/doc/org.eclipse.cdt.doc.user/tasks/

'R3_0_5_patches'>R3_0_5_patches This repo has moved to: https://github.com/eclipse-jeetools/webtools.javaeeLinux User
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcbridgha2009-02-25 05:55:48 +0000
committercbridgha2009-02-25 05:55:48 +0000
commit1eb6375753926f8e56b4b473ad4e87d67b9bf656 (patch)
tree1ff1703a36e50b7fe1c522533c42d371ff09246d
parent3eac5697d4c5bec3a9185b8e65e4383fede0bcde (diff)
downloadwebtools.javaee-200902250600.tar.gz
webtools.javaee-200902250600.tar.xz
webtools.javaee-200902250600.zip
This commit was manufactured by cvs2svn to create tag 'v200902250600'.v200902250600
Diffstat
-rw-r--r--features/org.eclipse.jst.enterprise_ui.feature.patch/.cvsignore2
-rw-r--r--features/org.eclipse.jst.enterprise_ui.feature.patch/.project17
-rw-r--r--features/org.eclipse.jst.enterprise_ui.feature.patch/build.properties5
-rw-r--r--features/org.eclipse.jst.enterprise_ui.feature.patch/buildnotes_org.eclipse.jst.enterprise_ui.feature.patch.html19
-rw-r--r--features/org.eclipse.jst.enterprise_ui.feature.patch/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--features/org.eclipse.jst.enterprise_ui.feature.patch/epl-v10.html328
-rw-r--r--features/org.eclipse.jst.enterprise_ui.feature.patch/feature.properties149
-rw-r--r--features/org.eclipse.jst.enterprise_ui.feature.patch/feature.xml31
-rw-r--r--features/org.eclipse.jst.enterprise_ui.feature.patch/license.html93
-rw-r--r--features/org.eclipse.jst.web_core.feature.patch/.cvsignore2
-rw-r--r--features/org.eclipse.jst.web_core.feature.patch/.project17
-rw-r--r--features/org.eclipse.jst.web_core.feature.patch/build.properties5
-rw-r--r--features/org.eclipse.jst.web_core.feature.patch/buildnotes_org.eclipse.jst.web_core.feature.patch.html16
-rw-r--r--features/org.eclipse.jst.web_core.feature.patch/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--features/org.eclipse.jst.web_core.feature.patch/epl-v10.html262
-rw-r--r--features/org.eclipse.jst.web_core.feature.patch/feature.properties147
-rw-r--r--features/org.eclipse.jst.web_core.feature.patch/feature.xml31
-rw-r--r--features/org.eclipse.jst.web_core.feature.patch/license.html93
-rw-r--r--plugins/org.eclipse.jem.proxy/.classpath13
-rw-r--r--plugins/org.eclipse.jem.proxy/.cvsignore9
-rw-r--r--plugins/org.eclipse.jem.proxy/.options9
-rw-r--r--plugins/org.eclipse.jem.proxy/.project28
-rw-r--r--plugins/org.eclipse.jem.proxy/.settings/org.eclipse.core.resources.prefs4
-rw-r--r--plugins/org.eclipse.jem.proxy/.settings/org.eclipse.jdt.core.prefs292
-rw-r--r--plugins/org.eclipse.jem.proxy/.settings/org.eclipse.jdt.ui.prefs8
-rw-r--r--plugins/org.eclipse.jem.proxy/.settings/org.eclipse.pde.core.prefs3
-rw-r--r--plugins/org.eclipse.jem.proxy/META-INF/MANIFEST.MF28
-rw-r--r--plugins/org.eclipse.jem.proxy/about.html25
-rw-r--r--plugins/org.eclipse.jem.proxy/build.properties31
-rw-r--r--plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/ArrayArguments.java136
-rw-r--r--plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/Block.java113
-rw-r--r--plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/BooleanLiteral.java63
-rw-r--r--plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/CannotProcessArrayTypesException.java29
-rw-r--r--plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/CannotProcessInnerClassesException.java29
-rw-r--r--plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/Cast.java173
-rw-r--r--plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/CharLiteral.java114
-rw-r--r--plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/Constructor.java339
-rw-r--r--plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/EvaluationException.java46
-rw-r--r--plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/Expression.java130
-rw-r--r--plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/Field.java146
-rw-r--r--plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/IParserConstants.java51
-rw-r--r--plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/InitializationStringEvaluationException.java34
-rw-r--r--plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/InitializationStringParser.java300
-rw-r--r--plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/Message.java224
-rw-r--r--plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/MessageArgument.java123
-rw-r--r--plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/NullLiteral.java59
-rw-r--r--plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/NumberLiteral.java171
-rw-r--r--plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/PrimitiveOperation.java113
-rw-r--r--plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/ProxyInitParserMessages.java46
-rw-r--r--plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/Statement.java201
-rw-r--r--plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/Static.java305
-rw-r--r--plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/StringLiteral.java142
-rw-r--r--plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/messages.properties24
-rw-r--r--plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/tree/AbstractEnum.java73
-rw-r--r--plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/tree/Enum.java37
-rw-r--r--plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/tree/ExpressionProcesser.java3364
-rw-r--r--plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/tree/ForExpression.java213
-rw-r--r--plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/tree/IExpressionConstants.java26
-rw-r--r--plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/tree/InfixOperator.java212
-rw-r--r--plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/tree/InitparserTreeMessages.java43
-rw-r--r--plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/tree/InternalConditionalOperandType.java70
-rw-r--r--plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/tree/InternalExpressionProxy.java77
-rw-r--r--plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/tree/InternalExpressionTypes.java303
-rw-r--r--plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/tree/InternalIfElseOperandType.java60
-rw-r--r--plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/tree/InternalInfixOperandType.java63
-rw-r--r--plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/tree/NoExpressionValueException.java87
-rw-r--r--plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/tree/PrefixOperator.java77
-rw-r--r--plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/tree/VariableReference.java58
-rw-r--r--plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/tree/messages.properties29
-rw-r--r--plugins/org.eclipse.jem.proxy/plugin.properties21
-rw-r--r--plugins/org.eclipse.jem.proxy/plugin.xml21
-rw-r--r--plugins/org.eclipse.jem.proxy/proxy.jars4
-rw-r--r--plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/awt/IStandardAwtBeanProxyFactory.java48
-rw-r--r--plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/awt/JavaStandardAwtBeanConstants.java254
-rw-r--r--plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/BaseProxyFactoryRegistry.java89
-rw-r--r--plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/CollectionBeanProxyWrapper.java137
-rw-r--r--plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/ConfigurationContributorAdapter.java51
-rw-r--r--plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/ContainerPathContributionMapping.java196
-rw-r--r--plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/ContributorExtensionPointInfo.java42
-rw-r--r--plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/EnumerationBeanProxyWrapper.java77
-rw-r--r--plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/Expression.java2546
-rw-r--r--plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/ExpressionProxy.java349
-rw-r--r--plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IAccessibleObjectProxy.java39
-rw-r--r--plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IArrayBeanProxy.java92
-rw-r--r--plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IArrayBeanTypeProxy.java41
-rw-r--r--plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IBeanProxy.java80
-rw-r--r--plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IBeanProxyFactory.java49
-rw-r--r--plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IBeanTypeExpressionProxy.java32
-rw-r--r--plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IBeanTypeProxy.java319
-rw-r--r--plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IBeanTypeProxyFactory.java31
-rw-r--r--plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IBooleanBeanProxy.java31
-rw-r--r--plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/ICallback.java152
-rw-r--r--plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/ICallbackRegistry.java75
-rw-r--r--plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/ICharacterBeanProxy.java35
-rw-r--r--plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IConfigurationContributionController.java172
-rw-r--r--plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IConfigurationContributionInfo.java164
-rw-r--r--plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IConfigurationContributor.java76
-rw-r--r--plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IConstructorProxy.java42
-rw-r--r--plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IDimensionBeanProxy.java34
-rw-r--r--plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IExpression.java1009
-rw-r--r--plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IExtensionRegistration.java42
-rw-r--r--plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IFieldProxy.java45
-rw-r--r--plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IIntegerBeanProxy.java29
-rw-r--r--plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IInvokable.java83
-rw-r--r--plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IMethodProxy.java52
-rw-r--r--plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IMethodProxyFactory.java83
-rw-r--r--plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/INumberBeanProxy.java59
-rw-r--r--plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IPDEContributeClasspath.java49
-rw-r--r--plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IPointBeanProxy.java33
-rw-r--r--plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IProxy.java48
-rw-r--r--plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IProxyBeanType.java85
-rw-r--r--plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IProxyConstants.java69
-rw-r--r--plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IProxyField.java25
-rw-r--r--plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IProxyMethod.java26
-rw-r--r--plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IRectangleBeanProxy.java43
-rw-r--r--plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IStandardBeanProxyFactory.java202
-rw-r--r--plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IStandardBeanTypeProxyFactory.java168
-rw-r--r--plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IStringBeanProxy.java30
-rw-r--r--plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IUIRunner.java40
-rw-r--r--plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IteratorBeanProxyWrapper.java84
-rw-r--r--plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/JavaStandardBeanProxyConstants.java347
-rw-r--r--plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/ListBeanProxyWrapper.java111
-rw-r--r--plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/ListIteratorBeanProxyWrapper.java84
-rw-r--r--plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/ListenerList.java195
-rw-r--r--plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/MapJNITypes.java72
-rw-r--r--plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/PDEContributeClasspath.java126
-rw-r--r--plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/PDEContributeClasspathInstance.java52
-rw-r--r--plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/PDEProcessForPlugin.java72
-rw-r--r--plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/ProxyFactoryRegistry.java327
-rw-r--r--plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/ProxyFindSupport.java209
-rw-r--r--plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/ProxyLaunchSupport.java871
-rw-r--r--plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/ProxyMessages.java48
-rw-r--r--plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/ProxyPlugin.java1371
-rw-r--r--plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/ThrowableProxy.java73
-rw-r--r--plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/UIRunner.java105
-rw-r--r--plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/messages.properties49
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyCommon/org/eclipse/jem/internal/proxy/common/AmbiguousMethodException.java33
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyCommon/org/eclipse/jem/internal/proxy/common/CommandException.java50
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyCommon/org/eclipse/jem/internal/proxy/common/GenericEventQueue.java146
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyCommon/org/eclipse/jem/internal/proxy/common/ICallback.java30
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyCommon/org/eclipse/jem/internal/proxy/common/ICallbackHandler.java101
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyCommon/org/eclipse/jem/internal/proxy/common/ICallbackRunnable.java28
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyCommon/org/eclipse/jem/internal/proxy/common/ICommandException.java20
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyCommon/org/eclipse/jem/internal/proxy/common/IVMCallbackServer.java48
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyCommon/org/eclipse/jem/internal/proxy/common/IVMServer.java50
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyCommon/org/eclipse/jem/internal/proxy/common/MapTypes.java159
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyCommon/org/eclipse/jem/internal/proxy/common/Messages.java41
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyCommon/org/eclipse/jem/internal/proxy/common/MethodHelper.java272
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyCommon/org/eclipse/jem/internal/proxy/common/UnresolvedCompilationError.java47
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyCommon/org/eclipse/jem/internal/proxy/common/messages.properties11
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/BeanProxyValueSender.java96
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/DebugModeHelper.java365
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/IREMBeanProxy.java63
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/IREMBeanTypeProxy.java42
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/IREMBeanTypeProxyFactory.java85
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/IREMConnection.java106
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/IREMConstantBeanProxy.java25
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/IREMConstantBeanTypeProxy.java32
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/IREMExpressionConnection.java182
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/IREMMethodProxy.java34
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/IREMSpecialBeanTypeProxy.java32
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/LocalFileConfigurationContributorController.java314
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/LocalProxyLaunchDelegate.java475
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/MessageDialog.java331
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/ProxyRemoteMessages.java55
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/ProxyRemoteUtil.java61
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMAbstractBeanProxy.java134
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMAbstractBeanTypeProxy.java703
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMAbstractNumberBeanTypeProxy.java72
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMAccessibleObjectProxy.java53
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMAnAbstractBeanTypeProxy.java75
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMArrayBeanProxy.java268
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMArrayBeanTypeProxy.java340
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMBeanProxy.java39
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMBeanTypeProxy.java66
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMBigDecimalBeanProxy.java45
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMBigDecimalBeanTypeProxy.java73
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMBigIntegerBeanProxy.java45
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMBigIntegerBeanTypeProxy.java75
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMBooleanClassBeanProxy.java96
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMBooleanClassBeanTypeProxy.java93
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMBooleanTypeBeanProxy.java104
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMBooleanTypeBeanTypeProxy.java69
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMByteClassBeanProxy.java45
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMByteClassBeanTypeProxy.java85
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMByteTypeBeanProxy.java133
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMByteTypeBeanTypeProxy.java110
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMCallbackInputStream.java146
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMCallbackRegistry.java185
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMCallbackThread.java327
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMCharacterClassBeanProxy.java150
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMCharacterClassBeanTypeProxy.java85
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMCharacterTypeBeanProxy.java155
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMCharacterTypeBeanTypeProxy.java66
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMClassBeanTypeProxy.java75
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMConnection.java342
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMConstantBeanProxy.java100
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMConstructorProxy.java109
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMConstructorTypeProxy.java67
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMDoubleClassBeanProxy.java44
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMDoubleClassBeanTypeProxy.java73
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMDoubleTypeBeanProxy.java133
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMDoubleTypeBeanTypeProxy.java98
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMExpression.java1864
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMFieldProxy.java106
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMFieldTypeProxy.java67
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMFloatClassBeanProxy.java44
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMFloatClassBeanTypeProxy.java74
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMFloatTypeBeanProxy.java131
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMFloatTypeBeanTypeProxy.java98
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMInitErrorBeanTypeProxy.java469
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMIntegerClassBeanProxy.java49
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMIntegerClassBeanTypeProxy.java85
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMIntegerTypeBeanProxy.java132
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMIntegerTypeBeanTypeProxy.java111
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMInterfaceBeanTypeProxy.java72
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMInvokable.java233
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMLongClassBeanProxy.java44
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMLongClassBeanTypeProxy.java87
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMLongTypeBeanProxy.java131
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMLongTypeBeanTypeProxy.java115
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMMasterServerThread.java172
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMMethodProxy.java276
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMMethodProxyFactory.java305
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMMethodTypeProxy.java67
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMNumberBeanProxy.java106
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMPrimitiveBeanTypeProxy.java234
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMProxyConstants.java679
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMProxyFactoryRegistry.java476
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMRegistryController.java198
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMShortClassBeanProxy.java44
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMShortClassBeanTypeProxy.java84
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMShortTypeBeanProxy.java132
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMShortTypeBeanTypeProxy.java109
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMStandardBeanProxyConstants.java514
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMStandardBeanProxyFactory.java854
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMStandardBeanTypeProxyFactory.java690
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMStringBeanProxy.java83
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMStringBeanTypeProxy.java124
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMThrowableBeanProxy.java214
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMThrowableBeanTypeProxy.java68
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMVoidBeanTypeProxy.java83
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/awt/REMDimensionBeanProxy.java68
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/awt/REMDimensionBeanTypeProxy.java67
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/awt/REMPointBeanProxy.java71
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/awt/REMPointBeanTypeProxy.java67
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/awt/REMRectangleBeanProxy.java120
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/awt/REMRectangleBeanTypeProxy.java67
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/awt/REMRegisterAWT.java38
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/awt/REMStandardAWTBeanProxyFactory.java74
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/awt/REMStandardAWTBeanTypeProxyFactory.java82
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/messages.properties67
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEAccessibleObjectProxy.java56
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEArrayBeanProxy.java322
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEArrayBeanTypeProxy.java326
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEBeanProxy.java101
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEBeanTypeProxy.java451
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEBigDecimalBeanTypeProxy.java38
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEBigIntegerBeanTypeProxy.java40
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEBooleanBeanProxy.java45
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEBooleanBeanTypeProxy.java46
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEBooleanClassBeanTypeProxy.java49
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEBooleanTypeBeanTypeProxy.java59
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEByteClassBeanTypeProxy.java32
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEByteTypeBeanTypeProxy.java36
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDECallbackRegistry.java150
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDECharTypeBeanTypeProxy.java39
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDECharacterBeanProxy.java84
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDECharacterClassBeanTypeProxy.java30
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEClassBeanTypeProxy.java63
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEConstructorProxy.java119
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEConstructorTypeProxy.java35
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEDoubleClassBeanTypeProxy.java32
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEDoubleTypeBeanTypeProxy.java37
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEExpression.java1077
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEExtensionBeanTypeProxyFactory.java28
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEFieldProxy.java96
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEFieldTypeProxy.java33
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEFloatClassBeanTypeProxy.java30
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEFloatTypeBeanTypeProxy.java40
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEInitErrorBeanTypeProxy.java260
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEIntegerBeanProxy.java38
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEIntegerClassBeanTypeProxy.java57
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEIntegerTypeBeanTypeProxy.java69
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDELongClassBeanTypeProxy.java32
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDELongTypeBeanTypeProxy.java41
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEMethodProxy.java191
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEMethodProxyFactory.java337
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEMethodTypeProxy.java35
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDENumberBeanProxy.java107
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDENumberBeanTypeProxy.java51
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEObjectBeanProxy.java65
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEPrimitiveBeanTypeProxy.java36
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEProxyFactoryRegistry.java205
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDERegistration.java154
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEShortClassBeanTypeProxy.java28
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEShortTypeBeanTypeProxy.java36
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEStandardBeanProxyFactory.java262
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEStandardBeanTypeProxyFactory.java465
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEStringBeanProxy.java40
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEStringBeanTypeProxy.java49
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEThrowableProxy.java100
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEVMServer.java83
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IIDEBeanProxy.java29
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/awt/IDEDimensionBeanProxy.java51
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/awt/IDEDimensionBeanTypeProxy.java46
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/awt/IDEPointBeanProxy.java51
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/awt/IDEPointBeanTypeProxy.java44
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/awt/IDERectangleBeanProxy.java73
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/awt/IDERectangleBeanTypeProxy.java45
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/awt/IDERegisterAWT.java29
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/awt/IDEStandardAWTBeanProxyFactory.java47
-rw-r--r--plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/awt/IDEStandardAWTBeanTypeProxyFactory.java85
-rw-r--r--plugins/org.eclipse.jem.proxy/remoteCommon/org/eclipse/jem/internal/proxy/common/remote/CommandErrorException.java76
-rw-r--r--plugins/org.eclipse.jem.proxy/remoteCommon/org/eclipse/jem/internal/proxy/common/remote/Commands.java1450
-rw-r--r--plugins/org.eclipse.jem.proxy/remoteCommon/org/eclipse/jem/internal/proxy/common/remote/ExpressionCommands.java345
-rw-r--r--plugins/org.eclipse.jem.proxy/remoteCommon/org/eclipse/jem/internal/proxy/common/remote/IOCommandException.java60
-rw-r--r--plugins/org.eclipse.jem.proxy/remoteCommon/org/eclipse/jem/internal/proxy/common/remote/TransmitableArray.java36
-rw-r--r--plugins/org.eclipse.jem.proxy/remoteCommon/org/eclipse/jem/internal/proxy/common/remote/UnexpectedCommandException.java72
-rw-r--r--plugins/org.eclipse.jem.proxy/remoteCommon/org/eclipse/jem/internal/proxy/common/remote/UnexpectedExceptionCommandException.java67
-rw-r--r--plugins/org.eclipse.jem.proxy/schema/contributors.exsd149
-rw-r--r--plugins/org.eclipse.jem.proxy/schema/extensions.exsd157
-rw-r--r--plugins/org.eclipse.jem.proxy/vm_remotevm/org/eclipse/jem/internal/proxy/vm/remote/AWTStarter.java35
-rw-r--r--plugins/org.eclipse.jem.proxy/vm_remotevm/org/eclipse/jem/internal/proxy/vm/remote/ArrayHelper.java118
-rw-r--r--plugins/org.eclipse.jem.proxy/vm_remotevm/org/eclipse/jem/internal/proxy/vm/remote/CallbackHandler.java181
-rw-r--r--plugins/org.eclipse.jem.proxy/vm_remotevm/org/eclipse/jem/internal/proxy/vm/remote/CallbackOutputStream.java155
-rw-r--r--plugins/org.eclipse.jem.proxy/vm_remotevm/org/eclipse/jem/internal/proxy/vm/remote/ClassHelper.java48
-rw-r--r--plugins/org.eclipse.jem.proxy/vm_remotevm/org/eclipse/jem/internal/proxy/vm/remote/ConnectionHandler.java950
-rw-r--r--plugins/org.eclipse.jem.proxy/vm_remotevm/org/eclipse/jem/internal/proxy/vm/remote/ConnectionThread.java53
-rw-r--r--plugins/org.eclipse.jem.proxy/vm_remotevm/org/eclipse/jem/internal/proxy/vm/remote/ExpressionProcesserController.java809
-rw-r--r--plugins/org.eclipse.jem.proxy/vm_remotevm/org/eclipse/jem/internal/proxy/vm/remote/IdentityMap.java96
-rw-r--r--plugins/org.eclipse.jem.proxy/vm_remotevm/org/eclipse/jem/internal/proxy/vm/remote/RemoteVMApplication.java45
-rw-r--r--plugins/org.eclipse.jem.proxy/vm_remotevm/org/eclipse/jem/internal/proxy/vm/remote/RemoteVMServerThread.java717
-rw-r--r--plugins/org.eclipse.jem.proxy/vm_remotevm/org/eclipse/jem/internal/proxy/vm/remote/StackTraceUtility.java32
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/.classpath8
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/.cvsignore8
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/.project29
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/.settings/org.eclipse.jdt.core.prefs62
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/.settings/org.eclipse.jdt.ui.prefs3
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/META-INF/MANIFEST.MF76
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/about.html34
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/build.properties22
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/20_cmpbean_obj.gifbin632 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/adown.gifbin826 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/appclientgroup_obj.gifbin578 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/arrow_down.gifbin78 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/arrowp.gifbin70 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/cascade_left.gifbin981 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/cascade_left2.gifbin1094 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/cascade_right.gifbin1129 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/cmp.gifbin581 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/connectorgroup_obj.gifbin355 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/deadend.gifbin865 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/ear-wiz-banner.gifbin3213 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/ear-wiz-icon.gifbin605 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/ear.gifbin592 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/eargroup_obj.gifbin596 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/ejbgroup_obj.gifbin569 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/folder.gifbin216 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/clcl16/ejb_client_remove_action_obj.gifbin603 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/clcl16/ejb_deploy_action_obj.gifbin571 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/appclient_export.gifbin356 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/appclient_import_wiz.gifbin358 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/ejbclientjar_wiz.gifbin1044 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/export_ear.gifbin607 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/export_ejbjar_wiz.gifbin563 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/export_rar.gifbin346 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/exportwar_wiz.gifbin581 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/import_ear.gifbin595 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/import_ejbjar.gifbin565 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/import_rar.gifbin347 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/importwar_wiz.gifbin580 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/newappclient_wiz.gifbin364 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/newconnectionprj_wiz.gifbin585 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/newear_wiz.gifbin605 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/newejbprj_wiz.gifbin587 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/newwar_wiz.gifbin1039 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/re_execute.gifbin565 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/cview16/j2ee_perspective.gifbin345 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/cview16/j2ee_view.gifbin345 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/dlcl16/ejb_client_remove_action_obj.gifbin375 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/dlcl16/ejb_deploy_action_obj.gifbin356 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/13_ear_obj.gifbin632 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/21_cmpbean_obj.gifbin628 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/21_ejb_obj.gifbin1041 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/21_ejbjar_wiz.gifbin631 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/annotation_positioned_overlay.gifbin83 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/appclient_14.gifbin590 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/appclient_14_deploy.gifbin615 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/extwebserviceitemprovider_obj.gifbin599 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/home_interface_positioned_overlay.gifbin122 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/library_obj.gifbin338 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/local_home_interface_positioned_overlay.gifbin125 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/local_interface_positioned_overlay.gifbin77 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/remote_interface_positioned_overlay.gifbin91 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/service_interface_positioned_overlay.gifbin77 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/webServiceItemProvider_obj.gifbin563 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/webServicesFolder_obj.gifbin604 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/webapp_14.gifbin590 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/webapp_deploy.gifbin364 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/annotation_bean_overlay.gifbin62 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/annotation_positioned_overlay.gifbin83 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/client_app_ovr.gifbin166 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/connector_ovr.gifbin166 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/dis_annotation_bean_overlay.gifbin111 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/ejb_module_ovr.gifbin167 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/enterprise_app_ovr.gifbin112 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/externalWebServiceOverlay_obj.gifbin82 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/home_interface_overlay_obj.gifbin106 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/home_interface_positioned_overlay.gifbin122 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/key_interf_ov.gifbin81 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/local_home_interface_overlay_obj.gifbin108 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/local_home_interface_positioned_overlay.gifbin125 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/local_interface_overlay_obj.gifbin64 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/local_interface_positioned_overlay.gifbin77 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/remote_interface_overlay_obj.gifbin77 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/remote_interface_positioned_overlay.gifbin91 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/service_interface_overlay_obj.gifbin66 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/service_interface_positioned_overlay.gifbin77 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/web_module_ovr.gifbin273 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/add_mess_dest_wiz_ban.gifbin2812 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/add_web_service_handler_wiz.gifbin3496 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/addauthoritycontraints_wiz_.gifbin3577 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/addcmpfiled_wiz_ban.gifbin3434 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/addcontextparameter_wiz_ban.gifbin2900 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/addenvirentry_wiz_ban.gifbin3368 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/adderrorcodeerror_wiz_ban.g.gifbin3374 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/addexceptionerrorpage_wiz_ban.gifbin2687 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/addfiltermapping_wiz_ban.gifbin3011 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/addhandlersoapheader_wiz_ba.gifbin3249 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/addjsppropgropu_wiz_ban.gifbin2904 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/addlocencodingmap_wiz_ban.gifbin3095 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/addmimemapping_wiz_ban.gifbin2960 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/addservletmapping_wiz_ban.gifbin3352 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/addtaglibref_wiz_ban.gifbin3385 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/addwebSecuritycontraint_wiz.gifbin2904 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/addwebrescollection_wiz_ban.gifbin3536 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/addwebsecurityroleref_wiz_b.gifbin3129 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/addwelcomepage_wiz_ban.gifbin3469 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/appclient_wiz.gifbin2940 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/connection_migration_wizard_wiz.gifbin3771 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/connector_wiz.gifbin2982 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/ear_wiz.gifbin3213 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/ejbclientjar_wizban.gifbin3415 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/ejbproject_wiz.gifbin3091 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/export_appclient_wiz.gifbin2992 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/export_ear_wiz.gifbin3189 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/export_ejbjar_obj.gifbin3487 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/export_rar_wiz.gifbin3374 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/export_war_wiz.gifbin3574 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/import_appclient_wiz.gifbin2978 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/import_class_file_wiz_ban.gifbin3303 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/import_ear_wiz.gifbin3360 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/import_ejbjar_wiz.gifbin3533 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/import_rar_wiz.gifbin3520 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/import_war_wiz.gifbin3598 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/init_param_wiz_ban.gifbin2988 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/mdb_2_1_jms_creation_wiz.gifbin3163 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/mdb_2_1_non_jms_creation_wi.gifbin3163 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/newservlet_wiz.gifbin3180 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/versionmigrate3_wiz.gifbin3313 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/war_wiz.gifbin3526 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/web_library_project_wiz_ban.gifbin3554 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/jar_obj.gifbin579 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/jcu_obj.gifbin569 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/key_interf_ov.gifbin81 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/left_arrow.gifbin981 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/right_arrow.gifbin956 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/servlet.gifbin588 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/sessionBean_obj.gifbin583 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/showerr_tsk.gifbin339 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/showwarn_tsk.gifbin338 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/srvce_elem_obj.gifbin569 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/util-wiz-banner.gifbin2938 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/util-wiz-icon.gifbin338 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/webgroup_obj.gifbin573 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/webservicedesc.gifbin563 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/icons/wsdl.gifbin563 -> 0 bytes
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/common/jdt/internal/integration/ui/WTPUIWorkingCopyManager.java474
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/AddModulestoEARPropertiesPage.java1357
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/AvailableJ2EEComponentsForEARContentProvider.java297
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ClassHelperAdapterFactory.java48
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ClasspathTableManager.java647
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/IClasspathTableOwner.java37
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ICommonManifestUIConstants.java46
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/IJ2EEDependenciesControl.java58
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/J2EEComponentProjectMigrator.java643
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/J2EEDependenciesPage.java237
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/J2EEPropertiesConstants.java58
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/JARDependencyPropertiesPage.java1099
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ManifestErrorPrompter.java54
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ManifestUIResourceHandler.java64
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/SecondCheckBoxStateChangedEvent.java34
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/UpdateManifestOperation.java83
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/WebLibDependencyPropertiesPage.java274
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/WebRefDependencyPropertiesPage.java103
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/WorkspaceModifyComposedOperation.java50
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/AbstractActionDelegate.java225
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/AbstractActionWithDelegate.java69
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/AbstractOpenAction.java122
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/AbstractOpenWizardAction.java147
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/AbstractOpenWizardWorkbenchAction.java61
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/BaseAction.java122
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/ComponentEditorInput.java54
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/ForceClasspathUpdateAction.java66
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/IJ2EEUIContextIds.java62
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/ImportClassesAction.java63
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/J2EEDeleteAction.java419
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/J2EEDeleteModuleActionPopulator.java47
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/J2EEDeployAction.java164
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/J2EEModuleRenameChange.java147
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/J2EERenameAction.java391
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/J2EERenameParticipant.java95
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/J2EERenameResourceAction.java67
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/J2EEResourceOpenListener.java56
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/NewAppClientComponentAction.java48
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/NewEARComponentAction.java48
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/NewJavaEEArtifactDropDownAction.java41
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/NewJavaEEDropDownAction.java303
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/NewJavaEEProjectDropDownAction.java41
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/OpenJ2EEResourceAction.java414
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/WTPBaseAction.java122
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/WorkspaceModifyComposedOperation.java44
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/classpathdep/ui/ClasspathDependencyAttributeConfiguration.java109
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/classpathdep/ui/ClasspathDependencyAttributeConfiguration.properties13
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/classpathdep/ui/ClasspathDependencyValidatorMarkerResolutions.java187
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/classpathdep/ui/ClasspathDependencyValidatorMarkerResolutions.properties15
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/classpathdep/ui/ClasspathNonDependencyAttributeConfiguration.java98
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/classpathdep/ui/ClasspathNonDependencyAttributeConfiguration.properties12
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/client/actions/AppClientArchiveUIResourceHandler.java59
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/client/actions/ExportApplicationClientAction.java51
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/client/actions/ImportApplicationClientAction.java56
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/command/AbstractOverrideCommand.java97
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/command/J2EEClipboard.java83
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/command/J2EECompoundCommand.java191
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/command/J2EECopyCommand.java81
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/command/J2EECopyFromClipboardCommand.java96
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/command/J2EECopyToClipboardOverrideCommand.java84
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/command/J2EEPasteFromClipboardOverrideCommand.java150
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/command/J2EERemoveOverrideCommand.java170
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/command/J2EEStrictCompoundCommand.java99
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/deployables/EnterpriseDeployableArtifactAdapterFactory.java38
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/deployables/EnterpriseModuleArtifact.java43
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/deployables/J2EEDeployableAdapterFactory.java50
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/ChangeLibDirDialog.java60
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/DeleteEARComposite.java270
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/DeleteEARDialog.java66
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/DeleteModuleComposite.java127
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/DeleteModuleDialog.java50
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/DeleteModuleReferencesComposite.java85
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/DependencyConflictResolveDialog.java64
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/FilteredFileSelectionDialog.java75
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/J2EEDeleteDialog.java50
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/J2EEDeleteUIConstants.java29
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/J2EEDeployStatusDialog.java334
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/J2EEDeployUIConstants.java23
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/J2EERenameDialog.java51
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/J2EERenameUIConstants.java27
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/ListMessageDialog.java211
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/RenameEARComposite.java265
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/RenameEARDialog.java60
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/RenameModuleComposite.java181
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/RenameModuleDialog.java65
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/RenameModuleReferencesComposite.java88
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/RuntimeSelectionDialog.java128
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/TwoArrayQuickSorter.java126
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/TypeJavaSearchScope.java352
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/TypeSearchEngine.java65
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/TypedFileViewerFilter.java72
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ear/actions/ArchiveEARUIResourceHandler.java59
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ear/actions/EARImportListContentProvider.java72
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ear/actions/ExportEARAction.java52
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ear/actions/ImportEARAction.java55
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ear/actions/ModulesProvider.java138
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/AbstractMethodsContentProvider.java316
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/BeanClassProviderHelper.java57
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/EJBUIMessages.java31
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/ExcludeListContentProvider.java140
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/GroupedEJBItemProvider.java46
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/GroupedEJBJarItemProvider.java376
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/GroupedEntityItemProvider.java37
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/GroupedMessageItemProvider.java38
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/GroupedSessionItemProvider.java37
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/HomeInterfaceProviderHelper.java60
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/J2EEContainerManagedEntityItemProvider.java46
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/J2EEEjbItemProviderAdapterFactory.java80
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/J2EEEntityItemProvider.java43
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/J2EEJavaClassProviderHelper.java146
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/J2EEMessageDrivenItemProvider.java40
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/J2EEReferenceProviderHelper.java49
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/J2EESessionItemProvider.java54
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/LocalHomeInterfaceProviderHelper.java58
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/LocalInterfaceProviderHelper.java58
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/MethodPermissionsContentProvider.java129
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/MethodTransactionContentProvider.java117
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/PrimaryKeyClassProviderHelper.java61
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/RemoteInterfaceProviderHelper.java60
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/ServiceEndpointInterfaceProviderHelper.java65
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/listeners/IValidateEditListener.java43
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/listeners/ValidateEditListener.java330
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/perspective/J2EEPerspective.java130
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/plugin/BinaryEditorUtilities.java240
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/plugin/CommonEditorUtility.java120
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/plugin/ErrorDialog.java192
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/plugin/FacetedProjectActionFilter.java108
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/plugin/FacetedProjectAdapterFactory.java40
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/plugin/J2EEEditorUtility.java196
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/plugin/J2EEUIAdapterFactory.java56
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/plugin/J2EEUIContextIds.java30
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/plugin/J2EEUIMessages.java243
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/plugin/J2EEUIPlugin.java343
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/plugin/J2EEUIPluginIcons.java55
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/plugin/J2EEViewerSorter.java53
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/plugin/UIProjectUtilities.java154
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/provider/J2EEAdapterFactoryContentProvider.java131
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/provider/J2EEAdapterFactoryLabelProvider.java101
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/provider/J2EEApplicationItemProvider.java193
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/provider/J2EEApplicationItemProviderAdapterFactory.java34
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/provider/J2EEBinaryModulesItemProvider.java34
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/provider/J2EEEditingDomain.java152
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/provider/J2EEModulemapItemProviderAdapterFactory.java32
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/provider/J2EEProviderUtility.java38
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/provider/J2EEUIEditingDomain.java73
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/provider/J2EEUtilityJarItemProvider.java304
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/provider/J2EEUtilityJavaProjectsItemProvider.java54
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/provider/MethodsProviderDelegate.java119
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/provider/ModulesItemProvider.java287
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/provider/UtilityModuleProjectItemProvider.java52
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ui/DoubleCheckboxTableItem.java113
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ui/DoubleCheckboxTableViewer.java181
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ui/J2EEPropertiesPage.java176
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ui/refactoring/ContextRootInputPage.java86
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ui/refactoring/RenameContextRootChange.java124
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ui/refactoring/RenameContextRootRefactoringProcessor.java121
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ui/refactoring/RenameContextRootWizard.java43
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ui/util/AnnotationIconDecorator.java119
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ui/util/BinaryProjectUIHelper.java44
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/war/ui/util/J2EEWebAppItemProvider.java337
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/war/ui/util/J2EEWebItemProviderAdapterFactory.java49
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/war/ui/util/WebContextParamGroupItemProvider.java71
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/war/ui/util/WebErrorPageGroupItemProvider.java71
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/war/ui/util/WebFilterMappingGroupItemProvider.java80
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/war/ui/util/WebFiltersGroupItemProvider.java84
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/war/ui/util/WebGroupItemProvider.java100
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/war/ui/util/WebListenerGroupItemProvider.java84
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/war/ui/util/WebReferencesGroupItemProvider.java119
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/war/ui/util/WebSecurityGroupItemProvider.java98
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/war/ui/util/WebServletGroupItemProvider.java81
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/war/ui/util/WebServletMappingGroupItemProvider.java92
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/war/ui/util/WebWelcomeFileGroupItemProvider.java75
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/wizard/AnnotationsStandaloneGroup.java113
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/wizard/AppClientComponentExportWizard.java76
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/wizard/AppClientComponentImportPage.java81
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/wizard/AppClientComponentImportWizard.java85
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/wizard/AppClientExportPage.java81
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/wizard/AvailableJarsProvider.java248
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/wizard/AvailableUtilJarsAndWebLibProvider.java163
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/wizard/AvailableUtilityJarsProvider.java162
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/wizard/ClassesImportWizard.java177
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/wizard/DefaultJ2EEComponentCreationWizard.java87
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/wizard/EARComponentExportPage.java93
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/wizard/EARComponentExportWizard.java78
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/wizard/EARComponentImportOptionsPage.java320
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/wizard/EARComponentImportPage.java130
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/wizard/EARComponentImportWizard.java111
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/wizard/EARComponentProjectsPage.java298
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/wizard/EARImportListContentProvider.java107
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/wizard/EARLibrariesContainerPage.java67
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/wizard/EARValidationHelper.java92
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/wizard/ImportUtil.java216
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/wizard/J2EEArtifactExportWizard.java172
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/wizard/J2EEArtifactImportWizard.java227
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/wizard/J2EEComponentFacetCreationWizardPage.java118
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/wizard/J2EEComponentImportWizard.java76
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/wizard/J2EEComponentLabelProvider.java91
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/wizard/J2EEExportPage.java556
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/wizard/J2EEImportPage.java282
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/wizard/J2EEModuleExportPage.java42
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/wizard/J2EEModuleFacetInstallPage.java118
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/wizard/J2EEModuleFacetInstallPage.properties1
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/wizard/J2EEModuleImportPage.java102
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/wizard/J2EEUtilityJarImportPageNew.java410
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/wizard/J2EEUtilityJarImportTypePageNew.java375
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/wizard/J2EEUtilityJarImportWizardNew.java95
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/wizard/MinimizedFileSystemElement.java131
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/wizard/NewJ2EEComponentSelectionPage.java524
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/wizard/NewJavaClassOptionsWizardPage.java401
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/wizard/NewJavaClassWizardPage.java700
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/wizard/PackageNameResolver.java70
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/wizard/ServerTargetComboHelper.java76
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/wizard/ServerTargetUIHelper.java129
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/wizard/StringArrayTableWizardSection.java543
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/wizard/TableObjects.java42
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/wizard/WizardClassesImportMainPage.java135
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/wizard/WizardClassesImportPage1.java1418
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/wizard/earlibraries.properties2
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/ui/archive/IArchiveExportParticipantPanelFactory.java38
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/ui/archive/internal/ArchiveExportParticipantPanelsExtensionPoint.java119
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/ui/project/facet/EarFacetInstallPage.java381
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/ui/project/facet/EarFacetInstallPage.properties14
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/ui/project/facet/EarProjectFirstPage.java39
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/ui/project/facet/EarProjectWizard.java72
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/ui/project/facet/EarSelectionPanel.java143
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/ui/project/facet/EarSelectionPanel.properties15
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/ui/project/facet/RuntimeMismatchMarkerResolutions.java188
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/ui/project/facet/RuntimeMismatchMarkerResolutions.properties13
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/ui/project/facet/UtilityFacetInstallPage.java51
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/ui/project/facet/UtilityFacetInstallPage.properties12
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/ui/project/facet/UtilityProjectFirstPage.java41
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/ui/project/facet/UtilityProjectWizard.java68
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/ui/project/facet/appclient/AppClientFacetInstallPage.java74
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/ui/project/facet/appclient/AppClientProjectFirstPage.java35
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/ui/project/facet/appclient/AppClientProjectWizard.java64
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/javadoc.xml6
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/plugin.properties40
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/plugin.xml794
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/prepareforpii.xml38
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/property_files/UtilityFacetInstallPage.properties12
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/property_files/ejb_figures.properties18
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/property_files/ejb_ui.properties47
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/property_files/j2ee_ejb_ui.properties15
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/property_files/j2ee_ui.properties357
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/property_files/jca_ui.properties23
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/property_files/manifest_ui.properties48
-rw-r--r--plugins/org.eclipse.jst.j2ee.ui/schema/archiveExportParticipantPanels.exsd127
726 files changed, 0 insertions, 87398 deletions
diff --git a/features/org.eclipse.jst.enterprise_ui.feature.patch/.cvsignore b/features/org.eclipse.jst.enterprise_ui.feature.patch/.cvsignore
deleted file mode 100644
index dda1b8f60..000000000
--- a/features/org.eclipse.jst.enterprise_ui.feature.patch/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-build.xml
-org.eclipse.jst.enterprise_ui.feature.patch_*.jar
diff --git a/features/org.eclipse.jst.enterprise_ui.feature.patch/.project b/features/org.eclipse.jst.enterprise_ui.feature.patch/.project
deleted file mode 100644
index 02a716add..000000000
--- a/features/org.eclipse.jst.enterprise_ui.feature.patch/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jst.enterprise_ui.feature.patch R3_0_1_patches</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/features/org.eclipse.jst.enterprise_ui.feature.patch/build.properties b/features/org.eclipse.jst.enterprise_ui.feature.patch/build.properties
deleted file mode 100644
index cb50260a9..000000000
--- a/features/org.eclipse.jst.enterprise_ui.feature.patch/build.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-bin.includes = feature.xml,\
- license.html,\
- feature.properties,\
- epl-v10.html,\
- eclipse_update_120.jpg
diff --git a/features/org.eclipse.jst.enterprise_ui.feature.patch/buildnotes_org.eclipse.jst.enterprise_ui.feature.patch.html b/features/org.eclipse.jst.enterprise_ui.feature.patch/buildnotes_org.eclipse.jst.enterprise_ui.feature.patch.html
deleted file mode 100644
index a085bae8d..000000000
--- a/features/org.eclipse.jst.enterprise_ui.feature.patch/buildnotes_org.eclipse.jst.enterprise_ui.feature.patch.html
+++ /dev/null
@@ -1,19 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<meta name="Build" content="Build">
-<title>WTP 3.0.3 Patches</title>
-</head>
-
-<body>
-
-<h1>WTP 3.0.3 Patches</h1>
-
-<p>Bug <a
- href='https://bugs.eclipse.org/bugs/show_bug.cgi?id=255537'>255537</a>.
-ClassCastException from Java EE Module Dependencies Properties Page</p>
-
-</body>
-</html> \ No newline at end of file
diff --git a/features/org.eclipse.jst.enterprise_ui.feature.patch/eclipse_update_120.jpg b/features/org.eclipse.jst.enterprise_ui.feature.patch/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad..000000000
--- a/features/org.eclipse.jst.enterprise_ui.feature.patch/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/features/org.eclipse.jst.enterprise_ui.feature.patch/epl-v10.html b/features/org.eclipse.jst.enterprise_ui.feature.patch/epl-v10.html
deleted file mode 100644
index ed4b19665..000000000
--- a/features/org.eclipse.jst.enterprise_ui.feature.patch/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<html xmlns:o="urn:schemas-microsoft-com:office:office"
-xmlns:w="urn:schemas-microsoft-com:office:word"
-xmlns="http://www.w3.org/TR/REC-html40">
-
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
-<meta name=ProgId content=Word.Document>
-<meta name=Generator content="Microsoft Word 9">
-<meta name=Originator content="Microsoft Word 9">
-<link rel=File-List
-href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
-<title>Eclipse Public License - Version 1.0</title>
-<!--[if gte mso 9]><xml>
- <o:DocumentProperties>
- <o:Revision>2</o:Revision>
- <o:TotalTime>3</o:TotalTime>
- <o:Created>2004-03-05T23:03:00Z</o:Created>
- <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
- <o:Pages>4</o:Pages>
- <o:Words>1626</o:Words>
- <o:Characters>9270</o:Characters>
- <o:Lines>77</o:Lines>
- <o:Paragraphs>18</o:Paragraphs>
- <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
- <o:Version>9.4402</o:Version>
- </o:DocumentProperties>
-</xml><![endif]--><!--[if gte mso 9]><xml>
- <w:WordDocument>
- <w:TrackRevisions/>
- </w:WordDocument>
-</xml><![endif]-->
-<style>
-<!--
- /* Font Definitions */
-@font-face
- {font-family:Tahoma;
- panose-1:2 11 6 4 3 5 4 4 2 4;
- mso-font-charset:0;
- mso-generic-font-family:swiss;
- mso-font-pitch:variable;
- mso-font-signature:553679495 -2147483648 8 0 66047 0;}
- /* Style Definitions */
-p.MsoNormal, li.MsoNormal, div.MsoNormal
- {mso-style-parent:"";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p
- {margin-right:0in;
- mso-margin-top-alt:auto;
- mso-margin-bottom-alt:auto;
- margin-left:0in;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p.BalloonText, li.BalloonText, div.BalloonText
- {mso-style-name:"Balloon Text";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:8.0pt;
- font-family:Tahoma;
- mso-fareast-font-family:"Times New Roman";}
-@page Section1
- {size:8.5in 11.0in;
- margin:1.0in 1.25in 1.0in 1.25in;
- mso-header-margin:.5in;
- mso-footer-margin:.5in;
- mso-paper-source:0;}
-div.Section1
- {page:Section1;}
--->
-</style>
-</head>
-
-<body lang=EN-US style='tab-interval:.5in'>
-
-<div class=Section1>
-
-<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
-</p>
-
-<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
-THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
-REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
-OF THIS AGREEMENT.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-in the case of the initial Contributor, the initial code and documentation
-distributed under this Agreement, and<br clear=left>
-b) in the case of each subsequent Contributor:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-changes to the Program, and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-additions to the Program;</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>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. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
-entity that distributes the Program.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; 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. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
-distributed in accordance with this Agreement.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
-receives the Program under this Agreement, including all Contributors.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-Subject to the terms of this Agreement, each Contributor hereby grants Recipient
-a non-exclusive, worldwide, royalty-free copyright license to<span
-style='color:red'> </span>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.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-Subject to the terms of this Agreement, each Contributor hereby grants
-Recipient a non-exclusive, worldwide,<span style='color:green'> </span>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. </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>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.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>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. </span></p>
-
-<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
-Program in object code form under its own license agreement, provided that:</span>
-</p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it complies with the terms and conditions of this Agreement; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-its license agreement:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>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; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-effectively excludes on behalf of all Contributors all liability for damages,
-including direct, indirect, special, incidental and consequential damages, such
-as lost profits; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
-states that any provisions which differ from this Agreement are offered by that
-Contributor alone and not by any other party; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>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.<span style='color:blue'> </span></span></p>
-
-<p><span style='font-size:10.0pt'>When the Program is made available in source
-code form:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it must be made available under this Agreement; and </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
-copy of this Agreement must be included with each copy of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
-copyright notices contained within the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>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. </span></p>
-
-<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
-
-<p><span style='font-size:10.0pt'>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 (&quot;Commercial
-Contributor&quot;) hereby agrees to defend and indemnify every other
-Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
-costs (collectively &quot;Losses&quot;) 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.</span> </p>
-
-<p><span style='font-size:10.0pt'>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.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; 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. </span></p>
-
-<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>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.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
-
-<p><span style='font-size:10.0pt'>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.</span> </p>
-
-<p><span style='font-size:10.0pt'>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. </span></p>
-
-<p><span style='font-size:10.0pt'>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. </span></p>
-
-<p><span style='font-size:10.0pt'>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.</span> </p>
-
-<p><span style='font-size:10.0pt'>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.</span> </p>
-
-<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
-
-</div>
-
-</body>
-
-</html> \ No newline at end of file
diff --git a/features/org.eclipse.jst.enterprise_ui.feature.patch/feature.properties b/features/org.eclipse.jst.enterprise_ui.feature.patch/feature.properties
deleted file mode 100644
index e40684dec..000000000
--- a/features/org.eclipse.jst.enterprise_ui.feature.patch/feature.properties
+++ /dev/null
@@ -1,149 +0,0 @@
-###############################################################################
-# Copyright (c) 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
-###############################################################################
-# feature.properties
-# contains externalized strings for feature.xml
-# "%foo" in feature.xml corresponds to the key "foo" in this file
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file should be translated.
-
-# "featureName" property - name of the feature
-featureName=WTP Patches for org.eclipse.jst.enterprise_ui.feature
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse.org
-
-# "updateSiteName" property - label for the update site
-updateSiteName=The Eclipse Web Tools Platform (WTP) Project update site
-
-# "description" property - description of the feature
-description=\n\
-\n\
-The fixes are described in the following bugzilla entries:\n\
-\n\
-Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=255537 ClassCastException from Java EE Module Dependencies Properties Page\n\
-\n\
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2008 IBM Corporation and others.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- IBM Corporation - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-licenseURL=license.html
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-license=\
-ECLIPSE FOUNDATION SOFTWARE USER AGREEMENT\n\
-August, 2008\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 Eclipse Foundation\n\
-is provided to you under the terms and conditions of the Eclipse Public\n\
-License Version 1.0 ("EPL"). A copy of the EPL is provided with this\n\
-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.org CVS\n\
-repository ("Repository") in CVS 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? 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\
-Features may also include other Features ("Included Features"). Files named\n\
-"feature.xml" may contain a list of the names and version numbers of\n\
-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\
-Eclipse Update Manager, you must agree to a license ("Feature Update\n\
-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". Such Abouts,\n\
-Feature Licenses and Feature Update Licenses contain the terms and\n\
-conditions (or references to such terms and conditions) that govern your\n\
-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\
- - 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\
- - IBM Public License 1.0 (available at http://oss.software.ibm.com/developerworks/opensource/license10.html)\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\
-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,\n\
-and re-export of encryption software, to see if this is permitted.\n\
-\n\
-Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.\n
-########### end of license property ##########################################
diff --git a/features/org.eclipse.jst.enterprise_ui.feature.patch/feature.xml b/features/org.eclipse.jst.enterprise_ui.feature.patch/feature.xml
deleted file mode 100644
index 87c8650b2..000000000
--- a/features/org.eclipse.jst.enterprise_ui.feature.patch/feature.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jst.enterprise_ui.feature.patch"
- label="%featureName"
- version="3.0.3.qualifier"
- provider-name="%providerName">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="%licenseURL">
- %license
- </license>
-
- <requires>
- <import feature="org.eclipse.jst.enterprise_ui.feature" version="3.0.3.v200810010400-7Y7BFSrEPOwQPnUuwhYV60NEQtTn" patch="true"/>
- </requires>
-
- <plugin
- id="org.eclipse.jst.j2ee.ui"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
-</feature>
diff --git a/features/org.eclipse.jst.enterprise_ui.feature.patch/license.html b/features/org.eclipse.jst.enterprise_ui.feature.patch/license.html
deleted file mode 100644
index 2347060ef..000000000
--- a/features/org.eclipse.jst.enterprise_ui.feature.patch/license.html
+++ /dev/null
@@ -1,93 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
-<!-- saved from url=(0044)http://www.eclipse.org/legal/epl/notice.html -->
-<HTML><HEAD><TITLE>Eclipse.org Software User Agreement</TITLE>
-<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<META content="MSHTML 6.00.2800.1479" name=GENERATOR></HEAD>
-<BODY lang=EN-US vLink=purple link=blue>
-<H2>Eclipse Foundation Software User Agreement</H2>
-<P>January 28, 2005</P>
-<H3>Usage Of Content</H3>
-<P>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.</P>
-<H3>Applicable Licenses</H3>
-<P>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 <A
-href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-<P>Content includes, but is not limited to, source code, object code,
-documentation and other files maintained in the Eclipse.org CVS repository
-("Repository") in CVS modules ("Modules") and made available as downloadable
-archives ("Downloads").</P>
-<P>Content may be apportioned into plug-ins ("Plug-ins"), plug-in fragments
-("Fragments"), and features ("Features"). A Feature is a bundle of one or more
-Plug-ins and/or Fragments and associated material. Files named "feature.xml" may
-contain a list of the names and version numbers of the Plug-ins and/or Fragments
-associated with a Feature. Plug-ins and Fragments are located in directories
-named "plugins" and Features are located in directories named "features".</P>
-<P>Features may also include other Features ("Included Features"). Files named
-"feature.xml" may contain a list of the names and version numbers of Included
-Features.</P>
-<P>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:</P>
-<UL>
- <LI>The top-level (root) directory
- <LI>Plug-in and Fragment directories
- <LI>Subdirectories of the directory named "src" of certain Plug-ins
- <LI>Feature directories </LI></UL>
-<P>Note: if a Feature made available by the Eclipse Foundation is installed
-using the Eclipse Update Manager, 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". 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.</P>
-<P>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):</P>
-<UL>
- <LI>Common Public License Version 1.0 (available at <A
- href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</A>)
-
- <LI>Apache Software License 1.1 (available at <A
- href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</A>)
-
- <LI>Apache Software License 2.0 (available at <A
- href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</A>)
-
- <LI>IBM Public License 1.0 (available at <A
- href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</A>)
-
- <LI>Metro Link Public License 1.00 (available at <A
- href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</A>)
-
- <LI>Mozilla Public License Version 1.1 (available at <A
- href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</A>)
- </LI></UL>
-<P>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.</P>
-<H3>Cryptography</H3>
-<P>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.</P></BODY></HTML>
diff --git a/features/org.eclipse.jst.web_core.feature.patch/.cvsignore b/features/org.eclipse.jst.web_core.feature.patch/.cvsignore
deleted file mode 100644
index b1d6d303a..000000000
--- a/features/org.eclipse.jst.web_core.feature.patch/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-build.xml
-feature.temp.folder
diff --git a/features/org.eclipse.jst.web_core.feature.patch/.project b/features/org.eclipse.jst.web_core.feature.patch/.project
deleted file mode 100644
index 6edda4614..000000000
--- a/features/org.eclipse.jst.web_core.feature.patch/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jst.web_core.feature.patch-hold</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/features/org.eclipse.jst.web_core.feature.patch/build.properties b/features/org.eclipse.jst.web_core.feature.patch/build.properties
deleted file mode 100644
index cb50260a9..000000000
--- a/features/org.eclipse.jst.web_core.feature.patch/build.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-bin.includes = feature.xml,\
- license.html,\
- feature.properties,\
- epl-v10.html,\
- eclipse_update_120.jpg
diff --git a/features/org.eclipse.jst.web_core.feature.patch/buildnotes_org.eclipse.jst.web_core.feature.patch.html b/features/org.eclipse.jst.web_core.feature.patch/buildnotes_org.eclipse.jst.web_core.feature.patch.html
deleted file mode 100644
index 2081c11b4..000000000
--- a/features/org.eclipse.jst.web_core.feature.patch/buildnotes_org.eclipse.jst.web_core.feature.patch.html
+++ /dev/null
@@ -1,16 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<meta name="Build" content="Build">
-<title>Web Tools Platform Patch Build Notes</title>
-</head>
-
-<body>
-
-<h1>WTP 3.0.4 Patches</h1>
-
-<p>Bug <a href='https://bugs.eclipse.org/265874'>265874</a>. JEM patch for a SocketTimeoutException </p>
-</body>
-</html> \ No newline at end of file
diff --git a/features/org.eclipse.jst.web_core.feature.patch/eclipse_update_120.jpg b/features/org.eclipse.jst.web_core.feature.patch/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad..000000000
--- a/features/org.eclipse.jst.web_core.feature.patch/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/features/org.eclipse.jst.web_core.feature.patch/epl-v10.html b/features/org.eclipse.jst.web_core.feature.patch/epl-v10.html
deleted file mode 100644
index e06ad62c2..000000000
--- a/features/org.eclipse.jst.web_core.feature.patch/epl-v10.html
+++ /dev/null
@@ -1,262 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
-<title>Eclipse Public License - Version 1.0</title>
-<style type="text/css">
- body {
- size: 8.5in 11.0in;
- margin: 0.25in 0.5in 0.25in 0.5in;
- tab-interval: 0.5in;
- }
- p {
- margin-left: auto;
- margin-top: 0.5em;
- margin-bottom: 0.5em;
- }
- p.list {
- margin-left: 0.5in;
- margin-top: 0.05em;
- margin-bottom: 0.05em;
- }
- </style>
-
-</head>
-
-<body lang="EN-US">
-
-<p align=center><b>Eclipse Public License - v 1.0</b></p>
-
-<p>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE
-PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE, REPRODUCTION OR
-DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS
-AGREEMENT.</p>
-
-<p><b>1. DEFINITIONS</b></p>
-
-<p>&quot;Contribution&quot; means:</p>
-
-<p class="list">a) in the case of the initial Contributor, the initial
-code and documentation distributed under this Agreement, and</p>
-<p class="list">b) in the case of each subsequent Contributor:</p>
-
-<p class="list">i) changes to the Program, and</p>
-<p class="list">ii) additions to the Program;</p>
-<p class="list">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.</p>
-
-<p>&quot;Contributor&quot; means any person or entity that distributes
-the Program.</p>
-
-<p>&quot;Licensed Patents&quot; 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.</p>
-
-<p>&quot;Program&quot; means the Contributions distributed in accordance
-with this Agreement.</p>
-
-<p>&quot;Recipient&quot; means anyone who receives the Program under
-this Agreement, including all Contributors.</p>
-
-<p><b>2. GRANT OF RIGHTS</b></p>
-
-<p class="list">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.</p>
-
-<p class="list">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.</p>
-
-<p class="list">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.</p>
-
-<p class="list">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.</p>
-
-<p><b>3. REQUIREMENTS</b></p>
-
-<p>A Contributor may choose to distribute the Program in object code
-form under its own license agreement, provided that:</p>
-
-<p class="list">a) it complies with the terms and conditions of this
-Agreement; and</p>
-
-<p class="list">b) its license agreement:</p>
-
-<p class="list">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;</p>
-
-<p class="list">ii) effectively excludes on behalf of all Contributors
-all liability for damages, including direct, indirect, special,
-incidental and consequential damages, such as lost profits;</p>
-
-<p class="list">iii) states that any provisions which differ from this
-Agreement are offered by that Contributor alone and not by any other
-party; and</p>
-
-<p class="list">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.</p>
-
-<p>When the Program is made available in source code form:</p>
-
-<p class="list">a) it must be made available under this Agreement; and</p>
-
-<p class="list">b) a copy of this Agreement must be included with each
-copy of the Program.</p>
-
-<p>Contributors may not remove or alter any copyright notices contained
-within the Program.</p>
-
-<p>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.</p>
-
-<p><b>4. COMMERCIAL DISTRIBUTION</b></p>
-
-<p>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
-(&quot;Commercial Contributor&quot;) hereby agrees to defend and
-indemnify every other Contributor (&quot;Indemnified Contributor&quot;)
-against any losses, damages and costs (collectively &quot;Losses&quot;)
-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.</p>
-
-<p>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.</p>
-
-<p><b>5. NO WARRANTY</b></p>
-
-<p>EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS
-PROVIDED ON AN &quot;AS IS&quot; 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.</p>
-
-<p><b>6. DISCLAIMER OF LIABILITY</b></p>
-
-<p>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.</p>
-
-<p><b>7. GENERAL</b></p>
-
-<p>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.</p>
-
-<p>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.</p>
-
-<p>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.</p>
-
-<p>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.</p>
-
-<p>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.</p>
-
-</body>
-
-</html>
diff --git a/features/org.eclipse.jst.web_core.feature.patch/feature.properties b/features/org.eclipse.jst.web_core.feature.patch/feature.properties
deleted file mode 100644
index f013faa35..000000000
--- a/features/org.eclipse.jst.web_core.feature.patch/feature.properties
+++ /dev/null
@@ -1,147 +0,0 @@
-###############################################################################
-# Copyright (c) 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
-###############################################################################
-# feature.properties
-# contains externalized strings for feature.xml
-# "%foo" in feature.xml corresponds to the key "foo" in this file
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file should be translated.
-
-# "featureName" property - name of the feature
-featureName=WTP Patches for org.eclipse.jst.web_core.feature
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse.org
-
-# "updateSiteName" property - label for the update site
-updateSiteName=The Eclipse Web Tools Platform (WTP) Project update site
-
-# "description" property - description of the feature
-description=\
-The bugs and fixes are described in the following bugzilla entries:\n\
-\n\
-Bug https://bugs.eclipse.org/265874 JJEM patch for a SocketTimeoutException\n\
-\n\
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2008 IBM Corporation and others.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- IBM Corporation - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-licenseURL=license.html
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-license=\
-ECLIPSE FOUNDATION SOFTWARE USER AGREEMENT\n\
-August, 2008\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 Eclipse Foundation\n\
-is provided to you under the terms and conditions of the Eclipse Public\n\
-License Version 1.0 ("EPL"). A copy of the EPL is provided with this\n\
-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.org CVS\n\
-repository ("Repository") in CVS 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? 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\
-Features may also include other Features ("Included Features"). Files named\n\
-"feature.xml" may contain a list of the names and version numbers of\n\
-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\
-Eclipse Update Manager, you must agree to a license ("Feature Update\n\
-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". Such Abouts,\n\
-Feature Licenses and Feature Update Licenses contain the terms and\n\
-conditions (or references to such terms and conditions) that govern your\n\
-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\
- - 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\
- - IBM Public License 1.0 (available at http://oss.software.ibm.com/developerworks/opensource/license10.html)\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\
-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,\n\
-and re-export of encryption software, to see if this is permitted.\n\
-\n\
-Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.\n
-########### end of license property ##########################################
diff --git a/features/org.eclipse.jst.web_core.feature.patch/feature.xml b/features/org.eclipse.jst.web_core.feature.patch/feature.xml
deleted file mode 100644
index 1e61a8750..000000000
--- a/features/org.eclipse.jst.web_core.feature.patch/feature.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jst.web_core.feature.patch"
- label="%featureName"
- version="3.0.4.qualifier"
- provider-name="%providerName">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="%licenseURL">
- %license
- </license>
-
- <requires>
- <import feature="org.eclipse.jst.web_core.feature" version="3.0.4.v200811260650-7Q7AEf1EHhHehNmEARhS7t" patch="true"/>
- </requires>
-
- <plugin
- id="org.eclipse.jem.proxy"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
-</feature>
diff --git a/features/org.eclipse.jst.web_core.feature.patch/license.html b/features/org.eclipse.jst.web_core.feature.patch/license.html
deleted file mode 100644
index 2347060ef..000000000
--- a/features/org.eclipse.jst.web_core.feature.patch/license.html
+++ /dev/null
@@ -1,93 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
-<!-- saved from url=(0044)http://www.eclipse.org/legal/epl/notice.html -->
-<HTML><HEAD><TITLE>Eclipse.org Software User Agreement</TITLE>
-<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<META content="MSHTML 6.00.2800.1479" name=GENERATOR></HEAD>
-<BODY lang=EN-US vLink=purple link=blue>
-<H2>Eclipse Foundation Software User Agreement</H2>
-<P>January 28, 2005</P>
-<H3>Usage Of Content</H3>
-<P>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.</P>
-<H3>Applicable Licenses</H3>
-<P>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 <A
-href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-<P>Content includes, but is not limited to, source code, object code,
-documentation and other files maintained in the Eclipse.org CVS repository
-("Repository") in CVS modules ("Modules") and made available as downloadable
-archives ("Downloads").</P>
-<P>Content may be apportioned into plug-ins ("Plug-ins"), plug-in fragments
-("Fragments"), and features ("Features"). A Feature is a bundle of one or more
-Plug-ins and/or Fragments and associated material. Files named "feature.xml" may
-contain a list of the names and version numbers of the Plug-ins and/or Fragments
-associated with a Feature. Plug-ins and Fragments are located in directories
-named "plugins" and Features are located in directories named "features".</P>
-<P>Features may also include other Features ("Included Features"). Files named
-"feature.xml" may contain a list of the names and version numbers of Included
-Features.</P>
-<P>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:</P>
-<UL>
- <LI>The top-level (root) directory
- <LI>Plug-in and Fragment directories
- <LI>Subdirectories of the directory named "src" of certain Plug-ins
- <LI>Feature directories </LI></UL>
-<P>Note: if a Feature made available by the Eclipse Foundation is installed
-using the Eclipse Update Manager, 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". 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.</P>
-<P>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):</P>
-<UL>
- <LI>Common Public License Version 1.0 (available at <A
- href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</A>)
-
- <LI>Apache Software License 1.1 (available at <A
- href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</A>)
-
- <LI>Apache Software License 2.0 (available at <A
- href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</A>)
-
- <LI>IBM Public License 1.0 (available at <A
- href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</A>)
-
- <LI>Metro Link Public License 1.00 (available at <A
- href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</A>)
-
- <LI>Mozilla Public License Version 1.1 (available at <A
- href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</A>)
- </LI></UL>
-<P>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.</P>
-<H3>Cryptography</H3>
-<P>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.</P></BODY></HTML>
diff --git a/plugins/org.eclipse.jem.proxy/.classpath b/plugins/org.eclipse.jem.proxy/.classpath
deleted file mode 100644
index 4dae10245..000000000
--- a/plugins/org.eclipse.jem.proxy/.classpath
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="proxyCommon"/>
- <classpathentry kind="src" path="initParser"/>
- <classpathentry kind="src" path="remoteCommon"/>
- <classpathentry kind="src" output="vm_bin" path="vm_remotevm"/>
- <classpathentry kind="src" path="proxy"/>
- <classpathentry kind="src" path="proxyRemote"/>
- <classpathentry kind="src" path="proxyide"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/plugins/org.eclipse.jem.proxy/.cvsignore b/plugins/org.eclipse.jem.proxy/.cvsignore
deleted file mode 100644
index 205e09f8b..000000000
--- a/plugins/org.eclipse.jem.proxy/.cvsignore
+++ /dev/null
@@ -1,9 +0,0 @@
-bin
-build.xml
-common_bin
-vm_bin
-javaCompiler.vm_remotevm.jar.args
-javaCompiler...args
-@dot
-org.eclipse.jem.proxy_2.0.100.200806031304.jar
-vm
diff --git a/plugins/org.eclipse.jem.proxy/.options b/plugins/org.eclipse.jem.proxy/.options
deleted file mode 100644
index 95c080f85..000000000
--- a/plugins/org.eclipse.jem.proxy/.options
+++ /dev/null
@@ -1,9 +0,0 @@
-org.eclipse.jem.proxy/remote/debug/debugvm=false
-org.eclipse.jem.proxy/remote/debug/ioconsole=false
-org.eclipse.jem.proxy/remote/debug/vmtraceout=false
-org.eclipse.jem.proxy/remote/debug/notimeouts=false
-org.eclipse.jem.proxy/debug/traceexpressions=false
-org.eclipse.jem.proxy/debug/traceexpressionstimethreshold=100
-org.eclipse.jem.proxy/debug/logtrace=default
-org.eclipse.jem.proxy/debug/logtracefile=default
-org.eclipse.jem.proxy/debug/loglevel=default \ No newline at end of file
diff --git a/plugins/org.eclipse.jem.proxy/.project b/plugins/org.eclipse.jem.proxy/.project
deleted file mode 100644
index 0f334e31a..000000000
--- a/plugins/org.eclipse.jem.proxy/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jem.proxy</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/plugins/org.eclipse.jem.proxy/.settings/org.eclipse.core.resources.prefs b/plugins/org.eclipse.jem.proxy/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index b7d372579..000000000
--- a/plugins/org.eclipse.jem.proxy/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,4 +0,0 @@
-#Sun Apr 15 21:15:15 EDT 2007
-eclipse.preferences.version=1
-encoding//proxyCommon/org/eclipse/jem/internal/proxy/common/messages.properties=8859_1
-encoding/<project>=ISO-8859-1
diff --git a/plugins/org.eclipse.jem.proxy/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.jem.proxy/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 97edd2d25..000000000
--- a/plugins/org.eclipse.jem.proxy/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,292 +0,0 @@
-#Mon Mar 12 17:19:57 EDT 2007
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
-org.eclipse.jdt.core.compiler.compliance=1.4
-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=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-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=ignore
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=error
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=error
-org.eclipse.jdt.core.compiler.problem.unusedLocal=error
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.3
-org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
-org.eclipse.jdt.core.formatter.alignment_for_assignment=0
-org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
-org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
-org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
-org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
-org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
-org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
-org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
-org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
-org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
-org.eclipse.jdt.core.formatter.blank_lines_after_package=1
-org.eclipse.jdt.core.formatter.blank_lines_before_field=1
-org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=1
-org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
-org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
-org.eclipse.jdt.core.formatter.blank_lines_before_method=1
-org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
-org.eclipse.jdt.core.formatter.blank_lines_before_package=0
-org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
-org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
-org.eclipse.jdt.core.formatter.comment.format_header=false
-org.eclipse.jdt.core.formatter.comment.format_html=true
-org.eclipse.jdt.core.formatter.comment.format_source_code=true
-org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
-org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
-org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
-org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
-org.eclipse.jdt.core.formatter.comment.line_length=150
-org.eclipse.jdt.core.formatter.compact_else_if=true
-org.eclipse.jdt.core.formatter.continuation_indentation=2
-org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
-org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
-org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
-org.eclipse.jdt.core.formatter.indent_empty_lines=false
-org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
-org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
-org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
-org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true
-org.eclipse.jdt.core.formatter.indentation.size=4
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
-org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
-org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
-org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
-org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
-org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
-org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
-org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
-org.eclipse.jdt.core.formatter.lineSplit=150
-org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
-org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
-org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
-org.eclipse.jdt.core.formatter.tabulation.char=tab
-org.eclipse.jdt.core.formatter.tabulation.size=4
-org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
diff --git a/plugins/org.eclipse.jem.proxy/.settings/org.eclipse.jdt.ui.prefs b/plugins/org.eclipse.jem.proxy/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index 855e13665..000000000
--- a/plugins/org.eclipse.jem.proxy/.settings/org.eclipse.jdt.ui.prefs
+++ /dev/null
@@ -1,8 +0,0 @@
-#Tue Feb 21 10:09:18 EST 2006
-eclipse.preferences.version=1
-formatter_profile=_jve
-formatter_settings_version=10
-org.eclipse.jdt.ui.ignorelowercasenames=true
-org.eclipse.jdt.ui.importorder=java;javax;org;org.eclipse.wtp;org.eclipse.jem;org.eclipse.ve.internal.cdm;org.eclipse.ve.internal.cde;org.eclipse.ve.internal.jcm;org.eclipse.ve.internal.java;org.eclipse.ve;com;
-org.eclipse.jdt.ui.ondemandthreshold=3
-org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8"?><templates/>
diff --git a/plugins/org.eclipse.jem.proxy/.settings/org.eclipse.pde.core.prefs b/plugins/org.eclipse.jem.proxy/.settings/org.eclipse.pde.core.prefs
deleted file mode 100644
index 78eace43b..000000000
--- a/plugins/org.eclipse.jem.proxy/.settings/org.eclipse.pde.core.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Thu Jun 16 11:08:13 EDT 2005
-eclipse.preferences.version=1
-selfhosting.binExcludes=/org.eclipse.jem.proxy/vm_bin
diff --git a/plugins/org.eclipse.jem.proxy/META-INF/MANIFEST.MF b/plugins/org.eclipse.jem.proxy/META-INF/MANIFEST.MF
deleted file mode 100644
index 668cf6472..000000000
--- a/plugins/org.eclipse.jem.proxy/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,28 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.jem.proxy; singleton:=true
-Bundle-Version: 2.0.101.qualifier
-Bundle-Activator: org.eclipse.jem.internal.proxy.core.ProxyPlugin
-Bundle-Vendor: %providerName
-Bundle-Localization: plugin
-Export-Package: org.eclipse.jem.internal.proxy.awt,
- org.eclipse.jem.internal.proxy.common,
- org.eclipse.jem.internal.proxy.common.remote,
- org.eclipse.jem.internal.proxy.core,
- org.eclipse.jem.internal.proxy.ide,
- org.eclipse.jem.internal.proxy.ide.awt,
- org.eclipse.jem.internal.proxy.initParser,
- org.eclipse.jem.internal.proxy.initParser.tree,
- org.eclipse.jem.internal.proxy.remote,
- org.eclipse.jem.internal.proxy.remote.awt,
- org.eclipse.jem.internal.proxy.vm.remote
-Require-Bundle: org.eclipse.jdt.launching;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.jdt.core;bundle-version="[3.3.0,4.0.0)",
- org.eclipse.debug.core;bundle-version="[3.3.0,4.0.0)",
- org.eclipse.jem.util;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.pde.core;bundle-version="[3.3.0,4.0.0)";resolution:=optional,
- org.eclipse.core.runtime;bundle-version="[3.3.0,4.0.0)",
- org.eclipse.ui;bundle-version="[3.3.0,4.0.0)";resolution:=optional
-Eclipse-LazyStart: true
-Bundle-RequiredExecutionEnvironment: J2SE-1.4
diff --git a/plugins/org.eclipse.jem.proxy/about.html b/plugins/org.eclipse.jem.proxy/about.html
deleted file mode 100644
index 5acea59c7..000000000
--- a/plugins/org.eclipse.jem.proxy/about.html
+++ /dev/null
@@ -1,25 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html><head><title>About</title>
-
-
-
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"></head><body lang="EN-US">
-<h2>About This Content</h2>
-
-<P>June, 2008</P>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party (&quot;Redistributor&quot;) 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 <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
-
-</body></html> \ No newline at end of file
diff --git a/plugins/org.eclipse.jem.proxy/build.properties b/plugins/org.eclipse.jem.proxy/build.properties
deleted file mode 100644
index b449a7a33..000000000
--- a/plugins/org.eclipse.jem.proxy/build.properties
+++ /dev/null
@@ -1,31 +0,0 @@
-###############################################################################
-# Copyright (c) 2003, 2005 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
-###############################################################################
-bin.includes = plugin.xml,\
- plugin.properties,\
- vm/remotevm.jar,\
- .options,\
- about.html,\
- META-INF/,\
- .
-src.includes = about.html,\
- schema/,\
- proxy.jars
-jars.compile.order = .,\
- vm/remotevm.jar
-source.vm/remotevm.jar = vm_remotevm/
-output.vm/remotevm.jar = vm_bin/
-output.. = bin/
-source.. = proxyCommon/,\
- initParser/,\
- remoteCommon/,\
- proxy/,\
- proxyRemote/,\
- proxyide/
diff --git a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/ArrayArguments.java b/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/ArrayArguments.java
deleted file mode 100644
index 05dd886a1..000000000
--- a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/ArrayArguments.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.initParser;
-/*
-
-
- */
-
-import java.io.StringWriter;
-import java.lang.reflect.Array;
-import java.util.*;
-/**
- * This represents the arguments in a multi dimensional array with construction parameters, e.g.
- * new int[][] { { 2 ,3 } , { 4 ,5 }}
- * the arguments of the constructor will be instance of ArrayArguments
- */
-public class ArrayArguments extends Expression {
-
- Static fType;
- List arguments = new ArrayList(2);
- boolean argsClosed;
- boolean insideArgsOpenedParen;
- boolean insideArgsClosedParen;
-
-public Expression push(char[] token, char tokenDelimiter) {
-
- // If the args are opened and a token was supplied then it must be an argument
- //if ( argsOpened && ( tokenDelimiter == DelimiterCloseParen || tokenDelimiter == DelimiterComma ||
- //tokenDelimiter == DelimiterSpace || tokenDelimiter == DelimiterQuote || tokenDelimiter == DelimiterPeriod)) {
- if (!argsClosed){
- if ( arguments.size() > 0 ){
- Expression openArgument = (Expression)arguments.get(arguments.size()-1);
- if ( !openArgument.isComplete() ) {
- openArgument.push(token,tokenDelimiter);
- // If the argument is complete and we received a ) then the message is complete
- if ( openArgument.isComplete() && tokenDelimiter == DelimiterCloseElipse){
- argsClosed = true;
- }
- return this;
- }
- }
-
- // We must have a new argument - process accordingly
- Expression newArgument = null;
- if (!insideArgsOpenedParen && tokenDelimiter == DelimiterOpenParen){
- insideArgsOpenedParen = true;
- newArgument = new Statement(fClassLoader).push(token,tokenDelimiter);
- newArgument = new MessageArgument(newArgument);
- arguments.add(newArgument);
-
- }
- if ( token.length > 0 || tokenDelimiter == DelimiterQuote || tokenDelimiter == DelimiterSingleQuote || tokenDelimiter == OperMinus ) {
- newArgument = new Statement(fClassLoader).push(token,tokenDelimiter);
- newArgument = new MessageArgument(newArgument);
- arguments.add(newArgument);
- }
- // If the token after the argument is a ) then the message is being closed
- if ( !insideArgsOpenedParen && tokenDelimiter == DelimiterCloseElipse ) {
- argsClosed = true;
- return this;
- }
- if ( insideArgsOpenedParen && tokenDelimiter == DelimiterCloseElipse ) {
- insideArgsClosedParen = true;
- argsClosed = true;
- return this;
- }
- }
- return this;
-}
-/**
- * In the case of the expression new int[][] { {2,3} , {4,5} } then we are the 2,3 or the 4,5
- * to evaluate we must return an array of ints based on our size. The type we return is determined by the initial
- * constructor who will have given this to us as our fType
- */
-public Object evaluate() throws Exception {
-
- Object result = Array.newInstance(fType.getPrimitiveTypeClass(),arguments.size());
- for (int i = 0; i < arguments.size(); i++) {
- Object argumentValue = ((Expression)arguments.get(i)).evaluate();
- Array.set(result,i,argumentValue);
- }
- return result;
-}
-
-public Class getTypeClass() throws Exception {
- return null;
-}
-
-public boolean isComplete() {
- return argsClosed;
-}
-
-public boolean isPrimitive() throws Exception {
- return false;
-}
-public void setType(Static type) {
- fType = type;
-}
-public void contributeArgumentNumber(List argumentNumberList){
-
- // Add the number of arguments we have to the list
- argumentNumberList.add(new Integer(arguments.size()));
- // If our arguments are themselves array arguments ( which will occur in an array of 3 or more dimensions )
- // then we should cascade this message to our argument so that the total array depth is known
- if ( arguments.size() > 0 ) {
- Object firstArgument = arguments.get(0);
- if ( firstArgument instanceof ArrayArguments ) {
-// ((ArrayArguments)firstArgument)contributeArgumentNumber(argumentNumberList);
- }
- }
-
-}
-public String toString(){
- StringWriter writer = new StringWriter();
- writer.write("Args("); //$NON-NLS-1$
- writer.write(new Integer(arguments.size()).toString());
- writer.write(")-"); //$NON-NLS-1$
- writer.write(arguments.toString());
- return writer.toString();
-}
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.initParser.Expression#getTypeClassName()
- */
- protected String getTypeClassName() {
- return ""; // Not applicable //$NON-NLS-1$
- }
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/Block.java b/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/Block.java
deleted file mode 100644
index 98c72fb68..000000000
--- a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/Block.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.initParser;
-/*
-
-
- */
-
-/**
- */
-public class Block extends Expression {
-
- protected boolean fIsClosed = false;
- protected boolean fIsComplete = false;
- protected boolean fMessageOrField = false;
-
- public Block(Expression anExpression){
- currentExpression = anExpression;
- }
-
- public Block(ClassLoader fClassLoader){
- currentExpression = new Statement(fClassLoader);
- }
-
- public Object evaluate() throws Exception {
- return currentExpression.evaluate();
- }
-
- public boolean isComplete() {
- return fIsComplete;
- }
-
- public Class getTypeClass() throws Exception {
- return currentExpression.getTypeClass();
- }
-
-
- public Expression push(char[] token, char tokenDelimiter) {
-
- // If we are closed (i.e. completed with a )) and we get a ) or , then we are all finished up
- // We should not forward this token to the expression, as it isComplete
- if ((fIsClosed || currentExpression.isComplete()) && (tokenDelimiter == DelimiterCloseParen || tokenDelimiter == DelimiterComma)){
- fIsComplete = true;
- return this;
- }
-
- // If we are a message of field and we get a ( we are message or a field otherwise
- if (fMessageOrField){
- fMessageOrField = false;
- // The problem now is that we are a block of an expression and we need to create a message
- // where we are the receiver. However we are on the stack and going to be popped when the message finishes
- // so we must alter ourself to be a block whose current expression is message whose argument
- // is a copy of us
- if ( tokenDelimiter == DelimiterOpenParen){
- Message message = new Message(currentExpression,token,fClassLoader);
- currentExpression = message;
- return message;
- } else {
- Field field = new Field(currentExpression,token,fClassLoader);
- currentExpression = field;
- return field;
- }
- }
-
- // If we are closed and we get a . then we must begin a message or field expression
- if (currentExpression.isComplete() && tokenDelimiter == DelimiterPeriod ){
- fMessageOrField = true;
- return this;
- }
-
- Expression result = currentExpression.push(token,tokenDelimiter);
- // If the result if a push then push the stack
- if ( result != currentExpression ) {
- pushExpressionStack(result);
- }
- // If our current expression is complete and we are receiving a close parent then we are closed
- if (currentExpression.isComplete() && tokenDelimiter == DelimiterCloseParen){
- fIsClosed = true;
-
- }
- // If we are here the current expression is still processing tokens so we should return it
- return currentExpression;
- }
-
- public boolean isPrimitive() throws Exception {
- return false;
- }
- public String toString(){
- StringBuffer buffer = new StringBuffer();
- buffer.append("Block("); //$NON-NLS-1$
- if ( currentExpression != null ) {
- buffer.append(currentExpression.toString());
- }
- buffer.append(')');
- return buffer.toString();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.initParser.Expression#getTypeClassName()
- */
- protected String getTypeClassName() {
- return currentExpression.getTypeClassName();
- }
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/BooleanLiteral.java b/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/BooleanLiteral.java
deleted file mode 100644
index e8a15f708..000000000
--- a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/BooleanLiteral.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.initParser;
-/*
-
-
- */
-
-
-public class BooleanLiteral extends Expression {
- public boolean value;
-public BooleanLiteral(boolean aValue){
-
- value = aValue;
-
-}
-
-public boolean isComplete(){
- return true;
-}
-/**
- * evaluate method comment.
- */
-public Object evaluate() {
- return new Boolean(value);
-}
-/**
- * evaluate method comment.
- */
-public Class getTypeClass(){
- return Boolean.TYPE;
-}
-/**
- * true or false cannot consume any kind of expression so we must return null
- */
-public Expression push(char[] token , char delimiter){
-
- return null;
-
-}
-
-/**
- * This is primitive
- */
-public boolean isPrimitive() {
- return true;
-}
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.initParser.Expression#getTypeClassName()
- */
- protected String getTypeClassName() {
- return Boolean.TYPE.getName();
- }
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/CannotProcessArrayTypesException.java b/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/CannotProcessArrayTypesException.java
deleted file mode 100644
index 5defcb9ec..000000000
--- a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/CannotProcessArrayTypesException.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.initParser;
-/*
-
-
- */
-
-/**
- * Exception to indicate that the initStringParser can't deal with arrays right now
- */
-public class CannotProcessArrayTypesException extends RuntimeException {
-
- /**
- * Comment for <code>serialVersionUID</code>
- *
- * @since 1.1.0
- */
- private static final long serialVersionUID = -4245984020065761634L;
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/CannotProcessInnerClassesException.java b/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/CannotProcessInnerClassesException.java
deleted file mode 100644
index 5cbecd1c2..000000000
--- a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/CannotProcessInnerClassesException.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.initParser;
-/*
-
-
- */
-
-/**
- * This exception is thrown to indicate that inner classes cannot be processed
- */
-public class CannotProcessInnerClassesException extends RuntimeException {
-
- /**
- * Comment for <code>serialVersionUID</code>
- *
- * @since 1.1.0
- */
- private static final long serialVersionUID = 8290504580738499445L;
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/Cast.java b/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/Cast.java
deleted file mode 100644
index ef70b80dd..000000000
--- a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/Cast.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.initParser;
-/*
-
-
- */
-
-
-import java.util.HashMap;
-
-public class Cast extends Expression {
- protected static final int BYTE_TYPE = 0;
- protected static final int SHORT_TYPE = 1;
- protected static final int INT_TYPE = 2;
- protected static final int LONG_TYPE = 3;
- protected static final int FLOAT_TYPE = 4;
- protected static final int DOUBLE_TYPE = 5;
-
- protected static final HashMap sTypeLookup;
- static {
- sTypeLookup = new HashMap(6);
- sTypeLookup.put(Byte.TYPE, new Integer(BYTE_TYPE));
- sTypeLookup.put(Short.TYPE, new Integer(SHORT_TYPE));
- sTypeLookup.put(Integer.TYPE, new Integer(INT_TYPE));
- sTypeLookup.put(Long.TYPE, new Integer(LONG_TYPE));
- sTypeLookup.put(Float.TYPE, new Integer(FLOAT_TYPE));
- sTypeLookup.put(Double.TYPE, new Integer(DOUBLE_TYPE));
- }
-
- protected Static fCastType;
- protected boolean fIsClosed = false;
-
- public Cast(Static castType, ClassLoader aClassLoader) {
- fCastType = castType;
- fClassLoader = aClassLoader;
- }
-
- public boolean isPrimitive() throws Exception {
- return getTypeClass().isPrimitive();
- }
-
- /**
- * The type of a Cast expression is the type of the cast type.
- */
- public Class getTypeClass() throws Exception {
- return fCastType.getTypeClass();
- }
-
-
- public boolean isComplete() {
- return currentExpression != null && currentExpression.isComplete();
- }
-
- /**
- * If the type is primitive, then we need to
- * convert the value, otherwise just pass
- * the value on.
- *
- * This is important for primitives because if your
- * entire initialization string was simply "(short) 3"
- * then a Short value must be returned so that the
- * correct kind of primitive proxy is created.
- */
- public Object evaluate() throws Exception {
- if (getTypeClass() == currentExpression.getTypeClass())
- return currentExpression.evaluate(); // They're the same, so just return it.
- if (getTypeClass().isPrimitive()) {
- // Can only cast a primitive to a primitive, except null can't be cast to a primitive.
- if (!currentExpression.getTypeClass().isPrimitive() || currentExpression.getTypeClass() == Void.TYPE)
- throw new EvaluationException(new ClassCastException(currentExpression.getTypeClass().getName()));
- // boolean only allows boolean cast.
- if (fCastType.getTypeClass() == Boolean.TYPE || currentExpression.getTypeClass() == Boolean.TYPE)
- throw new EvaluationException(new ClassCastException(currentExpression.getTypeClass().getName()));
- if (fCastType.getTypeClass() == Character.TYPE) {
- // So we have either a Character or a number as the value. Cast that.
- return new Character((char) ((Number) currentExpression.evaluate()).intValue());
- } else {
- Number value = null;
- // See if the value is character or a number.
- if (currentExpression.getTypeClass() == Character.TYPE)
- value = new Integer(((Character) currentExpression.evaluate()).charValue());
- else
- value = (Number) currentExpression.evaluate();
- switch (((Integer) sTypeLookup.get(fCastType.getTypeClass())).intValue()) {
- case BYTE_TYPE:
- return new Byte(value.byteValue());
- case SHORT_TYPE:
- return new Short(value.shortValue());
- case INT_TYPE:
- return new Integer(value.intValue());
- case LONG_TYPE:
- return new Long(value.longValue());
- case FLOAT_TYPE:
- return new Float(value.floatValue());
- case DOUBLE_TYPE:
- return new Double(value.doubleValue());
- default:
- return null; // Shouldn't occur. Just satisifies compiler.
- }
- }
-
- } else
- return currentExpression.evaluate();
- }
- /**
- * A cast expression always pushes onto the cast value
- */
- public Expression push(char[] token , char tokenDelimiter) {
- // If we don't have a class yet then we are within the statement to try and deterine the type being cast to
- if(fCastType.getPrimitiveTypeClass() == null && !fIsClosed){
- fCastType.push(token,tokenDelimiter);
- // If the type was completed and we have a ) then close us
- if(fCastType.getPrimitiveTypeClass() != null && tokenDelimiter == DelimiterCloseParen){
- fIsClosed = true;
- }
- return this;
- }
-
- if (!fIsClosed) {
- // The cast is not closed, but we have a static class. This class must therefore keep processing the tokens as it could be a method or message send
- Expression result = fCastType.push(token,tokenDelimiter);
- result.parenthesisLevel++;
- return result;
- }
-
- // If we have no expression push onto the cast value
- if(currentExpression == null){
- currentExpression = new Statement(fClassLoader);
- currentExpression = currentExpression.push(token,tokenDelimiter);
- return this;
- }
- Expression result = currentExpression.push(token, tokenDelimiter);
- // If the result if a push then push the stack
- if ( result.isComplete() ) {
- popExpressionStack();
- } else if ( result != currentExpression ) {
- pushExpressionStack(result);
- }
- return this;
- }
- public String toString(){
- StringBuffer buffer = new StringBuffer();
- buffer.append("Cast("); //$NON-NLS-1$
- if (fCastType != null){
- buffer.append(fCastType.toString());
- } else {
- buffer.append("???"); //$NON-NLS-1$
- }
- buffer.append(") "); //$NON-NLS-1$
- if ( currentExpression != null){
- buffer.append(currentExpression.toString());
- } else {
- buffer.append("???"); //$NON-NLS-1$
- }
- return buffer.toString();
- }
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.initParser.Expression#getTypeClassName()
- */
- protected String getTypeClassName() {
- return fCastType.getTypeClassName();
- }
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/CharLiteral.java b/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/CharLiteral.java
deleted file mode 100644
index 88ad26c39..000000000
--- a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/CharLiteral.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.initParser;
-/*
-
-
- */
-
-import java.text.MessageFormat;
-
-
-
-public class CharLiteral extends Expression {
- protected boolean isComplete;
- public char value;
- public StringBuffer valueBuffer = new StringBuffer();
- protected boolean isEscaped = false;
-
-/**
- * constructor
- */
-public CharLiteral(){
-}
-
-/**
- * evaluate method comment.
- */
-public Object evaluate() throws Exception {
- if (valueBuffer.length() == 1)
- return new Character(valueBuffer.charAt(0));
- else
- throw new EvaluationException(
- new IllegalArgumentException(MessageFormat.format(ProxyInitParserMessages.getString("CharTooComplicated_EXC_"), //$NON-NLS-1$
- new Object[] {valueBuffer.toString()})));
-}
-
-public boolean isComplete(){
- return isComplete;
-}
-/**
- * We must evaluate ourself and return the type of the result
- */
-
-public Class getTypeClass() {
- return Character.TYPE;
-}
-
-protected String getTypeClassName() {
- return Character.TYPE.getName();
-}
-/**
- *This string might be broken into a few tokens
- *so we need a StringBuffer
- */
-public Expression push(char[] token , char delimiter){
-
- if (isEscaped) {
- isEscaped = false;
- if (token.length != 0) {
- // Had an escape followed by stuff, so not a true esc for our current definition
- valueBuffer.append(DelimiterEscape);
- } else {
- if (delimiter == DelimiterSingleQuote || delimiter == DelimiterEscape)
- valueBuffer.append(delimiter); // It was a true escape.
- else {
- valueBuffer.append(DelimiterEscape); // If wasn't a true escape
- valueBuffer.append(delimiter);
- }
- return this;
- }
- }
-
- valueBuffer.append(token);
-
- if (delimiter == DelimiterSingleQuote){
- isComplete =true;
- return this;
- }
-
- // If the delimiter is an escape character remember it so we can escape
- // the next token, otherwise treat it as a literal
- if (delimiter == DelimiterEscape ){
- isEscaped = true;
- } else {
- valueBuffer.append(delimiter);
- }
- return this;
-}
-
-/**
- * chars are primitives.
- */
-public boolean isPrimitive() {
- return true;
-}
-public String toString(){
- StringBuffer buffer = new StringBuffer();
- buffer.append("Char('"); //$NON-NLS-1$
- if ( valueBuffer != null ) {
- buffer.append(valueBuffer.toString());
- }
- buffer.append(')');
- return buffer.toString();
-}
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/Constructor.java b/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/Constructor.java
deleted file mode 100644
index 0094e4837..000000000
--- a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/Constructor.java
+++ /dev/null
@@ -1,339 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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.jem.internal.proxy.initParser;
-/*
-
-
- */
-
-
-import java.util.*;
-
-import org.eclipse.jem.internal.proxy.common.AmbiguousMethodException;
-import org.eclipse.jem.internal.proxy.common.MethodHelper;
-/**
- * Insert the type's description here.
- * Creation date: (11/01/00 8:52:36 PM)
- * @author: Administrator
- */
-public class Constructor extends Expression {
- public boolean argsOpened = false;
- public boolean argsClosed = false;
- public boolean trailingPeriod = false;
- public ArrayList arguments = new ArrayList(2);
- public Static type;
- protected boolean fIsComplete;
- public boolean insideArgsOpenedParen = false;
- public boolean insideArgsClosedParen = false;
- public boolean isString = false;
- public java.lang.reflect.Constructor ctor;
-/**
- * Constructor constructor comment.
- */
-public Constructor(ClassLoader aClassLoader) {
- super();
- fClassLoader = aClassLoader;
-}
-
-public boolean isComplete(){
- return fIsComplete;
-}
-
-/**
- * Invoke the construtor
- */
-public Object evaluate() throws Exception {
-
- if ( type.isArray() ) {
- // For arrays we get the array that is actually held inside the static
- // To instantiate the array it is possible that the static knows the array size, e.g. new int[2]
- // or else it must be given this from the number of arguments we have, e.g. new int[] { 2 , 3 }
- if ( arguments.size() > 0 ) {
- type.setArrayArguments(arguments);
- }
- Object result = type.evaluate();
- // Deal with array initialization arguments
- return result;
- } else {
- // For non arrays we find the method and invoke it on the type
- cacheCtor();
- // Get the array of arguments
- Object[] args = new Object[arguments.size()];
- Iterator itr = arguments.iterator();
- for (int i = 0; i < arguments.size() ; i++){
- Expression anExpression = (Expression)itr.next();
- args[i] = anExpression.evaluate();
- }
-
- try {
- return ctor.newInstance(args);
- } catch (Exception e) {
- // If we got this far, then we have a valid parse, so anything is an evaluation exception.
- throw new EvaluationException(e);
- }
- }
-}
-/** A constructor can only return the class of its type
- */
-public Class getTypeClass() throws Exception {
- if ( type.isArray() ) {
- // For arrays we get the array that is actually held inside the static
- // To instantiate the array it is possible that the static knows the array size, e.g. new int[2]
- // or else it must be given this from the number of arguments we have, e.g. new int[] { 2 , 3 }
- if ( arguments.size() > 0 ) {
- type.setArrayArguments(arguments);
- }
- }
- return type.getTypeClass();
-}
-
-protected String getTypeClassName() {
- return type.getTypeClassName();
-}
-
-private void cacheCtor() throws Exception {
-
- if (ctor == null) {
- Class[] argTypes = new Class[arguments.size()];
- Iterator itr = arguments.iterator();
- for (int i=0; i<argTypes.length; i++)
- argTypes[i] = getEvaluationTypeClass((Expression) itr.next());
-
- try {
- ctor = MethodHelper.findCompatibleConstructor(getEvaluationTypeClass(this), argTypes);
- } catch (NoSuchMethodException e) {
- throw new EvaluationException(e);
- } catch (AmbiguousMethodException e) {
- throw new EvaluationException(e);
- } catch (IllegalAccessException e) {
- throw new EvaluationException(e);
- }
- }
-}
-protected boolean isDelimiterOpened(char token){
- return type.isArray() ? token == DelimiterOpenElipse : token == DelimiterOpenParen;
-}
-protected boolean isDelimiterClosed(char token){
- return type.isArray() ? token == DelimiterCloseElipse : token == DelimiterCloseParen;
-}
-/**
- * push method comment.
- */
-public Expression push(char[] token, char tokenDelimiter) {
-
- // If we are closed and we receive a . with no token then remember this
- if ( argsClosed && !trailingPeriod && tokenDelimiter == DelimiterPeriod && token.length == 0 ) {
- trailingPeriod = true;
- return this;
- }
- // If we have been closed with a . and we receive a . then we are a field
- if ( trailingPeriod && tokenDelimiter == DelimiterPeriod ) {
- return new Field(this,token,fClassLoader);
- }
- // If we have been closed with a . and we receive a ( we are a message
- if ( trailingPeriod && tokenDelimiter == DelimiterOpenParen ) {
- return new Message(this,token,fClassLoader);
- }
-
- // Lazy initialize the type if required
- if ( type == null ) {
- switch ( tokenDelimiter ) {
- case DelimiterPeriod: {
- type = new Static(token,tokenDelimiter,fClassLoader);
- type.setClassLoader(fClassLoader);
- return this;
- }
- case DelimiterOpenParen: {
- type = new Static(token,tokenDelimiter,fClassLoader);
- type.setClassLoader(fClassLoader);
- argsOpened = true;
- return this;
- }
- case DelimiterOpenSquareBrace: {
-// throw new CannotProcessArrayTypesException();
- // Array dimenions are created as staements in the arrayDimensions
- // This is for expressions like new String[] or new String[3], where the Statement represents the 3, i.e.
- // the code that declares the size of the array
- type = new Static(token,tokenDelimiter,fClassLoader,true);
- return this;
- }
- // If we get a { and our static is an array then this is the array initialization parameters
- case DelimiterOpenElipse: {
- if ( type != null && type.isArray() ) {
- argsOpened = true;
- }
- }
- default: {
- return null;
- }
- }
- }
-
- // If we have a static that is an array then it consumes token until it is complete
- if ( type != null && type.isArray() ) {
- // The type consumes token as long as it is still in the array declaration section
- if ( type.isProcessingArrayDimension || tokenDelimiter == DelimiterOpenSquareBrace ) {
- type.push(token,tokenDelimiter);
- return this;
- }
- }
-
- // If the type is incomplete and the token is a . ( for another class ) or a [ for an array then push it onto the type
- if (!type.isArray() && type.getTypeClass() == null && (tokenDelimiter == DelimiterPeriod || tokenDelimiter == DelimiterOpenSquareBrace)) {
- type.push(token , tokenDelimiter);
- return this;
- }
- // If the type is incomplete and the token is a ( then push it onto the type and open the parens
- if (!type.isArray()){
- if (type.getTypeClass() == null && !argsOpened && isDelimiterOpened(tokenDelimiter)) {
- argsOpened = true;
- insideArgsOpenedParen = true;
- type.push(token , DelimiterSpace );
- return this;
- }
- } else {
- if ( !argsOpened && isDelimiterOpened(tokenDelimiter)) {
- argsOpened = true;
- insideArgsOpenedParen = true;
- return this;
- }
- }
-
- // If the args are already closed and we get another close expression, then just return ourselves
- // This occurs in the case of nested array arguments within constructors
- if ( argsClosed && (tokenDelimiter == DelimiterCloseParen)){
- fIsComplete = true;
- return this;
- }
-
- // If the arguments are closed and we receive a { then this is an inner class declaration, e.g.
- // new javax.swing.table.DefaultTableModel(){}
- // This can't be processed by us so we need to throw an exception
- if (argsClosed && tokenDelimiter == DelimiterOpenElipse ) {
- throw new CannotProcessInnerClassesException();
- }
-
- // If the args are opened and a token was supplied then it must be an argument
- if (argsOpened){
- // If we already have an incomplete argument then this may be a constructor, a static reference, etc...
- // and we should forward the request to the argument
- Expression openArgument = null;
- if ( arguments.size() > 0 ){
- openArgument = (Expression)arguments.get(arguments.size()-1);
- if ( !openArgument.isComplete() ) {
- openArgument.push(token,tokenDelimiter);
- // If the argument is complete and we received a ) then the constructor is complete
- // or if we receive a } and are an array we are complete
- if ( openArgument.isComplete() && isDelimiterClosed(tokenDelimiter) ){
- argsClosed = true;
- }
- return this;
- }
- }
-
- Expression newArgument = null;
- // If we are not already inside the open arg and we get another open paren this is probably a cast
- // or some kind of statement, and OperMinus is probably the start of a number
- // If the args are not already open we must be opened with either a { or a ( depending on whether we are an array or not
- // however if the args are opened already and we receive a ( then this is the start of a new statement
-// if ((!insideArgsOpenedParen && isDelimiterOpened(tokenDelimiter)) || tokenDelimiter == DelimiterOpenParen){
- if (tokenDelimiter == DelimiterOpenElipse || tokenDelimiter == DelimiterOpenParen){
- insideArgsOpenedParen = true;
- newArgument = new Statement(fClassLoader).push(token,tokenDelimiter);
- if ( newArgument instanceof ArrayArguments ) {
- ((ArrayArguments)newArgument).setType(type);
- }
- newArgument = new MessageArgument(newArgument);
- arguments.add(newArgument);
-
- }
-
- // Start of a possible string or number or character
- if ( ( token.length > 0 || tokenDelimiter == DelimiterQuote || tokenDelimiter == DelimiterSingleQuote) || tokenDelimiter == OperMinus ){
- newArgument = new Statement(fClassLoader).push(token,tokenDelimiter);
- newArgument = new MessageArgument(newArgument);
- arguments.add(newArgument);
- }
- // If the token after the argument is a ) then the message is being closed
- if ( !insideArgsOpenedParen || argumentsAreComplete() && isDelimiterClosed(tokenDelimiter) ) {
- argsClosed = true;
- return this;
- }
- if ( insideArgsOpenedParen && isDelimiterClosed(tokenDelimiter) ) {
- insideArgsClosedParen = true;
- return this;
- }
-
- // If the token after the argument is a , or a ' ' then the argument is being closed
- if ( tokenDelimiter == DelimiterComma || tokenDelimiter == DelimiterSpace ) {
- // If our arguments are closed then we must be complete. We need to signal the fact we are closed
- // otherwise we will not be processed correctly if we are part of a stack
- if ( argsClosed ) {
- fIsComplete = true;
- }
- return this;
- }
-
- // If we receive a close bracket then we are closed as long as the last argument is closed
- if(argsOpened && isDelimiterClosed(tokenDelimiter)){
- // No parms - we are a closed constructor
- if(arguments.size() == 0){
- argsClosed = true;
- return this;
- }
- }
-
- // If our last argument is closed and receive a ) and we have no new argument then we are closed
- if (tokenDelimiter == DelimiterCloseParen && newArgument == null){
- Expression lastArgument = (Expression)arguments.get(arguments.size()-1);
- if ( lastArgument.isComplete() ) {
- argsClosed = true;
- return this;
- }
- }
-
- // Otherwise the new argument is stil processing. Return it
- return newArgument;
- }
-
- return this;
-}
-protected boolean argumentsAreComplete(){
- if ( arguments.size() == 0) return true;
- return ((Expression)arguments.get(arguments.size()-1)).isComplete();
-}
-public String toString(){
-
- java.io.StringWriter writer = new java.io.StringWriter();
- writer.write("Constructor \""); //$NON-NLS-1$
- if ( type != null ) {
- writer.write(type.typeWriter.toString());
- } else {
- writer.write("UNTYPED"); //$NON-NLS-1$
- }
- for (int i = 0; i < arguments.size() ; i++){
- writer.write(" Arg("); //$NON-NLS-1$
- writer.write("" + (i+1)); //$NON-NLS-1$
- writer.write(") = "); //$NON-NLS-1$
- writer.write(arguments.get(i).toString());
- }
-
- return writer.toString();
-
-}
-
-/**
- * This is never primitive
- */
-public boolean isPrimitive() {
- return false;
-}
-}
diff --git a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/EvaluationException.java b/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/EvaluationException.java
deleted file mode 100644
index 67215b935..000000000
--- a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/EvaluationException.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.initParser;
-/*
-
-
- */
-
-import java.lang.reflect.InvocationTargetException;
-
-/**
- * This is an InitializationStringEvaluationException, but
- * in addition, the exception that it wrappers is what should be
- * returned. This means it was a valid exception, parsing had
- * gone fine, but it was an evaluation that occured. This is
- * distinguished from the straight InitializationStringEvaluationException,
- * which means some error during parsing and evaluation.
- *
- * Note: InvocationTargetExceptions will be unwrappered to the true exception.
- */
-public class EvaluationException extends InitializationStringEvaluationException {
-
- /**
- * Comment for <code>serialVersionUID</code>
- *
- * @since 1.1.0
- */
- private static final long serialVersionUID = -6997239021885310986L;
-
- /**
- * Constructor for ReturnableException.
- * @param exc
- */
- public EvaluationException(Throwable exc) {
- super(exc instanceof InvocationTargetException ? ((InvocationTargetException) exc).getTargetException() : exc);
- }
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/Expression.java b/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/Expression.java
deleted file mode 100644
index 22bf67c25..000000000
--- a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/Expression.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.initParser;
-/*
-
-
- */
-
-
-import java.util.*;
-/**
- * Insert the type's description here.
- * Creation date: (11/01/00 8:46:44 PM)
- * @author: Administrator
- */
-public abstract class Expression implements IParserConstants {
- protected Expression currentExpression;
- protected List fExpressionStack;
- protected ClassLoader fClassLoader;
- public int parenthesisLevel = 0;
-/** Compare the two char arrays
- */
-public static boolean compare(char[] from , char[] to){
-
- return Arrays.equals(from, to);
-}
-/**
- * Expression constructor comment.
- * Note: If any exceptions that are due to evaluation, and not due to some
- * invalid state, then the exception should be wrappered in an EvaluationException,
- * and the EvaluationException thrown instead. This way we can distinquish between
- * valid exceptions that result evaluations (such as null pointer exceptions) from
- * parser errors due to string is too complicated.
- */
-public abstract Object evaluate() throws Exception;
-
-public abstract boolean isComplete();
-/**
- * Return a class type that the expression syntactically would produce.
- * For example, if a field is of type XYZ, return XYZ, even though
- * the value of the field may be SubXYZ where SubXYZ is a subclass of XYZ.
- */
-public abstract Class getTypeClass() throws Exception;
-/**
- * In evaluation phase, get the type class from the expression.
- * If typeclass not found, then a ClassCastException is thrown.
- * @param exp To getTypeClass from
- * @return type class.
- * @throws Exception ClassNotFoundException if type not found.
- */
-public Class getEvaluationTypeClass(Expression exp) throws Exception {
- Class cls = exp.getTypeClass();
- if (cls == null)
- throw new EvaluationException(new ClassNotFoundException(exp.getTypeClassName()));
- return cls;
-}
-
-/**
- * @return Type name that should be returned from this expression.
- */
-protected abstract String getTypeClassName();
-
-public boolean isNumber(char[] token){
-
- if ( token.length == 0) return false;
- // See whether the token is a number
- int parsePosition = 0;
- // Take into account it may start with a - sign, e.g. -1
- if ( token[0] == '-' ) parsePosition = 1;
- for (int i = parsePosition; i < token.length ; i++){
- // If the next token is a digit return true
- // Other things like decimals or primitive types, e.g. 2.2 or 2.2f are
- // handled by NumberLiteral
- return Character.isDigit(token[i]);
- }
- return true;
-}
-public boolean isPop(){
- return false;
-}
-protected void popExpressionStack(){
-
- if ( fExpressionStack != null && fExpressionStack.size() > 0 ) {
- currentExpression = (Expression) fExpressionStack.remove(fExpressionStack.size()-1);
- }
-}
-protected void pushExpressionStack(Expression anExpression){
-
- if ( fExpressionStack == null ) fExpressionStack = new ArrayList(2);
- // The current expression should go onto the stack
- fExpressionStack.add(currentExpression);
- // The current expression is replaced with the argument
- currentExpression = anExpression;
-
-}
-
-void setClassLoader(ClassLoader aClassLoader){
-}
-
-/**
- * Push an expression onto us
- * Return the new expression onto which subsequent token should be pushed
- */
-public abstract Expression push(char[] token , char tokenDelimiter);
-
-/**
- * Answer if this expression results in a primitive.
- */
-public abstract boolean isPrimitive() throws Exception;
-
-public String toString(int depth, boolean aBreak){
- StringBuffer buffer = new StringBuffer();
- if ( aBreak ) {
- buffer.append(System.getProperty("System.lineSeparator")); //$NON-NLS-1$
- }
- for(int i=0;i<depth;i++){
- buffer.append(" "); //$NON-NLS-1$
- }
- buffer.append(toString());
- return buffer.toString();
-}
-}
diff --git a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/Field.java b/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/Field.java
deleted file mode 100644
index 4625ca986..000000000
--- a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/Field.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.initParser;
-/*
-
-
- */
-
-
-/**
- * Insert the type's description here.
- * Creation date: (11/05/00 10:39:28 PM)
- * @author: Administrator
- */
-public class Field extends Expression {
- public boolean isComplete;
- protected java.lang.reflect.Field fField;
- public Expression receiver;
- public String fieldName;
- protected Class fResultType;
-
-public Field(Expression aReceiver , char[] token , ClassLoader aClassLoader){
-
- receiver = aReceiver;
- if ( token.length > 0 ){
- fieldName = new String(token);
- }
-
-}
-public boolean isComplete(){
- return isComplete;
-}
-
-/**
- * Send the message to the receiver
- */
-public Object evaluate() throws Exception {
- Object receiverValue = receiver.evaluate(); // So if it fails, we get an evaluation exception going on up.
- try {
- cacheField();
- return fField.get(receiverValue);
- } catch (Exception e) {
- throw new EvaluationException(e); // Any exception at this point is an evaluation exception.
- }
-}
-
-/**
- * Get the field from reflection.
- */
-protected void cacheField() throws Exception {
- if (fField == null) {
- Class aReceiverClass = getEvaluationTypeClass(receiver);
- fField = aReceiverClass.getField(fieldName);
- fResultType = fField.getType();
- }
-}
-
-/**
- * The result type is the type of the field.
- */
-public Class getTypeClass() throws Exception {
- if ( fResultType == null ) {
- cacheField();
- }
- return fResultType;
-}
-
-protected String getTypeClassName() {
- return ""; // If we got this far, we don't know what it is. //$NON-NLS-1$
-}
-/**
- * push method comment.
- */
-public Expression push(char[] token, char tokenDelimiter) {
-
- // If the delimiter is a ( then this is the start of a message
- if ( tokenDelimiter == DelimiterOpenParen ) {
- return new Message(this , token , fClassLoader);
- }
-
- // If the delimiter is a . then this is a field
- if (token.length > 0 && ( tokenDelimiter == DelimiterPeriod || tokenDelimiter == DelimiterSpace
- || tokenDelimiter == DelimiterComma)) {
- isComplete = true;
- return new Field(this , token , fClassLoader);
-
- }
-
- if(fieldName != null && tokenDelimiter == DelimiterComma){
- isComplete = true;
- return this;
- }
-
- // If we have no delimiter or a close paren then we have just received the field name
- if (!isComplete && fieldName == null) {
- fieldName = new String(token);
- return this;
- }
-
- if(tokenDelimiter == BitOR || tokenDelimiter == BitAND){
- isComplete = true;
- PrimitiveOperation result = new PrimitiveOperation(this,tokenDelimiter);
- return result;
- }
-
- // Ignore spaces as this maybe padding between the field and the next valid token
- if(token.length == 0 && tokenDelimiter == ' ') return this;
-
- throw new RuntimeException(java.text.MessageFormat.format(ProxyInitParserMessages.getString(ProxyInitParserMessages.UNEXPECTED_TOKEN), new Object[] {new StringBuffer(token.length+1).append(token).append(tokenDelimiter).toString()}));
-
-}
-public String toString(){
-
- java.io.StringWriter writer = new java.io.StringWriter();
- writer.write("Field Name=\""); //$NON-NLS-1$
- if ( fieldName != null ) {
- writer.write(fieldName);
- } else {
- writer.write("UNNAMED"); //$NON-NLS-1$
- }
- writer.write("\" Receiver="); //$NON-NLS-1$
- if ( receiver != null ){
- writer.write(receiver.toString());
- } else {
- writer.write("NONE"); //$NON-NLS-1$
- }
- return writer.toString();
-
-}
-
-/**
- * Test the field type to determine if primitive or not.
- */
-public boolean isPrimitive() throws Exception {
- cacheField();
- return getTypeClass().isPrimitive();
-}
-}
diff --git a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/IParserConstants.java b/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/IParserConstants.java
deleted file mode 100644
index dcc0f3b57..000000000
--- a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/IParserConstants.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.initParser;
-/*
-
-
- */
-
-
-/**
- * Constants for the parser.
- * Creation date: (11/05/00 9:37:45 PM)
- * @author: Administrator
- */
-public interface IParserConstants {
- // Define the delimiters
- public static final char DelimiterSpace = ' ';
- public static final char DelimiterPeriod = '.';
- public static final char DelimiterOpenParen = '(';
- public static final char DelimiterCloseParen = ')';
- public static final char DelimiterComma = ',';
- public static final char DelimiterQuote = '"';
- public static final char DelimiterEscape = '\\';
- public static final char DelimiterSingleQuote = '\'';
- public static final char DelimiterOpenElipse = '{';
- public static final char DelimiterCloseElipse = '}';
- public static final char DelimiterOpenSquareBrace = '[';
- public static final char DelimiterCloseSquareBrace = ']';
- // Define the math functions
- public static final char OperPlus = '+';
- public static final char OperMinus = '-';
- public static final char OperMultiply = '*';
- public static final char OperDivide = '/';
- // Define the primitive functions
- public static final char BitOR = '|';
- public static final char BitAND = '&';
-
- // Define constants
- public static final char[] ConstantNew = new char[] { 'n' , 'e' , 'w' };
- public static final char[] ConstantTrue = new char[] { 't' , 'r' , 'u' , 'e' };
- public static final char[] ConstantFalse = new char[] { 'f' , 'a' , 'l' , 's' , 'e' };
- public static final char[] ConstantNull = new char[] { 'n' , 'u' , 'l' , 'l' };
-}
diff --git a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/InitializationStringEvaluationException.java b/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/InitializationStringEvaluationException.java
deleted file mode 100644
index 7a284c29d..000000000
--- a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/InitializationStringEvaluationException.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.initParser;
-/*
-
-
- */
-
-
-
-public class InitializationStringEvaluationException extends Exception {
-
-
-/**
- * Comment for <code>serialVersionUID</code>
- *
- * @since 1.1.0
- */
- private static final long serialVersionUID = -8633390926210276727L;
-public InitializationStringEvaluationException(Throwable exc){
- super(exc);
-}
-public Throwable getOriginalException(){
- return getCause();
-}
-}
diff --git a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/InitializationStringParser.java b/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/InitializationStringParser.java
deleted file mode 100644
index c6adc9e82..000000000
--- a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/InitializationStringParser.java
+++ /dev/null
@@ -1,300 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.initParser;
-/*
-
-
- */
-
-
-import java.util.ArrayList;
-/**
- * Insert the type's description here.
- * Creation date: (11/01/00 8:53:45 PM)
- * @author: Administrator
- */
-public class InitializationStringParser implements IParserConstants {
- protected ClassLoader fClassLoader;
- protected boolean isComplete = false;
- protected String fInitString;
- protected int fSourceLength;
- protected char[] fSource;
- protected int fSourcePosition = -1;
- private char[] fCurrentToken;
- private char fCurrentTokenDelimiter = 0;
- protected ArrayList fExpressionStack = new ArrayList(4);
- protected Expression fExpression;
-/**
- * InitializationStringParser constructor comment.
- */
-public InitializationStringParser(String initString){
-
- fInitString = initString;
- fSource = initString.toCharArray();
- fSourceLength = fSource.length;
-
-}
-/** Look for a known token
- */
-protected void createNextToken(){
-
- fCurrentTokenDelimiter = 0;
- if ( fSourcePosition >= fSourceLength - 1 ) {
- isComplete = true;
- return;
- }
-
- fSourcePosition++;
- // If we are not in a token then look for " " or else for a period
- char[] fCurrentTokenSource = new char[fSourceLength];
- int i = 0;
- scanner : for ( ; fSourcePosition < fSourceLength ; fSourcePosition++ , i++ ){
- // Advance the source position so when finding the next token we skip over the '.' or ' '
- // Record the delimiter that was found
- switch ( fSource[fSourcePosition] ) {
- case DelimiterPeriod: {
- fCurrentTokenDelimiter = DelimiterPeriod;
- break scanner;
- }
- case DelimiterOpenParen: {
- fCurrentTokenDelimiter = DelimiterOpenParen;
- break scanner;
- }
- case DelimiterCloseParen: {
- fCurrentTokenDelimiter = DelimiterCloseParen;
- break scanner;
- }
- case DelimiterComma: {
- fCurrentTokenDelimiter = DelimiterComma;
- break scanner;
- }
- case DelimiterSpace: {
- fCurrentTokenDelimiter = DelimiterSpace;
- break scanner;
- }
- case DelimiterQuote: {
- fCurrentTokenDelimiter = DelimiterQuote;
- break scanner;
- }
- case DelimiterSingleQuote: {
- fCurrentTokenDelimiter = DelimiterSingleQuote;
- break scanner;
- }
- case DelimiterEscape: {
- fCurrentTokenDelimiter = DelimiterEscape;
- break scanner;
- }
- case DelimiterOpenElipse:{
- fCurrentTokenDelimiter = DelimiterOpenElipse;
- break scanner;
- }
- case DelimiterOpenSquareBrace:{
- fCurrentTokenDelimiter = DelimiterOpenSquareBrace;
- break scanner;
- }
- case DelimiterCloseSquareBrace:{
- fCurrentTokenDelimiter = DelimiterCloseSquareBrace;
- break scanner;
- }
- case DelimiterCloseElipse:{
- fCurrentTokenDelimiter = DelimiterCloseElipse;
- break scanner;
- }
- // Do the math functions
- case OperPlus: {
- fCurrentTokenDelimiter = OperPlus;
- break scanner;
- }
- case OperMinus: {
- fCurrentTokenDelimiter = OperMinus;
- break scanner;
- }
- case OperMultiply: {
- fCurrentTokenDelimiter = OperMultiply;
- break scanner;
- }
- case OperDivide: {
- fCurrentTokenDelimiter = OperDivide;
- break scanner;
- }
- // Do the primitive BitWise operations
- case BitOR: {
- fCurrentTokenDelimiter = BitOR;
- break scanner;
- }
- case BitAND: {
- fCurrentTokenDelimiter = BitAND;
- break scanner;
- }
- default: {
- fCurrentTokenSource[i] = fSource[fSourcePosition];
- }
- }
- }
-
- // Push the token onto the stack for later decoding
- if ( i >= 1 ) {
- fCurrentToken = new char[i];
- System.arraycopy( fCurrentTokenSource , 0 , fCurrentToken , 0 , i );
- } else {
- fCurrentToken = new char[0];
- }
-
-}
-/** Answer the result of evaluating the expression
- */
-public Object evaluate() throws InitializationStringEvaluationException {
-
- try {
- return fExpression.evaluate();
- } catch (java.lang.reflect.InvocationTargetException e) {
- throw new EvaluationException(e);
- } catch (EvaluationException e) {
- throw e; // Don't loose these
- } catch (Exception e) {
- throw new InitializationStringEvaluationException(e);
- }
-
-}
-public static Object evaluate(String initString) throws InitializationStringEvaluationException {
-
- return evaluate(initString,null);
-
-}
-public static Object evaluate(String initString,ClassLoader aClassLoader) throws InitializationStringEvaluationException {
-
- InitializationStringParser parser = null;;
- try {
- parser = new InitializationStringParser(initString);
- parser.setClassLoader(aClassLoader);
- parser.parse();
- } catch ( Throwable exc ) {
- throw new InitializationStringEvaluationException(exc);
- }
- return parser.evaluate();
-}
-
-/**
- * Return a parser already parsed. Use the default classloader (i.e. classloader that loaded InitializationStringParser).
- *
- * @param initString
- * @return The parser, already parsed.
- * @throws InitializationStringEvaluationException
- */
-
-public static InitializationStringParser createParser(String initString) throws InitializationStringEvaluationException {
- return createParser(initString, null);
-}
-
-/**
- * Return a parser already parsed. Use the given classloader.
- *
- * @param initString
- * @param classLoader
- * @return The parser, already parsed.
- * @throws InitializationStringEvaluationException
- */
-public static InitializationStringParser createParser(String initString, ClassLoader classLoader) throws InitializationStringEvaluationException {
-
- try {
- InitializationStringParser parser = new InitializationStringParser(initString);
- parser.setClassLoader(classLoader);
- parser.parse();
- return parser;
- } catch ( Throwable exc ) {
- throw new InitializationStringEvaluationException(exc);
- }
-
-}
-
-/** Analyze the string
- */
-public void parse(){
-
- createFirstExpression();
- int i =1;
- while ( true ){
- createNextToken();
- if ( isComplete ) {
- // If the current expression is incomplete it must be completed
- // by the end, which is basically the equiavlent of a;
- return;
- } else {
- i++;
- Expression result = fExpression.push( fCurrentToken , fCurrentTokenDelimiter );
- // If the result if a push then push the stack
- if ( result.isComplete() ) {
- popExpressionStack();
- } else if ( result != fExpression ) {
- pushExpressionStack(result);
- }
- }
- }
-}
-
-/**
- * Answer if the string results in a primitive.
- */
-public boolean isPrimitive() throws InitializationStringEvaluationException {
- try {
- return fExpression.isPrimitive();
- } catch (Exception e) {
- throw new InitializationStringEvaluationException(e);
- }
-}
-
-public Class getExpectedType() throws InitializationStringEvaluationException {
- try {
- return fExpression.getTypeClass();
- } catch (Exception e) {
- throw new InitializationStringEvaluationException(e);
- }
-}
-
-/* Pop the top expression off the stack
- */
-protected void popExpressionStack(){
-
- if ( fExpressionStack.size() > 0 ) {
- fExpression = (Expression) fExpressionStack.remove(fExpressionStack.size()-1);
- }
-}
-/* Push the expression onto the stack
- */
-protected void pushExpressionStack(Expression anExpression){
-
- // The current expression should go onto the stack
- fExpressionStack.add(fExpression);
- // The current expression is replaced with the argument
- fExpression = anExpression;
-
-}
-protected void createFirstExpression(){
- if ( fExpression == null ) {
- fExpression = new Statement(fClassLoader);
- };
-}
-public void setClassLoader(ClassLoader aClassLoader){
- fClassLoader = aClassLoader;
-}
-public String toString(){
- StringBuffer writer = new StringBuffer();
- writer.append("Parser. token=\""); //$NON-NLS-1$
- if ( fCurrentToken != null ) {
- writer.append(fCurrentToken);
- }
- writer.append("\", delim=\""); //$NON-NLS-1$
- writer.append(fCurrentTokenDelimiter);
- writer.append("\", initString=\""); //$NON-NLS-1$
- writer.append(fInitString);
- return writer.toString();
-}
-}
diff --git a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/Message.java b/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/Message.java
deleted file mode 100644
index 35ccad96b..000000000
--- a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/Message.java
+++ /dev/null
@@ -1,224 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.initParser;
-/*
-
-
- */
-
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import org.eclipse.jem.internal.proxy.common.AmbiguousMethodException;
-import org.eclipse.jem.internal.proxy.common.MethodHelper;
-
-public class Message extends Expression {
- protected boolean trailingPeriod = false;
- protected Method fMethod;
- public Expression receiver;
- public String message;
- public boolean argsClosed = false;
- public boolean insideArgsOpenedParen = false;
- public boolean insideArgsClosedParen = false;
- protected boolean isComplete = false;
- public ArrayList arguments = new ArrayList(2);
-
-public Message(Expression aReceiver , char[] token , ClassLoader aClassLoader){
- receiver = aReceiver;
- message = new String(token);
- fClassLoader = aClassLoader;
-}
-public boolean isComplete(){
- return isComplete;
-}
-
-/**
- * Send the message to the receiver
- */
-public Object evaluate() throws Exception {
- cacheMethod();
-
- // Get the array of arguments
- Object[] args = new Object[arguments.size()];
- Iterator itr = arguments.iterator();
- for (int i = 0; i < arguments.size() ; i++){
- Expression anExpression = (Expression)itr.next();
- args[i] = anExpression.evaluate();
- }
-
- Object receiverValue = receiver.evaluate(); // So if evaluation exception thrown, we don't wrapper again.
-
- try {
- return fMethod.invoke(receiverValue, args);
- } catch (Exception e) {
- throw new EvaluationException(e);
- }
-}
-
-/**
- * Cache the message
- */
-protected void cacheMethod() throws Exception {
- if (fMethod == null) {
- Class[] argTypes = new Class[arguments.size()];
- Iterator itr = arguments.iterator();
- for (int i=0; i<argTypes.length; i++)
- argTypes[i] = getEvaluationTypeClass((Expression) itr.next());
-
- try {
- fMethod = MethodHelper.findCompatibleMethod(getEvaluationTypeClass(receiver), message, argTypes);
- } catch (NoSuchMethodException e) {
- throw new EvaluationException(e);
- } catch (AmbiguousMethodException e) {
- throw new EvaluationException(e);
- }
- }
-}
-
-
-/**
- * getTypeClass method comment.
- */
-public Class getTypeClass() throws Exception {
- cacheMethod();
- return fMethod.getReturnType();
-}
-
-protected String getTypeClassName() {
- return ""; // If we got this far, we don't know what it is. //$NON-NLS-1$
-}
-/**
- * push method comment.
- */
-public Expression push(char[] token, char tokenDelimiter) {
-
- // If we are closed and we receive a . with no token then remember this
- if ( argsClosed && !trailingPeriod && tokenDelimiter == DelimiterPeriod && token.length == 0 ) {
- trailingPeriod = true;
- return this;
- }
- // If we have been closed with a . and we receive a . then we are a field
- if ( trailingPeriod && tokenDelimiter == DelimiterPeriod ) {
- return new Field(this,token,fClassLoader);
- }
- // If we have been closed with a . and we receive a ( we are a message
- if ( trailingPeriod && tokenDelimiter == DelimiterOpenParen ) {
- return new Message(this,token,fClassLoader);
- }
-
- // If we have been closed and we receive a , or a ) we are complete - this is a structural token intended for someone else,
- // probably a message argument lower down the stack
- if (argsClosed && (tokenDelimiter == DelimiterComma || tokenDelimiter == DelimiterCloseParen)){
- isComplete = true;
- return this;
- }
-
-
- // If the args are opened and a token was supplied then it must be an argument
- //if ( argsOpened && ( tokenDelimiter == DelimiterCloseParen || tokenDelimiter == DelimiterComma ||
- //tokenDelimiter == DelimiterSpace || tokenDelimiter == DelimiterQuote || tokenDelimiter == DelimiterPeriod)) {
- if (!argsClosed){
- if ( arguments.size() > 0 ){
- Expression openArgument = (Expression)arguments.get(arguments.size()-1);
- if ( !openArgument.isComplete() ) {
- openArgument.push(token,tokenDelimiter);
- // If the argument is complete and we received a ) then the message is complete
- if ( openArgument.isComplete() && tokenDelimiter == DelimiterCloseParen){
- argsClosed = true;
- }
- return this;
- }
- }
-
- // We must have a new argument - process accordingly
- Expression newArgument = null;
- if (!insideArgsOpenedParen && tokenDelimiter == DelimiterOpenParen){
- insideArgsOpenedParen = true;
- newArgument = new Statement(fClassLoader).push(token,tokenDelimiter);
- newArgument = new MessageArgument(newArgument);
- arguments.add(newArgument);
-
- }
- if ( newArgument == null && (token.length > 0 || tokenDelimiter == DelimiterQuote || tokenDelimiter == DelimiterSingleQuote || tokenDelimiter == DelimiterOpenParen )) {
- newArgument = new Statement(fClassLoader).push(token,tokenDelimiter);
- newArgument = new MessageArgument(newArgument);
- arguments.add(newArgument);
- }
- // If the token after the argument is a ) then the message is being closed
- if ( !insideArgsOpenedParen && tokenDelimiter == DelimiterCloseParen ) {
- argsClosed = true;
- return this;
- }
- if ( insideArgsOpenedParen && tokenDelimiter == DelimiterCloseParen ) {
- insideArgsClosedParen = true;
- return this;
- }
-
- // If the token after the argument is a , or a ' ' then the argument is being closed
- if ( tokenDelimiter == DelimiterComma || tokenDelimiter == DelimiterSpace ) {
- return this;
- }
-
- // Otherwise the new argument is stil processing. Return it
-// return newArgument;
- }
-
- // If we don't have a message yet, then consume this one
- if ( message.length() == 0 ) {
- message = new String(token);
- return this;
- }
-
- return this;
-}
-public String toString(){
-
- java.io.StringWriter writer = new java.io.StringWriter();
- writer.write("Msg Name=\""); //$NON-NLS-1$
- if ( message != null ) {
- writer.write(message);
- } else {
- writer.write("UNNAMED"); //$NON-NLS-1$
- }
- writer.write("\" Rcv=("); //$NON-NLS-1$
- if ( receiver != null ){
- writer.write(receiver.toString());
- } else {
- writer.write("NONE"); //$NON-NLS-1$
- }
- writer.write(')');
- if ( arguments != null ) {
- writer.write("Args("); //$NON-NLS-1$
- Iterator iter = arguments.iterator();
- int i=1;
- while(iter.hasNext()){
- writer.write(new Integer(i).toString());
- writer.write('(');
- writer.write(iter.next().toString());
- writer.write("),"); //$NON-NLS-1$
- }
- writer.write(')');
- }
-
- return writer.toString();
-
-}
-
-/**
- * Is the message result a primitive.
- */
-public boolean isPrimitive() throws Exception {
- cacheMethod();
- return fMethod.getReturnType().isPrimitive();
-}
-}
diff --git a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/MessageArgument.java b/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/MessageArgument.java
deleted file mode 100644
index 66febdb43..000000000
--- a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/MessageArgument.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.initParser;
-/*
-
-
- */
-
-
-import java.io.StringWriter;
-import java.util.*;
-
-public class MessageArgument extends Expression {
-
- protected boolean isComplete = false;
- Expression fExpression;
- ArrayList fExpressionStack = new ArrayList();
-
-public MessageArgument(Expression anExpression){
- fExpression = anExpression;
-}
-
-public Object evaluate() throws Exception {
-
- return fExpression.evaluate();
-
-}
-
-public Class getTypeClass() throws Exception {
-
- return fExpression.getTypeClass();
-
-}
-
-protected String getTypeClassName() {
- return fExpression.getTypeClassName();
-}
-public boolean isComplete(){
- return isComplete || fExpression.isComplete();
-}
-
-public Expression push(char[] token , char delimiter){
-
- // Even if our expression is complete and we receive anything other than a , then the expression must process it as this may be a field or message
- // that is being sent to the expression to make up a complex argument
- Expression result = fExpression.push(token,delimiter);
- // If the result if a push then push the stack
- if ( result != fExpression ) {
- pushExpressionStack(result);
- } else if (result.isComplete()){
- // If our expression is complete, we are completed with a ) pop the stack so the previous expression can process us
- if (delimiter == DelimiterCloseParen ) {
- isComplete = true;
- popExpressionStack();
- } else if (delimiter == DelimiterComma || delimiter == DelimiterQuote ) {
- // If we receive a comma we pop the stack so the previous expression can process us but we don't flag us as complete
- popExpressionStack();
- // unless our expression is some array argument AND it is complete AND we have a close elipse }
- } else if ( delimiter == DelimiterCloseElipse ) {
- popExpressionStack();
- if ( fExpression instanceof ArrayArguments ) {
- isComplete = true;
- }
- }
- }
- return this;
-}
-
-/* Pop the top expression off the stack
- */
-protected void popExpressionStack(){
-
- if ( fExpressionStack.size() > 0 ) {
- Expression lastExpression = (Expression)fExpressionStack.get(fExpressionStack.size() - 1);
- if ( !lastExpression.isComplete() ) {
- fExpression = (Expression) fExpressionStack.remove(fExpressionStack.size() - 1);
- } else {
- isComplete = true;
- }
- } else {
- isComplete = true;
- }
-}
-
-/* Push the expression onto the stack
- */
-protected void pushExpressionStack(Expression anExpression){
-
- // The current expression should go onto the stack
- fExpressionStack.add(fExpression);
- // The current expression is replaced with the argument
- fExpression = anExpression;
-
-}
-
-public boolean isPrimitive(){
- return false;
-}
-public String toString(){
- StringWriter writer = new StringWriter();
- writer.write("Arg("); //$NON-NLS-1$
- if ( fExpression != null ) {
- writer.write(fExpression.toString());
- }
- writer.write(")"); //$NON-NLS-1$
- return writer.toString();
-}
-public void contributeArgumentNumber(List argumentNumberList){
-
- if ( fExpression instanceof ArrayArguments ) {
- ((ArrayArguments)fExpression).contributeArgumentNumber(argumentNumberList);
- }
-
-}
-}
diff --git a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/NullLiteral.java b/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/NullLiteral.java
deleted file mode 100644
index ad3d0efcb..000000000
--- a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/NullLiteral.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.initParser;
-
-import org.eclipse.jem.internal.proxy.common.MethodHelper;
-
-/*
-
-
- */
-
-
-public class NullLiteral extends Expression {
-public NullLiteral(){
-}
-/**
- * evaluate method comment.
- */
-public Object evaluate() {
- return null;
-}
-/**
- * evaluate method comment.
- */
-public Class getTypeClass(){
- return MethodHelper.NULL_TYPE;
-}
-
-protected String getTypeClassName() {
- return MethodHelper.NULL_TYPE.getName();
-}
-/**
- * true or false cannot consume any kind of expression so we must return null
- */
-public Expression push(char[] token , char delimiter){
- return null;
-}
-
-public boolean isComplete(){
- return true;
-}
-
-/**
- * Null is not primitive
- */
-public boolean isPrimitive() {
- return false;
-}
-}
-
-
diff --git a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/NumberLiteral.java b/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/NumberLiteral.java
deleted file mode 100644
index 27fd999f1..000000000
--- a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/NumberLiteral.java
+++ /dev/null
@@ -1,171 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.initParser;
-/*
-
-
- */
-
-
-public class NumberLiteral extends Expression {
- protected String numberString = ""; //$NON-NLS-1$
- protected boolean isComplete = false;
- protected Class numberClass = Integer.TYPE;
- protected int exponentFlag = NO_EXPONENT;
-
- protected static final int
- NO_EXPONENT = 0,
- HAS_EXPONENT = 1,
- HAS_EXPONENT_MINUS = 2;
-/**
- * evaluate method comment.
- */
-public NumberLiteral(){
-}
-/**
- * evaluate method comment.
- */
-public Object evaluate() throws Exception {
- try {
- // Return a number of the correct instance
- if (numberClass == Float.TYPE){
- return new Float(Float.parseFloat(numberString));
- } else if (numberClass == Long.TYPE ) {
- return Long.decode(numberString);
- } else if (numberClass == Double.TYPE ){
- return new Double(Double.parseDouble(numberString));
- } else
- return Integer.decode(numberString);
- } catch (Exception e) {
- throw new EvaluationException(e);
- }
-
-}
-public boolean isComplete(){
- return isComplete;
-}
-
-/**
- * Return the type of number that we are.
- */
-public Class getTypeClass(){
- return numberClass;
-}
-
-protected String getTypeClassName() {
- return numberClass != null ? numberClass.getName() : ""; //$NON-NLS-1$
-}
-/**
- * If the delimiter is an operation such as a +,-,/,* then we can consume it
- * If the delimiter is period and we don't already have one then it is the decimal portion of us
- */
-public Expression push(char[] token , char delimiter){
-
- // Close brackets complete use
- if(delimiter == DelimiterCloseParen || delimiter == DelimiterComma || delimiter == DelimiterCloseElipse){
- isComplete = true;
- }
-
- if (delimiter == OperMinus && numberString.length() == 0)
- numberString+=OperMinus; // No digits yet, but we have a minus sign, so add to accumulating number.
-
- numberString += processNumberToken(token);
-
- // If we have part of a number and are asked to do some arithmetic throw an
- // error that this has not been coded yet, except minus could be part of an exponent.
- if(numberString.length() > 0 && token.length > 1) {
- switch(delimiter){
- case OperMinus:
- if (exponentFlag == HAS_EXPONENT) {
- exponentFlag = HAS_EXPONENT_MINUS;
- numberString += OperMinus;
- break;
- }
- case OperPlus:
- case OperMultiply:
- case OperDivide:
- {
- throw new RuntimeException("Can't do arithmetic yet"); //$NON-NLS-1$
- }
- }
- }
-
- if (delimiter == DelimiterPeriod){
- numberClass = Double.TYPE; // A decimal makes it double.
- numberString += DelimiterPeriod;
- }
-
- if(delimiter == BitOR || delimiter == BitAND){
- Expression result = new PrimitiveOperation(this,delimiter);
- isComplete = true;
- return result;
- }
-
- return this;
-
-}
-protected String processNumberToken(char[] token){
-
- for (int i=0; i<token.length; i++)
- if (token[i] == 'E' || token[i] == 'e') {
- numberClass = Double.TYPE; // Definitely a floating because of this.
- exponentFlag = HAS_EXPONENT;
- break;
- }
-
- // The token could be a number, e.g. 10 or 5 or could be qualified with a primitive
- // suffix, e.g. 10l or 5f
- char[] numberToken = token;
- if ( token.length > 0 ) {
- switch(token[token.length - 1]){
- case 'F':
- case 'f':
- numberClass = Float.TYPE;
- numberToken = new char[token.length - 1];
- System.arraycopy(token,0,numberToken,0,numberToken.length);
- isComplete = true;
- break;
- case 'L':
- case 'l':
- numberClass = Long.TYPE;
- numberToken = new char[token.length - 1];
- System.arraycopy(token,0,numberToken,0,numberToken.length);
- isComplete = true;
- break;
- case 'D':
- case 'd':
- numberClass = Double.TYPE;
- numberToken = new char[token.length - 1];
- System.arraycopy(token,0,numberToken,0,numberToken.length);
- isComplete = true;
- break;
- }
- }
-
- return new String(numberToken);
-}
-public String toString(){
-
- java.io.StringWriter writer = new java.io.StringWriter();
- writer.write("Number \""); //$NON-NLS-1$
- writer.write(numberString);
- writer.write("\""); //$NON-NLS-1$
- return writer.toString();
-
-}
-
-/**
- * Number literals are primitive
- */
-public boolean isPrimitive() {
- return true;
-}
-}
diff --git a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/PrimitiveOperation.java b/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/PrimitiveOperation.java
deleted file mode 100644
index 7f5147902..000000000
--- a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/PrimitiveOperation.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 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
- *******************************************************************************/
-/*
- * This is for primitive expressions that are optimized out the compiler such as bit or, bit and, etc..
- */
-package org.eclipse.jem.internal.proxy.initParser;
-
-import java.text.MessageFormat;
-
-/*
-
-
- */
-
-public class PrimitiveOperation extends Expression {
-
- protected int operation; // This can be BitOR or BitAND
- protected Expression receiver; // The left hand side of the expression
- protected boolean isComplete = false;
-
- public PrimitiveOperation(Expression aReceiver, int anOperation){
- receiver = aReceiver;
- operation = anOperation;
- }
-
- public Object evaluate() throws Exception {
- Object leftHandSide = receiver.evaluate();
- Object rightHandSide = currentExpression.evaluate();
- if (leftHandSide instanceof Integer && rightHandSide instanceof Integer) {
- if(operation == BitOR) {
- return new Integer(((Integer)leftHandSide).intValue() | ((Integer)rightHandSide).intValue());
- } else if(operation == BitAND) {
- return new Integer(((Integer)leftHandSide).intValue() & ((Integer)rightHandSide).intValue());
- }
- }
- throw new RuntimeException(MessageFormat.format(ProxyInitParserMessages.getString("PrimitiveOperation.Evaluate.InvalidOperator_EXC_"), new Object[]{getOperDescription(), leftHandSide, rightHandSide})); //$NON-NLS-1$
- }
- protected String getOperDescription(){
- if(operation == BitOR) return "|"; //$NON-NLS-1$
- if (operation == BitAND) return "&"; //$NON-NLS-1$
- return "???"; //$NON-NLS-1$
- }
-
- public boolean isComplete() {
- return isComplete;
- }
-
- public Class getTypeClass() throws Exception {
- return Integer.TYPE;
- }
-
- protected String getTypeClassName() {
- return Integer.TYPE.getName();
- }
-
- public Expression push(char[] token, char tokenDelimiter) {
-
- // Create a new statement if the argument is null ( we are always created with a receiver )
- if(currentExpression == null && token.length > 0){
- currentExpression = new Statement(fClassLoader).push(token,tokenDelimiter);
- pushExpressionStack(currentExpression);
- return this;
- }
-
- // Ignore whitespace
- if(token.length == 0 && tokenDelimiter == ' ') return this;
-
- // If we have an argument we just keep pushing the expression onto this
- if(currentExpression != null){
- Expression result = currentExpression.push(token,tokenDelimiter);
- if(result != currentExpression){
- pushExpressionStack(result);
- }
- }
-
- if(currentExpression != null && currentExpression.isComplete()){
- if(tokenDelimiter == DelimiterComma){
- isComplete = true;
- return this;
- } else if (tokenDelimiter == DelimiterCloseParen){
- if(receiver.parenthesisLevel > 0){
- receiver.parenthesisLevel--;
- } else {
- isComplete = true;
- return this;
- }
- }
- }
-
- return this;
- }
-
- public boolean isPrimitive() throws Exception {
- return true;
- }
-
- public String toString(){
- StringBuffer buffer = new StringBuffer();
- if (receiver != null) buffer.append(receiver.toString());
- buffer.append(getOperDescription());
- if (currentExpression != null) buffer.append(currentExpression.toString());
- return buffer.toString();
- }
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/ProxyInitParserMessages.java b/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/ProxyInitParserMessages.java
deleted file mode 100644
index 8d9620eb8..000000000
--- a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/ProxyInitParserMessages.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.initParser;
-/*
-
-
- */
-
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-/**
- * General Proxy NLS Constants
- * Creation date: (4/13/00 10:46:58 AM)
- * @author: Administrator
- */
-public class ProxyInitParserMessages {
- // Resource Bundle to use for basic Proxy NLS resources.
- static private final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle("org.eclipse.jem.internal.proxy.initParser.messages"); //$NON-NLS-1$
-
- // Keys for messages/strings within the resource bundle.
- static public final String
- UNEXPECTED_TOKEN = "UnexpectedToken_EXC_", //$NON-NLS-1$
- STATEMENT_UNEXPECTED_EXECUTION = "Statement.UnexpectedExecution_EXC_", //$NON-NLS-1$
- STATEMENT_UNEXPECTED_EVALUATION = "Statement.UnexpectedEvaluation_EXC_" ; //$NON-NLS-1$
-
- private ProxyInitParserMessages() {
- }
-
- public static String getString(String key) {
- try {
- return RESOURCE_BUNDLE.getString(key);
- } catch (MissingResourceException e) {
- return '!' + key + '!';
- }
- }
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/Statement.java b/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/Statement.java
deleted file mode 100644
index 74bad2621..000000000
--- a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/Statement.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.initParser;
-/*
-
-
- */
-
-
-
-public class Statement extends Expression {
- public boolean isStringObject = false;
- public boolean isCast = false;
- protected boolean messageOrFieldStarted;
-
-/**
- * Statement constructor comment.
- */
-public Statement(ClassLoader aClassLoader) {
- super();
- fClassLoader = aClassLoader;
-}
-
-public boolean isComplete(){
- return currentExpression != null && currentExpression.isComplete();
-}
-
-/** Defer this to the expression
- */
-public Object evaluate() throws Exception {
- if ( currentExpression != null ) {
- return currentExpression.evaluate();
- } else {
- throw new RuntimeException(ProxyInitParserMessages.getString(ProxyInitParserMessages.STATEMENT_UNEXPECTED_EXECUTION)); // This is not an evaluation error, it shouldn't of occured, so it is a parser error.
- }
-}
-/**
- */
-public Class getTypeClass() throws Exception {
- return currentExpression.getTypeClass();
- //throw new RuntimeException(ProxyBaseVMNLS.RESBUNDLE.getString(ProxyBaseVMNLS.STATEMENT_UNEXPECTED_EVALUATION));
-}
-
-protected String getTypeClassName() {
- return currentExpression.getTypeClassName();
-}
-/** There are several types of token that can begin a statement.
- * new , ' ' - Create a constructor
- * 1-10, true, false, etc... - Create a literal
- * Foo, '.' - Create a Type
- */
-public Expression push(char[] token , char delimiter){
-
- // If messageOrFieldStart is true then our expression is complete and either a message or field is being created
- // See which it is and create the correct expression
- if (messageOrFieldStarted){
- messageOrFieldStarted = false;
- if ( delimiter == DelimiterOpenParen){
- Message message = new Message(currentExpression,token,fClassLoader);
- currentExpression = message;
- return message;
- } else {
- Field field = new Field(currentExpression,token,fClassLoader);
- currentExpression = field;
- return field;
- }
- }
-
- // Look for "new " for a constructor"
- if ( delimiter == DelimiterSpace && compare( token , ConstantNew ) ) {
- // If we thought we were a possible cast and we now aren't then we must be a block expression
- if ( isCast ) {
- currentExpression = new Block(new Constructor(fClassLoader));
- } else {
- currentExpression = new Constructor(fClassLoader);
- }
- isCast = false; // Can't be a cast now
- return currentExpression;
- }
-
- // Look for "null"
- if ( compare( token , ConstantNull ) ) {
- currentExpression = new NullLiteral();
- isCast = false; // Can't be a cast now
- // Null cannot process anything so we return the statement
- return this;
- }
-
- // Look for a number
- if ( isNumber( token ) || delimiter == OperMinus ) {
- currentExpression = new NumberLiteral();
- currentExpression = currentExpression.push(token,delimiter);
- isCast = false; // Can't be a cast now
- return currentExpression;
- }
-
- if ( compare( token , ConstantTrue ) ) {
- currentExpression = new BooleanLiteral(true);
- // true cannot process anything so we return the statement
- isCast = false; // Can't be a cast now
- return currentExpression;
-// return this;
- }
-
- if ( compare( token , ConstantFalse ) ) {
- // false cannot process anything so we return the statement
- currentExpression = new BooleanLiteral(false);
- isCast = false; // Can't be a cast now
- return this;
- }
-
- if ( delimiter == DelimiterQuote ) {
- currentExpression = new StringLiteral();
- isCast = false; // Can't be a cast now
- return currentExpression;
- }
-
- if ( delimiter == DelimiterSingleQuote ) {
- currentExpression = new CharLiteral();
- isCast = false; // Can't be a cast now
- return currentExpression;
- }
-
- if (delimiter == DelimiterPeriod && token.length == 0 && currentExpression != null){
- if (currentExpression instanceof StringLiteral){
- //String s = "\"" + (String)(currentExpression.evaluate()) + "\"" ;
- //return new Constructor(s);
- isStringObject = true;
- return this;
- }
- }
-
- if (isStringObject && (token.length > 0) && (delimiter == DelimiterOpenParen)){
- return new Message(currentExpression, token,fClassLoader);
- }
-
- //handle type casting
- if ((token.length == 0) && (delimiter == DelimiterOpenParen)){
- // If we are a already a cast then we must be a block.
- if ( isCast ) {
- currentExpression = new Block(fClassLoader);
- } else {
- isCast = true; // Possibly a cast
- }
- return this;
- }
- if (isCast && (delimiter == DelimiterCloseParen || token.length != 0)){
- Static aStatic = new Static(fClassLoader);
- Cast aCast = new Cast(aStatic,fClassLoader);
- currentExpression = aCast.push(token,delimiter);
- return currentExpression;
- }
-
- if ( token.length != 0 ) {
- currentExpression = new Static(fClassLoader).push(token,delimiter);
- return currentExpression;
- }
-
- // If we get a { then we are part of an array argument
- if (delimiter == DelimiterOpenElipse){
- currentExpression = new ArrayArguments();
- return currentExpression;
- }
-
- // If our expression is closed and we receive a . we are either a message or a field. We won't know this until
- // the next token we receive, which will be either be delimited by a ( in which case it is a message, else it is a field
- if (currentExpression != null && currentExpression.isComplete() && delimiter == DelimiterPeriod){
- messageOrFieldStarted = true;
- }
-
- return this;
-}
-
-public String toString(){
- StringBuffer buffer = new StringBuffer();
- buffer.append("Statement{"); //$NON-NLS-1$
- if ( currentExpression != null ) {
- buffer.append(currentExpression.toString());
- }
- buffer.append('}');
- return buffer.toString();
-}
-/**
- * Is this statement a primitive.
- */
-public boolean isPrimitive() throws Exception {
- if ( currentExpression != null ) {
- return currentExpression.isPrimitive();
- } else {
- throw new RuntimeException(ProxyInitParserMessages.getString(ProxyInitParserMessages.STATEMENT_UNEXPECTED_EXECUTION));
- }
-}
-}
diff --git a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/Static.java b/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/Static.java
deleted file mode 100644
index 565b788a4..000000000
--- a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/Static.java
+++ /dev/null
@@ -1,305 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.initParser;
-/*
-
-
- */
-
-
-import java.io.*;
-import java.lang.reflect.Array;
-import java.util.*;
-
-public class Static extends Expression {
- protected static final HashMap sPrimitiveTypes;
-
- static {
- sPrimitiveTypes = new HashMap(10);
- sPrimitiveTypes.put("byte", Byte.TYPE); //$NON-NLS-1$
- sPrimitiveTypes.put("char", Character.TYPE); //$NON-NLS-1$
- sPrimitiveTypes.put("short", Short.TYPE); //$NON-NLS-1$
- sPrimitiveTypes.put("int", Integer.TYPE); //$NON-NLS-1$
- sPrimitiveTypes.put("long", Long.TYPE); //$NON-NLS-1$
- sPrimitiveTypes.put("float", Float.TYPE); //$NON-NLS-1$
- sPrimitiveTypes.put("double", Double.TYPE); //$NON-NLS-1$
- }
-
- protected ArrayList arrayDimensions;
- protected List fArrayArguments;
- protected StringWriter typeWriter = new StringWriter();
- protected boolean completedWithPeriod = false;
- protected char[] completionToken;
- public Class type;
- protected boolean isComplete;
-
- public boolean isProcessingArrayDimension;
-/**
- * Create an unknown expression
- */
-public Static(ClassLoader aClassLoader){
- fClassLoader = aClassLoader;
-}
-public Static(char[] aToken,char delimiter,ClassLoader aClassLoader){
-
- fClassLoader = aClassLoader;
- try {
- typeWriter.write(aToken);
- } catch ( IOException exc ) {};
- checkForValidType();
- if ( type == null && delimiter == DelimiterPeriod ){
- typeWriter.write(DelimiterPeriod);
- }
-
-}
-public Static(char[] aToken,char delimiter,ClassLoader aClassLoader,boolean isArray){
- this(aToken,delimiter,aClassLoader);
- isProcessingArrayDimension = true;
- arrayDimensions = new ArrayList(1);
- arrayDimensions.add(new Statement(aClassLoader));
-}
-
-public boolean isComplete(){
- return isComplete;
-}
-public boolean isArray(){
- return arrayDimensions != null;
-}
-/**
- * See whether or not we have a valid type
- * This uses the class loader given to us if one specified. The reason for this
- * is that Eclipse uses a special plugin class loader and when we are running
- * in a VM inside eclipse ( e.g. for IDEVM proxy stuff ) we must have
- * reference to the plugin that is using us otherwise we can't load its classes
- */
-protected void checkForValidType(){
-
- type = (Class) sPrimitiveTypes.get(typeWriter.toString());
- if (type == null)
- try {
- if ( fClassLoader == null ) {
- type = Class.forName(typeWriter.toString());
- } else {
- type = fClassLoader.loadClass(typeWriter.toString());
- }
- } catch ( ClassNotFoundException exc ) {
- try {
- type = Class.forName("java.lang." + typeWriter.toString()); //$NON-NLS-1$
- StringWriter writer = new StringWriter();
- writer.write(type.getName());
- typeWriter = writer;
- } catch ( ClassNotFoundException exc1 ) {}
- } catch ( NoClassDefFoundError exc ) {
- // A mismatch in some way. Found a class, probably different case. One possibility
- // is found a class, but this was really a package. So class and package with same name
- // but different case caused this to occur. [46376].
- }
-
-}
-/**
- * If we have any static methods return the result of evaluating them against the type
- */
-public Object evaluate() {
-
- // If we are an array but haven't created it do so
- if ( isArray() ) {
- if ( array == null ) {
- evaluateArray();
- }
- return array;
- } else {
- if ( type != null ) {
- return type;
- } else {
- // If we have no type then we are some kind incomplete expression that cannot be evaluted
- throw new RuntimeException();
- }
- }
-}
-/**
- * The type of us is either simply the class, or if we are an array then we must create the java.lang.reflect.Array
- * using the reflective APIs
- */
-protected Object array;
-public Class getTypeClass() {
-
- if ( isArray() ) {
- if ( array == null ) {
- // Do not evaluate the array and return its class. Instead just work out the class by our type
- // and number of dimensions
- Object result = Array.newInstance(type,getNumberOfDimensions());
- return result.getClass();
- } else {
- return array.getClass();
- }
- } else {
- return type;
- }
-}
-
-protected String getTypeClassName() {
- return typeWriter.toString();
-}
-public Class getPrimitiveTypeClass(){
- return type;
-}
-protected int[] getNumberOfDimensions(){
- List dimensions = new ArrayList(1);
- dimensions.add(new Integer(fArrayArguments.size()));
- ((MessageArgument)fArrayArguments.get(0)).contributeArgumentNumber(dimensions);
- // The total number of arguments is a set of Integer objects in the dimensions list
- // convert this to an int[]
- int[] intDimensions = new int[dimensions.size()];
- for (int i = 0; i < dimensions.size(); i++) {
- intDimensions[i] = ((Integer)dimensions.get(i)).intValue();
- }
- return intDimensions;
-}
-/**
- * Evaluate the array
- */
-protected void evaluateArray(){
- if ( fArrayArguments != null ) {
- // If the array isn't declared with a size but this is supplied with argument these will be in the fArrayArguments
- // new int[] { 2 ,3 } will have the constructor arguments supplied as two message arguments with
- if ( array == null ) {
- // The size of the array arguments is our array size, however for a multi arg array we need
- // to find the size of any nested arrays within arguments themselves, e.g.
- // new int[][] { {2,3} , {3,4} } then we have two array arguments, each of which is a MessageArgument
- // whose statement is an ArrayArguments that has two arguments, etc...
- // To find the number of arguments we create a list that we add our number of arguments to, and then
- // pass this all the way up the arguments chain using contributeArgumentNumber(List) so that each element
- // can add to the list the number of arguments ( if any ) that they have.
- array = Array.newInstance(type,getNumberOfDimensions());
- // Set the elements in the array to be the result of evaluating the constructor arguments
- for (int i = 0; i < fArrayArguments.size(); i++) {
- Expression expression = (Expression)fArrayArguments.get(i);
- try {
- Object element = expression.evaluate();
- Array.set(array,i,element);
- } catch ( Exception exc ) {
- // Any evaluation exceptions should be thrown back
- throw new RuntimeException();
- }
- }
- }
- } else if ( arrayDimensions != null ) {
- // To get the class of a reflective array we must actually first create it and then ask it for its class
- // The array Dimensions are present if the array was explicitly declared with a size, e.g. new int[2][3]
- // will have to arrayDimensions that represent the expressions 2 and 3 ( as NumberLiteral instances )
- if ( array == null ) {
- // Evaluate all of the arrayDimensions. These should be integers
- int[] dimensionSizes = new int[arrayDimensions.size()];
- for (int i = 0; i < dimensionSizes.length; i++) {
- try {
- Integer dimensionSize = (Integer) ((Expression)arrayDimensions.get(i)).evaluate();
- dimensionSizes[i] = dimensionSize.intValue();
- } catch ( Exception exc ) {
- throw new RuntimeException();
- }
- }
- // For a multi arg array we need to create using the static method on array that takes an int[] that represents
- // the number of dimensions, e.g. for new String[2][3] we do Array.newInstance(String.class,new int[] { 2 , 3 };
- array = Array.newInstance(type,dimensionSizes);
- }
- }
-}
-/**
- * If the token is a period then it could either be part of the type or else a static method call
- */
-public Expression push(char[] token , char delimiter ) {
-
- // If we don't yet have a valid type then see if we now do
- if (type == null){
- try {
- typeWriter.write(token);
- } catch ( IOException exc ) {};
- checkForValidType();
- // If we got a valid type and a period then remember it
- if ( delimiter == DelimiterPeriod ) {
- if (type != null) {
- completedWithPeriod = true;
- return this;
- }
- }
- }
-
- if ( arrayDimensions != null && isProcessingArrayDimension ) {
- Expression lastArrayDimension = (Expression)arrayDimensions.get(arrayDimensions.size()-1);
- lastArrayDimension.push(token,delimiter);
- if ( delimiter == DelimiterCloseSquareBrace && isProcessingArrayDimension ) {
- isProcessingArrayDimension = false;
- }
- return this;
- }
-
- if ( delimiter == DelimiterOpenSquareBrace && !isProcessingArrayDimension ) {
- if ( arrayDimensions == null ) arrayDimensions = new ArrayList(1);
- Statement statement = new Statement(fClassLoader);
- arrayDimensions.add(statement);
- isProcessingArrayDimension = true;
- return this;
- }
-
- // If we have a type and the delimiter is a ( then it must be a message beginning
- if ( type != null ) {
- if (delimiter == DelimiterOpenParen) {
- isComplete = true;
- return new Message( this , token , fClassLoader );
- } else if (completedWithPeriod){
- isComplete = true;
- Field field = new Field(this,token,fClassLoader);
- // If our token is a ), ' ' or , then the field is completed,
- // otherwise leave it open so it will process the remaining tokens
-// if (delimiter == DelimiterCloseParen || delimiter == DelimiterSpace || delimiter == DelimiterComma) {
- if (delimiter == DelimiterCloseParen || delimiter == DelimiterComma) {
- field.isComplete = true;
- }
- return field;
- }
- }
-
- // We are still looking for a type so append a .
- if ( type == null ) {
- typeWriter.write('.');
- }
- return this;
-}
-public String toString(){
-
- StringWriter writer = new StringWriter();
- writer.write("Static "); //$NON-NLS-1$
- if ( type == null ) {
- writer.write("(Incomplete) {"); //$NON-NLS-1$
- } else {
- writer.write("(Complete) {"); //$NON-NLS-1$
- }
- writer.write(typeWriter.toString());
- writer.write("}"); //$NON-NLS-1$
- if ( arrayDimensions != null ) {
- writer.write(" array dimensions="); //$NON-NLS-1$
- writer.write(new Integer(arrayDimensions.size()).toString());
- }
- if ( fArrayArguments != null ) {
- writer.write(" array dimensions="); //$NON-NLS-1$
- writer.write(new Integer(fArrayArguments.size()).toString());
- }
- return writer.toString();
-
-}
-
-public boolean isPrimitive() {
- return getTypeClass().isPrimitive();
-}
-public void setArrayArguments(List arguments) {
- fArrayArguments = arguments;
-}
-}
diff --git a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/StringLiteral.java b/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/StringLiteral.java
deleted file mode 100644
index 14c73df0b..000000000
--- a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/StringLiteral.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.initParser;
-/*
-
-
- */
-
-
-
-public class StringLiteral extends Expression {
- protected boolean isComplete;
- public String value;
- public StringBuffer valueBuffer = new StringBuffer();
- protected boolean isEscaped = false;
-
-/**
- * constructor
- */
-public StringLiteral(){
-}
-
-/**
- * evaluate method comment.
- */
-public Object evaluate() {
- return valueBuffer.toString();
-}
-
-public boolean isComplete(){
- return isComplete;
-}
-/**
- * We must evaluate ourself and return the type of the result
- */
-
-public Class getTypeClass() {
- return String.class;
-}
-
-protected String getTypeClassName() {
- return String.class.getName();
-}
-
-/**
- *This string might be broken into a few tokens
- *so we need a StringBuffer.
- *
- */
-public Expression push(char[] token , char delimiter){
- int appendTokenStart = 0;
- int appendTokenLength = token.length;
- if (isEscaped) {
- isEscaped = false;
- if (token.length != 0) {
- char c = token[0];
- switch (c) {
- case 'b':
- valueBuffer.append('\b');
- appendTokenStart = 1;
- appendTokenLength--;
- break;
- case 't':
- valueBuffer.append('\t');
- appendTokenStart = 1;
- appendTokenLength--;
- break;
- case 'n':
- valueBuffer.append('\n');
- appendTokenStart = 1;
- appendTokenLength--;
- break;
- case 'r':
- valueBuffer.append('\r');
- appendTokenStart = 1;
- appendTokenLength--;
- break;
- case 'u':
- // Unicode, next four gather for text;
- if (appendTokenLength>=5) {
- valueBuffer.append((char) Integer.parseInt(new String(token, 1, 4), 16));
- appendTokenStart=5;
- appendTokenLength-=5;
- }
- break;
- }
- // If we didn't append anything, then not a true escape, so put the escape on.
- if (appendTokenStart==0)
- valueBuffer.append(DelimiterEscape);
- } else {
- if (delimiter == DelimiterQuote || delimiter == DelimiterEscape || delimiter == DelimiterSingleQuote)
- valueBuffer.append(delimiter); // It was a true escape.
- else {
- valueBuffer.append(DelimiterEscape); // If wasn't a true escape
- valueBuffer.append(delimiter);
- }
- return this;
- }
- }
-
- if (appendTokenLength > 0)
- valueBuffer.append(token, appendTokenStart, appendTokenLength);
-
- if (delimiter == DelimiterQuote){
- isComplete =true;
- return this;
- }
-
- // If the delimiter is an escape character remember it so we can escape
- // the next token, otherwise treat it as a literal
- if (delimiter == DelimiterEscape ){
- isEscaped = true;
- } else {
- valueBuffer.append(delimiter);
- }
- return this;
-}
-
-/**
- * Strings are not primitives.
- */
-public boolean isPrimitive() {
- return false;
-}
-public String toString(){
- StringBuffer buffer = new StringBuffer();
- buffer.append("String(\""); //$NON-NLS-1$
- if ( valueBuffer != null ) {
- buffer.append(valueBuffer.toString());
- }
- buffer.append("\""); //$NON-NLS-1$
- return buffer.toString();
-}
-}
diff --git a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/messages.properties b/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/messages.properties
deleted file mode 100644
index caa692355..000000000
--- a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/messages.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-###############################################################################
-# Copyright (c) 2003, 2005 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: /cvsroot/webtools/jeetools.move/webtools.javaee.git/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/messages.properties,v $
-# $Revision: 1.6 $ $Date: 2005/08/24 20:39:07 $
-#
-
-
-#
-# Properties for the Proxy Base VM Support
-#
-UnexpectedToken_EXC_ = IWAV0127E Unexpected Token "{0}".
-Statement.UnexpectedExecution_EXC_ = IWAV0128E Statement was executed unexpectedly.
-Statement.UnexpectedEvaluation_EXC_ = IWAV0129E Statements should not be evaluated.
-CharTooComplicated_EXC_ = IWAV0130E Input text not a char that can be evaluated. Too complicated. \"{0}"
-PrimitiveOperation.Evaluate.InvalidOperator_EXC_=Invalid operator {0} between {1} and {2}
diff --git a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/tree/AbstractEnum.java b/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/tree/AbstractEnum.java
deleted file mode 100644
index 451e751a8..000000000
--- a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/tree/AbstractEnum.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 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.jem.internal.proxy.initParser.tree;
-
-/**
- * Base abstract implementation of the enum.
- * @since 1.1.0
- */
-public abstract class AbstractEnum implements Enum {
-
- /**
- * The name of the enumerator.
- */
- private final String name;
-
- /**
- * The <code>int</code> value of the enumerator.
- */
- private final int value;
-
- /**
- * Creates an initialized instance.
- *
- * @param value
- * the <code>int</code> value of the enumerator.
- * @param name
- * the name of the enumerator.
- */
- protected AbstractEnum(int value, String name) {
- this.name = name;
- this.value = value;
- }
-
- /**
- * Returns the name of the enumerator.
- *
- * @return the name.
- */
- public final String getName() {
- return name;
- }
-
- /**
- * Returns the <code>int</code> value of the enumerator.
- *
- * @return the value.
- */
- public final int getValue() {
- return value;
- }
-
- /**
- * Returns the name of the enumerator.
- *
- * @return the name.
- */
- public final String toString() {
- return name;
- }
-
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/tree/Enum.java b/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/tree/Enum.java
deleted file mode 100644
index 8ffa63cbc..000000000
--- a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/tree/Enum.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 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.jem.internal.proxy.initParser.tree;
-
-/**
- * TypeSafe enumerations for the IExpression processing.
- *
- * @since 1.1.0
- */
-public interface Enum {
-
- /**
- * Returns the name of the enumerator.
- *
- * @return the name.
- */
- String getName();
-
- /**
- * Returns the <code>int</code> value of the enumerator.
- *
- * @return the value.
- */
- int getValue();
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/tree/ExpressionProcesser.java b/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/tree/ExpressionProcesser.java
deleted file mode 100644
index 0c553ff59..000000000
--- a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/tree/ExpressionProcesser.java
+++ /dev/null
@@ -1,3364 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 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.jem.internal.proxy.initParser.tree;
-
-import java.lang.reflect.*;
-import java.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jem.internal.proxy.common.*;
-import org.eclipse.jem.internal.proxy.initParser.InitializationStringEvaluationException;
-import org.eclipse.jem.internal.proxy.initParser.InitializationStringParser;
-
-/**
- * Expression processing. This does the actual expression processing with the live objects.
- * It is meant to be subclassed only to provide additional expression types. All of the
- * current expressions cannot be overridden. This is because the stack is very sensitive to
- * call order.
- *
- * @since 1.0.0
- */
-public class ExpressionProcesser {
-
- /**
- * A variable reference for a field access.
- *
- * @since 1.1.0
- */
- protected static class FieldAccessReference extends VariableReference {
-
- private final Field field;
- private final Object receiver;
-
- /**
- * Use this to construct a FieldAccessReference. This will do checks to make sure
- * it is valid so that exceptions won't be thrown later when actually dereferenced.
- *
- * @param field
- * @param receiver
- * @return
- * @throws IllegalArgumentException
- *
- * @since 1.1.0
- */
- public static FieldAccessReference createFieldAccessReference(Field field, Object receiver) throws IllegalArgumentException {
- // If static, then receiver is ignored.
- if (!Modifier.isStatic(field.getModifiers())) {
- if (!field.getDeclaringClass().isInstance(receiver))
- throw new IllegalArgumentException(MessageFormat.format(InitparserTreeMessages.getString("ExpressionProcesser.CreateFieldAccessReference.FieldsTypesNotMatching_EXC_"), new Object[]{field.getType(), (receiver!=null ? receiver.getClass() : null)})); //$NON-NLS-1$
- }
- field.setAccessible(true); // Make it always accessible. Trust it.
- return new FieldAccessReference(field, receiver);
- }
-
- protected FieldAccessReference(Field field, Object receiver) {
- this.field = field;
- this.receiver = receiver;
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.initParser.tree.ExpressionProcesser.VariableReference#dereference()
- */
- public Object dereference() {
- try {
- return field.get(receiver);
- } catch (IllegalArgumentException e) {
- // Shouldn't occur. Already tested for this.
- e.printStackTrace();
- } catch (IllegalAccessException e) {
- // Shouldn't occur. Already tested for this.
- e.printStackTrace();
- }
- return null;
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.initParser.tree.ExpressionProcesser.VariableReference#set(java.lang.Object, java.lang.Class)
- */
- public Object set(Object value, Class type) throws IllegalArgumentException, IllegalAccessException {
- field.set(receiver, value);
- return field.get(receiver); // Just in case some conversion happened. Technically it is not the value set but the retrieved when in an assignment.
- }
-
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- public String toString() {
- return "FieldAccess{"+field.toString()+"} on "+(receiver != null ? receiver.toString() : "<static access>"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- }
-
- /**
- * A variable reference for an Array access. It will reference only the last indexed entry of the array.
- * For example if <code>x[3][4]</code> is the access, then what will be given to this reference will be
- * the array entry at x[3][4], not the x array itself.
- *
- * @since 1.1.0
- */
- protected static class ArrayAccessReference extends VariableReference {
-
-
- private final Object array;
- private final int index;
-
- /**
- * Use this to construct an array access reference. This will do checks to make sure
- * it is valid so that exceptions won't be thrown later when actually dereferenced.
- *
- * @param array
- * @param index
- * @return
- * @throws IllegalArgumentException
- *
- * @since 1.1.0
- */
- public static ArrayAccessReference createArrayAccessReference(Object array, int index) throws IllegalArgumentException, ArrayIndexOutOfBoundsException {
- int len = Array.getLength(array);
- if (index < 0 || len <= index)
- throw new ArrayIndexOutOfBoundsException(MessageFormat.format(InitparserTreeMessages.getString("ExpressionProcesser.CreateArrayAccessReference.OutOfBounds_EXC_"), new Object[]{new Integer(index), new Integer(len)})); //$NON-NLS-1$
- return new ArrayAccessReference(array, index);
- }
- /**
- * Construct the reference with the array and the index of the entry being referenced.
- * @param array
- * @param index
- *
- * @since 1.1.0
- */
- protected ArrayAccessReference(Object array, int index) {
- this.array = array;
- this.index = index;
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.initParser.tree.VariableReference#dereference()
- */
- public Object dereference() {
- return Array.get(array, index);
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.initParser.tree.VariableReference#set(java.lang.Object, java.lang.Class)
- */
- public Object set(Object value, Class type) throws IllegalArgumentException {
- Array.set(array, index, value);
- return Array.get(array, index); // In case there was some conversion applied. Technically it is not the value set but the retrieved when in an assignment.
- }
-
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- public String toString() {
- return "ArrayAccess["+index+"]: "+array.toString(); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- /**
- * The expression result stack and the expression result type stack.
- * The type stack is used to be expected type of the corresponding
- * expression result. This is needed for converting to primitives
- * and for finding correct method call from the argument types. In
- * this case, it is not the true value, but the value expected, e.g.
- * <code>Object getObject()</code> returns something of type Object.
- * This needs to be maintained so that if it goes into another method
- * we don't accidently return a more specific method instead of the
- * one that takes Object as an argument.
- *
- * expressionStack has result of the expression.
- * expressionTypeStack has the computed type of the expression i.e.
- * the type that the expression returns, not the type of the value.
- * These can be different because the expression (e.g. method) may
- * return an Object, but the expression value will be some specific
- * subclass. So the expressionTypeStack would have a <code>java.lang.Object.class</code>
- * on it in that case.
- * Note: if the expressionStack has a <code>null</code> on it, then the type stack
- * may either have a specific type in it, or it may be <code>MethodHelper.NULL_TYPE</code>. It
- * would be this if it was explicitly pushed in and not as the
- * result of a computation. If the result of a computation, it would have the
- * true value.
- * Note: if the expressionStack has a <code>Void.type</code> on it, then that
- * means the previous expression had no result. This is an error if trying to
- * use the expression in another expression.
- *
- * @see org.eclipse.jem.internal.proxy.initParser.MethodHelper#NULL_TYPE
- */
- private List expressionStack = new ArrayList(10);
- private List expressionTypeStack = new ArrayList(10);
-
- /**
- * List of the expression proxies. The index into the list is the
- * same as the expression proxy id.
- */
- private ArrayList expressionProxies; // It is array list because we want to call ensureCapacity and that is not available on List.
-
- /**
- * An error has occurred. At this point all subcommands will simply make sure they flush the input stream
- * correctly, but they do not process it.
- *
- * @since 1.0.0
- */
- private boolean errorOccurred = false;
- private boolean novalueException = false;
-
- private Throwable exception = null; // Was there another kind of exception that was caught.
-
- /**
- * Process all other exceptions then the NoExpressionValueException. This can be called from usage code so that if there was an error
- * in setting up for a call to the processer it can be logged.
- *
- * @param e
- *
- * @since 1.0.0
- */
- public final void processException(Throwable e) {
- // Process all other exceptions.
- novalueException = false;
- while (e.getCause() != null)
- e = e.getCause();
- if (traceOn) {
- System.out.println();
- System.out.print("***** >>>\tException: "); //$NON-NLS-1$
- System.out.println(e);
- }
- throwException(e); // Treat as a throw to let try/catches expressions handle it.
- }
-
- /**
- * This is a syntax exception. This means data coming across is corrupted in
- * some way so no further processing should occur.
- * @param e
- *
- * @since 1.1.0
- */
- protected final void processSyntaxException(Throwable e) {
- errorOccurred = true;
- novalueException = false;
- exception = e;
- }
-
- /**
- * Process a NoExpressionValueException. Don't wrapper these.
- * @param e
- *
- * @since 1.1.0
- */
- protected final void processSyntaxException(NoExpressionValueException e) {
- if (traceOn) {
- // This can happen at any time, so make sure we are on a new line.
- System.out.println();
- printTrace("Expression has no value", false); //$NON-NLS-1$
- }
- try {
- errorOccurred = true;
- novalueException = true;
- exception = e;
- } finally {
- if (traceOn)
- printTraceEnd();
- }
- }
-
- /**
- * Return whether there are any errors.
- *
- * @return <code>true</code> if no errors.
- *
- * @since 1.0.0
- */
- public boolean noErrors() {
- return !errorOccurred;
- }
-
- /**
- * Return whether the error is a NoExpressionValueException or not.
- * @return
- *
- * @since 1.1.0
- */
- public boolean isNoExpressionValue() {
- return novalueException;
- }
-
- /**
- * Return the throwable if a Throwable was caught.
- *
- * @return The throwable, or <code>null</code> if not set.
- *
- * @since 1.0.0
- */
- public Throwable getErrorThrowable() {
- return exception;
- }
-
- /**
- * Push the expression value and its expected type.
- * @param o
- * @param type
- *
- * @since 1.0.0
- */
- protected final void pushExpressionValue(Object o, Class type) {
- expressionStack.add(o);
- expressionTypeStack.add(type);
- }
-
- /**
- * Pop just the expression value. It is imperitive that the expression type
- * is popped immediately following. Separated the methods so that we
- * don't need to create an array to return two values. This will dereference
- * any variable references.
- *
- * @return The value.
- * @throws NoExpressionValueException
- *
- * @since 1.0.0
- */
- protected final Object popExpression() throws NoExpressionValueException {
- return popExpression(true);
- }
-
- /**
- * Pop just the expression value. It is imperitive that the expression type
- * is popped immediately following. Separated the methods so that we
- * don't need to create an array to return two values.
- *
- * @param deReference If the top expression is a Reference, then dereference it.
- * @return The value.
- * @throws NoExpressionValueException
- *
- * @since 1.0.0
- */
- protected final Object popExpression(boolean deReference) throws NoExpressionValueException {
- try {
- // Do not pop above the current subexpression pos, if any.
- if (topSubexpression != -1)
- if (expressionStack.size() == subexpressionStackPos[topSubexpression])
- throw new NoExpressionValueException();
-
- Object result = expressionStack.remove(expressionStack.size()-1);
- if (deReference && result instanceof VariableReference)
- result = ((VariableReference) result).dereference();
- return result;
- } catch (IndexOutOfBoundsException e) {
- throw new NoExpressionValueException();
- }
- }
-
- /**
- * Get the expression at <code>fromTop</code> down from the top. This is
- * need for when multi-operators happen and they are stored in reverse of
- * what is needed. They would normally be stored left to right, with the
- * rightmost one on top. But they need to be processed left to right, so
- * to get the left most one requires digging down in the stack.
- * <p>
- * When done, <code>popExpressions(int count)</code> must be called to
- * clean them out since they were processed.
- * <p>
- * This will not dereference the expression. It is the job of the caller to do this.
- *
- * @param fromTop <code>1</code> is the top one, <code>2</code> is the next one down.
- * @return The entry from the top that was requested.
- * @throws NoExpressionValueException
- *
- * @see IDEExpression#popExpressions(int)
- * @since 1.0.0
- */
- protected final Object getExpression(int fromTop) throws NoExpressionValueException {
- try {
- // Do not pull above the current subexpression pos, if any.
- if (topSubexpression != -1)
- if (expressionStack.size()-fromTop < subexpressionStackPos[topSubexpression])
- throw new NoExpressionValueException();
-
- return expressionStack.get(expressionStack.size()-fromTop);
- } catch (IndexOutOfBoundsException e) {
- throw new NoExpressionValueException();
- }
- }
-
- /**
- * Remove the top <code>count</code> items. This will not cause dereferencing to occur. It
- * removes the corresponding type stack entries.
- *
- * @param count
- * @throws NoExpressionValueException
- *
- * @since 1.0.0
- */
- protected final void popExpressions(int count) throws NoExpressionValueException {
- try {
- // Do not pop above the current subexpression pos, if any.
- int stop = topSubexpression != -1 ? subexpressionStackPos[topSubexpression] : -1;
- int remove = expressionStack.size()-1;
- while (count-- > 0) {
- if (expressionStack.size() <= stop)
- throw new NoExpressionValueException(); // Try to go above the current subexpression.
- expressionStack.remove(remove);
- expressionTypeStack.remove(remove--);
- }
- } catch (IndexOutOfBoundsException e) {
- throw new NoExpressionValueException();
- }
- }
-
- /**
- * Pop just the expression type. It is imperitive that the expression type
- * is popped immediately following popExpression. Separated the methods so that we
- * don't need to create an array to return two values.
- * <p>
- * If the allowVoid is false and type is void, then a NoExpressionValueException will be thrown.
- * This is for the case where the expression was trying to be used in a different
- * expression. This will be set to void only on expressions that return no value (only
- * method's do this for now).
- *
- * @param allowVoid Allow void types if <code>true</code>
- * @return The type.
- * @throws NoExpressionValueException
- * @since 1.0.0
- */
- protected final Class popExpressionType(boolean allowVoid) throws NoExpressionValueException {
- try {
- Class result = (Class) expressionTypeStack.remove(expressionTypeStack.size()-1);
- if (!allowVoid && result == Void.TYPE)
- throw new NoExpressionValueException(InitparserTreeMessages.getString("ExpressionProcesser.PopExpressionType.ExpressionVoid_EXC_")); //$NON-NLS-1$
- return result;
-
- } catch (IndexOutOfBoundsException e) {
- throw new NoExpressionValueException();
- }
- }
-
- /**
- * Get the expression type at <code>fromTop</code> down from the top. This is
- * need for when multi-operators happen and they are stored in reverse of
- * what is needed. They would normally be stored left to right, with the
- * rightmost one on top. But they need to be processed left to right, so
- * to get the left most one requires digging down in the stack.
- * <p>
- * When done, <code>popExpressionTypes(int count)</code> must be called to
- * clean them out since they were processed.
-
- * @param fromTop <code>1</code> is the top one, <code>2</code> is the next one down.
- * @param allowVoid Allow void types if <code>true</code>
- * @return The type from the top that was requested.
- * @throws ThrowableProxy
- * @throws NoExpressionValueException
- *
- * @see IDEExpression#popExpressionTypes(int)
- * @since 1.0.0
- */
- protected final Class getExpressionType(int fromTop, boolean allowVoid) throws NoExpressionValueException {
- try {
- Class result = (Class) expressionTypeStack.get(expressionTypeStack.size()-fromTop);
- if (!allowVoid && result == Void.TYPE)
- throw new NoExpressionValueException();
- return result;
- } catch (IndexOutOfBoundsException e) {
- throw new NoExpressionValueException();
- }
- }
-
- /**
- * Flag indicating expression should be ignored and not processed.
- * This happens because of few cases, like conditional and, that
- * if one returns false, the rest of the expressions in that conditional and
- * expression should be ignored and not processed.
- * <p>
- * It is an Object that acts as an enum for the type of expression that initiated the ignore.
- * If it is <code>null</code> then no one is ignoring.
- * <p>
- * All of the pushTo...Proxy methods must test this for this to work correctly.
- * Each expression has some way of testing that their particular nesting of
- * expressions is complete and they can turn off the ignore flag.
- * <p>
- * Only one type of ignore can exist at a time.
- */
- protected Object ignoreExpression = null;
-
-
- private List saveStates;
-
- /**
- * Are we tracing or not.
- */
- protected final boolean traceOn;
- private final long thresholdTime;
- private long startExpressionStepTime;
- private long startExpressionTime;
- private long lastExpressionEndTime;
-
- /**
- * Trace head of this expression. So that traces from different expressions can be distinquished.
- * It is simply an monotonically increasing counter. It is the header string for any trace output.
- */
- protected final String traceHeader;
-
- private int indent = 0; // Indented for certain block expressions.
-
- /*
- * Trace counter. It is incremented once for each expression and assigned to the traceId of the expression.
- */
- private static int TRACE_COUNTER;
-
- /**
- * Create the Expression without tracing.
- * @param registry
- *
- * @since 1.0.0
- */
- public ExpressionProcesser() {
- this(false, -1);
- }
-
- /**
- * Create the expression, and set the tracing mode and threshold time. Use -1
- * for default time of 100ms.
- * @param traceOn
- *
- * @since 1.1.0
- */
- public ExpressionProcesser(boolean traceOn, long threshold) {
- this.traceOn = traceOn;
- if (traceOn) {
- traceHeader = "**"+(++TRACE_COUNTER)+':'; //$NON-NLS-1$
- System.out.print(traceHeader);
- System.out.println(" Start expression"); //$NON-NLS-1$
- this.thresholdTime = threshold != -1 ? threshold : 100;
- lastExpressionEndTime = startExpressionTime = System.currentTimeMillis();
- } else {
- traceHeader = null;
- thresholdTime = 100;
- }
- }
-
- /**
- * Trace msg helper. Should only be called if traceOn is true. This method is only used to start a new trace message.
- * The caller is must call printTraceEnd at the end.
- *
- * @param msg message to print
- * @param ignore are we ignoring the expression, or is it being processed (this just alters the trace output slightly).
- *
- * @since 1.1.0
- */
- protected void printTrace(String msg, boolean ignore) {
- startExpressionStepTime = System.currentTimeMillis();
- long sinceLastExpression = startExpressionStepTime - lastExpressionEndTime;
- System.out.print(traceHeader);
- if (sinceLastExpression > 0) {
- System.out.print('(');
- if (sinceLastExpression > thresholdTime)
- System.out.print("***"); //$NON-NLS-1$
- System.out.print(sinceLastExpression);
- System.out.print("ms)"); //$NON-NLS-1$
- }
- System.out.print('\t');
- if (!ignore)
- System.out.print("\t"); //$NON-NLS-1$
- else
- System.out.print("##\t"); //$NON-NLS-1$
-
- printIndent();
- System.out.print(msg);
- }
-
- /**
- * print the indent. It will not do a new line before nor after.
- *
- * @since 1.1.0
- */
- protected void printIndent() {
- for(int i=indent; i>0; i--) {
- System.out.print(" "); //$NON-NLS-1$
- }
- }
-
- protected void printTraceEnd() {
- long stop = System.currentTimeMillis()-startExpressionStepTime;
- if (stop > 0) {
- System.out.print(" ("); //$NON-NLS-1$
- if (stop > thresholdTime)
- System.out.print("***"); //$NON-NLS-1$
- System.out.print(stop);
- System.out.print("ms)"); //$NON-NLS-1$
- }
- System.out.println();
- lastExpressionEndTime = System.currentTimeMillis();
- }
-
- /**
- * Do an indent (undent) according to indent flag.
- * @param indent <code>true</code> to increment indent, or otherwise decrement.
- *
- * @since 1.1.0
- */
- protected void indent(boolean indent) {
- this.indent += (indent ? 1 : -1);
- if (this.indent < 0)
- this.indent = 0;
- }
-
- /**
- * Print the object and type. It will not end with a newline char, so one will be needed afterwards.
- *
- * @param o
- * @param t
- *
- * @since 1.1.0
- */
- protected void printObjectAndType(Object o, Class t) {
- System.out.print(' ');
- System.out.print("Object-"); //$NON-NLS-1$
- System.out.print(o);
- System.out.print(" Type-"); //$NON-NLS-1$
- System.out.print(t);
- System.out.print(' ');
- }
-
- /**
- * Close the exception processing
- *
- * @since 1.0.0
- */
- public final void close() {
- boolean firstClose = expressionStack != null;
- if (firstClose && traceOn) {
- printTrace("End expression", false); //$NON-NLS-1$
- long totalTime = System.currentTimeMillis()-startExpressionTime;
- System.out.print(" Total expression evaluation time: "); //$NON-NLS-1$
- System.out.print(totalTime);
- System.out.print("ms."); //$NON-NLS-1$
- }
- try {
- expressionStack = null;
- expressionTypeStack = null;
- expressionProxies = null;
- exception = null;
- catchThrowable = null;
- saveStates = null;
- } finally {
- if (firstClose && traceOn)
- printTraceEnd();
- }
- }
-
- /**
- * Pull the value. The value will be placed into the array passed in.
- * It will be stored as value[0] = value value[1] = valuetype(Class).
- *
- * @param value The value array to store the value and type into.
- * @throws NoExpressionValueException
- * @since 1.0.0
- */
- public final void pullValue(Object[] value) throws NoExpressionValueException {
- if (traceOn)
- printTrace("Pull value:", false); //$NON-NLS-1$
- try {
- value[0] = popExpression();
- value[1] = popExpressionType(false);
- } finally {
- if (traceOn) {
- printObjectAndType(value[0], (Class) value[1]);
- printTraceEnd();
- }
- }
- close();
- }
-
- /**
- * Pull the value of the expression proxy, dereferencing it if necessary. This is for resolution only purposes at the
- * end of the expression being processed. Not meant for general access to the value of expression proxy. Use
- * {@link ExpressionProcesser#getExpressionProxyValue(int, Object[])} instead for general access to the value.
- *
- * @param proxyid
- * @param value
- * @throws NoExpressionValueException
- *
- * @since 1.1.0
- */
- public final void pullExpressionProxyValue(int proxyid, Object[] value) throws NoExpressionValueException {
- getExpressionProxyValue(proxyid, value, true, true);
- }
-
- /**
- * Get the expression proxy value. If the expression has not yet been evaluated it will
- * return false. If it has it will return true.
- * @param proxyid
- * @param value put value into value[0] and the type into value[1].
- * @return <code>true</code> if successful, or <code>false</code> if the expression proxy was never resolved or doesn't exist.
- *
- * @since 1.1.0
- */
- public boolean getExpressionProxyValue(int proxyid, Object[] value) {
- try {
- return getExpressionProxyValue(proxyid, value, true, false);
- } catch (NoExpressionValueException e) {
- return false;
- }
- }
-
- /**
- * Get the expression proxy value, or the NoExpressionValueException if not resolved. This
- * is useful for callers that need to handle the proxy itself for failed calls.
- *
- * @param proxyid
- * @param value
- * @throws NoExpressionValueException
- *
- * @since 1.1.0
- */
- public void getExpressionProxy(int proxyid, Object[] value) throws NoExpressionValueException {
- getExpressionProxyValue(proxyid, value, true, false);
- }
-
- /*
- * Internal method use to actually get the value, but to distinquish between pull and get of the public interface.
- * Get will process the errors as normal execution errors, while pull will throw the errors. finalTrace is when
- * this is the final call to return the values to the client. We will trace the results in that case.
- * Return true if successful.
- */
- private boolean getExpressionProxyValue(int proxyid, Object[] value, boolean pull, boolean finalTrace) throws NoExpressionValueException {
- // Note: This will throw the exceptions right away since this is called from outside to fill in the value and
- // so we are holding such exceptions.
- boolean doTrace = finalTrace && traceOn;
- try {
- if (expressionProxies != null && expressionProxies.size() > proxyid) {
- InternalExpressionProxy proxy = (InternalExpressionProxy) expressionProxies.get(proxyid);
- if (proxy != null && proxy.isSet()) {
- value[0] = proxy.getValue();
- if (value[0] instanceof VariableReference)
- value[0] = ((VariableReference) value[0]).dereference(); // Here we want the final current value.
- value[1] = proxy.getType();
- if (doTrace)
- if (value[1] != Void.TYPE) {
- printTrace("Return Proxy #" + proxyid + " Resolved to", false); //$NON-NLS-1$ //$NON-NLS-2$
- printObjectAndType(value[0], (Class) value[1]);
- } else
- printTrace("Return Proxy #" + proxyid + " Resolved to void.", false); //$NON-NLS-1$ //$NON-NLS-2$
- return true;
-
- } else {
- if (doTrace)
- printTrace("Return Proxy #" + proxyid + ": Not resolved", false); //$NON-NLS-1$ //$NON-NLS-2$
- NoExpressionValueException e = new NoExpressionValueException(InitparserTreeMessages.getString("ExpressionProcesser.GetExpressionProxyValue.ExpressionProxyNotSet_EXC_"), proxy); //$NON-NLS-1$
- if (pull)
- throw e;
- else
- processSyntaxException(e);
- return false;
- }
- } else {
- if (doTrace)
- printTrace("Return Proxy #" + proxyid + ": Never created.", false); //$NON-NLS-1$ //$NON-NLS-2$
- NoExpressionValueException e = new NoExpressionValueException(InitparserTreeMessages.getString("ExpressionProcesser.GetExpressionProxyValue.ExpressionProxyDoesntExist_EXC_")); //$NON-NLS-1$
- if (pull)
- throw e;
- else
- processSyntaxException(e);
- return false;
- }
- } finally {
- if (doTrace)
- printTraceEnd();
- }
- }
-
- /**
- * Push the expression (just a value) onto the stack.
- *
- * @param o
- * @param t
- *
- * @since 1.0.0
- */
- public final void pushExpression(Object o, Class t) {
- boolean ignore = (ignoreExpression != null || errorOccurred);
- if (traceOn) {
- printTrace("Push: ", ignore); //$NON-NLS-1$
- printObjectAndType(o, t);
- }
- try {
- if (ignore)
- return;
- pushExpressionValue(o, t);
- } finally {
- if (traceOn)
- printTraceEnd();
- }
- }
-
- /**
- * Get the value of the expression proxy (from proxy id), and push the value onto the stack.
- *
- * @param proxyid The proxy id of the ExpressionProxy to push as a value.
- *
- * @since 1.0.0
- */
- public final void pushExpressionProxy(int proxyid) {
- boolean ignore =(ignoreExpression != null || errorOccurred);
- if (traceOn)
- printTrace("Push Expression Proxy #"+proxyid, ignore); //$NON-NLS-1$
- try {
- if (ignore)
- return;
- if (expressionProxies != null && expressionProxies.size() > proxyid) {
- InternalExpressionProxy proxy = (InternalExpressionProxy) expressionProxies.get(proxyid);
- if (proxy != null && proxy.isSet()) {
- if (traceOn)
- printObjectAndType(proxy.getValue(), proxy.getType());
- pushExpressionValue(proxy.getValue(), proxy.getType()); // Can push a VariableReference. This is ok. When used it will then deref with the current value.
- } else
- processException(new NoExpressionValueException("Proxy id: "+proxyid)); //$NON-NLS-1$
- } else
- processException(new NoExpressionValueException("Proxy id: "+proxyid)); //$NON-NLS-1$
- } finally {
- if (traceOn)
- printTraceEnd();
- }
- }
-
- /**
- * Push a cast onto stack. The type passed in is either a String (with classname to cast to) or the
- * type to cast to.
- * @param type To cast to. If <code>String</code> then convert to type (using something like <code>Class.forName()</code>) or it is a Class
- *
- * @since 1.0.0
- */
- public final void pushCast(Class type) {
- boolean ignore = (ignoreExpression != null || errorOccurred);
- if (traceOn)
- printTrace("Cast to: "+type, ignore); //$NON-NLS-1$
- try {
- if (ignore)
- return;
-
- try {
- Object exp = popExpression();
- Class exptype = popExpressionType(false);
-
- pushExpressionValue(castBean(type, exp, exptype), type);
- } catch (RuntimeException e) {
- processException(e);
- } catch (NoExpressionValueException e) {
- processException(e);
- }
- } finally {
- if (traceOn)
- printTraceEnd();
- }
-
- }
-
- /**
- * Cast a bean into the return type. If the return type is not primitive, then
- * the bean is left alone, however it is checked to be an instance of
- * the return type. If the return type is primitive, then the
- * correct primitive wrapper is created from the bean (bean must be a number or character or boolean primitve so
- * that cast will work).
- * <p>
- * However if can't be cast for primitive or if not an instance of the
- * returntype for objects, a ClassCastException will be raised.
- * <p>
- * This is a helper method for expression processer to cast a bean. Since it is a helper method it doesn't
- * check nor process the exception. It throws it. Callers must handle it as they see fit.
- *
- * @param returnType
- * @param bean
- * @param beanType The type that bean is supposed to be (e.g. even though it is a Number, it actually represents a primitive).
- * @return The cast bean (either to the appropriate primitive wrapper type or bean)
- *
- * @throws ClassCastException
- * @since 1.0.0
- */
- protected final Object castBean(Class returnType, Object bean, Class beanType) throws ClassCastException {
- // Cast uses true value and true class of bean, not expected type (i.e. not beanType).
- if (bean == null)
- if (!returnType.isPrimitive())
- return bean; // bean is null, and return type is not primitive, so this is a valid cast.
- else
- throwClassCast(returnType, bean);
- else if (returnType.equals(bean.getClass()))
- return bean; // They are already the same.
- else if (!returnType.isPrimitive()) {
- if (!beanType.isPrimitive() && returnType.isInstance(bean))
- return bean;
- else
- throwClassCast(returnType, bean); // Either bean type was wrappering primitive or not instanceof returntype.
- } else {
- if (!beanType.isPrimitive())
- throwClassCast(returnType, bean); // bean type was not wrappering a primitive. Can't cast to primitive.
- // It is return type of primitive. Now convert to correct primitive.
- if (returnType == Boolean.TYPE)
- if (bean instanceof Boolean)
- return bean;
- else
- throwClassCast(returnType, bean);
- else {
- if (bean instanceof Number) {
- if (returnType == Integer.TYPE)
- if (bean instanceof Integer)
- return bean;
- else
- return new Integer(((Number) bean).intValue());
- else if (returnType == Byte.TYPE)
- if (bean instanceof Byte)
- return bean;
- else
- return new Byte(((Number) bean).byteValue());
- else if (returnType == Character.TYPE)
- if (bean instanceof Character)
- return bean;
- else
- return new Character((char) ((Number) bean).intValue());
- else if (returnType == Double.TYPE)
- if (bean instanceof Double)
- return bean;
- else
- return new Double(((Number) bean).doubleValue());
- else if (returnType == Float.TYPE)
- if (bean instanceof Float)
- return bean;
- else
- return new Float(((Number) bean).floatValue());
- else if (returnType == Long.TYPE)
- if (bean instanceof Long)
- return bean;
- else
- return new Long(((Number) bean).longValue());
- else if (returnType == Short.TYPE)
- if (bean instanceof Short)
- return bean;
- else
- return new Short(((Number) bean).shortValue());
- else
- throwClassCast(returnType, bean);
- } else if (bean instanceof Character) {
- if (returnType == Character.TYPE)
- return bean;
- else if (returnType == Integer.TYPE)
- return new Integer(((Character) bean).charValue());
- else if (returnType == Byte.TYPE)
- return new Byte((byte) ((Character) bean).charValue());
- else if (returnType == Double.TYPE)
- return new Double(((Character) bean).charValue());
- else if (returnType == Float.TYPE)
- return new Float(((Character) bean).charValue());
- else if (returnType == Long.TYPE)
- return new Long(((Character) bean).charValue());
- else if (returnType == Short.TYPE)
- return new Short((short) ((Character) bean).charValue());
- else
- throwClassCast(returnType, bean);
- } else
- throwClassCast(returnType, bean);
- }
-
- }
- return null; // It should never get here;
- }
-
- private void throwClassCast(Class returnType, Object bean) throws ClassCastException {
- throw new ClassCastException(MessageFormat.format(InitparserTreeMessages.getString("ExpressionProcesser.CannotCastXToY_EXC_"), new Object[] {bean != null ? bean.getClass().getName() : null, returnType.getName()})); //$NON-NLS-1$
- }
-
- /**
- * Return the primitive type that the wrapper bean represents (i.e. Boolean instance returns Boolean.TYPE)
- * <p>
- * This is a helper method for expression processer to get the primitive type. Since it is a helper method it doesn't
- * check nor process the exception. It throws it. Callers must handle it as they see fit.
-
- * @param bean
- * @return the primitive type class of the given bean.
- * @throws IllegalArgumentException if bean is <code>null</code> or not of the type that can be converted to a primitive.
- *
- * @since 1.0.0
- */
- protected final Class getPrimitiveType(Object bean) throws IllegalArgumentException {
- if (bean instanceof Boolean)
- return Boolean.TYPE;
- else if (bean instanceof Integer)
- return Integer.TYPE;
- else if (bean instanceof Byte)
- return Byte.TYPE;
- else if (bean instanceof Character)
- return Character.TYPE;
- else if (bean instanceof Double)
- return Double.TYPE;
- else if (bean instanceof Float)
- return Float.TYPE;
- else if (bean instanceof Long)
- return Long.TYPE;
- else if (bean instanceof Short)
- return Short.TYPE;
- else
- throw new IllegalArgumentException(bean != null ? bean.getClass().getName() : "null"); //$NON-NLS-1$
- }
-
- private static final Object IFELSE_IGNORE = "IF/ELSE IGNORE"; // Flag for if/else in ingore //$NON-NLS-1$
- private int ifElseNesting = 0; // Nesting of if/else expressions.
- private int ifElseIgnoreNestCount = 0; // When ignoring if/else expressions, ignore until this nest count.
- private boolean ifElseSkipTruePart;
-
-
- /**
- * Push an if test expression.
- * @param hasElseClause
- *
- * @since 1.0.0
- */
- public final void pushIfElse() {
- try {
- boolean ignore = true;
- try {
- if (errorOccurred)
- return;
- // Slightly different here in that if an ignoring occurred we still need to process at least part of it so that
- // we can get the expression grouping correct.
- ifElseNesting++; // We have the test.
-
- if (ignoreExpression != null)
- return;
- ignore = false;
- } finally {
- if (traceOn)
- printTrace("If test condition", ignore); //$NON-NLS-1$
- }
-
- try {
- Object condition = popExpression();
- Class type = popExpressionType(false);
- if (type != Boolean.TYPE)
- throwClassCast(Boolean.TYPE, condition);
- if (traceOn) {
- System.out.print(" Test Result="+condition); //$NON-NLS-1$
- printTraceEnd();
- indent(true);
- printTrace("Begin True Expression.", ignore); //$NON-NLS-1$
- printTraceEnd();
- indent(true);
- }
- if (((Boolean) condition).booleanValue()) {
- // Condition was true.
- // Do nothing. Let true condition be processed.
- } else {
- // Condition was false.
- ifElseSkipTruePart = true; // Tell the true condition should be ignored.
- ignoreExpression = IFELSE_IGNORE;
- ifElseIgnoreNestCount = ifElseNesting;
- }
- // We don't put anything back on the stack because the condition test is not ever returned.
- // The appropriate true or false condition evaluation will be left on the stack.
- } catch (RuntimeException e) {
- processException(e);
- } catch (NoExpressionValueException e) {
- processException(e);
- }
- } finally {
- if (traceOn)
- printTraceEnd();
- }
- }
-
- /**
- * Push an if/else clause. It can be any clause of the if (true, or false clause).
- * @param clauseType
- *
- * @since 1.0.0
- */
- public final void pushIfElse(InternalIfElseOperandType clauseType) {
- try {
- boolean ignore = true;
- if (errorOccurred)
- return;
- // Slightly different here in that if an ignoring occurred we still need to process at least part of it so that
- // we can get the expression grouping correct.
- switch (clauseType.getValue()) {
- case InternalIfElseOperandType.TRUE_CLAUSE_VALUE:
- if (traceOn) {
- indent(false);
- printTrace("Begin False Expression.", ignore); //$NON-NLS-1$
- printTraceEnd();
- indent(true);
- }
- if (ifElseSkipTruePart && ignoreExpression == IFELSE_IGNORE && ifElseIgnoreNestCount == ifElseNesting) {
- // stop ignoring, we've ignored the true condition of interest.
- ignoreExpression = null;
- return; // However, leave because since this condition was ignored.
- }
- break;
- case InternalIfElseOperandType.ELSE_CLAUSE_VALUE:
- if (traceOn) {
- indent(false);
- indent(false);
- printTrace("End IF/ELSE Expression.", ignore); //$NON-NLS-1$
- printTraceEnd();
- }
- int currentNesting = ifElseNesting--;
- if (ignoreExpression == IFELSE_IGNORE && ifElseIgnoreNestCount == currentNesting) {
- // stop ignoring, we've ignored the false condition of interest.
- ignoreExpression = null;
- return; // However, leave because since this condition was ignored.
- }
- }
-
- if (ignoreExpression != null)
- return;
- ignore = false;
-
-
- try {
- switch (clauseType.getValue()) {
- case InternalIfElseOperandType.TRUE_CLAUSE_VALUE:
- ifElseSkipTruePart = false; // Tell the false condition should be ignored.
- ignoreExpression = IFELSE_IGNORE;
- ifElseIgnoreNestCount = ifElseNesting;
- break;
- case InternalIfElseOperandType.ELSE_CLAUSE_VALUE:
- // There's nothing to do, if it was ignored due to true, we wouldn't of gotton here.
- // If it wasn't ignored, then the result of the false expression is on the stack, which is what it should be.
- break;
- }
- } catch (RuntimeException e) {
- processException(e);
- }
- } finally {
- if (traceOn)
- printTraceEnd();
- }
- }
-
- /**
- * Push the instanceof expression. The type passed in is either a String (with classname to test against) or the
- * type to test against.
- * @param type To test against.
- * @since 1.0.0
- */
- public final void pushInstanceof(Class type) {
- boolean ignore = (ignoreExpression != null || errorOccurred);
- if (traceOn)
- printTrace("Instanceof type: "+type, ignore); //$NON-NLS-1$
- try {
- if (ignore)
- return;
-
- try {
- Object exp = popExpression();
- Class exptype = popExpressionType(false);
- pushExpressionValue(Boolean.valueOf(isInstance(type, exp, exptype)), Boolean.TYPE);
- } catch (NoExpressionValueException e) {
- processException(e);
- } catch (RuntimeException e) {
- processException(e);
- }
- } finally {
- if (traceOn)
- printTraceEnd();
- }
- }
-
- /**
- * Test if instance of. It will make sure that primitive to non-primitive is not permitted.
- * This is a true instance of, which means null IS NOT AN instance of any type. This is
- * different then assignable from, in that case null can be assigned to any class type.
- * <p>
- * This is a helper method for expression processer to do isInstance. Since it is a helper method it doesn't
- * check nor process exceptions.
-
- * @param type
- * @param bean
- * @param beanType
- * @return
- *
- * @since 1.0.0
- */
- protected final boolean isInstance(Class type, Object bean, Class beanType) {
- if (type.isPrimitive())
- return beanType.isPrimitive() && type == beanType; // Can't use isInstance because for a primitive type isInstance returns false.
- else
- return type.isInstance(bean);
- }
-
- /**
- * Push new instance from string.
- * @param initializationString
- * @param resultType expected result type. If it isn't of that type, a classcast will be processed.
- * @param classloader classloader to use for finding classes, or <code>null</code> to use classloader of InitializationStringParser.class.
- *
- * @since 1.1.0
- */
- public final void pushNewInstanceFromString(String initializationString, Class resultType, ClassLoader classloader) {
- boolean ignore = (ignoreExpression != null || errorOccurred);
- if (traceOn)
- printTrace("New instance from string: \""+initializationString+"\" Type="+resultType, ignore); //$NON-NLS-1$ //$NON-NLS-2$
- try {
- if (ignore)
- return;
-
- try {
- InitializationStringParser parser = InitializationStringParser.createParser(initializationString, classloader);
- Object newValue = parser.evaluate();
- newValue = castBean(resultType, newValue, parser.getExpectedType());
- pushExpressionValue(newValue, resultType);
- } catch (RuntimeException e) {
- processException(e);
- } catch (InitializationStringEvaluationException e) {
- processException(e);
- }
- } finally {
- if (traceOn)
- printTraceEnd();
- }
-
- }
-
- /**
- * Push prefix expression.
- * @param operator
- * @since 1.0.0
- */
- public final void pushPrefix(PrefixOperator operator) {
- try {
- if (ignoreExpression != null || errorOccurred) {
- if (traceOn)
- printTrace("Prefix: \'"+operator+"\'", true); //$NON-NLS-1$ //$NON-NLS-2$
- return;
- }
-
- if (operator == PrefixOperator.PRE_PLUS)
- return; // Do nothing. "+" doesn't affect the result of the current top expression.
-
- if (traceOn)
- printTrace("Prefix: \'"+operator+"\' ", false); //$NON-NLS-1$ //$NON-NLS-2$
-
- try {
- Object exp = popExpression();
- Class exptype = popExpressionType(false);
- if (!exptype.isPrimitive())
- throwInvalidPrefix(operator, exp);
-
- int primTypeEnum = getEnumForPrimitive(exptype);
- switch (operator.getValue()) {
- case PrefixOperator.PRE_MINUS_VALUE:
- switch (primTypeEnum) {
- case BOOLEAN:
- throwInvalidPrefix(operator, exp);
- case BYTE:
- exp = new Integer(-((Number) exp).byteValue());
- break;
- case CHAR:
- exp = new Integer(-((Character) exp).charValue());
- break;
- case DOUBLE:
- exp = new Double(-((Number) exp).doubleValue());
- break;
- case FLOAT:
- exp = new Float(-((Number) exp).floatValue());
- break;
- case INT:
- exp = new Integer(-((Number) exp).intValue());
- break;
- case LONG:
- exp = new Long(-((Number) exp).longValue());
- break;
- case SHORT:
- exp = new Integer(-((Number) exp).shortValue());
- break;
- }
- exptype = getPrimitiveType(exp); // It can actually change the type.
- break;
-
- case PrefixOperator.PRE_COMPLEMENT_VALUE:
- switch (primTypeEnum) {
- case BOOLEAN:
- case DOUBLE:
- case FLOAT:
- throwInvalidPrefix(operator, exp);
- case BYTE:
- exp = new Integer(~((Number) exp).byteValue());
- break;
- case CHAR:
- exp = new Integer(~((Character) exp).charValue());
- break;
- case INT:
- exp = new Integer(~((Number) exp).intValue());
- break;
- case LONG:
- exp = new Long(~((Number) exp).longValue());
- break;
- case SHORT:
- exp = new Integer(~((Number) exp).shortValue());
- break;
- }
- exptype = getPrimitiveType(exp); // It can actually change the type.
- break;
- case PrefixOperator.PRE_NOT_VALUE:
- switch (primTypeEnum) {
- case BOOLEAN:
- exp = !((Boolean) exp).booleanValue() ? Boolean.TRUE : Boolean.FALSE;
- break;
- case BYTE:
- case CHAR:
- case DOUBLE:
- case FLOAT:
- case INT:
- case LONG:
- case SHORT:
- throwInvalidPrefix(operator, exp);
- }
- break;
- }
-
- if (traceOn)
- printObjectAndType(exp, exptype);
- pushExpressionValue(exp, exptype); // Push the result back on the stack.
-
- } catch (IllegalArgumentException e) {
- processSyntaxException(e);
- } catch (NoExpressionValueException e) {
- processException(e);
- } catch (RuntimeException e) {
- processException(e);
- }
- } finally {
- if (traceOn)
- printTraceEnd();
- }
-
- }
-
- /**
- * Assign the right expression to the left expression.
- * @since 1.1.0
- */
- public final void pushAssignment() {
- if (ignoreExpression != null || errorOccurred) {
- if (traceOn) {
- printTrace("Assignment", true); //$NON-NLS-1$
- printTraceEnd();
- }
- return;
- }
-
- try {
- // KLUDGE: The only reason leftValue/refType are outside of try/finally is because
- // of tracing. pushExpression() does its own trace statements, so we need to end
- // our trace before calling pushExpression.
- Object leftValue;
- Class refType;
- try {
- if (traceOn)
- printTrace("Assignment: ", false); //$NON-NLS-1$
- // The order on the stack is right then left operand.
- // First the right operand
- Object value = popExpression();
- Class type = popExpressionType(false);
-
- // Next the left operand, should be a reference.
- VariableReference left = (VariableReference) popExpression(false); // Don't dereference it.
- refType = popExpressionType(false);
-
- if (traceOn)
- printObjectAndType(left, refType);
-
- leftValue = left.set(value, type);
- } finally {
- if (traceOn)
- printTraceEnd();
- }
-
- // Now do assignment and return the value to the stack.
- pushExpression(leftValue, refType); // The type of the result is the type of the reference.
-
- } catch (IllegalArgumentException e) {
- processException(e);
- } catch (NoExpressionValueException e) {
- processException(e);
- } catch (IllegalAccessException e) {
- processException(e);
- } catch (RuntimeException e) {
- processException(e);
- }
-
- }
-
- /**
- * Assign the expression proxy to the top expression value.
- *
- * @param proxy
- *
- * @since 1.1.0
- */
- public final void pushAssignment(InternalExpressionProxy proxy) {
- boolean ignore = (ignoreExpression != null || errorOccurred);
- try {
- if (traceOn) {
- printTrace("Assign to Proxy #"+proxy.getProxyID(), ignore); //$NON-NLS-1$
- }
- if (ignore)
- return;
-
- try {
- assignToExpressionProxyFromTopStackEntry(proxy);
- if (traceOn)
- printObjectAndType(proxy.getValue(), proxy.getType());
- } catch (NoExpressionValueException e) {
- processException(e);
- } catch (RuntimeException e) {
- processException(e);
- }
- } finally {
- if (traceOn)
- printTraceEnd();
- }
-
- }
-
- /**
- * Assign the top stack entry to the new expression proxy and allocate it for callback later.
- * @param proxy
- * @throws NoExpressionValueException
- *
- * @since 1.1.0
- */
- protected void assignToExpressionProxyFromTopStackEntry(InternalExpressionProxy proxy) throws NoExpressionValueException {
- Object value = getExpression(1);
- Class type = getExpressionType(1, true);
- if (value instanceof VariableReference)
- value = ((VariableReference) value).dereference(); // Here we want the final current value.
-
- proxy.setProxy(value, type);
- allocateExpressionProxy(proxy);
- }
-
- /**
- * Allocate an expression proxy. This is used to make an expression proxy known to the processor. The expression proxy must
- * have been setProxy() at this point. This is used to assign from the top of the stack or to add from outside an evaluated proxy
- * to be used later by others.
- *
- * @param proxy
- *
- * @since 1.1.0
- */
- public void allocateExpressionProxy(InternalExpressionProxy proxy) {
- int minSize = proxy.getProxyID()+1;
- if (expressionProxies == null)
- expressionProxies = new ArrayList(minSize+10); // Allow room to grow ten more.
- else if (expressionProxies.size() < minSize)
- expressionProxies.ensureCapacity(minSize+10); // Allow room to grow ten more.
- int fill = minSize-expressionProxies.size(); // Number of "null" fill entries needed. Probably shouldn't occur, but to be safe.
- if (fill > 0) {
- while (--fill > 0)
- expressionProxies.add(null);
- expressionProxies.add(proxy);
- } else
- expressionProxies.set(proxy.getProxyID(), proxy); // Already large enough, replace entry.
-
- }
-
- /**
- * The primitive enums.
- * NOTE: Their order must not changed. They are in order of permitted widening.
- *
- */
- protected static final int
- BOOLEAN = 0,
- BYTE = 1,
- SHORT = 2,
- CHAR = 3,
- INT = 4,
- LONG = 5,
- FLOAT = 6,
- DOUBLE = 7;
-
-
-
- /**
- * Get the enum constant for the type of primitive passed in.
- * <p>
- * This is a helper method for expression processer to get the enum for the primitive type. Since it is a helper method it doesn't
- * check nor process the exception. It throws it. Callers must handle it as they see fit.
-
- * @param primitiveType
- * @return
- * @throws IllegalArgumentException if type is not a primitive.
- *
- * @see ExpressionProcesser#BOOLEAN
- * @since 1.0.0
- */
- protected final int getEnumForPrimitive(Class primitiveType) throws IllegalArgumentException {
- if (primitiveType == Boolean.TYPE)
- return BOOLEAN;
- else if (primitiveType == Integer.TYPE)
- return INT;
- else if (primitiveType == Byte.TYPE)
- return BYTE;
- else if (primitiveType == Character.TYPE)
- return CHAR;
- else if (primitiveType == Double.TYPE)
- return DOUBLE;
- else if (primitiveType == Float.TYPE)
- return FLOAT;
- else if (primitiveType == Long.TYPE)
- return LONG;
- else if (primitiveType == Short.TYPE)
- return SHORT;
- else
- throw new IllegalArgumentException(primitiveType != null ? primitiveType.getName() : "null"); //$NON-NLS-1$
- }
-
- private void throwInvalidPrefix(PrefixOperator operator, Object exp) throws IllegalArgumentException {
- throw new IllegalArgumentException(MessageFormat.format(InitparserTreeMessages.getString("ExpressionProcesser.InvalidOperandOfPrefixOperator_EXC_"), new Object[] {exp != null ? exp.toString() : null, operator.toString()})); //$NON-NLS-1$
- }
-
- private static final Object INFIX_IGNORE = "INFIX IGNORE"; // Flag for infix in ingore //$NON-NLS-1$
- private int infixNesting = 0; // Nesting of infix expressions.
- private int infixIgnoreNestCount = 0; // When ignoring infix expressions, ignore until this nest count.
- /**
- * Push the infix expression onto the stack.
- * @param operator
- * @param operandType The operator type. Left, right, other.
- * @since 1.0.0
- */
- public final void pushInfix(InfixOperator operator, InternalInfixOperandType operandType) {
- try {
- boolean ignore = true;
- try {
- if (errorOccurred) {
- return;
- }
- // Slightly different here in that if an ignored occurred we still need to process at least part of it so that
- // we can get the expression grouping correct.
- if (operandType == InternalInfixOperandType.INFIX_LEFT_OPERAND)
- infixNesting++;
- else if (operandType == InternalInfixOperandType.INFIX_LAST_OPERAND) {
- int currentNest = infixNesting--;
- if (ignoreExpression == INFIX_IGNORE && currentNest == infixIgnoreNestCount) {
- // We were ignoring, and it was this expression that was being ignore.
- // We have received the last operand of the nested expression that was being ignored,
- // so we can stop ignoring. But we still leave since the value of the expression is on the
- // top of the stack.
- ignoreExpression = null;
- return;
- }
- }
-
- if (ignoreExpression != null)
- return;
- ignore = false;
- } finally {
- if (traceOn)
- printTrace("Infix: "+operator, ignore); //$NON-NLS-1$
- }
-
- try {
- Object right = null;
- Class rightType = null;
- if (operandType != InternalInfixOperandType.INFIX_LEFT_OPERAND) {
- // We are not the left operand, so the stack has the right on the top, followed by the left.
- right = popExpression();
- rightType = popExpressionType(false);
- }
-
- Object value = popExpression();
- Class valueType = popExpressionType(false);
-
- switch (operator.getValue()) {
- case InfixOperator.IN_AND_VALUE:
- if (operandType == InternalInfixOperandType.INFIX_LEFT_OPERAND)
- break; // Do nothing with first operand
-
- testValidBitType(valueType, InfixOperator.IN_AND);
- testValidBitType(rightType, InfixOperator.IN_AND);
- if (valueType == Long.TYPE || rightType == Long.TYPE) {
- // If either side is long, the result will be long.
- value = new Long(getLong(value) & getLong(right));
- valueType = Long.TYPE;
- } else {
- // Else it is int. (even two shorts together produce an int).
- value = new Integer(getInt(value) & getInt(right));
- valueType = Integer.TYPE;
- }
- break;
- case InfixOperator.IN_CONDITIONAL_AND_VALUE:
- // This is tricky.
- // First if this is left type, then just continue.
- // Else if this other or last, then need to make it the new value.
- if (operandType != InternalInfixOperandType.INFIX_LEFT_OPERAND) {
- value = right;
- valueType = rightType;
- }
-
- //If the value is now false, we need to ignore the rest.
- if (valueType != Boolean.TYPE)
- throwInvalidInfix(operator, value);
- if (!((Boolean) value).booleanValue() && operandType != InternalInfixOperandType.INFIX_LAST_OPERAND)
- startInfixIgnore(); // Start ignoring because we know the value of the expression at this point. It is false.
- break;
- case InfixOperator.IN_CONDITIONAL_OR_VALUE:
- // This is tricky.
- // First if this is left type, then just continue.
- // Else if this other or last, then need to make it the new value.
- if (operandType != InternalInfixOperandType.INFIX_LEFT_OPERAND) {
- value = right;
- valueType = rightType;
- }
-
- //If the value is now true, we need to ignore the rest.
- if (valueType != Boolean.TYPE)
- throwInvalidInfix(operator, value);
- if (((Boolean) value).booleanValue() && operandType != InternalInfixOperandType.INFIX_LAST_OPERAND)
- startInfixIgnore(); // Start ignoring because we know the value of the expression at this point. It is true.
- break;
- case InfixOperator.IN_DIVIDE_VALUE:
- if (operandType == InternalInfixOperandType.INFIX_LEFT_OPERAND)
- break; // Do nothing with first operand
-
- testValidArithmeticType(valueType, InfixOperator.IN_DIVIDE);
- testValidArithmeticType(rightType, InfixOperator.IN_DIVIDE);
- if (valueType == Double.TYPE || rightType == Double.TYPE) {
- // If either side is double, the result will be double.
- value = new Double(getDouble(value) / getDouble(right));
- valueType = Double.TYPE;
- } else if (valueType == Float.TYPE || rightType == Float.TYPE) {
- // If either side is float, the result will be float.
- value = new Float(getFloat(value) / getFloat(right));
- valueType = Float.TYPE;
- } else if (valueType == Long.TYPE || rightType == Long.TYPE) {
- // If either side is long, the result will be long.
- value = new Long(getLong(value) / getLong(right));
- valueType = Long.TYPE;
- } else {
- // Else it will result in an int, even if both sides are short.
- value = new Integer(getInt(value) / getInt(right));
- valueType = Integer.TYPE;
- }
- break;
- case InfixOperator.IN_EQUALS_VALUE:
- if (operandType == InternalInfixOperandType.INFIX_LEFT_OPERAND)
- break; // Do nothing with first operand
- // We should never get extended operator for this, but we'll ignore the possibility.
- if (valueType.isPrimitive() && rightType.isPrimitive()) {
- // Primitives require more testing than just ==. boolean primitives
- if (valueType == Boolean.TYPE || rightType == Boolean.TYPE) {
- // If either side is a boolean, then the other side needs to be boolean for it to even try to be true.
- if (valueType != Boolean.TYPE || valueType != Boolean.TYPE)
- value = Boolean.FALSE;
- else
- value = (((Boolean) value).booleanValue() == ((Boolean) right).booleanValue()) ? Boolean.TRUE : Boolean.FALSE;
- } else {
- // Now do number tests since not boolean primitive, only numbers are left
- if (valueType == Double.TYPE || rightType == Double.TYPE) {
- // If either side is double, compare as double.
- value = (getDouble(value) == getDouble(right)) ? Boolean.TRUE : Boolean.FALSE;
- } else if (valueType == Float.TYPE || rightType == Float.TYPE) {
- // If either side is float, compare as float.
- value = (getFloat(value) == getFloat(right)) ? Boolean.TRUE : Boolean.FALSE;
- } else if (valueType == Long.TYPE || rightType == Long.TYPE) {
- // If either side is long, the compare as long.
- value = (getLong(value) == getLong(right)) ? Boolean.TRUE : Boolean.FALSE;
- } else {
- // Else it will compare as int, even if both sides are short.
- value = (getInt(value) == getInt(right)) ? Boolean.TRUE : Boolean.FALSE;
- }
- }
- } else if (valueType.isPrimitive() || rightType.isPrimitive())
- value = Boolean.FALSE; // Can't be true if one side prim and the other isn't
- else {
- // Just do object ==
- value = (value == right) ? Boolean.TRUE : Boolean.FALSE;
- }
- valueType = Boolean.TYPE; // We know result will be a boolean.
- break;
- case InfixOperator.IN_GREATER_VALUE:
- if (operandType == InternalInfixOperandType.INFIX_LEFT_OPERAND)
- break; // Do nothing with first operand
-
- testValidArithmeticType(valueType, InfixOperator.IN_GREATER);
- testValidArithmeticType(rightType, InfixOperator.IN_GREATER);
- if (valueType == Double.TYPE || rightType == Double.TYPE) {
- // If either side is double, compare will be double.
- value = (getDouble(value) > getDouble(right)) ? Boolean.TRUE : Boolean.FALSE;
- } else if (valueType == Float.TYPE || rightType == Float.TYPE) {
- // If either side is float, compare will be float.
- value = (getFloat(value) > getFloat(right)) ? Boolean.TRUE : Boolean.FALSE;
- } else if (valueType == Long.TYPE || rightType == Long.TYPE) {
- // If either side is long, compare will be long.
- value = (getLong(value) > getLong(right)) ? Boolean.TRUE : Boolean.FALSE;
- } else {
- // Else compare will be int, even if both sides are short.
- value = (getInt(value) > getInt(right)) ? Boolean.TRUE : Boolean.FALSE;
- }
- valueType = Boolean.TYPE; // We know result will be a boolean.
- break;
- case InfixOperator.IN_GREATER_EQUALS_VALUE:
- if (operandType == InternalInfixOperandType.INFIX_LEFT_OPERAND)
- break; // Do nothing with first operand
-
- testValidArithmeticType(valueType, InfixOperator.IN_GREATER_EQUALS);
- testValidArithmeticType(rightType, InfixOperator.IN_GREATER_EQUALS);
- if (valueType == Double.TYPE || rightType == Double.TYPE) {
- // If either side is double, compare will be double.
- value = (getDouble(value) >= getDouble(right)) ? Boolean.TRUE : Boolean.FALSE;
- } else if (valueType == Float.TYPE || rightType == Float.TYPE) {
- // If either side is float, compare will be float.
- value = (getFloat(value) >= getFloat(right)) ? Boolean.TRUE : Boolean.FALSE;
- } else if (valueType == Long.TYPE || rightType == Long.TYPE) {
- // If either side is long, compare will be long.
- value = (getLong(value) >= getLong(right)) ? Boolean.TRUE : Boolean.FALSE;
- } else {
- // Else compare will be int, even if both sides are short.
- value = (getInt(value) >= getInt(right)) ? Boolean.TRUE : Boolean.FALSE;
- }
- valueType = Boolean.TYPE; // We know result will be a boolean.
- break;
- case InfixOperator.IN_LEFT_SHIFT_VALUE:
- if (operandType == InternalInfixOperandType.INFIX_LEFT_OPERAND)
- break; // Do nothing with first operand
-
- testValidBitType(valueType, InfixOperator.IN_LEFT_SHIFT);
- testValidBitType(rightType, InfixOperator.IN_LEFT_SHIFT);
- if (valueType == Long.TYPE || rightType == Long.TYPE) {
- // If either side is long, the result will be long.
- value = new Long(getLong(value) << getLong(right));
- valueType = Long.TYPE;
- } else {
- // Else it is int. (even two shorts together produce an int).
- value = new Integer(getInt(value) << getInt(right));
- valueType = Integer.TYPE;
- }
- break;
- case InfixOperator.IN_LESS_VALUE:
- if (operandType == InternalInfixOperandType.INFIX_LEFT_OPERAND)
- break; // Do nothing with first operand
-
- testValidArithmeticType(valueType, InfixOperator.IN_LESS);
- testValidArithmeticType(rightType, InfixOperator.IN_LESS);
- if (valueType == Double.TYPE || rightType == Double.TYPE) {
- // If either side is double, compare will be double.
- value = (getDouble(value) < getDouble(right)) ? Boolean.TRUE : Boolean.FALSE;
- } else if (valueType == Float.TYPE || rightType == Float.TYPE) {
- // If either side is float, compare will be float.
- value = (getFloat(value) < getFloat(right)) ? Boolean.TRUE : Boolean.FALSE;
- } else if (valueType == Long.TYPE || rightType == Long.TYPE) {
- // If either side is long, compare will be long.
- value = (getLong(value) < getLong(right)) ? Boolean.TRUE : Boolean.FALSE;
- } else {
- // Else compare will be int, even if both sides are short.
- value = (getInt(value) < getInt(right)) ? Boolean.TRUE : Boolean.FALSE;
- }
- valueType = Boolean.TYPE; // We know result will be a boolean.
- break;
- case InfixOperator.IN_LESS_EQUALS_VALUE:
- if (operandType == InternalInfixOperandType.INFIX_LEFT_OPERAND)
- break; // Do nothing with first operand
-
- testValidArithmeticType(valueType, InfixOperator.IN_LESS_EQUALS);
- testValidArithmeticType(rightType, InfixOperator.IN_LESS_EQUALS);
- if (valueType == Double.TYPE || rightType == Double.TYPE) {
- // If either side is double, compare will be double.
- value = (getDouble(value) <= getDouble(right)) ? Boolean.TRUE : Boolean.FALSE;
- } else if (valueType == Float.TYPE || rightType == Float.TYPE) {
- // If either side is float, compare will be float.
- value = (getFloat(value) <= getFloat(right)) ? Boolean.TRUE : Boolean.FALSE;
- } else if (valueType == Long.TYPE || rightType == Long.TYPE) {
- // If either side is long, compare will be long.
- value = (getLong(value) <= getLong(right)) ? Boolean.TRUE : Boolean.FALSE;
- } else {
- // Else compare will be int, even if both sides are short.
- value = (getInt(value) <= getInt(right)) ? Boolean.TRUE : Boolean.FALSE;
- }
- valueType = Boolean.TYPE; // We know result will be a boolean.
- break;
- case InfixOperator.IN_MINUS_VALUE:
- if (operandType == InternalInfixOperandType.INFIX_LEFT_OPERAND)
- break; // Do nothing with first operand
-
- testValidArithmeticType(valueType, InfixOperator.IN_MINUS);
- testValidArithmeticType(rightType, InfixOperator.IN_MINUS);
- if (valueType == Double.TYPE || rightType == Double.TYPE) {
- // If either side is double, the result will be double.
- value = new Double(getDouble(value) - getDouble(right));
- valueType = Double.TYPE;
- } else if (valueType == Float.TYPE || rightType == Float.TYPE) {
- // If either side is float, the result will be float.
- value = new Float(getFloat(value) - getFloat(right));
- valueType = Float.TYPE;
- } else if (valueType == Long.TYPE || rightType == Long.TYPE) {
- // If either side is long, the result will be long.
- value = new Long(getLong(value) - getLong(right));
- valueType = Long.TYPE;
- } else {
- // Else it will result in an int, even if both sides are short.
- value = new Integer(getInt(value) - getInt(right));
- valueType = Integer.TYPE;
- }
- break;
- case InfixOperator.IN_NOT_EQUALS_VALUE:
- if (operandType == InternalInfixOperandType.INFIX_LEFT_OPERAND)
- break; // Do nothing with first operand
- // We should never get extended operator for this, but we'll ignore the possibility.
- if (valueType.isPrimitive() && rightType.isPrimitive()) {
- // Primitives require more testing than just ==. boolean primitives
- if (valueType == Boolean.TYPE || rightType == Boolean.TYPE) {
- // If either side is a boolean, then the other side needs to be boolean for it to even try to be true.
- if (valueType != Boolean.TYPE || valueType != Boolean.TYPE)
- value = Boolean.TRUE;
- else
- value = (((Boolean) value).booleanValue() != ((Boolean) right).booleanValue()) ? Boolean.TRUE : Boolean.FALSE;
- } else {
- // Now do number tests since not boolean primitive, only numbers are left
- if (valueType == Double.TYPE || rightType == Double.TYPE) {
- // If either side is double, compare as double.
- value = (getDouble(value) != getDouble(right)) ? Boolean.TRUE : Boolean.FALSE;
- } else if (valueType == Float.TYPE || rightType == Float.TYPE) {
- // If either side is float, compare as float.
- value = (getFloat(value) != getFloat(right)) ? Boolean.TRUE : Boolean.FALSE;
- } else if (valueType == Long.TYPE || rightType == Long.TYPE) {
- // If either side is long, the compare as long.
- value = (getLong(value) != getLong(right)) ? Boolean.TRUE : Boolean.FALSE;
- } else {
- // Else it will compare as int, even if both sides are short.
- value = (getInt(value) != getInt(right)) ? Boolean.TRUE : Boolean.FALSE;
- }
- }
- } else if (valueType.isPrimitive() || rightType.isPrimitive())
- value = Boolean.TRUE; // Must be true if one side prim and the other isn't
- else {
- // Just do object !=
- value = (value != right) ? Boolean.TRUE : Boolean.FALSE;
- }
- valueType = Boolean.TYPE; // We know result will be a boolean.
- break;
- case InfixOperator.IN_OR_VALUE:
- if (operandType == InternalInfixOperandType.INFIX_LEFT_OPERAND)
- break; // Do nothing with first operand
-
- testValidBitType(valueType, InfixOperator.IN_OR);
- testValidBitType(rightType, InfixOperator.IN_OR);
- if (valueType == Long.TYPE || rightType == Long.TYPE) {
- // If either side is long, the result will be long.
- value = new Long(getLong(value) | getLong(right));
- valueType = Long.TYPE;
- } else {
- // Else it is int. (even two shorts together produce an int).
- value = new Integer(getInt(value) | getInt(right));
- valueType = Integer.TYPE;
- }
- break;
- case InfixOperator.IN_PLUS_VALUE:
- if (operandType == InternalInfixOperandType.INFIX_LEFT_OPERAND) {
- if (valueType == String.class) {
- // Special. left argument is a string, so we want to store a string buffer instead
- // since we know we will be appending to it.
- value = new StringBuffer((String) value);
- }
- break; // Do nothing with first operand
- }
-
- testValidPlusType(valueType, rightType);
- if (valueType == String.class || rightType == String.class) {
- // Special we have a string on one side. Need to do it as strings instead.
- // We are going to be tricky in that we will store a StringBuffer on the stack (if not last operand)
- // but call it a string.
- StringBuffer sb = null;
- if (valueType == String.class) {
- sb = (StringBuffer) value; // We know that if the value (left) is string type, we've already converted it to buffer.
- } else {
- // The right is the one that introduces the string, so we change the value over to a string buffer.
- sb = new StringBuffer(((String) right).length()+16); // We can't put the value in yet, need to get left into it.
- appendToBuffer(sb, value, valueType); // Put the left value in now
- value = sb;
- valueType = String.class; // Make it a string class
- }
- appendToBuffer(sb, right, rightType);
- // Now if we are the last operand, we should get rid of the buffer and put a true string back in.
- if (operandType == InternalInfixOperandType.INFIX_LAST_OPERAND)
- value = sb.toString();
- } else if (valueType == Double.TYPE || rightType == Double.TYPE) {
- // If either side is double, the result will be double.
- value = new Double(getDouble(value) + getDouble(right));
- valueType = Double.TYPE;
- } else if (valueType == Float.TYPE || rightType == Float.TYPE) {
- // If either side is float, the result will be float.
- value = new Float(getFloat(value) + getFloat(right));
- valueType = Float.TYPE;
- } else if (valueType == Long.TYPE || rightType == Long.TYPE) {
- // If either side is long, the result will be long.
- value = new Long(getLong(value) + getLong(right));
- valueType = Long.TYPE;
- } else {
- // Else it will result in an int, even if both sides are short.
- value = new Integer(getInt(value) + getInt(right));
- valueType = Integer.TYPE;
- }
- break;
- case InfixOperator.IN_REMAINDER_VALUE:
- if (operandType == InternalInfixOperandType.INFIX_LEFT_OPERAND)
- break; // Do nothing with first operand
-
- testValidArithmeticType(valueType, InfixOperator.IN_REMAINDER);
- testValidArithmeticType(rightType, InfixOperator.IN_REMAINDER);
- if (valueType == Double.TYPE || rightType == Double.TYPE) {
- // If either side is double, the result will be double.
- value = new Double(getDouble(value) % getDouble(right));
- valueType = Double.TYPE;
- } else if (valueType == Float.TYPE || rightType == Float.TYPE) {
- // If either side is float, the result will be float.
- value = new Float(getFloat(value) % getFloat(right));
- valueType = Float.TYPE;
- } else if (valueType == Long.TYPE || rightType == Long.TYPE) {
- // If either side is long, the result will be long.
- value = new Long(getLong(value) % getLong(right));
- valueType = Long.TYPE;
- } else {
- // Else it will result in an int, even if both sides are short.
- value = new Integer(getInt(value) % getInt(right));
- valueType = Integer.TYPE;
- }
- break;
- case InfixOperator.IN_RIGHT_SHIFT_SIGNED_VALUE:
- if (operandType == InternalInfixOperandType.INFIX_LEFT_OPERAND)
- break; // Do nothing with first operand
-
- testValidBitType(valueType, InfixOperator.IN_RIGHT_SHIFT_SIGNED);
- testValidBitType(rightType, InfixOperator.IN_RIGHT_SHIFT_SIGNED);
- if (valueType == Long.TYPE || rightType == Long.TYPE) {
- // If either side is long, the result will be long.
- value = new Long(getLong(value) >> getLong(right));
- valueType = Long.TYPE;
- } else {
- // Else it is int. (even two shorts together produce an int).
- value = new Integer(getInt(value) >> getInt(right));
- valueType = Integer.TYPE;
- }
- break;
- case InfixOperator.IN_RIGHT_SHIFT_UNSIGNED_VALUE:
- if (operandType == InternalInfixOperandType.INFIX_LEFT_OPERAND)
- break; // Do nothing with first operand
-
- testValidBitType(valueType, InfixOperator.IN_RIGHT_SHIFT_UNSIGNED);
- testValidBitType(rightType, InfixOperator.IN_RIGHT_SHIFT_UNSIGNED);
- if (valueType == Long.TYPE || rightType == Long.TYPE) {
- // If either side is long, the result will be long.
- value = new Long(getLong(value) >>> getLong(right));
- valueType = Long.TYPE;
- } else {
- // Else it is int. (even two shorts together produce an int).
- value = new Integer(getInt(value) >>> getInt(right));
- valueType = Integer.TYPE;
- }
- break;
- case InfixOperator.IN_TIMES_VALUE:
- if (operandType == InternalInfixOperandType.INFIX_LEFT_OPERAND)
- break; // Do nothing with first operand
-
- testValidArithmeticType(valueType, InfixOperator.IN_TIMES);
- testValidArithmeticType(rightType, InfixOperator.IN_TIMES);
- if (valueType == Double.TYPE || rightType == Double.TYPE) {
- // If either side is double, the result will be double.
- value = new Double(getDouble(value) * getDouble(right));
- valueType = Double.TYPE;
- } else if (valueType == Float.TYPE || rightType == Float.TYPE) {
- // If either side is float, the result will be float.
- value = new Float(getFloat(value) * getFloat(right));
- valueType = Float.TYPE;
- } else if (valueType == Long.TYPE || rightType == Long.TYPE) {
- // If either side is long, the result will be long.
- value = new Long(getLong(value) * getLong(right));
- valueType = Long.TYPE;
- } else {
- // Else it will result in an int, even if both sides are short.
- value = new Integer(getInt(value) * getInt(right));
- valueType = Integer.TYPE;
- }
- break;
- case InfixOperator.IN_XOR_VALUE:
- if (operandType == InternalInfixOperandType.INFIX_LEFT_OPERAND)
- break; // Do nothing with first operand
-
- testValidBitType(valueType, InfixOperator.IN_XOR);
- testValidBitType(rightType, InfixOperator.IN_XOR);
- if (valueType == Long.TYPE || rightType == Long.TYPE) {
- // If either side is long, the result will be long.
- value = new Long(getLong(value) ^ getLong(right));
- valueType = Long.TYPE;
- } else {
- // Else it is int. (even two shorts together produce an int).
- value = new Integer(getInt(value) ^ getInt(right));
- valueType = Integer.TYPE;
- }
- break;
- }
-
- if (traceOn)
- printObjectAndType(value, valueType);
- pushExpressionValue(value, valueType); // Push the result back on the stack.
-
- } catch (IllegalArgumentException e) {
- processException(e);
- } catch (NoExpressionValueException e) {
- processException(e);
- } catch (RuntimeException e) {
- processException(e);
- }
- } finally {
- if (traceOn)
- printTraceEnd();
- }
-
- }
-
- /**
- * Start ignoring rest of the current infix expression.
- *
- * @since 1.1.0
- */
- private void startInfixIgnore() {
- ignoreExpression = INFIX_IGNORE;
- infixIgnoreNestCount = infixNesting; // Ignore until we get back to the current nesting.
-
- }
-
- /**
- * Get int value of the primitive wrapper bean passed in (must be either a <code>Number/code> or <code>Character</code>.
- * Anything else will cause a class cast error.
- * <p>
- * This is a helper method for expression processer to get the int value of the object. Since it is a helper method it doesn't
- * check nor process the exception. It throws it. Callers must handle it as they see fit.
- * @param bean
- * @return the int value of the number/character
- * @throws ClassCastException
- *
- * @since 1.0.0
- */
- protected final int getInt(Object bean) throws ClassCastException {
- return (bean instanceof Number) ? ((Number) bean).intValue() : ((Character) bean).charValue();
- }
-
- /**
- * Get float value of the primitive wrapper bean passed in (must be either a <code>Number/code> or <code>Character</code>.
- * Anything else will cause a class cast error.
- * <p>
- * This is a helper method for expression processer to get the float value of the object. Since it is a helper method it doesn't
- * check nor process the exception. It throws it. Callers must handle it as they see fit.
- * @param bean
- * @return float value of the Number/character
- * @throws ClassCastException
- * @since 1.0.0
- */
- protected final float getFloat(Object bean) throws ClassCastException {
- return (bean instanceof Number) ? ((Number) bean).floatValue() : ((Character) bean).charValue();
- }
-
- /**
- * Get double value of the primitive wrapper bean passed in (must be either a <code>Number/code> or <code>Character</code>.
- * Anything else will cause a class cast error.
- * <p>
- * This is a helper method for expression processer to get the float value of the object. Since it is a helper method it doesn't
- * check nor process the exception. It throws it. Callers must handle it as they see fit.
- *
- * @param bean
- * @return double value of the Number/Character.
- * @throws ClassCastException
- * @since 1.0.0
- */
- protected final double getDouble(Object bean) throws ClassCastException {
- return (bean instanceof Number) ? ((Number) bean).doubleValue() : ((Character) bean).charValue();
- }
-
- /**
- * Get long value of the primitive wrapper bean passed in (must be either a <code>Number/code> or <code>Character</code>.
- * Anything else will cause a class cast error.
- * <p>
- * This is a helper method for expression processer to get the float value of the object. Since it is a helper method it doesn't
- * check nor process the exception. It throws it. Callers must handle it as they see fit.
- *
- * @param bean
- * @return
- * @throws ClassCastException
- * @since 1.0.0
- */
- protected final long getLong(Object bean) throws ClassCastException {
- return (bean instanceof Number) ? ((Number) bean).longValue() : ((Character) bean).charValue();
- }
-
- private void throwInvalidInfix(InfixOperator operator, Object value) throws IllegalArgumentException {
- throw new IllegalArgumentException(MessageFormat.format(InitparserTreeMessages.getString("ExpressionProcesser.InvalidOperandOfOperator_EXC_"), new Object[] {value != null ? value.toString() : null, operator.toString()})); //$NON-NLS-1$
- }
-
- private void testValidBitType(Class type, InfixOperator operator) {
- if (!type.isPrimitive() || type == Boolean.TYPE || type == Double.TYPE|| type == Float.TYPE)
- throwInvalidInfix(operator, type);
- }
-
- private void testValidArithmeticType(Class type, InfixOperator operator) {
- if (!type.isPrimitive() || type == Boolean.TYPE)
- throwInvalidInfix(operator, type);
- }
-
- private void testValidPlusType(Class left, Class right) {
- // Plus is special in that string objects are also valid.
- if (left == String.class || right == String.class)
- return; // As long as one side is string. Anything is valid.
- // If neither is string, then standard arithmetic test.
- testValidArithmeticType(left, InfixOperator.IN_PLUS);
- testValidArithmeticType(right, InfixOperator.IN_PLUS);
- }
-
- private void appendToBuffer(StringBuffer sb, Object value, Class valueType) {
- if (value == null)
- sb.append((Object)null);
- else if (valueType == String.class)
- sb.append((String) value);
- else if (valueType.isPrimitive()) {
- switch (getEnumForPrimitive(valueType)) {
- case BOOLEAN:
- sb.append(((Boolean) value).booleanValue());
- break;
- case BYTE:
- sb.append(((Number) value).byteValue());
- break;
- case CHAR:
- sb.append(((Character) value).charValue());
- break;
- case DOUBLE:
- sb.append(((Number) value).doubleValue());
- break;
- case FLOAT:
- sb.append(((Number) value).floatValue());
- break;
- case INT:
- sb.append(((Number) value).intValue());
- break;
- case LONG:
- sb.append(((Number) value).longValue());
- break;
- case SHORT:
- sb.append(((Number) value).shortValue());
- break;
- }
- } else {
- // Just an object.
- sb.append(value);
- }
- }
-
- /**
- * Push the array access expression.
- *
- * @param indexCount Number of dimensions being accessed
- * @since 1.0.0
- */
- public final void pushArrayAccess(int indexCount) {
- boolean ignore = (ignoreExpression != null || errorOccurred);
-
- if (traceOn) {
- printTrace("Array Access["+indexCount+']', ignore); //$NON-NLS-1$
- }
- try {
- if (ignore)
- return;
-
- try {
- // We need to pop off the args. The topmost will be the rightmost index, and the bottom most will be the array itself.
- int[] arguments = new int[indexCount];
- // Fill the arg array in reverse order.
- for(int i=indexCount-1; i >= 0; i--) {
- Object index = popExpression();
- Class indexType = popExpressionType(false);
- if (indexType.isPrimitive() && (indexType == Integer.TYPE || indexType == Short.TYPE || indexType == Character.TYPE || indexType == Byte.TYPE)) {
- arguments[i] = getInt(index);
- } else
- throwClassCast(Integer.TYPE, index);
- }
-
- Object array = popExpression();
- Class arrayType = popExpressionType(false);
- if (arrayType.isArray()) {
- // First figure out how many dimensions are available. Stop when we hit indexcount because we won't be going further.
- int dimcount = 0;
- Class[] componentTypes = new Class[indexCount]; //
- Class componentType = arrayType;
- while (dimcount < indexCount && componentType.isArray()) {
- componentTypes[dimcount++] = componentType = componentType.getComponentType();
- }
-
- if (dimcount < indexCount)
- throw new IllegalArgumentException(MessageFormat.format(InitparserTreeMessages.getString("ExpressionProcesser.XIsGreaterThanNumberOfDimensionsInArray_EXC_"), new Object[] {new Integer(indexCount), new Integer(dimcount)})); //$NON-NLS-1$
-
- // Now start accessing one index at a time, stop just before the last one. The last one will be turned into an ArrayAccessReference.
- Object value = array; // Final value, start with full array.
- int pullCount = indexCount-1;
- for(int i=0; i<pullCount; i++) {
- value = Array.get(value, arguments[i]);
- }
- ArrayAccessReference arrayValue = ArrayAccessReference.createArrayAccessReference(value, arguments[pullCount]);
- if (traceOn)
- printObjectAndType(arrayValue, componentTypes[pullCount]);
- pushExpressionValue(arrayValue, componentTypes[pullCount]);
- } else
- throw new IllegalArgumentException(MessageFormat.format(InitparserTreeMessages.getString("ExpressionProcesser.NotAnArray_EXC_"), new Object[] {arrayType})); //$NON-NLS-1$
-
- } catch (NoExpressionValueException e) {
- processException(e);
- } catch (RuntimeException e) {
- processException(e);
- }
- } finally {
- if (traceOn)
- printTraceEnd();
- }
- }
-
- /**
- * Push the array creation request.
- *
- * @param arrayType The type of the array
- * @param dimensionCount The number of dimensions being initialized. Zero if using an initializer.
- * @since 1.0.0
- */
- public final void pushArrayCreation(Class arrayType, int dimensionCount) {
- boolean ignore = (ignoreExpression != null || errorOccurred);
- if (traceOn)
- printTrace("Array Creation: "+arrayType.getName()+'['+dimensionCount+']', ignore); //$NON-NLS-1$
-
- try {
- if (ignore)
- return;
-
- try {
- if (dimensionCount == 0) {
- // The top value is the array itself, from the array initializer.
- // So we do nothing.
- } else {
- // Strip off dimensionCounts from the array type, e.g.
- // ArrayType is int[][][]
- // Dimensioncount is 2
- // Then we need to strip two componenttypes off of the array type
- // wind up with int[]
- // This is necessary because Array.new will add those dimensions back
- // on through the dimension count.
- Class componentType = arrayType;
- for(int i=0; i < dimensionCount && componentType != null; i++)
- componentType = componentType.getComponentType();
- if (componentType == null)
- throw new IllegalArgumentException(MessageFormat.format(InitparserTreeMessages.getString("ExpressionProcesser.ArraytypeHasFewerDimensionsThanRequested_EXC_"), new Object[] {arrayType, new Integer(dimensionCount)})); //$NON-NLS-1$
-
- // We need to pull in the dimension initializers. They are stacked in reverse order.
- int[] dimInit = new int[dimensionCount];
- for(int i=dimensionCount-1; i >= 0; i--) {
- Object index = popExpression();
- Class dimType = popExpressionType(false);
- if (dimType.isPrimitive() && (dimType == Integer.TYPE || dimType == Short.TYPE || dimType == Character.TYPE || dimType == Byte.TYPE)) {
- dimInit[i] = getInt(index);
- } else
- throwClassCast(Integer.TYPE, index);
- }
-
- // Finally create the array.
- Object array = Array.newInstance(componentType, dimInit);
- pushExpressionValue(array, arrayType);
- }
- } catch (RuntimeException e) {
- processException(e);
- } catch (NoExpressionValueException e) {
- processException(e);
- }
- } finally {
- if (traceOn)
- printTraceEnd();
- }
-
- }
-
- /**
- * Push the array initializer request.
- *
- * @param arrayType The original type of the array to create.
- * @param stripCount the count of how many dimensions to strip to get the type needed for this initializer.
- * @param expressionCount
- * @since 1.0.0
- */
- public final void pushArrayInitializer(Class arrayType, int stripCount, int expressionCount) {
- boolean ignore = (ignoreExpression != null || errorOccurred);
-
- if (traceOn)
- printTrace("Initialize Array: "+arrayType.getName()+'{'+expressionCount+'}', ignore); //$NON-NLS-1$
-
- try {
- if (ignore)
- return;
-
- try {
- if (!arrayType.isArray()) {
- // It is not an array type.
- throw new ClassCastException(MessageFormat.format(InitparserTreeMessages.getString("ExpressionProcesser.CannotCastXToY_EXC_"), new Object[] {arrayType, "array"})); //$NON-NLS-1$ //$NON-NLS-2$
- }
- // Strip off the number of dimensions specified.
- while(stripCount-->0) {
- arrayType = arrayType.getComponentType();
- }
- Object[] dimValues = null;
- if (expressionCount > 0) {
- // We need to pull in the initializers. They are stacked in reverse order.
- dimValues = new Object[expressionCount];
- for (int i = expressionCount - 1; i >= 0; i--) {
- Object dimValue = dimValues[i] = popExpression();
- Class dimType = popExpressionType(false);
- if (arrayType.isPrimitive()) {
- if (dimValue == null || !dimType.isPrimitive())
- throwClassCast(arrayType, dimType);
- // A little trickier. Can assign short to an int, but can't assign long to an int. Widening is permitted.
- if (arrayType != dimType) {
- int compEnum = getEnumForPrimitive(arrayType);
- int dimEnum = getEnumForPrimitive(dimType);
- if (compEnum == BOOLEAN || dimEnum == BOOLEAN)
- throwClassCast(arrayType, dimType);
- int dimValueAsInt = getInt(dimValue);
- switch (compEnum) {
- case BYTE :
- // Can accept byte, short, char, or int as long as value is <= byte max. Can't accept long, double, float at all.
- // Note: This isn't actually true. The max/min test is only valid if the value is a literal, not an expression,
- // however, at this point in time we no longer know this. So we will simply allow it.
- if (dimEnum > INT || dimValueAsInt > Byte.MAX_VALUE || dimValueAsInt < Byte.MIN_VALUE)
- throwClassCast(arrayType, dimType);
- // But need to be changed to appropriate type for the array.set to work.
- dimValues[i] = new Byte((byte)dimValueAsInt);
- break;
- case SHORT :
- // Can accept byte, short, char, or int as long as value is <= byte max. Can't accept long, double, float at all.
- // Note: This isn't actually true. The max/min test is only valid if the value is a literal, not an expression,
- // however, at this point in time we no longer know this. So we will simply allow it.
- if (dimEnum > INT || dimValueAsInt > Short.MAX_VALUE || dimValueAsInt < Short.MIN_VALUE)
- throwClassCast(arrayType, dimType);
- // But need to be changed to appropriate type for the array.set to work.
- dimValues[i] = new Short((short)dimValueAsInt);
- break;
- case CHAR :
- // Can accept byte, short, char, or int as long as value is <= byte max. Can't accept long, double, float at all.
- // Note: This isn't actually true. The max/min test is only valid if the value is a literal, not an expression,
- // however, at this point in time we no longer know this. So we will simply allow it.
- if (dimEnum > INT || dimValueAsInt > Character.MAX_VALUE || dimValueAsInt < Character.MIN_VALUE)
- throwClassCast(arrayType, dimType);
- // But need to be changed to appropriate type for the array.set to work.
- dimValues[i] = new Character((char)dimValueAsInt);
- break;
- case INT :
- // Can accept byte, short, char, or int. Can't accept long, double, float at all.
- if (dimEnum > INT)
- throwClassCast(arrayType, dimType);
- // But need to be changed to appropriate type for the array.set to work.
- dimValues[i] = new Integer(dimValueAsInt);
- break;
- case LONG :
- // Can accept byte, short, char, int, or long. Can't accept double, float at all.
- if (dimEnum > LONG)
- throwClassCast(arrayType, dimType);
- // But need to be changed to appropriate type for the array.set to work.
- dimValues[i] = new Long(getLong(dimValue));
- break;
- case FLOAT :
- // Can accept byte, short, char, int, long, or float. Can't accept double at all.
- if (dimEnum > FLOAT)
- throwClassCast(arrayType, dimType);
- // But need to be changed to appropriate type for the array.set to work.
- dimValues[i] = new Float(getFloat(dimValue));
- break;
- case DOUBLE :
- // But need to be changed to appropriate type for the array.set to work.
- dimValues[i] = new Double(getDouble(dimValue));
- break;
-
- }
- }
- // Compatible, so ok.
- } else if (dimType != MethodHelper.NULL_TYPE && !arrayType.isAssignableFrom(dimType)) {
- // If it is NULL_TYPE, then this is a pushed null. This is always assignable to a non-primitive.
- // So we don't enter here in that case. However, a null that was returned from some expression
- // won't have a NULL_TYPE, it will instead have the expected return type. That must be used
- // in the assignment instead. That is because in java it uses the expected type to determine
- // compatibility, not the actual type.
- throwClassCast(arrayType, dimType);
- }
- }
-
- }
-
- // Now we finally create the array.
- Object array = Array.newInstance(arrayType, new int[] {expressionCount});
- for (int i = 0; i < expressionCount; i++) {
- Array.set(array, i, dimValues[i]);
- }
-
- pushExpressionValue(array, array.getClass()); // Adjust to true array type, not the incoming type (which is one dimension too small).
-
- } catch (RuntimeException e) {
- processException(e);
- } catch (NoExpressionValueException e) {
- processException(e);
- }
- } finally {
- if (traceOn)
- printTraceEnd();
- }
-
- }
-
- /**
- * Push the class instance creation request.
- *
- * @param type The type to create an instance of
- * @param argumentCount The number of arguments (which are stored on the stack). * @throws NoExpressionValueException
- * @since 1.0.0
- */
- public final void pushClassInstanceCreation(Class type, int argumentCount) {
- boolean ignore = (ignoreExpression != null || errorOccurred);
-
- if (traceOn)
- printTrace("Create Class: "+type+" (", ignore); //$NON-NLS-1$ //$NON-NLS-2$
- try {
- if (ignore)
- return;
-
- try {
- // We need to pull in the arguments. They are stacked in reverse order.
- Object value = null; // The new instance.
- Object[] args = new Object[argumentCount];
- Class[] argTypes = new Class[argumentCount];
- for (int i = argumentCount - 1; i >= 0; i--) {
- args[i] = popExpression();
- argTypes[i] = popExpressionType(false);
- }
-
- // Now we need to find the appropriate constructor.
- Constructor ctor;
- ctor = MethodHelper.findCompatibleConstructor(type, argTypes);
- if (traceOn) {
- if (argumentCount == 0) {
- // No args, just do default ctor.
- System.out.print("Default ctor)"); //$NON-NLS-1$
- } else {
- System.out.print(ctor);
- System.out.print(')');
- }
- }
- value = ctor.newInstance(args);
-
- pushExpressionValue(value, type);
- } catch (RuntimeException e) {
- processException(e);
- } catch (NoExpressionValueException e) {
- processException(e);
- } catch (InstantiationException e) {
- processException(e);
- } catch (IllegalAccessException e) {
- processException(e);
- } catch (InvocationTargetException e) {
- processException(e);
- } catch (NoSuchMethodException e) {
- processException(e);
- } catch (AmbiguousMethodException e) {
- processException(e);
- } catch (LinkageError e) {
- processException(e);
- } catch (Error e) {
- if (e.getClass() == Error.class) {
- // If exactly Error.class, then process it. This is hopefully just a "unresolved compilation error".
- processException(new UnresolvedCompilationError(e));
- } else
- throw e; // All subclasses we throw on out.
- }
- } finally {
- if (traceOn)
- printTraceEnd();
- }
-
- }
-
- /**
- * Push the field access expression.
- * @param field String for fieldname, or a java.lang.reflect.Field.
- * @param fieldIsString <code>true</code> if field is a string name, and not a java.lang.reflect.Field.
- * @param hasReceiver
- *
- * @since 1.0.0
- */
- public final void pushFieldAccess(Object field, boolean fieldIsString, boolean hasReceiver) {
- try {
- if (ignoreExpression != null || errorOccurred) {
- if (traceOn)
- printTrace("Field Access", true); //$NON-NLS-1$
- return;
- }
-
- if (traceOn)
- printTrace("Field Access: ", false); //$NON-NLS-1$
- try {
- // Get the receiver off of the stack.
- Object receiver = null;
- Class receiverType = null;
- if (hasReceiver) {
- receiver = popExpression();
- receiverType = popExpressionType(false);
- }
-
- // Find the field.
- Field reflectField = fieldIsString ? receiverType.getField((String) field) : (Field) field;
- // Access the field.
- Object value = FieldAccessReference.createFieldAccessReference(reflectField, receiver);
- Class valueType = reflectField.getType();
- if (traceOn) {
- System.out.print("Field: "); //$NON-NLS-1$
- if (fieldIsString)
- System.out.print("(looked up) "); //$NON-NLS-1$
- System.out.print(reflectField);
- System.out.print(">"); //$NON-NLS-1$
- printObjectAndType(value, valueType);
- }
-
- pushExpressionValue(value, valueType);
- } catch (RuntimeException e) {
- processException(e);
- } catch (NoExpressionValueException e) {
- processException(e);
- } catch (NoSuchFieldException e) {
- processException(e);
- }
- } finally {
- if (traceOn)
- printTraceEnd();
- }
-
- }
-
- /**
- * Push the method invocation expression.
- * @param method
- * @param methodIsString <code>true</code> if method is a string (so string name) or else it is a java.lang.reflect.Method.
- * @param hasReceiver
- * @param argCount
- * @since 1.0.0
- */
- public final void pushMethodInvocation(Object method, boolean methodIsString, boolean hasReceiver, int argCount) {
- try {
- if (ignoreExpression != null || errorOccurred) {
- if (traceOn)
- printTrace("Invoke", true); //$NON-NLS-1$
- return;
- }
-
- if (traceOn)
- printTrace("Invoke: ", false); //$NON-NLS-1$
-
- Method reflectMethod = null;
- try {
- // We need to pull in the arguments. They are stacked in reverse order.
- Object[] args = new Object[argCount];
- Class[] argTypes = new Class[argCount];
- for (int i = argCount - 1; i >= 0; i--) {
- args[i] = popExpression();
- argTypes[i] = popExpressionType(false);
- }
-
- // Now get receiver
- Object receiver = null;
- Class receiverType = null;
- if (hasReceiver) {
- receiver = popExpression();
- receiverType = popExpressionType(false);
- }
-
- // Now we need to find the appropriate method. If it is a string then there must be a receiver, otherwise no way to know.
- if (methodIsString) {
- reflectMethod = MethodHelper.findCompatibleMethod(receiverType, (String) method, argTypes);
- } else
- reflectMethod = (Method) method;
-
- if (traceOn && reflectMethod != null) {
- System.out.print("Method: "); //$NON-NLS-1$
- if (methodIsString)
- System.out.print("(looked up) "); //$NON-NLS-1$
- System.out.print(reflectMethod);
- }
-
- if (!Modifier.isStatic(reflectMethod.getModifiers()) && receiver == null)
- throw new NullPointerException("No receiver for non-static method: "+reflectMethod.toString()); //$NON-NLS-1$
-
- Object value = reflectMethod.invoke(receiver, args);
-
- if (traceOn) {
- System.out.print(" returns: "); //$NON-NLS-1$
- printObjectAndType(value, reflectMethod.getReturnType());
- }
- pushExpressionValue(value, reflectMethod.getReturnType());
- } catch (RuntimeException e) {
- processException(fixUpMethodException(e, reflectMethod));
- } catch (NoExpressionValueException e) {
- processException(fixUpMethodException(e, reflectMethod));
- } catch (IllegalAccessException e) {
- processException(fixUpMethodException(e, reflectMethod));
- } catch (InvocationTargetException e) {
- processException(fixUpMethodException(e.getCause(), reflectMethod));
- } catch (NoSuchMethodException e) {
- processException(e);
- } catch (AmbiguousMethodException e) {
- processException(e);
- }
- } finally {
- if (traceOn)
- printTraceEnd();
- }
-
- }
-
- /*
- * Many of the exceptions don't add in what method had the error, so we
- * will do that here.
- */
- private Throwable fixUpMethodException(Throwable e, Method method) {
- if (method == null)
- return e;
- try {
- String msg = e.getMessage();
- Constructor eWithStringCtor = e.getClass().getConstructor(new Class[] {String.class});
- String newMsg;
- if (msg == null) {
- newMsg = method.toString();
- } else {
- newMsg = method.toString()+": \""+msg+'\"'; //$NON-NLS-1$
- }
- Exception fixedupE = (Exception) eWithStringCtor.newInstance(new Object[] {newMsg});
- fixedupE.setStackTrace(e.getStackTrace());
- return fixedupE;
- } catch (Exception e1) {
- return e;
- }
-
- }
-
- private static final Object CONDITIONAL_IGNORE = "CONDITIONAL IGNORE"; // Flag for conditional in ingore //$NON-NLS-1$
- private int conditionalNesting = 0; // Nesting of conditional expressions.
- private int conditionalIgnoreNestCount = 0; // When ignoring conditional expressions, ignore until this nest count.
- private boolean skipTruePart;
-
- /**
- * Push a conditional expression. It can be any clause of the conditional (test, true, or false clause).
- * @param expressionType
- *
- * @since 1.0.0
- */
- public final void pushConditional(InternalConditionalOperandType expressionType) {
- try {
- boolean ignore = true;
- try {
- if (errorOccurred)
- return;
- // Slightly different here in that if an ignoring occurred we still need to process at least part of it so that
- // we can get the expression grouping correct.
- switch (expressionType.getValue()) {
- case InternalConditionalOperandType.CONDITIONAL_TEST_VALUE:
- conditionalNesting++;
- break;
- case InternalConditionalOperandType.CONDITIONAL_TRUE_VALUE:
- if (skipTruePart && ignoreExpression == CONDITIONAL_IGNORE && conditionalIgnoreNestCount == conditionalNesting) {
- // stop ignoring, we've ignored the true condition of interest.
- ignoreExpression = null;
- return; // However, leave because since this condition was ignored.
- }
- break;
- case InternalConditionalOperandType.CONDITIONAL_FALSE_VALUE:
- int currentNesting = conditionalNesting--;
- if (ignoreExpression == CONDITIONAL_IGNORE && conditionalIgnoreNestCount == currentNesting) {
- // stop ignoring, we've ignored the false condition of interest.
- ignoreExpression = null;
- return; // However, leave because since this condition was ignored.
- }
- }
-
- if (ignoreExpression != null)
- return;
- ignore = false;
- } finally {
- if (traceOn)
- printTrace("Conditional "+expressionType, ignore); //$NON-NLS-1$
- }
-
- try {
- switch (expressionType.getValue()) {
- case InternalConditionalOperandType.CONDITIONAL_TEST_VALUE:
- Object condition = popExpression();
- Class type = popExpressionType(false);
- if (type != Boolean.TYPE)
- throwClassCast(Boolean.TYPE, condition);
- if (((Boolean) condition).booleanValue()) {
- // Condition was true.
- // Do nothing. Let true condition be processed.
- } else {
- // Condition was false.
- skipTruePart = true; // Tell the true condition should be ignored.
- ignoreExpression = CONDITIONAL_IGNORE;
- conditionalIgnoreNestCount = conditionalNesting;
- }
- // We don't put anything back on the stack because the condition test is not ever returned.
- // The appropriate true or false condition evaluation will be left on the stack.
- break;
- case InternalConditionalOperandType.CONDITIONAL_TRUE_VALUE:
- skipTruePart = false; // Tell the false condition should be ignored.
- ignoreExpression = CONDITIONAL_IGNORE;
- conditionalIgnoreNestCount = conditionalNesting;
- break;
- case InternalConditionalOperandType.CONDITIONAL_FALSE_VALUE:
- // There's nothing to do, if it was ignored due to true, we wouldn't of gotton here.
- // If it wasn't ignored, then the result of the false expression is on the stack, which is what it should be.
- break;
- }
- } catch (RuntimeException e) {
- processException(e);
- } catch (NoExpressionValueException e) {
- processException(e);
- }
- } finally {
- if (traceOn)
- printTraceEnd();
- }
- }
-
- private static final Object BLOCK_IGNORE = "BLOCK IGNORE"; //$NON-NLS-1$
- private int[] blocks; // Stack of block numbers currently evaluating.
- private int topBlock = -1; // Top block index.
- private int breakBlock = -1; // Block number we are breaking to.
-
- /**
- * Push a begin block.
- * @param blockNumber
- *
- * @since 1.1.0
- */
- public final void pushBlockBegin(int blockNumber) {
- if (traceOn) {
- printTrace("Begin Block #"+blockNumber, errorOccurred); //$NON-NLS-1$
- indent(true);
- }
- try {
- if (errorOccurred)
- return;
- // We are not checking ignore because this is a structural concept instead of executable expressions, so we need to keep track of these.
- if (blocks == null)
- blocks = new int[10];
- if (++topBlock >= blocks.length) {
- int[] newList = new int[blocks.length*2];
- System.arraycopy(blocks, 0, newList, 0, blocks.length);
- blocks = newList;
- }
- blocks[topBlock] = blockNumber;
- } finally {
- if (traceOn)
- printTraceEnd();
- }
- }
-
- /**
- * Push a block end. The current block must be the given number, or it is an error.
- *
- * @param blockNumber
- *
- * @since 1.1.0
- */
- public final void pushBlockEnd(int blockNumber) {
- try {
- if (traceOn) {
- indent(false);
- printTrace("End Block #"+blockNumber, errorOccurred); //$NON-NLS-1$
- }
- if (errorOccurred)
- return;
- // We are not checking ignore because this is a structural concept instead of executable expressions, so we need to keep track of these.
- if (blocks == null || topBlock < 0 || blocks[topBlock] != blockNumber) {
- processSyntaxException(new IllegalStateException(InitparserTreeMessages.getString("ExpressionProcesser.PushBlockEnd.ReceivedEndBlocksOutOfOrder_EXC_"))); //$NON-NLS-1$
- } else {
- topBlock--;
- if (ignoreExpression == BLOCK_IGNORE && blockNumber == breakBlock) {
- ignoreExpression = null;
- }
- }
- } finally {
- if (traceOn)
- printTraceEnd();
- }
- }
-
- /**
- * Skip all following until we hit the requested block number.
- * @param blockNumber
- *
- * @since 1.1.0
- */
- public final void pushBlockBreak(int blockNumber) {
- try {
- if (traceOn)
- printTrace("Break Block #"+blockNumber, errorOccurred); //$NON-NLS-1$
- if (errorOccurred)
- return;
- if (ignoreExpression == null) {
- ignoreExpression = BLOCK_IGNORE; // Start ignoring expressions until we hit the block number end block.
- breakBlock = blockNumber;
- }
- } finally {
- if (traceOn)
- printTraceEnd();
- }
- }
-
- private static final Object TRY_THROW_IGNORE = "TRY THROW IGNORE"; //$NON-NLS-1$
- private static final Object TRY_FINAL_IGNORE = "TRY FINAL IGNORE"; //$NON-NLS-1$
- private int[] trys; // Stack of try numbers currently evaluating.
- // Stack of trys in catch clause (i.e. starting executing a catch/final clause for the try). Corresponds with try from same index in trys. Contains the throwable for the catch.
- // This is used to know we are executing a catch (entry not null) and for the rethrow short-hand to rethrow the same exception within the catch.
- private Throwable[] trysInCatch;
- private int topTry = -1; // Top try index.
- private int breakTry = -1; // Try number we are breaking to.
- private Throwable catchThrowable; // The throwable to check catches against.
-
- /**
- * Push a try statement.
- * @param tryNumber
- *
- * @since 1.1.0
- */
- public final void pushTryBegin(int tryNumber) {
- try {
- if (traceOn) {
- printTrace("Begin Try #"+tryNumber, errorOccurred); //$NON-NLS-1$
- indent(true);
- }
-
- if (errorOccurred)
- return;
- // We are not checking ignore because this is a structural concept instead of executable expressions, so we need to keep track of these.
- if (trys == null) {
- trys = new int[10];
- trysInCatch = new Throwable[10];
- }
- if (++topTry >= trys.length) {
- int[] newList = new int[trys.length*2];
- System.arraycopy(trys, 0, newList, 0, trys.length);
- trys = newList;
- Throwable[] newCatches = new Throwable[trys.length];
- System.arraycopy(trysInCatch, 0, newCatches, 0, trysInCatch.length);
- trysInCatch = newCatches;
- }
- trys[topTry] = tryNumber;
- trysInCatch[topTry] = null;
- } finally {
- if (traceOn)
- printTraceEnd();
- }
- }
-
- /**
- * Throw the top stack entry. It must be an exception.
- *
- *
- * @since 1.1.0
- */
- public final void pushThrowException() {
- try {
- boolean ignore = (ignoreExpression != null || errorOccurred);
- if (traceOn)
- printTrace("Throw exception: ", ignore); //$NON-NLS-1$
-
- if (ignore)
- return;
-
- try {
- Object t = popExpression();
- popExpressionType(false);
- if (traceOn) {
- System.out.print(t);
- }
- throwException((Throwable) t);
- } catch (NoExpressionValueException e) {
- processException(e);
- } catch (ClassCastException e) {
- processException(e);
- }
- } finally {
- if (traceOn)
- printTraceEnd();
- }
- }
-
- /**
- * Throw this exception (means throw through the expression being processed, not throw for this thread).
- * @param exception
- *
- * @since 1.1.0
- */
- protected final void throwException(Throwable exception) {
- if (topTry == -1) {
- // There are no tries, so treat this as a syntax error.
- if (exception instanceof NoExpressionValueException)
- processSyntaxException((NoExpressionValueException) exception);
- else
- processSyntaxException(exception);
- } else if (trysInCatch[topTry] == null) {
- // We are not in a catch clause of the top try. So do a throw ignore for toptry.
- ignoreExpression = TRY_THROW_IGNORE;
- breakTry = trys[topTry];
- catchThrowable = exception;
- } else {
- // We are in a catch of the top try. So do a throw to finally instead.
- ignoreExpression = TRY_FINAL_IGNORE;
- trysInCatch[topTry] = FINAL_CATCH;
- breakTry = trys[topTry];
- catchThrowable = exception;
- }
- }
-
- /**
- * Push a catch clause
- * @param tryNumber
- * @param exceptionType
- * @param expressionProxy
- *
- * @since 1.1.0
- */
- public final void pushTryCatchClause(int tryNumber, Class exceptionType, InternalExpressionProxy expressionProxy) {
- try {
- if (traceOn) {
- indent(false);
- if (expressionProxy == null)
- printTrace("Catch Try #"+tryNumber+" ("+exceptionType+')', errorOccurred); //$NON-NLS-1$ //$NON-NLS-2$
- else
- printTrace("Catch Try #"+tryNumber+" ("+exceptionType+") Return exception in proxy #"+expressionProxy.getProxyID(), errorOccurred); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- indent(true);
- }
-
- if (errorOccurred)
- return;
-
- // We are not checking ignore because this is a structural concept instead of executable expressions, so we need to keep track of these.
- if (trys == null || topTry < 0 || trys[topTry] != tryNumber) {
- processSyntaxException(new IllegalStateException(InitparserTreeMessages.getString("ExpressionProcesser.PushTryCatchClause.CatchReceivedOutOfOrder_EXC_"))); //$NON-NLS-1$
- } else {
- if (ignoreExpression == null) {
- // Normal flow, no throw in progress, so just ignore now until the finally or end try reached.
- ignoreExpression = TRY_FINAL_IGNORE;
- breakTry = tryNumber;
- } else if (ignoreExpression == TRY_THROW_IGNORE && tryNumber == breakTry) {
- // We are here due to a throw occuring in this try block, see if for us, and if it is, stop ignoring.
- // Else just continue ignoring.
- if (exceptionType.isInstance(catchThrowable)) {
- // For us, so just turn everything back on, except mark that we are in the catch phase.
- ignoreExpression = null;
- trysInCatch[topTry] = catchThrowable; // This is so that we know if we throw again that we should not catch anything.
- breakTry = -1;
- if (expressionProxy != null) {
- expressionProxy.setProxy(catchThrowable, catchThrowable.getClass());
- allocateExpressionProxy(expressionProxy);
- }
- if (traceOn) {
- System.out.print(" Caught: "); //$NON-NLS-1$
- System.out.print(catchThrowable);
- }
- catchThrowable = null;
- }
- }
- }
- } finally {
- if (traceOn)
- printTraceEnd();
- }
- }
-
- // This is used only so that finally clause can indicate it was executing so that end expression knows this.
- private static final Throwable FINAL_CATCH = new RuntimeException();
-
- /**
- * Push the try finally clause.
- * @param tryNumber
- *
- * @since 1.1.0
- */
- public final void pushTryFinallyClause(int tryNumber) {
- try {
- if (traceOn) {
- indent(false);
- printTrace("Finally Try #"+tryNumber, errorOccurred); //$NON-NLS-1$
- indent(true);
- }
- if (errorOccurred)
- return;
- // We are not checking ignore because this is a structural concept instead of executable expressions, so we need to keep track of these.
- if (trys == null || topTry < 0 || trys[topTry] != tryNumber) {
- processSyntaxException(new IllegalStateException(InitparserTreeMessages.getString("ExpressionProcesser.PushTryFinallyClause.FinallyReceivedOutOfOrder_EXC_"))); //$NON-NLS-1$
- } else {
- if (tryNumber == breakTry && (ignoreExpression == TRY_THROW_IGNORE || ignoreExpression == TRY_FINAL_IGNORE)) {
- // We are here due to a throw occuring in this try block or a catch was reached (in which case all intervening catch's were ignored).
- // Now do a normal execution. If we are here due to a throw that wasn't cleared (either no catch or another throw occured within the catch)
- // then we leave it uncleared so that try/end may rethrow it.
- ignoreExpression = null;
- trysInCatch[topTry] = FINAL_CATCH; // We are in the finally clause of a exception being thrown within this try.
- breakTry = -1;
- if (traceOn)
- System.out.print(" Executing finally."); //$NON-NLS-1$
- }
- }
- } finally {
- if (traceOn)
- printTraceEnd();
- }
- }
-
- /**
- * Rethrow the caught exception. This is a shortcut for:
- * } catch (Exception e) {
- * ... do stuff ...
- * throw e;
- * }
- * @param tryNumber
- *
- * @since 1.1.0
- */
- public final void pushTryRethrow(int tryNumber) {
- if (traceOn)
- printTrace("Rethrow Try #"+tryNumber, errorOccurred || ignoreExpression != null); //$NON-NLS-1$
-
- try {
- if (errorOccurred)
- return;
- // We are not checking ignore because we need to make sure this is not called out of order.
- if (trys == null || topTry < 0 || trys[topTry] != tryNumber) {
- processSyntaxException(new IllegalStateException(InitparserTreeMessages.getString("ExpressionProcesser.PushTryRethrow.RethrowReceivedOutOfOrder_EXC_"))); //$NON-NLS-1$
- } else if (ignoreExpression == null) {
- if (trysInCatch[topTry] == null || trysInCatch[topTry] == FINAL_CATCH)
- processSyntaxException(new IllegalStateException(InitparserTreeMessages.getString("ExpressionProcesser.PushTryRethrow.RetryReceivedOutOfExecutingCatchClause_EXC_"))); //$NON-NLS-1$
- else {
- throwException(trysInCatch[topTry]);
- }
- }
- } finally {
- if (traceOn)
- printTraceEnd();
- }
- }
-
- public final void pushTryEnd(int tryNumber) {
- if (traceOn) {
- indent(false);
- printTrace("End Try #"+tryNumber, errorOccurred); //$NON-NLS-1$
- }
- try {
- if (errorOccurred)
- return;
- // We are not checking ignore because this is a structural concept instead of executable expressions, so we need to keep track of these.
- if (trys == null || topTry < 0 || trys[topTry] != tryNumber) {
- processSyntaxException(new IllegalStateException(InitparserTreeMessages.getString("ExpressionProcesser.PushTryEnd.TryEndReceivedOutOfOrder_EXC_"))); //$NON-NLS-1$
- } else {
- boolean inCatch = trysInCatch[topTry] != null;
- trysInCatch[topTry] = null;
- topTry--;
- if (inCatch || (tryNumber == breakTry && (ignoreExpression == TRY_THROW_IGNORE || ignoreExpression == TRY_FINAL_IGNORE))) {
- // We are here due to a throw or normal flow through a catch. Either way if there is a throwable still pending, we rethrow.
- ignoreExpression = null;
- breakTry = -1;
- if (catchThrowable != null)
- throwException(catchThrowable);
- }
- }
- } finally {
- if (traceOn)
- printTraceEnd();
- }
- }
-
- /**
- * Class used to save the state at time of mark. It will
- * be used to restore state if error.
- *
- * @since 1.1.0
- */
- protected class SaveState {
- public int markID;
-
- // Block state
- public int topBlock;
- public int breakBlock;
-
- // Subexpression state
- public int topSubexpression;
-
- // Try state
- public int topTry;
- public int breakTry;
- public Throwable catchThrowable;
-
- // Error state
- public boolean errorOccurred;
- public boolean novalueException;
- public Throwable exception;
- public Object ignoreExpression;
-
- // Expression stack state
- public int expressionStackPos;
-
- // If/else state
- public int ifElseNesting;
- public int ifElseIgnoreNestCount;
- public boolean ifElseSkipTruePart;
-
- // Other
- public int indent;
- public int expressionProxyPos;
-
- /**
- * Construct and save the state.
- *
- * @param markNumber
- *
- * @since 1.1.0
- */
- public SaveState(int markID) {
- this.markID = markID;
-
- ExpressionProcesser ep = ExpressionProcesser.this;
- this.topBlock = ep.topBlock;
- this.breakBlock = ep.breakBlock;
-
- this.topSubexpression = ep.topSubexpression;
-
- this.topTry = ep.topTry;
- this.breakTry = ep.breakTry;
- this.catchThrowable = ep.catchThrowable;
-
- this.errorOccurred = ep.errorOccurred;
- this.novalueException = ep.novalueException;
- this.exception = ep.exception;
- this.ignoreExpression = ep.ignoreExpression;
-
- this.expressionStackPos = expressionStack.size()-1;
-
- this.ifElseNesting = ep.ifElseNesting;
- this.ifElseIgnoreNestCount = ep.ifElseIgnoreNestCount;
- this.ifElseSkipTruePart = ep.ifElseSkipTruePart;
-
- this.indent = ep.indent;
- this.expressionProxyPos = expressionProxies != null ? expressionProxies.size()-1 : -1;
- }
-
- /**
- * Restore the state.
- *
- *
- * @since 1.1.0
- */
- public void restoreState() {
- ExpressionProcesser ep = ExpressionProcesser.this;
- ep.topBlock = this.topBlock;
- ep.breakBlock = this.breakBlock;
-
- ep.topSubexpression = this.topSubexpression;
-
- ep.topTry = this.topTry;
- ep.breakTry = this.breakTry;
- ep.catchThrowable = this.catchThrowable;
- if (trysInCatch != null) {
- for (int i = topTry + 1; i < ep.trysInCatch.length; i++) {
- ep.trysInCatch[i] = null;
- }
- }
-
- ep.errorOccurred = this.errorOccurred;
- ep.novalueException = ep.novalueException;
- ep.exception = this.exception;
- ep.ignoreExpression = this.ignoreExpression;
-
- // Pop stack down to saved state.
- for (int i = expressionStack.size()-1; i > this.expressionStackPos; i--) {
- expressionStack.remove(i);
- expressionTypeStack.remove(i);
- }
-
- ep.ifElseNesting = this.ifElseNesting;
- ep.ifElseIgnoreNestCount = this.ifElseIgnoreNestCount;
- ep.ifElseSkipTruePart = this.ifElseSkipTruePart;
-
- ep.indent = this.indent;
-
- if (expressionProxies != null) {
- for (int i = expressionProxies.size() - 1; i > this.expressionProxyPos; i--) {
- expressionProxies.remove(i);
- }
- }
-
- // These settings can't cross mark boundaries, so reset them to not set. This is in case we were in this state somewhere
- // in the mark when the restore occurred.
- ep.conditionalIgnoreNestCount = 0;
- ep.conditionalNesting = 0;
- ep.skipTruePart = false;
-
- ep.infixIgnoreNestCount = 0;
- ep.infixNesting = 0;
- }
- }
-
- /**
- * Create the save state with the given id.
- * @param markID
- * @return
- *
- * @since 1.1.0
- */
- protected SaveState createSaveState(int markID) {
- return new SaveState(markID);
- }
-
- /**
- * Push the start of a mark.
- * @param markNumber
- *
- * @since 1.1.0
- */
- public final void pushMark(int markNumber) {
- if (traceOn)
- printTrace("Mark#"+markNumber, false); //$NON-NLS-1$
-
- if (saveStates == null)
- saveStates = new ArrayList();
- saveStates.add(createSaveState(markNumber));
-
- if (traceOn)
- printTraceEnd();
- }
-
- /**
- * Push the end mark. If there is no error, it will simply
- * remove it and all save states in the map after it. If there
- * is an error it will do this plus it will restore the state.
- * <p>
- * It is assumed that the calls are coming in correct order from
- * the server so we won't check validity.
- *
- * @param markID
- * @param restore
- *
- * @since 1.1.0
- */
- public final void pushEndmark(int markID, boolean restore) {
- if (traceOn)
- printTrace("End Mark#"+markID+" Restored="+restore, false); //$NON-NLS-1$ //$NON-NLS-2$
-
- try {
- if (saveStates != null) {
- // Start from the end (since that is where it most likely will be) and start
- // search, removing the end one until we reach the markID.
- for (int i = saveStates.size() - 1; i >= 0; i--) {
- SaveState state = (SaveState) saveStates.remove(i);
- if (state.markID == markID) {
- // We found it.
- if (restore)
- state.restoreState();
- return;
- }
- }
- // But to be safe, if we got here, this is bad. We tried restore a mark we didn't have.
- processSyntaxException(new IllegalStateException(MessageFormat.format(InitparserTreeMessages.getString("ExpressionProcesser.PushEndmark.EndMarkOnNonExistingID_EXC_"), new Object[]{new Integer(markID)}))); //$NON-NLS-1$
- }
- } finally {
- if (traceOn)
- printTraceEnd();
- }
- }
-
- private int[] subexpressions; // Stack of subexpression numbers currently evaluating.
- private int[] subexpressionStackPos; // Stack of the expression stack positions (next entry index) for currently evaluating expressions. The evaluation stack cannot be popped beyond the current top. And at end it will be cleaned up to the position.
- private int topSubexpression = -1; // Top subexpression index.
-
-
- /**
- * Push a begin subexpression.
- * @param subexpressionNumber
- *
- * @since 1.1.0
- */
- public final void pushSubexpressionBegin(int subexpressionNumber) {
- if (traceOn) {
- printTrace("Begin Subexpression #"+subexpressionNumber, errorOccurred); //$NON-NLS-1$
- indent(true);
- }
- try {
- if (errorOccurred)
- return;
- // We are not checking ignore because this is a structural concept instead of executable expressions, so we need to keep track of these.
- if (subexpressions == null) {
- subexpressions = new int[10];
- subexpressionStackPos = new int[10];
- }
- if (++topSubexpression >= subexpressions.length) {
- int[] newList = new int[subexpressions.length*2];
- System.arraycopy(subexpressions, 0, newList, 0, subexpressions.length);
- subexpressions = newList;
- newList = new int[subexpressionStackPos.length*2];
- System.arraycopy(subexpressionStackPos, 0, newList, 0, subexpressionStackPos.length);
- subexpressionStackPos = newList;
- }
- subexpressions[topSubexpression] = subexpressionNumber;
- subexpressionStackPos[topSubexpression] = expressionStack.size();
- } finally {
- if (traceOn)
- printTraceEnd();
- }
- }
-
- /**
- * Push a subexpression end. The current subexpression must be the given number, or it is an error.
- *
- * @param subexpressionNumber
- *
- * @since 1.1.0
- */
- public final void pushSubexpressionEnd(int subexpressionNumber) {
- try {
- if (traceOn) {
- indent(false);
- printTrace("End Subexpression #"+subexpressionNumber, errorOccurred); //$NON-NLS-1$
- }
- if (errorOccurred)
- return;
- // We are not checking ignore because this is a structural concept instead of executable expressions, so we need to keep track of these.
- if (subexpressions == null || topSubexpression < 0 || subexpressions[topSubexpression] != subexpressionNumber) {
- processSyntaxException(new IllegalStateException(InitparserTreeMessages.getString("ExpressionProcesser.PushSubexpressionEnd.ReceivedEndSubexpressionsOutOfOrder_EXC_"))); //$NON-NLS-1$
- } else {
- try {
- popExpressions(expressionStack.size()-subexpressionStackPos[topSubexpression]);
- topSubexpression--;
- } catch (NoExpressionValueException e) {
- processException(e);
- }
- }
- } finally {
- if (traceOn)
- printTraceEnd();
- }
- }
-
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/tree/ForExpression.java b/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/tree/ForExpression.java
deleted file mode 100644
index 8e47baf05..000000000
--- a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/tree/ForExpression.java
+++ /dev/null
@@ -1,213 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 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.jem.internal.proxy.initParser.tree;
-
-/**
- * Enum for the forExpression parameters.
- * <p>
- * This is not meant to be subclassed by customers.
- * @since 1.1.0
- */
-public class ForExpression extends AbstractEnum {
-
- /**
- * forExpression: Creating a root expression
- */
- public static final int ROOTEXPRESSION_VALUE = 0;
-
- public static final ForExpression ROOTEXPRESSION = new ForExpression(ROOTEXPRESSION_VALUE, "Root"); //$NON-NLS-1$
-
- /**
- * forExpression: Creating the array expression for an array access (i.e. the array to access)
- */
- public static final int ARRAYACCESS_ARRAY_VALUE = 1;
-
- public static final ForExpression ARRAYACCESS_ARRAY = new ForExpression(ARRAYACCESS_ARRAY_VALUE, "Array Access: Array Operand"); //$NON-NLS-1$
-
- /**
- * forExpression: Creating an index expression for an array access (i.e. one of the expressions within the <code>[]</code>).
- */
- public static final int ARRAYACCESS_INDEX_VALUE = 2;
-
- public static final ForExpression ARRAYACCESS_INDEX = new ForExpression(ARRAYACCESS_INDEX_VALUE, "Array Access: Index"); //$NON-NLS-1$
-
- /**
- * forExpression: Creating an dimension expression for an array creation (i.e. one of the expressions within the <code>[]</code>).
- */
- public static final int ARRAYCREATION_DIMENSION_VALUE = 3;
-
- public static final ForExpression ARRAYCREATION_DIMENSION = new ForExpression(ARRAYCREATION_DIMENSION_VALUE, "Array Access: Dimension"); //$NON-NLS-1$
-
- /**
- * forExpression: Creating an expression for an array initializer (i.e. one of the expressions with the <code>{}</code>). Special case is that
- * array initializers are valid as an expression within an array initializer and it doesn't use a for expression.
- */
- public static final int ARRAYINITIALIZER_EXPRESSION_VALUE = 4;
-
- public static final ForExpression ARRAYINITIALIZER_EXPRESSION = new ForExpression(ARRAYINITIALIZER_EXPRESSION_VALUE, "Array Initializer"); //$NON-NLS-1$
-
- /**
- * forExpression: Creating the expression for the cast (i.e. the expresion after the <code>(type)</code>).
- */
- public static final int CAST_EXPRESSION_VALUE = 5;
-
- public static final ForExpression CAST_EXPRESSION = new ForExpression(CAST_EXPRESSION_VALUE, "Cast"); //$NON-NLS-1$
-
- /**
- * forExpression: Creating the argument expression for the new instance.
- */
- public static final int CLASSINSTANCECREATION_ARGUMENT_VALUE = 6;
-
- public static final ForExpression CLASSINSTANCECREATION_ARGUMENT = new ForExpression(CLASSINSTANCECREATION_ARGUMENT_VALUE,
- "Class Instance Creation: Argument"); //$NON-NLS-1$
-
- /**
- * forExpression: Creating the condition for a conditional expression.
- */
- public static final int CONDITIONAL_CONDITION_VALUE = 7;
-
- public static final ForExpression CONDITIONAL_CONDITION = new ForExpression(CONDITIONAL_CONDITION_VALUE, "Conditional: Condition"); //$NON-NLS-1$
-
- /**
- * forExpression: Creating the true (then) expression for a conditional expression.
- */
- public static final int CONDITIONAL_TRUE_VALUE = 8;
-
- public static final ForExpression CONDITIONAL_TRUE = new ForExpression(CONDITIONAL_TRUE_VALUE, "Conditional: True"); //$NON-NLS-1$
-
- /**
- * forExpression: Creating the false (else) condition for a conditional expression.
- */
- public static final int CONDITIONAL_FALSE_VALUE = 9;
-
- public static final ForExpression CONDITIONAL_FALSE = new ForExpression(CONDITIONAL_FALSE_VALUE, "Conditional: False"); //$NON-NLS-1$
-
- /**
- * forExpression: Creating the receiver for a field access (i.e. the expression before the ".")
- */
- public static final int FIELD_RECEIVER_VALUE = 10;
-
- public static final ForExpression FIELD_RECEIVER = new ForExpression(FIELD_RECEIVER_VALUE, "Field Access: Receiver"); //$NON-NLS-1$
-
- /**
- * forExpression: Creating the left operand of an infix expression.
- */
- public static final int INFIX_LEFT_VALUE = 11;
-
- public static final ForExpression INFIX_LEFT = new ForExpression(INFIX_LEFT_VALUE, "Infix: Left"); //$NON-NLS-1$
-
- /**
- * forExpression: Creating the right operand of an infix expression.
- */
- public static final int INFIX_RIGHT_VALUE = 12;
-
- public static final ForExpression INFIX_RIGHT = new ForExpression(INFIX_RIGHT_VALUE, "Infix: Right"); //$NON-NLS-1$
-
- /**
- * forExpression: Creating an extended operand of an infix expression.
- */
- public static final int INFIX_EXTENDED_VALUE = 13;
-
- public static final ForExpression INFIX_EXTENDED = new ForExpression(INFIX_EXTENDED_VALUE, "Infix: Extended"); //$NON-NLS-1$
-
- /**
- * forExpression: Creating the value expression of an instanceof.
- */
- public static final int INSTANCEOF_VALUE_VALUE = 14;
-
- public static final ForExpression INSTANCEOF_VALUE = new ForExpression(INSTANCEOF_VALUE_VALUE, "Instanceof"); //$NON-NLS-1$
-
- /**
- * forExpression: Creating a receiver expression for a method invocation.
- */
- public static final int METHOD_RECEIVER_VALUE = 15;
-
- public static final ForExpression METHOD_RECEIVER = new ForExpression(METHOD_RECEIVER_VALUE, "Method Invoke: Receiver"); //$NON-NLS-1$
-
- /**
- * forExpression: Creating an argument for a method invocation.
- */
- public static final int METHOD_ARGUMENT_VALUE = 16;
-
- public static final ForExpression METHOD_ARGUMENT = new ForExpression(METHOD_ARGUMENT_VALUE, "Method Invoke: Argument"); //$NON-NLS-1$
-
- /**
- * forExpression: Creating the operand expression for a prefix operator.
- */
- public static final int PREFIX_OPERAND_VALUE = 17;
-
- public static final ForExpression PREFIX_OPERAND = new ForExpression(PREFIX_OPERAND_VALUE, "Prefix: Operand"); //$NON-NLS-1$
-
- /**
- * forExpression: Creating the right operand of an assignment operator.
- *
- * @since 1.1.0
- */
- public static final int ASSIGNMENT_RIGHT_VALUE = 18;
-
- public static final ForExpression ASSIGNMENT_RIGHT = new ForExpression(ASSIGNMENT_RIGHT_VALUE, "Assignment: Right"); //$NON-NLS-1$
-
- /**
- * forExpression: Creating the left operand of an assignment operator.
- * <p>
- * Note: The left expression can only be a FieldAccess or ArrayAccess.
- */
- public static final int ASSIGNMENT_LEFT_VALUE = 19;
-
- public static final ForExpression ASSIGNMENT_LEFT = new ForExpression(ASSIGNMENT_LEFT_VALUE, "Assignment: Left"); //$NON-NLS-1$
-
- /**
- * forExpression: Creating the throw operand of the throw expression.
- */
- public static final int THROW_OPERAND_VALUE = 20;
-
- public static final ForExpression THROW_OPERAND = new ForExpression(THROW_OPERAND_VALUE, "Throw operand"); //$NON-NLS-1$
-
- /**
- * forExpression: Creating the if conditional operand of the if expression.
- */
- public static final int IF_CONDITION_VALUE = 21;
-
- public static final ForExpression IF_CONDITION = new ForExpression(IF_CONDITION_VALUE, "If condition"); //$NON-NLS-1$
-
- /**
- * forExpression: Creating the if true clause of the if expression.
- */
- public static final int IF_TRUE_VALUE = 22;
-
- public static final ForExpression IF_TRUE = new ForExpression(IF_TRUE_VALUE, "If true clause"); //$NON-NLS-1$
-
- /**
- * forExpression: Creating the if else clause of the if expression.
- */
- public static final int IF_ELSE_VALUE = 23;
-
- public static final ForExpression IF_ELSE = new ForExpression(IF_ELSE_VALUE, "If else clause"); //$NON-NLS-1$
-
-
- /**
- * This is not private, but protected only so that proxy core can add an internal ForExpression enum.
- * <p>
- * This is not meant to be subclassed by customers.
- * @param value
- * @param name
- *
- * @since 1.1.0
- */
- protected ForExpression(int value, String name) {
- super(value, name);
- }
-
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/tree/IExpressionConstants.java b/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/tree/IExpressionConstants.java
deleted file mode 100644
index de6724b5a..000000000
--- a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/tree/IExpressionConstants.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 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.jem.internal.proxy.initParser.tree;
-
-/**
- * These are constants needed by IExpression that will be common between
- * the vm and the IDE. They are also available to users of the IExpression
- * interface.
- *
- * @since 1.0.0
- */
-public interface IExpressionConstants {
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/tree/InfixOperator.java b/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/tree/InfixOperator.java
deleted file mode 100644
index 176486052..000000000
--- a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/tree/InfixOperator.java
+++ /dev/null
@@ -1,212 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 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.jem.internal.proxy.initParser.tree;
-
-/**
- * Enum for Infix operator
- *
- * @since 1.1.0
- */
-public class InfixOperator extends AbstractEnum {
-
- /**
- * Infix times "*"
- */
- public static final int IN_TIMES_VALUE = 0;
-
- public static final InfixOperator IN_TIMES = new InfixOperator(IN_TIMES_VALUE, "Infix *"); //$NON-NLS-1$
-
- /**
- * Infix divide "/"
- */
- public static final int IN_DIVIDE_VALUE = 1;
-
- public static final InfixOperator IN_DIVIDE = new InfixOperator(IN_DIVIDE_VALUE, "Infix /"); //$NON-NLS-1$
-
- /**
- * Infix remainder "%"
- */
- public static final int IN_REMAINDER_VALUE = 2;
-
- public static final InfixOperator IN_REMAINDER = new InfixOperator(IN_REMAINDER_VALUE, "Infix %"); //$NON-NLS-1$
-
- /**
- * Infix plus "+"
- */
- public static final int IN_PLUS_VALUE = 3;
-
- public static final InfixOperator IN_PLUS = new InfixOperator(IN_PLUS_VALUE, "Infix +"); //$NON-NLS-1$
-
- /**
- * Infix minus "-"
- */
- public static final int IN_MINUS_VALUE = 4;
-
- public static final InfixOperator IN_MINUS = new InfixOperator(IN_MINUS_VALUE, "Infix -"); //$NON-NLS-1$
-
- /**
- * Infix left shift " < <"
- */
- public static final int IN_LEFT_SHIFT_VALUE = 5;
-
- public static final InfixOperator IN_LEFT_SHIFT = new InfixOperator(IN_LEFT_SHIFT_VALUE, "Infix <<"); //$NON-NLS-1$
-
- /**
- * Infix right shift signed ">>"
- */
- public static final int IN_RIGHT_SHIFT_SIGNED_VALUE = 6;
-
- public static final InfixOperator IN_RIGHT_SHIFT_SIGNED = new InfixOperator(IN_RIGHT_SHIFT_SIGNED_VALUE, "Infix >>"); //$NON-NLS-1$
-
- /**
- * Infix right shift unsigned ">>>"
- */
- public static final int IN_RIGHT_SHIFT_UNSIGNED_VALUE = 7;
-
- public static final InfixOperator IN_RIGHT_SHIFT_UNSIGNED = new InfixOperator(IN_RIGHT_SHIFT_UNSIGNED_VALUE, "Infix >>>"); //$NON-NLS-1$
-
- /**
- * Infix less " <"
- */
- public static final int IN_LESS_VALUE = 8;
-
- public static final InfixOperator IN_LESS = new InfixOperator(IN_LESS_VALUE, "Infix <"); //$NON-NLS-1$
-
- /**
- * Infix greater ">"
- */
- public static final int IN_GREATER_VALUE = 9;
-
- public static final InfixOperator IN_GREATER = new InfixOperator(IN_GREATER_VALUE, "Infix >"); //$NON-NLS-1$
-
- /**
- * Infix less than or equals " <="
- */
- public static final int IN_LESS_EQUALS_VALUE = 10;
-
- public static final InfixOperator IN_LESS_EQUALS = new InfixOperator(IN_LESS_EQUALS_VALUE, "Infix <="); //$NON-NLS-1$
-
- /**
- * Infix Greater than or equlas ">="
- */
- public static final int IN_GREATER_EQUALS_VALUE = 11;
-
- public static final InfixOperator IN_GREATER_EQUALS = new InfixOperator(IN_GREATER_EQUALS_VALUE, "Infix >="); //$NON-NLS-1$
-
- /**
- * Infix equals "=="
- */
- public static final int IN_EQUALS_VALUE = 12;
-
- public static final InfixOperator IN_EQUALS = new InfixOperator(IN_EQUALS_VALUE, "Infix =="); //$NON-NLS-1$
-
- /**
- * Infix not equals "!="
- */
- public static final int IN_NOT_EQUALS_VALUE = 13;
-
- public static final InfixOperator IN_NOT_EQUALS = new InfixOperator(IN_NOT_EQUALS_VALUE, "Infix !="); //$NON-NLS-1$
-
- /**
- * Infix exclusive or "^"
- */
- public static final int IN_XOR_VALUE = 14;
-
- public static final InfixOperator IN_XOR = new InfixOperator(IN_XOR_VALUE, "Infix ^"); //$NON-NLS-1$
-
- /**
- * Infix bitwise and "&"
- */
- public static final int IN_AND_VALUE = 15;
-
- public static final InfixOperator IN_AND = new InfixOperator(IN_AND_VALUE, "Infix &"); //$NON-NLS-1$
-
- /**
- * Infix bitwise or "|"
- */
- public static final int IN_OR_VALUE = 16;
-
- public static final InfixOperator IN_OR = new InfixOperator(IN_OR_VALUE, "Infix |"); //$NON-NLS-1$
-
- /**
- * Infix Conditional logical and "&&"
- */
- public static final int IN_CONDITIONAL_AND_VALUE = 17;
-
- public static final InfixOperator IN_CONDITIONAL_AND = new InfixOperator(IN_CONDITIONAL_AND_VALUE, "Infix &&"); //$NON-NLS-1$
-
- /**
- * Infix Conditional logical or "||"
- */
- public static final int IN_CONDITIONAL_OR_VALUE = 18;
-
- public static final InfixOperator IN_CONDITIONAL_OR = new InfixOperator(IN_CONDITIONAL_OR_VALUE, "Ifnix ||"); //$NON-NLS-1$
-
- /**
- * Return the infix operator for the given enum value.
- * @param value
- * @return
- *
- * @since 1.1.0
- */
- public static InfixOperator get(int value) {
- switch (value) {
- case IN_TIMES_VALUE:
- return IN_TIMES;
- case IN_DIVIDE_VALUE:
- return IN_DIVIDE;
- case IN_REMAINDER_VALUE:
- return IN_REMAINDER;
- case IN_PLUS_VALUE:
- return IN_PLUS;
- case IN_MINUS_VALUE:
- return IN_MINUS;
- case IN_LEFT_SHIFT_VALUE:
- return IN_LEFT_SHIFT;
- case IN_RIGHT_SHIFT_SIGNED_VALUE:
- return IN_RIGHT_SHIFT_SIGNED;
- case IN_RIGHT_SHIFT_UNSIGNED_VALUE:
- return IN_RIGHT_SHIFT_UNSIGNED;
- case IN_LESS_VALUE:
- return IN_LESS;
- case IN_GREATER_VALUE:
- return IN_GREATER;
- case IN_LESS_EQUALS_VALUE:
- return IN_LESS_EQUALS;
- case IN_GREATER_EQUALS_VALUE:
- return IN_GREATER_EQUALS;
- case IN_EQUALS_VALUE:
- return IN_EQUALS;
- case IN_NOT_EQUALS_VALUE:
- return IN_NOT_EQUALS;
- case IN_XOR_VALUE:
- return IN_XOR;
- case IN_AND_VALUE:
- return IN_AND;
- case IN_OR_VALUE:
- return IN_OR;
- case IN_CONDITIONAL_AND_VALUE:
- return IN_CONDITIONAL_AND;
- case IN_CONDITIONAL_OR_VALUE:
- return IN_CONDITIONAL_OR;
- }
- return null;
- }
-
- private InfixOperator(int value, String name) {
- super(value, name);
- }
-
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/tree/InitparserTreeMessages.java b/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/tree/InitparserTreeMessages.java
deleted file mode 100644
index bebdd83db..000000000
--- a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/tree/InitparserTreeMessages.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 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.jem.internal.proxy.initParser.tree;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * @author sri
- *
- * TODO To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-public class InitparserTreeMessages {
-
- private static final String BUNDLE_NAME = "org.eclipse.jem.internal.proxy.initParser.tree.messages";//$NON-NLS-1$
-
- private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
-
- private InitparserTreeMessages() {
- }
-
- public static String getString(String key) {
- // TODO Auto-generated method stub
- try {
- return RESOURCE_BUNDLE.getString(key);
- } catch (MissingResourceException e) {
- return '!' + key + '!';
- }
- }
-}
diff --git a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/tree/InternalConditionalOperandType.java b/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/tree/InternalConditionalOperandType.java
deleted file mode 100644
index 6d6b4eb34..000000000
--- a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/tree/InternalConditionalOperandType.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 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.jem.internal.proxy.initParser.tree;
-
-/**
- * Internal class for the Conditional operand type. Not meant to be used by customers.
- *
- * @since 1.1.0
- */
-public class InternalConditionalOperandType extends AbstractEnum {
-
- /**
- * Used in Conditional processing. False operand on expression stack
- */
- public final static int CONDITIONAL_FALSE_VALUE = 0;
-
- public final static InternalConditionalOperandType CONDITIONAL_FALSE = new InternalConditionalOperandType(CONDITIONAL_FALSE_VALUE,
- "Conditional False Operand Flag"); //$NON-NLS-1$
-
- /**
- * Used in Conditional processing. True operand on expression stack
- */
- public final static int CONDITIONAL_TRUE_VALUE = 1;
-
- public final static InternalConditionalOperandType CONDITIONAL_TRUE = new InternalConditionalOperandType(CONDITIONAL_TRUE_VALUE,
- "Conditional True Operand Flag"); //$NON-NLS-1$
-
- /**
- * Used in Conditional processing. Test operand on expression stack
- */
- public final static int CONDITIONAL_TEST_VALUE = 2;
-
- public final static InternalConditionalOperandType CONDITIONAL_TEST = new InternalConditionalOperandType(CONDITIONAL_TEST_VALUE,
- "Conditional Test Operand Flag"); //$NON-NLS-1$
-
- /**
- * Return the enum for the given value.
- * @param value
- * @return
- *
- * @since 1.1.0
- */
- public static InternalConditionalOperandType get(int value) {
- switch (value) {
- case CONDITIONAL_FALSE_VALUE:
- return CONDITIONAL_FALSE;
- case CONDITIONAL_TRUE_VALUE:
- return CONDITIONAL_TRUE;
- case CONDITIONAL_TEST_VALUE:
- return CONDITIONAL_TEST;
- }
- return null;
- }
-
- private InternalConditionalOperandType(int value, String name) {
- super(value, name);
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/tree/InternalExpressionProxy.java b/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/tree/InternalExpressionProxy.java
deleted file mode 100644
index 05dd32a07..000000000
--- a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/tree/InternalExpressionProxy.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 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.jem.internal.proxy.initParser.tree;
-
-
-/**
- * This interface is used for expression proxies in the evaluation side (in {@link org.eclipse.jem.internal.proxy.initParser.tree.ExpressionProcesser}).
- * <p>
- * It is meant to be implemented only by users of the ExpressionProcessor.
- *
- * @since 1.1.0
- */
-public interface InternalExpressionProxy {
-
- /**
- * Get the id of the proxy.
- * @return
- *
- * @since 1.1.0
- */
- public int getProxyID();
-
- /**
- * Called by ExpressionProcesser to give the expression proxy its value and type, i.e. it has been evaluated.
- * <p>
- * The type may not be the actual type of the value, it may be a superclass of it. It is the type that the proxy
- * represents from the return of the expression. For instance it may of returned null but it is supposed to be
- * java.lang.String. Or it is supposed to be a primitive int, since we can't store that, we need to store
- * an Integer value with the type indicating it is Interger.TYPE.
- *
- * @param value
- * @param type
- *
- * @since 1.1.0
- */
- public void setProxy(Object value, Class type);
-
- /**
- * Get the value of the proxy.
- * <p>
- * Note: The value may be a {@link VariableReference}, in which
- * case further dereferencing may be with the returned value.
- * @return the value of the proxy, it may be an ExpressionProcesser.VariableReference.
- *
- * @since 1.1.0
- */
- public Object getValue();
-
- /**
- * Get the type of the proxy.
- * @return
- *
- * @see InternalExpressionProxy#setProxy(Object, Class) for what type means.
- * @since 1.1.0
- */
- public Class getType();
-
- /**
- * Return whether the proxy has had a value/class set into it yet.
- * @return <code>true</code> if it has been set.
- *
- * @since 1.1.0
- */
- public boolean isSet();
-}
diff --git a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/tree/InternalExpressionTypes.java b/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/tree/InternalExpressionTypes.java
deleted file mode 100644
index d1a35eda7..000000000
--- a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/tree/InternalExpressionTypes.java
+++ /dev/null
@@ -1,303 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 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.jem.internal.proxy.initParser.tree;
-
-/**
- * These constants are for communicating between the IDE and the proxy side for expression evaluation. It is not meant to be used by customers.
- *
- * @since 1.0.0
- */
-public class InternalExpressionTypes extends AbstractEnum {
-
- /**
- * ARRAY ACCESS Expression
- */
- public final static int ARRAY_ACCESS_EXPRESSION_VALUE = 1;
-
- public final static InternalExpressionTypes ARRAY_ACCESS_EXPRESSION = new InternalExpressionTypes(ARRAY_ACCESS_EXPRESSION_VALUE,
- "Array Access Expression"); //$NON-NLS-1$
-
- /**
- * ARRAY CREATION Expression
- */
- public final static int ARRAY_CREATION_EXPRESSION_VALUE = 2;
-
- public final static InternalExpressionTypes ARRAY_CREATION_EXPRESSION = new InternalExpressionTypes(ARRAY_CREATION_EXPRESSION_VALUE,
- "Array Creation Expression"); //$NON-NLS-1$
-
- /**
- * ARRAY INITIALIZER expression
- */
- public final static int ARRAY_INITIALIZER_EXPRESSION_VALUE = 3;
-
- public final static InternalExpressionTypes ARRAY_INITIALIZER_EXPRESSION = new InternalExpressionTypes(ARRAY_INITIALIZER_EXPRESSION_VALUE,
- "Array Initializer Expression"); //$NON-NLS-1$
-
- /**
- * CAST Expression.
- */
- public final static int CAST_EXPRESSION_VALUE = 4;
-
- public final static InternalExpressionTypes CAST_EXPRESSION = new InternalExpressionTypes(CAST_EXPRESSION_VALUE, "Cast Expression"); //$NON-NLS-1$
-
- /**
- * CONDITIONAL expression
- */
- public final static int CONDITIONAL_EXPRESSION_VALUE = 5;
-
- public final static InternalExpressionTypes CONDITIONAL_EXPRESSION = new InternalExpressionTypes(CONDITIONAL_EXPRESSION_VALUE,
- "Conditional Expression"); //$NON-NLS-1$
-
- /**
- * CLASS INSTANCE CREATION expression
- */
- public final static int CLASS_INSTANCE_CREATION_EXPRESSION_VALUE = 6;
-
- public final static InternalExpressionTypes CLASS_INSTANCE_CREATION_EXPRESSION = new InternalExpressionTypes(
- CLASS_INSTANCE_CREATION_EXPRESSION_VALUE, "Class Instance Creation Expression"); //$NON-NLS-1$
-
- /**
- * FIELD ACCESS expression.
- */
- public final static int FIELD_ACCESS_EXPRESSION_VALUE = 7;
-
- public final static InternalExpressionTypes FIELD_ACCESS_EXPRESSION = new InternalExpressionTypes(FIELD_ACCESS_EXPRESSION_VALUE,
- "Field Access Expression"); //$NON-NLS-1$
-
- /**
- * INSTANCEOF Expression.
- */
- public final static int INSTANCEOF_EXPRESSION_VALUE = 8;
-
- public final static InternalExpressionTypes INSTANCEOF_EXPRESSION = new InternalExpressionTypes(INSTANCEOF_EXPRESSION_VALUE,
- "Instanceof Expression"); //$NON-NLS-1$
-
- /**
- * Infix expression
- */
- public final static int INFIX_EXPRESSION_VALUE = 9;
-
- public final static InternalExpressionTypes INFIX_EXPRESSION = new InternalExpressionTypes(INFIX_EXPRESSION_VALUE, "Infix Expression"); //$NON-NLS-1$
-
- /**
- * Method expression.
- */
- public final static int METHOD_EXPRESSION_VALUE = 10;
-
- public final static InternalExpressionTypes METHOD_EXPRESSION = new InternalExpressionTypes(METHOD_EXPRESSION_VALUE, "Method Invoke Expression"); //$NON-NLS-1$
-
- /**
- * Prefix expression
- */
- public final static int PREFIX_EXPRESSION_VALUE = 11;
-
- public final static InternalExpressionTypes PREFIX_EXPRESSION = new InternalExpressionTypes(PREFIX_EXPRESSION_VALUE, "Prefix Expression"); //$NON-NLS-1$
-
- /**
- * Push to proxy expression.
- */
- public final static int PUSH_TO_PROXY_EXPRESSION_VALUE = 12;
-
- public final static InternalExpressionTypes PUSH_TO_PROXY_EXPRESSION = new InternalExpressionTypes(PUSH_TO_PROXY_EXPRESSION_VALUE,
- "Push to Proxy Expression"); //$NON-NLS-1$
-
- /**
- * Push BeanType expression proxy expression.
- */
- public final static int PUSH_BEANTYPE_EXPRESSIONPROXY_EXPRESSION_VALUE = 13;
-
- public final static InternalExpressionTypes PUSH_BEANTYPE_EXPRESSIONPROXY_EXPRESSION = new InternalExpressionTypes(PUSH_BEANTYPE_EXPRESSIONPROXY_EXPRESSION_VALUE,
- "Push BeanType ExpressionProxy Expression"); //$NON-NLS-1$
-
-
- /**
- * Type receiver expression.
- */
- public final static int TYPERECEIVER_EXPRESSION_VALUE = 14;
-
- public final static InternalExpressionTypes TYPERECEIVER_EXPRESSION = new InternalExpressionTypes(TYPERECEIVER_EXPRESSION_VALUE,
- "Type Receiver Expression"); //$NON-NLS-1$
-
- /**
- * Assignment to an ExpressionProxy expression.
- */
- public final static int ASSIGNMENT_PROXY_EXPRESSION_VALUE = 15;
-
- public final static InternalExpressionTypes ASSIGNMENT_PROXY_EXPRESSION = new InternalExpressionTypes(ASSIGNMENT_PROXY_EXPRESSION_VALUE,
- "Assignment to Proxy Expression"); //$NON-NLS-1$
-
- /**
- * Push expression proxy value expression.
- */
- public final static int PUSH_TO_EXPRESSION_PROXY_EXPRESSION_VALUE = 16;
-
- public final static InternalExpressionTypes PUSH_TO_EXPRESSION_PROXY_EXPRESSION = new InternalExpressionTypes(
- PUSH_TO_EXPRESSION_PROXY_EXPRESSION_VALUE, "Push to Expression Proxy Expression"); //$NON-NLS-1$
-
- /**
- * Assignment expression.
- */
- public final static int ASSIGNMENT_EXPRESSION_VALUE = 17;
-
- public final static InternalExpressionTypes ASSIGNMENT_EXPRESSION = new InternalExpressionTypes(ASSIGNMENT_EXPRESSION_VALUE,
- "Assignment Expression"); //$NON-NLS-1$
-
- /**
- * Block End expression.
- */
- public final static int BLOCK_BEGIN_EXPRESSION_VALUE = 18;
-
- public final static InternalExpressionTypes BLOCK_BEGIN_EXPRESSION = new InternalExpressionTypes(BLOCK_BEGIN_EXPRESSION_VALUE,
- "Begin block Expression"); //$NON-NLS-1$
-
- /**
- * Block End expression.
- */
- public final static int BLOCK_BREAK_EXPRESSION_VALUE = 19;
-
- public final static InternalExpressionTypes BLOCK_BREAK_EXPRESSION = new InternalExpressionTypes(BLOCK_BREAK_EXPRESSION_VALUE,
- "Break block Expression"); //$NON-NLS-1$
-
- /**
- * Block End expression.
- */
- public final static int BLOCK_END_EXPRESSION_VALUE = 20;
-
- public final static InternalExpressionTypes BLOCK_END_EXPRESSION = new InternalExpressionTypes(BLOCK_END_EXPRESSION_VALUE,
- "End block Expression"); //$NON-NLS-1$
-
- /**
- * Try Begin expression.
- */
- public final static int TRY_BEGIN_EXPRESSION_VALUE = 21;
-
- public final static InternalExpressionTypes TRY_BEGIN_EXPRESSION = new InternalExpressionTypes(TRY_BEGIN_EXPRESSION_VALUE,
- "Begin try Expression"); //$NON-NLS-1$
-
- /**
- * Try Catch expression.
- */
- public final static int TRY_CATCH_EXPRESSION_VALUE = 22;
-
- public final static InternalExpressionTypes TRY_CATCH_EXPRESSION = new InternalExpressionTypes(TRY_CATCH_EXPRESSION_VALUE,
- "Try catch Expression"); //$NON-NLS-1$
-
- /**
- * Try Finally expression.
- */
- public final static int TRY_FINALLY_EXPRESSION_VALUE = 23;
-
- public final static InternalExpressionTypes TRY_FINALLY_EXPRESSION = new InternalExpressionTypes(TRY_FINALLY_EXPRESSION_VALUE,
- "Try finally Expression"); //$NON-NLS-1$
-
- /**
- * Try End expression.
- */
- public final static int TRY_END_EXPRESSION_VALUE = 24;
-
- public final static InternalExpressionTypes TRY_END_EXPRESSION = new InternalExpressionTypes(TRY_END_EXPRESSION_VALUE,
- "End try Expression"); //$NON-NLS-1$
-
- /**
- * Throw expression.
- */
- public final static int THROW_EXPRESSION_VALUE = 25;
-
- public final static InternalExpressionTypes THROW_EXPRESSION = new InternalExpressionTypes(THROW_EXPRESSION_VALUE,
- "Throw Expression"); //$NON-NLS-1$
-
- /**
- * Rethrow expression.
- */
- public final static int RETHROW_EXPRESSION_VALUE = 26;
-
- public final static InternalExpressionTypes RETHROW_EXPRESSION = new InternalExpressionTypes(RETHROW_EXPRESSION_VALUE,
- "Rethrow Expression"); //$NON-NLS-1$
-
- /**
- * Push Method Lookup expression proxy expression.
- */
- public final static int PUSH_METHOD_EXPRESSIONPROXY_EXPRESSION_VALUE = 27;
-
- public final static InternalExpressionTypes PUSH_METHOD_EXPRESSIONPROXY_EXPRESSION = new InternalExpressionTypes(PUSH_METHOD_EXPRESSIONPROXY_EXPRESSION_VALUE,
- "Push Method ExpressionProxy Expression"); //$NON-NLS-1$
-
- /**
- * Push Field Lookup expression proxy expression.
- */
- public final static int PUSH_FIELD_EXPRESSIONPROXY_EXPRESSION_VALUE = 28;
-
- public final static InternalExpressionTypes PUSH_FIELD_EXPRESSIONPROXY_EXPRESSION = new InternalExpressionTypes(PUSH_FIELD_EXPRESSIONPROXY_EXPRESSION_VALUE,
- "Push Field ExpressionProxy Expression"); //$NON-NLS-1$
-
- /**
- * Push If/else (the clauses) expression proxy expression.
- */
- public final static int IF_ELSE_EXPRESSION_VALUE = 29;
-
- public final static InternalExpressionTypes IF_ELSE_EXPRESSION = new InternalExpressionTypes(IF_ELSE_EXPRESSION_VALUE,
- "Push If/else Expression"); //$NON-NLS-1$
-
- /**
- * Push If/else condition test expression proxy expression.
- */
- public final static int IF_TEST_EXPRESSION_VALUE = 30;
-
- public final static InternalExpressionTypes IF_TEST_EXPRESSION = new InternalExpressionTypes(IF_TEST_EXPRESSION_VALUE,
- "Push If Test Expression"); //$NON-NLS-1$
-
-
- /**
- * Push new instance from init string proxy expression.
- */
- public final static int NEW_INSTANCE_VALUE = 31;
-
- public final static InternalExpressionTypes NEW_INSTANCE = new InternalExpressionTypes(NEW_INSTANCE_VALUE,
- "Push New Instance Expression"); //$NON-NLS-1$
-
-
- /**
- * Push mark proxy expression.
- */
- public final static int MARK_VALUE = 32;
-
- public final static InternalExpressionTypes MARK = new InternalExpressionTypes(MARK_VALUE,
- "Push Mark Expression"); //$NON-NLS-1$
-
- /**
- * Push end mark proxy expression.
- */
- public final static int ENDMARK_VALUE = 33;
-
- public final static InternalExpressionTypes ENDMARK = new InternalExpressionTypes(ENDMARK_VALUE,
- "Push End Mark Expression"); //$NON-NLS-1$
-
- /**
- * Subexpression End expression.
- */
- public final static int SUBEXPRESSION_BEGIN_EXPRESSION_VALUE = 34;
-
- public final static InternalExpressionTypes SUBEXPRESSION_BEGIN_EXPRESSION = new InternalExpressionTypes(SUBEXPRESSION_BEGIN_EXPRESSION_VALUE,
- "Begin Subexpression Expression"); //$NON-NLS-1$
-
- /**
- * Subexpression End expression.
- */
- public final static int SUBEXPRESSION_END_EXPRESSION_VALUE = 35;
-
- public final static InternalExpressionTypes SUBEXPRESSION_END_EXPRESSION = new InternalExpressionTypes(SUBEXPRESSION_END_EXPRESSION_VALUE,
- "End Subexpression Expression"); //$NON-NLS-1$
-
-
- private InternalExpressionTypes(int value, String name) {
- super(value, name);
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/tree/InternalIfElseOperandType.java b/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/tree/InternalIfElseOperandType.java
deleted file mode 100644
index ca998c9fa..000000000
--- a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/tree/InternalIfElseOperandType.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 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.jem.internal.proxy.initParser.tree;
-
-/**
- * Internal class for the If/else operand type. Not meant to be used by customers.
- *
- * @since 1.1.0
- */
-public class InternalIfElseOperandType extends AbstractEnum {
-
- /**
- * Used in If/else processing. False clause on expression stack
- */
- public final static int ELSE_CLAUSE_VALUE = 0;
-
- public final static InternalIfElseOperandType ELSE_CLAUSE = new InternalIfElseOperandType(ELSE_CLAUSE_VALUE,
- "Else Clause Flag"); //$NON-NLS-1$
-
- /**
- * Used in If/else processing. If operand on expression stack
- */
- public final static int TRUE_CLAUSE_VALUE = 1;
-
- public final static InternalIfElseOperandType TRUE_CLAUSE = new InternalIfElseOperandType(TRUE_CLAUSE_VALUE,
- "If True Clause Flag"); //$NON-NLS-1$
-
- /**
- * Return the enum for the given value.
- * @param value
- * @return
- *
- * @since 1.1.0
- */
- public static InternalIfElseOperandType get(int value) {
- switch (value) {
- case ELSE_CLAUSE_VALUE:
- return ELSE_CLAUSE;
- case TRUE_CLAUSE_VALUE:
- return TRUE_CLAUSE;
- }
- return null;
- }
-
- private InternalIfElseOperandType(int value, String name) {
- super(value, name);
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/tree/InternalInfixOperandType.java b/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/tree/InternalInfixOperandType.java
deleted file mode 100644
index 34604b15a..000000000
--- a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/tree/InternalInfixOperandType.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 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.jem.internal.proxy.initParser.tree;
-
-
-/**
- * Internal class for the Prefix operand type. Not meant to be used by customers.
- * @since 1.1.0
- */
-public class InternalInfixOperandType extends AbstractEnum {
-
- /**
- * Used in Infix processing. Left operand on expression stack
- */
- public final static int INFIX_LEFT_OPERAND_VALUE = 0;
- public final static InternalInfixOperandType INFIX_LEFT_OPERAND = new InternalInfixOperandType(INFIX_LEFT_OPERAND_VALUE, "Infix Left Operand Flag"); //$NON-NLS-1$
- /**
- * Used in Infix processing. Other operand (but not last) on expression stack
- */
- public final static int INFIX_OTHER_OPERAND_VALUE = 1;
- public final static InternalInfixOperandType INFIX_OTHER_OPERAND = new InternalInfixOperandType(INFIX_OTHER_OPERAND_VALUE,
- "Infix Other Operand Flag"); //$NON-NLS-1$
- /**
- * Used in Infix processing. Rightmost (last) operand on expression stack
- */
- public final static int INFIX_LAST_OPERAND_VALUE = 2;
- public final static InternalInfixOperandType INFIX_LAST_OPERAND = new InternalInfixOperandType(INFIX_LAST_OPERAND_VALUE, "Infix Last Operand Flag"); //$NON-NLS-1$
-
- /**
- * Return the enum for the given value.
- * @param value
- * @return
- *
- * @since 1.1.0
- */
- public static InternalInfixOperandType get(int value) {
- switch (value) {
- case INFIX_LAST_OPERAND_VALUE:
- return INFIX_LAST_OPERAND;
- case INFIX_LEFT_OPERAND_VALUE:
- return INFIX_LEFT_OPERAND;
- case INFIX_OTHER_OPERAND_VALUE:
- return INFIX_OTHER_OPERAND;
- }
- return null;
- }
-
- private InternalInfixOperandType(int value, String name) {
- super(value, name);
- }
-}
diff --git a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/tree/NoExpressionValueException.java b/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/tree/NoExpressionValueException.java
deleted file mode 100644
index 7005354b5..000000000
--- a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/tree/NoExpressionValueException.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 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.jem.internal.proxy.initParser.tree;
-
-
-/**
- * The expression (or some nested expression) did not return a value. I.e. it was <code>void</code>.
- * This would occur only if the value of expression was being retrieved through getExpressionValue,
- * or if a nested expression was used, since in that case the value would of been used as an
- * argument or receiver to another expression.
- *
- * @since 1.0.0
- */
-public class NoExpressionValueException extends Exception {
-
- /**
- * Comment for <code>serialVersionUID</code>
- *
- * @since 1.1.0
- */
- private static final long serialVersionUID = -7953101867782417964L;
-
- private InternalExpressionProxy proxy;
-
- /**
- * Construct with no arguments.
- *
- * @since 1.0.0
- */
- public NoExpressionValueException() {
- super();
- }
-
- public NoExpressionValueException(Throwable e) {
- super(e);
- }
-
- /**
- * Construct with a message.
- *
- * @param message
- *
- * @since 1.0.0
- */
- public NoExpressionValueException(String message) {
- this(message, null);
- }
-
- /**
- * Construct with a message and a proxy. This is only used from {@link ExpressionProcesser#getExpressionProxyValue(int, Object[])} when
- * the proxy existed but it was not set.
- *
- * @param message
- * @param proxy
- *
- * @since 1.1.0
- */
- public NoExpressionValueException(String message, InternalExpressionProxy proxy) {
- super (message);
- this.proxy = proxy;
- }
-
- /**
- * Get the proxy if there is one. It will be a proxy if {@link ExpressionProcesser#getExpressionProxyValue(int, Object[])}
- * was for an existing proxy but that proxy was not set. Otherwise it will be null. This is here for callers to
- * put special info in the proxy for the not set condition and report better info.
- *
- * @return the proxy (if not set) or <code>null</code> if no proxy available.
- *
- * @since 1.1.0
- */
- public InternalExpressionProxy getProxy() {
- return proxy;
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/tree/PrefixOperator.java b/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/tree/PrefixOperator.java
deleted file mode 100644
index b8b99b504..000000000
--- a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/tree/PrefixOperator.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 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.jem.internal.proxy.initParser.tree;
-
-/**
- * Enum for prefix operator.
- *
- * @since 1.1.0
- */
-public class PrefixOperator extends AbstractEnum {
-
- /**
- * Prefix plus "+"
- */
- public static final int PRE_PLUS_VALUE = 0;
-
- public static final PrefixOperator PRE_PLUS = new PrefixOperator(PRE_PLUS_VALUE, "Prefix +"); //$NON-NLS-1$
-
- /**
- * Prefix minus "-"
- */
- public static final int PRE_MINUS_VALUE = 1;
-
- public static final PrefixOperator PRE_MINUS = new PrefixOperator(PRE_MINUS_VALUE, "Prefix -"); //$NON-NLS-1$
-
- /**
- * Prefix bitwise complement "~"
- */
- public static final int PRE_COMPLEMENT_VALUE = 2;
-
- public static final PrefixOperator PRE_COMPLEMENT = new PrefixOperator(PRE_COMPLEMENT_VALUE, "Prefix ~"); //$NON-NLS-1$
-
- /**
- * Prefix logical not "!"
- */
- public static final int PRE_NOT_VALUE = 3;
-
- public static final PrefixOperator PRE_NOT = new PrefixOperator(PRE_NOT_VALUE, "Prefix !"); //$NON-NLS-1$
-
- /**
- * Return the prefix operator for the given enum value.
- * @param value
- * @return
- *
- * @since 1.1.0
- */
- public static PrefixOperator get(int value) {
- switch (value) {
- case PRE_PLUS_VALUE:
- return PRE_PLUS;
- case PRE_MINUS_VALUE:
- return PRE_MINUS;
- case PRE_COMPLEMENT_VALUE:
- return PRE_COMPLEMENT;
- case PRE_NOT_VALUE:
- return PRE_NOT;
- }
- return null;
- }
-
- private PrefixOperator(int value, String name) {
- super(value, name);
- }
-
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/tree/VariableReference.java b/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/tree/VariableReference.java
deleted file mode 100644
index 7588b6294..000000000
--- a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/tree/VariableReference.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 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.jem.internal.proxy.initParser.tree;
-
-
-/**
- * This represents a Variable Reference value. A variable reference value can be on the left
- * side of an assignment (e.g. field or array access) or on any side
- * of any expression. When on the left side of an assignment, then the
- * value can assigned to. Such as <code>x[3] = 4</code>. Or it is value
- * that can be used in expressions, such as <code>x[3] + 2</code>.
- * <p>
- * When dereferenced, the value is given (see {@link VariableReference#dereference()}) as
- * the result or it is set with a value and then deferenced (see {@link VariableReference#set(Object, Class)}).
- * <p>
- * The type of the reference is the type stored in the corresponding expressionTypeStack entry. This is the type
- * for assignment, and the type for dereferenced.
- * @since 1.1.0
- */
-public abstract class VariableReference {
-
- /**
- * Dereference the value.
- * @return the dereferenced value. Such as the result of <code>x[3]</code>. The type of the reference
- * is the type stored in the corresponding expressionTypeStack entry for this reference.
- * @throws IllegalAccessException
- * @throws IllegalArgumentException
- *
- * @since 1.1.0
- */
- public abstract Object dereference();
-
- /**
- * Set the value into the variable and dereference it. Once it is set it is
- * no longer a reference and must be dereferenced.
- * @param value value to set to.
- * @param type type of the value being set. It may be of use to the reference or maybe not.
- * @return the dereferenced value after being set. The type of the dereferenced value
- * is the type stored in the corresponding expressionTypeStack entry for this reference.
- * @throws IllegalAccessException
- * @throws IllegalArgumentException
- *
- * @since 1.1.0
- */
- public abstract Object set(Object value, Class type) throws IllegalArgumentException, IllegalAccessException;
-}
diff --git a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/tree/messages.properties b/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/tree/messages.properties
deleted file mode 100644
index da6840dc1..000000000
--- a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/tree/messages.properties
+++ /dev/null
@@ -1,29 +0,0 @@
-###############################################################################
-# Copyright (c) 2003, 2005 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
-###############################################################################
-ExpressionProcesser.CannotCastXToY_EXC_ = IWAV0156E Cannot cast "{0}" to be "{1}".
-ExpressionProcesser.InvalidOperandOfPrefixOperator_EXC_ = IWAV0157E {0} not valid as the operand of prefix operator "{1}".
-ExpressionProcesser.PopExpressionType.ExpressionVoid_EXC_=Expression was void.
-ExpressionProcesser.InvalidOperandOfOperator_EXC_ = IWAV0158E {0} not valid as the operand of operator "{1}".
-ExpressionProcesser.XIsGreaterThanNumberOfDimensionsInArray_EXC_ = IWAV0159E {0} is greater then number of dimensions ({1}) in the array
-ExpressionProcesser.CreateArrayAccessReference.OutOfBounds_EXC_=Index: {0} size:{1}
-ExpressionProcesser.PushTryEnd.TryEndReceivedOutOfOrder_EXC_=Try/end received out of order.
-ExpressionProcesser.PushEndmark.EndMarkOnNonExistingID_EXC_=Tried to do an end mark on a non-existing markID ({0})
-ExpressionProcesser.NotAnArray_EXC_ = IWAV0160E "{0}" is not an array.
-ExpressionProcesser.ArraytypeHasFewerDimensionsThanRequested_EXC_ = IWAV0161E Arraytype "{0}" has fewer dimensions than creation requested ({1}).
-ExpressionProcesser.CreateFieldAccessReference.FieldsTypesNotMatching_EXC_=Field receiver does not match the type of the field: Field: {0} receiver: {1}
-ExpressionProcesser.GetExpressionProxyValue.ExpressionProxyNotSet_EXC_=Expression Proxy never set.
-ExpressionProcesser.GetExpressionProxyValue.ExpressionProxyDoesntExist_EXC_=Expression proxy doesn't exist.
-ExpressionProcesser.PushBlockEnd.ReceivedEndBlocksOutOfOrder_EXC_=End Blocks received out of order.
-ExpressionProcesser.PushTryCatchClause.CatchReceivedOutOfOrder_EXC_=Catch received out of order.
-ExpressionProcesser.PushTryFinallyClause.FinallyReceivedOutOfOrder_EXC_=Finally received out of order.
-ExpressionProcesser.PushTryRethrow.RethrowReceivedOutOfOrder_EXC_=Rethrow received out of order.
-ExpressionProcesser.PushTryRethrow.RetryReceivedOutOfExecutingCatchClause_EXC_=Retry received outside of an executing catch clause
-ExpressionProcesser.PushSubexpressionEnd.ReceivedEndSubexpressionsOutOfOrder_EXC_=End Subexpressions received out of order.
diff --git a/plugins/org.eclipse.jem.proxy/plugin.properties b/plugins/org.eclipse.jem.proxy/plugin.properties
deleted file mode 100644
index e07dfc9d5..000000000
--- a/plugins/org.eclipse.jem.proxy/plugin.properties
+++ /dev/null
@@ -1,21 +0,0 @@
-###############################################################################
-# Copyright (c) 2003, 2005 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: /cvsroot/webtools/jeetools.move/webtools.javaee.git/plugins/org.eclipse.jem.proxy/plugin.properties,v $
-# $Revision: 1.7 $ $Date: 2005/08/24 20:39:07 $
-#
-
-
-pluginName=Java EMF Model Proxy Support
-providerName = Eclipse.org
-contributors.extensionpoint.name=Proxy configuration contributors
-extensions.extensionpoint.name=Proxy configuration extension registrations
-Launch.localProxy=Local Proxy Application
diff --git a/plugins/org.eclipse.jem.proxy/plugin.xml b/plugins/org.eclipse.jem.proxy/plugin.xml
deleted file mode 100644
index ca74b4218..000000000
--- a/plugins/org.eclipse.jem.proxy/plugin.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin>
-
- <extension-point id="contributors" name="%contributors.extensionpoint.name" schema="schema/contributors.exsd"/>
- <extension-point id="extensions" name="%extensions.extensionpoint.name" schema="schema/extensions.exsd"/>
-
- <extension
- point="org.eclipse.debug.core.launchConfigurationTypes">
- <launchConfigurationType
- name="%Launch.localProxy"
- delegate="org.eclipse.jem.internal.proxy.remote.LocalProxyLaunchDelegate"
- category="org.eclipse.jem.proxy"
- modes="run"
- id="org.eclipse.jem.proxy.LocalProxyLaunchConfigurationType"
- sourceLocatorId="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector"
- sourcePathComputerId="org.eclipse.jdt.launching.sourceLookup.javaSourcePathComputer">
- </launchConfigurationType>
- </extension>
-
-</plugin>
diff --git a/plugins/org.eclipse.jem.proxy/proxy.jars b/plugins/org.eclipse.jem.proxy/proxy.jars
deleted file mode 100644
index 10aede430..000000000
--- a/plugins/org.eclipse.jem.proxy/proxy.jars
+++ /dev/null
@@ -1,4 +0,0 @@
-proxycommon.jar=/org.eclipse.jem.proxy/common_bin/
-initparser.jar=/org.eclipse.jem.proxy/common_bin/
-remotecommon.jar=/org.eclipse.jem.proxy/common_bin/
-vm/remotevm.jar=/org.eclipse.jem.proxy/vm_bin/ \ No newline at end of file
diff --git a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/awt/IStandardAwtBeanProxyFactory.java b/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/awt/IStandardAwtBeanProxyFactory.java
deleted file mode 100644
index 00e894e57..000000000
--- a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/awt/IStandardAwtBeanProxyFactory.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.awt;
-/*
-
-
- */
-
-
-import org.eclipse.jem.internal.proxy.core.*;
-import org.eclipse.jem.internal.proxy.core.IBeanProxyFactory;
-/**
- * The Standard awt bean proxy factory.
- * This is the Interface that the desktop will talk
- * to.
- * Creation date: (12/3/99 11:52:09 AM)
- * @author: Joe Winchester
- */
-public interface IStandardAwtBeanProxyFactory extends IBeanProxyFactory {
- public static final String REGISTRY_KEY = "standard-java.awt"; //$NON-NLS-1$
-
-/**
- * Return a new bean proxy for the dimension argument
- * Creation date: (12/3/99 11:52:20 AM)
- * @author Joe Winchester
- */
-public IDimensionBeanProxy createDimensionBeanProxyWith(int width, int height);
-/**
- * Return a new bean proxy for the point argument
- * Creation date: (12/3/99 11:52:20 AM)
- * @author Joe Winchester
- */
-public IPointBeanProxy createPointBeanProxyWith(int x, int y);
-/**
- * Return a new bean proxy for the rectangle argument
- * Creation date: (12/3/99 11:52:20 AM)
- * @author Joe Winchester
- */
-public IRectangleBeanProxy createBeanProxyWith(int x, int y, int width, int height);
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/awt/JavaStandardAwtBeanConstants.java b/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/awt/JavaStandardAwtBeanConstants.java
deleted file mode 100644
index 57cecb79b..000000000
--- a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/awt/JavaStandardAwtBeanConstants.java
+++ /dev/null
@@ -1,254 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.awt;
-/*
-
-
- */
-
-
-import org.eclipse.jem.internal.proxy.core.*;
-
-/**
- * Standard AWT Constants
- *
- * Use the static accessor method (getConstants()) to get the appropriate
- * constants instance for the registry. This is done so that until the
- * the constants are needed, they aren't registered.
- *
- * NOTE: Since everything in here just proxies, there is
- * no need to have them separated by VM. That is why
- * this in the Proxy package.
- *
- * This is final because this can't be extended. This specific one
- * will be registered with the factory for this key. Any extensions
- * must be done in their own constants and registry key.
- *
- * Creation date: (4/7/00 4:47:48 PM)
- * @author: Administrator
- */
-public final class JavaStandardAwtBeanConstants {
-
- public static final Object REGISTRY_KEY = new Object();
-
- final boolean AWTLoaded; // AWT may not be available. So non-ui JVM's don't have AWT.
- final boolean AWTRegistered; // AWT was registered to be used in this VM. It may be registered, but still not available.
-
- final IFieldProxy dimensionHeightProxy;
- final IFieldProxy dimensionWidthProxy;
- final IMethodProxy setDimensionSizeHWProxy;
- final IMethodProxy setDimensionSizeDProxy;
-
- final IFieldProxy pointXProxy;
- final IFieldProxy pointYProxy;
- final IMethodProxy setPointLocationXYProxy;
- final IMethodProxy setPointLocationPProxy;
-
- final IFieldProxy rectangleHeightProxy;
- final IFieldProxy rectangleWidthProxy;
- final IFieldProxy rectangleXProxy;
- final IFieldProxy rectangleYProxy;
- final IMethodProxy setRectangleSizeHWProxy;
- final IMethodProxy setRectangleSizeDProxy;
- final IMethodProxy setRectangleLocationXYProxy;
- final IMethodProxy setRectangleLocationPProxy;
- final IMethodProxy setRectangleBoundsXYHWProxy;
- final IMethodProxy setRectangleBoundsRProxy;
-
-/**
- * Get the constants instance for the specified registry.
- */
-public static JavaStandardAwtBeanConstants getConstants(ProxyFactoryRegistry registry) {
- JavaStandardAwtBeanConstants constants = (JavaStandardAwtBeanConstants) registry.getConstants(REGISTRY_KEY);
- if (constants == null)
- registry.registerConstants(REGISTRY_KEY, constants = new JavaStandardAwtBeanConstants(registry, registry.getBeanProxyFactoryExtension(IStandardAwtBeanProxyFactory.REGISTRY_KEY) != null));
- return constants;
-}
-
-
-public JavaStandardAwtBeanConstants(ProxyFactoryRegistry registry, boolean isRegistered) {
- super();
-
- AWTRegistered = isRegistered;
- if (!AWTRegistered) {
- AWTLoaded = false;
- dimensionHeightProxy = dimensionWidthProxy = pointXProxy = pointYProxy = rectangleHeightProxy = rectangleWidthProxy = rectangleXProxy = rectangleYProxy = null;
- setDimensionSizeHWProxy = setDimensionSizeDProxy = setPointLocationXYProxy = setPointLocationPProxy = setRectangleSizeHWProxy = setRectangleSizeDProxy = setRectangleLocationXYProxy = setRectangleLocationPProxy = setRectangleBoundsXYHWProxy = setRectangleBoundsRProxy = null;
- return;
- }
-
- IStandardBeanTypeProxyFactory typeFactory = registry.getBeanTypeProxyFactory();
-
- IBeanTypeProxy dimensionTypeProxy = typeFactory.getBeanTypeProxy("java.awt.Dimension");//$NON-NLS-1$
- if (dimensionTypeProxy != null) {
- // AWT is available.
- AWTLoaded = true;
- IBeanTypeProxy intTypeProxy = typeFactory.getBeanTypeProxy("int"); //$NON-NLS-1$
-
- dimensionHeightProxy = dimensionTypeProxy.getFieldProxy("height");//$NON-NLS-1$
- dimensionWidthProxy = dimensionTypeProxy.getFieldProxy("width");//$NON-NLS-1$
- setDimensionSizeHWProxy = dimensionTypeProxy.getMethodProxy("setSize", new IBeanTypeProxy[] {intTypeProxy, intTypeProxy}); //$NON-NLS-1$
- setDimensionSizeDProxy = dimensionTypeProxy.getMethodProxy("setSize", new IBeanTypeProxy[] {dimensionTypeProxy}); //$NON-NLS-1$
-
- IBeanTypeProxy pointTypeProxy = typeFactory.getBeanTypeProxy("java.awt.Point");//$NON-NLS-1$
- pointXProxy = pointTypeProxy.getFieldProxy("x");//$NON-NLS-1$
- pointYProxy = pointTypeProxy.getFieldProxy("y"); //$NON-NLS-1$
- setPointLocationXYProxy = pointTypeProxy.getMethodProxy("setLocation", new IBeanTypeProxy[] {intTypeProxy, intTypeProxy}); //$NON-NLS-1$
- setPointLocationPProxy = pointTypeProxy.getMethodProxy("setLocation", new IBeanTypeProxy[] {pointTypeProxy}); //$NON-NLS-1$
-
-
- IBeanTypeProxy rectangleTypeProxy = typeFactory.getBeanTypeProxy("java.awt.Rectangle");//$NON-NLS-1$
- rectangleHeightProxy = rectangleTypeProxy.getFieldProxy("height");//$NON-NLS-1$
- rectangleWidthProxy = rectangleTypeProxy.getFieldProxy("width");//$NON-NLS-1$
- rectangleXProxy = rectangleTypeProxy.getFieldProxy("x");//$NON-NLS-1$
- rectangleYProxy = rectangleTypeProxy.getFieldProxy("y");//$NON-NLS-1$
- setRectangleSizeHWProxy = rectangleTypeProxy.getMethodProxy("setSize", new IBeanTypeProxy[] {intTypeProxy, intTypeProxy}); //$NON-NLS-1$
- setRectangleSizeDProxy = rectangleTypeProxy.getMethodProxy("setSize", new IBeanTypeProxy[] {dimensionTypeProxy}); //$NON-NLS-1$
- setRectangleLocationXYProxy = rectangleTypeProxy.getMethodProxy("setLocation", new IBeanTypeProxy[] {intTypeProxy, intTypeProxy}); //$NON-NLS-1$
- setRectangleLocationPProxy = rectangleTypeProxy.getMethodProxy("setLocation", new IBeanTypeProxy[] {pointTypeProxy}); //$NON-NLS-1$
- setRectangleBoundsXYHWProxy = rectangleTypeProxy.getMethodProxy("setBounds", new IBeanTypeProxy[] {intTypeProxy, intTypeProxy, intTypeProxy, intTypeProxy}); //$NON-NLS-1$
- setRectangleBoundsRProxy = rectangleTypeProxy.getMethodProxy("setBounds", new IBeanTypeProxy[] {rectangleTypeProxy}); //$NON-NLS-1$
- } else {
- AWTLoaded = false;
- dimensionHeightProxy = dimensionWidthProxy = pointXProxy = pointYProxy = rectangleHeightProxy = rectangleWidthProxy = rectangleXProxy = rectangleYProxy = null;
- setDimensionSizeHWProxy = setDimensionSizeDProxy = setPointLocationXYProxy = setPointLocationPProxy = setRectangleSizeHWProxy = setRectangleSizeDProxy = setRectangleLocationXYProxy = setRectangleLocationPProxy = setRectangleBoundsXYHWProxy = setRectangleBoundsRProxy = null;
- }
-}
-
-/**
- * Answer if AWT is available.
- */
-public boolean isAWTAvailable() {
- return AWTLoaded;
-}
-
-/**
- * Answer if AWT was registered to be available.
- */
-public boolean isAWTRegistered() {
- return AWTRegistered;
-}
-
-
-
-/**
- * getDimensionHeightFieldProxy method comment.
- */
-public IFieldProxy getDimensionHeightFieldProxy() {
- return dimensionHeightProxy;
-}
-/**
- * getDimensionWidthProxy method comment.
- */
-public IFieldProxy getDimensionWidthFieldProxy() {
- return dimensionWidthProxy;
-}
-/**
- * getDimensionSetSizeWHProxy method comment.
- */
-public IMethodProxy getDimensionSetSizeHWProxy() {
- return setDimensionSizeHWProxy;
-}
-/**
- * getDimensionSetSizeDProxy method comment.
- */
-public IMethodProxy getDimensionSetSizeDProxy() {
- return setDimensionSizeDProxy;
-}
-
-/**
- * getPointXFieldProxy method comment.
- */
-public IFieldProxy getPointXFieldProxy() {
- return pointXProxy;
-}
-/**
- * getPointYFieldProxy method comment.
- */
-public IFieldProxy getPointYFieldProxy() {
- return pointYProxy;
-}
-/**
- * getPointSetLocationXYProxy method comment.
- */
-public IMethodProxy getPointSetLocationXYProxy() {
- return setPointLocationXYProxy;
-}
-/**
- * getPointSetLocationPProxy method comment.
- */
-public IMethodProxy getPointSetLocationPProxy() {
- return setPointLocationPProxy;
-}
-/**
- * getRectangleHeightFieldProxy method comment.
- */
-public IFieldProxy getRectangleHeightFieldProxy() {
- return rectangleHeightProxy;
-}
-/**
- * getRectangleWidthFieldProxy method comment.
- */
-public IFieldProxy getRectangleWidthFieldProxy() {
- return rectangleWidthProxy;
-}
-/**
- * getRectangleXFieldProxy method comment.
- */
-public IFieldProxy getRectangleXFieldProxy() {
- return rectangleXProxy;
-}
-/**
- * getRectangleYFieldProxy method comment.
- */
-public IFieldProxy getRectangleYFieldProxy() {
- return rectangleYProxy;
-}
-/**
- * getRectangleSetSizeWHProxy method comment.
- */
-public IMethodProxy getRectangleSetSizeHWProxy() {
- return setRectangleSizeHWProxy;
-}
-/**
- * getRectangleSetSizeDProxy method comment.
- */
-public IMethodProxy getRectangleSetSizeDProxy() {
- return setRectangleSizeDProxy;
-}
-/**
- * getRectangleSetLocationXYProxy method comment.
- */
-public IMethodProxy getRectangleSetLocationXYProxy() {
- return setRectangleLocationXYProxy;
-}
-/**
- * getRectangleSetLocationPProxy method comment.
- */
-public IMethodProxy getRectangleSetLocationPProxy() {
- return setRectangleLocationPProxy;
-}
-
-/**
- * getRectangleSetBoundsXYHWProxy method comment.
- */
-public IMethodProxy getRectangleSetBoundsXYHWProxy() {
- return setRectangleBoundsXYHWProxy;
-}
-/**
- * getRectangleSetBoundsRProxy method comment.
- */
-public IMethodProxy getRectangleSetBoundsRProxy() {
- return setRectangleBoundsRProxy;
-}
-
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/BaseProxyFactoryRegistry.java b/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/BaseProxyFactoryRegistry.java
deleted file mode 100644
index ba972293b..000000000
--- a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/BaseProxyFactoryRegistry.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 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.jem.internal.proxy.core;
-
-/**
- * This is the Base Registry that all implementations should subclass.
- * <p>
- * It is not meant to be used by customers. It provides public functions only for access of individual implementations.
- * Customers should only access {@link org.eclipse.jem.internal.proxy.core.ProxyFactoryRegistry}.
- *
- * @since 1.1.0
- */
-public abstract class BaseProxyFactoryRegistry extends ProxyFactoryRegistry {
-
- private final String registryTypeID;
-
- /**
- * Construct with registry type ID. The type id should be provided by
- * each implementation. This will be used to provide specific type
- * registrations through contributions.
- *
- * @param registryTypeID
- *
- * @since 1.1.0
- */
- protected BaseProxyFactoryRegistry(String registryTypeID) {
- super();
- this.registryTypeID = registryTypeID;
- }
-
- /**
- * Return the reqistry type id.
- * @return
- *
- * @since 1.1.0
- */
- public String getRegistryTypeID() {
- return registryTypeID;
- }
-
- /**
- Register the current registered bean proxy factory to be used for creating IBeanProxy instances
- */
- public void registerBeanProxyFactory(IStandardBeanProxyFactory aStandardFactory) {
- fCurrentStandardBeanProxyFactory = aStandardFactory;
- }
-
- /**
- Register a factory to be used for creating IBeanProxy instances
- */
- public void registerBeanProxyFactory(String packageName, IBeanProxyFactory aFactory) {
- fRegisteredExtensionBeanProxyFactories.put(packageName, aFactory);
- }
-
- /**
- Register the current registered bean type proxy factory to be used for creating IBeanTypeProxy instances
- */
- public void registerBeanTypeProxyFactory(IStandardBeanTypeProxyFactory aStandardFactory) {
- fCurrentStandardBeanTypeProxyFactory = aStandardFactory;
- }
-
- /**
- Register a factory to be used for creating IBeanTypeProxy instances
- */
- public void registerBeanTypeProxyFactory(String packageName, IBeanTypeProxyFactory aFactory) {
- fRegisteredExtensionBeanTypeProxyFactories.put(packageName, aFactory);
- }
-
- /**
- * Set the Method Proxy Factory for this VM.
- * Creation date: (3/13/00 10:58:19 AM)
- */
- public void registerMethodProxyFactory(IMethodProxyFactory newMethodProxyFactory) {
- fMethodProxyFactory = newMethodProxyFactory;
- }
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/CollectionBeanProxyWrapper.java b/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/CollectionBeanProxyWrapper.java
deleted file mode 100644
index 51c415882..000000000
--- a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/CollectionBeanProxyWrapper.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.core;
-/*
-
-
- */
-
-import org.eclipse.core.runtime.*;
-/**
- * This is a wrapper for an java.util.Collection proxy.
- * It provides the collection methods to interface to
- * the proxy.
- */
-
-public class CollectionBeanProxyWrapper {
- protected final IBeanProxy fCollection;
- protected final JavaStandardBeanProxyConstants fConstants;
-
- /**
- * Construct with the collection.
- */
- public CollectionBeanProxyWrapper(IBeanProxy aCollectionProxy) {
- if (!aCollectionProxy.getTypeProxy().isKindOf(aCollectionProxy.getProxyFactoryRegistry().getBeanTypeProxyFactory().getBeanTypeProxy("java.util.Collection"))) //$NON-NLS-1$
- throw new ClassCastException(java.text.MessageFormat.format(ProxyMessages.ClassCast_EXC__IncorrectType, new Object[] {aCollectionProxy.getTypeProxy().getTypeName(), "java.util.Collection"})); //$NON-NLS-1$
- else
- fCollection = aCollectionProxy;
-
- fConstants = JavaStandardBeanProxyConstants.getConstants(aCollectionProxy.getProxyFactoryRegistry());
- }
-
- /**
- * Answer the collection proxy that this is wrappering.
- */
- public IBeanProxy getBeanProxy() {
- return fCollection;
- }
-
- /**
- * equals - Pass it on to the proxy to handle this.
- */
- public boolean equals(Object object) {
- return fCollection.equals(object);
- }
-
- /**
- * hashCode - Pass it on to the proxy to handle this.
- */
- public int hashCode() {
- return fCollection.hashCode();
- }
-
- /**
- * Collection accessors
- */
- public boolean add(IBeanProxy object) throws ThrowableProxy {
- return ((IBooleanBeanProxy) fConstants.getCollectionAdd().invoke(fCollection, object)).booleanValue();
- }
- public boolean addAll(IBeanProxy collection) throws ThrowableProxy {
- return ((IBooleanBeanProxy) fConstants.getCollectionAddAll().invoke(fCollection, collection)).booleanValue();
- }
- public void clear() throws ThrowableProxy {
- fConstants.getCollectionClear().invoke(fCollection);
- }
- public boolean contains(IBeanProxy object) {
- try {
- return ((IBooleanBeanProxy) fConstants.getCollectionContains().invoke(fCollection, object)).booleanValue();
- } catch (ThrowableProxy e) {
- // This shouldn't occur, so just log it.
- ProxyPlugin.getPlugin().getLogger().log(new Status(IStatus.ERROR, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, ProxyMessages.UnexpectedException_EXC_, e));
- return false;
- }
- }
- public boolean containsAll(IBeanProxy collection) {
- try {
- return ((IBooleanBeanProxy) fConstants.getCollectionContainsAll().invoke(fCollection, collection)).booleanValue();
- } catch (ThrowableProxy e) {
- // This shouldn't occur, so just log it.
- ProxyPlugin.getPlugin().getLogger().log(new Status(IStatus.ERROR, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, ProxyMessages.UnexpectedException_EXC_, e));
- return false;
- }
- }
- public boolean isEmpty() {
- try {
- return ((IBooleanBeanProxy) fConstants.getCollectionIsEmpty().invoke(fCollection)).booleanValue();
- } catch (ThrowableProxy e) {
- // This shouldn't occur, so just log it.
- ProxyPlugin.getPlugin().getLogger().log(new Status(IStatus.ERROR, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, ProxyMessages.UnexpectedException_EXC_, e));
- return true;
- }
- }
- public IteratorBeanProxyWrapper iterator() {
- try {
- IBeanProxy itr = fConstants.getCollectionIterator().invoke(fCollection);
- if (itr != null)
- return new IteratorBeanProxyWrapper(itr);
- else
- return null;
- } catch (ThrowableProxy e) {
- // This shouldn't occur, so just log it.
- ProxyPlugin.getPlugin().getLogger().log(new Status(IStatus.ERROR, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, ProxyMessages.UnexpectedException_EXC_, e));
- return null;
- }
- }
- public boolean remove(IBeanProxy object) throws ThrowableProxy {
- return ((IBooleanBeanProxy) fConstants.getCollectionRemove().invoke(fCollection, object)).booleanValue();
- }
- public boolean removeAll(IBeanProxy collection) throws ThrowableProxy {
- return ((IBooleanBeanProxy) fConstants.getCollectionRemoveAll().invoke(fCollection, collection)).booleanValue();
- }
- public boolean retainAll(IBeanProxy collection) throws ThrowableProxy {
- return ((IBooleanBeanProxy) fConstants.getCollectionRetainAll().invoke(fCollection, collection)).booleanValue();
- }
- public int size() {
- try {
- return ((IIntegerBeanProxy) fConstants.getCollectionSize().invoke(fCollection)).intValue();
- } catch (ThrowableProxy e) {
- // This shouldn't occur, so just log it.
- ProxyPlugin.getPlugin().getLogger().log(new Status(IStatus.ERROR, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, ProxyMessages.UnexpectedException_EXC_, e));
- return 0;
- }
- }
- public IArrayBeanProxy toArray() throws ThrowableProxy {
- return (IArrayBeanProxy) fConstants.getCollectionToArray().invoke(fCollection);
- }
- public IArrayBeanProxy toArray(IArrayBeanProxy array) throws ThrowableProxy {
- return (IArrayBeanProxy) fConstants.getCollectionToArrayWithArray().invoke(fCollection, array);
- }
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/ConfigurationContributorAdapter.java b/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/ConfigurationContributorAdapter.java
deleted file mode 100644
index 570c72bd4..000000000
--- a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/ConfigurationContributorAdapter.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 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.jem.internal.proxy.core;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-
-/**
- * This is an implementation of IConfigurationContributor that does nothing. It
- * can be subclassed to provide specific overrides.
- * @since 1.0.0
- */
-public class ConfigurationContributorAdapter implements IConfigurationContributor {
-
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IConfigurationContributor#initialize(org.eclipse.jem.internal.proxy.core.IConfigurationContributionInfo)
- */
- public void initialize(IConfigurationContributionInfo info) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IConfigurationContributor#contributeClasspaths(org.eclipse.jem.internal.proxy.core.IConfigurationContributionController)
- */
- public void contributeClasspaths(IConfigurationContributionController controller) throws CoreException {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IConfigurationContributor#contributeToConfiguration(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- */
- public void contributeToConfiguration(ILaunchConfigurationWorkingCopy config) throws CoreException {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IConfigurationContributor#contributeToRegistry(org.eclipse.jem.internal.proxy.core.ProxyFactoryRegistry)
- */
- public void contributeToRegistry(ProxyFactoryRegistry registry) {
- }
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/ContainerPathContributionMapping.java b/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/ContainerPathContributionMapping.java
deleted file mode 100644
index 1f4ca36cc..000000000
--- a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/ContainerPathContributionMapping.java
+++ /dev/null
@@ -1,196 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 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.jem.internal.proxy.core;
-
-import java.lang.reflect.Array;
-import java.util.*;
-import java.util.regex.Pattern;
-
-
-/**
- * Mapping of container paths (Regular expressions) to configuration elements.
- * <p>
- * It can be instantiated by clients that need to built up a subset of the mapping from the
- * normal mapping done by {@link ProxyPlugin#getPluginExtensions(String)}.
- * <p>
- * To build one up separately clients would:
- * <pre><code>
- * ContainerPathContributionMapping mapping = new ContainerPathContributionMapping(contributionType);
- * mapping.addContribution(containerid, pattern, contribution);
- * ...
- * mapping.finalizeMapping();
- * </code></pre>
- *
- * @since 1.2.0
- */
-public class ContainerPathContributionMapping {
-
- /**
- * Used in {@link ContainerPathContributionMapping#containerIdToContributions} as the value of the map.
- * This contains a Pattern for a container path to match against to see if the contribution
- * should be used.
- * <p>
- * Normally it would be better to use {@link ContainerPathContributionMapping#getContributors(String, String[])}
- * to get all of the contributors for all of the paths of the same container id.
- *
- * @since 1.2.0
- */
- public static class ContainerContributionEntry {
-
- private final Object contribution;
- private final Pattern containerPathPattern;
-
- public ContainerContributionEntry(Object contribution, Pattern containerPathPattern) {
- this.contribution = contribution;
- this.containerPathPattern = containerPathPattern;
- }
-
-
- /**
- * @return Returns the contribution.
- *
- * @since 1.2.0
- */
- public final Object getContribution() {
- return contribution;
- }
-
-
- /**
- * @return Returns the container pattern for matching.
- *
- * @since 1.2.0
- */
- public final Pattern getContainerPathPattern() {
- return containerPathPattern;
- }
- }
-
-
- /**
- * Map of container ids (String, first segment of container path) to {@link ContainerContributionEntry[]}.
- * <p>
- * Normally it would be better to use {@link #getContributors(String, String[])}
- * to get all of the contributors for all of the paths of the same container id.
- *
- * @since 1.2.0
- */
- public Map containerIdToContributions = Collections.EMPTY_MAP;
-
- // TODO When 1.5, this can go away.
- private final Class contributionType;
-
- /**
- * Create with contribution type (i.e. the array type returned from {@link #getContributors(String, String[])}.
- * <p>
- * TODO This will go away with 1.5 because this will be templated.
- *
- * @param type
- *
- *
- * @since 1.2.0
- */
- public ContainerPathContributionMapping(Class type) {
- contributionType = type;
- }
-
-
- /**
- * Get the unique array of configuration elements (no duplicates) for the given container id, and
- * the set of container paths for that container id. For example, "SWT_CONTAINER" as containerID and
- * {"/SWT_CONTAINER/", "/SWT_CONTAINER/PDE/JFACE"} for container paths. This will then return configuration elements
- * that match these two paths in the container attribute of the configuration element. The container attribute
- * is a regular expression. For example "SWT_CONTAINER" will match both "/SWT_CONTAINER/" and "/SWT_CONTAINER/PDE/JFACE"
- * while "SWT_CONTAINER/.* /JFACE" will match "/SWT_CONTAINER/PDE/JFACE". (Note it is actually no space between the "*" and "/" but java comment syntax won't allow it.)
- * @param containerId id of all the containers in the list of paths (the first segment of all of the paths).
- * @param containerPaths array of all of the paths to look for contributions for.
- * @return array of configuration elements for the given list of paths. They will be in order declared within a plugin within plugin order.
- *
- * @since 1.2.0
- */
- public Object[] getContributors(String containerId, String[] containerPaths) {
- ContainerContributionEntry[] bundleContributions = (ContainerContributionEntry[]) containerIdToContributions.get(containerId);
- if (bundleContributions == null)
- return (Object[]) Array.newInstance(contributionType, 0);
- List contributions = new ArrayList();
- // Patterns that have been tested. Key is a pattern, value is Boolean. true if this pattern matched any of the container paths.
- // This way a pattern will only be tested once for the list of paths. If the pattern is found the list again we will know if it
- // should be selected or not.
- // The bundleContributions are in order declared within each plugin within plugin order.
- Map testedPatterns = new HashMap();
- for (int i = 0; i < bundleContributions.length; i++) {
- Boolean tested = (Boolean) testedPatterns.get(bundleContributions[i].getContainerPathPattern());
- if (tested == null) {
- // Need to test it.
- // Run through container paths and see if any match.
- tested = Boolean.FALSE;
- Pattern pattern = bundleContributions[i].getContainerPathPattern();
- for (int j = 0; j < containerPaths.length; j++) {
- if (pattern.matcher(containerPaths[j]).matches()) {
- tested = Boolean.TRUE;
- break;
- }
- }
- testedPatterns.put(pattern, tested);
- }
- if (tested.booleanValue())
- contributions.add(bundleContributions[i].getContribution());
- }
- return contributions.toArray((Object[]) Array.newInstance(contributionType, contributions.size()));
- }
-
- /**
- * Add contribution to mapping. This is not normally needed by clients unless the client needs to
- * build up a different container path mapping than the one normally created by {@link ProxyPlugin#processContributionExtensionPoint(String)}.
- * <p>
- * After all contributions have been added {@link #finalizeMapping()} must be called. If this
- * is not called then {@link #getContributors(String, String[])} will fail with exceptions.
-
- * @param containerId
- * @param pattern
- * @param contribution
- *
- * @since 1.2.0
- */
- public void addContribution(String containerId, Pattern pattern, Object contribution) {
- if (containerIdToContributions == Collections.EMPTY_MAP)
- containerIdToContributions = new HashMap(); // This is first call to add something.
- // We will build as list, but then change to array when done.
- Object contributions = containerIdToContributions.get(containerId);
- if (contributions == null) {
- contributions = new ArrayList(1);
- containerIdToContributions.put(containerId, contributions);
- } else if (!(contributions instanceof List)) {
- // It must be an array, so convert back to list so that we can add to it.
- List oldContributions = Arrays.asList((Object[]) contribution);
- contributions = new ArrayList(oldContributions.size());
- ((List) contributions).addAll(oldContributions);
- containerIdToContributions.put(containerId, contributions);
- }
- ((List) contributions).add(new ContainerContributionEntry(contribution, pattern));
-
- }
-
- /**
- * Finalize the mapping. This is called when clients are done with all {@link #addContribution(String)}.
- * It takes the mapping from an internal format that allowed for quicker building into the final format.
- *
- *
- * @since 1.2.0
- */
- public void finalizeMapping() {
- for (Iterator iter = containerIdToContributions.entrySet().iterator(); iter.hasNext();) {
- Map.Entry entry = (Map.Entry) iter.next();
- if (entry.getValue() instanceof List)
- entry.setValue(((List) entry.getValue()).toArray(new ContainerContributionEntry[((List) entry.getValue()).size()]));
- }
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/ContributorExtensionPointInfo.java b/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/ContributorExtensionPointInfo.java
deleted file mode 100644
index 61839e0a7..000000000
--- a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/ContributorExtensionPointInfo.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 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.jem.internal.proxy.core;
-
-import java.util.Map;
-
-
-/**
- * Result from {@link ProxyPlugin#processContributionExtensionPoint(String)}
- *
- * @since 1.0.0
- */
-public class ContributorExtensionPointInfo {
-
- /**
- * Contributions that are based upon container paths that are built up from
- * the extension point.
- *
- * @since 1.2.0
- */
- public ContainerPathContributionMapping containerPathContributions;
-
- ContributorExtensionPointInfo() {
- // Not meant to be instantiated or subclassed outside of ProxyPlugin.
- }
-
- /**
- * Map of plugin ids (String) to contributions (IConfigurationElement[]) that was found with that id. For each plugin,
- * the contributions will be listed in plugin prereq order.
- */
- public Map pluginToContributions;
-
-
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/EnumerationBeanProxyWrapper.java b/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/EnumerationBeanProxyWrapper.java
deleted file mode 100644
index feb900fc5..000000000
--- a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/EnumerationBeanProxyWrapper.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.core;
-/*
-
-
- */
-
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-/**
- * This is a wrapper for an java.util.Enumeration proxy.
- * It provides the Enumeration methods to interface to
- * the proxy.
- */
-
-public class EnumerationBeanProxyWrapper {
- protected final IBeanProxy fEnumeration;
- protected final JavaStandardBeanProxyConstants fConstants;
-
- /**
- * Construct with the collection.
- */
- public EnumerationBeanProxyWrapper(IBeanProxy anEnumerationProxy) {
-
- fEnumeration = anEnumerationProxy;
-
- fConstants = JavaStandardBeanProxyConstants.getConstants(anEnumerationProxy.getProxyFactoryRegistry());
- }
-
- /**
- * Answer the iterator proxy that this is wrappering.
- */
- public IBeanProxy getBeanProxy() {
- return fEnumeration;
- }
-
- /**
- * equals - Pass it on to the proxy to handle this.
- */
- public boolean equals(Object object) {
- return fEnumeration.equals(object);
- }
-
- /**
- * hashCode - Pass it on to the proxy to handle this.
- */
- public int hashCode() {
- return fEnumeration.hashCode();
- }
-
- /**
- * Enumeration accessors
- */
- public boolean hasMoreElements() {
- try {
- return ((IBooleanBeanProxy) fConstants.getEnumerationHasMoreElements().invoke(fEnumeration)).booleanValue();
- } catch (ThrowableProxy e) {
- // This shouldn't occur, so just log it.
- ProxyPlugin.getPlugin().getLogger().log(new Status(IStatus.ERROR, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, ProxyMessages.UnexpectedException_EXC_, e));
- return false;
- }
- }
- public IBeanProxy nextElement() throws ThrowableProxy {
- return fConstants.getEnumerationNextElement().invoke(fEnumeration);
- }
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/Expression.java b/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/Expression.java
deleted file mode 100644
index 99645a746..000000000
--- a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/Expression.java
+++ /dev/null
@@ -1,2546 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 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.jem.internal.proxy.core;
-
-import java.text.MessageFormat;
-import java.util.*;
-
-import org.eclipse.jem.internal.proxy.initParser.tree.*;
-
-/**
- * This is implementation of IExpression. It encapsulates much of the processing required
- * into a common form that will be turned into simple push/pop/evaluate type of interaction with the
- * actual other side. All registry specific implementations of IExpression must subclass this class.
- * <p>
- * It will maintain a stack of the expressions. As the expressions come in they will be stacked if not
- * able to be executed immediately. The expressions come to this class in an outside to inside order,
- * but they need to be processed in an inside-out order instead.
- * <p>
- * Subclasses will be used for the different types of proxy interfaces. The abstract methods will
- * then be the simple interface.
- * <p>
- * It is not meant for subclasses to override the actual create expression methods because the processing the stack
- * is very sensitive and must execute in the proper sequence. So the create methods are final for this reason.
- * <p>
- * This class is not thread-safe.
- * <p>
- * This class also has API of its own and can be used by customers for advanced usage. Those advanced API are
- * listed on each method as to whether it is customer API or implementers API (i.e. API for implementers of
- * expression subclasses to use).
- *
- *
- * @since 1.0.0
- */
-public abstract class Expression implements IExpression {
-
- /*
- * We have stack here, but rather than create a class that does the
- * stack protocol, will simply have some private methods to do
- * the same thing for the stack. (Note: Can't use java.util.Stack
- * because that is a synchronized class, and don't want the overhead).
- *
- * The purpose of the stack is to stack up expressions that have not yet
- * been evaluated.
- *
- * Each expression type will control the content of what it pushes and pops.
- * The expression type will be the last thing it pushes so that on popping
- * we know what kind of expression is now completed and ready for evaluation.
- */
- private ArrayList controlStack = new ArrayList(30);
-
- protected final ProxyFactoryRegistry registry;
- protected final IStandardBeanProxyFactory beanProxyFactory;
- protected Boolean traceFlag;
-
- /**
- * Answer whether trace has been explicitly set.
- * This is not in the IExpression interface because it is for advanced users.
- * @return
- *
- * @since 1.1.0
- */
- public boolean isTraceSet() {
- return traceFlag != null;
- }
-
- /**
- * Answer if trace is on. If not explicitly set this will answer false.
- * Use {@link Expression#isTraceSet()} first to determine if this
- * should be called or not.
- * This is not in the IExpression interface because it is for advanced users.
- * @return
- *
- * @since 1.1.0
- */
- public boolean isTrace() {
- return traceFlag != null ? traceFlag.booleanValue() : false;
- }
-
- /**
- * Explicitly set the trace flag. This will only be honoured before any
- * expressions have been created. After that this will be ignored.
- * The trace is initially set to use default. Once set it cannot be unset.
- * This is not in the IExpression interface because it is for advanced users.
- * @param trace
- *
- * @since 1.1.0
- */
- public void setTrace(boolean trace) {
- traceFlag = Boolean.valueOf(trace);
- }
-
- /**
- * Push an object onto the control stack.
- *
- * @param o
- *
- * @since 1.0.0
- */
- protected final void push(Object o) {
- controlStack.add(o);
- }
-
- /**
- * Pop an object off of the control stack
- * @return
- *
- * @since 1.0.0
- */
- protected final Object pop() {
- return controlStack.remove(controlStack.size()-1);
- }
-
- /**
- * Peek at an object from the control stack. <code>fromTop</code> is how far from the top of the stack to look.
- * If it one, then it is the top entry, two is the next one down. Zero is an invalid value for the parameter.
- * @param fromTop How far from the top to peek. <code>1</code> is the top, not zero.
- * @return
- *
- * @since 1.0.0
- */
- protected final Object peek(int fromTop) {
- // 1 means the top, 2 is the next one down.
- return controlStack.get(controlStack.size()-fromTop);
- }
-
- /*
- * Expression type constants.
- */
-
- /*
- * ARRAY ACCESS expression.
- * The expression stack will have:
- * IExpression.ARRAYACCESS_ARRAY
- * IExpression.ARRAYACCESS_INDEX (for 1 to n times depending on index count)
- * PROCESS_EXPRESSION
- *
- * The value stack will have
- * ARRAYACCESS
- * Integer(index count)
- */
- private static final Integer ARRAYACCESS_INDEX_1 = new Integer(1); // Use in normal case of one index count. Saves object creation.
-
- /*
- * ARRAY CREATION expression.
- * The expression stack will have:
- * ARRAYCREATION_INITIALIZER - if hasInitializer
- * IExpression.ARRAYCREATION_DIMENSION (for 0 to n times depending on dimension count)
- * PROCESS_EXPRESSION
- *
- * The value stack will have
- * ARRAYCREATION
- * type (either a string representing the type, or an IBeanProxyType representing the type).
- * Integer(dimension count) (if zero then there is an initializer)
- *
- *
- * Note: Array Initializer works with this in that it will peek into the value stack two entries down
- * to find the type of array it should be creating.
- */
- private static final Integer ARRAY_CREATION_DIMENSION_1 = new Integer(1); // Use in normal case of one dimension. Save object creation.
- private static final Integer ARRAY_CREATION_DIMENSION_0 = new Integer(0); // Use in normal case of initializer. Save object creation.
- private static final ForExpression ARRAY_INITIALIZER = new ExpressionEnum(Integer.MIN_VALUE+1, "Array Initializer Internal"); //$NON-NLS-1$
-
- /*
- * ARRAY INITIALIZER expression
- * The expression stack will have:
- * IExpression.ARRAYINITIALIZER_EXPRESSION (for n times depending on number of expressions count)
- * PROCESS_EXPRESSION
- *
- * The value stack will have
- * ARRAYINITIALIZER
- * type (either a string representing the type, or an IBeanProxyType representing the type).
- * I.e. if array being created is int[][], the value pushed here will be int[]. This is because when created
- * the array will wind up with int[expressioncount][] in the end.
- * Integer (expression count)
- *
- * Note: Imbedded Array Initializers works with this in that it will peek into the value stack two entries down
- * to find the type of array it should be creating.
- */
- private static final Integer ARRAYINITIALIZER_COUNT_0 = new Integer(0); // Use in normal case of empty array. Save object creation.
- private static final Integer ARRAYINITIALIZER_COUNT_1 = new Integer(1); // Use in normal case of one element array. Save object creation.
- private static final Integer ARRAYINITIALIZER_COUNT_2 = new Integer(2); // Use in normal case of two element array. Save object creation.
-
- /*
- * CAST expression.
- * The expression stack will have:
- * IExpression.CAST_EXPRESSION
- * PROCESS_EXPRESSION
- *
- * The value stack will have:
- * CAST
- * type (either a string representing the type, or an IBeanProxyType representing the type).
- */
-
- /*
- * CLASS INSTANCE CREATION expression.
- * The expression stack will have:
- * IExpression.CLASSINSTANCECREATION_ARGUMENT (for 0 to n times depending on argument count)
- * PROCESS_EXPRESSION
- *
- * The value stack will have
- * CLASSINSTANCECREATION
- * type (either a string representing the type, or an IBeanProxyType representing the type).
- * Integer(argument count)
- *
- *
- * Note: Array Initializer works with this in that it will peek into the value stack two entries down
- * to find the type of array it should be creating.
- */
- private static final Integer CLASS_INSTANCE_CREATION_ARGUMENTS_1 = new Integer(1); // Use in normal case of one argument. Save object creation.
- private static final Integer CLASS_INSTANCE_CREATION_ARGUMENTS_0 = new Integer(0); // Use in normal case of no arguments (default ctor). Save object creation.
-
- /*
- * CONDITIONAL expression.
- * Since this can cause skipping of expressions (e.g. if condition is false, then the true condition should not be evaluated),
- * we need to have a process expression and process call to the other side for each expression so that it can
- * determine if it should be ignored or not.
- *
- * The expression stack will have:
- * IExpression.CONDITIONAL_CONDITION
- * PROCESS_EXPRESSION
- * IExpression.CONDITIONAL_TRUE
- * PROCESS_EXPRESSION
- * IExpression.CONDITIONAL_FALSE
- * PROCESS_EXPRESSION
- *
- * The value stack will have:
- * CONDITIONAL
- * CONDITIONAL_CONDITION
- * CONDITIONAL
- * CONDITIONAL_TRUE
- * CONDITIONAL
- * CONDITIONAL_FALSE
- *
- */
-
- /*
- * PREFIX expression.
- * The expression stack will have:
- * IExpression.PREFIX_OPERAND
- * PROCESS_EXPRESSION
- *
- * The value stack will have:
- * PREFIX
- * operator (using Integer prefix operator constants defined here)
- */
-
- /*
- * INFIX expression.
- * Since two types of infix operators (conditional and AND or) can cause skipping of expressions (e.g. once
- * conditional and sees a false expression, the rest of the expressions are skipped and should not be evaluated),
- * we need to have a process expression and process call to the other side for each expression so that it can
- * determine if it should be ignored or not.
- *
- * The expression stack will have:
- * IExpression.INFIX_LEFT
- * PROCESS_EXPRESSION
- * IExpression.INFIX_RIGHT
- * PROCESS_EXPRESSION
- * (for 0 to n times depending upon extended count)
- * IExpression.INFIX_EXTENDED
- * PROCESS_EXPRESSION
- *
- * The value stack will have:
- * INFIX
- * operator (using Integer infix operator constants defined here)
- * IN_LEFT
- * (for (extendedCount) times) This will cover the right one and all but last extended
- * INFIX
- * operator (using Integer infix operator constants defined here)
- * IN_OTHER
- * INFIX
- * operator (using Integer infix operator constants defined here)
- * IN_LAST (this is covers either the right one if no extended, or the last extended)
- */
-
- /*
- * INSTANCEOF expression.
- * The expression stack will have:
- * IExpression.INSTANCEOF_EXPRESSION
- * PROCESS_EXPRESSION
- *
- * The value stack will have:
- * INSTANCEOF
- * type (either a string representing the type, or an IBeanProxyType representing the type).
- */
-
- /*
- * Field access expression.
- * The expression stack will have:
- * IExpression.FIELD_RECEIVER (if hasReceiver is true)
- * PROCESS_EXPRESSION
- *
- * The value stack will have:
- * FIELDACCESS
- * name (the name of the field)
- * Boolean (true if has receiver)
- */
-
- /*
- * Method invocation expression.
- * The expression stack will have:
- * IExpression.METHOD_RECEIVER (if hasReceiver is true)
- * IExpression.METHOD_ARGUMENT (0 to n times for how many arguments).
- * PROCESS_EXPRESSION
- *
- * The value stack will have:
- * METHODINVOCATION
- * name (the name of the method)
- * Boolean (true if has receiver)
- * argCount (the number of arguments).
- */
- private static final Integer METHOD_ARGUMENTS_1 = new Integer(1); // Use in normal case of one argument. Save object creation.
- private static final Integer METHOD_ARGUMENTS_0 = new Integer(0); // Use in normal case of no arguments. Save object creation.
-
-
- /*
- * Assignment expression
- * The expression stack will have:
- * IExpression.ASSIGNMENT_RIGHT
- * IExpression.ASSIGNMENT_LEFT
- * PROCESS_EXPRESSION
- *
- * The value stack will have:
- * ASSIGNMENT
- * left expression (variable reference)
- * right expression
- */
-
- /*
- * Assignment proxy expression
- * The expression stack will have:
- * IExpression.ASSIGNMENT_RIGHT
- * PROCESS_EXPRESSION
- *
- * The value stack will have:
- * ASSIGNMENT_PROXY
- * expression proxy (an expression proxy)
- */
-
- /*
- * Next valid for expression stack. This is kept as a stack also.
- * As the expressions come in, the appropriate order (in reverse)
- * of expression types will be pushed, and then popped as they
- * come in.
- *
- * Since we can't have an array list of ints, will simulate the
- * stack here.
- */
- private ForExpression[] nextForExpressionStack = new ForExpression[30];
- private int nextForExpressionStackPos = -1; // Position of top entry in stack.
- private boolean expressionValid = true; // Is the expression currently valid.
- private String invalidMsg = null; // Msg for being invalid if default msg not sufficient.
- private List expressionProxies; // List of expression proxies. The index of the proxy is its id. This list must never shrink in size.
-
- // A MarkEntry. To allow restore in case of error.
- private static class MarkEntry {
- public int markID;
- public int controlStackPos; // Position of control stack at time of mark.
- public int nextExpressionStackPos; // Position of nextForExpression stack at time of mark.
- public int expressionProxiesPos; // Position of expressionProxies list at time of mark.
- }
-
- private int highestMarkID = 0; // Next mark id. '0' is invalid, as in no marks. This is incremented for each new mark. Never decremented.
- private MarkEntry currentMarkEntry; // Just a convienence to the current mark entry so no need to look into the list every time.
- private List markEntries; // Stack of mark entries.
-
- // This class is here so we can add our special internal ForExpression: PROCESS_EXPRESSION. These are never used outside Expression.
- private static class ExpressionEnum extends ForExpression {
-
- public ExpressionEnum(int value, String name) {
- super(value, name);
- }
-
- }
-
- // This is pushed onto the next expression stack, and when it is popped, then the expression is complete and ready to be pushed to the proxy side.
- private static final ForExpression PROCESS_EXPRESSION = new ExpressionEnum(Integer.MIN_VALUE, "Process Expression"); //$NON-NLS-1$
-
- // This is pushed onto the next expression stack for end block and will test if this there to make sure that it is being called correctly.
- private static final ForExpression BLOCKEND_EXPRESSION = new ExpressionEnum(PROCESS_EXPRESSION.getValue()-2, "End Block Expression"); //$NON-NLS-1$
-
- // This is pushed onto the next expression stack for end try and will test if this there to make sure that it is being called correctly.
- private static final ForExpression TRYEND_EXPRESSION = new ExpressionEnum(BLOCKEND_EXPRESSION.getValue()-1, "End Try Expression"); //$NON-NLS-1$
-
- // This is pushed onto the next expression stack for catch and will test if this there to make sure that it is being called correctly.
- private static final ForExpression TRYCATCH_EXPRESSION = new ExpressionEnum(TRYEND_EXPRESSION.getValue()-1, "Catch Expression"); //$NON-NLS-1$
-
-
- // This is pushed onto the next expression stack for begin thread transfer and will test if this there to make sure that it is being called correctly.
- private static final ForExpression THREADTRANSFER_EXPRESSION = new ExpressionEnum(TRYCATCH_EXPRESSION.getValue()-1, "Catch Expression"); //$NON-NLS-1$
-
- // This is pushed onto the next expression stack for end subexpression and will test if this there to make sure that it is being called correctly.
- private static final ForExpression SUBEXPRESSIONEND_EXPRESSION = new ExpressionEnum(THREADTRANSFER_EXPRESSION.getValue()-2, "End Subexpression"); //$NON-NLS-1$
-
- /**
- * Check the for expression, and if legal, set to the next valid for expression type,
- * if it can. If the stack entry is ROOTEXPRESSION, and the forExpression is ROOTEXPRESSION,
- * then the expression is allowed, but it is not popped. It must be popped later when appropriate.
- * <p>
- * This is for "block" expressions. We don't want to pop down the stack passed the ROOTEXPRESSION
- * that got added by the create block until we get an end block. That allows root expressions to
- * be added to the block without the stack popping up past the block start in the stack.
- *
- * @param forExpression
- * @throws IllegalStateException
- *
- * @since 1.0.0
- */
- protected final void checkForExpression(ForExpression forExpression) throws IllegalStateException {
- if (expressionValid) {
- if (nextForExpressionStackPos == -1)
- if (forExpression == ForExpression.ROOTEXPRESSION)
- return; // valid. We are at the root (i.e. nothing is waiting).
- else
- ; // invalid. drop through
- else if (nextForExpressionStack[nextForExpressionStackPos] == forExpression) {
- // Valid, either the root expression matched (We don't implicitly pop those. That needs to be done explicitly).
- // Or we matched non-root, those will be popped.
- if (forExpression != ForExpression.ROOTEXPRESSION) {
- popForExpression(); // Pop the stack since stack not a root expression.
- }
- return;
- }
- } else {
- String expMsg = invalidMsg != null ? MessageFormat.format(ProxyMessages.Expression_InInvalidStateDueTo_EXC_, new Object[] {invalidMsg}) : ProxyMessages.Expression_InInvalidState_EXC_;
- throw new IllegalStateException(expMsg);
- }
-
- // If we got here, then invalid.
- ForExpression expected = nextForExpressionStackPos >= 0 ? nextForExpressionStack[nextForExpressionStackPos] : ForExpression.ROOTEXPRESSION;
- expressionValid = false;
- throw new IllegalStateException(MessageFormat.format(ProxyMessages.Expression_TypeSentInInvalidOrder_EXC_, new Object[] {forExpression, expected}));
- }
-
- /**
- * Pop the top for expression, whatever it is.
- * @throws IllegalStateException thrown if try to pop through through the current mark entry. The endMark is the only one who can do this.
- * @since 1.1.0
- */
- protected final void popForExpression() throws IllegalStateException {
- if (expressionValid && nextForExpressionStackPos >= 0) {
- nextForExpressionStackPos--;
- if (currentMarkEntry != null && nextForExpressionStackPos < currentMarkEntry.nextExpressionStackPos) {
- nextForExpressionStackPos++; // Restore to what it was
- throwInvalidMarkNesting();
- }
- }
- }
-
- /*
- * @throws IllegalStateException
- *
- * @since 1.1.0
- */
- private void throwInvalidMarkNesting() throws IllegalStateException {
- expressionValid = false;
- throw new IllegalStateException(MessageFormat.format(ProxyMessages.Expression_InvalidMarkNesting, new Object[] {new Integer(currentMarkEntry != null ? currentMarkEntry.markID : 0)}));
- }
-
- /**
- * Peek into the for expression stack to see if the top entry is the passed in value. It will
- * not pop the stack nor throw any exceptions.
- *
- * @param forExpression The top expression flag will be compared against this value.
- * @return <code>true</code> if the top expression equals the parameter passed in.
- *
- * @since 1.0.0
- */
- protected final boolean peekForExpression(ForExpression forExpression) {
- if (expressionValid) {
- if (nextForExpressionStackPos == -1)
- if (forExpression == ForExpression.ROOTEXPRESSION)
- return true; // valid. We are at the root (i.e. nothing is waiting).
- else
- ; // invalid. drop through
- else if (nextForExpressionStack[nextForExpressionStackPos] == forExpression)
- return true; // Valid, the top expression matched.
- }
- return false;
- }
-
- /**
- * Mark this expression as now invalid.
- */
- protected final void markInvalid() {
- expressionValid = false;
- }
-
- /**
- * Mark this expression as now invalid, but supply a message to go with it.
- *
- * @param msg
- *
- * @since 1.0.0
- */
- protected final void markInvalid(String msg) {
- invalidMsg = msg;
- markInvalid();
- }
-
- public void close() {
- nextForExpressionStackPos = -1;
- controlStack.clear();
- if (expressionProxies != null)
- markAllProxiesNotResolved(expressionProxies); // They weren't processed, close must of been called early.
- expressionProxies = null;
- markEntries = null;
- expressionValid = false;
- closeProxy();
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IExpression#isValid()
- */
- public boolean isValid() {
- return expressionValid;
- }
-
- /*
- * Check if the pending expression is ready for evaluation.
- * It is complete if the next entry on the stack is a PROCESS_EXPRESSION
- */
- private boolean expressionReady() {
- if (nextForExpressionStackPos >= 0 && nextForExpressionStack[nextForExpressionStackPos] == PROCESS_EXPRESSION) {
- checkForExpression(PROCESS_EXPRESSION); // pop it
- return true;
- } else
- return false;
- }
-
- /*
- * Push the next expression type.
- */
- private void pushForExpression(ForExpression nextExpression) {
- if (++nextForExpressionStackPos >= nextForExpressionStack.length) {
- // Increase stack size.
- ForExpression[] newStack = new ForExpression[nextForExpressionStackPos*2]; // So room to grow without excessive allocations.
- System.arraycopy(nextForExpressionStack, 0, newStack, 0, nextForExpressionStack.length);
- nextForExpressionStack = newStack;
- }
- nextForExpressionStack[nextForExpressionStackPos] = nextExpression;
- }
-
- /*
- * Check if expression is complete, and if it is, process it.
- */
- private void processExpression() {
- while (expressionReady()) {
- try {
- // We've received all of the expressions for the expression, so process it.
- int expType = ((InternalExpressionTypes) pop()).getValue();
- switch (expType) {
- case InternalExpressionTypes.CAST_EXPRESSION_VALUE:
- pushCastToProxy((IProxyBeanType) pop());
- break;
- case InternalExpressionTypes.INSTANCEOF_EXPRESSION_VALUE:
- pushInstanceofToProxy((IProxyBeanType) pop());
- break;
- case InternalExpressionTypes.PREFIX_EXPRESSION_VALUE:
- pushPrefixToProxy((PrefixOperator)pop());
- break;
- case InternalExpressionTypes.INFIX_EXPRESSION_VALUE:
- pushInfixToProxy((InfixOperator) pop(), (InternalInfixOperandType) pop());
- break;
- case InternalExpressionTypes.ARRAY_ACCESS_EXPRESSION_VALUE:
- pushArrayAccessToProxy(((Integer) pop()).intValue());
- break;
- case InternalExpressionTypes.ARRAY_CREATION_EXPRESSION_VALUE:
- pushArrayCreationToProxy((IProxyBeanType) pop(), ((Integer) pop()).intValue());
- break;
- case InternalExpressionTypes.ARRAY_INITIALIZER_EXPRESSION_VALUE:
- pushArrayInitializerToProxy((IProxyBeanType) pop(), ((Integer) pop()).intValue(), ((Integer) pop()).intValue());
- break;
- case InternalExpressionTypes.CLASS_INSTANCE_CREATION_EXPRESSION_VALUE:
- pushClassInstanceCreationToProxy((IProxyBeanType) pop(), ((Integer) pop()).intValue());
- break;
- case InternalExpressionTypes.FIELD_ACCESS_EXPRESSION_VALUE:
- pushFieldAccessToProxy(pop(), ((Boolean) pop()).booleanValue());
- break;
- case InternalExpressionTypes.METHOD_EXPRESSION_VALUE:
- pushMethodInvocationToProxy(pop(), ((Boolean) pop()).booleanValue(), ((Integer) pop()).intValue());
- break;
- case InternalExpressionTypes.CONDITIONAL_EXPRESSION_VALUE:
- pushConditionalToProxy((InternalConditionalOperandType) pop());
- break;
- case InternalExpressionTypes.ASSIGNMENT_PROXY_EXPRESSION_VALUE:
- pushAssignmentToProxy((ExpressionProxy) pop());
- break;
- case InternalExpressionTypes.ASSIGNMENT_EXPRESSION_VALUE:
- pushAssignmentToProxy();
- break;
- case InternalExpressionTypes.BLOCK_END_EXPRESSION_VALUE:
- pushBlockEndToProxy(((Integer) pop()).intValue());
- break;
- case InternalExpressionTypes.TRY_END_EXPRESSION_VALUE:
- pushTryEndToProxy(((Integer) pop()).intValue());
- break;
- case InternalExpressionTypes.THROW_EXPRESSION_VALUE:
- pushThrowToProxy();
- break;
- case InternalExpressionTypes.IF_TEST_EXPRESSION_VALUE:
- pushIfTestToProxy();
- break;
- case InternalExpressionTypes.IF_ELSE_EXPRESSION_VALUE:
- pushIfElseToProxy((InternalIfElseOperandType) pop());
- break;
- case InternalExpressionTypes.SUBEXPRESSION_END_EXPRESSION_VALUE:
- pushSubexpressionEndToProxy(((Integer) pop()).intValue());
- break;
- default:
- internalProcessUnknownExpressionType(expType);
- break;
- }
- } catch (RuntimeException e) {
- markInvalid();
- throw e;
- }
- }
- }
-
-
- private void internalProcessUnknownExpressionType(int expressionType) throws IllegalArgumentException {
- if (!processUnknownExpressionType(expressionType))
- throw new IllegalArgumentException();
- }
-
- /**
- * An unknown expression type was found in the processing of expression stack. Subclasses can override
- * to process new types of expressions.
- * <p>
- * Overrides must return <code>true</code> if they processed the expression type. If they return <code>false</code>
- * it means they didn't understand it either and we should do default processing for unknow type.
- * @param expressionType
- * @return <code>true</code> if type was processed, <code>false</code> if not known by subclass either.
- *
- * @since 1.0.0
- */
- protected boolean processUnknownExpressionType(int expressionType) {
- return false;
- }
-
- /**
- * Create the expression.
- *
- * @param registry
- *
- * @since 1.0.0
- */
- protected Expression(ProxyFactoryRegistry registry) {
- this.registry = registry;
- this.beanProxyFactory = this.registry.getBeanProxyFactory();
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IExpression#getRegistry()
- */
- public ProxyFactoryRegistry getRegistry() {
- return registry;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IExpression#invokeExpression()
- */
- public final void invokeExpression() throws ThrowableProxy, IllegalStateException, NoExpressionValueException {
- try {
- checkForExpression(ForExpression.ROOTEXPRESSION); // We are at the root.
- popForExpression(); // Get rid of any intermediate roots.
- checkForExpression(ForExpression.ROOTEXPRESSION); // We should be at true root now. We don't have more than one intermediate root pushed in sequence.
- List proxies = expressionProxies;
- expressionProxies = null;
- pushInvoke(processExpressionProxyCallbacks(proxies), proxies);
- } finally {
- markInvalid(); // Mark invalid so any new calls after this will fail.
- close();
- }
- }
-
- /*
- * Process the expression proxy callbacks, if any.
- * @return the number of proxies that have callbacks.
- */
- private int processExpressionProxyCallbacks(List proxies) {
- if (proxies != null) {
- // Strip list down to only those with callbacks and send on.
- int proxiesWithCallbacks = 0;
- for (ListIterator eps = proxies.listIterator(); eps.hasNext();) {
- ExpressionProxy proxy = (ExpressionProxy) eps.next();
- if (!proxy.hasListeners())
- eps.set(null); // Remove it from the list. No one cares.
- else
- proxiesWithCallbacks++;
- }
- return proxiesWithCallbacks;
- }
- return 0;
- }
-
- /**
- * Called to validate this is a valid proxy for this expression. This could happen
- * if a proxy from another expression is sent to this expression. If the proxy
- * is a bean proxy or is an expression proxy for this expression, then this
- * just returns. Else it will throw the {@link IllegalArgumentException}.
- * @param proxy
- * @throws IllegalArgumentException if the proxy is an expression proxy for another expression.
- *
- * @since 1.1.0.1
- */
- private void validateProxy(IProxy proxy) throws IllegalArgumentException {
- if (proxy != null && (proxy.isExpressionProxy() && ((ExpressionProxy) proxy).getExpression() != this))
- throw new IllegalArgumentException(ProxyMessages.Expression_InvalidProxy);
- }
-
- /**
- * Called by subclass to fill in the value of an expression proxy. See {@link Expression#pullProxyValue(int, List))} for an example of who would call it.
- * @param ep
- * @param beanproxy
- *
- * @since 1.1.0
- */
- protected void fireProxyResolved(ExpressionProxy ep, IBeanProxy beanproxy) {
- ep.fireResolved(beanproxy);
- }
-
- /**
- * Called by subclass to fire proxy was not resolved. See {@link Expression#pullProxyValue(int, List))} for an example of who would call it.
- * @param ep
- *
- * @since 1.1.0
- */
- protected void fireProxyNotResolved(ExpressionProxy ep) {
- ep.fireNotResolved();
- }
-
- /**
- * Called by subclass to fire proxy resolved to a void return type. See {@link Expression#pullProxyValue(int, List))} for an example of who would call it.
- * @param ep
- *
- * @since 1.1.0
- */
- protected void fireProxyVoid(ExpressionProxy ep) {
- ep.fireVoidResolved();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IExpression#getExpressionValue()
- */
- public final IBeanProxy getExpressionValue() throws ThrowableProxy, NoExpressionValueException, IllegalStateException {
- try {
- checkForExpression(ForExpression.ROOTEXPRESSION); // We are at the root.
- popForExpression(); // Get rid of any intermediate roots.
- checkForExpression(ForExpression.ROOTEXPRESSION); // We should be at true root now. We don't have more than one intermediate root pushed in sequence.
- List proxies = expressionProxies;
- expressionProxies = null;
- return pullProxyValue(processExpressionProxyCallbacks(proxies), proxies); // Get the top value.
- } finally {
- markInvalid(); // Mark invalid so any new calls after this will fail.
- close();
- }
- }
-
-
- /**
- * Mark the list of proxies as not resolved.
- *
- * @since 1.1.0
- */
- protected void markAllProxiesNotResolved(List proxies) {
- if (proxies != null) {
- for (ListIterator eps = proxies.listIterator(); eps.hasNext();) {
- ExpressionProxy proxy = (ExpressionProxy) eps.next();
- if (proxy != null && proxy.hasListeners())
- fireProxyNotResolved(proxy);
- }
- }
- }
-
- private int blockNumber = -1; // Current block number. This is always incrementing.
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IExpression#createBlockBegin()
- */
- public final int createBlockBegin() throws IllegalStateException {
- try {
- // Blocks are special, they can be anywhere at root, of could be the true or else clause of an if/else.
- if (peekForExpression(ForExpression.ROOTEXPRESSION))
- checkForExpression(ForExpression.ROOTEXPRESSION);
- else if (peekForExpression(ForExpression.IF_TRUE))
- checkForExpression(ForExpression.IF_TRUE);
- else
- checkForExpression(ForExpression.IF_ELSE);
-
- pushForExpression(PROCESS_EXPRESSION);
- pushForExpression(BLOCKEND_EXPRESSION);
- pushForExpression(ForExpression.ROOTEXPRESSION);
-
- pushBlockBeginToProxy(++blockNumber);
- push(new Integer(blockNumber));
- push(InternalExpressionTypes.BLOCK_END_EXPRESSION);
- processExpression();
- return blockNumber;
- } catch (RuntimeException e) {
- markInvalid();
- throw e;
- }
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IExpression#createBlockBreak(int)
- */
- public final void createBlockBreak(int blockNumber) throws IllegalStateException {
- try {
- checkForExpression(ForExpression.ROOTEXPRESSION);
- pushBlockBreakToProxy(blockNumber);
- processExpression();
- } catch (RuntimeException e) {
- markInvalid();
- throw e;
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IExpression#createBlockEnd()
- */
- public final void createBlockEnd() throws IllegalStateException {
- try {
- checkForExpression(ForExpression.ROOTEXPRESSION);
- popForExpression(); // Remove the root expression since block is done.
- checkForExpression(BLOCKEND_EXPRESSION); // This needs to be next for it to be valid.
- processExpression(); // Now let it handle the previously pushed end block, containing the block number being ended.
- } catch (RuntimeException e) {
- markInvalid();
- throw e;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IExpression#createArrayAccess(int, int)
- */
- public final void createArrayAccess(ForExpression forExpression, int indexCount) {
- try {
- checkForExpression(forExpression);
- pushForExpression(PROCESS_EXPRESSION);
- int i = indexCount;
- while (i-- > 0)
- pushForExpression(ForExpression.ARRAYACCESS_INDEX);
- pushForExpression(ForExpression.ARRAYACCESS_ARRAY);
-
- push(indexCount == 1 ? ARRAYACCESS_INDEX_1 : new Integer(indexCount));
- push(InternalExpressionTypes.ARRAY_ACCESS_EXPRESSION);
- processExpression(); // See if previous expression is ready for processing.
- } catch (RuntimeException e) {
- markInvalid();
- throw e;
- }
- }
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IExpression#createArrayCreation(int, java.lang.String, int)
- */
- public final void createArrayCreation(ForExpression forExpression, String type, int dimensionExpressionCount)
- throws IllegalStateException {
- pushArrayCreation(forExpression, getProxyBeanType(type), dimensionExpressionCount);
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IExpression#createArrayCreation(org.eclipse.jem.internal.proxy.initParser.tree.ForExpression, org.eclipse.jem.internal.proxy.core.IProxyBeanType, int)
- */
- public final void createArrayCreation(ForExpression forExpression, IProxyBeanType type, int dimensionExpressionCount)
- throws IllegalStateException, IllegalArgumentException {
- pushArrayCreation(forExpression, type, dimensionExpressionCount);
- }
-
- private void pushArrayCreation(ForExpression forExpression, IProxyBeanType type, int dimensionExpressionCount) throws IllegalStateException, IllegalArgumentException {
- try {
- checkForExpression(forExpression);
- validateProxy(type);
- switch (dimensionExpressionCount) {
- case 0:
- push(ARRAY_CREATION_DIMENSION_0);
- break;
- case 1:
- push(ARRAY_CREATION_DIMENSION_1);
- break;
- default:
- push(new Integer(dimensionExpressionCount));
- break;
- }
- push(type);
- push(InternalExpressionTypes.ARRAY_CREATION_EXPRESSION);
-
- pushForExpression(PROCESS_EXPRESSION);
- if (dimensionExpressionCount == 0)
- pushForExpression(ARRAY_INITIALIZER);
- else {
- while (dimensionExpressionCount-- > 0)
- pushForExpression(ForExpression.ARRAYCREATION_DIMENSION);
- }
- processExpression(); // See if previous expression is ready for processing.
- } catch (RuntimeException e) {
- markInvalid();
- throw e;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IExpression#createArrayInitializer(int)
- */
- public final void createArrayInitializer(int expressionCount) throws IllegalStateException {
- try {
- // This is special, we could be waiting for an array initializer or an array initializer expression.
- // We will peek to see what it is and handle it.
- if (peekForExpression(ARRAY_INITIALIZER))
- checkForExpression(ARRAY_INITIALIZER);
- else
- checkForExpression(ForExpression.ARRAYINITIALIZER_EXPRESSION);
-
- // At this point in time that stack may either have:
- // array_type, array_creation
- // strip_count, array_type, array_initializer
- // So we can get the array type from peek(2), and get the command type from peek(1).
- // Then if the command type is array_creation, strip_count will be inited to 0, while
- // else it will be inited to peek(3). From that we can increment the strip_count to
- // use for this initializer.
- //
- // We need to peek here because we will be adding various pushes to the stack and we
- // need to get the info while it is still at the top of the stack.
- Object arrayType = peek(2);
- int stripCount = 0;
- if (peek(1) == InternalExpressionTypes.ARRAY_INITIALIZER_EXPRESSION)
- stripCount = ((Integer) peek(3)).intValue();
-
- switch (expressionCount) {
- case 0:
- push(ARRAYINITIALIZER_COUNT_0);
- break;
- case 1:
- push(ARRAYINITIALIZER_COUNT_1);
- break;
- case 2:
- push(ARRAYINITIALIZER_COUNT_2);
- break;
- default:
- push(new Integer(expressionCount));
- break;
- }
-
- if (arrayType instanceof String) {
- String at = (String) arrayType;
- int i = at.lastIndexOf("[]"); //$NON-NLS-1$
- if (i == -1)
- throw new IllegalArgumentException(MessageFormat.format(
- ProxyMessages.Expression_ArrayTypeNotAnArray_EXC_, new Object[] { arrayType}));
- arrayType = getProxyBeanType(at);
- } else if (!(arrayType instanceof IProxyBeanType)) {
- throw new IllegalArgumentException(MessageFormat.format(
- ProxyMessages.Expression_ArrayTypeNotAnArray_EXC_, new Object[] { arrayType}));
- }
- push(new Integer(++stripCount));
- push(arrayType);
- push(InternalExpressionTypes.ARRAY_INITIALIZER_EXPRESSION);
-
- pushForExpression(PROCESS_EXPRESSION);
- while (expressionCount-- > 0)
- pushForExpression(ForExpression.ARRAYINITIALIZER_EXPRESSION);
-
- processExpression();
- } catch (RuntimeException e) {
- markInvalid();
- throw e;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IExpression#createCastExpression(int, java.lang.String)
- * A cast expression has one nested expression.
- */
- public final void createCastExpression(ForExpression forExpression, String type) throws IllegalStateException {
- pushCast(forExpression, getProxyBeanType(type)); // Push this onto the local stack to wait for completion.
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IExpression#createCastExpression(org.eclipse.jem.internal.proxy.initParser.tree.ForExpression, org.eclipse.jem.internal.proxy.core.IProxyBeanType)
- */
- public final void createCastExpression(ForExpression forExpression, IProxyBeanType type) throws IllegalStateException, IllegalArgumentException {
- pushCast(forExpression, type); // Push this onto the local stack to wait for completion.
- }
-
- /*
- * Push for a cast.
- */
- private void pushCast(ForExpression forExpression, IProxyBeanType type) throws IllegalStateException, IllegalArgumentException {
- try {
- checkForExpression(forExpression);
- validateProxy(type);
- push(type);
- push(InternalExpressionTypes.CAST_EXPRESSION);
- pushForExpression(PROCESS_EXPRESSION);
- pushForExpression(ForExpression.CAST_EXPRESSION); // The next expression must be for the cast expression.
- processExpression();
- } catch (RuntimeException e) {
- markInvalid();
- throw e;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IExpression#createClassInstanceCreation(int, java.lang.String, int)
- */
- public final void createClassInstanceCreation(ForExpression forExpression, String type, int argumentCount)
- throws IllegalStateException {
- pushClassInstanceCreation(forExpression, getProxyBeanType(type), argumentCount); // Push this onto the local stack to wait for completion.
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IExpression#createClassInstanceCreation(org.eclipse.jem.internal.proxy.initParser.tree.ForExpression, org.eclipse.jem.internal.proxy.core.IProxyBeanType, int)
- */
- public final void createClassInstanceCreation(ForExpression forExpression, IProxyBeanType type, int argumentCount)
- throws IllegalStateException, IllegalArgumentException {
- pushClassInstanceCreation(forExpression, type, argumentCount); // Push this onto the local stack to wait for completion.
- }
-
- /*
- * Push for a class instance creation
- */
- private void pushClassInstanceCreation(ForExpression forExpression, IProxyBeanType type, int argumentCount) throws IllegalStateException, IllegalArgumentException {
- try {
- checkForExpression(forExpression);
- validateProxy(type);
- switch (argumentCount) {
- case 0:
- push(CLASS_INSTANCE_CREATION_ARGUMENTS_0);
- break;
- case 1:
- push(CLASS_INSTANCE_CREATION_ARGUMENTS_1);
- break;
- default:
- push(new Integer(argumentCount));
- break;
- }
- push(type);
- push(InternalExpressionTypes.CLASS_INSTANCE_CREATION_EXPRESSION);
-
- pushForExpression(PROCESS_EXPRESSION);
- while (argumentCount-- > 0)
- pushForExpression(ForExpression.CLASSINSTANCECREATION_ARGUMENT);
- processExpression(); // See if previous expression is ready for processing.
- } catch (RuntimeException e) {
- markInvalid();
- throw e;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IExpression#createConditionalExpression(int)
- */
- public final void createConditionalExpression(ForExpression forExpression) throws IllegalStateException {
- try {
- checkForExpression(forExpression);
- pushForExpression(PROCESS_EXPRESSION);
- pushForExpression(ForExpression.CONDITIONAL_FALSE);
- pushForExpression(PROCESS_EXPRESSION);
- pushForExpression(ForExpression.CONDITIONAL_TRUE);
- pushForExpression(PROCESS_EXPRESSION);
- pushForExpression(ForExpression.CONDITIONAL_CONDITION);
-
- push(InternalConditionalOperandType.CONDITIONAL_FALSE);
- push(InternalExpressionTypes.CONDITIONAL_EXPRESSION);
- push(InternalConditionalOperandType.CONDITIONAL_TRUE);
- push(InternalExpressionTypes.CONDITIONAL_EXPRESSION);
- push(InternalConditionalOperandType.CONDITIONAL_TEST);
- push(InternalExpressionTypes.CONDITIONAL_EXPRESSION);
- processExpression();
- } catch (RuntimeException e) {
- markInvalid();
- throw e;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IExpression#createFieldAccess(int, java.lang.String, boolean)
- */
- public final void createFieldAccess(ForExpression forExpression, String fieldName, boolean hasReceiver) throws IllegalStateException, IllegalArgumentException {
- try {
- // Only for string fieldnames is this invalid when no receiver because no way to determine receiver. (Don't handle implicit "this" yet for fields).
- // For the accessor that takes a IFieldProxy we can get away with no receiver because the field proxy can determine if static or not, and if not
- // static it will fail at evaluation time.
- if (!hasReceiver)
- throw new IllegalArgumentException(MessageFormat.format(
- ProxyMessages.Expression_CannotHandleNoReceiveOnFieldAccess_EXC_, new Object[] { fieldName}));
- pushFieldAccess(forExpression, fieldName, hasReceiver);
- } catch (RuntimeException e) {
- markInvalid();
- throw e;
- }
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IExpression#createIfElse(boolean)
- */
- public final void createIfElse(boolean hasElseClause) throws IllegalStateException {
- try {
- checkForExpression(ForExpression.ROOTEXPRESSION);
-
- pushForExpression(PROCESS_EXPRESSION);
- if (hasElseClause) {
- pushForExpression(ForExpression.IF_ELSE);
- }
- pushForExpression(PROCESS_EXPRESSION);
- pushForExpression(ForExpression.IF_TRUE);
- pushForExpression(PROCESS_EXPRESSION);
- pushForExpression(ForExpression.IF_CONDITION);
-
- // We still push an else clause so that we know when finished. We don't have a pushForExpression for it because there
- // won't be any. But the else clause processing will be on the push stack so that we can clean up when end of if stmt occurs.
- push(InternalIfElseOperandType.ELSE_CLAUSE);
- push(InternalExpressionTypes.IF_ELSE_EXPRESSION);
-
- push(InternalIfElseOperandType.TRUE_CLAUSE);
- push(InternalExpressionTypes.IF_ELSE_EXPRESSION);
- push(InternalExpressionTypes.IF_TEST_EXPRESSION);
- processExpression();
- } catch (RuntimeException e) {
- markInvalid();
- throw e;
- }
- }
-
- /*
- * Push the field access.
- * @param forExpression
- * @param field String if field name, or IProxyField.
- * @param hasReceiver
- * @throws IllegalAccessException
- *
- * @since 1.1.0
- */
- private void pushFieldAccess(ForExpression forExpression, Object field, boolean hasReceiver) throws IllegalStateException {
- try {
- checkForExpression(forExpression);
- push(hasReceiver ? Boolean.TRUE : Boolean.FALSE); // We have a receiver
- push(field);
- push(InternalExpressionTypes.FIELD_ACCESS_EXPRESSION);
-
- pushForExpression(PROCESS_EXPRESSION);
- if (hasReceiver)
- pushForExpression(ForExpression.FIELD_RECEIVER);
- processExpression(); // See if previous expression is ready for processing.
- } catch (RuntimeException e) {
- markInvalid();
- throw e;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IExpression#createInfixExpression(int, int, int)
- */
- public final void createInfixExpression(ForExpression forExpression, InfixOperator operator, int extendedOperandCount) throws IllegalStateException {
- try {
- checkForExpression(forExpression);
- push(InternalInfixOperandType.INFIX_LAST_OPERAND);
- push(operator);
- push(InternalExpressionTypes.INFIX_EXPRESSION);
- int i = extendedOperandCount;
- while (i-- > 0) {
- push(InternalInfixOperandType.INFIX_OTHER_OPERAND);
- push(operator);
- push(InternalExpressionTypes.INFIX_EXPRESSION);
- }
- push(InternalInfixOperandType.INFIX_LEFT_OPERAND);
- push(operator);
- push(InternalExpressionTypes.INFIX_EXPRESSION);
-
- i = extendedOperandCount;
- while (i-- > 0) {
- pushForExpression(PROCESS_EXPRESSION);
- pushForExpression(ForExpression.INFIX_EXTENDED);
- }
- pushForExpression(PROCESS_EXPRESSION);
- pushForExpression(ForExpression.INFIX_RIGHT);
- pushForExpression(PROCESS_EXPRESSION);
- pushForExpression(ForExpression.INFIX_LEFT);
- processExpression(); // See if previous expression is ready for processing.
- } catch (RuntimeException e) {
- markInvalid();
- throw e;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IExpression#createInstanceofExpression(int, java.lang.String)
- */
- public final void createInstanceofExpression(ForExpression forExpression, String type) throws IllegalStateException {
- pushInstanceof(forExpression, getProxyBeanType(type)); // Push this onto the local stack to wait for completion.
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IExpression#createInstanceofExpression(org.eclipse.jem.internal.proxy.initParser.tree.ForExpression, org.eclipse.jem.internal.proxy.core.IProxyBeanType)
- */
- public final void createInstanceofExpression(ForExpression forExpression, IProxyBeanType type) throws IllegalStateException, IllegalArgumentException {
- pushInstanceof(forExpression, type); // Push this onto the local stack to wait for completion.
- }
-
- /*
- * Push for a cast.
- */
- private void pushInstanceof(ForExpression forExpression, IProxyBeanType type) throws IllegalStateException, IllegalArgumentException {
- try {
- checkForExpression(forExpression);
- validateProxy(type);
- push(type);
- push(InternalExpressionTypes.INSTANCEOF_EXPRESSION);
- pushForExpression(PROCESS_EXPRESSION);
- pushForExpression(ForExpression.INSTANCEOF_VALUE); // The next expression must be for the instance of expression.
- processExpression();
- } catch (RuntimeException e) {
- markInvalid();
- throw e;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IExpression#createMethodInvocation(int, java.lang.String, boolean, int)
- */
- public final void createMethodInvocation(ForExpression forExpression, String name, boolean hasReceiver, int argumentCount)
- throws IllegalStateException, IllegalArgumentException {
- try {
- // Only for string methodnames is this invalid when no receiver because no way to determine receiver. (Don't handle implicit "this" yet for methods).
- // For the accessor that takes a IFieldProxy we can get away with no receiver because the field proxy can determine if static or not, and if not
- // static it will fail at evaluation time.
- if (!hasReceiver)
- throw new IllegalArgumentException(MessageFormat.format(
- ProxyMessages.Expression_MethodsNeedReceiver_EXC_, new Object[] { name}));
-
- pushMethodInvocation(forExpression, name, hasReceiver, argumentCount);
- } catch (RuntimeException e) {
- markInvalid();
- throw e;
- }
- }
-
- /**
- * @param forExpression
- * @param method String for method name, IMethodProxy otherwise.
- * @param hasReceiver
- * @param argumentCount
- * @throws ThrowableProxy
- * @throws NoExpressionValueException
- *
- * @since 1.1.0
- */
- private void pushMethodInvocation(ForExpression forExpression, Object method, boolean hasReceiver, int argumentCount) throws IllegalArgumentException, IllegalStateException {
- try {
- checkForExpression(forExpression);
- switch (argumentCount) {
- case 0:
- push(METHOD_ARGUMENTS_0);
- break;
- case 1:
- push(METHOD_ARGUMENTS_1);
- break;
- default:
- push(new Integer(argumentCount));
- break;
- }
- push(hasReceiver ? Boolean.TRUE : Boolean.FALSE);
- push(method);
- push(InternalExpressionTypes.METHOD_EXPRESSION);
-
- pushForExpression(PROCESS_EXPRESSION);
- while (argumentCount-- > 0)
- pushForExpression(ForExpression.METHOD_ARGUMENT);
- if (hasReceiver)
- pushForExpression(ForExpression.METHOD_RECEIVER);
- processExpression(); // See if previous expression is ready for processing.
- } catch (RuntimeException e) {
- markInvalid();
- throw e;
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IExpression#createPrefixExpression(int, org.eclipse.jem.internal.proxy.initParser.tree.PrefixOperator)
- */
- public final void createPrefixExpression(ForExpression forExpression, PrefixOperator operator) throws IllegalStateException {
- try {
- checkForExpression(forExpression);
- push(operator);
- push(InternalExpressionTypes.PREFIX_EXPRESSION);
-
- pushForExpression(PROCESS_EXPRESSION);
- pushForExpression(ForExpression.PREFIX_OPERAND);
- processExpression(); // See if previous expression is ready for processing.
- } catch (RuntimeException e) {
- markInvalid();
- throw e;
- }
- }
-
- /**
- * Create a new instance using the initialization string. The result must be compatible with the
- * given type. This is not on the IExpression interface because it is not for use of regular
- * customers. It is here for the allocation processer to create entries that are just strings.
- * <p>
- * This is not customer advanced API. This API for the implementers of registries and expression subclasses.
- *
- * @param forExpression
- * @param initializationString
- * @param type
- * @throws IllegalStateException
- * @throws IllegalArgumentException
- *
- * @since 1.1.0
- */
- public final void createNewInstance(ForExpression forExpression, String initializationString, IProxyBeanType type) throws IllegalStateException, IllegalArgumentException{
- try {
- checkForExpression(forExpression);
- validateProxy(type);
- pushNewInstanceToProxy(initializationString, type);
- processExpression();
- } catch (RuntimeException e) {
- markInvalid();
- throw e;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IExpression#createNull(int)
- */
- public final void createNull(ForExpression forExpression) throws IllegalStateException {
- try {
- checkForExpression(forExpression);
- pushToProxy(null);
- processExpression(); // See if previous expression is ready for processing.
- } catch (RuntimeException e) {
- markInvalid();
- throw e;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IExpression#createTypeLiteral(int, java.lang.String)
- */
- public final void createTypeLiteral(ForExpression forExpression, String type) throws IllegalStateException {
- createProxyExpression(forExpression, getProxyBeanType(type));
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IExpression#createTypeReceiver(java.lang.String)
- */
- public final void createTypeReceiver(String type) throws IllegalStateException {
- pushTypeReceiver(getProxyBeanType(type));
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IExpression#createTypeReceiver(org.eclipse.jem.internal.proxy.core.IProxyBeanType)
- */
- public final void createTypeReceiver(IProxyBeanType type) throws IllegalStateException, IllegalArgumentException {
- validateProxy(type);
- pushTypeReceiver(type);
- }
-
- /*
- * Push for a type receiver.
- * @param type
- *
- * @since 1.0.0
- */
- private void pushTypeReceiver(IProxyBeanType type) throws IllegalStateException {
- try {
- // This is special because type receivers are only valid as the receiver for a field access or a method access.
- // Since each has a different forExpression we need to test for one or the other. It doesn't make any difference
- // which one it is, but it must be one or the other.
- if (peekForExpression(ForExpression.FIELD_RECEIVER))
- checkForExpression(ForExpression.FIELD_RECEIVER);
- else
- checkForExpression(ForExpression.METHOD_RECEIVER);
-
- pushTypeReceiverToProxy(type);
- processExpression(); // See if previous expression is ready for processing.
- } catch (RuntimeException e) {
- markInvalid();
- throw e;
- }
- }
-
- /*
- * For all of the primitive types we will be creating a IBeanProxy for them. That is because that
- * would be the expected result of the expression, and no need to get the other side involved.
- */
-
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IExpression#createPrimitiveLiteral(int, boolean)
- */
- public final void createPrimitiveLiteral(ForExpression forExpression, boolean value) throws IllegalStateException {
- try {
- checkForExpression(forExpression);
- pushToProxy(beanProxyFactory.createBeanProxyWith(value));
- processExpression();
- } catch (RuntimeException e) {
- markInvalid();
- throw e;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IExpression#createPrimitiveLiteral(int, char)
- */
- public final void createPrimitiveLiteral(ForExpression forExpression, char value) throws IllegalStateException {
- try {
- checkForExpression(forExpression);
- pushToProxy(beanProxyFactory.createBeanProxyWith(value));
- processExpression();
- } catch (RuntimeException e) {
- markInvalid();
- throw e;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IExpression#createPrimitiveLiteral(int, byte)
- */
- public final void createPrimitiveLiteral(ForExpression forExpression, byte value) throws IllegalStateException {
- try {
- checkForExpression(forExpression);
- pushToProxy(beanProxyFactory.createBeanProxyWith(value));
- processExpression();
- } catch (RuntimeException e) {
- markInvalid();
- throw e;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IExpression#createPrimitiveLiteral(int, double)
- */
- public final void createPrimitiveLiteral(ForExpression forExpression, double value) throws IllegalStateException {
- try {
- checkForExpression(forExpression);
- pushToProxy(beanProxyFactory.createBeanProxyWith(value));
- processExpression();
- } catch (RuntimeException e) {
- markInvalid();
- throw e;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IExpression#createPrimitiveLiteral(int, float)
- */
- public final void createPrimitiveLiteral(ForExpression forExpression, float value) throws IllegalStateException {
- try {
- checkForExpression(forExpression);
- pushToProxy(beanProxyFactory.createBeanProxyWith(value));
- processExpression();
- } catch (RuntimeException e) {
- markInvalid();
- throw e;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IExpression#createPrimitiveLiteral(int, int)
- */
- public final void createPrimitiveLiteral(ForExpression forExpression, int value) throws IllegalStateException {
- try {
- checkForExpression(forExpression);
- pushToProxy(beanProxyFactory.createBeanProxyWith(value));
- processExpression();
- } catch (RuntimeException e) {
- markInvalid();
- throw e;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IExpression#createPrimitiveLiteral(int, long)
- */
- public final void createPrimitiveLiteral(ForExpression forExpression, long value) throws IllegalStateException {
- try {
- checkForExpression(forExpression);
- pushToProxy(beanProxyFactory.createBeanProxyWith(value));
- processExpression();
- } catch (RuntimeException e) {
- markInvalid();
- throw e;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IExpression#createPrimitiveLiteral(int, short)
- */
- public final void createPrimitiveLiteral(ForExpression forExpression, short value) throws IllegalStateException {
- try {
- checkForExpression(forExpression);
- pushToProxy(beanProxyFactory.createBeanProxyWith(value));
- processExpression();
- } catch (RuntimeException e) {
- markInvalid();
- throw e;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IExpression#createStringLiteral(int, java.lang.String)
- */
- public final void createStringLiteral(ForExpression forExpression, String value) throws IllegalStateException {
- try {
- checkForExpression(forExpression);
- pushToProxy(beanProxyFactory.createBeanProxyWith(value));
- processExpression();
- } catch (RuntimeException e) {
- markInvalid();
- throw e;
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IExpression#createProxyExpression(int, org.eclipse.jem.internal.proxy.core.IProxy)
- */
- public final void createProxyExpression(ForExpression forExpression, IProxy proxy) throws IllegalStateException, IllegalArgumentException {
- try {
- checkForExpression(forExpression);
- validateProxy(proxy);
- pushToProxy(proxy);
- processExpression();
- } catch (RuntimeException e) {
- markInvalid();
- throw e;
- }
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IExpression#createAssignmentExpression(int)
- */
- public final void createAssignmentExpression(ForExpression forExpression) throws IllegalStateException {
- try {
- checkForExpression(forExpression);
- push(InternalExpressionTypes.ASSIGNMENT_EXPRESSION);
-
- pushForExpression(PROCESS_EXPRESSION);
- pushForExpression(ForExpression.ASSIGNMENT_RIGHT);
- pushForExpression(ForExpression.ASSIGNMENT_LEFT);
- processExpression(); // See if previous expression is ready for processing.
- } catch (RuntimeException e) {
- markInvalid();
- throw e;
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IExpression#createAssignmentExpression(int)
- */
- public final ExpressionProxy createProxyAssignmentExpression(ForExpression forExpression) throws IllegalStateException {
- try {
- checkForExpression(forExpression);
- ExpressionProxy proxy = allocateExpressionProxy(NORMAL_EXPRESSION_PROXY);
- push(proxy);
- push(InternalExpressionTypes.ASSIGNMENT_PROXY_EXPRESSION);
-
- pushForExpression(PROCESS_EXPRESSION);
- pushForExpression(ForExpression.ASSIGNMENT_RIGHT);
- processExpression(); // See if previous expression is ready for processing.
- return proxy;
- } catch (RuntimeException e) {
- markInvalid();
- throw e;
- }
- }
-
- /**
- * Called by registries to create an expression proxy for a bean type. It is not in the interface because it should
- * only be called by the proxy registry to create an expression proxy. It shouldn't be called outside of the registries
- * because there may already exist in the registry the true IBeanTypeProxy, and that one should be used instead.
- * <p>
- * This is not customer advanced API. This API for the implementers of registries and expression subclasses.
- *
- * @param typeName
- * @return expression proxy that is hooked up and will notify when resolved. It can be called at any time. The resolution will occur at this point in the
- * execution stack, but since it will not interfere with the stack this is OK, other than it could throw a ClassNotFoundException on the
- * execution.
- *
- * @since 1.1.0
- */
- public final IProxyBeanType createBeanTypeExpressionProxy(String typeName) {
- IBeanTypeExpressionProxy proxy = (IBeanTypeExpressionProxy) allocateExpressionProxy(BEANTYPE_EXPRESSION_PROXY);
- proxy.setTypeName(typeName);
- // This can be sent at any time. It doesn't matter what is on the expression stack. It will be sent to be resolved immediately.
- pushBeanTypeToProxy(proxy);
- return proxy;
- }
-
- /**
- * Called by registries to create an expression proxy for a method. It is not in the interface because it should
- * only be called by the proxy registry to create an expression proxy. It shouldn't be called outside of the registries
- * because there may already exist in the registry the true IMethodProxy, and that one should be used instead.
- * <p>
- * This is not customer advanced API. This API for the implementers of registries and expression subclasses.
- *
- * @param declaringType
- * @param methodName
- * @param parameterTypes parameter types or <code>null</code> if no parameter types.
- * @return
- *
- * @throws IllegalArgumentException
- * @since 1.1.0
- */
- public final IProxyMethod createMethodExpressionProxy(IProxyBeanType declaringType, String methodName, IProxyBeanType[] parameterTypes) throws IllegalArgumentException{
- validateProxy(declaringType);
- if (parameterTypes != null && parameterTypes.length > 0) {
- for (int i = 0; i < parameterTypes.length; i++) {
- validateProxy(parameterTypes[i]);
- }
- }
- ExpressionProxy proxy = allocateExpressionProxy(METHOD_EXPRESSION_PROXY);
- // This can be sent at any time. It doesn't matter what is on the expression stack. It will be sent to be resolved immediately.
- pushMethodToProxy(proxy, declaringType, methodName, parameterTypes);
- return (IProxyMethod) proxy;
- }
-
- /**
- * Called by registries to create an expression proxy for a field. It is not in the interface because it should
- * only be called by the proxy registry to create an expression proxy. It shouldn't be called outside of the registries
- * because there may already exist in the registry the true IFieldProxy, and that one should be used instead.
- * <p>
- * This is not customer advanced API. This API for the implementers of registries and expression subclasses.
- *
- * @param declaringType
- * @param fieldName
- * @return
- *
- * @throws IllegalArgumentException
- * @since 1.1.0
- */
- public final IProxyField createFieldExpressionProxy(IProxyBeanType declaringType, String fieldName) throws IllegalArgumentException {
- validateProxy(declaringType);
- ExpressionProxy proxy = allocateExpressionProxy(FIELD_EXPRESSION_PROXY);
- // This can be sent at any time. It doesn't matter what is on the expression stack. It will be sent to be resolved immediately.
- pushFieldToProxy(proxy, declaringType, fieldName);
- return (IProxyField) proxy;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IExpression#createProxyReassignmentExpression(org.eclipse.jem.internal.proxy.initParser.tree.ForExpression, org.eclipse.jem.internal.proxy.core.ExpressionProxy)
- */
- public final void createProxyReassignmentExpression(ForExpression forExpression, ExpressionProxy proxy) throws IllegalStateException, IllegalArgumentException {
- try {
- checkForExpression(forExpression);
- if (!proxy.isValidForReassignment())
- throw new IllegalArgumentException(MessageFormat.format(ProxyMessages.Expression_CreateProxyReassignmentExpression_InvalidForReassignment_EXC_, new Object[]{proxy.toString()}));
- push(proxy);
- push(InternalExpressionTypes.ASSIGNMENT_PROXY_EXPRESSION);
-
- pushForExpression(PROCESS_EXPRESSION);
- pushForExpression(ForExpression.ASSIGNMENT_RIGHT);
- processExpression(); // See if previous expression is ready for processing.
- } catch (RuntimeException e) {
- markInvalid();
- throw e;
- }
- }
-
- protected static final int NORMAL_EXPRESSION_PROXY = 0;
- protected static final int BEANTYPE_EXPRESSION_PROXY = 1;
- protected static final int METHOD_EXPRESSION_PROXY = 2;
- protected static final int FIELD_EXPRESSION_PROXY = 3;
- /**
- * Allocate a new ExpressionProxy
- * @return new ExpressionProxy.
- *
- * @since 1.1.0
- */
- protected final ExpressionProxy allocateExpressionProxy(int proxyType) {
- if (expressionProxies == null)
- expressionProxies = new ArrayList();
- // It is very important that this always creates a proxy id that is greater than all previous. This is
- // so that it can be assured that proxies will be resolved in order of creation.
- // Currently this is done here by using expressionProxies.size().
- ExpressionProxy proxy = createExpressionProxy(proxyType, expressionProxies.size());
- expressionProxies.add(proxy);
- return proxy;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IExpression#createFieldAccess(org.eclipse.jem.internal.proxy.initParser.tree.ForExpression, org.eclipse.jem.internal.proxy.core.IProxyField, boolean)
- */
- public final void createFieldAccess(ForExpression forExpression, IProxyField fieldProxy, boolean hasReceiver) throws IllegalStateException, IllegalArgumentException {
- validateProxy(fieldProxy);
- pushFieldAccess(forExpression, fieldProxy, hasReceiver);
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IExpression#createMethodInvocation(org.eclipse.jem.internal.proxy.initParser.tree.ForExpression, org.eclipse.jem.internal.proxy.core.IProxyMethod, boolean, int)
- */
- public final void createMethodInvocation(ForExpression forExpression, IProxyMethod methodProxy, boolean hasReceiver, int argumentCount) throws IllegalArgumentException,
- IllegalStateException {
- validateProxy(methodProxy);
- pushMethodInvocation(forExpression, methodProxy, hasReceiver, argumentCount);
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IExpression#createSimpleFieldAccess(org.eclipse.jem.internal.proxy.core.IProxyField, org.eclipse.jem.internal.proxy.core.IProxy)
- */
- public final ExpressionProxy createSimpleFieldAccess(IProxyField field, IProxy receiver) throws IllegalStateException, IllegalArgumentException {
- validateProxy(field);
- validateProxy(receiver);
- ExpressionProxy result = createProxyAssignmentExpression(ForExpression.ROOTEXPRESSION);
- createFieldAccess(ForExpression.ASSIGNMENT_RIGHT, field, receiver != null);
- if (receiver != null)
- createProxyExpression(ForExpression.FIELD_RECEIVER, receiver);
- return result;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IExpression#createSimpleFieldSet(org.eclipse.jem.internal.proxy.core.IProxyField, org.eclipse.jem.internal.proxy.core.IProxy, org.eclipse.jem.internal.proxy.core.IProxy, boolean)
- */
- public final ExpressionProxy createSimpleFieldSet(IProxyField field, IProxy receiver, IProxy value, boolean wantResult) throws IllegalStateException, IllegalArgumentException {
- validateProxy(field);
- validateProxy(receiver);
- ExpressionProxy result = null;
- ForExpression forExpression = ForExpression.ROOTEXPRESSION;
- if (wantResult) {
- result = createProxyAssignmentExpression(forExpression);
- forExpression = ForExpression.ASSIGNMENT_RIGHT;
- }
- createAssignmentExpression(forExpression);
- createFieldAccess(ForExpression.ASSIGNMENT_LEFT, field, receiver != null);
- if (receiver != null)
- createProxyExpression(ForExpression.FIELD_RECEIVER, receiver);
- createProxyExpression(ForExpression.ASSIGNMENT_RIGHT, value);
- return result;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IExpression#createSimpleMethodInvoke(org.eclipse.jem.internal.proxy.core.IMethodProxy, org.eclipse.jem.internal.proxy.core.IProxy, org.eclipse.jem.internal.proxy.core.IProxy[], boolean)
- */
- public final ExpressionProxy createSimpleMethodInvoke(IProxyMethod method, IProxy receiver, IProxy[] arguments, boolean wantResult)
- throws IllegalStateException, IllegalArgumentException {
- validateProxy(method);
- validateProxy(receiver);
- if (arguments != null && arguments.length > 0) {
- for (int i = 0; i < arguments.length; i++) {
- validateProxy(arguments[i]);
- }
- }
- ForExpression nextExpression = ForExpression.ROOTEXPRESSION;
- ExpressionProxy result = null;
- if (wantResult) {
- result = createProxyAssignmentExpression(nextExpression);
- nextExpression = ForExpression.ASSIGNMENT_RIGHT;
- }
- createMethodInvocation(nextExpression, method, receiver != null, arguments != null ? arguments.length : 0);
- if (receiver != null)
- createProxyExpression(ForExpression.METHOD_RECEIVER, receiver);
- if (arguments != null) {
- for (int i = 0; i < arguments.length; i++) {
- createProxyExpression(ForExpression.METHOD_ARGUMENT, arguments[i]);
- }
- }
- return result;
- }
-
- private int subexpressionNumber = -1; // Current subexpression number. This is always incrementing.
-
- public void createSubexpression() throws IllegalStateException {
- try {
- // Subexpressions are special, they can be anywhere.
- pushForExpression(PROCESS_EXPRESSION);
- pushForExpression(SUBEXPRESSIONEND_EXPRESSION);
- pushForExpression(ForExpression.ROOTEXPRESSION);
-
- pushSubexpressionBeginToProxy(++subexpressionNumber);
- push(new Integer(subexpressionNumber));
- push(InternalExpressionTypes.SUBEXPRESSION_END_EXPRESSION);
- processExpression();
- return;
- } catch (RuntimeException e) {
- markInvalid();
- throw e;
- }
- }
-
- public void createSubexpressionEnd() throws IllegalStateException {
- try {
- checkForExpression(ForExpression.ROOTEXPRESSION);
- popForExpression(); // Remove the root expression since block is done.
- checkForExpression(SUBEXPRESSIONEND_EXPRESSION); // This needs to be next for it to be valid.
- processExpression(); // Now let it handle the previously pushed end subexpression, containing the subexpression number being ended.
- } catch (RuntimeException e) {
- markInvalid();
- throw e;
- }
- }
-
-
- private int tryNumber = -1; // Current try number. This is always incrementing.
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IExpression#createTry()
- */
- public final void createTry() throws IllegalStateException {
- try {
- checkForExpression(ForExpression.ROOTEXPRESSION);
- pushForExpression(PROCESS_EXPRESSION); // Set up so that when reached we can process the TRY_END that we've pushed data for later in this method.
- pushForExpression(TRYEND_EXPRESSION); // Must get a try end before we can process it.
- pushForExpression(TRYCATCH_EXPRESSION); // Must get a catch/finally clause (or try end, which knows how to handle this).
- pushForExpression(ForExpression.ROOTEXPRESSION); // Expecting root expressions for the try clause.
-
- pushTryBeginToProxy(++tryNumber);
- push(new Integer(tryNumber));
- push(InternalExpressionTypes.TRY_END_EXPRESSION);
- processExpression();
- } catch (RuntimeException e) {
- markInvalid();
- throw e;
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IExpression#createTryCatchClause(org.eclipse.jem.internal.proxy.core.IProxyBeanType, boolean)
- */
- public final ExpressionProxy createTryCatchClause(IProxyBeanType exceptionType, boolean wantExceptionReturned)
- throws IllegalStateException, IllegalArgumentException {
- validateProxy(exceptionType);
- return pushTryCatch(exceptionType, wantExceptionReturned);
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IExpression#createTryCatchClause(java.lang.String, boolean)
- */
- public final ExpressionProxy createTryCatchClause(String exceptionType, boolean wantExceptionReturned)
- throws IllegalStateException {
- return pushTryCatch(getProxyBeanType(exceptionType), wantExceptionReturned);
- }
-
- /**
- * @param exceptionType
- * @param wantExceptionReturned
- * @return
- * @throws IllegalStateException
- *
- * @since 1.1.0
- */
- private ExpressionProxy pushTryCatch(IProxyBeanType exceptionType, boolean wantExceptionReturned) throws IllegalStateException {
- try {
- checkForExpression(ForExpression.ROOTEXPRESSION);
- popForExpression(); // Remove the root expression since try or previous catch clause is done.
- checkForExpression(TRYCATCH_EXPRESSION); // This needs to be next for it to be valid.
- pushForExpression(TRYCATCH_EXPRESSION); // Set up for a following catch/finally clause.
- pushForExpression(ForExpression.ROOTEXPRESSION); // Root expressions are next for the catch clause.
-
- int tryNumber = ((Integer) peek(2)).intValue(); // Get the try#. It should be in this place on the stack.
-
- ExpressionProxy ep = null;
- if (wantExceptionReturned)
- ep = allocateExpressionProxy(NORMAL_EXPRESSION_PROXY);
- pushTryCatchClauseToProxy(tryNumber, exceptionType, ep);
-
- processExpression();
- return ep;
- } catch (RuntimeException e) {
- markInvalid();
- throw e;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IExpression#createTryEnd()
- */
- public final void createTryEnd() throws IllegalStateException {
- try {
- checkForExpression(ForExpression.ROOTEXPRESSION);
- popForExpression(); // Remove the root expression since try or previous catch clause is done.
- if (peekForExpression(TRYCATCH_EXPRESSION))
- checkForExpression(TRYCATCH_EXPRESSION); // This may of been next if no finally clause was added. If a finally clause was added this would not be here.
- checkForExpression(TRYEND_EXPRESSION); // And this needs to be after that to be valid.
-
- processExpression();
- } catch (RuntimeException e) {
- markInvalid();
- throw e;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IExpression#createTryFinallyClause()
- */
- public final void createTryFinallyClause() throws IllegalStateException {
- try {
- checkForExpression(ForExpression.ROOTEXPRESSION);
- popForExpression(); // Remove the root expression since try or previous catch clause is done.
- checkForExpression(TRYCATCH_EXPRESSION); // This needs to be next for it to be valid.
- pushForExpression(ForExpression.ROOTEXPRESSION); // Root expressions are next for the finally clause.
-
- int tryNumber = ((Integer) peek(2)).intValue(); // Get the try#. It should be in this place on the stack.
-
- pushTryFinallyClauseToProxy(tryNumber);
- processExpression();
- } catch (RuntimeException e) {
- markInvalid();
- throw e;
- }
- }
-
-
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IExpression#createRethrow()
- */
- public final void createRethrow() throws IllegalStateException {
- try {
- checkForExpression(ForExpression.ROOTEXPRESSION);
- popForExpression(); // Remove the root expression since try or previous catch clause is done.
- checkForExpression(TRYCATCH_EXPRESSION); // This needs to be next for it to be valid.
- // It is in a valid state, so put the catch and root back on so that things work correctly.
- pushForExpression(TRYCATCH_EXPRESSION);
- pushForExpression(ForExpression.ROOTEXPRESSION);
-
- int tryNumber = ((Integer) peek(2)).intValue(); // Get the try#. It should be in this place on the stack.
-
- pushRethrowToProxy(tryNumber);
- processExpression();
- } catch (RuntimeException e) {
- markInvalid();
- throw e;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IExpression#createThrow()
- */
- public final void createThrow() throws IllegalStateException {
- try {
- checkForExpression(ForExpression.ROOTEXPRESSION);
- push(InternalExpressionTypes.THROW_EXPRESSION);
- pushForExpression(PROCESS_EXPRESSION);
- pushForExpression(ForExpression.THROW_OPERAND); // The next expression must be for the throw value.
- processExpression();
- } catch (RuntimeException e) {
- markInvalid();
- throw e;
- }
- }
-
-
- public final int mark() throws IllegalStateException {
- try {
- checkForExpression(ForExpression.ROOTEXPRESSION);
- ++highestMarkID;
- currentMarkEntry = new MarkEntry();
- currentMarkEntry.markID = highestMarkID;
- currentMarkEntry.controlStackPos = controlStack.size() - 1;
- currentMarkEntry.nextExpressionStackPos = nextForExpressionStackPos;
- currentMarkEntry.expressionProxiesPos = expressionProxies != null ? expressionProxies.size() - 1 : -1;
- if (markEntries == null)
- markEntries = new ArrayList(5);
- markEntries.add(currentMarkEntry);
- pushMarkToProxy(highestMarkID);
- return highestMarkID;
- } catch (RuntimeException e) {
- markInvalid();
- throw e;
- }
- }
-
- public void endMark(int markNumber) throws IllegalStateException {
- if (isValid()) {
- // Can only do a valid end mark if we are at root. If not at root, we fall through and treat as invalid.
- if (peekForExpression(ForExpression.ROOTEXPRESSION)) {
- checkForExpression(ForExpression.ROOTEXPRESSION); // Now remove it if it should be removed.
- // If the current mark number is not the same as the incoming mark number, we have improper nesting.
- if (currentMarkEntry == null || currentMarkEntry.markID != markNumber)
- throwInvalidMarkNesting(); // We have improper nesting.
- // We are popping the current mark. Since we are valid, just move up one in the mark stack.
- MarkEntry me = (MarkEntry) markEntries.remove(markEntries.size()-1);
- if (!markEntries.isEmpty())
- currentMarkEntry = (MarkEntry) markEntries.get(markEntries.size()-1);
- else
- currentMarkEntry = null;
- pushEndmarkToProxy(markNumber, false);
- if (me.controlStackPos != controlStack.size()-1 || me.nextExpressionStackPos != nextForExpressionStackPos)
- throwInvalidMarkNesting(); // The stacks should be back to the same size at this point for a valid end mark.
- return;
- }
- }
-
- // It was invalid, or became invalid.
- if (markEntries == null)
- throwInvalidMarkNesting(); // We have no marks, so this is an invalid end mark.
-
- // We are invalid, need to pop to the given markNumber.
- // Starting from the end we search back to find the entry for the given mark number. We do it
- // from the end because it is more likely to be closer to the end than to the beginning.
- for (int i = markEntries.size()-1; i >=0; i--) {
- MarkEntry me = (MarkEntry) markEntries.get(i);
- if (me.markID == markNumber) {
- // Found it.
- // Trim the control stack down to the size at time of mark. (No easy way to do this other than repeated remove's.
- // We do it backwards to eliminate repeated shuffling of entries.
- for (int j = controlStack.size()-1; j > me.controlStackPos; j--) {
- controlStack.remove(j);
- }
-
- // Trim the expression stack. This is simple, just reset the next entry pointer.
- nextForExpressionStackPos = me.nextExpressionStackPos;
-
- if (expressionProxies != null) {
- // Now we need to mark all of the expression proxies that occured after the mark as
- // not resolved (since someone may be listening), and remove them, and reuse the proxies.
- for (int j = expressionProxies.size()-1; j > me.expressionProxiesPos; j--) {
- ExpressionProxy proxy = (ExpressionProxy) expressionProxies.remove(j);
- if (proxy != null && proxy.hasListeners())
- fireProxyNotResolved(proxy);
- }
- }
-
- // Now that we know it is valid, we want to remove all of the mark entries above it in the stack
- // since those are now invalid. We couldn't remove them as we were searching for the entry because
- // if the entry wasn't found we didn't want to wipe out the probably valid ones.
- for (int j = markEntries.size()-1; j >= i; j--) {
- markEntries.remove(j);
- }
-
- if (!markEntries.isEmpty())
- currentMarkEntry = (MarkEntry) markEntries.get(markEntries.size()-1);
- else
- currentMarkEntry = null;
- pushEndmarkToProxy(markNumber, true);
- expressionValid = true;
- return;
- }
- }
- throwInvalidMarkNesting(); // The mark number wasn't found, so this is an invalid end mark.
- }
-
- /**
- * Begin the transfer of the expression to another thread.
- * <p>
- * This is used when the expression needs to continue to be built up, but it needs
- * to be done on a different thread. The reason for doing something special other
- * than just using it on the other thread is that some proxy registries connections are
- * tied through the thread. If you switched to another thread the connections would not
- * be properly set up.
- * This is not on the IExpression interface because even though it is API, it is tricky
- * to use and so not exposed to everyone. Users can legitimately cast to Expression and
- * use this as API for advanced use.
- * <p>
- * This is used to begin the transfer. It puts it into a state ready for the transfer. Calling this
- * method will cause a synchronization of the expression up to the current level. This means
- * that it will not return until the expression has been completely processed in the proxy registry
- * up to this point. Typically the connection is a pipe where the instructions are just pushed onto
- * it and the caller is not held up waiting for the registry to process it.
- * <p>
- * Then when the other thread is done, it will call beginTransferThread itself to signal that it is done
- * and that the old thread can pick it up. Then the old thread will call transferThread to pick up processing.
- * <p>
- * It will be:
- * <pre><code>
- * ... expression stuff ...
- * expression.beginTransferThread()
- * ... do what is necessary to get to the other thread ...
- * ... on other thread:
- * expression.transferThread();
- * try {
- * ... do your expression stuff on this thread ...
- * } finally {
- * expression.beginTransferThread(); // This is to return it to old thread.
- * }
- * ... tell old thread to pick up ...
- * ... back on old thread:
- * expression.transferThread();
- * ... do more expression stuff ...
- * expression.invokeExpression();
- * </code></pre>
- *
- * @throws IllegalStateException
- * @throws ThrowableProxy Thrown if there was an exception with the remote vm during this request.
- * @since 1.1.0
- */
- public final void beginTransferThread() throws IllegalStateException, ThrowableProxy {
- try {
- pushForExpression(THREADTRANSFER_EXPRESSION);
- pushBeginTransferThreadToProxy();
- } catch (RuntimeException e) {
- markInvalid();
- throw e;
- }
- }
-
- /**
- * Transfer the expression to the current thread.
- * <p>
- * This is called to actually transfer to the current thread. It must be the next call against
- * the expression after the beginTransferThread, but on the new thread.
- * <p>
- * This is not on the IExpression interface because even though it is API, it is tricky
- * to use and so not exposed to everyone. Users can legitimately cast to Expression and
- * use this as API for advanced use.
- * @see Expression#beginTransferThread() for a full explanation.
- * @throws IllegalStateException
- *
- * @since 1.1.0
- */
- public final void transferThread() throws IllegalStateException {
- try {
- checkForExpression(THREADTRANSFER_EXPRESSION);
- pushTransferThreadToProxy();
- } catch (RuntimeException e) {
- markInvalid();
- throw e;
- }
- }
-
-
- /**
- * Get the IProxyBeanType for the type string sent in.
- * @param type
- * @return
- *
- * @since 1.1.0
- */
- protected IProxyBeanType getProxyBeanType(String type) {
- return getRegistry().getBeanTypeProxyFactory().getBeanTypeProxy(this, type);
- }
-
- /**
- * Create the expression proxy subclass that is applicable for this kind of processor.
- * @param proxyType type of proxy. {@link Expression#NORMAL_EXPRESSION_PROXY
- * @param proxyID the id of the new expression proxy.
- *
- * @return
- *
- * @since 1.1.0
- */
- protected abstract ExpressionProxy createExpressionProxy(int proxyType, int proxyID);
-
- /**
- * Push this proxy to the other side. It will simply take the proxy and push it onto
- * its evaluation stack. It will be treated as the result of an expression. It's just
- * that the expression was evaluatable on this side (since it is already a proxy).
- *
- * @param proxy
- *
- * @since 1.0.0
- */
- protected abstract void pushToProxy(IProxy proxy);
-
- /**
- * Tell the other side we are complete. This will always be called after expression evaluation, or
- * if expression was prematurely closed.
- * <p>
- * <b>Note:</b> The implementation must be able to handle multiple invocations, where the first call is a valid close and any
- * subsequent call should be ignored.
- *
- * @throws ThrowableProxy
- *
- * @since 1.0.0
- */
- protected abstract void closeProxy();
-
- /**
- * Do invoke. This should simply make sure everything is done and throw any pending errors.
- * <p>
- * <b>Note:</b> The expression proxies MUST be resolved (callbacks called) in the order they are found in the expressionProxies list. This
- * is so that the contract is followed that resolution notifications will occur in the order of creation.
- *
- * @param proxycount Number of Expression Proxies that need a callback.
- * @param list of expression proxies. If proxycount > 0, then process the non-null entries in the list. They will be of type ExpressionProxy.
- * @throws ThrowableProxy
- *
- * @since 1.0.0
- */
- protected abstract void pushInvoke(int proxycount, List expressionProxies) throws ThrowableProxy, NoExpressionValueException;
-
- /**
- * Pull the top expression value from the evaluation stack. It will also under
- * the covers call closeProxy. It also must process the expression proxy callbacks. It must do the expression proxy callbacks first, and then
- * process the result value. If an error had occured sometime during processing, it should still process the proxy callbacks before throwing
- * an exception.
- * <p>
- * <b>Note:</b> The expression proxies MUST be resolved (callbacks called) in the order they are found in the expressionProxies list. This
- * is so that the contract is followed that resolution notifications will occur in the order of creation. Also <b>REQUIRED</b> is that
- * the entire list must be processed of proxies must be processed by this call. It cannot do some or none.
- *
- * @param proxycount Number of Expression Proxies that need a callback.
- * @param list of expression proxies. If proxycount > 0, then process the non-null entries in the list. They will be of type ExpressionProxy.
- * @return The top level evaluation stack value.
- * @throws ThrowableProxy
- * @throws NoExpressionValueException
- *
- * @since 1.0.0
- */
- protected abstract IBeanProxy pullProxyValue(int proxycount, List expressionProxies) throws ThrowableProxy, NoExpressionValueException;
-
- /**
- * Push to proxy the cast expression. The expression to use will be on the top of its evaluation stack.
- * The result of the cast expression will be placed onto the evaluation stack.
- *
- * @param type Cast type.
- *
- * @since 1.0.0
- */
- protected abstract void pushCastToProxy(IProxyBeanType type);
-
- /**
- * Push to proxy the instanceof expression. The expression to use will be on the top of its evaluation stack.
- * The result of the instanceof expression will be placed onto the evaluation stack.
- *
- * @param type Instanceof type.
- *
- * @since 1.0.0
- */
- protected abstract void pushInstanceofToProxy(IProxyBeanType type);
-
- /**
- * Push to proxy the infix operation. This is called on the completion of each operand of the expression.
- * So it will be called a minimum of two times.
- *
- * @param operator The operator.
- * @param operandType The operand type. left, other, or last.
- *
- * @since 1.0.0
- */
- protected abstract void pushInfixToProxy(InfixOperator operator, InternalInfixOperandType operandType);
-
- /**
- * Push to proxy the prefix expression. The expression to use will be on top of its evaluation stack.
- * The result of the prefix operation will be placed onto the evaluation stack.
- *
- * @param operator
- *
- * @see IExpressionConstants#PRE_MINUS
- * @since 1.0.0
- */
- protected abstract void pushPrefixToProxy(PrefixOperator operator);
-
-
- /**
- * Push to proxy the array access. The result will be placed onto the evaluation stack.
- *
- * @param indexCount
- *
- * @since 1.0.0
- */
- protected abstract void pushArrayAccessToProxy(int indexCount);
-
- /**
- * Push to proxy the array creation. The result will be placed onto the evaluation stack.
- * @param type The array type.
- * @param dimensionCount
- *
- * @since 1.0.0
- */
- protected abstract void pushArrayCreationToProxy(IProxyBeanType type, int dimensionCount);
-
- /**
- * Push to proxy the array initializer. The resulting array will be placed onto the evaluation stack.
- * @param type The array type. (must be an array type).
- * @param stripDimCount the number of dimensions that must be stripped from the array type. This is needed
- * because the first array initializer needs to be for the component type of the array (array minus one dimension), and
- * each initializer after that needs one more dimension stripped off. But since we are working with possible expression
- * proxies for "type", we can't create the appropriate component types of the array. So we need to tell the
- * processor how many dims to strip from the original type (which is what is sent in on every initializer push, the original type).
- * @param expressionCount
- *
- * @since 1.0.0
- */
- protected abstract void pushArrayInitializerToProxy(IProxyBeanType type, int stripDimCount, int expressionCount);
-
- /**
- * Push to proxy the class instance creation. The resulting class instance will be placed onto the evaluation stack.
- *
- * @param type Class type.
- * @param argumentCount The number of arguments.
- *
- * @since 1.0.0
- */
- protected abstract void pushClassInstanceCreationToProxy(IProxyBeanType type, int argumentCount);
-
- /**
- * Push to proxy the type receiver. The resulting class will be placed onto the evaluation stack, along with it also
- * being the expression type.
- * @param type Class type.
- *
- * @since 1.0.0
- */
- protected abstract void pushTypeReceiverToProxy(IProxyBeanType type);
-
- /**
- * Push to proxy the field access. The result value will be placed onto the evaluation stack.
- * @param field The name of the field if string, or an IFieldProxy.
- * @param hasReceiver Has receiver flag.
- *
- * @since 1.0.0
- */
- protected abstract void pushFieldAccessToProxy(Object field, boolean hasReceiver);
-
- /**
- * Push to proxy the method invocation. The result value will be placed onto the evaluation stack.
- *
- * @param method String for method name or IProxyMethod
- * @param hasReceiver
- * @param argCount
- *
- * @since 1.0.0
- */
- protected abstract void pushMethodInvocationToProxy(Object method, boolean hasReceiver, int argCount);
-
- /**
- * Push to proxy the conditional expression. This will be called on each part of expression. The expression type
- * will be the current part (e.g. test, true, false).
- *
- * @param expressionType The expression type.
- *
- * @since 1.0.0
- */
- protected abstract void pushConditionalToProxy(InternalConditionalOperandType expressionType);
-
- /**
- * Push to the proxy the expression proxy. Whatever the last expression value is will be assigned to the ExpressionProxy.
- *
- * @param proxy
- *
- * @since 1.1.0
- */
- protected abstract void pushAssignmentToProxy(ExpressionProxy proxy);
-
- /**
- * Push the assignment expression. The operands are already on the stack.
- *
- * @since 1.1.0
- */
- protected abstract void pushAssignmentToProxy();
-
-
- /**
- * Push the begin block expression.
- * @param blockNumber
- *
- * @since 1.1.0
- */
- protected abstract void pushBlockBeginToProxy(int blockNumber);
-
- /**
- * Push the end block expression.
- * @param blockNumber
- *
- * @since 1.1.0
- */
- protected abstract void pushBlockEndToProxy(int blockNumber);
-
- /**
- * Push the break block expression.
- * @param blockNumber
- *
- * @since 1.1.0
- *
- */
- protected abstract void pushBlockBreakToProxy(int blockNumber);
-
- /**
- * Push the begin try expression.
- * @param tryNumber
- *
- * @since 1.1.0
- */
- protected abstract void pushTryBeginToProxy(int tryNumber);
-
- /**
- * Push the catch clause to proxy.
- * @param tryNumber
- * @param exceptionType
- * @param ep ExpressionProxy to be assigned with the exception or <code>null</code> if exception is not to be assigned.
- *
- * @since 1.1.0
- */
- protected abstract void pushTryCatchClauseToProxy(int tryNumber, IProxyBeanType exceptionType, ExpressionProxy ep);
-
- /**
- * Push the finally clause to proxy.
- * @param tryNumber
- *
- * @since 1.1.0
- */
- protected abstract void pushTryFinallyClauseToProxy(int tryNumber);
-
- /**
- * Push try end to proxy.
- * @param tryNumber
- *
- * @since 1.1.0
- */
- protected abstract void pushTryEndToProxy(int tryNumber);
-
- /**
- * Push the throw of the exception to proxy.
- * @param exception
- *
- * @since 1.1.0
- */
- protected abstract void pushThrowToProxy();
-
- /**
- * Push a rethrow to proxy.
- * @param tryNumber
- *
- * @since 1.1.0
- */
- protected abstract void pushRethrowToProxy(int tryNumber);
-
- /**
- * Push the BeanType Expression proxy to be resolved on the execution side.
- * @param proxy
- *
- * @since 1.1.0
- */
- protected abstract void pushBeanTypeToProxy(IBeanTypeExpressionProxy proxy);
-
- /**
- * Push the Method Expression proxy to be resolved on the execution side.
- * @param proxy
- * @param declaringType
- * @param methodName
- * @param parameterTypes parameter types or <code>null</code> if no parameters.
- *
- * @since 1.1.0
- */
- protected abstract void pushMethodToProxy(ExpressionProxy proxy, IProxyBeanType declaringType, String methodName, IProxyBeanType[] parameterTypes);
-
- /**
- * Push the Field Expression Proxy to be resolved on the execution side.
- * @param proxy
- * @param declaringType
- * @param fieldName
- *
- * @since 1.1.0
- */
- protected abstract void pushFieldToProxy(ExpressionProxy proxy, IProxyBeanType declaringType, String fieldName);
-
- /**
- * Push the If test condition to proxy.
- *
- * @since 1.1.0
- */
- protected abstract void pushIfTestToProxy();
-
- /**
- * Push a true or else clause to proxy.
- * @param clauseType
- *
- * @since 1.1.0
- */
- protected abstract void pushIfElseToProxy(InternalIfElseOperandType clauseType);
-
- /**
- * Push to proxy a new instance using an initialization string.
- * @param initializationString
- * @param resultType
- *
- * @since 1.1.0
- */
- protected abstract void pushNewInstanceToProxy(String initializationString, IProxyBeanType resultType);
-
- /**
- * Push the mark id to proxy.
- *
- * @param markID
- *
- * @since 1.1.0
- */
- protected abstract void pushMarkToProxy(int markID);
-
- /**
- * Push the end mark id to proxy.
- *
- * @param markID
- * @param restore <code>true</code> if this is a restore due to error, <code>false</code> if this is just a normal end mark.
- *
- * @since 1.1.0
- */
- protected abstract void pushEndmarkToProxy(int markID, boolean restore);
-
- /**
- * Push the begin transfer thread to proxy.
- *
- *
- * @since 1.1.0
- */
- protected abstract void pushBeginTransferThreadToProxy() throws ThrowableProxy;
-
- /**
- * Push the actual transfer to the current thread to proxy.
- *
- *
- * @since 1.1.0
- */
- protected abstract void pushTransferThreadToProxy();
-
- /**
- * Push the subexpression begin to proxy.
- * @param subexpressionNumber
- *
- * @since 1.1.0
- */
- protected abstract void pushSubexpressionBeginToProxy(int subexpressionNumber);
-
- /**
- * Push the subexpression end to proxy.
- * @param subexpressionNumber
- *
- * @since 1.1.0
- */
- protected abstract void pushSubexpressionEndToProxy(int subexpressionNumber);
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/ExpressionProxy.java b/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/ExpressionProxy.java
deleted file mode 100644
index ec12faad8..000000000
--- a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/ExpressionProxy.java
+++ /dev/null
@@ -1,349 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 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.jem.internal.proxy.core;
-
-import java.util.EventObject;
-import java.util.logging.Level;
-
-
-/**
- * This is a proxy for an IExpression evaluation value. It is used as a place holder proxy value for result of an expression, and
- * then the value can be used in a later expression, or at the end, it can callback and return a proxy in the IDE
- * side in a callback for usage later on outside of the IExpression.
- * <p>
- * After receiving the resolved event, listeners should not hold onto the ExpressionProxy because it would then be invalid. At that
- * point they should instead hold onto the resolved bean proxy.
- *
- * @see org.eclipse.jem.internal.proxy.core.IExpression#assignExpressionProxy()
- * @see org.eclipse.jem.internal.proxy.core.IExpression#createExpressionProxyExpression(int, ExpressionProxy)
- * @since 1.1.0
- */
-public class ExpressionProxy implements IProxy {
-
- public ProxyFactoryRegistry getProxyFactoryRegistry() {
- return getExpression().getRegistry();
- }
-
- /**
- * The event object for the resolved event of the proxy listener.
- * <p>
- * The source will be the ExpressionProxy that is being resolved.
- * @since 1.1.0
- */
- public static class ProxyEvent extends EventObject {
-
- /**
- * Comment for <code>serialVersionUID</code>
- *
- * @since 1.1.0
- */
- private static final long serialVersionUID = -2305781662465107377L;
- private final IBeanProxy proxy;
-
- /**
- * @param source the expression proxy for the event.
- * @param proxy the bean proxy the expression proxy (source) resolved to.
- *
- * @since 1.1.0
- */
- public ProxyEvent(ExpressionProxy source, IBeanProxy proxy) {
- super(source);
- this.proxy = proxy;
- }
-
- /**
- * Construct the event with no proxy. Used for not resolved and void.
- * @param source
- *
- * @since 1.1.0
- */
- public ProxyEvent(ExpressionProxy source) {
- this(source, null);
- }
-
- /**
- * Get the proxy value that the expression proxy (source) resolved to.
- * @return
- *
- * @since 1.1.0
- */
- public IBeanProxy getProxy() {
- return proxy;
- }
- }
-
- /**
- * Listener for expression proxy events.
- *
- * @since 1.1.0
- */
- public interface ProxyListener {
- /**
- * The expression proxy has been resolved. The event contains the resolved proxy.
- * At this point, any listeners should no longer hold onto the ExpressionProxy
- * because it is now invalid. They should hold onto the resolved bean proxy instead.
- *
- * @param event
- *
- * @since 1.1.0
- */
- public void proxyResolved(ProxyEvent event);
-
- /**
- * This is called for ExpressionProxies that have a callback listener, but the proxy
- * was never resolved. This means that the expression that assigns to the proxy was
- * not executed. In this case the event does not have a bean proxy in it.
- *
- * @param event
- *
- * @since 1.1.0
- */
- public void proxyNotResolved(ProxyEvent event);
-
- /**
- * This is called for ExpressionProxies that were assigned to an expression that
- * had a <code>VOID</code> return type. This is usually for method invocations that
- * have a void return type. In this case the event does not have a bean proxy in it.
- * @param event
- *
- * @since 1.1.0
- */
- public void proxyVoid(ProxyEvent event);
- }
-
- /**
- * An implementation of ProxyListener that does nothing. It can be
- * used as a superclass for individual listeners that are only interested
- * in some of the events.
- *
- * @since 1.1.0
- */
- public static class ProxyAdapter implements ProxyListener {
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.ExpressionProxy.ProxyListener#proxyNotResolved(org.eclipse.jem.internal.proxy.core.ExpressionProxy.ProxyEvent)
- */
- public void proxyNotResolved(ProxyEvent event) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.ExpressionProxy.ProxyListener#proxyResolved(org.eclipse.jem.internal.proxy.core.ExpressionProxy.ProxyEvent)
- */
- public void proxyResolved(ProxyEvent event) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.ExpressionProxy.ProxyListener#proxyVoid(org.eclipse.jem.internal.proxy.core.ExpressionProxy.ProxyEvent)
- */
- public void proxyVoid(ProxyEvent event) {
- }
- }
-
- final private int proxyID;
- final private int proxyType;
- private ListenerList listenerList;
- private Expression expression;
-
- /**
- * Create with the given proxy id.
- * @param proxyid
- *
- * @since 1.1.0
- */
- public ExpressionProxy(int proxyid, int proxyType, Expression expression) {
- this.proxyID = proxyid;
- this.proxyType = proxyType;
- this.expression = expression;
- }
-
- /**
- * Get the expression this proxy is for.
- * @return
- *
- * @since 1.1.0
- */
- public Expression getExpression() {
- return expression;
- }
-
- /**
- * Used internally in expression to get the proxy type.
- * @return
- *
- * @since 1.1.0
- */
- protected final int getProxyType() {
- return proxyType;
- }
-
- /**
- * Return the proxy id.
- * @return
- *
- * @since 1.1.0
- */
- public final int getProxyID() {
- return proxyID;
- }
-
- /**
- * Add a listener. If listener already added, it has no effect.
- * @param listener
- *
- * @since 1.1.0
- */
- public void addProxyListener(ProxyListener listener) {
- if (listenerList == null)
- listenerList = new ListenerList();
- listenerList.add(listener);
- }
-
- /**
- * Remove a listener. If listener not already added, then no error.
- * @param listener
- *
- * @since 1.1.0
- */
- public void removeProxyListener(ProxyListener listener) {
- if (listenerList != null)
- listenerList.remove(listener);
- }
-
- /**
- * Used by internal subclasses or Expression to know if anyone is listening.
- * @return
- *
- * @since 1.1.0
- */
- protected final boolean hasListeners() {
- return listenerList != null && !listenerList.isEmpty();
- }
-
- /**
- * The proxy has been fired (one of the events has occurred). Subclasses should clean
- * up and not hold onto anything that would be expensive in case the proxy is still
- * held onto be someone. For example the default clears the listener list.
- * <p>
- * <b>Note:</b> Subclasses must call super.dispose().
- *
- * @since 1.1.0
- */
- protected void dispose() {
- listenerList = null;
- expression = null;
- }
-
- /**
- * Used by internal subclasses or by Expression to fire the resolved event. Once fired all listeners are removed.
- * This is because only one kind of firing can be done for a expression proxy and then the proxy is dead. This
- * prevents listeners from being held on to if any one accidently still holds the proxy.
- * @param proxy
- *
- * @since 1.1.0
- */
- protected void fireResolved(IBeanProxy proxy) {
- if (hasListeners()) {
- ProxyEvent event = new ProxyEvent(this, proxy);
- Object[] listeners = listenerList.getListeners();
- for (int i = 0; i < listeners.length; i++) {
- try {
- ((ProxyListener) listeners[i]).proxyResolved(event);
- } catch (RuntimeException e) {
- ProxyPlugin.getPlugin().getLogger().log(e, Level.WARNING);
- }
- }
- }
- dispose();
- }
-
- /**
- * Used by internal subclasses or by Expression to fire the not resolved event. Once fired all listeners are removed.
- * This is because only one kind of firing can be done for a expression proxy and then the proxy is dead. This
- * prevents listeners from being held on to if any one accidently still holds the proxy.
- *
- * @since 1.1.0
- */
- protected void fireNotResolved() {
- if (hasListeners()) {
- ProxyEvent event = new ProxyEvent(this);
- Object[] listeners = listenerList.getListeners();
- for (int i = 0; i < listeners.length; i++) {
- try {
- ((ProxyListener) listeners[i]).proxyNotResolved(event);
- } catch (RuntimeException e) {
- ProxyPlugin.getPlugin().getLogger().log(e, Level.WARNING);
- }
-
- }
- }
- dispose();
- }
-
- /**
- * Used by internal subclasses or by Expression to fire the void resolved event. Once fired all listeners are removed.
- * This is because only one kind of firing can be done for a expression proxy and then the proxy is dead. This
- * prevents listeners from being held on to if any one accidently still holds the proxy.
- *
- * @since 1.1.0
- */
- protected void fireVoidResolved() {
- if (hasListeners()) {
- ProxyEvent event = new ProxyEvent(this);
- Object[] listeners = listenerList.getListeners();
- for (int i = 0; i < listeners.length; i++) {
- try {
- ((ProxyListener) listeners[i]).proxyVoid(event);
- } catch (RuntimeException e) {
- ProxyPlugin.getPlugin().getLogger().log(e, Level.WARNING);
- }
-
- }
- }
- dispose();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IProxy#isBeanProxy()
- */
- public final boolean isBeanProxy() {
- return false;
- }
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IProxy#isExpressionProxy()
- */
- public final boolean isExpressionProxy() {
- return true;
- }
-
- /**
- * Is this proxy valid for reassignment. By default only if the type is NORMAL_EXPRESSION_PROXY.
- * Subclasses may override and return true in their cases.
- *
- * @return
- *
- * @since 1.1.0
- */
- public boolean isValidForReassignment() {
- return getProxyType() == Expression.NORMAL_EXPRESSION_PROXY;
- }
-
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- public String toString() {
- return super.toString()+": "+getProxyID(); //$NON-NLS-1$
- }
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IAccessibleObjectProxy.java b/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IAccessibleObjectProxy.java
deleted file mode 100644
index d563228b9..000000000
--- a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IAccessibleObjectProxy.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.core;
-/*
-
-
- */
-
-/**
- * Proxy for an AccessibleObject.
- *
- * @since 1.0.0
- */
-public interface IAccessibleObjectProxy extends IBeanProxy {
-
- /**
- * Is the proxy accessible or not?
- *
- * @return <code>true</code> if accessible.
- */
- public boolean isAccessible() throws ThrowableProxy;
-
- /**
- * Set the accessible flag on the proxy.
- *
- * @param flag <code>true</code> if accessible.
- * @throws ThrowableProxy
- */
- public void setAccessible(boolean flag) throws ThrowableProxy;
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IArrayBeanProxy.java b/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IArrayBeanProxy.java
deleted file mode 100644
index 8bdbaa278..000000000
--- a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IArrayBeanProxy.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.core;
-/*
-
-
- */
-
-
-/**
- * Proxy wrappering an array.
- */
-public interface IArrayBeanProxy extends IBeanProxy {
- /**
- * Get the object at the specified index.
- */
- IBeanProxy get(int index) throws ThrowableProxy;
-
- IBeanProxy getCatchThrowableException(int index);
-
- /**
- * Get the object at the specified multi-dimensional index.
- * The array must be at least the number of dimensions specified,
- * and each index along the way must exist.
- * The number of dimensions can't be greater than the number
- * of dimensions of the real object.
- */
- IBeanProxy get(int [] indexes) throws ThrowableProxy;
-
- /**
- * Get a snapshot of the array. It will return an array of proxies of the
- * complete first dimension of the array. This is useful if you need
- * to be working with more than one entry of the array. You can save
- * accesses to the vm by doing this.
- * <p>
- * NOTE: This is a snapshot. It will not see changes to the array.
- * If an entry is set into the returned array of proxies, this will
- * not be reflected into the real array. Also any changes in the
- * contents of the first dimension of the real array will not
- * be reflected into this returned array of proxies. The proxies
- * returned are real proxies, so any changes to them will be reflected
- * back and forth. Treat this as an array copy to a new array.
- *
- * @return array of proxies of the first dimension of the array.
- * @throws ThrowableProxy
- *
- * @since 1.1.0
- */
- IBeanProxy[] getSnapshot() throws ThrowableProxy;
-
- /**
- * Set the object at the specified index.
- */
- void set(IBeanProxy value, int index) throws ThrowableProxy;
-
- /**
- * Set the object at the specified multi-dimensional index.
- * The array must be at least the number of dimensions specified,
- * and each index along the way must exist.
- * The number of dimensions can't be greater than the number
- * of dimensions of the real object.
- */
- void set(IBeanProxy value, int [] indexes) throws ThrowableProxy;
-
- /**
- * Get the length of the first dimension of this array.
- * If there are multi-dimensions, you must get the appropriate
- * dimension from the get method to see the size of that dimension.
- *
- * e.g.
- * int [3] returns 3
- * int [3][2] returns 3
- *
- * ((IArrayBeanProxy) get(1)).getLength() returns 2
- * Since arrays do not have to be homogenous, there could
- * be a different length array for each of the arrays
- * returned from the first dimension, the returned length
- * from get(2) and get(3) could result in a different value
- * from get(1).
- */
- int getLength();
-
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IArrayBeanTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IArrayBeanTypeProxy.java
deleted file mode 100644
index aceff093e..000000000
--- a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IArrayBeanTypeProxy.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.core;
-/*
-
-
- */
-
-
-/**
- * A Proxy for an array type.
- */
-
-public interface IArrayBeanTypeProxy extends IBeanTypeProxy {
- /**
- * getComponentType: Get the component type of this array.
- * e.g. (new Object[3]).getClass().getComponentType() will
- * return "java.lang.Object".
- * and (new Object[3][2][1]).getClass().getComponentType() will
- * return "Object[][]";
- */
- public IBeanTypeProxy getComponentType();
- /**
- * Return the final type, i.e. the final non-array type.
- * i.e. int[][] will return int.
- */
- public IBeanTypeProxy getFinalComponentType();
- /**
- * Return the number of dimensions for this type.
- * i.e. int [][] will return 2.
- */
- public int getDimensions();
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IBeanProxy.java b/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IBeanProxy.java
deleted file mode 100644
index 7fc92f42e..000000000
--- a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IBeanProxy.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.core;
-/*
-
-
- */
-
-
-/**
- * Bean Proxy interface. This is the
- * root interface for any bean proxy instance.
- * Creation date: (12/3/99 11:37:01 AM)
- * @author: Joe Winchester
- */
-public interface IBeanProxy extends IProxy {
-/**
- * equals: Equal if:
- * 1) This proxy == (identity) to the other object
- * 2) Else if other is an IBeanProxy, then if
- * equals on the server.
- * 3) If this is a constant proxy and the other is too or is a constant
- * value (e.g. IStringBeanProxy.equals(String), then true if values are equals.
- */
-public boolean equals(Object anObject);
-
-/**
- * Test for identity among this bean proxy and the other bean proxy.
- * For some proxy systems, this may be redundent and you can be assured
- * that if the objects being proxied are identical you will receive the
- * same proxy for both. However, other implementations may not have this
- * condition. Therefor this method was created.
- *
- * There is one restriction, constants may not necessarily be identical.
- * For instance, in some implementations, the Boolean proxy (i.e. an instance of class Boolean) is a constant, i.e.
- * it cannot be changed. In those cases a new proxy may be created for each
- * access and so they will not be considered to be identical. In those cases false will be returned.
- * But in other implementations a new proxy will not be created and so sameAs will return true.
- *
- * Primitives will return true if just equal because in Java primitives are identical if the same value.
- *
- * @param aBeanProxy
- * @return true if they are identical (i.e. ==) and not just equals.
- */
-public boolean sameAs(IBeanProxy aBeanProxy);
-
-/**
- * Return the registry this proxy was created with.
- */
-public ProxyFactoryRegistry getProxyFactoryRegistry();
-/**
- * Return the proxied class of the bean
- * Creation date: (12/3/99 11:37:01 AM)
- * @author: Joe Winchester
- */
-public IBeanTypeProxy getTypeProxy();
-
-/**
- * Return a string representation of the bean itself
- * This could be done by finding the toString() method by a findMethod()
- * on the type proxy, etc... but toString() is so ubiquitous that it is
- * explicitly declared on the IBeanProxy interface
- * Creation date: (12/3/99 11:37:01 AM)
- * @author: Joe Winchester
- */
-public String toBeanString();
-/**
- * Is this bean still valid? It could be invalid because it
- * was specifically released but someone is still holding onto it.
- */
-public boolean isValid();
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IBeanProxyFactory.java b/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IBeanProxyFactory.java
deleted file mode 100644
index 510d8f908..000000000
--- a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IBeanProxyFactory.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.core;
-/*
-
-
- */
-
-
-/**
- * Bean Proxy Factory for creating bean proxies.
- * Creation methods are actually package protected.
- * All creation is done through the IBeanTypeProxy.
- * Specific factories may have helper methods that
- * allow creation of specific types, such as the
- * standard factory allows creation of Boolean, int's, etc.
- * Creation date: (12/3/99 11:52:09 AM)
- * @author: Joe Winchester
- */
-public interface IBeanProxyFactory {
- /**
- * The factory is being terminated.
- * <p>
- * It should clean up its resources.
- * It should not reference any other factory because they could of
- * already been terminated.
- * <p>
- * For example, if it is holding onto IREMBeanProxy's, it doesn't
- * need to call release on them except if they are constants because
- * the BeanProxyFactory has all non-constant bean proxies registered
- * and will call the release itself.
- * <p>
- * Note: This is not meant to be called by users. It will be called internally by the proxy registry when necessary.
- *
- * @param wait <code>true</code> should wait for completion, <code>false</code> don't necessarily wait. False is just
- * a suggestion. The factory may not permit not waiting. True must be honoured and it must wait.
- *
- * @since 1.0.2
- */
- public void terminateFactory(boolean wait);
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IBeanTypeExpressionProxy.java b/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IBeanTypeExpressionProxy.java
deleted file mode 100644
index 8966aa17d..000000000
--- a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IBeanTypeExpressionProxy.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 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.jem.internal.proxy.core;
-
-
-/**
- * An internal interface for the registries to create the appropriate beantype expression proxy.
- * Not to be implemented or referenced by customers.
- * @since 1.1.0
- */
-public interface IBeanTypeExpressionProxy extends IProxyBeanType {
-
- /**
- * Allow the expression to set the type name.
- * @param typeName
- *
- * @since 1.1.0
- */
- public void setTypeName(String typeName);
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IBeanTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IBeanTypeProxy.java
deleted file mode 100644
index 30f733fd9..000000000
--- a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IBeanTypeProxy.java
+++ /dev/null
@@ -1,319 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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.jem.internal.proxy.core;
-
-import org.eclipse.jem.internal.proxy.common.AmbiguousMethodException;
-
-/**
- * A proxy for a BeanType (i.e. Java type/class). Creation date: (12/3/99 11:38:06 AM)
- *
- * @author: Joe Winchester
- */
-public interface IBeanTypeProxy extends IBeanProxy, IProxyBeanType {
-
- /**
- * Find the most compatible constructor (out of the declared constructors). This means it will
- * find either an exact match or an override that is compatible, e.g. X(Object j) is returned when looking with arg type of "java.lang.String".
- * @param argumentTypes array of arg types or <code>null</code> if none. (In case of null, this is the default ctor, so just use that).
- * @return
- * @throws NoSuchMethodException
- * @throws AmbiguousMethodException
- * @throws IllegalAccessException
- *
- * @since 1.1.0
- */
- public IConstructorProxy getCompatibleConstructor(IBeanTypeProxy[] argumentTypes) throws AmbiguousMethodException, NoSuchMethodException, IllegalAccessException;
-
- /**
- * Find the most compatible public method, including inheritied. This means it will
- * find either an exact match or an override that is compatible, e.g. xyz(Object j) is returned when looking with arg type of "java.lang.String".
- * @param methodName
- * @param argumentTypes array of arg types or <code>null</code> if none. (In case of null, just use getMethod(String methodName) since only one is compatible then.
- * @return
- * @throws AmbiguousMethodException
- * @throws NoSuchMethodException
- *
- * @since 1.1.0
- */
- public IMethodProxy getCompatibleMethod(String methodName, IBeanTypeProxy[] argumentTypes) throws AmbiguousMethodException, NoSuchMethodException;
-
- /**
- * Return the constructor proxy on the receiver with the specified arguments Creation date: (12/3/99 2:25:07 PM)
- */
- public IConstructorProxy getConstructorProxy(String[] argumentClassNames);
-
- /**
- * Return the constructor proxy on the receiver with the specified types Creation date: (12/3/99 2:25:07 PM)
- */
- public IConstructorProxy getConstructorProxy(IBeanTypeProxy[] argumentTypes);
-
- /**
- * Return an array of public constructors for this class.
- *
- * @return an array of constructor proxies or <code>null</code> if an error.
- *
- * @since 1.1.0
- */
- public IConstructorProxy[] getConstructors();
-
- /**
- * Return the declared constructor proxy on the receiver with the specified arguments Creation date: (12/3/99 2:25:07 PM)
- */
- public IConstructorProxy getDeclaredConstructorProxy(String[] argumentClassNames);
-
- /**
- * Return the declared constructor proxy on the receiver with the specified types Creation date: (12/3/99 2:25:07 PM)
- */
- public IConstructorProxy getDeclaredConstructorProxy(IBeanTypeProxy[] argumentTypes);
-
- /**
- * Return an array of declared constructors for this class.
- *
- * @return an array of constructor proxies or <code>null</code> if an error.
- *
- * @since 1.1.0
- */
- public IConstructorProxy[] getDeclaredConstructors();
-
- /**
- * Return the array of field proxies.
- * @return
- *
- * @since 1.1.0
- */
- public IFieldProxy[] getFields();
-
- /**
- * Return the array of declared field proxies.
- * @return
- *
- * @since 1.1.0
- */
- public IFieldProxy[] getDeclaredFields();
-
- /**
- * Return the fieldproxy on the receiver with the specified name Creation date: (12/3/99 2:25:07 PM)
- */
- public IFieldProxy getFieldProxy(String fieldName);
-
- /**
- * Return the declared fieldproxy on the receiver with the specified name
- */
- public IFieldProxy getDeclaredFieldProxy(String fieldName);
-
- /**
- * Return the method proxy on the receiver with the specified name and no arguments.
- *
- * @param methodName
- * @return
- * @since 1.0.0
- */
- public IMethodProxy getMethodProxy(String methodName);
-
- /**
- * Return the method proxy on the receiver with the qualified class names as string arguments
- *
- * @param methodName
- * @param argumentClassNames
- * @return
- * @since 1.0.0
- */
- public IMethodProxy getMethodProxy(String methodName, String[] argumentClassNames);
-
- /**
- * Return the method proxy on the receiver with the specified name and one argument
- *
- * @param methodName
- * @param argumentClassName
- * @return
- * @since 1.0.0
- */
- public IMethodProxy getMethodProxy(String methodName, String argumentClassName);
-
- /**
- * Return the method proxy on the receiver with the beanTypes as arguments
- *
- * @param methodName
- * @param argumentTypes
- * @return
- * @since 1.0.0
- */
- public IMethodProxy getMethodProxy(String methodName, IBeanTypeProxy[] argumentTypes);
-
- /**
- * Return an array of public methods for this class.
- *
- * @return an array of method proxies or <code>null</code> if an error.
- *
- * @since 1.1.0
- */
- public IMethodProxy[] getMethods();
-
- /**
- * Return the declared method proxy on the receiver with the specified arguments Creation date: (12/3/99 2:25:07 PM)
- */
- public IMethodProxy getDeclaredMethodProxy(String methodName, String[] argumentClassNames);
-
- /**
- * Return the declared method proxy on the receiver with the specified types Creation date: (12/3/99 2:25:07 PM)
- */
- public IMethodProxy getDeclaredMethodProxy(String methodName, IBeanTypeProxy[] argumentTypes);
-
- /**
- * Return an array of declared methods for this class.
- *
- * @return an array of method proxies or <code>null</code> if an error.
- *
- * @since 1.1.0
- */
- public IMethodProxy[] getDeclaredMethods();
-
- /**
- * Return the invokable on the receiver with the specified name and no arguments.
- * <p>
- * The method proxy is not retrieved. Instead the method will be looked up
- * each time on the vm. Because of this these are suitable only for one-shot invokations. If it is to be invoked often, then a method proxy should
- * be retrieved instead.
- * <p>
- * Though typical for one-shot deal the invokable can be used over and over. There is just overhead because the method is looked up each time. So a reasonable compromise
- * would be if using it infrequently or is used closely together once or twice it is better to use a Invokable instead of a method proxy.
- * <p>
- * Note there is no guarantee that the method is available. This won't be known until the actual invoke is done.
- *
- * @param methodName
- * @return
- * @since 1.0.0
- */
- public IInvokable getInvokable(String methodName);
-
- /**
- * Return the method proxy on the receiver with the qualified class names as string arguments
- * <p>
- * The method proxy is not retrieved. Instead the method will be looked up
- * each time on the vm. Because of this these are suitable only for one-shot invokations. If it is to be invoked often, then a method proxy should
- * be retrieved instead.
- * <p>
- * Though typical for one-shot deal the invokable can be used over and over. There is just overhead because the method is looked up each time. So a reasonable compromise
- * would be if using it infrequently or is used closely together once or twice it is better to use a Invokable instead of a method proxy.
- * <p>
- * Note there is no guarantee that the method is available. This won't be known until the actual invoke is done.
- *
- * @param methodName
- * @param argumentClassNames
- * @return
- * @since 1.0.0
- */
- public IInvokable getInvokable(String methodName, String[] argumentClassNames);
-
- /**
- * Return the method proxy on the receiver with the specified name and one argument
- * <p>
- * The method proxy is not retrieved. Instead the method will be looked up
- * each time on the vm. Because of this these are suitable only for one-shot invokations. If it is to be invoked often, then a method proxy should
- * be retrieved instead.
- * <p>
- * Though typical for one-shot deal the invokable can be used over and over. There is just overhead because the method is looked up each time. So a reasonable compromise
- * would be if using it infrequently or is used closely together once or twice it is better to use a Invokable instead of a method proxy.
- * <p>
- * Note there is no guarantee that the method is available. This won't be known until the actual invoke is done.
- *
- * @param methodName
- * @param argumentClassName
- * @return
- * @since 1.0.0
- */
- public IInvokable getInvokable(String methodName, String argumentClassName);
-
- /**
- * Return the method proxy on the receiver with the beanTypes as arguments
- * <p>
- * The method proxy is not retrieved. Instead the method will be looked up
- * each time on the vm. Because of this these are suitable only for one-shot invokations. If it is to be invoked often, then a method proxy should
- * be retrieved instead.
- * <p>
- * Though typical for one-shot deal the invokable can be used over and over. There is just overhead because the method is looked up each time. So a reasonable compromise
- * would be if using it infrequently or is used closely together once or twice it is better to use a Invokable instead of a method proxy.
- * <p>
- * Note there is no guarantee that the method is available. This won't be known until the actual invoke is done.
- *
- * @param methodName
- * @param argumentTypes
- * @return
- * @since 1.0.0
- */
- public IInvokable getInvokable(String methodName, IBeanTypeProxy[] argumentTypes);
-
- /**
- * Return the constructor proxy on the receiver with no arguments Creation date: (12/3/99 2:25:07 PM)
- */
- public IConstructorProxy getNullConstructorProxy();
-
- /**
- * Answer the type proxy for the superclass Creation date: (12/3/99 2:25:07 PM)
- */
- public IBeanTypeProxy getSuperBeanTypeProxy();
-
- /**
- * Answer the name of the type we are proxying This is the fully qualified name. For arrays it will return the format: [Lclassname; Creation date:
- * (12/3/99 2:25:07 PM)
- */
- public String getTypeName();
-
- /**
- * Answer the formal format type name. For normal classes, this just the same as getTypeName(), but for arrays, it is of the format classname[]
- */
- public String getFormalTypeName();
-
- /**
- * Answer a boolean as to whether we are an array type.
- */
- public boolean isArray();
-
- /**
- * Answer a boolean as to whether we are a type or an interface Creation date: (12/3/99 2:25:07 PM)
- */
- public boolean isInterface();
-
- /**
- * Answer a boolean as to whether we are a primitive or not.
- */
- public boolean isPrimitive();
-
- /**
- * Answer a boolean as to whether we are a kind of the argument We can either be it, inherit from it, or implement it
- */
- public boolean isKindOf(IBeanTypeProxy aBeanProxyType);
-
- /**
- * Return a new instance Creation date: (12/3/99 2:25:07 PM)
- */
- public IBeanProxy newInstance() throws ThrowableProxy;
-
- /**
- * Return a new instance of this type using the initialization string to create the proxy. ClassCastException is thrown if the initstring doesn't
- * result in an object compatible with this type. InstantiationException is thrown when the initialization string cannot be parsed correctly.
- * Creation date: (12/3/99 2:25:07 PM)
- */
- public IBeanProxy newInstance(String initializationString) throws ThrowableProxy, ClassCastException, InstantiationException;
-
- /**
- * Return the exception message that happened when trying to find this bean type. Class not found is not such an exception. In that case the bean
- * type will be returned as a null instead. An example of such is an initialization error during loading the class, i.e. it was found but some
- * static failed to initialize.
- *
- * Return null if there is no initialization error.
- */
- public String getInitializationError();
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IBeanTypeProxyFactory.java b/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IBeanTypeProxyFactory.java
deleted file mode 100644
index ce1164672..000000000
--- a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IBeanTypeProxyFactory.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.core;
-/*
-
-
- */
-
-
-/**
- * Factory for creating BeanTypeProxy's.
- * This is a common tag interface so that
- * the factory can be registered. But each
- * VM requires a different interface that
- * extends this interface. That extended
- * interface is what must be implemented in
- * each VM.
- * Creation date: (12/3/99 2:26:00 PM)
- * @author: Joe Winchester
- */
-public interface IBeanTypeProxyFactory extends IBeanProxyFactory {
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IBooleanBeanProxy.java b/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IBooleanBeanProxy.java
deleted file mode 100644
index 625d83964..000000000
--- a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IBooleanBeanProxy.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.core;
-/*
-
-
- */
-
-
-/**
- * Optimized implementation that should be used for Boolean proxies that
- * allows the IDE VM to get the boolean value easily
- * Creation date: (2/6/00 8:58:22 AM)
- * @author: Joe Winchester
- */
-public interface IBooleanBeanProxy extends IBeanProxy {
-/**
- * Return the proxied boolean as a boolean that the IDE can use
- * Creation date: (2/6/00 8:58:32 AM)
- */
-boolean booleanValue();
-Boolean getBooleanValue();
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/ICallback.java b/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/ICallback.java
deleted file mode 100644
index 7f8a02d4e..000000000
--- a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/ICallback.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.core;
-/*
-
-
- */
-
-import java.io.InputStream;
-
-/**
- * Users will create a callback of this interface
- * and register it with the factory. Then when ever
- * the callback occurs, this callback will be called
- * with data from the proxy. It can return a value too.
- *
- * Or an InputStream can be returned to supply the data.
- *
- * @since 1.0.0
- */
-public interface ICallback {
-
- /**
- * This is the entry point of the callback.
- * It will be called whenever the callback
- * occurred. It will be on its own thread.
- * A particular thread cannot be requested.
- * <p>
- * The implementation MUST return. This is
- * because the callback will not be completed
- * until it is returned, and the process will
- * not continue on the remote vm until it is
- * returned.
- * <p>
- * The value returned must either be an
- * IBeanProxy or IBeanProxy[]. It is typed
- * to Object to allow either one, but it
- * will be checked, and if it isn't, then
- * null will be returned instead to the
- * caller.
- *
- * @param msgID
- * @param parm The beanproxy - will not be null
- * @return
- *
- * @since 1.0.0
- */
- public Object calledBack(int msgID, IBeanProxy parm);
-
- /**
- * This is the entry point of the callback.
- * It will be called whenever the callback
- * occurred. It will be on its own thread.
- * A particular thread cannot be requested.
- * <p>
- * The parms will be an array of IBeanProxys,
- * or an entry could be another array of IBeanProxys,
- * or null if null was sent to callBackWithParms.
- * The final component of any entry will be an
- * IBeanProxy. It is up to the developers to
- * agree on the format of the parms.
- * <p>
- * The implementation MUST return. This is
- * because the callback will not be completed
- * until it is returned, and the process will
- * not continue on the remote vm until it is
- * returned.
- * <p>
- * The value returned must either be an
- * IBeanProxy or IBeanProxy[]. It is typed
- * to Object to allow either one, but it
- * will be checked, and if it isn't, then
- * null will be returned instead to the
- * caller.
- *
- * @param msgID
- * @param parms
- * @return
- *
- * @see org.eclipse.jem.internal.proxy.common.ICallbackHandler#callbackWithParms(int, int, Object[])
- * @since 1.0.0
- */
- public Object calledBack(int msgID, Object[] parms);
-
- /**
- * This is the entry point of the callback.
- * It will be called whenever the callback
- * occurred. It will be on its own thread.
- * A particular thread cannot be requested.
- * <p>
- * The parm will be an object. This occurs
- * if remote vm just wanted to send some objects.
- * They will not be proxies. It is recommended
- * that this be used only for small items. For
- * anything large, the callbackStream should be
- * used instead.
- * <p>
- * The implementation MUST return. This is
- * because the callback will not be completed
- * until it is returned, and the process will
- * not continue on the remote vm until it is
- * returned.
- * <p>
- * The value returned must either be an
- * IBeanProxy or IBeanProxy[]. It is typed
- * to Object to allow either one, but it
- * will be checked, and if it isn't, then
- * null will be returned instead to the
- * caller.
- *
- * @param msgID
- * @param parm The parm or <code>null</code> if null was sent.
- * @return
- *
- * @see ICallback#calledBackStream(int, InputStream)
- * @since 1.0.0
- */
- public Object calledBack(int msgID, Object parm);
-
- /**
- * This is the entry point of the callback.
- * It will be called whenever the callback stream
- * occurred. It will be on its own thread.
- * A particular thread cannot be requested.
- * <p>
- * The callback should continue to read from the InputStream
- * until it returns -1 indicating no more data. The stream can
- * be closed. In that case the next time the remote vm wants to
- * send data it will first check that the stream has not been closed.
- * If it has, it will raise an exception on that side.
- * <p>
- * The implementation MUST return. This is
- * because the callback will not be completed
- * until it is returned, and the process will
- * not continue on the remote vm until it is
- * returned.
- *
- * @param msgID
- * @param is
- *
- * @since 1.0.0
- */
- public void calledBackStream(int msgID, InputStream is);
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/ICallbackRegistry.java b/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/ICallbackRegistry.java
deleted file mode 100644
index 0e3c561f7..000000000
--- a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/ICallbackRegistry.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.core;
-/*
-
-
- */
-
-/**
- * This is the registry for handling callbacks.
- * It is used to register and deregister callbacks.
- *
- * Callbacks are split into two parts:
- * 1) CallbackProxy. This is any proxy that implements the
- * interface ICallback. (Or the
- * equivalent one if not standard remote vm). This is the
- * object which will actually submit the callback on the remote
- * vm. For example, any kind of listener. It would implement
- * both the ICallback and the appropriate listener interface.
- * Then when it gets called as a listener, it will redirect the
- * call to the remote vm callback handler to submit it to the
- * proxy side.
- * 2) Callback. This is on this side and is the object that will
- * be notified of the callback and will execute at that time.
- *
- */
-
-public interface ICallbackRegistry {
-
- /**
- * Register this callback proxy and this callback.
- *
- * The process is to:
- * 1) Create the callbackProxy and the callback
- * 2) register these with registerCallback
- * 3) Now connect the callbackProxy so that it will start notifying.
- * For example, if it is a normal listener, at this time do the
- * addListener call to add the callbackProxy to the appropriate object.
- * You don't want it to start notifying before registering it.
- * (Though it won't hust it, it will just return null).
- */
- public void registerCallback(IBeanProxy callbackProxy, ICallback cb);
-
- /**
- * Same as {@link ICallbackRegistry#registerCallback(IBeanProxy, ICallback) registerCallback} except that
- * it is deferred off into an expression.
- *
- * @param callbackProxy
- * @param cb
- * @param expression
- *
- * @since 1.1.0
- */
- public void registerCallback(IProxy callbackProxy, ICallback cb, IExpression expression);
-
- /**
- * Deregister the callback proxy. This will remove it from the
- * registry and release the callback.
- *
- * The process is to:
- * 1) Stop the proxy from listening so it no notifies. This is usually
- * removeListener on the remote vm. You don't want it notifying
- * after it deregister (though it won't hurt it, it will just return null).
- * 2) deregister it.
- */
- public void deregisterCallback(IBeanProxy callbackProxy);
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/ICharacterBeanProxy.java b/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/ICharacterBeanProxy.java
deleted file mode 100644
index b2e7c3ed9..000000000
--- a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/ICharacterBeanProxy.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.core;
-/*
-
-
- */
-
-
-/**
- * Optimized implementation that should be used for character proxies that
- * allows the IDE VM to get the character value easily
- * Creation date: (2/6/00 8:58:22 AM)
- * @author: Joe Winchester
- */
-public interface ICharacterBeanProxy extends IBeanProxy, INumberBeanProxy {
-/**
- * Return the proxied character as a char that the IDE can use
- * Creation date: (2/6/00 8:58:32 AM)
- */
-char charValue();
-/**
- * Return the proxied character as a Character that the IDE can use
- * Creation date: (2/6/00 8:58:32 AM)
- */
-Character characterValue();
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IConfigurationContributionController.java b/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IConfigurationContributionController.java
deleted file mode 100644
index 03267f944..000000000
--- a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IConfigurationContributionController.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.core;
-/*
-
-
- */
-
-import java.net.URL;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jdt.core.IJavaProject;
-import org.osgi.framework.Bundle;
-;
-/**
- * Controls contribution to the configuration. This allows the classpath
- * to be modified in an acceptable manner, so that duplicates aren't in
- * the path, or adding a project to the path in an acceptable way.
- *
- * If only deleting or moving entries from the classpath, that can be done directly
- * to the classpath list passed in. Adding entries needs to go through this
- * controller.
- *
- * This is meant to be implemented by developers of proxy launch configurations.
- *
- * @version 1.0
- * @author
- */
-public interface IConfigurationContributionController {
-
- /**
- * Append to the user classpath.
- */
- public static final int APPEND_USER_CLASSPATH = 0;
-
- /**
- * Prepend to the user classpath. This will stick it in position 0. If
- * another prepend comes along, it will go in pos 0 and this one will move to 1.
- */
- public static final int PREPEND_USER_CLASSPATH = 1;
-
-
- /**
- * Append to the boot classpath.
- */
- public static final int APPEND_BOOT_CLASSPATH = 2;
-
- /**
- * Prepend to the boot classpath.
- */
- public static final int PREPEND_BOOT_CLASSPATH = 3;
-
- /**
- * Append a folder to the java.library.path (for things like
- * dll's). This should result in a folder only.
- * The nlsLocalize flag contribute via plugin will be
- * ignored for this type flag.
- */
- public static final int APPEND_JAVA_LIBRARY_PATH = 4;
-
- /**
- * Get the java project that we are contributing for.
- *
- * @return javaproject, may be <code>null</code>
- *
- * @since 1.0.0
- */
- public IJavaProject getJavaProject();
-
- /**
- * Add a project to the classpath. The type flag tells where to add it.
- *
- * @param project
- * @throws CoreException
- *
- * @since 1.0.0
- */
- public void contributeProject(IProject project) throws CoreException;
-
- /**
- * Add an external file/folder to the classpath. The type flag tells where to add it.
- *
- * @param classpath
- * @param typeFlag One of <code>APPEND_USER_CLASSPATH</code>, <code>APPEND_BOOT_CLASSPATH</code>, <code>PREPEND_BOOT_CLASSPATH</code>, or <code>APPEND_JAVA_LIBRARY_PATH</code>.
- *
- * @deprecated use contributeClasspath(URL, int) instead.
- * @see #contributeClasspath(URL, int)
- * @since 1.0.0
- */
- public void contributeClasspath(String classpath, int typeFlag);
-
- /**
- * Add an external file/folder to the classpath. The type flag tells where to add it.
- *
- * @param classpathURL
- * @param typeFlag One of <code>APPEND_USER_CLASSPATH</code>, <code>APPEND_BOOT_CLASSPATH</code>, <code>PREPEND_BOOT_CLASSPATH</code>, or <code>APPEND_JAVA_LIBRARY_PATH</code>.
- *
- * @since 1.0.0
- */
- public void contributeClasspath(URL classpathURL, int typeFlag);
-
- /**
- * Add an external files/folders to the classpath. The type flag tells where to add it.
- *
- * @param classpaths
- * @param typeFlag One of <code>APPEND_USER_CLASSPATH</code>, <code>APPEND_BOOT_CLASSPATH</code>, <code>PREPEND_BOOT_CLASSPATH</code>, or <code>APPEND_JAVA_LIBRARY_PATH</code>.
- *
- * @deprecated use contributeClasspath(URL[], int) instead.
- * @see #contributeClasspath(URL[], int)
- * @since 1.0.0
- */
- public void contributeClasspath(String[] classpaths, int typeFlag);
-
- /**
- * Add an external files/folders to the classpath. The type flag tells where to add it.
- *
- * @param classpathURLs
- * @param typeFlag One of <code>APPEND_USER_CLASSPATH</code>, <code>APPEND_BOOT_CLASSPATH</code>, <code>PREPEND_BOOT_CLASSPATH</code>, or <code>APPEND_JAVA_LIBRARY_PATH</code>.
- *
- * @since 1.0.0
- */
- public void contributeClasspath(URL[] classpathURLs, int typeFlag);
-
- /**
- * Add a file/folder from a plugin in the running Eclipse to the classpath. The type flag tells where to add it.
- * In development mode it will find the bin class files instead if proxy.jars is setup correctly.
- * <p>
- * If nlsLocalize is <code>true</code>, then it will also search through the fragments in this manner:
- * (Note: if <code>false</code> it will still search in the fragments, but it will only return the first file found that matches.
- * <p>
- * Find in the plugin and all of the fragments those that match the name exactly
- * <p>
- * This is useful for nls where the nls for the filename will be in one or more of the fragments of the plugin.
- *
- * @param bundle The bundle it can be found in.
- * @param relativePath Path to file/folder relative to bundle root. Or <code>null</code> if it is the bundle/fragment itself (for when the bundle has been jar'ed up).
- * <b>Note: </b>If it is <code>APPEND_JAVA_LIBRARY_PATH</code>, it should be folder and nlsLocalize will be ignored.
- * In this case be careful that if a folder and the plugin is jarred that the folder <b>IS NOT THE ROOT OF THE PLUGIN</b>. This will
- * cause the entire plugin to be extracted instead of just the directory containing the libraries. If the libraries are in the root
- * of a jarred plugin then a separate cache directory should be created instead and the libraries of interest extracted to there. And
- * then point to the cache directory instead.
- * @param typeFlag One of <code>APPEND_USER_CLASSPATH</code>, <code>APPEND_BOOT_CLASSPATH</code>, <code>PREPEND_BOOT_CLASSPATH</code>, or <code>APPEND_JAVA_LIBRARY_PATH</code>.
- * @param nlsLocalize The usual value should be <code>false</code>. Use <code>true</code> if should look through fragments to gather them all as described in this methods description. This will work for jarred bundles/fragments too.
- *
- * @since 1.0.0
- */
- public void contributeClasspath(Bundle bundle, String relativePath, int typeFlag, boolean nlsLocalize);
-
- /**
- * Same as {@link #contributeClasspath(Bundle, String, int, boolean)} except an IPath can be used as the relative path.
- *
- * @param bundle
- * @param relativePath path to file within bundle. Or <code>null</code> if it is the bundle/fragment itself (for when the bundle has been jar'ed up).
- * @param typeFlag
- * @param nlsLocalize
- *
- * @see #contributeClasspath(Bundle, String, int, boolean)
- * @since 1.0.0
- */
- public void contributeClasspath(Bundle bundle, IPath relativePath, int typeFlag, boolean nlsLocalize);
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IConfigurationContributionInfo.java b/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IConfigurationContributionInfo.java
deleted file mode 100644
index 9d25a4524..000000000
--- a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IConfigurationContributionInfo.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 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.jem.internal.proxy.core;
-
-import java.util.Map;
-
-import org.eclipse.jdt.core.IJavaProject;
-
-/**
- * This interface will be passed to the IConfigurationContributor initialize method. It has info
- * that may be needed by the contributor. It may be saved for later use, but if classpaths have changed,
- * it won't be kept up to date.
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
- *
- * @see org.eclipse.jem.internal.proxy.core.IConfigurationContributor#initialize(IConfigurationContributionInfo)
- * @since 1.0.0
- */
-public interface IConfigurationContributionInfo {
-
- /**
- * Hold the visible and hidden container paths.
- * A visible container path means it has been exported up to the top-level project. And also
- * the array of those not visible. The paths are the String form (i.e. IPath.toString()).
- * <p>
- * These are the values of the {@link IConfigurationContributionInfo#getContainerIds()} map.
- *
- * @since 1.2.0
- */
- public static class ContainerPaths {
-
- private final String[] visiblePath;
- private final String[] hiddenPaths;
- private final String containerId;
-
- ContainerPaths(String containerId, String[] visiblePath, String[] hiddenPaths) {
- // Not meant to be subclassed or constructed by clients.
- this.containerId = containerId;
- this.visiblePath = visiblePath;
- this.hiddenPaths = hiddenPaths;
- }
-
-
- /**
- * @return Returns the containerId.
- *
- * @since 1.2.0
- */
- public final String getContainerId() {
- return containerId;
- }
-
- /**
- * Array of visible container paths. A path is visible if it is exported up to and can
- * see by the top-level project.
- *
- * @return
- *
- * @since 1.2.0
- */
- public final String[] getVisibleContainerPaths() {
- return visiblePath;
- }
-
- /**
- * Array of hidden container paths. A path is hidden if it is not exported up to and cannot
- * see by the top-level project.
- *
- * @return
- *
- * @since 1.2.0
- */
- public final String[] getHiddenContainerPaths() {
- return hiddenPaths;
- }
-
- /**
- * Get all of the paths together, both visible and hidden.
- * @return
- *
- * @since 1.2.0
- */
- public String[] getAllPaths() {
- String[] allPaths = new String[visiblePath.length+hiddenPaths.length];
- System.arraycopy(visiblePath, 0, allPaths, 0, visiblePath.length);
- System.arraycopy(hiddenPaths, 0, allPaths, visiblePath.length, hiddenPaths.length);
- return allPaths;
- }
- }
-
- /**
- * Get the java project that we are contributing for.
- *
- * @return javaproject, may be <code>null</code>
- *
- * @since 1.0.0
- */
- public IJavaProject getJavaProject();
-
- /**
- * Return the map of containers (the key) that are found in the classpath. This is useful for determining
- * if the container impliments a contributor interface.
- * <p>
- * Value will be {@link ContainerPaths}
- *
- * @return Map of containers. Keys of type String for container id (e.g. "SWT_CONTAINER" for a container classpath of "/SWT_CONTAINER/PDE/xyz".
- * Values will be {@link ContainerPaths} Empty if launch not in a project.
- *
- * @since 1.0.0
- */
- public Map getContainers();
-
- /**
- * Return the map of container ids that are found in the classpath.
- * <p>
- * Key will be String and it is the first segment of a container path. Value will {@link ContainerPaths}. This
- * will contain all of the visible and hidden paths that the project can see. All of the paths will have
- * the key (container id) as the first segment of the path.
- *
- * @return map of container ids. Keys of type String. Values will be {@link ContainerPaths} Empty if launch not in a project.
- *
- * @since 1.0.0
- */
- public Map getContainerIds();
-
- /**
- * Return the map of plugin ids (the key) that are found in the classpath.
- * <p>
- * Value will <code>Boolean</code> and will be true if plugin was visible to top-level project.
- *
- * @return map of plugin ids. Key of type String. Empty if launch not in a project.
- *
- * @since 1.0.0
- */
- public Map getPluginIds();
-
- /**
- * Return the map of project paths (the key) that are found in the classpath. The top-level project
- * will NOT be in this list since it is assumed to be visible to itself.
- * <p>
- * Value will <code>Boolean</code> and will be true if project was visible to top-level project.
- *
- * @return map of project paths. Key of type <code>IPath</code>. Empty if launch not in a project.
- *
- * @see org.eclipse.core.runtime.IPath
- * @since 1.0.0
- */
- public Map getProjectPaths();
-
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IConfigurationContributor.java b/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IConfigurationContributor.java
deleted file mode 100644
index d456b480a..000000000
--- a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IConfigurationContributor.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.core;
-/*
-
-
- */
-
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-
-
-/**
- * This interface is used to contribute to the configuration that will be
- * used to start a proxy registry.
- *
- * @since 1.0.0
- */
-public interface IConfigurationContributor {
-
- /**
- * Called first before any of the other calls. This can be used to do any internal initializations
- * required by the other calls. That way the other calls can have the order changed as the implementation
- * requires.
- * <p>
- * NOTE: For those who nest configuration contributors (i.e. within an implementation of a contributor, more
- * contributors are discovered) then it is imperitive that when those contributors are discovered that this method
- * be called on them too. This is necessary so the contract with contributors can be followed. It is best if the
- * discoveries are actually done in the initialize method itself so that it can pass the launch info right there.
- *
- * @param info info contains things like containers visible, etc.
- *
- * @see IConfigurationContributionInfo
- * @since 1.0.0
- */
- public void initialize(IConfigurationContributionInfo info);
-
- /**
- * Contribute to the classpath. The controller is used to do the actual contribution.
- *
- * @param controller
- * @throws CoreException
- *
- * @since 1.0.0
- */
- public void contributeClasspaths(IConfigurationContributionController controller) throws CoreException;
-
- /**
- * Contribute updates to the configuration. It will be called before the launch has started.
- *
- * @param config
- * @throws CoreException
- *
- * @since 1.0.0
- */
- public void contributeToConfiguration(ILaunchConfigurationWorkingCopy config) throws CoreException;
-
- /**
- * Contribute to the registry (or interact with the remote vm) after the registry has been
- * created.
- *
- * @param registry
- *
- * @since 1.0.0
- */
- public void contributeToRegistry(ProxyFactoryRegistry registry);
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IConstructorProxy.java b/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IConstructorProxy.java
deleted file mode 100644
index 0bc00835c..000000000
--- a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IConstructorProxy.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.core;
-/*
-
-
- */
-
-
-/**
- * This is a proxy that allows a constructor to exist in the target VM
- * and be referenced in the IDE VM
- * Creation date: (1/17/00 1:21:52 PM)
- * @author: Joe Winchester
- */
-public interface IConstructorProxy extends IAccessibleObjectProxy {
-/**
- * Return a new instance with no creation arguments,
- * i.e. for a null constructor
- * Creation date: (1/17/00 1:22:11 PM)
- */
-IBeanProxy newInstance() throws ThrowableProxy;
-/**
- * Return a new instance with the specified creation arguments
- * Creation date: (1/17/00 1:22:11 PM)
- */
-IBeanProxy newInstance(IBeanProxy[] creationArguments) throws ThrowableProxy;
-
-IBeanProxy newInstanceCatchThrowableExceptions();
-IBeanProxy newInstanceCatchThrowableExceptions(IBeanProxy[] creationArguments);
-
-IBeanTypeProxy[] getParameterTypes();
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IDimensionBeanProxy.java b/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IDimensionBeanProxy.java
deleted file mode 100644
index 549c1cb4f..000000000
--- a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IDimensionBeanProxy.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.core;
-/*
-
-
- */
-
-
-
-/**
- * Interface to a Dimension bean proxy.
- * <p>
- * These are common for different windowing systems, e.g. AWT and SWT. So this here
- * is common interface for them.
- * Creation date: (4/7/00 3:46:39 PM)
- * @author: Administrator
- */
-public interface IDimensionBeanProxy extends IBeanProxy {
- public int getHeight();
- public int getWidth();
- public void setHeight(int height);
- public void setWidth(int width);
- public void setSize(int width, int height);
- public void setSize(IDimensionBeanProxy dim);
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IExpression.java b/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IExpression.java
deleted file mode 100644
index 561fe4112..000000000
--- a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IExpression.java
+++ /dev/null
@@ -1,1009 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 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.jem.internal.proxy.core;
-
-import org.eclipse.jem.internal.proxy.initParser.tree.*;
-import org.eclipse.jem.internal.proxy.initParser.tree.IExpressionConstants;
-import org.eclipse.jem.internal.proxy.initParser.tree.NoExpressionValueException;
-
-/**
- * This is an expression. It will be evaluated on the other side. The difference between an
- * expression and using IMethodProxy's, IConstructorProxy's, etc. is the granularity. The proxies
- * are one round-trip to the other side for each access or execution. The expression builds them up
- * and will execute them all at once on the other side. Another difference is that the reflection
- * will be done on the other side too. For instance when invoking a method, the method name is
- * passed into the expression as a string then reflected and then invoked, while with method
- * proxies, the string is used to find the proxy on the other side, and then a later round-trip
- * will be used to invoke it.
- * <p>
- * Also an expression is a one-time use object. It can't be reused a second time. A new one must be
- * built up again.
- * <p>
- * We are not using separate instances of expressions, and types of expressions, because we don't
- * want to build up many objects (in a form of an expression tree) that will then be thrown away
- * (one for each expression in the nested list of expressions). We just build the command list as
- * we build the expression.
- * <p>
- * To use, you call the IStandardBeanProxyFactory's createExpression method. An IExpression is
- * returned. From there you will start creating the contents of the expression. And then you will
- * finally either getExpressionValue() to get the final value of the expression, or use
- * invokeExpression() to just execute the expression(s). If you use getExpressionValue(), there can
- * only be one root expression. If you use invokeExpression there can be more than one root
- * expression, and they will all be executed.
- * <p>
- * Since sequence is so important, it will be tested and if anything is done out of order an
- * IllegalStateException will be thrown.
- * <p>
- * Each time an expression is created, one argument passed in will be <code>forExpression</code> flag.
- * This is a set of constants used as a clue for what expression this expression is being created.
- * This is for a sanity check on the state. For example, when creating the array expression for an
- * array access, the ARRAYACCESS_ARRAY flag is passed in. This way if the current expression on the
- * stack is not for an array access waiting for the array expression, an IllegalStateException will be thrown.
- * Without this flag, it would be easy to accidently create the wrong expression at the wrong time.
- * Once such an error occurs, this IExpression will no longer be valid. IllegalStateException will be thrown
- * for any type of access.
- * <p>
- * It is guarenteed that the entire stack of commands will be sent without stopping except for IllegalStateException
- * due to out of order expressions.
- * <p>
- * <b>Note:</b> This interface is not meant to be neither instantiated nor implemented by customers.
- * It is the interface into the expression processing. It is to be instantiated through the createExpression request.
- * The {@link org.eclipse.jem.internal.proxy.core.Expression} class is available as API. It is not meant to
- * be instantiated by customers, but customers can take the IExpression and cast to Expression for some advanced
- * API.
- *
- * @see org.eclipse.jem.internal.proxy.core.IStandardBeanProxyFactory#createExpression()
- * @see java.lang.IllegalStateException
- * @since 1.0.0
- */
-public interface IExpression extends IExpressionConstants {
-
- /**
- * Return the registry this expression is working against.
- * @return
- *
- * @since 1.1.0
- */
- public ProxyFactoryRegistry getRegistry();
-
- /**
- * Invoke the expression(s). If there is more than one root expression, it will invoke them
- * in the order created. If the expression stack is not complete, then <code>IllegalStateException</code>
- * will be thrown.
- *
- * @throws ThrowableProxy
- * @throws IllegalStateException
- * @throws NoExpressionValueException
- *
- * @since 1.0.0
- */
- public void invokeExpression() throws ThrowableProxy, NoExpressionValueException, IllegalStateException;
-
- /**
- * Return whether the expression is valid. It would be invalid if any of the create... calls had thrown an
- * exception or if the expression has already been evaluated (invoked or getExpressionValue()).
- *
- * @return <code>true</code> if expression is valid, <code>false</code> if there had been some error, or if the expression has already been evaluated.
- *
- * @since 1.1.0
- */
- public boolean isValid();
-
- /**
- * Close the expression. This needs to be called if for some reason {@link IExpression#invokeExpression()} or {@link IExpression#getExpressionValue()}
- * were not called. It is not an error to always call this after these calls. It will not have any problems with the expression already
- * being closed. invoke and getvalue automatically call close for you. If you don't call close in case of an error, the resources
- * for the expression will not be freed up.
- *
- *
- * @since 1.1.0
- */
- public void close();
-
- /**
- * Invoke the root expression and return the value of the expression. If the expression stack
- * is not complete, or if there is more than one root expression, then <code>IllegalStateException</code>
- * will be thrown.
- *
- * @return The value of the root expression.
- *
- * @throws ThrowableProxy
- * @throws IllegalStateException
- * @throws NoExpressionValueException
- *
- * @since 1.0.0
- */
- public IBeanProxy getExpressionValue() throws ThrowableProxy, NoExpressionValueException, IllegalStateException;
-
- /**
- * Create an Array Access (e.g. x[3]).
- * This must be followed by create expressions for:
- * <pre>
- * <code>ARRAYACCESS_ARRAY</code>
- * <code>ARRAYACCESS_INDEX</code> an indexCount times.
- * </pre>
- * <p>
- * So the array access must be followed by 1+indexCount expressions.
- *
- * @param forExpression This is for what expression this expression is being created.
- * @param indexCount The number of index expressions that will be created.
- * @throws IllegalStateException
- *
- * @since 1.0.0
- */
- public void createArrayAccess(ForExpression forExpression, int indexCount) throws IllegalStateException;
-
- /**
- * Create an Array Creation (e.g. <code>new int[3]</code> or <code>new int[3][]</code> or <code>new int[] {3, 4}</code>).
- * If <code>dimensionExpressionCount</code> is zero, then there must be an initializer. This is because
- * if there are any dimension expressions, then initializers are invalid and visa-versa.
- * <p>
- * The dimensionExpressionCount is for how many dimensions have an expression in them. For instance,
- * <code>new int[3]</code> will have a dimensionExpressionCount of 1. While
- * <code>new int[3][]</code> will also have count of 1. And finally
- * <code>new int []</code> will have a count of 0.
- * <p>
- * This must be followed by create expressions for:
- * <pre>
- * <code>ARRAYCREATION_DIMENSION</code> a dimensionExpressionCount times,
- * or an <code>createArrayInitializer()</code> if dimension count is 0.
- * </pre>
- *
- * @param forExpression
- * @param type This is the type. It must be fully-qualified and if an inner class, it must have the "$" format. It must also include the correct number of <code>[]</code> at the end.
- * @param dimensionExpressionCount
- * @throws IllegalStateException
- *
- * @since 1.0.0
- */
- public void createArrayCreation(ForExpression forExpression, String type, int dimensionExpressionCount) throws IllegalStateException;
-
- /**
- * Create an Array Creation (e.g. <code>new int[3]</code> or <code>new int[3][]</code> or <code>new int[] {3, 4}</code>).
- * If <code>dimensionExpressionCount</code> is zero, then there must be an initializer. This is because
- * if there are any dimension expressions, then initializers are invalid and visa-versa.
- * <p>
- * The dimensionExpressionCount is for how many dimensions have an expression in them. For instance,
- * <ol>
- * <li><code>new int[3]</code> will have a dimensionExpressionCount of 1. While
- * <li><code>new int[3][]</code> will also have count of 1. And finally
- * <li><code>new int []</code> will have a count of 0.
- * </ol>
- * The expressions that follow if dimensionExpressionCount is not zero must evaluate to be compatible to an int type (i.e. byte, char, short, or int).
- * Each expression will be used to create an array for that dimension of that size. For example <code>new int[3][]</code> will have an
- * dimension expression that evaluates to "3", and so it will create an array int[3][].
- * <p>
- * This must be followed by create expressions for:
- * dimensionExpressionCount times an: <code>ARRAYCREATION_DIMENSION</code>
- * or an createArrayInitializer if dimension count is 0.
- *
- * @param forExpression
- * @param type This is the type. This must be the actual type with the correct total number of dimensions (e.g. "java.lang.Object[][]").
- * @param dimensionExpressionCount number of int valued expressions that follow that give the size for each dimension.
- * @throws IllegalStateException
- * @throws IllegalArgumentException
- *
- * @since 1.0.0
- */
- public void createArrayCreation(ForExpression forExpression, IProxyBeanType type, int dimensionExpressionCount) throws IllegalStateException, IllegalArgumentException;
-
- /**
- * Create an array initializer. (e.g. <code>{2,3}</code>).
- * This one is unusual in that there is no forExpression. That is because array initializers are only valid in
- * certain places. And so if called when not expected, this is an IllegalStateException.
- * <p>
- * This must be followed by createExpressions for:
- * expressionCount times an: <code>ARRAYINITIALIZER_EXPRESSION</code>
- * except if the expression is another array initializer. That is valid and doesn't have a forExpression,
- * but it does count as one of the expressionCounts.
- *
- * @param expressionCount Number of expressions, may be 0.
- * @throws IllegalStateException
- *
- * @since 1.0.0
- */
- public void createArrayInitializer(int expressionCount) throws IllegalStateException;
-
- /**
- * Create a cast expression (e.g. <code>(short)10</code> or <code>(java.lang.String) "asd"</code>)
- * <p>
- * This must be followed by createExpressions for:
- * <code>CAST_EXPRESSION</code>
- *
- * @param forExpression
- * @param type This is the type. It must be fully-qualified and if an inner class, it must have the "$" format.
- * @throws IllegalStateException
- *
- * @since 1.0.0
- */
- public void createCastExpression(ForExpression forExpression, String type) throws IllegalStateException;
-
- /**
- * Create a cast expression (e.g. <code>(short)10</code> or <code>(java.lang.String) "asd"</code>)
- * <p>
- * This must be followed by createExpressions for:
- * <code>CAST_EXPRESSION</code>
- *
- * @param forExpression
- * @param type This is the type.
- * @throws IllegalStateException
- * @throws IllegalArgumentException
- *
- * @since 1.0.0
- */
- public void createCastExpression(ForExpression forExpression, IProxyBeanType type) throws IllegalStateException, IllegalArgumentException;
-
- /**
- * Create a new class instance expression (e.g. <code>new java.lang.Integer(5)</code>)
- * <p>
- * This must be followed by createExpressions for:
- * argumentCount times an: <code>CLASSINSTANCECREATION_ARGUMENT</code>
- *
- * <p>
- * <b>Note:</b> This method can throw {@link org.eclipse.jem.internal.proxy.common.UnresolvedCompilationError} while processing
- * and can be caught by an Expression try/catch. This is not thrown such that it can be caught by a real java try/catch.
- *
- * @param forExpression
- * @param type This is the type. It must be fully-qualified and if an inner class, it must have the "$" format.
- * @param argumentCount
- * @throws IllegalStateException
- *
- * @since 1.0.0
- */
- public void createClassInstanceCreation(ForExpression forExpression, String type, int argumentCount) throws IllegalStateException;
-
- /**
- * Create a new class instance expression (e.g. <code>new java.lang.Integer(5)</code>)
- * <p>
- * This must be followed by createExpressions for:
- * argumentCount times an: <code>CLASSINSTANCECREATION_ARGUMENT</code>
- *
- * <p>
- * <b>Note:</b> This method can throw {@link org.eclipse.jem.internal.proxy.common.UnresolvedCompilationError} while processing
- * and can be caught by an Expression try/catch. This is not thrown such that it can be caught by a real java try/catch.
- *
- * @param forExpression
- * @param type This is the type.
- * @param argumentCount
- * @throws IllegalStateException
- * @throws IllegalArgumentException
- *
- * @since 1.0.0
- */
- public void createClassInstanceCreation(ForExpression forExpression, IProxyBeanType type, int argumentCount) throws IllegalStateException, IllegalArgumentException;
-
- /**
- * Create a conditional expression (e.g. <code>x != 3 ? 4 : 5</code>)
- * <p>
- * This must be followed by createExpressions for:
- * <code>CONDITIONAL_CONDITION</code>
- * <code>CONDITIONAL_TRUE</code>
- * <code>CONDITIONAL_FALSE</code>
- *
- * @param forExpression
- * @throws IllegalStateException
- *
- * @since 1.0.0
- */
- public void createConditionalExpression(ForExpression forExpression) throws IllegalStateException;
-
- /**
- * Create a field access (e.g. <code>java.awt.Color.red</code>)
- * <p>
- * Note: At this time we require a receiver. In the future it may be possible to not have one, but
- * for that we need a <code>this</code> object to know who the receiver implicitly is.
- * The receiver may be a "type receiver" if it is a type, e.g. <code>java.awt.Color</code>.
- * <p>
- * This must be followed by createExpressions for:
- * <code>FIELD_RECEIVER</code> if hasReceiver is <code>true</code>
- *
- * @param forExpression
- * @param fieldName The name of the field.
- * @param hasReceiver Has a receiver flag. Currently this must always be true. This is because can't tell what class to look into for the field without a receiver.
- * @throws IllegalArgumentException
- * @throws IllegalStateException
- *
- * @see IExpression#createTypeReceiver(String)
- * @since 1.0.0
- */
- public void createFieldAccess(ForExpression forExpression, String fieldName, boolean hasReceiver) throws IllegalArgumentException, IllegalStateException;
-
- /**
- * Create a field access (e.g. <code>java.awt.Color.red</code>)
- * <p>
- * Note: At this time we require a receiver for non-static access. In the future it may be possible to not have one, but
- * for that we need a <code>this</code> object to know who the receiver implicitly is.
- * The receiver may be a "type receiver" if it is a type, e.g. <code>java.awt.Color</code>.
- * <p>
- * This must be followed by createExpressions for:
- * <pre>
- * <code>FIELD_RECEIVER</code> if hasReceiver is <code>true</code>
- * </pre>
- *
- * @param forExpression
- * @param fieldProxy The field proxy for the field.
- * @param hasReceiver Has a receiver flag.
- * @throws IllegalStateException
- * @throws IllegalArgumentException
- *
- * @see IExpression#createTypeReceiver(String)
- * @since 1.0.0
- */
- public void createFieldAccess(ForExpression forExpression, IProxyField fieldProxy, boolean hasReceiver) throws IllegalStateException, IllegalArgumentException;
-
- /**
- * Create an if/else stmt. Since this is a statment, there is no ForExpression. ROOT_EXPRESSION must be the next expression type.
- * <p<
- * This must be followed by createExpressions for:
- * <pre>
- * <code>IF_CONDITION</code> The if test, must return boolean.
- * <code>IF_TRUE</code> The if condition is true clause. The clause may be an expression, or a block.
- * <code>IF_ELSE</code> if hasElseClause is <code>true</code>. The else clause. The clause may be an expression, or a block.
- * </pre>
- *
- * @param hasElseClause
- * @throws IllegalStateException
- *
- * @since 1.1.0
- */
- public void createIfElse(boolean hasElseClause) throws IllegalStateException;
-
- /**
- * Create an infix expression (e.g. <code>3 + 4</code> or <code>3 + 4 + 5</code>).
- * <p>
- * If there are more than 2 operands (all with the same operator) then for convienence all of
- * the expression can be done in one expression than requiring several, one for each operator.
- * If they are different operators, then different expressions will be required.
- * <p>
- * <pre>
- * This must be followed by createExpressions for:
- * <code>INFIX_LEFT</code>
- * <code>INFIX_RIGHT</code>
- * extendedOperandCount times an: <code>INFIX_EXTENDED</code>
- * </pre>
- *
- * @param forExpression
- * @param operator The operator.
- * @param extendedOperandCount The number of extended operands. May be zero.
- * @throws IllegalStateException
- *
- * @see org.eclipse.jem.internal.proxy.common.IExpressionConstants#IN_AND
- * @since 1.0.0
- */
- public void createInfixExpression(ForExpression forExpression, InfixOperator operator, int extendedOperandCount) throws IllegalStateException;
-
- /**
- * Create an instanceof expression (e.g. <code>x instanceof java.lang.String</code>
- * <p>
- * This must be followed by createExpression for:
- * <code>INSTANCEOF_VALUE</code>
- * @param forExpression
- * @param type This is the type. It must be fully-qualified and if an inner class, it must have the "$" format.
- * @throws IllegalStateException
- *
- * @since 1.0.0
- */
- public void createInstanceofExpression(ForExpression forExpression, String type) throws IllegalStateException;
-
- /**
- * Create an instanceof expression (e.g. <code>x instanceof java.lang.String</code>
- * <p>
- * This must be followed by createExpression for:
- * <code>INSTANCEOF_VALUE</code>
- * @param forExpression
- * @param type This is the type.
- * @throws IllegalStateException
- * @throws IllegalArgumentException
- *
- * @since 1.0.0
- */
- public void createInstanceofExpression(ForExpression forExpression, IProxyBeanType type) throws IllegalStateException, IllegalArgumentException;
-
- /**
- * Create a method invocation expression (e.g. <code>java.lang.String.valueOf(10)</code>).
- * When using a string the method invoked will be the one most compatible with the arguments sent.
- * This allows overloading a method to occur when coming in from a parse tree, since the parse tree
- * doesn't know the exact method to use.
- * <p>
- * Note: At this time we require a receiver. In the future it may be possible to not have one, but
- * for that we need a <code>this</code> object to know who the receiver implicitly is.
- * The receiver may be a "type receiver" if it is a type, e.g. <code>java.awt.Color</code>.
- * <p>
- * This must be followed by createExpression for:
- * <code>METHOD_RECEIVER</code>
- * argumentCounts times expressions for: <code>METHOD_ARGUMENT</code>
- *
- * @param forExpression
- * @param name The name of the method
- * @param hasReceiver Has a receiver flag. Currently this must always be true.
- * @param argumentCount Count of number of arguments. May be zero.
- * @throws IllegalStateException
- * @throws IllegalArgumentException
- *
- * @see IExpression#createTypeReceiver(String)
- * @since 1.0.0
- */
- public void createMethodInvocation(ForExpression forExpression, String name, boolean hasReceiver, int argumentCount) throws IllegalStateException, IllegalArgumentException;
-
- /**
- * Create a method invocation expression (e.g. <code>java.lang.String.valueOf(10)</code>)
- * <p>
- * Note: At this time we require a receiver. In the future it may be possible to not have one, but
- * for that we need a <code>this</code> object to know who the receiver implicitly is.
- * The receiver may be a "type receiver" if it is a type, e.g. <code>java.awt.Color</code>.
- * <p>
- * This must be followed by createExpression for:
- * <code>METHOD_RECEIVER</code>
- * argumentCounts times expressions for: <code>METHOD_ARGUMENT</code>
- *
- * @param forExpression
- * @param methodProxy The proxy of the method
- * @param hasReceiver Has a receiver flag. Currently this must always be true.
- * @param argumentCount Count of number of arguments. May be zero.
- * @throws IllegalStateException
- * @throws IllegalArgumentException
- *
- * @see IExpression#createTypeReceiver(String)
- * @since 1.0.0
- */
- public void createMethodInvocation(ForExpression forExpression, IProxyMethod methodProxy, boolean hasReceiver, int argumentCount) throws IllegalStateException, IllegalArgumentException;
-
- /**
- * Create a prefix expression (e.g. <code>!flag</code> or <code>-(3+4)</code>).
- * If you are just trying to create a signed numeric literal, just use the createPrimitiveLiteral passing in a
- * negative value. You don't need to use prefix expression for that.
- * <p>
- * <pre>
- * This must be followed by createExpressions for:
- * <code>PREFIX_OPERAND</code>
- * </pre>
- * @param forExpression
- * @param operator The operator. The values come from IExpressionConstants, the prefix constants.
- * @throws IllegalStateException
- *
- * @see org.eclipse.jem.internal.proxy.common.IExpressionConstants#PRE_PLUS
- * @since 1.0.0
- */
- public void createPrefixExpression(ForExpression forExpression, PrefixOperator operator) throws IllegalStateException;
-
- /**
- * Create a reference to <code>null</code>.
- *
- * @param forExpression
- * @throws IllegalStateException
- *
- * @since 1.0.0
- */
- public void createNull(ForExpression forExpression) throws IllegalStateException;
-
- /**
- * Create a type literal (e.g. <code>java.lang.String.class</code>). This is used when the type is being used as value itself, not
- * as a receiver for a field or method or constructor or instanceof. Like as an argument to a method.
- * <p>
- * Note: If you want a type literal to be an IProxyBeanType, just use {@link IExpression#createProxyExpression(ForExpression, IProxy)} and pass in the
- * IProxyBeanType.
- *
- * @param forExpression
- * @param type This is the type. It must be fully-qualified and if an inner class, it must have the "$" format.
- * @throws IllegalStateException
- *
- * @since 1.0.0
- */
- public void createTypeLiteral(ForExpression forExpression, String type) throws IllegalStateException;
-
- /**
- * Create a type receiver. This is where a type is used as the receiver of a field access or a method invocation.
- * (e.g. <code>java.lang.String.valueOf(10)</code>). For this the "java.lang.String" IBeanTypeProxy is the type receiver.
- * <p>
- * This is unusual in that there is no forExpression. It isn't needed because these are only valid
- * in certain situations (method or field receiver) and if used anywhere else it is an error.
- *
- * @param type This is the type. It must be fully-qualified and if an inner class, it must have the "$" format.
- * @throws IllegalStateException
- *
- * @since 1.0.0
- */
- public void createTypeReceiver(String type) throws IllegalStateException;
-
- /**
- * Create a type receiver. This is where a type is used as the receiver of a field access or a method invocation.
- * (e.g. <code>java.lang.String.valueOf(10)</code>). For this the "java.lang.String" IProxyBeanType is the type receiver.
- * <p>
- * This is unusual in that there is no forExpression. It isn't needed because these are only valid
- * in certain situations (method or field receiver) and if used anywhere else it is an error.
- *
- * @param type This is the type proxy.
- * @throws IllegalStateException
- * @throws IllegalArgumentException
- *
- * @since 1.0.0
- */
- public void createTypeReceiver(IProxyBeanType type) throws IllegalStateException, IllegalArgumentException;
-
- /**
- * Create a boolean primitive literal (e.g. <code>true</code>).
- *
- * @param forExpression
- * @param value The boolean value for the literal.
- * @throws IllegalStateException
- *
- * @since 1.0.0
- */
- public void createPrimitiveLiteral(ForExpression forExpression, boolean value) throws IllegalStateException;
-
- /**
- * Create a character literal (e.g. <code>'a'</code> or <code>'\n'</code>)
- *
- * @param forExpression
- * @param value The character value for this literal.
- * @throws IllegalStateException
- *
- * @since 1.0.0
- */
- public void createPrimitiveLiteral(ForExpression forExpression, char value) throws IllegalStateException;
-
- /**
- * Create a byte literal (e.g. <code>(byte)10</code>)
- *
- * @param forExpression
- * @param value The byte value for this literal.
- * @throws IllegalStateException
- *
- * @since 1.0.0
- */
- public void createPrimitiveLiteral(ForExpression forExpression, byte value) throws IllegalStateException;
-
- /**
- * Create a double literal (e.g. <code>10d</code>)
- *
- * @param forExpression
- * @param value The double value for this literal.
- * @throws IllegalStateException
- *
- * @since 1.0.0
- */
- public void createPrimitiveLiteral(ForExpression forExpression, double value) throws IllegalStateException;
-
- /**
- * Create a float literal (e.g. <code>10f</code>)
- *
- * @param forExpression
- * @param value The float value for this literal.
- * @throws IllegalStateException
- *
- * @since 1.0.0
- */
- public void createPrimitiveLiteral(ForExpression forExpression, float value) throws IllegalStateException;
-
- /**
- * Create a int literal (e.g. <code>100000</code>)
- *
- * @param forExpression
- * @param value The int value for this literal.
- * @throws IllegalStateException
- *
- * @since 1.0.0
- */
- public void createPrimitiveLiteral(ForExpression forExpression, int value) throws IllegalStateException;
-
- /**
- * Create a long literal (e.g. <code>10l</code>)
- *
- * @param forExpression
- * @param value The long value for this literal.
- * @throws IllegalStateException
- *
- * @since 1.0.0
- */
- public void createPrimitiveLiteral(ForExpression forExpression, long value) throws IllegalStateException;
-
- /**
- * Create a short literal (e.g. <code>(short)10</code>)
- *
- * @param forExpression
- * @param value The short value for this literal.
- * @throws IllegalStateException
- *
- * @since 1.0.0
- */
- public void createPrimitiveLiteral(ForExpression forExpression, short value) throws IllegalStateException;
-
- /**
- * Create a string literal (e.g. <code>"asdf"</code>). The value is the actual string, with escapes already
- * translated into the true character values.
- *
- * @param forExpression
- * @param value The string value for this literal.
- * @throws IllegalStateException
- *
- * @since 1.0.0
- */
- public void createStringLiteral(ForExpression forExpression, String value) throws IllegalStateException;
-
- /**
- * Create a subexpression.
- * <p>
- * A subexpression allows, at any time, to fork off the expression stack and do some other sets of expressions.
- * When the cooresponding {@link #createSubexpressionEnd()} is called, all of the expression results on the
- * stack that accumulated during the subexpression evaluation will be thrown away and the stack will be
- * what it was at the start of subexpression. Any ExpressionProxies that were resolved during the evaluation
- * will not be thrown away and will still be valid.
- * <p>
- * This is useful if in the middle of an expression (such as method invocation and an argument is needed) to
- * go off and get the necessary value. This will allow expressions that require ROOTEXPRESSION state like a
- * try/catch. If you know the expression doesn't need this, then it is more efficient to not use subexpression.
- * <p>
- * For example:
- * <pre><code>
- * new XYZ(
- * {(subexpression)
- * try {
- * x = 3*y.get();
- * } catch (Exception e) {
- * x =4;
- * }
- * (end subexpression)}
- * x);
- * </code></pre>
- *
- * In the above example, we needed to calculate "x" as the argument for XYZ, but it was too complicated and
- * could throw exceptions. So we used a subexpression instead.
- * <p>
- * Of course the following would of been the better way to do it without subexpressions. But sometimes
- * your code is in a position that you don't know you need to do this until it is too late.
- * <pre><code>
- * try {
- * x = 3*y.get();
- * } catch (Exception e) {
- * x =4;
- * }
- * new XYZ(x);
- * </code></pre>
- * @throws IllegalStateException
- *
- * @since 1.1.0
- */
- public void createSubexpression() throws IllegalStateException;
-
- public void createSubexpressionEnd() throws IllegalStateException;
-
- /**
- * Create an expression that has an existing bean proxy as its value.
- *
- * @param forExpression This is for what expression this expression is being created.
- * @param proxy The proxy that should be used as a value, either a bean proxy or an expression proxy.
- * @throws IllegalStateException
- * @throws IllegalArgumentException
- *
- * @since 1.0.0
- */
- public void createProxyExpression(ForExpression forExpression, IProxy proxy) throws IllegalStateException, IllegalArgumentException;
-
- /**
- * Create an assignment expression between a VariableReference and an expression. The left operand must be a variable reference (e.g. FieldAccess or
- * ArrayAccess). The right operand may be any expression that results in a value.
- * <p>
- * <pre>
- * This must be followed by createExpressions for:
- * <code>ASSIGNMENT_LEFT</code>
- * <code>ASSIGNMENT_RIGHT</code>
- * </pre>
- * @param forExpression
- * @throws ThrowableProxy
- * @throws IllegalStateException
- * @throws NoExpressionValueException
- *
- * @since 1.1.0
- */
- public void createAssignmentExpression(ForExpression forExpression) throws IllegalStateException;
-
- /**
- * Create an assignment expression (e.g. x = 3+4) where x will be assigned to the ExpressionProxy.
- * It may be used later on as a value in {@link IExpression#createExpressionProxyExpression(int, ExpressionProxy)}.
- * Or if callbacks were added, the callbacks would be called to return the true IBeanProxy value of the expression proxy when the complete
- * IExpression has been evaluated. The value of the assignment expression (e.g. x) will be passed on into the next expression.
- * <p>
- * <pre>
- * This must be followed by createExpressions for:
- * <code>ASSIGNMENT_RIGHT</code>
- * </pre>
- * <p>
- * <b>Note:</b> It is guarenteed as part of the contract that expression proxies will be notified through the listeners of the final state in the
- * order the expression proxies were created.
- * @param forExpression This is for what expression this expression is being created.
- * @return a proxy to the expression value.
- * @throws IllegalStateException
- *
- * @since 1.1.0
- */
- public ExpressionProxy createProxyAssignmentExpression(ForExpression forExpression) throws IllegalStateException;
-
- /**
- * Create a reassignment expression. This is like the original proxy assignment except that instead of returning a new proxy, it
- * reassigns the new value to the existing proxy. This cannot be used on IBeanTypeExpressionProxy's. That is because
- * they are controlled by the registry and severe errors would occur if they were reassigned.
- * <p>
- * <pre>
- * This must be followed by createExpressions for:
- * <code>ASSIGNMENT_RIGHT</code>
- * </pre>
- * <p>
- * <b>Note:</b> Since we are not creating a new proxy, the notification on the callbacks will be in the original order of proxies. This
- * does not change the notification position of this proxy.
- *
- * @param forExpression
- * @param proxy
- * @throws IllegalStateException
- * @throws IllegalArgumentException if the expression proxy is for a BeanType instead of just a standard expression proxy.
- *
- * @since 1.1.0
- */
- public void createProxyReassignmentExpression(ForExpression forExpression, ExpressionProxy proxy) throws IllegalStateException, IllegalArgumentException;
-
- /**
- * A simple method invocation. This is a helper to make it easier for a simple method invoke. It uses only the
- * method proxy (not a string to look it up), it uses a IBeanProxy receiver (not a complicated expression), and the
- * arguments are a mixture of IBeanProxies and ExpressionProxies. Also it can be called only when the next
- * expression must be a RootExpression.
- *
- * @param method methodproxy of the method
- * @param receiver the receiver proxy or <code>null</code> if a static method
- * @param arguments array of arguments, where each element can only be either <code>null</code> for a null argument, <code>IProxy</code>. The array can be <code>null</code> if no arguments.
- * @param wantResult <code>true</code> if you want an ExpressionProxy back, otherwise it will return <code>null</code>. For performance reasons, only use <code>true</code> if you really need the expression proxy.
- * @return expression proxy if "wantResult" was true, else <code>null</code>.
- * @throws IllegalStateException
- * @throws IllegalArgumentException
- *
- * @since 1.1.0
- */
- public ExpressionProxy createSimpleMethodInvoke(IProxyMethod method, IProxy receiver, IProxy[] arguments, boolean wantResult) throws IllegalStateException, IllegalArgumentException;
-
- /**
- * A simple field access. This is a helper to make it easier for a simple field access. It uses only the
- * field proxy (not a string to look it up), and the bean proxy that is the receiver. Also it can be called only when the next
- * expression must be a RootExpression. It doesn't allow complicated field access, such as <code>fielda.fieldb.fieldc</code>.
- * Since this is a field access, it will always return an ExpressionProxy. It doesn't make sense to have a simple field access
- * that doesn't return one.
- *
- * @param field field proxy of the field.
- * @param receiver the receiver proxy. It may be <code>null</code> for static fields.
- * @return expression proxy to the result of the access.
- * @throws IllegalStateException
- * @throws IllegalArgumentException
- *
- * @since 1.1.0
- */
- public ExpressionProxy createSimpleFieldAccess(IProxyField field, IProxy receiver) throws IllegalStateException, IllegalArgumentException;
-
- /**
- * A simple field set. This is a helper to make it easier for a simple field access. It uses only the
- * field proxy (not a string to look it up), and the bean proxy that is the receiver. Also it can be called only when the next
- * expression must be a RootExpression. It doesn't allow complicated field access setting, such as <code>fielda.fieldb.fieldc = 3</code>.
- *
- * @param field field proxy of the field.
- * @param receiver the receiver proxy. It may be <code>null</code> if this is a static field.
- * @param value the value proxy to set it to or <code>null</code> if set to null value.
- * @param wantResult <code>true</code> if you want an ExpressionProxy back, otherwise it will return <code>null</code>. For performance reasons, only use <code>true</code> if you really need the expression proxy.
- * @return expression proxy if "wantResult" was true, else <code>null</code>.
- * @throws IllegalStateException
- * @throws IllegalArgumentException
- *
- * @since 1.1.0
- */
- public ExpressionProxy createSimpleFieldSet(IProxyField field, IProxy receiver, IProxy value, boolean wantResult) throws IllegalStateException, IllegalArgumentException;
-
- /**
- * Begin a block. No need for a forExpression because it must currently be at ROOTEXPRESSION.
- * <p>
- * Eventually {@link Expression#createBlockEnd()} must be called. You should use this pattern:
- * <pre><code>
- * exp.createBeginBlock();
- * try {
- * exp.create something else.
- * ...
- * } finally {
- * exp.createEndBlock();
- * }
- * </code></pre>
- *
- * @return blocknumber for the block just opened. Can be used in {@link Expression#createBlockBreak(int)}.
- * @throws IllegalStateException
- *
- * @since 1.1.0
- */
- public int createBlockBegin() throws IllegalStateException;
-
- /**
- * Does a break for the specified block number. No need for a forExpression because it must currently be at ROOTEXPRESSION.
- * @param blockNumber
- * @throws IllegalStateException
- *
- * @since 1.1.0
- */
- public void createBlockBreak(int blockNumber) throws IllegalStateException;
-
- /**
- * End a block. It will always end the inner most block that currently is on the stack. No need for a forExpression because it must currently be at ROOTEXPRESSION.
- * @throws IllegalStateException
- *
- * @see Expression#createBlockBegin()
- * @since 1.1.0
- */
- public void createBlockEnd() throws IllegalStateException;
-
- /**
- * Create a try/catch statement. No need for a forExpression because it must currently be at ROOTEXPRESSION.
- * There must be at least one catch or finally clause before try end or this is invalid.
- * <p>
- * This should be executed in the following way:
- * <pre><code>
- * exp.createTry();
- * try {
- * ... create other exceptions ...
- * ... create catch/finally clauses as needed.
- * } finally {
- * if (exp.isValid())
- * exp.createTryEnd();
- * }
- * </code></pre>
- * @throws IllegalStateException
- *
- * @since 1.1.0
- */
- public void createTry() throws IllegalStateException;
-
-
- /**
- * Create a catch clause for the inner most try statement. No need for a forExpression because it must currently be at ROOTEXPRESSION.
- * <p>
- * Using this you can get just the exception as a proxy and/or execute some expressions as part of the catch clause.
- * <p>
- * This can be followed by RootExpressions, or another catch, or a finally, or a try end.
- *
- * @param exceptionType the type of the exception to catch on.
- * @param wantExceptionReturned <code>true</code> if you want an expression proxy for the exception.
- * @return the ExpressionProxy for the exception if <code>wantExceptionReturned</code> is <code>true</code>, <code>null</code> otherwise.
- *
- * @throws IllegalStateException
- * @throws IllegalArgumentException
- * @since 1.1.0
- */
- public ExpressionProxy createTryCatchClause(IProxyBeanType exceptionType, boolean wantExceptionReturned) throws IllegalStateException, IllegalArgumentException;
-
- /**
- * Create a catch clause for the inner most try statement. No need for a forExpression because it must currently be at ROOTEXPRESSION.
- * <p>
- * Using this you can get just the exception as a proxy and/or execute some expressions as part of the catch clause.
- * <p>
- * This can be followed by RootExpressions, or another catch, or a finally, or a try end.
- *
- * @param exceptionType the type of the exception to catch on.
- * @param wantExceptionReturned <code>true</code> if you want an expression proxy for the exception.
- * @return the ExpressionProxy for the exception if <code>wantExceptionReturned</code> is <code>true</code>, <code>null</code> otherwise.
- *
- * @throws IllegalStateException
- * @since 1.1.0
- */
- public ExpressionProxy createTryCatchClause(String exceptionType, boolean wantExceptionReturned) throws IllegalStateException;;
-
- /**
- * Create a finally clause for the inner most try statement. No need for a forExpression because it must currently be at ROOTEXPRESSION.
- * There must be no more catch clauses for the try statement after this finally clause.
- *
- * @throws IllegalStateException
- * @since 1.1.0
- */
- public void createTryFinallyClause() throws IllegalStateException;;
-
- /**
- * Create the end of the inner most try statement. No need for a forExpression because it must currently be at ROOTEXPRESSION.
- * There must be no more catch/finally clauses after this except if a new try statement is started.
- *
- * @throws IllegalStateException
- * @since 1.1.0
- */
- public void createTryEnd() throws IllegalStateException;;
-
- /**
- * Create a throw. No need for a forExpression because it must currently be at ROOTEXPRESSION.
- * The next expression is the exception to be thrown.
- * <p>
- * This must be followed by createExpression for:
- * <code>THROW_OPERAND</code>
- *
- * @throws IllegalStateException
- *
- * @since 1.1.0
- */
- public void createThrow() throws IllegalStateException;
-
- /**
- * Create a rethrow. This must be within a catch clause or there is an error.
- * <p>
- * This is a shortcut for:
- * <pre><code>
- * try {
- * .. do something ..
- * } catch (AnException e) {
- * .. do something ..
- * throw e;
- * }
- * </code></pre>
- * @throws IllegalStateException
- *
- * @since 1.1.0
- */
- public void createRethrow() throws IllegalStateException;
-
-
- /**
- * Mark the expression stack so that if there are IllegalStateExceptions errors that would make the
- * expression invalid, you can restore back to this mark point and the expression will now be valid
- * again and at the state it was when mark was created. All marks must be ended, and at the same nesting
- * level.
- * <p>
- * No need for a forExpression because it must currently be at ROOTEXPRESSION.
- * <p>
- * It must be used in conjunction with endMark. You must use <code>mark;try/finally{endMark;}</code> because
- * the mark/endMark must match up.
- * <pre><code>
- * int mark = expression.mark();
- * try {
- * expression.create ...
- * } catch (IllegalStateException e) {
- * process the error.
- * } finally {
- * expression.endMark(mark); // After this, the expression will be valid again.
- * }
- * </code></pre>
- * <p>
- * However, the following code would be invalid nesting, and will throw an IllegalStateException on the createTryEnd. This is because
- * we tried to end the Try statement within the mark. This is invalid because if we let it go through it would
- * of popped the stack and when we got to the endMark the stack would of been popped past it and it could not
- * be restored to the same state as it was at the time of the mark. The try would of already been ended.
- * <pre><code>
- * expression.createTry();
- * int mark = expression.mark();
- * try {
- * expression.create ...
- * expression.createTryEnd();
- * } catch (IllegalStateException e) {
- * process the error. The expression is now invalid.
- * } finally {
- * expression.endMark(mark); // After this, the expression will be valid again, if it had gone invalid.
- * }
- * </code></pre>
- * <p>
- * If not at RootExpression at time of mark() request, an IllegalStateException will be thrown.
- * @return mark number, this number will be used in the cooresponding endMark.
- * @throws IllegalStateException
- *
- * @see IExpression#endMark(int)
- * @since 1.1.0
- */
- public int mark() throws IllegalStateException;
-
- /**
- * The end mark for a mark.
- * <p>
- * No need for a forExpression because it must currently be at ROOTEXPRESSION.
- * @param markNumber
- * @throws IllegalStateException
- *
- * @see IExpression#mark()
- * @since 1.1.0
- */
- public void endMark(int markNumber) throws IllegalStateException;
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IExtensionRegistration.java b/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IExtensionRegistration.java
deleted file mode 100644
index f3ebe3822..000000000
--- a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IExtensionRegistration.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 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.jem.internal.proxy.core;
-
-
-/**
- * Extensions point ("extensions" elements of the "org.eclipse.jem.proxy.contributors" extension point).
- * <p>
- * Implementers of this interface are called when the appropriate registry type for a given classPath/plugin is present.
- * It is used to register the registry type specific extensions.
- * @since 1.1.0
- */
-public interface IExtensionRegistration {
-
- /**
- * This will be called before any contributeToRegistry's have been called. Typically all that
- * should be done in here is to register extension factories or constants. It is best if no
- * actual proxy calls are made. This is because the registry does not yet have all of the
- * appropriate extensions registered and it would be possible to accidently reference a bean type
- * that has not yet had its appropriate factory registered.
- * <p>
- * <b>Note:</b> This may be called more than once if used in more than one extension or if used in a plugin and a container path and both are found.
- * Should take this into account and not register twice.
- * @param baseRegistry
- *
- * @since 1.1.0
- */
- public void register(BaseProxyFactoryRegistry baseRegistry);
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IFieldProxy.java b/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IFieldProxy.java
deleted file mode 100644
index b79db1b40..000000000
--- a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IFieldProxy.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.core;
-/*
-
-
- */
-
-
-/**
- * A Proxy to a field that allows the field value to be retrieved and set
- * This allows target VM proxying of the field and is analagous to the java.lang.Reflect.Field
- * in the same way IMethodProxy is analagous to java.lang.Reflect.Method
- * Creation date: (1/17/00 12:17:52 PM)
- * @author: Joe Winchester
- */
-public interface IFieldProxy extends IAccessibleObjectProxy, IProxyField {
-/**
- * Return the type of the field.
- */
-IBeanTypeProxy getFieldType();
-
-/**
- * Return the value of us on the subject argument.
- * If the field is a primitive type, the return proxy
- * will be of the primitive type too.
- * Creation date: (1/17/00 12:28:48 PM)
- */
-IBeanProxy get(IBeanProxy aSubject) throws ThrowableProxy;
-
-/**
- * Set the argument as the field value on the subject
- * Creation date: (1/17/00 12:28:48 PM)
- */
-void set(IBeanProxy aSubject, IBeanProxy argument) throws ThrowableProxy;
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IIntegerBeanProxy.java b/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IIntegerBeanProxy.java
deleted file mode 100644
index a8dd2b48d..000000000
--- a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IIntegerBeanProxy.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.core;
-/*
-
-
- */
-
-
-/**
- * Interface to an integer bean proxy.
- * We originally had only an Integer proxy,
- * so the use of it was throughout the system.
- * We are now supporting Number instead, but
- * because there were so many places using int,
- * we've left it in.
- * Creation date: (2/6/00 8:52:42 AM)
- * @author: Joe Winchester
- */
-public interface IIntegerBeanProxy extends INumberBeanProxy {
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IInvokable.java b/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IInvokable.java
deleted file mode 100644
index c55167500..000000000
--- a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IInvokable.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 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.jem.internal.proxy.core;
-
-
-/**
- * Interface for invoking method calls on the vm.
- * IMethodProxy implements it for when you have a method proxy available,
- * but you can also get a straight invokable which will get the
- * proxy on the vm at the time of execution.
- * <p>
- * The method proxy factory can be used to return either method
- * proxies when the invokable will be used over and over, and
- * it can return IInvokable's when it is one shot deal. Though even
- * when one-shot deal it can be used over and over. There is just overhead because the
- * method is looked up each time. So a reasonable compromise would be if
- * using it infrequently or use closely together once or twice it is better
- * to use a Invokable instead of a method proxy.
- * @since 1.0.0
- */
-public interface IInvokable {
-
- /**
- * Invoke us on the subject
- * Creation date: (12/3/99 11:37:12 AM)
- * @author Joe Winchester
- */
- IBeanProxy invoke(IBeanProxy subject) throws ThrowableProxy;
-
- /**
- * Invoke us on the subject with the specified argument
- * Creation date: (12/3/99 11:37:12 AM)
- * @author Joe Winchester
- */
- IBeanProxy invoke(IBeanProxy subject, IBeanProxy argument) throws ThrowableProxy;
-
- /**
- * Invoke us on the subject with the specified arguments
- * Creation date: (12/3/99 11:37:12 AM)
- * @author Joe Winchester
- */
- IBeanProxy invoke(IBeanProxy subject, IBeanProxy[] arguments) throws ThrowableProxy;
-
- /**
- * Invoke us on the subject, however catch all exceptions
- * Only to be used when you don't want ThrowableExceptions. This should
- * not be the normal way to invoke.
- * Creation date: (12/3/99 11:37:12 AM)
- * @author Joe Winchester
- */
- IBeanProxy invokeCatchThrowableExceptions(IBeanProxy subject);
-
- /**
- * Invoke us on the subject with the specified argument, however catch all exceptions
- * Only to be used when you don't want ThrowableExceptions. This should
- * not be the normal way to invoke.
- * Creation date: (12/3/99 11:37:12 AM)
- * @author Joe Winchester
- */
- IBeanProxy invokeCatchThrowableExceptions(IBeanProxy subject, IBeanProxy argument);
-
- /**
- * Invoke us on the subject with the specified arguments, however catch all exceptions
- * Only to be used when you don't want ThrowableExceptions. This should
- * not be the normal way to invoke.
- * Creation date: (12/3/99 11:37:12 AM)
- * @author Joe Winchester
- */
- IBeanProxy invokeCatchThrowableExceptions(IBeanProxy subject, IBeanProxy[] arguments);
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IMethodProxy.java b/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IMethodProxy.java
deleted file mode 100644
index e04442c40..000000000
--- a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IMethodProxy.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.core;
-
-/**
- * Interface for Method Proxies Creation date: (12/3/99 11:36:29 AM)
- *
- * @author: Joe Winchester
- */
-public interface IMethodProxy extends IAccessibleObjectProxy, IInvokable, IProxyMethod {
-
- /**
- * Answer the class the method is defined in. Creation date: (12/3/99 11:37:12 AM)
- *
- * @author Joe Winchester
- */
- IBeanTypeProxy getClassType();
-
- /**
- * Answer the name of the method Creation date: (12/3/99 11:37:12 AM)
- *
- * @author Joe Winchester
- */
- String getName();
-
- /**
- * Answer the parameter types of the method Creation date: (12/3/99 11:37:12 AM)
- *
- * @author Joe Winchester
- */
- IBeanTypeProxy[] getParameterTypes();
-
- /**
- * Answer the return type of the method Creation date: (12/3/99 11:37:12 AM)
- *
- * @author Joe Winchester
- */
- IBeanTypeProxy getReturnType();
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IMethodProxyFactory.java b/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IMethodProxyFactory.java
deleted file mode 100644
index 216cdcc1a..000000000
--- a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IMethodProxyFactory.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.core;
-
-/**
- * Factory for creating method proxies.
- *
- * The factory exists for use, but generally it is better to go through the bean type proxy to get a method proxy. This is useful for setting up a
- * bunch of method proxies in initialization routines so you don't need to have a bean type proxy for each.
- *
- * Creation date: (12/3/99 6:21:52 PM)
- *
- * @author: Joe Winchester
- */
-public interface IMethodProxyFactory extends IBeanProxyFactory {
-
- /**
- * Return a method proxy for the specified name, arguments from the class.
- *
- * @param className
- * @param methodName
- * @param parameterTypes
- * parameter type names or <code>null</code> for parameterTypes means no parameters.
- * @return a method proxy or null if can't be found.
- * @since 1.0.0
- */
- IMethodProxy getMethodProxy(String className, String methodName, String[] parameterTypes);
-
- /**
- * Return an IProxyMethod for the specified name, arguments from the given class.
- * @param expression
- * @param className
- * @param methodName
- * @param parameterTypes
- * @return
- *
- * @since 1.1.0
- */
- IProxyMethod getMethodProxy(IExpression expression, String className, String methodName, String[] parameterTypes);
-
- /**
- * Return an IProxyField for the specified name, arguments from the given class.
- * @param expression
- * @param className
- * @param fieldName
- * @return
- *
- * @since 1.1.0
- */
- IProxyField getFieldProxy(IExpression expression, String className, String fieldName);
-
-
- /**
- * Return an invokable for the specified name, arguments from the class. The method proxy is not retrieved. Instead the method will be looked up
- * each time on the vm. Because of this these are suitable only for one-shot invokations. If it is to be invoked often, then a method proxy should
- * be retrieved instead.
- * <p>
- * Though typical for one-shot deal the invokable can be used over and over. There is just overhead because the method is looked up each time. So a reasonable compromise
- * would be if using it infrequently or is used closely together once or twice it is better to use a Invokable instead of a method proxy.
- * <p>
- * Note there is no guarantee that the method is available. This won't be known until the actual invoke is done.
- *
- * @param className
- * @param methodName
- * @param parameterTypes
- * parameter type names or <code>null</code> for parameterTypes means no parameters.
- * @return an invokable
- * @since 1.0.0
- */
- IInvokable getInvokable(String className, String methodName, String[] parameterTypes);
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/INumberBeanProxy.java b/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/INumberBeanProxy.java
deleted file mode 100644
index efe7a4297..000000000
--- a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/INumberBeanProxy.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.core;
-/*
-
-
- */
-
-
-/**
- * Interface to an integer bean proxy.
- * Creation date: (2/6/00 8:52:42 AM)
- * @author: Joe Winchester
- */
-public interface INumberBeanProxy extends IBeanProxy {
-/**
- * Return the primitive byte value of the proxied Number
- * Creation date: (2/6/00 8:52:59 AM)
- */
-byte byteValue();
-/**
- * Return the primitive double value of the proxied Number
- * Creation date: (2/6/00 8:52:59 AM)
- */
-double doubleValue();
-/**
- * Return the primitive float value of the proxied Number
- * Creation date: (2/6/00 8:52:59 AM)
- */
-float floatValue();
-/**
- * Return the primitive int value of the proxied Number
- * Creation date: (2/6/00 8:52:59 AM)
- */
-int intValue();
-/**
- * Return the primitive long value of the proxied Number
- * Creation date: (2/6/00 8:52:59 AM)
- */
-long longValue();
-/**
- * Return the value as a Number.
- * Creation date: (2/6/00 8:52:59 AM)
- */
-Number numberValue();
-/**
- * Return the primitive short value of the proxied Number
- * Creation date: (2/6/00 8:52:59 AM)
- */
-short shortValue();
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IPDEContributeClasspath.java b/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IPDEContributeClasspath.java
deleted file mode 100644
index 6c1687066..000000000
--- a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IPDEContributeClasspath.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 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.jem.internal.proxy.core;
-
-import org.eclipse.core.runtime.CoreException;
-
-
-/**
- * Contribute to classpath PDE entries that are needed for a launch.
- * <p>
- * Use the <code>INSTANCE()</code> to access the contributor. If the value
- * is <code>null</code>, then PDE is not available.
- *
- * @since 1.0.2
- */
-public interface IPDEContributeClasspath {
-
- public static IPDEContributeClasspath INSTANCE = PDEContributeClasspathInstance.getInstance();
-
- /**
- * Return the classpath contributions for the plugins in the given project.
- * <p>
- * This will add in the libraries from any fragments of any plugin that this
- * project references, either directly or indirectly through other plugins.
- * <p>
- * It is used by launches to get the fragment libraries since these are not
- * added by default to the classpath for a project by PDE. That is because they
- * aren't needed for compilation purposes, but they are needed for running.
- *
- * @param controller the controller to contribute to.
- * @param info configuration info for the project
- * @throws CoreException
- *
- * @since 1.0.2
- */
- public abstract void getPDEContributions(IConfigurationContributionController controller, IConfigurationContributionInfo info) throws CoreException;
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IPointBeanProxy.java b/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IPointBeanProxy.java
deleted file mode 100644
index a41a51aa5..000000000
--- a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IPointBeanProxy.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.core;
-/*
-
-
- */
-
-
-/**
- * Interface to a Point bean proxy.
- * <p>
- * These are common for different windowing systems, e.g. AWT and SWT. So this here
- * is common interface for them.
- * Creation date: (4/7/00 3:46:39 PM)
- * @author: Administrator
- */
-public interface IPointBeanProxy extends IBeanProxy {
- public int getX();
- public int getY();
- public void setX(int x);
- public void setY(int y);
- public void setLocation(int x, int y);
- public void setLocation(IPointBeanProxy point);
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IProxy.java b/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IProxy.java
deleted file mode 100644
index dfaf838a6..000000000
--- a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IProxy.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 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.jem.internal.proxy.core;
-
-
-/**
- * A common interface for proxies. It is used by the expression processor to easily distinquish between
- * a proxy and an Expression proxy.
- * @since 1.1.0
- */
-public interface IProxy {
-
- /**
- * Return the registry this proxy was created with.
- * @return
- *
- * @since 1.1.0
- */
- public ProxyFactoryRegistry getProxyFactoryRegistry();
-
- /**
- * Is this a bean proxy (including all of the subinterfaces of it, like IMethodProxy).
- * @return <code>true</code> if this is a bean proxy.
- *
- * @since 1.1.0
- */
- public boolean isBeanProxy();
-
- /**
- * Is this an expression proxy.
- * @return <code>true</code> if this is an expression proxy.
- *
- * @since 1.1.0
- */
- public boolean isExpressionProxy();
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IProxyBeanType.java b/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IProxyBeanType.java
deleted file mode 100644
index 59635a732..000000000
--- a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IProxyBeanType.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 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.jem.internal.proxy.core;
-
-
-/**
- * This interface is for IBeanTypeProxy's and BeanTypeExpressionProxy's so that we can lazily
- * get the beantype proxy and have the expression process it when needed.
- *
- * @since 1.1.0
- */
-public interface IProxyBeanType extends IProxy {
-
- /**
- * Answer the name of the type we are proxying This is the fully qualified name. For arrays it will return the format: [Lclassname;
- * @return
- *
- * @since 1.1.0
- */
- public String getTypeName();
-
- /**
- * Get the IProxyMethod for the method from this beantype. It may be either a resolved method proxy (if already resolved) or
- * it may be an ExpressionProxy if not yet resolved.
- *
- * @param expression
- * @param methodName
- * @param parameterTypes array of parameter types or <code>null</code> if no parameters.
- * @return
- *
- * @since 1.1.0
- */
- public IProxyMethod getMethodProxy(IExpression expression, String methodName, IProxyBeanType[] parameterTypes);
-
- /**
- * Get the IProxyMethod for the method from this beantype where the method has no arguments. It may be either a resolved method proxy (if already resolved) or
- * it may be an ExpressionProxy if not yet resolved.
- * <p>
- * This is a shortcut for getMethodProxy() that takes arguments names where the names have been sent as null.
- *
- * @param expression
- * @param methodName
- * @return
- *
- * @since 1.1.0
- */
- public IProxyMethod getMethodProxy(IExpression expression, String methodName);
-
- /**
- * Get the IProxyMethod for the method from this beantype. It may be either a resolved method proxy (if already resolved) or
- * it may be an ExpressionProxy if not yet resolved.
- *
- * @param expression
- * @param methodName
- * @param parameterTypes array of parameter types or <code>null</code> if no parameters.
- * @return
- *
- * @since 1.1.0
- */
- public IProxyMethod getMethodProxy(IExpression expression, String methodName, String[] parameterTypes);
-
- /**
- * Get the IProxyyField for the field from this beantype. It may be either a resolved field proxy (if already resolved) or
- * it may be an ExpressionProxy if not yet resolved.
- *
- * @param expression
- * @param fieldName
- * @return
- *
- * @since 1.1.0
- */
- public IProxyField getFieldProxy(IExpression expression, String fieldName);
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IProxyConstants.java b/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IProxyConstants.java
deleted file mode 100644
index 0d819f3f6..000000000
--- a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IProxyConstants.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 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.jem.internal.proxy.core;
-
-/**
- * Constants used with the plugin xml.
- *
- * @since 1.0.0
- */
-public interface IProxyConstants {
-
- /**
- * Launch group id for proxy launch configurations.
- */
- public static final String ID_PROXY_LAUNCH_GROUP = "org.eclipse.jem.proxy"; //$NON-NLS-1$
-
- /**
- * Launch configuration type for local proxy. It is local in that it is on the same machine, but a different
- * VM then the one running the IDE.
- *
- * It here because this is the default config type when no launch config specified for a project.
- */
- public static final String LOCAL_LAUNCH_TYPE = "org.eclipse.jem.proxy.LocalProxyLaunchConfigurationType"; //$NON-NLS-1$
-
- /**
- * Attribute on Proxy Launch Configuration:
- *
- * Key used in Launch Configuration for attaching AWT/Swing to the registry. This means simply
- * that AWT/Swing should be treated as being in the registry or not. It doesn't actually prevent
- * them from being there.
- *
- * The default value for this attribute is "true", so it should be set only to "false".
- */
- public static final String ATTRIBUTE_AWT_SWING = "org.eclipse.jem.proxy.AWT/Swing"; //$NON-NLS-1$
-
- /**
- * Attribute on Proxy Launch Configuration:
- *
- * Key used in Launch Configuration for the contributors and returning the registry. After retrieving key,
- * go back to ProxyLaunchSupport to retrieve the contributors. And it uses it to return the registry.
- *
- * Not to be set by contributors. This will be set only by the ProxyLaunchSupport start implementation methods.
- * It is here only because external developer's launch configurations will need to be able to access this.
- */
- public static final String ATTRIBUTE_LAUNCH_KEY = "org.eclipse.jem.proxy.LaunchKey"; //$NON-NLS-1$
-
- /**
- * Attribute on Proxy Launch Configuration:
- *
- * VM title used for the launch registry.
- *
- * Not to be set by contributors. This will be set only by the ProxyLaunchSupport start implementation methods.
- * It is here only because external developer's launch configurations will need to be able to access this.
- */
- public static final String ATTRIBUTE_VM_TITLE = "org.eclipse.jem.proxy.vmtitle"; //$NON-NLS-1$
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IProxyField.java b/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IProxyField.java
deleted file mode 100644
index 1f2e1da3a..000000000
--- a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IProxyField.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 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.jem.internal.proxy.core;
-
-
-/**
- * This interface is for IFieldProxy's and FieldExpressionProxy's so that we can lazily
- * get the field proxy and have the expression process it when needed.
- * @since 1.1.0
- */
-public interface IProxyField extends IProxy {
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IProxyMethod.java b/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IProxyMethod.java
deleted file mode 100644
index f260a234f..000000000
--- a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IProxyMethod.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 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.jem.internal.proxy.core;
-
-
-/**
- * This interface is for IMethodProxy's and MethodExpressionProxy's so that we can lazily
- * get the method proxy and have the expression process it when needed.
- *
- * @since 1.1.0
- */
-public interface IProxyMethod extends IProxy {
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IRectangleBeanProxy.java b/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IRectangleBeanProxy.java
deleted file mode 100644
index f38660d37..000000000
--- a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IRectangleBeanProxy.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.core;
-/*
-
-
- */
-
-
-/**
- * Interface to a Rectangle bean proxy.
- * <p>
- * These are common for different windowing systems, e.g. AWT and SWT. So this here
- * is common interface for them.
- * Creation date: (4/7/00 3:46:39 PM)
- * @author: Administrator
- */
-public interface IRectangleBeanProxy extends IBeanProxy {
- public int getX();
- public int getY();
- public void setX(int x);
- public void setY(int y);
- public void setLocation(int x, int y);
- public void setLocation(IPointBeanProxy point);
-
- public int getHeight();
- public int getWidth();
- public void setHeight(int height);
- public void setWidth(int width);
- public void setSize(int width, int height);
- public void setSize(IDimensionBeanProxy dim);
-
- public void setBounds(int x, int y, int width, int height);
- public void setBounds(IRectangleBeanProxy rect);
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IStandardBeanProxyFactory.java b/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IStandardBeanProxyFactory.java
deleted file mode 100644
index 4353e522c..000000000
--- a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IStandardBeanProxyFactory.java
+++ /dev/null
@@ -1,202 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.core;
-
-
-/*
-
-
- */
-
-
-/**
- * The Standard base bean proxy factory.
- * This is the Interface that the desktop will talk
- * to.
- * Creation date: (12/3/99 11:52:09 AM)
- * @author: Joe Winchester
- */
-public interface IStandardBeanProxyFactory extends IBeanProxyFactory {
-
-/**
- * Get the {@link org.eclipse.jem.internal.proxy.common.IVMServer} proxy for the
- * this registry. This is only needed if you need to give the IVMserver to a proxy so that
- * it can access it.
- * <p>
- * <b>Note:</b> Does not need to be given to callback proxies because they are given
- * an {@link org.eclipse.jem.internal.proxy.common.IVMCallbackServer} on initialization, and
- * that interface implements the IVMServer interface too.
- *
- * @return
- *
- * @since 1.1.0
- */
-public IBeanProxy getIVMServerProxy();
-/**
- * Return a new bean proxy for the primitive integer argument
- * Creation date: (12/3/99 11:52:20 AM)
- * @author Joe Winchester
- */
-public IIntegerBeanProxy createBeanProxyWith(int aPrimitiveInteger);
-/**
- * Return a new bean proxy for the primitive character argument
- * Creation date: (12/3/99 11:52:20 AM)
- * @author Joe Winchester
- */
-public ICharacterBeanProxy createBeanProxyWith(char aPrimitiveCharacter);
-/**
- * Return a new bean proxy for the primitive byte argument
- * Creation date: (12/3/99 11:52:20 AM)
- * @author Joe Winchester
- */
-public INumberBeanProxy createBeanProxyWith(byte aPrimitiveByte);
-/**
- * Return a new bean proxy for the primitive short argument
- * Creation date: (12/3/99 11:52:20 AM)
- * @author Joe Winchester
- */
-public INumberBeanProxy createBeanProxyWith(short aPrimitiveShort);
-/**
- * Return a new bean proxy for the primitive long argument
- * Creation date: (12/3/99 11:52:20 AM)
- * @author Joe Winchester
- */
-public INumberBeanProxy createBeanProxyWith(long aPrimitiveLong);
-/**
- * Return a new bean proxy for the primitive float argument
- * Creation date: (12/3/99 11:52:20 AM)
- * @author Joe Winchester
- */
-public INumberBeanProxy createBeanProxyWith(float aPrimitiveFloat);
-/**
- * Return a new bean proxy for the primitive double argument
- * Creation date: (12/3/99 11:52:20 AM)
- * @author Joe Winchester
- */
-public INumberBeanProxy createBeanProxyWith(double aPrimitiveDouble);
-/**
- * Return a new bean proxy for the Boolean argument
- * Creation date: (12/3/99 11:52:20 AM)
- * @author Joe Winchester
- */
-public IBooleanBeanProxy createBeanProxyWith(Boolean aBoolean);
-/**
- * Return a new bean proxy for the Integer argument
- * Creation date: (12/3/99 11:52:20 AM)
- * @author Joe Winchester
- */
-public IIntegerBeanProxy createBeanProxyWith(Integer anInteger);
-/**
- * Return a new bean proxy for the Character argument
- * Creation date: (12/3/99 11:52:20 AM)
- * @author Joe Winchester
- */
-public ICharacterBeanProxy createBeanProxyWith(Character aCharacter);
-/**
- * Return a new bean proxy for the Number argument, can handle any of the numbers.
- * Creation date: (12/3/99 11:52:20 AM)
- * @author Joe Winchester
- */
-public INumberBeanProxy createBeanProxyWith(Number aNumber);
-/**
- * Return a new bean proxy for the string argument
- * Creation date: (12/3/99 11:52:20 AM)
- * @author Joe Winchester
- */
-public IStringBeanProxy createBeanProxyWith(String aString);
-
-/**
- * Convert the non-primitive proxy to a primitive proxy, if it
- * of one of the wrapper types. If not, then just return the proxy as is.
- * <p>
- * I.E. BooleanClassProxy will convert to BooleanTypeProxy, but ObjectClassProxy will just return unchanged.
- * @param nonPrimitiveProxy
- * @return either the primitive proxy that nonPrimitive wrappers, or the non-primitive if not a wrapper type.
- *
- * @since 1.0.0
- */
-public IBeanProxy convertToPrimitiveBeanProxy(IBeanProxy nonPrimitiveProxy);
-/**
- * Return a new bean proxy for the boolean argument
- * Creation date: (12/3/99 11:52:20 AM)
- * @author Joe Winchester
- */
-public IBooleanBeanProxy createBeanProxyWith(boolean aBoolean);
-/**
- * Create an array bean proxy.
- *
- * - (int, new int[2] {3, 4}) will create:
- * int [3] [4]
- *
- * - (int[], new int[1] {1})
- * int [1]
- *
- * - (int[], new int[2] {2,3})
- * int [2] [3]
- *
- *
- * - (int[], null) or (int[], new int[0]) or (int, null) or (int, new int[0])
- * int [0]...
- * or
- * (int[][]..., null) or (int[][]..., new int[0])
- * int[0][]...
- * This is because an array instance with no specified dimensions is not valid.
- *
- * - (int[][], new int[1] {3})
- * int[3][]
- */
-public IArrayBeanProxy createBeanProxyWith(IBeanTypeProxy type, int[] dimensions) throws ThrowableProxy;
-/**
- * Create a one-dimensional array.
- * The result will be the same as calling
- * createBeanProxyWith(IBeanTypeProxy type, new int[1] {x})
- * where 'x' is the value passed in as the dimension.
- */
-public IArrayBeanProxy createBeanProxyWith(IBeanTypeProxy type, int dimension) throws ThrowableProxy;
-
-/**
- * Create a bean proxy from an initialization string.
- * <p>
- * It is not recommended that this method be commonly used. That is because no type checking will be performed
- * on the result. Whatever it evaluates to be will be what it is. It is useful for the rare cases where the desired
- * result type is not known.
- * <p>
- * It is recommended instead to use the newInstance(initString) method on the appropriate IBeanTypeProxy so that the
- * result can be type-checked to make sure the string evaluates to something of that type.
- *
- * @param initializationString
- * @return
- * @throws ThrowableProxy
- * @throws InstantiationException
- * @throws ClassCastException
- *
- * @since 1.0.0
- */
-public IBeanProxy createBeanProxyFrom(String initializationString) throws ThrowableProxy, InstantiationException, ClassCastException;
-
-/**
- * Release the proxy. In the case of Remote VM, this means
- * it will remove the proxy on the client side, and remove
- * the reference to the real object on the server side. On the server
- * side the real object may not go away because something else could
- * be holding onto it, but it won't be held simply because the client
- * is holding onto it.
- */
-public void releaseProxy(IBeanProxy proxy);
-
-/**
- * Create an expression.
- * @return The expression.
- *
- * @since 1.0.0
- */
-public IExpression createExpression();
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IStandardBeanTypeProxyFactory.java b/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IStandardBeanTypeProxyFactory.java
deleted file mode 100644
index 77df7e9de..000000000
--- a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IStandardBeanTypeProxyFactory.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.core;
-/*
-
-
- */
-
-import java.util.Set;
-/**
- * The standard bean type proxy factory.
- * This is the Interface that the desktop will talk
- * to, the one that is returned when getCurrent() is called.
- * Creation date: (3/10/00 11:00:50 AM)
- * @author: Richard Lee Kulp
- */
-public interface IStandardBeanTypeProxyFactory extends IBeanProxyFactory {
-
-/**
- * Used by other registered bean type proxy factories to
- * register their bean type proxies with the standard factory
- * so that it will be cached there.
- * <p><b>Note:</b> This is not meant to be called by customers. It is here for the usage
- * of registry extensions.
- * @param aBeanTypeProxy
- * @param permanent indicates that beantype will never be released,
- * not even if explicit request is made.
- *
- * @since 1.1.0
- */
-void registerBeanTypeProxy(IBeanTypeProxy aBeanTypeProxy, boolean permanent);
-
-/**
- * Used by other registered bean type proxy factories to
- * register their proxy bean type with the standard factory
- * so that it will be cached there.
- * <p><b>Note:</b> This is not meant to be called by customers. It is here for the usage
- * of registry extensions.
- * @param aBeanTypeProxy
- * @param permanent indicates that beantype will never be released,
- * not even if explicit request is made.
- *
- * @since 1.1.0
- */
-void registerBeanTypeProxy(IProxyBeanType aBeanTypeProxy, boolean permanent);
-
-/**
- * Return the beanType proxy for the given class name.
- * It must be fully qualified. And for arrays it can handle
- * either the jni type ([Ljava.lang.Object;) or the Java EMF Model
- * formal type (java.lang.Object[]).
- */
-IBeanTypeProxy getBeanTypeProxy(String className);
-
-/**
- * Get the beantype proxy suitable for an expression.
- *
- * @param expression
- * @param typeName
- * @return
- *
- * @since 1.1.0
- */
-IProxyBeanType getBeanTypeProxy(IExpression expression, String typeName);
-
-/**
- * Return an Array type proxy for the given class name of
- * the specified dimensions. This is a helper method. The
- * same result can be gotton from getBeanTypeProxy.
- * e.g.
- * getBeanTypeProxy("java.lang.Object", 3)
- * is the same as:
- * getBeanTypeProxy("[[[Ljava.lang.Object;")
- *
- * They both result in a type of:
- * Object [][][]
- *
- * or if using the JNI format (proxy format)
- * getBeanTypeProxy("[Ljava.langObject;", 3)
- * becomes
- * Object [][][][]
- *
- * or if using the standard java format (as in actual code)
- * getBeanTypeProxy("java.langObject[];", 3)
- * becomes
- * Object [][][][]
- */
-IBeanTypeProxy getBeanTypeProxy(String componentClassName, int dimensions);
-
-/**
- * Return an Array type proxy for the given class name of
- * the specified dimensions. This is a helper method. The
- * same result can be gotton from getBeanTypeProxy.
- * e.g.
- * getBeanTypeProxy("java.lang.Object", 3)
- * is the same as:
- * getBeanTypeProxy("[[[Ljava.lang.Object;")
- *
- * They both result in a type of:
- * Object [][][]
- *
- * or if using the JNI format (proxy format)
- * getBeanTypeProxy("[Ljava.langObject;", 3)
- * becomes
- * Object [][][][]
- *
- * or if using the standard java format (as in actual code)
- * getBeanTypeProxy("java.langObject[];", 3)
- * becomes
- * Object [][][][]
- *
- * @param expression
- * @param componentClassName
- * @param dimensions
- * @return
- *
- * @since 1.1.0
- */
-IProxyBeanType getBeanTypeProxy(IExpression expression, String componentClassName, int dimensions);
-
-/**
- * Test if a specific bean type has been registered. Don't access and create
- * if it isn't currently registered.
- */
-boolean isBeanTypeRegistered(String className);
-
-/**
- * Registered types. Return a set of strings that are the registered classes.
- * This Set isn't synchronized, there may be changes while accessing it.
- */
-Set registeredTypes();
-
-/**
- * Maintain list of not found types. This list is types that were requested,
- * but didn't exist. This method sets whether list should be maintained or not.
- * If set to false, the list will be empty. The default is false.
- *
- * @param maintain
- */
-void setMaintainNotFoundTypes(boolean maintain);
-
-/**
- * Maintain list of not found types. This list is types that were requested,
- * but didn't exist. This method returns whether list should be maintained or not.
- * If false, the list will be empty. The default is false.
- *
- * @return maintaining not found types.
- */
-boolean isMaintainNotFoundTypes();
-
-/**
- * Maintain list of not found types. This list is types that were requested,
- * but didn't exist.
- *
- * @param className Classname to search for to see if ever not found.
- * @return true if the bean type had been searched for but was not found. If not maintaining, then result will be false.
- */
-boolean isBeanTypeNotFound(String className);
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IStringBeanProxy.java b/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IStringBeanProxy.java
deleted file mode 100644
index 2078fad25..000000000
--- a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IStringBeanProxy.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.core;
-/*
-
-
- */
-
-
-/**
- * Optimized implementation that should be used for string proxies that
- * allows the IDE VM to get the string value easily
- * Creation date: (2/6/00 8:58:22 AM)
- * @author: Joe Winchester
- */
-public interface IStringBeanProxy extends IBeanProxy {
-/**
- * Return the proxied string as a string that the IDE can use
- * Creation date: (2/6/00 8:58:32 AM)
- */
-String stringValue();
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IUIRunner.java b/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IUIRunner.java
deleted file mode 100644
index 9356c2d2f..000000000
--- a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IUIRunner.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 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.jem.internal.proxy.core;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-
-
-/**
- * Interface that doesn't require UI. The implementation will. This will
- * only be used if within UI environment.
- *
- * <package-protected> because should only be used within here.
- *
- * @since 1.0.0
- */
-interface IUIRunner {
- /**
- * Handle the build. If not in UI thread, just call back to ProxyLaunchSupport
- * to handle the build. If on UI thread, then use the IProgressService to do it.
- * This will keep the UI from "locking", though it will be disabled it won't deadlock.
- *
- * @param pm
- *
- * @since 1.0.0
- */
- public void handleBuild(IProgressMonitor pm) throws CoreException;
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IteratorBeanProxyWrapper.java b/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IteratorBeanProxyWrapper.java
deleted file mode 100644
index 43f64fc98..000000000
--- a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IteratorBeanProxyWrapper.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.core;
-/*
-
-
- */
-
-
-import java.text.MessageFormat;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-/**
- * This is a wrapper for an java.util.Iterator proxy.
- * It provides the iterator methods to interface to
- * the proxy.
- */
-
-public class IteratorBeanProxyWrapper {
- protected final IBeanProxy fIterator;
- protected final JavaStandardBeanProxyConstants fConstants;
-
- /**
- * Construct with the collection.
- */
- public IteratorBeanProxyWrapper(IBeanProxy anIteratorProxy) {
- if (!anIteratorProxy.getTypeProxy().isKindOf(anIteratorProxy.getProxyFactoryRegistry().getBeanTypeProxyFactory().getBeanTypeProxy("java.util.Iterator"))) //$NON-NLS-1$
- throw new ClassCastException(MessageFormat.format(ProxyMessages.ClassCast_EXC__IncorrectType, new Object[] {anIteratorProxy.getTypeProxy().getTypeName(), "java.util.Iterator"})); //$NON-NLS-1$
- else
- fIterator = anIteratorProxy;
-
- fConstants = JavaStandardBeanProxyConstants.getConstants(anIteratorProxy.getProxyFactoryRegistry());
- }
-
- /**
- * Answer the iterator proxy that this is wrappering.
- */
- public IBeanProxy getBeanProxy() {
- return fIterator;
- }
-
- /**
- * equals - Pass it on to the proxy to handle this.
- */
- public boolean equals(Object object) {
- return fIterator.equals(object);
- }
-
- /**
- * hashCode - Pass it on to the proxy to handle this.
- */
- public int hashCode() {
- return fIterator.hashCode();
- }
-
- /**
- * Iterator accessors
- */
- public boolean hasNext() {
- try {
- return ((IBooleanBeanProxy) fConstants.getIteratorHasNext().invoke(fIterator)).booleanValue();
- } catch (ThrowableProxy e) {
- // This shouldn't occur, so just log it.
- ProxyPlugin.getPlugin().getLogger().log(new Status(IStatus.ERROR, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, ProxyMessages.UnexpectedException_EXC_, e));
- return false;
- }
- }
- public IBeanProxy next() throws ThrowableProxy {
- return fConstants.getIteratorNext().invoke(fIterator);
- }
- public void remove() throws ThrowableProxy {
- fConstants.getIteratorRemove().invoke(fIterator);
- }
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/JavaStandardBeanProxyConstants.java b/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/JavaStandardBeanProxyConstants.java
deleted file mode 100644
index df46f1607..000000000
--- a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/JavaStandardBeanProxyConstants.java
+++ /dev/null
@@ -1,347 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.core;
-/*
-
-
- */
-
-
-/**
- * Standard Proxy constants.
- *
- * Use the static accessor method (getConstants()) to get the appropriate
- * constants instance for the registry. This is done so that until the
- * the constants are needed, they aren't registered.
- *
- * There are some standard utility functions too.
- *
- * NOTE: Since everything in here just proxies, there is
- * no need to have them separated by VM. That is why
- * this in the Proxy package.
- *
- * This is final because this can't be extended. This specific one
- * will be registered with the factory for this key. Any extensions
- * must be done in their own constants and registry key.
- *
- * Creation date: (4/7/00 4:47:48 PM)
- * @author: Administrator
- */
-public final class JavaStandardBeanProxyConstants {
- public static final Object REGISTRY_KEY = new Object();
-
- final IBeanTypeProxy fCollectionType;
- final IBeanTypeProxy fListType;
- final IBeanTypeProxy fIteratorType;
- final IBeanTypeProxy fListIteratorType;
- final IBeanTypeProxy fEnumerationType;
- final IBeanTypeProxy fSystemType;
- final IBeanTypeProxy fStringType;
-
- IMethodProxy fCollectionAdd, fCollectionAddAll, fCollectionClear, fCollectionContains,
- fCollectionContainsAll, fCollectionIsEmpty, fCollectionIterator, fCollectionRemove,
- fCollectionRemoveAll, fCollectionRetainAll, fCollectionSize, fCollectionToArray,
- fCollectionToArrayWithArray;
-
- IMethodProxy fListAddWithInt, fListAddAllWithInt, fListGet, fListIndexOf, fListLastIndexOf,
- fListListIterator, fListListIteratorWithInt, fListRemoveInt,
- fListSet, fListSubList;
-
- IMethodProxy fIteratorHasNext, fIteratorNext, fIteratorRemove;
-
- IMethodProxy fListIteratorAdd, fListIteratorHasPrevious, fListIteratorNextIndex, fListIteratorPrevious,
- fListIteratorPreviousIndex, fListIteratorRemove, fListIteratorSet;
-
- IMethodProxy fEnumerationHasMoreElements, fEnumerationNextElement;
-
- IMethodProxy fSystemArraycopy;
-
-/**
- * Get the constants instance for the specified registry.
- */
-public static JavaStandardBeanProxyConstants getConstants(ProxyFactoryRegistry registry) {
- JavaStandardBeanProxyConstants constants = (JavaStandardBeanProxyConstants) registry.getConstants(REGISTRY_KEY);
- if (constants == null)
- registry.registerConstants(REGISTRY_KEY, constants = new JavaStandardBeanProxyConstants(registry));
- return constants;
-}
-
-
-/**
- * IDEJavaBeanConstants constructor comment.
- */
-private JavaStandardBeanProxyConstants(ProxyFactoryRegistry registry) {
- super();
-
- IStandardBeanTypeProxyFactory typeFactory = registry.getBeanTypeProxyFactory();
- fCollectionType = typeFactory.getBeanTypeProxy("java.util.Collection");//$NON-NLS-1$
- fListType = typeFactory.getBeanTypeProxy("java.util.List"); //$NON-NLS-1$
- fIteratorType = typeFactory.getBeanTypeProxy("java.util.Iterator"); //$NON-NLS-1$
- fListIteratorType = typeFactory.getBeanTypeProxy("java.util.ListIterator"); //$NON-NLS-1$
- fEnumerationType = typeFactory.getBeanTypeProxy("java.util.Enumeration"); //$NON-NLS-1$
- fSystemType = typeFactory.getBeanTypeProxy("java.lang.System"); //$NON-NLS-1$
- fStringType = typeFactory.getBeanTypeProxy("java.lang.String"); //$NON-NLS-1$
-}
-
-public IBeanTypeProxy getStringType() {
- return fStringType;
-}
-
-/**
- * Collection method accessors
- */
-public IMethodProxy getCollectionAdd() {
- if (fCollectionAdd == null)
- fCollectionAdd = fCollectionType.getMethodProxy("add", "java.lang.Object"); //$NON-NLS-1$ //$NON-NLS-2$
- return fCollectionAdd;
-}
-
-public IMethodProxy getCollectionAddAll(){
- if (fCollectionAddAll == null)
- fCollectionAddAll = fCollectionType.getMethodProxy("addAll", "java.util.Collection"); //$NON-NLS-1$ //$NON-NLS-2$
- return fCollectionAddAll;
-}
-
-public IMethodProxy getCollectionClear() {
- if (fCollectionClear == null)
- fCollectionClear = fCollectionType.getMethodProxy("clear"); //$NON-NLS-1$
- return fCollectionClear;
-}
-
-public IMethodProxy getCollectionContains() {
- if (fCollectionContains == null)
- fCollectionContains = fCollectionType.getMethodProxy("contains", "java.lang.Object"); //$NON-NLS-1$ //$NON-NLS-2$
- return fCollectionContains;
-}
-
-public IMethodProxy getCollectionContainsAll() {
- if (fCollectionContainsAll == null)
- fCollectionContainsAll = fCollectionType.getMethodProxy("containsAll", "java.util.Collection"); //$NON-NLS-1$ //$NON-NLS-2$
- return fCollectionContainsAll;
-}
-
-public IMethodProxy getCollectionIsEmpty() {
- if (fCollectionIsEmpty == null)
- fCollectionIsEmpty = fCollectionType.getMethodProxy("isEmpty"); //$NON-NLS-1$
- return fCollectionIsEmpty;
-}
-
-public IMethodProxy getCollectionIterator() {
- if (fCollectionIterator == null)
- fCollectionIterator = fCollectionType.getMethodProxy("iterator"); //$NON-NLS-1$
- return fCollectionIterator;
-}
-
-public IMethodProxy getCollectionRemove() {
- if (fCollectionRemove == null)
- fCollectionRemove = fCollectionType.getMethodProxy("remove", "java.lang.Object"); //$NON-NLS-1$ //$NON-NLS-2$
- return fCollectionRemove;
-}
-
-public IMethodProxy getCollectionRemoveAll() {
- if (fCollectionRemoveAll == null)
- fCollectionRemoveAll = fCollectionType.getMethodProxy("removeAll", "java.util.Collection"); //$NON-NLS-1$ //$NON-NLS-2$
- return fCollectionRemoveAll;
-}
-
-public IMethodProxy getCollectionRetainAll() {
- if (fCollectionRetainAll == null)
- fCollectionRetainAll = fCollectionType.getMethodProxy("retainAll", "java.util.Collection"); //$NON-NLS-1$ //$NON-NLS-2$
- return fCollectionRetainAll;
-}
-
-public IMethodProxy getCollectionSize() {
- if (fCollectionSize == null)
- fCollectionSize = fCollectionType.getMethodProxy("size"); //$NON-NLS-1$
- return fCollectionSize;
-}
-
-public IMethodProxy getCollectionToArray() {
- if (fCollectionToArray == null)
- fCollectionToArray = fCollectionType.getMethodProxy("toArray"); //$NON-NLS-1$
- return fCollectionToArray;
-}
-
-public IMethodProxy getCollectionToArrayWithArray() {
- if (fCollectionToArrayWithArray == null)
- fCollectionToArrayWithArray = fCollectionType.getMethodProxy("toArray", "[Ljava.lang.Object;"); //$NON-NLS-1$ //$NON-NLS-2$
- return fCollectionToArrayWithArray;
-}
-
-/**
- * Iterator accessors
- */
-
-public IMethodProxy getIteratorHasNext() {
- if (fIteratorHasNext == null)
- fIteratorHasNext = fIteratorType.getMethodProxy("hasNext"); //$NON-NLS-1$
- return fIteratorHasNext;
-}
-
-public IMethodProxy getIteratorNext() {
- if (fIteratorNext == null)
- fIteratorNext = fIteratorType.getMethodProxy("next"); //$NON-NLS-1$
- return fIteratorNext;
-}
-
-public IMethodProxy getIteratorRemove() {
- if (fIteratorRemove == null)
- fIteratorRemove = fIteratorType.getMethodProxy("remove"); //$NON-NLS-1$
- return fIteratorRemove;
-}
-
-/**
- * Listaccessors
- */
-
-public IMethodProxy getListAddWithInt() {
- if (fListAddWithInt == null)
- fListAddWithInt = fListType.getMethodProxy("add", new String[] {"int", "java.lang.Object"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- return fListAddWithInt;
-}
-
-public IMethodProxy getListAddAllWithInt() {
- if (fListAddAllWithInt == null)
- fListAddAllWithInt = fListType.getMethodProxy("addAll", new String[] {"int", "java.util.Collection"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- return fListAddAllWithInt;
-}
-
-public IMethodProxy getListGet() {
- if (fListGet == null)
- fListGet = fListType.getMethodProxy("get", "int"); //$NON-NLS-1$ //$NON-NLS-2$
- return fListGet;
-}
-
-public IMethodProxy getListIndexOf() {
- if (fListIndexOf == null)
- fListIndexOf = fListType.getMethodProxy("indexOf", "java.lang.Object"); //$NON-NLS-1$ //$NON-NLS-2$
- return fListIndexOf;
-}
-
-public IMethodProxy getListLastIndexOf() {
- if (fListLastIndexOf == null)
- fListLastIndexOf = fListType.getMethodProxy("lastIndexOf", "java.lang.Object"); //$NON-NLS-1$ //$NON-NLS-2$
- return fListLastIndexOf;
-}
-
-public IMethodProxy getListListIterator() {
- if (fListListIterator == null)
- fListListIterator = fListType.getMethodProxy("listIterator"); //$NON-NLS-1$
- return fListListIterator;
-}
-
-public IMethodProxy getListListIteratorWithInt() {
- if (fListListIteratorWithInt == null)
- fListListIteratorWithInt = fListType.getMethodProxy("listIterator", "int"); //$NON-NLS-1$ //$NON-NLS-2$
- return fListListIteratorWithInt;
-}
-
-public IMethodProxy getListRemoveInt() {
- if (fListRemoveInt == null)
- fListRemoveInt = fListType.getMethodProxy("remove", "int"); //$NON-NLS-1$ //$NON-NLS-2$
- return fListRemoveInt;
-}
-
-public IMethodProxy getListSet() {
- if (fListSet == null)
- fListSet = fListType.getMethodProxy("set", new String[] {"int", "java.lang.Object"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- return fListSet;
-}
-
-public IMethodProxy getListSubList() {
- if (fListSubList == null)
- fListSubList = fListType.getMethodProxy("subList", new String[] {"int", "int"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- return fListSubList;
-}
-
-/**
- * ListIterator accessors
- */
-
-public IMethodProxy getListIteratorAdd() {
- if (fListIteratorAdd == null)
- fListIteratorAdd = fListIteratorType.getMethodProxy("add", "java.lang.Object"); //$NON-NLS-1$ //$NON-NLS-2$
- return fListIteratorAdd;
-}
-
-public IMethodProxy getListIteratorHasPrevious() {
- if (fListIteratorHasPrevious == null)
- fListIteratorHasPrevious = fListIteratorType.getMethodProxy("hasPrevious"); //$NON-NLS-1$
- return fListIteratorHasPrevious;
-}
-
-public IMethodProxy getListIteratorNextIndex() {
- if (fListIteratorNextIndex == null)
- fListIteratorNextIndex = fListIteratorType.getMethodProxy("nextIndex"); //$NON-NLS-1$
- return fListIteratorNextIndex;
-}
-
-public IMethodProxy getListIteratorPrevious() {
- if (fListIteratorPrevious == null)
- fListIteratorPrevious = fListIteratorType.getMethodProxy("previous"); //$NON-NLS-1$
- return fListIteratorPrevious;
-}
-
-public IMethodProxy getListIteratorPreviousIndex() {
- if (fListIteratorPreviousIndex == null)
- fListIteratorPreviousIndex = fListIteratorType.getMethodProxy("previousIndex"); //$NON-NLS-1$
- return fListIteratorPreviousIndex;
-}
-
-public IMethodProxy getListIteratorSet() {
- if (fListIteratorSet == null)
- fListIteratorSet = fListIteratorType.getMethodProxy("set", "java.lang.Object"); //$NON-NLS-1$ //$NON-NLS-2$
- return fListIteratorSet;
-}
-
-public IMethodProxy getListIteratorRemove() {
- if (fListIteratorRemove == null)
- fListIteratorRemove = fListIteratorType.getMethodProxy("remove"); //$NON-NLS-1$
- return fListIteratorRemove;
-}
-
-protected IMethodProxy getSystemArraycopy() {
- if (fSystemArraycopy == null)
- fSystemArraycopy = fSystemType.getMethodProxy("arraycopy", new String[] {"java.lang.Object", "int", "java.lang.Object", "int", "int"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
- return fSystemArraycopy;
-}
-
-/**
- * Enumeration accessors
- */
-public IMethodProxy getEnumerationHasMoreElements() {
- if (fEnumerationHasMoreElements == null)
- fEnumerationHasMoreElements = fEnumerationType.getMethodProxy("hasMoreElements"); //$NON-NLS-1$
- return fEnumerationHasMoreElements;
-}
-
-public IMethodProxy getEnumerationNextElement() {
- if (fEnumerationNextElement == null)
- fEnumerationNextElement = fEnumerationType.getMethodProxy("nextElement"); //$NON-NLS-1$
- return fEnumerationNextElement;
-}
-
-/**
- * Utility function to copy an array.
- */
-public void arraycopy(IBeanProxy src, int srcPosition, IBeanProxy dest, int destPosition, int length) throws ThrowableProxy {
- IStandardBeanProxyFactory factory = src.getProxyFactoryRegistry().getBeanProxyFactory();
- IBeanProxy[] args = new IBeanProxy[] {
- src,
- factory.createBeanProxyWith(srcPosition),
- dest,
- factory.createBeanProxyWith(destPosition),
- factory.createBeanProxyWith(length)
- };
-
- getSystemArraycopy().invoke(null, args);
-}
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/ListBeanProxyWrapper.java b/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/ListBeanProxyWrapper.java
deleted file mode 100644
index a47278327..000000000
--- a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/ListBeanProxyWrapper.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.core;
-/*
-
-
- */
-
-
-import java.text.MessageFormat;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-/**
- * This is a wrapper for an java.util.Collection proxy.
- * It provides the collection methods to interface to
- * the proxy.
- */
-
-public class ListBeanProxyWrapper extends CollectionBeanProxyWrapper {
- /**
- * Construct with the List.
- */
- public ListBeanProxyWrapper(IBeanProxy aListProxy) {
- super(aListProxy);
-
- if (!aListProxy.getTypeProxy().isKindOf(aListProxy.getProxyFactoryRegistry().getBeanTypeProxyFactory().getBeanTypeProxy("java.util.List"))) //$NON-NLS-1$
- throw new ClassCastException(MessageFormat.format(ProxyMessages.ClassCast_EXC__IncorrectType, new Object[] {aListProxy.getTypeProxy().getTypeName(), "java.util.List"})); //$NON-NLS-1$
- }
-
-
- /**
- * List accessors
- */
- public void add(int index, IBeanProxy object) throws ThrowableProxy {
- fConstants.getListAddWithInt().invoke(fCollection, new IBeanProxy[] {fCollection.getProxyFactoryRegistry().getBeanProxyFactory().createBeanProxyWith(index), object});
- }
- public boolean addAll(int index, IBeanProxy aCollection) throws ThrowableProxy {
- return ((IBooleanBeanProxy) fConstants.getListAddAllWithInt().invoke(fCollection, new IBeanProxy[] {fCollection.getProxyFactoryRegistry().getBeanProxyFactory().createBeanProxyWith(index), aCollection})).booleanValue();
- }
- public IBeanProxy get(int index) throws ThrowableProxy {
- return fConstants.getListGet().invoke(fCollection, fCollection.getProxyFactoryRegistry().getBeanProxyFactory().createBeanProxyWith(index));
- }
- public int indexOf(IBeanProxy object) {
- try {
- return ((IIntegerBeanProxy) fConstants.getListIndexOf().invoke(fCollection, object)).intValue();
- } catch (ThrowableProxy e) {
- // This shouldn't occur, so just log it.
- ProxyPlugin.getPlugin().getLogger().log(new Status(IStatus.ERROR, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, ProxyMessages.UnexpectedException_EXC_, e));
- return -1;
- }
- }
- public int lastIndexOf(IBeanProxy object) {
- try {
- return ((IIntegerBeanProxy) fConstants.getListLastIndexOf().invoke(fCollection, object)).intValue();
- } catch (ThrowableProxy e) {
- // This shouldn't occur, so just log it.
- ProxyPlugin.getPlugin().getLogger().log(new Status(IStatus.ERROR, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, ProxyMessages.UnexpectedException_EXC_, e));
- return -1;
- }
- }
- public ListIteratorBeanProxyWrapper listIterator() {
- try {
- IBeanProxy itr = fConstants.getListListIterator().invoke(fCollection);
- if (itr != null)
- return new ListIteratorBeanProxyWrapper(itr);
- else
- return null;
- } catch (ThrowableProxy e) {
- // This shouldn't occur, so just log it.
- ProxyPlugin.getPlugin().getLogger().log(new Status(IStatus.ERROR, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, ProxyMessages.UnexpectedException_EXC_, e));
- return null;
- }
- }
- public ListIteratorBeanProxyWrapper listIterator(int index) {
- try {
- IBeanProxy itr = fConstants.getListListIteratorWithInt().invoke(fCollection, fCollection.getProxyFactoryRegistry().getBeanProxyFactory().createBeanProxyWith(index));
- if (itr != null)
- return new ListIteratorBeanProxyWrapper(itr);
- else
- return null;
- } catch (ThrowableProxy e) {
- // This shouldn't occur, so just log it.
- ProxyPlugin.getPlugin().getLogger().log(new Status(IStatus.ERROR, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, ProxyMessages.UnexpectedException_EXC_, e));
- return null;
- }
- }
- public IBeanProxy remove(int index, IBeanProxy object) throws ThrowableProxy {
- return fConstants.getListSet().invoke(fCollection, fCollection.getProxyFactoryRegistry().getBeanProxyFactory().createBeanProxyWith(index));
- }
- public IBeanProxy set(int index, IBeanProxy object) throws ThrowableProxy {
- return fConstants.getListRemoveInt().invoke(fCollection, new IBeanProxy[] {fCollection.getProxyFactoryRegistry().getBeanProxyFactory().createBeanProxyWith(index), object});
- }
- public ListBeanProxyWrapper subList(int fromIndex, int toIndex) throws ThrowableProxy {
- IBeanProxy list = fConstants.getListSubList().invoke(fCollection, new IBeanProxy[] {fCollection.getProxyFactoryRegistry().getBeanProxyFactory().createBeanProxyWith(fromIndex), fCollection.getProxyFactoryRegistry().getBeanProxyFactory().createBeanProxyWith(toIndex)});
- if (list != null)
- return new ListBeanProxyWrapper(list);
- else
- return null;
- }
-
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/ListIteratorBeanProxyWrapper.java b/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/ListIteratorBeanProxyWrapper.java
deleted file mode 100644
index e19802886..000000000
--- a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/ListIteratorBeanProxyWrapper.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.core;
-/*
-
-
- */
-
-
-import java.text.MessageFormat;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-/**
- * This is a wrapper for an java.util.ListIterator proxy.
- * It provides the ListIterator methods to interface to
- * the proxy.
- */
-
-public class ListIteratorBeanProxyWrapper extends IteratorBeanProxyWrapper {
-
- /**
- * Construct with the ListIterator.
- */
- public ListIteratorBeanProxyWrapper(IBeanProxy anIteratorProxy) {
- super(anIteratorProxy);
-
- if (!anIteratorProxy.getTypeProxy().isKindOf(anIteratorProxy.getProxyFactoryRegistry().getBeanTypeProxyFactory().getBeanTypeProxy("java.util.ListIterator"))) //$NON-NLS-1$
- throw new ClassCastException(MessageFormat.format(ProxyMessages.ClassCast_EXC__IncorrectType, new Object[] {anIteratorProxy.getTypeProxy().getTypeName(), "java.util.ListIterator"})); //$NON-NLS-1$
- }
-
-
- /**
- * ListIterator accessors
- */
- public void add(IBeanProxy object) throws ThrowableProxy {
- fConstants.getListIteratorAdd().invoke(fIterator, object);
- }
- public boolean hasPrevious() {
- try {
- return ((IBooleanBeanProxy) fConstants.getListIteratorHasPrevious().invoke(fIterator)).booleanValue();
- } catch (ThrowableProxy e) {
- // This shouldn't occur, so just log it.
- ProxyPlugin.getPlugin().getLogger().log(new Status(IStatus.ERROR, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, ProxyMessages.UnexpectedException_EXC_, e));
- return false;
- }
- }
- public int nextIndex() {
- try {
- return ((IIntegerBeanProxy) fConstants.getListIteratorNextIndex().invoke(fIterator)).intValue();
- } catch (ThrowableProxy e) {
- // This shouldn't occur, so just log it.
- ProxyPlugin.getPlugin().getLogger().log(new Status(IStatus.ERROR, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, ProxyMessages.UnexpectedException_EXC_, e));
- return -1;
- }
- }
- public IBeanProxy previous() throws ThrowableProxy {
- return fConstants.getListIteratorPrevious().invoke(fIterator);
- }
- public int previousIndex() {
- try {
- return ((IIntegerBeanProxy) fConstants.getListIteratorPreviousIndex().invoke(fIterator)).intValue();
- } catch (ThrowableProxy e) {
- // This shouldn't occur, so just log it.
- ProxyPlugin.getPlugin().getLogger().log(new Status(IStatus.ERROR, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, ProxyMessages.UnexpectedException_EXC_, e));
- return -1;
- }
- }
- public void remove() throws ThrowableProxy {
- fConstants.getListIteratorRemove().invoke(fIterator);
- }
- public void set(IBeanProxy object) throws ThrowableProxy {
- fConstants.getListIteratorSet().invoke(fIterator, object);
- }
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/ListenerList.java b/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/ListenerList.java
deleted file mode 100644
index d4b47e99c..000000000
--- a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/ListenerList.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 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.jem.internal.proxy.core;
-
-/**
- * This class is used to maintain a list of listeners, and
- * is used in the implementations of several classes within jem
- * which allow you to register listeners of various kinds.
- * It is a fairly lightweight object, occupying minimal space when
- * no listeners are registered.
- * <p>
- * Note that the <code>add</code> method checks for and eliminates
- * duplicates based on identity (not equality). Likewise, the
- * <code>remove</code> method compares based on identity.
- * </p>
- * <p>
- * Use the <code>getListeners</code> method when notifying listeners.
- * Note that no garbage is created if no listeners are registered.
- * The recommended code sequence for notifying all registered listeners
- * of say, <code>FooListener.eventHappened</code>, is:
- * <pre>
- * Object[] listeners = myListenerList.getListeners();
- * for (int i = 0; i < listeners.length; ++i) {
- * ((FooListener) listeners[i]).eventHappened(event);
- * }
- * </pre>
- * </p>
- */
-
-public class ListenerList {
-
- /**
- * The initial capacity of the list. Always >= 1.
- */
- private int capacity;
-
- /**
- * The current number of listeners.
- * Maintains invariant: 0 <= size <= listeners.length.
- */
- private int size;
-
- /**
- * The list of listeners. Initially <code>null</code> but initialized
- * to an array of size capacity the first time a listener is added.
- * Maintains invariant: listeners != null IFF size != 0
- */
- private Object[] listeners = null;
-
- /**
- * The empty array singleton instance, returned by getListeners()
- * when size == 0.
- */
- private static final Object[] EmptyArray = new Object[0];
-
- /**
- * Creates a listener list with an initial capacity of 1.
- */
- public ListenerList() {
- this(1);
- }
-
- /**
- * Creates a listener list with the given initial capacity.
- *
- * @param capacity the number of listeners which this list can initially accept
- * without growing its internal representation; must be at least 1
- */
- public ListenerList(int capacity) {
- if (!(capacity >= 1))
- throw new IllegalArgumentException();
- this.capacity = capacity;
- }
-
- /**
- * Adds the given listener to this list. Has no effect if an identical listener
- * is already registered.
- *
- * @param listener the listener
- */
- public void add(Object listener) {
- if (listener == null)
- throw new IllegalArgumentException();
- if (size == 0) {
- listeners = new Object[capacity];
- } else {
- // check for duplicates using identity
- for (int i = 0; i < size; ++i) {
- if (listeners[i] == listener) {
- return;
- }
- }
- // grow array if necessary
- if (size == listeners.length) {
- System.arraycopy(
- listeners,
- 0,
- listeners = new Object[size * 2 + 1],
- 0,
- size);
- }
- }
- listeners[size++] = listener;
- }
-
- /**
- * Removes all listeners from this list.
- */
- public void clear() {
- size = 0;
- listeners = null;
- }
-
- /**
- * Returns an array containing all the registered listeners,
- * in the order in which they were added.
- * <p>
- * The resulting array is unaffected by subsequent adds or removes.
- * If there are no listeners registered, the result is an empty array
- * singleton instance (no garbage is created).
- * Use this method when notifying listeners, so that any modifications
- * to the listener list during the notification will have no effect on the
- * notification itself.
- * </p>
- *
- * @return the list of registered listeners
- */
- public Object[] getListeners() {
- if (size == 0)
- return EmptyArray;
- Object[] result = new Object[size];
- System.arraycopy(listeners, 0, result, 0, size);
- return result;
- }
-
- /**
- * Returns whether this listener list is empty.
- *
- * @return <code>true</code> if there are no registered listeners, and
- * <code>false</code> otherwise
- */
- public boolean isEmpty() {
- return size == 0;
- }
-
- /**
- * Removes the given listener from this list. Has no effect if an identical
- * listener was not already registered.
- *
- * @param listener the listener
- */
- public void remove(Object listener) {
- if (listener == null)
- throw new IllegalArgumentException();
- for (int i = 0; i < size; ++i) {
- if (listeners[i] == listener) {
- if (size == 1) {
- listeners = null;
- size = 0;
- } else {
- System.arraycopy(
- listeners,
- i + 1,
- listeners,
- i,
- --size - i);
- listeners[size] = null;
- }
- return;
- }
- }
- }
-
- /**
- * Returns the number of registered listeners.
- *
- * @return the number of registered listeners
- */
- public int size() {
- return size;
- }
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/MapJNITypes.java b/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/MapJNITypes.java
deleted file mode 100644
index 7ed975fa2..000000000
--- a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/MapJNITypes.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 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.jem.internal.proxy.core;
-
-import org.eclipse.jem.internal.proxy.common.MapTypes;
-
-
-/**
- * This is a public class to map between JNI and normal format (e.g. "[Ljava.lang.String;" to "java.lang.String[]") and back again.
- * This is for arrays, non-arrays will be left alone since they are already correct.
- * @since 1.1.0
- */
-public class MapJNITypes {
-
- /**
- * Convert the formal type name to the JNI format.
- * @param formalTypeName
- * @return JNI format
- *
- * @since 1.1.0
- */
- public static String getJNITypeName(String formalTypeName) {
- return MapTypes.getJNIFormatName(formalTypeName);
- }
-
- /**
- * Convert the JNI format to the formal type name.
- * @param jniTypeName
- * @return formal type name or "" if not valid.
- *
- * @since 1.1.0
- */
- public static String getFormalTypeName(String jniTypeName) {
- return MapTypes.getFormalTypeName(jniTypeName);
- }
-
- /**
- * Return whether the formal type name is for a primitive or not.
- * @param formalType
- * @return <code>true</code> if for a primitive.
- *
- * @since 1.1.0
- */
- public static boolean isFormalTypePrimitive(String formalType) {
- return MapTypes.MAP_TYPENAME_TO_SHORTSIG.get(formalType) != null;
- }
-
- /**
- * Convert the formal type name, with the given number of dimensions,
- * to an array JNI type.
- * @param finalComponent final component name, should not be an array type.
- * @param dimensions number of dimensions for the array.
- * @return
- *
- * @since 1.1.0
- */
- public static String getJNITypeName(String finalComponent, int dimensions) {
- return MapTypes.getJNITypeName(finalComponent, dimensions);
- }
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/PDEContributeClasspath.java b/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/PDEContributeClasspath.java
deleted file mode 100644
index ba030614f..000000000
--- a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/PDEContributeClasspath.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 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.jem.internal.proxy.core;
-
-import java.io.File;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.*;
-import java.util.logging.Level;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.pde.core.plugin.*;
-
-/**
- * Contribute to classpath PDE entries that are needed for a launch.
- * <p>
- * This is a special class that should not be referenced directly from code. Reference it through the interface that it implements.
- *
- * @see org.eclipse.jem.internal.proxy.core.IPDEContributeClasspath
- * @since 1.0.2
- */
-class PDEContributeClasspath implements IPDEContributeClasspath {
-
- public void getPDEContributions(IConfigurationContributionController controller, IConfigurationContributionInfo info) throws CoreException {
- if (!info.getPluginIds().isEmpty()) {
- Collection pluginIds = info.getPluginIds().keySet();
-
- IPluginModelBase[] allModels = PluginRegistry.getAllModels();
- List fragments = new ArrayList();
- for (int i = 0; i < allModels.length; i++) {
- if (allModels[i].isFragmentModel()) {
- fragments.add(allModels[i]);
- }
- }
-
- for (Iterator itr = fragments.iterator(); itr.hasNext();) {
- IFragmentModel fragmentModel = (IFragmentModel) itr.next();
- IFragment fragment = fragmentModel.getFragment();
- if (pluginIds.contains(fragment.getPluginId())) {
- // We'll do a cheat for now and assume fragment is for same version of plugin. PDECore actually
- // checks the version of the fragment against the version of the plugin to see they are for each
- // other, but we'll just assume they are for now. Change this later if we actually do run into this case.
- IResource resource = fragment.getModel().getUnderlyingResource();
- if (resource != null) {
- IProject fragProject = resource.getProject();
- if (fragProject.hasNature(JavaCore.NATURE_ID)) {
- controller.contributeProject(fragProject);
- }
- continue;
- }
-
- IPluginLibrary[] libraries = fragment.getLibraries();
- for (int j = 0; j < libraries.length; j++) {
- IPluginLibrary library = libraries[j];
- String name = library.getName();
- String expandedName = expandLibraryName(name);
-
- IPluginModelBase model = library.getPluginModel();
- URL url = getPath(model, expandedName);
- if (url != null)
- controller.contributeClasspath(url, IConfigurationContributionController.APPEND_USER_CLASSPATH);
- }
- }
- }
- }
-
- return;
- }
-
- private URL getPath(IPluginModelBase model, String libraryName) {
- try {
- IResource resource = model.getUnderlyingResource();
- if (resource != null) {
- IResource jarFile = resource.getProject().findMember(libraryName);
- if (jarFile != null)
- return jarFile.getFullPath().toFile().toURL();
- } else {
- File file = new File(model.getInstallLocation(), libraryName);
- if (file.exists())
- return file.toURL();
- }
- } catch (MalformedURLException e) {
- ProxyPlugin.getPlugin().getLogger().log(e, Level.WARNING);
- }
- return null;
- }
-
- /**
- * This utility method was originally copied from method of same name, in org.eclipse.pde.internal.core.ClasspathUtilCore. It was not API, and
- * seems safe enough to copy here. But, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=182555
- * in case there is ever an API method provided to codify these Eclipse rules.
- */
- private static String expandLibraryName(String source) {
- if (source == null || source.length() == 0)
- return ""; //$NON-NLS-1$
- if (source.indexOf("$ws$") != -1) //$NON-NLS-1$
- source = source.replaceAll("\\$ws\\$", //$NON-NLS-1$
- "ws" + IPath.SEPARATOR + TargetPlatform.getWS()); //$NON-NLS-1$
- if (source.indexOf("$os$") != -1) //$NON-NLS-1$
- source = source.replaceAll("\\$os\\$", //$NON-NLS-1$
- "os" + IPath.SEPARATOR + TargetPlatform.getOS()); //$NON-NLS-1$
- if (source.indexOf("$nl$") != -1) //$NON-NLS-1$
- source = source.replaceAll("\\$nl\\$", //$NON-NLS-1$
- "nl" + IPath.SEPARATOR + TargetPlatform.getNL()); //$NON-NLS-1$
- if (source.indexOf("$arch$") != -1) //$NON-NLS-1$
- source = source.replaceAll("\\$arch\\$", //$NON-NLS-1$
- "arch" + IPath.SEPARATOR + TargetPlatform.getOSArch()); //$NON-NLS-1$
- return source;
- }
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/PDEContributeClasspathInstance.java b/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/PDEContributeClasspathInstance.java
deleted file mode 100644
index 90c7529e2..000000000
--- a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/PDEContributeClasspathInstance.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 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.jem.internal.proxy.core;
-
-import java.util.logging.Level;
-
-import org.eclipse.core.runtime.Platform;
-
-
-
-/**
- * Accessor to the IPDEContributeClasspath instance to use.
- * <pacakge-protected> because only IPDEContributeClasspath should access it.
- *
- * @since 1.0.2
- */
-class PDEContributeClasspathInstance {
-
- /**
- * Get the instance to use.
- * @return the instance to use or <code>null</code> if PDE not available.
- *
- * @since 1.0.2
- */
- public static IPDEContributeClasspath getInstance() {
- if (Platform.getBundle("org.eclipse.pde.core") != null) { //$NON-NLS-1$
- try {
- Class pdeClass = Class.forName("org.eclipse.jem.internal.proxy.core.PDEContributeClasspath"); //$NON-NLS-1$
- return (IPDEContributeClasspath) pdeClass.newInstance();
- } catch (ClassNotFoundException e) {
- // PDE not available, this is ok.
- } catch (InstantiationException e) {
- ProxyPlugin.getPlugin().getLogger().log(e.getCause(), Level.WARNING);
- } catch (IllegalAccessException e) {
- ProxyPlugin.getPlugin().getLogger().log(e, Level.WARNING);
- }
- }
- return null;
- }
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/PDEProcessForPlugin.java b/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/PDEProcessForPlugin.java
deleted file mode 100644
index b77dc516a..000000000
--- a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/PDEProcessForPlugin.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 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.jem.internal.proxy.core;
-
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.pde.core.plugin.*;
-
-import org.eclipse.jem.internal.proxy.core.ProxyPlugin.FoundIDs;
-
-
-/*
- * Used for PDE Processing for the Proxy Plugin class. It will be optionally loaded
- * if PDE plugin is installed. This allows usage in an installation that doesn't have
- * PDE installed.
- *
- * @since 1.0.2
- */
-class PDEProcessForPlugin implements ProxyPlugin.IPDEProcessForPlugin {
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.ProxyPlugin.IPDEProcessForPlugin#processPlugin(org.eclipse.jdt.core.IJavaProject, java.util.Map, boolean, boolean)
- */
- public void findPlugins(IJavaProject project, FoundIDs foundIds, boolean visible, boolean first) {
- IPluginModelBase m = PluginRegistry.findModel(project.getProject());
- if (m instanceof IPluginModel) {
- // it is a plugin, process it.
- IPlugin plugin = ((IPluginModel) m).getPlugin();
- if (foundIds.pluginIds.containsKey(plugin.getId()))
- return; // already processed it
- foundIds.pluginIds.put(plugin.getId(), first || visible ? Boolean.TRUE : Boolean.FALSE);
- expandPlugin(plugin, foundIds, visible, first);
- }
- return;
- }
-
- private void expandPlugin(IPluginBase plugin, FoundIDs foundIds, boolean visible, boolean first) {
- IPluginImport[] imports = plugin.getImports();
- for (int i = 0; i < imports.length; i++) {
- IPluginImport pi = imports[i];
- Boolean piValue = (Boolean) foundIds.pluginIds.get(pi.getId());
- boolean importVisible = first || (visible && pi.isReexported());
- if (piValue != null && (!importVisible || piValue.booleanValue()))
- continue; // we already processed it, this time not visible, or this time visible and was previously visible.
- // Now either first time, or it was there before, but now visible, but this time it is visible.
- // We want it to become visible in that case.
- foundIds.pluginIds.put(pi.getId(), importVisible ? Boolean.TRUE : Boolean.FALSE);
-
- // Note: this search does not take into account the IPluginImport's version or match level
- // but neither did the previous version
- IPluginModelBase model = PluginRegistry.findModel(pi.getId());
- if (model != null && model.isEnabled()) {
- IPluginBase foundPlugin = model.getPluginBase();
- if (foundPlugin != null) {
- expandPlugin(foundPlugin, foundIds, importVisible, false);
- }
- }
- }
- }
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/ProxyFactoryRegistry.java b/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/ProxyFactoryRegistry.java
deleted file mode 100644
index c87f1910a..000000000
--- a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/ProxyFactoryRegistry.java
+++ /dev/null
@@ -1,327 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.core;
-/*
-
-
- */
-
-
-import java.util.Hashtable;
-import java.util.Iterator;
-
-import org.eclipse.jem.util.TimerTests;
-
-/**
- * Registry of proxy factories on a per-VM basis.
- * There can be multiple VM's, this would be required by the
- * desktop because more than one project could be open, and each
- * would require their own VM because the classpaths would be different.
- * This class may be subclassed to provide more factories for a particular
- * VM.
- * Creation date: (3/13/00 10:48:10 AM)
- * @author: Richard Lee Kulp
- */
-public abstract class ProxyFactoryRegistry {
-
- protected boolean fIsValid = true; // The registry is valid until terminated.
- protected ListenerList registryListeners = new ListenerList();
-
- /**
- * IRegistryListener
- * Listen for the registry being terminated.
- */
- public interface IRegistryListener {
- /**
- * Method registryTerminated.
- *
- * The registry has been terminated. When this is called the registry
- * is no longer valid. It should not be assumed any calls can be made
- * to the registry.
- *
- * @param registry
- */
- public void registryTerminated(ProxyFactoryRegistry registry);
- }
-
-
- // Factory registration IS NOT a dynamic registration. Once registered for a VM or an instance
- // they should not be changed. This is because references are cached in other objects.
- // The VM associated with this Registry shouldn't exited and restarted because
- // the cached object will then have invalid references to no longer existing objects.
- // If the VM needs to be restarted, then all proxies need to be tossed.
-
- //
- // Individual ProxyFactoryRegistry, applies to a particular VM.
- //
-
- // ***************************
- //
- // IBeanProxyFactory Registry
- //
-
- // The standard bean proxy factory, the one the desktop will use for packages that have not
- // been extended and registered by customization developers.
- protected IStandardBeanProxyFactory fCurrentStandardBeanProxyFactory;
-
- // The directory of registered extension factories, typically registered by package.
- final protected Hashtable fRegisteredExtensionBeanProxyFactories = new Hashtable();
-
- // ***************************
- //
- // IBeanTypeProxyFactory Registry
- //
-
- // The standard bean type proxy factory, the one the desktop will use for packages that have not
- // been extended and registered by customization developers.
- protected IStandardBeanTypeProxyFactory fCurrentStandardBeanTypeProxyFactory;
-
- // The directory of registered extension factories, typically registered by package.
- final protected Hashtable fRegisteredExtensionBeanTypeProxyFactories = new Hashtable();
-
-
- // ***************************
- //
- // Other factories
- //
-
- protected IMethodProxyFactory fMethodProxyFactory = null; // Method Proxy Factory
-
- // ***************************
- //
- // Constants Registry. Different extensions can store
- // objects by key as a registry of constants.
- // For example, java.awt extension will store an object
- // which has some pre-fetched method proxies stored in it so
- // that they don't need to be continually recreated.
- //
- // This feature should be used with care, so that
- // only proxies that really need to be cached should
- // be cached.
- //
- // Don't store proxies to live beans in here because
- // those will be created and destroyed over and over,
- // and the instance in this cache will get stale.
- // Should only store things like often used method
- // proxies that once created are rarely changed.
- //
- // Since the proxies can be on any VM, you should have
- // an interface defining what's available in your
- // constants entry, and access it through that.
-
- protected final Hashtable fRegisteredConstants = new Hashtable();
-
- /**
- * ProxyFactoryRegistry constructor comment.
- */
- public ProxyFactoryRegistry() {
- super();
- }
-
- /**
- * Method addRegistryListener.
- * @param listener
- */
- public void addRegistryListener(IRegistryListener listener) {
- registryListeners.add(listener);
- }
-
- /**
- * Method removeRegistryListener.
- * @param listener
- */
- public void removeRegistryListener(IRegistryListener listener) {
- registryListeners.remove(listener);
- }
-
- protected void fireRegistryTerminated() {
- if (!registryListeners.isEmpty()) {
- Object[] list = registryListeners.getListeners();
- for (int i = 0; i < list.length; i++) {
- ((IRegistryListener) list[i]).registryTerminated(this);
- }
- }
- }
-
- /**
- Return the current factory to be used for creating IBeanProxy instances
- */
- public IStandardBeanProxyFactory getBeanProxyFactory() {
- if (fCurrentStandardBeanProxyFactory == null) {
- throw new RuntimeException(ProxyMessages.ProxyFactory_EXC__NoBeanProxyFactory);
- }
- return fCurrentStandardBeanProxyFactory;
- }
- /**
- Return the current registered bean proxy factory to be used for creating IBeanProxy instances
- */
- public IBeanProxyFactory getBeanProxyFactoryExtension(String packageName) {
- return (IBeanProxyFactory)fRegisteredExtensionBeanProxyFactories.get(packageName);
- }
-
- /**
- Return the current factory to be used for creating IBeanTypeProxy instances
- */
- public IStandardBeanTypeProxyFactory getBeanTypeProxyFactory() {
- if (fCurrentStandardBeanTypeProxyFactory == null) {
- throw new RuntimeException(ProxyMessages.ProxyFactory_EXC__NoBeanTypeProxyFactory);
- }
- return fCurrentStandardBeanTypeProxyFactory;
- }
- /**
- Return the current registered bean type proxy factory to be used for creating IBeanTypeProxy instances
- */
- public IBeanTypeProxyFactory getBeanTypeProxyFactoryExtension(String packageName) {
- return (IBeanTypeProxyFactory)fRegisteredExtensionBeanTypeProxyFactories.get(packageName);
- }
- /**
- * Return the requested constants entry
- */
- public Object getConstants(Object key) {
- return fRegisteredConstants.get(key);
- }
- /**
- * Return the MethodProxyFactory for this VM.
- * Creation date: (3/13/00 10:54:59 AM)
- * @return org.eclipse.jem.internal.proxy.core.IMethodProxyFactory
- */
- public IMethodProxyFactory getMethodProxyFactory() {
- return fMethodProxyFactory;
- }
-
-
- /**
- * Set the requested constants entry for this VM.
- */
- public void registerConstants(Object key, Object constant) {
- fRegisteredConstants.put(key, constant);
- }
-
- /**
- * Remove the constants for the given key.
- * @param key
- *
- * @since 1.1.0
- */
- public void deregisterConstants(Object key) {
- fRegisteredConstants.remove(key);
- }
- /**
- * Release the proxy, no longer needed.
- * This is a helper method to easily access the release from the bean proxy factory.
- */
- public void releaseProxy(IBeanProxy proxy) {
- // To simply things if release is called when the factory is down (invalid), then just
- // go on because the proxy is already released.
- if (fCurrentStandardBeanProxyFactory != null)
- fCurrentStandardBeanProxyFactory.releaseProxy(proxy);
- }
-
- /**
- * Is this a valid registry, i.e. is it not terminated.
- */
- public boolean isValid() {
- return fIsValid;
- }
-
- /**
- * Terminate the registry without waiting.
- * <p>
- * Terminate the registry, but don't necessarily wait for it.
- *
- * @see #terminateRegistry(boolean)
- * @since 1.0.0
- */
- public final void terminateRegistry() {
- terminateRegistry(false);
- }
-
- /**
- * Terminate the registry.
- * <p>
- * This will go through each factory and terminate it, and
- * let the subclass terminate. It will then remove all of the factories so that
- * if there are any proxies still hanging around they won't hold onto everything,
- * just the this registry will be held onto.
- *<p>
- * Note during termination, the factories should not reference any other factory.
- * It can assume that the factories will take care of themselves and they should
- * only release their resources.
- * <p>
- * The constants registry will not be terminated because they aren't factories.
- * However, they will be cleared (no longer referenced) from here so that they
- * can be GC'd.
- *
- * @param wait <code>true</code> to wait for complete termination, <code>false</code> to kick off termination but return ASAP.
- * @since 1.0.2
- */
- public final void terminateRegistry(boolean wait) {
- if (!fIsValid)
- return; // Already or are already terminating. Don't do it again and don't notify again.
- fIsValid = false;
- if (fCurrentStandardBeanTypeProxyFactory != null) {
-// TimerTests.basicTest.startStep("Terminate Bean Type Factory");
- fCurrentStandardBeanTypeProxyFactory.terminateFactory(wait);
-// TimerTests.basicTest.stopStep("Terminate Bean Type Factory");
- fCurrentStandardBeanTypeProxyFactory = null;
- }
- if (fCurrentStandardBeanProxyFactory != null) {
- fCurrentStandardBeanProxyFactory.terminateFactory(wait);
- fCurrentStandardBeanProxyFactory = null;
- }
- if (fMethodProxyFactory != null) {
- fMethodProxyFactory.terminateFactory(wait);
- fMethodProxyFactory = null;
- }
-
- Iterator itr = fRegisteredExtensionBeanTypeProxyFactories.values().iterator();
- while (itr.hasNext()) {
- ((IBeanProxyFactory) itr.next()).terminateFactory(wait);
- }
- fRegisteredExtensionBeanTypeProxyFactories.clear();
-
- itr = fRegisteredExtensionBeanProxyFactories.values().iterator();
- while (itr.hasNext()) {
- ((IBeanProxyFactory) itr.next()).terminateFactory(wait);
- }
- fRegisteredExtensionBeanProxyFactories.clear();
-
- fRegisteredConstants.clear();
-
- TimerTests.basicTest.startStep("Registry Terminated"); //$NON-NLS-1$
- registryTerminated(wait);
- TimerTests.basicTest.stopStep("Registry Terminated"); //$NON-NLS-1$
-
-// TimerTests.basicTest.startStep("Registry Terminated Notification");
- fireRegistryTerminated(); // Let everyone know that we are gone. This is fired even if wait is false because at this point in time the registry is invalid.
-// TimerTests.basicTest.stopStep("Registry Terminated Notification");
- }
-
-
- /**
- * Terminate the Registry.
- * <p>
- * It is up to each registry to determine what this means.
- * <p>
- * The wait parm is a suggestion if it is <code>false</code>, but it must be honoured if <code>true</code>
- *
- * @param wait wait for registry to terminate flag.
- *
- * @since 1.0.2
- */
- protected abstract void registryTerminated(boolean wait);
-
- /**
- * Get the callback registry.
- */
- public abstract ICallbackRegistry getCallbackRegistry();
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/ProxyFindSupport.java b/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/ProxyFindSupport.java
deleted file mode 100644
index fe977cf87..000000000
--- a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/ProxyFindSupport.java
+++ /dev/null
@@ -1,209 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 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.jem.internal.proxy.core;
-
-import java.io.*;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Properties;
-
-import org.eclipse.core.runtime.*;
-import org.osgi.framework.Bundle;
-
-
-/**
- * Utility to help finding files. It is used to find them within plugins of the current platform or to find them in the PDE target platform.
- * Also if in the current platform and the current platform is in development mode it will find the bin directories for the jars instead since
- * there are no jars in that case.
- * It can also extract non-local files (such as files within a jar) and make a cache of them so that are a local file and not extracted everytime
- * they are needed.
- *
- * TODO If we ever get back to continuing development we should add to this PDE Target support. And test the code here
- * since it hasn't been tested yet. Also note that in configuration contributor,
- * when we add the library path we expect it to be a folder. This would be a problem with jarred plugins because the directory containing the
- * libraries may be the root of the plugin and localizing a directory would extract and cache the entire plugin. Need to change to figure out
- * how to only extract the dll/so needed instead. Also, none of these handle the case where the bundle is actually non-local (e.g. "http:/").
- * @since 1.2.0
- */
-public class ProxyFindSupport {
-
-
- /**
- * Find the filename relative to the platform bundle. It will search in the bundle and in all fragments for the file name.
- * It will return a URL for each found file.
- * <p>
- * This is useful for NLS purposes. In NLS situations the main bundle would contain the main non-library jar with the default properties files.
- * Then a fragment for each set of languages will be installed. Within each fragment will be a jar with the same filepath, and it will
- * contain the properties files for that language. This would be done only for plugin non-library jars.
- * The NLS for library jars of a plugin (i.e. those jars that are the <runtime> jars for the plugin) are usually library jars themselves in
- * the fragment, and they usually have a different name than the main library jar. So this should not be used for library jars.
- * <p>
- * If in development mode, then if the jar is not found it will look in the plugin project's build.properties to find the output directory
- * of the jar. If not in the build.properties (meaning it isn't being built by PDE), it will look in the proxy.jars file (if there is one).
- * This file is used for jars that are built in a separate project from the plugin but will be found in the plugin at execution.
- *
- * @param bundle bundle and its fragments to look in.
- * @param filenameWithinBundle path to filename within the bundle and fragments. <b>This must be a file, not a directory.</b>
- * For finding the bundle itself (only when the bundle is packaged as a jar), use <@link #platformFind(Bundle)>. This does not use
- * the platform shortcuts like "$os$". It finds the files exactly as specified.
- * @param asLocal <code>true</code> if the urls need to point to local filesystem files. This may cause caching of files locally. This
- * could happen if the file is within a plugin that is jarred. <code>false</code> if the url can be a non-local filesystem url.
- * @return array of URL's for found files.
- *
- * @since 1.2.0
- */
- public static URL[] platformFindAll(Bundle bundle, IPath filenameWithinBundle, boolean asLocal) {
- Bundle[] fragments = Platform.getFragments(bundle);
- ArrayList urls = new ArrayList((fragments == null ? 0 : fragments.length) + 1);
- String filename = filenameWithinBundle.toString();
- URL url = internalFindFromBundleOnly(bundle, filename, asLocal);
- if (url != null)
- urls.add(url);
- if (fragments != null) {
- for (int i = 0; i < fragments.length; i++) {
- Bundle fragment = fragments[i];
- url = internalFindFromBundleOnly(fragment, filename, asLocal);
- if (url != null)
- urls.add(url);
- }
- }
- return (URL[]) urls.toArray(new URL[urls.size()]);
- }
-
- /**
- * @param bundle
- * @param filenameWithinBundle
- * @param asLocal
- * @return
- *
- * @since 1.2.0
- */
- private static URL internalFindFromBundleOnly(Bundle bundle, String filenameWithinBundle, boolean asLocal) {
- try {
- URL pvm = bundle.getEntry(filenameWithinBundle);
- if (pvm != null)
- return asLocal ? FileLocator.toFileURL(pvm) : pvm;
- } catch (IOException e) {
- }
- if (ProxyPlugin.getPlugin().isDevMode()) {
- return findDev(bundle, filenameWithinBundle, asLocal);
- } else
- return null;
- }
-
- /**
- * Find the filename relative to the platform bundle. It will search in the bundle and in all fragments for the file name. It will return
- * URL for the file if found.
- * <p>
- * If in development mode, then if the jar is not found it will look in the plugin project's build.properties to find the output directory
- * of the jar. If not in the build.properties (meaning it isn't being built by PDE), it will look in the proxy.jars file (if there is one).
- * This file is used for jars that are built in a separate project from the plugin but will be found in the plugin at execution.
- *
- * @param bundle bundle and its fragments to look in.
- * @param filenameWithinBundle path to filename within the bundle and fragments. <b>This must be a file, not a directory.</b>
- * For finding the bundle itself (only when the bundle is packaged as a jar), use <@link #platformFind(Bundle)>.
- * @param asLocal <code>true</code> if the urls need to point to local filesystem files. This may cause caching of files locally. This
- * could happen if the file is within a plugin that is jarred. <code>false</code> if the url can be a non-local filesystem url.
- * @return the found url or <code>null</code> if not found.
- *
- * @since 1.2.0
- */
- public static URL platformFind(Bundle bundle, IPath filenameWithinBundle, boolean asLocal) {
- try {
- URL pvm = FileLocator.find(bundle, filenameWithinBundle, null);
- if (pvm != null)
- return asLocal ? FileLocator.toFileURL(pvm) : pvm;
- } catch (IOException e) {
- }
- if (ProxyPlugin.getPlugin().isDevMode()) {
- return findDev(bundle, filenameWithinBundle.toString(), asLocal);
- } else
- return null;
-
- }
-
- private static final String BUILDPROPERTIES = "build.properties"; //$NON-NLS-1$
- private static final String PROXYJARS = "proxy.jars"; //$NON-NLS-1$
-
- private static URL findDev(Bundle bundle, String filenameWithinBundle, boolean asLocal) {
- // Got this far and in dev mode means it wasn't found, so we'll try for development style.
- // It is assumed that in dev mode, we are running with the IDE as local and any
- // build outputs will be local so local file protocol will be returned
- // from Platform.resolve(). We won't be running in dev mode with our entireplugin being in a jar,
- // or on a separate system.
- try {
- URL bp = bundle.getEntry(BUILDPROPERTIES);
- if (bp != null) {
- InputStream ios = null;
- try {
- ios = bp.openStream();
- Properties props = new Properties();
- props.load(ios);
- String pathString = props.getProperty("output."+filenameWithinBundle.toString()); //$NON-NLS-1$
- if (pathString != null) {
- URL pvm = bundle.getEntry(pathString);
- if (pvm != null)
- return asLocal ? FileLocator.toFileURL(pvm) : pvm;
- }
- } finally {
- if (ios != null)
- ios.close();
- }
- }
- } catch (IOException e) {
- }
-
- try {
- URL pvm = bundle.getEntry(PROXYJARS);
- if (pvm != null) {
- InputStream ios = null;
- try {
- ios = pvm.openStream();
- Properties props = new Properties();
- props.load(ios);
- String pathString = props.getProperty(filenameWithinBundle.toString());
- if (pathString != null) {
- URL url = FileLocator.resolve(bundle.getEntry("/")); // It is assumed that if in debug mode, then this plugin is an imported plugin within the developement workspace. //$NON-NLS-1$
- if (url.getProtocol().equals("file")) { //$NON-NLS-1$
- File file = new File(url.getFile()).getParentFile(); // This gets us to workspace root of development workspace.
- file = new File(file, pathString);
- return file.toURL();
- }
- }
- } finally {
- if (ios != null)
- ios.close();
- }
- }
- } catch (IOException e) {
- }
- return null;
- }
-
-
- /**
- * Find the bundle and all active fragments libraries. This should normally be used only when the bundle is packaged as a jar and not as a directory. It will
- * return the urls to the jars of the bundle and fragments. If in development mode it will find the bundle's "." output directory.
- * @param bundle
- * @return array of URL's for the jarred bundle and fragments. If the bundle/fragments are not packaged as jars, then the array will be empty.
- *
- * @since 1.2.0
- */
- public static URL[] platformFind(Bundle bundle) {
- return null;
- }
-
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/ProxyLaunchSupport.java b/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/ProxyLaunchSupport.java
deleted file mode 100644
index 4a18afbed..000000000
--- a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/ProxyLaunchSupport.java
+++ /dev/null
@@ -1,871 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 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.jem.internal.proxy.core;
-
-import java.io.File;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.text.MessageFormat;
-import java.util.*;
-import java.util.logging.Level;
-
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
-import org.eclipse.core.runtime.jobs.IJobManager;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.debug.core.*;
-import org.eclipse.jdt.core.*;
-import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
-import org.osgi.framework.Bundle;
-
-import org.eclipse.jem.internal.proxy.core.IConfigurationContributionInfo.ContainerPaths;
-import org.eclipse.jem.internal.proxy.core.ProxyPlugin.FoundIDs;
-import org.eclipse.jem.util.PerformanceMonitorUtil;
-import org.eclipse.jem.util.TimerTests;
-
-
-/**
- * This is the used to launch the proxy registries.
- * This is a static helper class, it is not meant to be instantiated.
- *
- * @since 1.0.0
- */
-public class ProxyLaunchSupport {
-
- // The key for the persisten property is in ProxyPlugin so that it can set it on startup without
- // causing this class to be initialized. We don't want this class initialized until the very last
- // moment when needed. This is because it needs UI to be active when initialized to query some
- // values and if ProxyPlugin.start() causes this class to initialize, it may be too soon.
- //
- // If a project's persistent property is set with this value, that means there is at least one
- // launch configuration with this project, but none are selected as the default. This is here
- // so that we can check in the object contribution that if not set then don't show the menu
- // item at all. This is to clean up the popup menu so not so cluttered.
- // If the property is trully not set, then there is no default and there are no configurations for it.
- public static final String NOT_SET = "...not..set.."; //$NON-NLS-1$
-
- public static final String EXPRESSION_TRACING = "/debug/traceexpressions"; // Trace IExpressions. //$NON-NLS-1$
-
- /**
- * Timer threshold for indicating any expressions that took longer than this.
- * If not set, then threshold will default to 100ms.
- * It will only be used if traceexpressions is true.
- */
- public static final String EXPRESSION_TRACEING_TIMER_THRESHOLD = "/debug/traceexpressionstimethreshold"; //$NON-NLS-1$
-
- /*
- * Registry of launch key to LaunchInfo classes.
- */
- private static Map LAUNCH_INFO = new HashMap(2);
-
- /**
- * Public only for access by other launch delegates to set up if they go outside of ProxyLaunchSupport,
- * e.g. IDE proxy. Must not be used for any purpose.
- *
- * @since 1.0.0
- */
- public static class LaunchSupportIConfigurationContributionInfo implements IConfigurationContributionInfo {
-
- /**
- * Construct with no settings. This is to be used by other launch delegates that
- * don't have a {@link FoundIDs} available to fill in the fields. Those
- * delegates must fill the fields themselves.
- *
- *
- * @since 1.2.0
- */
- public LaunchSupportIConfigurationContributionInfo(IJavaProject javaProject) {
- this.javaProject = javaProject;
- }
-
- public LaunchSupportIConfigurationContributionInfo(IJavaProject javaProject, FoundIDs foundIDs) {
- this(javaProject);
- containerIds = foundIDs.containerIds;
- containers = foundIDs.containers;
- pluginIds = foundIDs.pluginIds;
- projectPaths = foundIDs.projects;
- }
-
- /* (non-Javadoc)
- * Map of containers (IClasspathContainer) found in classpath (including required projects).
- * This is for each project found. If there was a container in more than one project with the
- * id, this set will contain the container from each such project. They are not considered the
- * same because they come from a different project.
- * <p>
- * The key will be the containers, and the value will be a <code>Boolean</code>, where true means it
- * is visible to the top-level project.
- * <p>
- * This is used for determining if a project's container implements the desired contributor.
- *
- * Will be empty if no project sent in to launch configuration.
- *
- * @see org.eclipse.jdt.core.IClasspathContainer
- *
- */
- public Map containers = Collections.EMPTY_MAP;
-
-
- /* (non-Javadoc)
- * Map of unique container id strings found in classpath (including required projects).
- * If a container with the same id was found in more than one project, only one id will
- * be in this set since they are the same.
- * <p>
- * The key will be the container ids, and the value will be ContainerPaths
- *
- * Will be empty if no project sent in to launch configuration.
- *
- */
- public Map containerIds = Collections.EMPTY_MAP;
-
- /* (non-Javadoc)
- * Set of unique plugin id strings found in classpath (including required projects).
- * If a required plugin with the same id was found in more than one project, only one id will
- * be in this set since they are the same.
- * <p>
- * The key will be the plugin ids, and the value will be a <code>Boolean</code>, where true means it
- * is visible to the top-level project.
- *
- * Will be empty if no project sent in to launch configuration.
- */
- public Map pluginIds = Collections.EMPTY_MAP;;
-
- /* (non-Javadoc)
- * Map of unique projects found in classpath (including required projects), but not including top-level project.
- * <p>
- * The key will be the <code>IPath</code> for the project, and the value will be a <code>Boolean</code>, where true means it
- * is visible to the top-level project.
- *
- * Will be <code>null</code> if no project sent in to launch configuration.
- */
- public Map projectPaths;
-
- /* (non-Javadoc)
- * Java project for this launch. <code>null</code> if not for a project.
- */
- public IJavaProject javaProject;
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IConfigurationContributionInfo#getContainerIds()
- */
- public Map getContainerIds() {
- return containerIds;
- }
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IConfigurationContributionInfo#getContainers()
- */
- public Map getContainers() {
- return containers;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IConfigurationContributionInfo#getJavaProject()
- */
- public IJavaProject getJavaProject() {
- return javaProject;
- }
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IConfigurationContributionInfo#getPluginIds()
- */
- public Map getPluginIds() {
- return pluginIds;
- }
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IConfigurationContributionInfo#getProjectPaths()
- */
- public Map getProjectPaths() {
- return projectPaths;
- }
-
- }
-
- /**
- * LaunchInfo for a launch. Stored by key and retrievable by the key.
- * This is only passed to launch delegates. It should not be passed on to
- * others, though the IConfigurationContributionInfo may be.
- *
- * <p>
- * This class is not intended to be subclassed by clients.
- * </p>
- *
- * @see ProxyLaunchSupport#getInfo(String)
- * @see IConfigurationContributionInfo
- * @since 1.0.0
- */
- public static class LaunchInfo {
- /**
- * Contributors for this launch. It will never be <code>null</code>. It may be empty.
- */
- public IConfigurationContributor[] contributors;
-
- /**
- * The registry returned from the launch. The launch needs to set this before it returns.
- */
- public ProxyFactoryRegistry resultRegistry;
-
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IConfigurationContributionInfo#getJavaProject()
- */
- public IJavaProject getJavaProject() {
- return configInfo.getJavaProject();
- }
-
- /**
- * Return the IConfigurationContributionInfo for this launch.
- * @return
- *
- * @since 1.0.0
- */
- public IConfigurationContributionInfo getConfigInfo() {
- return configInfo;
- }
-
- protected IConfigurationContributionInfo configInfo;
-
- }
-
- /**
- * Start an implementation using the default config for the given project.
- * <p>
- * This will wait for build. If you
- * know the build has been suspended by your thread, then you must use the other method that takes a waitForThread
- * boolean, and you must pass in false. Otherwise it will deadlock.
- *
- * @param project The project. It must be a java project, and it cannot be <code>null</code>.
- * @param vmTitle title for VM. It may be <code>null</code>.
- * @param aContribs The contributions array. It may be <code>null</code>.
- * @param pm
- * @return The created registry.
- * @throws CoreException
- *
- * @see ProxyLaunchSupport#startImplementation(IProject, String, IConfigurationContributor[], boolean, IProgressMonitor)
- * @since 1.0.0
- */
- public static ProxyFactoryRegistry startImplementation(
- IProject project,
- String vmTitle,
- IConfigurationContributor[] aContribs,
- IProgressMonitor pm)
- throws CoreException {
- return startImplementation(project, vmTitle, aContribs, true, pm);
- }
-
- /**
- * Start an implementation using the default config for the given project.
- * <p>
- * If you know the build has been suspended by your thread, then you must use call this with false for waitForThread. Otherwise it will deadlock.
- *
- * @param project The project. It must be a java project, and it cannot be <code>null</code>.
- * @param vmTitle title for VM. It may be <code>null</code>.
- * @param aContribs The contributions array. It may be <code>null</code>.
- * @param waitForBuild wait for the build. If caller knows that the build has been suspended by this thread, then it must call this with false. Otherwise a deadlock will occur.
- * @param pm
- * @return The created registry.
- * @throws CoreException
- *
- * @since 1.0.0
- */
- public static ProxyFactoryRegistry startImplementation(
- IProject project,
- String vmTitle,
- IConfigurationContributor[] aContribs,
- boolean waitForBuild,
- IProgressMonitor pm)
- throws CoreException {
- // First find the appropriate launch configuration to use for this project.
- // The process is:
- // 1) See if the project's persistent property has a setting for "proxyLaunchConfiguration", if it does,
- // get the configuration of that name and create a working copy of it.
- // 2) If not, then get the "org.eclipse.jem.proxy.LocalProxyLaunchConfigurationType"
- // and create a new instance working copy.
-
- IJavaProject javaProject = JavaCore.create(project);
- if (javaProject == null) {
- throw new CoreException(
- new Status(
- IStatus.WARNING,
- ProxyPlugin.getPlugin().getBundle().getSymbolicName(),
- 0,
- MessageFormat.format(
- ProxyMessages.Not_Java_Project_WARN_,
- new Object[] { project.getName()}),
- null));
- }
-
- // First if specific set.
- String launchName = project.getPersistentProperty(ProxyPlugin.PROPERTY_LAUNCH_CONFIGURATION);
- ILaunchConfiguration config = null;
- if (launchName != null && !NOT_SET.equals(launchName)) {
- ILaunchConfiguration[] configs = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurations();
- for (int i = 0; i < configs.length; i++) {
- if (configs[i].getName().equals(launchName)) {
- config = configs[i];
- break;
- }
- }
- if (config == null || !config.getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, "").equals(project.getName())) { //$NON-NLS-1$
- project.setPersistentProperty(ProxyPlugin.PROPERTY_LAUNCH_CONFIGURATION, (String) null); // Config not found, or for a different project, so no longer the default.
- config = null;
- }
- }
-
- if (config == null) {
- ILaunchConfigurationWorkingCopy configwc = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationType(IProxyConstants.LOCAL_LAUNCH_TYPE).newInstance(null, DebugPlugin.getDefault().getLaunchManager().generateUniqueLaunchConfigurationNameFrom("LocalProxy_"+project.getName())); //$NON-NLS-1$
- configwc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, project.getName());
- config = configwc;
- }
-
- return startImplementation(config, vmTitle, aContribs, waitForBuild, pm);
- }
-
- /**
- * Launch a registry using the given configuration.
- * <p>
- * This will wait for build. If you
- * know the build has been suspended by your thread, then you must use the other method that takes a waitForThread
- * boolean, and you must pass in false. Otherwise it will deadlock.
- *
- * @param config
- * @param vmTitle title for VM. It may be <code>null</code>.
- * @param aContribs The contributions array. It may be <code>null</code>.
- * @param pm
- * @return The registry from this configuration.
- * @throws CoreException
- *
- * @see ProxyLaunchSupport#startImplementation(ILaunchConfiguration, String, IConfigurationContributor[], boolean, IProgressMonitor)
- * @since 1.0.0
- */
- public static ProxyFactoryRegistry startImplementation(
- ILaunchConfiguration config,
- String vmTitle,
- IConfigurationContributor[] aContribs,
- IProgressMonitor pm)
- throws CoreException {
- return startImplementation(config, vmTitle, aContribs, true, pm);
- }
-
- /**
- * Launch a registry using the given configuration.
- * <p>
- * If you know the build has been suspended by your thread, then you must use you must pass in false for waitForThread. Otherwise it will deadlock.
- *
- * @param config
- * @param vmTitle title for VM. It may be <code>null</code>.
- * @param aContribs The contributions array. It may be <code>null</code>.
- * @param waitForBuild wait for the build. If caller knows that the build has been suspended by this thread, then it must call this with false. Otherwise a deadlock will occur.
- * @param pm
- * @return The registry from this configuration.
- * @throws CoreException
- *
- * @since 1.0.0
- */
- public static ProxyFactoryRegistry startImplementation(
- ILaunchConfiguration config,
- String vmTitle,
- IConfigurationContributor[] aContribs,
- boolean waitForBuild,
- IProgressMonitor pm)
- throws CoreException {
-
- if (pm == null)
- pm = new NullProgressMonitor();
- String stepId = "Pre-launch VM ( " + vmTitle + " )"; //$NON-NLS-1$ //$NON-NLS-2$
- TimerTests.basicTest.startStep(stepId);
- if (vmTitle.equals("Beaninfo")) //$NON-NLS-1$
- PerformanceMonitorUtil.getMonitor().snapshot(125);
- final ILaunchConfigurationWorkingCopy configwc = config.getWorkingCopy();
-
- pm.beginTask("", 400); //$NON-NLS-1$
- pm.subTask(ProxyMessages.ProxyLaunch);
- if (waitForBuild) {
- // See if build needed or waiting or inprogress, if so, wait for it to complete. We've
- // decided too difficult to determine if build would affect us or not, so just wait.
- if (UI_RUNNER != null)
- UI_RUNNER.handleBuild(new SubProgressMonitor(pm, 100));
- else
- runBuild(new SubProgressMonitor(pm, 100));
-
- if (pm.isCanceled())
- return null;
- }
-
- if (aContribs != null) {
- IConfigurationContributor[] newContribs = new IConfigurationContributor[aContribs.length+1];
- System.arraycopy(aContribs, 0, newContribs, 1, aContribs.length);
- newContribs[0] = new ProxyContributor();
- aContribs = newContribs;
- } else
- aContribs = new IConfigurationContributor[] {new ProxyContributor()};
-
- String launchKey = String.valueOf(System.currentTimeMillis());
- LaunchInfo launchInfo = new LaunchInfo();
- synchronized (ProxyLaunchSupport.class) {
- while (LAUNCH_INFO.containsKey(launchKey)) {
- launchKey += 'a'; // Just add something on to make it unique.
- }
- LAUNCH_INFO.put(launchKey, launchInfo);
- }
-
- String projectName = configwc.getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, (String) null);
- aContribs = fillInLaunchInfo(aContribs, launchInfo, projectName);
-
- try {
- configwc.setAttribute(IProxyConstants.ATTRIBUTE_LAUNCH_KEY, launchKey);
- if (vmTitle != null && vmTitle.length()>0)
- configwc.setAttribute(IProxyConstants.ATTRIBUTE_VM_TITLE, vmTitle);
-
- if (ATTR_PRIVATE != null)
- configwc.setAttribute(ATTR_PRIVATE, true);
-
- // Let contributors modify the configuration.
- final IConfigurationContributor[] contribs = aContribs;
- final LaunchInfo linfo = launchInfo;
- for (int i = 0; i < contribs.length; i++) {
- // First run the initialize.
- // Run in safe mode so that anything happens we don't go away.
- final int ii = i;
- SafeRunner.run(new ISafeRunnable() {
- public void handleException(Throwable exception) {
- // Don't need to do anything. Platform.run logs it for me.
- }
-
- public void run() throws Exception {
- contribs[ii].initialize(linfo.getConfigInfo());
- }
- });
-
- // Now run the contribute to configuration.
- // Run in safe mode so that anything happens we don't go away.
- SafeRunner.run(new ISafeRunnable() {
- public void handleException(Throwable exception) {
- // Don't need to do anything. Platform.run logs it for me.
- }
-
- public void run() throws Exception {
- contribs[ii].contributeToConfiguration(configwc);
- }
- });
- }
- pm.worked(100);
-
- configwc.launch(ILaunchManager.RUN_MODE, new SubProgressMonitor(pm, 100));
-
- final ProxyFactoryRegistry reg = launchInfo.resultRegistry;
- if (!pm.isCanceled() && reg == null)
- throw new CoreException(new Status(IStatus.WARNING, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, ProxyMessages.ProxyLaunchSupport_RegistryCouldNotStartForSomeReason_WARN_, null));
- if (pm.isCanceled()) {
- if (reg != null)
- reg.terminateRegistry();
- return null;
- }
-
- performExtensionRegistrations((BaseProxyFactoryRegistry) reg, launchInfo);
-
-// TimerTests.basicTest.startStep("contribute to registry");
- for (int i = 0; i < contribs.length; i++) {
- final int ii = i;
- // Run in safe mode so that anything happens we don't go away.
- SafeRunner.run(new ISafeRunnable() {
- public void handleException(Throwable exception) {
- // Don't need to do anything. Platform.run logs it for me.
- }
-
- public void run() throws Exception {
-// String stepid = "contribute to registry for " + contribs[ii].getClass();
-// TimerTests.basicTest.startStep(stepid);
- contribs[ii].contributeToRegistry(reg);
-// TimerTests.basicTest.stopStep(stepid);
- }
- });
- }
-// TimerTests.basicTest.stopStep("contribute to registry");
- } finally {
- // Clean up and return.
- LAUNCH_INFO.remove(launchKey);
- }
-
- pm.done();
- if (vmTitle.equals("Beaninfo")) //$NON-NLS-1$
- PerformanceMonitorUtil.getMonitor().snapshot(126);
- TimerTests.basicTest.stopStep(stepId);
- return launchInfo.resultRegistry;
- }
-
- /**
- * Create a default IConfigurationContributionInfo for the given project. This is useful info even when not launching a
- * vm.
- *
- * @param javaProject
- * @return new contrib info.
- * @throws JavaModelException
- *
- * @since 1.1.0
- */
- public static IConfigurationContributionInfo createDefaultConfigurationContributionInfo(IJavaProject javaProject) throws JavaModelException {
- LaunchSupportIConfigurationContributionInfo configInfo = new LaunchSupportIConfigurationContributionInfo(javaProject,
- ProxyPlugin.getPlugin().getIDsFound(javaProject));
- return configInfo;
-
- }
-
- /**
- * Use in calling {@link ProxyLaunchSupport#fillInLaunchInfo(IConfigurationContributor[], LaunchInfo, String)} for the configuration
- * contributors array if there are no incoming contributors.
- *
- * @since 1.1.0
- */
- public static final IConfigurationContributor[] EMPTY_CONFIG_CONTRIBUTORS = new IConfigurationContributor[0];
- /**
- * Fill in the launch info config info and contribs. The contribs sent in may be expanded due to extension
- * points and a new one created. Either the expanded copy or the original (if no change) will be stored in
- * the launchinfo and returned from this call.
- *
- * @param aContribs this should never be <code>null</code>. Pass in {@link ProxyLaunchSupport#EMPTY_CONFIG_CONTRIBUTORS} in that case.
- * @param launchInfo
- * @param projectName
- * @return a modified aContribs if any change was made to it. This will never be <code>null</code>. It will return an empty list if aContribs was null and no changes were made.
- * @throws JavaModelException
- * @throws CoreException
- *
- * @since 1.0.0
- */
- public static IConfigurationContributor[] fillInLaunchInfo(IConfigurationContributor[] aContribs, LaunchInfo launchInfo, String projectName) throws JavaModelException, CoreException {
- if (projectName != null) {
- projectName = projectName.trim();
- if (projectName.length() > 0) {
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
- IJavaProject javaProject = JavaCore.create(project);
- if (javaProject != null && javaProject.exists()) {
- launchInfo.configInfo = createDefaultConfigurationContributionInfo(javaProject);
- if (!launchInfo.configInfo.getContainerIds().isEmpty() || !launchInfo.configInfo.getContainers().isEmpty() || !launchInfo.configInfo.getPluginIds().isEmpty()) {
- List computedContributors = new ArrayList(launchInfo.configInfo.getContainerIds().size()+launchInfo.configInfo.getContainers().size()+launchInfo.configInfo.getPluginIds().size());
- // Note: We don't care about the visibility business here. For contributors to proxy it means
- // some classes in the projects/plugins/etc. need configuration whether they are visible or not.
- // This is because even though not visible, some other visible class may instantiate it. So it
- // needs the configuration.
- // First handle explicit classpath containers that implement IConfigurationContributor
- for (Iterator iter = launchInfo.configInfo.getContainers().keySet().iterator(); iter.hasNext();) {
- IClasspathContainer container = (IClasspathContainer) iter.next();
- if (container instanceof IConfigurationContributor)
- computedContributors.add(container);
- }
-
- // Second add in contributors that exist for a container id.
- for (Iterator iter = launchInfo.configInfo.getContainerIds().values().iterator(); iter.hasNext();) {
- ContainerPaths paths = (ContainerPaths) iter.next();
- IConfigurationElement[] contributors = ProxyPlugin.getPlugin().getContainerConfigurations(paths.getContainerId(), paths.getAllPaths());
- if (contributors != null)
- for (int i = 0; i < contributors.length; i++) {
- Object contributor = contributors[i].createExecutableExtension(ProxyPlugin.PI_CLASS);
- if (contributor instanceof IConfigurationContributor)
- computedContributors.add(contributor);
- }
- }
-
- // Finally add in contributors that exist for a plugin id.
- for (Iterator iter = launchInfo.configInfo.getPluginIds().keySet().iterator(); iter.hasNext();) {
- String pluginId = (String) iter.next();
- IConfigurationElement[] contributors = ProxyPlugin.getPlugin().getPluginConfigurations(pluginId);
- if (contributors != null)
- for (int i = 0; i < contributors.length; i++) {
- Object contributor = contributors[i].createExecutableExtension(ProxyPlugin.PI_CLASS);
- if (contributor instanceof IConfigurationContributor)
- computedContributors.add(contributor);
- }
- }
-
- // Now turn into array
- if (!computedContributors.isEmpty()) {
- IConfigurationContributor[] newContribs = new IConfigurationContributor[aContribs.length
- + computedContributors.size()];
- System.arraycopy(aContribs, 0, newContribs, 0, aContribs.length);
- IConfigurationContributor[] cContribs = (IConfigurationContributor[]) computedContributors
- .toArray(new IConfigurationContributor[computedContributors.size()]);
- System.arraycopy(cContribs, 0, newContribs, aContribs.length, cContribs.length);
- aContribs = newContribs;
- }
- }
- }
- }
- }
-
- launchInfo.contributors = aContribs;
- return aContribs;
- }
-
- /**
- * Execute the extension registrations that are valid for this type of registry and the launchinfo paths.
- * <p>
- * This is meant to be called only by registry implementations that do not launch through a launch configration after the registry is created but
- * before the {@link IConfigurationContributor#contributeToRegistry(ProxyFactoryRegistry)} is called. This will be called automatically
- * by registries that used a launch configuration to launch.
- *
- * @param baseRegistry
- * @param launchInfo
- * @throws CoreException
- *
- * @since 1.1.0
- */
- public static void performExtensionRegistrations(final BaseProxyFactoryRegistry baseRegistry, LaunchInfo launchInfo) throws CoreException {
- IConfigurationContributionInfo configInfo = launchInfo.configInfo;
- if (configInfo != null && (!configInfo.getContainerIds().isEmpty() || !configInfo.getPluginIds().isEmpty())) {
- String registryID = baseRegistry.getRegistryTypeID();
- // Note: We don't care about the visibility business here. For contributors to proxy it means
- // some classes in the projects/plugins/etc. need configuration whether they are visible or not.
- // This is because even though not visible, some other visible class may instantiate it. So it
- // needs the configuration.
-
- // First call registrations that exist for a container id.
- for (Iterator iter = configInfo.getContainerIds().values().iterator(); iter.hasNext();) {
- ContainerPaths paths = (ContainerPaths) iter.next();
- IConfigurationElement[] contributors = ProxyPlugin.getPlugin().getContainerExtensions(paths.getContainerId(), paths.getAllPaths());
- if (contributors != null)
- for (int i = 0; i < contributors.length; i++) {
- if (registryID.equals(contributors[i].getAttribute(ProxyPlugin.PI_REGISTRY_TYPE))) {
- try {
- final IExtensionRegistration contributor = (IExtensionRegistration) contributors[i].createExecutableExtension(ProxyPlugin.PI_CLASS);
- SafeRunner.run(new ISafeRunnable() {
-
- public void run() throws Exception {
- contributor.register(baseRegistry);
- }
-
- public void handleException(Throwable exception) {
- // Don't need to do anything, Platform logs it for me.
- }
-
- });
- } catch (ClassCastException e) {
- // If not right class, just ignore it.
- }
- }
- }
- }
-
- // Finally add in contributors that exist for a plugin id.
- for (Iterator iter = configInfo.getPluginIds().keySet().iterator(); iter.hasNext();) {
- String pluginId = (String) iter.next();
- IConfigurationElement[] contributors = ProxyPlugin.getPlugin().getPluginExtensions(pluginId);
- if (contributors != null)
- for (int i = 0; i < contributors.length; i++) {
- if (registryID.equals(contributors[i].getAttribute(ProxyPlugin.PI_REGISTRY_TYPE))) {
- try {
- final IExtensionRegistration contributor = (IExtensionRegistration) contributors[i].createExecutableExtension(ProxyPlugin.PI_CLASS);
- SafeRunner.run(new ISafeRunnable() {
-
- public void run() throws Exception {
- contributor.register(baseRegistry);
- }
-
- public void handleException(Throwable exception) {
- // Don't need to do anything, Platform logs it for me.
- }
-
- });
- } catch (ClassCastException e) {
- // If not right class, just ignore it.
- }
- }
- }
- }
- }
-}
-
-
- /*
- * Run the build. If the original launch was in the UI thread, this will
- * be called under control of an IProgressService so that it is in a separate
- * thread and the UI will remain responsive (in that either a busy cursor comes
- * up or eventually a progress dialog).
- * If the pm is canceled, this will just return, but the caller must check if the pm is canceled.
- *
- * <package-protected> so that only the UI handler will access it.
- */
- static void runBuild(IProgressMonitor pm) throws CoreException {
- boolean autobuilding = ResourcesPlugin.getWorkspace().isAutoBuilding();
- if (!autobuilding) {
- try {
- // We are not autobuilding. So kick off a build right here and
- // wait for it. (If we already within a build on this thread, then this
- // will return immediately without building. We will take that risk. If
- // some other thread is building, we will wait for it finish before we
- // can get it and do our build.
- ResourcesPlugin.getWorkspace().build(IncrementalProjectBuilder.INCREMENTAL_BUILD, pm);
- } catch (OperationCanceledException e) {
- // The pm is already marked canceled, so caller can check that instead.
- }
- } else {
- pm.beginTask("", 200); //$NON-NLS-1$
- IJobManager jobManager = Job.getJobManager();
- Job currentJob = jobManager.currentJob();
- if (currentJob == null || (!currentJob.belongsTo(ResourcesPlugin.FAMILY_AUTO_BUILD) && !currentJob.belongsTo(ResourcesPlugin.FAMILY_MANUAL_BUILD))) {
- if (jobManager.find(ResourcesPlugin.FAMILY_AUTO_BUILD).length > 0 || jobManager.find(ResourcesPlugin.FAMILY_MANUAL_BUILD).length >0) {
- // We are not within a build job. If we were, then we don't do the build. We will take
- // that risk. The problem is that if within the build, we can't wait for it to finish because
- // we would stop the thread and so the build would not complete.
- pm.subTask(ProxyMessages.ProxyWaitForBuild);
- try {
- while (true) {
- try {
- jobManager.join(ResourcesPlugin.FAMILY_AUTO_BUILD, new SubProgressMonitor(pm, 100));
- jobManager.join(ResourcesPlugin.FAMILY_MANUAL_BUILD, new SubProgressMonitor(pm, 100));
- break;
- } catch (InterruptedException e) {
- }
- }
- } catch (OperationCanceledException e) {
- }
- }
- }
- pm.done();
- }
- }
-
-
- /*
- * This prevents the launch from being shown. However these constants are in UI component, and we don't
- * want to pre-req that. So we will get them reflectively instead.
- * public but only so that launch delegate can get to it.
- */
- public static String ATTR_PRIVATE;
- private static IUIRunner UI_RUNNER = null;
-
- static {
- ATTR_PRIVATE = null;
- try {
- // See if we have a UI bundle and it is active. If it exists but is not active,
- // then we won't do anything. If we were running a UI application, it should already
- // of been active before we got here.
- Bundle uiBundle = Platform.getBundle("org.eclipse.ui"); //$NON-NLS-1$
- if (uiBundle != null && uiBundle.getState() == Bundle.ACTIVE) {
- try {
- // We have a UI bundle, so we can load our UIRunner class and it will load fine.
- UI_RUNNER = (IUIRunner) Class.forName("org.eclipse.jem.internal.proxy.core.UIRunner").newInstance(); //$NON-NLS-1$
- } catch (InstantiationException e1) {
- ProxyPlugin.getPlugin().getLogger().log(e1, Level.WARNING);
- }
-
- // So that we can run headless (w/o ui), need to do class forName for debugui contants
- Bundle debuguiBundle = Platform.getBundle("org.eclipse.debug.ui"); //$NON-NLS-1$
- if (debuguiBundle != null && debuguiBundle.getState() == Bundle.ACTIVE) {
- Class debugUIConstants = debuguiBundle.loadClass("org.eclipse.debug.ui.IDebugUIConstants"); //$NON-NLS-1$
- ATTR_PRIVATE = (String) debugUIConstants.getField("ATTR_PRIVATE").get(null); //$NON-NLS-1$
- }
- }
- } catch (SecurityException e) {
- } catch (ClassNotFoundException e) {
- } catch (NoSuchFieldException e) {
- } catch (IllegalArgumentException e) {
- } catch (IllegalAccessException e) {
- }
- }
-
- /* (non-Javadoc)
- * Only referenced by launch delegates. public because they are in other packages,
- * or even external developers packages. Not meant to be generally available.
- *
- * This is needed because we can't pass the generic info into a launch configuration
- * because a launch configuration can't take objects. Only can take strings and numbers.
- */
- public static synchronized LaunchInfo getInfo(String key) {
- return (LaunchInfo) LAUNCH_INFO.get(key);
- }
-
- /**
- * Convert the string path into a valid url.
- * @param path
- * @return the url or <code>null</code> if not convertable (i.e. not well-formed).
- *
- * @since 1.0.0
- */
- public static URL convertStringPathToURL(String path) {
- try {
- return path != null ? new File(path).toURL() : null;
- } catch (MalformedURLException e) {
- return null;
- }
- }
-
- /**
- * Convert the string paths into a valid urls.
- *
- * @param paths
- * @return the urls or <code>null</code> if paths is null. Any path not convertable (i.e. not well-formed) will not be in the final list.
- * So this means the result length may be smaller than the paths length.
- *
- * @since 1.0.0
- */
- public static URL[] convertStringPathsToURL(String[] paths) {
- if (paths != null) {
- URL[] result = new URL[paths.length];
- int nextURL = 0;
- for (int i = 0; i < paths.length; i++) {
- URL url = convertStringPathToURL(paths[i]);
- if (url != null)
- result[nextURL++] = url;
- }
- if (nextURL == 0)
- return null; // None were found.
-
- if (nextURL != result.length) {
- URL[] nr = new URL[nextURL];
- System.arraycopy(result, 0, nr, 0, nr.length);
- result = nr;
- }
- return result;
- } else
- return null;
- }
-
- /**
- * Convert the urls to string array. It is assumed the urls are in file protocol. It handles platform and JDK reqts. too.
- * @param urls
- * @return string paths or <code>null</code> if urls is <code>null</code>. Any <code>null</code> entry of urls will result in
- * a corresponding <code>null</code> in the strings.
- *
- * @since 1.0.0
- */
- public static String[] convertURLsToStrings(URL[] urls) {
- if (urls != null) {
- String[] strings = new String[urls.length];
- for (int i = 0; i < urls.length; i++) {
- // [132378] There is a problem with IBM JDK's. They can't handle the getFile() from a URL in the java lib path on Windows.
- // That is because the normalized format of a file url on windows is "file:/D:/asdfasf". But IBM JDKs can't handle the
- // leading slash. Sun JDKs do.
- URL url = urls[i];
- if (url != null) {
- strings[i] = url.getFile();
- if(strings[i].startsWith("/") && Platform.getOS().equals(Platform.OS_WIN32)) //$NON-NLS-1$
- strings[i] = strings[i].substring(1);
- }
- }
- return strings;
- } else
- return null;
- }
-
- /* (non-Javadoc)
- * Local contributor used to make sure that certain jars are in the path.
- *
- * @since 1.0.0
- */
- static class ProxyContributor extends ConfigurationContributorAdapter {
- public void contributeClasspaths(IConfigurationContributionController controller) {
- // Add the required jars to the end of the classpath. (We want proxyCommon and initParser (+ initParser NLS), but they are in the runtime of the proxy bundle (which is jarred up), so we contribute the bundle instead.
- controller.contributeClasspath(ProxyPlugin.getPlugin().getBundle(), (IPath) null, IConfigurationContributionController.APPEND_USER_CLASSPATH, true); //$NON-NLS-1$
- }
- }
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/ProxyMessages.java b/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/ProxyMessages.java
deleted file mode 100644
index 81786529f..000000000
--- a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/ProxyMessages.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 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.jem.internal.proxy.core;
-
-import org.eclipse.osgi.util.NLS;
-
-public final class ProxyMessages extends NLS {
-
- private static final String BUNDLE_NAME = "org.eclipse.jem.internal.proxy.core.messages";//$NON-NLS-1$
-
- private ProxyMessages() {
- // Do not instantiate
- }
-
- public static String UnexpectedException_EXC_;
- public static String ClassCast_EXC__IncorrectType;
- public static String ProxyFactory_EXC__NoBeanProxyFactory;
- public static String ProxyFactory_EXC__NoBeanTypeProxyFactory;
- public static String Not_Java_Project_WARN_;
- public static String No_VM_WARN_;
- public static String No_Implementation_WARN_;
- public static String ProxyLaunch;
- public static String ProxyWaitForBuild;
- public static String Expression_InInvalidStateDueTo_EXC_;
- public static String Expression_InInvalidState_EXC_;
- public static String Expression_TypeSentInInvalidOrder_EXC_;
- public static String Expression_ArrayTypeNotAnArray_EXC_;
- public static String Expression_CannotHandleNoReceiveOnFieldAccess_EXC_;
- public static String Expression_MethodsNeedReceiver_EXC_;
- public static String Expression_InvalidMarkNesting;
- public static String ProxyPlugin_CleanupDefaultProxyLaunchConfigurations;
- public static String ProxyLaunchSupport_RegistryCouldNotStartForSomeReason_WARN_;
- public static String Expression_CreateProxyReassignmentExpression_InvalidForReassignment_EXC_;
-
- static {
- NLS.initializeMessages(BUNDLE_NAME, ProxyMessages.class);
- }
-
- public static String Expression_InvalidProxy;
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/ProxyPlugin.java b/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/ProxyPlugin.java
deleted file mode 100644
index dfd3fd5e3..000000000
--- a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/ProxyPlugin.java
+++ /dev/null
@@ -1,1371 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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.jem.internal.proxy.core;
-/*
-
-
- */
-
-
-import java.io.*;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.*;
-import java.util.Map.Entry;
-import java.util.logging.Level;
-import java.util.regex.Pattern;
-
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.debug.core.*;
-import org.eclipse.jdt.core.*;
-import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
-import org.eclipse.jdt.launching.JavaRuntime;
-import org.eclipse.osgi.service.resolver.BundleSpecification;
-import org.eclipse.osgi.util.ManifestElement;
-import org.osgi.framework.*;
-
-import org.eclipse.jem.util.logger.proxy.Logger;
-import org.eclipse.jem.util.logger.proxyrender.EclipseLogger;
-
-import org.eclipse.jem.internal.proxy.core.IConfigurationContributionInfo.ContainerPaths;
-
-/**
- * The plugin class for the org.eclipse.jem.internal.proxy.core plugin.
- */
-
-public class ProxyPlugin extends Plugin {
-
- /**
- * This interface is for a listener that needs to know if this plugin (ProxyPlugin) is being shutdown.
- * It is needed because there are some extensions that get added dynamically that need to know when the
- * plugin is being shutdown. Can't use new bundle listener for this because it notifies AFTER shutdown.
- *
- * @since 1.0.0
- */
- public interface IProxyPluginShutdownListener {
- /**
- * ProxyPlugin is in shutdown.
- *
- * @since 1.0.0
- */
- public void shutdown();
- }
-
- private static ProxyPlugin PROXY_PLUGIN = null;
- public static final String PREFERENCES_VM_NOVERIFY_KEY = "JEM_PREFERENCES_VM_NOVERIFY_KEY"; // Key for NOVERIFY option of VM //$NON-NLS-1$
- public static final String PDE_NATURE_ID = "org.eclipse.pde.PluginNature" ; //$NON-NLS-1$
-
- // If this is set to true, then in development mode and it will try for proxy jars in directories.
- private boolean devMode;
-
- private ListenerList shutdownListeners;
-
- public ProxyPlugin() {
- super();
- PROXY_PLUGIN = this;
- devMode = Platform.inDevelopmentMode();
- }
-
- public boolean isDevMode() {
- return devMode;
- }
-
- /**
- * Access the singleton
- * @return the singleton plugin
- *
- * @since 1.0.0
- */
- public static ProxyPlugin getPlugin() {
- return PROXY_PLUGIN;
- }
-
- private Logger logger;
- public Logger getLogger() {
- if (logger == null)
- logger = EclipseLogger.getEclipseLogger(this);
- return logger;
- }
-
- /**
- * This will take the bundle and file name and make it local and return that
- * fully qualified. It will look in fragments, but only returns first found. If there can be multiples use
- * the one for bundles and it fragments.
- * <p>
- * If we are in development and it will pick it up from the path
- * that is listed in the proxy.jars file located in the bundle passed in. This allows development code to be
- * used in place of the actual runtime jars. If the runtime jars are found,
- * they will be used.
- * <p>
- * For example if looking for file runtime/xyz.jar in bundle abc, then in bundle directory for abc,
- * there should be a file called proxy.jars. This should only be in development, this file should not
- * be distributed for production. It would be distributed in the SDK environment when testing is desired.
- * <p>
- * The format of the file is:
- * runtimefile=/projectname/builddirectory
- * <p>
- * For this to work when the actual jar is not found, the Eclipse must of been started in
- * dev mode (i.e. the bundle location will be a project within the developer Eclipse. That way
- * we can go up one level for the current install location and assume the above projectname
- * will be found relative to the directory.
- * <p>
- * For the above example:
- * runtime/xyz.jar=/xyzproject/bin
- * <p>
- * It will return "." if file can't be found. It means nothing but it won't cause jvm to crash.
- *
- * @param bundle
- * @param filenameWithinBundle
- * @return the path to the file or <code>"."</code> if not found.
- *
- * @since 1.0.0
- */
- public String localizeFromBundleOnly(Bundle bundle, String filenameWithinBundle) {
- URL url = urlLocalizeFromBundleOnly(bundle, filenameWithinBundle);
- return url != null ? getFileFromURL(url) : "."; //$NON-NLS-1$
- }
- public String localizeFromBundleAndFragments(Bundle bundle, String filenameWithinBundle) {
- URL url = urlLocalizeFromBundleAndFragments(bundle, filenameWithinBundle);
- return url != null ? getFileFromURL(url) : "."; //$NON-NLS-1$
- }
-
- /**
- * Just like localizeFromBundle except it will return an array of Strings. It will look for the filename
- * within the bundle and any fragments of the bundle. If none are found, an empty array will be returned.
- * <p>
- * To find the files in the fragments that are in the runtime path (i.e. libraries), it will need to use a suffix,
- * This is because the JDT will get confused if a runtime jar in a fragment has the same name
- * as a runtime jar in the main bundle.
- * NOTE: This is obsolete. JDT no longer has this problem. So we can find libraries in fragments that have the
- * same file path.
- * <p>
- * So we will use the following search pattern:
- * <ol>
- * <li>Find in all of the fragments those that match the name exactly in the same paths if paths are supplied.</li>
- * <li>Find in all of the fragments, in their runtime path (library stmt), those that match the name
- * but have a suffix the same as the uniqueid of the fragment (preceeded by a period). This is so that it can be easily
- * found but yet be unique in the entire list of fragments. For example if looking for "runtime/xyz.jar"
- * and we have fragment "a.b.c.d.frag", then in the runtime path we will look for the file
- * "runtime/xyz.a.b.c.d.frag.jar". Note: This is obsolete. Still here only for possible old code. Will go
- * away in future.</li>
- * <p>
- * If the files in the fragments are not in the fragments library path then it can have the same name. NOTE: Obsolete,
- * JDT can now handle same name.
- * <p>
- * This is useful for nls where the nls for the filename will be in one or more of the fragments of the plugin.
- *
- * @param bundle
- * @param filenameWithinBundle
- * @return
- *
- * @since 1.0.0
- */
- public String[] localizeAllFromBundleAndFragments(Bundle bundle, String filenameWithinBundle) {
- URL[] urls = urlLocalizeAllFromBundleAndFragments(bundle, filenameWithinBundle);
- String[] result = new String[urls.length];
- for (int i = 0; i < urls.length; i++) {
- result[i] = getFileFromURL(urls[i]);
- }
- return result;
- }
-
- public static String getFileFromURL(URL url) {
- // We need to do this in a device independent way. The URL will always put a leading '/' in the
- // file part of the URL, but on Windows we need to have this '/' removed. Some JRE's don't understand it.
- return new File(url.getFile()).getAbsolutePath();
-
- }
-
- public URL urlLocalizeFromBundleAndFragments(Bundle bundle, String filenameWithinBundle) {
- return urlLocalizeFromBundleAndFragments(bundle, new Path(filenameWithinBundle));
- }
- public URL urlLocalizeFromBundleAndFragments(Bundle bundle, IPath filenameWithinBundle) {
- try {
- URL pvm = FileLocator.find(bundle, filenameWithinBundle, null);
- if (pvm != null)
- return FileLocator.toFileURL(pvm);
- } catch (IOException e) {
- }
- if (devMode) {
- URL[] urls = findDevAllFromBundleAndFragments(bundle, filenameWithinBundle.toString());
- if (urls.length > 0)
- return urls[0];
- else
- return null;
- } else
- return null;
- }
-
- /**
- * Like <code>localizeFromBundleAndFragments</code> except it returns URL's instead.
- *
- * @param bundle
- * @param filenameWithinBundle
- * @return
- *
- * @see ProxyPlugin#localizeFromBundleAndFragments(Bundle, String)
- * @since 1.0.0
- */
- public URL[] urlLocalizeAllFromBundleAndFragments(Bundle bundle, String filenameWithinBundle) {
- return urlLocalizeAllBundleAndFragments(bundle, Platform.getFragments(bundle), filenameWithinBundle);
- }
- public URL[] urlLocalizeAllFromBundleAndFragments(Bundle bundle, IPath filenameWithinBundle) {
- return urlLocalizeAllBundleAndFragments(bundle, Platform.getFragments(bundle), filenameWithinBundle.toString());
- }
-
- /**
- * @param bundle
- * @param filenameWithinBundle
- * @param fragments
- * @return
- *
- * @since 1.0.0
- */
- private URL[] urlLocalizeAllBundleAndFragments(Bundle bundle, Bundle[] fragments, String filenameWithinBundle) {
-
- ArrayList urls = new ArrayList((fragments == null ? 0 : fragments.length) + 1);
- URL url = internalUrlLocalizeFromBundleOnly(bundle, filenameWithinBundle);
- if (url != null)
- urls.add(url);
- if (fragments != null) {
- for (int i = 0; i < fragments.length; i++) {
- Bundle fragment = fragments[i];
- url = internalUrlLocalizeFromBundleOnly(fragment, filenameWithinBundle);
- if (url != null)
- urls.add(url);
- }
- }
- return (URL[]) urls.toArray(new URL[urls.size()]);
- }
-
- private static final String PROXYJARS = "proxy.jars"; //$NON-NLS-1$
-
- /**
- * @see ProxyPlugin#localizeFromBundle(Bundle, String)
- *
- * This is just a helper to return a url instead.
- *
- * @param bundle
- * @param filenameWithinBundle
- * @return
- *
- * @since 1.0.0
- */
- public URL urlLocalizeFromBundleOnly(Bundle bundle, String filenameWithinBundle) {
- // If the filenameWithinBundle begins with one of these special characters,
- // it might be in a fragment.
- if (filenameWithinBundle.charAt(0) == '$'
- && (filenameWithinBundle.regionMatches(true, 0, "$nl$", 0, "$nl$".length()) //$NON-NLS-1$ //$NON-NLS-2$
- || filenameWithinBundle.regionMatches(true, 0, "$os$", 0, "$os$".length()) || filenameWithinBundle.regionMatches(true, 0, //$NON-NLS-1$ //$NON-NLS-2$
- "$ws$", 0, "$ws$".length()))) //$NON-NLS-1$ //$NON-NLS-2$
- return urlLocalizeFromBundleAndFragments(bundle, filenameWithinBundle);
- try {
- URL pvm = new URL(bundle.getEntry("/"), filenameWithinBundle); //$NON-NLS-1$
- pvm = verifyFound(FileLocator.toFileURL(pvm));
- if (pvm != null)
- return pvm;
- } catch (IOException e) {
- }
- return findDev(bundle, filenameWithinBundle);
-
- }
-
- protected URL internalUrlLocalizeFromBundleOnly(Bundle bundle, String filenameWithinBundle) {
- try {
- URL pvm = bundle.getEntry(filenameWithinBundle);
- if (pvm != null)
- return FileLocator.toFileURL(pvm);
- } catch (IOException e) {
- }
- return findDev(bundle, filenameWithinBundle);
-
- }
-
- private URL verifyFound(URL pvm) throws IOException {
- if (devMode) {
- // Need to test if found in devmode. Otherwise we will just assume it is found. If not found on remote and moved to cache, an IOException would be thrown.
- if (pvm != null) {
- InputStream ios = null;
- try {
- ios = pvm.openStream();
- if (ios != null)
- return pvm; // Found it, so return it.
- } finally {
- if (ios != null)
- ios.close();
- }
- }
- } else
- return pvm;
- return null;
- }
-
- /**
- * @see ProxyPlugin#localizeFromBundle(bundle, String)
- *
- * This is just a helper to return a url instead.
- *
- * @param bundle
- * @param filenameWithinBundle
- * @return
- *
- * @since 1.0.0
- */
- public URL urlLocalizeFromBundleOnly(Bundle bundle, IPath filenameWithinBundle) {
- return urlLocalizeFromBundleOnly(bundle, filenameWithinBundle.toString());
- }
-
- private URL findDev(Bundle bundle, String filenameWithinBundle) {
- if (devMode) {
- // Got this far and in dev mode means it wasn't found, so we'll try for development style.
- // It is assumed that in dev mode, we are running with the IDE as local and any
- // build outputs will be local so local file protocol will be returned
- // from Platform.resolve(). We won't be running in dev mode with our entireplugin being in a jar,
- // or on a separate system.
- try {
- URL pvm = bundle.getEntry(PROXYJARS);
- if (pvm != null) {
- InputStream ios = null;
- try {
- ios = pvm.openStream();
- Properties props = new Properties();
- props.load(ios);
- String pathString = props.getProperty(filenameWithinBundle.toString());
- if (pathString != null) {
- URL url = FileLocator.resolve(bundle.getEntry("/")); // It is assumed that if in debug mode, then this plugin is an imported plugin within the developement workspace. //$NON-NLS-1$
- if (url.getProtocol().equals("file")) { //$NON-NLS-1$
- File file = new File(url.getFile()).getParentFile(); // This gets us to workspace root of development workspace.
- file = new File(file, pathString);
- return file.toURL();
- }
- }
- } finally {
- if (ios != null)
- ios.close();
- }
- }
- } catch (IOException e) {
- }
- }
-
- return null;
-
- }
- private URL[] findDevAllFromBundleAndFragments(Bundle bundle, String filenameWithinBundle) {
- Bundle [] fragments = Platform.getFragments(bundle);
- ArrayList urls = new ArrayList((fragments == null ? 0 : fragments.length) + 1);
- URL url = findDev(bundle, filenameWithinBundle);
- if (url != null)
- urls.add(url);
- if (fragments != null) {
- for (int i = 0; i < fragments.length; i++) {
- Bundle fragment = fragments[i];
- url = findDev(fragment, filenameWithinBundle);
- if (url != null)
- urls.add(url);
- }
- }
- return (URL[]) urls.toArray(new URL[urls.size()]);
- }
-
- /**
- * Get the urls for the bundle and all fragments. This is used when bundles/fragments are jarred. It won't work correctly if not
- * a jarred bundle and fragments. This would most likely be used for NLS
- * purposes to bring in the bundle and all of the nls. If a specific fragment was wanted use {@link #urlLocalizeBundle(Bundle)} instead.
- *
- * @param bundle
- * @return urls for bundle and all fragments.
- *
- * @since 1.2.0
- */
- public URL[] urlLocalizeBundleAndFragments(Bundle bundle) {
- Bundle[] fragments = Platform.getFragments(bundle);
- List urls = new ArrayList((fragments == null ? 0 : fragments.length) + 1);
- URL[] burls = urlLocalizeBundle(bundle);
- if (burls != null) {
- urls.addAll(Arrays.asList(burls));
- }
- if (fragments != null) {
- for (int i = 0; i < fragments.length; i++) {
- burls = urlLocalizeBundle(fragments[i]);
- if (burls != null)
- urls.addAll(Arrays.asList(burls));
- }
- }
-
- return (URL[]) urls.toArray(new URL[urls.size()]);
-
- }
-
- /**
- * Get the urls for the bundle libraries only. If a fragment is wanted, then pass in the fragment instead.
- * If bundle and all fragments are wanted use {@link #urlLocalizeBundleAndFragments(Bundle)} instead.
- * <p>
- * If in dev mode, it will use the binary output directory for the plugin libraries from the build.properties file.
- *
- * @param bundle
- * @return URL array of local library references for the bundle or null if can't resolve to local.
- *
- * @since 1.2.0
- */
- public URL[] urlLocalizeBundle(Bundle bundle) {
- URL[] pvms;
- try {
- pvms = new URL[] {FileLocator.resolve(bundle.getEntry("/"))}; //$NON-NLS-1$
- if (pvms[0].getProtocol().equals("jar")) { //$NON-NLS-1$
- // The bundle is a jar, so use as is.
- pvms[0] = getFilePath(pvms[0]);
- return pvms;
- }
- } catch (IOException e) {
- pvms = null;
- }
- try {
- // It is a directory. We could be in either development mode or not. Walk the manifest classpath and find the libraries.
- Properties buildProps = null;
- String libraries = (String) bundle.getHeaders().get(Constants.BUNDLE_CLASSPATH);
- ManifestElement[] elements = ManifestElement.parseHeader(Constants.BUNDLE_CLASSPATH, libraries);
- List urls = new ArrayList();
- if (elements != null) {
- for (int i = 0; i < elements.length; i++) {
- try {
- URL pvm = bundle.getEntry(elements[i].getValue());
- if (pvm != null) {
- urls.add(FileLocator.toFileURL(pvm));
- continue;
- }
- } catch (IOException e) {
- }
- if (devMode) {
- // Not found as a jar, so see if can be found in devmode.
- if (buildProps == null) {
- buildProps = new Properties();
- try {
- URL bp = bundle.getEntry("build.properties"); //$NON-NLS-1$
- if (bp != null) {
- InputStream ios = null;
- try {
- ios = bp.openStream();
- buildProps.load(ios);
- } finally {
- if (ios != null)
- ios.close();
- }
- }
- } catch (IOException e) {
- }
- }
- String pathString = buildProps.getProperty("output."+elements[i].getValue()); //$NON-NLS-1$
- if (pathString != null) {
- try {
- urls.add(FileLocator.toFileURL(bundle.getEntry(pathString)));
- } catch (IOException e) {
- }
- }
- }
- }
- return (URL[]) urls.toArray(new URL[urls.size()]);
- } else if (devMode) {
- // If dev mode then we would look in the build.properties to find the output.. entry. This tells where the binaries are
- // for project. If there is no "output.." entry then either it is not a runnable plugin or the rare case is it is only
- // classfiles in a folder. In that case see if there is a "source.." entry and use that.
- try {
- URL bp = bundle.getEntry("build.properties"); //$NON-NLS-1$
- if (bp != null) {
- InputStream ios = null;
- try {
- ios = bp.openStream();
- Properties props = new Properties();
- props.load(ios);
- String pathString = props.getProperty("output.."); //$NON-NLS-1$
- if (pathString != null) {
- return new URL[] {FileLocator.resolve(bundle.getEntry(pathString))};
- } else if ((pathString = props.getProperty("source..")) != null) { //$NON-NLS-1$
- // Probably a class folder, so use the source instead.
- return new URL[] {FileLocator.resolve(bundle.getEntry(pathString))};
- } else
- return pvms; // Try the root of the plugin.
- } finally {
- if (ios != null)
- ios.close();
- }
- }
- } catch (IOException e) {
- }
-
- }
- } catch (BundleException e) {
- }
- return null;
- }
-
- /**
- * Returns a url as file url if it can. If it is already a file url, it will just return it.
- * If it is "jar:file:...." type protocol, then it will strip it down to the file part, which is
- * the jar itself, and not the file within the jar.
- * @param l
- * @return
- *
- * @since 1.2.0
- */
- public static URL getFilePath(URL l) {
- if (l != null) {
- if (l.getProtocol().equals("file")) //$NON-NLS-1$
- return l;
- else if (l.getProtocol().equals("jar")) { //$NON-NLS-1$
- String f = l.getFile();
- int idx = f.lastIndexOf('!');
- if (idx>=0)
- f = f.substring(0,idx);
- try {
- return getFilePath(new URL(f));
- } catch (MalformedURLException e) {}
- }
- }
- return null;
- }
-
- /**
- * A helper to order the plugins into pre-req order.
- * If A eventually depends on B, then B will be ahead of A in the
- * list of plugins. (I.e. B is a pre-req somewhere of A).
- *
- * @param bundlesToOrder - Bundles of interest. The results will have these in thiee correct order.
- * @return An array of the Bundlers in there order from no prereqs in set to the leaves.
- *
- * @since 1.0.0
- */
- public static Bundle[] orderPlugins(final Set bundlesToOrder) {
- Map prereqsMap = new HashMap(bundlesToOrder.size()*3);
- int ndx = bundlesToOrder.size();
- Bundle[] result = new Bundle[ndx];
- Map dependents = getDependentCounts(false, bundlesToOrder, prereqsMap); // We want the inactive ones too. That way have complete order. They can be ignored later if necessary.
- // keep iterating until all have been visited. This will actually find them in reverse order from what we
- // want, i.e. it will find the leaves first. So we will build result array in reverse order.
- while (!dependents.isEmpty()) {
- // loop over the dependents list. For each entry, if there are no dependents, visit
- // the bundle and remove it from the list. Make a copy of the keys so we don't end up
- // with concurrent accesses (since we are deleting the values as we go)
- Iterator ib = dependents.entrySet().iterator();
- while (ib.hasNext()) {
- Map.Entry entry = (Map.Entry) ib.next();
- Bundle bundle = (Bundle) entry.getKey() ;
- int[] count = (int[]) entry.getValue();
- if (count != null && count[0] <= 0) {
- if (bundlesToOrder.contains(bundle)) {
- result[--ndx] = bundle;
- if (ndx == 0)
- return result; // We've ordered all that we care about. Anything left over is unimportant.
- }
- ib.remove();
- // decrement the dependent count for all of the prerequisites.
- Bundle[] requires = getPrereqs(bundle, prereqsMap);
- for (int j = 0; j < requires.length; j++) {
- Bundle prereq = requires[j];
- int[] countPrereq = (int[]) dependents.get(prereq);
- if (countPrereq != null)
- --countPrereq[0];
- }
- }
- }
- }
- return result;
- }
-
- /**
- * Get all of the prereqs for this bundle, all of the way down to the root.
- * They will be in top-down depth-first order. There won't be duplicates. They will show up
- * only once the first time they are found.
- *
- * @param bundle
- * @return list of all pre-reqs.
- *
- * @since 1.0.0
- */
- public static List getAllPrereqs(Bundle bundle) {
- List prereqs = new ArrayList();
- getAllPrereqs(bundle, prereqs, new HashMap());
- return prereqs;
- }
-
- private static void getAllPrereqs(Bundle bundle, List prereqs, Map prereqsMap) {
- Bundle[] prs = getPrereqs(bundle, prereqsMap);
- for (int i = 0; i < prs.length; i++) {
- Bundle pre = prs[i];
- if (prereqsMap.containsKey(pre))
- continue; // Already processed this one once.
- prereqs.add(pre); // Add to the list of pre-reqs accumulated so far.
- getAllPrereqs(pre, prereqs, prereqsMap);
- }
- }
-
- private static Bundle[] getPrereqs(Bundle bundle, Map prereqsMap) {
- Bundle[] prereqs = (Bundle[]) prereqsMap.get(bundle);
- if (prereqs == null) {
- prereqs = getPrereqs(bundle);
- prereqsMap.put(bundle, prereqs);
- }
- return prereqs;
- }
-
- public static Bundle[] getPrereqs(Bundle bundle) {
- Bundle[] l = (Bundle[]) pluginRequiredMap.get(bundle.getSymbolicName());
- if (l == null) {
- BundleSpecification specs[] = Platform.getPlatformAdmin().getState(false).getBundle(bundle.getBundleId()).getRequiredBundles();
- ArrayList bundles = new ArrayList(specs.length);
- for (int i = 0; i < specs.length; i++) {
- Bundle b = Platform.getBundle(specs[i].getName());
- if (b != null)
- bundles.add(b);
- }
- l = (Bundle[]) bundles.toArray(new Bundle[bundles.size()]);
- pluginRequiredMap.put(bundle.getSymbolicName(), l);
- }
- return l;
- }
-
- private static Map getDependentCounts(boolean activeOnly, Set startingSet, Map prereqsMap) {
- // Try to maintain independents in order from the starting set (which happens to be ordered, and hopefully reversed.).
- // Trying to have leaves show up in same order they are found in the Eclipse extensions, so we should
- // have the starting set be in reverse order from that. The actual process
- // builds them in reverse order from the starting set, so we expect the startingSet to be in reverse order so they will be in forward order
- // hopefully. This is just a heuristic. There is no guarentee it will actually produce the
- // desired output.
- Map dependents = new LinkedHashMap(startingSet.size());
- // build a table of all dependent counts. The table is keyed by descriptor and
- // the value the integer number of dependent plugins.
- List processNow = new ArrayList(startingSet);
- List processNext = new ArrayList(processNow.size());
- if (!processNow.isEmpty()) {
- // Go through the first time from the starting set to get an entry into the list.
- // If there is an entry, then it won't be marked for processNext. Only new entries
- // are added to processNext in the following loop.
- int pnSize = processNow.size();
- for (int i = 0; i < pnSize; i++) {
- Bundle bundle = (Bundle) processNow.get(i);
- if (activeOnly && bundle.getState() != Bundle.ACTIVE)
- continue;
- // ensure there is an entry for this descriptor (otherwise it will not be visited)
- int[] entry = (int[]) dependents.get(bundle);
- if (entry == null)
- dependents.put(bundle, new int[1]);
- }
- }
-
- // Now process the processNow to find the requireds, increment them, and add to processNext if never found before.
- while (!processNow.isEmpty()) {
- processNext.clear();
- int pnSize = processNow.size();
- for (int i = 0; i < pnSize; i++) {
- Bundle bundle = (Bundle) processNow.get(i);
- if (activeOnly && bundle.getState() != Bundle.ACTIVE)
- continue;
- Bundle[] requires = getPrereqs(bundle, prereqsMap);
- for (int j = 0; j < requires.length; j++) {
- Bundle prereq = requires[j];
- if (prereq == null || activeOnly
- && bundle.getState() != Bundle.ACTIVE)
- continue;
- int[] entry = (int[]) dependents.get(prereq);
- if (entry == null) {
- dependents.put(prereq, new int[]{1});
- processNext.add(prereq); // Never processed before, so we add it to the next process loop.
- } else
- ++entry[0];
- }
- }
-
- // Now swap the lists so that we processNext will be now and visa-versa.
- List t = processNext;
- processNext = processNow;
- processNow = t;
- }
- return dependents;
- }
-
- /**
- * Add a shutdown listener
- * @param listener
- *
- * @since 1.0.0
- */
- public void addProxyShutdownListener(IProxyPluginShutdownListener listener) {
- if (shutdownListeners == null)
- shutdownListeners = new ListenerList();
- shutdownListeners.add(listener);
- }
-
- /**
- * Remove a shutdown listener
- * @param listener
- *
- * @since 1.0.0
- */
- public void removeProxyShutdownListener(IProxyPluginShutdownListener listener) {
- if (shutdownListeners != null)
- shutdownListeners.remove(listener);
- }
-
- private ILaunchConfigurationListener launchListener = new ILaunchConfigurationListener() {
- public void launchConfigurationAdded(ILaunchConfiguration configuration) {
- try {
- if (!configuration.isWorkingCopy() && IProxyConstants.ID_PROXY_LAUNCH_GROUP.equals(configuration.getCategory()))
- startCleanupJob();
- } catch (Exception e) {
- }
- }
-
- public void launchConfigurationChanged(ILaunchConfiguration configuration) {
- try {
- if (!configuration.isWorkingCopy() && IProxyConstants.ID_PROXY_LAUNCH_GROUP.equals(configuration.getCategory()))
- startCleanupJob();
- } catch (Exception e) {
- }
- }
-
- public void launchConfigurationRemoved(ILaunchConfiguration configuration) {
- try {
- // On delete you can't tell the category or anything because all of that info has already removed.
- if (!configuration.isWorkingCopy())
- startCleanupJob();
- } catch (Exception e) {
- }
- }
- };
-
- private Job cleanupJob = new Job(ProxyMessages.ProxyPlugin_CleanupDefaultProxyLaunchConfigurations) {
- {
- setSystem(true); // So it doesn't show up in progress monitor. No need to interrupt user.
- setPriority(Job.SHORT); // A quick running job.
- }
- protected IStatus run(IProgressMonitor monitor) {
- synchronized (this) {
- if (monitor.isCanceled())
- return Status.CANCEL_STATUS;
- }
- // all we want to do is find out if any launch configurations (from proxy launch group) exist for
- // a project. If they don't, then unset the project's property. If they do, and the property is not
- // set, then set it to NOT_SET to indicate not set, but there are some configs for it.
- // We just gather the project names that have launch configurations.
- try {
- Set projectNames = new HashSet();
- ILaunchConfiguration[] configs = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurations();
- for (int i = 0; i < configs.length; i++) {
- if (IProxyConstants.ID_PROXY_LAUNCH_GROUP.equals(configs[i].getCategory())
- && (ProxyLaunchSupport.ATTR_PRIVATE == null || !configs[i].getAttribute(ProxyLaunchSupport.ATTR_PRIVATE, false)))
- projectNames.add(configs[i].getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, "")); //$NON-NLS-1$
- }
-
- IJavaModel model = JavaCore.create(ResourcesPlugin.getWorkspace().getRoot());
- IJavaElement[] children = model.getChildren();
- int cancelCount = 10;
- for (int j = 0; j < children.length; j++) {
- if (children[j].getElementType() == IJavaElement.JAVA_PROJECT) {
- if (--cancelCount <= 0)
- synchronized (this) {
- cancelCount = 10; // Rest for next set of ten.
- // Checking on every 10 projects because they may be many projects, while only few configs.
- // This way it will stop sooner.
- if (monitor.isCanceled())
- return Status.CANCEL_STATUS;
- }
- IProject p = ((IJavaProject) children[j]).getProject();
- if (projectNames.contains(p.getName())) {
- // This project has a launch config. If it has a setting, then do nothing, else need to put on not set.
- if (p.getPersistentProperty(ProxyPlugin.PROPERTY_LAUNCH_CONFIGURATION) == null)
- p.getProject().setPersistentProperty(
- ProxyPlugin.PROPERTY_LAUNCH_CONFIGURATION,
- ProxyLaunchSupport.NOT_SET);
- } else {
- // This project has no launch configs. Remove any setting if it exists.
- p.setPersistentProperty(ProxyPlugin.PROPERTY_LAUNCH_CONFIGURATION, (String) null);
- }
- }
- }
- return Status.OK_STATUS;
- } catch (CoreException e) {
- return e.getStatus();
- }
- }
- };
-
- private void startCleanupJob() {
- cleanupJob.cancel(); // Stop what we are doing.
- cleanupJob.schedule(1000l); // Schedule to start in one second.
- }
-
-
- /* (non-Javadoc)
- * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
- */
- public void start(final BundleContext context) throws Exception {
- super.start(context);
- DebugPlugin.getDefault().getLaunchManager().addLaunchConfigurationListener(launchListener);
- context.addBundleListener(new BundleListener() {
- public void bundleChanged(BundleEvent event) {
- if (event.getBundle() != ProxyPlugin.this.getBundle())
- return; // Not of interest to us.
- switch (event.getType()) {
- case BundleEvent.STARTED:
- context.removeBundleListener(this); // Since we don't care anymore
- startCleanupJob();
- break;
- case BundleEvent.STOPPED:
- case BundleEvent.UNINSTALLED:
- case BundleEvent.UNRESOLVED:
- context.removeBundleListener(this); // We stopped before we started, so remove ourselves.
- break;
- }
- }
- });
- getPluginPreferences().setDefault(PREFERENCES_VM_NOVERIFY_KEY, true);
- }
-
-
- /* (non-Javadoc)
- * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext context) throws Exception {
- // Handle case where debug plugin shuts down before we do since order not guarenteed.
- if (DebugPlugin.getDefault() != null)
- DebugPlugin.getDefault().getLaunchManager().removeLaunchConfigurationListener(launchListener);
- cleanupJob.cancel(); // Stop what we are doing.
- if (shutdownListeners != null) {
- Object[] listeners = shutdownListeners.getListeners();
- for (int i = 0; i < listeners.length; i++) {
- ((IProxyPluginShutdownListener) listeners[i]).shutdown();
- }
- }
- super.stop(context);
- }
-
- public static final String PI_CONFIGURATION_CONTRIBUTION_EXTENSION_POINT = "org.eclipse.jem.proxy.contributors"; //$NON-NLS-1$
- public static final String PI_EXTENSION_REGISTRATION_EXTENSION_POINT = "org.eclipse.jem.proxy.extensions"; //$NON-NLS-1$
- public static final String PI_CONTAINER = "container"; //$NON-NLS-1$
- public static final String PI_PLUGIN = "plugin"; //$NON-NLS-1$
- public static final String PI_CLASS = "class"; //$NON-NLS-1$
- public static final String PI_REGISTRY_TYPE = "registryType"; //$NON-NLS-1$
- public static final Map pluginRequiredMap = new HashMap(50);
-
- /*
- * Processed extension point info for contributors.
- */
- protected ContributorExtensionPointInfo contributions;
-
- /*
- * Processed extension point info for registry extensions.
- */
- protected ContributorExtensionPointInfo extensions;
-
-
- /**
- * These are public only so that jem.ui can access this constant. Not meant to be accessed by others.
- */
- public static final QualifiedName PROPERTY_LAUNCH_CONFIGURATION = new QualifiedName("org.eclipse.jem.proxy", "proxyLaunchConfiguration"); //$NON-NLS-1$ //$NON-NLS-2$
-
- /**
- * Return the plugin ordered array of configuration elements for the given container, or <code>null</code> if not contributed.
- *
- * @param containerid the first segment of all of the container paths is the container id.
- * @param containerPaths array of container paths to match against for contributions. The paths must all be of the same container id.
- * @return Array of configuration elements.
- *
- * @since 1.0.0
- */
- public synchronized IConfigurationElement[] getContainerConfigurations(String containerid, String[] containerPaths) {
- if (contributions == null)
- processProxyContributionExtensionPoint();
- return (IConfigurationElement[]) contributions.containerPathContributions.getContributors(containerid, containerPaths);
- }
-
- /**
- * Return the plugin ordered array of configuration elements for the given plugin, or <code>null</code> if not contributed.
- *
- * @param pluginid
- * @return Array of configuration elements or <code>null</code> if this plugin has no contributions.
- *
- * @since 1.0.0
- */
- public synchronized IConfigurationElement[] getPluginConfigurations(String pluginid) {
- if (contributions == null)
- processProxyContributionExtensionPoint();
- return (IConfigurationElement[]) contributions.pluginToContributions.get(pluginid);
- }
-
- /**
- * Return the plugin ordered array of configuration elements for the given container, or <code>null</code> if not contributed.
- *
- * @param containerid the first segment of all of the container paths is the container id.
- * @param containerPaths array of container paths to match against for contributions. The paths must all be of the same container id.
- * @return Array of configuration elements.
- *
- * @since 1.0.0
- */
- public synchronized IConfigurationElement[] getContainerExtensions(String containerid, String[] containerPaths) {
- if (extensions == null)
- processProxyExtensionExtensionPoint();
- return (IConfigurationElement[]) extensions.containerPathContributions.getContributors(containerid, containerPaths);
- }
-
- /**
- * Return the plugin ordered array of configuration elements for the given plugin, or <code>null</code> if not contributed.
- *
- * @param pluginid
- * @return Array of configuration elements or <code>null</code> if this plugin has no contributions.
- *
- * @since 1.0.0
- */
- public synchronized IConfigurationElement[] getPluginExtensions(String pluginid) {
- if (extensions == null)
- processProxyExtensionExtensionPoint();
- return (IConfigurationElement[]) extensions.pluginToContributions.get(pluginid);
- }
-
- protected synchronized void processProxyContributionExtensionPoint() {
- contributions = processContributionExtensionPoint(PI_CONFIGURATION_CONTRIBUTION_EXTENSION_POINT);
- }
-
- protected synchronized void processProxyExtensionExtensionPoint() {
- extensions = processContributionExtensionPoint(PI_EXTENSION_REGISTRATION_EXTENSION_POINT);
- }
-
- /**
- * Process the extension point looking contributors. It will find entries that have the "container" or "plugin" attributes
- * set on them.
- *
- * @param extensionPoint fully-qualified extension point id, including plugin id of the extension point.
- * @return the contributor info record.
- *
- * @since 1.0.0
- */
- public static ContributorExtensionPointInfo processContributionExtensionPoint(String extensionPoint) {
- // We are processing this once because it is accessed often (once per vm per project).
- // This can add up so we get it together once here.
- IExtensionPoint extp = Platform.getExtensionRegistry().getExtensionPoint(extensionPoint);
- ContributorExtensionPointInfo result = new ContributorExtensionPointInfo();
- result.containerPathContributions = new ContainerPathContributionMapping(IConfigurationElement.class);
- if (extp == null) {
- result.pluginToContributions = Collections.EMPTY_MAP;
- return result;
- }
-
- IExtension[] extensions = extp.getExtensions();
- if (extensions.length > 0) {
- // Need to be in plugin order so that first ones processed have no dependencies on others.
- // Gather in extension order.
- // We want the list in reverse order of found extensions for a bundle. This is a heuristic to try
- // to get leaves ordered in the order found from the extension list. Since the orderPlugins actually
- // reverses the leaf order, hopefully this will set it back to what we want at the end.
- HashMap bundlesToExtensions = new LinkedHashMap(extensions.length);
- for (int i = extensions.length-1; i >= 0; i--) {
- Bundle bundle = Platform.getBundle(extensions[i].getContributor().getName());
- IExtension[] ext = (IExtension[]) bundlesToExtensions.get(bundle);
- if (ext == null)
- bundlesToExtensions.put(bundle, new IExtension[] { extensions[i]});
- else {
- // More than one extension defined in this plugin.
- IExtension[] newExt = new IExtension[ext.length + 1];
- System.arraycopy(ext, 0, newExt, 0, ext.length);
- newExt[newExt.length - 1] = extensions[i];
- bundlesToExtensions.put(bundle, newExt);
- }
- }
-
- // Now order them so we process in required order.
- Bundle[] ordered = ProxyPlugin.orderPlugins(bundlesToExtensions.keySet());
- Map patternStringToID_Pattern = new HashMap(); // Map of string patterns to the {container id, compiled pattern}. This so that we use the same compiled pattern everywhere.
- result.pluginToContributions = new HashMap(ordered.length);
- for (int i = 0; i < ordered.length; i++) {
- IExtension[] exts = (IExtension[]) bundlesToExtensions.get(ordered[i]);
- for (int j = 0; j < exts.length; j++) {
- IConfigurationElement[] configs = exts[j].getConfigurationElements();
- // Technically we expect the config elements to have a name of "contributor", but since that
- // is all that can be there, we will ignore it. The content is what is important.
- for (int k = 0; k < configs.length; k++) {
- String containerPattern = configs[k].getAttribute(PI_CONTAINER);
- if (containerPattern != null) {
- Object[] id_Pattern = (Object[]) patternStringToID_Pattern.get(containerPattern);
- if (id_Pattern == null) {
- int slash = containerPattern.indexOf('/');
- String containerID = slash != -1 ? containerPattern.substring(0, slash) : containerPattern;
- // The pattern becomes for the containerPattern "SWT_CONTAINER" becomes "SWT_CONTAINER(/.*)*". This
- // means to match the string must start with "SWT_CONTAINER" and it must have either nothing after this
- // or it must have a "/" and any characters after that. So this means it will not match "SWT_CONTAINERXZ"
- // but it will match "SWT_CONTAINER/XYZ".
- id_Pattern = new Object[] { containerID, Pattern.compile(containerPattern + "(/.*)*")}; //$NON-NLS-1$
- patternStringToID_Pattern.put(containerPattern, id_Pattern);
- }
- result.containerPathContributions.addContribution((String) id_Pattern[0], (Pattern) id_Pattern[1], configs[k]);
- }
-
- String plugin = configs[k].getAttribute(PI_PLUGIN);
- if (plugin != null) {
- List contributions = (List) result.pluginToContributions.get(plugin);
- if (contributions == null) {
- contributions = new ArrayList(1);
- result.pluginToContributions.put(plugin, contributions);
- }
- contributions.add(configs[k]);
- }
- }
- }
- }
-
- // Finalize the mappings for both container paths and plugins.
- result.containerPathContributions.finalizeMapping();
- for (Iterator iter = result.pluginToContributions.entrySet().iterator(); iter.hasNext();) {
- Map.Entry entry = (Map.Entry) iter.next();
- entry.setValue(((List) entry.getValue()).toArray(new IConfigurationElement[((List) entry.getValue()).size()]));
- }
- } else
- result.pluginToContributions = Collections.EMPTY_MAP;
- return result;
- }
-
- /**
- * The result of the {@link ProxyPlugin#getIDsFound(IJavaProject)}.
- *
- * @since 1.2.0
- */
- public static class FoundIDs {
-
- /**
- * Map of (containerIds(String)->{@link ContainerPaths}) of containers classpaths found in the project's classpath.
- *
- */
- public Map containerIds = new HashMap(2);
-
- /**
- * Map of (containers({@link IClasspathContainer})->Boolean) of containers found in the project's classpath. The value will be <code>true</code> if the container is visible to the top-level project.
- */
- public Map containers = new HashMap(2);
-
- /**
- * Map of (pluginIds(String)->Boolean) of plugin ids found in the project's classpath if the project is a plugin project. The value will be <code>true</code> if the plugin is visible to the top-level project.
- */
- public Map pluginIds;
-
- /**
- * Map of (projects({@link IPath}->Boolean) of project found in the project's classpath. The value will be <code>true</code> if the project is visible to the top-level project.
- */
- public Map projects = new HashMap(2);
-
- FoundIDs() {
- // not meant to be instantiated or subclassed by clients.
- }
- }
-
- /**
- * For the given java project, return the maps of found ids.
- *
- * @param jproject
- * @return the found ids.
- *
- * @since 1.0.0
- */
- public FoundIDs getIDsFound(IJavaProject jproject) throws JavaModelException {
- IPath projectPath = jproject.getProject().getFullPath();
- FoundIDs foundIDs = new FoundIDs();
- foundIDs.projects.put(projectPath, Boolean.TRUE);
- expandProject(projectPath, foundIDs, true, true);
-
- // The containerIds values will actually be an Map[] {Map(visibleIPath->pathString), Map(hiddenIPath->pathString)}. Needs to be converted to a ContainerPaths now
- // that we are done.
- for (Iterator itr = foundIDs.containerIds.entrySet().iterator(); itr.hasNext();) {
- Map.Entry entry = (Entry) itr.next();
- Map[] value = (Map[]) entry.getValue();
- entry.setValue(new ContainerPaths((String) entry.getKey(), (String[]) value[0].values().toArray(new String[value[0].size()]), (String[]) value[1].values().toArray(new String[value[1].size()])));
- }
-
- if (foundIDs.pluginIds == null)
- foundIDs.pluginIds = Collections.EMPTY_MAP;
-
- foundIDs.projects.remove(projectPath); // Don't need to include itself now, was needed for testing so if ciruclar we don't get into a loop.
- if (foundIDs.projects.isEmpty())
- foundIDs.projects = Collections.EMPTY_MAP;
-
- return foundIDs;
-
- }
-
- private static final IPath JRE_CONTAINER_PATH = new Path(JavaRuntime.JRE_CONTAINER);
-
- /*
- * The passed in visible flag tells if this project is visible and its contents are visible if they are exported.
- * Only exception is if first is true, then all contents are visible to the top level project.
- */
- private void expandProject(IPath projectPath, FoundIDs foundIds, boolean visible, boolean first) throws JavaModelException {
- IResource res = ResourcesPlugin.getWorkspace().getRoot().findMember(projectPath.lastSegment());
- if (res == null)
- return; // Not exist so don't delve into it.
- IJavaProject project = (IJavaProject)JavaCore.create(res);
- if (project == null || !project.exists() || !project.getProject().isOpen())
- return; // Not exist as a java project or not open, so don't delve into it.
-
- IClasspathEntry[] entries = project.getRawClasspath();
- for (int i = 0; i < entries.length; i++) {
- IClasspathEntry entry = entries[i];
- Boolean currentFlag = null; // Current setting value.
- boolean newFlag; // The new setting value.
- switch (entry.getEntryKind()) {
- case IClasspathEntry.CPE_PROJECT:
- // Force true if already true, or this is the first project, or this project is visible and the entry is exported. These override a previous false.
- currentFlag = (Boolean) foundIds.projects.get(entry.getPath());
- newFlag = (currentFlag != null && currentFlag.booleanValue()) || first || (visible && entry.isExported());
- if (currentFlag == null || currentFlag.booleanValue() != newFlag)
- foundIds.projects.put(entry.getPath(), newFlag ? Boolean.TRUE : Boolean.FALSE );
- if (currentFlag == null)
- expandProject(entry.getPath(), foundIds, visible && entry.isExported(), false);
- break;
- case IClasspathEntry.CPE_CONTAINER:
- if (!first && JavaRuntime.JRE_CONTAINER.equals(entry.getPath().segment(0))) //$NON-NLS-1$
- break; // The first project determines the JRE, so any subsequent ones can be ignored.
- Map[] paths = (Map[]) foundIds.containerIds.get(entry.getPath().segment(0));
- if (paths == null) {
- paths = new Map[] {new HashMap(2), new HashMap(2)};
- foundIds.containerIds.put(entry.getPath().segment(0), paths);
- }
- currentFlag = null;
- if (paths[0].containsKey(entry.getPath()))
- currentFlag = Boolean.TRUE;
- else if (paths[1].containsKey(entry.getPath()))
- currentFlag = Boolean.FALSE;
- newFlag = (currentFlag != null && currentFlag.booleanValue()) || first || (visible && entry.isExported());
- if (currentFlag == null || currentFlag.booleanValue() != newFlag) {
- if (newFlag) {
- // It is visible, remove from hidden, if there, and add to visible.
- paths[1].remove(entry.getPath());
- paths[0].put(entry.getPath(), entry.getPath().toString());
- } else {
- // It is hidden, remove from visible, if there, and add to hidden.
- paths[0].remove(entry.getPath());
- paths[1].put(entry.getPath(), entry.getPath().toString());
- }
- }
-
- IClasspathContainer container = JavaCore.getClasspathContainer(entry.getPath(), project);
- // Force true if already true, or this is the first project, or this project is visible and the entry is exported. These override a previous false.
- currentFlag = (Boolean) foundIds.containers.get(container);
- newFlag = (currentFlag != null && currentFlag.booleanValue()) || first || (visible && entry.isExported());
- if (currentFlag == null || currentFlag.booleanValue() != newFlag)
- foundIds.containers.put(container, newFlag ? Boolean.TRUE : Boolean.FALSE );
- break;
- case IClasspathEntry.CPE_VARIABLE:
- // We only care about JRE_LIB. If we have that, then we will treat it as JRE_CONTAINER. Only
- // care about first project too, because the first project is the one that determines the JRE type.
- if (first && JavaRuntime.JRELIB_VARIABLE.equals(entry.getPath().segment(0))) { //$NON-NLS-1$
- paths = (Map[]) foundIds.containerIds.get(JavaRuntime.JRE_CONTAINER);
- if (paths == null) {
- paths = new Map[] {new HashMap(2), new HashMap(2)};
- foundIds.containerIds.put(JavaRuntime.JRE_CONTAINER, paths);
- }
- currentFlag = null;
- if (paths[0].containsKey(JRE_CONTAINER_PATH))
- currentFlag = Boolean.TRUE;
- else if (paths[1].containsKey(JRE_CONTAINER_PATH))
- currentFlag = Boolean.FALSE;
- newFlag = (currentFlag != null && currentFlag.booleanValue()) || first || (visible && entry.isExported());
- if (currentFlag == null || currentFlag.booleanValue() != newFlag) {
- if (newFlag) {
- // It is visible, remove from hidden, if there, and add to visible.
- paths[1].remove(JRE_CONTAINER_PATH);
- paths[0].put(JRE_CONTAINER_PATH, JavaRuntime.JRE_CONTAINER);
- } else {
- // It is hidden, remove from visible, if there, and add to hidden.
- paths[0].remove(JRE_CONTAINER_PATH);
- paths[1].put(JRE_CONTAINER_PATH, JavaRuntime.JRE_CONTAINER);
- }
- }
- }
- break;
- default:
- break;
- }
- }
-
- findPlugins(foundIds, visible, first, project);
- }
-
- /**
- * Find the plugins that the given project references, either directly or indirectly.
- * <p>
- * The map will be of plugin ids to a Boolean. If the boolean is <code>BooleanTRUE</code>,
- * then the plugin is visible to the given project. the visible and first flags
- * will modify this. If first is true, then all direct plugins will be visible,
- * else only exported plugins will be visible. If visible is false and first is false, then it doesn't matter, all of the
- * plugins will not be visible.
- * <p>
- * Visible means that classes in the plugin can be referenced directly from code. Not visible
- * means that they can only be referenced from some other plugin in the list. In other words,
- * visible ones can be directly referenced, but invisible ones can only be referenced from
- * plugins that can see it.
- * <p>
- * For most uses, first and visible should be true. Then it will treat the project as the toplevel
- * project and will return true for those that are visible to it, either directly or indirectly.
- * These flags were added for more special cases where may be calling on a project that is deeper
- * down in the classpath were visibilty has already been decided.
- * <p>
- * Note: PDE must be installed for this to return anything, otherwise it will leave
- * the map alone.
- *
- * @param foundIds foundIds structure to get plugin info from.
- * @param visible <code>true</code> means this project is visible, so any plugins visible to it will be visible, else none will be visible.
- * @param first <code>true</code> if this is the top project of interest. This means that all plugins within the project are visible. Else only exported projects will be visible.
- * @param project project to start looking from
- *
- * @since 1.0.2
- */
- public void findPlugins(FoundIDs foundIds, boolean visible, boolean first, IJavaProject project) {
- try {
- // To prevent unnecessary loading of the PDE plugin, find the plugins only if this project is a PDE plugin project.
- if (isPDEProject(project)) {
- IPDEProcessForPlugin pdeprocess = getPDEProcessForPlugin();
- if (pdeprocess != null) {
- if (foundIds.pluginIds == null)
- foundIds.pluginIds = new HashMap();
- pdeprocess.findPlugins(project, foundIds, visible, first); // expand the plugins for this project, if any.
- }
- }
- } catch (CoreException e) {
- }
- }
-
- /**
- *
- * @param project
- *
- * @return true if this is a Plugin project or false if not
- * @throws CoreException
- *
- * @since 1.1.0
- */
- public static boolean isPDEProject(IJavaProject project) throws CoreException {
- return project.getProject().hasNature(PDE_NATURE_ID);
- }
-
-
- /*
- * Interface for processing Plugins. Used when PDE plugin is present in the installation.
- *
- * @since 1.0.2
- */
- interface IPDEProcessForPlugin {
-
- /*
- * Go through the project and find all of the plugins it references, either directly or through
- * the referenced plugins, and mark them as visible or not.
- */
- public abstract void findPlugins(IJavaProject project, FoundIDs foundIds, boolean visible, boolean first);
- }
-
- /*
- * Try to get the pde process for plugin. If already tried once and not found, then forget it.
- * <package-protected> because PDEContributeClasspath needs it too.
- */
- private IPDEProcessForPlugin pdeProcessForPlugin;
- private boolean triedPDEProcess;
- IPDEProcessForPlugin getPDEProcessForPlugin() {
- if (!triedPDEProcess) {
- triedPDEProcess = true;
- if (Platform.getBundle("org.eclipse.pde.core") != null) { //$NON-NLS-1$
- try {
- Class classPDEProcess = Class.forName("org.eclipse.jem.internal.proxy.core.PDEProcessForPlugin"); //$NON-NLS-1$
- pdeProcessForPlugin = (IPDEProcessForPlugin) classPDEProcess.newInstance();
- } catch (ClassNotFoundException e) {
- // Not found, do nothing.
- } catch (InstantiationException e) {
- getLogger().log(e, Level.WARNING);
- } catch (IllegalAccessException e) {
- getLogger().log(e, Level.WARNING);
- }
- }
- }
- return pdeProcessForPlugin;
- }
-
- /**
- * This tries to find a jar in the bundle specified, and the attached source using the
- * PDE source location extension point. The jar must exist for source to be attachable.
- * The source must be in the standard PDE source plugin. I.e. it must be in a directory
- * of the name "bundlename_bundleversion", and in the same path from there as in the
- * jar, plus the name must be "jarnamesrc.zip".
- * <p>
- * The returned URL's will not be Platform.resolve(). They will be in form returned from
- * Platform.find().
- *
- * @param bundle bundle to search, will search fragments too.
- * @param filepath filepath from the root of the bundle/fragment where the jar will be found.
- * @return two URL's. [0] is the URL to the jar, <code>null</code> if not found, [2] is the URL to the source zip, <code>null</code> if not found.
- *
- * @since 1.0.0
- */
- public URL[] findPluginJarAndAttachedSource(Bundle bundle, IPath filepath) {
- // This is a bit kludgy, but the algorithm is to find the file first, and then get the root url of the bundle/fragment
- // that matches the found file. This will be used to calculate the name of the directory under the source. From there
- // all of the source extensions will be searched for the source zip file.
- // This is assuming that find returns a url where the file part of the url is a standard path and doesn't have
- // things like special chars to indicate within a jar. That would appear when it is resolved, but I think that the
- // unresolved ones from find are typically "jarbundle://nnn/path" or something like that. This is a gray area.
- URL jarURL = FileLocator.find(bundle, filepath, null);
- if (jarURL == null)
- return new URL[2];
-
- // Found it, so let's try to find which bundle/fragment it was found in.
- String jarString = jarURL.toExternalForm();
- // First the bundle itself.
- String installLoc = bundle.getEntry("/").toExternalForm(); //$NON-NLS-1$
- URL sourceURL = null;
- if (jarString.startsWith(installLoc))
- sourceURL = getSrcFrom(bundle, installLoc, jarString);
- else {
- // Now look in the fragments.
- Bundle[] frags = Platform.getFragments(bundle);
- for (int i = 0; i < frags.length; i++) {
- installLoc = frags[i].getEntry("/").toExternalForm(); //$NON-NLS-1$
- if (jarString.startsWith(installLoc)) {
- sourceURL = getSrcFrom(frags[i], installLoc, jarString);
- break;
- }
- }
- }
- return new URL[] {jarURL, sourceURL};
- }
-
- private URL getSrcFrom(Bundle bundle, String installLoc, String jarString) {
- // format of path in a PDE source plugin is (under the "src" directory from the extension point),
- // "bundlename_bundleversion/pathOfJar/jarnamesrc.zip". However there is no way to know
- // which extension has the source in it, so we need to search them all.
-
- IPath srcPath = new Path(bundle.getSymbolicName()+"_"+ (String) bundle.getHeaders("").get(Constants.BUNDLE_VERSION)); //$NON-NLS-1$ //$NON-NLS-2$ $NON-NLS-2$
- srcPath = srcPath.append(new Path(jarString.substring(installLoc.length())));
- if (srcPath.segmentCount() < 2)
- return null; // Something is not right. No jar name.
- srcPath = srcPath.removeFileExtension(); // Remove the .jar.
- String jarName = srcPath.lastSegment(); // This should be the jar name.
- srcPath = srcPath.removeLastSegments(1).append(jarName+"src.zip"); //$NON-NLS-1$
-
- // Now look through all of the src extensions. Can't tell if the extension is from a fragment or a bundle, so we need to
- // use Platform.find() to look in the bundle and fragment. So we may get a dup search if there is a fragment source
- // (for example platform source and win32 platform source (which is a fragment of platform source).
- IConfigurationElement[] ces = Platform.getExtensionRegistry().getConfigurationElementsFor("org.eclipse.pde.core.source"); //$NON-NLS-1$
- for (int i = 0; i < ces.length; i++) {
- IPath srcsrch = new Path(ces[i].getAttribute("path")).append(srcPath); //$NON-NLS-1$
- Bundle srcBundle = Platform.getBundle(ces[i].getDeclaringExtension().getContributor().getName());
- URL srcUrl = FileLocator.find(srcBundle, srcsrch, null);
- if (srcUrl != null) {
- return srcUrl;
- }
- }
- return null;
- }
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/ThrowableProxy.java b/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/ThrowableProxy.java
deleted file mode 100644
index dd8014fcf..000000000
--- a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/ThrowableProxy.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.core;
-/*
-
-
- */
-
-
-/**
- * This is a proxy wrapper for an exception being thrown on the
- * remove VM. The standard exception methods refer to this proxy.
- * To refer to the proxied exception itself, the methods defined
- * in here would be used.
- */
-public abstract class ThrowableProxy extends java.lang.Exception implements IBeanProxy {
- /**
- *
- */
- private static final long serialVersionUID = 1L;
-
-/**
- * Constructs an <code>Exception</code> with no specified detail message.
- */
- public ThrowableProxy() {
- super();
- }
-
- /**
- * @param message
- * @param cause
- *
- * @since 1.1.0
- */
- protected ThrowableProxy(String message, Throwable cause) {
- super(message, cause);
- }
- /**
- * @param cause
- *
- * @since 1.1.0
- */
- protected ThrowableProxy(Throwable cause) {
- super(cause);
- }
- /**
- * Constructs an <code>Exception</code> with the specified detail message.
- *
- * @param s the detail message.
- */
- public ThrowableProxy(String s) {
- super(s);
- }
-
-
- public abstract String getProxyLocalizedMessage();
- public abstract String getProxyMessage();
- public abstract void printProxyStackTrace(java.io.PrintWriter writer);
- public abstract void printProxyStackTrace(java.io.PrintStream stream);
- public abstract void printProxyStackTrace();
-
- public String toString() {
- return super.toString() + "Proxy: " + toBeanString(); //$NON-NLS1$ - toString's aren't nls'ed. //$NON-NLS-1$
- }
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/UIRunner.java b/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/UIRunner.java
deleted file mode 100644
index 06fdbf173..000000000
--- a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/UIRunner.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 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.jem.internal.proxy.core;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.logging.Level;
-
-import org.eclipse.core.runtime.*;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.PlatformUI;
-
-
-/**
- * The actual implementation of IUIRunner to run the build under
- * IProgressService control if in the UI thread.
- *
- * <package-protected> because should only be used within here.
- *
- * @since 1.0.0
- */
-class UIRunner implements IUIRunner {
-
- /*
- * Special class that takes a progress monitor 1 and only handles isCanceled from it,
- * but everything else is forwarded to progress monitor 2. This allows the pm that
- * is sent into handleBuild to signal a cancel even though the progress service
- * sends in its own pm.
- *
- * @since 1.0.0
- */
- private static class UIRunnerProgressMonitor extends ProgressMonitorWrapper {
- private IProgressMonitor pmcancel;
-
- public UIRunnerProgressMonitor(IProgressMonitor pmcancel, IProgressMonitor pmmain) {
- super(pmmain);
- this.pmcancel = pmcancel;
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IProgressMonitor#isCanceled()
- */
- public boolean isCanceled() {
- return pmcancel.isCanceled() || super.isCanceled();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IProgressMonitor#setCanceled(boolean)
- */
- public void setCanceled(boolean value) {
- super.setCanceled(value);
- pmcancel.setCanceled(value); // Cancel it too now.
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IUIRunner#handleBuild(org.eclipse.core.runtime.IProgressMonitor)
- */
- public void handleBuild(final IProgressMonitor pm) throws CoreException {
- if (!PlatformUI.isWorkbenchRunning() || Display.getCurrent() == null) {
- ProxyLaunchSupport.runBuild(pm);
- } else {
- pm.beginTask("", 100); //$NON-NLS-1$
- try {
- PlatformUI.getWorkbench().getProgressService().busyCursorWhile(new IRunnableWithProgress() {
-
- public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
- IProgressMonitor uipm = new UIRunnerProgressMonitor(pm, monitor);
- try {
- ProxyLaunchSupport.runBuild(uipm);
- } catch (CoreException e) {
- throw new InvocationTargetException(e);
- }
- if (uipm.isCanceled()) {
- pm.setCanceled(true); // Make sure that cancel got through (could of come from monitor instead).
- throw new InterruptedException();
- }
- }
- });
- } catch (InvocationTargetException e) {
- if (e.getCause() instanceof CoreException)
- throw (CoreException) e.getCause();
- ProxyPlugin.getPlugin().getLogger().log(e.getCause(), Level.WARNING);
- } catch (InterruptedException e) {
- // It was canceled, launch will be canceled too. pm is already marked canceled and caller can check that
- }
- pm.done();
- }
- }
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/messages.properties b/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/messages.properties
deleted file mode 100644
index e6e08c398..000000000
--- a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/messages.properties
+++ /dev/null
@@ -1,49 +0,0 @@
-###############################################################################
-# Copyright (c) 2003, 2005 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: /cvsroot/webtools/jeetools.move/webtools.javaee.git/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/messages.properties,v $
-# $Revision: 1.12 $ $Date: 2005/08/24 20:39:05 $
-#
-
-
-
-#
-# Exception Messages. All of these messages are the text of an java exception.
-#
-UnexpectedException_EXC_ = IWAV0064E Unexpected exception thrown.
-
-# {0} and {1} are java classes (e.g. java.lang.Object)
-ClassCast_EXC__IncorrectType = IWAV0065E "{0}" is neither a subclass of, nor does it implement, class "{1}".
-
-# Standard Bean Proxy Factory and Standard Bean Type Proxy Factory are terms in beaninfo. They are the
-# standard (i.e. base) factories for beans or bean types. Bean types are java classes.
-ProxyFactory_EXC__NoBeanProxyFactory = IWAV0066E No Standard Bean Proxy Factory has been set.
-ProxyFactory_EXC__NoBeanTypeProxyFactory = IWAV0067E No Standard Bean Type Proxy Factory has been set.
-
-
-# {0} is the title of a project.
-Not_Java_Project_WARN_ = IWAV0068W Project "{0}" is not a java project.
-No_VM_WARN_ = IWAV0069W Project "{0}" has no Java JRE defined to use to run programs within this project.
-No_Implementation_WARN_ = IWAV0070W Cannot find a proxy implementation to use for project "{0}."
-
-ProxyLaunch = Launching Local Proxy VM
-ProxyWaitForBuild = Waiting for build to complete
-Expression_InInvalidStateDueTo_EXC_ = IWAV0162E Expression is in invalid state due to "{0}"
-Expression_InInvalidState_EXC_ = IWAV0163E Expression is in invalid state
-Expression_TypeSentInInvalidOrder_EXC_ = IWAV0164E Expression type sent in invalid order, received: {0}, expected {1}.
-Expression_ArrayTypeNotAnArray_EXC_ = IWAV0165E ArrayType "{0}" is not an array.
-Expression_CannotHandleNoReceiveOnFieldAccess_EXC_ = IWAV0166E Access by field name ({0}) (not by proxy) requires a receiver.
-Expression_MethodsNeedReceiver_EXC_ = IWAV0167E Access by method name ({0}) (not by proxy) requires a receiver.
-Expression_InvalidMarkNesting = IWAV0168E Improper nesting of mark statements in Expression. Tried to pop or endMark to before current mark. Tried to go past Mark# {0}.
-Expression_InvalidProxy=Expression Proxy is for a different expression
-ProxyPlugin_CleanupDefaultProxyLaunchConfigurations = Clean up default proxy launch configurations.
-ProxyLaunchSupport_RegistryCouldNotStartForSomeReason_WARN_ = IWAV0168W Registry could not be started for some reason.
-Expression_CreateProxyReassignmentExpression_InvalidForReassignment_EXC_=Invalid expression type for reassignment: {0}
diff --git a/plugins/org.eclipse.jem.proxy/proxyCommon/org/eclipse/jem/internal/proxy/common/AmbiguousMethodException.java b/plugins/org.eclipse.jem.proxy/proxyCommon/org/eclipse/jem/internal/proxy/common/AmbiguousMethodException.java
deleted file mode 100644
index 2856eba41..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyCommon/org/eclipse/jem/internal/proxy/common/AmbiguousMethodException.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 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.jem.internal.proxy.common;
-
-
-/**
- * Ambiguous Method Exception. I.E. There is more than one that could be used.
- */
-public class AmbiguousMethodException extends Exception {
- /**
- * Comment for <code>serialVersionUID</code>
- *
- * @since 1.1.0
- */
- private static final long serialVersionUID = -7084137612344373381L;
- public AmbiguousMethodException() {
- }
- public AmbiguousMethodException(String msg) {
- super(msg);
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jem.proxy/proxyCommon/org/eclipse/jem/internal/proxy/common/CommandException.java b/plugins/org.eclipse.jem.proxy/proxyCommon/org/eclipse/jem/internal/proxy/common/CommandException.java
deleted file mode 100644
index cbb25f2d9..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyCommon/org/eclipse/jem/internal/proxy/common/CommandException.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.common;
-/*
-
-
- */
-/**
- * An error occurred during command processing.
- *
- */
-
-public class CommandException extends Exception {
- /**
- * Comment for <code>serialVersionUID</code>
- *
- * @since 1.1.0
- */
- private static final long serialVersionUID = -2519238571145682514L;
- protected final Object fExceptionData;
-
- public CommandException() {
- fExceptionData = null;
- }
-
- public CommandException(Object data) {
- fExceptionData = data;
- }
-
- public CommandException(String msg, Object data) {
- super(msg);
- fExceptionData = data;
- }
-
- public Object getExceptionData() {
- return fExceptionData;
- }
-
- public boolean isRecoverable() {
- return false; // By default Command Exceptions are not recoverable.
- }
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyCommon/org/eclipse/jem/internal/proxy/common/GenericEventQueue.java b/plugins/org.eclipse.jem.proxy/proxyCommon/org/eclipse/jem/internal/proxy/common/GenericEventQueue.java
deleted file mode 100644
index 72fd9fd07..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyCommon/org/eclipse/jem/internal/proxy/common/GenericEventQueue.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 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
- *******************************************************************************/
-/*
- * $RCSfile$
- * $Revision$ $Date$
- */
-package org.eclipse.jem.internal.proxy.common;
-
-import java.util.LinkedList;
-
-/**
- * A generic event queue. It runs on its own thread and will execute any queued up runnables.
- * <p>
- * When a runnable is added to the queue, the thread will be notified. If the thread is free it will
- * run the runnable. If it is not free, the runnable will be added to the queue. The thread will process
- * all intervening runnables and then execute the runnable in sequence with all of the rest.
- * <p>
- * This is used when you can't use the system widget (e.g. AWT event queue or SWT asyncExec) or when the
- * runnable must be executed on a non-ui thread.
- * <p>
- * <b>Note:</b> It is required that {@link #close()} be called so that resources are cleared up.
- *
- * @since 1.1.0.1
- */
-public class GenericEventQueue {
-
- private LinkedList queue = new LinkedList();
-
- private class EventThread extends Thread {
- private boolean run = true;
-
- public EventThread(String title) {
- super(title);
- }
-
- public void close() {
- synchronized (queue) {
- run = false;
- queue.clear();
- queue.notifyAll();
- }
- }
-
- public void postEvent(Runnable run) {
- if (!this.isAlive()) {
- throw new IllegalStateException("Event queue thread is not executing."); //$NON-NLS-1$
- }
- synchronized (queue) {
- if (run != null)
- queue.addLast(run);
- queue.notifyAll();
- }
- }
-
- public void run() {
- while (true) {
- Runnable runnable;
- synchronized (queue) {
- while (run && queue.isEmpty()) {
- try {
- queue.wait();
- } catch (InterruptedException e) {
- }
- }
- if (!run)
- return; // Done.
- else {
- runnable = (Runnable) queue.removeFirst();
- }
- }
-
- try {
- runnable.run();
- } catch (RuntimeException e) {
- e.printStackTrace();
- } finally {
- runnable = null; // Set this so that we don't hold onto resources in the runnable while waiting for next quy.
- }
- }
- }
- }
-
- private EventThread eventThread;
-
- /**
- * Construct with a title. (This title will be the title on the Thread for the queue).
- * The thread will have the same priority as the current thread.
- * @param queueTitle
- *
- * @since 1.1.0.1
- */
- public GenericEventQueue(String queueTitle) {
- this(queueTitle, Thread.currentThread().getPriority());
- }
-
- /**
- * Construct with a title. (This title will be the title on the Thread for the queue).
- * And a priority for the event queue's processing thread.
- * @param queueTitle
- * @param priority priority to use for event queue's thread.
- *
- * @since 1.1.0.1
- */
- public GenericEventQueue(String queueTitle, int priority) {
- eventThread = new EventThread(queueTitle);
- eventThread.setPriority(priority);
- synchronized(queue) {
- eventThread.start();
- try {
- queue.wait(100); // Wait for thread to start.
- } catch (InterruptedException e) {
- }
- }
- }
-
- /**
- * Close the event queue. This will clear out any pending events. They will not
- * be executed.
- *
- *
- * @since 1.1.0.1
- */
- public void close() {
- eventThread.close();
- }
-
- /**
- * Post the event.
- * @param runnable runnable to execute, or <code>null</code> to kick-start the thread if for some reason it may be waiting and it shouldn't be.
- *
- * @throws IllegalStateException thrown if the event queue thread has already been closed, or ended for some severe error.
- * @since 1.1.0.1
- */
- public void postEvent(Runnable runnable) {
- eventThread.postEvent(runnable);
- }
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyCommon/org/eclipse/jem/internal/proxy/common/ICallback.java b/plugins/org.eclipse.jem.proxy/proxyCommon/org/eclipse/jem/internal/proxy/common/ICallback.java
deleted file mode 100644
index 4d718fe36..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyCommon/org/eclipse/jem/internal/proxy/common/ICallback.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.common;
-/*
-
-
- */
-
-/**
- * This interface is to be implemented by any callback.
- * The callback will use the IVMCallbackServer passed in to
- * get callback handlers, and the id passed in is
- * to be passed to these handlers.
- */
-public interface ICallback {
-
- /**
- * Initialize the callback
- */
- public void initializeCallback(IVMCallbackServer vmServer, int callbackID);
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyCommon/org/eclipse/jem/internal/proxy/common/ICallbackHandler.java b/plugins/org.eclipse.jem.proxy/proxyCommon/org/eclipse/jem/internal/proxy/common/ICallbackHandler.java
deleted file mode 100644
index 1d2f829a2..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyCommon/org/eclipse/jem/internal/proxy/common/ICallbackHandler.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.common;
-/*
-
-
- */
-
-/**
- * This is the interface for a callback handler.
- * Users will talk to this interface to perform
- * callbacks.
- */
-public interface ICallbackHandler {
-
- /**
- * Callback, but send the parm as an object, ie. it must
- * be nothing but constants, e.g. String, Integer, or an
- * array of constants. Constants should not be things like
- * regular objects. This is because only standard java.lang
- * type constants can be assured to be available on the other
- * client. Also you don't want to send big objects. It must
- * be constants that don't need to be sent back for any reason
- * since their identity will be lost in the transfer.
- * <p>
- * This should be used if there are no parms (i.e. it is null).
- * <p>
- * To send big objects, use the callback stream.
- *
- * @param callbackID
- * @param msgID
- * @param parm
- * @return
- * @throws CommandException
- *
- * @see IVMCallbackServer#requestStream(int, int)
- * @since 1.0.0
- */
- public Object callbackAsConstants(int callbackID, int msgID, Object parm) throws CommandException;
-
- /**
- * Callback to registered client.
- * <p>
- * The parms can be <code>null</code> if no parms, or it is an array of parms.
- * The parms
- * will be turned into proxies on the client vm. So the callback
- * will recieve an array of proxies to the values in the parms.
- * If any of the entries in the array is itself an array, a
- * proxy to the array will be created and sent. The array itself
- * will not be sent.
- * <p>
- * If an array entry should go across as an array of proxies and
- * not as one proxy to an array, then the entry needs to be an
- * instance of {@link ICallbackHandler.TransmitableArray transmitableArray}. This will flag
- * that it should transmit the entire entry as proxies. This should
- * be used sparingly, only if there isn't much data in the array and
- * all of the array would be used on the client. That way transmitting
- * the entire array will be faster than accessing individual components.
- * <p>
- * If the array contains only one entry or the parm itself is null, then {@link org.eclipse.jem.internal.proxy.core.ICallback#calledBack(int, IBeanProxy)}
- * will be called. Else {@link org.eclipse.jem.internal.proxy.core.ICallback#calledBack(int, Object[])} will be called with all of the parms
- * turned into proxies as mentioned in the previous paragraph.
- *
- * @param callbackID The id of the callback. This will be given
- * to the callback when it is created, and it must pass
- * on to the handler. That way it is know which callback
- * to call on the client.
- * @param msgID The id of the message for the callback. This is an
- * agreed upon id of the developers of the callback on both
- * sides.
- * @param parms Null if no parms, or an array of objects to send to the client vm. See the comments
- * above for a complete description of the parameter.
- *
- * @see ICallbackHandler.TransmitableArray
- */
- public Object callbackWithParms(int callbackID, int msgID, Object[] parms) throws CommandException;
-
- /**
- * Array wrapper that turns an array for parameters into a transmittable array.
- *
- * @see ICallbackHandler#callbackWithParms(int, int, Object[])
- * @since 1.1.0
- */
- public static class TransmitableArray {
- protected final Object[] fArray;
- public TransmitableArray(Object[] array) {
- fArray = array;
- }
- public Object[] getArray() {
- return fArray;
- }
- }
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyCommon/org/eclipse/jem/internal/proxy/common/ICallbackRunnable.java b/plugins/org.eclipse.jem.proxy/proxyCommon/org/eclipse/jem/internal/proxy/common/ICallbackRunnable.java
deleted file mode 100644
index ceaae7cbc..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyCommon/org/eclipse/jem/internal/proxy/common/ICallbackRunnable.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.common;
-
-/**
- * Users would implement this as a runnable to
- * send a callback request.
- */
-public interface ICallbackRunnable {
-
- /**
- * The actual run code.
- */
- public Object run(ICallbackHandler handler) throws CommandException;
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyCommon/org/eclipse/jem/internal/proxy/common/ICommandException.java b/plugins/org.eclipse.jem.proxy/proxyCommon/org/eclipse/jem/internal/proxy/common/ICommandException.java
deleted file mode 100644
index 66b04dfa9..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyCommon/org/eclipse/jem/internal/proxy/common/ICommandException.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.common;
-/*
-
-
- */
-
-
-public class ICommandException {
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyCommon/org/eclipse/jem/internal/proxy/common/IVMCallbackServer.java b/plugins/org.eclipse.jem.proxy/proxyCommon/org/eclipse/jem/internal/proxy/common/IVMCallbackServer.java
deleted file mode 100644
index e79349a1b..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyCommon/org/eclipse/jem/internal/proxy/common/IVMCallbackServer.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.common;
-/*
- * $RCSfile$
- * $Revision$ $Date$
- */
-
-import java.io.OutputStream;
-/**
- * This is the interface for accessing the
- * VM callback Server. It will be given to an
- * ICallback so that the callback can access
- * the server to request a callback.
- */
-public interface IVMCallbackServer {
-
- /**
- * Get the IVMServer for this callback server.
- * @return
- *
- * @since 1.1.0
- */
- public IVMServer getIVMServer();
-
-
- /**
- * Process a callback. The runnable contains the
- * actual code.
- */
- public Object doCallback(ICallbackRunnable runnable) throws CommandException;
-
- /**
- * Request a stream for writing a lot of data (suggested for larger
- * than several thousand bytes). The connection will be assigned
- * to this stream until the stream is closed.
- */
- public OutputStream requestStream(int callbackID, int msgID) throws CommandException;
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyCommon/org/eclipse/jem/internal/proxy/common/IVMServer.java b/plugins/org.eclipse.jem.proxy/proxyCommon/org/eclipse/jem/internal/proxy/common/IVMServer.java
deleted file mode 100644
index cdedb342d..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyCommon/org/eclipse/jem/internal/proxy/common/IVMServer.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 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.jem.internal.proxy.common;
-
-/**
- * This is the base server for the vm on the vm side (i.e. not the client side).
- * <p>
- * It can be passed to proxies if they need to access the vm server.
- * @since 1.1.0
- */
-public interface IVMServer {
-
- /**
- * Add a runnable that will be called if shutdown is requested. If already added,
- * it will not be added again.
- * <p>
- * The body of the runnable must not do any vm server calls. That is because
- * the server is shutdown at this point. The body must simply do clean up code.
- * The shutdown will not continue until the call to the runnable is returned.
- * <p>
- * Calls to this will be ignored if shutdown has already started.
- * @param runnable
- *
- * @since 1.1.0
- */
- public void addShutdownListener(Runnable runnable);
-
- /**
- * Remove the shutdown runnable from the list. If not added, then not an error to call this.
- * <p>
- * Calls to this will be ignored if shutdown has already started.
- * @param runnable
- *
- * @since 1.1.0
- */
- public void removeShutdownListener(Runnable runnable);
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyCommon/org/eclipse/jem/internal/proxy/common/MapTypes.java b/plugins/org.eclipse.jem.proxy/proxyCommon/org/eclipse/jem/internal/proxy/common/MapTypes.java
deleted file mode 100644
index c42afee48..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyCommon/org/eclipse/jem/internal/proxy/common/MapTypes.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 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.jem.internal.proxy.common;
-
-import java.util.HashMap;
-
-
-/**
- * This is used for mapping between JNI format and non-JNI format. It also has the
- * maps for primitives.
- * @since 1.0.0
- */
-public class MapTypes {
-
- public final static HashMap MAP_SHORTSIG_TO_TYPE = new HashMap(8);
- public final static HashMap MAP_TYPENAME_TO_SHORTSIG = new HashMap(8);
- static {
- MapTypes.MAP_SHORTSIG_TO_TYPE.put("B", Byte.TYPE); //$NON-NLS-1$
- MapTypes.MAP_SHORTSIG_TO_TYPE.put("C", Character.TYPE); //$NON-NLS-1$
- MapTypes.MAP_SHORTSIG_TO_TYPE.put("D", Double.TYPE); //$NON-NLS-1$
- MapTypes.MAP_SHORTSIG_TO_TYPE.put("F", Float.TYPE); //$NON-NLS-1$
- MapTypes.MAP_SHORTSIG_TO_TYPE.put("I", Integer.TYPE); //$NON-NLS-1$
- MapTypes.MAP_SHORTSIG_TO_TYPE.put("J", Long.TYPE); //$NON-NLS-1$
- MapTypes.MAP_SHORTSIG_TO_TYPE.put("S", Short.TYPE); //$NON-NLS-1$
- MapTypes.MAP_SHORTSIG_TO_TYPE.put("Z", Boolean.TYPE); //$NON-NLS-1$
-
- MapTypes.MAP_TYPENAME_TO_SHORTSIG.put("byte","B"); //$NON-NLS-1$ //$NON-NLS-2$
- MapTypes.MAP_TYPENAME_TO_SHORTSIG.put("char","C"); //$NON-NLS-1$ //$NON-NLS-2$
- MapTypes.MAP_TYPENAME_TO_SHORTSIG.put("double","D"); //$NON-NLS-1$ //$NON-NLS-2$
- MapTypes.MAP_TYPENAME_TO_SHORTSIG.put("float","F"); //$NON-NLS-1$ //$NON-NLS-2$
- MapTypes.MAP_TYPENAME_TO_SHORTSIG.put("int","I"); //$NON-NLS-1$ //$NON-NLS-2$
- MapTypes.MAP_TYPENAME_TO_SHORTSIG.put("long","J"); //$NON-NLS-1$ //$NON-NLS-2$
- MapTypes.MAP_TYPENAME_TO_SHORTSIG.put("short","S"); //$NON-NLS-1$ //$NON-NLS-2$
- MapTypes.MAP_TYPENAME_TO_SHORTSIG.put("boolean","Z"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
-
-
- /**
- * Convert formal type name for an array (i.e. java.lang.Object[]
- * to the jni format (i.e. [Ljava.lang.Object;)
- * This is used when a name is passed in from the IDE side.
- * The VM side uses the jni format, and all of proxy uses the jni format.
- *
- * @param classname
- * @return string jni form of name.
- *
- * @since 1.0.0
- */
- public static String getJNIFormatName(String classname) {
- if (classname.length() == 0 || !classname.endsWith("]")) //$NON-NLS-1$
- return classname; // Not an array,or invalid
-
- StringBuffer jni = new StringBuffer(classname.length());
- int firstOpenBracket = classname.indexOf('[');
- int ob = firstOpenBracket;
- while (ob > -1) {
- int cb = classname.indexOf(']', ob);
- if (cb == -1)
- break;
- jni.append('[');
- ob = classname.indexOf('[', cb);
- }
-
- String finalType = classname.substring(0, firstOpenBracket).trim();
- if (finalType != null) {
- String shortSig = (String) MapTypes.MAP_TYPENAME_TO_SHORTSIG.get(finalType);
- if (shortSig == null) {
- jni.append('L');
- jni.append(finalType);
- jni.append(';');
- } else {
- jni.append(shortSig);
- }
- }
-
- return jni.toString();
- }
-
- /**
- * This converts from the JNI format to the formal typename.
- *
- * @param jniName
- * @return formal typename
- *
- * @since 1.1.0
- */
- public static String getFormalTypeName(String jniName) {
- if (jniName.charAt(0) == '[') {
- // It is an array
- int dims = jniName.lastIndexOf('[')+1; // Number of dimensions
- int startType = dims;
- StringBuffer fName = new StringBuffer(jniName.length()+(2*dims));
- if (jniName.charAt(startType) == 'L')
- fName.append(jniName.substring(startType+1, jniName.length()-1)); // For "[Ljava.lang.String;" return "java.lang.String"
- else if (jniName.length() == startType+1) {
- // Possible primitive
- Class type = (Class) MAP_SHORTSIG_TO_TYPE.get(jniName.substring(startType, startType+1));
- if (type != null) {
- fName.append(type.getName());
- } else
- return ""; // Invalid if no 'L' and not a primitive. //$NON-NLS-1$
- } else
- return ""; // Invalid, must be either a primitive or 'L' type. //$NON-NLS-1$
- while(dims-- > 0) {
- fName.append("[]"); //$NON-NLS-1$
- }
- return fName.toString();
- } else if (jniName.length() == 1) {
- // Possible primitive.
- Class type = (Class) MAP_SHORTSIG_TO_TYPE.get(jniName);
- if (type != null) {
- return type.getName();
- }
- }
-
- // If got here then just a name as is.
- return jniName;
- }
-
- /**
- * Convert the formal type name, with the given number of dimensions,
- * to an array JNI type.
- * @param finalComponent final component name, should not be an array type.
- * @param dimensions number of dimensions for the array.
- * @return
- *
- * @since 1.1.0
- */
- public static String getJNITypeName(String finalComponent, int dimensions) {
- StringBuffer jni = new StringBuffer(finalComponent.length()+dimensions+2);
- while (dimensions-- > 0) {
- jni.append('[');
- }
-
- String shortSig = (String) MapTypes.MAP_TYPENAME_TO_SHORTSIG.get(finalComponent);
- if (shortSig == null) {
- jni.append('L');
- jni.append(finalComponent);
- jni.append(';');
- } else {
- jni.append(shortSig);
- }
-
- return jni.toString();
- }
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyCommon/org/eclipse/jem/internal/proxy/common/Messages.java b/plugins/org.eclipse.jem.proxy/proxyCommon/org/eclipse/jem/internal/proxy/common/Messages.java
deleted file mode 100644
index e9d2984b3..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyCommon/org/eclipse/jem/internal/proxy/common/Messages.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 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.jem.internal.proxy.common;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- *
- * @since 1.2.0
- */
-public class Messages {
-
- private static final String BUNDLE_NAME = "org.eclipse.jem.internal.proxy.common.messages"; //$NON-NLS-1$
-
- private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
-
- private Messages() {
- }
-
- public static String getString(String key) {
- // TODO Auto-generated method stub
- try {
- return RESOURCE_BUNDLE.getString(key);
- } catch (MissingResourceException e) {
- return '!' + key + '!';
- }
- }
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyCommon/org/eclipse/jem/internal/proxy/common/MethodHelper.java b/plugins/org.eclipse.jem.proxy/proxyCommon/org/eclipse/jem/internal/proxy/common/MethodHelper.java
deleted file mode 100644
index 3bceb66e4..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyCommon/org/eclipse/jem/internal/proxy/common/MethodHelper.java
+++ /dev/null
@@ -1,272 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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.jem.internal.proxy.common;
-import java.lang.reflect.*;
-import java.text.MessageFormat;
-import java.util.*;
-
-/**
- * This is a class to do message/constructor work.
- * Specifically to find the most appropriate method.
- */
-public class MethodHelper {
-
- /*
- * The class that is used to represent Null class type.
- *
- * @since 1.0.0
- */
- private static class NULL_CLASS {
- }
-
- public static final Class NULL_TYPE = NULL_CLASS.class;
-
- static final ArrayList sPrimitivesOrder;
- static final int sCharPos;
-
- static {
- sPrimitivesOrder = new ArrayList(6);
- sPrimitivesOrder.add(Byte.TYPE);
- sPrimitivesOrder.add(Short.TYPE);
- sPrimitivesOrder.add(Integer.TYPE);
- sPrimitivesOrder.add(Long.TYPE);
- sPrimitivesOrder.add(Float.TYPE);
- sPrimitivesOrder.add(Double.TYPE);
-
- // char can be treated like a short for purposes of ordering.
- sCharPos = sPrimitivesOrder.indexOf(Short.TYPE);
- }
-
- /**
- * Return whether the type2 can be assigned to type1 in
- * method argument conversion.
- */
- public static boolean isAssignableFrom(Class type1, Class type2) {
- if (type1 == type2)
- return true; // They're the same, so assignable.
- if (type1.isPrimitive()) {
- if (type2.isPrimitive()) {
- if (type1 == Boolean.TYPE || type2 == Boolean.TYPE)
- return false; // Since not equal and one is boolean and the other isn't, not assignable
- int type1Pos = (type1 != Character.TYPE) ? sPrimitivesOrder.indexOf(type1) : sCharPos;
- int type2Pos = (type2 != Character.TYPE) ? sPrimitivesOrder.indexOf(type2) : sCharPos;
- return type1Pos > type2Pos; // It can be widened if type1 is higher in the order
- }
- return false; // primitive to non-primitive, not assignable.
- } else
- if (type2 == NULL_TYPE)
- return true; // NULL_TYPE represents null for us, and null can be assigned to any object
- else
- return type1.isAssignableFrom(type2); // Can type2 be assigned to type1
- }
-
-
- /**
- * Every entry in Array2 can be assigned to the corresponding entry in Array1.
- */
- public static boolean isAssignableFrom(Class[] types1, Class[] types2) {
- if (types1.length != types2.length)
- return false; // Not the same size, so not compatible.
- for (int i=0; i<types1.length; i++) {
- if (!isAssignableFrom(types1[i], types2[i]))
- return false;
- }
- return true; // All are assignable
- }
-
- /**
- * Return the index of the most compatible method/constructor from the lists passed in.
- * MethodsList: List of methods (if null then this is for constructors)
- * ParmsList: List of parms for each method (each entry will be Class[]).
- */
- private static int findMostCompatible(List methods, List parms, String ambiguousName) throws AmbiguousMethodException {
- // The algorithm used is from the Java Language Specification 15.12.2.2
- // Find the maximally specific ones
- // This is defined as the one that is more specific then all of the rest.
- // If there are duplicates parms that are maximally specific, then it doesn't matter which choosen
- // because when invoked the JVM will make sure the right thing is done.
- //
- Class[][] parmsCopy = (Class[][]) parms.toArray(new Class[parms.size()][]);
- int size = parmsCopy.length;
- // For each entry see if it is maximally specific, i.e. it is more specific then all of the others.
-nextMethod: for (int i=0; i<size; i++) {
- // For ctors we don't need to test the declaring class because it will always be the same class.
- Class dclClassi = methods != null ? ((Method) methods.get(i)).getDeclaringClass() : null;
- Class[] parmsi = parmsCopy[i];
- for (int j=0; j<size; j++) {
- if (i == j)
- continue;
- // Methodi is more specific if
- // a) Methodi declaring class is assignable to Methodj declaring class
- // b) Methodi parms are assignable to Methodj parms
- //
- // First see if Methodi is more specific, if it is
- // then throw out Methodj and continue
- // If Methodi is not compatible to Methodj, go to the next method for i. Methodi is not the most specific
- // Something else is either more specific or none are ma
- if (dclClassi != null) {
- // Step a
- if (!isAssignableFrom(((Method) methods.get(j)).getDeclaringClass(), dclClassi))
- continue nextMethod; // Methodi is not more specific than Methodj, so try next i.
- }
-
- // Step b
- Class[] parmsj = parmsCopy[j];
- if (!isAssignableFrom(parmsj, parmsi)) {
- // Methodi is not more specific than Methodj, so go to next i.
- continue nextMethod;
- }
- }
- return i; // Methodi is more specific than all of the other ones.
- }
-
- throw new AmbiguousMethodException(ambiguousName); // There was not one more specific than all of the others.
- }
-
- /**
- * Find the most compatible method for the given arguments.
- */
- public static Method findCompatibleMethod(Class receiver, String methodName, Class[] arguments) throws NoSuchMethodException, AmbiguousMethodException {
- try {
- return receiver.getMethod(methodName, arguments); // Found exact match in public
- } catch (NoSuchMethodException exc) {
- if (arguments != null) {
- // Need to find most compatible one. We will take protected into consideration (i.e. inheritance).
- ArrayList parmsList = new ArrayList(); // The parm list from each compatible method.
- ArrayList mthdsList = new ArrayList(); // The list of compatible methods, same order as the parms above.
- Class cls = receiver;
- while (cls != null) {
- Method mthds[] = cls.getDeclaredMethods();
- for (int i = 0; i < mthds.length; i++) {
- Method mthd = mthds[i];
- if (!mthd.getName().equals(methodName))
- continue; // Not compatible, not same name
- int modifiers = mthd.getModifiers();
- if (!(Modifier.isPublic(modifiers) || Modifier.isProtected(modifiers)))
- continue; // Will not call private or package-protected because we don't know the context.
- Class[] parms = mthd.getParameterTypes();
- // If exact match we found a non-public exact match, which is good.
- if (Arrays.equals(arguments, parms))
- return makeMethodAccessable(mthd);
- if (!isAssignableFrom(parms, arguments))
- continue; // Not compatible, parms
- // It is compatible with the requested method - now see if we already have an exact match from a subclass. Don't want to add it twice.
- // We are assuming the actual number of compatible methods is small, so this O(n-squared) search is efficient enough.
- int size = parmsList.size();
- for (int j = 0; j < size; j++) {
- if (Arrays.equals(parms, (Object[]) parmsList.get(j)))
- continue;
- }
- parmsList.add(parms);
- mthdsList.add(mthd);
- }
- cls = cls.getSuperclass();
- }
- // Now have list of compatible methods.
- if (parmsList.size() == 0)
- throw throwFixedNoSuchMethod(exc, receiver, methodName, arguments); // None found, so rethrow the exception
- if (parmsList.size() == 1)
- return makeMethodAccessable((Method) mthdsList.get(0)); // Only one, so return it
-
- // Now find the most compatible method
- int mostCompatible = findMostCompatible(mthdsList, parmsList, methodName);
- return makeMethodAccessable((Method) mthdsList.get(mostCompatible));
- } else
- throw throwFixedNoSuchMethod(exc, receiver, methodName, arguments); // None found, so rethrow the exception
- }
- }
-
- private static Method makeMethodAccessable(Method m) {
- m.setAccessible(true); // We allow all access, let ide and compiler handle security.
- return m;
- }
-
- /*
- * NoSuchMEthodExeception doesn't include the signature. Since these are dynamic searches, the exception itself is useless without
- * the signature. So we add it.
- */
- private static NoSuchMethodException throwFixedNoSuchMethod(NoSuchMethodException e, Class declareClass, String methodName, Class[] argClasses) {
-
- // The default trace doesn't show what method was being searched for, so recreate with that.
- StringBuffer s = new StringBuffer();
- s.append(declareClass.getName());
- s.append('.');
- s.append(methodName);
- s.append('(');
- if (argClasses != null) {
- for (int i = 0; i < argClasses.length; i++) {
- if (i > 0)
- s.append(',');
- s.append(argClasses[i].getName());
- }
- }
- s.append(')');
- NoSuchMethodException ne = new NoSuchMethodException(s.toString());
- ne.setStackTrace(e.getStackTrace());
- return ne;
- }
-
-
- /**
- * Find the most compatible constructor for the class with the given arguments.
- * @param receiver class to get the constructor for
- * @param arguments array of argument types
- * @return the constructor
- * @throws NoSuchMethodException no compatible constructor can be found
- * @throws AmbiguousMethodException there is more than one compatible constructor
- * @throws IllegalAccessException it can't be accessed. Such as it is a non-static inner class.
- *
- * @since 1.2.0
- */
- public static Constructor findCompatibleConstructor(Class receiver, Class[] arguments) throws NoSuchMethodException, AmbiguousMethodException, IllegalAccessException {
- if (receiver.getDeclaringClass() != null && !Modifier.isStatic(receiver.getModifiers()))
- throw new IllegalAccessException(MessageFormat.format(Messages.getString("MethodHelper.NONSTATICINNERCLASS_WARNING"), new Object[] {receiver.getName()})); //$NON-NLS-1$
- try {
- java.lang.reflect.Constructor ctor = receiver.getDeclaredConstructor(arguments);
- ctor.setAccessible(true); // We allow all access, let ide and compiler handle security.
- return ctor; // Found exact match
- } catch (NoSuchMethodException exc) {
- if (arguments != null) {
- // Need to find most compatible one.
- java.lang.reflect.Constructor ctors[] = receiver.getDeclaredConstructors();
- ArrayList parmsList = new ArrayList(ctors.length); // The parm list from each compatible method.
- ArrayList ctorsList = new ArrayList(ctors.length); // The list of compatible methods, same order as the parms above.
- for (int i = 0; i < ctors.length; i++) {
- java.lang.reflect.Constructor ctor = ctors[i];
- Class[] parms = ctor.getParameterTypes();
- if (!isAssignableFrom(parms, arguments))
- continue; // Not compatible, parms
- // It is compatible with the requested method
- parmsList.add(parms);
- ctorsList.add(ctor);
- }
-
- // Now have list of compatible methods.
- if (parmsList.size() == 0)
- throw exc; // None found, so rethrow the exception
- if (parmsList.size() == 1) {
- java.lang.reflect.Constructor ctor = (java.lang.reflect.Constructor) ctorsList.get(0); // Only one, so return it
- ctor.setAccessible(true); // We allow all access, let ide and compilor handle security.
- return ctor;
- }
-
- // Now find the most compatible ctor
- int mostCompatible = findMostCompatible(null, parmsList, receiver.getName());
- java.lang.reflect.Constructor ctor = (java.lang.reflect.Constructor) ctorsList.get(mostCompatible);
- ctor.setAccessible(true); // We allow all access, let ide and compilor handle security.
- return ctor;
- } else
- throw exc; // None found, so rethrow the exception
- }
- }
-
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyCommon/org/eclipse/jem/internal/proxy/common/UnresolvedCompilationError.java b/plugins/org.eclipse.jem.proxy/proxyCommon/org/eclipse/jem/internal/proxy/common/UnresolvedCompilationError.java
deleted file mode 100644
index 687dd6f9c..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyCommon/org/eclipse/jem/internal/proxy/common/UnresolvedCompilationError.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 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
- *******************************************************************************/
-/*
- * $RCSfile$
- * $Revision$ $Date$
- */
-package org.eclipse.jem.internal.proxy.common;
-
-/**
- * Used by the the registries to indicate "UnresolvedCompilationError". This is because the
- * normal java throws just an Error with a message. To make it easier in processing, it will
- * be turned into this error instead so that it can be explicitly caught.
- * <p>
- * This will only be used in certain explicit parts of the code. It will be detailed where
- * it can be thrown.
- *
- * @since 1.1.0.1
- */
-public class UnresolvedCompilationError extends Error {
-
- /**
- * Comment for <code>serialVersionUID</code>
- *
- * @since 1.1.0.1
- */
- private static final long serialVersionUID = 7778842211073592790L;
-
- /**
- * Construct from an Error.
- * @param error The error that is the actual one. <b>This will not be the cause, the message and stacktrace will be copied into this new error.</b>
- *
- * @since 1.1.0.1
- */
- public UnresolvedCompilationError(Error error) {
- super(error.getMessage());
- setStackTrace(error.getStackTrace());
- }
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyCommon/org/eclipse/jem/internal/proxy/common/messages.properties b/plugins/org.eclipse.jem.proxy/proxyCommon/org/eclipse/jem/internal/proxy/common/messages.properties
deleted file mode 100644
index 937eea7b7..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyCommon/org/eclipse/jem/internal/proxy/common/messages.properties
+++ /dev/null
@@ -1,11 +0,0 @@
-###############################################################################
-# Copyright (c) 2006 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
-###############################################################################
-MethodHelper.NONSTATICINNERCLASS_WARNING=Class {0} is a non-static inner class. These cannot be instantiated at this time.
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/BeanProxyValueSender.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/BeanProxyValueSender.java
deleted file mode 100644
index 3765039ee..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/BeanProxyValueSender.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 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.jem.internal.proxy.remote;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-
-import org.eclipse.jem.internal.proxy.common.CommandException;
-import org.eclipse.jem.internal.proxy.common.remote.Commands;
-import org.eclipse.jem.internal.proxy.core.ProxyPlugin;
-import org.eclipse.jem.internal.proxy.core.ThrowableProxy;
-
-/**
- * Useful in REM to get the array of BeanProxyValues.
- *
- * @since 1.1.0
- */
-public class BeanProxyValueSender implements Commands.ValueSender {
- protected int index = 0;
- protected Object[] array;
- private Exception exception;
- private final REMStandardBeanProxyFactory factory;
-
- /**
- * See if there was an exception thrown during reading.
- *
- * @return an exception or <code>null</code> if no exception.
- *
- * @since 1.1.0
- */
- public Exception getException() {
- return exception;
- }
-
- public BeanProxyValueSender(REMStandardBeanProxyFactory factory) {
- this.factory = factory;
- }
- public BeanProxyValueSender(REMStandardBeanProxyFactory factory, Commands.ValueObject arrayHeader) {
- this(factory);
- initialize(arrayHeader);
- }
-
- public void initialize(Commands.ValueObject arrayHeader) {
- index = 0;
- // The array type doesn't matter, it will be an array of objects.
- // The values will either be IBeanProxies or an array, or constants.
- array = new Object[arrayHeader.anInt];
- }
-
- public void clear() {
- array = null;
- index = 0;
- }
-
- public Object[] getArray() {
- return array;
- }
-
- // A new value is being sent to the array
- // NOTE: It is important that this has been called within a transaction.
- public void sendValue(Commands.ValueObject value) {
- try {
- array[index++] = factory.getBeanProxy(value); // Add it to the array
- } catch (ThrowableProxy e) {
- // We can't stop it right away because we can't send exception on, however,
- // we can log it and save the exception.
- ProxyPlugin.getPlugin().getLogger().log(new Status(IStatus.ERROR, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "", e)); //$NON-NLS-1$
- exception = e;
- } catch (CommandException e) {
- // We can't stop it right away because we can't send exception on, however,
- // we can log it and save the exception.
- ProxyPlugin.getPlugin().getLogger().log(new Status(IStatus.ERROR, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "", e)); //$NON-NLS-1$
- exception = e;
- }
- }
-
- // The next entry is an array too!
- public Commands.ValueSender nestedArray(Commands.ValueObject arrayHeader) {
- BeanProxyValueSender sender = new BeanProxyValueSender(factory, arrayHeader);
- // Take the newly created array and put it into the current array.
- array[index++] = sender.getArray();
- return sender;
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/DebugModeHelper.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/DebugModeHelper.java
deleted file mode 100644
index caab6436d..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/DebugModeHelper.java
+++ /dev/null
@@ -1,365 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-
-
-import java.lang.reflect.*;
-
-import org.eclipse.core.runtime.Platform;
-import org.osgi.framework.Bundle;
-
-import org.eclipse.jem.internal.proxy.core.ProxyPlugin;
-/**
- * This is a helper for debug mode. It allows access to
- * the workbench, if available, or AWT, if available, for
- * the debug prompts. It uses reflection so that nothing is
- * forced to be loaded or pre-reqd. That way it can run headless.
- */
-
-class DebugModeHelper {
- boolean awt = false;
- boolean console = false;
- boolean setup = false;
- java.io.InputStreamReader inReader = null;
-
- // Workbench reflections
- Object display = null;
- Constructor cMB = null;
- Field fPrimaryModel = null;
- Method fasync = null;
- Method fsync = null;
- Method fSetText = null;
- Method fSetMessage = null;
- Method fOpen = null;
- Method fGetWorkbench = null;
- Class cSWT = null;
-
-
- // AWT Reflections
- Class cMessageDialog = null;
- Method fDoit = null;
-
- protected void setupType() {
- if (setup)
- return;
-
- setup = true;
-
- // See if use system console instead. If false or not set, then try to query usage.
- console = "true".equalsIgnoreCase(Platform.getDebugOption(ProxyPlugin.getPlugin().getBundle().getSymbolicName()+ProxyRemoteUtil.IO_CONSOLE)); //$NON-NLS-1$
- if (console)
- return;
-
- try {
- // See if PlatformUI plugin available.
- Bundle uiBundle = Platform.getBundle("org.eclipse.ui"); //$NON-NLS-1$
- if (uiBundle == null) {
- setupAWT(); // UI not available, try through AWT.
- return;
- }
-
- // Setup Eclipse
- Class cPlatformUI = uiBundle.loadClass("org.eclipse.ui.PlatformUI"); //$NON-NLS-1$
- Method isWBRunning = cPlatformUI.getMethod("isWorkbenchRunning", null); //$NON-NLS-1$
- if (!((Boolean) isWBRunning.invoke(null, null)).booleanValue()) {
- setupAWT(); // UI not available, try through AWT.
- return;
- }
-
- fGetWorkbench = cPlatformUI.getMethod("getWorkbench", null); //$NON-NLS-1$
- Object w = fGetWorkbench.invoke(null, null);
-
- if (w != null) {
- Class cDisplay = uiBundle.loadClass("org.eclipse.swt.widgets.Display"); //$NON-NLS-1$
- Method fGetCurrent = cDisplay.getMethod("getCurrent", null); //$NON-NLS-1$
- Method fGetDefault = cDisplay.getMethod("getDefault", null); //$NON-NLS-1$
- fasync = cDisplay.getMethod("asyncExec", new Class[] {Runnable.class}); //$NON-NLS-1$
- fsync = cDisplay.getMethod("syncExec", new Class[] {Runnable.class}); //$NON-NLS-1$
-
- // Get the display
- display = fGetCurrent.invoke(null, null);
- if (display == null)
- display = fGetDefault.invoke(null, null);
- }
-
- if (display != null) {
- Class cShell = uiBundle.loadClass("org.eclipse.swt.widgets.Shell"); //$NON-NLS-1$
- Class cMessageBox = uiBundle.loadClass("org.eclipse.swt.widgets.MessageBox"); //$NON-NLS-1$
- cMB = cMessageBox.getConstructor(new Class[] {cShell, Integer.TYPE});
-
- fSetText = cMessageBox.getMethod("setText", new Class[] {String.class}); //$NON-NLS-1$
- fSetMessage = cMessageBox.getMethod("setMessage", new Class[] {String.class}); //$NON-NLS-1$
- fOpen = cMessageBox.getMethod("open", null); //$NON-NLS-1$
-
- cSWT = uiBundle.loadClass("org.eclipse.swt.SWT"); //$NON-NLS-1$
- fPrimaryModel = cSWT.getField("PRIMARY_MODAL"); //$NON-NLS-1$
- } else {
- setupAWT(); // UI not available, try through AWT.
- }
- } catch (NoSuchMethodException e) {
- } catch (ClassNotFoundException e) {
- } catch (IllegalAccessException e) {
- } catch (InvocationTargetException e) {
- } catch (NoSuchFieldException e) {
- }
-
- return;
-
- }
-
- protected void setupAWT() {
-
- // See if AWT is available.
- try {
- cMessageDialog = Class.forName("org.eclipse.jem.internal.proxy.remote.MessageDialog"); //$NON-NLS-1$
- fDoit = cMessageDialog.getMethod("doit", new Class[] {String.class, String.class, String.class, String.class}); //$NON-NLS-1$
- awt = true;
- return;
- } catch (ClassNotFoundException e) {
- } catch (NoSuchMethodException e) {
- }
- console = true; // No AWT either, i.e. true headless environment
- }
-
- public boolean debugMode(final String name) {
- boolean debugMode = "true".equalsIgnoreCase(Platform.getDebugOption(ProxyPlugin.getPlugin().getBundle().getSymbolicName()+ProxyRemoteUtil.DEBUG_VM)); //$NON-NLS-1$
- if (!debugMode)
- return debugMode;
-
- setupType();
-
- // See if use system console instead. If false or not set, then try to query usage.
- if (console)
- return debugModeConsole(name);
-
- if (awt)
- return debugModeAWT(name);
-
- try {
- final Field fYes = cSWT.getField("YES"); //$NON-NLS-1$
- Field fNo = cSWT.getField("NO"); //$NON-NLS-1$
- Field fIcon = cSWT.getField("ICON_QUESTION"); //$NON-NLS-1$
-
- final int style = fYes.getInt(null) | fNo.getInt(null) | fIcon.getInt(null) | fPrimaryModel.getInt(null);
- final boolean[] db = new boolean[1];
-
- fsync.invoke(display, new Object[] { new Runnable() {
- /**
- * @see java.lang.Runnable#run()
- */
- public void run() {
- try {
- Object shell = getActiveShell();
- Object mb = cMB.newInstance(new Object[] {shell, new Integer(style)});
- fSetText.invoke(mb, new Object[] {"Debug RemoteVM?"}); //$NON-NLS-1$
- fSetMessage.invoke(mb, new Object[] {"Do you want to start the remote vm ("+name+") in debug mode?"}); // Not NLS'd because this is for internal developers only //$NON-NLS-1$ //$NON-NLS-2$
-
- db[0] = fYes.get(null).equals(fOpen.invoke(mb, null));
- } catch (InstantiationException e) {
- } catch (IllegalAccessException e) {
- } catch (InvocationTargetException e) {
- }
- }
- }});
- return db[0];
- } catch (IllegalAccessException e) {
- } catch (InvocationTargetException e) {
- } catch (NoSuchFieldException e) {
- }
-
- return debugModeAWT(name);
- }
-
-
- /*
- * This must be called from within the display thread.
- */
- protected Object getActiveShell() {
- Object shell = null;
- try {
- Object w = fGetWorkbench.invoke(null, null);
- Object ww = null;
- if (w != null) {
- Class cWorkbench = w.getClass();
- Method getWorkbenchWindow = cWorkbench.getMethod("getActiveWorkbenchWindow", null); //$NON-NLS-1$
- ww = getWorkbenchWindow.invoke(w, null);
- }
- if (ww != null) {
- Class cWorkbenchWindow = ww.getClass();
- Method getShell = cWorkbenchWindow.getMethod("getShell", null); //$NON-NLS-1$
- shell = getShell.invoke(ww, null);
- }
- } catch (IllegalAccessException e) {
- } catch (InvocationTargetException e) {
- } catch (NoSuchMethodException e) {
- }
-
- return shell;
- }
-
- protected boolean debugModeAWT(String name) {
-
- // See if AWT is available.
- try {
- Integer r = (Integer) fDoit.invoke(null, new Object[] {"Debug RemoteVM?", "Do you want to start the remote vm ("+name+") in debug mode?", "Yes", "No"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
- return r.intValue() == 1; // i.e. button1 or "yes" was hit.
- } catch (IllegalAccessException e) {
- } catch (InvocationTargetException e) {
- }
-
- return false; // No AWT either, i.e. headless environment, shouldn't of gotton here.
- }
-
- protected boolean debugModeConsole(String name) {
-
- // Debug through the console
- inReader = new java.io.InputStreamReader(System.in);
- System.out.println("Do you want to start the remote vm ("+name+") in debug mode? (Enter Y or N):"); //$NON-NLS-1$ //$NON-NLS-2$
- char r = ' ';
- try {
- r = Character.toLowerCase((char) inReader.read());
- // Need to flush the input reader now.
- while (inReader.ready())
- inReader.read();
- return r == 'y'; // i.e. "y" was entered.
- } catch (java.io.IOException e) {
- }
-
- return false; // Error reading, so no debugging.
- }
-
- /**
- * Return true if continue debugging.
- */
- public boolean promptPort(final int dport) {
- if (awt)
- return promptPortAWT(dport);
- else if (console)
- return promptPortConsole(dport);
-
- try {
- final Field fOK = cSWT.getField("OK"); //$NON-NLS-1$
- Field fCancel = cSWT.getField("CANCEL"); //$NON-NLS-1$
- Field fIcon = cSWT.getField("ICON_WORKING"); //$NON-NLS-1$
-
- final int style = fOK.getInt(null) | fCancel.getInt(null) | fIcon.getInt(null) | fPrimaryModel.getInt(null);
-
- final boolean[] ok = new boolean[1];
- fsync.invoke(display, new Object[] { new Runnable() {
- /**
- * @see java.lang.Runnable#run()
- */
- public void run() {
- try {
- Object shell = getActiveShell();
- Object mb = cMB.newInstance(new Object[] {shell, new Integer(style)});
- fSetText.invoke(mb, new Object[] {"Connect Debugger to RemoteVM!"}); //$NON-NLS-1$
- fSetMessage.invoke(mb, new Object[] {"You must now attach the debugger to port number "+dport+". Press OK when the debugger is attached. The program will not continue properly without the debugger being attached. Press Cancel if you could not connect the debugger. This will still cause an error, but it will clean up better."}); // Not NLS'd because this is for internal developers only //$NON-NLS-1$ //$NON-NLS-2$
- ok[0] = fOK.get(null).equals(fOpen.invoke(mb, null));
- } catch (InstantiationException e) {
- } catch (IllegalAccessException e) {
- } catch (InvocationTargetException e) {
- }
- }
- }});
- return ok[0];
- } catch (NoSuchFieldException e) {
- } catch (InvocationTargetException e) {
- } catch (IllegalAccessException e) {
- }
- return false;
- }
-
- protected boolean promptPortAWT(int dport) {
- try {
- Integer r = (Integer) fDoit.invoke(null, new Object[] {"Connect Debugger to RemoteVM!", "You must now attach the debugger to port number "+dport+". Press OK when the debugger is attached. The program will not continue properly without the debugger being attached. Press Cancel if you could not connect the debugger. This will still cause an error, but it will clean up better.", "OK", "Cancel"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
- return r.intValue() == 1; // i.e. button1 or "OK" was hit.
- } catch (InvocationTargetException e) {
- } catch (IllegalAccessException e) {
- }
-
- return false;
- }
-
- protected boolean promptPortConsole(int dport) {
- System.out.println("You must now attach the debugger to port number "+dport+". Enter 'y' when the debugger is attached. The program will not continue properly without the debugger being attached. Press 'n' if you could not connect the debugger. This will still cause an error, but it will clean up better. Enter 'y' or 'n':"); //$NON-NLS-1$ //$NON-NLS-2$
- char r = ' ';
- try {
- r = Character.toLowerCase((char) inReader.read());
- while (inReader.ready())
- inReader.read();
- return r == 'y'; // i.e. "y" was entered, go on
- } catch (java.io.IOException e) {
- }
-
- return false;
- }
-
- /**
- * Display an error msg. There will only be an OK button.
- * This will always display, debug mode won't be looked at.
- * This is for errors. This will be displayed async, so this
- * may return before the msg has been displayed and answered,
- * but since the only response is OK, it doesn't really matter.
- */
- public void displayErrorMessage(final String title, final String msg) {
- setupType();
- if (console)
- displayErrorMessageConsole(title, msg);
- else if (awt)
- displayErrorMessageAWT(title, msg);
- else {
- try { // This needs to be done in display thread.
- Field fOK = cSWT.getField("OK"); //$NON-NLS-1$
- Field fIcon = cSWT.getField("ICON_ERROR"); //$NON-NLS-1$
-
- final int style = fOK.getInt(null) | fIcon.getInt(null) | fPrimaryModel.getInt(null);
- fasync.invoke(display, new Object[] { new Runnable() {
- /**
- * @see java.lang.Runnable#run()
- */
- public void run() { try { Object shell = getActiveShell();
- Object mb = cMB.newInstance(new Object[] { shell, new Integer(style)});
-
- fSetText.invoke(mb, new Object[] { title });
- fSetMessage.invoke(mb, new Object[] { msg });
- fOpen.invoke(mb, null);
- } catch (InstantiationException e) {
- } catch (IllegalAccessException e) {
- } catch (InvocationTargetException e) {
- }
- }
- }
- });
- } catch (NoSuchFieldException e) {
- } catch (InvocationTargetException e) {
- } catch (IllegalAccessException e) {
- }
- }
- }
-
- protected void displayErrorMessageConsole(String title, String msg) {
- System.out.println("Error: " + title); //$NON-NLS-1$
- System.out.println(" " + msg); //$NON-NLS-1$
- }
-
- protected void displayErrorMessageAWT(String title, String msg) {
- try {
- fDoit.invoke(null, new Object[] {title, msg, ProxyRemoteMessages.OK_7, null});
- } catch (InvocationTargetException e) {
- } catch (IllegalAccessException e) {
- }
- }
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/IREMBeanProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/IREMBeanProxy.java
deleted file mode 100644
index 8e0427686..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/IREMBeanProxy.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-
-import org.eclipse.jem.internal.proxy.core.IBeanProxy;
-import org.eclipse.jem.internal.proxy.common.remote.Commands;
-/**
- * A Remote VM proxy. All IBeanProxy implementations
- * for the Remote VM must also implement this interface.
- * This is necessary for proper functioning.
- *
- * NOTE: This is an internal interface to the Remote VM Proxy.
- * It MUST not be used outside of the proxy factory family.
- */
-
-public interface IREMBeanProxy extends IBeanProxy {
- /**
- * Return the ID of this proxy
- */
- public Integer getID();
-
- /**
- * Proxy is about to be released, MUST mark it invalid.
- * This is required. Resources can also be cleaned up
- * if they are being held and need to be cleaned up.
- *
- * NOTE: This method will only be called when the proxy
- * is explicitly released. If it is simply garbage collected,
- * then this method will not be called. Simple garbage collection
- * means that no one is referencing this proxy. The proxy factory
- * will know what id this proxy was referencing and will release it
- * on the server at GC time.
- *
- * If there are resources
- * that absolutely must be released, then the finalize method
- * should be implemented to do the clean up. However, try not
- * to have this be the case. Finalize methods add overhead that is
- * usually better not to have. The better way is for any users
- * that get this kind of proxy object know to call release on
- * ProxyFactoryRegistry to release it before garbage collection.
- */
- public void release();
-
- /**
- * Render this bean for transport to the server into a Commands.ValueObject.
- * For example, a string may put a string. An id type may put out the id.
- */
- public void renderBean(Commands.ValueObject renderInto);
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/IREMBeanTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/IREMBeanTypeProxy.java
deleted file mode 100644
index 391ad309c..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/IREMBeanTypeProxy.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-
-import org.eclipse.jem.internal.proxy.core.*;
-/**
- * All bean type proxies in remote vm must implement this interface.
- *
- * NOTE: This is an internal interface to the Remote VM Proxy.
- * It MUST not be used outside of the proxy factory family.
- */
-public interface IREMBeanTypeProxy extends IBeanTypeProxy, IREMBeanProxy {
-
-/**
- * Create a new bean proxy with the specified id.
- */
-public IREMBeanProxy newBeanProxy(Integer anID);
-
-/**
- * newBeanTypeForClass: Create a new beantypeproxy of this kind for the given class.
- * This is used by beantype proxy factory when creating a beantype proxy for a subclass.
- * This is because subclasses, unless explicitly overridden, should use the same kind
- * of beantype proxy. This way if anything special is needed for a specific type, then
- * that can be done.
- */
-public IREMBeanTypeProxy newBeanTypeForClass(Integer anID, String aClassname, boolean anAbstract);
-
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/IREMBeanTypeProxyFactory.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/IREMBeanTypeProxyFactory.java
deleted file mode 100644
index 10f8b6847..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/IREMBeanTypeProxyFactory.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-
-import org.eclipse.jem.internal.proxy.core.*;
-/**
- * Interface for Remote VM Bean Type Proxy Factories.
- * All extension factories for Remote VM must implement this interface.
- */
-
-public interface IREMBeanTypeProxyFactory extends IBeanTypeProxyFactory {
-/**
- * Return a bean type proxy for the class name.
- * Return null if the extension factory doesn't handle this class.
- * Don't register any proxies returned, they will automatically be registered.
- * This should only return bean type proxies where the factory can determine
- * everything it needs, such as supertype and classID.
- * NOTE: This is implemented for the usage of the
- * standard BeanType proxy factory. It should
- * NOT be called by anyone else. They should
- * go through the IStandardBeanTypeFactory
- * instead. The standard bean type factory
- * will call this method on the appropriate
- * extension when it needs to.
- *
- * Creation date: (12/3/99 2:26:12 PM)
- */
-public IREMBeanTypeProxy getExtensionBeanTypeProxy(String typeName);
-
-/**
- * Return a bean type proxy for the class name.
- * Return null if the extension factory doesn't handle this class.
- * Don't register any proxies returned, they will automatically be registered.
- * This should only return bean type proxies where the factory can determine
- * everything it needs, such as supertype and classID.
- * NOTE: This is implemented for the usage of the
- * standard BeanType proxy factory. It should
- * NOT be called by anyone else. They should
- * go through the IStandardBeanTypeFactory
- * instead. The standard bean type factory
- * will call this method on the appropriate
- * extension when it needs to.
-
- * @param typeName
- * @param expression
- * @return
- *
- * @since 1.1.0
- */
-public IProxyBeanType getExtensionBeanTypeProxy(String typeName, IExpression expression);
-
-/**
- * Return a bean type proxy for the class id and class name.
- * Return null if the extension factory doesn't handle this class.
- * Don't register any proxies returned, they will automatically be registered.
- * This will be called in the case that a new class id was returned
- * from the server that we don't have registered yet. Implementers will
- * created a proxy out of the name and the id and return it.
- * The supertype will be passed in so that the extension factory doesn't need to
- * try to find it.
- * NOTE: This is implemented for the usage of the
- * standard BeanType proxy factory. It should
- * NOT be called by anyone else. They should
- * go through the IStandardBeanTypeFactory
- * instead. The standard bean type factory
- * will call this method on the appropriate
- * extension when it needs to.
- *
- * Creation date: (12/3/99 2:26:12 PM)
- */
-public IREMBeanTypeProxy getExtensionBeanTypeProxy(String typeName, Integer classID, IBeanTypeProxy superType);
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/IREMConnection.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/IREMConnection.java
deleted file mode 100644
index 6e7e47587..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/IREMConnection.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-
-import org.eclipse.jem.internal.proxy.common.CommandException;
-import org.eclipse.jem.internal.proxy.common.remote.Commands;
-/**
- * Interface for the Remote VM Connection object.
- */
-
-public interface IREMConnection {
-
- /**
- * Did this construct correctly.
- * This is needed because an exception could be thrown in the ctor and
- * that's not a good thing to do.
- */
- public boolean isConnected();
-
- /**
- * Terminate the server.
- * WARNING: This is only here so that factory can to it. Termination should ONLY
- * be done by the Factory not any one else.
- */
- public void terminateServer();
-
- /**
- * Close the connection.
- */
- public void close();
-
- /**
- * Get the class information. Null return if not found.
- */
- public Commands.GetClassReturn getClass(String className) throws CommandException;
-
- /**
- * Get the class information from the id.
- */
- public Commands.GetClassIDReturn getClassFromID(int classID) throws CommandException;
-
-
-
- /**
- * Get object data from an id.
- */
- public void getObjectData(int objectID, Commands.ValueObject valueReturn) throws CommandException;
-
- /**
- * Get a new instance using the initialization string.
- */
- public void getNewInstance(int classID, String initString, Commands.ValueObject newInstance) throws CommandException;
-
- /**
- * Invoke the get array contents command.
- * @param arrayID
- * @param returnValue
- * @throws CommandException
- *
- * @since 1.1.0
- */
- public void getArrayContents(int arrayID, Commands.ValueObject returnValue) throws CommandException;
-
- /**
- * Invoke the method call.
- * The parms valueObject must represent an Object[] (either through ARRAY_IDS or OBJECT)
- */
- public void invokeMethod(int methodID, Commands.ValueObject invokeOn, Commands.ValueObject parms, Commands.ValueObject returnValue) throws CommandException;
-
- /**
- * Invoke the method call with method passed.
- * The parms valueObject must represent an Object[] (either through ARRAY_IDS or OBJECT)
- */
- public void invokeMethod(Commands.ValueObject classType, String methodName, Commands.ValueObject parmTypes, Commands.ValueObject invokeOn, Commands.ValueObject parms, Commands.ValueObject returnValue) throws CommandException;
-
- /**
- * Release the id. It is no longer needed on the client.
- */
- public void releaseID(int id);
-
- /**
- * Read array values as BeanProxies into valueSender.
- * @param returnValue
- * @param valueSender
- * @param allowFlag <code>true</code> to allow FLAG values, <code>false</code> if not allow flag values.
- *
- * @throws CommandException
- *
- * @since 1.1.0
- */
- public void readProxyArrayValues(Commands.ValueObject returnValue, Commands.ValueSender valueSender, boolean allowFlag) throws CommandException;
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/IREMConstantBeanProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/IREMConstantBeanProxy.java
deleted file mode 100644
index dccb9d5f6..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/IREMConstantBeanProxy.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-
-/**
- * Tag interface to indicate this proxy is a constant proxy, i.e. there
- * is no bean on the server representing this (e.g. Strings and Integers).
- */
-
-public interface IREMConstantBeanProxy extends IREMBeanProxy {
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/IREMConstantBeanTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/IREMConstantBeanTypeProxy.java
deleted file mode 100644
index 2c3f9fd4a..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/IREMConstantBeanTypeProxy.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-
-import org.eclipse.jem.internal.proxy.core.*;
-import org.eclipse.jem.internal.proxy.common.remote.Commands;
-/**
- * This interface is used for any BeanType that represents a constant type bean.
- * These are types that are immutable and a copy of the actual value is kept here
- * in the client and not stored as an object id.
- */
-
-public interface IREMConstantBeanTypeProxy extends IBeanTypeProxy {
-
- /**
- * Create a new bean proxy the ValueObject passed in.
- */
- public IBeanProxy newBeanProxy(Commands.ValueObject value);
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/IREMExpressionConnection.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/IREMExpressionConnection.java
deleted file mode 100644
index 335fb430c..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/IREMExpressionConnection.java
+++ /dev/null
@@ -1,182 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 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.jem.internal.proxy.remote;
-
-import java.io.IOException;
-
-import org.eclipse.jem.internal.proxy.common.CommandException;
-import org.eclipse.jem.internal.proxy.common.remote.Commands;
-
-/**
- * Additional function on a connection for expression tree processing.
- * Connections returned (IREMConnections) will always also implement IREMExpressionConnection,
- * but they are separated so that expression functions don't pollute the regular
- * connection interface with added commands that shouldn't be called except
- * when processing an expression. If they were called out of order, big problems
- * can occur.
- * <p>
- * To use, simply cast the IREMConnection to be an IREMExpressionConnection.
- *
- * @since 1.0.0
- */
-public interface IREMExpressionConnection extends IREMConnection {
-
- /**
- * Start expression processing.
- * @param expressionID
- * @param trace TODO
- * @throws IOException
- *
- * @since 1.0.0
- */
- public void startExpressionProcessing(int expressionID, byte trace) throws IOException;
-
- /**
- * Transfer the expression. This tells the remote vm to stop processing on the
- * given connection and return the expression processing controller for the expression.
- *
- * @param expressionID
- * @param expController
- * @throws IOException
- *
- * @since 1.1.0
- */
- public void transferExpression(int expressionID, Commands.ValueObject expController) throws CommandException;
-
- /**
- * Resume the expression on this connection.
- * @param expressionID
- * @param expController expression processor controller to use for the expression on this new connection.
- * @throws CommandException
- *
- * @since 1.1.0
- */
- public void resumeExpression(int expressionID, Commands.ValueObject expController) throws CommandException;
-
- /**
- * Push an expression command. This is the common portion of the
- * subcommand. The actual data of the command will be separately done.
- * @param expressionID
- * @param subcommand The subcommand being sent. From IInternalExpressionConstants.
- *
- * @throws IOException
- *
- * @see org.eclipse.jem.internal.proxy.initParser.tree.IInternalExpressionConstants#PUSH_TO_PROXY_EXPRESSION
- * @since 1.0.0
- */
- public void pushExpressionCommand(int expressionID, byte subcommand) throws IOException;
-
- /**
- * Push the value object to the remote side.
- *
- * @param valueObject
- * @throws CommandException
- *
- * @since 1.0.0
- */
- public void pushValueObject(Commands.ValueObject valueObject) throws CommandException;
-
- /**
- * Push just the single byte to the remote side.
- * @param abyte
- * @throws IOException
- *
- * @since 1.0.0
- */
- public void pushByte(byte abyte) throws IOException;
-
- /**
- * Push just the single int to the remote side.
- *
- * @param anInt
- * @throws IOException
- *
- * @since 1.0.0
- */
- public void pushInt(int anInt) throws IOException;
-
-
- /**
- * Push just the singe string to the remote side.
- *
- * @param aString
- * @throws IOException
- *
- * @since 1.0.0
- */
- public void pushString(String aString) throws IOException;
-
- /**
- * Push just the bool to the remote side.
- * @param aBool
- * @throws IOException
- *
- * @since 1.0.0
- */
- public void pushBoolean(boolean aBool) throws IOException;
-
- /**
- * Get the final value. It must be called after processing the proxy id resolutions even for sync (so that we can get
- * any thrown errors).
- *
- * @param result
- * @throws CommandException
- *
- * @since 1.1.0
- */
- public void getFinalValue(Commands.ValueObject result) throws CommandException;
-
- /**
- * Send the pull value command, with the proxyids of intereset. If an error
- * occurs, command exception is thrown.
- * <p>
- * After the pull value call, if no errors, the proxyids must be read, and then getFinalValue call must be sent.
- * @param expressionID
- * @param proxyids expression proxyids that request feedback or <code>null</code> if no proxy ids.
- * @param sender sender to use to process the returned proxy ids, or <code>null</code> if expecting no proxy resolutions.
- *
- * @throws CommandException
- *
- * @since 1.0.0
- */
- public void pullValue(int expressionID, Commands.ValueObject proxyids, Commands.ValueSender sender) throws CommandException;
-
- /**
- * Send the sync command, with the proxyids of intereset. If an error
- * occurs, command exception is thrown.
- * <p>
- * After the sync call, if no errors, the returned proxyids must be processed and then the final endValue call must be sent.
- *
- * @param expressionID
- * @param proxyids expression proxyids that request feedback or <code>null</code> if no proxy ids.
- * @param sender sender to use to process the proxy id resolutions, or <code>null</code> if expecting no proxy ids.
- *
- * @throws CommandException
- *
- * @since 1.0.0
- */
- public void sync(int expressionID, Commands.ValueObject proxyids, Commands.ValueSender sender) throws CommandException;
-
- /**
- * Stop expression processing.
- * @param expressionID
- *
- * @throws IOException
- *
- * @since 1.0.0
- */
- public void stopExpressionProcessing(int expressionID) throws IOException;
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/IREMMethodProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/IREMMethodProxy.java
deleted file mode 100644
index f56556ba9..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/IREMMethodProxy.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-
-import org.eclipse.jem.internal.proxy.core.*;
-/**
- * This interface for REMMethodProxy allows the invokation where
- * the parms are a mixture of constant objects (i.e. can be sent
- * as values to the client) and IBeanProxies. It is only to be
- * used by other factories that want to invoke methods where
- * some of the parms are constants so that there is no need
- * create IBeanProxies for them, e.g. String. This should be
- * used with extreme care.
- */
-
-public interface IREMMethodProxy extends IMethodProxy, IREMBeanProxy {
- public IBeanProxy invokeWithParms(IBeanProxy subject, Object[] parms) throws ThrowableProxy;
-
-
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/IREMSpecialBeanTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/IREMSpecialBeanTypeProxy.java
deleted file mode 100644
index 897a4ff67..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/IREMSpecialBeanTypeProxy.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-import org.eclipse.jem.internal.proxy.core.IBeanTypeProxy;
-/**
- * This is a special interface for allowing abstract
- * types to create the correct subclass types.
- * Only ones that use REMAnAbstractBeanTypeProxy
- * should implement this.
- */
-public interface IREMSpecialBeanTypeProxy {
-
- /**
- * Called by REMAnAbstractBeanTypeProxy to create a subclass of it.
- * This allows correct types to be created depending upon the
- * main super type.
- */
- public IREMBeanTypeProxy newBeanTypeForClass(Integer anID, String aClassname, boolean anAbstract, IBeanTypeProxy superType);
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/LocalFileConfigurationContributorController.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/LocalFileConfigurationContributorController.java
deleted file mode 100644
index df8937b3d..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/LocalFileConfigurationContributorController.java
+++ /dev/null
@@ -1,314 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 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.jem.internal.proxy.remote;
-
-import java.net.URL;
-import java.util.*;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jdt.core.*;
-import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
-import org.eclipse.jdt.launching.JavaRuntime;
-import org.osgi.framework.Bundle;
-
-import org.eclipse.jem.internal.proxy.core.*;
-import org.eclipse.jem.util.plugin.JEMUtilPlugin;
-
-/**
- * This version works with local files being added to the classpath, and the classpath is strings.
- *
- * @since 1.0.0
- */
-public class LocalFileConfigurationContributorController implements IConfigurationContributionController {
-
- private URL[] classpathInfo;
-
- private URL[][] bootpathInfo;
-
- private List classpath;
-
- private List prependBootpath;
-
- private List appendBootpath;
-
- private List javaLibraryPath;
-
- private ProxyLaunchSupport.LaunchInfo launchInfo;
-
- public LocalFileConfigurationContributorController(URL[] classpathInfo, URL[][] bootpathInfo, ProxyLaunchSupport.LaunchInfo launchInfo) {
- this.classpathInfo = classpathInfo;
- this.bootpathInfo = bootpathInfo;
- this.launchInfo = launchInfo;
- }
-
- public URL[] getFinalClasspath() {
- if (classpath == null)
- return classpathInfo;
- else
- return (URL[]) classpath.toArray(new URL[classpath.size()]);
- }
-
- public URL[] getFinalPrependBootpath() {
- if (prependBootpath == null)
- return bootpathInfo[0];
- else
- return (URL[]) prependBootpath.toArray(new URL[prependBootpath.size()]);
- }
-
- public URL[] getFinalAppendBootpath() {
- if (appendBootpath == null)
- return bootpathInfo[2];
- else
- return (URL[]) appendBootpath.toArray(new URL[appendBootpath.size()]);
- }
-
- public List getFinalJavaLibraryPath() {
- if (javaLibraryPath == null)
- return Collections.EMPTY_LIST;
- else
- return javaLibraryPath;
- }
-
- protected List getClasspath() {
- if (classpath == null) {
- classpath = new ArrayList(classpathInfo.length);
- addAll(classpath, classpathInfo, -1);
- }
- return classpath;
- }
-
- protected List getPrependBootpath() {
- if (prependBootpath == null) {
- if (bootpathInfo[0] != null) {
- prependBootpath = new ArrayList(bootpathInfo[0].length);
- addAll(prependBootpath, bootpathInfo[0], -1);
- } else
- prependBootpath = new ArrayList(1);
- }
- return prependBootpath;
- }
-
- protected List getAppendBootpath() {
- if (appendBootpath == null) {
- if (bootpathInfo[2] != null) {
- appendBootpath = new ArrayList(bootpathInfo[2].length);
- addAll(appendBootpath, bootpathInfo[2], -1);
- } else
- appendBootpath = new ArrayList(1);
- }
- return appendBootpath;
- }
-
- protected List getJavaLibraryPath() {
- if (javaLibraryPath == null) {
- javaLibraryPath = new ArrayList(3);
- }
- return javaLibraryPath;
- }
-
- protected void addAll(List toList, Object[] array, int loc) {
- for (int i = 0; i < array.length; i++) {
- // Need a dup check, sometimes dups come in especially during development
- if (toList.contains(array[i]))
- continue;
- if (loc == -1)
- toList.add(array[i]);
- else
- toList.add(loc++, array[i]);
- }
- }
-
- protected void addLocations(List toList, IRuntimeClasspathEntry[] entries) {
- for (int i = 0; i < entries.length; i++) {
- IRuntimeClasspathEntry entry = entries[i];
- URL location = ProxyLaunchSupport.convertStringPathToURL(entry.getLocation());
- if (location != null && !toList.contains(location))
- toList.add(location);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IConfigurationContributionController#getJavaProject()
- */
- public IJavaProject getJavaProject() {
- return launchInfo.getJavaProject();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IConfigurationContributionController#contributeProject(org.eclipse.core.resources.IProject)
- */
- public void contributeProject(IProject project) throws CoreException {
- IJavaProject jproject = JavaCore.create(project);
- IRuntimeClasspathEntry[] projPath = JavaRuntime.computeUnresolvedRuntimeClasspath(jproject);
- boolean jreContainerFound = false;
- for (int i = 0; i < projPath.length; i++) {
- IRuntimeClasspathEntry entry = projPath[i];
- if (entry.getClasspathProperty() == IRuntimeClasspathEntry.BOOTSTRAP_CLASSES
- || entry.getClasspathProperty() == IRuntimeClasspathEntry.STANDARD_CLASSES) {
- int entryKind = entry.getClasspathEntry().getEntryKind();
- String segment0 = entry.getPath().segment(0);
- if (entryKind == IClasspathEntry.CPE_CONTAINER && JavaRuntime.JRE_CONTAINER.equals(segment0)
- || entryKind == IClasspathEntry.CPE_VARIABLE && JavaRuntime.JRELIB_VARIABLE.equals(segment0)) {
- jreContainerFound = true;
- } else {
- if (jreContainerFound)
- addLocations(getAppendBootpath(), JavaRuntime.resolveRuntimeClasspathEntry(entry, jproject));
- else
- addLocations(getPrependBootpath(), JavaRuntime.resolveRuntimeClasspathEntry(entry, jproject));
- }
- } else {
- addLocations(getClasspath(), JavaRuntime.resolveRuntimeClasspathEntry(entry, jproject));
- }
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IConfigurationContributionController#contributeClasspath(java.lang.String, int)
- */
- public void contributeClasspath(String classpath, int typeFlag) {
- contributeClasspath(ProxyLaunchSupport.convertStringPathToURL(classpath), typeFlag);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IConfigurationContributionController#contributeClasspath(java.net.URL, int)
- */
- public void contributeClasspath(URL classpathURL, int typeFlag) {
- if (classpathURL == null)
- return;
- switch (typeFlag) {
- case PREPEND_BOOT_CLASSPATH:
- if (!getPrependBootpath().contains(classpathURL))
- getPrependBootpath().add(classpathURL);
- break;
- case PREPEND_USER_CLASSPATH:
- if (!getClasspath().contains(classpathURL))
- getClasspath().add(0, classpathURL);
- break;
- case APPEND_USER_CLASSPATH:
- if (!getClasspath().contains(classpathURL))
- getClasspath().add(classpathURL);
- break;
- case APPEND_BOOT_CLASSPATH:
- if (!getAppendBootpath().contains(classpathURL))
- getAppendBootpath().add(classpathURL);
- break;
- case APPEND_JAVA_LIBRARY_PATH:
- if (!getJavaLibraryPath().contains(classpathURL))
- getJavaLibraryPath().add(classpathURL);
- break;
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IConfigurationContributionController#contributeClasspath(org.osgi.framework.Bundle, java.lang.String,
- * int, boolean)
- */
- public void contributeClasspath(Bundle bundle, String relativePath, int typeFlag, boolean nlsLocalize) {
- // If not nls localize, or if it is java library path, then just find the one in the plugin/fragment and add it.
- if (nlsLocalize)
- contributeClasspath(ProxyPlugin.getPlugin().urlLocalizeAllFromBundleAndFragments(bundle, relativePath), typeFlag);
- else if (typeFlag == IConfigurationContributionController.APPEND_JAVA_LIBRARY_PATH) {
- if (relativePath == null || relativePath.length() == 0) {
- // PDE is not here to help us extract that @#$ dll
- JEMUtilPlugin.getLogger().log("Can't extract a directory from the root of a plugin."); //$NON-NLS-1$
- return;
- }
- URL contribution = ProxyPlugin.getPlugin().urlLocalizeFromBundleAndFragments(bundle, relativePath);
- contributeClasspath(contribution, typeFlag);
- } else {
- if (relativePath != null)
- contributeClasspath(ProxyPlugin.getPlugin().urlLocalizeFromBundleOnly(bundle, relativePath), typeFlag);
- else
- contributeClasspath(ProxyPlugin.getPlugin().urlLocalizeBundle(bundle), typeFlag);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IConfigurationContributionController#contributeClasspath(org.osgi.framework.Bundle,
- * org.eclipse.core.runtime.IPath, int, boolean)
- */
- public void contributeClasspath(Bundle bundle, IPath relativePath, int typeFlag, boolean nlsLocalize) {
- if (nlsLocalize)
- if (relativePath != null)
- contributeClasspath(ProxyPlugin.getPlugin().urlLocalizeAllFromBundleAndFragments(bundle, relativePath), typeFlag);
- else
- contributeClasspath(ProxyPlugin.getPlugin().urlLocalizeBundleAndFragments(bundle), typeFlag);
- else if (typeFlag == IConfigurationContributionController.APPEND_JAVA_LIBRARY_PATH) {
- if (relativePath == null || relativePath.segmentCount() == 0) {
- // PDE is not here to help us extract that @#$ dll
- JEMUtilPlugin.getLogger().log("Can't extract a directory from the root of a plugin."); //$NON-NLS-1$
- return;
- }
- URL contribution = ProxyPlugin.getPlugin().urlLocalizeFromBundleAndFragments(bundle, relativePath);
- contributeClasspath(contribution, typeFlag);
- } else {
- if (relativePath != null)
- contributeClasspath(ProxyPlugin.getPlugin().urlLocalizeFromBundleOnly(bundle, relativePath), typeFlag);
- else
- contributeClasspath(ProxyPlugin.getPlugin().urlLocalizeBundle(bundle), typeFlag);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IConfigurationContributionController#contributeClasspath(java.lang.String[], int)
- */
- public void contributeClasspath(String[] classpaths, int typeFlag) {
- contributeClasspath(ProxyLaunchSupport.convertStringPathsToURL(classpaths), typeFlag);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IConfigurationContributionController#contributeClasspath(java.net.URL[], int)
- */
- public void contributeClasspath(URL[] classpathURLs, int typeFlag) {
- if (classpathURLs == null)
- return;
- switch (typeFlag) {
- case PREPEND_BOOT_CLASSPATH:
- addAll(getPrependBootpath(), classpathURLs, -1);
- break;
- case PREPEND_USER_CLASSPATH:
- addAll(getClasspath(), classpathURLs, 0);
- break;
- case APPEND_USER_CLASSPATH:
- addAll(getClasspath(), classpathURLs, -1);
- break;
- case APPEND_BOOT_CLASSPATH:
- addAll(getAppendBootpath(), classpathURLs, -1);
- break;
- case APPEND_JAVA_LIBRARY_PATH:
- addAll(getJavaLibraryPath(), classpathURLs, -1);
- break;
- }
- }
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/LocalProxyLaunchDelegate.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/LocalProxyLaunchDelegate.java
deleted file mode 100644
index c59772c15..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/LocalProxyLaunchDelegate.java
+++ /dev/null
@@ -1,475 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- *******************************************************************************/
-/*
- * $RCSfile: LocalProxyLaunchDelegate.java,v $ $Revision: 1.35 $ $Date: 2006/05/23 15:43:03 $
- */
-package org.eclipse.jem.internal.proxy.remote;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.*;
-import java.text.MessageFormat;
-import java.util.*;
-import java.util.logging.Level;
-
-import org.eclipse.core.runtime.*;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.debug.core.*;
-import org.eclipse.debug.core.model.*;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.launching.*;
-
-import org.eclipse.jem.internal.proxy.common.remote.ExpressionCommands;
-import org.eclipse.jem.internal.proxy.core.*;
-import org.eclipse.jem.internal.proxy.remote.awt.REMRegisterAWT;
-import org.eclipse.jem.util.TimerTests;
-import org.eclipse.jem.util.logger.proxy.Logger;
-
-
-/**
- * Launch Delegate for launching Local (i.e. remote vm is on local system). Here "remote" means the
- * registry is not in the IDE but in a separate VM, and "local" means that is in on the local
- * physical machine and not on a separate machine.
- *
- * @since 1.0.0
- */
-public class LocalProxyLaunchDelegate extends AbstractJavaLaunchConfigurationDelegate {
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.debug.core.model.ILaunchConfigurationDelegate#launch(org.eclipse.debug.core.ILaunchConfiguration,
- * java.lang.String, org.eclipse.debug.core.ILaunch,
- * org.eclipse.core.runtime.IProgressMonitor)
- */
- public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor pm) throws CoreException {
-
- String launchKey = configuration.getAttribute(IProxyConstants.ATTRIBUTE_LAUNCH_KEY, (String) null);
- if (launchKey == null)
- abort(ProxyRemoteMessages.ProxyRemoteNoLaunchKey, null, 0);
-
- // In Eclipse, even if private, a launch will show up in the debug process tree and in the console viewer.
- // To be absolutely private, we need to remove the launch which has already been added.
- if (ProxyLaunchSupport.ATTR_PRIVATE != null && configuration.getAttribute(ProxyLaunchSupport.ATTR_PRIVATE, false))
- DebugPlugin.getDefault().getLaunchManager().removeLaunch(launch);
- if (pm == null) {
- pm = new NullProgressMonitor();
- }
-
- IJavaProject project = getJavaProject(configuration);
- String name = configuration.getAttribute(IProxyConstants.ATTRIBUTE_VM_TITLE, (String) null);
- if (name == null)
- name = MessageFormat.format(ProxyRemoteMessages.ProxyRemoteVMName, new Object[] { project != null ? project.getProject().getName() : "" }); //$NON-NLS-1$
- else
- name = MessageFormat.format(ProxyRemoteMessages.ProxyRemoteVMNameWithComment, new Object[] { project != null ? project.getProject().getName() : "", name }); //$NON-NLS-1$
-
- String stepId = "Launch VM ( " + name + " )"; //$NON-NLS-1$ //$NON-NLS-2$
- TimerTests.basicTest.startStep(stepId);
- // Problem with launch, can't have double-quotes in vmName.
- if (name.indexOf('"') != -1)
- name = name.replace('"', '\'');
-
- pm.beginTask("", 500); //$NON-NLS-1$
- pm.subTask(MessageFormat.format(ProxyRemoteMessages.ProxyRemoteLaunchVM, new Object[] { name }));
- // check for cancellation
- if (pm.isCanceled())
- return;
-
- IVMInstall vm = verifyVMInstall(configuration);
-
- IVMRunner runner = vm.getVMRunner(mode);
- if (runner == null) {
- abort(MessageFormat.format(ProxyRemoteMessages.Proxy_NoRunner_ERROR_, new Object[] { name }), null, 0);
- }
-
- File workingDir = verifyWorkingDirectory(configuration);
- String workingDirName = null;
- if (workingDir != null) {
- workingDirName = workingDir.getAbsolutePath();
- }
-
- // Environment variables
- String[] envp = DebugPlugin.getDefault().getLaunchManager().getEnvironment(configuration);
-
- // Program & VM args
- String pgmArgs = getProgramArguments(configuration);
- String vmArgs = getVMArguments(configuration);
- ExecutionArguments execArgs = new ExecutionArguments(vmArgs, pgmArgs);
-
- // VM-specific attributes
- Map vmAttributesMap = getVMSpecificAttributesMap(configuration);
-
- pm.worked(100);
-
- // Now let's get the classpaths created through the contributors.
- URL[] classpath = ProxyLaunchSupport.convertStringPathsToURL(getClasspath(configuration));
- String[][] bootpathInfoStrings = getBootpathExt(vmAttributesMap);
- URL[][] bootpathInfo = new URL[][]{
- ProxyLaunchSupport.convertStringPathsToURL(bootpathInfoStrings[0]),
- ProxyLaunchSupport.convertStringPathsToURL(bootpathInfoStrings[1]),
- ProxyLaunchSupport.convertStringPathsToURL(bootpathInfoStrings[2]),
- };
- ProxyLaunchSupport.LaunchInfo launchInfo = ProxyLaunchSupport.getInfo(launchKey);
- final IConfigurationContributor[] contributors = launchInfo.contributors;
- final LocalFileConfigurationContributorController controller =
- new LocalFileConfigurationContributorController(classpath, bootpathInfo, launchInfo);
- if (contributors != null) {
- for (int i = 0; i < contributors.length; i++) {
- // Run in safe mode so that anything happens we don't go away.
- final int ii = i;
- SafeRunner.run(new ISafeRunnable() {
- public void handleException(Throwable exception) {
- // Don't need to do anything. Platform.run logs it for me.
- }
-
- public void run() throws Exception {
- contributors[ii].contributeClasspaths(controller);
- }
- });
- }
- }
-
- // Add in the required ones by the Proxy support. These are hard-coded since they are
- // required.
- ProxyRemoteUtil.updateClassPaths(controller);
- addInFragmentLibraries(controller, launchInfo.getConfigInfo());
-
- classpath = controller.getFinalClasspath();
- if (bootpathInfo[0] != controller.getFinalPrependBootpath()) {
- if (vmAttributesMap == null)
- vmAttributesMap = new HashMap(2);
- vmAttributesMap.put(IJavaLaunchConfigurationConstants.ATTR_BOOTPATH_PREPEND, ProxyLaunchSupport.convertURLsToStrings(bootpathInfo[0]));
- }
- if (bootpathInfo[2] != controller.getFinalAppendBootpath()) {
- if (vmAttributesMap == null)
- vmAttributesMap = new HashMap(2);
- vmAttributesMap.put(IJavaLaunchConfigurationConstants.ATTR_BOOTPATH_APPEND, ProxyLaunchSupport.convertURLsToStrings(bootpathInfo[2]));
- }
-
- // check for cancellation
- if (pm.isCanceled())
- return;
- pm.worked(100);
-
- // Create VM config
- VMRunnerConfiguration runConfig =
- new VMRunnerConfiguration("org.eclipse.jem.internal.proxy.vm.remote.RemoteVMApplication", ProxyLaunchSupport.convertURLsToStrings(classpath)); //$NON-NLS-1$
-
- REMProxyFactoryRegistry registry = new REMProxyFactoryRegistry(ProxyRemoteUtil.getRegistryController(), name);
- Integer registryKey = registry.getRegistryKey();
-
- Integer bufSize = Integer.getInteger("proxyvm.bufsize"); //$NON-NLS-1$
- if (bufSize == null)
- bufSize = new Integer(16000);
-
- int masterServerPort = ProxyRemoteUtil.getRegistryController().getMasterSocketPort();
-
- // See if debug mode is requested.
- DebugModeHelper dh = new DebugModeHelper();
- boolean debugMode = dh.debugMode(name);
- boolean useNoverify = ProxyPlugin.getPlugin().getPluginPreferences().getBoolean(ProxyPlugin.PREFERENCES_VM_NOVERIFY_KEY);
-
- String[] evmArgs = execArgs.getVMArgumentsArray();
-
- int extraArgs = 4; // Number of extra standard args added (if number changes below, this must change)
- if (debugMode)
- extraArgs+=4; // Number of extra args added for debug mode (if number changes below, this must change).
- if(useNoverify)
- extraArgs++; // An extra arg added for '-noverify' flag (if number changes below, this must change).
-
- boolean useExpressionTracing = "true".equalsIgnoreCase(Platform.getDebugOption(ProxyPlugin.getPlugin().getBundle().getSymbolicName() + ProxyLaunchSupport.EXPRESSION_TRACING)); //$NON-NLS-1$
- long expressionTracingThreshold = -1;
- if (useExpressionTracing) {
- extraArgs++;
- String thresholdString = Platform.getDebugOption(ProxyPlugin.getPlugin().getBundle().getSymbolicName() + ProxyLaunchSupport.EXPRESSION_TRACEING_TIMER_THRESHOLD);
- if (thresholdString != null) {
- try {
- expressionTracingThreshold = Long.valueOf(thresholdString).longValue();
- extraArgs++;
- } catch (NumberFormatException e) {
- }
- }
- }
-
- List javaLibPaths = controller.getFinalJavaLibraryPath();
- int existingLibpaths = -1;
- if (!javaLibPaths.isEmpty()) {
- // first need to see if java lib path also specified in standard args by someone configuring the configuration by hand.
- for (int i = 0; i < evmArgs.length; i++) {
- if (evmArgs[i].startsWith("-Djava.library.path")) { //$NON-NLS-1$
- // We found one already here, save the spot so we update it later.
- existingLibpaths = i;
- break;
- }
- }
- if (existingLibpaths == -1)
- ++extraArgs; // Need to have room for one more.
- }
-
- String[] cvmArgs = new String[evmArgs.length + extraArgs];
- System.arraycopy(evmArgs, 0, cvmArgs, extraArgs, evmArgs.length); // Put existing into new list at the end.
-
- int cvmArgsCount=0;
- cvmArgs[cvmArgsCount++] = "-Dproxyvm.registryKey=" + registryKey; //$NON-NLS-1$
- cvmArgs[cvmArgsCount++] = "-Dproxyvm.masterPort=" + String.valueOf(masterServerPort); //$NON-NLS-1$
- cvmArgs[cvmArgsCount++] = "-Dproxyvm.bufsize=" + bufSize; //$NON-NLS-1$
- cvmArgs[cvmArgsCount++] = "-Dproxyvm.servername=" + name; //$NON-NLS-1$
-
- if(useNoverify)
- cvmArgs[cvmArgsCount++] = "-noverify"; //$NON-NLS-1$
-
- if (useExpressionTracing) {
- cvmArgs[cvmArgsCount++] = "-D"+ExpressionCommands.EXPRESSIONTRACE+"=true"; //$NON-NLS-1$ //$NON-NLS-2$
- if (expressionTracingThreshold != -1)
- cvmArgs[cvmArgsCount++] = "-D"+ExpressionCommands.EXPRESSIONTRACE_TIMER_THRESHOLD+'='+String.valueOf(expressionTracingThreshold); //$NON-NLS-1$
- }
-
- // If in debug mode, we need to find a port for it to use.
- int dport = -1;
- if (debugMode) {
- dport = findUnusedLocalPort("localhost", 5000, 15000, new int[0]); //$NON-NLS-1$
- cvmArgs[cvmArgsCount++] = "-Djava.compiler=NONE"; //$NON-NLS-1$
- cvmArgs[cvmArgsCount++] = "-Xdebug"; //$NON-NLS-1$
- cvmArgs[cvmArgsCount++] = "-Xnoagent"; //$NON-NLS-1$
- cvmArgs[cvmArgsCount++] = "-Xrunjdwp:transport=dt_socket,server=y,address=" + dport; //$NON-NLS-1$
- }
-
- if (!javaLibPaths.isEmpty()) {
- StringBuffer appendTo = null;
- if (existingLibpaths != -1) {
- appendTo = new StringBuffer(evmArgs[existingLibpaths]);
- appendTo.append(File.pathSeparatorChar); // Plus a separator so we can append
- } else
- appendTo = new StringBuffer("-Djava.library.path="); //$NON-NLS-1$
- String [] libPaths = ProxyLaunchSupport.convertURLsToStrings((URL[]) javaLibPaths.toArray(new URL[javaLibPaths.size()]));
- for (int i = 0; i < libPaths.length; i++) {
- if (i != 0)
- appendTo.append(File.pathSeparator);
- appendTo.append(libPaths[i]);
- }
- if (existingLibpaths != -1)
- cvmArgs[extraArgs+existingLibpaths] = appendTo.toString();
- else
- cvmArgs[extraArgs-1] = appendTo.toString();
- }
-
- runConfig.setProgramArguments(execArgs.getProgramArgumentsArray());
- runConfig.setEnvironment(envp);
- runConfig.setVMArguments(cvmArgs);
- runConfig.setWorkingDirectory(workingDirName);
- runConfig.setVMSpecificAttributesMap(vmAttributesMap);
-
- // Bootpath
- runConfig.setBootClassPath(getBootpath(configuration));
-
- // check for cancellation
- if (pm.isCanceled())
- return;
- pm.worked(100);
-
- // set the default source locator if required
- setDefaultSourceLocator(launch, configuration);
-
- // Launch the configuration - 1 unit of work
- runner.run(runConfig, launch, new SubProgressMonitor(pm, 100));
-
- // check for cancellation
- if (pm.isCanceled())
- return;
-
- IProcess[] processes = launch.getProcesses();
- IProcess process = processes[0]; // There is only one.
- // Check if it is already terminated. If it is, then there was a bad error, so just
- // print out the results from it.
- if (process.isTerminated()) {
- IStreamsProxy stProxy = process.getStreamsProxy();
- // Using a printWriter for println capability, but it needs to be on another
- // writer, which will be string
- java.io.StringWriter s = new java.io.StringWriter();
- java.io.PrintWriter w = new java.io.PrintWriter(s);
-
- w.println(ProxyRemoteMessages.VM_TERMINATED_INFO_);
- w.println(ProxyRemoteMessages.VM_COMMAND_LINE);
- w.println(process.getAttribute(IProcess.ATTR_CMDLINE));
- w.println(ProxyRemoteMessages.VM_TERMINATED_LINE1);
- w.println(stProxy.getErrorStreamMonitor().getContents());
- w.println(ProxyRemoteMessages.VM_TERMINATED_LINE2);
- w.println(stProxy.getOutputStreamMonitor().getContents());
- w.println(ProxyRemoteMessages.VM_TERMINATED_LINE3);
- w.close();
-
- String msg = MessageFormat.format(ProxyRemoteMessages.Proxy_Terminated_too_soon_ERROR_, new Object[] { name });
- dh.displayErrorMessage(ProxyRemoteMessages.Proxy_Error_Title, msg);
- throw new CoreException(
- new Status(IStatus.WARNING, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, s.toString(), null));
- } else {
- final String traceName = name;
- IStreamsProxy fStreamsProxy = process.getStreamsProxy();
-
- /**
- * StreamListener. Should not be created if ProxyPlugin logger is not logging the requested level.
- *
- * @since 1.1.0
- */
- class StreamListener implements IStreamListener {
- String tracePrefix;
- Level level;
- Job printJob; // Job to try to gather printing together.
- Logger logger;
- StringBuffer gatheredText = new StringBuffer(100);
- {
- logger = ProxyPlugin.getPlugin().getLogger();
- printJob = new Job("") { //$NON-NLS-1$
-
- protected IStatus run(IProgressMonitor monitor) {
- monitor.beginTask(ProxyRemoteMessages.LocalProxyLaunchDelegate_Monitor_PrintRemoteTrace_Text, 1);
- while(true) {
- String output = null;
- synchronized (gatheredText) {
- if (gatheredText.length() <= tracePrefix.length())
- break; // We've reached the end, no more to print.
- output = gatheredText.toString();
- gatheredText.setLength(tracePrefix.length()); // Reset the length to the prefix.
- }
- logger.log(output, level);
- }
- monitor.done();
- return Status.OK_STATUS;
- }
- };
- printJob.setPriority(Job.SHORT);
- printJob.setSystem(true);
- }
-
- public StreamListener(String type, Level level, Logger logger) {
- tracePrefix = traceName + ':' + type + '>' + System.getProperty("line.separator"); //$NON-NLS-1$
- gatheredText.append(tracePrefix);
- this.level = level;
- this.logger = logger;
- }
-
- public void streamAppended(String newText, IStreamMonitor monitor) {
- synchronized(gatheredText) {
- gatheredText.append(newText);
- }
- printJob.schedule(100L); // Wait tenth of second to gather as much as can together.
- }
- };
-
- Logger logger = ProxyPlugin.getPlugin().getLogger();
- if (logger.isLoggingLevel(Level.WARNING)) {
- // Always listen to System.err output if we are at least logging warnings.
- IStreamMonitor monitor = fStreamsProxy.getErrorStreamMonitor();
- if (monitor != null)
- monitor.addListener(new StreamListener("err", Level.WARNING, logger)); //$NON-NLS-1$
- }
-
- // If debug trace is requested, then attach trace listener for System.out
- // Expression tracing requires debug trace too because it prints to sysout. However, it requesting expressionTracing, change logging level to INFO,
- // we want them to show if this true. It is confusing to also have to change logging level in .options file.
- if (useExpressionTracing)
- if (!logger.isLoggingLevel(Level.INFO))
- logger.setLevel(Level.INFO);
- if (useExpressionTracing || "true".equalsIgnoreCase(Platform.getDebugOption(ProxyPlugin.getPlugin().getBundle().getSymbolicName() + ProxyRemoteUtil.DEBUG_VM_TRACEOUT))) { //$NON-NLS-1$
- // Want to trace the output of the remote vm's. And we are logging at least level info.
- if (logger.isLoggingLevel(Level.INFO)) {
- IStreamMonitor monitor = fStreamsProxy.getOutputStreamMonitor();
- if (monitor != null)
- monitor.addListener(new StreamListener("out", Level.INFO, logger)); //$NON-NLS-1$
- }
- }
- }
-
- // If in debug mode, tester must start debugger before going on.
- if (debugMode) {
- if (!dh.promptPort(dport)) {
- process.terminate();
- throw new CoreException(
- new Status(
- IStatus.WARNING,
- ProxyPlugin.getPlugin().getBundle().getSymbolicName(),
- 0,
- "Debugger attach canceled", //$NON-NLS-1$
- null));
- }
- }
-
- // Now set up the registry.
- registry.initializeRegistry(process);
- new REMStandardBeanTypeProxyFactory(registry);
- new REMStandardBeanProxyFactory(registry);
- new REMMethodProxyFactory(registry);
-
- if (debugMode || REMProxyFactoryRegistry.fGlobalNoTimeouts)
- registry.fNoTimeouts = true;
- if (configuration.getAttribute(IProxyConstants.ATTRIBUTE_AWT_SWING, true))
- REMRegisterAWT.registerAWT(registry);
-
- launchInfo.resultRegistry = registry;
-
- pm.done();
- TimerTests.basicTest.stopStep(stepId);
- }
-
- /**
- * @param controller
- * @param info
- * @throws CoreException
- *
- * @since 1.0.2
- */
- private void addInFragmentLibraries(IConfigurationContributionController controller, IConfigurationContributionInfo info) throws CoreException {
- IPDEContributeClasspath instance = IPDEContributeClasspath.INSTANCE;
- if (instance != null) {
- instance.getPDEContributions(controller, info);
- }
- }
-
- // Utilities to find the free port
- private static final Random fgRandom = new Random(System.currentTimeMillis());
-
- private static int findUnusedLocalPort(String host, int searchFrom, int searchTo, int[] exclude) {
- for (int i = 0; i < 10; i++) {
- int port = 0;
- newport : while (true) {
- port = getRandomPort(searchFrom, searchTo);
- if (exclude != null)
- for (int e = 0; e < exclude.length; e++)
- if (port == exclude[e])
- continue newport;
- break;
- }
- try {
- new Socket(host, port);
- } catch (ConnectException e) {
- return port;
- } catch (IOException e) {
- }
- }
- return -1;
- }
-
- private static int getRandomPort(int low, int high) {
- return (int) (fgRandom.nextFloat() * (high - low)) + low;
- }
-
- private String[][] getBootpathExt(Map vmMap) {
- String[][] ext = new String[3][];
- if (vmMap != null) {
- ext[0] = (String[]) vmMap.get(IJavaLaunchConfigurationConstants.ATTR_BOOTPATH_PREPEND);
- ext[1] = (String[]) vmMap.get(IJavaLaunchConfigurationConstants.ATTR_BOOTPATH);
- ext[2] = (String[]) vmMap.get(IJavaLaunchConfigurationConstants.ATTR_BOOTPATH_APPEND);
- }
- return ext;
- }
-
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/MessageDialog.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/MessageDialog.java
deleted file mode 100644
index dd60e3dd1..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/MessageDialog.java
+++ /dev/null
@@ -1,331 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-import java.awt.*;
-/**
- * This is an AWT message dialog. It will only be used
- * if not running in the workbench by the debug mode helper.
- * It won't be loaded unless AWT is available, so it can be
- * distributed without causing problems on systems that
- * don't have AWT because it won't be loaded in that case.
- */
-class MessageDialog extends Dialog {
- /**
- * Comment for <code>serialVersionUID</code>
- *
- * @since 1.1.0
- */
- private static final long serialVersionUID = 2547670349372067345L;
- private java.awt.Panel ivjContentsPane = null;
- IvjEventHandler ivjEventHandler = new IvjEventHandler();
- private java.awt.TextArea ivjTextArea1 = null;
- private java.awt.Button ivjButton1 = null;
- public int result = 2; // Nothing hit is the same as button 2.
- private java.awt.Button ivjButton2 = null;
-
-class IvjEventHandler implements java.awt.event.ActionListener, java.awt.event.WindowListener {
- public void actionPerformed(java.awt.event.ActionEvent e) {
- if (e.getSource() == MessageDialog.this.getButton1())
- connEtoC2(e);
- if (e.getSource() == MessageDialog.this.getButton2())
- connEtoC3(e);
- };
- public void windowActivated(java.awt.event.WindowEvent e) {};
- public void windowClosed(java.awt.event.WindowEvent e) {};
- public void windowClosing(java.awt.event.WindowEvent e) {
- if (e.getSource() == MessageDialog.this)
- connEtoC1(e);
- };
- public void windowDeactivated(java.awt.event.WindowEvent e) {};
- public void windowDeiconified(java.awt.event.WindowEvent e) {};
- public void windowIconified(java.awt.event.WindowEvent e) {};
- public void windowOpened(java.awt.event.WindowEvent e) {};
- };
-/**
- * MessageDialog constructor comment.
- * @param owner java.awt.Frame
- * @param title java.lang.String
- * @param modal boolean
- */
-public MessageDialog(Frame owner, String title, boolean modal, String msg, String button1, String button2) {
- super(owner, title, modal);
-
- initialize();
- getTextArea1().setText(msg);
- getButton1().setLabel(button1);
- if (button2 != null)
- getButton2().setLabel(button2);
- else {
- // We only want one button, so remove button2
- getContentsPane().remove(getButton2());
- }
-
-}
-/**
- * Comment
- */
-public void button1_ActionPerformed() {
- result = 1;
- setVisible(false);
- return;
-}
-/**
- * Comment
- */
-public void button2_ActionPerformed() {
- result = 2;
- setVisible(false);
- return;
-}
-/**
- * connEtoC1: (MessageDialog.window.windowClosing(java.awt.event.WindowEvent) --> MessageDialog.dispose()V)
- * @param arg1 java.awt.event.WindowEvent
- */
-/* WARNING: THIS METHOD WILL BE REGENERATED. */
-private void connEtoC1(java.awt.event.WindowEvent arg1) {
- try {
- // user code begin {1}
- // user code end
- this.dispose();
- // user code begin {2}
- // user code end
- } catch (java.lang.Throwable ivjExc) {
- // user code begin {3}
- // user code end
- handleException(ivjExc);
- }
-}
-/**
- * connEtoC2: (Button1.action.actionPerformed(java.awt.event.ActionEvent) --> MessageDialog.button1_ActionPerformed()V)
- * @param arg1 java.awt.event.ActionEvent
- */
-/* WARNING: THIS METHOD WILL BE REGENERATED. */
-private void connEtoC2(java.awt.event.ActionEvent arg1) {
- try {
- // user code begin {1}
- // user code end
- this.button1_ActionPerformed();
- // user code begin {2}
- // user code end
- } catch (java.lang.Throwable ivjExc) {
- // user code begin {3}
- // user code end
- handleException(ivjExc);
- }
-}
-/**
- * connEtoC3: (Button2.action.actionPerformed(java.awt.event.ActionEvent) --> MessageDialog.button2_ActionPerformed()V)
- * @param arg1 java.awt.event.ActionEvent
- */
-/* WARNING: THIS METHOD WILL BE REGENERATED. */
-private void connEtoC3(java.awt.event.ActionEvent arg1) {
- try {
- // user code begin {1}
- // user code end
- this.button2_ActionPerformed();
- // user code begin {2}
- // user code end
- } catch (java.lang.Throwable ivjExc) {
- // user code begin {3}
- // user code end
- handleException(ivjExc);
- }
-}
-/**
- * Display dialog.
- * @param args java.lang.String[]
- */
-public static int doit(String title, String message, String button1, String button2) {
- try {
- Frame f = new java.awt.Frame(title);
- f.setVisible(true);
- // Need to massage the method since AWT doesn't have wordwrap. This is for left to right only.
- String msg = message;
- if (message.length() > 95) {
- msg = ""; //$NON-NLS-1$
-nextSeg: while (message.length() > 95) {
- // Too wide, wrapping should be done. This is just a rough guess.
- for (int i=95; 0<=i; i--) {
- if (message.charAt(i) == ' ') {
- // Break here.
- msg = msg + message.substring(0, i) + '\n';
- if (i+1 < message.length())
- message = message.substring(i+1);
- else
- message = ""; //$NON-NLS-1$
- continue nextSeg;
- }
- }
- // If we got here, then there weren't any spaces in the first 80, so look right for first space.
- for (int i=96; i<message.length(); i++) {
- if (message.charAt(i) == ' ') {
- // Break here
- msg = msg + message.substring(0, i) + '\n';
- if (i+1 < message.length())
- message = message.substring(i+1);
- else
- message = ""; //$NON-NLS-1$
- continue nextSeg;
- }
- }
- }
- msg += message; // Now put on whatever is left.
- }
- MessageDialog aMessageDialog = new MessageDialog(f,title,true, msg, button1, button2);
- aMessageDialog.pack();
- aMessageDialog.getToolkit().beep();
- aMessageDialog.setVisible(true);
- f.dispose();
- aMessageDialog.dispose();
-
- return aMessageDialog.result;
- } catch (Exception exception) {
- }
-
- return 2;
-}
-/**
- * Return the Button1 property value.
- * @return java.awt.Button
- */
-/* WARNING: THIS METHOD WILL BE REGENERATED. */
-private java.awt.Button getButton1() {
- if (ivjButton1 == null) {
- try {
- ivjButton1 = new java.awt.Button();
- ivjButton1.setName("Button1"); //$NON-NLS-1$
- ivjButton1.setLabel("Button1"); //$NON-NLS-1$
- // user code begin {1}
- // user code end
- } catch (java.lang.Throwable ivjExc) {
- // user code begin {2}
- // user code end
- handleException(ivjExc);
- }
- }
- return ivjButton1;
-}
-/**
- * Return the Button2 property value.
- * @return java.awt.Button
- */
-/* WARNING: THIS METHOD WILL BE REGENERATED. */
-private java.awt.Button getButton2() {
- if (ivjButton2 == null) {
- try {
- ivjButton2 = new java.awt.Button();
- ivjButton2.setName("Button2"); //$NON-NLS-1$
- ivjButton2.setLabel("Button2"); //$NON-NLS-1$
- // user code begin {1}
- // user code end
- } catch (java.lang.Throwable ivjExc) {
- // user code begin {2}
- // user code end
- handleException(ivjExc);
- }
- }
- return ivjButton2;
-}
-/**
- * Return the ContentsPane property value.
- * @return java.awt.Panel
- */
-/* WARNING: THIS METHOD WILL BE REGENERATED. */
-private java.awt.Panel getContentsPane() {
- if (ivjContentsPane == null) {
- try {
- ivjContentsPane = new java.awt.Panel();
- ivjContentsPane.setName("ContentsPane"); //$NON-NLS-1$
- ivjContentsPane.setLayout(new java.awt.FlowLayout());
- getContentsPane().add(getTextArea1(), getTextArea1().getName());
- getContentsPane().add(getButton1(), getButton1().getName());
- getContentsPane().add(getButton2(), getButton2().getName());
- // user code begin {1}
- // user code end
- } catch (java.lang.Throwable ivjExc) {
- // user code begin {2}
- // user code end
- handleException(ivjExc);
- }
- }
- return ivjContentsPane;
-}
-/**
- * Return the TextArea1 property value.
- * @return java.awt.TextArea
- */
-/* WARNING: THIS METHOD WILL BE REGENERATED. */
-private java.awt.TextArea getTextArea1() {
- if (ivjTextArea1 == null) {
- try {
- ivjTextArea1 = new TextArea();
- ivjTextArea1.setName("TextArea1"); //$NON-NLS-1$
- ivjTextArea1.setText("TextArea1"); //$NON-NLS-1$
- ivjTextArea1.setRows(20);
- ivjTextArea1.setColumns(100);
- ivjTextArea1.setEditable(false);
- // user code begin {1}
- // user code end
- } catch (java.lang.Throwable ivjExc) {
- // user code begin {2}
- // user code end
- handleException(ivjExc);
- }
- }
- return ivjTextArea1;
-}
-/**
- * Called whenever the part throws an exception.
- * @param exception java.lang.Throwable
- */
-private void handleException(java.lang.Throwable exception) {
-
- /* Uncomment the following lines to print uncaught exceptions to stdout */
- // ProxyPlugin.getPlugin().getMsgLogger().write(Level.WARNING,"--------- UNCAUGHT EXCEPTION ---------");
- // ProxyPlugin.getPlugin().getMsgLogger().write(Level.WARNING,exception);
-}
-/**
- * Initializes connections
- * @exception java.lang.Exception The exception description.
- */
-/* WARNING: THIS METHOD WILL BE REGENERATED. */
-private void initConnections() throws java.lang.Exception {
- // user code begin {1}
- // user code end
- this.addWindowListener(ivjEventHandler);
- getButton1().addActionListener(ivjEventHandler);
- getButton2().addActionListener(ivjEventHandler);
-}
-/**
- * Initialize the class.
- */
-/* WARNING: THIS METHOD WILL BE REGENERATED. */
-private void initialize() {
- try {
- // user code begin {1}
- // user code end
- setName("MessageDialog"); //$NON-NLS-1$
- setLayout(new java.awt.BorderLayout());
- setSize(426, 240);
- add(getContentsPane(), "Center"); //$NON-NLS-1$
- initConnections();
- } catch (java.lang.Throwable ivjExc) {
- handleException(ivjExc);
- }
- // user code begin {2}
- // user code end
-}
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/ProxyRemoteMessages.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/ProxyRemoteMessages.java
deleted file mode 100644
index 68ddb07ef..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/ProxyRemoteMessages.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 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.jem.internal.proxy.remote;
-
-import org.eclipse.osgi.util.NLS;
-
-public final class ProxyRemoteMessages extends NLS {
-
- private static final String BUNDLE_NAME = "org.eclipse.jem.internal.proxy.remote.messages";//$NON-NLS-1$
-
- private ProxyRemoteMessages() {
- // Do not instantiate
- }
-
- public static String NO_OUTPUT_FOLDER_EXC_;
- public static String VM_COMMAND_LINE;
- public static String VM_TERMINATED_INFO_;
- public static String VM_TERMINATED_LINE1;
- public static String VM_TERMINATED_LINE2;
- public static String VM_TERMINATED_LINE3;
- public static String REMOTE_VM_TRACE_INFO_;
- public static String REMOTE_VM_LOCAL_TRACE_INFO_;
- public static String Classcast_EXC_;
- public static String Instantiate_EXC_;
- public static String RemoteCmd_EXC_;
- public static String ExceptionErrorMsg_EXC_;
- public static String OK_7;
- public static String Proxy_NoRunner_ERROR_;
- public static String Proxy_Error_Title;
- public static String Proxy_Terminated_too_soon_ERROR_;
- public static String ProxyRemoteVMName;
- public static String ProxyRemoteVMNameWithComment;
- public static String ProxyRemoteNoLaunchKey;
- public static String ProxyRemoteLaunchVM;
- public static String CleanupJob_title;
- public static String REMProxyFactoryRegistry_CallbackConnectionNotWorking_EXC_;
- public static String REMProxyFactoryRegistry_ConnectionCreationFailed_INFO_;
- public static String REMProxyFactoryRegistry_Job_TerminateProcess_Title;
- public static String REMProxyFactoryRegistry_CouldNotCreateSocketConnectionToRemoteVM_EXC_;
- public static String REMExpression_IOExceptionSeeLog_INFO_;
- public static String REMExpression_CommandExceptionSeeLog_INFO_;
- public static String LocalProxyLaunchDelegate_Monitor_PrintRemoteTrace_Text;
-
- static {
- NLS.initializeMessages(BUNDLE_NAME, ProxyRemoteMessages.class);
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/ProxyRemoteUtil.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/ProxyRemoteUtil.java
deleted file mode 100644
index 73eed8a0e..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/ProxyRemoteUtil.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-
-import org.eclipse.core.runtime.IPath;
-import org.osgi.framework.Bundle;
-
-import org.eclipse.jem.internal.proxy.core.IConfigurationContributionController;
-import org.eclipse.jem.internal.proxy.core.ProxyPlugin;
-
-
-public class ProxyRemoteUtil {
-
- // Debug options
- public static final String DEBUG_VM = "/remote/debug/debugvm", // Bring up debugger on remote vm's. //$NON-NLS-1$
- IO_CONSOLE = "/remote/debug/ioconsole", // IO Through console (system in and out) for asking questions. //$NON-NLS-1$
- DEBUG_VM_TRACEOUT = "/remote/debug/vmtraceout", // Trace the output from the remote vm's. //$NON-NLS-1$
- NO_TIMEOUTS = "/remote/debug/notimeouts"; // No socket timeouts when talking to remote vm. Turn this on when doing callback testing. Not needed otherwise. //$NON-NLS-1$
-
- private static REMRegistryController pluginRegistryController;
-
- /**
- * Return the registry controller.
- */
- public synchronized static REMRegistryController getRegistryController() {
- return pluginRegistryController != null ? pluginRegistryController : (pluginRegistryController = new REMRegistryController());
- }
-
- /**
- * Method to update any class paths with any
- * paths that need to be added to a VM. In this case, it is
- * the remotevm.jar and the remotecommon.jar that need to be added. The first jar contains
- * the code necessary to run the remote vm and listen for commands. The second jar contains
- * the common code that is required to be shared on both the IDE side and remote side. It
- * is the interface code so that they both talk the same language.
- * support.
- */
- public static void updateClassPaths(IConfigurationContributionController controller) {
- Bundle proxyBundle = ProxyPlugin.getPlugin().getBundle();
- // Need to have our jars at the beginning. (Struts causes a problem because
- // they have a jar (commons-fileupload.jar) that if when searching for a class and
- // this jar is reached, it causes the class loader to barf. Our jars used to be at
- // the end, and so it found the fileupload jar first and no remote vm could be started
- // because of this.
- controller.contributeClasspath(proxyBundle, (IPath) null, IConfigurationContributionController.PREPEND_USER_CLASSPATH, false); //$NON-NLS-1$
- controller.contributeClasspath(proxyBundle, "vm/remotevm.jar", IConfigurationContributionController.PREPEND_USER_CLASSPATH, false); //$NON-NLS-1$
- }
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMAbstractBeanProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMAbstractBeanProxy.java
deleted file mode 100644
index 9ada5230b..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMAbstractBeanProxy.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-
-import org.eclipse.jem.internal.proxy.core.*;
-import org.eclipse.jem.internal.proxy.common.remote.*;
-/**
- * An abstract base class of IREMBeanProxy that doesn't
- * have the bean type stored in it. The subclasses will
- * supply it. It does however have an ID because it does
- * exist over on the remote VM.
- */
-public abstract class REMAbstractBeanProxy implements IREMBeanProxy {
- protected final REMProxyFactoryRegistry fFactory;
- private Integer fID;
-
- /**
- * Set the bean we are proxying. We are a proxy for a bean running on the remote VM.
- */
- protected REMAbstractBeanProxy(REMProxyFactoryRegistry aRegistry, Integer anID){
- fFactory = aRegistry;
- fID = anID;
- }
-
- /**
- * equals: Equal if:
- * 1) This proxy == (identity) to the other object
- * 2) Else if other is an IBeanProxy and not a constant one, then if
- * equals on the server.
- * 3) If this is a constant proxy and the other is too or is a constant
- * value (e.g. IStringBeanProxy.equals(String), then true if values are equals.
- */
- public boolean equals(Object anObject) {
- if (super.equals(anObject))
- return true; // Identity
- if (anObject instanceof IBeanProxy && !(anObject instanceof IREMConstantBeanProxy) && fFactory.isValid() && ((IBeanProxy) anObject).getProxyFactoryRegistry() == fFactory)
- try {
- // The other is a bean proxy and is not a constant one, let the server do the check.
- return ((IBooleanBeanProxy) REMStandardBeanProxyConstants.getConstants(fFactory).getObjectEquals().invoke(this, (IBeanProxy) anObject)).booleanValue();
- } catch (ThrowableProxy e) {
- }
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IBeanProxy#sameAs(org.eclipse.jem.internal.proxy.core.IBeanProxy)
- */
- public boolean sameAs(IBeanProxy aBeanProxy) {
- return this == aBeanProxy; // We can be assured in Remote Proxy that identity of proxy and identity of object are the same.
- }
-
- public ProxyFactoryRegistry getProxyFactoryRegistry() {
- return fFactory;
- }
-
- /**
- * Get ID. An internal method to be used only within the ProxyFactory family.
- */
- public Integer getID() {
- return fID;
- }
-
- /**
- * isValid.
- */
- public boolean isValid() {
- return fID != null;
- }
-
- /**
- * Proxy is about to be released, MUST mark it invalid.
- * This is required. Resources can also be cleaned up
- * if they are being held and need to be cleaned up.
- *
- * NOTE: This method will only be called when the proxy
- * is explicitly released. If it is simply garbage collected,
- * then this method will not be called. Simple garbage collection
- * means that no one is referencing this proxy. The proxy factory
- * will know what id this proxy was referencing and will release it
- * on the server at GC time.
- *
- * If there are resources
- * that absolutely must be released, then the finalize method
- * should be implemented to do the clean up. However, try not
- * to have this be the case. Finalize methods add overhead that is
- * usually better not to have. The better way is for any users
- * that get this kind of proxy object know to call release on
- * ProxyFactoryRegistry to release it before garbage collection.
- */
- public void release() {
- fID = null;
- }
-
- /**
- * Return the toString of the actual bean on the remote side.
- */
- public String toBeanString() {
- IStringBeanProxy string = (IStringBeanProxy) REMStandardBeanProxyConstants.getConstants(fFactory).getObjectToString().invokeCatchThrowableExceptions(this);
- return (string != null) ? string.stringValue() : null;
- }
-
- /**
- * Render the bean proxy into the value field.
- */
- public void renderBean(Commands.ValueObject value) {
- value.setObjectID(isValid() ? getID().intValue() : Commands.VOID); // No longer exists, so send over null.
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IProxy#isBeanProxy()
- */
- public final boolean isBeanProxy() {
- return true;
- }
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IProxy#isExpressionProxy()
- */
- public final boolean isExpressionProxy() {
- return false;
- }
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMAbstractBeanTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMAbstractBeanTypeProxy.java
deleted file mode 100644
index dd09366b9..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMAbstractBeanTypeProxy.java
+++ /dev/null
@@ -1,703 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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.jem.internal.proxy.remote;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-
-import org.eclipse.jem.internal.proxy.core.*;
-import org.eclipse.jem.internal.proxy.common.AmbiguousMethodException;
-import org.eclipse.jem.internal.proxy.common.CommandException;
-import org.eclipse.jem.internal.proxy.common.remote.Commands;
-import org.eclipse.jem.internal.proxy.common.remote.TransmitableArray;
-
-/**
- * This implementation of IBeanTypeProxy is for where the Bean is on a different VM then the IDE
- *
- * Creation date: (12/3/99 12:29:26 PM)
- *
- * @author: Joe Winchester
- */
-public abstract class REMAbstractBeanTypeProxy implements IREMBeanTypeProxy {
-
- private Integer fID;
-
- protected final REMProxyFactoryRegistry fRegistry;
-
- protected final String fClassname; // This is cached here so that we don't need to go over the line to get it.
-
- private IBeanTypeProxy fSuperType; // This is cached so as not to have to go over the line for it.
-
- /**
- * Create with a registry and a class. It is protected so that only subclasses and the factory with this REM package can call it.
- */
- protected REMAbstractBeanTypeProxy(REMProxyFactoryRegistry aRegistry, Integer anID, String aClassname, IBeanTypeProxy aSuperType) {
- fRegistry = aRegistry;
- fID = anID;
- fClassname = aClassname;
- fSuperType = aSuperType;
- }
-
- /**
- * equals: Equal if: 1) This proxy == (identity) to the other object This is all that is needed for BeanTypes because we know these are classes,
- * there is only one per class, and Class equals is true only for identity.
- */
- public boolean equals(Object anObject) {
- return super.equals(anObject);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanProxy#sameAs(org.eclipse.jem.internal.proxy.core.IBeanProxy)
- */
- public boolean sameAs(IBeanProxy aBeanProxy) {
- return this == aBeanProxy; // We can be assured in Remote Proxy that identity of proxy and identity of object are the same.
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.remote.IREMBeanProxy#getID()
- */
- public Integer getID() {
- return fID;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanProxy#isValid()
- */
- public boolean isValid() {
- return fID != null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.remote.IREMBeanProxy#release()
- */
- public void release() {
- // Clear the id and supertype (supertype is cleared so that
- // it won't hold onto it and will let the supertype be GC'd
- // if necessary.
-
- fID = null;
- fSuperType = null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getConstructorProxy(java.lang.String[])
- */
- public IConstructorProxy getConstructorProxy(String[] argumentClassNames) {
- if (isInterface())
- return null; // Interfaces don't have ctor's.
-
- // Turn class names into array of BeanTypes.
- IBeanTypeProxy[] argTypes = null;
- if (argumentClassNames != null) {
- IStandardBeanTypeProxyFactory typeFactory = fRegistry.getBeanTypeProxyFactory();
- argTypes = new IBeanTypeProxy[argumentClassNames.length];
- for (int i = 0; i < argumentClassNames.length; i++) {
- IBeanTypeProxy type = argTypes[i] = typeFactory.getBeanTypeProxy(argumentClassNames[i]);
- if (type == null)
- return null; // Couldn't find the type.
- }
- }
-
- return getConstructorProxy(argTypes);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getConstructorProxy(org.eclipse.jem.internal.proxy.core.IBeanTypeProxy[])
- */
- public IConstructorProxy getConstructorProxy(IBeanTypeProxy[] argumentTypes) {
- if (isInterface())
- return null; // Interfaces don't have ctor's.
-
- IREMMethodProxy getCtorMethod = (IREMMethodProxy) REMStandardBeanProxyConstants.getConstants(fRegistry).getClassConstructor();
-
- // Create the argument array
- Object[] getParms = (argumentTypes != null) ? new Object[] { new TransmitableArray(Commands.CLASS_CLASS, argumentTypes)} : // Get Ctor has
- // only one parm,
- // the array of
- // parm types.
- null;
-
- try {
- return (IConstructorProxy) getCtorMethod.invokeWithParms(this, getParms);
- } catch (ThrowableProxy e) {
- fRegistry.releaseProxy(e);
- return null;
- }
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getConstructors()
- */
- public IConstructorProxy[] getConstructors() {
-
- if (isInterface())
- return null; // Interfaces don't have ctor's.
-
- IREMMethodProxy getCtorMethod = (IREMMethodProxy) REMStandardBeanProxyConstants.getConstants(fRegistry).getClassConstructors();
-
- try {
- IArrayBeanProxy ctors = (IArrayBeanProxy) getCtorMethod.invokeWithParms(this, null);
- IBeanProxy[] proxies = ctors.getSnapshot();
- IConstructorProxy[] ctorproxies = new IConstructorProxy[proxies.length];
- System.arraycopy(proxies, 0, ctorproxies, 0, proxies.length);
- return ctorproxies;
- } catch (ThrowableProxy e) {
- fRegistry.releaseProxy(e);
- return null;
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getConstructorProxy(java.lang.String[])
- */
- public IConstructorProxy getDeclaredConstructorProxy(String[] argumentClassNames) {
- if (isInterface())
- return null; // Interfaces don't have ctor's.
-
- // Turn class names into array of BeanTypes.
- IBeanTypeProxy[] argTypes = null;
- if (argumentClassNames != null) {
- IStandardBeanTypeProxyFactory typeFactory = fRegistry.getBeanTypeProxyFactory();
- argTypes = new IBeanTypeProxy[argumentClassNames.length];
- for (int i = 0; i < argumentClassNames.length; i++) {
- IBeanTypeProxy type = argTypes[i] = typeFactory.getBeanTypeProxy(argumentClassNames[i]);
- if (type == null)
- return null; // Couldn't find the type.
- }
- }
-
- return getDeclaredConstructorProxy(argTypes);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getConstructorProxy(org.eclipse.jem.internal.proxy.core.IBeanTypeProxy[])
- */
- public IConstructorProxy getDeclaredConstructorProxy(IBeanTypeProxy[] argumentTypes) {
- if (isInterface())
- return null; // Interfaces don't have ctor's.
-
- IREMMethodProxy getCtorMethod = (IREMMethodProxy) REMStandardBeanProxyConstants.getConstants(fRegistry).getDeclaredClassConstructor();
-
- // Create the argument array
- Object[] getParms = (argumentTypes != null) ? new Object[] { new TransmitableArray(Commands.CLASS_CLASS, argumentTypes)} : // Get Ctor has
- // only one parm,
- // the array of
- // parm types.
- null;
-
- try {
- return (IConstructorProxy) getCtorMethod.invokeWithParms(this, getParms);
- } catch (ThrowableProxy e) {
- fRegistry.releaseProxy(e);
- return null;
- }
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getConstructors()
- */
- public IConstructorProxy[] getDeclaredConstructors() {
-
- if (isInterface())
- return null; // Interfaces don't have ctor's.
-
- IREMMethodProxy getCtorMethod = (IREMMethodProxy) REMStandardBeanProxyConstants.getConstants(fRegistry).getDeclaredClassConstructors();
-
- try {
- IArrayBeanProxy ctors = (IArrayBeanProxy) getCtorMethod.invokeWithParms(this, null);
- IBeanProxy[] proxies = ctors.getSnapshot();
- IConstructorProxy[] ctorproxies = new IConstructorProxy[proxies.length];
- System.arraycopy(proxies, 0, ctorproxies, 0, proxies.length);
- return ctorproxies;
- } catch (ThrowableProxy e) {
- fRegistry.releaseProxy(e);
- return null;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getConstructors()
- */
- public IFieldProxy[] getFields() {
-
- IREMMethodProxy getFieldsMethod = (IREMMethodProxy) REMStandardBeanProxyConstants.getConstants(fRegistry).getClassGetFields();
-
- try {
- IArrayBeanProxy fields = (IArrayBeanProxy) getFieldsMethod.invokeWithParms(this, null);
- IBeanProxy[] proxies = fields.getSnapshot();
- IFieldProxy[] fieldProxies = new IFieldProxy[proxies.length];
- System.arraycopy(proxies, 0, fieldProxies, 0, proxies.length);
- return fieldProxies;
- } catch (ThrowableProxy e) {
- fRegistry.releaseProxy(e);
- return null;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getConstructors()
- */
- public IFieldProxy[] getDeclaredFields() {
-
- IREMMethodProxy getDeclaredFieldsMethod = (IREMMethodProxy) REMStandardBeanProxyConstants.getConstants(fRegistry).getClassGetDeclaredFields();
-
- try {
- IArrayBeanProxy fields = (IArrayBeanProxy) getDeclaredFieldsMethod.invokeWithParms(this, null);
- IBeanProxy[] proxies = fields.getSnapshot();
- IFieldProxy[] fieldProxies = new IFieldProxy[proxies.length];
- System.arraycopy(proxies, 0, fieldProxies, 0, proxies.length);
- return fieldProxies;
- } catch (ThrowableProxy e) {
- fRegistry.releaseProxy(e);
- return null;
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getDeclaredFieldProxy(java.lang.String)
- */
- public IFieldProxy getDeclaredFieldProxy(String fieldName) {
- return (IFieldProxy) REMStandardBeanProxyConstants.getConstants(fRegistry).getClassGetDeclaredField().invokeCatchThrowableExceptions(this,
- fRegistry.getBeanProxyFactory().createBeanProxyWith(fieldName));
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getFieldProxy(java.lang.String)
- */
- public IFieldProxy getFieldProxy(String fieldName) {
- return ((REMStandardBeanTypeProxyFactory) fRegistry.getBeanTypeProxyFactory()).proxyConstants.getFieldProxy(this,fieldName);
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IProxyBeanType#getFieldProxy(org.eclipse.jem.internal.proxy.core.IExpression, java.lang.String)
- */
- public IProxyField getFieldProxy(IExpression expression, String fieldName) {
- REMProxyFactoryRegistry registry = (REMProxyFactoryRegistry) expression.getRegistry();
- return ((REMMethodProxyFactory) registry.getMethodProxyFactory()).getFieldProxy(expression, this, fieldName);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getConstructors()
- */
- public IMethodProxy[] getMethods() {
-
- IREMMethodProxy getMethodsMethod = (IREMMethodProxy) REMStandardBeanProxyConstants.getConstants(fRegistry).getClassMethods();
-
- try {
- IArrayBeanProxy methods = (IArrayBeanProxy) getMethodsMethod.invokeWithParms(this, null);
- IBeanProxy[] proxies = methods.getSnapshot();
- IMethodProxy[] methodProxies = new IMethodProxy[proxies.length];
- System.arraycopy(proxies, 0, methodProxies, 0, proxies.length);
- return methodProxies;
- } catch (ThrowableProxy e) {
- fRegistry.releaseProxy(e);
- return null;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getConstructors()
- */
- public IMethodProxy[] getDeclaredMethods() {
-
- IREMMethodProxy getDeclaredMethodsMethod = (IREMMethodProxy) REMStandardBeanProxyConstants.getConstants(fRegistry).getClassDeclaredMethods();
-
- try {
- IArrayBeanProxy methods = (IArrayBeanProxy) getDeclaredMethodsMethod.invokeWithParms(this, null);
- IBeanProxy[] proxies = methods.getSnapshot();
- IMethodProxy[] methodProxies = new IMethodProxy[proxies.length];
- System.arraycopy(proxies, 0, methodProxies, 0, proxies.length);
- return methodProxies;
- } catch (ThrowableProxy e) {
- fRegistry.releaseProxy(e);
- return null;
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getMethodProxy(java.lang.String)
- */
- public IMethodProxy getMethodProxy(String methodName) {
- return ((REMStandardBeanTypeProxyFactory) fRegistry.getBeanTypeProxyFactory()).proxyConstants.getMethodProxy(this,methodName,(String[])null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getMethodProxy(java.lang.String, java.lang.String[])
- */
- public IMethodProxy getMethodProxy(String methodName, String[] argumentClassNames) {
- return ((REMStandardBeanTypeProxyFactory) fRegistry.getBeanTypeProxyFactory()).proxyConstants.getMethodProxy(this,methodName,argumentClassNames);
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IProxyBeanType#getMethodProxy(org.eclipse.jem.internal.proxy.core.IExpression, java.lang.String, org.eclipse.jem.internal.proxy.core.IProxyBeanType[])
- */
- public IProxyMethod getMethodProxy(IExpression expression, String methodName, IProxyBeanType[] parameterTypes) {
- REMProxyFactoryRegistry registry = (REMProxyFactoryRegistry) expression.getRegistry();
- return ((REMMethodProxyFactory) registry.getMethodProxyFactory()).getMethodProxy(expression, this, methodName, parameterTypes);
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IProxyBeanType#getMethodProxy(org.eclipse.jem.internal.proxy.core.IExpression, java.lang.String, java.lang.String[])
- */
- public IProxyMethod getMethodProxy(IExpression expression, String methodName, String[] parameterTypes) {
- REMProxyFactoryRegistry registry = (REMProxyFactoryRegistry) expression.getRegistry();
- return ((REMMethodProxyFactory) registry.getMethodProxyFactory()).getMethodProxy(expression, this, methodName, parameterTypes);
- }
-
- public IProxyMethod getMethodProxy(IExpression expression, String methodName) {
- return getMethodProxy(expression, methodName, (IProxyBeanType[]) null);
- }
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getMethodProxy(java.lang.String, java.lang.String)
- */
- public IMethodProxy getMethodProxy(String methodName, String argumentQualifiedTypeName) {
- return ((REMStandardBeanTypeProxyFactory) fRegistry.getBeanTypeProxyFactory()).proxyConstants.getMethodProxy(this,methodName,new String[] {argumentQualifiedTypeName});
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getMethodProxy(java.lang.String, org.eclipse.jem.internal.proxy.core.IBeanTypeProxy[])
- */
- public IMethodProxy getMethodProxy(String methodName, IBeanTypeProxy[] argumentTypes) {
- return ((REMStandardBeanTypeProxyFactory) fRegistry.getBeanTypeProxyFactory()).proxyConstants.getMethodProxy(this,methodName,argumentTypes);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getConstructorProxy(java.lang.String[])
- */
- public IMethodProxy getDeclaredMethodProxy(String methodName, String[] argumentClassNames) {
-
- // Turn class names into array of BeanTypes.
- IBeanTypeProxy[] argTypes = null;
- if (argumentClassNames != null) {
- IStandardBeanTypeProxyFactory typeFactory = fRegistry.getBeanTypeProxyFactory();
- argTypes = new IBeanTypeProxy[argumentClassNames.length];
- for (int i = 0; i < argumentClassNames.length; i++) {
- IBeanTypeProxy type = argTypes[i] = typeFactory.getBeanTypeProxy(argumentClassNames[i]);
- if (type == null)
- return null; // Couldn't find the type.
- }
- }
-
- return getDeclaredMethodProxy(methodName, argTypes);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getConstructorProxy(org.eclipse.jem.internal.proxy.core.IBeanTypeProxy[])
- */
- public IMethodProxy getDeclaredMethodProxy(String methodName, IBeanTypeProxy[] argumentTypes) {
- IREMMethodProxy getDeclaredMethodMethod = (IREMMethodProxy) REMStandardBeanProxyConstants.getConstants(fRegistry).getClassDeclaredMethod();
- IBeanProxy nameProxy = fRegistry.getBeanProxyFactory().createBeanProxyWith(methodName);
- // Create the argument array
- Object[] getParms = (argumentTypes != null) ? new Object[] { nameProxy, new TransmitableArray(Commands.CLASS_CLASS, argumentTypes)} : new Object[] {nameProxy, null};
-
- try {
- return (IMethodProxy) getDeclaredMethodMethod.invokeWithParms(this, getParms);
- } catch (ThrowableProxy e) {
- fRegistry.releaseProxy(e);
- return null;
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getInvokable(java.lang.String)
- */
- public IInvokable getInvokable(String methodName) {
- return ((REMStandardBeanTypeProxyFactory) fRegistry.getBeanTypeProxyFactory()).proxyConstants.getInvokable(this,methodName,(String[])null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getInvokable(java.lang.String, java.lang.String[])
- */
- public IInvokable getInvokable(String methodName, String[] argumentClassNames) {
- return ((REMStandardBeanTypeProxyFactory) fRegistry.getBeanTypeProxyFactory()).proxyConstants.getInvokable(this,methodName,argumentClassNames);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getInvokable(java.lang.String, java.lang.String)
- */
- public IInvokable getInvokable(String methodName, String argumentQualifiedTypeName) {
- return getInvokable(methodName, new String[] { argumentQualifiedTypeName});
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getInvokable(java.lang.String, org.eclipse.jem.internal.proxy.core.IBeanTypeProxy[])
- */
- public IInvokable getInvokable(String methodName, IBeanTypeProxy[] argumentTypes) {
- return ((REMStandardBeanTypeProxyFactory) fRegistry.getBeanTypeProxyFactory()).proxyConstants.getInvokable(this,methodName,argumentTypes);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getNullConstructorProxy()
- */
- public IConstructorProxy getNullConstructorProxy() {
- return getConstructorProxy((IBeanTypeProxy[]) null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanProxy#getProxyFactoryRegistry()
- */
- public ProxyFactoryRegistry getProxyFactoryRegistry() {
- return fRegistry;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getSuperBeanTypeProxy()
- */
- public IBeanTypeProxy getSuperBeanTypeProxy() {
- return fSuperType;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getTypeName()
- */
- public String getTypeName() {
- return fClassname;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#isArray()
- */
- public boolean isArray() {
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#isInterface()
- */
- public boolean isInterface() {
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#isPrimitive()
- */
- public boolean isPrimitive() {
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#isKindOf(org.eclipse.jem.internal.proxy.core.IBeanTypeProxy)
- */
- public boolean isKindOf(IBeanTypeProxy aBeanProxyType) {
- return ((IBooleanBeanProxy) REMStandardBeanProxyConstants.getConstants(fRegistry).getClassIsAssignableFrom().invokeCatchThrowableExceptions(
- aBeanProxyType, this)).booleanValue();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#newInstance(java.lang.String)
- */
- public IBeanProxy newInstance(String initializationString) throws ThrowableProxy, ClassCastException, InstantiationException {
- try {
- return ((REMStandardBeanProxyFactory) fRegistry.getBeanProxyFactory()).createBeanProxy(this, initializationString);
- } catch (CommandException e) {
- ProxyPlugin.getPlugin().getLogger().log(new Status(IStatus.WARNING, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "", e)); //$NON-NLS-1$
- return null;
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#toString()
- */
- public String toString() {
- return super.toString() + "(" + getTypeName() + ")"; //$NON-NLS-2$//$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanProxy#getTypeProxy()
- */
- public IBeanTypeProxy getTypeProxy() {
- return ((REMStandardBeanTypeProxyFactory) fRegistry.getBeanTypeProxyFactory()).classClass;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanProxy#toBeanString()
- */
- public String toBeanString() {
- return getTypeName();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#newInstance()
- */
- public IBeanProxy newInstance() throws ThrowableProxy {
- return ((REMStandardBeanProxyFactory) fRegistry.getBeanProxyFactory()).createBeanProxy(this);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.remote.IREMBeanProxy#renderBean(org.eclipse.jem.internal.proxy.common.remote.Commands.ValueObject)
- */
- public void renderBean(Commands.ValueObject value) {
- value.setObjectID(getID().intValue());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getFormalTypeName()
- */
- public String getFormalTypeName() {
- return getTypeName();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getInitializationError()
- */
- public String getInitializationError() {
- return null; // By default none have an initialization error. There is a special instance for init errors.
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getCompatibleConstructor(org.eclipse.jem.internal.proxy.core.IBeanTypeProxy[])
- */
- public IConstructorProxy getCompatibleConstructor(IBeanTypeProxy[] argumentTypes) throws NoSuchMethodException, AmbiguousMethodException, IllegalAccessException {
- if (isInterface())
- return null; // Interfaces don't have ctor's.
-
- IREMMethodProxy findCompatibleMethod = (IREMMethodProxy) REMStandardBeanProxyConstants.getConstants(fRegistry).getFindCompatibleConstructorMethod();
-
- // Create the argument array
- Object[] getParms = (argumentTypes != null) ? new Object[] { this, new TransmitableArray(Commands.CLASS_CLASS, argumentTypes)} : new Object[] {this, null};
-
- try {
- return (IConstructorProxy) findCompatibleMethod.invokeWithParms(this, getParms);
- } catch (ThrowableProxy e) {
- try {
- if (e.getTypeProxy().equals(fRegistry.getBeanTypeProxyFactory().getBeanTypeProxy("java.lang.NoSuchMethodException"))) //$NON-NLS-1$
- throw new NoSuchMethodException(e.getProxyLocalizedMessage());
- else if (e.getTypeProxy().equals(fRegistry.getBeanTypeProxyFactory().getBeanTypeProxy("org.eclipse.jem.internal.proxy.common.AmbiguousMethodException"))) //$NON-NLS-1$
- throw new AmbiguousMethodException(e.getProxyLocalizedMessage());
- else if (e.getTypeProxy().equals(fRegistry.getBeanTypeProxyFactory().getBeanTypeProxy("java.lang.IllegalAccessException"))) //$NON-NLS-1$
- throw new IllegalAccessException(e.getProxyLocalizedMessage());
- ProxyPlugin.getPlugin().getLogger().log(e);
- return null;
- } finally {
- fRegistry.releaseProxy(e);
- }
- }
- }
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getCompatibleMethod(java.lang.String, org.eclipse.jem.internal.proxy.core.IBeanTypeProxy[])
- */
- public IMethodProxy getCompatibleMethod(String methodName, IBeanTypeProxy[] argumentTypes) throws NoSuchMethodException, AmbiguousMethodException {
-
- IREMMethodProxy findCompatibleMethod = (IREMMethodProxy) REMStandardBeanProxyConstants.getConstants(fRegistry).getFindCompatibleMethodMethod();
- IBeanProxy methodNameProxy = fRegistry.getBeanProxyFactory().createBeanProxyWith(methodName);
-
- // Create the argument array
- Object[] getParms = (argumentTypes != null) ? new Object[] { this, methodNameProxy, new TransmitableArray(Commands.CLASS_CLASS, argumentTypes)} : new Object[] {this, methodNameProxy, null};
-
- try {
- return (IMethodProxy) findCompatibleMethod.invokeWithParms(this, getParms);
- } catch (ThrowableProxy e) {
- try {
- if (e.getTypeProxy().equals(fRegistry.getBeanTypeProxyFactory().getBeanTypeProxy("java.lang.NoSuchMethodException"))) //$NON-NLS-1$
- throw new NoSuchMethodException(e.getProxyLocalizedMessage());
- else if (e.getTypeProxy().equals(fRegistry.getBeanTypeProxyFactory().getBeanTypeProxy("org.eclipse.jem.internal.proxy.common.AmbiguousMethodException"))) //$NON-NLS-1$
- throw new AmbiguousMethodException(e.getProxyLocalizedMessage());
- ProxyPlugin.getPlugin().getLogger().log(e);
- return null;
- } finally {
- fRegistry.releaseProxy(e);
- }
- }
- }
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IProxy#isBeanProxy()
- */
- public final boolean isBeanProxy() {
- return true;
- }
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IProxy#isExpressionProxy()
- */
- public final boolean isExpressionProxy() {
- return false;
- }
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMAbstractNumberBeanTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMAbstractNumberBeanTypeProxy.java
deleted file mode 100644
index 73a318b69..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMAbstractNumberBeanTypeProxy.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-
-import org.eclipse.jem.internal.proxy.core.*;
-
-/**
- * Abstract class for any of the number bean type subclasses.
- * NOTE: This does not represent the beantype Number. It is a
- * class that provides functions for Number subclass beantypes.
- * The Number beantype itself is simply a REMBeanTypeProxy since
- * Number is abstract and has no necessary extra function.
- * Creation date: (08/31/00 11:49:12 AM)
- * @author: Administrator
- */
-public abstract class REMAbstractNumberBeanTypeProxy extends REMAbstractBeanTypeProxy implements IREMConstantBeanTypeProxy {
-
-protected REMAbstractNumberBeanTypeProxy(REMProxyFactoryRegistry aRegistry, Integer anID, String aClassname, IBeanTypeProxy aSuperType) {
- super(aRegistry, anID, aClassname, aSuperType);
-}
-/**
- * Helper to create a bean proxy
- * protected because everyone should go through the factory API
- * that is defined as part of IBeanProxyFactory
- */
-protected abstract INumberBeanProxy createNumberBeanProxy(Number aNumber);
-
-/**
- * Create a new bean proxy with the specified id.
- *
- * For all of the Number types, this is an invalid operation. They are created
- * explicitly through the appropriate create method.
- */
-public IREMBeanProxy newBeanProxy(Integer anID) {
- throw new UnsupportedOperationException();
-}
-
-/**
- * newBeanTypeForClass: Create a new beantypeproxy of this kind for the given class.
- * This is used by beantype proxy factory when creating a beantype proxy for a subclass.
- * This is because subclasses, unless explicitly overridden, should use the same kind
- * of beantype proxy. This way if anything special is needed for a specific type, then
- * that can be done.
- *
- * For all of the Number types, they are final classes, so you can't create a newBeanType
- * for subclasses.
- */
-public IREMBeanTypeProxy newBeanTypeForClass(Integer anID, String aClassname, boolean anAbstract) {
- throw new UnsupportedOperationException();
-}
-
-/**
- * newInstance method. Number's don't have a default ctor, so the standard way won't work.
- * Each beantype will return a default value (usually a value of 0).
- */
-public abstract IBeanProxy newInstance() throws ThrowableProxy;
-}
-
-
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMAccessibleObjectProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMAccessibleObjectProxy.java
deleted file mode 100644
index 8c2eb0047..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMAccessibleObjectProxy.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 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.jem.internal.proxy.remote;
-
-import org.eclipse.jem.internal.proxy.core.*;
-import org.eclipse.jem.internal.proxy.core.IAccessibleObjectProxy;
-import org.eclipse.jem.internal.proxy.core.ThrowableProxy;
-
-/**
- * AccessibleObject Proxy.
- *
- * @since 1.0.0
- */
-public class REMAccessibleObjectProxy extends REMAbstractBeanProxy implements IAccessibleObjectProxy {
-
- protected REMAccessibleObjectProxy(REMProxyFactoryRegistry aRegistry, Integer anID) {
- super(aRegistry, anID);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IAccessibleObjectProxy#isAccessible()
- */
- public boolean isAccessible() throws ThrowableProxy {
- return ((IBooleanBeanProxy) REMStandardBeanProxyConstants.getConstants(fFactory).getAccessibleIsAccessible().invoke(this)).booleanValue();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IAccessibleObjectProxy#setAccessible(boolean)
- */
- public void setAccessible(boolean flag) throws ThrowableProxy {
- REMStandardBeanProxyConstants.getConstants(fFactory).getAccessibleSetAccessible().invoke(this, fFactory.getBeanProxyFactory().createBeanProxyWith(flag));
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IBeanProxy#getTypeProxy()
- */
- public IBeanTypeProxy getTypeProxy() {
- return ((REMMethodProxyFactory) fFactory.getMethodProxyFactory()).accessibleType;
- }
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMAnAbstractBeanTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMAnAbstractBeanTypeProxy.java
deleted file mode 100644
index ce7fae116..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMAnAbstractBeanTypeProxy.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-
-import org.eclipse.jem.internal.proxy.core.*;
-
-/**
- * This is a proxy for an abstract bean type. I.e. you can't create a new instance of it.
- * It can be used as a general abstract type. It will pass newBeanTypeForClass unto
- * the main super type passed in.
- */
-
-public class REMAnAbstractBeanTypeProxy extends REMAbstractBeanTypeProxy {
-
- protected IREMSpecialBeanTypeProxy fMainSuperType; // The type that this was created from so that
- // any non-abstract subclasses can create the correct
- // type of beantype proxy.
-
- public REMAnAbstractBeanTypeProxy(REMProxyFactoryRegistry aRegistry, Integer anID, String aClassname, IBeanTypeProxy aSuperType, IREMSpecialBeanTypeProxy aType) {
- super(aRegistry, anID, aClassname, aSuperType);
- fMainSuperType = aType;
- }
-
- /**
- * Create a new bean proxy with the specified id.
- *
- * For all of the abstract types, this is an invalid operation.
- */
- public IREMBeanProxy newBeanProxy(Integer anID) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Note: Since new instances of abstract classes can never be done,
- * this function is not supported.
- */
- public IBeanProxy newInstance() {
- throw new UnsupportedOperationException();
- }
-
- /**
- * newBeanTypeForClass: Create a new beantypeproxy of this kind for the given class.
- * This is used by beantype proxy factory when creating a beantype proxy for a subclass.
- * This is because subclasses, unless explicitly overridden, should use the same kind
- * of beantype proxy. This way if anything special is needed for a specific type, then
- * that can be done.
- */
- public IREMBeanTypeProxy newBeanTypeForClass(Integer anID, String aClassname, boolean anAbstract) {
- return fMainSuperType.newBeanTypeForClass(anID, aClassname, anAbstract, this);
- }
-
- /**
- * release - BeanType is about to be released.
- * Clear the fMainSupertype (supertype is cleared so that
- * it won't hold onto it and will let the supertype be GC'd
- * if necessary.
- */
- public void release() {
- fMainSuperType = null;
- super.release();
- }
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMArrayBeanProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMArrayBeanProxy.java
deleted file mode 100644
index 2041d8a16..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMArrayBeanProxy.java
+++ /dev/null
@@ -1,268 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-import java.lang.reflect.Array;
-import java.util.logging.Level;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-
-import org.eclipse.jem.internal.proxy.common.CommandException;
-import org.eclipse.jem.internal.proxy.common.remote.CommandErrorException;
-import org.eclipse.jem.internal.proxy.common.remote.Commands;
-import org.eclipse.jem.internal.proxy.common.remote.Commands.ValueObject;
-import org.eclipse.jem.internal.proxy.core.*;
-/**
- * IDE VM version of the Array proxy
- */
-
-public final class REMArrayBeanProxy extends REMBeanProxy implements IArrayBeanProxy {
- private int fLength = -1;
-
- REMArrayBeanProxy(REMProxyFactoryRegistry aRegistry, Integer anID, IBeanTypeProxy aType) {
- super(aRegistry, anID, aType);
- }
-
- public boolean equals(Object anObject) {
- if (!(anObject instanceof IArrayBeanProxy))
- return false;
- if (sameAs((IBeanProxy) anObject))
- return true; // Identity
- if (((IBeanProxy) anObject).getProxyFactoryRegistry() == fFactory)
- try {
- // The other is an array also, let the server do the check. We will use Arrays.equals.
- return ((IBooleanBeanProxy) REMStandardBeanProxyConstants.getConstants(fFactory).getArrayHelperEquals().invoke(null, new IBeanProxy[] {this, (IBeanProxy) anObject})).booleanValue();
- } catch (ThrowableProxy e) {
- ProxyPlugin.getPlugin().getLogger().log(e, Level.INFO);
- }
- return false;
- }
-
- /**
- * Get the object at the specified index.
- */
- public IBeanProxy get(int index) throws ThrowableProxy {
- // Format of getter parms is: (Object (array), int (index)).
- Object[] parms = new Object[] {this, new Integer(index)};
- // If the component type is primitive, we need to use the correct getter so that a valid value is returned,
- // if we just used the standard get, if the type was "int" the value returned would be an java.lang.Integer.
- IBeanTypeProxy compType = ((IArrayBeanTypeProxy) getTypeProxy()).getComponentType();
- if (!compType.isPrimitive()) {
- // Use standard getter.
- return ((IREMMethodProxy) REMStandardBeanProxyConstants.getConstants(fFactory).getArrayGet()).invokeWithParms(null, parms);
- } else {
- // Use the correct primitive getter.
- int id = ((IREMBeanProxy) compType).getID().intValue();
- switch (id) {
- case Commands.BYTE_TYPE:
- return ((IREMMethodProxy) REMStandardBeanProxyConstants.getConstants(fFactory).getArrayGetByte()).invokeWithParms(null, parms);
- case Commands.BOOLEAN_TYPE:
- return ((IREMMethodProxy) REMStandardBeanProxyConstants.getConstants(fFactory).getArrayGetBoolean()).invokeWithParms(null, parms);
- case Commands.CHARACTER_TYPE:
- return ((IREMMethodProxy) REMStandardBeanProxyConstants.getConstants(fFactory).getArrayGetChar()).invokeWithParms(null, parms);
- case Commands.DOUBLE_TYPE:
- return ((IREMMethodProxy) REMStandardBeanProxyConstants.getConstants(fFactory).getArrayGetDouble()).invokeWithParms(null, parms);
- case Commands.FLOAT_TYPE:
- return ((IREMMethodProxy) REMStandardBeanProxyConstants.getConstants(fFactory).getArrayGetFloat()).invokeWithParms(null, parms);
- case Commands.INTEGER_TYPE:
- return ((IREMMethodProxy) REMStandardBeanProxyConstants.getConstants(fFactory).getArrayGetInt()).invokeWithParms(null, parms);
- case Commands.LONG_TYPE:
- return ((IREMMethodProxy) REMStandardBeanProxyConstants.getConstants(fFactory).getArrayGetLong()).invokeWithParms(null, parms);
- case Commands.SHORT_TYPE:
- return ((IREMMethodProxy) REMStandardBeanProxyConstants.getConstants(fFactory).getArrayGetShort()).invokeWithParms(null, parms);
- }
- }
-
- return null;
- }
-
- /**
- * Get the object at the specified multi-dimensional index.
- * The array must be at least the number of dimensions specified,
- * and each index along the way must exist.
- * The number of dimensions can't be greater than the number
- * of dimensions of the real object.
- */
- public IBeanProxy get(int [] indexes) throws ThrowableProxy {
- // Format of getter parms is: (Object (array), int[] (indexes)).
- Object[] parms = new Object[] {this, indexes};
- // If the component type at the specified dimension is primitive, we need to use the correct getter so that a valid value is returned,
- // if we just used the standard get, if the type was "int" the value returned would be an java.lang.Integer.
- int dims = ((IArrayBeanTypeProxy) getTypeProxy()).getDimensions();
- if (dims < indexes.length)
- throw new IllegalArgumentException(); // Too many dimensions
- IBeanTypeProxy finalCompType = ((IArrayBeanTypeProxy) getTypeProxy()).getFinalComponentType();
- if (dims == indexes.length && finalCompType.isPrimitive()) {
- // Use the correct primitive getter because we are accessing the final component and it is primitive.
- int id = ((IREMBeanProxy) finalCompType).getID().intValue();
- switch (id) {
- case Commands.BYTE_TYPE:
- return ((IREMMethodProxy) REMStandardBeanProxyConstants.getConstants(fFactory).getArrayHelperGetByte()).invokeWithParms(null, parms);
- case Commands.BOOLEAN_TYPE:
- return ((IREMMethodProxy) REMStandardBeanProxyConstants.getConstants(fFactory).getArrayHelperGetBoolean()).invokeWithParms(null, parms);
- case Commands.CHARACTER_TYPE:
- return ((IREMMethodProxy) REMStandardBeanProxyConstants.getConstants(fFactory).getArrayHelperGetChar()).invokeWithParms(null, parms);
- case Commands.DOUBLE_TYPE:
- return ((IREMMethodProxy) REMStandardBeanProxyConstants.getConstants(fFactory).getArrayHelperGetDouble()).invokeWithParms(null, parms);
- case Commands.FLOAT_TYPE:
- return ((IREMMethodProxy) REMStandardBeanProxyConstants.getConstants(fFactory).getArrayHelperGetFloat()).invokeWithParms(null, parms);
- case Commands.INTEGER_TYPE:
- return ((IREMMethodProxy) REMStandardBeanProxyConstants.getConstants(fFactory).getArrayHelperGetInt()).invokeWithParms(null, parms);
- case Commands.LONG_TYPE:
- return ((IREMMethodProxy) REMStandardBeanProxyConstants.getConstants(fFactory).getArrayHelperGetLong()).invokeWithParms(null, parms);
- case Commands.SHORT_TYPE:
- return ((IREMMethodProxy) REMStandardBeanProxyConstants.getConstants(fFactory).getArrayHelperGetShort()).invokeWithParms(null, parms);
- }
- } else {
- // It is not the final component, or it is not primitive, use the standard accessor.
- return ((IREMMethodProxy) REMStandardBeanProxyConstants.getConstants(fFactory).getArrayHelperGet()).invokeWithParms(null, parms);
- }
-
- return null;
- }
-
- /**
- * Set the object at the specified index.
- */
- public void set(IBeanProxy value, int index) throws ThrowableProxy {
- // Format of setter parms is: (Object (array), int (index), Object (value)).
- Object[] parms = new Object[] {this, new Integer(index), value};
- ((IREMMethodProxy) REMStandardBeanProxyConstants.getConstants(fFactory).getArraySet()).invokeWithParms(null, parms);
- }
-
- /**
- * Set the object at the specified multi-dimensional index.
- * The array must be at least the number of dimensions specified,
- * and each index along the way must exist.
- * The number of dimensions can't be greater than the number
- * of dimensions of the real object.
- */
- public void set(IBeanProxy value, int [] indexes) throws ThrowableProxy {
- // Format of setter parms is: (Object (array), int[] (indexes), Object (value)).
- Object[] parms = new Object[] {this, indexes, value};
- ((IREMMethodProxy) REMStandardBeanProxyConstants.getConstants(fFactory).getArrayHelperSet()).invokeWithParms(null, parms);
- }
-
- /**
- * Get the length of the first dimension of this array.
- * If there are multi-dimensions, you must get the appropriate
- * dimension from the get method to see the size of that dimension.
- *
- * e.g.
- * int [3] returns 3
- * int [3][2] returns 3
- *
- * ((IArrayBeanProxy) get(1)).getLength() returns 2
- * Since arrays do not have to be homogenous, there could
- * be a different length array for each of the arrays
- * returned from the first dimension, the returned length
- * from get(2) and get(3) could result in a different value
- * from get(1).
- */
- public int getLength() {
- if (fLength == -1) {
- // It hasn't yet been quiered.
- fLength = ((IIntegerBeanProxy) REMStandardBeanProxyConstants.getConstants(fFactory).getArrayGetLength().invokeCatchThrowableExceptions(null, this)).intValue();
- }
- return fLength;
- }
-
- public IBeanProxy getCatchThrowableException(int index){
- try {
- return get(index);
- } catch (ThrowableProxy e) {
- ProxyPlugin.getPlugin().getLogger().log(new Status(IStatus.WARNING, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "", e)); //$NON-NLS-1$
- fFactory.releaseProxy(e); // Since it's no longer needed, get rid of now instead of GC time.
- return null;
- }
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IArrayBeanProxy#getSnapshot()
- */
- public IBeanProxy[] getSnapshot() throws ThrowableProxy {
- IREMConnection connect = fFactory.getFreeConnection();
- REMStandardBeanProxyFactory proxyFactory = (REMStandardBeanProxyFactory) fFactory.getBeanProxyFactory();
- proxyFactory.startTransaction(); // This is definately a transaction, so start it.
- try {
- Commands.ValueObject returnValue = new Commands.ValueObject();
- try {
- try {
- connect.getArrayContents(getID().intValue(), returnValue);
- return processReturnValue(connect, returnValue);
- } catch (CommandErrorException e) {
- proxyFactory.processErrorReturn(e);
- }
- } catch (CommandException e) {
- if (!e.isRecoverable()) {
- // Close the connection and try again.
- fFactory.closeConnection(connect);
- connect = null;
- connect = fFactory.getFreeConnection();
- try {
- connect.getArrayContents(getID().intValue(), returnValue);
- return processReturnValue(connect, returnValue);
- } catch (CommandException eAgain) {
- // Failed again. Just close and print trace.
- fFactory.closeConnection(connect);
- connect = null;
- ProxyPlugin.getPlugin().getLogger().log(new Status(IStatus.WARNING, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "", eAgain)); //$NON-NLS-1$
- return null;
- }
- } else {
- // A recoverable error, print trace and return
- ProxyPlugin.getPlugin().getLogger().log(new Status(IStatus.WARNING, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "", e)); //$NON-NLS-1$
- return null;
- }
- }
- } finally {
- proxyFactory.stopTransaction();
- if (connect != null)
- fFactory.returnConnection(connect);
- }
- return null;
- }
-
-
- /*
- * @param returnValue
- * @return
- *
- * @since 1.1.0
- */
- private IBeanProxy[] processReturnValue(IREMConnection connection, ValueObject returnValue) throws CommandException, ThrowableProxy {
- // It is an array containing IDs, as it normally would be.
- // However it will become IBeanProxy[]. That is because if ID's
- // they must be proxies over here.
- BeanProxyValueSender valueSender = new BeanProxyValueSender((REMStandardBeanProxyFactory) fFactory.getBeanProxyFactory(), returnValue);
- connection.readProxyArrayValues(returnValue, valueSender, false);
- Exception e = valueSender.getException();
- if (e != null) {
- if (e instanceof ThrowableProxy)
- throw (ThrowableProxy) e;
- else
- throw (CommandException) e;
- }
- Object vals = valueSender.getArray();
- IBeanProxy[] proxyArray = new IBeanProxy[Array.getLength(vals)];
- System.arraycopy(vals, 0, proxyArray, 0, proxyArray.length);
- return proxyArray;
- }
-
-}
-
-
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMArrayBeanTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMArrayBeanTypeProxy.java
deleted file mode 100644
index ca4f3a95a..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMArrayBeanTypeProxy.java
+++ /dev/null
@@ -1,340 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-
-
-import org.eclipse.jem.internal.proxy.common.MapTypes;
-import org.eclipse.jem.internal.proxy.core.*;
-/**
- * Array Type Proxy for the IDE VM.
- *
- * The class is final because array's are special and shouldn't have
- * any subclasses since the factory would never call it.
- */
-
-public final class REMArrayBeanTypeProxy extends REMAbstractBeanTypeProxy implements IArrayBeanTypeProxy {
-
- /**
- * Create with a registry and a class. It is package so that only
- * the factory with this IDE package can call it.
- */
- protected REMArrayBeanTypeProxy(REMProxyFactoryRegistry aRegistry, Integer anID, String aClassname, IBeanTypeProxy objectType) {
- super(aRegistry, anID, aClassname, objectType);
- }
- /**
- * This is an array type!
- */
- public boolean isArray() {
- return true;
- }
- /**
- * Return the final component type.
- */
- public IBeanTypeProxy getFinalComponentType() {
- // Component type is strip off all '[' and return class name (if we ever add classLoader support, this won't work).
- // However, if the type is a primitive we need to go through the change table).
- int typeStart = getTypeName().lastIndexOf('[')+1;
- if (getTypeName().charAt(typeStart) == 'L') {
- // It is a class.
- // Strip off up to the 'L', and the trailing ';'. That is the class name.
- return fRegistry.getBeanTypeProxyFactory().getBeanTypeProxy(getTypeName().substring(typeStart+1, getTypeName().length()-1));
- } else {
- // It is a type. Need to map it.
- Class aType = (Class) MapTypes.MAP_SHORTSIG_TO_TYPE.get(getTypeName().substring(typeStart, typeStart+1));
- return aType != null ? fRegistry.getBeanTypeProxyFactory().getBeanTypeProxy(aType.getName()) : null;
- }
- }
-
- /**
- * Return the component type.
- */
- public IBeanTypeProxy getComponentType() {
- // Component type is strip off first '[' and return class name (if we ever add classLoader support, this won't work).
- // However, if the type is a primitive we need to go through the change table).
- if (getTypeName().charAt(1) != '[') {
- // It is a one dimensional array, just send to getFinalComponentType to figure out the type.
- return getFinalComponentType();
- } else {
- // It is a multi-dimensional array. Just strip off one '[' and send that to the bean type factory.
- return fRegistry.getBeanTypeProxyFactory().getBeanTypeProxy(getTypeName().substring(1));
- }
- }
- /**
- * Return the number of dimensions.
- */
- public int getDimensions() {
- return getTypeName().lastIndexOf('[')+1;
- }
-
- /**
- * Create a new bean proxy with the specified object
- * Use the constructor that allows the type proxy to be set as well as the bean
- * because we are the type and by setting it now we might avoid it being lookup for in the
- * factory the first time it is asked for.
- */
- public IREMBeanProxy newBeanProxy(Integer anID) {
- return new REMArrayBeanProxy(fRegistry, anID, this);
- }
-
-
- /**
- * newBeanTypeForClass: Create a new beantypeproxy of this kind for the given class.
- * This is used by beantype proxy factory when creating a beantype proxy for a subclass.
- * This is because subclasses, unless explicitly overridden, should use the same kind
- * of beantype proxy. This way if anything special is needed for a specific type, then
- * that can be done.
- *
- * Arrays can't be subclassed.
- */
- public IREMBeanTypeProxy newBeanTypeForClass(Integer anID, String aClassname, boolean anAbstract) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Return the null ctor proxy for this method with these arguments.
- * For all of the array types, this is an invalid operation.
- */
- public IConstructorProxy getNullConstructorProxy() {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Return a proxy to the constructor for the target VM being the same as the REM
- * For all of the array types, this is an invalid operation.
- */
- public IConstructorProxy getConstructorProxy(String[] argumentClassNames) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Return a proxy to the constructor for the target VM being the same as the REM
- * For all of the array types, this is an invalid operation.
- */
- public IConstructorProxy getConstructorProxy(IBeanTypeProxy[] argumentTypes) {
- throw new UnsupportedOperationException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getConstructors()
- *
- * For all of the array types, this is an invalid operation.
- */
- public IConstructorProxy[] getConstructors() {
- throw new UnsupportedOperationException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getConstructors()
- *
- * For all of the array types, this is an invalid operation.
- */
- public IConstructorProxy[] getDeclaredConstructors() {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Return a proxy to the constructor for the target VM being the same as the REM
- * For all of the array types, this is an invalid operation.
- */
- public IConstructorProxy getDeclaredConstructorProxy(String[] argumentClassNames) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Return a proxy to the constructor for the target VM being the same as the REM
- * For all of the array types, this is an invalid operation.
- */
- public IConstructorProxy getDeclaredConstructorProxy(IBeanTypeProxy[] argumentTypes) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Return a proxy to the field for the target VM being the same as the REM
- * For all of the array types, this is an invalid operation.
- */
- public IFieldProxy getFieldProxy(String fieldName) {
- throw new UnsupportedOperationException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getConstructors()
- *
- * For all of the array types, this is an invalid operation.
- */
- public IFieldProxy[] getFields() {
- throw new UnsupportedOperationException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getConstructors()
- *
- * For all of the array types, this is an invalid operation.
- */
- public IFieldProxy[] getDeclaredFields() {
- throw new UnsupportedOperationException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getConstructors()
- *
- * For all of the array types, this is an invalid operation.
- */
- public IMethodProxy[] getMethods() {
- throw new UnsupportedOperationException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getConstructors()
- *
- * For all of the array types, this is an invalid operation.
- */
- public IMethodProxy[] getDeclaredMethods() {
- throw new UnsupportedOperationException();
- }
-
-
- /**
- * Return the method proxy for this method with these arguments.
- * For all of the array types, this is an invalid operation.
- */
- public IMethodProxy getMethodProxy(String methodName, IBeanTypeProxy[] argumentTypes) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Return the method proxy for this method with these arguments.
- * For all of the array types, this is an invalid operation.
- */
- public IMethodProxy getMethodProxy(String methodName, String[] argumentClassNames) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Return the method proxy for this method with these arguments.
- * For all of the array types, this is an invalid operation.
- */
- public IMethodProxy getDeclaredMethodProxy(String methodName, IBeanTypeProxy[] argumentTypes) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Return the method proxy for this method with these arguments.
- * For all of the array types, this is an invalid operation.
- */
- public IMethodProxy getDeclaredMethodProxy(String methodName, String[] argumentClassNames) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Return the method proxy for this method with these arguments.
- * For all of the array types, this is an invalid operation.
- */
- public IMethodProxy getMethodProxy(String methodName, String argumentQualifiedTypeName) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Return the method proxy for this method with these arguments.
- * For all of the array types, this is an invalid operation.
- */
- public IMethodProxy getMethodProxy(String methodName) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Create an array bean proxy.
- *
- * - (int, new int[2] {3, 4}) will create:
- * int [3] [4]
- *
- * - (int[], new int[1] {1})
- * int [1]
- *
- * - (int[], new int[2] {2,3})
- * int [2] [3]
- *
- *
- * - (int[], null) or (int[], new int[0]) or (int, null) or (int, new int[0])
- * int [0]
- * (int[][], null) or (int[][], new int[0])
- * int[0][]
- * This is because an array instance with no dimensions specified is not valid.
- *
- * - (int[][], new int[1] {3})
- * int[3][]
- *
- * It is package protected so that only the REM Factory can call it.
- */
- REMArrayBeanProxy createBeanProxyWith(int[] dimensions) throws ThrowableProxy {
- // If the dimensions is null or zero length, then create the
- // array as a 0 sized array one dimensional array.
- if (dimensions == null || dimensions.length == 0)
- return createBeanProxyWith(new int[] {0});
-
- // Remove from this type the number of dimensions specified
- // coming in, up to but no further than the final component.
- // From here we can then use the appropriate java.lang.reflect.Array
- // method to create the array.
- IBeanTypeProxy compType = null; // The type of array to create (it may be different number of dimensions).
- int numDims = getDimensions();
- if (numDims <= dimensions.length)
- compType = getFinalComponentType(); // There are the same or more requested dimensions, so use final component type
- else {
- // There are fewer requested dimensions, so strip off that many
- String compClass = getTypeName().substring(dimensions.length);
- compType = fRegistry.getBeanTypeProxyFactory().getBeanTypeProxy(compClass);
- }
-
- if (dimensions.length == 1) {
- // Use the one dimension call
- Object[] parms = new Object[] {compType, new Integer(dimensions[0])};
- return (REMArrayBeanProxy) ((IREMMethodProxy) REMStandardBeanProxyConstants.getConstants(fRegistry).getArrayNewInstanceOneDimension()).invokeWithParms(null, parms);
- } else {
- // Use the multi dimension call
- Object[] parms = new Object[] {compType, dimensions};
- return (REMArrayBeanProxy) ((IREMMethodProxy) REMStandardBeanProxyConstants.getConstants(fRegistry).getArrayNewInstanceMultiDimension()).invokeWithParms(null, parms);
- }
- }
-
- /**
- * @see IBeanTypeProxy#getFormalTypeName()
- */
- public String getFormalTypeName() {
- String name = getTypeName();
- int dims = name.lastIndexOf('[') + 1;
- String type = getFinalComponentType().getTypeName();
- StringBuffer formalType = new StringBuffer(type.length()+("[]".length()*dims)); //$NON-NLS-1$
- formalType.append(type);
- for (int i=0; i<dims; i++)
- formalType.append("[]"); //$NON-NLS-1$
- return formalType.toString();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getCompatibleConstructor(org.eclipse.jem.internal.proxy.core.IBeanTypeProxy[])
- */
- public IConstructorProxy getCompatibleConstructor(IBeanTypeProxy[] argumentTypes) {
- throw new UnsupportedOperationException();
- }
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getCompatibleMethod(java.lang.String, org.eclipse.jem.internal.proxy.core.IBeanTypeProxy[])
- */
- public IMethodProxy getCompatibleMethod(String methodName, IBeanTypeProxy[] argumentTypes) {
- throw new UnsupportedOperationException();
- }
-}
-
-
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMBeanProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMBeanProxy.java
deleted file mode 100644
index 86e05000e..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMBeanProxy.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-
-import org.eclipse.jem.internal.proxy.core.*;
-/**
- * Standard implementation of IREMBeanProxy
- */
-
-public class REMBeanProxy extends REMAbstractBeanProxy {
- private IBeanTypeProxy fType;
-
- protected REMBeanProxy(REMProxyFactoryRegistry aRegistry, Integer anID, IBeanTypeProxy aType){
- super(aRegistry, anID);
- fType = aType;
- }
-
- public IBeanTypeProxy getTypeProxy() {
- return fType;
- }
-
- public void release() {
- fType = null;
- super.release();
- }
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMBeanTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMBeanTypeProxy.java
deleted file mode 100644
index bda0aeff7..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMBeanTypeProxy.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-
-import org.eclipse.jem.internal.proxy.core.IBeanTypeProxy;
-/**
- * Default implementation for a BeanTypeProxy. This is what is used
- * for regular default beans and beantypes when no special beans or bean types are needed.
- */
-public class REMBeanTypeProxy extends REMAbstractBeanTypeProxy implements IREMSpecialBeanTypeProxy {
-
- /**
- * Create with a registry and a class. It is protected so that only subclasses
- * and the factory with this REM package can call it.
- */
- public REMBeanTypeProxy(REMProxyFactoryRegistry aRegistry, Integer anID, String aClassname, IBeanTypeProxy aSuperType) {
- super(aRegistry, anID, aClassname, aSuperType);
- }
-
- /**
- * newBeanTypeForClass: Create a new beantypeproxy of this kind for the given class.
- * This is used by beantype proxy factory when creating a beantype proxy for a subclass.
- * This is because subclasses, unless explicitly overridden, should use the same kind
- * of beantype proxy. This way if anything special is needed for a specific type, then
- * that can be done.
- *
- * NOTE: All subclasses must override this to return the correct type of BeanTypeProxy.
- */
- public IREMBeanTypeProxy newBeanTypeForClass(Integer anID, String aClassname, boolean anAbstract) {
- return newBeanTypeForClass(anID, aClassname, anAbstract, this);
- }
-
- /**
- * The special method to handle subclassing from an abstract).
- */
- public IREMBeanTypeProxy newBeanTypeForClass(Integer anID, String aClassname, boolean anAbstract, IBeanTypeProxy superType) {
- if (!anAbstract)
- return new REMBeanTypeProxy(fRegistry, anID, aClassname, superType);
- else
- return new REMAnAbstractBeanTypeProxy(fRegistry, anID, aClassname, superType, this);
- }
-
- /**
- * Create a new bean proxy with the specified id.
- */
- public IREMBeanProxy newBeanProxy(Integer anID){
-
- return new REMBeanProxy(fRegistry, anID, this);
-
- }
-
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMBigDecimalBeanProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMBigDecimalBeanProxy.java
deleted file mode 100644
index de0427251..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMBigDecimalBeanProxy.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-
-import org.eclipse.jem.internal.proxy.core.*;
-import java.math.BigDecimal;
-import org.eclipse.jem.internal.proxy.common.remote.Commands;
-/**
- * Remote Proxy for BigDecimals.
- */
-class REMBigDecimalBeanProxy extends REMNumberBeanProxy {
-
-REMBigDecimalBeanProxy(REMProxyFactoryRegistry aRegistry, BigDecimal aBigDecimal) {
- super(aRegistry, aBigDecimal);
-}
-
-/**
- * Get the beantype
- */
-public IBeanTypeProxy getTypeProxy() {
- return ((REMStandardBeanTypeProxyFactory) fFactory.getBeanTypeProxyFactory()).bigDecimalClass;
-}
-
-/**
- * Render the bean into value object.
- */
-public void renderBean(Commands.ValueObject value) {
- value.set(numberValue(), ((IREMBeanTypeProxy) getTypeProxy()).getID().intValue());
-}
-}
-
-
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMBigDecimalBeanTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMBigDecimalBeanTypeProxy.java
deleted file mode 100644
index 8d0fce770..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMBigDecimalBeanTypeProxy.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-
-import org.eclipse.jem.internal.proxy.core.*;
-import org.eclipse.jem.internal.proxy.common.remote.Commands;
-import java.math.BigDecimal;
-/**
- * Remote Implementation of IBeanTypeProxy for BigDecimal.
- * Creation date: (2/6/00 9:01:40 AM)
- * @author: Joe Winchester
- */
-final class REMBigDecimalBeanTypeProxy extends REMAbstractNumberBeanTypeProxy {
-// Some values are cache'd for speed
- private final INumberBeanProxy zeroProxy;
- private final static BigDecimal zeroValue = new BigDecimal(0D);
-
-REMBigDecimalBeanTypeProxy(REMProxyFactoryRegistry aRegistry, IBeanTypeProxy numberType) {
- super(aRegistry, new Integer(Commands.BIG_DECIMAL_CLASS), BigDecimal.class.getName(), numberType);
-
- // Create the cached values
- zeroProxy = new REMBigDecimalBeanProxy(aRegistry, zeroValue);
-}
-
-/**
- * Helper to create a bean proxy
- * Package protected because everyone should go through the factory API
- * that is defined as part of IBeanProxyFactory
- */
-INumberBeanProxy createBigDecimalBeanProxy(BigDecimal aBigDecimal) {
- return (!zeroValue.equals(aBigDecimal)) ?
- new REMBigDecimalBeanProxy(fRegistry, aBigDecimal) : zeroProxy;
-}
-
-/**
- * Generic way to create an BigDecimal proxy, however, the Number must be a BigDecimal.
- */
-protected INumberBeanProxy createNumberBeanProxy(Number aNumber) {
- return createBigDecimalBeanProxy((BigDecimal) aNumber);
-}
-
-/**
- * newInstance method. Number's don't have a default ctor, so the standard way won't work.
- * Return the zero proxy for this case.
- */
-public IBeanProxy newInstance() {
- return zeroProxy;
-}
-
-/**
- * Create a new bean proxy the ValueObject passed in.
- * We will assume the object is correct type.
- */
-public IBeanProxy newBeanProxy(Commands.ValueObject value) {
- return createBigDecimalBeanProxy((BigDecimal) value.anObject);
-}
-
-}
-
-
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMBigIntegerBeanProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMBigIntegerBeanProxy.java
deleted file mode 100644
index cfd4dbf79..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMBigIntegerBeanProxy.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-
-import org.eclipse.jem.internal.proxy.core.*;
-import org.eclipse.jem.internal.proxy.common.remote.Commands;
-import java.math.BigInteger;
-/**
- * Remote Proxy for BigIntegers.
- */
-class REMBigIntegerBeanProxy extends REMNumberBeanProxy {
-
-REMBigIntegerBeanProxy(REMProxyFactoryRegistry aRegistry, BigInteger aBigInteger) {
- super(aRegistry, aBigInteger);
-}
-
-/**
- * Get the beantype
- */
-public IBeanTypeProxy getTypeProxy() {
- return ((REMStandardBeanTypeProxyFactory) fFactory.getBeanTypeProxyFactory()).bigIntegerClass;
-}
-
-/**
- * Render the bean into value object.
- */
-public void renderBean(Commands.ValueObject value) {
- value.set(numberValue(), ((IREMBeanTypeProxy) getTypeProxy()).getID().intValue());
-}
-}
-
-
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMBigIntegerBeanTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMBigIntegerBeanTypeProxy.java
deleted file mode 100644
index 8661f332f..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMBigIntegerBeanTypeProxy.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-
-import org.eclipse.jem.internal.proxy.core.*;
-import org.eclipse.jem.internal.proxy.common.remote.Commands;
-import java.math.BigInteger;
-/**
- * Remote Implementation of IBeanTypeProxy for BigInteger.
- * Creation date: (2/6/00 9:01:40 AM)
- * @author: Joe Winchester
- */
-final class REMBigIntegerBeanTypeProxy extends REMAbstractNumberBeanTypeProxy {
-// Some values are cache'd for speed
- private final INumberBeanProxy zeroProxy;
- private final static BigInteger zeroValue = new BigInteger("0"); //$NON-NLS-1$
-/**
- * REMIntegerBeanTypeProxy constructor comment.
- * @param aClass java.lang.Class
- */
-REMBigIntegerBeanTypeProxy(REMProxyFactoryRegistry aRegistry, IBeanTypeProxy numberType) {
- super(aRegistry, new Integer(Commands.BIG_INTEGER_CLASS), BigInteger.class.getName(), numberType);
-
- // Create the cached values
- zeroProxy = new REMBigIntegerBeanProxy(aRegistry, zeroValue);
-}
-
-/**
- * Helper to create a bean proxy
- * Package protected because everyone should go through the factory API
- * that is defined as part of IBeanProxyFactory
- */
-INumberBeanProxy createBigIntegerBeanProxy(BigInteger aBigInteger) {
- return (!zeroValue.equals(aBigInteger)) ?
- new REMBigIntegerBeanProxy(fRegistry, aBigInteger) : zeroProxy;
-}
-
-/**
- * Generic way to create an BigInteger proxy, however, the Number must be a BigInteger.
- */
-protected INumberBeanProxy createNumberBeanProxy(Number aNumber) {
- return createBigIntegerBeanProxy((BigInteger) aNumber);
-}
-
-/**
- * newInstance method. Number's don't have a default ctor, so the standard way won't work.
- * Return the zero proxy for this case.
- */
-public IBeanProxy newInstance() {
- return zeroProxy;
-}
-
-/**
- * Create a new bean proxy the ValueObject passed in.
- * We will assume the object is correct type.
- */
-public IBeanProxy newBeanProxy(Commands.ValueObject value) {
- return createBigIntegerBeanProxy((BigInteger) value.anObject);
-}
-}
-
-
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMBooleanClassBeanProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMBooleanClassBeanProxy.java
deleted file mode 100644
index 77ec3c4dc..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMBooleanClassBeanProxy.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-
-import org.eclipse.jem.internal.proxy.core.*;
-import org.eclipse.jem.internal.proxy.common.remote.Commands;
-/**
- * Remote Implementation of IBooleanBeanProxy for Boolean.class.
- * Creation date: (2/6/00 9:02:54 AM)
- * @author: Joe Winchester
- */
-final class REMBooleanClassBeanProxy extends REMConstantBeanProxy implements IBooleanBeanProxy {
- private final Boolean fBooleanValue;
-
-/**
- * Store the boolean value so that we can return the booleanValue faster
- * without the need for going across the line. It is package protected because it is created in
- * special way, so no one else should create these.
- * @param aBean java.lang.Object
- */
-REMBooleanClassBeanProxy(REMProxyFactoryRegistry aRegistry, Boolean value) {
- super(aRegistry);
- fBooleanValue = value;
-}
-
-/**
- * equals: Equal if:
- * 1) This proxy == (identity) to the other object
- * 2) Else if other is an IBeanProxy and not a constant one, then if
- * equals on the server.
- * 3) If this is a constant proxy and the other is too or is a constant
- * value (e.g. IStringBeanProxy.equals(String), then true if values are equals.
- */
-public boolean equals(Object anObject) {
- if (this == anObject)
- return true; // Identity
- if (anObject instanceof REMBooleanClassBeanProxy)
- return fBooleanValue.booleanValue() == ((REMBooleanClassBeanProxy) anObject).booleanValue();
- if (anObject instanceof Boolean)
- return fBooleanValue.booleanValue() == ((Boolean) anObject).booleanValue();
- return false;
-}
-
-/**
- * Return the boolean value
- */
-public boolean booleanValue() {
- return fBooleanValue.booleanValue();
-}
-/**
- * Return the java.lang.Boolean value
- */
-public Boolean getBooleanValue() {
- return fBooleanValue;
-}
-
-/**
- * Return the toString of the bean itself.
- */
-public String toBeanString() {
- return fBooleanValue.toString();
-}
-
-/**
- * Get the beantype
- */
-public IBeanTypeProxy getTypeProxy() {
- return ((REMStandardBeanTypeProxyFactory) fFactory.getBeanTypeProxyFactory()).booleanClass;
-}
-
-/**
- * Render the bean into value object.
- */
-public void renderBean(Commands.ValueObject value) {
- value.set(fBooleanValue);
-}
-}
-
-
-
-
-
-
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMBooleanClassBeanTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMBooleanClassBeanTypeProxy.java
deleted file mode 100644
index b5960a334..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMBooleanClassBeanTypeProxy.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-
-import org.eclipse.jem.internal.proxy.core.*;
-import org.eclipse.jem.internal.proxy.common.remote.Commands;
-/**
- * Boolean BeanType Proxy for Boolean.class.
- * Creation date: (2/23/00 1:59:02 PM)
- * @author: Richard Lee Kulp
- */
-final class REMBooleanClassBeanTypeProxy extends REMAbstractBeanTypeProxy implements IREMConstantBeanTypeProxy {
-
- // Cache these instances. Since the BeanType proxies are cached also, only one instance
- // of true/false will be in system.
- protected final IBooleanBeanProxy trueProxy;
- protected final IBooleanBeanProxy falseProxy;
-/**
- * REMBooleanBeanTypeProxy constructor comment.
- */
-protected REMBooleanClassBeanTypeProxy(REMProxyFactoryRegistry aRegistry, IBeanTypeProxy objectType) {
- super(aRegistry, new Integer(Commands.BOOLEAN_CLASS), Boolean.class.getName(), objectType);
-
- trueProxy = new REMBooleanClassBeanProxy( fRegistry, Boolean.TRUE);
- falseProxy = new REMBooleanClassBeanProxy( fRegistry, Boolean.FALSE);
-}
-
-/**
- * Helper to create a bean proxy
- * Package protected because everyone should go through the factory API
- * that is defined as part of IBeanProxyFactory
- * Use the cache.
- */
-IBooleanBeanProxy createBooleanBeanProxy(Boolean aBoolean) {
- return aBoolean.booleanValue() ? trueProxy : falseProxy;
-}
-
-/**
- * Create a new bean proxy with the specified id.
- *
- * For all of the primitive wrapper types, this is an invalid operation. They are created
- * explicitly through the appropriate create method.
- */
-public IREMBeanProxy newBeanProxy(Integer anID) {
- throw new UnsupportedOperationException();
-}
-
-/**
- * newBeanTypeForClass: Create a new beantypeproxy of this kind for the given class.
- * This is used by beantype proxy factory when creating a beantype proxy for a subclass.
- * This is because subclasses, unless explicitly overridden, should use the same kind
- * of beantype proxy. This way if anything special is needed for a specific type, then
- * that can be done.
- *
- * For all of the primitive wrapper types, they are final classes, so you can't create a newBeanType
- * for subclasses.
- */
-public IREMBeanTypeProxy newBeanTypeForClass(Integer anID, String aClassname, boolean anAbstract) {
- throw new UnsupportedOperationException();
-}
-
-/**
- * newInstance method. Boolean doesn't have a default ctor, so the standard way won't work.
- * Return the falseProxy for this case because that is the default value.
- */
-public IBeanProxy newInstance() {
- return falseProxy;
-}
-
-/**
- * Create a new bean proxy the ValueObject passed in.
- * We will assume the object is correct type.
- */
-public IBeanProxy newBeanProxy(Commands.ValueObject value) {
- return createBooleanBeanProxy(value.aBool ? Boolean.TRUE : Boolean.FALSE);
-}
-
-}
-
-
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMBooleanTypeBeanProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMBooleanTypeBeanProxy.java
deleted file mode 100644
index 2dd4c0907..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMBooleanTypeBeanProxy.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-
-import org.eclipse.jem.internal.proxy.common.remote.Commands;
-import org.eclipse.jem.internal.proxy.core.*;
-/**
- * Remote Implementation of IBooleanBeanProxy for Boolean.TYPE.
- * Creation date: (2/6/00 9:02:54 AM)
- * @author: Joe Winchester
- */
-final class REMBooleanTypeBeanProxy extends REMConstantBeanProxy implements IBooleanBeanProxy {
- private final boolean fBoolean;
-
-/**
- * Store the boolean value so that we can return the booleanValue faster
- * without the need for going across the line. It is package protected because it is created in
- * special way, so no one else should create these.
- * @param aBean java.lang.Object
- */
-REMBooleanTypeBeanProxy(REMProxyFactoryRegistry aRegistry, boolean value) {
- super(aRegistry);
- fBoolean = value;
-}
-
-/**
- * equals: Equal if:
- * 1) This proxy == (identity) to the other object
- * 2) Else if other is an IBeanProxy and not a constant one, then if
- * equals on the server.
- * 3) If this is a constant proxy and the other is too or is a constant
- * value (e.g. IStringBeanProxy.equals(String), then true if values are equals.
- */
-public boolean equals(Object anObject) {
- if (this == anObject)
- return true; // Identity
- if (anObject instanceof REMBooleanTypeBeanProxy)
- return fBoolean == ((REMBooleanTypeBeanProxy) anObject).booleanValue();
- if (anObject instanceof Boolean)
- return fBoolean == ((Boolean) anObject).booleanValue();
- return false;
-}
-
-/* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IBeanProxy#sameAs(org.eclipse.jem.internal.proxy.core.IBeanProxy)
- */
-public boolean sameAs(IBeanProxy aBeanProxy) {
- if (this == aBeanProxy)
- return true; // Identity
- if (aBeanProxy instanceof REMBooleanTypeBeanProxy)
- return fBoolean == ((REMBooleanTypeBeanProxy) aBeanProxy).booleanValue();
- return false;
-}
-
-/**
- * Return the boolean value
- */
-public boolean booleanValue() {
- return fBoolean;
-}
-/**
- * Return the java.lang.Boolean value
- */
-public Boolean getBooleanValue() {
- return fBoolean ? Boolean.TRUE : Boolean.FALSE;
-}
-
-/**
- * Return the toString of the bean itself.
- */
-public String toBeanString() {
- return fBoolean ? Boolean.TRUE.toString() : Boolean.FALSE.toString();
-}
-
-/**
- * Get the beantype
- */
-public IBeanTypeProxy getTypeProxy() {
- return ((REMStandardBeanTypeProxyFactory) fFactory.getBeanTypeProxyFactory()).booleanType;
-}
-
-/**
- * Render the bean into value object.
- */
-public void renderBean(Commands.ValueObject value) {
- value.set(fBoolean);
-}
-
-}
-
-
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMBooleanTypeBeanTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMBooleanTypeBeanTypeProxy.java
deleted file mode 100644
index 58aab1068..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMBooleanTypeBeanTypeProxy.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-
-import org.eclipse.jem.internal.proxy.core.*;
-import org.eclipse.jem.internal.proxy.common.remote.Commands;
-/**
- * Boolean BeanType Proxy for Boolean.TYPE
- * Creation date: (2/23/00 1:59:02 PM)
- * @author: Richard Lee Kulp
- */
-final class REMBooleanTypeBeanTypeProxy extends REMPrimitiveBeanTypeProxy {
-
- // Cache these instances. Since the BeanType proxies are cached also, only one instance
- // of true/false will be in system.
- protected final IBooleanBeanProxy trueProxy;
- protected final IBooleanBeanProxy falseProxy;
-/**
- * REMBooleanBeanTypeProxy constructor comment.
- */
-protected REMBooleanTypeBeanTypeProxy(REMProxyFactoryRegistry aRegistry) {
- super(aRegistry, new Integer(Commands.BOOLEAN_TYPE), Boolean.TYPE.getName());
-
- trueProxy = new REMBooleanTypeBeanProxy( fRegistry, true);
- falseProxy = new REMBooleanTypeBeanProxy( fRegistry, false);
-}
-
-/**
- * Helper to create a bean proxy
- * Package protected because everyone should go through the factory API
- * that is defined as part of IBeanProxyFactory
- * Use the cache.
- */
-IBooleanBeanProxy createBooleanBeanProxy(boolean aBoolean) {
- return aBoolean ? trueProxy : falseProxy;
-}
-
-
-/**
- * newInstance method. boolean is a primitive, so the standard way won't work.
- * Return the falseProxy for this case because that is the default value.
- */
-public IBeanProxy newInstance() {
- return falseProxy;
-}
-
-/**
- * Create a new bean proxy the ValueObject passed in.
- * We will assume the object is correct type.
- */
-public IBeanProxy newBeanProxy(Commands.ValueObject value) {
- return createBooleanBeanProxy(value.aBool);
-}
-}
-
-
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMByteClassBeanProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMByteClassBeanProxy.java
deleted file mode 100644
index e8a44552d..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMByteClassBeanProxy.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-
-import org.eclipse.jem.internal.proxy.core.*;
-import org.eclipse.jem.internal.proxy.common.remote.Commands;
-
-/**
- * Remote Proxy for Byte.class.
- */
-class REMByteClassBeanProxy extends REMNumberBeanProxy {
-
-REMByteClassBeanProxy(REMProxyFactoryRegistry aRegistry, Byte aByte) {
- super(aRegistry, aByte);
-}
-
-/**
- * Get the beantype
- */
-public IBeanTypeProxy getTypeProxy() {
- return ((REMStandardBeanTypeProxyFactory) fFactory.getBeanTypeProxyFactory()).byteClass;
-}
-
-/**
- * Render the bean into value object.
- */
-public void renderBean(Commands.ValueObject value) {
- value.set((Byte) numberValue());
-}
-}
-
-
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMByteClassBeanTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMByteClassBeanTypeProxy.java
deleted file mode 100644
index bfbf1ac44..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMByteClassBeanTypeProxy.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-
-import org.eclipse.jem.internal.proxy.core.*;
-import org.eclipse.jem.internal.proxy.common.remote.Commands;
-/**
- * BeanType Proxy for Byte.class.
- * Creation date: (2/6/00 9:01:40 AM)
- * @author: Joe Winchester
- */
-final class REMByteClassBeanTypeProxy extends REMAbstractNumberBeanTypeProxy {
-// Some values are cache'd for speed
- private final INumberBeanProxy zeroProxy;
- private final INumberBeanProxy oneProxy;
- private final INumberBeanProxy twoProxy;
- private final INumberBeanProxy threeProxy;
-/**
- * REMIntegerBeanTypeProxy constructor comment.
- * @param aClass java.lang.Class
- */
-REMByteClassBeanTypeProxy(REMProxyFactoryRegistry aRegistry, IBeanTypeProxy numberType) {
- super(aRegistry, new Integer(Commands.BYTE_CLASS), Byte.class.getName(), numberType);
-
- // Create the cached values
- zeroProxy = new REMByteClassBeanProxy(aRegistry, new Byte((byte)0));
- oneProxy = new REMByteClassBeanProxy(aRegistry, new Byte((byte)1));
- twoProxy = new REMByteClassBeanProxy(aRegistry, new Byte((byte)2));
- threeProxy = new REMByteClassBeanProxy(aRegistry, new Byte((byte)3));
-}
-
-/**
- * Helper to create a bean proxy
- * Package protected because everyone should go through the factory API
- * that is defined as part of IBeanProxyFactory
- */
-INumberBeanProxy createByteBeanProxy(Byte aByte) {
- switch(aByte.byteValue()) {
- case 0: return zeroProxy;
- case 1: return oneProxy ;
- case 2: return twoProxy ;
- case 3: return threeProxy ;
- default: return new REMByteClassBeanProxy(fRegistry, aByte);
- }
-}
-
-/**
- * Generic way to create an Integer proxy, however, the Number must be an Integer.
- */
-protected INumberBeanProxy createNumberBeanProxy(Number aNumber) {
- return createByteBeanProxy((Byte) aNumber);
-}
-
-/**
- * newInstance method. Number's don't have a default ctor, so the standard way won't work.
- * Return the zero proxy for this case.
- */
-public IBeanProxy newInstance() {
- return zeroProxy;
-}
-
-/**
- * Create a new bean proxy the ValueObject passed in.
- * We will assume the object is correct type.
- */
-public IBeanProxy newBeanProxy(Commands.ValueObject value) {
- return createByteBeanProxy(new Byte(value.aByte));
-}
-
-}
-
-
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMByteTypeBeanProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMByteTypeBeanProxy.java
deleted file mode 100644
index b762b9b9b..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMByteTypeBeanProxy.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-
-import org.eclipse.jem.internal.proxy.common.remote.Commands;
-import org.eclipse.jem.internal.proxy.core.*;
-/**
- * Remote Implementation of INumberBeanProxy for Byte.TYPE.
- * It can answer all of the primitive number types (int, long, short, byte, double, float).
- * Creation date: (2/6/00 9:02:54 AM)
- * @author: Joe Winchester
- */
-class REMByteTypeBeanProxy extends REMConstantBeanProxy implements INumberBeanProxy {
- private final byte fByte;
-
-/**
- * It is package protected because they are created
- * in a special way and no one else should create them.
- * @param aBean java.lang.Object
- */
-REMByteTypeBeanProxy(REMProxyFactoryRegistry aRegistry, byte aByte) {
- super(aRegistry);
- fByte = aByte;
-}
-
-/**
- * equals: Equal if:
- * 1) This proxy == (identity) to the other object
- * 2) Else if other is an IBeanProxy and not a constant one, then if
- * equals on the server.
- * 3) If this is a constant proxy and the other is too or is a constant
- * value (e.g. IStringBeanProxy.equals(String), then true if values are equals.
- */
-public boolean equals(Object anObject) {
- if (this == anObject)
- return true; // Identity
- if (anObject instanceof REMByteTypeBeanProxy)
- return fByte == ((REMByteTypeBeanProxy) anObject).byteValue();
- if (anObject instanceof Byte)
- return fByte == ((Byte) anObject).byteValue();
- return false;
-}
-
-/* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IBeanProxy#sameAs(org.eclipse.jem.internal.proxy.core.IBeanProxy)
- */
-public boolean sameAs(IBeanProxy aBeanProxy) {
- if (this == aBeanProxy)
- return true; // Identity
- if (aBeanProxy instanceof REMByteTypeBeanProxy)
- return fByte == ((REMByteTypeBeanProxy) aBeanProxy).byteValue();
- return false;
-}
-
-/**
- * byteValue method comment.
- */
-public byte byteValue() {
- return fByte;
-}
-/**
- * doubleValue method comment.
- */
-public double doubleValue() {
- return fByte;
-}
-/**
- * floatValue method comment.
- */
-public float floatValue() {
- return fByte;
-}
-/**
- * Return the int value
- */
-public int intValue() {
- return fByte;
-}
-/**
- * longValue method comment.
- */
-public long longValue() {
- return fByte;
-}
-/**
- * numberValue method comment.
- */
-public Number numberValue() {
- return new Byte(fByte);
-}
-/**
- * shortValue method comment.
- */
-public short shortValue() {
- return fByte;
-}
-
-/**
- * The bean's toString.
- */
-public String toBeanString() {
- return String.valueOf(fByte);
-}
-
-/**
- * Get the beantype
- */
-public IBeanTypeProxy getTypeProxy() {
- return ((REMStandardBeanTypeProxyFactory) fFactory.getBeanTypeProxyFactory()).byteType;
-}
-
-/**
- * Render the bean into value object.
- */
-public void renderBean(Commands.ValueObject value) {
- value.set(fByte);
-}
-}
-
-
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMByteTypeBeanTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMByteTypeBeanTypeProxy.java
deleted file mode 100644
index 514192a13..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMByteTypeBeanTypeProxy.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-
-import org.eclipse.jem.internal.proxy.core.*;
-import org.eclipse.jem.internal.proxy.common.remote.Commands;
-/**
- * Remote Implementation of IBeanTypeProxy for Byte.TYPE.
- * Creation date: (2/6/00 9:01:40 AM)
- * @author: Joe Winchester
- */
-final class REMByteTypeBeanTypeProxy extends REMPrimitiveBeanTypeProxy {
-// Some values are cache'd for speed
- private final INumberBeanProxy zeroProxy;
- private final INumberBeanProxy oneProxy;
- private final INumberBeanProxy twoProxy;
- private final INumberBeanProxy threeProxy;
-/**
- * REMIntegerBeanTypeProxy constructor comment.
- * @param aClass java.lang.Class
- */
-REMByteTypeBeanTypeProxy(REMProxyFactoryRegistry aRegistry) {
- super(aRegistry, new Integer(Commands.BYTE_TYPE), Byte.TYPE.getName());
-
- // Create the cached values
- zeroProxy = new REMByteTypeBeanProxy(aRegistry, (byte)0);
- oneProxy = new REMByteTypeBeanProxy(aRegistry, (byte)1);
- twoProxy = new REMByteTypeBeanProxy(aRegistry, (byte)2);
- threeProxy = new REMByteTypeBeanProxy(aRegistry, (byte)3);
-}
-
-/**
- * Helper to create a bean proxy
- * Package protected because everyone should go through the factory API
- * that is defined as part of IBeanProxyFactory
- */
-INumberBeanProxy createByteBeanProxy(byte aByte) {
- switch(aByte) {
- case 0: return zeroProxy;
- case 1: return oneProxy ;
- case 2: return twoProxy ;
- case 3: return threeProxy ;
- default: return new REMByteTypeBeanProxy(fRegistry, aByte);
- }
-}
-
-/**
- * newInstance method. byte is a primitive, so the standard way won't work.
- * Return the zeroProxy for this case because that is the default value.
- */
-public IBeanProxy newInstance() {
- return zeroProxy;
-}
-
-/**
- * Create a new bean proxy the ValueObject passed in.
- * We will assume the object is correct type.
- */
-public IBeanProxy newBeanProxy(Commands.ValueObject value) {
- return createByteBeanProxy(value.aByte);
-}
-
-/**
- * Short cut for newInstance where the string follows the
- * specific pattern we expect. That way it won't be necessary to ship over to the vm
- * to process it.
- *
- * The pattern it can accept is:
- * 1) (byte) validNumber - number can be any number because (byte) explicitly casts it down.
- * 2) validNumber
- * It will use the decode function of byte to determine the valid number.
- */
-public IBeanProxy newInstance(String initializationString) throws ThrowableProxy, ClassCastException, InstantiationException {
- String trim = initializationString.trim();
- if (trim.length() == 0)
- return super.newInstance(initializationString);
- byte aByte;
- if (trim.startsWith("(byte)")) { //$NON-NLS-1$
- Number v = parseString(trim.substring("(byte)".length()).trim()); //$NON-NLS-1$
- if (v != null)
- aByte = v.byteValue();
- else
- return super.newInstance(initializationString); // Can't decode it, let full parser handle it.
- } else {
- try {
- aByte = Byte.decode(trim).byteValue(); // See if valid byte format.
- } catch (NumberFormatException e) {
- return super.newInstance(initializationString); // Can't decode it, let full parser handle it.
- }
- }
-
- return getProxyFactoryRegistry().getBeanProxyFactory().createBeanProxyWith(aByte);
-}
-
-}
-
-
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMCallbackInputStream.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMCallbackInputStream.java
deleted file mode 100644
index 9e2075bbb..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMCallbackInputStream.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-import java.io.*;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jem.internal.proxy.core.ProxyPlugin;
-import org.eclipse.jem.internal.proxy.common.CommandException;
-import org.eclipse.jem.internal.proxy.common.remote.Commands;
-import org.eclipse.jem.internal.proxy.common.remote.IOCommandException;
-/**
- * This is the inputstream used to return a lot of data from
- * the server.
- */
-
-public class REMCallbackInputStream extends InputStream {
-
- protected DataInputStream fIn;
- protected DataOutputStream fOut;
- protected byte[] fBuffer;
- protected int fNextByte = 0;
- protected int fLastByte = 0;
-
- public REMCallbackInputStream(DataInputStream in, DataOutputStream out) {
- fIn = in;
- fOut = out;
-
- Integer bufSize = Integer.getInteger("proxyvm.bufsize"); //$NON-NLS-1$
- if (bufSize == null)
- bufSize = new Integer(16000);
- fBuffer = new byte[bufSize.intValue()];
- }
-
- protected void clearStream() {
- fIn = null;
- fOut = null;
- fBuffer = null;
- }
-
- protected void fillBuffer() throws IOException {
- if (fIn == null)
- throw new InterruptedIOException();
- try {
- if (fLastByte != -1) {
- fLastByte = Commands.readBytes(fIn, fBuffer);
- if (fLastByte != -1)
- fNextByte = 0;
- else {
- fNextByte = -1;
- }
- }
- } catch (CommandException e) {
- try {
- close(false);
- } catch (IOException e1) {
- ProxyPlugin.getPlugin().getLogger().log(new Status(IStatus.WARNING, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "", e1)); // Error during close, just log it. //$NON-NLS-1$
- }
- throw new IOCommandException(e);
- }
- }
-
- public int read() throws IOException {
- if (fNextByte >= fLastByte) {
- fillBuffer();
- }
- if (fLastByte == -1)
- return -1; // We've previously reached the end.
-
- return fBuffer[fNextByte++] & 0xFF; // So that it is in range 0 to 255.
- }
-
- public int read(byte b[], int off, int len) throws IOException {
- if (b == null) {
- throw new NullPointerException();
- } else if ((off < 0) || (off > b.length) || (len < 0) ||
- ((off + len) > b.length) || ((off + len) < 0)) {
- throw new IndexOutOfBoundsException();
- } else if (len == 0) {
- return 0;
- }
-
- int read = 0;
- while (len > 0) {
- if (fNextByte >= fLastByte)
- fillBuffer();
- if (fLastByte == -1)
- return read != 0 ? read : -1; // No more, return amount read, or if none read, then -1
- int move = fLastByte - fNextByte;
- if (move > len)
- move = len;
- System.arraycopy(fBuffer, fNextByte, b, off, move);
- read += move;
- fNextByte += move;
- off += move;
- len -= move;
- }
-
- return read;
- }
-
- public int available() throws IOException {
- return fLastByte != -1 ? fLastByte - fNextByte : 0;
- }
-
- public void close() throws IOException {
- close(true);
- }
-
- protected void close(boolean wait) throws IOException {
- if (fOut == null)
- return; // Already closed.
- try {
- fOut.writeByte(Commands.CALLBACK_STREAM_TERMINATE);
- fOut.flush();
- fOut = null; // So that we know we closed already if error occurs during in read() below.
- if (wait) {
- // Need to read until End of stream because we need to flush out the
- // stream so that next time we use this connection we start fresh.
- // If the server has already finished writing, we will read until then.
- // If the server has not yet finished writing, when it reads the terminate
- // request it will send an end of stream marker for us to read. But either
- // way we can't leave until we've read everything from the stream.
-
- // If called with no wait, then we are closing hard and will be closing the socket too.
- while (read() != -1) {
- }
- }
- } finally {
- clearStream();
- }
- }
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMCallbackRegistry.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMCallbackRegistry.java
deleted file mode 100644
index 816c40c80..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMCallbackRegistry.java
+++ /dev/null
@@ -1,185 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-import java.net.Socket;
-import java.util.*;
-
-import org.eclipse.jem.internal.proxy.common.remote.Commands;
-import org.eclipse.jem.internal.proxy.core.*;
-import org.eclipse.jem.internal.proxy.core.ExpressionProxy.ProxyEvent;
-
-/**
- * This registry will handle callbacks.
- * It is package protected because no one
- * should access it outside.
- */
-class REMCallbackRegistry implements ICallbackRegistry {
- final REMProxyFactoryRegistry fFactory;
- final String fNamePostfix;
- List fThreads = Collections.synchronizedList(new LinkedList()); // List of active callback threads.
-
- Map fIdToCallback = new HashMap(5); // ID to Callback map.
- Map fCallbackProxyToId = new HashMap(5); // Callback to ID map. This will also hold onto the callback proxies so that they don't get GC'd while the callback is registered.
-
- IREMMethodProxy fInitializeCallback;
- IBeanProxy fRemoteServer;
-
- boolean registryOpen = true;
-
- public REMCallbackRegistry(String name, REMProxyFactoryRegistry aFactory) {
-
- fFactory = aFactory;
- fNamePostfix = name;
-
- // Now register common proxies.
- IREMBeanTypeProxy callbackType = new REMInterfaceBeanTypeProxy(fFactory, new Integer(Commands.ICALLBACK_CLASS), "org.eclipse.jem.internal.proxy.vm.remote.ICallback"); //$NON-NLS-1$
-
- fInitializeCallback = (IREMMethodProxy) ((REMMethodProxyFactory) fFactory.getMethodProxyFactory()).methodType.newBeanProxy(new Integer(Commands.INITIALIZECALLBACK_METHOD_ID));
-
- fRemoteServer = aFactory.getBeanProxyFactory().getIVMServerProxy(); // For us, the IVMServer on the remote vm ALSO implements IVMCallbackServer.
-
- ((REMStandardBeanTypeProxyFactory) fFactory.getBeanTypeProxyFactory()).registerBeanTypeProxy(callbackType, true);
- ((REMStandardBeanProxyFactory) fFactory.getBeanProxyFactory()).registerProxy(fInitializeCallback);
-
- }
-
- public boolean createCallback(Socket incoming) {
- if (registryOpen) {
- Thread st = new REMCallbackThread(incoming, this, "Callback Thread-"+fNamePostfix, fFactory, fFactory.fNoTimeouts); //$NON-NLS-1$
- fThreads.add(st);
- st.start();
- return true;
- } else
- return false;
- }
-
- /**
- * Use this to request a shutdown. If the server is already shutdown, this will return false.
- */
- public boolean requestShutdown() {
- if (registryOpen)
- shutdown();
- else
- return false;
- return true;
- }
-
- /**
- * Remove a thread from the list.
- */
- public void removeCallbackThread(REMCallbackThread thread) {
- fThreads.remove(thread);
- }
-
- private void shutdown() {
-
- // Go through each thread and ask it to close. Make a copy of the list so that we
- // won't get into deadlocks.
- REMCallbackThread[] threadsArray = (REMCallbackThread[]) fThreads.toArray(new REMCallbackThread[fThreads.size()]);
- for (int i=0; i<threadsArray.length; i++) {
- // This is a harsh way to shut a connection down, but there's no
- // other way I know of to interrupt the read on a socket.
- threadsArray[i].close();
- }
-
- // Now that they've been told to close, wait on each one to finish.
- for (int i=0; i<threadsArray.length; i++)
- try {
- threadsArray[i].join(10000); // Wait ten seconds, if longer, just go on to next one.
- } catch (InterruptedException e) {
- }
-
- fThreads.clear();
- fIdToCallback.clear();
- fCallbackProxyToId.clear();
- fInitializeCallback = null;
- fRemoteServer = null;
-
- }
-
- public ICallback getRegisteredCallback(int id) {
- synchronized(fIdToCallback) {
- return (ICallback) fIdToCallback.get(new Integer(id));
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.ICallbackRegistry#registerCallback(org.eclipse.jem.internal.proxy.core.IBeanProxy, org.eclipse.jem.internal.proxy.core.ICallback)
- */
- public void registerCallback(IBeanProxy callbackProxy, ICallback cb) {
- synchronized(fIdToCallback) {
- fIdToCallback.put(((IREMBeanProxy) callbackProxy).getID(), cb);
- fCallbackProxyToId.put(callbackProxy, ((IREMBeanProxy) callbackProxy).getID());
- fInitializeCallback.invokeCatchThrowableExceptions(callbackProxy, new IBeanProxy[] {fRemoteServer, fFactory.getBeanProxyFactory().createBeanProxyWith(((IREMBeanProxy) callbackProxy).getID().intValue())});
- }
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.ICallbackRegistry#registerCallback(org.eclipse.jem.internal.proxy.core.IProxy, org.eclipse.jem.internal.proxy.core.ICallback, org.eclipse.jem.internal.proxy.core.IExpression)
- */
- public void registerCallback(IProxy callbackProxy, final ICallback cb, IExpression expression) {
- final Integer id;
- if (callbackProxy.isBeanProxy()) {
- id = ((IREMBeanProxy) callbackProxy).getID();
- synchronized(fIdToCallback) {
- fIdToCallback.put(id, cb);
- fCallbackProxyToId.put(callbackProxy, id);
- }
- } else {
- id = new Integer(callbackProxy.hashCode());
- synchronized (fIdToCallback) {
- fIdToCallback.put(id, cb); // This is so that it is registered in case callback is invoked from remote vm during expression processing.
- }
- ((ExpressionProxy) callbackProxy).addProxyListener(new ExpressionProxy.ProxyListener() {
- public void proxyResolved(ProxyEvent event) {
- synchronized(fIdToCallback) {
- fCallbackProxyToId.put(event.getProxy(), id);
- }
- }
-
- public void proxyNotResolved(ProxyEvent event) {
- // Failed, so remove registration completely.
- synchronized (fIdToCallback) {
- fIdToCallback.remove(id);
- }
- }
-
- public void proxyVoid(ProxyEvent event) {
- // Failed, so remove registration completely.
- synchronized (fIdToCallback) {
- fIdToCallback.remove(id);
- }
- }
-
- });
- }
- expression.createSimpleMethodInvoke(fInitializeCallback, callbackProxy, new IProxy[] {fRemoteServer, fFactory.getBeanProxyFactory().createBeanProxyWith(id.intValue())}, false);
- }
-
- /**
- * The public interface for deregistering callbacks.
- */
- public void deregisterCallback(IBeanProxy callbackProxy) {
- synchronized(fIdToCallback) {
- Integer id = (Integer) fCallbackProxyToId.remove(callbackProxy);
- fIdToCallback.remove(id);
- }
- }
-
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMCallbackThread.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMCallbackThread.java
deleted file mode 100644
index 5625d1cd2..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMCallbackThread.java
+++ /dev/null
@@ -1,327 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-import java.io.*;
-import java.net.Socket;
-import java.util.logging.Level;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-
-import org.eclipse.jem.internal.proxy.common.remote.Commands;
-import org.eclipse.jem.internal.proxy.common.remote.TransmitableArray;
-import org.eclipse.jem.internal.proxy.core.*;
-
-/**
- * This thread handles the actual callback.
- * It is package protected because no one else should access it.
- */
-class REMCallbackThread extends Thread {
- final REMConnection fConnection; // A connection to use
- final REMCallbackRegistry fServer;
- final REMStandardBeanProxyFactory fFactory;
- final REMStandardBeanTypeProxyFactory fTypeFactory;
- final REMProxyFactoryRegistry registry;
- protected boolean shuttingDown;
- protected boolean inTransaction; // Is this thread currently participating in a transaction, (i.e. reading/writing), if so then we can't use it for another transaction.
-
-
- /**
- * Is this callback thread currently participating in a transaction (reading/writing). If so then it can't be used for an
- * independent new transaction. In other words you can't write/read data using this callback thread's
- * connection because it is being used by someone else expecting to have exclusive read/write on this connection.
- *
- * @return
- *
- * @since 1.1.0
- */
- public boolean inTransaction() {
- return inTransaction;
- }
-
- /**
- * Set whether this callback thread is in a transaction or not. If it is in a transaction it cannot be used
- * for an independent new transaction. In other words you can't write/read data using this callback thread's
- * connection because it is being used by someone else expecting to have exclusive read/write on this connection.
- * @param inTransaction
- *
- * @since 1.1.0
- */
- public void setIntransaction(boolean inTransaction) {
- this.inTransaction = inTransaction;
- }
-
- // Kludge: Bug in Linux 1.3.xxx of JVM. Closing a socket while the socket is being read/accept will not interrupt the
- // wait. Need to timeout to the socket read/accept before the socket close will be noticed. This has been fixed
- // in Linux 1.4. So on Linux 1.3 need to put timeouts in on those sockets that can be separately closed while reading/accepting.
- static boolean LINUX_1_3 = "linux".equalsIgnoreCase(System.getProperty("os.name")) && System.getProperty("java.version","").startsWith("1.3"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
-
- public REMCallbackThread(Socket socket, REMCallbackRegistry server, String name, REMProxyFactoryRegistry registry, boolean noTimeouts) {
- super(name);
-
- fConnection = new REMConnection(socket, true); // No timeouts since this is a server thread.
- this.registry = registry;
- fServer = server;
- fFactory = (REMStandardBeanProxyFactory) registry.getBeanProxyFactory();
- fTypeFactory = (REMStandardBeanTypeProxyFactory) registry.getBeanTypeProxyFactory();
- }
-
- /**
- * Request the thread to close down.
- */
- public void close() {
- try {
- shuttingDown = true; // So that if this is a forced close then it will know not to print error msgs.
- if (fConnection.fSocket != null)
- fConnection.fSocket.close();
- } catch (Exception e) {
- }
- }
-
-
- /*
- * Return the IREMConnection associated with this callback. Used by
- * the connection server to return this connection for any requests
- * made on this thread.
- * <package-protected> so that only remote proxy can access.
- */
- IREMConnection getConnection() {
- return fConnection;
- }
-
- public void run() {
-
- DataInputStream in = fConnection.in;
- DataOutputStream out = fConnection.out;
- InputStream ins = null;
- boolean shutdown = false;
- Commands.ValueObject valueObject = new Commands.ValueObject(); // Working value object so not continually recreated.
- BeanProxyValueSender valueSender = new BeanProxyValueSender(this.fFactory); // Working valuesender so not continually recreated.
- try {
- boolean doLoop = true;
-
- /**
- * Note: In the cases below you will see a lot of finally clauses that null variables out.
- * This is because this is a long running loop, and variables declared within blocks are not
- * garbage collected until the method is terminated, so these variables once set would never
- * be GC'd. The nulling at the end of the case makes sure that any of those objects set are
- * now available for garbage collection when necessary.
- */
- while(doLoop) {
- byte cmd = 0;
- try {
- if (LINUX_1_3)
- fConnection.fSocket.setSoTimeout(1000); // Linux 1.3 bug, see static LINUX_1_3 above
- cmd = in.readByte();
- if (LINUX_1_3)
- fConnection.fSocket.setSoTimeout(0); // Linux 1.3 bug, see static LINUX_1_3 above
- } catch (InterruptedIOException e) {
- continue; // Timed out, try again
- }
-
- switch (cmd) {
- case Commands.QUIT_CONNECTION:
- doLoop = false;
- break; // Close this connection
-
- case Commands.TERMINATE_SERVER:
- doLoop = false;
- shutdown = true; // Shutdown everything
- break;
-
- case Commands.CALLBACK:
- int callID = in.readInt(); // The id of the registered callback to call.
- int msgID = in.readInt(); // The id of the message to call.
- Object parm = null;
- Object result = null;
- ICallback cb = null;
- try {
- // The register callback handler will know how to handle the parm,
- // it will know if it is an array of proxies, or an object of some kind.
- fFactory.startTransaction(); // Start a transaction.
- setIntransaction(true); // Also tell ourselves that we are in a transaction.
- boolean isProxies = true;
- try {
- Commands.readValue(in, valueObject);
- if (valueObject.type == Commands.ARRAY_IDS) {
- // It is an array containing IDs, as it normally would be.
- // However it will become IBeanProxy[]. That is because if ID's
- // they must be proxies over here.
- valueSender.initialize(valueObject);
- Commands.readArray(in, valueObject.anInt, valueSender, valueObject, false);
- if (valueSender.getException() != null) {
- close(); // Something wrong, close the thread so next time we get a new one.
- }
- parm = valueSender.getArray();
- } else {
- // It is object or null. It could be an array of objects, or one object.
- isProxies = false;
- parm = valueObject.getAsObject();
- }
- } finally {
- setIntransaction(false);
- fFactory.stopTransaction();
- }
- // Now perform the callback.
- cb = fServer.getRegisteredCallback(callID);
- if (cb != null) {
- // Callback still registered. If proxies, then if first entry is just a proxy,
- // then we are sending only one. A convienence factor for callbacks.
- // If not a single entry of IBeanProxy, then send whole array.
- try {
- if (isProxies)
- if (((Object[]) parm).length == 1 && (((Object[]) parm)[0] == null || ((Object[]) parm)[0] instanceof IBeanProxy))
- result = cb.calledBack(msgID, (IBeanProxy) ((Object[]) parm)[0]);
- else
- result = cb.calledBack(msgID, (Object[]) parm);
- else
- result = cb.calledBack(msgID, parm);
- // We only accept null, IREMBeanProxies, and Object[], where
- // contents of Object[] are bean proxies.
- valueObject.set();
- if (result instanceof IREMBeanProxy)
- ((IREMBeanProxy) result).renderBean(valueObject);
- else if (result instanceof Object[]) {
- class Retriever implements Commands.ValueRetrieve {
- int index = 0;
- Object[] array;
- Commands.ValueObject worker = new Commands.ValueObject();
-
- public Retriever(Object[] anArray) {
- array = anArray;
- }
-
- public Commands.ValueObject nextValue() {
- Object retParm = array[index++];
- if (retParm != null)
- if (retParm instanceof IREMBeanProxy)
- ((IREMBeanProxy) retParm).renderBean(worker);
- else if (retParm instanceof TransmitableArray) {
- // It is another array, create a new
- // retriever.
- worker.setArrayIDS(
- new Retriever(((TransmitableArray) retParm).array),
- ((TransmitableArray) retParm).array.length,
- ((TransmitableArray) retParm).componentTypeID);
- } else {
- // It's an object. Need to get bean
- // type so that we can send it.
- IREMBeanProxy type =
- (IREMBeanProxy) fTypeFactory.getBeanTypeProxy(retParm.getClass().getName());
- if (type == null)
- throw new IllegalArgumentException();
- int classID = type.getID().intValue();
- worker.setAsObject(retParm, classID);
- }
- else
- worker.set();
- return worker;
- }
- };
-
- valueObject.setArrayIDS(
- new Retriever((Object[]) result),
- ((Object[]) result).length,
- Commands.OBJECT_CLASS);
- }
-
- Commands.sendCallbackDoneCommand(out, valueObject, Commands.NO_ERROR);
- } catch (RuntimeException e) {
- // Something happened, turn it into an error object
- // to send back.
- valueObject.set(e.getClass().getName() + ':' + e.getLocalizedMessage());
- Commands.sendCallbackDoneCommand(out, valueObject, Commands.CALLBACK_RUNTIME_EXCEPTION);
- ProxyPlugin.getPlugin().getLogger().log(e, Level.INFO); // Just log it, but assume safe enough to just go back and wait for next callback request.
- }
- } else {
- valueObject.set();
- Commands.sendCallbackDoneCommand(out, valueObject, Commands.CALLBACK_NOT_REGISTERED); // Send error msg back to indicate we weren't registered.
- }
- } finally {
- parm = null; // Clear out for GC to work
- result = null;
- cb = null;
- valueObject.set();
- valueSender.clear();
- }
- break;
-
- case Commands.CALLBACK_STREAM:
- // A request for a stream
- callID = in.readInt(); // The id of the registered callback to call.
- msgID = in.readInt(); // The id of the message to call.
- cb = null;
- try {
- // Now perform the callback.
- cb = fServer.getRegisteredCallback(callID);
- if (cb != null) {
- // Callback still registered
- valueObject.set();
- Commands.sendCallbackDoneCommand(out, valueObject, Commands.NO_ERROR); // Send null to let it know we've accepted the stream
- ins = new REMCallbackInputStream(in, out);
- try {
- cb.calledBackStream(msgID, ins);
- } finally {
- try {
- ins.close(); // Make sure it's closed.
- } catch (IOException e) {
- // Exception while closing, just log it and then mark to end the loop so we close connection too.
- doLoop = false;
- ProxyPlugin.getPlugin().getLogger().log(new Status(IStatus.ERROR, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "In REMCallbackThread", e)); //$NON-NLS-1$
- }
- }
- } else {
- valueObject.set();
- Commands.sendCallbackDoneCommand(out, valueObject, Commands.CALLBACK_NOT_REGISTERED); // Send error msg back to indicate we weren't registered.
- }
- } finally {
- cb = null; // Clear out for GC to work
- ins = null;
- valueObject.set();
- }
- break;
-
- default:
- // Unknown command. We don't know how long the command is, so we need to close the connection.
- ProxyPlugin.getPlugin().getLogger().log(new Status(IStatus.ERROR, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "REMCallback: Invalid cmd sent="+cmd, null)); //$NON-NLS-1$
- doLoop = false;
- break;
- }
- }
- } catch (EOFException e) {
- // This is ok. It means that the connection on the other side was terminated.
- // So just accept this and go down.
- } catch (Exception e) {
- if (!shuttingDown)
- ProxyPlugin.getPlugin().getLogger().log(new Status(IStatus.ERROR, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "In REMCallbackThread", e)); //$NON-NLS-1$
- } finally {
- if (in != null)
- try {
- in.close();
- } catch (Exception e) {
- }
- if (out != null)
- try {
- out.close();
- } catch (Exception e) {
- }
- close();
- }
- fServer.removeCallbackThread(this);
- if (shutdown)
- fServer.requestShutdown();
- }
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMCharacterClassBeanProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMCharacterClassBeanProxy.java
deleted file mode 100644
index 4fc5cf994..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMCharacterClassBeanProxy.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
- * $RCSfile: REMCharacterClassBeanProxy.java,v $ $Revision: 1.6 $ $Date: 2005/08/24 20:39:06 $
- */
-
-import org.eclipse.jem.internal.proxy.core.*;
-import org.eclipse.jem.internal.proxy.common.remote.Commands;
-/**
- * IDE Implementation of ICharacterBeanProxy for the Character class. Creation date: (2/6/00
- * 9:02:54 AM) @author: Joe Winchester
- */
-final class REMCharacterClassBeanProxy extends REMConstantBeanProxy implements ICharacterBeanProxy {
- protected Character fCharValue;
-
- /**
- * As well as storing the bean store the char value so that we can return the charValue faster
- * without the need for repeated re-casting. It is package protected because it is created in
- * special way, so no one else should create these.
- *
- * @param aBean
- * java.lang.Object
- */
- REMCharacterClassBeanProxy(REMProxyFactoryRegistry aRegistry, Character value) {
- super(aRegistry);
- fCharValue = value;
- }
-
- /**
- * equals: Equal if: 1) This proxy == (identity) to the other object 2) Else if other is an
- * IBeanProxy and not a constant one, then if equals on the server. 3) If this is a constant
- * proxy and the other is too or is a constant value (e.g. IStringBeanProxy.equals(String),
- * then true if values are equals.
- */
- public boolean equals(Object anObject) {
- if (this == anObject)
- return true; // Identity
- if (anObject instanceof REMCharacterClassBeanProxy)
- return fCharValue.charValue() == ((REMCharacterClassBeanProxy) anObject).charValue();
- if (anObject instanceof Character)
- return fCharValue.charValue() == ((Character) anObject).charValue();
- return false;
- }
-
- /**
- * Return the char value
- */
- public char charValue() {
- return fCharValue.charValue();
- }
- /**
- * Return the java.lang.Character value
- */
- public Character characterValue() {
- return fCharValue;
- }
-
- /**
- * Answer the toString() of the value.
- */
- public String toBeanString() {
- return fCharValue.toString();
- }
-
- /**
- * Get the beantype
- */
- public IBeanTypeProxy getTypeProxy() {
- return ((REMStandardBeanTypeProxyFactory) fFactory.getBeanTypeProxyFactory()).characterClass;
- }
-
- /**
- * Render the bean into value object.
- */
- public void renderBean(Commands.ValueObject value) {
- value.set(fCharValue);
- }
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.INumberBeanProxy#byteValue()
- */
- public byte byteValue() {
- return (byte) fCharValue.charValue();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.INumberBeanProxy#doubleValue()
- */
- public double doubleValue() {
- return fCharValue.charValue();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.INumberBeanProxy#floatValue()
- */
- public float floatValue() {
- return fCharValue.charValue();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.INumberBeanProxy#intValue()
- */
- public int intValue() {
- return fCharValue.charValue();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.INumberBeanProxy#longValue()
- */
- public long longValue() {
- return fCharValue.charValue();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.INumberBeanProxy#numberValue()
- */
- public Number numberValue() {
- return new Integer(charValue()); // Kludge.
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.INumberBeanProxy#shortValue()
- */
- public short shortValue() {
- return (short) fCharValue.charValue();
- }
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMCharacterClassBeanTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMCharacterClassBeanTypeProxy.java
deleted file mode 100644
index b3d9ff7da..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMCharacterClassBeanTypeProxy.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-
-import org.eclipse.jem.internal.proxy.core.*;
-import org.eclipse.jem.internal.proxy.common.remote.Commands;
-
-/**
- * Character BeanType Proxy for Character.class.
- * Creation date: (2/23/00 1:59:02 PM)
- * @author: Richard Lee Kulp
- */
-final class REMCharacterClassBeanTypeProxy extends REMAbstractBeanTypeProxy implements IREMConstantBeanTypeProxy {
- final REMCharacterClassBeanProxy nilProxy; // Value of '\0'
-
-REMCharacterClassBeanTypeProxy(REMProxyFactoryRegistry aRegistry, IBeanTypeProxy objectType) {
- super(aRegistry, new Integer(Commands.CHARACTER_CLASS), Character.class.getName(), objectType);
-
- nilProxy = new REMCharacterClassBeanProxy(aRegistry, new Character('\0'));
-}
-/**
- * Static helper to create a bean proxy
- * Package protected because everyone should go through the factory API
- * that is defined as part of IBeanProxyFactory
- */
-ICharacterBeanProxy createCharacterBeanProxy(Character aCharacter) {
- return (aCharacter.charValue() != '\0') ?
- new REMCharacterClassBeanProxy(fRegistry, aCharacter) : nilProxy;
-}
-
-/**
- * Create a new bean proxy with the specified id.
- *
- * For all of the primitive wrapper types, this is an invalid operation. They are created
- * explicitly through the appropriate create method.
- */
-public IREMBeanProxy newBeanProxy(Integer anID) {
- throw new UnsupportedOperationException();
-}
-
-/**
- * newBeanTypeForClass: Create a new beantypeproxy of this kind for the given class.
- * This is used by beantype proxy factory when creating a beantype proxy for a subclass.
- * This is because subclasses, unless explicitly overridden, should use the same kind
- * of beantype proxy. This way if anything special is needed for a specific type, then
- * that can be done.
- *
- * For all of the primitive wrapper types, they are final classes, so you can't create a newBeanType
- * for subclasses.
- */
-public IREMBeanTypeProxy newBeanTypeForClass(Integer anID, String aClassname, boolean anAbstract) {
- throw new UnsupportedOperationException();
-}
-
-/**
- * newInstance method. Character doesn't have a default ctor, so the standard way won't work.
- * Return the nilProxy for this case because that is the default value.
- */
-public IBeanProxy newInstance() {
- return nilProxy;
-}
-
-/**
- * Create a new bean proxy the ValueObject passed in.
- * We will assume the object is correct type.
- */
-public IBeanProxy newBeanProxy(Commands.ValueObject value) {
- return createCharacterBeanProxy(new Character(value.aChar));
-}
-}
-
-
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMCharacterTypeBeanProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMCharacterTypeBeanProxy.java
deleted file mode 100644
index 1c8966bc3..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMCharacterTypeBeanProxy.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
- * $RCSfile: REMCharacterTypeBeanProxy.java,v $ $Revision: 1.6 $ $Date: 2005/08/24 20:39:07 $
- */
-
-import org.eclipse.jem.internal.proxy.common.remote.Commands;
-import org.eclipse.jem.internal.proxy.core.*;
-/**
- * Remote implementation of ICharacterBeanProxy. Creation date: (2/6/00 9:02:54 AM) @author: Joe
- * Winchester
- */
-final class REMCharacterTypeBeanProxy extends REMConstantBeanProxy implements ICharacterBeanProxy {
- protected char fChar;
-
- REMCharacterTypeBeanProxy(REMProxyFactoryRegistry aRegistry, char value) {
- super(aRegistry);
- fChar = value;
- }
-
- /**
- * equals: Equal if: 1) This proxy == (identity) to the other object 2) Else if other is an
- * IBeanProxy and not a constant one, then if equals on the server. 3) If this is a constant
- * proxy and the other is too or is a constant value (e.g. IStringBeanProxy.equals(String),
- * then true if values are equals.
- */
- public boolean equals(Object anObject) {
- if (this == anObject)
- return true; // Identity
- if (anObject instanceof REMCharacterTypeBeanProxy)
- return fChar == ((REMCharacterTypeBeanProxy) anObject).charValue();
- if (anObject instanceof Character)
- return fChar == ((Character) anObject).charValue();
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanProxy#sameAs(org.eclipse.jem.internal.proxy.core.IBeanProxy)
- */
- public boolean sameAs(IBeanProxy aBeanProxy) {
- if (this == aBeanProxy)
- return true; // Identity
- if (aBeanProxy instanceof REMCharacterTypeBeanProxy)
- return fChar == ((REMCharacterTypeBeanProxy) aBeanProxy).charValue();
- return false;
- }
-
- /**
- * Return the char value
- */
- public char charValue() {
- return fChar;
- }
- /**
- * Return the java.lang.Character value
- */
- public Character characterValue() {
- return new Character(fChar);
- }
-
- /**
- * Answer the toString() of the value.
- */
- public String toBeanString() {
- return String.valueOf(fChar);
- }
-
- /**
- * Get the beantype
- */
- public IBeanTypeProxy getTypeProxy() {
- return ((REMStandardBeanTypeProxyFactory) fFactory.getBeanTypeProxyFactory()).charType;
- }
-
- /**
- * Render the bean into value object.
- */
- public void renderBean(Commands.ValueObject value) {
- value.set(fChar);
- }
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.INumberBeanProxy#byteValue()
- */
- public byte byteValue() {
- return (byte) fChar;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.INumberBeanProxy#doubleValue()
- */
- public double doubleValue() {
- return fChar;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.INumberBeanProxy#floatValue()
- */
- public float floatValue() {
- return fChar;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.INumberBeanProxy#intValue()
- */
- public int intValue() {
- return fChar;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.INumberBeanProxy#longValue()
- */
- public long longValue() {
- return fChar;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.INumberBeanProxy#numberValue()
- */
- public Number numberValue() {
- return new Integer(fChar); // Kludge
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.INumberBeanProxy#shortValue()
- */
- public short shortValue() {
- return (short) fChar;
- }
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMCharacterTypeBeanTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMCharacterTypeBeanTypeProxy.java
deleted file mode 100644
index 2c9f309af..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMCharacterTypeBeanTypeProxy.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-
-import org.eclipse.jem.internal.proxy.core.*;
-import org.eclipse.jem.internal.proxy.common.remote.Commands;
-
-/**
- * Character.TYPE BeanType Proxy.
- * Creation date: (2/23/00 1:59:02 PM)
- * @author: Richard Lee Kulp
- */
-final class REMCharacterTypeBeanTypeProxy extends REMPrimitiveBeanTypeProxy {
-
- final REMCharacterTypeBeanProxy nilProxy; // Value of '\0'
-/**
- * REMCharacterBeanTypeProxy constructor comment.
- * @param aClass java.lang.Class
- */
-REMCharacterTypeBeanTypeProxy(REMProxyFactoryRegistry aRegistry) {
- super(aRegistry, new Integer(Commands.CHARACTER_TYPE), Character.TYPE.getName());
-
- nilProxy = new REMCharacterTypeBeanProxy(aRegistry, '\0');
-}
-
-/**
- * Static helper to create a bean proxy
- * Package protected because everyone should go through the factory API
- * that is defined as part of IBeanProxyFactory
- * Use the cache.
- */
-ICharacterBeanProxy createCharacterBeanProxy(char aCharacter) {
- return new REMCharacterTypeBeanProxy(fRegistry, aCharacter);
-}
-
-/**
- * newInstance method. Character doesn't have a default ctor, so the standard way won't work.
- * Return the nilProxy for this case because that is the default value.
- */
-public IBeanProxy newInstance() {
- return nilProxy;
-}
-
-/**
- * Create a new bean proxy the ValueObject passed in.
- * We will assume the object is correct type.
- */
-public IBeanProxy newBeanProxy(Commands.ValueObject value) {
- return createCharacterBeanProxy(value.aChar);
-}
-}
-
-
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMClassBeanTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMClassBeanTypeProxy.java
deleted file mode 100644
index cd8da01cf..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMClassBeanTypeProxy.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-
-import org.eclipse.jem.internal.proxy.core.*;
-import org.eclipse.jem.internal.proxy.common.remote.Commands;
-/**
- * This is a bean type for the Class object. It is needed so that
- * when a new object id comes in that represents a class, it will
- * go through this bean type to create it. We need to do something
- * special so that the correct bean type object is created.
- */
-
-final class REMClassBeanTypeProxy extends REMAbstractBeanTypeProxy {
-
-
-REMClassBeanTypeProxy(REMProxyFactoryRegistry aRegistry, IBeanTypeProxy objectType) {
- super(aRegistry, new Integer(Commands.CLASS_CLASS), Class.class.getName(), objectType);
-}
-
-/**
- * Note: Since new instances of Class are never done through a default ctor,
- * this function is not supported.
- */
-public IBeanProxy newInstance() {
- throw new UnsupportedOperationException();
-}
-
-/**
- * Note: Since new instances of Class are never done through a initialization strings,
- * this function is not supported.
- */
-public IBeanProxy newInstance(String initializationString) {
- throw new UnsupportedOperationException();
-}
-
-/**
- * newBeanTypeForClass: Create a new beantypeproxy of this kind for the given class.
- * This is used by beantype proxy factory when creating a beantype proxy for a subclass.
- * This is because subclasses, unless explicitly overridden, should use the same kind
- * of beantype proxy. This way if anything special is needed for a specific type, then
- * that can be done.
- *
- * NOTE: Since the Class type is final, this function isn't supported.
- */
-public IREMBeanTypeProxy newBeanTypeForClass(Integer anID, String aClassname, boolean anAbstract) {
- throw new UnsupportedOperationException();
-}
-
-/**
- * Create a new bean proxy with the specified id.
- *
- * In this case it means we need a new IBeanProxyType. We will let the
- * Beantype factory handle this since it knows how to get the information
- * for a specific id.
- */
-public IREMBeanProxy newBeanProxy(Integer anID) {
- return ((REMStandardBeanTypeProxyFactory) fRegistry.getBeanTypeProxyFactory()).createBeanTypeProxy(anID);
-}
-
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMConnection.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMConnection.java
deleted file mode 100644
index d37e8007f..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMConnection.java
+++ /dev/null
@@ -1,342 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-
-import java.io.*;
-import java.net.Socket;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-
-import org.eclipse.jem.internal.proxy.common.CommandException;
-import org.eclipse.jem.internal.proxy.common.remote.*;
-import org.eclipse.jem.internal.proxy.common.remote.Commands.*;
-import org.eclipse.jem.internal.proxy.core.ProxyPlugin;
-import org.eclipse.jem.util.TimerTests;
-/**
- * The default implementation of the connection.
- *
- * It uses the property "proxyvm.bufsize" to determine the buffer size to use. If not specified, it uses the system default
- */
-public class REMConnection implements IREMConnection, IREMExpressionConnection {
-
- public final static String INVOKE_STEP = "Invoke"; //$NON-NLS-1$
- public final static String INVOKE_METHOD_STEP = "Invoke Method"; //$NON-NLS-1$
- protected Socket fSocket = null;
- protected DataInputStream in = null;
- protected DataOutputStream out = null;
- private static final int TIME_OUT = 1000 * 60; // Wait up to a minute before timeout.
-
- public REMConnection(Socket socket, boolean noTimeouts) {
- try {
- fSocket = socket;
- fSocket.setSoLinger(true, 30); // Wait 30 seconds if necessary for the final stuff to go out after closing.
- if (!noTimeouts)
- fSocket.setSoTimeout(TIME_OUT); // Timeout period
- Integer bufSize = Integer.getInteger("proxyvm.bufsize"); //$NON-NLS-1$
- if (bufSize == null)
- bufSize = new Integer(16000);
- out = new DataOutputStream(new BufferedOutputStream(fSocket.getOutputStream(), bufSize.intValue())); // It didn't take the hint, so we will buffer it.
- in = new DataInputStream(new BufferedInputStream(fSocket.getInputStream(), bufSize.intValue())); // It didn't take the hint, so we will buffer it.
- } catch (IOException e) {
- ProxyPlugin.getPlugin().getLogger().log(new Status(IStatus.ERROR, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "", e)); //$NON-NLS-1$
-
- if (out != null)
- try {
- out.close();
- } catch (IOException e2) {
- }
- if (in != null)
- try {
- in.close();
- } catch (IOException e3) {
- }
- try {
- fSocket.close();
- } catch (IOException e4) {
- }
- fSocket = null;
- in = null;
- out = null;
- }
- }
-
- /**
- * Did this construct correctly.
- * This is needed because an exception could be thrown in the ctor and
- * that's not a good thing to do.
- */
- public boolean isConnected() {
- return fSocket != null;
- }
-
- /**
- * Terminate the server.
- */
- public void terminateServer() {
- if (isConnected()) {
- try {
- Commands.sendTerminateCommand(out);
- } catch (IOException e) {
- }
- close();
- }
- }
-
- /**
- * Close the connection.
- */
- public void close() {
- if (isConnected()) {
- try {
- Commands.sendQuitCommand(out);
- } catch (IOException e) {
- } finally {
- try {
- out.close();
- } catch (IOException e2) {
- }
- try {
- in.close();
- } catch (IOException e3) {
- }
- try {
- fSocket.close();
- } catch (IOException e4) {
- }
- }
- fSocket = null;
- in = null;
- out = null;
- }
- }
-
-
- /**
- * Return the class information.
- */
- public GetClassReturn getClass(String className) throws CommandException {
- if (isConnected())
- try {
- // It's simple, just pass onto Commands.
- return Commands.sendGetClassCommand(out, in, className);
- } catch (CommandErrorException e) {
- if (e.getErrorCode() != Commands.GET_CLASS_NOT_FOUND)
- throw e; // Not class not found, send it on
- }
- return null; // Not found, so return null
- }
-
-
- /**
- * Return the class information given an ID.
- */
- public GetClassIDReturn getClassFromID(int classID) throws CommandException {
- if (isConnected()) {
- // It's simple, just pass onto Commands.
- return Commands.sendGetClassFromIDCommand(out, in, classID);
- }
- return null; // Not found, so return null
- }
-
- /**
- * Get the object data from an id.
- */
- public void getObjectData(int classID, Commands.ValueObject valueReturn) throws CommandException {
- if (isConnected()) {
- // Just pass onto Commands.
- Commands.sendGetObjectData(out, in, classID, valueReturn);
- } else
- valueReturn.set(); // Set it to null since we aren't connected.
- }
-
- /**
- * Get a new instance using an init string
- */
- public void getNewInstance(int classID, String initString, Commands.ValueObject newInstance) throws CommandException {
- if (isConnected()) {
- // Just pass onto Commands.
- Commands.sendNewInstance(out, in, classID, initString, newInstance);
- } else
- newInstance.set(); // Set it to null since we aren't connected.
- }
-
- /**
- * Release the id.
- */
- public void releaseID(int id){
- if (isConnected())
- try {
- // Just pass onto Commands.
- Commands.releaseObjectCommand(out, id);
- } catch (IOException e) {
- // Don't care it didn't work
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.remote.IREMConnection#getArrayContents(int, org.eclipse.jem.internal.proxy.common.remote.Commands.ValueObject)
- */
- public void getArrayContents(int arrayID, Commands.ValueObject returnValue) throws CommandException {
- if (isConnected()) {
- // It's simple, just pass onto Commands.
- Commands.sendGetArrayContentsCommand(out, in, arrayID, returnValue);
- }
- }
-
- /**
- * Invoke the method call
- */
- public void invokeMethod(int methodID, Commands.ValueObject invokeOn, Commands.ValueObject parms, Commands.ValueObject returnValue) throws CommandException {
- if (isConnected()) {
- // It's simple, just pass onto Commands.
- TimerTests.basicTest.startCumulativeStep(INVOKE_METHOD_STEP);
- Commands.sendInvokeMethodCommand(out, in, methodID, invokeOn, parms, returnValue);
- TimerTests.basicTest.stopCumulativeStep(INVOKE_METHOD_STEP);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.remote.IREMConnection#invokeMethod(org.eclipse.jem.internal.proxy.common.remote.Commands.ValueObject, java.lang.String, org.eclipse.jem.internal.proxy.common.remote.Commands.ValueObject, org.eclipse.jem.internal.proxy.common.remote.Commands.ValueObject, org.eclipse.jem.internal.proxy.common.remote.Commands.ValueObject, org.eclipse.jem.internal.proxy.common.remote.Commands.ValueObject)
- */
- public void invokeMethod(ValueObject classType, String methodName, ValueObject parmTypes, ValueObject invokeOn, ValueObject parms,
- ValueObject returnValue) throws CommandException {
- if (isConnected()) {
- // It's simple, just pass onto Commands.
- TimerTests.basicTest.startCumulativeStep(INVOKE_STEP);
- Commands.sendInvokeMethodCommand(out, in, classType, methodName, parmTypes, invokeOn, parms, returnValue);
- TimerTests.basicTest.stopCumulativeStep(INVOKE_STEP);
- }
- }
-
- /* ************************************************************
- * Put the Expression processing commands here.
- *
- * ************************************************************/
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.remote.IREMExpressionConnection#startExpressionProcessing()
- */
- public void startExpressionProcessing(int expressionID, byte trace) throws IOException {
- if (isConnected())
- ExpressionCommands.sendStartExpressionProcessingCommand(expressionID, trace, out);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.remote.IREMExpressionConnection#pushExpressionCommand(byte)
- */
- public void pushExpressionCommand(int expressionID, byte subcommand) throws IOException {
- if (isConnected())
- ExpressionCommands.sendExpressionCommand(expressionID, out, subcommand);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.remote.IREMExpressionConnection#stopExpressionProcessing()
- */
- public void stopExpressionProcessing(int expressionID) throws IOException {
- if (isConnected())
- ExpressionCommands.sendEndExpressionProcessingCommand(expressionID, out);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.remote.IREMExpressionConnection#pushValueObject(org.eclipse.jem.internal.proxy.common.remote.Commands.ValueObject)
- */
- public void pushValueObject(ValueObject valueObject) throws CommandException {
- if (isConnected())
- Commands.writeValue(out, valueObject, false);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.remote.IREMExpressionConnection#pushByte(byte)
- */
- public void pushByte(byte abyte) throws IOException {
- if (isConnected())
- ExpressionCommands.sendByte(out, abyte);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.remote.IREMExpressionConnection#pushInt(int)
- */
- public void pushInt(int anInt) throws IOException {
- if (isConnected())
- ExpressionCommands.sendInt(out, anInt);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.remote.IREMExpressionConnection#pushString(java.lang.String)
- */
- public void pushString(String aString) throws IOException {
- if (isConnected())
- ExpressionCommands.sendString(out, aString);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.remote.IREMExpressionConnection#pushBoolean(boolean)
- */
- public void pushBoolean(boolean aBool) throws IOException {
- if (isConnected())
- ExpressionCommands.sendBoolean(out, aBool);
- }
-
-
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.remote.IREMExpressionConnection#getFinalValue(org.eclipse.jem.internal.proxy.common.remote.Commands.ValueObject)
- */
- public void getFinalValue(ValueObject result) throws CommandException {
- if (isConnected())
- Commands.readBackValue(in, result, Commands.NO_TYPE_CHECK);
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.remote.IREMExpressionConnection#pullValue(int, org.eclipse.jem.internal.proxy.common.remote.Commands.ValueObject)
- */
- public void pullValue(int expressionID, ValueObject proxyids, ValueSender sender) throws CommandException {
- if (isConnected())
- ExpressionCommands.sendPullValueCommand(expressionID, out, in, proxyids, sender);
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.remote.IREMExpressionConnection#sync(int, org.eclipse.jem.internal.proxy.common.remote.Commands.ValueObject)
- */
- public void sync(int expressionID, ValueObject proxyids, ValueSender sender) throws CommandException {
- if (isConnected())
- ExpressionCommands.sendSyncCommand(expressionID, out, in, proxyids, sender);
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.remote.IREMConnection#readProxyArrayValues(org.eclipse.jem.internal.proxy.common.remote.Commands.ValueObject, org.eclipse.jem.internal.proxy.common.remote.Commands.ValueSender, boolean)
- */
- public void readProxyArrayValues(Commands.ValueObject returnValue, Commands.ValueSender valueSender, boolean allowFlag) throws CommandException {
- if (isConnected())
- Commands.readArray(in, returnValue.anInt, valueSender, returnValue, allowFlag);
- }
-
- public void transferExpression(int expressionID, ValueObject expController) throws CommandException {
- if (isConnected())
- ExpressionCommands.sendTransferExpressionCommand(expressionID, out, in, expController);
- }
-
- public void resumeExpression(int expressionID, ValueObject expController) throws CommandException {
- if (isConnected())
- ExpressionCommands.sendResumeExpressionCommand(expressionID, out, expController);
- }
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMConstantBeanProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMConstantBeanProxy.java
deleted file mode 100644
index 7742b5bb3..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMConstantBeanProxy.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-
-import org.eclipse.jem.internal.proxy.common.remote.Commands;
-import org.eclipse.jem.internal.proxy.core.IBeanProxy;
-import org.eclipse.jem.internal.proxy.core.ProxyFactoryRegistry;
-/**
- * This is a base for bean proxies that are constants and
- * do not have an object on the remote VM side. They are
- * shipped back and forth by value.
- */
-
-public abstract class REMConstantBeanProxy implements IREMConstantBeanProxy {
- protected final REMProxyFactoryRegistry fFactory;
- private final static Integer ID = new Integer(Commands.NOT_AN_ID);
-
- protected REMConstantBeanProxy(REMProxyFactoryRegistry aFactory) {
- fFactory = aFactory;
- }
- /**
- * Return the registry this proxy was created with.
- */
- public ProxyFactoryRegistry getProxyFactoryRegistry() {
- return fFactory;
- }
-
- /**
- * equals: Equal if:
- * 1) This proxy == (identity) to the other object
- * 2) Else if other is an IBeanProxy and not a constant one, then if
- * equals on the server.
- * 3) If this is a constant proxy and the other is too or is a constant
- * value (e.g. IStringBeanProxy.equals(String), then true if values are equals.
- * This is abstract because each type needs to do a unique test for equality.
- */
- public abstract boolean equals(Object anObject);
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IBeanProxy#sameAs(org.eclipse.jem.internal.proxy.core.IBeanProxy)
- */
- public boolean sameAs(IBeanProxy aBeanProxy) {
- // We can't be assured that there are not non-identical constants that are actually identical.
- // This is because for constants we do not know the id of the original. That is not sent across from the vm.
- return this == aBeanProxy;
- }
-
- /**
- * Return the ID of this proxy.
- * Constants have no id's, so we return -1.
- */
- public Integer getID() {
- return ID;
- }
-
- /**
- * isValid. Constant ones are always valid unless the registry is terminated, except if an
- * override releases resources. In that case the overriding
- * subclass should also override isValid() to return false
- * if release() was called.
- */
- public boolean isValid() {
- return fFactory.isValid();
- }
-
- /**
- * release. Constant ones don't need to typically be released, however
- * if an override does do something to release, then it MUST also
- * override isValid() to return false.
- */
- public void release() {
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IProxy#isBeanProxy()
- */
- public final boolean isBeanProxy() {
- return true;
- }
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IProxy#isExpressionProxy()
- */
- public final boolean isExpressionProxy() {
- return false;
- }
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMConstructorProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMConstructorProxy.java
deleted file mode 100644
index 555670a3c..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMConstructorProxy.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-
-import org.eclipse.jem.internal.proxy.common.remote.Commands;
-import org.eclipse.jem.internal.proxy.common.remote.TransmitableArray;
-import org.eclipse.jem.internal.proxy.core.*;
-/**
- * Proxy for a constructor.
- */
-
-final class REMConstructorProxy extends REMAccessibleObjectProxy implements IConstructorProxy {
-
- REMConstructorProxy(REMProxyFactoryRegistry aRegistry, Integer anID) {
- super(aRegistry, anID);
- }
-
- /**
- * Using this constructor (assuming it takes no arguments) create a new instance.
- * Exception will be raised if this constructor takes arguments.
- */
- public IBeanProxy newInstance() throws ThrowableProxy {
- return newInstance(null);
- }
-
- /**
- * The type proxy is constant proxy out of the method factory.
- */
- public IBeanTypeProxy getTypeProxy() {
- return ((REMMethodProxyFactory) fFactory.getMethodProxyFactory()).ctorType;
- }
-
- /**
- * Using this constructor (with the arguments) create a new instance.
- * Exception will be raised if arguments don't match the constructor.
- */
- public IBeanProxy newInstance(IBeanProxy[] creationArguments) throws ThrowableProxy {
- IREMMethodProxy newInstanceMethod =
- (IREMMethodProxy) REMStandardBeanProxyConstants.getConstants(fFactory).getConstructorNewInstance();
-
- // Constructor.newInstance takes one parm (Object[]) where [0] is an Object[] of the arguments to the constructor.
- Object[] parms = null;
- if (creationArguments != null)
- parms = new Object[] { new TransmitableArray(Commands.OBJECT_CLASS, creationArguments)};
-
- return newInstanceMethod.invokeWithParms(this, parms);
- }
- public IBeanProxy newInstanceCatchThrowableExceptions() {
- try {
- return newInstance();
- } catch (ThrowableProxy e) {
- ProxyPlugin.getPlugin().getLogger().log(new Status(IStatus.WARNING, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "", e)); //$NON-NLS-1$
- fFactory.releaseProxy(e); // Since it's no longer needed, get rid of now instead of GC time.
- return null;
- }
- }
- public IBeanProxy newInstanceCatchThrowableExceptions(IBeanProxy[] args) {
- try {
- return newInstance(args);
- } catch (ThrowableProxy e) {
- ProxyPlugin.getPlugin().getLogger().log(new Status(IStatus.WARNING, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "", e)); //$NON-NLS-1$
- fFactory.releaseProxy(e); // Since it's no longer needed, get rid of now instead of GC time.
- return null;
- }
- }
-
- private IBeanTypeProxy[] fParameterTypes;
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IConstructorProxy#getParameterTypes()
- */
- public synchronized IBeanTypeProxy[] getParameterTypes() {
- if (fParameterTypes == null) {
- IArrayBeanProxy parmTypes = (IArrayBeanProxy) REMStandardBeanProxyConstants.getConstants(fFactory)
- .getConstructorParameterTypesMessage().invokeCatchThrowableExceptions(this);
- if (parmTypes == null)
- fParameterTypes = new IBeanTypeProxy[0]; // There was some error, only way null is returned
- else {
- int len = parmTypes.getLength();
- fParameterTypes = new IBeanTypeProxy[len];
- for (int i = 0; i < len; i++)
- try {
- fParameterTypes[i] = (IBeanTypeProxy) parmTypes.get(i);
- } catch (ThrowableProxy e) {
- }
- fFactory.releaseProxy(parmTypes); // Don't need the array on the server anymore.
- }
- }
-
- return fParameterTypes;
- }
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMConstructorTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMConstructorTypeProxy.java
deleted file mode 100644
index 831ab2859..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMConstructorTypeProxy.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-
-import org.eclipse.jem.internal.proxy.core.*;
-import org.eclipse.jem.internal.proxy.common.remote.Commands;
-/**
- * BeanType Proxy for Method class.
- */
-
-final class REMConstructorTypeProxy extends REMAbstractBeanTypeProxy {
-
-REMConstructorTypeProxy(REMProxyFactoryRegistry aRegistry, IBeanTypeProxy accessibleTypeProxy) {
- super(aRegistry, new Integer(Commands.CONSTRUCTOR_CLASS), java.lang.reflect.Constructor.class.getName(), accessibleTypeProxy);
-}
-
-/**
- * newBeanTypeForClass: Create a new beantypeproxy of this kind for the given class.
- * This is used by beantype proxy factory when creating a beantype proxy for a subclass.
- * This is because subclasses, unless explicitly overridden, should use the same kind
- * of beantype proxy. This way if anything special is needed for a specific type, then
- * that can be done.
- *
- * For all of the accessible object types, they are final classes, so you can't create a newBeanType
- * for subclasses.
- */
-public IREMBeanTypeProxy newBeanTypeForClass(Integer anID, String aClassname, boolean anAbstract) {
- throw new UnsupportedOperationException();
-}
-
-/**
- * Specialized from REMAbstractBeanTypeProxy to ensure Constructor proxies are created correctly.
- */
-public IREMBeanProxy newBeanProxy(Integer objectID) {
- return new REMConstructorProxy(fRegistry, objectID);
-}
-
-/**
- * Note: Since new instances of Constructor are never done through a default ctor,
- * this function is not supported.
- */
-public IBeanProxy newInstance() {
- throw new UnsupportedOperationException();
-}
-
-/**
- * Note: Since new instances of Constructor are never done through an initialization string,
- * this function is not supported.
- */
-public IBeanProxy newInstance(String initializationString) {
- throw new UnsupportedOperationException();
-}
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMDoubleClassBeanProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMDoubleClassBeanProxy.java
deleted file mode 100644
index 1b124dc24..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMDoubleClassBeanProxy.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-
-import org.eclipse.jem.internal.proxy.core.*;
-import org.eclipse.jem.internal.proxy.common.remote.Commands;
-/**
- * Remote Proxy for Double.class.
- */
-class REMDoubleClassBeanProxy extends REMNumberBeanProxy {
-
-REMDoubleClassBeanProxy(REMProxyFactoryRegistry aRegistry, Double aDouble) {
- super(aRegistry, aDouble);
-}
-
-/**
- * Get the beantype
- */
-public IBeanTypeProxy getTypeProxy() {
- return ((REMStandardBeanTypeProxyFactory) fFactory.getBeanTypeProxyFactory()).doubleClass;
-}
-
-/**
- * Render the bean into value object.
- */
-public void renderBean(Commands.ValueObject value) {
- value.set((Double) numberValue());
-}
-}
-
-
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMDoubleClassBeanTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMDoubleClassBeanTypeProxy.java
deleted file mode 100644
index 1f316f77f..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMDoubleClassBeanTypeProxy.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-
-import org.eclipse.jem.internal.proxy.core.*;
-import org.eclipse.jem.internal.proxy.common.remote.Commands;
-/**
- * Remote Implementation of IBeanTypeProxy for Double.class.
- * Creation date: (2/6/00 9:01:40 AM)
- * @author: Joe Winchester
- */
-final class REMDoubleClassBeanTypeProxy extends REMAbstractNumberBeanTypeProxy {
-// Some values are cache'd for speed
- private final INumberBeanProxy zeroProxy;
-/**
- * REMIntegerBeanTypeProxy constructor comment.
- * @param aClass java.lang.Class
- */
-REMDoubleClassBeanTypeProxy(REMProxyFactoryRegistry aRegistry, IBeanTypeProxy numberType) {
- super(aRegistry, new Integer(Commands.DOUBLE_CLASS), Double.class.getName(), numberType);
-
- // Create the cached values
- zeroProxy = new REMDoubleClassBeanProxy(aRegistry, new Double(0D));
-}
-
-/**
- * Helper to create a bean proxy
- * Package protected because everyone should go through the factory API
- * that is defined as part of IBeanProxyFactory
- */
-INumberBeanProxy createDoubleBeanProxy(Double aDouble) {
- return (aDouble.doubleValue() != 0D) ?
- new REMDoubleClassBeanProxy(fRegistry, aDouble) : zeroProxy;
-}
-
-/**
- * Generic way to create an Double proxy, however, the Number must be a Double.
- */
-protected INumberBeanProxy createNumberBeanProxy(Number aNumber) {
- return createDoubleBeanProxy((Double) aNumber);
-}
-
-/**
- * newInstance method. Number's don't have a default ctor, so the standard way won't work.
- * Return the zero proxy for this case.
- */
-public IBeanProxy newInstance() {
- return zeroProxy;
-}
-
-/**
- * Create a new bean proxy the ValueObject passed in.
- * We will assume the object is correct type.
- */
-public IBeanProxy newBeanProxy(Commands.ValueObject value) {
- return createDoubleBeanProxy(new Double(value.aDouble));
-}
-}
-
-
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMDoubleTypeBeanProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMDoubleTypeBeanProxy.java
deleted file mode 100644
index 90f075c1a..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMDoubleTypeBeanProxy.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-
-import org.eclipse.jem.internal.proxy.common.remote.Commands;
-import org.eclipse.jem.internal.proxy.core.*;
-/**
- * Remote Implementation of INumberProxy for the primitive "double".
- * It can answer all of the primitive number types (int, long, short, byte, double, float).
- * Creation date: (2/6/00 9:02:54 AM)
- * @author: Joe Winchester
- */
-class REMDoubleTypeBeanProxy extends REMConstantBeanProxy implements INumberBeanProxy {
- private final double fDouble;
-
-/**
- * It is package protected because they are created
- * in a special way and no one else should create them.
- * @param aBean java.lang.Object
- */
-REMDoubleTypeBeanProxy(REMProxyFactoryRegistry aRegistry, double aDouble) {
- super(aRegistry);
- fDouble = aDouble;
-}
-
-/**
- * equals: Equal if:
- * 1) This proxy == (identity) to the other object
- * 2) Else if other is an IBeanProxy and not a constant one, then if
- * equals on the server.
- * 3) If this is a constant proxy and the other is too or is a constant
- * value (e.g. IStringBeanProxy.equals(String), then true if values are equals.
- */
-public boolean equals(Object anObject) {
- if (this == anObject)
- return true; // Identity
- if (anObject instanceof REMDoubleTypeBeanProxy)
- return fDouble == ((REMDoubleTypeBeanProxy) anObject).doubleValue();
- if (anObject instanceof Double)
- return fDouble == ((Double) anObject).doubleValue();
- return false;
-}
-
-/* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IBeanProxy#sameAs(org.eclipse.jem.internal.proxy.core.IBeanProxy)
- */
-public boolean sameAs(IBeanProxy aBeanProxy) {
- if (this == aBeanProxy)
- return true; // Identity
- if (aBeanProxy instanceof REMDoubleTypeBeanProxy)
- return fDouble == ((REMDoubleTypeBeanProxy) aBeanProxy).doubleValue();
- return false;
-}
-
-/**
- * byteValue method comment.
- */
-public byte byteValue() {
- return (byte) fDouble;
-}
-/**
- * doubleValue method comment.
- */
-public double doubleValue() {
- return fDouble;
-}
-/**
- * floatValue method comment.
- */
-public float floatValue() {
- return (float) fDouble;
-}
-/**
- * Return the int value
- */
-public int intValue() {
- return (int) fDouble;
-}
-/**
- * longValue method comment.
- */
-public long longValue() {
- return (long) fDouble;
-}
-/**
- * numberValue method comment.
- */
-public Number numberValue() {
- return new Double(fDouble);
-}
-/**
- * shortValue method comment.
- */
-public short shortValue() {
- return (short) fDouble;
-}
-
-/**
- * The bean's toString.
- */
-public String toBeanString() {
- return String.valueOf(fDouble);
-}
-
-/**
- * Get the beantype
- */
-public IBeanTypeProxy getTypeProxy() {
- return ((REMStandardBeanTypeProxyFactory) fFactory.getBeanTypeProxyFactory()).doubleType;
-}
-
-/**
- * Render the bean into value object.
- */
-public void renderBean(Commands.ValueObject value) {
- value.set(fDouble);
-}
-}
-
-
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMDoubleTypeBeanTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMDoubleTypeBeanTypeProxy.java
deleted file mode 100644
index aa17f7d65..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMDoubleTypeBeanTypeProxy.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-
-import org.eclipse.jem.internal.proxy.core.*;
-import org.eclipse.jem.internal.proxy.common.remote.Commands;
-/**
- * Remote Implementation of IBeanTypeProxy for Double.TYPE
- * Creation date: (2/6/00 9:01:40 AM)
- * @author: Joe Winchester
- */
-final class REMDoubleTypeBeanTypeProxy extends REMPrimitiveBeanTypeProxy {
-// Some values are cache'd for speed
- private final INumberBeanProxy zeroProxy;
-/**
- * REMIntegerBeanTypeProxy constructor comment.
- * @param aClass java.lang.Class
- */
-REMDoubleTypeBeanTypeProxy(REMProxyFactoryRegistry aRegistry) {
- super(aRegistry, new Integer(Commands.DOUBLE_TYPE), Double.TYPE.getName());
-
- // Create the cached values
- zeroProxy = new REMDoubleTypeBeanProxy(aRegistry, 0D);
-}
-
-/**
- * Helper to create a bean proxy
- * Package protected because everyone should go through the factory API
- * that is defined as part of IBeanProxyFactory
- */
-INumberBeanProxy createDoubleBeanProxy(double aDouble) {
- return (aDouble != 0D) ?
- new REMDoubleTypeBeanProxy(fRegistry, aDouble) : zeroProxy;
-}
-
-/**
- * newInstance method. double is a primitive, so the standard way won't work.
- * Return the zeroProxy for this case because that is the default value.
- */
-public IBeanProxy newInstance() {
- return zeroProxy;
-}
-
-/**
- * Create a new bean proxy the ValueObject passed in.
- * We will assume the object is correct type.
- */
-public IBeanProxy newBeanProxy(Commands.ValueObject value) {
- return createDoubleBeanProxy(value.aDouble);
-}
-
-/**
- * Short cut for newInstance where the string follows the
- * specific pattern we expect. That way it won't be necessary to ship over to the vm
- * to process it.
- *
- * The pattern it can accept is:
- * 1) (double) validNumber - number can be any number because (double) explicitly casts it down.
- * 2) validNumber
- * It will use the decode function of double to determine the valid number.
- */
-public IBeanProxy newInstance(String initializationString) throws ThrowableProxy, ClassCastException, InstantiationException {
- String trim = initializationString.trim();
- if (trim.length() == 0)
- return super.newInstance(initializationString);
- double aDouble;
- if (trim.startsWith("(double)")) { //$NON-NLS-1$
- Number v = parseString(trim.substring("(double)".length()).trim()); //$NON-NLS-1$
- if (v != null)
- aDouble = v.doubleValue();
- else
- return super.newInstance(initializationString); // Can't decode it, let full parser handle it.
- } else {
- try {
- aDouble = Double.valueOf(initializationString).doubleValue(); // See if valid double format.
- } catch (NumberFormatException e) {
- return super.newInstance(initializationString); // Can't decode it, let full parser handle it.
- }
- }
-
- return getProxyFactoryRegistry().getBeanProxyFactory().createBeanProxyWith(aDouble);
-}
-}
-
-
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMExpression.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMExpression.java
deleted file mode 100644
index ee7f450a0..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMExpression.java
+++ /dev/null
@@ -1,1864 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 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.jem.internal.proxy.remote;
-
-import java.io.*;
-import java.util.*;
-import java.util.logging.Level;
-
-import org.eclipse.jem.internal.proxy.common.CommandException;
-import org.eclipse.jem.internal.proxy.common.remote.*;
-import org.eclipse.jem.internal.proxy.common.remote.Commands.ValueObject;
-import org.eclipse.jem.internal.proxy.core.*;
-import org.eclipse.jem.internal.proxy.initParser.tree.*;
-
-/**
- * The Remote proxy version of Expression.
- *
- * @since 1.0.0
- */
-public class REMExpression extends Expression {
-
- private IREMExpressionConnection connection;
- private boolean closed; // Are we closed.
-
- protected Commands.ValueObject workerValue; // A worker object so that we don't need to keep creating one and throwing it away.
-
- protected Map beanTypeCache; // Use to cache pending BeanTypes. Used in conjunction with REMStandardBeanTypeFactory.
- protected Map methodsCache; // Use to cache pending expression method proxies. Used in conjunction with REMProxyConsants.
- protected Map fieldsCache; // Use to cache pending expression field proxies. Used in conjunction with REMProxyConsants.
-
- /*
- * This is very special list. It tries to eliminate unneeded traffic. For example a mark immediately followed by an endmark does
- * not need to be sent. Many expressions can look like: mark, endmark, endtransaction. This is a do nothing and we don't want
- * to create a connection to just send this. So this list is used to queue up these and remove them too when found as not needed.
- *
- * However, this is very tricky because all pushToProxy transactions that actually do something MUST call the processPending() method
- * first to make sure any pending transactions are submitted. Because once a real type transaction, such as assignment occurs, any
- * pending transaction is a valid transaction, and no longer a do-nothing transaction.
- *
- * Each transaction type uses a subclass of PendingTransaction to be an entry on the list.
- *
- * The pendings currently supported are:
- * mark/endmark
- * try/catch/endtry
- * block/endblock
- *
- * See each individual transaction type to see how it is handled.
- */
- protected List pendingTransactions;
-
- /**
- * PendingTransaction entry.
- *
- * @since 1.1.0
- */
- protected abstract static class PendingTransaction {
-
- /**
- * The transaction is now being pushed. The implementation should
- * actually do the push.
- *
- * @param remExpression The REMExpression for this transaction.
- *
- * @since 1.1.0
- */
- public abstract void pushTransaction(REMExpression remExpression);
- }
-
- /**
- * @param registry
- *
- * @since 1.0.0
- */
- public REMExpression(REMProxyFactoryRegistry registry) {
- super(registry);
- }
-
- /**
- * Return the expression id for this REMExpression. This id is used on the remote vm to
- * identify who the request is for.
- * @return
- *
- * @since 1.1.0
- */
- protected int getREMExpressionID() {
- return this.hashCode();
- }
- /**
- * Get the pending transactions list.
- * @return
- *
- * @since 1.1.0
- */
- protected List getPendingTransactions() {
- if (pendingTransactions == null)
- pendingTransactions = new ArrayList();
- return pendingTransactions;
- }
-
- // Use this flag when debugging to test if errors are due to improper pending processing.
- // If true they will be treated as if not pending and will be executed immediately.
- private static final boolean EXECUTE_PENDING_IMMEDIATELY = false;
- protected void addPendingTransaction(PendingTransaction pending) {
- if (!EXECUTE_PENDING_IMMEDIATELY)
- getPendingTransactions().add(pending);
- else
- pending.pushTransaction(this);
- }
-
- private boolean sentData; // Flag to indicate if we have sent anything yet to the remote vm. This is used for the pending optimizations.
-
- /**
- * Have we sent any data in this transaction yet.
- * @return
- *
- * @since 1.1.0
- */
- protected boolean haveSentData() {
- return sentData;
- }
-
- /**
- * @return Returns the connection.
- *
- * @since 1.1.0
- */
- protected IREMExpressionConnection getConnection() {
- if (connection == null) {
- if (!sentData)
- getREMBeanProxyFactory().startTransaction(); // This is the first time we send data, so start transaction.
-
- sentData = true; // If we are getting a transaction, that means we are sending data.
- connection = (IREMExpressionConnection) getREMRegistry().getFreeConnection();
- // This will actually not be stopped until closeproxy. There could be a slight problem if the expression is never closed.
- // But that shouldn't happen. This is to prevent any proxy that was released during the execution but was used by
- // the expression from being released on the remote vm until after the expression is finished.
- try {
- if (workerValue == null)
- workerValue = new Commands.ValueObject();
- if (expressionProcesserController == null) {
- byte trace = !isTraceSet() ? ExpressionCommands.TRACE_DEFAULT : (isTrace() ? ExpressionCommands.TRACE_ON : ExpressionCommands.TRACE_OFF);
- connection.startExpressionProcessing(getREMExpressionID(), trace); // It is a new expression.
- } else {
- fillProxy(expressionProcesserController, workerValue);
- connection.resumeExpression(getREMExpressionID(), workerValue);
- expressionProcesserController = null;
- }
- } catch (IOException e) {
- connection.close();
- ProxyPlugin.getPlugin().getLogger().log(e);
- throwIllegalStateException(IO_EXCEPTION_MSG);
- } catch (CommandException e) {
- ProxyPlugin.getPlugin().getLogger().log(e);
- if (!e.isRecoverable()) {
- connection.close();
- connection = null;
- }
- throwIllegalStateException(COMMAND_EXCEPTION_MSG);
- }
- }
- return connection;
- }
-
- /**
- * General IOException occurred msg.
- */
- protected static final String IO_EXCEPTION_MSG = ProxyRemoteMessages.REMExpression_IOExceptionSeeLog_INFO_;
-
- protected static final String COMMAND_EXCEPTION_MSG = ProxyRemoteMessages.REMExpression_CommandExceptionSeeLog_INFO_;
-
- /**
- * Throw an an illegal state exception if some general error, in particular an I/O or Command Exception
- * occurred so that callers know there is something wrong.
- *
- * @param msg
- * @throws IllegalStateException
- *
- * @since 1.0.0
- */
- protected void throwIllegalStateException(String msg) throws IllegalStateException {
- throw new IllegalStateException(msg);
- }
-
- /**
- * Return the registry as a REMProxyFactoryRegistry
- * @return
- *
- * @since 1.0.0
- */
- protected final REMProxyFactoryRegistry getREMRegistry() {
- return (REMProxyFactoryRegistry) registry;
- }
-
- /**
- * Return the bean proxy factory as a REMStandardBeanProxyFactory.
- * @return
- *
- * @since 1.0.0
- */
- protected final REMStandardBeanProxyFactory getREMBeanProxyFactory() {
- return (REMStandardBeanProxyFactory) beanProxyFactory;
- }
-
- /**
- * Process any pending transactions.
- * <p>
- * <b>Note: </b>It is required that all non-pending-participating transactions must
- * call this method first to make sure pending transactions are sent. If this is
- * not done, there will be errors in the expression.
- *
- *
- * @since 1.1.0
- */
- protected void processPendingTransactions() {
- if (pendingTransactions != null && !pendingTransactions.isEmpty()) {
- try {
- for (int i = 0; i < pendingTransactions.size(); i++) {
- ((PendingTransaction) pendingTransactions.get(i)).pushTransaction(this);
- }
- } finally {
- pendingTransactions.clear();
- }
- }
- }
-
- /**
- * Get the pending entry from top. If top is 1, then get top entry (i.e. last one added), 2 is next one.
- * @param fromTop
- * @return entry requested, or <code>null</code> if no such entry.
- *
- * @since 1.1.0
- */
- protected PendingTransaction getPendingEntryFromTop(int fromTop) {
- if (pendingTransactions != null && pendingTransactions.size() >= fromTop) {
- return (PendingTransaction) pendingTransactions.get(pendingTransactions.size()-fromTop);
- } else
- return null;
- }
-
- /**
- * Pop up the top entry from the pending transactions queue.
- * @param fromTop how many entries to pop from the pending transaction list.
- *
- *
- * @since 1.1.0
- */
- protected void popPendingEntry(int fromTop) {
- if (pendingTransactions != null)
- if (pendingTransactions.size() > fromTop) {
- while(fromTop-- >0)
- pendingTransactions.remove(pendingTransactions.size()-1);
- } else
- pendingTransactions.clear();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.Expression#pushToProxy(org.eclipse.jem.internal.proxy.core.IProxy)
- */
- protected void pushToProxy(IProxy proxy) {
- if (proxy == null || proxy.isBeanProxy())
- pushToProxy((IBeanProxy) proxy);
- else
- pushToExpressionProxy((ExpressionProxy) proxy);
- }
-
- private void pushToProxy(IBeanProxy proxy) {
- processPendingTransactions();
- IREMExpressionConnection connection = getConnection();
- try {
- // Format of push proxy command is:
- // PushExpressionCommand(push to proxy) followed by:
- // ValueObject containing the rendered proxy.
- connection.pushExpressionCommand(getREMExpressionID(), (byte)InternalExpressionTypes.PUSH_TO_PROXY_EXPRESSION_VALUE);
- if (proxy == null)
- workerValue.set();
- else
- ((IREMBeanProxy) proxy).renderBean(workerValue);
- connection.pushValueObject(workerValue);
- } catch (IOException e) {
- connection.close();
- ProxyPlugin.getPlugin().getLogger().log(e);
- markInvalid(e.getLocalizedMessage());
- throwIllegalStateException(IO_EXCEPTION_MSG);
- } catch (CommandException e) {
- ProxyPlugin.getPlugin().getLogger().log(e);
- markInvalid(e.getLocalizedMessage());
- if (!e.isRecoverable()) {
- connection.close();
- throwIllegalStateException(COMMAND_EXCEPTION_MSG);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.Expression#closeProxy()
- */
- protected void closeProxy() {
- if (!closed) {
- try {
- if (connection != null && connection.isConnected()) {
- try {
- connection.stopExpressionProcessing(getREMExpressionID());
- } catch (IOException e) {
- connection.close();
- ProxyPlugin.getPlugin().getLogger().log(e, Level.INFO);
- // Not throwing an illegal state here because we don't care, other than logging and not
- // returning the connection to the registry that there was an error on close.
- } finally {
- getREMRegistry().returnConnection(connection);
- }
- }
- } finally {
- closed = true;
- if (sentData)
- getREMBeanProxyFactory().stopTransaction(); // Resume proxy releases. We've sent data at least once.
- }
- }
- methodsCache = null;
- fieldsCache = null;
- beanTypeCache = null;
- pendingTransactions = null;
- connection = null;
- }
-
- private static final Object VOIDTYPE = new Object(); // A void type was sent in expression proxy resolution.
- private static final Object NOTRESOLVED = new Object(); // A not resolved type was sent in expression proxy resolution.
-
- /*
- * Get the sender to use for pulling the expression proxy resolutions.
- */
- private BeanProxyValueSender getExpressionProxiesSender() {
- return new BeanProxyValueSender(getREMBeanProxyFactory()) {
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.remote.BeanProxyValueSender#sendValue(org.eclipse.jem.internal.proxy.common.remote.Commands.ValueObject)
- */
- public void sendValue(ValueObject value) {
- if (value.getType() == Commands.FLAG) {
- switch (value.anInt) {
- case ExpressionCommands.EXPRESSIONPROXY_NOTRESOLVED:
- array[index++] = NOTRESOLVED;
- break;
- case ExpressionCommands.EXPRESSIONPROXY_VOIDTYPE:
- array[index++] = VOIDTYPE;
- break;
- default:
- // Shouldn't happen.
- break;
- }
- } else
- super.sendValue(value);
- }
- };
- }
-
- /*
- * Process the pulled expression proxy resolutions.
- */
- private void processpulledExpressionProxies(List expressionProxies, BeanProxyValueSender sender) {
-
- // It is expected that each entry will coorespond to the next non-null expression proxy and will be the bean proxy or one of the special
- // types.
- int len = expressionProxies.size();
- int j = 0;
- Object[] resolveds = sender.getArray();
- for (int i = 0; i < len; i++) {
- ExpressionProxy ep = (ExpressionProxy) expressionProxies.get(i);
- if (ep != null) {
- Object resolved = resolveds[j++];
- if (resolved == NOTRESOLVED)
- fireProxyNotResolved(ep);
- else if (resolved == VOIDTYPE)
- fireProxyVoid(ep);
- else
- fireProxyResolved(ep, (IBeanProxy) resolved);
- }
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.Expression#pullProxyValue(int, java.util.List)
- */
- protected IBeanProxy pullProxyValue(int proxycount, List expressionProxies) throws ThrowableProxy, NoExpressionValueException {
- if (!haveSentData()) {
- markAllProxiesNotResolved(expressionProxies);
- return null; // We haven't pushed any commands, so there is nothing to do. Don't create a connection for this.
- }
- // If there are any pending transactions at this point in time, there is no need to send them. They would be do nothings anyway.
-
- boolean processedExpressionProxies = false;
- IREMExpressionConnection lclConnection = getConnection();
- markInTransaction(lclConnection);
- try {
- Commands.ValueObject proxyids = null;
- BeanProxyValueSender sender = null;
- if (proxycount > 0) {
- proxyids = createExpressionProxiesValueObject(proxycount, expressionProxies);
- sender = getExpressionProxiesSender();
- }
-
- lclConnection.pullValue(getREMExpressionID(), proxyids, sender);
- // If we got this far, then if there are proxies, we need to process these too.
- if (proxycount > 0)
- processpulledExpressionProxies(expressionProxies, sender);
- processedExpressionProxies =true;
- lclConnection.getFinalValue(workerValue); // Get the returned value.
- return getREMBeanProxyFactory().getBeanProxy(workerValue);
- } catch (CommandErrorException e) {
- try {
- if (e.getErrorCode() == ExpressionCommands.EXPRESSION_NOEXPRESSIONVALUE_EXCEPTION) {
- // Need to turn it into a Throwable.
- ThrowableProxy t = null;
- try {
- getREMBeanProxyFactory().getBeanProxy(e.getValue()); // This will cause a throw to occur, but we don't want it going out, we want to capture it.
- } catch (ThrowableProxy e1) {
- t = e1;
- }
- throw new REMNoExpressionValueException(t);
- }
- getREMBeanProxyFactory().processErrorReturn(e);
- } catch (CommandException e1) {
- ProxyPlugin.getPlugin().getLogger().log(e);
- if (!e.isRecoverable()) {
- lclConnection.close();
- throwIllegalStateException(COMMAND_EXCEPTION_MSG);
- }
- }
- } catch (CommandException e) {
- ProxyPlugin.getPlugin().getLogger().log(e);
- if (!e.isRecoverable()) {
- lclConnection.close();
- throwIllegalStateException(COMMAND_EXCEPTION_MSG);
- }
- } finally {
- markEndTransaction(lclConnection);
- if (!processedExpressionProxies)
- markAllProxiesNotResolved(expressionProxies); // We failed before we could process the expression proxies. So mark all as not resolved.
- }
- return null;
- }
-
- /**
- * This is called by commands that write some data and will be reading data back immediately
- * (i.e. pull value and invoke expression). If we are on a callback thread and have the
- * used the connection from the callback thread, we need to tell the callback thread that
- * it is in a transaction. This is needed because while reading data back there are
- * sometimes calls back to the vm to get beantype data for new classes. This would
- * normally be through a new connection so that it doesn't get stuck in the middle of the
- * data being sent back. But when running on a callback the same connection is used. So it
- * would stick data in the middle of the return stream of data. To prevent this we need
- * to tell the callback thread that it is in a transaction during this call so that any
- * such new connection requests will get a new connection.
- * <p>
- * This is not nestable (i.e. the first markEndTransaction will set it false, even if several nested
- * markInTransactions are called).
- * <p>
- * markEndTransaction must be called in ALL cases, such use try/finally.
- * @param remConnection the connection to see check against and mark in transaction for.
- *
- *
- * @since 1.1.0
- */
- protected void markInTransaction(IREMExpressionConnection remConnection) {
- Thread thread = Thread.currentThread();
- if (thread instanceof REMCallbackThread) {
- // We are in a callback, and the callback connection is our connection, tell the callback that it is in transaction.
- REMCallbackThread callbackThread = (REMCallbackThread) thread;
- if (callbackThread.getConnection() == remConnection) {
- callbackThread.setIntransaction(true);
- }
- }
- }
-
- /**
- * Mark end of transaction.
- * @param remConn REMConnection to test and mark not in connection for.
- *
- * @see REMExpression#markInTransaction(IREMExpressionConnection)
- * @since 1.1.0
- */
- protected void markEndTransaction(IREMExpressionConnection remConn) {
- Thread thread = Thread.currentThread();
- if (thread instanceof REMCallbackThread) {
- // We are in a callback, and the callback connection is our connection, tell the callback that it is in transaction.
- REMCallbackThread callbackThread = (REMCallbackThread) thread;
- if (callbackThread.getConnection() == remConn) {
- callbackThread.setIntransaction(false);
- }
- }
- }
-
- /**
- * @param expressionProxies
- *
- * @since 1.1.0
- */
- private Commands.ValueObject createExpressionProxiesValueObject(int actualCount, List expressionProxies) {
- class ExpressionProxyRetriever implements Commands.ValueRetrieve {
- Iterator expressionProxiesItr;
- Commands.ValueObject worker = new Commands.ValueObject();
-
- public ExpressionProxyRetriever(List expressionProxies) {
- this.expressionProxiesItr = expressionProxies.iterator();
- }
-
- public Commands.ValueObject nextValue() {
- worker.set(-1);
- while (expressionProxiesItr.hasNext()) {
- Object parm = expressionProxiesItr.next();
- if (parm != null) {
- worker.set(((ExpressionProxy) parm).getProxyID());
- break;
- }
- }
- return worker;
- }
- };
-
- workerValue.setArrayIDS(new ExpressionProxyRetriever(expressionProxies), actualCount, Commands.INT);
- return workerValue;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.Expression#pushCastToProxy(org.eclipse.jem.internal.proxy.core.IProxyBeanType)
- */
- protected void pushCastToProxy(IProxyBeanType type) {
- processPendingTransactions();
- IREMExpressionConnection connection = getConnection();
- try {
- // Format of push cast to proxy command is:
- // PushExpressionCommand(push cast to proxy) followed by:
- connection.pushExpressionCommand(getREMExpressionID(), (byte)InternalExpressionTypes.CAST_EXPRESSION_VALUE);
- fillProxy(type, workerValue);
- connection.pushValueObject(workerValue);
- } catch (IOException e) {
- connection.close();
- ProxyPlugin.getPlugin().getLogger().log(e);
- markInvalid(e.getLocalizedMessage());
- throwIllegalStateException(IO_EXCEPTION_MSG);
- } catch (CommandException e) {
- ProxyPlugin.getPlugin().getLogger().log(e);
- markInvalid(e.getLocalizedMessage());
- if (!e.isRecoverable()) {
- connection.close();
- throwIllegalStateException(COMMAND_EXCEPTION_MSG);
- }
- }
- }
-
- /**
- * Push the proxy bean type in the format depending on expression proxy or beantype proxy.
- * @param type
- * @throws IOException
- *
- * @since 1.1.0
- */
- protected void fillProxy(IProxy type, Commands.ValueObject value) throws IOException {
- // ValueObject containing the rendered bean type proxy if IBeanTypeProxy or int (for expression proxy id) if expression proxy.
- if (type.isBeanProxy()) {
- ((IREMBeanProxy) type).renderBean(value);
- } else {
- ExpressionProxy ep = (ExpressionProxy) type;
- value.set(ep.getProxyID());
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.Expression#pushInstanceofToProxy(org.eclipse.jem.internal.proxy.core.IProxyBeanType)
- */
- protected void pushInstanceofToProxy(IProxyBeanType type) {
- processPendingTransactions();
- IREMExpressionConnection connection = getConnection();
- try {
- // Format of push instanceof to proxy command is:
- // PushExpressionCommand(push instanceof to proxy) followed by:
- // ValueObject containing the rendered bean type proxy or the String representing the name of class.
- connection.pushExpressionCommand(getREMExpressionID(), (byte)InternalExpressionTypes.INSTANCEOF_EXPRESSION_VALUE);
- fillProxy(type, workerValue);
- connection.pushValueObject(workerValue);
- } catch (IOException e) {
- connection.close();
- ProxyPlugin.getPlugin().getLogger().log(e);
- markInvalid(e.getLocalizedMessage());
- throwIllegalStateException(IO_EXCEPTION_MSG);
- } catch (CommandException e) {
- ProxyPlugin.getPlugin().getLogger().log(e);
- markInvalid(e.getLocalizedMessage());
- if (!e.isRecoverable()) {
- connection.close();
- throwIllegalStateException(COMMAND_EXCEPTION_MSG);
- }
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.Expression#pushInfixToProxy(org.eclipse.jem.internal.proxy.initParser.tree.InfixOperator, int)
- */
- protected void pushInfixToProxy(InfixOperator operator, InternalInfixOperandType operandType) {
- processPendingTransactions();
- IREMExpressionConnection connection = getConnection();
- try {
- // Format of push infix to proxy command is:
- // PushExpressionCommand(push infix to proxy) followed by:
- // byte: operator
- // byte: operandType
- connection.pushExpressionCommand(getREMExpressionID(), (byte)InternalExpressionTypes.INFIX_EXPRESSION_VALUE);
- connection.pushByte((byte) operator.getValue());
- connection.pushByte((byte) operandType.getValue());
- } catch (IOException e) {
- connection.close();
- ProxyPlugin.getPlugin().getLogger().log(e);
- markInvalid(e.getLocalizedMessage());
- throwIllegalStateException(IO_EXCEPTION_MSG);
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.Expression#pushPrefixToProxy(org.eclipse.jem.internal.proxy.initParser.tree.PrefixOperator)
- */
- protected void pushPrefixToProxy(PrefixOperator operator) {
- processPendingTransactions();
- IREMExpressionConnection connection = getConnection();
- try {
- // Format of push prefix to proxy command is:
- // PushExpressionCommand(push prefix to proxy) followed by:
- // byte: operator
- connection.pushExpressionCommand(getREMExpressionID(), (byte)InternalExpressionTypes.PREFIX_EXPRESSION_VALUE);
- connection.pushByte((byte) operator.getValue());
- } catch (IOException e) {
- connection.close();
- ProxyPlugin.getPlugin().getLogger().log(e);
- markInvalid(e.getLocalizedMessage());
- throwIllegalStateException(IO_EXCEPTION_MSG);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.Expression#pushArrayAccessToProxy(int)
- */
- protected void pushArrayAccessToProxy(int indexCount) {
- processPendingTransactions();
- IREMExpressionConnection connection = getConnection();
- try {
- // Format of push array access to proxy command is:
- // PushExpressionCommand(push array acces to proxy) followed by:
- // int: indexCount
- connection.pushExpressionCommand(getREMExpressionID(), (byte)InternalExpressionTypes.ARRAY_ACCESS_EXPRESSION_VALUE);
- connection.pushInt(indexCount);
- } catch (IOException e) {
- connection.close();
- ProxyPlugin.getPlugin().getLogger().log(e);
- markInvalid(e.getLocalizedMessage());
- throwIllegalStateException(IO_EXCEPTION_MSG);
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.Expression#pushArrayCreationToProxy(org.eclipse.jem.internal.proxy.core.IProxyBeanType, int)
- */
- protected void pushArrayCreationToProxy(IProxyBeanType type, int dimensionCount) {
- processPendingTransactions();
- IREMExpressionConnection connection = getConnection();
- try {
- // Format of push array creation to proxy command is:
- // PushExpressionCommand(push array creation to proxy) followed by:
- // ValueObject containing the rendered bean type proxy or the expression proxy.
- // int: dimension count
- connection.pushExpressionCommand(getREMExpressionID(), (byte)InternalExpressionTypes.ARRAY_CREATION_EXPRESSION_VALUE);
- fillProxy(type, workerValue);
- connection.pushValueObject(workerValue);
- connection.pushInt(dimensionCount);
- } catch (IOException e) {
- connection.close();
- ProxyPlugin.getPlugin().getLogger().log(e);
- markInvalid(e.getLocalizedMessage());
- throwIllegalStateException(IO_EXCEPTION_MSG);
- } catch (CommandException e) {
- ProxyPlugin.getPlugin().getLogger().log(e);
- markInvalid(e.getLocalizedMessage());
- if (!e.isRecoverable()) {
- connection.close();
- throwIllegalStateException(COMMAND_EXCEPTION_MSG);
- }
- }
- }
-
- protected void pushArrayInitializerToProxy(IProxyBeanType type, int stripCount, int expressionCount) {
- processPendingTransactions();
- IREMExpressionConnection connection = getConnection();
- try {
- // Format of push array initializer to proxy command is:
- // PushExpressionCommand(push array initializer to proxy) followed by:
- // ValueObject containing the rendered bean type proxy or expression proxy.
- // int: strip count
- // int: expression count
- connection.pushExpressionCommand(getREMExpressionID(), (byte)InternalExpressionTypes.ARRAY_INITIALIZER_EXPRESSION_VALUE);
- fillProxy(type, workerValue);
- connection.pushValueObject(workerValue);
- connection.pushInt(stripCount);
- connection.pushInt(expressionCount);
- } catch (IOException e) {
- connection.close();
- ProxyPlugin.getPlugin().getLogger().log(e);
- markInvalid(e.getLocalizedMessage());
- throwIllegalStateException(IO_EXCEPTION_MSG);
- } catch (CommandException e) {
- ProxyPlugin.getPlugin().getLogger().log(e);
- markInvalid(e.getLocalizedMessage());
- if (!e.isRecoverable()) {
- connection.close();
- throwIllegalStateException(COMMAND_EXCEPTION_MSG);
- }
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.Expression#pushClassInstanceCreationToProxy(org.eclipse.jem.internal.proxy.core.IProxyBeanType, int)
- */
- protected void pushClassInstanceCreationToProxy(IProxyBeanType type, int argumentCount) {
- processPendingTransactions();
- IREMExpressionConnection connection = getConnection();
- try {
- // Format of push class instance creation to proxy command is:
- // PushExpressionCommand(push class instance creation to proxy) followed by:
- // ValueObject containing the rendered bean type proxy or the expression proxy
- // int: argument count
- connection.pushExpressionCommand(getREMExpressionID(), (byte)InternalExpressionTypes.CLASS_INSTANCE_CREATION_EXPRESSION_VALUE);
- fillProxy(type, workerValue);
- connection.pushValueObject(workerValue);
- connection.pushInt(argumentCount);
- } catch (IOException e) {
- connection.close();
- ProxyPlugin.getPlugin().getLogger().log(e);
- markInvalid(e.getLocalizedMessage());
- throwIllegalStateException(IO_EXCEPTION_MSG);
- } catch (CommandException e) {
- ProxyPlugin.getPlugin().getLogger().log(e);
- markInvalid(e.getLocalizedMessage());
- if (!e.isRecoverable()) {
- connection.close();
- throwIllegalStateException(COMMAND_EXCEPTION_MSG);
- }
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.Expression#pushTypeReceiverToProxy(org.eclipse.jem.internal.proxy.core.IProxyBeanType)
- */
- protected void pushTypeReceiverToProxy(IProxyBeanType type) {
- processPendingTransactions();
- IREMExpressionConnection connection = getConnection();
- try {
- // Format of push type receiver to proxy command is:
- // PushExpressionCommand(push type receiver to proxy) followed by:
- // ValueObject containing the rendered bean type proxy or the expression proxy.
- connection.pushExpressionCommand(getREMExpressionID(), (byte)InternalExpressionTypes.TYPERECEIVER_EXPRESSION_VALUE);
- fillProxy(type, workerValue);
- connection.pushValueObject(workerValue);
- } catch (IOException e) {
- connection.close();
- ProxyPlugin.getPlugin().getLogger().log(e);
- markInvalid(e.getLocalizedMessage());
- throwIllegalStateException(IO_EXCEPTION_MSG);
- } catch (CommandException e) {
- ProxyPlugin.getPlugin().getLogger().log(e);
- markInvalid(e.getLocalizedMessage());
- if (!e.isRecoverable()) {
- connection.close();
- throwIllegalStateException(COMMAND_EXCEPTION_MSG);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.Expression#pushFieldAccessToProxy(java.lang.String, boolean)
- */
- protected void pushFieldAccessToProxy(Object field, boolean hasReceiver) {
- processPendingTransactions();
- IREMExpressionConnection connection = getConnection();
- try {
- // Format of push field access to proxy command is:
- // PushExpressionCommand(push field access to proxy) followed by:
- // Commands.Value: fieldName or IProxyField
- // boolean: hasReceiver
- connection.pushExpressionCommand(getREMExpressionID(), (byte)InternalExpressionTypes.FIELD_ACCESS_EXPRESSION_VALUE);
- if (field instanceof String) {
- workerValue.set((String) field);
- } else {
- fillProxy((IProxy) field, workerValue);
- }
- connection.pushValueObject(workerValue);
- connection.pushBoolean(hasReceiver);
- } catch (IOException e) {
- connection.close();
- ProxyPlugin.getPlugin().getLogger().log(e);
- markInvalid(e.getLocalizedMessage());
- throwIllegalStateException(IO_EXCEPTION_MSG);
- } catch (CommandException e) {
- ProxyPlugin.getPlugin().getLogger().log(e);
- markInvalid(e.getLocalizedMessage());
- if (!e.isRecoverable()) {
- connection.close();
- throwIllegalStateException(COMMAND_EXCEPTION_MSG);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.Expression#pushMethodInvocationToProxy(java.lang.String, boolean, int)
- */
- protected void pushMethodInvocationToProxy(Object method, boolean hasReceiver, int argCount) {
- processPendingTransactions();
- IREMExpressionConnection connection = getConnection();
- try {
- // Format of push method invocation to proxy command is:
- // PushExpressionCommand(push method invocation to proxy) followed by:
- // Commands.ValueObject: methodName or IMethodProxy
- // boolean: hasReceiver
- // int: argCount
- connection.pushExpressionCommand(getREMExpressionID(), (byte)InternalExpressionTypes.METHOD_EXPRESSION_VALUE);
- if (method instanceof String) {
- workerValue.set((String) method);
- } else {
- fillProxy((IProxy) method, workerValue);
- }
- connection.pushValueObject(workerValue);
- connection.pushBoolean(hasReceiver);
- connection.pushInt(argCount);
- } catch (IOException e) {
- connection.close();
- ProxyPlugin.getPlugin().getLogger().log(e);
- markInvalid(e.getLocalizedMessage());
- throwIllegalStateException(IO_EXCEPTION_MSG);
- } catch (CommandException e) {
- ProxyPlugin.getPlugin().getLogger().log(e);
- markInvalid(e.getLocalizedMessage());
- if (!e.isRecoverable()) {
- connection.close();
- throwIllegalStateException(COMMAND_EXCEPTION_MSG);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.Expression#pushConditionalToProxy(int)
- */
- protected void pushConditionalToProxy(InternalConditionalOperandType expressionType) {
- processPendingTransactions();
- IREMExpressionConnection connection = getConnection();
- try {
- // Format of push conditional to proxy command is:
- // PushExpressionCommand(push conditional to proxy) followed by:
- // byte: expression type
- connection.pushExpressionCommand(getREMExpressionID(), (byte)InternalExpressionTypes.CONDITIONAL_EXPRESSION_VALUE);
- connection.pushByte((byte) expressionType.getValue());
- } catch (IOException e) {
- connection.close();
- ProxyPlugin.getPlugin().getLogger().log(e);
- markInvalid(e.getLocalizedMessage());
- throwIllegalStateException(IO_EXCEPTION_MSG);
- }
- }
-
- /*
- * A special one that takes the ThrowableProxy for no expression value and
- * wrappers it prints its stack trace instead, but still makes it a subclass
- * of NoExpressionValueException.
- *
- * @since 1.1.0
- */
- private static class REMNoExpressionValueException extends NoExpressionValueException {
- /**
- * Comment for <code>serialVersionUID</code>
- *
- * @since 1.1.0
- */
- private static final long serialVersionUID = 1692406777391812694L;
-
-
- public REMNoExpressionValueException(ThrowableProxy e) {
- super(e);
- }
-
-
- /* (non-Javadoc)
- * @see java.lang.Throwable#getLocalizedMessage()
- */
- public String getLocalizedMessage() {
- return ((ThrowableProxy) getCause()).getProxyLocalizedMessage();
- }
-
-
- /* (non-Javadoc)
- * @see java.lang.Throwable#getMessage()
- */
- public String getMessage() {
- return ((ThrowableProxy) getCause()).getProxyMessage();
- }
-
-
- /* (non-Javadoc)
- * @see java.lang.Throwable#printStackTrace()
- */
- public void printStackTrace() {
- getCause().printStackTrace();
- }
-
-
- /* (non-Javadoc)
- * @see java.lang.Throwable#printStackTrace(java.io.PrintStream)
- */
- public void printStackTrace(PrintStream s) {
- getCause().printStackTrace(s);
- }
-
-
- /* (non-Javadoc)
- * @see java.lang.Throwable#printStackTrace(java.io.PrintWriter)
- */
- public void printStackTrace(PrintWriter s) {
- getCause().printStackTrace(s);
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.Expression#pushInvoke(int, java.util.List)
- */
- protected void pushInvoke(int proxycount, List expressionProxies) throws ThrowableProxy, NoExpressionValueException {
- if (!haveSentData()) {
- markAllProxiesNotResolved(expressionProxies);
- return; // We haven't pushed any commands, so there is nothing to do. Don't create a connection for this.
- }
- // If at this point there are pending transactions, there is no need to send them because they would all be do-nothings.
-
- boolean processedExpressionProxies = false;
- IREMExpressionConnection lclConnection = getConnection();
- markInTransaction(lclConnection);
- try {
- Commands.ValueObject proxyids = null;
- BeanProxyValueSender sender = null;
- if (proxycount > 0) {
- proxyids = createExpressionProxiesValueObject(proxycount, expressionProxies);
- sender = getExpressionProxiesSender();
- }
-
- lclConnection.sync(getREMExpressionID(), proxyids, sender);
-
- // If we got this far, then if there are proxies, we need to process these too.
- if (proxycount > 0)
- processpulledExpressionProxies(expressionProxies, sender);
- processedExpressionProxies = true;
- lclConnection.getFinalValue(workerValue); // We don't care what it is, we just need to see if there is an error.
- } catch (CommandErrorException e) {
- try {
- if (e.getErrorCode() == ExpressionCommands.EXPRESSION_NOEXPRESSIONVALUE_EXCEPTION) {
- // Need to turn it into a Throwable.
- ThrowableProxy t = null;
- try {
- getREMBeanProxyFactory().getBeanProxy(e.getValue()); // This will cause a throw to occur, but we don't want it going out, we want to capture it.
- } catch (ThrowableProxy e1) {
- t = e1;
- }
- throw new REMNoExpressionValueException(t);
- }
- getREMBeanProxyFactory().processErrorReturn(e);
- } catch (CommandException e1) {
- ProxyPlugin.getPlugin().getLogger().log(e);
- if (!e.isRecoverable()) {
- lclConnection.close();
- throwIllegalStateException(COMMAND_EXCEPTION_MSG);
- }
- }
- } catch (CommandException e) {
- ProxyPlugin.getPlugin().getLogger().log(e);
- if (!e.isRecoverable()) {
- lclConnection.close();
- throwIllegalStateException(COMMAND_EXCEPTION_MSG);
- }
- } finally {
- markEndTransaction(lclConnection);
- if (!processedExpressionProxies)
- markAllProxiesNotResolved(expressionProxies); // We failed before we could process the expression proxies. So mark all as not resolved.
- }
- }
-
- private static class REMBeanTypeExpressionProxy extends ExpressionProxy implements IBeanTypeExpressionProxy {
-
- private String typeName;
-
- /**
- * @param proxyid
- *
- * @since 1.1.0
- */
- private REMBeanTypeExpressionProxy(int proxyid, Expression expression) {
- super(proxyid, BEANTYPE_EXPRESSION_PROXY, expression);
- }
-
- public void setTypeName(String typeName) {
- this.typeName = typeName;
- }
-
- public String getTypeName() {
- return typeName;
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.ExpressionProxy#toString()
- */
- public String toString() {
- return super.toString()+" - "+getTypeName(); //$NON-NLS-1$
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IProxyBeanType#getMethodProxy(org.eclipse.jem.internal.proxy.core.IExpression, java.lang.String, org.eclipse.jem.internal.proxy.core.IProxyBeanType[])
- */
- public IProxyMethod getMethodProxy(IExpression expression, String methodName, IProxyBeanType[] parameterTypes) {
- REMProxyFactoryRegistry registry = (REMProxyFactoryRegistry) expression.getRegistry();
- return ((REMMethodProxyFactory) registry.getMethodProxyFactory()).getMethodProxy(expression, this, methodName, parameterTypes);
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IProxyBeanType#getMethodProxy(org.eclipse.jem.internal.proxy.core.IExpression, java.lang.String, java.lang.String[])
- */
- public IProxyMethod getMethodProxy(IExpression expression, String methodName, String[] parameterTypes) {
- REMProxyFactoryRegistry registry = (REMProxyFactoryRegistry) expression.getRegistry();
- return ((REMMethodProxyFactory) registry.getMethodProxyFactory()).getMethodProxy(expression, this, methodName, parameterTypes);
- }
-
- public IProxyMethod getMethodProxy(IExpression expression, String methodName) {
- return getMethodProxy(expression, methodName, (IProxyBeanType[]) null);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IProxyBeanType#getFieldProxy(org.eclipse.jem.internal.proxy.core.IExpression, java.lang.String)
- */
- public IProxyField getFieldProxy(IExpression expression, String fieldName) {
- REMProxyFactoryRegistry registry = (REMProxyFactoryRegistry) expression.getRegistry();
- return ((REMMethodProxyFactory) registry.getMethodProxyFactory()).getFieldProxy(expression, this, fieldName);
- }
- }
-
- private static class REMMethodExpressionProxy extends ExpressionProxy implements IProxyMethod {
-
- /**
- * @param proxyid
- * @param proxyType
- * @param expression
- *
- * @since 1.1.0
- */
- private REMMethodExpressionProxy(int proxyid, Expression expression) {
- super(proxyid, METHOD_EXPRESSION_PROXY, expression);
- }
- }
-
- private static class REMFieldExpressionProxy extends ExpressionProxy implements IProxyField {
-
- /**
- * @param proxyid
- * @param proxyType
- * @param expression
- *
- * @since 1.1.0
- */
- private REMFieldExpressionProxy(int proxyid, Expression expression) {
- super(proxyid, FIELD_EXPRESSION_PROXY, expression);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.Expression#createExpressionProxy(int)
- */
- protected ExpressionProxy createExpressionProxy(int proxyType, int proxyID) {
- switch (proxyType) {
- case NORMAL_EXPRESSION_PROXY:
- default:
- return new ExpressionProxy(proxyID, NORMAL_EXPRESSION_PROXY, this);
-
- case BEANTYPE_EXPRESSION_PROXY:
- return new REMBeanTypeExpressionProxy(proxyID, this);
-
- case METHOD_EXPRESSION_PROXY:
- return new REMMethodExpressionProxy(proxyID, this);
-
- case FIELD_EXPRESSION_PROXY:
- return new REMFieldExpressionProxy(proxyID, this);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.Expression#pushAssignmentToProxy(org.eclipse.jem.internal.proxy.core.ExpressionProxy)
- */
- protected void pushAssignmentToProxy(ExpressionProxy proxy) {
- processPendingTransactions();
- IREMExpressionConnection connection = getConnection();
- try {
- // Format of push assignment to proxy command is:
- // PushExpressionCommand(push assignment to proxy) followed by:
- // int: proxy id
- connection.pushExpressionCommand(getREMExpressionID(), (byte)InternalExpressionTypes.ASSIGNMENT_PROXY_EXPRESSION_VALUE);
- connection.pushInt(proxy.getProxyID());
- } catch (IOException e) {
- connection.close();
- ProxyPlugin.getPlugin().getLogger().log(e);
- markInvalid(e.getLocalizedMessage());
- throwIllegalStateException(IO_EXCEPTION_MSG);
- }
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.Expression#pushAssignmentToProxy()
- */
- protected void pushAssignmentToProxy() {
- processPendingTransactions();
- IREMExpressionConnection connection = getConnection();
- try {
- // Format of the push assignment command is:
- // PushAssignmentCommand.
- connection.pushExpressionCommand(getREMExpressionID(), (byte) InternalExpressionTypes.ASSIGNMENT_EXPRESSION_VALUE);
- } catch (IOException e) {
- connection.close();
- ProxyPlugin.getPlugin().getLogger().log(e);
- markInvalid(e.getLocalizedMessage());
- throwIllegalStateException(IO_EXCEPTION_MSG);
- }
- }
-
-
- private void pushToExpressionProxy(ExpressionProxy proxy) {
- processPendingTransactions();
- IREMExpressionConnection connection = getConnection();
- try {
- // Format of push to expression proxy command is:
- // PushExpressionCommand(push expression proxy to proxy) followed by:
- // int: proxy id
- connection.pushExpressionCommand(getREMExpressionID(), (byte)InternalExpressionTypes.PUSH_TO_EXPRESSION_PROXY_EXPRESSION_VALUE);
- connection.pushInt(proxy.getProxyID());
- } catch (IOException e) {
- connection.close();
- ProxyPlugin.getPlugin().getLogger().log(e);
- markInvalid(e.getLocalizedMessage());
- throwIllegalStateException(IO_EXCEPTION_MSG);
- }
-
- }
-
- private static class BlockBegin extends PendingTransaction {
- public int blockNumber;
-
- public BlockBegin(int blockNumber) {
- this.blockNumber = blockNumber;
- }
-
- public void pushTransaction(REMExpression remExpression) {
- IREMExpressionConnection connection = remExpression.getConnection();
- try {
- // Format of push to block begin proxy command is:
- // PushExpressionCommand(push block begin proxy to proxy) followed by:
- // int: block id
- connection.pushExpressionCommand(remExpression.getREMExpressionID(), (byte)InternalExpressionTypes.BLOCK_BEGIN_EXPRESSION_VALUE);
- connection.pushInt(blockNumber);
- } catch (IOException e) {
- connection.close();
- ProxyPlugin.getPlugin().getLogger().log(e);
- remExpression.markInvalid(e.getLocalizedMessage());
- remExpression.throwIllegalStateException(IO_EXCEPTION_MSG);
- }
- }
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.Expression#pushBlockBeginToProxy(int)
- */
- protected void pushBlockBeginToProxy(int blockNumber) {
- addPendingTransaction(new BlockBegin(blockNumber));
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.Expression#pushBlockEndToProxy(int)
- */
- protected void pushBlockEndToProxy(int blockNumber) {
- // See if the top pending transactions is BreakBlock(blockNumber). If it is then the BreakBlock can be thrown away.
- PendingTransaction topEntry = getPendingEntryFromTop(1);
- if (topEntry instanceof BlockBreak && ((BlockBreak) topEntry).blockNumber == blockNumber) {
- popPendingEntry(1);
- topEntry = getPendingEntryFromTop(1);
- }
- // See if the top pending transaction is now BeginBlock(blockNumber). If it is, then this transaction and the block begin
- // can be thrown away because they are an empty block.
- if (topEntry instanceof BlockBegin && ((BlockBegin) topEntry).blockNumber == blockNumber) {
- popPendingEntry(1);
- return;
- }
- processPendingTransactions();
- IREMExpressionConnection connection = getConnection();
- try {
- // Format of push to block end proxy command is:
- // PushExpressionCommand(push block end proxy to proxy) followed by:
- // int: block id
- connection.pushExpressionCommand(getREMExpressionID(), (byte)InternalExpressionTypes.BLOCK_END_EXPRESSION_VALUE);
- connection.pushInt(blockNumber);
- } catch (IOException e) {
- connection.close();
- ProxyPlugin.getPlugin().getLogger().log(e);
- markInvalid(e.getLocalizedMessage());
- throwIllegalStateException(IO_EXCEPTION_MSG);
- }
- }
-
- private static class BlockBreak extends PendingTransaction {
- public int blockNumber;
-
- public BlockBreak(int blockNumber) {
- this.blockNumber = blockNumber;
- }
-
- public void pushTransaction(REMExpression remExpression) {
- IREMExpressionConnection connection = remExpression.getConnection();
- try {
- // Format of push to block break proxy command is:
- // PushExpressionCommand(push block break proxy to proxy) followed by:
- // int: block id
- connection.pushExpressionCommand(remExpression.getREMExpressionID(), (byte)InternalExpressionTypes.BLOCK_BREAK_EXPRESSION_VALUE);
- connection.pushInt(blockNumber);
- } catch (IOException e) {
- connection.close();
- ProxyPlugin.getPlugin().getLogger().log(e);
- remExpression.markInvalid(e.getLocalizedMessage());
- remExpression.throwIllegalStateException(IO_EXCEPTION_MSG);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.Expression#pushBlockBreakToProxy(int)
- */
- protected void pushBlockBreakToProxy(int blockNumber) {
- // Even if there is no pending block begin for this block, we will pend the break.
- // This is so that if the break occurred just before the block end, then it can be ignored.
- addPendingTransaction(new BlockBreak(blockNumber));
- }
-
- private static class TryBegin extends PendingTransaction {
-
- public final int tryNumber;
-
- public TryBegin(int tryNumber) {
- this.tryNumber = tryNumber;
-
- }
- public void pushTransaction(REMExpression remExpression) {
- IREMExpressionConnection connection = remExpression.getConnection();
- try {
- // Format of push to try begin proxy command is:
- // PushExpressionCommand(push try begin to proxy) followed by:
- // int: try id
- connection.pushExpressionCommand(remExpression.getREMExpressionID(), (byte)InternalExpressionTypes.TRY_BEGIN_EXPRESSION_VALUE);
- connection.pushInt(tryNumber);
- } catch (IOException e) {
- connection.close();
- ProxyPlugin.getPlugin().getLogger().log(e);
- remExpression.markInvalid(e.getLocalizedMessage());
- remExpression.throwIllegalStateException(IO_EXCEPTION_MSG);
- }
- }
-
- }
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.Expression#pushTryBeginToProxy(int)
- */
- protected void pushTryBeginToProxy(int tryNumber) {
- addPendingTransaction(new TryBegin(tryNumber));
- }
-
- private static class TryCatch extends PendingTransaction {
-
- public final int tryNumber;
- private final IProxyBeanType exceptionType;
- private final ExpressionProxy ep;
-
- public TryCatch(int tryNumber, IProxyBeanType exceptionType, ExpressionProxy ep) {
- this.tryNumber = tryNumber;
- this.exceptionType = exceptionType;
- this.ep = ep;
- }
-
- public void pushTransaction(REMExpression remExpression) {
- IREMExpressionConnection connection = remExpression.getConnection();
- try {
- // Format of push to try begin proxy command is:
- // PushExpressionCommand(push try begin to proxy) followed by:
- // int: try id
- // object: expression type (as beantype or as expression proxy)
- // int: proxy id or (-1 if null).
- connection.pushExpressionCommand(remExpression.getREMExpressionID(), (byte)InternalExpressionTypes.TRY_CATCH_EXPRESSION_VALUE);
- connection.pushInt(tryNumber);
- remExpression.fillProxy(exceptionType, remExpression.workerValue);
- connection.pushValueObject(remExpression.workerValue);
- if (ep != null)
- connection.pushInt(ep.getProxyID());
- else
- connection.pushInt(-1);
- } catch (IOException e) {
- connection.close();
- ProxyPlugin.getPlugin().getLogger().log(e);
- remExpression.markInvalid(e.getLocalizedMessage());
- remExpression.throwIllegalStateException(IO_EXCEPTION_MSG);
- } catch (CommandException e) {
- ProxyPlugin.getPlugin().getLogger().log(e);
- remExpression.markInvalid(e.getLocalizedMessage());
- if (!e.isRecoverable()) {
- connection.close();
- remExpression.throwIllegalStateException(COMMAND_EXCEPTION_MSG);
- }
- }
- }
-
- }
- /*
- * (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.Expression#pushTryCatchClauseToProxy(int, org.eclipse.jem.internal.proxy.core.IProxyBeanType, org.eclipse.jem.internal.proxy.core.ExpressionProxy)
- */
- protected void pushTryCatchClauseToProxy(int tryNumber, IProxyBeanType exceptionType, ExpressionProxy ep) {
- addPendingTransaction(new TryCatch(tryNumber, exceptionType, ep));
- }
-
- private static class TryFinally extends PendingTransaction {
-
- public final int tryNumber;
-
- public TryFinally(int tryNumber) {
- this.tryNumber = tryNumber;
-
- }
-
- public void pushTransaction(REMExpression remExpression) {
- IREMExpressionConnection connection = remExpression.getConnection();
- try {
- // Format of push to try begin proxy command is:
- // PushExpressionCommand(push try finally to proxy) followed by:
- // int: try id
- connection.pushExpressionCommand(remExpression.getREMExpressionID(), (byte)InternalExpressionTypes.TRY_FINALLY_EXPRESSION_VALUE);
- connection.pushInt(tryNumber);
- } catch (IOException e) {
- connection.close();
- ProxyPlugin.getPlugin().getLogger().log(e);
- remExpression.markInvalid(e.getLocalizedMessage());
- remExpression.throwIllegalStateException(IO_EXCEPTION_MSG);
- }
- }
-
- }
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.Expression#pushTryFinallyClauseToProxy(int)
- */
- protected void pushTryFinallyClauseToProxy(int tryNumber) {
- addPendingTransaction(new TryFinally(tryNumber));
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.Expression#pushTryEndToProxy(int)
- */
- protected void pushTryEndToProxy(int tryNumber) {
- // This is a little tricky. We need to find if there is nothing but try/catch/finally for this tryNumber on the pending
- // transactions up to the try begin, if there is nothing else, then we can throw the entire try away. That
- // means there was no code at all in any of the try/catch/finally blocks.
- int fromTop = 0;
- while (true) {
- PendingTransaction topEntry = getPendingEntryFromTop(++fromTop);
- if (topEntry instanceof TryFinally) {
- if (((TryFinally) topEntry).tryNumber != tryNumber)
- break; // We met a finally that wasn't ours, so entire try group must be sent.
- } else if (topEntry instanceof TryCatch) {
- if (((TryCatch) topEntry).tryNumber != tryNumber)
- break; // We met a catch that wasn't ours, so entire try group must be sent.
- } else if (topEntry instanceof TryBegin) {
- if (((TryBegin) topEntry).tryNumber == tryNumber) {
- // We've met our try begin, and nothing but empty catch/finally in between, so the entire group can be thrown away
- popPendingEntry(fromTop);
- return;
- } else
- break; // We've hit a try begin that wasn't ours, so the entire try group must be sent.
- } else
- break; // We've hit something other than our try group, so process everything.
- }
- processPendingTransactions();
- IREMExpressionConnection connection = getConnection();
- try {
- // Format of push to try begin proxy command is:
- // PushExpressionCommand(push try end to proxy) followed by:
- // int: try id
- connection.pushExpressionCommand(getREMExpressionID(), (byte)InternalExpressionTypes.TRY_END_EXPRESSION_VALUE);
- connection.pushInt(tryNumber);
- } catch (IOException e) {
- connection.close();
- ProxyPlugin.getPlugin().getLogger().log(e);
- markInvalid(e.getLocalizedMessage());
- throwIllegalStateException(IO_EXCEPTION_MSG);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.Expression#pushThrowToProxy()
- */
- protected void pushThrowToProxy() {
- processPendingTransactions();
- IREMExpressionConnection connection = getConnection();
- try {
- // Format of push to try begin proxy command is:
- // PushExpressionCommand(push throw to proxy)
- connection.pushExpressionCommand(getREMExpressionID(), (byte)InternalExpressionTypes.THROW_EXPRESSION_VALUE);
- } catch (IOException e) {
- connection.close();
- ProxyPlugin.getPlugin().getLogger().log(e);
- markInvalid(e.getLocalizedMessage());
- throwIllegalStateException(IO_EXCEPTION_MSG);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.Expression#pushRethrowToProxy(int)
- */
- protected void pushRethrowToProxy(int tryNumber) {
- processPendingTransactions();
- IREMExpressionConnection connection = getConnection();
- try {
- // Format of push to rethow proxy command is:
- // PushExpressionCommand(push rethrow to proxy)
- // int: try id
- connection.pushExpressionCommand(getREMExpressionID(), (byte)InternalExpressionTypes.RETHROW_EXPRESSION_VALUE);
- connection.pushInt(tryNumber);
- } catch (IOException e) {
- connection.close();
- ProxyPlugin.getPlugin().getLogger().log(e);
- markInvalid(e.getLocalizedMessage());
- throwIllegalStateException(IO_EXCEPTION_MSG);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.Expression#pushBeanTypeToProxy(org.eclipse.jem.internal.proxy.core.IBeanTypeExpressionProxy)
- */
- protected void pushBeanTypeToProxy(IBeanTypeExpressionProxy proxy) {
- // Push beantype to proxy is sent out of sequence without respect to where in expression we are,
- // so no need to handle pending transactions at this point. They would not affect the result
- // of this call.
- IREMExpressionConnection connection = getConnection();
- try {
- // Format of push to beanType proxy command is:
- // PushExpressionCommand(push bean type expression proxy)
- // int: proxy id
- // string: typename
- connection.pushExpressionCommand(getREMExpressionID(), (byte)InternalExpressionTypes.PUSH_BEANTYPE_EXPRESSIONPROXY_EXPRESSION_VALUE);
- REMBeanTypeExpressionProxy ep = (REMBeanTypeExpressionProxy) proxy;
- connection.pushInt(ep.getProxyID());
- connection.pushString(ep.getTypeName());
- } catch (IOException e) {
- connection.close();
- ProxyPlugin.getPlugin().getLogger().log(e);
- markInvalid(e.getLocalizedMessage());
- throwIllegalStateException(IO_EXCEPTION_MSG);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.Expression#pushMethodToProxy(org.eclipse.jem.internal.proxy.core.ExpressionProxy, org.eclipse.jem.internal.proxy.core.IProxyBeanType, java.lang.String, org.eclipse.jem.internal.proxy.core.IProxyBeanType[])
- */
- protected void pushMethodToProxy(ExpressionProxy proxy, IProxyBeanType declaringType, String methodName, IProxyBeanType[] parameterTypes) {
- // Push method to proxy is sent out of sequence without respect to where in expression we are,
- // so no need to handle pending transactions at this point. They would not affect the result
- // of this call.
-
- IREMExpressionConnection connection = getConnection();
- try {
- // Format of push to method proxy command is:
- // PushExpressionCommand(push method type expression proxy)
- // int: proxy id
- // ValueObject: containing the rendered bean type proxy or the expression proxy for the declaring type
- // string: method name
- // int: number of parameter types
- // ValueObject(s): containing the rendered bean type proxy or the expression proxy for the parameter types.
- connection.pushExpressionCommand(getREMExpressionID(), (byte)InternalExpressionTypes.PUSH_METHOD_EXPRESSIONPROXY_EXPRESSION_VALUE);
- connection.pushInt(proxy.getProxyID());
- fillProxy(declaringType, workerValue);
- connection.pushValueObject(workerValue);
- connection.pushString(methodName);
- if (parameterTypes == null || parameterTypes.length == 0)
- connection.pushInt(0);
- else {
- connection.pushInt(parameterTypes.length);
- for (int i = 0; i < parameterTypes.length; i++) {
- fillProxy(parameterTypes[i], workerValue);
- connection.pushValueObject(workerValue);
- }
- }
- } catch (IOException e) {
- connection.close();
- ProxyPlugin.getPlugin().getLogger().log(e);
- markInvalid(e.getLocalizedMessage());
- throwIllegalStateException(IO_EXCEPTION_MSG);
- } catch (CommandException e) {
- ProxyPlugin.getPlugin().getLogger().log(e);
- markInvalid(e.getLocalizedMessage());
- if (!e.isRecoverable()) {
- connection.close();
- throwIllegalStateException(COMMAND_EXCEPTION_MSG);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.Expression#pushFieldToProxy(org.eclipse.jem.internal.proxy.core.ExpressionProxy, org.eclipse.jem.internal.proxy.core.IProxyBeanType, java.lang.String)
- */
- protected void pushFieldToProxy(ExpressionProxy proxy, IProxyBeanType declaringType, String fieldName) {
- // Push field to proxy is sent out of sequence without respect to where in expression we are,
- // so no need to handle pending transactions at this point. They would not affect the result
- // of this call.
-
- IREMExpressionConnection connection = getConnection();
- try {
- // Format of push to field proxy command is:
- // PushExpressionCommand(push field type expression proxy)
- // int: proxy id
- // ValueObject: containing the rendered bean type proxy or the expression proxy for the declaring type
- // string: field name
- connection.pushExpressionCommand(getREMExpressionID(), (byte)InternalExpressionTypes.PUSH_FIELD_EXPRESSIONPROXY_EXPRESSION_VALUE);
- connection.pushInt(proxy.getProxyID());
- fillProxy(declaringType, workerValue);
- connection.pushValueObject(workerValue);
- connection.pushString(fieldName);
- } catch (IOException e) {
- connection.close();
- ProxyPlugin.getPlugin().getLogger().log(e);
- markInvalid(e.getLocalizedMessage());
- throwIllegalStateException(IO_EXCEPTION_MSG);
- } catch (CommandException e) {
- ProxyPlugin.getPlugin().getLogger().log(e);
- markInvalid(e.getLocalizedMessage());
- if (!e.isRecoverable()) {
- connection.close();
- throwIllegalStateException(COMMAND_EXCEPTION_MSG);
- }
- }
- }
-
- /**
- * Get the map of IProxyMethods for a beantype. Meant to be used only in conjunction with REMProxyConstants.
- * It is here so the REMProxyConstants can store pending proxies per expression.
- *
- * @param beanType
- * @return
- *
- * @since 1.1.0
- */
- public Map getMethods(IProxyBeanType beanType) {
- if (methodsCache == null)
- methodsCache = new HashMap();
- Map methods = (Map) methodsCache.get(beanType.getTypeName());
- if(methods == null){
- methods = new HashMap(20);
- methodsCache.put(beanType.getTypeName(),methods);
- }
- return methods;
- }
-
- /**
- * Get the map of IProxyFields for a beantype. Meant to be used only in conjunction with REMProxyConstants.
- * It is here so the REMProxyConstants can store pending proxies per expression.
- *
- * @param beanType
- * @return
- *
- * @since 1.1.0
- */
- public Map getFields(IProxyBeanType beanType) {
- if (fieldsCache == null)
- fieldsCache = new HashMap();
- Map fields = (Map) fieldsCache.get(beanType.getTypeName());
- if(fields == null){
- fields = new HashMap(20);
- fieldsCache.put(beanType.getTypeName(),fields);
- }
- return fields;
- }
-
- /**
- * Get the map of IProxyBeanTypes for a beantype name. Meant to be used only in conjunction with REMSgtandardBeanTypeFactory.
- * It is here so the REMStandardBeanTypeFactory can store pending proxies per expression.
- *
- * @param beanType
- * @return
- *
- * @since 1.1.0
- */
- public IProxyBeanType getBeanType(String beanTypeName) {
- if (beanTypeCache == null)
- beanTypeCache = new HashMap();
- return (IProxyBeanType) beanTypeCache.get(beanTypeName);
- }
-
- /**
- * Add the beantype expression proxy to the map of bean type expression proxies. Used in conjunction with REMStandardBeanTypeFactory.
- * It is here so the REMStandardBeanTypeFactory can store pending proxies per expression.
- * @param beanTypeName
- * @param beantype
- *
- * @since 1.1.0
- */
- public void addBeanType(String beanTypeName, IProxyBeanType beantype) {
- beanTypeCache.put(beanTypeName, beantype);
- }
-
- /**
- * Remove the beantype expression proxy from the map. This is called because there was a rollback due to an endmark.
- * @param beanTypeName
- *
- * @since 1.1.0
- */
- public void removeBeanType(String beanTypeName) {
- beanTypeCache.remove(beanTypeName);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.Expression#pushIfTestToProxy()
- */
- protected void pushIfTestToProxy() {
- processPendingTransactions();
- IREMExpressionConnection connection = getConnection();
- try {
- // Format of push if test to proxy command is:
- // PushExpressionCommand(push if test to proxy)
- connection.pushExpressionCommand(getREMExpressionID(), (byte)InternalExpressionTypes.IF_TEST_EXPRESSION_VALUE);
- } catch (IOException e) {
- connection.close();
- ProxyPlugin.getPlugin().getLogger().log(e);
- markInvalid(e.getLocalizedMessage());
- throwIllegalStateException(IO_EXCEPTION_MSG);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.Expression#pushIfElseToProxy(org.eclipse.jem.internal.proxy.initParser.tree.InternalIfElseOperandType)
- */
- protected void pushIfElseToProxy(InternalIfElseOperandType clauseType) {
- processPendingTransactions();
- IREMExpressionConnection connection = getConnection();
- try {
- // Format of push conditional to proxy command is:
- // PushExpressionCommand(push if/else clause to proxy) followed by:
- // byte: clause type
- connection.pushExpressionCommand(getREMExpressionID(), (byte)InternalExpressionTypes.IF_ELSE_EXPRESSION_VALUE);
- connection.pushByte((byte) clauseType.getValue());
- } catch (IOException e) {
- connection.close();
- ProxyPlugin.getPlugin().getLogger().log(e);
- markInvalid(e.getLocalizedMessage());
- throwIllegalStateException(IO_EXCEPTION_MSG);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.Expression#pushNewInstanceToProxy(java.lang.String, org.eclipse.jem.internal.proxy.core.IProxyBeanType)
- */
- protected void pushNewInstanceToProxy(String initializationString, IProxyBeanType resultType) {
- processPendingTransactions();
- IREMExpressionConnection connection = getConnection();
- try {
- // Format of push new instance from initstring to proxy command is:
- // PushExpressionCommand(push new instance to proxy) followed by:
- // string: init string
- // ValueObject: containing the rendered bean type proxy or the expression proxy for the declaring type
- connection.pushExpressionCommand(getREMExpressionID(), (byte)InternalExpressionTypes.NEW_INSTANCE_VALUE);
- connection.pushString(initializationString);
- fillProxy(resultType, workerValue);
- connection.pushValueObject(workerValue);
- } catch (IOException e) {
- connection.close();
- ProxyPlugin.getPlugin().getLogger().log(e);
- markInvalid(e.getLocalizedMessage());
- throwIllegalStateException(IO_EXCEPTION_MSG);
- } catch (CommandException e) {
- ProxyPlugin.getPlugin().getLogger().log(e);
- markInvalid(e.getLocalizedMessage());
- if (!e.isRecoverable()) {
- connection.close();
- throwIllegalStateException(COMMAND_EXCEPTION_MSG);
- }
- }
- }
-
- private static class Mark extends PendingTransaction {
- public int markID;
-
- public Mark(int markID) {
- this.markID = markID;
- }
-
- public void pushTransaction(REMExpression remExpression) {
- IREMExpressionConnection connection = remExpression.getConnection();
- try {
- // Format of push mark to proxy command is:
- // PushExpressionCommand(push mark to proxy) followed by:
- // int: markID
- connection.pushExpressionCommand(remExpression.getREMExpressionID(), (byte)InternalExpressionTypes.MARK_VALUE);
- connection.pushInt(markID);
- } catch (IOException e) {
- connection.close();
- ProxyPlugin.getPlugin().getLogger().log(e);
- remExpression.markInvalid(e.getLocalizedMessage());
- remExpression.throwIllegalStateException(IO_EXCEPTION_MSG);
- }
- }
-
- }
-
- protected void pushMarkToProxy(int markID) {
- addPendingTransaction(new Mark(markID));
- }
-
- protected void pushEndmarkToProxy(int markID, boolean restore) {
- // See if the top pending transaction is now Mark(markID). If it is, then this transaction and the mark begin
- // can be thrown away because they are an empty block.
- PendingTransaction topEntry = getPendingEntryFromTop(1);
- if (topEntry instanceof Mark && ((Mark) topEntry).markID == markID) {
- popPendingEntry(1);
- return;
- }
- processPendingTransactions();
- IREMExpressionConnection connection = getConnection();
- try {
- // Format of push end mark to proxy command is:
- // PushExpressionCommand(push end mark to proxy) followed by:
- // int: markID
- // boolean: restore
- connection.pushExpressionCommand(getREMExpressionID(), (byte)InternalExpressionTypes.ENDMARK_VALUE);
- connection.pushInt(markID);
- connection.pushBoolean(restore);
- } catch (IOException e) {
- connection.close();
- ProxyPlugin.getPlugin().getLogger().log(e);
- markInvalid(e.getLocalizedMessage());
- throwIllegalStateException(IO_EXCEPTION_MSG);
- }
- }
-
- // This is the expression processor controller used to transfer.
- // This is the guy that maintains continuity of the transaction as
- // it is passed from one connection to another.
- protected IBeanProxy expressionProcesserController;
- protected void pushBeginTransferThreadToProxy() throws ThrowableProxy {
- // If the controller is not null, that means we had already requested a transfer
- // but had not used it in this thread so there is no need to do anything. It
- // will be handled when switching back to the other thread.
- // If the connection is null, no need to do anything since there is no connection
- // to transfer.
- if (connection != null && expressionProcesserController == null) {
- IREMExpressionConnection lclConnection = getConnection();
- markInTransaction(lclConnection);
- try {
- workerValue.set();
- lclConnection.transferExpression(getREMExpressionID(), workerValue);
- expressionProcesserController = getREMBeanProxyFactory().getBeanProxy(workerValue);
- getREMRegistry().returnConnection(lclConnection);
- this.connection = null;
- } catch (CommandException e) {
- ProxyPlugin.getPlugin().getLogger().log(e);
- if (!e.isRecoverable()) {
- lclConnection.close();
- throwIllegalStateException(COMMAND_EXCEPTION_MSG);
- }
- } finally {
- markEndTransaction(lclConnection);
- }
- }
- }
-
- protected void pushTransferThreadToProxy() {
- // Don't need to do anything. The next time we need to push data across, we will get a connection and the getConnection()
- // will hook up the expression processor controller for us. This way if nothing happens in this thread then we won't
- // waste communication time on it.
- }
-
- private static class SubexpressionBegin extends PendingTransaction {
- public int subexpressionNumber;
-
- public SubexpressionBegin(int subexpressionNumber) {
- this.subexpressionNumber = subexpressionNumber;
- }
-
- public void pushTransaction(REMExpression remExpression) {
- IREMExpressionConnection connection = remExpression.getConnection();
- try {
- // Format of push to subexpression begin proxy command is:
- // PushExpressionCommand(push subexpression begin proxy to proxy) followed by:
- // int: subexpression id
- connection.pushExpressionCommand(remExpression.getREMExpressionID(), (byte)InternalExpressionTypes.SUBEXPRESSION_BEGIN_EXPRESSION_VALUE);
- connection.pushInt(subexpressionNumber);
- } catch (IOException e) {
- connection.close();
- ProxyPlugin.getPlugin().getLogger().log(e);
- remExpression.markInvalid(e.getLocalizedMessage());
- remExpression.throwIllegalStateException(IO_EXCEPTION_MSG);
- }
- }
-
- }
-
- protected void pushSubexpressionBeginToProxy(int subexpressionNumber) {
- addPendingTransaction(new SubexpressionBegin(subexpressionNumber));
- }
-
- protected void pushSubexpressionEndToProxy(int subexpressionNumber) {
- // See if the top pending transactions is SubexpressionBegin(subexpressionNumber). If it is then the SubexpressionBegin can be thrown away.
- PendingTransaction topEntry = getPendingEntryFromTop(1);
- if (topEntry instanceof SubexpressionBegin && ((SubexpressionBegin) topEntry).subexpressionNumber == subexpressionNumber) {
- popPendingEntry(1);
- return;
- }
- processPendingTransactions();
- IREMExpressionConnection connection = getConnection();
- try {
- // Format of push to block end proxy command is:
- // PushExpressionCommand(push subexpression end proxy to proxy) followed by:
- // int: subexpression id
- connection.pushExpressionCommand(getREMExpressionID(), (byte)InternalExpressionTypes.SUBEXPRESSION_END_EXPRESSION_VALUE);
- connection.pushInt(subexpressionNumber);
- } catch (IOException e) {
- connection.close();
- ProxyPlugin.getPlugin().getLogger().log(e);
- markInvalid(e.getLocalizedMessage());
- throwIllegalStateException(IO_EXCEPTION_MSG);
- }
- }
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMFieldProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMFieldProxy.java
deleted file mode 100644
index b99a5968a..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMFieldProxy.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-import org.eclipse.jem.internal.proxy.core.*;
-import org.eclipse.jem.internal.proxy.common.remote.Commands;
-
-final class REMFieldProxy extends REMAccessibleObjectProxy implements IFieldProxy {
- private IBeanTypeProxy fFieldType;
-
- REMFieldProxy(REMProxyFactoryRegistry aRegistry, Integer anID) {
- super(aRegistry, anID);
- }
-
- /**
- * Return the type of the field.
- */
- public IBeanTypeProxy getFieldType() {
- if (fFieldType == null)
- fFieldType =
- (IBeanTypeProxy) REMStandardBeanProxyConstants.getConstants(fFactory).getFieldGetType().invokeCatchThrowableExceptions(
- this);
-
- return fFieldType;
- }
-
- /**
- * Release the proxy, i.e. mark it invalid.
- */
- public void release() {
- fFieldType = null;
- super.release();
- }
-
- /**
- * Get the value of this field from the subject
- */
- public IBeanProxy get(IBeanProxy subject) throws ThrowableProxy {
- // Format of getter parms is: (Object (subject)).
- // If the component type is primitive, we need to use the correct getter so that a valid value is returned,
- // if we just used the standard get, if the type was "int" the value returned would be an java.lang.Integer.
- IBeanTypeProxy fieldType = getFieldType();
- if (!fieldType.isPrimitive()) {
- // Use standard getter.
- return ((IREMMethodProxy) REMStandardBeanProxyConstants.getConstants(fFactory).getFieldGet()).invoke(this, subject);
- } else {
- // Use the correct primitive getter.
- int id = ((IREMBeanProxy) fieldType).getID().intValue();
- switch (id) {
- case Commands.BYTE_TYPE :
- return ((IREMMethodProxy) REMStandardBeanProxyConstants.getConstants(fFactory).getFieldGetByte()).invoke(this, subject);
- case Commands.BOOLEAN_TYPE :
- return ((IREMMethodProxy) REMStandardBeanProxyConstants.getConstants(fFactory).getFieldGetBoolean()).invoke(
- this,
- subject);
- case Commands.CHARACTER_TYPE :
- return ((IREMMethodProxy) REMStandardBeanProxyConstants.getConstants(fFactory).getFieldGetChar()).invoke(this, subject);
- case Commands.DOUBLE_TYPE :
- return ((IREMMethodProxy) REMStandardBeanProxyConstants.getConstants(fFactory).getFieldGetDouble()).invoke(
- this,
- subject);
- case Commands.FLOAT_TYPE :
- return ((IREMMethodProxy) REMStandardBeanProxyConstants.getConstants(fFactory).getFieldGetFloat()).invoke(
- this,
- subject);
- case Commands.INTEGER_TYPE :
- return ((IREMMethodProxy) REMStandardBeanProxyConstants.getConstants(fFactory).getFieldGetInt()).invoke(this, subject);
- case Commands.LONG_TYPE :
- return ((IREMMethodProxy) REMStandardBeanProxyConstants.getConstants(fFactory).getFieldGetLong()).invoke(this, subject);
- case Commands.SHORT_TYPE :
- return ((IREMMethodProxy) REMStandardBeanProxyConstants.getConstants(fFactory).getFieldGetShort()).invoke(
- this,
- subject);
- }
- }
-
- return null;
- }
-
- /**
- * Set the value of this field in this subject to this value.
- */
- public void set(IBeanProxy subject, IBeanProxy value) throws ThrowableProxy {
- REMStandardBeanProxyConstants.getConstants(fFactory).getFieldSet().invoke(this, new IBeanProxy[] { subject, value });
- }
-
- /**
- * The type proxy is constant proxy out of the method factory.
- */
- public IBeanTypeProxy getTypeProxy() {
- return ((REMMethodProxyFactory) fFactory.getMethodProxyFactory()).fieldType;
- }
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMFieldTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMFieldTypeProxy.java
deleted file mode 100644
index 06f6670ea..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMFieldTypeProxy.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-
-import org.eclipse.jem.internal.proxy.core.*;
-import org.eclipse.jem.internal.proxy.common.remote.Commands;
-/**
- * BeanType Proxy for Method class.
- */
-
-final class REMFieldTypeProxy extends REMAbstractBeanTypeProxy {
-
-REMFieldTypeProxy(REMProxyFactoryRegistry aRegistry, IBeanTypeProxy accessibleTypeProxy) {
- super(aRegistry, new Integer(Commands.FIELD_CLASS), java.lang.reflect.Field.class.getName(), accessibleTypeProxy);
-}
-
-/**
- * newBeanTypeForClass: Create a new beantypeproxy of this kind for the given class.
- * This is used by beantype proxy factory when creating a beantype proxy for a subclass.
- * This is because subclasses, unless explicitly overridden, should use the same kind
- * of beantype proxy. This way if anything special is needed for a specific type, then
- * that can be done.
- *
- * For all of the accessible object types, they are final classes, so you can't create a newBeanType
- * for subclasses.
- */
-public IREMBeanTypeProxy newBeanTypeForClass(Integer anID, String aClassname, boolean anAbstract) {
- throw new UnsupportedOperationException();
-}
-
-/**
- * Specialized from REMAbstractBeanTypeProxy to ensure Constructor proxies are created correctly.
- */
-public IREMBeanProxy newBeanProxy(Integer objectID) {
- return new REMFieldProxy(fRegistry, objectID);
-}
-
-/**
- * Note: Since new instances of Constructor are never done through a default ctor,
- * this function is not supported.
- */
-public IBeanProxy newInstance() {
- throw new UnsupportedOperationException();
-}
-
-/**
- * Note: Since new instances of Constructor are never done through an initialization string,
- * this function is not supported.
- */
-public IBeanProxy newInstance(String initializationString) {
- throw new UnsupportedOperationException();
-}
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMFloatClassBeanProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMFloatClassBeanProxy.java
deleted file mode 100644
index ab325e3f5..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMFloatClassBeanProxy.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-
-import org.eclipse.jem.internal.proxy.core.*;
-import org.eclipse.jem.internal.proxy.common.remote.Commands;
-/**
- * Remote proxy implementation of INumberBeanProxy for Float.class
- */
-class REMFloatClassBeanProxy extends REMNumberBeanProxy {
-
-REMFloatClassBeanProxy(REMProxyFactoryRegistry aRegistry, Float aFloat) {
- super(aRegistry, aFloat);
-}
-
-/**
- * Get the beantype
- */
-public IBeanTypeProxy getTypeProxy() {
- return ((REMStandardBeanTypeProxyFactory) fFactory.getBeanTypeProxyFactory()).floatClass;
-}
-
-/**
- * Render the bean into value object.
- */
-public void renderBean(Commands.ValueObject value) {
- value.set((Float) numberValue());
-}
-}
-
-
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMFloatClassBeanTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMFloatClassBeanTypeProxy.java
deleted file mode 100644
index da271beec..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMFloatClassBeanTypeProxy.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-
-import org.eclipse.jem.internal.proxy.core.*;
-import org.eclipse.jem.internal.proxy.common.remote.Commands;
-/**
- * Remote Implementation of IBeanTypePRoxy for Float.class
- * Creation date: (2/6/00 9:01:40 AM)
- * @author: Joe Winchester
- */
-final class REMFloatClassBeanTypeProxy extends REMAbstractNumberBeanTypeProxy {
-// Some values are cache'd for speed
- private final INumberBeanProxy zeroProxy;
-/**
- * REMIntegerBeanTypeProxy constructor comment.
- * @param aClass java.lang.Class
- */
-REMFloatClassBeanTypeProxy(REMProxyFactoryRegistry aRegistry, IBeanTypeProxy numberType) {
- super(aRegistry, new Integer(Commands.FLOAT_CLASS), Float.class.getName(), numberType);
-
- // Create the cached values
- zeroProxy = new REMFloatClassBeanProxy(aRegistry, new Float(0F));
-}
-
-/**
- * Helper to create a bean proxy
- * Package protected because everyone should go through the factory API
- * that is defined as part of IBeanProxyFactory
- */
-INumberBeanProxy createFloatBeanProxy(Float aFloat) {
- return (aFloat.floatValue() != 0F) ?
- new REMFloatClassBeanProxy(fRegistry, aFloat) : zeroProxy;
-}
-
-/**
- * Generic way to create an Float proxy, however, the Number must be a Float.
- */
-protected INumberBeanProxy createNumberBeanProxy(Number aNumber) {
- return createFloatBeanProxy((Float) aNumber);
-}
-
-/**
- * newInstance method. Number's don't have a default ctor, so the standard way won't work.
- * Return the zero proxy for this case.
- */
-public IBeanProxy newInstance() {
- return zeroProxy;
-}
-
-/**
- * Create a new bean proxy the ValueObject passed in.
- * We will assume the object is correct type.
- */
-public IBeanProxy newBeanProxy(Commands.ValueObject value) {
- return createFloatBeanProxy(new Float(value.aFloat));
-}
-
-}
-
-
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMFloatTypeBeanProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMFloatTypeBeanProxy.java
deleted file mode 100644
index 67fab4107..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMFloatTypeBeanProxy.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-
-import org.eclipse.jem.internal.proxy.common.remote.Commands;
-import org.eclipse.jem.internal.proxy.core.*;
-/**
- * Remote Implementation of INumberBeanProxy for the primitive "float".
- * It can answer all of the primitive number types (int, long, short, byte, double, float).
- * Creation date: (2/6/00 9:02:54 AM)
- * @author: Joe Winchester
- */
-class REMFloatTypeBeanProxy extends REMConstantBeanProxy implements INumberBeanProxy {
- private final float fFloat;
-
-/**
- * It is package protected because they are created
- * in a special way and no one else should create them.
- * @param aBean java.lang.Object
- */
-REMFloatTypeBeanProxy(REMProxyFactoryRegistry aRegistry, float aFloat) {
- super(aRegistry);
- fFloat = aFloat;
-}
-/**
- * equals: Equal if:
- * 1) This proxy == (identity) to the other object
- * 2) Else if other is an IBeanProxy and not a constant one, then if
- * equals on the server.
- * 3) If this is a constant proxy and the other is too or is a constant
- * value (e.g. IStringBeanProxy.equals(String), then true if values are equals.
- */
-public boolean equals(Object anObject) {
- if (this == anObject)
- return true; // Identity
- if (anObject instanceof REMFloatTypeBeanProxy)
- return fFloat == ((REMFloatTypeBeanProxy) anObject).floatValue();
- if (anObject instanceof Double)
- return fFloat == ((Float) anObject).floatValue();
- return false;
-}
-
-/* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IBeanProxy#sameAs(org.eclipse.jem.internal.proxy.core.IBeanProxy)
- */
-public boolean sameAs(IBeanProxy aBeanProxy) {
- if (this == aBeanProxy)
- return true; // Identity
- if (aBeanProxy instanceof REMFloatTypeBeanProxy)
- return fFloat == ((REMFloatTypeBeanProxy) aBeanProxy).floatValue();
- return false;
-}
-/**
- * byteValue method comment.
- */
-public byte byteValue() {
- return (byte) fFloat;
-}
-/**
- * doubleValue method comment.
- */
-public double doubleValue() {
- return fFloat;
-}
-/**
- * floatValue method comment.
- */
-public float floatValue() {
- return fFloat;
-}
-/**
- * Return the int value
- */
-public int intValue() {
- return (int) fFloat;
-}
-/**
- * longValue method comment.
- */
-public long longValue() {
- return (long) fFloat;
-}
-/**
- * numberValue method comment.
- */
-public Number numberValue() {
- return new Float(fFloat);
-}
-/**
- * shortValue method comment.
- */
-public short shortValue() {
- return (short) fFloat;
-}
-
-/**
- * The bean's toString.
- */
-public String toBeanString() {
- return String.valueOf(fFloat);
-}
-
-/**
- * Get the beantype
- */
-public IBeanTypeProxy getTypeProxy() {
- return ((REMStandardBeanTypeProxyFactory) fFactory.getBeanTypeProxyFactory()).floatType;
-}
-
-/**
- * Render the bean into value object.
- */
-public void renderBean(Commands.ValueObject value) {
- value.set(fFloat);
-}
-}
-
-
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMFloatTypeBeanTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMFloatTypeBeanTypeProxy.java
deleted file mode 100644
index edc7eb193..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMFloatTypeBeanTypeProxy.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-
-import org.eclipse.jem.internal.proxy.core.*;
-import org.eclipse.jem.internal.proxy.common.remote.Commands;
-/**
- * Remote Implementation of IBeanTypeProxy for Float.TYPE.
- * Creation date: (2/6/00 9:01:40 AM)
- * @author: Joe Winchester
- */
-final class REMFloatTypeBeanTypeProxy extends REMPrimitiveBeanTypeProxy {
-// Some values are cache'd for speed
- private final INumberBeanProxy zeroProxy;
-/**
- * REMIntegerBeanTypeProxy constructor comment.
- * @param aClass java.lang.Class
- */
-REMFloatTypeBeanTypeProxy(REMProxyFactoryRegistry aRegistry) {
- super(aRegistry, new Integer(Commands.FLOAT_TYPE), Float.TYPE.getName());
-
- // Create the cached values
- zeroProxy = new REMFloatTypeBeanProxy(aRegistry, 0F);
-}
-
-/**
- * Helper to create a bean proxy
- * Package protected because everyone should go through the factory API
- * that is defined as part of IBeanProxyFactory
- */
-INumberBeanProxy createFloatBeanProxy(float aFloat) {
- return (aFloat != 0F) ?
- new REMFloatTypeBeanProxy(fRegistry, aFloat) : zeroProxy;
-}
-
-/**
- * newInstance method. float is a primitive, so the standard way won't work.
- * Return the zeroProxy for this case because that is the default value.
- */
-public IBeanProxy newInstance() {
- return zeroProxy;
-}
-
-/**
- * Create a new bean proxy the ValueObject passed in.
- * We will assume the object is correct type.
- */
-public IBeanProxy newBeanProxy(Commands.ValueObject value) {
- return createFloatBeanProxy(value.aFloat);
-}
-
-/**
- * Short cut for newInstance where the string follows the
- * specific pattern we expect. That way it won't be necessary to ship over to the vm
- * to process it.
- *
- * The pattern it can accept is:
- * 1) (float) validNumber - number can be any number because (float) explicitly casts it down.
- * 2) validNumber
- * It will use the decode function of float to determine the valid number.
- */
-public IBeanProxy newInstance(String initializationString) throws ThrowableProxy, ClassCastException, InstantiationException {
- String trim = initializationString.trim();
- if (trim.length() == 0)
- return super.newInstance(initializationString);
- float aFloat;
- if (trim.startsWith("(float)")) { //$NON-NLS-1$
- Number v = parseString(trim.substring("(float)".length()).trim()); //$NON-NLS-1$
- if (v != null)
- aFloat = v.floatValue();
- else
- return super.newInstance(initializationString); // Can't decode it, let full parser handle it.
- } else {
- try {
- aFloat = Float.valueOf(initializationString).floatValue(); // See if valid float format.
- } catch (NumberFormatException e) {
- return super.newInstance(initializationString); // Can't decode it, let full parser handle it.
- }
- }
-
- return getProxyFactoryRegistry().getBeanProxyFactory().createBeanProxyWith(aFloat);
-}
-}
-
-
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMInitErrorBeanTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMInitErrorBeanTypeProxy.java
deleted file mode 100644
index d70efd2fd..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMInitErrorBeanTypeProxy.java
+++ /dev/null
@@ -1,469 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-
-import org.eclipse.jem.internal.proxy.core.*;
-import org.eclipse.jem.internal.proxy.common.remote.Commands;
-
-/**
- * A special bean type proxy. It is for those bean types that had an instantiation error while being initialized. It is so we have the message. All
- * other actions against it will fail.
- *
- * @author richkulp
- */
-public class REMInitErrorBeanTypeProxy implements IREMBeanTypeProxy {
-
- protected final String initializationError;
-
- protected final REMProxyFactoryRegistry registry;
-
- protected final String classname;
-
- /**
- * Constructor for REMInitErrorBeanTypeProxy.
- */
- public REMInitErrorBeanTypeProxy(REMProxyFactoryRegistry registry, String initializationError, String classname) {
- super();
- this.registry = registry;
- this.initializationError = initializationError;
- this.classname = classname;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.remote.IREMBeanTypeProxy#newBeanProxy(java.lang.Integer)
- */
- public IREMBeanProxy newBeanProxy(Integer anID) {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.remote.IREMBeanTypeProxy#newBeanTypeForClass(java.lang.Integer, java.lang.String, boolean)
- */
- public IREMBeanTypeProxy newBeanTypeForClass(Integer anID, String aClassname, boolean anAbstract) {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getConstructorProxy(java.lang.String[])
- */
- public IConstructorProxy getConstructorProxy(String[] argumentClassNames) {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getConstructorProxy(org.eclipse.jem.internal.proxy.core.IBeanTypeProxy[])
- */
- public IConstructorProxy getConstructorProxy(IBeanTypeProxy[] argumentTypes) {
- return null;
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getConstructors()
- */
- public IConstructorProxy[] getConstructors() {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getConstructorProxy(java.lang.String[])
- */
- public IConstructorProxy getDeclaredConstructorProxy(String[] argumentClassNames) {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getConstructorProxy(org.eclipse.jem.internal.proxy.core.IBeanTypeProxy[])
- */
- public IConstructorProxy getDeclaredConstructorProxy(IBeanTypeProxy[] argumentTypes) {
- return null;
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getConstructors()
- */
- public IConstructorProxy[] getDeclaredConstructors() {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getConstructors()
- */
- public IFieldProxy[] getFields() {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getConstructors()
- */
- public IFieldProxy[] getDeclaredFields() {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getFieldProxy(java.lang.String)
- */
- public IFieldProxy getFieldProxy(String fieldName) {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getDeclaredFieldProxy(java.lang.String)
- */
- public IFieldProxy getDeclaredFieldProxy(String fieldName) {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getConstructors()
- */
- public IMethodProxy[] getMethods() {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getConstructors()
- */
- public IMethodProxy[] getDeclaredMethods() {
- return null;
- }
-
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getMethodProxy(java.lang.String)
- */
- public IMethodProxy getMethodProxy(String methodName) {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getMethodProxy(java.lang.String, java.lang.String[])
- */
- public IMethodProxy getMethodProxy(String methodName, String[] argumentClassNames) {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getMethodProxy(java.lang.String, java.lang.String)
- */
- public IMethodProxy getMethodProxy(String methodName, String argumentClassName) {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getMethodProxy(java.lang.String, org.eclipse.jem.internal.proxy.core.IBeanTypeProxy[])
- */
- public IMethodProxy getMethodProxy(String methodName, IBeanTypeProxy[] argumentTypes) {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getMethodProxy(java.lang.String, org.eclipse.jem.internal.proxy.core.IBeanTypeProxy[])
- */
- public IMethodProxy getDeclaredMethodProxy(String methodName, IBeanTypeProxy[] argumentTypes) {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getMethodProxy(java.lang.String, java.lang.String[])
- */
- public IMethodProxy getDeclaredMethodProxy(String methodName, String[] argumentClassNames) {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getNullConstructorProxy()
- */
- public IConstructorProxy getNullConstructorProxy() {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanProxy#getProxyFactoryRegistry()
- */
- public ProxyFactoryRegistry getProxyFactoryRegistry() {
- return registry;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getSuperBeanTypeProxy()
- */
- public IBeanTypeProxy getSuperBeanTypeProxy() {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getTypeName()
- */
- public String getTypeName() {
- return classname;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getFormalTypeName()
- */
- public String getFormalTypeName() {
- return getTypeName();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#isArray()
- */
- public boolean isArray() {
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#isInterface()
- */
- public boolean isInterface() {
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#isPrimitive()
- */
- public boolean isPrimitive() {
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#isKindOf(org.eclipse.jem.internal.proxy.core.IBeanTypeProxy)
- */
- public boolean isKindOf(IBeanTypeProxy aBeanProxyType) {
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#newInstance()
- */
- public IBeanProxy newInstance() throws ThrowableProxy {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#newInstance(java.lang.String)
- */
- public IBeanProxy newInstance(String initializationString) throws ThrowableProxy, ClassCastException, InstantiationException {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getInitializationError()
- */
- public String getInitializationError() {
- return initializationError;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.remote.IREMBeanProxy#getID()
- */
- public Integer getID() {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.remote.IREMBeanProxy#release()
- */
- public void release() {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.remote.IREMBeanProxy#renderBean(org.eclipse.jem.internal.proxy.common.remote.Commands.ValueObject)
- */
- public void renderBean(Commands.ValueObject renderInto) {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanProxy#getTypeProxy()
- */
- public IBeanTypeProxy getTypeProxy() {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanProxy#toBeanString()
- */
- public String toBeanString() {
- return ""; //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanProxy#isValid()
- */
- public boolean isValid() {
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanProxy#sameAs(org.eclipse.jem.internal.proxy.core.IBeanProxy)
- */
- public boolean sameAs(IBeanProxy aBeanProxy) {
- return this == aBeanProxy; // This is place holder anyway. So only identical if same proxy.
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getInvokable(java.lang.String, org.eclipse.jem.internal.proxy.core.IBeanTypeProxy[])
- */
- public IInvokable getInvokable(String methodName, IBeanTypeProxy[] argumentTypes) {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getInvokable(java.lang.String, java.lang.String)
- */
- public IInvokable getInvokable(String methodName, String argumentClassName) {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getInvokable(java.lang.String, java.lang.String[])
- */
- public IInvokable getInvokable(String methodName, String[] argumentClassNames) {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getInvokable(java.lang.String)
- */
- public IInvokable getInvokable(String methodName) {
- return null;
- }
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getCompatibleConstructor(org.eclipse.jem.internal.proxy.core.IBeanTypeProxy[])
- */
- public IConstructorProxy getCompatibleConstructor(IBeanTypeProxy[] argumentTypes) {
- return null;
- }
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getCompatibleMethod(java.lang.String, org.eclipse.jem.internal.proxy.core.IBeanTypeProxy[])
- */
- public IMethodProxy getCompatibleMethod(String methodName, IBeanTypeProxy[] argumentTypes) {
- return null;
- }
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IProxy#isBeanProxy()
- */
- public final boolean isBeanProxy() {
- return true;
- }
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IProxy#isExpressionProxy()
- */
- public final boolean isExpressionProxy() {
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IProxyBeanType#getMethodProxy(org.eclipse.jem.internal.proxy.core.IExpression, java.lang.String, org.eclipse.jem.internal.proxy.core.IProxyBeanType[])
- */
- public IProxyMethod getMethodProxy(IExpression expression, String methodName, IProxyBeanType[] parameters) {
- return null; // Since this guy is invalid, we can't return a method.
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IProxyBeanType#getMethodProxy(org.eclipse.jem.internal.proxy.core.IExpression, java.lang.String, java.lang.String[])
- */
- public IProxyMethod getMethodProxy(IExpression expression, String methodName, String[] parameterTypes) {
- return null;
- }
-
- public IProxyMethod getMethodProxy(IExpression expression, String methodName) {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IProxyBeanType#getFieldProxy(org.eclipse.jem.internal.proxy.core.IExpression, java.lang.String)
- */
- public IProxyField getFieldProxy(IExpression expression, String fieldName) {
- return null;
- }
-
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMIntegerClassBeanProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMIntegerClassBeanProxy.java
deleted file mode 100644
index 790596823..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMIntegerClassBeanProxy.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-
-import org.eclipse.jem.internal.proxy.core.*;
-import org.eclipse.jem.internal.proxy.common.remote.Commands;
-/**
- * Remote Proxy for Integers. Since Integers were first implemented
- * in the VCE, and because they are often referenced, we've created
- * a subclass to handle them. That way we wouldn't need to change
- * everyone that was using the IIntegerProxy interface.
- * Creation date: (08/31/00 11:28:48 AM)
- * @author: Administrator
- */
-class REMIntegerClassBeanProxy extends REMNumberBeanProxy implements IIntegerBeanProxy {
-
-REMIntegerClassBeanProxy(REMProxyFactoryRegistry aRegistry, Integer anInteger) {
- super(aRegistry, anInteger);
-}
-
-/**
- * Get the beantype
- */
-public IBeanTypeProxy getTypeProxy() {
- return ((REMStandardBeanTypeProxyFactory) fFactory.getBeanTypeProxyFactory()).integerClass;
-}
-
-/**
- * Render the bean into value object.
- */
-public void renderBean(Commands.ValueObject value) {
- value.set((Integer) numberValue());
-}
-}
-
-
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMIntegerClassBeanTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMIntegerClassBeanTypeProxy.java
deleted file mode 100644
index 7e5d6cc5d..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMIntegerClassBeanTypeProxy.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-
-import org.eclipse.jem.internal.proxy.core.*;
-import org.eclipse.jem.internal.proxy.common.remote.Commands;
-/**
- * Remote Implementation of INumberBeanProxy for Integer.class.
- * Creation date: (2/6/00 9:01:40 AM)
- * @author: Joe Winchester
- */
-final class REMIntegerClassBeanTypeProxy extends REMAbstractNumberBeanTypeProxy {
-// Some values are cache'd for speed
- private final IIntegerBeanProxy zeroProxy;
- private final IIntegerBeanProxy oneProxy;
- private final IIntegerBeanProxy twoProxy;
- private final IIntegerBeanProxy threeProxy;
-/**
- * REMIntegerBeanTypeProxy constructor comment.
- * @param aClass java.lang.Class
- */
-REMIntegerClassBeanTypeProxy(REMProxyFactoryRegistry aRegistry, IBeanTypeProxy numberType) {
- super(aRegistry, new Integer(Commands.INTEGER_CLASS), Integer.class.getName(), numberType);
-
- // Create the cached values
- zeroProxy = new REMIntegerClassBeanProxy(aRegistry, new Integer(0));
- oneProxy = new REMIntegerClassBeanProxy(aRegistry, new Integer(1));
- twoProxy = new REMIntegerClassBeanProxy(aRegistry, new Integer(2));
- threeProxy = new REMIntegerClassBeanProxy(aRegistry, new Integer(3));
-
-}
-
-/**
- * Helper to create a bean proxy
- * Package protected because everyone should go through the factory API
- * that is defined as part of IBeanProxyFactory
- */
-IIntegerBeanProxy createIntegerBeanProxy(Integer anInteger) {
- switch(anInteger.intValue()) {
- case 0: return zeroProxy;
- case 1: return oneProxy ;
- case 2: return twoProxy ;
- case 3: return threeProxy ;
- default: return new REMIntegerClassBeanProxy(fRegistry, anInteger);
- }
-}
-
-/**
- * Generic way to create an Integer proxy, however, the Number must be an Integer.
- */
-protected INumberBeanProxy createNumberBeanProxy(Number aNumber) {
- return createIntegerBeanProxy((Integer) aNumber);
-}
-
-/**
- * newInstance method. Number's don't have a default ctor, so the standard way won't work.
- * Return the zero proxy for this case.
- */
-public IBeanProxy newInstance() {
- return zeroProxy;
-}
-
-/**
- * Create a new bean proxy the ValueObject passed in.
- * We will assume the object is correct type.
- */
-public IBeanProxy newBeanProxy(Commands.ValueObject value) {
- return createIntegerBeanProxy(new Integer(value.anInt));
-}
-}
-
-
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMIntegerTypeBeanProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMIntegerTypeBeanProxy.java
deleted file mode 100644
index e80dcc1ec..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMIntegerTypeBeanProxy.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-
-import org.eclipse.jem.internal.proxy.common.remote.Commands;
-import org.eclipse.jem.internal.proxy.core.*;
-/**
- * Remote Implementation of IIntegerBeanProxy for the primitive "int".
- * It can answer all of the primitive number types (int, long, short, byte, double, float).
- * Creation date: (2/6/00 9:02:54 AM)
- * @author: Joe Winchester
- */
-class REMIntegerTypeBeanProxy extends REMConstantBeanProxy implements IIntegerBeanProxy {
- private final int fInt;
-
-/**
- * It is package protected because they are created
- * in a special way and no one else should create them.
- * @param aBean java.lang.Object
- */
-REMIntegerTypeBeanProxy(REMProxyFactoryRegistry aRegistry, int anInt) {
- super(aRegistry);
- fInt = anInt;
-}
-/**
- * equals: Equal if:
- * 1) This proxy == (identity) to the other object
- * 2) Else if other is an IBeanProxy and not a constant one, then if
- * equals on the server.
- * 3) If this is a constant proxy and the other is too or is a constant
- * value (e.g. IStringBeanProxy.equals(String), then true if values are equals.
- */
-public boolean equals(Object anObject) {
- if (this == anObject)
- return true; // Identity
- if (anObject instanceof REMIntegerTypeBeanProxy)
- return fInt == ((REMIntegerTypeBeanProxy) anObject).intValue();
- if (anObject instanceof Integer)
- return fInt == ((Integer) anObject).intValue();
- return false;
-}
-
-/* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IBeanProxy#sameAs(org.eclipse.jem.internal.proxy.core.IBeanProxy)
- */
-public boolean sameAs(IBeanProxy aBeanProxy) {
- if (this == aBeanProxy)
- return true; // Identity
- if (aBeanProxy instanceof REMIntegerTypeBeanProxy)
- return fInt == ((REMIntegerTypeBeanProxy) aBeanProxy).intValue();
- return false;
-}
-
-/**
- * byteValue method comment.
- */
-public byte byteValue() {
- return (byte) fInt;
-}
-/**
- * doubleValue method comment.
- */
-public double doubleValue() {
- return fInt;
-}
-/**
- * floatValue method comment.
- */
-public float floatValue() {
- return fInt;
-}
-/**
- * Return the int value
- */
-public int intValue() {
- return fInt;
-}
-/**
- * longValue method comment.
- */
-public long longValue() {
- return fInt;
-}
-/**
- * numberValue method comment.
- */
-public Number numberValue() {
- return new Integer(fInt);
-}
-/**
- * shortValue method comment.
- */
-public short shortValue() {
- return (short) fInt;
-}
-
-/**
- * The bean's toString.
- */
-public String toBeanString() {
- return String.valueOf(fInt);
-}
-
-/**
- * Get the beantype
- */
-public IBeanTypeProxy getTypeProxy() {
- return ((REMStandardBeanTypeProxyFactory) fFactory.getBeanTypeProxyFactory()).intType;
-}
-
-/**
- * Render the bean into value object.
- */
-public void renderBean(Commands.ValueObject value) {
- value.set(fInt);
-}
-}
-
-
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMIntegerTypeBeanTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMIntegerTypeBeanTypeProxy.java
deleted file mode 100644
index 1f35e7f88..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMIntegerTypeBeanTypeProxy.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-
-import org.eclipse.jem.internal.proxy.core.*;
-import org.eclipse.jem.internal.proxy.common.remote.Commands;
-/**
- * Remote Implementation of IBeanTypeProxy for Integer.TYPE.
- * Creation date: (2/6/00 9:01:40 AM)
- * @author: Joe Winchester
- */
-final class REMIntegerTypeBeanTypeProxy extends REMPrimitiveBeanTypeProxy {
-// Some values are cache'd for speed
- private final IIntegerBeanProxy zeroProxy;
- private final IIntegerBeanProxy oneProxy;
- private final IIntegerBeanProxy twoProxy;
- private final IIntegerBeanProxy threeProxy;
-/**
- * REMIntegerBeanTypeProxy constructor comment.
- * @param aClass java.lang.Class
- */
-REMIntegerTypeBeanTypeProxy(REMProxyFactoryRegistry aRegistry) {
- super(aRegistry, new Integer(Commands.INTEGER_TYPE), Integer.TYPE.getName());
-
- // Create the cached values
- zeroProxy = new REMIntegerTypeBeanProxy(aRegistry, 0);
- oneProxy = new REMIntegerTypeBeanProxy(aRegistry, 1);
- twoProxy = new REMIntegerTypeBeanProxy(aRegistry, 2);
- threeProxy = new REMIntegerTypeBeanProxy(aRegistry, 3);
-
-}
-/**
- * Helper to create a bean proxy
- * Package protected because everyone should go through the factory API
- * that is defined as part of IBeanProxyFactory
- * Use the cache to see if the value is being held before creating a new one
- */
-IIntegerBeanProxy createIntegerBeanProxy(int anInt) {
-
- switch(anInt) {
- case 0: return zeroProxy;
- case 1: return oneProxy ;
- case 2: return twoProxy ;
- case 3: return threeProxy ;
- default: return new REMIntegerTypeBeanProxy(fRegistry, anInt);
- }
-}
-
-/**
- * newInstance method. integer is a primitive, so the standard way won't work.
- * Return the zeroProxy for this case because that is the default value.
- */
-public IBeanProxy newInstance() {
- return zeroProxy;
-}
-
-/**
- * Create a new bean proxy the ValueObject passed in.
- * We will assume the object is correct type.
- */
-public IBeanProxy newBeanProxy(Commands.ValueObject value) {
- return createIntegerBeanProxy(value.anInt);
-}
-
-/**
- * Short cut for newInstance where the string follows the
- * specific pattern we expect. That way it won't be necessary to ship over to the vm
- * to process it.
- *
- * The pattern it can accept is:
- * 1) (int) validNumber - number can be any number because (byte) explicitly casts it down.
- * 2) validNumber
- * It will use the decode function of int to determine the valid number.
- */
-public IBeanProxy newInstance(String initializationString) throws ThrowableProxy, ClassCastException, InstantiationException {
- String trim = initializationString.trim();
- if (trim.length() == 0)
- return super.newInstance(initializationString);
- int anInt;
- if (trim.startsWith("(int)")) { //$NON-NLS-1$
- Number v = parseString(trim.substring("(int)".length()).trim()); //$NON-NLS-1$
- if (v != null)
- anInt = v.intValue();
- else
- return super.newInstance(initializationString); // Can't decode it, let full parser handle it.
- } else {
- try {
- anInt = Integer.decode(trim).intValue(); // See if valid int format.
- } catch (NumberFormatException e) {
- return super.newInstance(initializationString); // Can't decode it, let full parser handle it.
- }
- }
-
- return getProxyFactoryRegistry().getBeanProxyFactory().createBeanProxyWith(anInt);
-}
-}
-
-
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMInterfaceBeanTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMInterfaceBeanTypeProxy.java
deleted file mode 100644
index f18ed5221..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMInterfaceBeanTypeProxy.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-
-import org.eclipse.jem.internal.proxy.core.*;
-/**
- * Default beantype proxy for an interface.
- */
-
-public class REMInterfaceBeanTypeProxy extends REMAbstractBeanTypeProxy {
-
- protected REMInterfaceBeanTypeProxy(REMProxyFactoryRegistry aRegistry, Integer anID, String aClassname) {
- super(aRegistry, anID, aClassname, null);
- }
-
- /**
- * Interfaces are interfaces.
- */
- public boolean isInterface() {
- return true;
- }
-
- /**
- * Create a new bean proxy with the specified id.
- *
- * For all of the interface types, this is an invalid operation.
- */
- public IREMBeanProxy newBeanProxy(Integer anID) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * newBeanTypeForClass: Create a new beantypeproxy of this kind for the given class.
- * This is used by beantype proxy factory when creating a beantype proxy for a subclass.
- * This is because subclasses, unless explicitly overridden, should use the same kind
- * of beantype proxy. This way if anything special is needed for a specific type, then
- * that can be done.
- *
- * For all of the interface types, you can't create a newBeanType for subclasses since
- * interface aren't subclassable, only extendable.
- */
- public IREMBeanTypeProxy newBeanTypeForClass(Integer anID, String aClassname, boolean anAbstact) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Note: Since new instances of interfaces can never be done,
- * this function is not supported.
- */
- public IBeanProxy newInstance() {
- throw new UnsupportedOperationException();
- }
-
- /**
- * newInstance(initializationString) is valid because it can be used to create
- * an instance of an implementation of the interface.
- */
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMInvokable.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMInvokable.java
deleted file mode 100644
index fc4514b75..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMInvokable.java
+++ /dev/null
@@ -1,233 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 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.jem.internal.proxy.remote;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-
-import org.eclipse.jem.internal.proxy.common.CommandException;
-import org.eclipse.jem.internal.proxy.common.remote.*;
-import org.eclipse.jem.internal.proxy.core.*;
-import org.eclipse.jem.internal.proxy.core.IInvokable;
-
-
-/**
- * Remote Invokable. This invokes on the remote vm, but it doesn't use a method proxy. Instead
- * it sends the information to get the method to the remote vm along with the parms. That way
- * it will do the lookup on the remote vm and we don't have the overhead of two calls, one to
- * get the methodproxy and the other to actually do the invoke. This should typically be used
- * only for infrequent calls so that cache of the method proxy is not needed.
- *
- * @since 1.0.0
- */
-class REMInvokable implements IInvokable {
-
- protected final IREMBeanTypeProxy beanType; // Beantype to get method from.
- protected final String methodName; // Method name
- protected final IBeanTypeProxy[] methodArgTypes; // Argument types (or null if no arguments).
- protected final REMProxyFactoryRegistry factory; // Factory for this invokable
-
-
- REMInvokable(IREMBeanTypeProxy beanType, String methodName, IBeanTypeProxy[] methodArgTypes) {
- this.beanType = beanType;
- this.methodName = methodName;
- this.methodArgTypes = methodArgTypes;
- this.factory = (REMProxyFactoryRegistry) beanType.getProxyFactoryRegistry();
- }
-
- public IBeanProxy invoke(IBeanProxy subject) throws ThrowableProxy {
- return invoke(subject, (IBeanProxy[]) null);
- }
-
- public IBeanProxy invoke(IBeanProxy subject, IBeanProxy[] parms) throws ThrowableProxy {
- return invokeWithParms(subject, parms);
- }
-
- /**
- * The internal method that allows mixture of constants (e.g. String) with bean proxies.
- * A parm value can be a REMMethodProxy.ParmArray. This means this parm is an array that
- * needs to have a ValueRetriever created for it. This is used if the array has ID's in
- * it and is not an existing array on the server or all constant values.
- *
- * NOTE: It is assumed that all IBeanTypeProxies of the parms have already been retrieved.
- * It should still work, but it could be asking for them in the middle of the request
- * if they are not first gotton.
- *
- */
- public IBeanProxy invokeWithParms(IBeanProxy subject, final Object[] parms) throws ThrowableProxy {
- IREMConnection connect = factory.getFreeConnection();
- REMStandardBeanProxyFactory proxyFactory = (REMStandardBeanProxyFactory) factory.getBeanProxyFactory();
- proxyFactory.startTransaction(); // This is definately a transaction, so start it.
- try {
- // First need to send the method info.
- Commands.ValueObject classValue = new Commands.ValueObject();
- beanType.renderBean(classValue);
-
- Commands.ValueObject parmTypesValue = new Commands.ValueObject();
- if (methodArgTypes != null) {
- class Retriever implements Commands.ValueRetrieve {
- int index = 0;
- Object[] array;
- Commands.ValueObject worker = new Commands.ValueObject();
-
- public Retriever(Object[] anArray) {
- array = anArray;
- }
-
- public Commands.ValueObject nextValue() {
- Object parm = array[index++];
- ((IREMBeanTypeProxy) parm).renderBean(worker);
- return worker;
- }
- };
-
- parmTypesValue.setArrayIDS(new Retriever(methodArgTypes), methodArgTypes.length, Commands.CLASS_CLASS); // Create Class[].
- }
-
-
- // Now we start building the actual invocation.
-
- Commands.ValueObject subjectValue = new Commands.ValueObject();
- if (subject != null)
- ((IREMBeanProxy) subject).renderBean(subjectValue);
-
- Commands.ValueObject parmsValue = new Commands.ValueObject();
-
- if (parms != null) {
- // Have a local definition of the retriever so that the retriever can create
- // another one of itself if necessary.
- final IStandardBeanTypeProxyFactory typeFactory = factory.getBeanTypeProxyFactory();
-
- class Retriever implements Commands.ValueRetrieve {
- int index = 0;
- Object[] array;
- Commands.ValueObject worker = new Commands.ValueObject();
-
- public Retriever(Object[] anArray) {
- array = anArray;
- }
-
- public Commands.ValueObject nextValue() {
- Object parm = array[index++];
- if (parm != null)
- if (parm instanceof IREMBeanProxy)
- ((IREMBeanProxy) parm).renderBean(worker);
- else if (parm instanceof TransmitableArray) {
- // It is another array, create a new retriever.
- worker.setArrayIDS(
- new Retriever(((TransmitableArray) parm).array),
- ((TransmitableArray) parm).array.length,
- ((TransmitableArray) parm).componentTypeID);
- } else {
- // It's an object. Need to get bean type so that we can send it.
- IREMBeanProxy type = (IREMBeanProxy) typeFactory.getBeanTypeProxy(parm.getClass().getName());
- if (type == null)
- throw new IllegalArgumentException();
- int classID = type.getID().intValue();
- worker.setAsObject(parm, classID);
- }
- else
- worker.set();
- return worker;
- }
- };
-
- parmsValue.setArrayIDS(new Retriever(parms), parms.length, Commands.OBJECT_CLASS); // Create Object[].
- }
-
- Commands.ValueObject returnValue = new Commands.ValueObject();
- try {
- invoke(connect, proxyFactory, classValue, parmTypesValue, subjectValue, parmsValue, returnValue);
- return proxyFactory.getBeanProxy(returnValue);
- } catch (CommandException e) {
- if (!e.isRecoverable()) {
- // Close the connection and try again.
- factory.closeConnection(connect);
- connect = null;
- connect = factory.getFreeConnection();
- try {
- invoke(connect, proxyFactory, classValue, parmTypesValue, subjectValue, parmsValue, returnValue);
- return proxyFactory.getBeanProxy(returnValue);
- } catch (CommandException eAgain) {
- // Failed again. Just close and print trace.
- factory.closeConnection(connect);
- connect = null;
- ProxyPlugin.getPlugin().getLogger().log(new Status(IStatus.WARNING, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "", eAgain)); //$NON-NLS-1$
- return null;
- }
- } else {
- // A recoverable error, print trace and return
- ProxyPlugin.getPlugin().getLogger().log(new Status(IStatus.WARNING, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "", e)); //$NON-NLS-1$
- return null;
- }
- }
- } finally {
- proxyFactory.stopTransaction();
- if (connect != null)
- factory.returnConnection(connect);
- }
- }
-
-private void invoke(
- IREMConnection connect,
- REMStandardBeanProxyFactory proxyFactory,
- Commands.ValueObject classTypeValue,
- Commands.ValueObject parmTypesValue,
- Commands.ValueObject subjectValue,
- Commands.ValueObject parmsValue,
- Commands.ValueObject returnValue)
- throws ThrowableProxy, CommandException {
- try {
- connect.invokeMethod(classTypeValue, methodName, parmTypesValue, subjectValue, parmsValue, returnValue);
- } catch (CommandErrorException e) {
- proxyFactory.processErrorReturn(e);
- }
- }
-
- public IBeanProxy invoke(IBeanProxy subject, IBeanProxy parm) throws ThrowableProxy {
- return invoke(subject, new IBeanProxy[] { parm });
- }
-
- public IBeanProxy invokeCatchThrowableExceptions(IBeanProxy subject) {
- try {
- return invoke(subject);
- } catch (ThrowableProxy e) {
- ProxyPlugin.getPlugin().getLogger().log(new Status(IStatus.WARNING, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "", e)); //$NON-NLS-1$
- factory.releaseProxy(e); // Since it's no longer needed, get rid of now instead of GC time.
- return null;
- }
- }
-
- public IBeanProxy invokeCatchThrowableExceptions(IBeanProxy subject, IBeanProxy[] parms) {
- try {
- return invoke(subject, parms);
- } catch (ThrowableProxy e) {
- ProxyPlugin.getPlugin().getLogger().log(new Status(IStatus.WARNING, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "", e)); //$NON-NLS-1$
- factory.releaseProxy(e); // Since it's no longer needed, get rid of now instead of GC time.
- return null;
- }
- }
-
- public IBeanProxy invokeCatchThrowableExceptions(IBeanProxy subject, IBeanProxy parm) {
- try {
- return invoke(subject, parm);
- } catch (ThrowableProxy e) {
- ProxyPlugin.getPlugin().getLogger().log(new Status(IStatus.WARNING, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "", e)); //$NON-NLS-1$
- factory.releaseProxy(e); // Since it's no longer needed, get rid of now instead of GC time.
- return null;
- }
- }
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMLongClassBeanProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMLongClassBeanProxy.java
deleted file mode 100644
index 94b41a244..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMLongClassBeanProxy.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-
-import org.eclipse.jem.internal.proxy.core.*;
-import org.eclipse.jem.internal.proxy.common.remote.Commands;
-/**
- * Remote Proxy for Long.class.
- */
-class REMLongClassBeanProxy extends REMNumberBeanProxy {
-
-REMLongClassBeanProxy(REMProxyFactoryRegistry aRegistry, Long aLong) {
- super(aRegistry, aLong);
-}
-
-/**
- * Get the beantype
- */
-public IBeanTypeProxy getTypeProxy() {
- return ((REMStandardBeanTypeProxyFactory) fFactory.getBeanTypeProxyFactory()).longClass;
-}
-
-/**
- * Render the bean into value object.
- */
-public void renderBean(Commands.ValueObject value) {
- value.set((Long) numberValue());
-}
-}
-
-
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMLongClassBeanTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMLongClassBeanTypeProxy.java
deleted file mode 100644
index 45556c21c..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMLongClassBeanTypeProxy.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-
-import org.eclipse.jem.internal.proxy.core.*;
-import org.eclipse.jem.internal.proxy.common.remote.Commands;
-/**
- * Remote Implementation of IBeanTypeProxy Long.class.
- * Creation date: (2/6/00 9:01:40 AM)
- * @author: Joe Winchester
- */
-final class REMLongClassBeanTypeProxy extends REMAbstractNumberBeanTypeProxy {
-// Some values are cache'd for speed
- private final INumberBeanProxy zeroProxy;
- private final INumberBeanProxy oneProxy;
- private final INumberBeanProxy twoProxy;
- private final INumberBeanProxy threeProxy;
-/**
- * REMIntegerBeanTypeProxy constructor comment.
- * @param aClass java.lang.Class
- */
-REMLongClassBeanTypeProxy(REMProxyFactoryRegistry aRegistry, IBeanTypeProxy numberType) {
- super(aRegistry, new Integer(Commands.LONG_CLASS), Long.class.getName(), numberType);
-
- // Create the cached values
- zeroProxy = new REMLongClassBeanProxy(aRegistry, new Long(0));
- oneProxy = new REMLongClassBeanProxy(aRegistry, new Long(1));
- twoProxy = new REMLongClassBeanProxy(aRegistry, new Long(2));
- threeProxy = new REMLongClassBeanProxy(aRegistry, new Long(3));
-}
-
-/**
- * Helper to create a bean proxy
- * Package protected because everyone should go through the factory API
- * that is defined as part of IBeanProxyFactory
- */
-INumberBeanProxy createLongBeanProxy(Long aLong) {
- if (aLong.longValue() >= 0 && aLong.longValue() < 4) {
- // Switch statements don't work with longs.
- switch(aLong.intValue()) {
- case 0: return zeroProxy;
- case 1: return oneProxy ;
- case 2: return twoProxy ;
- case 3: return threeProxy ;
- }
- }
- return new REMLongClassBeanProxy(fRegistry, aLong);
-}
-
-/**
- * Generic way to create a Long proxy, however, the Number must be a Long.
- */
-protected INumberBeanProxy createNumberBeanProxy(Number aNumber) {
- return createLongBeanProxy((Long) aNumber);
-}
-
-/**
- * newInstance method. Number's don't have a default ctor, so the standard way won't work.
- * Return the zero proxy for this case.
- */
-public IBeanProxy newInstance() {
- return zeroProxy;
-}
-
-/**
- * Create a new bean proxy the ValueObject passed in.
- * We will assume the object is correct type.
- */
-public IBeanProxy newBeanProxy(Commands.ValueObject value) {
- return createLongBeanProxy(new Long(value.aLong));
-}
-}
-
-
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMLongTypeBeanProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMLongTypeBeanProxy.java
deleted file mode 100644
index a26d8006c..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMLongTypeBeanProxy.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-
-import org.eclipse.jem.internal.proxy.common.remote.Commands;
-import org.eclipse.jem.internal.proxy.core.*;
-/**
- * Remote Implementation of INumberBeanProxy for the primitive "long".
- * It can answer all of the primitive number types (int, long, short, byte, double, float).
- * Creation date: (2/6/00 9:02:54 AM)
- * @author: Joe Winchester
- */
-class REMLongTypeBeanProxy extends REMConstantBeanProxy implements INumberBeanProxy {
- private final long fLong;
-
-/**
- * It is package protected because they are created
- * in a special way and no one else should create them.
- * @param aBean java.lang.Object
- */
-REMLongTypeBeanProxy(REMProxyFactoryRegistry aRegistry, long aLong) {
- super(aRegistry);
- fLong = aLong;
-}
-/**
- * equals: Equal if:
- * 1) This proxy == (identity) to the other object
- * 2) Else if other is an IBeanProxy and not a constant one, then if
- * equals on the server.
- * 3) If this is a constant proxy and the other is too or is a constant
- * value (e.g. IStringBeanProxy.equals(String), then true if values are equals.
- */
-public boolean equals(Object anObject) {
- if (this == anObject)
- return true; // Identity
- if (anObject instanceof REMLongTypeBeanProxy)
- return fLong == ((REMLongTypeBeanProxy) anObject).longValue();
- if (anObject instanceof Long)
- return fLong == ((Long) anObject).longValue();
- return false;
-}
-
-/* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IBeanProxy#sameAs(org.eclipse.jem.internal.proxy.core.IBeanProxy)
- */
-public boolean sameAs(IBeanProxy aBeanProxy) {
- if (this == aBeanProxy)
- return true; // Identity
- if (aBeanProxy instanceof REMLongTypeBeanProxy)
- return fLong == ((REMLongTypeBeanProxy) aBeanProxy).longValue();
- return false;
-}
-/**
- * byteValue method comment.
- */
-public byte byteValue() {
- return (byte) fLong;
-}
-/**
- * doubleValue method comment.
- */
-public double doubleValue() {
- return fLong;
-}
-/**
- * floatValue method comment.
- */
-public float floatValue() {
- return fLong;
-}
-/**
- * Return the int value
- */
-public int intValue() {
- return (int) fLong;
-}
-/**
- * longValue method comment.
- */
-public long longValue() {
- return fLong;
-}
-/**
- * numberValue method comment.
- */
-public Number numberValue() {
- return new Long(fLong);
-}
-/**
- * shortValue method comment.
- */
-public short shortValue() {
- return (short) fLong;
-}
-
-/**
- * The bean's toString.
- */
-public String toBeanString() {
- return String.valueOf(fLong);
-}
-
-/**
- * Get the beantype
- */
-public IBeanTypeProxy getTypeProxy() {
- return ((REMStandardBeanTypeProxyFactory) fFactory.getBeanTypeProxyFactory()).longType;
-}
-
-/**
- * Render the bean into value object.
- */
-public void renderBean(Commands.ValueObject value) {
- value.set(fLong);
-}
-}
-
-
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMLongTypeBeanTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMLongTypeBeanTypeProxy.java
deleted file mode 100644
index b35740141..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMLongTypeBeanTypeProxy.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-
-import org.eclipse.jem.internal.proxy.core.*;
-import org.eclipse.jem.internal.proxy.common.remote.Commands;
-/**
- * Remote Implementation of IBeanTypeProxy for Long.TYPE/
- * Creation date: (2/6/00 9:01:40 AM)
- * @author: Joe Winchester
- */
-final class REMLongTypeBeanTypeProxy extends REMPrimitiveBeanTypeProxy {
-// Some values are cache'd for speed
- private final INumberBeanProxy zeroProxy;
- private final INumberBeanProxy oneProxy;
- private final INumberBeanProxy twoProxy;
- private final INumberBeanProxy threeProxy;
-/**
- * REMIntegerBeanTypeProxy constructor comment.
- * @param aClass java.lang.Class
- */
-REMLongTypeBeanTypeProxy(REMProxyFactoryRegistry aRegistry) {
- super(aRegistry, new Integer(Commands.LONG_TYPE), Long.TYPE.getName());
-
- // Create the cached values
- zeroProxy = new REMLongTypeBeanProxy(aRegistry, 0);
- oneProxy = new REMLongTypeBeanProxy(aRegistry, 1);
- twoProxy = new REMLongTypeBeanProxy(aRegistry, 2);
- threeProxy = new REMLongTypeBeanProxy(aRegistry, 3);
-}
-
-/**
- * Helper to create a bean proxy
- * Package protected because everyone should go through the factory API
- * that is defined as part of IBeanProxyFactory
- */
-INumberBeanProxy createLongBeanProxy(long aLong) {
- if (aLong >= 0 && aLong < 4) {
- // Switch statements don't work with longs.
- switch((int) aLong) {
- case 0: return zeroProxy;
- case 1: return oneProxy ;
- case 2: return twoProxy ;
- case 3: return threeProxy ;
- }
- }
- return new REMLongTypeBeanProxy(fRegistry, aLong);
-}
-
-/**
- * newInstance method. long is a primitive, so the standard way won't work.
- * Return the zeroProxy for this case because that is the default value.
- */
-public IBeanProxy newInstance() {
- return zeroProxy;
-}
-
-/**
- * Create a new bean proxy the ValueObject passed in.
- * We will assume the object is correct type.
- */
-public IBeanProxy newBeanProxy(Commands.ValueObject value) {
- return createLongBeanProxy(value.aLong);
-}
-
-/**
- * Short cut for newInstance where the string follows the
- * specific pattern we expect. That way it won't be necessary to ship over to the vm
- * to process it.
- *
- * The pattern it can accept is:
- * 1) (long) validNumber - number can be any number because (byte) explicitly casts it down.
- * 2) validNumber
- * It will use the decode function of long to determine the valid number.
- */
-public IBeanProxy newInstance(String initializationString) throws ThrowableProxy, ClassCastException, InstantiationException {
- String trim = initializationString.trim();
- if (trim.length() == 0)
- return super.newInstance(initializationString);
- long aLong;
- if (trim.startsWith("(long)")) { //$NON-NLS-1$
- Number v = parseString(trim.substring("(long)".length()).trim()); //$NON-NLS-1$
- if (v != null)
- aLong = v.longValue();
- else
- return super.newInstance(initializationString); // Can't decode it, let full parser handle it.
- } else {
- if (trim.charAt(trim.length()-1) == 'L' || trim.charAt(trim.length()-1) == 'l')
- trim = trim.substring(0, trim.length()-1);
- try {
- aLong = Long.decode(trim).longValue(); // See if valid long format.
- } catch (NumberFormatException e) {
- return super.newInstance(initializationString); // Can't decode it, let full parser handle it.
- }
- }
-
- return getProxyFactoryRegistry().getBeanProxyFactory().createBeanProxyWith(aLong);
-}
-
-}
-
-
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMMasterServerThread.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMMasterServerThread.java
deleted file mode 100644
index da70385dd..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMMasterServerThread.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-import java.io.*;
-import java.net.*;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jem.internal.proxy.core.ProxyPlugin;
-import org.eclipse.jem.internal.proxy.common.remote.Commands;
-
-/**
- * Master Server thread for the Remote VMs.
- *
- * It responds to the remote vm requests to this IDE.
- *
- * It is package-protected because only ProxyRemotePluguin should access it.
- * @author richkulp
- */
-class REMMasterServerThread extends Thread {
-
- protected ServerSocket masterServerSocket;
- protected REMRegistryController registryController;
- protected boolean shuttingDown = false;
-
- // Kludge: Bug in Linux 1.3.xxx of JVM. Closing a socket while the socket is being read/accept will not interrupt the
- // wait. Need to timeout to the socket read/accept before the socket close will be noticed. This has been fixed
- // in Linux 1.4. So on Linux 1.3 need to put timeouts in on those sockets that can be separately closed while reading/accepting.
- static boolean LINUX_1_3 = "linux".equalsIgnoreCase(System.getProperty("os.name")) && System.getProperty("java.version","").startsWith("1.3"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
-
-
- public REMMasterServerThread(REMRegistryController registryController) {
- super("Remote Proxy Master Server Thread"); //$NON-NLS-1$
- this.registryController = registryController;
-
- try {
- masterServerSocket = new ServerSocket(0, 50, InetAddress.getByName("localhost")); // Any available port //$NON-NLS-1$
- if (LINUX_1_3)
- masterServerSocket.setSoTimeout(1000); // Linux 1.3 bug, see comment on LINUX_1_3
- } catch (SocketException e) {
- ProxyPlugin.getPlugin().getLogger().log(new Status(IStatus.ERROR, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "", e)); // This is bad. Should be no exceptions creating a socket. //$NON-NLS-1$
- } catch (IOException e) {
- ProxyPlugin.getPlugin().getLogger().log(new Status(IStatus.ERROR, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "", e)); // This is bad. Should be no exceptions creating a socket. //$NON-NLS-1$
- }
- }
-
- public ServerSocket getMasterSocket() {
- return masterServerSocket;
- }
-
- /**
- * @see java.lang.Thread#run()
- */
- public void run() {
- try {
- while (masterServerSocket != null) {
- Socket incoming = null;
- try {
- incoming = masterServerSocket.accept();
- } catch (InterruptedIOException e) {
- continue; // Timeout, try again
- } catch (NullPointerException e) {
- continue; // In Linux 1.3 case masterServerSocket could of gone null between loop test and try block.
- }
- boolean close = false; // process request will tell if socket should be closed. it may be passed onto callback thread instead.
- try {
- close = processRequest(incoming);
- } finally {
- if (close) {
- try {
- incoming.close();
- } catch (IOException e) {
- }
- }
-}
- incoming = null;
- }
- } catch (Exception e) {
- if (!shuttingDown)
- ProxyPlugin.getPlugin().getLogger().log(new Status(IStatus.ERROR, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "", e)); //$NON-NLS-1$
- }
-
- shutdown(); // Either a bad exception or we were closed. Either way is shutdown.
- }
-
- /**
- * Use this to request a shutdown.
- */
- public void requestShutdown() {
- if (masterServerSocket == null)
- return;
- // Closing the server socket should cause a break.
- try {
- shuttingDown = true;
- masterServerSocket.close();
- } catch (Exception e) {
- }
- return;
- }
-
- protected boolean processRequest(Socket remote) throws IOException {
- DataInputStream in = new DataInputStream(remote.getInputStream());
- DataOutputStream out = new DataOutputStream(remote.getOutputStream());
- boolean close = true; // flag indicating socket not given over to callback. Don't close the socket when done because callback has it.
- try {
- byte cmd = in.readByte();
- switch (cmd) {
- case Commands.ALIVE:
- int registryID = in.readInt();
- out.writeBoolean(registryController.getRegistry(new Integer(registryID)) != null); // Return if registry still alive
- out.flush();
- break;
-
- case Commands.REMOTE_STARTED:
- registryID = in.readInt();
- int remoteServerPort = in.readInt();
- REMProxyFactoryRegistry registry = registryController.getRegistry(new Integer(registryID));
- if (registry != null) {
- registry.setServerPort(remoteServerPort);
- out.writeBoolean(true);
- } else
- out.writeBoolean(false); // No registry
- out.flush();
- break;
-
- case Commands.ATTACH_CALLBACK:
- registryID = in.readInt();
- registry = registryController.getRegistry(new Integer(registryID));
- if (registry != null) {
- close = !((REMCallbackRegistry) registry.getCallbackRegistry()).createCallback(remote); // close if failed, don't close if good.
- out.writeBoolean(!close); // if not close, then return it worked.
- } else
- out.writeBoolean(false);
- out.flush();
- break;
- }
- } catch (Exception e) {
- ProxyPlugin.getPlugin().getLogger().log(new Status(IStatus.ERROR, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "", e)); //$NON-NLS-1$
- } finally {
- if (close) {
- try {
- in.close();
- } catch (IOException e) {
- }
- try {
- out.close();
- } catch (IOException e) {
- }
- }
- }
- return close;
- }
-
- private void shutdown() {
- requestShutdown();
- masterServerSocket = null;
- }
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMMethodProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMMethodProxy.java
deleted file mode 100644
index 681a90d99..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMMethodProxy.java
+++ /dev/null
@@ -1,276 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-
-import org.eclipse.jem.internal.proxy.common.CommandException;
-import org.eclipse.jem.internal.proxy.common.remote.*;
-import org.eclipse.jem.internal.proxy.core.*;
-/**
- * Remote VM implementation of the MethodProxy
- */
-
-final class REMMethodProxy extends REMAccessibleObjectProxy implements IREMMethodProxy {
-
- private IBeanTypeProxy fDeclaringType;
- private String fMethodName;
- private IBeanTypeProxy[] fParameterTypes;
- private IBeanTypeProxy fReturnType;
-
- REMMethodProxy(REMProxyFactoryRegistry aRegistry, Integer anID) {
- super(aRegistry, anID);
- }
-
- public IBeanTypeProxy getClassType() {
- if (fDeclaringType == null)
- fDeclaringType =
- (IBeanTypeProxy) REMStandardBeanProxyConstants
- .getConstants(fFactory)
- .getMethodDeclaringClassMessage()
- .invokeCatchThrowableExceptions(
- this);
- return fDeclaringType;
- }
-
- public String getName() {
- if (fMethodName == null) {
- IStringBeanProxy proxy =
- (IStringBeanProxy) REMStandardBeanProxyConstants
- .getConstants(fFactory)
- .getMethodMethodNameMessage()
- .invokeCatchThrowableExceptions(
- this);
- if (proxy != null)
- fMethodName = proxy.stringValue();
- else
- fMethodName = ""; //$NON-NLS-1$
- }
- return fMethodName;
- }
-
- public synchronized IBeanTypeProxy[] getParameterTypes() {
- if (fParameterTypes == null) {
- IArrayBeanProxy parmTypes = (IArrayBeanProxy) REMStandardBeanProxyConstants.getConstants(fFactory)
- .getMethodParameterTypesMessage().invokeCatchThrowableExceptions(this);
- if (parmTypes == null)
- fParameterTypes = new IBeanTypeProxy[0]; // There was some error, only way null is returned
- else {
- int len = parmTypes.getLength();
- fParameterTypes = new IBeanTypeProxy[len];
- for (int i = 0; i < len; i++)
- try {
- fParameterTypes[i] = (IBeanTypeProxy) parmTypes.get(i);
- } catch (ThrowableProxy e) {
- }
- fFactory.releaseProxy(parmTypes); // Don't need the array on the server anymore.
- }
- }
-
- return fParameterTypes;
- }
-
- public IBeanTypeProxy getReturnType() {
- if (fReturnType == null)
- fReturnType =
- (IBeanTypeProxy) REMStandardBeanProxyConstants
- .getConstants(fFactory)
- .getMethodReturnTypeMessage()
- .invokeCatchThrowableExceptions(
- this);
- return fReturnType;
- }
-
- public IBeanProxy invoke(IBeanProxy subject) throws ThrowableProxy {
- return invoke(subject, (IBeanProxy[]) null);
- }
-
- public IBeanProxy invoke(IBeanProxy subject, IBeanProxy[] parms) throws ThrowableProxy {
- return invokeWithParms(subject, parms);
- }
-
- /**
- * The internal method that allows mixture of constants (e.g. String) with bean proxies.
- * A parm value can be a REMMethodProxy.ParmArray. This means this parm is an array that
- * needs to have a ValueRetriever created for it. This is used if the array has ID's in
- * it and is not an existing array on the server or all constant values.
- *
- * NOTE: It is assumed that all IBeanTypeProxies of the parms have already been retrieved.
- * It should still work, but it could be asking for them in the middle of the request
- * if they are not first gotton.
- *
- * NOTE: This is in IREMMethodProxy only so that other REM proxy implementations can access it.
- */
-
- public IBeanProxy invokeWithParms(IBeanProxy subject, final Object[] parms) throws ThrowableProxy {
- IREMConnection connect = fFactory.getFreeConnection();
- REMStandardBeanProxyFactory proxyFactory = (REMStandardBeanProxyFactory) fFactory.getBeanProxyFactory();
- proxyFactory.startTransaction(); // This is definately a transaction, so start it.
- try {
- Commands.ValueObject subjectValue = new Commands.ValueObject();
- if (subject != null)
- ((IREMBeanProxy) subject).renderBean(subjectValue);
-
- Commands.ValueObject parmsValue = new Commands.ValueObject();
-
- class Retriever implements Commands.ValueRetrieve {
- int index = 0;
- Object[] array;
- Commands.ValueObject worker = new Commands.ValueObject();
- IStandardBeanTypeProxyFactory typeFactory = fFactory.getBeanTypeProxyFactory();
-
- public Retriever(Object[] anArray) {
- array = anArray;
- }
-
- public void reset() {
- index = 0;
- }
-
- public Commands.ValueObject nextValue() {
- Object parm = array[index++];
- if (parm != null)
- if (parm instanceof IREMBeanProxy)
- ((IREMBeanProxy) parm).renderBean(worker);
- else if (parm instanceof TransmitableArray) {
- // It is another array, create a new retriever.
- worker.setArrayIDS(
- new Retriever(((TransmitableArray) parm).array),
- ((TransmitableArray) parm).array.length,
- ((TransmitableArray) parm).componentTypeID);
- } else {
- // It's an object. Need to get bean type so that we can send it.
- IREMBeanProxy type = (IREMBeanProxy) typeFactory.getBeanTypeProxy(parm.getClass().getName());
- if (type == null)
- throw new IllegalArgumentException();
- int classID = type.getID().intValue();
- worker.setAsObject(parm, classID);
- }
- else
- worker.set();
- return worker;
- }
- };
-
- Retriever retriever = null;
-
- if (parms != null) {
- // Have a local definition of the retriever so that the retriever can create
- // another one of itself if necessary.
- parmsValue.setArrayIDS(retriever = new Retriever(parms), parms.length, Commands.OBJECT_CLASS); // Create Object[].
- }
-
- Commands.ValueObject returnValue = new Commands.ValueObject();
- try {
- invoke(connect, proxyFactory, subjectValue, parmsValue, returnValue);
- return proxyFactory.getBeanProxy(returnValue);
- } catch (CommandException e) {
- if (!e.isRecoverable()) {
- // Close the connection and try again.
- fFactory.closeConnection(connect);
- connect = null;
- connect = fFactory.getFreeConnection();
- try {
- if (retriever != null)
- retriever.reset();
- invoke(connect, proxyFactory, subjectValue, parmsValue, returnValue);
- return proxyFactory.getBeanProxy(returnValue);
- } catch (CommandException eAgain) {
- // Failed again. Just close and print trace.
- fFactory.closeConnection(connect);
- connect = null;
- ProxyPlugin.getPlugin().getLogger().log(new Status(IStatus.WARNING, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "", eAgain)); //$NON-NLS-1$
- return null;
- }
- } else {
- // A recoverable error, print trace and return
- ProxyPlugin.getPlugin().getLogger().log(new Status(IStatus.WARNING, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "", e)); //$NON-NLS-1$
- return null;
- }
- }
- } finally {
- proxyFactory.stopTransaction();
- if (connect != null)
- fFactory.returnConnection(connect);
- }
- }
-
-private void invoke(
- IREMConnection connect,
- REMStandardBeanProxyFactory proxyFactory,
- Commands.ValueObject subjectValue,
- Commands.ValueObject parmsValue,
- Commands.ValueObject returnValue)
- throws ThrowableProxy, CommandException {
- try {
- connect.invokeMethod(getID().intValue(), subjectValue, parmsValue, returnValue);
- } catch (CommandErrorException e) {
- proxyFactory.processErrorReturn(e);
- }
- }
-
- public IBeanProxy invoke(IBeanProxy subject, IBeanProxy parm) throws ThrowableProxy {
- return invoke(subject, new IBeanProxy[] { parm });
- }
-
- public IBeanProxy invokeCatchThrowableExceptions(IBeanProxy subject) {
- try {
- return invoke(subject);
- } catch (ThrowableProxy e) {
- ProxyPlugin.getPlugin().getLogger().log(new Status(IStatus.WARNING, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "", e)); //$NON-NLS-1$
- fFactory.releaseProxy(e); // Since it's no longer needed, get rid of now instead of GC time.
- return null;
- }
- }
-
- public IBeanProxy invokeCatchThrowableExceptions(IBeanProxy subject, IBeanProxy[] parms) {
- try {
- return invoke(subject, parms);
- } catch (ThrowableProxy e) {
- ProxyPlugin.getPlugin().getLogger().log(new Status(IStatus.WARNING, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "", e)); //$NON-NLS-1$
- fFactory.releaseProxy(e); // Since it's no longer needed, get rid of now instead of GC time.
- return null;
- }
- }
-
- public IBeanProxy invokeCatchThrowableExceptions(IBeanProxy subject, IBeanProxy parm) {
- try {
- return invoke(subject, parm);
- } catch (ThrowableProxy e) {
- ProxyPlugin.getPlugin().getLogger().log(new Status(IStatus.WARNING, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "", e)); //$NON-NLS-1$
- fFactory.releaseProxy(e); // Since it's no longer needed, get rid of now instead of GC time.
- return null;
- }
- }
-
- /**
- * The type proxy is constant proxy out of the method factory.
- */
- public IBeanTypeProxy getTypeProxy() {
- return ((REMMethodProxyFactory) fFactory.getMethodProxyFactory()).methodType;
- }
-
- /**
- * The bean is being released, clear out the fields so they can be GC'd if necessary.
- * Usually only big objects and proxy fields need to be cleared.
- */
- public void release() {
- fDeclaringType = null;
- fParameterTypes = null;
- fReturnType = null;
- super.release();
- }
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMMethodProxyFactory.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMMethodProxyFactory.java
deleted file mode 100644
index 8660c8e3c..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMMethodProxyFactory.java
+++ /dev/null
@@ -1,305 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-
-import java.lang.reflect.AccessibleObject;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jem.internal.proxy.core.*;
-import org.eclipse.jem.internal.proxy.common.remote.Commands;
-import org.eclipse.jem.internal.proxy.common.remote.TransmitableArray;
-
-/**
- * Factory for creating method proxies. Creation date: (12/3/99 6:29:40 PM)
- *
- * @author: Joe Winchester
- */
-public class REMMethodProxyFactory implements IMethodProxyFactory {
-
- final protected REMProxyFactoryRegistry fFactoryRegistry;
-
- // Cached copy of a few typical method type proxies.
- IREMBeanTypeProxy accessibleType;
-
- REMMethodTypeProxy methodType;
-
- REMFieldTypeProxy fieldType;
-
- REMConstructorTypeProxy ctorType;
-
- REMMethodProxy getMethodProxy;
-
- REMMethodProxyFactory(REMProxyFactoryRegistry aRegistry) {
- fFactoryRegistry = aRegistry;
- aRegistry.registerMethodProxyFactory(this);
- REMStandardBeanTypeProxyFactory typeFactory = (REMStandardBeanTypeProxyFactory) aRegistry.getBeanTypeProxyFactory();
-
- accessibleType = typeFactory.objectClass.newBeanTypeForClass(new Integer(Commands.ACCESSIBLEOBJECT_CLASS), AccessibleObject.class.getName(),
- false);
- methodType = new REMMethodTypeProxy(aRegistry, accessibleType);
- fieldType = new REMFieldTypeProxy(aRegistry, accessibleType);
- ctorType = new REMConstructorTypeProxy(aRegistry, accessibleType);
- aRegistry.getBeanTypeProxyFactory().registerBeanTypeProxy(accessibleType, true);
- aRegistry.getBeanTypeProxyFactory().registerBeanTypeProxy(methodType, true);
- aRegistry.getBeanTypeProxyFactory().registerBeanTypeProxy(fieldType, true);
- aRegistry.getBeanTypeProxyFactory().registerBeanTypeProxy(ctorType, true);
-
- getMethodProxy = (REMMethodProxy) methodType.newBeanProxy(new Integer(Commands.GET_METHOD_ID));
- ((REMStandardBeanProxyFactory) aRegistry.getBeanProxyFactory()).registerProxy(getMethodProxy);
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IMethodProxyFactory#getMethodProxy(java.lang.String, java.lang.String, java.lang.String[])
- */
- public IMethodProxy getMethodProxy(String className, String methodName, String[] parameterTypes) {
- IStandardBeanTypeProxyFactory typeFactory = fFactoryRegistry.getBeanTypeProxyFactory();
- IBeanTypeProxy clsProxy = typeFactory.getBeanTypeProxy(className);
- if (clsProxy == null)
- return null;
- // This will redirect to the beantype, which will go through the method cache.
- return clsProxy.getMethodProxy(methodName, parameterTypes);
- }
-
- /**
- * A helper method to get the method proxy for the expression. This is used by registries and beantype proxies. It will go through
- * the method cache to make sure we get only one.
- *
- * @param expression
- * @param aBeanTypeProxy
- * @param methodName
- * @param parmTypes
- * @return
- *
- * @since 1.1.0
- */
- public IProxyMethod getMethodProxy(IExpression expression, IProxyBeanType aBeanTypeProxy, String methodName, IProxyBeanType[] parmTypes){
- return ((REMStandardBeanTypeProxyFactory) fFactoryRegistry.getBeanTypeProxyFactory()).proxyConstants.getMethodProxy(expression, aBeanTypeProxy, methodName, parmTypes);
- }
-
- /**
- * A helper method to get the field proxy for the expression. This is used by registries and beantype proxies. It will go through
- * the method cache to make sure we get only one.
- * @param expression
- * @param aBeanTypeProxy
- * @param fieldName
- *
- * @return
- *
- * @since 1.1.0
- */
- public IProxyField getFieldProxy(IExpression expression, IProxyBeanType aBeanTypeProxy, String fieldName){
- return ((REMStandardBeanTypeProxyFactory) fFactoryRegistry.getBeanTypeProxyFactory()).proxyConstants.getFieldProxy(expression, aBeanTypeProxy, fieldName);
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IMethodProxyFactory#getFieldProxy(org.eclipse.jem.internal.proxy.core.IExpression, java.lang.String, java.lang.String)
- */
- public IProxyField getFieldProxy(IExpression expression, String className, String fieldName) {
- // We are getting the class resolved through the expression. Might as well because it probably will
- // be needed again and this way when the expression is finished it will be resolved for later usage.
- IStandardBeanTypeProxyFactory beanTypeProxyFactory = fFactoryRegistry.getBeanTypeProxyFactory();
- IProxyBeanType beanType = beanTypeProxyFactory.getBeanTypeProxy(expression, className);
- return beanType.getFieldProxy(expression, fieldName);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IMethodProxyFactory#getMethodProxy(org.eclipse.jem.internal.proxy.core.IExpression, java.lang.String, java.lang.String, java.lang.String[])
- */
- public IProxyMethod getMethodProxy(IExpression expression, String className, String methodName, String[] parameterTypes) {
- // We are getting the class and parmtypes resolved through the expression. Might as well because they probably will
- // be needed again and this way when the expression is finished they will be resolved for later usage.
- IStandardBeanTypeProxyFactory beanTypeProxyFactory = fFactoryRegistry.getBeanTypeProxyFactory();
- IProxyBeanType beanType = beanTypeProxyFactory.getBeanTypeProxy(expression, className);
- IProxyBeanType[] parmTypes = getParameterTypes(expression, parameterTypes, beanTypeProxyFactory);
- return beanType.getMethodProxy(expression, methodName, parmTypes);
- }
-
- /**
- * Helper method for BeanTypes and proxy Beantypes. So they don't need to have common code to convert string to proxy bean type.
- * @param expression
- * @param classType
- * @param methodName
- * @param parameterTypes
- * @return
- *
- * @since 1.1.0
- */
- public IProxyMethod getMethodProxy(IExpression expression, IProxyBeanType classType, String methodName, String[] parameterTypes) {
- // We are getting the class and parmtypes resolved through the expression. Might as well because they probably will
- // be needed again and this way when the expression is finished they will be resolved for later usage.
- IStandardBeanTypeProxyFactory beanTypeProxyFactory = fFactoryRegistry.getBeanTypeProxyFactory();
- IProxyBeanType[] parmTypes = getParameterTypes(expression, parameterTypes, beanTypeProxyFactory);
- return classType.getMethodProxy(expression, methodName, parmTypes);
- }
-
- /**
- * @param expression
- * @param parameterTypes
- * @param beanTypeProxyFactory
- * @return
- *
- * @since 1.1.0
- */
- protected IProxyBeanType[] getParameterTypes(IExpression expression, String[] parameterTypes, IStandardBeanTypeProxyFactory beanTypeProxyFactory) {
- IProxyBeanType[] parmTypes;
- if (parameterTypes == null || parameterTypes.length == 0)
- parmTypes = null;
- else {
- parmTypes = new IProxyBeanType[parameterTypes.length];
- for (int i = 0; i < parameterTypes.length; i++) {
- parmTypes[i] = beanTypeProxyFactory.getBeanTypeProxy(expression, parameterTypes[i]);
- }
- }
- return parmTypes;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IMethodProxyFactory#getInvokable(java.lang.String, java.lang.String, java.lang.String[])
- */
- public IInvokable getInvokable(String className, String methodName, String[] parameterTypes) {
- IStandardBeanTypeProxyFactory typeFactory = fFactoryRegistry.getBeanTypeProxyFactory();
- IBeanTypeProxy clsProxy = typeFactory.getBeanTypeProxy(className);
- if (clsProxy == null)
- return null;
- return clsProxy.getInvokable(methodName, parameterTypes);
- }
-
- /**
- * Get the method id from the remote system and create the method proxy.
- *
- * NOTE: It is public ONLY so that IBeanTypeProxy implementations can call it. It must not be used by anyone else.
- *
- * @param beanType
- * @param methodName
- * @param parameterTypes
- * @return
- *
- * @since 1.0.0
- */
- public IInvokable getInvokable(IREMBeanTypeProxy beanType, String methodName, String[] parameterTypes) {
- // First convert the parameter types into IBeanTypeProxy[].
- IREMBeanTypeProxy[] types = null;
- if (parameterTypes != null) {
- IStandardBeanTypeProxyFactory typeFactory = fFactoryRegistry.getBeanTypeProxyFactory();
- types = new IREMBeanTypeProxy[parameterTypes.length];
- for (int i = 0; i < parameterTypes.length; i++) {
- IBeanTypeProxy type = types[i] = (IREMBeanTypeProxy) typeFactory.getBeanTypeProxy(parameterTypes[i]);
- if (type == null)
- return null; // One of the parm types doesn't exist.
- }
- }
-
- return getInvokable(beanType, methodName, types);
- }
-
- /**
- * Get the method id from the remote system and create the method proxy.
- * This does not go through the method cache. It goes direct to the remote vm.
- *
- * NOTE: It is public ONLY so that IBeanTypeProxy implementations can call it. It must not be used by anyone else.
- */
- public IMethodProxy getMethodProxy(IREMBeanTypeProxy beanType, String methodName, String[] parameterTypes) {
- // First convert the parameter types into IBeanTypeProxy[].
- IBeanTypeProxy[] types = null;
- if (parameterTypes != null) {
- IStandardBeanTypeProxyFactory typeFactory = fFactoryRegistry.getBeanTypeProxyFactory();
- types = new IBeanTypeProxy[parameterTypes.length];
- for (int i = 0; i < parameterTypes.length; i++) {
- IBeanTypeProxy type = types[i] = typeFactory.getBeanTypeProxy(parameterTypes[i]);
- if (type == null)
- return null; // One of the parm types doesn't exist.
- }
- }
-
- return getMethodProxy(beanType, methodName, types);
- }
-
-
- /**
- * Get the invokable.
- *
- * NOTE: It is public ONLY so that IBeanTypeProxy implementations can call it. It must not be used by anyone else.
- * @param beanType
- * @param methodName
- * @param parameterTypes
- * @return
- *
- * @since 1.0.0
- */
- public IInvokable getInvokable(IREMBeanTypeProxy beanType, String methodName, IBeanTypeProxy[] parameterTypes) {
- return new REMInvokable(beanType, methodName, parameterTypes);
- }
-
- /**
- * Get the method id from the remote system and create the method proxy.
- * <p>
- * This does not go through the method cache. It goes direct to the remote vm.
- *
- * NOTE: It is public ONLY so that IBeanTypeProxy implementations can call it. It must not be used by anyone else.
- */
- public IMethodProxy getMethodProxy(IREMBeanTypeProxy beanType, String methodName, IBeanTypeProxy[] parameterTypes) {
- // The parms to getMethod are:
- // parm[0] = String - method name
- // parm[1] = Class[] - Parameter Classes.
- Object[] parms = new Object[] { methodName, parameterTypes != null ? (new TransmitableArray(Commands.CLASS_CLASS, parameterTypes)) : null};
- IBeanProxy result = null;
- try {
- result = getMethodProxy.invokeWithParms(beanType, parms);
- return (IMethodProxy) result;
- } catch (ThrowableProxy e) {
- fFactoryRegistry.releaseProxy(e); // Since it's not needed, get rid of now instead of GC time.
- return null;
- } catch (ClassCastException e) {
- // Some trace msgs because we keep getting into a mode after awhile (though not reproducible) that returns non-method proxies and we need
- // more info.
- StringBuffer buf = new StringBuffer("Method requested is \"" + methodName + "("); //$NON-NLS-1$ //$NON-NLS-2$
- for (int i = 0; i < parameterTypes.length; i++) {
- if (i > 0)
- buf.append(','); //$NON-NLS-1$
- buf.append(parameterTypes[i].getTypeName());
- }
- buf.append(")\""); //$NON-NLS-1$
- ProxyPlugin.getPlugin().getLogger().log(
- new Status(IStatus.ERROR, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, buf.toString(), null));
- try {
- if (result != null) {
- ProxyPlugin.getPlugin().getLogger().log(
- new Status(IStatus.ERROR, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0,
- "ClassCastException of result. Return type is \"" + result.getTypeProxy().getTypeName() + "\"\n" + //$NON-NLS-1$ //$NON-NLS-2$
- "Return type bean type proxy class=\"" + result.getTypeProxy().getClass().getName() + "\"\n" + //$NON-NLS-1$ //$NON-NLS-2$
- "GetMethodProxy valid=" + getMethodProxy.isValid() + "\n" + //$NON-NLS-1$ //$NON-NLS-2$
- "GetMethodProxy real name is \"" + getMethodProxy.getName() + "\"\n", null)); //$NON-NLS-1$ //$NON-NLS-2$
- }
- } catch (Exception e2) {
- ProxyPlugin.getPlugin().getLogger().log(new Status(IStatus.ERROR, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "", e2)); //$NON-NLS-1$
- }
- throw e; // Rethrow it.
- }
- }
-
- /*
- * Terminate the factory. Don't need to do anything because of the proxies being held onto are registered any will be cleaned up themselves.
- */
- public void terminateFactory(boolean wait) {
- }
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMMethodTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMMethodTypeProxy.java
deleted file mode 100644
index d3019b951..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMMethodTypeProxy.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-
-import org.eclipse.jem.internal.proxy.core.*;
-import org.eclipse.jem.internal.proxy.common.remote.Commands;
-/**
- * BeanType Proxy for Method class.
- */
-
-final class REMMethodTypeProxy extends REMAbstractBeanTypeProxy {
-
-REMMethodTypeProxy(REMProxyFactoryRegistry aRegistry, IBeanTypeProxy accessibleTypeProxy) {
- super(aRegistry, new Integer(Commands.METHOD_CLASS), java.lang.reflect.Method.class.getName(), accessibleTypeProxy);
-}
-
-/**
- * newBeanTypeForClass: Create a new beantypeproxy of this kind for the given class.
- * This is used by beantype proxy factory when creating a beantype proxy for a subclass.
- * This is because subclasses, unless explicitly overridden, should use the same kind
- * of beantype proxy. This way if anything special is needed for a specific type, then
- * that can be done.
- *
- * For all of the accessible object types, they are final classes, so you can't create a newBeanType
- * for subclasses.
- */
-public IREMBeanTypeProxy newBeanTypeForClass(Integer anID, String aClassname, boolean anAbstract) {
- throw new UnsupportedOperationException();
-}
-
-/**
- * Specialized from REMAbstractBeanTypeProxy to ensure Constructor proxies are created correctly.
- */
-public IREMBeanProxy newBeanProxy(Integer objectID) {
- return new REMMethodProxy(fRegistry, objectID);
-}
-
-/**
- * Note: Since new instances of Constructor are never done through a default ctor,
- * this function is not supported.
- */
-public IBeanProxy newInstance() {
- throw new UnsupportedOperationException();
-}
-
-/**
- * Note: Since new instances of Constructor are never done through an initialization string,
- * this function is not supported.
- */
-public IBeanProxy newInstance(String initializationString) {
- throw new UnsupportedOperationException();
-}
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMNumberBeanProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMNumberBeanProxy.java
deleted file mode 100644
index 8ca6e7ab9..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMNumberBeanProxy.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-
-import org.eclipse.jem.internal.proxy.core.*;
-
-/**
- * Remote Implementation of INumberBeanProxy for any Number (i.e. the non-primitives)
- * It can answer all of the primitive number types (int, long, short, byte, double, float).
- * Creation date: (2/6/00 9:02:54 AM)
- * @author: Joe Winchester
- */
-abstract class REMNumberBeanProxy extends REMConstantBeanProxy implements INumberBeanProxy {
- private final Number fNumberValue;
-
-/**
- * It is package protected because they are created
- * in a special way and no one else should create them.
- * @param aBean java.lang.Object
- */
-REMNumberBeanProxy(REMProxyFactoryRegistry aRegistry, Number aNumber) {
- super(aRegistry);
- fNumberValue = aNumber;
-}
-/**
- * equals: Equal if:
- * 1) This proxy == (identity) to the other object
- * 2) Else if other is an IBeanProxy and not a constant one, then if
- * equals on the server.
- * 3) If this is a constant proxy and the other is too or is a constant
- * value (e.g. IStringBeanProxy.equals(String), then true if values are equals.
- */
-public boolean equals(Object anObject) {
- if (this == anObject)
- return true; // Identity
- if (anObject instanceof REMNumberBeanProxy)
- return fNumberValue.equals(((REMNumberBeanProxy) anObject).numberValue());
- if (anObject instanceof Number)
- return fNumberValue.equals(anObject);
- return false;
-}
-/**
- * byteValue method comment.
- */
-public byte byteValue() {
- return fNumberValue.byteValue();
-}
-/**
- * doubleValue method comment.
- */
-public double doubleValue() {
- return fNumberValue.doubleValue();
-}
-/**
- * floatValue method comment.
- */
-public float floatValue() {
- return fNumberValue.floatValue();
-}
-/**
- * Return the int value
- */
-public int intValue() {
- return fNumberValue.intValue();
-}
-/**
- * longValue method comment.
- */
-public long longValue() {
- return fNumberValue.longValue();
-}
-/**
- * numberValue method comment.
- */
-public Number numberValue() {
- return fNumberValue;
-}
-/**
- * shortValue method comment.
- */
-public short shortValue() {
- return fNumberValue.shortValue();
-}
-
-/**
- * The bean's toString.
- */
-public String toBeanString() {
- return fNumberValue.toString();
-}
-}
-
-
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMPrimitiveBeanTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMPrimitiveBeanTypeProxy.java
deleted file mode 100644
index 78c6f752b..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMPrimitiveBeanTypeProxy.java
+++ /dev/null
@@ -1,234 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-
-import org.eclipse.jem.internal.proxy.core.*;
-/**
- * Primitive BeanType Proxies
- */
-public abstract class REMPrimitiveBeanTypeProxy extends REMAbstractBeanTypeProxy implements IREMConstantBeanTypeProxy {
-
- protected REMPrimitiveBeanTypeProxy(REMProxyFactoryRegistry aRegistry, Integer anID, String aClassname) {
- super(aRegistry, anID, aClassname, null);
- }
-
- /**
- * Return whether this is the primitive Byte.TYPE or Byte.class
- */
- public boolean isPrimitive() {
- return true;
- }
-
- /**
- * Return the null ctor proxy for this method with these arguments.
- * For all of the primitive types, this is an invalid operation.
- */
- public IConstructorProxy getNullConstructorProxy() {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Return a proxy to the constructor for the target VM being the same as the REM
- * For all of the primitive types, this is an invalid operation.
- */
- public IConstructorProxy getConstructorProxy(String[] argumentClassNames) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Return a proxy to the constructor for the target VM being the same as the REM
- * For all of the primitive types, this is an invalid operation.
- */
- public IConstructorProxy getConstructorProxy(IBeanTypeProxy[] argumentTypes) {
- throw new UnsupportedOperationException();
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getConstructors()
- *
- * For all of the primitive types, this is an invalid operation.
- */
- public IConstructorProxy[] getConstructors() {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Return a proxy to the constructor for the target VM being the same as the REM
- * For all of the primitive types, this is an invalid operation.
- */
- public IConstructorProxy getDeclaredConstructorProxy(String[] argumentClassNames) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Return a proxy to the constructor for the target VM being the same as the REM
- * For all of the primitive types, this is an invalid operation.
- */
- public IConstructorProxy getDeclaredConstructorProxy(IBeanTypeProxy[] argumentTypes) {
- throw new UnsupportedOperationException();
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getConstructors()
- *
- * For all of the primitive types, this is an invalid operation.
- */
- public IConstructorProxy[] getDeclaredConstructors() {
- throw new UnsupportedOperationException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getConstructors()
- *
- * For all of the primitive types, this is an invalid operation.
- */
- public IFieldProxy[] getFields() {
- throw new UnsupportedOperationException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getConstructors()
- *
- * For all of the primitive types, this is an invalid operation.
- */
- public IFieldProxy[] getDeclaredFields() {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Return a proxy to the field for the target VM being the same as the REM
- * For all of the primitive types, this is an invalid operation.
- */
- public IFieldProxy getFieldProxy(String fieldName) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Return the method proxy for this method with these arguments.
- * For all of the primitive types, this is an invalid operation.
- */
- public IMethodProxy getMethodProxy(String methodName, IBeanTypeProxy[] argumentTypes) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Return the method proxy for this method with these arguments.
- * For all of the primitive types, this is an invalid operation.
- */
- public IMethodProxy getMethodProxy(String methodName, String[] argumentClassNames) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Return the method proxy for this method with these arguments.
- * For all of the primitive types, this is an invalid operation.
- */
- public IMethodProxy getMethodProxy(String methodName, String argumentQualifiedTypeName) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Return the method proxy for this method with these arguments.
- * For all of the primitive types, this is an invalid operation.
- */
- public IMethodProxy getMethodProxy(String methodName) {
- throw new UnsupportedOperationException();
- }
-
-
- /**
- * Create a new bean proxy with the specified id.
- *
- * For all of the primitive types, this is an invalid operation. They are created
- * explicitly through the appropriate create method.
- */
- public IREMBeanProxy newBeanProxy(Integer anID) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * newBeanTypeForClass: Create a new beantypeproxy of this kind for the given class.
- * This is used by beantype proxy factory when creating a beantype proxy for a subclass.
- * This is because subclasses, unless explicitly overridden, should use the same kind
- * of beantype proxy. This way if anything special is needed for a specific type, then
- * that can be done.
- *
- * For all of the primitive types, they aren't classes, so you can't create a newBeanType
- * for subclasses.
- */
- public IREMBeanTypeProxy newBeanTypeForClass(Integer anID, String aClassname, boolean anAbstract) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * release - BeanType is about to be released.
- * primitives don't need to be released, they don't hold onto any ids or resources.
- */
- public void release() {
- }
-
- /**
- * Have a string that should represent a number.
- * See if it ends in a type letter, if so parse as such.
- * See if there is an 'E' in it, then parse as a double.
- * If neither condition, then try parse as long, if that
- * fails try as double.
- */
- protected static Number parseString(String v) {
- if (v.length() == 0)
- return null;
- char last = v.charAt(v.length()-1);
- try {
- switch (last) {
- case 'd':
- case 'D':
- return Double.valueOf(v);
- case 'f':
- case 'F':
- return Float.valueOf(v);
- case 'l':
- case 'L':
- return Long.decode(v.substring(0, v.length()-1));
- }
- } catch (NumberFormatException e) {
- return null;
- }
-
- try {
- return Long.decode(v);
- } catch (NumberFormatException e) {
- try {
- return Double.valueOf(v);
- } catch (NumberFormatException e1) {
- return null;
- }
- }
- }
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getCompatibleConstructor(org.eclipse.jem.internal.proxy.core.IBeanTypeProxy[])
- */
- public IConstructorProxy getCompatibleConstructor(IBeanTypeProxy[] argumentTypes) {
- throw new UnsupportedOperationException();
- }
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getCompatibleMethod(java.lang.String, org.eclipse.jem.internal.proxy.core.IBeanTypeProxy[])
- */
- public IMethodProxy getCompatibleMethod(String methodName, IBeanTypeProxy[] argumentTypes) {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMProxyConstants.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMProxyConstants.java
deleted file mode 100644
index 92a9d3bcf..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMProxyConstants.java
+++ /dev/null
@@ -1,679 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 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.jem.internal.proxy.remote;
-
-import java.util.*;
-import java.util.Map.Entry;
-
-import org.eclipse.jem.internal.proxy.core.*;
-import org.eclipse.jem.internal.proxy.core.ExpressionProxy.ProxyEvent;
-
-
-
-
-/**
- * MethodProxyConstants is a cache of IMethodProxies to avoid repeated lookup
- * and thereby avoid the relatively expensive java.lang.reflect calls to repeatedly
- * lookup method by name
- *
- * @since 1.1.0
- */
-public class REMProxyConstants {
-
- private Map methodsCache = new HashMap(80);
- private Map invokablesCache = new HashMap(80);
- private Map fieldsCache = new HashMap(80);
-
- private REMProxyFactoryRegistry registry;
-
- public REMProxyConstants(REMProxyFactoryRegistry registry) {
- this.registry = registry;
- }
-
- /*
- * Used as the key to the methodCache and invokablesCache when there are parms.
- * It allows the parms to be either strings or IBeanTypeProxies without the
- * overhead of creating complicated strings.
- *
- * It will compare method name and each individual parm name without fluffing
- * up a string and building it up.
- *
- * For no parm methods, just the name of the method as a string will be the key.
- *
- * @since 1.1.0
- */
- private abstract static class MethodKey {
- public String methodName;
- public MethodKey(String methodName) {
- this.methodName = methodName;
- }
-
- protected abstract boolean compareParms(IProxyBeanType[] parms);
- protected abstract boolean compareParms(String[] parms);
-
-
- /* (non-Javadoc)
- * @see java.lang.Object#hashCode()
- */
- public int hashCode() {
- return methodName.hashCode();
- }
- }
-
- private static class MethodKeyStringParms extends MethodKey {
- public String[] parmNames;
-
- public MethodKeyStringParms(String methodName, String[] parmNames) {
- super(methodName);
- this.parmNames = parmNames;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#equals(java.lang.Object)
- */
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- try {
- return ((MethodKey) obj).compareParms(parmNames);
- } catch (ClassCastException e) {
- return false;
- }
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.remote.REMProxyConstants.MethodKey#hashCode()
- */
- public int hashCode() {
- int h = super.hashCode();
- for (int i = 0; i < parmNames.length; i++) {
- h += parmNames[i].hashCode();
- }
- return h;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.remote.REMProxyConstants.MethodKey#compareParms(org.eclipse.jem.internal.proxy.core.IBeanTypeProxy[])
- */
- protected boolean compareParms(IProxyBeanType[] parms) {
- if (parms.length != parmNames.length)
- return false;
- for (int i = 0; i < parms.length; i++) {
- if (!parms[i].getTypeName().equals(parmNames[i]))
- return false;
- }
- return true;
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.remote.REMProxyConstants.MethodKey#compareParms(java.lang.String[])
- */
- protected boolean compareParms(String[] parms) {
- return Arrays.equals(parms, parmNames);
- }
- }
-
- private static class MethodKeyProxyParms extends MethodKey {
- public IProxyBeanType[] parmTypes;
-
- public MethodKeyProxyParms(String methodName, IProxyBeanType[] parmTypes) {
- super(methodName);
- this.parmTypes = parmTypes;
- }
-
- public Object toMethodKeyStringParms() {
- String[] parms = new String[parmTypes.length];
- for (int i = 0; i < parmTypes.length; i++) {
- parms[i] = parmTypes[i].getTypeName();
- }
- return new MethodKeyStringParms(methodName, parms);
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#equals(java.lang.Object)
- */
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- try {
- return ((MethodKey) obj).compareParms(parmTypes);
- } catch (ClassCastException e) {
- return false;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.remote.REMProxyConstants.MethodKey#hashCode()
- */
- public int hashCode() {
- int h = super.hashCode();
- for (int i = 0; i < parmTypes.length; i++) {
- h += parmTypes[i].getTypeName().hashCode();
- }
- return h;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.remote.REMProxyConstants.MethodKey#compareParms(org.eclipse.jem.internal.proxy.core.IBeanTypeProxy[])
- */
- protected boolean compareParms(String[] parms) {
- if (parms.length != parmTypes.length)
- return false;
- for (int i = 0; i < parms.length; i++) {
- if (!parmTypes[i].getTypeName().equals(parms[i]))
- return false;
- }
- return true;
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.remote.REMProxyConstants.MethodKey#compareParms(java.lang.String[])
- */
- protected boolean compareParms(IProxyBeanType[] parms) {
- if (parms.length != parmTypes.length)
- return false;
- for (int i = 0; i < parms.length; i++) {
- if (!parmTypes[i].getTypeName().equals(parms[i].getTypeName()))
- return false;
- }
- return true;
- }
- }
-
- static int REMMETHODCOUNT = 0;
- static int UNIQUEMETHODCOUNT = 0;
- static int REMINVOKABLECOUNT = 0;
- static int UNIQUEINVOKABLECOUNT = 0;
- static int INVOKEINVOKECOUNT = 0;
- static int METHODPROXYINVOKECOUNT = 0;
- static int REMFIELDCOUNT = 0;
- static int UNIQUEFIELDCOUNT = 0;
- static int REMCONSTRUCTORCALLED = 0;
- static HashMap METHODCOUNTMAP;
- static HashMap FIELDCOUNTMAP;
- static HashMap FIELDSETCOUNTMAP;
- static boolean GATHER_COUNTS;
-
- /**
- * Set if counts should be gathered.
- *
- * @param gatherCounts
- *
- * @since 1.1.0
- */
- public static void setGatherCounts(boolean gatherCounts) {
- if (gatherCounts != GATHER_COUNTS) {
- reset();
- if (gatherCounts) {
- if (METHODCOUNTMAP == null) {
- METHODCOUNTMAP = new HashMap();
- FIELDCOUNTMAP = new HashMap();
- FIELDSETCOUNTMAP = new HashMap();
- }
- }
- GATHER_COUNTS = gatherCounts;
- }
- }
-
-
- public static void reset(){
- REMMETHODCOUNT = UNIQUEMETHODCOUNT = REMINVOKABLECOUNT = UNIQUEINVOKABLECOUNT = REMCONSTRUCTORCALLED = METHODPROXYINVOKECOUNT = INVOKEINVOKECOUNT = REMFIELDCOUNT = UNIQUEFIELDCOUNT = 0;
- if (GATHER_COUNTS) {
- METHODCOUNTMAP.clear();
- FIELDCOUNTMAP.clear();
- FIELDSETCOUNTMAP.clear();
- }
- }
-
- public static void println(){
-
- if (GATHER_COUNTS) {
- System.out.println("--------------------------------------------------"); //$NON-NLS-1$
- System.out.println("Method proxies invokes = " + METHODPROXYINVOKECOUNT); //$NON-NLS-1$
- System.out.println("Invoke invokes = " + INVOKEINVOKECOUNT); //$NON-NLS-1$
- System.out.println(".................................................."); //$NON-NLS-1$
- System.out.println("Methods retrieved = " + REMMETHODCOUNT + "(" + UNIQUEMETHODCOUNT + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- System.out.println("Invokes retrieved = " + REMINVOKABLECOUNT + "(" + UNIQUEINVOKABLECOUNT + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- System.out.println("Fields retrieved = " + REMFIELDCOUNT + "(" + UNIQUEFIELDCOUNT + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- System.out.println("Constructor calls = " + REMCONSTRUCTORCALLED); //$NON-NLS-1$
- System.out.println("--------------------------------------------------"); //$NON-NLS-1$
- System.out.println("-Count of methods invoked-------------------------"); //$NON-NLS-1$
- System.out.println("--------------------------------------------------"); //$NON-NLS-1$
-
- // Collate the methods called
- Iterator entries = METHODCOUNTMAP.entrySet().iterator();
- while (entries.hasNext()) {
- Map.Entry entry = (Entry) entries.next();
- REMMethodProxy methodProxy = (REMMethodProxy) entry.getKey();
- System.out.println(methodProxy.getClassType().getTypeName() + "," + methodProxy.getName() + "," + entry.getValue()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- System.out.println("--------------------------------------------------"); //$NON-NLS-1$
- System.out.println("-Count of fields get called ----------------------"); //$NON-NLS-1$
- System.out.println("--------------------------------------------------"); //$NON-NLS-1$
-
- // Collate the fields accessed
- entries = FIELDCOUNTMAP.entrySet().iterator();
- while (entries.hasNext()) {
- Map.Entry entry = (Entry) entries.next();
- REMFieldProxy fieldProxy = (REMFieldProxy) entry.getKey();
- System.out.println(fieldProxy.toBeanString() + "," + entry.getValue()); //$NON-NLS-1$
- }
-
- System.out.println("--------------------------------------------------"); //$NON-NLS-1$
- System.out.println("-Count of fields set called ----------------------"); //$NON-NLS-1$
- System.out.println("--------------------------------------------------"); //$NON-NLS-1$
-
- // Collate the fields set
- entries = FIELDSETCOUNTMAP.entrySet().iterator();
- while (entries.hasNext()) {
- Map.Entry entry = (Entry) entries.next();
- REMFieldProxy fieldProxy = (REMFieldProxy) entry.getKey();
- System.out.println(fieldProxy.toBeanString() + "," + entry.getValue()); //$NON-NLS-1$
- }
- }
-
- }
-
-/**
- * @param aBeanTypeProxy = BeanTypeProxy for the method
- * @param methodName = methodName to be looked for
- * @param parmTypes = array of qualified type names for the method arguments, null if no methods
- */
- public IMethodProxy getMethodProxy(IBeanTypeProxy aBeanTypeProxy, String methodName, String[] parmTypes){
- if (!registry.isValid())
- return null;
-
- REMMETHODCOUNT++;
- Map methods;
- Object key;
- synchronized (this) {
- // The classCache map is keyed by the BeanTypeProxy and holds a further map of cache'd methods
- methods = getMethods(aBeanTypeProxy);
-
- // The syntax of the key is methodName(parmType1,parmType2)
- if (parmTypes == null || parmTypes.length == 0) {
- key = methodName;
- } else {
- key = new MethodKeyStringParms(methodName, parmTypes);
- }
-
- IMethodProxy result = (IMethodProxy) methods.get(key);
- if (result != null)
- return result;
- }
-
- UNIQUEMETHODCOUNT++;
- // Get the method proxy and cache this before returning it
- // Get the method proxy and cache this before returning it
- REMMethodProxyFactory proxyFactory = (REMMethodProxyFactory) registry.getMethodProxyFactory();
- IMethodProxy result = proxyFactory.getMethodProxy((IREMBeanTypeProxy)aBeanTypeProxy,methodName,parmTypes);
- synchronized (this) {
- // Get it again to make sure it hasn't changed due to a race condition. We don't sync for the getMethodProxy because that goes to the remote vm and could deadlock.
- IMethodProxy mValue = (IMethodProxy) methods.get(key);
- if (mValue != null && mValue != result) {
- registry.releaseProxy(result); // Don't need the result now, got it through a race condition.
- return mValue; // We have a real value now.
- }
- methods.put(key, result);
- }
- return result;
- }
-/**
- * @param aBeanTypeProxy
- * @return Map of cache'd methods
- */
-private Map getMethods(IProxyBeanType aBeanTypeProxy) {
- Map methods = (Map) methodsCache.get(aBeanTypeProxy.getTypeName());
- if(methods == null){
- methods = new HashMap(20);
- methodsCache.put(aBeanTypeProxy.getTypeName(),methods);
- }
- return methods;
-}
-/**
- * @param aBeanTypeProxy
- * @return Map of cache'd invokables
- */
-private Map getInvokables(IBeanTypeProxy aBeanTypeProxy) {
- Map invokables = (Map) invokablesCache.get(aBeanTypeProxy);
- if(invokables == null){
- invokables = new HashMap(20);
- invokablesCache.put(aBeanTypeProxy,invokables);
- }
- return invokables;
-}
-/**
- * @param aBeanTypeProxy
- * @return Map of cache'd fields
- */
-private Map getFields(IProxyBeanType aBeanTypeProxy) {
- Map fields = (Map) fieldsCache.get(aBeanTypeProxy.getTypeName());
- if(fields == null){
- fields = new HashMap(20);
- fieldsCache.put(aBeanTypeProxy.getTypeName(),fields);
- }
- return fields;
-}
-/**
- * @param aBeanTypeProxy = BeanTypeProxy for the method
- * @param methodName = methodName to be looked for
- * @param parmTypes = array of qualified type names for the method arguments, null if no arguments
- */
- public IInvokable getInvokable(IBeanTypeProxy aBeanTypeProxy, String invokableName, String[] parmTypeNames){
-
- REMINVOKABLECOUNT++;
- // The classCache map is keyed by the BeanTypeProxy and holds a further map of cache'd methods
- Map invokables = getInvokables(aBeanTypeProxy);
-
- Object key = null;
- if(parmTypeNames == null || parmTypeNames.length == 0){
- key = invokableName;
- } else {
- key = new MethodKeyStringParms(invokableName, parmTypeNames);
- }
-
- IInvokable result = (IInvokable) invokables.get(key);
- if(result != null) return result;
-
- UNIQUEINVOKABLECOUNT++;
- // Get the method proxy and cache this before returning it
- // Get the method proxy and cache this before returning it
- REMMethodProxyFactory proxyFactory = (REMMethodProxyFactory) aBeanTypeProxy.getProxyFactoryRegistry().getMethodProxyFactory();
- result = proxyFactory.getInvokable((IREMBeanTypeProxy)aBeanTypeProxy,invokableName,parmTypeNames);
- invokables.put(key,result);
- return result;
-
- }
- /**
- * @param aBeanTypeProxy = BeanTypeProxy for the method
- * @param methodName = methodName to be looked for
- * @param parmTypes = array of IBeanTypeProxy types for the method arguments, null if no arguments
- */
- public IInvokable getInvokable(IBeanTypeProxy aBeanTypeProxy, String invokableName, IBeanTypeProxy[] parmTypes){
-
- REMINVOKABLECOUNT++;
- // The classCache map is keyed by the BeanTypeProxy and holds a further map of cache'd methods
- Map invokables = getInvokables(aBeanTypeProxy);
-
- Object key = null;
- if(parmTypes == null || parmTypes.length == 0){
- key = invokableName;
- } else {
- key = new MethodKeyProxyParms(invokableName, parmTypes);
- }
-
- IInvokable result = (IInvokable) invokables.get(key);
- if(result != null) return result;
-
- UNIQUEINVOKABLECOUNT++;
- // Get the method proxy and cache this before returning it
- // Get the method proxy and cache this before returning it
- REMMethodProxyFactory proxyFactory = (REMMethodProxyFactory) aBeanTypeProxy.getProxyFactoryRegistry().getMethodProxyFactory();
- result = proxyFactory.getInvokable((IREMBeanTypeProxy)aBeanTypeProxy,invokableName,parmTypes);
- invokables.put(key,result);
- return result;
-
- }
-/**
- * @param aBeanTypeProxy = BeanTypeProxy for the method
- * @param methodName = methodName to be looked for
- * @param parmTypes = array of qualified type names for the method arguments, null if no methods
- */
- public IMethodProxy getMethodProxy(IBeanTypeProxy aBeanTypeProxy, String methodName, IBeanTypeProxy[] parmTypes){
- if (!registry.isValid())
- return null;
-
- REMMETHODCOUNT++;
- // The classCache map is keyed by the BeanTypeProxy and holds a further map of cache'd methods
- Map methods;
- Object key;
- synchronized (this) {
- methods = getMethods(aBeanTypeProxy);
-
- key = null;
- if (parmTypes == null || parmTypes.length == 0) {
- key = methodName;
- } else {
- key = new MethodKeyProxyParms(methodName, parmTypes);
- }
-
- IMethodProxy result = (IMethodProxy) methods.get(key);
- if (result != null)
- return result;
- }
-
- UNIQUEMETHODCOUNT++;
- // Get the method proxy and cache this before returning it
- // Get the method proxy and cache this before returning it
- REMMethodProxyFactory proxyFactory = (REMMethodProxyFactory) registry.getMethodProxyFactory();
- IMethodProxy result = proxyFactory.getMethodProxy((IREMBeanTypeProxy)aBeanTypeProxy,methodName,parmTypes);
- synchronized (this) {
- // Get it again to make sure it hasn't changed due to a race condition. We don't sync for the getMethodProxy because that goes to the remote vm and could deadlock.
- IMethodProxy mValue = (IMethodProxy) methods.get(key);
- if (mValue != null && mValue != result) {
- registry.releaseProxy(result); // Don't need result now, got it already through a race condition.
- return mValue; // We have a real value now.
- }
- methods.put(key, result);
- }
-
- return result;
- }
-
- /**
- * Return the proxy method for the method through the expression.
- * @param expression
- * @param aBeanTypeProxy
- * @param methodName
- * @param parmTypes
- * @return either the IMethodProxy if already resolved or an ExpressionProxy if not yet resolved.
- *
- * @since 1.1.0
- */
- public IProxyMethod getMethodProxy(IExpression expression, IProxyBeanType aBeanTypeProxy, String methodName, IProxyBeanType[] parmTypes){
- if (!registry.isValid())
- return null;
-
- REMMETHODCOUNT++;
- Map methods;
- Map epMethods;
- Object key;
- boolean isKey;
- synchronized (this) {
- // The classCache map is keyed by the BeanTypeProxy name and holds a further map of cache'd methods
- methods = getMethods(aBeanTypeProxy);
-
- if (parmTypes == null || parmTypes.length == 0) {
- key = methodName;
- isKey = false;
- } else {
- key = new MethodKeyProxyParms(methodName, parmTypes);
- isKey = true;
- }
-
- IProxyMethod result = (IProxyMethod) methods.get(key);
- if (result != null)
- return result;
-
- // See if stored in the expression.
- epMethods = ((REMExpression) expression).getMethods(aBeanTypeProxy);
- result = (IProxyMethod) epMethods.get(key);
- if (result != null)
- return result;
- }
-
- UNIQUEMETHODCOUNT++;
- // Get the method expression proxy and cache this before returning it
- IProxyMethod result = ((Expression) expression).createMethodExpressionProxy(aBeanTypeProxy,methodName,parmTypes);
- epMethods.put(key, result);
- final Object epKey = key;
- final Map rMethods = methods;
- final Map fepMethods = epMethods;
- final boolean isKeyType = isKey;
- ((ExpressionProxy) result).addProxyListener(new ExpressionProxy.ProxyAdapter() {
- public void proxyResolved(ProxyEvent event) {
- synchronized (REMProxyConstants.this) {
- if (rMethods.containsKey(epKey))
- return; // We already have a true method proxy in there. A race condition occurred.
-
- // Now put this resolved guy into the methods.
- // We don't want the key to contain expression proxies in the final map, so if it is a key type
- // we will turn it into a string type key.
- Object key;
- if (isKeyType) {
- key = ((MethodKeyProxyParms) epKey).toMethodKeyStringParms(); // So that we don't put a ket that contains expression proxy parm types into the main map.
- } else
- key = epKey;
-
- rMethods.put(key, event.getProxy());
- }
- }
-
- public void proxyNotResolved(ExpressionProxy.ProxyEvent event) {
- synchronized (REMProxyConstants.this) {
- fepMethods.remove(epKey);
- }
- }
-
- });
- return result;
- }
-
- /**
- * @param proxy
- */
- static void methodInvoked(REMMethodProxy proxy) {
-
- if (GATHER_COUNTS) {
- Integer count = (Integer) METHODCOUNTMAP.get(proxy);
- if (count == null) {
- METHODCOUNTMAP.put(proxy, new Integer(1));
- } else {
- METHODCOUNTMAP.put(proxy, new Integer(count.intValue() + 1));
- }
- }
- }
-
- static void fieldGetInvoked(IBeanProxy proxy) {
-
- if (GATHER_COUNTS) {
- Integer count = (Integer) FIELDCOUNTMAP.get(proxy);
- if (count == null) {
- FIELDCOUNTMAP.put(proxy, new Integer(1));
- } else {
- FIELDCOUNTMAP.put(proxy, new Integer(count.intValue() + 1));
- }
- }
- }
-
- static void fieldSetInvoked(IBeanProxy proxy, IBeanProxy value) {
-
- if (GATHER_COUNTS) {
- Integer count = (Integer) FIELDSETCOUNTMAP.get(proxy);
- if (count == null) {
- FIELDSETCOUNTMAP.put(proxy, new Integer(1));
- } else {
- FIELDSETCOUNTMAP.put(proxy, new Integer(count.intValue() + 1));
- }
- }
- }
-
- /**
- * @param proxy for the BeanType of the field
- * @param fieldName of the field, e.g. (java.awt.Dimension, width) for the "width" field on Dimension
- * @return The field proxy that is cache'd for performance
- */
- public IFieldProxy getFieldProxy(REMAbstractBeanTypeProxy aBeanTypeProxy, String fieldName) {
- if (!registry.isValid())
- return null;
-
- REMFIELDCOUNT++;
- Map fields;
- synchronized (this) {
- // The field map is keyed by the BeanTypeProxy and holds a further map of cache'd fields
- fields = getFields(aBeanTypeProxy);
-
- // Lookup the cache'd Field proxy
- IFieldProxy result = (IFieldProxy) fields.get(fieldName);
- if (result != null)
- return result;
- }
-
- UNIQUEFIELDCOUNT++;
- IFieldProxy result = (IFieldProxy) REMStandardBeanProxyConstants.getConstants(aBeanTypeProxy.getProxyFactoryRegistry()).getClassGetField().invokeCatchThrowableExceptions(
- aBeanTypeProxy,
- registry.getBeanProxyFactory().createBeanProxyWith(fieldName));
- synchronized (this) {
- IFieldProxy fValue = (IFieldProxy) fields.get(fieldName);
- if (fValue != null) {
- registry.releaseProxy(result); // Don't need it now. A race had put another one in.
- return fValue;
- }
- fields.put(fieldName,result);
- }
- return result;
- }
-
- public IProxyField getFieldProxy(IExpression expression, IProxyBeanType aBeanTypeProxy, final String fieldName){
- if (!registry.isValid())
- return null;
-
- REMFIELDCOUNT++;
- Map fields;
- Map epFields;
- synchronized (this) {
- // The classCache map is keyed by the BeanTypeProxy name and holds a further map of cache'd methods
- fields = getFields(aBeanTypeProxy);
-
- IProxyField result = (IProxyField) fields.get(fieldName);
- if (result != null)
- return result;
-
- // See if stored in the expression.
- epFields = ((REMExpression) expression).getFields(aBeanTypeProxy);
- result = (IProxyField) epFields.get(fieldName);
- if (result != null)
- return result;
- }
-
- UNIQUEFIELDCOUNT++;
- // Get the field expression proxy and cache this before returning it
- IProxyField result = ((REMExpression) expression).createFieldExpressionProxy(aBeanTypeProxy, fieldName);
- epFields.put(fieldName, result);
- final Map fpFields = fields;
- final Map fepFields = epFields;
- ((ExpressionProxy) result).addProxyListener(new ExpressionProxy.ProxyAdapter() {
-
- public void proxyResolved(ProxyEvent event) {
- synchronized (REMProxyConstants.this) {
- if (fpFields.containsKey(fieldName))
- return; // Already set to resolved value by someone else.
- fpFields.put(fieldName, event.getProxy());
- }
- }
- public void proxyNotResolved(ExpressionProxy.ProxyEvent event) {
- synchronized (REMProxyConstants.this) {
- fepFields.remove(fieldName);
- }
- }
- });
-
- return result;
- }
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMProxyFactoryRegistry.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMProxyFactoryRegistry.java
deleted file mode 100644
index db1e31ed3..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMProxyFactoryRegistry.java
+++ /dev/null
@@ -1,476 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-
-import java.io.IOException;
-import java.net.Socket;
-import java.text.MessageFormat;
-import java.util.Iterator;
-import java.util.Stack;
-
-import org.eclipse.core.runtime.*;
-import org.eclipse.core.runtime.jobs.IJobManager;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.debug.core.*;
-import org.eclipse.debug.core.model.IProcess;
-import org.eclipse.debug.core.model.IStreamsProxy;
-
-import org.eclipse.jem.internal.proxy.core.*;
-/**
- * This is the factory registry to use for Remote VM.
- * It adds to the standard registry, connection specific information.
- *
- * This will always hold onto one connection open until termination is requested.
- * That way while the IDE is up, the remove vm won't time out.
- */
-
-public class REMProxyFactoryRegistry extends BaseProxyFactoryRegistry {
-
- public static final String REMOTE_REGISTRY_TYPE_ID = "org.eclipse.jem.REMOTE"; //$NON-NLS-1$
-
- protected int fServerPort = 0; // The server port to use when making connections.
- protected REMCallbackRegistry fCallbackServer; // The callback server thread for this remote vm.
- protected Stack fConnectionPool = new Stack(); // Stack of free connections.
- protected static int NUMBER_FREE_CONNECTIONS = 5; // Number of free connections to keep open.
- protected IProcess fProcess; // The process that is the server. If null and fServerPort is not zero,
- // then this registry is in test mode
- // and the server is in same the process.
- protected String fName;
- protected int fCallbackServerPort;
- protected Integer fRegistryKey;
- protected REMRegistryController fRegistryController;
-
- protected final static Object TERMINATE_JOB_FAMILY = new Object();
-
- // Package protected because only the ProxyVMStarter should set this flag. It would set it if
- // working with a debugger because we don't how long it will be to respond to requests when
- // someone is working with a debugger.
- boolean fNoTimeouts = false;
-
- // This is set via the static setGlobalNoTimeouts() method, or via debug options flag. It is here so that
- // when debugging callbacks, but not debugging remote vm, that no timeouts for any registry will occur.
- // Or it can be set through the debug .options flag.
- static boolean fGlobalNoTimeouts = "true".equalsIgnoreCase(Platform.getDebugOption(ProxyPlugin.getPlugin().getBundle().getSymbolicName()+ProxyRemoteUtil.NO_TIMEOUTS)); //$NON-NLS-1$;
-
- /**
- * Typicall set through the "expression" evaluation of the debugger.
- * @param noTimeouts
- *
- * @since 1.0.0
- */
- public static void setGlobalNoTimeouts(boolean noTimeouts) {
- fGlobalNoTimeouts = noTimeouts;
- }
-
- // An internal thread that locks and waits for the remote vm to register itself.
- private WaitForRegistrationThread waitRegistrationThread;
-
- private class WaitForRegistrationThread extends Thread {
- public WaitForRegistrationThread() {
- super("Wait for remote vm registration thread"); //$NON-NLS-1$
- }
-
- /**
- * @see java.lang.Thread#run()
- */
- public void run() {
- // Wait for registration. Put it into a thread so this
- // can occur while other stuff goes on. It locks the fConnectionPool
- // until done so that the first request for a connection by anyone
- // else will wait until this thread is finished.
-
- synchronized(fConnectionPool) {
- synchronized(REMProxyFactoryRegistry.this) {
- // Notify the main thread that we have the
- // connection pool locked.
- REMProxyFactoryRegistry.this.notifyAll();
- }
- synchronized (this) {
- // sync on self so that it can be notified when finally receive the registration
- long stopTime = System.currentTimeMillis()+60000;
- while (waitRegistrationThread != null && (fNoTimeouts || System.currentTimeMillis() < stopTime)) {
- try {
- Thread.currentThread().wait(60000);
- } catch (InterruptedException e) {
- }
- }
- }
- }
-
- waitRegistrationThread = null; // No longer exists.
- }
- }
-
-
- public REMProxyFactoryRegistry(REMRegistryController registryController, String name) {
- super(REMOTE_REGISTRY_TYPE_ID);
- fRegistryController = registryController;
- fRegistryKey = fRegistryController.registerRegistry(this); // Register the registry with the plugin.
- fName = name;
-
- // Get the waitRegistrationThread started before we actually launch remote vm so
- // that it is waiting when the callback comes in.
- synchronized (this) {
- waitRegistrationThread = new WaitForRegistrationThread();
- waitRegistrationThread.start();
-
- // Now we will wait until the registration callback has been done. The thread will
- // signal us when that is done. This is so that we don't continue on and let
- // a work connection be requested before we even got a chance to start waiting
- // for the registration.
- while(true) {
- try {
- wait();
- break;
- } catch (InterruptedException e) {
- }
- };
- }
- }
-
- public Integer getRegistryKey() {
- return fRegistryKey;
- }
-
- public void initializeRegistry(IProcess process) {
- fProcess = process;
- processListener = new IDebugEventSetListener() {
- /**
- * @see org.eclipse.debug.core.IDebugEventSetListener#handleDebugEvents(DebugEvent[])
- */
- public void handleDebugEvents(DebugEvent[] events) {
- for (int i = 0; i < events.length; i++) {
- DebugEvent e = events[i];
- if (e.getSource() == fProcess && e.getKind() == DebugEvent.TERMINATE) {
- // We terminating too soon. Pop up a msg.
- IStreamsProxy stProxy = fProcess.getStreamsProxy();
- java.io.StringWriter s = new java.io.StringWriter();
- java.io.PrintWriter w = new java.io.PrintWriter(s);
-
- String msg = MessageFormat.format(ProxyRemoteMessages.Proxy_Terminated_too_soon_ERROR_, new Object[] {fName});
- w.println(msg);
- w.println(ProxyRemoteMessages.VM_TERMINATED_INFO_);
- w.println(ProxyRemoteMessages.VM_COMMAND_LINE);
- w.println(fProcess.getAttribute(IProcess.ATTR_CMDLINE));
- w.println(ProxyRemoteMessages.VM_TERMINATED_LINE1);
- w.println(stProxy.getErrorStreamMonitor().getContents());
- w.println(ProxyRemoteMessages.VM_TERMINATED_LINE2);
- w.println(stProxy.getOutputStreamMonitor().getContents());
- w.println(ProxyRemoteMessages.VM_TERMINATED_LINE3);
- w.close();
-
- DebugModeHelper dh = new DebugModeHelper();
- dh.displayErrorMessage(ProxyRemoteMessages.Proxy_Error_Title, msg);
- ProxyPlugin.getPlugin().getLogger().log(new Status(IStatus.WARNING, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, s.toString(), null));
- processListener = null;
- DebugPlugin.getDefault().removeDebugEventListener(this);
- terminateRegistry();
- break;
- }
- }
- }
- };
-
- DebugPlugin.getDefault().addDebugEventListener(processListener);
- }
-
- private IDebugEventSetListener processListener = null;
-
- /**
- * Get the CallbackRegistry
- */
- public ICallbackRegistry getCallbackRegistry() {
- if (fCallbackServer == null)
- fCallbackServer = new REMCallbackRegistry(fName, this);
- return fCallbackServer;
- }
-
- /**
- * This is called by the registry controller to tell
- * the registry to terminate with prejudice all
- * pending TerminateJobs.
- *
- *
- * @since 1.1.0
- */
- public static void cancelAllTerminateJobs() {
- IJobManager jobManager = Job.getJobManager();
- jobManager.cancel(TERMINATE_JOB_FAMILY);
- try {
- jobManager.join(TERMINATE_JOB_FAMILY, null);
- } catch (OperationCanceledException e) {
- } catch (InterruptedException e) {
- }
- }
-
- private static class TerminateProcess extends Job {
- private IProcess process;
-
- public TerminateProcess(IProcess process) {
- super(ProxyRemoteMessages.REMProxyFactoryRegistry_Job_TerminateProcess_Title);
- this.process = process;
- }
-
- public boolean belongsTo(Object family) {
- return family == TERMINATE_JOB_FAMILY || super.belongsTo(family);
- }
-
-
- /* (non-Javadoc)
- * @see java.lang.Thread#run()
- */
- public IStatus run(IProgressMonitor mon) {
- try {
- // There is no join on a process available, so we will have to
- // busy wait. Give it 10 seconds in 1/10 second intervals.
- for (int i=0; !process.isTerminated() && i<100; i++) {
- try {
- Thread.sleep(100);
- } catch (InterruptedException e) {
- }
- }
- if (!process.isTerminated()) {
- process.terminate();
- }
- } catch (DebugException e) {
- }
- return Status.OK_STATUS;
- }
- }
-
- protected void registryTerminated(boolean wait) {
- if (processListener != null) {
- // Remove listener cause we are now going to terminate process and don't want premature terminate notice.
- // Sometimes in shutdown we are called and the debug plugin may of already been shutdown. In that case the db
- // will be null and there is nothing remove listener from.
- DebugPlugin db = DebugPlugin.getDefault();
- if (db != null)
- db.removeDebugEventListener(processListener);
- processListener = null;
- }
-
- Job tjob = null;
- if (waitRegistrationThread != null) {
- synchronized (waitRegistrationThread) {
- // Still waiting. close it out.
- WaitForRegistrationThread wThread = waitRegistrationThread;
- waitRegistrationThread = null;
- wThread.notifyAll();
- }
- }
- if (fServerPort != 0) {
- IREMConnection closeCon = null; // The connection we will use to close the remote vm.
- synchronized(fConnectionPool) {
- // Now we walk through all of the free connections and close them properly.
- Iterator itr = fConnectionPool.iterator();
- if (itr.hasNext())
- closeCon = (IREMConnection) itr.next();
- while (itr.hasNext()) {
- IREMConnection con = (IREMConnection) itr.next();
- con.close();
- }
- }
-
- // Now we terminate the server.
- if (closeCon == null)
- try {
- closeCon = getFreeConnection(); // There weren't any free connections, so get a new one so that we can close it.
- } catch (IllegalStateException e) {
- // Do nothing, don't want to stop termination just because we can't get a connection.
- }
- if (closeCon != null) {
- closeCon.terminateServer(); // We got a connection to terminate (process may of terminated early, so we would not have a conn then).
- }
- fConnectionPool.clear();
- fServerPort = 0;
-
- if (fProcess != null && !fRegistryController.inShutDown()) {
- tjob = new TerminateProcess(fProcess);
- tjob.setSystem(true);
- tjob.schedule();
- fProcess = null;
- }
- }
-
- if (fCallbackServer != null) {
- fCallbackServer.requestShutdown();
- fCallbackServer = null;
- }
-
- fConnectionPool.clear();
- fRegistryController.deregisterRegistry(fRegistryKey); // De-register this registry.
-
- if (wait && tjob != null) {
- try {
- tjob.join();
- } catch (InterruptedException e) {
- // It timed out, so we'll just go on.
- }
- }
- }
-
- /**
- * Return the server port number.
- */
- public int getServerPort() {
- return fServerPort;
- }
-
- /*
- * set the server port.
- */
- void setServerPort(int serverport) {
- fServerPort = serverport;
- if (waitRegistrationThread != null) {
- synchronized (waitRegistrationThread) {
- // Close it out, we are now registered
- WaitForRegistrationThread wThread = waitRegistrationThread;
- waitRegistrationThread = null;
- wThread.notifyAll();
- }
- }
- }
-
- /**
- * Get a free connection
- * @return
- * @throws IllegalStateException - Thrown if a connection cannot be created.
- *
- * @since 1.0.0
- */
- public IREMConnection getFreeConnection() throws IllegalStateException {
- Thread thread = Thread.currentThread();
- if (thread instanceof REMCallbackThread) {
- // The current thread is a call back thread, so just reuse the connection.
- // But this thread could actually be trying to access another registry.
- // So if this thread is for this registry, use it, if not for this registry, create a new connection.
- // But if for this registry AND is already in a transaction, we need a fresh connection.
- REMCallbackThread callbackThread = (REMCallbackThread) thread;
- if (callbackThread.registry == this && !callbackThread.inTransaction()) {
- // This way any calls out to the remote vm will be on same thread as callback caller
- // on remote vm because that thread is waiting on this connection for commands.
- IREMConnection c = (callbackThread).getConnection();
- if (c.isConnected())
- return c;
- else
- throw new IllegalStateException(ProxyRemoteMessages.REMProxyFactoryRegistry_CallbackConnectionNotWorking_EXC_);
- }
- }
- synchronized(fConnectionPool) {
- if (!fConnectionPool.isEmpty())
- return (IREMConnection) fConnectionPool.pop();
- // else we need to allocate one.
- return createConnection();
- }
- }
-
-
- /**
- * Make a new connection.
- * @return
- * @throws IllegalStateException - Thrown if connection cannot be created.
- *
- * @since 1.0.0
- */
- protected IREMConnection createConnection() throws IllegalStateException {
- // If we have a server port, then the server is probably open. If we don't then there is no server.
- if (fServerPort != 0) {
- // We are putting it off into a thread because there are no timeout capabilities on getting a socket.
- // So we need to allow for that.
- final Socket[] scArray = new Socket[1];
- final boolean[] waiting = new boolean[] {true};
- Thread doIt = new Thread(new Runnable() {
- public void run() {
- try {
- Socket sc = new Socket("localhost", fServerPort); //$NON-NLS-1$
- synchronized (this) {
- if (waiting[0])
- scArray[0] = sc;
- else
- sc.close(); // We are no longer waiting on this thread so close the socket since no one will use it.
- }
- } catch (IOException e) {
- ProxyPlugin.getPlugin().getLogger().log(new Status(IStatus.WARNING, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "", e)); //$NON-NLS-1$
- }
- }
- });
-
- doIt.start();
- while (true) {
- try {
- doIt.join(!fNoTimeouts ? 60000 : 0);
- synchronized (doIt) {
- waiting[0] = false; // To let it know we are no longer waiting
- }
- break;
- } catch (InterruptedException e) {
- }
- }
-
- if (scArray[0] == null) {
- // Log where we are at so we can know where it was we down.
- ProxyPlugin.getPlugin().getLogger().log(new Status(IStatus.WARNING, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "", new IllegalStateException(ProxyRemoteMessages.REMProxyFactoryRegistry_ConnectionCreationFailed_INFO_))); //$NON-NLS-1$
- throw new IllegalStateException(ProxyRemoteMessages.REMProxyFactoryRegistry_CouldNotCreateSocketConnectionToRemoteVM_EXC_); // Couldn't get one, probably server is down. //$NON-NLS-1$
- }
-
- REMConnection connection = new REMConnection(scArray[0], fNoTimeouts);
- if (connection.isConnected())
- return connection;
-
- // Failed, close the socket.
- try {
- scArray[0].close();
- } catch (IOException e) {
- }
- } else
- ProxyPlugin.getPlugin().getLogger().log(new Status(IStatus.WARNING, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "No Server to retrieve a connection.", null)); ///$NON-NLS-1$
-
- throw new IllegalStateException(ProxyRemoteMessages.REMProxyFactoryRegistry_CouldNotCreateSocketConnectionToRemoteVM_EXC_);
- }
-
- /**
- * Free the connection
- */
- public void returnConnection(IREMConnection connection) {
- if (connection.isConnected()) {
- Thread thread = Thread.currentThread();
- if (!(thread instanceof REMCallbackThread) || ((REMCallbackThread) thread).getConnection() != connection) {
- // We are not a callback thread, or we are but the connection is not for the thread, then the connection
- // can be returned.
- synchronized (fConnectionPool) {
- if (fConnectionPool.size() < NUMBER_FREE_CONNECTIONS)
- fConnectionPool.push(connection);
- else
- connection.close(); // We don't need to maintain more than five free connections.
- }
- }
- }
- }
-
- /**
- * Release this connection. This means close it out.
- */
- public void closeConnection(IREMConnection connection) {
- connection.close();
- }
-
-
- public int connectionCount() {
- synchronized (fConnectionPool) {
- return fConnectionPool.size();
- }
- }
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMRegistryController.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMRegistryController.java
deleted file mode 100644
index 8405d6fc5..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMRegistryController.java
+++ /dev/null
@@ -1,198 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.runtime.*;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.jobs.Job;
-
-import org.eclipse.jem.internal.proxy.core.ProxyPlugin;
-
-/**
- * This class is a controller for all of the registries.
- * @author richkulp
- */
-public class REMRegistryController {
-
- private Map fActiveRegistries = new HashMap(); // Access to this must be sync(REMRegistryController)
- private static final long CLEANUP_INTERVAL = 60000l; // The interval between clean up job execution.
-
- protected boolean inShutdown; // Are we in shutdown mode. Terminate registries runs differently in shutdown mode.
-
- // Thread to clean up GC'd proxies. Runs as a daemon at the lowest priority
- private Job processQueueJob= new Job(ProxyRemoteMessages.CleanupJob_title) {
- public IStatus run(IProgressMonitor m) {
- REMProxyFactoryRegistry[] registries = null;
- synchronized (REMRegistryController.this) {
- // This list may be updated by others, so we need to make a copy
- // or else we could get a failure.
- registries =
- (REMProxyFactoryRegistry[]) fActiveRegistries.values().toArray(
- new REMProxyFactoryRegistry[fActiveRegistries.size()]);
- }
- for (int i = 0; i < registries.length; i++) {
- try {
- ((REMStandardBeanProxyFactory) registries[i].getBeanProxyFactory()).processQueue();
- } catch (RuntimeException e) {
- // When debugging, getBeanProxyFactory can throw exception because it hasn't been initialized
- // yet when the thread wakes up, though the registry has been registered. It has to do with it
- // can take significant time for the user to start up the debugger, and during that time this
- // thread could kick in.
- }
- }
- synchronized(this) {
- if (!m.isCanceled())
- this.schedule(CLEANUP_INTERVAL); // Schedule to start again in one minute.
- }
- return Status.OK_STATUS;
- }
-
- }; //$NON-NLS-1$
-
- public REMRegistryController() {
-
- ProxyPlugin.getPlugin().addProxyShutdownListener(new ProxyPlugin.IProxyPluginShutdownListener() {
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.ProxyPlugin.IProxyPluginShutdownListener#shutdown()
- */
- public void shutdown() {
- REMRegistryController.this.shutdown();
- }
- });
-
- masterThread = new REMMasterServerThread(this);
- masterThread.start();
-
- processQueueJob.setSystem(true); // So that it won't show processing in process view. Not of interest to general users.
- processQueueJob.setPriority(Job.SHORT);
- processQueueJob.schedule(CLEANUP_INTERVAL);
-
- }
-
- /**
- * Answer whether we are shutting down or not.
- * @return
- *
- * @since 1.1.0
- */
- public boolean inShutDown() {
- return inShutdown;
- }
-
- /*
- * Add registry to list of active. Return a unique number to be the key.
- * Package-protected so that only locals can access it.
- */
- synchronized Integer registerRegistry(REMProxyFactoryRegistry registry) {
-
- Integer hashcode = new Integer(registry.hashCode());
- while (true) {
- REMProxyFactoryRegistry existing = (REMProxyFactoryRegistry) fActiveRegistries.get(hashcode);
- if (existing == null)
- break; // Not yet registered, use use the hashcode
- else if (existing != registry)
- hashcode = new Integer(hashcode.intValue()+1);
- else
- return hashcode; // Same guy, use the hashcode.
- }
-
- fActiveRegistries.put(hashcode, registry);
- return hashcode;
- }
-
- /*
- * deregister the registry.
- */
- synchronized void deregisterRegistry(Integer key) {
- fActiveRegistries.remove(key);
- }
-
- /*
- * Return the registry for the given key
- */
- synchronized REMProxyFactoryRegistry getRegistry(Integer key) {
- return (REMProxyFactoryRegistry) fActiveRegistries.get(key);
- }
-
- /**
- * Master server thread. Handles keep-alive requests and register remote server threads.
- * It will be created when needed.
- */
- protected REMMasterServerThread masterThread;
-
- /*
- * Shuts down this plug-in and discards all plug-in state.
- *
- * In this case, terminate all of the active registries so that they can be shutdown.
- * Don't want them hanging around after termination of the desktop.
- */
- void shutdown() {
-
- synchronized(processQueueJob) {
- processQueueJob.cancel();
- }
-
- REMProxyFactoryRegistry[] registries = null;
- synchronized (this) {
- // This list will be updated in the terminateRegistry, so we need to make a copy
- // or else we get a failure.
- registries =
- (REMProxyFactoryRegistry[]) fActiveRegistries.values().toArray(
- new REMProxyFactoryRegistry[fActiveRegistries.size()]);
- }
-
- inShutdown = true; // We are now in shutdown mode.
- // In shutdown mode the registries will not create the job that waits for the process
- // to terminate, and if it doesn't in 1.5 secs it does a force.
- // Instead what we will do is shutdown all of the registries. If they don't
- // shutdown on their own then they stay out there. But they do have an
- // internal timer that checks every five minutes to see if the host is
- // still there, and if it isn't they will shut themselves down. They
- // would have to be really hosed if the suicide timer wasn't working.
-
- for (int i = 0; i < registries.length; i++)
- registries[i].terminateRegistry();
-
- if (masterThread != null) {
- try {
- masterThread.requestShutdown();
- masterThread.join(20000); // Wait 20 seconds for everything to go down.
- masterThread = null;
- } catch (InterruptedException e) {
- }
- }
-
- try {
- processQueueJob.join();
- } catch(InterruptedException e) {
- }
-
- REMProxyFactoryRegistry.cancelAllTerminateJobs();
- }
-
- /**
- * Return the master socket port number.
- */
- public int getMasterSocketPort() {
- return masterThread != null ? masterThread.getMasterSocket().getLocalPort() : -1;
- }
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMShortClassBeanProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMShortClassBeanProxy.java
deleted file mode 100644
index 27ea767c6..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMShortClassBeanProxy.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-
-import org.eclipse.jem.internal.proxy.core.*;
-import org.eclipse.jem.internal.proxy.common.remote.Commands;
-/**
- * Remote Proxy for Short.class.
- */
-class REMShortClassBeanProxy extends REMNumberBeanProxy {
-
-REMShortClassBeanProxy(REMProxyFactoryRegistry aRegistry, Short aShort) {
- super(aRegistry, aShort);
-}
-
-/**
- * Get the beantype
- */
-public IBeanTypeProxy getTypeProxy() {
- return ((REMStandardBeanTypeProxyFactory) fFactory.getBeanTypeProxyFactory()).shortClass;
-}
-
-/**
- * Render the bean into value object.
- */
-public void renderBean(Commands.ValueObject value) {
- value.set((Short) numberValue());
-}
-}
-
-
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMShortClassBeanTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMShortClassBeanTypeProxy.java
deleted file mode 100644
index d93e66fc8..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMShortClassBeanTypeProxy.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-
-import org.eclipse.jem.internal.proxy.core.*;
-import org.eclipse.jem.internal.proxy.common.remote.Commands;
-/**
- * Remote Implementation of IBeanTypeProxy for Short.class.
- * Creation date: (2/6/00 9:01:40 AM)
- * @author: Joe Winchester
- */
-final class REMShortClassBeanTypeProxy extends REMAbstractNumberBeanTypeProxy {
-// Some values are cache'd for speed
- private final INumberBeanProxy zeroProxy;
- private final INumberBeanProxy oneProxy;
- private final INumberBeanProxy twoProxy;
- private final INumberBeanProxy threeProxy;
-/**
- * REMIntegerBeanTypeProxy constructor comment.
- * @param aClass java.lang.Class
- */
-REMShortClassBeanTypeProxy(REMProxyFactoryRegistry aRegistry, IBeanTypeProxy numberType) {
- super(aRegistry, new Integer(Commands.SHORT_CLASS), Short.class.getName(), numberType);
-
- // Create the cached values
- zeroProxy = new REMShortClassBeanProxy(aRegistry, new Short((short)0));
- oneProxy = new REMShortClassBeanProxy(aRegistry, new Short((short)1));
- twoProxy = new REMShortClassBeanProxy(aRegistry, new Short((short)2));
- threeProxy = new REMShortClassBeanProxy(aRegistry, new Short((short)3));
-}
-
-/**
- * Helper to create a bean proxy
- * Package protected because everyone should go through the factory API
- * that is defined as part of IBeanProxyFactory
- */
-INumberBeanProxy createShortBeanProxy(Short aShort) {
- switch(aShort.shortValue()) {
- case 0: return zeroProxy;
- case 1: return oneProxy ;
- case 2: return twoProxy ;
- case 3: return threeProxy ;
- default: return new REMShortClassBeanProxy(fRegistry, aShort);
- }
-}
-
-/**
- * Generic way to create a Short proxy, however, the Number must be a Short.
- */
-protected INumberBeanProxy createNumberBeanProxy(Number aNumber) {
- return createShortBeanProxy((Short) aNumber);
-}
-
-/**
- * newInstance method. Number's don't have a default ctor, so the standard way won't work.
- * Return the zero proxy for this case.
- */
-public IBeanProxy newInstance() {
- return zeroProxy;
-}
-
-/**
- * Create a new bean proxy the ValueObject passed in.
- * We will assume the object is correct type.
- */
-public IBeanProxy newBeanProxy(Commands.ValueObject value) {
- return createShortBeanProxy(new Short(value.aShort));
-}
-}
-
-
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMShortTypeBeanProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMShortTypeBeanProxy.java
deleted file mode 100644
index d2bc1e2d8..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMShortTypeBeanProxy.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-
-import org.eclipse.jem.internal.proxy.common.remote.Commands;
-import org.eclipse.jem.internal.proxy.core.*;
-/**
- * Remote Implementation of INumberBeanProxy for the primitive "short".
- * It can answer all of the primitive number types (int, long, short, byte, double, float).
- * Creation date: (2/6/00 9:02:54 AM)
- * @author: Joe Winchester
- */
-class REMShortTypeBeanProxy extends REMConstantBeanProxy implements INumberBeanProxy {
- private final short fShort;
-
-/**
- * It is package protected because they are created
- * in a special way and no one else should create them.
- * @param aBean java.lang.Object
- */
-REMShortTypeBeanProxy(REMProxyFactoryRegistry aRegistry, short aShort) {
- super(aRegistry);
- fShort = aShort;
-}
-/**
- * equals: Equal if:
- * 1) This proxy == (identity) to the other object
- * 2) Else if other is an IBeanProxy and not a constant one, then if
- * equals on the server.
- * 3) If this is a constant proxy and the other is too or is a constant
- * value (e.g. IStringBeanProxy.equals(String), then true if values are equals.
- */
-public boolean equals(Object anObject) {
- if (this == anObject)
- return true; // Identity
- if (anObject instanceof REMShortTypeBeanProxy)
- return fShort == ((REMShortTypeBeanProxy) anObject).shortValue();
- if (anObject instanceof Short)
- return fShort == ((Short) anObject).shortValue();
- return false;
-}
-
-/* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IBeanProxy#sameAs(org.eclipse.jem.internal.proxy.core.IBeanProxy)
- */
-public boolean sameAs(IBeanProxy aBeanProxy) {
- if (this == aBeanProxy)
- return true; // Identity
- if (aBeanProxy instanceof REMShortTypeBeanProxy)
- return fShort == ((REMShortTypeBeanProxy) aBeanProxy).shortValue();
- return false;
-}
-
-/**
- * byteValue method comment.
- */
-public byte byteValue() {
- return (byte) fShort;
-}
-/**
- * doubleValue method comment.
- */
-public double doubleValue() {
- return fShort;
-}
-/**
- * floatValue method comment.
- */
-public float floatValue() {
- return fShort;
-}
-/**
- * Return the int value
- */
-public int intValue() {
- return fShort;
-}
-/**
- * longValue method comment.
- */
-public long longValue() {
- return fShort;
-}
-/**
- * numberValue method comment.
- */
-public Number numberValue() {
- return new Short(fShort);
-}
-/**
- * shortValue method comment.
- */
-public short shortValue() {
- return fShort;
-}
-
-/**
- * The bean's toString.
- */
-public String toBeanString() {
- return String.valueOf(fShort);
-}
-
-/**
- * Get the beantype
- */
-public IBeanTypeProxy getTypeProxy() {
- return ((REMStandardBeanTypeProxyFactory) fFactory.getBeanTypeProxyFactory()).shortType;
-}
-
-/**
- * Render the bean into value object.
- */
-public void renderBean(Commands.ValueObject value) {
- value.set(fShort);
-}
-}
-
-
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMShortTypeBeanTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMShortTypeBeanTypeProxy.java
deleted file mode 100644
index 8dbbd7f48..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMShortTypeBeanTypeProxy.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-
-import org.eclipse.jem.internal.proxy.core.*;
-import org.eclipse.jem.internal.proxy.common.remote.Commands;
-/**
- * Remote Implementation of IBeanTypeProxy for Short.TYPE.
- * Creation date: (2/6/00 9:01:40 AM)
- * @author: Joe Winchester
- */
-final class REMShortTypeBeanTypeProxy extends REMPrimitiveBeanTypeProxy {
-// Some values are cache'd for speed
- private final INumberBeanProxy zeroProxy;
- private final INumberBeanProxy oneProxy;
- private final INumberBeanProxy twoProxy;
- private final INumberBeanProxy threeProxy;
-/**
- * REMIntegerBeanTypeProxy constructor comment.
- * @param aClass java.lang.Class
- */
-REMShortTypeBeanTypeProxy(REMProxyFactoryRegistry aRegistry) {
- super(aRegistry, new Integer(Commands.SHORT_TYPE), Short.TYPE.getName());
-
- // Create the cached values
- zeroProxy = new REMShortTypeBeanProxy(aRegistry, (short) 0);
- oneProxy = new REMShortTypeBeanProxy(aRegistry, (short) 1);
- twoProxy = new REMShortTypeBeanProxy(aRegistry, (short) 2);
- threeProxy = new REMShortTypeBeanProxy(aRegistry, (short) 3);
-}
-
-/**
- * Helper to create a bean proxy
- * Package protected because everyone should go through the factory API
- * that is defined as part of IBeanProxyFactory
- */
-INumberBeanProxy createShortBeanProxy(short aShort) {
- switch(aShort) {
- case 0: return zeroProxy;
- case 1: return oneProxy ;
- case 2: return twoProxy ;
- case 3: return threeProxy ;
- default: return new REMShortTypeBeanProxy(fRegistry, aShort);
- }
-}
-
-/**
- * newInstance method. short is a primitive, so the standard way won't work.
- * Return the zeroProxy for this case because that is the default value.
- */
-public IBeanProxy newInstance() {
- return zeroProxy;
-}
-
-/**
- * Create a new bean proxy the ValueObject passed in.
- * We will assume the object is correct type.
- */
-public IBeanProxy newBeanProxy(Commands.ValueObject value) {
- return createShortBeanProxy(value.aShort);
-}
-
-/**
- * Short cut for newInstance where the string follows the
- * specific pattern we expect. That way it won't be necessary to ship over to the vm
- * to process it.
- *
- * The pattern it can accept is:
- * 1) (short) validNumber - number can be any number because (byte) explicitly casts it down.
- * 2) validNumber
- * It will use the decode function of short to determine the valid number.
- */
-public IBeanProxy newInstance(String initializationString) throws ThrowableProxy, ClassCastException, InstantiationException {
- String trim = initializationString.trim();
- if (trim.length() == 0)
- return super.newInstance(initializationString);
- short aShort;
- if (trim.startsWith("(short)")) { //$NON-NLS-1$
- Number v = parseString(trim.substring("(short)".length()).trim()); //$NON-NLS-1$
- if (v != null)
- aShort = v.shortValue();
- else
- return super.newInstance(initializationString); // Can't decode it, let full parser handle it.
- } else {
- try {
- aShort = Short.decode(trim).shortValue(); // See if valid short format.
- } catch (NumberFormatException e) {
- return super.newInstance(initializationString); // Can't decode it, let full parser handle it.
- }
- }
-
- return getProxyFactoryRegistry().getBeanProxyFactory().createBeanProxyWith(aShort);
-}
-}
-
-
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMStandardBeanProxyConstants.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMStandardBeanProxyConstants.java
deleted file mode 100644
index 70faa919e..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMStandardBeanProxyConstants.java
+++ /dev/null
@@ -1,514 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-
-import org.eclipse.jem.internal.proxy.core.IMethodProxy;
-import org.eclipse.jem.internal.proxy.core.ProxyFactoryRegistry;
-/**
- * REM Standard Proxy constants.
- *
- * Use the static accessor method (getConstants()) to get the appropriate
- * constants instance for the registry. This is done so that until the
- * the constants are needed, they aren't registered.
- *
- * There are some standard utility functions too.
- *
- * This is final because this can't be extended. This specific one
- * will be registered with the factory for this key. Any extensions
- * must be done in their own constants and registry key.
- *
- * Creation date: (4/7/00 4:47:48 PM)
- * @author: Administrator
- */
-public final class REMStandardBeanProxyConstants {
- public static final Object REGISTRY_KEY = new Object();
-
- private final ProxyFactoryRegistry fRegistry;
-
- private IMethodProxy fClassNewInstance;
- private IMethodProxy fClassGetField;
- private IMethodProxy fClassGetDeclaredField;
- private IMethodProxy fClassGetDeclaredFields;
- private IMethodProxy fClassGetFields;
- private IMethodProxy fClassGetConstructor;
- private IMethodProxy fClassGetConstructors;
- private IMethodProxy fClassGetDeclaredConstructor;
- private IMethodProxy fClassGetDeclaredConstructors;
- private IMethodProxy fClassGetMethods;
- private IMethodProxy fClassGetDeclaredMethods;
- private IMethodProxy fClassGetDeclaredMethod;
-
- private IMethodProxy fMethodHelperFindCompatibleConstructor;
- private IMethodProxy fMethodHelperFindCompatibleMethod;
-
- private IMethodProxy fClassIsAssignableFrom;
-
- private IMethodProxy fObjectToString;
- private IMethodProxy fObjectEquals;
-
- private IMethodProxy fThrowableLocalizedMessage;
- private IMethodProxy fThrowableMessage;
-
- private IMethodProxy fMethodDeclaringClassMessage;
- private IMethodProxy fMethodMethodNameMessage;
- private IMethodProxy fMethodParameterTypesMessage;
- private IMethodProxy fMethodReturnTypeMessage;
-
- private IMethodProxy fAccessibleIsAccessible;
- private IMethodProxy fAccessibleSetAccessible;
-
- private IMethodProxy fFieldGet;
- private IMethodProxy fFieldGetType;
- private IMethodProxy fFieldGetByte;
- private IMethodProxy fFieldGetBoolean;
- private IMethodProxy fFieldGetChar;
- private IMethodProxy fFieldGetDouble;
- private IMethodProxy fFieldGetFloat;
- private IMethodProxy fFieldGetInt;
- private IMethodProxy fFieldGetShort;
- private IMethodProxy fFieldGetLong;
- private IMethodProxy fFieldSet;
-
- private IMethodProxy fConstructorNewInstance;
- private IMethodProxy fConstructorParameterTypesMessage;
-
- private IMethodProxy fArrayNewInstanceOneDimension;
- private IMethodProxy fArrayNewInstanceMultiDimensions;
- private IMethodProxy fArrayGetLength;
- private IMethodProxy fArrayGet;
- private IMethodProxy fArrayGetByte;
- private IMethodProxy fArrayGetBoolean;
- private IMethodProxy fArrayGetChar;
- private IMethodProxy fArrayGetDouble;
- private IMethodProxy fArrayGetFloat;
- private IMethodProxy fArrayGetInt;
- private IMethodProxy fArrayGetShort;
- private IMethodProxy fArrayGetLong;
- private IMethodProxy fArraySet;
-
- private IMethodProxy fArrayHelperGet;
- private IMethodProxy fArrayHelperGetByte;
- private IMethodProxy fArrayHelperGetBoolean;
- private IMethodProxy fArrayHelperGetChar;
- private IMethodProxy fArrayHelperGetDouble;
- private IMethodProxy fArrayHelperGetFloat;
- private IMethodProxy fArrayHelperGetInt;
- private IMethodProxy fArrayHelperGetShort;
- private IMethodProxy fArrayHelperGetLong;
- private IMethodProxy fArrayHelperSet;
- private IMethodProxy fArrayHelperEquals;
-
-/**
- * Get the constants instance for the specified registry.
- */
-public static REMStandardBeanProxyConstants getConstants(ProxyFactoryRegistry registry) {
- REMStandardBeanProxyConstants constants = (REMStandardBeanProxyConstants) registry.getConstants(REGISTRY_KEY);
- if (constants == null)
- registry.registerConstants(REGISTRY_KEY, constants = new REMStandardBeanProxyConstants(registry));
- return constants;
-}
-
-
-private REMStandardBeanProxyConstants(ProxyFactoryRegistry registry) {
- super();
- fRegistry = registry;
-}
-
-public IMethodProxy getClassNewInstance() {
- // We actually need a special new instance because we want to be able to access outside of security. For our purposes security doesn't matter for construction.
- if (fClassNewInstance == null)
- fClassNewInstance = fRegistry.getMethodProxyFactory().getMethodProxy("org.eclipse.jem.internal.proxy.vm.remote.ClassHelper", "newInstance", new String[] {"java.lang.Class"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- return fClassNewInstance;
-}
-
-public IMethodProxy getClassGetField() {
- if (fClassGetField == null)
- fClassGetField = fRegistry.getMethodProxyFactory().getMethodProxy("java.lang.Class", "getField", new String[] {"java.lang.String"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- return fClassGetField;
-}
-
-public IMethodProxy getClassConstructor() {
- if (fClassGetConstructor == null)
- fClassGetConstructor = fRegistry.getMethodProxyFactory().getMethodProxy("java.lang.Class", "getConstructor", new String[] {"[Ljava.lang.Class;"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- return fClassGetConstructor;
-}
-
-public IMethodProxy getClassConstructors() {
- if (fClassGetConstructors == null)
- fClassGetConstructors = fRegistry.getMethodProxyFactory().getMethodProxy("java.lang.Class", "getConstructors", null); //$NON-NLS-1$ //$NON-NLS-2$
- return fClassGetConstructors;
-}
-
-public IMethodProxy getDeclaredClassConstructor() {
- if (fClassGetDeclaredConstructor == null)
- fClassGetDeclaredConstructor = fRegistry.getMethodProxyFactory().getMethodProxy("java.lang.Class", "getDeclaredConstructor", new String[] {"[Ljava.lang.Class;"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- return fClassGetDeclaredConstructor;
-}
-
-public IMethodProxy getDeclaredClassConstructors() {
- if (fClassGetDeclaredConstructors == null)
- fClassGetDeclaredConstructors = fRegistry.getMethodProxyFactory().getMethodProxy("java.lang.Class", "getDeclaredConstructors", null); //$NON-NLS-1$ //$NON-NLS-2$
- return fClassGetDeclaredConstructors;
-}
-
-public IMethodProxy getClassIsAssignableFrom() {
- if (fClassIsAssignableFrom == null)
- fClassIsAssignableFrom = fRegistry.getMethodProxyFactory().getMethodProxy("java.lang.Class", "isAssignableFrom", new String[] {"java.lang.Class"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- return fClassIsAssignableFrom;
-}
-
-public IMethodProxy getObjectToString() {
- if (fObjectToString == null)
- fObjectToString = fRegistry.getMethodProxyFactory().getMethodProxy("java.lang.Object", "toString", null); //$NON-NLS-1$ //$NON-NLS-2$
- return fObjectToString;
-}
-
-public IMethodProxy getObjectEquals() {
- if (fObjectEquals == null)
- fObjectEquals = fRegistry.getMethodProxyFactory().getMethodProxy("java.lang.Object", "equals", new String[] {"java.lang.Object"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- return fObjectEquals;
-}
-public IMethodProxy getThrowableLocalizedMessage() {
- if (fThrowableLocalizedMessage == null)
- fThrowableLocalizedMessage = fRegistry.getMethodProxyFactory().getMethodProxy("java.lang.Throwable", "getLocalizedMessage", null); //$NON-NLS-1$ //$NON-NLS-2$
- return fThrowableLocalizedMessage;
-}
-
-public IMethodProxy getThrowableMessage() {
- if (fThrowableMessage == null)
- fThrowableMessage = fRegistry.getMethodProxyFactory().getMethodProxy("java.lang.Throwable", "getMessage", null); //$NON-NLS-1$ //$NON-NLS-2$
- return fThrowableMessage;
-}
-
-public IMethodProxy getMethodDeclaringClassMessage() {
- if (fMethodDeclaringClassMessage == null)
- fMethodDeclaringClassMessage = fRegistry.getMethodProxyFactory().getMethodProxy("java.lang.reflect.Method", "getDeclaringClass", null); //$NON-NLS-1$ //$NON-NLS-2$
- return fMethodDeclaringClassMessage;
-}
-
-public IMethodProxy getMethodMethodNameMessage() {
- if (fMethodMethodNameMessage == null)
- fMethodMethodNameMessage = fRegistry.getMethodProxyFactory().getMethodProxy("java.lang.reflect.Method", "getName", null); //$NON-NLS-1$ //$NON-NLS-2$
- return fMethodMethodNameMessage;
-}
-
-public IMethodProxy getMethodParameterTypesMessage() {
- if (fMethodParameterTypesMessage == null)
- fMethodParameterTypesMessage = fRegistry.getMethodProxyFactory().getMethodProxy("java.lang.reflect.Method", "getParameterTypes", null); //$NON-NLS-1$ //$NON-NLS-2$
- return fMethodParameterTypesMessage;
-}
-
-public IMethodProxy getMethodReturnTypeMessage() {
- if (fMethodReturnTypeMessage == null)
- fMethodReturnTypeMessage = fRegistry.getMethodProxyFactory().getMethodProxy("java.lang.reflect.Method", "getReturnType", null); //$NON-NLS-1$ //$NON-NLS-2$
- return fMethodReturnTypeMessage;
-}
-
-public IMethodProxy getAccessibleIsAccessible() {
- if (fAccessibleIsAccessible == null)
- fAccessibleIsAccessible = fRegistry.getMethodProxyFactory().getMethodProxy("java.lang.reflect.AccessibleObject", "isAccessible", null); //$NON-NLS-1$ //$NON-NLS-2$
- return fAccessibleIsAccessible;
-}
-
-public IMethodProxy getAccessibleSetAccessible() {
- if (fAccessibleSetAccessible == null)
- fAccessibleSetAccessible = fRegistry.getMethodProxyFactory().getMethodProxy("java.lang.reflect.AccessibleObject", "setAccessible", new String[] {"boolean"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- return fAccessibleSetAccessible;
-}
-
-public IMethodProxy getFieldGetType() {
- if (fFieldGetType == null)
- fFieldGetType = fRegistry.getMethodProxyFactory().getMethodProxy("java.lang.reflect.Field", "getType", null); //$NON-NLS-1$ //$NON-NLS-2$
- return fFieldGetType;
-}
-
-public IMethodProxy getFieldGet() {
- if (fFieldGet == null)
- fFieldGet = fRegistry.getMethodProxyFactory().getMethodProxy("java.lang.reflect.Field", "get", new String[] {"java.lang.Object"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- return fFieldGet;
-}
-
-public IMethodProxy getFieldGetByte() {
- if (fFieldGetByte == null)
- fFieldGetByte = fRegistry.getMethodProxyFactory().getMethodProxy("java.lang.reflect.Field", "getByte", new String[] {"java.lang.Object"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- return fFieldGetByte;
-}
-
-public IMethodProxy getFieldGetBoolean() {
- if (fFieldGetBoolean == null)
- fFieldGetBoolean = fRegistry.getMethodProxyFactory().getMethodProxy("java.lang.reflect.Field", "getBoolean", new String[] {"java.lang.Object"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- return fFieldGetBoolean;
-}
-
-public IMethodProxy getFieldGetChar() {
- if (fFieldGetChar == null)
- fFieldGetChar = fRegistry.getMethodProxyFactory().getMethodProxy("java.lang.reflect.Field", "getChar", new String[] {"java.lang.Object"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- return fFieldGetChar;
-}
-
-public IMethodProxy getFieldGetDouble() {
- if (fFieldGetDouble == null)
- fFieldGetDouble = fRegistry.getMethodProxyFactory().getMethodProxy("java.lang.reflect.Field", "getDouble", new String[] {"java.lang.Object"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- return fFieldGetDouble;
-}
-
-public IMethodProxy getFieldGetFloat() {
- if (fFieldGetFloat == null)
- fFieldGetFloat = fRegistry.getMethodProxyFactory().getMethodProxy("java.lang.reflect.Field", "getFloat", new String[] {"java.lang.Object"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- return fFieldGetFloat;
-}
-
-public IMethodProxy getFieldGetInt() {
- if (fFieldGetInt == null)
- fFieldGetInt = fRegistry.getMethodProxyFactory().getMethodProxy("java.lang.reflect.Field", "getInt", new String[] {"java.lang.Object"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- return fFieldGetInt;
-}
-
-public IMethodProxy getFieldGetLong() {
- if (fFieldGetLong == null)
- fFieldGetLong = fRegistry.getMethodProxyFactory().getMethodProxy("java.lang.reflect.Field", "getLong", new String[] {"java.lang.Object"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- return fFieldGetLong;
-}
-
-public IMethodProxy getFieldGetShort() {
- if (fFieldGetShort == null)
- fFieldGetShort = fRegistry.getMethodProxyFactory().getMethodProxy("java.lang.reflect.Field", "getShort", new String[] {"java.lang.Object"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- return fFieldGetShort;
-}
-
-public IMethodProxy getFieldSet() {
- if (fFieldSet == null)
- fFieldSet = fRegistry.getMethodProxyFactory().getMethodProxy("java.lang.reflect.Field", "set", new String[] {"java.lang.Object", "java.lang.Object"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- return fFieldSet;
-}
-
-public IMethodProxy getConstructorNewInstance() {
- if (fConstructorNewInstance == null)
- fConstructorNewInstance = fRegistry.getMethodProxyFactory().getMethodProxy("java.lang.reflect.Constructor", "newInstance", new String[] {"[Ljava.lang.Object;"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- return fConstructorNewInstance;
-}
-
-public IMethodProxy getConstructorParameterTypesMessage() {
- if (fConstructorParameterTypesMessage == null)
- fConstructorParameterTypesMessage = fRegistry.getMethodProxyFactory().getMethodProxy("java.lang.reflect.Constructor", "getParameterTypes", null); //$NON-NLS-1$ //$NON-NLS-2$
- return fConstructorParameterTypesMessage;
-}
-
-public IMethodProxy getArrayNewInstanceOneDimension() {
- if (fArrayNewInstanceOneDimension == null)
- fArrayNewInstanceOneDimension = fRegistry.getMethodProxyFactory().getMethodProxy("java.lang.reflect.Array", "newInstance", new String[] {"java.lang.Class", "int"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- return fArrayNewInstanceOneDimension;
-}
-
-public IMethodProxy getArrayNewInstanceMultiDimension() {
- if (fArrayNewInstanceMultiDimensions == null)
- fArrayNewInstanceMultiDimensions = fRegistry.getMethodProxyFactory().getMethodProxy("java.lang.reflect.Array", "newInstance", new String[] {"java.lang.Class", "[I"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- return fArrayNewInstanceMultiDimensions;
-}
-
-public IMethodProxy getArrayGetLength() {
- if (fArrayGetLength == null)
- fArrayGetLength = fRegistry.getMethodProxyFactory().getMethodProxy("java.lang.reflect.Array", "getLength", new String[] {"java.lang.Object"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- return fArrayGetLength;
-}
-
-public IMethodProxy getArrayGet() {
- if (fArrayGet == null)
- fArrayGet = fRegistry.getMethodProxyFactory().getMethodProxy("java.lang.reflect.Array", "get", new String[] {"java.lang.Object", "int"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- return fArrayGet;
-}
-
-public IMethodProxy getArrayGetByte() {
- if (fArrayGetByte == null)
- fArrayGetByte = fRegistry.getMethodProxyFactory().getMethodProxy("java.lang.reflect.Array", "getByte", new String[] {"java.lang.Object", "int"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- return fArrayGetByte;
-}
-
-public IMethodProxy getArrayGetBoolean() {
- if (fArrayGetBoolean == null)
- fArrayGetBoolean = fRegistry.getMethodProxyFactory().getMethodProxy("java.lang.reflect.Array", "getBoolean", new String[] {"java.lang.Object", "int"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- return fArrayGetBoolean;
-}
-
-public IMethodProxy getArrayGetChar() {
- if (fArrayGetChar == null)
- fArrayGetChar = fRegistry.getMethodProxyFactory().getMethodProxy("java.lang.reflect.Array", "getChar", new String[] {"java.lang.Object", "int"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- return fArrayGetChar;
-}
-
-public IMethodProxy getArrayGetDouble() {
- if (fArrayGetDouble == null)
- fArrayGetDouble = fRegistry.getMethodProxyFactory().getMethodProxy("java.lang.reflect.Array", "getDouble", new String[] {"java.lang.Object", "int"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- return fArrayGetDouble;
-}
-
-public IMethodProxy getArrayGetFloat() {
- if (fArrayGetFloat == null)
- fArrayGetFloat = fRegistry.getMethodProxyFactory().getMethodProxy("java.lang.reflect.Array", "getFloat", new String[] {"java.lang.Object", "int"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- return fArrayGetFloat;
-}
-
-public IMethodProxy getArrayGetInt() {
- if (fArrayGetInt == null)
- fArrayGetInt = fRegistry.getMethodProxyFactory().getMethodProxy("java.lang.reflect.Array", "getInt", new String[] {"java.lang.Object", "int"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- return fArrayGetInt;
-}
-
-public IMethodProxy getArrayGetLong() {
- if (fArrayGetLong == null)
- fArrayGetLong = fRegistry.getMethodProxyFactory().getMethodProxy("java.lang.reflect.Array", "getLong", new String[] {"java.lang.Object", "int"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- return fArrayGetLong;
-}
-
-public IMethodProxy getArrayGetShort() {
- if (fArrayGetShort == null)
- fArrayGetShort = fRegistry.getMethodProxyFactory().getMethodProxy("java.lang.reflect.Array", "getShort", new String[] {"java.lang.Object", "int"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- return fArrayGetShort;
-}
-
-public IMethodProxy getArraySet() {
- if (fArraySet == null)
- fArraySet = fRegistry.getMethodProxyFactory().getMethodProxy("java.lang.reflect.Array", "set", new String[] {"java.lang.Object", "int", "java.lang.Object"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
- return fArraySet;
-}
-
-public IMethodProxy getArrayHelperGet() {
- if (fArrayHelperGet == null)
- fArrayHelperGet = fRegistry.getMethodProxyFactory().getMethodProxy("org.eclipse.jem.internal.proxy.vm.remote.ArrayHelper", "get", new String[] {"java.lang.Object", "[I"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- return fArrayHelperGet;
-}
-
-public IMethodProxy getArrayHelperGetByte() {
- if (fArrayHelperGetByte == null)
- fArrayHelperGetByte = fRegistry.getMethodProxyFactory().getMethodProxy("org.eclipse.jem.internal.proxy.vm.remote.ArrayHelper", "getByte", new String[] {"java.lang.Object", "[I"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- return fArrayHelperGetByte;
-}
-
-public IMethodProxy getArrayHelperGetBoolean() {
- if (fArrayHelperGetBoolean == null)
- fArrayHelperGetBoolean = fRegistry.getMethodProxyFactory().getMethodProxy("org.eclipse.jem.internal.proxy.vm.remote.ArrayHelper", "getBoolean", new String[] {"java.lang.Object", "[I"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- return fArrayHelperGetBoolean;
-}
-
-public IMethodProxy getArrayHelperGetChar() {
- if (fArrayHelperGetChar == null)
- fArrayHelperGetChar = fRegistry.getMethodProxyFactory().getMethodProxy("org.eclipse.jem.internal.proxy.vm.remote.ArrayHelper", "getChar", new String[] {"java.lang.Object", "[I"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- return fArrayHelperGetChar;
-}
-
-public IMethodProxy getArrayHelperGetDouble() {
- if (fArrayHelperGetDouble == null)
- fArrayHelperGetDouble = fRegistry.getMethodProxyFactory().getMethodProxy("org.eclipse.jem.internal.proxy.vm.remote.ArrayHelper", "getDouble", new String[] {"java.lang.Object", "[I"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- return fArrayHelperGetDouble;
-}
-
-public IMethodProxy getArrayHelperGetFloat() {
- if (fArrayHelperGetFloat == null)
- fArrayHelperGetFloat = fRegistry.getMethodProxyFactory().getMethodProxy("org.eclipse.jem.internal.proxy.vm.remote.ArrayHelper", "getFloat", new String[] {"java.lang.Object", "[I"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- return fArrayHelperGetFloat;
-}
-
-public IMethodProxy getArrayHelperGetInt() {
- if (fArrayHelperGetInt == null)
- fArrayHelperGetInt = fRegistry.getMethodProxyFactory().getMethodProxy("org.eclipse.jem.internal.proxy.vm.remote.ArrayHelper", "getInt", new String[] {"java.lang.Object", "[I"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- return fArrayHelperGetInt;
-}
-
-public IMethodProxy getArrayHelperGetLong() {
- if (fArrayHelperGetLong == null)
- fArrayHelperGetLong = fRegistry.getMethodProxyFactory().getMethodProxy("org.eclipse.jem.internal.proxy.vm.remote.ArrayHelper", "getLong", new String[] {"java.lang.Object", "[I"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- return fArrayHelperGetLong;
-}
-
-public IMethodProxy getArrayHelperGetShort() {
- if (fArrayHelperGetShort == null)
- fArrayHelperGetShort = fRegistry.getMethodProxyFactory().getMethodProxy("org.eclipse.jem.internal.proxy.vm.remote.ArrayHelper", "getShort", new String[] {"java.lang.Object", "[I"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- return fArrayHelperGetShort;
-}
-
-public IMethodProxy getArrayHelperSet() {
- if (fArrayHelperSet == null)
- fArrayHelperSet = fRegistry.getMethodProxyFactory().getMethodProxy("org.eclipse.jem.internal.proxy.vm.remote.ArrayHelper", "set", new String[] {"java.lang.Object", "[I", "java.lang.Object"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
- return fArrayHelperSet;
-}
-
-public IMethodProxy getArrayHelperEquals() {
- if (fArrayHelperEquals == null)
- fArrayHelperEquals = fRegistry.getMethodProxyFactory().getMethodProxy("org.eclipse.jem.internal.proxy.vm.remote.ArrayHelper", "equals", new String[] {"java.lang.Object", "java.lang.Object"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- return fArrayHelperEquals;
-}
-
-public IMethodProxy getClassGetDeclaredField() {
-
- if (fClassGetDeclaredField == null)
- fClassGetDeclaredField = fRegistry.getMethodProxyFactory().getMethodProxy("java.lang.Class", "getDeclaredField", new String[] {"java.lang.String"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- return fClassGetDeclaredField;
-}
-
-public IMethodProxy getClassGetDeclaredFields() {
-
- if (fClassGetDeclaredFields == null)
- fClassGetDeclaredFields = fRegistry.getMethodProxyFactory().getMethodProxy("java.lang.Class", "getDeclaredFields", null); //$NON-NLS-1$ //$NON-NLS-2$
- return fClassGetDeclaredFields;
-}
-public IMethodProxy getClassGetFields() {
-
- if (fClassGetFields == null)
- fClassGetFields = fRegistry.getMethodProxyFactory().getMethodProxy("java.lang.Class", "getFields", null); //$NON-NLS-1$ //$NON-NLS-2$
- return fClassGetFields;
-}
-
-
-/**
- * @return
- *
- * @since 1.1.0
- */
-public IMethodProxy getClassMethods() {
- if (fClassGetMethods == null)
- fClassGetMethods = fRegistry.getMethodProxyFactory().getMethodProxy("java.lang.Class", "getMethods", null); //$NON-NLS-1$ //$NON-NLS-2$
- return fClassGetMethods;
-}
-
-/**
- * @return
- *
- * @since 1.1.0
- */
-public IMethodProxy getClassDeclaredMethods() {
- if (fClassGetDeclaredMethods == null)
- fClassGetDeclaredMethods = fRegistry.getMethodProxyFactory().getMethodProxy("java.lang.Class", "getDeclaredMethods", null); //$NON-NLS-1$ //$NON-NLS-2$
- return fClassGetDeclaredMethods;
-}
-
-public IMethodProxy getClassDeclaredMethod() {
- if (fClassGetDeclaredMethod == null)
- fClassGetDeclaredMethod = fRegistry.getMethodProxyFactory().getMethodProxy("java.lang.Class", "getDeclaredMethod", new String[] {"java.lang.String", "[Ljava.lang.Class;"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- return fClassGetDeclaredMethod;
-}
-
-public IMethodProxy getFindCompatibleConstructorMethod() {
- if (fMethodHelperFindCompatibleConstructor == null)
- fMethodHelperFindCompatibleConstructor = fRegistry.getMethodProxyFactory().getMethodProxy("org.eclipse.jem.internal.proxy.common.MethodHelper", "findCompatibleConstructor", new String[] {"java.lang.Class", "[Ljava.lang.Class;"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- return fMethodHelperFindCompatibleConstructor;
-}
-
-public IMethodProxy getFindCompatibleMethodMethod() {
- if (fMethodHelperFindCompatibleMethod == null)
- fMethodHelperFindCompatibleMethod = fRegistry.getMethodProxyFactory().getMethodProxy("org.eclipse.jem.internal.proxy.common.MethodHelper", "findCompatibleMethod", new String[] {"java.lang.Class", "java.lang.String", "[Ljava.lang.Class;"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
- return fMethodHelperFindCompatibleMethod;
-}
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMStandardBeanProxyFactory.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMStandardBeanProxyFactory.java
deleted file mode 100644
index bd04d7dd2..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMStandardBeanProxyFactory.java
+++ /dev/null
@@ -1,854 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-
-import java.text.MessageFormat;
-import java.util.*;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jem.internal.proxy.core.*;
-import org.eclipse.jem.internal.proxy.common.CommandException;
-import org.eclipse.jem.internal.proxy.common.remote.CommandErrorException;
-import org.eclipse.jem.internal.proxy.common.remote.Commands;
-
-/**
- * The Remote VM Standard Bean Proxy Factory.
- * Creation date: (12/3/99 12:01:45 PM)
- * @author: Joe Winchester
- */
-public final class REMStandardBeanProxyFactory implements IStandardBeanProxyFactory {
- protected final REMProxyFactoryRegistry fRegistry;
- protected final REMStandardBeanTypeProxyFactory fBeanTypeProxyFactory; // Convenience field.
- protected final IREMBeanProxy vmServerProxy;
-
-
- // We need a map for mapping object id's to the proxy. The entry will actually be
- // a REMStandardBeanProxyFactory.WeakProxyReference. This is so that the
- // proxy will not be held tightly by this map and can be GC'd if not referenced.
- // Periodically, the reference queue will be processed to remove any of the
- // entries that have been GC'd and the server will be told that it can release
- // the ID on its side.
- //
- // This map will be used as synchronize object also for access to it.
- //
- // There will be a low priority job that will occasionally process the GC'd objects
- // and remove them from the queue and the remote vm. It will not remove during lockedTransactions.
- //
- // NOTE: Certain proxies never get added to the map. They are the
- // standard types/class (i.e. null, byte, int, long, short, double, float, byte, string). These
- // always have the value saved in the proxy so that it can be retrieved without going back
- // to the server.
- private final HashMap fIDToProxiesMap = new HashMap(1000); // Map ID's to proxies. The proxies have their id's so we don't need a reverse map
- private int transactionLockCount = 0; // Count of transactions that have locked access. It is changed under sync control of fIDToProxies map.
-
- /**
- * The Weak reference used for the id to proxies map for the proxy
- * so that we can clean it up when the proxy has been garbage collected.
- *
- * It is important that all changes to the ProxyRef are done through sync on fIDToProxiesMap.
- */
- private static class ProxyRef extends java.lang.ref.WeakReference {
- private Integer id; // We need the id because this reference will be on the value side
- // and not the key side of the map, so we need to know the key
- // so that the object can be removed from the map.
- //
- // If the ID is null, then this means this entry has been processed
- // in some way and should not be released or removed from the table.
- private int useCnt = 1; // Usage/Ref count. Needed so that we don't get rid of too soon. Since we don't
- // create a ProxyRef without a usage, we start it off with one. It will be incremented
- // then on retrievals when needed by users outside of the remote factories themselves.
- // It won't be physically released until either GC got rid of it, or it goes to 0 or less
- // on a release request.
-
- public ProxyRef(Integer anID, Object proxy, java.lang.ref.ReferenceQueue q) {
- super(proxy, q);
- id = anID;
- }
-
- public Integer getID() {
- return id;
- }
-
- public void clear() {
- super.clear();
- id = null;
- }
-
- public synchronized int useCnt() {
- return useCnt;
- }
-
- public synchronized void incrUseCnt() {
- useCnt++;
- }
-
- public synchronized int decrUseCnt() {
- if (--useCnt < 0)
- useCnt = 0;
- return useCnt;
- }
- }
-
- /* Reference queue for cleared Proxies */
- private java.lang.ref.ReferenceQueue queue = new java.lang.ref.ReferenceQueue();
-
- /**
- * Process the entries on the id to proxies map that have been garbage collected.
- * It is package-protected because only REMRegistryController should call it.
- */
- void processQueue() {
- ProxyRef pr;
- while (true) {
- if (Thread.interrupted())
- return; // Maybe going down. (This actually a kludge because the thread happens to be the master thread from the registry controller).
-
- synchronized (fIDToProxiesMap) {
- if (queue == null || transactionLockCount > 0)
- break; // Either no queue (we are cleaning up) or in a transaction, stop processing and retry on next time slice.
- if ((pr = (ProxyRef) queue.poll()) != null) {
- if (pr.getID() != null) {
- // It hasn't been processed by some other means.
- fIDToProxiesMap.remove(pr.getID());
- releaseID(pr.getID().intValue());
- }
- } else
- break; // There are no more waiting, so leave.
- }
- }
- }
-
-
-/**
- * REMBeanProxyFactory constructor comment.
- *
- * Note: It assumes the beantype factory has already been registered.
- */
-REMStandardBeanProxyFactory(REMProxyFactoryRegistry aRegistry) {
- fRegistry = aRegistry;
- aRegistry.registerBeanProxyFactory(this);
- fBeanTypeProxyFactory = (REMStandardBeanTypeProxyFactory) aRegistry.getBeanTypeProxyFactory();
- fBeanTypeProxyFactory.initialize(this); // Now we're ready for the beantype factory to be initialized.
-
- IREMBeanTypeProxy serverType = fBeanTypeProxyFactory.objectClass.newBeanTypeForClass(new Integer(Commands.REMOTEVMSERVER_CLASS), "org.eclipse.jem.internal.proxy.vm.remote.RemoteVMServerThread", false); //$NON-NLS-1$
- fBeanTypeProxyFactory.registerBeanTypeProxy(serverType, true);
- vmServerProxy = serverType.newBeanProxy(new Integer(Commands.REMOTESERVER_ID));
- registerProxy(vmServerProxy);
-}
-
-
-/**
- * Register a collection of Proxies
- */
-public void registerProxies(Collection proxies) {
- synchronized(fIDToProxiesMap) {
- Iterator itr = proxies.iterator();
- while (itr.hasNext()) {
- IREMBeanProxy proxy = (IREMBeanProxy) itr.next();
- if (proxy instanceof IBeanTypeProxy || !(proxy.getTypeProxy() instanceof IREMConstantBeanTypeProxy)) {
- ProxyRef oldRef = (ProxyRef) fIDToProxiesMap.put(proxy.getID(), new ProxyRef(proxy.getID(), proxy, queue));
- if (oldRef != null) {
- // We've replaced it with a new one, so we will clear out the ref so that it won't later try to remove itself
- oldRef.clear();
- }
- }
- }
- }
-}
-
-/**
- * Register a single proxy
- */
-public void registerProxy(IREMBeanProxy proxy) {
- if (proxy instanceof IBeanTypeProxy || !(proxy.getTypeProxy() instanceof IREMConstantBeanTypeProxy))
- synchronized(fIDToProxiesMap) {
- ProxyRef oldRef = (ProxyRef) fIDToProxiesMap.put(proxy.getID(), new ProxyRef(proxy.getID(), proxy, queue));
- if (oldRef != null) {
- // We've replaced it with a new one, so we will clear out the ref so that it won't later try to remove itself
- oldRef.clear();
- }
- }
-}
-
-/**
- * Release a proxy because no longer needed.
- */
-public void releaseProxy(IBeanProxy proxy) {
- if (!proxy.isValid())
- return;
- if (proxy instanceof IBeanTypeProxy && !fBeanTypeProxyFactory.releaseProxy((IBeanTypeProxy) proxy))
- return; // BeanType and type factory won't allow release of it.
- Integer id = ((IREMBeanProxy) proxy).getID();
- synchronized(fIDToProxiesMap) {
- // Synced in here so that we will remove it before some one else from a different thread may try
- // to access it again.
- if (id.intValue() != Commands.NOT_AN_ID) {
- ProxyRef ref = (ProxyRef) fIDToProxiesMap.get(id);
- if (ref == null || ref.decrUseCnt() <= 0) {
- // No usage, so do actual release.
- fIDToProxiesMap.remove(id);
- ((IREMBeanProxy) proxy).release();
- if (ref != null)
- ref.enqueue(); // Queue it up so that on next release cycle it will go away.
- }
- } else {
- ((IREMBeanProxy) proxy).release();
- }
- }
-}
-
-/**
- * Release a specific ID. This is used in case an ID has been sent
- * but we couldn't proxy it. In that case we only have an ID. It is
- * also used when a proxy has been released explicitly or through GC.
- * In that case it has already been de-registered.
- */
-private void releaseID(int anID) {
- try {
- IREMConnection connect = fRegistry.getFreeConnection();
- try {
- connect.releaseID(anID);
- } finally {
- fRegistry.returnConnection(connect);
- }
- } catch (IllegalStateException e) {
- // Couldn't get connection, don't bother with a release.
- }
-}
-
-/**
- * For the Remote Factory we will create an REMBeanProxy using the null constructor
- * Package protected so only REMBeanTypeProxies can create instances.
- */
-
-IBeanProxy createBeanProxy(IREMBeanTypeProxy aTypeProxy) throws ThrowableProxy {
- return REMStandardBeanProxyConstants.getConstants(fRegistry).getClassNewInstance().invoke(null, aTypeProxy);
-}
-
-/**
- * For the Remote Factory we will create a REMBeanProxy using the initializationString.
- * Package protected so only REMBeanTypeProxies can create instances.
- */
-IBeanProxy createBeanProxy(IREMBeanTypeProxy aTypeProxy, String initializationString)
- throws ThrowableProxy, CommandException, ClassCastException, InstantiationException, IllegalStateException {
- IREMConnection connect = fRegistry.getFreeConnection();
- startTransaction();
- // Starting a transaction, we will be getting id's back and need to get data in a separate step, so we need to group it in a transaction.
- try {
- Commands.ValueObject newInstanceData = null;
- try {
- newInstanceData = getNewInstanceData(aTypeProxy, initializationString, connect);
- } catch (CommandErrorException e) {
- switch (e.getErrorCode()) {
- case Commands.CLASS_CAST_EXCEPTION:
- // The result was not of the correct type.
- throw new ClassCastException(
- MessageFormat.format(ProxyRemoteMessages.Classcast_EXC_, new Object[] {extractFirstLine(initializationString), aTypeProxy.getTypeName()}));
- case Commands.CANNOT_EVALUATE_STRING:
- // Want to log the exception that caused it to not evaluate.
- // Don't need to log this side, just log the RemoteVM side of the trace.
- java.io.StringWriter s = new java.io.StringWriter();
- java.io.PrintWriter w = new java.io.PrintWriter(s);
- ((ThrowableProxy) e.getErrorObject()).printProxyStackTrace(w);
- ProxyPlugin.getPlugin().getLogger().log(new Status(IStatus.WARNING, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, s.toString(), null));
- throw new InstantiationException(
- MessageFormat.format(ProxyRemoteMessages.Instantiate_EXC_, new Object[] {extractFirstLine(initializationString)}));
- default:
- throw e; //$NON-NLS-1$
- }
- } catch (CommandException e) {
- if (e.isRecoverable()) {
- ProxyPlugin.getPlugin().getLogger().log(
- new Status(
- IStatus.WARNING,
- ProxyPlugin.getPlugin().getBundle().getSymbolicName(),
- 0,
- "", //$NON-NLS-1$
- e));
- } else {
- // It failed in the command, try again.
- fRegistry.closeConnection(connect);
- connect = null;
- connect = fRegistry.getFreeConnection();
- try {
- newInstanceData = getNewInstanceData(aTypeProxy, initializationString, connect);
- } catch (CommandException eAgain) {
- // It failed again. Close this connection and don't let it be returned.
- fRegistry.closeConnection(connect);
- connect = null; // This is so that it won't be returned.
- }
- }
- } finally {
- if (connect != null)
- fRegistry.returnConnection(connect);
- }
-
- if (newInstanceData != null)
- return getBeanProxy(newInstanceData); // Turn it into a proxy
- } finally {
- stopTransaction(); // Now we can release the transaction.
- }
-
-return null;
-}
-
-private String extractFirstLine(String initString) {
- // Need to extract the first line for the messageFormat not to barf.
- int cr = initString.indexOf('\r');
- int lf = initString.indexOf('\n');
- if (cr != -1 || lf != -1) {
- if (cr == -1 || (lf != -1 && lf < cr))
- return initString.substring(0, lf);
- else
- return initString.substring(0, cr);
- } else
- return initString;
-}
-
-
-/**
- * actually create it using a passed in connection. This allows retry capability.
- *
- * This will send the request over to the connection.
- *
- * If we get an OBJECT back, then the beantypeproxy that the classID in the
- * value points to must be of type IREMConstantBeanTypeProxy so that we can
- * send this new object to the correct beantype to create the correct proxy.
- *
- * If we get an OBJECT_ID back, then the beantypeproxy that the classID in
- * the value points to must be able to handle creating a proxy of that type.
- */
-private Commands.ValueObject getNewInstanceData(IREMBeanTypeProxy aTypeProxy, String initializationString, IREMConnection connect) throws ThrowableProxy, CommandException {
- try {
- Commands.ValueObject newInstanceData = new Commands.ValueObject();
- connect.getNewInstance(aTypeProxy.getID().intValue(), initializationString, newInstanceData);
- return newInstanceData;
- } catch (CommandErrorException e) {
- // TBD - Needs to handle error of not evaluatable and send over to the compilor.
- processErrorReturn(e); // Process this
- }
- return null;
-}
-
-/**
- * actually create it using a passed in connection. This allows retry capability.
- */
-private void getObjectInstanceData(IREMConnection connect, int objectID, Commands.ValueObject valueReturn) throws ThrowableProxy, CommandException {
- try {
- connect.getObjectData(objectID, valueReturn);
- } catch (CommandErrorException e) {
- processErrorReturn(e); // Process this
- }
-}
-
-/**
- * Get a bean proxy from the value object passed in. If not yet created, create one.
- * NOTE: NULL type actually returns a true null. This is so that if people are casting
- * the returned proxy to a specific type (e.g IIntegerBeanProxy), then they won't get
- * a ClassCastException, they will get a null. This is easier for them to handle.
- *
- * NOTE: This is public ONLY so that extension factories can create correct types of
- * proxies in consistent manner from a value object.
- *
- * It is important that this is called
- * from within a transaction only because otherwise the value could have invalid data
- * by the time we try to get the data out of it.
- */
-public IBeanProxy getBeanProxy(Commands.ValueObject value) throws ThrowableProxy, CommandException {
- switch (value.type) {
- // Null result.
- case (byte) Commands.VOID_TYPE:
- return null;
- // A constant object was received.
- case Commands.OBJECT:
- IREMConstantBeanTypeProxy constantBeanType = null;
- try {
- constantBeanType = (IREMConstantBeanTypeProxy) getBeanType(value.classID);
- if (constantBeanType == null)
- return null; // Cannot find the type to create it.
- } catch (ClassCastException e) {
- // It wasn't a constant type, so we can't create it. Return null.
- ProxyPlugin.getPlugin().getLogger().log(new Status(IStatus.WARNING, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "", e)); //$NON-NLS-1$
- return null;
- }
-
- return constantBeanType.newBeanProxy(value);
-
- // An existing object_id was returned, the object should exist. If it doesn't
- // then submit the info command to try to recreate it correctly.
- case Commands.OBJECT_ID:
- Integer objectID = new Integer(value.objectID);
- IBeanProxy proxy = retrieveProxy(objectID, true);
- if (proxy != null)
- return proxy;
-
- // Not found, need to try to recreate it.
- IREMConnection connect = fRegistry.getFreeConnection();
- try {
- getObjectInstanceData(connect, value.objectID, value); // Go and get the data
- } catch (CommandErrorException e) {
- if (e.isRecoverable()) {
- ProxyPlugin.getPlugin().getLogger().log(
- new Status(
- IStatus.WARNING,
- ProxyPlugin.getPlugin().getBundle().getSymbolicName(),
- 0,
- "", //$NON-NLS-1$
- e));
- return null;
- } else {
- // Try one more time.
- fRegistry.closeConnection(connect);
- connect = null;
- connect = fRegistry.getFreeConnection();
- try {
- getObjectInstanceData(connect, value.objectID, value); // Go and get the data
- } catch (CommandErrorException eAgain) {
- fRegistry.closeConnection(connect);
- connect = null;
- throw eAgain;
- }
- }
- } finally {
- if (connect != null)
- fRegistry.returnConnection(connect);
- }
-
- return getBeanProxy(value); // Now process it to create the new data.
-
- // An new object id. Need to get the class type and let it create it.
- case Commands.NEW_OBJECT_ID:
- try {
- IREMBeanTypeProxy newBeanType = getBeanType(value.classID);
- IREMBeanProxy newProxy = newBeanType.newBeanProxy(new Integer(value.objectID));
- if (newProxy != null)
- registerProxy(newProxy);
- return newProxy;
- } catch (CommandException e) {
- // The server has created a new object, but we couldn't create/register a proxy for it.
- // We need to release it so that the server can get rid of it. Otherwise it would hang
- // around over there forever.
- releaseID(value.objectID);
- throw e;
- } catch (RuntimeException e) {
- // The server has created a new object, but we couldn't create/register a proxy for it.
- // We need to release it so that the server can get rid of it. Otherwise it would hang
- // around over there forever.
- releaseID(value.objectID);
- throw e;
- }
-
- // An exception was thrown, create the ThrowableProxy and then throw it.
- case Commands.THROW:
- IREMBeanProxy newThrowProxy = null;
- try {
- IREMBeanTypeProxy newThrowType = getBeanType(value.classID);
- newThrowProxy = newThrowType.newBeanProxy(new Integer(value.objectID));
- if (newThrowProxy != null)
- registerProxy(newThrowProxy);
- } catch (CommandException e) {
- // The server has created a new object, but we couldn't create/register a proxy for it.
- // We need to release it so that the server can get rid of it. Otherwise it would hang
- // around over there forever.
- releaseID(value.objectID);
- throw e;
- } catch (RuntimeException e) {
- // The server has created a new object, but we couldn't create/register a proxy for it.
- // We need to release it so that the server can get rid of it. Otherwise it would hang
- // around over there forever.
- releaseID(value.objectID);
- throw e;
- }
- // It really should be a throwable, but if not, just return it.
- if (newThrowProxy instanceof ThrowableProxy)
- throw (ThrowableProxy) newThrowProxy;
- else
- return newThrowProxy;
-
- // It is one of the standard kinds, which are Constant types
- default:
- IREMConstantBeanTypeProxy standardBeanType = null;
- try {
- standardBeanType = (IREMConstantBeanTypeProxy) getBeanType(value.type);
- if (standardBeanType == null)
- return null; // Cannot find the type to create it.
- } catch (ClassCastException e) {
- // It wasn't a standard type, so we can't create it. Return null.
- ProxyPlugin.getPlugin().getLogger().log(new Status(IStatus.WARNING, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "", e)); //$NON-NLS-1$
- return null;
- }
- return standardBeanType.newBeanProxy(value);
- }
-}
-
-/**
- * Process the error exception. Get the data from it and turn it into proxy data.
- * If it is a THROW, then it will throw the Throwable instead.
- *
- * NOTE: It is public ONLY so that extension factories can process errors in
- * an consistent manner.
- *
- * It is important that this be called only within a transaction.
- */
-public void processErrorReturn(CommandErrorException e) throws CommandException, ThrowableProxy {
- int code = e.getErrorCode();
- Object data = null;
- if (code == Commands.THROWABLE_SENT)
- data = getBeanProxy(e.getValue()); // It is Throw sent, so let the throw from getBeanProxy continue on out. (But as a safety, we still try to get the data.
- else {
- try {
- data = getBeanProxy(e.getValue());
- } catch (ThrowableProxy t) {
- // But we want to keep throwables in this case. They are just data for the command error.
- data = t;
- }
- }
- throw new CommandErrorException(MessageFormat.format(ProxyRemoteMessages.RemoteCmd_EXC_, new Object[] {new Integer(code)}), code, e.getValue(), data); // Create a new one and throw it containing the proxied data. //$NON-NLS-1$
-}
-
-
-/**
- * Get a beantype where the id passed in is the classID of the beantype.
- * If not found, then go get it loaded. If it can't be found, then we will
- * release the id because it means we have an id from the server, but we
- * can't create a proxy for it, so don't keep the server holding it.
- * NOTE: This is public ONLY so that extension factories can create correct types
- * in a consistent manner from the id.
- *
- * It is important that this be called only from within a transaction.
- */
-public IREMBeanTypeProxy getBeanType(int id) throws CommandException {
- IREMBeanTypeProxy beanType = null;
- try {
- Integer classID = new Integer(id);
- beanType = (IREMBeanTypeProxy) retrieveProxy(classID, false);
- if (beanType == null)
- beanType = fBeanTypeProxyFactory.createBeanTypeProxy(classID); // We don't have it, need to go to the factory so that it can go query what it needs
- if (beanType == null)
- return null; // Cannot find the type to create it.
- } catch (ClassCastException e) {
- // It wasn't a bean type, so we can't create it. Return null.
- ProxyPlugin.getPlugin().getLogger().log(new Status(IStatus.WARNING, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "", e)); //$NON-NLS-1$
- } finally {
- if (beanType == null)
- releaseID(id); // Couldn't create a proxy, so release the id.
- }
- return beanType;
-}
-
-
-/**
- * Return a proxy wrapping the primitive integer
- */
-public IIntegerBeanProxy createBeanProxyWith(int aPrimitiveInteger) {
-
- return fBeanTypeProxyFactory.intType.createIntegerBeanProxy(aPrimitiveInteger);
-}
-
-/**
- * Return a proxy wrapping the primitive byte
- */
-public INumberBeanProxy createBeanProxyWith(byte aPrimitiveByte) {
-
- return fBeanTypeProxyFactory.byteType.createByteBeanProxy(aPrimitiveByte);
-}
-
-/**
- * Return a proxy wrapping the primitive char
- */
-public ICharacterBeanProxy createBeanProxyWith(char aPrimitiveChar) {
-
- return fBeanTypeProxyFactory.charType.createCharacterBeanProxy(aPrimitiveChar);
-}
-
-/**
- * Return a proxy wrapping the primitive short
- */
-public INumberBeanProxy createBeanProxyWith(short aPrimitiveShort) {
-
- return fBeanTypeProxyFactory.shortType.createShortBeanProxy(aPrimitiveShort);
-}
-
-/**
- * Return a proxy wrapping the primitive long
- */
-public INumberBeanProxy createBeanProxyWith(long aPrimitiveLong) {
-
- return fBeanTypeProxyFactory.longType.createLongBeanProxy(aPrimitiveLong);
-}
-/**
- * Return a proxy wrapping the primitive double
- */
-public INumberBeanProxy createBeanProxyWith(double aPrimitiveDouble) {
-
- return fBeanTypeProxyFactory.doubleType.createDoubleBeanProxy(aPrimitiveDouble);
-}
-/**
- * Return a proxy wrapping the primitive float
- */
-public INumberBeanProxy createBeanProxyWith(float aPrimitiveFloat) {
-
- return fBeanTypeProxyFactory.floatType.createFloatBeanProxy(aPrimitiveFloat);
-}
-
-/**
- * createBeanProxyWith method comment.
- */
-public IBooleanBeanProxy createBeanProxyWith(Boolean aBoolean) {
- return fBeanTypeProxyFactory.booleanClass.createBooleanBeanProxy(aBoolean);
-}
-/**
- * Return a proxy that wraps the Integer argument
- */
-public IIntegerBeanProxy createBeanProxyWith(Integer anInteger) {
-
- return fBeanTypeProxyFactory.integerClass.createIntegerBeanProxy(anInteger);
-}
-/**
- * createBeanProxyWith method comment.
- */
-public INumberBeanProxy createBeanProxyWith(Number aNumber) {
- REMAbstractNumberBeanTypeProxy type = (REMAbstractNumberBeanTypeProxy) fBeanTypeProxyFactory.getBeanTypeProxy(aNumber.getClass().getName());
- return type.createNumberBeanProxy(aNumber);
-}
-/**
- * Return a proxy for the argument
- */
-public IStringBeanProxy createBeanProxyWith(String aString) {
-
- return fBeanTypeProxyFactory.stringClass.createStringBeanProxy(aString);
-
-}
-/**
- * Return a proxy for the argument
- */
-public ICharacterBeanProxy createBeanProxyWith(Character aCharacter) {
-
- return fBeanTypeProxyFactory.characterClass.createCharacterBeanProxy(aCharacter);
-
-}
-/**
- * createBeanProxyWith method comment.
- */
-public IBooleanBeanProxy createBeanProxyWith(boolean aPrimitiveBoolean) {
- return fBeanTypeProxyFactory.booleanType.createBooleanBeanProxy(aPrimitiveBoolean);
-}
-
-/**
- * Create an array bean proxy.
- *
- * - (int, new int[2] {3, 4}) will create:
- * int [3] [4]
- *
- * - (int[], new int[1] {1})
- * int [1]
- *
- * - (int[], new int[2] {2,3})
- * int [2] [3]
- *
- *
- * - (int[], null) or (int[], new int[0]) or (int, null) or (int, new int[0])
- * int [0]...
- * or
- * (int[][]..., null) or (int[][]..., new int[0])
- * int[0][]...
- * This is because an array instance with no specified dimensions is not valid.
- *
- * - (int[][], new int[1] {3})
- * int[3][]
- */
-public IArrayBeanProxy createBeanProxyWith(IBeanTypeProxy type, int[] dimensions) throws ThrowableProxy {
- if (type.isArray())
- return ((REMArrayBeanTypeProxy) type).createBeanProxyWith(dimensions); // Already an array type, just pass it on.
- else {
- // It is not an array type, so we need to get an array of this type and dimensions.
- REMArrayBeanTypeProxy arrayType = (REMArrayBeanTypeProxy) fBeanTypeProxyFactory.getBeanTypeProxy(type.getTypeName(), dimensions.length);
- return arrayType.createBeanProxyWith(dimensions);
- }
-}
-/**
- * Create a one-dimensional array.
- * The result will be the same as calling
- * createBeanProxyWith(IBeanTypeProxy type, new int[1] {x})
- * where 'x' is the value passed in as the dimension.
- */
-public IArrayBeanProxy createBeanProxyWith(IBeanTypeProxy type, int dimension) throws ThrowableProxy {
- return createBeanProxyWith(type, new int[] {dimension});
-}
-
-/**
- * Retrieve the proxy from the mapping table. Handle already GC'd.
- * If this returns null, it is important that the caller tries to recreate
- * it since the id is still valid on the server.
- */
-private IBeanProxy retrieveProxy(Integer objectID, boolean incrementUseCnt) {
- synchronized (fIDToProxiesMap) {
- ProxyRef ref = (ProxyRef) fIDToProxiesMap.get(objectID);
- if (ref != null) {
- Object bp = ref.get();
- if (ref.isEnqueued() || bp == null) {
- // It's waiting to be removed, or has been removed. i.e. GC'd, so just remove it from the map, next processQueue will remove it from the queue.
- fIDToProxiesMap.remove(objectID);
- ref.clear(); // This is so that when the processQueue see's it,
- // it won't send a release request to the server
- // since it will be recreated when this method returns.
- return null;
- } else {
- if (incrementUseCnt)
- ref.incrUseCnt();
- return (IBeanProxy) bp;
- }
- } else
- return null;
- }
-}
-
-/**
- * Start Transaction: During the time between start/stop transaction,
- * proxies will not be cleaned up. This prevents the case of a two step
- * transaction where the returned ID from the remote vm is for a proxy
- * that is about to be cleaned up, and then having that proxy disappear
- * when going for the data for it.
- *
- * Note: It is IMPERITIVE that the start/stop is used in the following way:
- * factory.startTransaction();
- * try {
- * do your stuff...
- * } finally {
- * factory.stopTransaction();
- * }
- *
- * This way it can never accidently leave it in a locked state.
- */
-public void startTransaction() {
- synchronized (fIDToProxiesMap) {
- transactionLockCount++;
- }
-}
-
-public boolean inTransaction() {
- synchronized (fIDToProxiesMap) {
- return transactionLockCount != 0;
- }
-}
-
-/**
- * Stop Transaction: During the time between start/stop transaction,
- * proxies will not be cleaned up. This prevents the case of a two step
- * transaction where the returned ID from the remote vm is for a proxy
- * that is about to be cleaned up, and then having that proxy disappear
- * when going for the data for it.
- *
- * Note: It is IMPERITIVE that the start/stop is used in the following way:
- * factory.startTransaction();
- * try {
- * do your stuff...
- * } finally {
- * factory.stopTransaction();
- * }
- *
- * This way it can never accidently leave it in a locked state.
- */
-public void stopTransaction() {
- synchronized (fIDToProxiesMap) {
- if (--transactionLockCount < 0)
- transactionLockCount = 0; // Shouldn't occur, but just in case.
- }
-}
-
-/**
- * Terminate the factory. If this is being terminated, then the server is being terminated too.
- * So just go through all of the proxies and release them, but don't send any notification to
- * the server since the server is subsequently just going to throw them away when it terminates.
- * <p>
- * This can't run async, so wait is a suggestion here.
- */
-public void terminateFactory(boolean wait) {
- synchronized (fIDToProxiesMap) {
- Iterator itr = fIDToProxiesMap.values().iterator();
- while (itr.hasNext()) {
- ProxyRef ref = (ProxyRef) itr.next();
- if (ref != null) {
- Object bp = ref.get();
- // If not cleaned up and not enqueued, release it.
- if (bp != null && !ref.isEnqueued())
- ((IREMBeanProxy) bp).release();
- }
- }
-
- fIDToProxiesMap.clear();
- queue = null; // Don't bother processing the queue, don't need to now.
- }
-}
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IStandardBeanProxyFactory#createExpression()
- */
- public IExpression createExpression() {
- return new REMExpression(this.fRegistry);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IStandardBeanProxyFactory#createBeanProxyFrom(java.lang.String)
- */
- public IBeanProxy createBeanProxyFrom(String initializationString) throws ThrowableProxy, ClassCastException, InstantiationException {
- try {
- return createBeanProxy(fBeanTypeProxyFactory.voidType, initializationString);
- } catch (CommandException e) {
- ProxyPlugin.getPlugin().getLogger().log(new Status(IStatus.WARNING, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "", e)); //$NON-NLS-1$ }
- }
- return null;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IStandardBeanProxyFactory#convertToPrimitiveBeanProxy(org.eclipse.jem.internal.proxy.core.IBeanProxy)
- */
- public IBeanProxy convertToPrimitiveBeanProxy(IBeanProxy nonPrimitiveProxy) {
- if (nonPrimitiveProxy == null)
- return null;
- if (!nonPrimitiveProxy.isValid())
- return nonPrimitiveProxy;
- IREMBeanTypeProxy type = (IREMBeanTypeProxy) nonPrimitiveProxy.getTypeProxy();
- // Step into the internals. The ID is a constant int, so we can use a switch stmt.
- switch (type.getID().intValue()) {
- case Commands.BOOLEAN_CLASS:
- return this.createBeanProxyWith(((IBooleanBeanProxy) nonPrimitiveProxy).booleanValue());
- case Commands.BYTE_CLASS:
- return this.createBeanProxyWith(((INumberBeanProxy) nonPrimitiveProxy).byteValue());
- case Commands.CHARACTER_CLASS:
- return this.createBeanProxyWith(((ICharacterBeanProxy) nonPrimitiveProxy).charValue());
- case Commands.DOUBLE_CLASS:
- return this.createBeanProxyWith(((INumberBeanProxy) nonPrimitiveProxy).doubleValue());
- case Commands.FLOAT_CLASS:
- return this.createBeanProxyWith(((INumberBeanProxy) nonPrimitiveProxy).floatValue());
- case Commands.INTEGER_CLASS:
- return this.createBeanProxyWith(((INumberBeanProxy) nonPrimitiveProxy).intValue());
- case Commands.LONG_CLASS:
- return this.createBeanProxyWith(((INumberBeanProxy) nonPrimitiveProxy).longValue());
- case Commands.SHORT_CLASS:
- return this.createBeanProxyWith(((INumberBeanProxy) nonPrimitiveProxy).shortValue());
- default:
- return nonPrimitiveProxy;
- }
- }
-
-
- public IBeanProxy getIVMServerProxy() {
- return vmServerProxy;
- }
-}
-
-
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMStandardBeanTypeProxyFactory.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMStandardBeanTypeProxyFactory.java
deleted file mode 100644
index d9a524327..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMStandardBeanTypeProxyFactory.java
+++ /dev/null
@@ -1,690 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-
-/*
-
-
- */
-
-import java.text.MessageFormat;
-import java.util.*;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jem.internal.proxy.core.*;
-import org.eclipse.jem.internal.proxy.core.ExpressionProxy.ProxyEvent;
-import org.eclipse.jem.internal.proxy.common.CommandException;
-import org.eclipse.jem.internal.proxy.common.MapTypes;
-import org.eclipse.jem.internal.proxy.common.remote.CommandErrorException;
-import org.eclipse.jem.internal.proxy.common.remote.Commands;
-
-/**
- * We are a beanTypeProxyFactory for creating REMBeanTypeProxy objects Primitive types as well as common types like String are cached for speed of
- * lookup. We are the standard one that the VCE uses. Creation date: (12/3/99 2:32:48 PM)
- *
- * @author: Joe Winchester
- */
-public final class REMStandardBeanTypeProxyFactory implements IStandardBeanTypeProxyFactory {
-
- protected final REMProxyFactoryRegistry fFactoryRegistry;
-
- protected REMStandardBeanProxyFactory fBeanFactory;
-
- // Hashtable to cache proxies for classes so they are found on second and subsequent lookups
- protected Map fBeanProxies = new HashMap(1000);
-
- // A Cache of bean type proxies that should not ever be released. These are the standard ones
- // that we create here. They are never released because they wouldn't be correctly re-created
- // if they were. Also they are standard ones with standard ID's that don't change so they
- // don't need to be re-created later.
- protected Set fPermanentProxies = new HashSet(30);
-
- // Cache of requested but not found bean types. If not maintaining the list, this variable will be null.
- // The values are strings (classnames in JNI format).
- protected Set fNotFoundTypes = null;
-
- // Cached copy of a few typical bean type proxies.
- REMBeanTypeProxy objectClass;
-
- REMClassBeanTypeProxy classClass;
-
- REMVoidBeanTypeProxy voidType;
-
- REMBooleanTypeBeanTypeProxy booleanType;
-
- REMBooleanClassBeanTypeProxy booleanClass;
-
- REMIntegerTypeBeanTypeProxy intType;
-
- REMIntegerClassBeanTypeProxy integerClass;
-
- REMByteTypeBeanTypeProxy byteType;
-
- REMByteClassBeanTypeProxy byteClass;
-
- REMShortClassBeanTypeProxy shortClass;
-
- REMShortTypeBeanTypeProxy shortType;
-
- REMLongClassBeanTypeProxy longClass;
-
- REMLongTypeBeanTypeProxy longType;
-
- REMDoubleClassBeanTypeProxy doubleClass;
-
- REMDoubleTypeBeanTypeProxy doubleType;
-
- REMFloatClassBeanTypeProxy floatClass;
-
- REMFloatTypeBeanTypeProxy floatType;
-
- REMBigDecimalBeanTypeProxy bigDecimalClass;
-
- REMBigIntegerBeanTypeProxy bigIntegerClass;
-
- REMCharacterTypeBeanTypeProxy charType;
-
- REMCharacterClassBeanTypeProxy characterClass;
-
- REMStringBeanTypeProxy stringClass;
-
- /**
- * Available to all REM beantypes.
- */
- public REMProxyConstants proxyConstants;
-
- /**
- * IDEBeanTypeProxyFactory constructor comment.
- */
- REMStandardBeanTypeProxyFactory(REMProxyFactoryRegistry aRegistry) {
- fFactoryRegistry = aRegistry;
- aRegistry.registerBeanTypeProxyFactory(this);
-
- proxyConstants = new REMProxyConstants(aRegistry);
-
- // Now initialize the cache.
- objectClass = new REMBeanTypeProxy(fFactoryRegistry, new Integer(Commands.OBJECT_CLASS), Object.class.getName(), null);
- classClass = new REMClassBeanTypeProxy(fFactoryRegistry, objectClass);
- voidType = new REMVoidBeanTypeProxy(fFactoryRegistry);
- booleanType = new REMBooleanTypeBeanTypeProxy(fFactoryRegistry);
- booleanClass = new REMBooleanClassBeanTypeProxy(fFactoryRegistry, objectClass);
- IBeanTypeProxy numberClass = objectClass.newBeanTypeForClass(new Integer(Commands.NUMBER_CLASS), Number.class.getName(), true);
- intType = new REMIntegerTypeBeanTypeProxy(fFactoryRegistry);
- integerClass = new REMIntegerClassBeanTypeProxy(fFactoryRegistry, numberClass);
- byteType = new REMByteTypeBeanTypeProxy(fFactoryRegistry);
- byteClass = new REMByteClassBeanTypeProxy(fFactoryRegistry, numberClass);
- shortType = new REMShortTypeBeanTypeProxy(fFactoryRegistry);
- shortClass = new REMShortClassBeanTypeProxy(fFactoryRegistry, numberClass);
- longType = new REMLongTypeBeanTypeProxy(fFactoryRegistry);
- longClass = new REMLongClassBeanTypeProxy(fFactoryRegistry, numberClass);
- doubleType = new REMDoubleTypeBeanTypeProxy(fFactoryRegistry);
- doubleClass = new REMDoubleClassBeanTypeProxy(fFactoryRegistry, numberClass);
- floatType = new REMFloatTypeBeanTypeProxy(fFactoryRegistry);
- floatClass = new REMFloatClassBeanTypeProxy(fFactoryRegistry, numberClass);
- bigDecimalClass = new REMBigDecimalBeanTypeProxy(fFactoryRegistry, numberClass);
- bigIntegerClass = new REMBigIntegerBeanTypeProxy(fFactoryRegistry, numberClass);
- charType = new REMCharacterTypeBeanTypeProxy(fFactoryRegistry);
- characterClass = new REMCharacterClassBeanTypeProxy(fFactoryRegistry, objectClass);
- stringClass = new REMStringBeanTypeProxy(fFactoryRegistry, objectClass);
- IBeanTypeProxy throwableClass = new REMThrowableBeanTypeProxy(fFactoryRegistry, new Integer(Commands.THROWABLE_CLASS), Throwable.class
- .getName(), objectClass);
- IBeanTypeProxy threadClass = objectClass.newBeanTypeForClass(new Integer(Commands.THREAD_CLASS), Thread.class.getName(), false);
- IBeanTypeProxy expressionProcessorControllerClass = objectClass.newBeanTypeForClass(new Integer(Commands.EXPRESSIONPROCESSERCONTROLLER_CLASS), "org.eclipse.jem.internal.proxy.vm.remote.ExpressionProcesserController", false); //$NON-NLS-1$
-
- // Initialize the hashtable with the primitives, their lang equivalents, and also common classes like String
-
- // Primitives
- fBeanProxies.put(voidType.getTypeName(), voidType);
- fBeanProxies.put(intType.getTypeName(), intType);
- fBeanProxies.put(booleanType.getTypeName(), booleanType);
- fBeanProxies.put(charType.getTypeName(), charType);
- fBeanProxies.put(byteType.getTypeName(), byteType);
- fBeanProxies.put(shortType.getTypeName(), shortType);
- fBeanProxies.put(longType.getTypeName(), longType);
- fBeanProxies.put(floatType.getTypeName(), floatType);
- fBeanProxies.put(doubleType.getTypeName(), doubleType);
-
- // java.lang primitive peers
- // Note that special classes are used for some of these which allow the IDE to get the
- // lang objects from the objects that are holding proxies
- fBeanProxies.put(integerClass.getTypeName(), integerClass);
- fBeanProxies.put(booleanClass.getTypeName(), booleanClass);
- fBeanProxies.put(characterClass.getTypeName(), characterClass);
- fBeanProxies.put(byteClass.getTypeName(), byteClass);
- fBeanProxies.put(shortClass.getTypeName(), shortClass);
- fBeanProxies.put(longClass.getTypeName(), longClass);
- fBeanProxies.put(floatClass.getTypeName(), floatClass);
- fBeanProxies.put(doubleClass.getTypeName(), doubleClass);
- fBeanProxies.put(bigDecimalClass.getTypeName(), bigDecimalClass);
- fBeanProxies.put(bigIntegerClass.getTypeName(), bigIntegerClass);
- fBeanProxies.put(stringClass.getTypeName(), stringClass);
- fBeanProxies.put(throwableClass.getTypeName(), throwableClass);
- fBeanProxies.put(objectClass.getTypeName(), objectClass);
- fBeanProxies.put(classClass.getTypeName(), classClass);
- fBeanProxies.put(numberClass.getTypeName(), numberClass);
- fBeanProxies.put(threadClass.getTypeName(), threadClass);
- fBeanProxies.put(expressionProcessorControllerClass.getTypeName(), expressionProcessorControllerClass);
-
- // Mark these as permanent.
- fPermanentProxies.addAll(fBeanProxies.values());
- }
-
- /**
- * Initialize AFTER BeanProxyFactory has been created. This is REQUIRED! NOTE: It is package protected so that only REMStandardBeanProxyFactory
- * can call it when ready.
- */
- synchronized void initialize(REMStandardBeanProxyFactory proxyFactory) {
- fBeanFactory = proxyFactory;
- fBeanFactory.registerProxies(fBeanProxies.values());
- }
-
- /*
- * This is called when we know we don't have the class registered, so we need to create the proxy. We have a connection passed in and will reuse
- * it as necessary
- *
- * It is important that this be called only from within a transaction.
- */
- private synchronized IREMBeanTypeProxy createBeanTypeProxy(String typeName, IREMConnection connection) throws CommandException {
-
- // We don't have the beantype proxy, so create it.
- IREMBeanTypeProxy beanTypeProxy = null;
- Commands.GetClassReturn ret = null;
- try {
- ret = getClassReturn(connection, typeName);
- } catch (ThrowableProxy ep) {
- // Print out the trace and return proxy with init error.
- ProxyPlugin.getPlugin().getLogger().log(new Status(IStatus.WARNING, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "", ep)); //$NON-NLS-1$
- IREMBeanTypeProxy proxy = new REMInitErrorBeanTypeProxy(fFactoryRegistry, MessageFormat.format(ProxyRemoteMessages.ExceptionErrorMsg_EXC_, new Object[] { ep.getTypeProxy().getTypeName(), ep.getProxyLocalizedMessage()}), typeName); //$NON-NLS-1$
- registerBeanTypeProxy(proxy, false);
- return proxy;
- }
- if (ret == null) {
- if (fNotFoundTypes != null)
- fNotFoundTypes.add(typeName);
- return null; // The class doesn't even exist on the server.
- }
-
- if (typeName.charAt(0) != '[') {
- // It is not an array.
- IREMBeanTypeProxy superTypeProxy = null;
- if (!ret.isInterface && ret.superClassname.length() != 0) {
- // Get the beantype proxy of the superclass.
- superTypeProxy = getBeanTypeProxy(ret.superClassname, connection);
- }
-
- // First check with the factory for the package of the class.
- // Inner classes have to use the dollar notation since if they didn't we couldn't tell where
- // the package ended and the class started. This check is here in case the
- // extension factory can handle this class but needs the id from the server to
- // create it.
- int packageIndex = typeName.lastIndexOf('.');
- if (packageIndex != -1) {
- String packageName = typeName.substring(0, packageIndex);
- IREMBeanTypeProxyFactory packageFactory = (IREMBeanTypeProxyFactory) fFactoryRegistry.getBeanTypeProxyFactoryExtension(packageName);
- if (packageFactory != null) {
- beanTypeProxy = packageFactory.getExtensionBeanTypeProxy(typeName, new Integer(ret.classID), superTypeProxy);
- if (beanTypeProxy != null) {
- registerBeanTypeProxy(beanTypeProxy, false);
- return beanTypeProxy;
- }
- }
- }
-
- if (ret.isInterface) {
- // Interface never have a super type, so we will create a specific type.
- beanTypeProxy = new REMInterfaceBeanTypeProxy(fFactoryRegistry, new Integer(ret.classID), typeName);
- } else {
- // Ask the supertype
- // to create a beantype proxy of the same beantype proxy class.
- // This is so that any subclasses will get the same beantype proxy class
- // for it if it is special.
- if (superTypeProxy != null)
- beanTypeProxy = superTypeProxy.newBeanTypeForClass(new Integer(ret.classID), typeName, ret.isAbstract);
- }
- } else
- beanTypeProxy = new REMArrayBeanTypeProxy(fFactoryRegistry, new Integer(ret.classID), typeName, objectClass);
-
- // Cache the instance so we can re-use it again
- if (beanTypeProxy != null)
- registerBeanTypeProxy(beanTypeProxy, false);
- return beanTypeProxy;
- }
-
- /**
- * Using the helper class to find a class by name, then create the proxy.
- */
- public IBeanTypeProxy getBeanTypeProxy(String typeName) {
- try {
- return getBeanTypeProxy(MapTypes.getJNIFormatName(typeName), (IREMConnection) null);
- } catch (CommandException e) {
- // Try once more (we won't have received recoverable exceptions here, they were already caught and handled)
- try {
- return getBeanTypeProxy(typeName, (IREMConnection) null);
- } catch (CommandException eAgain) {
- // Failed again.
- ProxyPlugin.getPlugin().getLogger().log(
- new Status(IStatus.WARNING, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "", eAgain)); //$NON-NLS-1$
- }
- }
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IStandardBeanTypeProxyFactory#getBeanTypeProxy(org.eclipse.jem.internal.proxy.core.IExpression,
- * java.lang.String)
- */
- public synchronized IProxyBeanType getBeanTypeProxy(IExpression expression, String typeName) {
- typeName = MapTypes.getJNIFormatName(typeName);
- // See whether we already have the proxy for the argument name
- IProxyBeanType beanTypeProxy = (IProxyBeanType) fBeanProxies.get(typeName);
- if (beanTypeProxy != null)
- return beanTypeProxy;
-
- // Now see if an expression proxy cached.
- beanTypeProxy = ((REMExpression) expression).getBeanType(typeName);
- if (beanTypeProxy != null)
- return beanTypeProxy;
-
- // If not an array, then see if the package extension mechanism can find it.
- // Do this here so that if it is found in the package extension we won't necessarily create an
- // extra connection when not needed.
- if (typeName.charAt(0) != '[') {
- // It is not an array
- // First check with the factory for the package of the class.
- // Inner classes have to use the dollar notation since if they didn't we couldn't tell where
- // the package ended and the class started.
- int packageIndex = typeName.lastIndexOf('.');
- if (packageIndex != -1) {
- String packageName = typeName.substring(0, packageIndex);
- IREMBeanTypeProxyFactory packageFactory = (IREMBeanTypeProxyFactory) fFactoryRegistry.getBeanTypeProxyFactoryExtension(packageName);
- if (packageFactory != null) {
- beanTypeProxy = packageFactory.getExtensionBeanTypeProxy(typeName, expression);
- if (beanTypeProxy != null) {
- registerBeanTypeProxy(beanTypeProxy, false);
- return beanTypeProxy;
- }
- }
- }
- }
-
- // Need to create the expression proxy for it.
- beanTypeProxy = ((Expression) expression).createBeanTypeExpressionProxy(typeName);
- registerBeanTypeProxy(beanTypeProxy, false);
- return beanTypeProxy;
-
- }
-
- /**
- * One that internally allows that we already have a connection to work with. If the connection is null, then one will be created.
- *
- * It is important that if the connection is not null, then we are in a transaction.
- */
- private synchronized IREMBeanTypeProxy getBeanTypeProxy(String typeName, IREMConnection inConnect) throws CommandException {
-
- // See whether we already have the proxy for the argument name
- IProxyBeanType beanTypeProxy = (IProxyBeanType) fBeanProxies.get(typeName);
- // See if there and resolved, if so, return it. If not resolved, that means we need it NOW
- // so we must go for it. When finally resolved the original ExpressionProxy will be deregistered and
- // the resolved beantypeproxy will be in its place.
- if (beanTypeProxy != null && beanTypeProxy.isBeanProxy()) { return (IREMBeanTypeProxy) beanTypeProxy; }
-
- // If not an array, then see if the package extension mechanism can find it.
- // Do this here so that if it is found in the package extension we won't necessarily create an
- // extra connection when not needed.
- if (typeName.charAt(0) != '[') {
- // It is not an array
- // First check with the factory for the package of the class.
- // Inner classes have to use the dollar notation since if they didn't we couldn't tell where
- // the package ended and the class started.
- int packageIndex = typeName.lastIndexOf('.');
- if (packageIndex != -1) {
- String packageName = typeName.substring(0, packageIndex);
- IREMBeanTypeProxyFactory packageFactory = (IREMBeanTypeProxyFactory) fFactoryRegistry.getBeanTypeProxyFactoryExtension(packageName);
- if (packageFactory != null) {
- beanTypeProxy = packageFactory.getExtensionBeanTypeProxy(typeName);
- if (beanTypeProxy != null) {
- registerBeanTypeProxy((IREMBeanTypeProxy) beanTypeProxy, false);
- return (IREMBeanTypeProxy) beanTypeProxy;
- }
- }
- }
- }
-
- IREMConnection connect = inConnect != null ? inConnect : fFactoryRegistry.getFreeConnection();
- if (inConnect == null)
- fBeanFactory.startTransaction(); // Start a transation.
- try {
- return createBeanTypeProxy(typeName, connect);
- } catch (CommandException e) {
- if (inConnect == null) {
- // Need to close the connection, not return it.
- fFactoryRegistry.closeConnection(connect);
- connect = null; // So that it won't be returned.
- }
- throw e; // Pass it on up
- } finally {
- if (inConnect == null)
- fBeanFactory.stopTransaction();
- if (inConnect == null && connect != null)
- fFactoryRegistry.returnConnection(connect);
- }
- }
-
- /*
- * It is important this be called only from within a transaction.
- */
- private Commands.GetClassReturn getClassReturn(IREMConnection connection, String className) throws CommandException, ThrowableProxy {
- try {
- return connection.getClass(className);
- } catch (CommandErrorException e) {
- fBeanFactory.processErrorReturn(e); // Let proxy factory handle the error return
- }
- return null;
- }
-
- /**
- * Return an Array type proxy for the given class name of the specified dimensions. This is a helper method. The same result can be gotton from
- * getBeanTypeProxy. e.g. getBeanTypeProxy("java.lang.Object", 3) is the same as: getBeanTypeProxy("[[[Ljava.lang.Object;")
- *
- * They both result in a type of: Object [][][]
- *
- * or getBeanTypeProxy("[Ljava.langObject;", 3) becomes Object [][][][]
- */
- public IBeanTypeProxy getBeanTypeProxy(String componentClassName, int dimensions) {
- return getBeanTypeProxy(getArrayClassName(componentClassName, dimensions));
- }
-
- /**
- * @param componentClassName
- * @param dimensions
- * @return
- *
- * @since 1.1.0
- */
- private String getArrayClassName(String componentClassName, int dimensions) {
- String jniComponentClassName = MapTypes.getJNIFormatName(componentClassName);
- String compType = jniComponentClassName;
- if (jniComponentClassName.charAt(0) != '[') {
- // We're not already an array, so create correct template.
- compType = (String) MapTypes.MAP_TYPENAME_TO_SHORTSIG.get(jniComponentClassName);
- if (compType == null) {
- // It is a class, and not a type.
- compType = "L" + jniComponentClassName + ";"; //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- // Now create it with the appropriate number of '[' in front.
- StringBuffer buffer = new StringBuffer(dimensions + compType.length());
- for (int i = 0; i < dimensions; i++)
- buffer.append('[');
- buffer.append(compType);
- return buffer.toString();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IStandardBeanTypeProxyFactory#getBeanTypeProxy(org.eclipse.jem.internal.proxy.core.IExpression,
- * java.lang.String, int)
- */
- public IProxyBeanType getBeanTypeProxy(IExpression expression, String componentClassName, int dimensions) {
- return getBeanTypeProxy(expression, getArrayClassName(componentClassName, dimensions));
- }
-
- /**
- * Get the bean type proxy from a class id. This means that a new class id was sent back from the server that we don't have yet. We need to go ask
- * the server for information on this type so that we can create it.
- *
- * NOTE: This is package protected so that only the standard bean proxy factory can call it.
- *
- * It is important that this has been called within a transaction.
- */
- IREMBeanTypeProxy createBeanTypeProxy(Integer classID) {
- IREMConnection connect = fFactoryRegistry.getFreeConnection();
- try {
- return createBeanTypeProxy(classID, connect);
- } catch (CommandException e) {
- if (e.isRecoverable()) {
- // It is recoverable, print message, keep connection live and return it.
- ProxyPlugin.getPlugin().getLogger().log(new Status(IStatus.WARNING, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "", e)); //$NON-NLS-1$
- } else {
- // Try again, close connection, get a new one.
- fFactoryRegistry.closeConnection(connect);
- connect = null;
- connect = fFactoryRegistry.getFreeConnection();
- try {
- return createBeanTypeProxy(classID, connect);
- } catch (CommandException eAgain) {
- // Failed again. Close connection, don't return it.
- ProxyPlugin.getPlugin().getLogger().log(
- new Status(IStatus.WARNING, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "", eAgain)); //$NON-NLS-1$
- fFactoryRegistry.closeConnection(connect);
- connect = null;
- }
- }
- } finally {
- if (connect != null)
- fFactoryRegistry.returnConnection(connect);
- }
- return null;
- }
-
- /*
- * One that internally allows that we already have a connection to work with. If the connection is null, then one will be created.
- *
- * It is important this be called only from within a transaction.
- */
- private synchronized IREMBeanTypeProxy createBeanTypeProxy(Integer classID, IREMConnection connect) throws CommandException {
- // We don't have the beantype proxy, so create it.
- IREMBeanTypeProxy beanTypeProxy = null;
-
- Commands.GetClassIDReturn ret = null;
- try {
- ret = getClassIDReturn(connect, classID);
- } catch (ThrowableProxy ep) {
- // Just print out the trace and return proxy not found.
- ProxyPlugin.getPlugin().getLogger().log(new Status(IStatus.WARNING, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "", ep)); //$NON-NLS-1$
- return null;
- }
-
- // If the signature is that of a class.
- if (ret.className.charAt(0) != '[') {
- // It is not an array.
- IREMBeanTypeProxy superTypeProxy = null;
- if (!ret.isInterface && ret.superClassname.length() != 0) {
- // Get the beantype proxy of the superclass.
- superTypeProxy = getBeanTypeProxy(ret.superClassname, connect);
- }
-
- // First check with the factory for the package of the class.
- // Inner classes have to use the dollar notation since if they didn't we couldn't tell where
- // the package ended and the class started.
- int packageIndex = ret.className.lastIndexOf('.');
- if (packageIndex != -1) {
- String packageName = ret.className.substring(0, packageIndex);
- IREMBeanTypeProxyFactory packageFactory = (IREMBeanTypeProxyFactory) fFactoryRegistry.getBeanTypeProxyFactoryExtension(packageName);
- if (packageFactory != null) {
- beanTypeProxy = packageFactory.getExtensionBeanTypeProxy(ret.className, classID, superTypeProxy);
- if (beanTypeProxy != null) {
- registerBeanTypeProxy(beanTypeProxy, false);
- return beanTypeProxy;
- }
- }
- }
-
- if (ret.isInterface) {
- // Interface never have a super type, so we will let the object class do it for us.
- beanTypeProxy = new REMInterfaceBeanTypeProxy(fFactoryRegistry, classID, ret.className);
- } else {
- // Ask the beantype proxy of the superclass
- // to create a beantype proxy of the same beantype proxy class.
- // This is so that any subclasses will get the same beantype proxy class
- // for it if it is special.
- if (superTypeProxy != null)
- beanTypeProxy = superTypeProxy.newBeanTypeForClass(classID, ret.className, ret.isAbstract);
- }
-
- // Cache the instance so we can re-use it again
- if (beanTypeProxy != null)
- registerBeanTypeProxy(beanTypeProxy, false);
- return beanTypeProxy;
- } else {
- // It is an array.
- beanTypeProxy = new REMArrayBeanTypeProxy(fFactoryRegistry, classID, ret.className, objectClass);
- registerBeanTypeProxy(beanTypeProxy, false);
- return beanTypeProxy;
- }
- }
-
- /*
- * It is important that this be called only from within a transaction.
- */
- private Commands.GetClassIDReturn getClassIDReturn(IREMConnection connection, Integer classID) throws CommandException, ThrowableProxy {
- try {
- return connection.getClassFromID(classID.intValue());
- } catch (CommandErrorException e) {
- fBeanFactory.processErrorReturn(e); // Let proxy factory handle the error return
- }
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IStandardBeanTypeProxyFactory#registerBeanTypeProxy(org.eclipse.jem.internal.proxy.core.IBeanTypeProxy,
- * boolean)
- */
- public synchronized void registerBeanTypeProxy(IBeanTypeProxy aBeanTypeProxy, boolean permanent) {
- fBeanProxies.put(aBeanTypeProxy.getTypeName(), aBeanTypeProxy);
- fBeanFactory.registerProxy((IREMBeanProxy) aBeanTypeProxy);
- if (permanent)
- fPermanentProxies.add(aBeanTypeProxy);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IStandardBeanTypeProxyFactory#registerBeanTypeProxy(org.eclipse.jem.internal.proxy.core.IProxyBeanType,
- * boolean)
- */
- public void registerBeanTypeProxy(IProxyBeanType aProxyBeanType, final boolean permanent) {
- if (aProxyBeanType.isBeanProxy())
- registerBeanTypeProxy((IBeanTypeProxy) aProxyBeanType, permanent); // A regular kind, do regular registration.
- else {
- ExpressionProxy beanExpressionProxy = ((ExpressionProxy) aProxyBeanType);
- final String typeName = aProxyBeanType.getTypeName();
- ((REMExpression) beanExpressionProxy.getExpression()).addBeanType(typeName, aProxyBeanType);
- beanExpressionProxy.addProxyListener(new ExpressionProxy.ProxyAdapter() {
-
- public void proxyResolved(ProxyEvent event) {
- String typeName = ((IProxyBeanType) event.getSource()).getTypeName();
- synchronized (REMStandardBeanTypeProxyFactory.this) {
- if (!fBeanProxies.containsKey(typeName)) {
- // It hasn't been resolved through some other means. So this is good. Actually this should never
- // occur because upon resolution we've already registered the bean type proxy through the
- // normal mechanisms. But to be safe, we'll do it here.
- fBeanProxies.put(typeName, event.getProxy());
- if (permanent)
- fPermanentProxies.add(event.getProxy());
- }
- }
- }
-
- public void proxyNotResolved(ExpressionProxy.ProxyEvent event) {
- ((REMExpression) ((ExpressionProxy) event.getSource()).getExpression()).removeBeanType(typeName);
- }
- });
- }
-
- }
-
- /**
- * A beantype proxy is asked to be released. We can only release ones that were not in the permanent set that we initialized with. Those in the
- * permanent set can't be changed so we can't release them.
- *
- * Answer whether it can be released from the server too.
- *
- * NOTE: Package protected since only REMStandardBeanProxyFactory should call it.
- */
- boolean releaseProxy(IBeanTypeProxy proxy) {
- /**
- * Currently we won't allow any bean type proxies to be released. We don't have a good strategy for handling that there may be hard refs from
- * subtypes. One thought is that beanproxies table should store SoftReferences so that only when space is needed, that any beantype that
- * doesn't have a subtype (since subtypes hold a strong ref) or, is in the permanent table (since that is hardref) could be GC'd. Then what
- * would happen is on releaseProxy we don't actually release, we change it to a WeakRef so that it would definitely be released on a GC. These
- * are complicated arch. and we're not sure if it should be allowed or not. So for now, we don't allow them to be released. if
- * (!fPermanentProxies.contains(proxy)) { // We can release it. It is not one of the permanent ones. synchronized(this) {
- * fBeanProxies.remove(proxy.getTypeName()); return true; } }
- */
- return false;
- }
-
- /*
- * Terminate this factory. Since all of the proxies are registered in the proxy factory, there is no need to release them here. There is no need
- * to clear out any fields since this factory will not be held onto by anything and so it will be GC'd.
- */
- public void terminateFactory(boolean wait) {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IStandardBeanTypeProxyFactory#isBeanTypeRegistered(String)
- */
- public synchronized boolean isBeanTypeRegistered(String className) {
- return fBeanProxies.containsKey(MapTypes.getJNIFormatName(className));
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IStandardBeanTypeProxyFactory#registeredTypes()
- */
- public Set registeredTypes() {
- return fBeanProxies.keySet();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IStandardBeanTypeProxyFactory#isBeanTypeNotFound(String)
- */
- public synchronized boolean isBeanTypeNotFound(String className) {
- return fNotFoundTypes != null && fNotFoundTypes.contains(MapTypes.getJNIFormatName(className));
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IStandardBeanTypeProxyFactory#isMaintainNotFoundTypes()
- */
- public synchronized boolean isMaintainNotFoundTypes() {
- return fNotFoundTypes != null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IStandardBeanTypeProxyFactory#setMaintainNotFoundTypes(boolean)
- */
- public synchronized void setMaintainNotFoundTypes(boolean maintain) {
- if (maintain) {
- if (fNotFoundTypes == null)
- fNotFoundTypes = new HashSet();
- } else
- fNotFoundTypes = null;
- }
-
-}
-
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMStringBeanProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMStringBeanProxy.java
deleted file mode 100644
index 7d396d0dd..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMStringBeanProxy.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-
-import org.eclipse.jem.internal.proxy.core.*;
-import org.eclipse.jem.internal.proxy.common.remote.Commands;
-
-/**
- * Remote VM Implementation of IStringBeanProxy
- * Creation date: (2/6/00 9:02:42 AM)
- * @author: Joe Winchester
- */
-final class REMStringBeanProxy extends REMConstantBeanProxy implements IStringBeanProxy {
- private final String fString;
-
-/**
- * Store the bean in the string field to save re-casting each time it is asked for.
- * It is package protected because they are created
- * in a special way and no one else should create them.
- */
-REMStringBeanProxy(REMProxyFactoryRegistry aRegistry, String value) {
- super(aRegistry);
- fString = value;
-}
-/**
- * equals: Equal if:
- * 1) This proxy == (identity) to the other object
- * 2) Else if other is an IBeanProxy and not a constant one, then if
- * equals on the server.
- * 3) If this is a constant proxy and the other is too or is a constant
- * value (e.g. IStringBeanProxy.equals(String), then true if values are equals.
- */
-public boolean equals(Object anObject) {
- if (this == anObject)
- return true; // Identity
- if (anObject instanceof IStringBeanProxy)
- return fString.equals(((IStringBeanProxy) anObject).stringValue());
- else
- return fString.equals(anObject);
-}
-/**
- * Return the cache'd string that is a java.lang.String that the IDE can use
- */
-public String stringValue() {
- return fString;
-}
-
-/**
- * Return the toString value from the bean.
- */
-public String toBeanString() {
- return fString.toString();
-}
-
-/**
- * Get the beantype
- */
-public IBeanTypeProxy getTypeProxy() {
- return ((REMStandardBeanTypeProxyFactory) fFactory.getBeanTypeProxyFactory()).stringClass;
-}
-
-/**
- * Render the bean into value object.
- */
-public void renderBean(Commands.ValueObject value) {
- value.set(fString);
-}
-}
-
-
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMStringBeanTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMStringBeanTypeProxy.java
deleted file mode 100644
index f48c29da3..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMStringBeanTypeProxy.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-
-import org.eclipse.jem.internal.proxy.common.remote.Commands;
-import org.eclipse.jem.internal.proxy.core.*;
-
-/**
- * Remote Implementation of the BeanType proxy for java.lang.String
- * Creation date: (2/6/00 9:01:23 AM)
- * @author: Joe Winchester
- */
-final class REMStringBeanTypeProxy extends REMAbstractBeanTypeProxy implements IREMConstantBeanTypeProxy {
- // Cache a proxy to an empty string for speed
- protected final IStringBeanProxy emptyStringProxy;
-/**
- * IDEStringBeanTypeProxy constructor comment.
- * @param aClass java.lang.Class
- */
-REMStringBeanTypeProxy(REMProxyFactoryRegistry aRegistry, IBeanTypeProxy objectTypeProxy) {
- super(aRegistry, new Integer(Commands.STRING_CLASS), String.class.getName(), objectTypeProxy);
-
- // Cache a proxy to an empty string for speed
- emptyStringProxy = new REMStringBeanProxy(aRegistry, ""); //$NON-NLS-1$
-}
-/**
- * Helper to create string beans
- * Package protected because no-one else outside the package should use this, they
- * must go through the API where you look up a factory first.
- */
-IStringBeanProxy createStringBeanProxy(String aString){
- if ( aString.equals("") ) {//$NON-NLS-1$
- return emptyStringProxy;
- } else {
- return new REMStringBeanProxy(fRegistry, aString);
- }
-}
-
-/**
- * Create a new bean proxy with the specified id.
- *
- * For all of the primitive wrapper types, this is an invalid operation. They are created
- * explicitly through the appropriate create method.
- */
-public IREMBeanProxy newBeanProxy(Integer anID) {
- throw new UnsupportedOperationException();
-}
-
-/**
- * newBeanTypeForClass: Create a new beantypeproxy of this kind for the given class.
- * This is used by beantype proxy factory when creating a beantype proxy for a subclass.
- * This is because subclasses, unless explicitly overridden, should use the same kind
- * of beantype proxy. This way if anything special is needed for a specific type, then
- * that can be done.
- *
- * For all of the primitive wrapper types, they are final classes, so you can't create a newBeanType
- * for subclasses.
- */
-public IREMBeanTypeProxy newBeanTypeForClass(Integer anID, String aClassname, boolean anAbstract) {
- throw new UnsupportedOperationException();
-}
-
-/**
- * newInstance method. String has a default ctor, but it results in the emptyStringProxy,
- * so return the zeroProxy for this case because that is the default value.
- */
-public IBeanProxy newInstance() {
- return emptyStringProxy;
-}
-
-/**
- * newInstance method comment. Put a short cut in for strings so we don't need to go to the remote
- * vm just to create a string.
- */
-public IBeanProxy newInstance(String initializationString) throws ThrowableProxy, ClassCastException, InstantiationException {
- if (initializationString.length() <= 1)
- return super.newInstance(initializationString); // Not large enough for two quotes, so let default handle it.
- // Need a quick check that it is only one quoted string. Anything else needs to be passed on up.
- String s = initializationString.trim();
- int sl = s.length()-1;
- if (s.charAt(0) != '"' || s.charAt(sl) != '"')
- return super.newInstance(initializationString); // No leading and trailing quote.
-
- StringBuffer sb = new StringBuffer(sl);
- boolean escape = false;
- for (int i=1; i<sl; i++) {
- char c = s.charAt(i);
- if (c == '\\') {
- escape = true;
- continue;
- }
- if (!escape && c == '"')
- return super.newInstance(initializationString); // Had a quote in the middle without an escape. This means an expression, send on up.
- escape = false;
- sb.append(c);
- }
-
- return getProxyFactoryRegistry().getBeanProxyFactory().createBeanProxyWith(sb.toString());
-}
-
-/**
- * Create a new bean proxy the ValueObject passed in.
- * We will assume the object is correct type.
- */
-public IBeanProxy newBeanProxy(Commands.ValueObject value) {
- return createStringBeanProxy((String) value.anObject);
-}
-
-}
-
-
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMThrowableBeanProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMThrowableBeanProxy.java
deleted file mode 100644
index 1b45591f4..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMThrowableBeanProxy.java
+++ /dev/null
@@ -1,214 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-
-import org.eclipse.jem.internal.proxy.core.*;
-import org.eclipse.jem.internal.proxy.common.remote.*;
-/**
- * Exception Proxy for exception on Remote.
- * NOTE: This one is unusual in that it doesn't inherit from
- * IDEBeanProxy because it needs to be an exception, and
- * exceptions are not an interface.
- */
-public class REMThrowableBeanProxy extends ThrowableProxy implements IREMBeanProxy {
-
- /**
- * Comment for <code>serialVersionUID</code>
- *
- * @since 1.1.0
- */
- private static final long serialVersionUID = 2076777336810215206L;
- private Integer fID;
- protected final REMProxyFactoryRegistry fFactory;
- private IBeanTypeProxy fTypeProxy;
-
- /**
- * Set the bean we are proxying. We are a proxy for a bean running on the remote VM.
- */
- protected REMThrowableBeanProxy(REMProxyFactoryRegistry aRegistry, Integer anID, IBeanTypeProxy aType){
- fFactory = aRegistry;
- fID = anID;
- fTypeProxy = aType;
- }
-
- /**
- * equals: Equal if:
- * 1) This proxy == (identity) to the other object
- * 2) Else if other is an IBeanProxy and not a constant one, then if
- * equals on the server.
- * 3) If this is a constant proxy and the other is too or is a constant
- * value (e.g. IStringBeanProxy.equals(String), then true if values are equals.
- */
- public boolean equals(Object anObject) {
- if (super.equals(anObject))
- return true; // Identity
- if (anObject instanceof IBeanProxy && !(anObject instanceof IREMConstantBeanProxy) && fFactory.isValid() && ((IBeanProxy) anObject).getProxyFactoryRegistry() == fFactory)
- try {
- // The other is a bean proxy and is not a constant one, let the server do the check.
- return ((IBooleanBeanProxy) REMStandardBeanProxyConstants.getConstants(fFactory).getObjectEquals().invoke(this, (IBeanProxy) anObject)).booleanValue();
- } catch (ThrowableProxy e) {
- }
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IBeanProxy#sameAs(org.eclipse.jem.internal.proxy.core.IBeanProxy)
- */
- public boolean sameAs(IBeanProxy aBeanProxy) {
- return this == aBeanProxy; // We can be assured in Remote Proxy that identity of proxy and identity of object are the same.
- }
-
-
- /**
- * Get ID. An internal method to be used only within the ProxyFactory family.
- */
- public Integer getID() {
- return fID;
- }
-
- /**
- * isValid - has this bean been released.
- */
- public boolean isValid() {
- return fID != null;
- }
-
- /**
- * release - The bean is being released.
- */
- public void release() {
- fID = null;
- fTypeProxy = null;
- }
-
- /**
- * Return the registry this proxy was created with.
- */
- public ProxyFactoryRegistry getProxyFactoryRegistry() {
- return fFactory;
- }
-
- /**
- * Return the proxied class of the bean
- * Creation date: (12/3/99 11:37:01 AM)
- * @author: Joe Winchester
- */
- public IBeanTypeProxy getTypeProxy() {
- return fTypeProxy;
- }
-
- /**
- * Return the toString of the actual bean on the remote side.
- */
- public String toBeanString() {
- IStringBeanProxy string = (IStringBeanProxy) REMStandardBeanProxyConstants.getConstants(fFactory).getObjectToString().invokeCatchThrowableExceptions(this);
- return (string != null) ? string.stringValue() : null;
- }
-
- public String getProxyLocalizedMessage() {
- IStringBeanProxy msg = (IStringBeanProxy) REMStandardBeanProxyConstants.getConstants(fFactory).getThrowableLocalizedMessage().invokeCatchThrowableExceptions(this);
- return msg != null ? msg.stringValue() : null;
- }
-
- public String getProxyMessage() {
- IStringBeanProxy msg = (IStringBeanProxy) REMStandardBeanProxyConstants.getConstants(fFactory).getThrowableMessage().invokeCatchThrowableExceptions(this);
- return msg != null ? msg.stringValue() : null;
- }
-
- /**
- * Temporary way to get the string value of the stacktrace.
- */
- private String getProxyStackTrace() {
- IMethodProxy tempGetStackTrace = fFactory.getMethodProxyFactory().getMethodProxy("org.eclipse.jem.internal.proxy.vm.remote.StackTraceUtility", "printStackTrace", new String[] {"java.lang.Throwable"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- IStringBeanProxy trace = (IStringBeanProxy) tempGetStackTrace.invokeCatchThrowableExceptions(null, this);
- return trace != null ? trace.stringValue() : ""; //$NON-NLS-1$
- }
-
- public void printProxyStackTrace(java.io.PrintWriter writer) {
- String trace = getProxyStackTrace();
- synchronized(writer) {
- writer.print(trace);
- }
- }
-
- public void printProxyStackTrace(java.io.PrintStream stream) {
- String trace = getProxyStackTrace();
- synchronized(stream) {
- stream.print(trace);
- }
-
- }
-
- public void printProxyStackTrace() {
- String trace = getProxyStackTrace();
- synchronized(System.err) {
- System.err.print(trace);
- }
- }
-
-
- /**
- * Below are the actual printStackTrace. They are set up to first call
- * the proxy trace so that it can show where it occurred on the server,
- * and then it will do a super to show where it occurred on this side.
- */
- public void printStackTrace() {
- synchronized (System.err) {
- System.err.println(ProxyRemoteMessages.REMOTE_VM_TRACE_INFO_);
- printProxyStackTrace();
- System.err.println(ProxyRemoteMessages.REMOTE_VM_LOCAL_TRACE_INFO_);
- super.printStackTrace();
- }
- }
-
- public void printStackTrace(java.io.PrintWriter s) {
- synchronized (s) {
- s.println(ProxyRemoteMessages.REMOTE_VM_TRACE_INFO_);
- printProxyStackTrace(s);
- s.println(ProxyRemoteMessages.REMOTE_VM_LOCAL_TRACE_INFO_);
- super.printStackTrace(s);
- }
- }
-
- public void printStackTrace(java.io.PrintStream s) {
- synchronized (s) {
- s.println(ProxyRemoteMessages.REMOTE_VM_TRACE_INFO_);
- printProxyStackTrace(s);
- s.println(ProxyRemoteMessages.REMOTE_VM_LOCAL_TRACE_INFO_);
- super.printStackTrace(s);
- }
- }
-
- /**
- * Render the bean into value object.
- */
- public void renderBean(Commands.ValueObject value) {
- value.setObjectID(getID().intValue());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IProxy#isBeanProxy()
- */
- public final boolean isBeanProxy() {
- return true;
- }
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IProxy#isExpressionProxy()
- */
- public final boolean isExpressionProxy() {
- return false;
- }
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMThrowableBeanTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMThrowableBeanTypeProxy.java
deleted file mode 100644
index 997bddc3c..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMThrowableBeanTypeProxy.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-
-import org.eclipse.jem.internal.proxy.core.*;
-/**
- * The Remote implementation of a Throwable bean type.
- */
-public class REMThrowableBeanTypeProxy extends REMAbstractBeanTypeProxy implements IREMSpecialBeanTypeProxy {
-
- protected REMThrowableBeanTypeProxy(REMProxyFactoryRegistry aRegistry, Integer anID, String aClassname, IBeanTypeProxy aSuperType) {
- super(aRegistry, anID, aClassname, aSuperType);
- }
-
- /**
- * Helper to create a bean proxy
- * Package protected because everyone should go through the factory API
- * that is defined as part of IBeanProxyFactory
- */
- REMThrowableBeanProxy createThrowableBeanProxy(Integer objectID) {
- return new REMThrowableBeanProxy(fRegistry, objectID, this);
- }
-
- /**
- * newBeanTypeForClass: Create a new beantypeproxy of this kind for the given class.
- * This is used by beantype proxy factory when creating a beantype proxy for a subclass.
- * This is because subclasses, unless explicitly overridden, should use the same kind
- * of beantype proxy. This way if anything special is needed for a specific type, then
- * that can be done.
- *
- * NOTE: All subclasses must override this to return the correct type of BeanTypeProxy.
- */
- public IREMBeanTypeProxy newBeanTypeForClass(Integer anID, String aClassname, boolean anAbstract) {
- return newBeanTypeForClass(anID, aClassname, anAbstract, this);
- }
-
- /**
- * The special method to handle subclassing from an abstract).
- */
- public IREMBeanTypeProxy newBeanTypeForClass(Integer anID, String aClassname, boolean anAbstract, IBeanTypeProxy superType) {
- // We can never have an interface of type Throwable since that doesn't exist.
- if (!anAbstract)
- return new REMThrowableBeanTypeProxy(fRegistry, anID, aClassname, superType);
- else
- return new REMAnAbstractBeanTypeProxy(fRegistry, anID, aClassname, superType, this);
- }
-
- /**
- * Specialized from REMAbstractBeanTypeProxy to ensure ExceptionBeanProxies are created correctly.
- */
- public IREMBeanProxy newBeanProxy(Integer objectID) {
- return createThrowableBeanProxy(objectID);
- }
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMVoidBeanTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMVoidBeanTypeProxy.java
deleted file mode 100644
index 1fb6c2688..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/REMVoidBeanTypeProxy.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote;
-/*
-
-
- */
-
-
-import org.eclipse.jem.internal.proxy.core.*;
-import org.eclipse.jem.internal.proxy.common.remote.Commands;
-/**
- * BeanTypeProxy for representing the "void" type value, and a value of this type is "null".
- * Creation date: (2/11/00 2:26:47 PM)
- * @author: Richard Lee Kulp
- */
-final class REMVoidBeanTypeProxy extends REMAbstractBeanTypeProxy implements IREMConstantBeanTypeProxy {
-
-
-protected REMVoidBeanTypeProxy(REMProxyFactoryRegistry aRegistry) {
- super(aRegistry, new Integer(Commands.VOID_TYPE), Void.TYPE.getName(), null);
-}
-
-/**
- * Return the supertype for us
- * null/void has no superclass.
- * This is required as part of the interface
- */
-public IBeanTypeProxy getSuperBeanTypeProxy() {
- return null;
-}
-
-/**
- * Create a new bean proxy with the specified id.
- *
- * For void, this is an invalid operation. They are created
- * explicitly through the appropriate create method.
- */
-public IREMBeanProxy newBeanProxy(Integer anID) {
- throw new UnsupportedOperationException();
-}
-
-/**
- * newBeanTypeForClass: Create a new beantypeproxy of this kind for the given class.
- * This is used by beantype proxy factory when creating a beantype proxy for a subclass.
- * This is because subclasses, unless explicitly overridden, should use the same kind
- * of beantype proxy. This way if anything special is needed for a specific type, then
- * that can be done.
- *
- * For void is a final class, so you can't create a newBeanType
- * for subclasses.
- */
-public IREMBeanTypeProxy newBeanTypeForClass(Integer anID, String aClassname, boolean anAbstract) {
- throw new UnsupportedOperationException();
-}
-
-/**
- * newInstance method. void represents "null",
- * so return the null for this case because that is the default value.
- */
-public IBeanProxy newInstance() {
- return null;
-}
-
-/**
- * Create a new bean proxy the ValueObject passed in.
- * We will assume the object is correct type.
- */
-public IBeanProxy newBeanProxy(Commands.ValueObject value) {
- return newInstance();
-}
-
-}
-
-
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/awt/REMDimensionBeanProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/awt/REMDimensionBeanProxy.java
deleted file mode 100644
index fdd351b1f..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/awt/REMDimensionBeanProxy.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote.awt;
-/*
-
-
- */
-
-import org.eclipse.jem.internal.proxy.remote.*;
-import org.eclipse.jem.internal.proxy.awt.*;
-import org.eclipse.jem.internal.proxy.core.*;
-/**
- * The REM Bean Proxy for java.awt.Dimension.
- */
-public class REMDimensionBeanProxy extends REMBeanProxy implements IDimensionBeanProxy {
-
- protected REMDimensionBeanProxy(REMProxyFactoryRegistry aRegistry, Integer anID, IBeanTypeProxy aType) {
- super(aRegistry, anID, aType);
- }
-
- public int getHeight() {
- try {
- IIntegerBeanProxy h = (IIntegerBeanProxy) JavaStandardAwtBeanConstants.getConstants(fFactory).getDimensionHeightFieldProxy().get(this);
- return h.intValue();
- } catch (ThrowableProxy e) {
- return 0;
- }
- }
-
- public int getWidth() {
- try {
- IIntegerBeanProxy h = (IIntegerBeanProxy) JavaStandardAwtBeanConstants.getConstants(fFactory).getDimensionWidthFieldProxy().get(this);
- return h.intValue();
- } catch (ThrowableProxy e) {
- return 0;
- }
- }
-
- public void setHeight(int height) {
- try {
- JavaStandardAwtBeanConstants.getConstants(fFactory).getDimensionHeightFieldProxy().set(this, fFactory.getBeanProxyFactory().createBeanProxyWith(height));
- } catch (ThrowableProxy e) {
- }
- }
-
- public void setWidth(int width) {
- try {
- JavaStandardAwtBeanConstants.getConstants(fFactory).getDimensionWidthFieldProxy().set(this, fFactory.getBeanProxyFactory().createBeanProxyWith(width));
- } catch (ThrowableProxy e) {
- }
- }
-
- public void setSize(int width, int height) {
- JavaStandardAwtBeanConstants.getConstants(fFactory).getDimensionSetSizeHWProxy().invokeCatchThrowableExceptions(this, new IBeanProxy[] {fFactory.getBeanProxyFactory().createBeanProxyWith(width), fFactory.getBeanProxyFactory().createBeanProxyWith(height)});
- }
-
- public void setSize(IDimensionBeanProxy fromDimensionProxy) {
- JavaStandardAwtBeanConstants.getConstants(fFactory).getDimensionSetSizeDProxy().invokeCatchThrowableExceptions(this, fromDimensionProxy);
- }
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/awt/REMDimensionBeanTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/awt/REMDimensionBeanTypeProxy.java
deleted file mode 100644
index 7ea93dee3..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/awt/REMDimensionBeanTypeProxy.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote.awt;
-/*
-
-
- */
-
-import org.eclipse.jem.internal.proxy.remote.*;
-import org.eclipse.jem.internal.proxy.core.IBeanTypeProxy;
-/**
- * Beantype proxy for java.awt.Dimension
- */
-public class REMDimensionBeanTypeProxy extends REMAbstractBeanTypeProxy implements IREMSpecialBeanTypeProxy {
-
- protected REMDimensionBeanTypeProxy(REMProxyFactoryRegistry aRegistry, Integer anID, String aClassname, IBeanTypeProxy aSuperType) {
- super(aRegistry, anID, aClassname, aSuperType);
- }
-
- /**
- * Helper to create a bean proxy
- * Package protected because everyone should go through the factory API
- * that is defined as part of IBeanProxyFactory
- */
- REMDimensionBeanProxy createDimensionBeanProxy(Integer objectID) {
- return new REMDimensionBeanProxy(fRegistry, objectID, this);
- }
-
- /**
- * newBeanTypeForClass: Create a new beantypeproxy of this kind for the given class.
- * This is used by beantype proxy factory when creating a beantype proxy for a subclass.
- * This is because subclasses, unless explicitly overridden, should use the same kind
- * of beantype proxy. This way if anything special is needed for a specific type, then
- * that can be done.
- *
- * NOTE: All subclasses must override this to return the correct type of BeanTypeProxy.
- */
- public IREMBeanTypeProxy newBeanTypeForClass(Integer anID, String aClassname, boolean anAbstract) {
- return newBeanTypeForClass(anID, aClassname, anAbstract, this);
- }
-
- /**
- * The special method to handle subclassing from an abstract).
- */
- public IREMBeanTypeProxy newBeanTypeForClass(Integer anID, String aClassname, boolean anAbstract, IBeanTypeProxy superType) {
- if (!anAbstract)
- return new REMDimensionBeanTypeProxy(fRegistry, anID, aClassname, superType);
- else
- return new REMAnAbstractBeanTypeProxy(fRegistry, anID, aClassname, superType, this);
- }
-
- /**
- * Specialized from REMAbstractBeanTypeProxy to ensure ExceptionBeanProxies are created correctly.
- */
- public IREMBeanProxy newBeanProxy(Integer objectID) {
- return createDimensionBeanProxy(objectID);
- }
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/awt/REMPointBeanProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/awt/REMPointBeanProxy.java
deleted file mode 100644
index c817747f1..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/awt/REMPointBeanProxy.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote.awt;
-/*
-
-
- */
-
-import org.eclipse.jem.internal.proxy.remote.*;
-import org.eclipse.jem.internal.proxy.awt.*;
-import org.eclipse.jem.internal.proxy.core.*;
-
-/**
- * The REM Bean Proxy for java.awt.Point.
- */
-public class REMPointBeanProxy extends REMBeanProxy implements IPointBeanProxy {
-
- protected REMPointBeanProxy(REMProxyFactoryRegistry aRegistry, Integer anID, IBeanTypeProxy aType) {
- super(aRegistry, anID, aType);
- }
-
- public int getX() {
- try {
- IIntegerBeanProxy h = (IIntegerBeanProxy) JavaStandardAwtBeanConstants.getConstants(fFactory).getPointXFieldProxy().get(this);
- return h.intValue();
- } catch (ThrowableProxy e) {
- return 0;
- }
- }
-
- public int getY() {
- try {
- IIntegerBeanProxy h = (IIntegerBeanProxy) JavaStandardAwtBeanConstants.getConstants(fFactory).getPointYFieldProxy().get(this);
- return h.intValue();
- } catch (ThrowableProxy e) {
- return 0;
- }
- }
-
- public void setX(int x) {
- try {
- JavaStandardAwtBeanConstants.getConstants(fFactory).getPointXFieldProxy().set(this, fFactory.getBeanProxyFactory().createBeanProxyWith(x));
- } catch (ThrowableProxy e) {
- }
- }
-
- public void setY(int y) {
- try {
- JavaStandardAwtBeanConstants.getConstants(fFactory).getPointYFieldProxy().set(this, fFactory.getBeanProxyFactory().createBeanProxyWith(y));
- } catch (ThrowableProxy e) {
- }
- }
-
- public void setLocation(int x, int y) {
- JavaStandardAwtBeanConstants.getConstants(fFactory).getPointSetLocationXYProxy().invokeCatchThrowableExceptions(this, new IBeanProxy[] {fFactory.getBeanProxyFactory().createBeanProxyWith(x), fFactory.getBeanProxyFactory().createBeanProxyWith(y)});
- }
-
- public void setLocation(IPointBeanProxy fromPointProxy) {
- JavaStandardAwtBeanConstants.getConstants(fFactory).getPointSetLocationPProxy().invokeCatchThrowableExceptions(this, fromPointProxy);
- }
-}
-
-
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/awt/REMPointBeanTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/awt/REMPointBeanTypeProxy.java
deleted file mode 100644
index e0768ef80..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/awt/REMPointBeanTypeProxy.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote.awt;
-/*
-
-
- */
-
-import org.eclipse.jem.internal.proxy.remote.*;
-import org.eclipse.jem.internal.proxy.core.IBeanTypeProxy;
-/**
- * Beantype proxy for java.awt.Dimension
- */
-public class REMPointBeanTypeProxy extends REMAbstractBeanTypeProxy implements IREMSpecialBeanTypeProxy {
-
- protected REMPointBeanTypeProxy(REMProxyFactoryRegistry aRegistry, Integer anID, String aClassname, IBeanTypeProxy aSuperType) {
- super(aRegistry, anID, aClassname, aSuperType);
- }
-
- /**
- * Helper to create a bean proxy
- * Package protected because everyone should go through the factory API
- * that is defined as part of IBeanProxyFactory
- */
- REMPointBeanProxy createPointBeanProxy(Integer objectID) {
- return new REMPointBeanProxy(fRegistry, objectID, this);
- }
-
- /**
- * newBeanTypeForClass: Create a new beantypeproxy of this kind for the given class.
- * This is used by beantype proxy factory when creating a beantype proxy for a subclass.
- * This is because subclasses, unless explicitly overridden, should use the same kind
- * of beantype proxy. This way if anything special is needed for a specific type, then
- * that can be done.
- *
- * NOTE: All subclasses must override this to return the correct type of BeanTypeProxy.
- */
- public IREMBeanTypeProxy newBeanTypeForClass(Integer anID, String aClassname, boolean anAbstract) {
- return newBeanTypeForClass(anID, aClassname, anAbstract, this);
- }
-
- /**
- * The special method to handle subclassing from an abstract).
- */
- public IREMBeanTypeProxy newBeanTypeForClass(Integer anID, String aClassname, boolean anAbstract, IBeanTypeProxy superType) {
- if (!anAbstract)
- return new REMPointBeanTypeProxy(fRegistry, anID, aClassname, superType);
- else
- return new REMAnAbstractBeanTypeProxy(fRegistry, anID, aClassname, superType, this);
- }
-
- /**
- * Specialized from REMAbstractBeanTypeProxy to ensure ExceptionBeanProxies are created correctly.
- */
- public IREMBeanProxy newBeanProxy(Integer objectID) {
- return createPointBeanProxy(objectID);
- }
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/awt/REMRectangleBeanProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/awt/REMRectangleBeanProxy.java
deleted file mode 100644
index 96ee2ec26..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/awt/REMRectangleBeanProxy.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote.awt;
-/*
-
-
- */
-
-
-import org.eclipse.jem.internal.proxy.remote.*;
-import org.eclipse.jem.internal.proxy.awt.*;
-import org.eclipse.jem.internal.proxy.core.*;
-/**
- * The REM Bean Proxy for java.awt.Rectangle.
- */
-public class REMRectangleBeanProxy extends REMBeanProxy implements IRectangleBeanProxy {
-
- protected REMRectangleBeanProxy(REMProxyFactoryRegistry aRegistry, Integer anID, IBeanTypeProxy aType) {
- super(aRegistry, anID, aType);
- }
-
- public int getX() {
- try {
- IIntegerBeanProxy h = (IIntegerBeanProxy) JavaStandardAwtBeanConstants.getConstants(fFactory).getRectangleXFieldProxy().get(this);
- return h.intValue();
- } catch (ThrowableProxy e) {
- return 0;
- }
- }
-
- public int getY() {
- try {
- IIntegerBeanProxy h = (IIntegerBeanProxy) JavaStandardAwtBeanConstants.getConstants(fFactory).getRectangleYFieldProxy().get(this);
- return h.intValue();
- } catch (ThrowableProxy e) {
- return 0;
- }
- }
-
- public void setX(int x) {
- try {
- JavaStandardAwtBeanConstants.getConstants(fFactory).getRectangleXFieldProxy().set(this, fFactory.getBeanProxyFactory().createBeanProxyWith(x));
- } catch (ThrowableProxy e) {
- }
- }
-
- public void setY(int y) {
- try {
- JavaStandardAwtBeanConstants.getConstants(fFactory).getRectangleYFieldProxy().set(this, fFactory.getBeanProxyFactory().createBeanProxyWith(y));
- } catch (ThrowableProxy e) {
- }
- }
-
- public void setLocation(int x, int y) {
- JavaStandardAwtBeanConstants.getConstants(fFactory).getRectangleSetLocationXYProxy().invokeCatchThrowableExceptions(this, new IBeanProxy[] {fFactory.getBeanProxyFactory().createBeanProxyWith(x), fFactory.getBeanProxyFactory().createBeanProxyWith(y)});
- }
-
- public void setLocation(IPointBeanProxy fromPointProxy) {
- JavaStandardAwtBeanConstants.getConstants(fFactory).getRectangleSetLocationPProxy().invokeCatchThrowableExceptions(this, fromPointProxy);
- }
-
-
- public int getHeight() {
- try {
- IIntegerBeanProxy h = (IIntegerBeanProxy) JavaStandardAwtBeanConstants.getConstants(fFactory).getRectangleHeightFieldProxy().get(this);
- return h.intValue();
- } catch (ThrowableProxy e) {
- return 0;
- }
- }
-
- public int getWidth() {
- try {
- IIntegerBeanProxy h = (IIntegerBeanProxy) JavaStandardAwtBeanConstants.getConstants(fFactory).getRectangleWidthFieldProxy().get(this);
- return h.intValue();
- } catch (ThrowableProxy e) {
- return 0;
- }
- }
-
- public void setHeight(int height) {
- try {
- JavaStandardAwtBeanConstants.getConstants(fFactory).getRectangleHeightFieldProxy().set(this, fFactory.getBeanProxyFactory().createBeanProxyWith(height));
- } catch (ThrowableProxy e) {
- }
- }
-
- public void setWidth(int width) {
- try {
- JavaStandardAwtBeanConstants.getConstants(fFactory).getRectangleWidthFieldProxy().set(this, fFactory.getBeanProxyFactory().createBeanProxyWith(width));
- } catch (ThrowableProxy e) {
- }
- }
-
- public void setSize(int width, int height) {
- JavaStandardAwtBeanConstants.getConstants(fFactory).getRectangleSetSizeHWProxy().invokeCatchThrowableExceptions(this, new IBeanProxy[] {fFactory.getBeanProxyFactory().createBeanProxyWith(width), fFactory.getBeanProxyFactory().createBeanProxyWith(height)});
- }
-
- public void setSize(IDimensionBeanProxy fromDimensionProxy) {
- JavaStandardAwtBeanConstants.getConstants(fFactory).getRectangleSetSizeDProxy().invokeCatchThrowableExceptions(this, fromDimensionProxy);
- }
-
- public void setBounds(int x, int y, int width, int height) {
- JavaStandardAwtBeanConstants.getConstants(fFactory).getRectangleSetBoundsXYHWProxy().invokeCatchThrowableExceptions(this, new IBeanProxy[] {fFactory.getBeanProxyFactory().createBeanProxyWith(x), fFactory.getBeanProxyFactory().createBeanProxyWith(y), fFactory.getBeanProxyFactory().createBeanProxyWith(width), fFactory.getBeanProxyFactory().createBeanProxyWith(height)});
- }
-
- public void setBounds(IRectangleBeanProxy fromRectangleProxy) {
- JavaStandardAwtBeanConstants.getConstants(fFactory).getRectangleSetBoundsRProxy().invokeCatchThrowableExceptions(this, fromRectangleProxy);
- }
-}
-
-
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/awt/REMRectangleBeanTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/awt/REMRectangleBeanTypeProxy.java
deleted file mode 100644
index e272f5004..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/awt/REMRectangleBeanTypeProxy.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote.awt;
-/*
-
-
- */
-
-import org.eclipse.jem.internal.proxy.remote.*;
-import org.eclipse.jem.internal.proxy.core.IBeanTypeProxy;
-/**
- * Beantype proxy for java.awt.Dimension
- */
-public class REMRectangleBeanTypeProxy extends REMAbstractBeanTypeProxy implements IREMSpecialBeanTypeProxy {
-
- protected REMRectangleBeanTypeProxy(REMProxyFactoryRegistry aRegistry, Integer anID, String aClassname, IBeanTypeProxy aSuperType) {
- super(aRegistry, anID, aClassname, aSuperType);
- }
-
- /**
- * Helper to create a bean proxy
- * Package protected because everyone should go through the factory API
- * that is defined as part of IBeanProxyFactory
- */
- REMRectangleBeanProxy createRectangleBeanProxy(Integer objectID) {
- return new REMRectangleBeanProxy(fRegistry, objectID, this);
- }
-
- /**
- * newBeanTypeForClass: Create a new beantypeproxy of this kind for the given class.
- * This is used by beantype proxy factory when creating a beantype proxy for a subclass.
- * This is because subclasses, unless explicitly overridden, should use the same kind
- * of beantype proxy. This way if anything special is needed for a specific type, then
- * that can be done.
- *
- * NOTE: All subclasses must override this to return the correct type of BeanTypeProxy.
- */
- public IREMBeanTypeProxy newBeanTypeForClass(Integer anID, String aClassname, boolean anAbstract) {
- return newBeanTypeForClass(anID, aClassname, anAbstract, this);
- }
-
- /**
- * The special method to handle subclassing from an abstract).
- */
- public IREMBeanTypeProxy newBeanTypeForClass(Integer anID, String aClassname, boolean anAbstract, IBeanTypeProxy superType) {
- if (!anAbstract)
- return new REMRectangleBeanTypeProxy(fRegistry, anID, aClassname, superType);
- else
- return new REMAnAbstractBeanTypeProxy(fRegistry, anID, aClassname, superType, this);
- }
-
- /**
- * Specialized from REMAbstractBeanTypeProxy to ensure ExceptionBeanProxies are created correctly.
- */
- public IREMBeanProxy newBeanProxy(Integer objectID) {
- return createRectangleBeanProxy(objectID);
- }
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/awt/REMRegisterAWT.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/awt/REMRegisterAWT.java
deleted file mode 100644
index 2734556cf..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/awt/REMRegisterAWT.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote.awt;
-/*
-
-
- */
-
-import org.eclipse.jem.internal.proxy.core.IBeanTypeProxy;
-import org.eclipse.jem.internal.proxy.core.IMethodProxy;
-import org.eclipse.jem.internal.proxy.remote.REMProxyFactoryRegistry;
-/**
- * This class is used to register the AWT factories. It is not
- * meant to be called by anyone other than ProxyVMStarter.
- */
-public final class REMRegisterAWT {
- public static void registerAWT(REMProxyFactoryRegistry registry) {
- new REMStandardAWTBeanTypeProxyFactory(registry);
- new REMStandardAWTBeanProxyFactory(registry);
-
- // If we are doing AWT, get the AWT event queue going. This is trying to be a time-saver
- // by having it up right away.
- IBeanTypeProxy starterBeanType = registry.getBeanTypeProxyFactory().getBeanTypeProxy("org.eclipse.jem.internal.proxy.vm.remote.AWTStarter"); //$NON-NLS-1$
- if (starterBeanType != null) {
- IMethodProxy starter = starterBeanType.getMethodProxy("startAWT"); //$NON-NLS-1$
- if (starter != null)
- starter.invokeCatchThrowableExceptions(null);
- }
- }
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/awt/REMStandardAWTBeanProxyFactory.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/awt/REMStandardAWTBeanProxyFactory.java
deleted file mode 100644
index 6e938c4ea..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/awt/REMStandardAWTBeanProxyFactory.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote.awt;
-/*
-
-
- */
-
-import org.eclipse.jem.internal.proxy.awt.*;
-import org.eclipse.jem.internal.proxy.core.*;
-import org.eclipse.jem.internal.proxy.remote.REMProxyFactoryRegistry;
-
-/**
- * Standard AWT Bean Proxy Factory.
- * Package protected because it should not referenced
- * outside of the package other than through the interface.
- */
-class REMStandardAWTBeanProxyFactory implements IStandardAwtBeanProxyFactory {
-
- final IStandardBeanTypeProxyFactory fBeanTypeFactory;
-
- public REMStandardAWTBeanProxyFactory(REMProxyFactoryRegistry factory) {
- factory.registerBeanProxyFactory(IStandardAwtBeanProxyFactory.REGISTRY_KEY, this);
- fBeanTypeFactory = factory.getBeanTypeProxyFactory();
- }
-
- public IDimensionBeanProxy createDimensionBeanProxyWith(int width, int height){
- try {
- return (IDimensionBeanProxy) fBeanTypeFactory.getBeanTypeProxy("java.awt.Dimension").newInstance("new java.awt.Dimension("+width+","+height+")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- } catch (ThrowableProxy e) {
- return null;
- } catch (InstantiationException e) {
- return null; // Shouldn't occur
- }
- }
-
- public IPointBeanProxy createPointBeanProxyWith(int x, int y){
- try {
- return (IPointBeanProxy) fBeanTypeFactory.getBeanTypeProxy("java.awt.Point").newInstance("new java.awt.Point("+x+","+y+")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- } catch (ThrowableProxy e) {
- return null;
- } catch (InstantiationException e) {
- return null; // Shouldn't occur
- }
-
- }
-
- public IRectangleBeanProxy createBeanProxyWith(int x, int y, int width, int height){
- try {
- return (IRectangleBeanProxy) fBeanTypeFactory.getBeanTypeProxy("java.awt.Rectangle").newInstance("new java.awt.Rectangle("+x+","+y+","+width+","+height+")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
- } catch (ThrowableProxy e) {
- return null;
- } catch (InstantiationException e) {
- return null; // Shouldn't occur
- }
-
- }
-
- /*
- * Terminate this factory. Since it doesn't hold onto anything other than the beantype factory,
- * and nothing will be holding onto this factory, nothing needs to be done. It will be GC'd.
- */
- public void terminateFactory(boolean wait) {
- }
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/awt/REMStandardAWTBeanTypeProxyFactory.java b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/awt/REMStandardAWTBeanTypeProxyFactory.java
deleted file mode 100644
index 2e6d50f67..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/awt/REMStandardAWTBeanTypeProxyFactory.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.remote.awt;
-
-
-import org.eclipse.jem.internal.proxy.core.*;
-import org.eclipse.jem.internal.proxy.core.IBeanTypeProxy;
-import org.eclipse.jem.internal.proxy.remote.*;
-
-/**
- * BeanType factory standard AWT bean types. This is package protected because it shouldn't be referenced outside the package. It should only be
- * accessed through the interface.
- */
-class REMStandardAWTBeanTypeProxyFactory implements IREMBeanTypeProxyFactory {
-
- static final String BEAN_TYPE_FACTORY_KEY = "java.awt"; //$NON-NLS-1$
-
- protected final REMProxyFactoryRegistry fFactoryRegistry;
-
- REMStandardAWTBeanTypeProxyFactory(REMProxyFactoryRegistry aRegistry) {
- fFactoryRegistry = aRegistry;
- fFactoryRegistry.registerBeanTypeProxyFactory(BEAN_TYPE_FACTORY_KEY, this);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.remote.IREMBeanTypeProxyFactory#getExtensionBeanTypeProxy(java.lang.String)
- */
- public IREMBeanTypeProxy getExtensionBeanTypeProxy(String className) {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.remote.IREMBeanTypeProxyFactory#getExtensionBeanTypeProxy(java.lang.String, java.lang.Integer,
- * org.eclipse.jem.internal.proxy.core.IBeanTypeProxy)
- */
- public IREMBeanTypeProxy getExtensionBeanTypeProxy(String className, Integer classID, IBeanTypeProxy superType) {
-
- if ("java.awt.Dimension".equals(className)) //$NON-NLS-1$
- return new REMDimensionBeanTypeProxy(fFactoryRegistry, classID, className, superType);
- else if ("java.awt.Point".equals(className)) //$NON-NLS-1$
- return new REMPointBeanTypeProxy(fFactoryRegistry, classID, className, superType);
- else if ("java.awt.Rectangle".equals(className)) //$NON-NLS-1$
- return new REMRectangleBeanTypeProxy(fFactoryRegistry, classID, className, superType);
- else
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.remote.IREMBeanTypeProxyFactory#getExtensionBeanTypeProxy(java.lang.String,
- * org.eclipse.jem.internal.proxy.core.IExpression)
- */
- public IProxyBeanType getExtensionBeanTypeProxy(String typeName, IExpression expression) {
- return getExtensionBeanTypeProxy(typeName);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanProxyFactory#terminateFactory(boolean)
- */
- public void terminateFactory(boolean wait) {
- }
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/messages.properties b/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/messages.properties
deleted file mode 100644
index fca5f071a..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/messages.properties
+++ /dev/null
@@ -1,67 +0,0 @@
-###############################################################################
-# Copyright (c) 2003, 2005 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: /cvsroot/webtools/jeetools.move/webtools.javaee.git/plugins/org.eclipse.jem.proxy/proxyRemote/org/eclipse/jem/internal/proxy/remote/messages.properties,v $
-# $Revision: 1.17 $ $Date: 2006/09/14 18:29:35 $
-#
-
-
-
-# Exception message - {0} is the name of a project within Eclipse.
-NO_OUTPUT_FOLDER_EXC_ = IWAV0071E No output folder for project "{0}."
-
-# These are lines that are placed into a log file listing the outputs from the two different streams.
-VM_TERMINATED_INFO_ = IWAV0072I Remote VM terminated before any commands can be sent. Following are the error and output streams.
-VM_TERMINATED_LINE1 = -- Error Stream --
-VM_TERMINATED_LINE2 = -- Output Stream --
-VM_TERMINATED_LINE3 = -- End of Stream Output --
-
-# These are the headers for two parts of a stack trace of an exception. The first one is the trace from the remote system.
-# The second is the trace from the local system.
-REMOTE_VM_TRACE_INFO_ = IWAV0073I *** RemoteVM Exception - Trace from Remote VM:
-REMOTE_VM_LOCAL_TRACE_INFO_ = IWAV0074I *** Local StackTrace:
-
-# In the two below, {0} is a string that is a java creation string, e.g. "new Integer(3)", so they don't participate in translation.
-# In Classcast, {1} is a java type name, e.g. java.lang.Integer.
-Classcast_EXC_ = IWAV0124E "{0}" does not evaluate to an object of type {1}
-Instantiate_EXC_ = IWAV0125E "{0}" is too complicated to be evaluated
-
-# {0} is a number, e.g. 1, 2, ...
-RemoteCmd_EXC_ = IWAV0126E Remote command error {0}
-
-# The following is an exception error where {0} is the name of the class of the exception and {1} is the message from the exception
-# The message {1} has already been localized (if it supplied it localized). It comes from somewhere outside of our project.
-ExceptionErrorMsg_EXC_ = IWAV0135E {0}({1})
-OK_7 = OK
-Proxy_NoRunner_ERROR_ = IWAV0137E Could not find a Run type runner to launch for \"{0}\".
-Proxy_Error_Title = Error:
-Proxy_Terminated_too_soon_ERROR_ = IWAV0138E Remote VM terminated too soon. See .log file for trace of output. For VM \"{0}\".
-# This is a launch name for a given project name ({0}).
-# WARNING for the ProxyRemoteVMName and ProxyRemoteVMNameWithComment do not use double-quote ("). It will cause problems.
-ProxyRemoteVMName = Project ({0})
-# This is a launch name that has a comment ({0} is project name, {1} is the comment for this project launch)
-ProxyRemoteVMNameWithComment = Project ({0})-{1}
-
-ProxyRemoteNoLaunchKey = Cannot launch local proxy registry. Not launched from valid launcher.
-
-# {0} is the appropriate VMName from the above two entries.
-ProxyRemoteLaunchVM = Launching remote vm "{0}"
-
-CleanupJob_title = Remote VM Cleanup GC'd Proxies Job
-
-REMProxyFactoryRegistry_CallbackConnectionNotWorking_EXC_ = IWAV0169E Callback connection is not working.
-REMProxyFactoryRegistry_ConnectionCreationFailed_INFO_ = IWAV0170I Connection creation failed.
-REMProxyFactoryRegistry_Job_TerminateProcess_Title=Terminate the remote vm process.
-REMProxyFactoryRegistry_CouldNotCreateSocketConnectionToRemoteVM_EXC_ = IWAV0171E Could not create a socket connection to remote vm. This is often due to your firewall blocking access from your java to do local access.
-REMExpression_IOExceptionSeeLog_INFO_ = IWAV0172I I/O Exception occurred. See .log file for details.
-REMExpression_CommandExceptionSeeLog_INFO_ = IWAV0173I Command Exception occurred. See .log file for details.
-LocalProxyLaunchDelegate_Monitor_PrintRemoteTrace_Text=Print remote vm trace output
-VM_COMMAND_LINE=Remote VM Commandline:
diff --git a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEAccessibleObjectProxy.java b/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEAccessibleObjectProxy.java
deleted file mode 100644
index 66fdfcf67..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEAccessibleObjectProxy.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 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.jem.internal.proxy.ide;
-
-import java.lang.reflect.AccessibleObject;
-
-import org.eclipse.jem.internal.proxy.core.*;
-
-/**
- *
- * @since 1.0.0
- */
-public class IDEAccessibleObjectProxy extends IDEBeanProxy implements IAccessibleObjectProxy {
-
- protected IDEAccessibleObjectProxy(IDEProxyFactoryRegistry aProxyFactoryRegistry) {
- super(aProxyFactoryRegistry);
- }
-
- protected IDEAccessibleObjectProxy(IDEProxyFactoryRegistry aProxyFactoryRegistry, Object anObject) {
- super(aProxyFactoryRegistry, anObject);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IAccessibleObjectProxy#isAccessible()
- */
- public boolean isAccessible() throws ThrowableProxy {
- return ((AccessibleObject) getBean()).isAccessible();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IAccessibleObjectProxy#setAccessible(boolean)
- */
- public void setAccessible(boolean flag) throws ThrowableProxy {
- ((AccessibleObject) getBean()).setAccessible(flag);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IBeanProxy#getTypeProxy()
- */
- public IBeanTypeProxy getTypeProxy() {
- return ((IDEMethodProxyFactory) fProxyFactoryRegistry.getMethodProxyFactory()).accessibleType;
- }
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEArrayBeanProxy.java b/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEArrayBeanProxy.java
deleted file mode 100644
index 1d3244667..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEArrayBeanProxy.java
+++ /dev/null
@@ -1,322 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.ide;
-/*
-
-
- */
-
-import org.eclipse.jem.internal.proxy.core.*;
-import java.lang.reflect.*;
-import java.util.Arrays;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-/**
- * IDE VM version of the Array proxy
- */
-
-public final class IDEArrayBeanProxy extends IDEObjectBeanProxy implements IArrayBeanProxy {
-
- private IDEStandardBeanTypeProxyFactory fBeanTypeProxyFactory;
-
-IDEArrayBeanProxy(IDEProxyFactoryRegistry aRegistry, Object array,IBeanTypeProxy aType) {
- super(aRegistry, array ,aType);
- fBeanTypeProxyFactory = (IDEStandardBeanTypeProxyFactory)aRegistry.getBeanTypeProxyFactory();
-}
-
-/* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.ide.IDEBeanProxy#equals(java.lang.Object)
- */
-public boolean equals(Object obj) {
- if (super.equals(obj))
- return true;
- if (!(obj instanceof IDEArrayBeanProxy))
- return false;
- Object arrayBean = ((IDEArrayBeanProxy) obj).getBean();
-
- if (getBean() == null || arrayBean == null)
- return false;
- Object thisArrayBean = getBean();
- Class aclass = thisArrayBean.getClass();
- Class bclass = arrayBean.getClass();
- Class acomp = aclass.getComponentType();
- Class bcomp = bclass.getComponentType();
- if (acomp.isPrimitive() || bcomp.isPrimitive()) {
- if (acomp != bcomp)
- return false;
- if (acomp == Integer.TYPE)
- return Arrays.equals((int[]) thisArrayBean, (int[]) arrayBean);
- else if (acomp == Boolean.TYPE)
- return Arrays.equals((boolean[]) thisArrayBean, (boolean[]) arrayBean);
- else if (acomp == Long.TYPE)
- return Arrays.equals((long[]) thisArrayBean, (long[]) arrayBean);
- else if (acomp == Short.TYPE)
- return Arrays.equals((short[]) thisArrayBean, (short[]) arrayBean);
- else if (acomp == Double.TYPE)
- return Arrays.equals((double[]) thisArrayBean, (double[]) arrayBean);
- else if (acomp == Float.TYPE)
- return Arrays.equals((float[]) thisArrayBean, (float[]) arrayBean);
- else if (acomp == Character.TYPE)
- return Arrays.equals((char[]) thisArrayBean, (char[]) arrayBean);
- else if (acomp == Byte.TYPE)
- return Arrays.equals((byte[]) thisArrayBean, (byte[]) arrayBean);
- else
- return false;
- } else
- return Arrays.equals((Object[]) thisArrayBean, (Object[]) arrayBean);
-}
-/**
- * Get the object at the specified index.
- */
-public IBeanProxy get(int index) throws ThrowableProxy {
- // If the component type is primitive, we need to use the correct getter so that a valid value is returned,
- // if we just used the standard get, if the type was "int" the value returned would be an java.lang.Integer.
- IBeanTypeProxy compType = ((IArrayBeanTypeProxy) getTypeProxy()).getComponentType();
- if (!compType.isPrimitive()) {
- // Use standard getter.
- Object result = Array.get(fBean,index);
- if ( result == null ) return null;
- return ((IDEBeanTypeProxy)fBeanTypeProxyFactory.getBeanTypeProxy(result.getClass())).newBeanProxy(result);
- } else {
- // Use the correct primitive getter.
- int id = ((IDEPrimitiveBeanTypeProxy)compType).getPrimitiveType();
- switch (id) {
- case IDEPrimitiveBeanTypeProxy.BYTE:
- return fBeanTypeProxyFactory.byteType.createByteBeanProxy(Array.getByte(fBean,index));
- case IDEPrimitiveBeanTypeProxy.BOOLEAN:
- return fBeanTypeProxyFactory.booleanType.createBooleanBeanProxy(Array.getBoolean(fBean,index));
- case IDEPrimitiveBeanTypeProxy.CHAR:
- return fBeanTypeProxyFactory.charType.createCharBeanProxy(Array.getChar(fBean,index));
- case IDEPrimitiveBeanTypeProxy.DOUBLE:
- return fBeanTypeProxyFactory.doubleType.createDoubleBeanProxy(Array.getDouble(fBean,index));
- case IDEPrimitiveBeanTypeProxy.FLOAT:
- return fBeanTypeProxyFactory.floatType.createFloatBeanProxy(Array.getFloat(fBean,index));
- case IDEPrimitiveBeanTypeProxy.INTEGER:
- return fBeanTypeProxyFactory.intType.createIntegerBeanProxy(Array.getInt(fBean,index));
- case IDEPrimitiveBeanTypeProxy.LONG:
- return fBeanTypeProxyFactory.longType.createLongBeanProxy(Array.getLong(fBean,index));
- case IDEPrimitiveBeanTypeProxy.SHORT:
- return fBeanTypeProxyFactory.shortType.createShortBeanProxy(Array.getShort(fBean,index));
- default :
- return null; // Shouldn't get here, said it was primitive, but not one we understand
- }
- }
-}
-/**
- * Get the object at the specified multi-dimensional index.
- * The array must be at least the number of dimensions specified,
- * and each index along the way must exist.
- * The number of dimensions can't be greater than the number
- * of dimensions of the real object.
- */
-public IBeanProxy get(int[] indexes) throws ThrowableProxy {
- if (indexes.length == 1)
- return get(indexes[0]);
- int dims = ((IArrayBeanTypeProxy) getTypeProxy()).getDimensions();
- if (dims < indexes.length)
- throw new IllegalArgumentException(); // Too many dimensions
- // Get up to the next to last dimension so that we can do the appropriate final get depending upon primitive or not.
- Object array = fBean;
- int lastArrayDim = indexes.length - 1;
- for (int i = 0; i < lastArrayDim; i++)
- array = Array.get(array, indexes[i]);
-
- int index = indexes[lastArrayDim]; // Final array dim to retrieve
-
- if (dims == indexes.length) {
- IBeanTypeProxy finalCompType = ((IArrayBeanTypeProxy) getTypeProxy()).getFinalComponentType();
- if (finalCompType.isPrimitive()) {
- // If the component type at the specified dimension is primitive, we need to use the correct getter so that a valid value is returned,
- // if we just used the standard get, if the type was "int" the value returned would be an java.lang.Integer.
- int id = ((IDEPrimitiveBeanTypeProxy) finalCompType).getPrimitiveType();
- switch (id) {
- case IDEPrimitiveBeanTypeProxy.BYTE :
- return fBeanTypeProxyFactory.byteType.createByteBeanProxy(Array.getByte(array, index));
- case IDEPrimitiveBeanTypeProxy.BOOLEAN :
- return fBeanTypeProxyFactory.booleanType.createBooleanBeanProxy(Array.getBoolean(array, index));
- case IDEPrimitiveBeanTypeProxy.CHAR :
- return fBeanTypeProxyFactory.charType.createCharBeanProxy(Array.getChar(array, index));
- case IDEPrimitiveBeanTypeProxy.DOUBLE :
- return fBeanTypeProxyFactory.doubleType.createDoubleBeanProxy(Array.getDouble(array, index));
- case IDEPrimitiveBeanTypeProxy.FLOAT :
- return fBeanTypeProxyFactory.floatType.createFloatBeanProxy(Array.getFloat(array, index));
- case IDEPrimitiveBeanTypeProxy.INTEGER :
- return fBeanTypeProxyFactory.intType.createIntegerBeanProxy(Array.getInt(array, index));
- case IDEPrimitiveBeanTypeProxy.LONG :
- return fBeanTypeProxyFactory.longType.createLongBeanProxy(Array.getLong(array, index));
- case IDEPrimitiveBeanTypeProxy.SHORT :
- return fBeanTypeProxyFactory.shortType.createShortBeanProxy(Array.getShort(array, index));
- default :
- return null; // Shouldn't get here, said it was primitive, but not one we understand
- }
- }
- }
-
- // Won't be returning a primitive, so use standard accessor
- Object result = Array.get(array, index);
- if (result == null)
- return null;
- return ((IDEBeanTypeProxy) fBeanTypeProxyFactory.getBeanTypeProxy(result.getClass())).newBeanProxy(
- result);
-}
-
-/**
- * Set the object at the specified index.
- */
-public void set(IBeanProxy valueProxy, int index) throws ThrowableProxy {
- // If the component type is primitive, we need to use the correct getter so that a valid value is returned,
- // if we just used the standard get, if the type was "int" the value returned would be an java.lang.Integer.
- Object value = ((IIDEBeanProxy)valueProxy).getBean();
- Class valueClass = value.getClass();
- if (!valueClass.isPrimitive()) {
- // Use standard getter.
- Array.set(fBean,index,value);
- } else if (valueClass == Byte.TYPE ) {
- Array.setByte(fBean,index,((Byte)value).byteValue());
- } else if (valueClass == Boolean.TYPE ){
- Array.setBoolean(fBean,index,((Boolean)value).booleanValue());
- } else if (valueClass == Character.TYPE) {
- Array.setChar(fBean,index,((Character)value).charValue());
- } else if (valueClass == Double.TYPE) {
- Array.setDouble(fBean,index,((Double)value).doubleValue());
- } else if (valueClass == Float.TYPE) {
- Array.setFloat(fBean,index,((Float)value).floatValue());
- } else if (valueClass == Integer.TYPE) {
- Array.setInt(fBean,index,((Integer)value).intValue());
- } else if (valueClass == Long.TYPE ) {
- Array.setLong(fBean,index,((Long)value).longValue());
- } else if (valueClass == Short.TYPE ) {
- Array.setShort(fBean,index,((Short)value).shortValue());
- }
-}
-/**
- * Set the object at the specified multi-dimensional index.
- * The array must be at least the number of dimensions specified,
- * and each index along the way must exist.
- * The number of dimensions can't be greater than the number
- * of dimensions of the real object.
- */
-public void set(IBeanProxy valueProxy, int[] indexes) throws ThrowableProxy {
-
- Object subArray = fBean;
- int upTo = indexes.length - 1;
- for (int i = 0; i < upTo; i++)
- subArray = Array.get(subArray, indexes[i]);
- int index = indexes[upTo];
-
- // Now set the appropriate value in
- // If the component type is primitive, we need to use the correct getter so that a valid value is returned,
- // if we just used the standard get, if the type was "int" the value returned would be an java.lang.Integer.
- Object value = ((IIDEBeanProxy) valueProxy).getBean();
- Class valueClass = value.getClass();
- if (!valueClass.isPrimitive()) {
- // Use standard getter.
- Array.set(subArray, index, value);
- } else if (valueClass == Byte.TYPE) {
- Array.setByte(subArray, index, ((Byte) value).byteValue());
- } else if (valueClass == Boolean.TYPE) {
- Array.setBoolean(subArray, index, ((Boolean) value).booleanValue());
- } else if (valueClass == Character.TYPE) {
- Array.setChar(subArray, index, ((Character) value).charValue());
- } else if (valueClass == Double.TYPE) {
- Array.setDouble(subArray, index, ((Double) value).doubleValue());
- } else if (valueClass == Float.TYPE) {
- Array.setFloat(subArray, index, ((Float) value).floatValue());
- } else if (valueClass == Integer.TYPE) {
- Array.setInt(subArray, index, ((Integer) value).intValue());
- } else if (valueClass == Long.TYPE) {
- Array.setLong(subArray, index, ((Long) value).longValue());
- } else if (valueClass == Short.TYPE) {
- Array.setShort(subArray, index, ((Short) value).shortValue());
- }
-
-}
-/**
- * Get the length of the first dimension of this array.
- * If there are multi-dimensions, you must get the appropriate
- * dimension from the get method to see the size of that dimension.
- *
- * e.g.
- * int [3] returns 3
- * int [3][2] returns 3
- *
- * ((IArrayBeanProxy) get(1)).getLength() returns 2
- * Since arrays do not have to be homogenous, there could
- * be a different length array for each of the arrays
- * returned from the first dimension, the returned length
- * from get(2) and get(3) could result in a different value
- * from get(1).
- */
-public int getLength() {
- return Array.getLength(fBean);
-}
- /**
- * @see org.eclipse.jem.internal.proxy.core.IArrayBeanProxy#getCatchThrowableException(int)
- */
- public IBeanProxy getCatchThrowableException(int index) {
- try {
- return get(index);
- } catch ( ThrowableProxy exc ) {
- ProxyPlugin.getPlugin().getLogger().log(new Status(IStatus.WARNING, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "", exc)); //$NON-NLS-1$
- return null;
- }
- }
-
-
- public IBeanProxy[] getSnapshot() throws ThrowableProxy {
- // If the component type is primitive, we need to use the correct getter so that a valid value is returned,
- // if we just used the standard get, if the type was "int" the value returned would be an java.lang.Integer.
- IBeanTypeProxy compType = ((IArrayBeanTypeProxy) getTypeProxy()).getComponentType();
- int id = compType.isPrimitive() ? ((IDEPrimitiveBeanTypeProxy)compType).getPrimitiveType() : -1;
- IBeanProxy[] result = new IBeanProxy[Array.getLength(fBean)];
- for (int i = 0; i < result.length; i++) {
- if (id == -1) {
- // Use standard getter.
- Object val = Array.get(fBean,i);
- if ( val != null )
- result[i] = ((IDEBeanTypeProxy)fBeanTypeProxyFactory.getBeanTypeProxy(val.getClass())).newBeanProxy(val);
- } else {
- // Use the correct primitive getter.
- switch (id) {
- case IDEPrimitiveBeanTypeProxy.BYTE:
- result[i] = fBeanTypeProxyFactory.byteType.createByteBeanProxy(Array.getByte(fBean,i));
- break;
- case IDEPrimitiveBeanTypeProxy.BOOLEAN:
- result[i] = fBeanTypeProxyFactory.booleanType.createBooleanBeanProxy(Array.getBoolean(fBean,i));
- break;
- case IDEPrimitiveBeanTypeProxy.CHAR:
- result[i] = fBeanTypeProxyFactory.charType.createCharBeanProxy(Array.getChar(fBean,i));
- break;
- case IDEPrimitiveBeanTypeProxy.DOUBLE:
- result[i] = fBeanTypeProxyFactory.doubleType.createDoubleBeanProxy(Array.getDouble(fBean,i));
- break;
- case IDEPrimitiveBeanTypeProxy.FLOAT:
- result[i] = fBeanTypeProxyFactory.floatType.createFloatBeanProxy(Array.getFloat(fBean,i));
- break;
- case IDEPrimitiveBeanTypeProxy.INTEGER:
- result[i] = fBeanTypeProxyFactory.intType.createIntegerBeanProxy(Array.getInt(fBean,i));
- break;
- case IDEPrimitiveBeanTypeProxy.LONG:
- result[i] = fBeanTypeProxyFactory.longType.createLongBeanProxy(Array.getLong(fBean,i));
- break;
- case IDEPrimitiveBeanTypeProxy.SHORT:
- result[i] = fBeanTypeProxyFactory.shortType.createShortBeanProxy(Array.getShort(fBean,i));
- break;
- default :
- break; // Shouldn't get here, said it was primitive, but not one we understand
- }
- }
- }
- return result;
- }
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEArrayBeanTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEArrayBeanTypeProxy.java
deleted file mode 100644
index a9d7cf420..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEArrayBeanTypeProxy.java
+++ /dev/null
@@ -1,326 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.ide;
-
-/*
-
-
- */
-
-import org.eclipse.jem.internal.proxy.core.*;
-
-import java.lang.reflect.*;
-
-/**
- * Array Type Proxy for the IDE VM.
- *
- * The class is final because array's are special and shouldn't have any subclasses since the factory would never call it.
- */
-
-public final class IDEArrayBeanTypeProxy extends IDEBeanTypeProxy implements IArrayBeanTypeProxy {
-
- IBeanTypeProxy fFinalComponentType;
-
- IBeanTypeProxy fComponentType;
-
- String fTypeName;
-
- /**
- * Create with a registry and a class. It is package so that only the factory with this IDE package can call it.
- */
- IDEArrayBeanTypeProxy(IDEProxyFactoryRegistry aRegistry, String aTypeName, Class aClass) {
- // The class of an Array is always Object
- super(aRegistry, aClass);
- fTypeName = aTypeName;
- }
-
- /**
- * This is an array type!
- */
- public boolean isArray() {
- return true;
- }
-
- public String getTypeName() {
- return fTypeName;
- }
-
- /**
- * Return the final component type.
- */
- public IBeanTypeProxy getFinalComponentType() {
- if (fFinalComponentType == null) {
- // Component type is strip off all '[' and return class name (if we ever add classLoader support, this won't work).
- // However, if the type is a primitive we need to go through the change table).
- int typeStart = getTypeName().lastIndexOf('[') + 1;
- if (getTypeName().charAt(typeStart) == 'L') {
- // It is a class.
- // Strip off up to the 'L', and the trailing ';'. That is the class name.
- fFinalComponentType = fProxyFactoryRegistry.getBeanTypeProxyFactory().getBeanTypeProxy(
- getTypeName().substring(typeStart + 1, getTypeName().length() - 1));
- } else {
- // It is a type. Need to map it.
- Class aType = (Class) IDEStandardBeanTypeProxyFactory.MAP_SHORTSIG_TO_TYPE.get(getTypeName().substring(typeStart, typeStart + 1));
- fFinalComponentType = aType != null ? fProxyFactoryRegistry.getBeanTypeProxyFactory().getBeanTypeProxy(aType.getName()) : null;
- }
- }
- return fFinalComponentType;
- }
-
- /**
- * Return the component type.
- */
- public IBeanTypeProxy getComponentType() {
- if (fComponentType == null) {
- // Component type is strip off first '[' and return class name (if we ever add classLoader support, this won't work).
- // However, if the type is a primitive we need to go through the change table).
- if (getTypeName().charAt(1) != '[') {
- // It is a one dimensional array, just send to getFinalComponentType to figure out the type.
- fComponentType = getFinalComponentType();
- } else {
- // It is a multi-dimensional array. Just strip off one '[' and send that to the bean type factory.
- fComponentType = fProxyFactoryRegistry.getBeanTypeProxyFactory().getBeanTypeProxy(getTypeName().substring(1));
- }
- }
- return fComponentType;
- }
-
- /**
- * Return the number of dimensions.
- */
- public int getDimensions() {
- return getTypeName().lastIndexOf('[') + 1;
- }
-
- /**
- * Return the null ctor proxy for this method with these arguments. For all of the array types, this is an invalid operation.
- */
- public IConstructorProxy getNullConstructorProxy() {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Return a proxy to the constructor for the target VM being the same as the REM For all of the array types, this is an invalid operation.
- */
- public IConstructorProxy getConstructorProxy(String[] argumentClassNames) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Return a proxy to the constructor for the target VM being the same as the REM For all of the array types, this is an invalid operation.
- */
- public IConstructorProxy getConstructorProxy(IBeanTypeProxy[] argumentTypes) {
- throw new UnsupportedOperationException();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getConstructors() For all of the array types, this is an invalid operation.
- */
- public IConstructorProxy[] getConstructors() {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Return a proxy to the constructor for the target VM being the same as the REM For all of the array types, this is an invalid operation.
- */
- public IConstructorProxy getDeclaredConstructorProxy(String[] argumentClassNames) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Return a proxy to the constructor for the target VM being the same as the REM For all of the array types, this is an invalid operation.
- */
- public IConstructorProxy getDeclaredConstructorProxy(IBeanTypeProxy[] argumentTypes) {
- throw new UnsupportedOperationException();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getConstructors() For all of the array types, this is an invalid operation.
- */
- public IConstructorProxy[] getDeclaredConstructors() {
- throw new UnsupportedOperationException();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getConstructors() For all of the array types, this is an invalid operation.
- */
- public IFieldProxy[] getFields() {
- throw new UnsupportedOperationException();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getCompatibleConstructor(org.eclipse.jem.internal.proxy.core.IBeanTypeProxy[])
- */
- public IConstructorProxy getCompatibleConstructor(IBeanTypeProxy[] argumentTypes) {
- throw new UnsupportedOperationException();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getCompatibleMethod(java.lang.String,
- * org.eclipse.jem.internal.proxy.core.IBeanTypeProxy[])
- */
- public IMethodProxy getCompatibleMethod(String methodName, IBeanTypeProxy[] argumentTypes) {
- throw new UnsupportedOperationException();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getConstructors() For all of the array types, this is an invalid operation.
- */
- public IFieldProxy[] getDeclaredFields() {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Return a proxy to the field for the target VM being the same as the REM For all of the array types, this is an invalid operation.
- */
- public IFieldProxy getFieldProxy(String fieldName) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Return the method proxy for this method with these arguments. For all of the array types, this is an invalid operation.
- */
- public IMethodProxy getMethodProxy(String methodName, IBeanTypeProxy[] argumentTypes) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Return the method proxy for this method with these arguments. For all of the array types, this is an invalid operation.
- */
- public IMethodProxy getMethodProxy(String methodName, String[] argumentClassNames) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Return the method proxy for this method with these arguments. For all of the array types, this is an invalid operation.
- */
- public IMethodProxy getMethodProxy(String methodName, String argumentQualifiedTypeName) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Return the method proxy for this method with these arguments. For all of the array types, this is an invalid operation.
- */
- public IMethodProxy getMethodProxy(String methodName) {
- throw new UnsupportedOperationException();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getConstructors() For all of the array types, this is an invalid operation.
- */
- public IMethodProxy[] getMethods() {
- throw new UnsupportedOperationException();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getConstructors() For all of the array types, this is an invalid operation.
- */
- public IMethodProxy[] getDeclaredMethods() {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Return the method proxy for this method with these arguments. For all of the array types, this is an invalid operation.
- */
- public IMethodProxy getDeclaredMethodProxy(String methodName, IBeanTypeProxy[] argumentTypes) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Return the method proxy for this method with these arguments. For all of the array types, this is an invalid operation.
- */
- public IMethodProxy getDeclaredMethodProxy(String methodName, String[] argumentClassNames) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Create an array bean proxy.
- * - (int, new int[2] {3, 4}) will create: int [3] [4]
- * - (int[], new int[1] {1}) int [1]
- * - (int[], new int[2] {2,3}) int [2] [3]
- *
- * - (int[], null) or (int[], new int[0]) or (int, null) or (int, new int[0]) int [0] (int[][], null) or (int[][], new int[0]) int[0][] This is
- * because an array instance with no dimensions specified is not valid.
- * - (int[][], new int[1] {3}) int[3][]
- *
- * It is package protected so that only the REM Factory can call it.
- */
- IDEArrayBeanProxy createBeanProxyWith(int[] dimensions) throws ThrowableProxy {
- // If the dimensions is null or zero length, then create the
- // array as a 0 sized array one dimensional array.
- if (dimensions == null || dimensions.length == 0)
- return createBeanProxyWith(new int[] { 0});
-
- // Remove from this type the number of dimensions specified
- // coming in, up to but no further than the final component.
- // From here we can then use the appropriate java.lang.reflect.Array
- // method to create the array.
- IBeanTypeProxy compType = null; // The type of array to create (it may be different number of dimensions).
- int numDims = getDimensions();
- if (numDims <= dimensions.length)
- compType = getFinalComponentType(); // There are the same or more requested dimensions, so use final component type
- else {
- // There are fewer requested dimensions, so strip off that many
- String compClass = getTypeName().substring(dimensions.length);
- compType = fProxyFactoryRegistry.getBeanTypeProxyFactory().getBeanTypeProxy(compClass);
- }
-
- if (dimensions.length == 1) {
- // Use the one dimension call
- Object array = Array.newInstance(((IDEBeanTypeProxy) compType).fClass, dimensions[0]);
- return new IDEArrayBeanProxy(fProxyFactoryRegistry, array, null);
- } else {
- // Use the multi dimension call
- Object array = Array.newInstance(((IDEBeanTypeProxy) compType).fClass, dimensions);
- return new IDEArrayBeanProxy(fProxyFactoryRegistry, array, null);
- }
- }
-
- /**
- * Create a new bean proxy with the specified object
- */
- protected IIDEBeanProxy newBeanProxy(Object anObject) {
-
- return new IDEArrayBeanProxy(fProxyFactoryRegistry, anObject, this);
-
- }
-
- /**
- * @see IBeanTypeProxy#getFormalTypeName()
- */
- public String getFormalTypeName() {
- String name = getTypeName();
- int dims = name.lastIndexOf('[') + 1;
- String type = getFinalComponentType().getTypeName();
- StringBuffer formalType = new StringBuffer(type.length() + ("[]".length() * dims)); //$NON-NLS-1$
- formalType.append(type);
- for (int i = 0; i < dims; i++)
- formalType.append("[]"); //$NON-NLS-1$
- return formalType.toString();
- }
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEBeanProxy.java b/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEBeanProxy.java
deleted file mode 100644
index 52ed180d3..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEBeanProxy.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.ide;
-/*
-
-
- */
-
-import org.eclipse.jem.internal.proxy.core.*;
-
-public abstract class IDEBeanProxy implements IBeanProxy, IIDEBeanProxy {
-
- protected Object fBean;
- protected final IDEProxyFactoryRegistry fProxyFactoryRegistry;
-
- protected IDEBeanProxy(IDEProxyFactoryRegistry aProxyFactoryRegistry) {
- fProxyFactoryRegistry = aProxyFactoryRegistry;
- }
- protected IDEBeanProxy(IDEProxyFactoryRegistry aProxyFactoryRegistry, Object anObject) {
- fProxyFactoryRegistry = aProxyFactoryRegistry;
- fBean = anObject;
- }
- public boolean isValid() {
- return true;
- }
- public ProxyFactoryRegistry getProxyFactoryRegistry() {
- return fProxyFactoryRegistry;
- }
- /**
- * USE with extreme care
- */
- public final Object getBean() {
- return fBean;
- }
- /**
- * Return the toString() of the bean
- */
- public String toBeanString() {
- return (fBean != null ? fBean.toString() : "null"); //$NON-NLS-1$
- }
- /**
- Append the bean's to string to our own name if we have one
- */
- public String toString() {
-
- if (fBean == null)
- return super.toString();
- else
- return super.toString() + "(" + fBean.toString() + ")"; //$NON-NLS-2$//$NON-NLS-1$
-
- }
- /**
- * equals: If there are identical or if they wrapper the same bean. In the IDE VM this
- * can happen if bean proxies are created from a Bean, since proxies aren't cached in
- * the beanproxy factory, more than one proxy can be created for the same bean.
- */
- public boolean equals(Object obj) {
- if (super.equals(obj))
- return true;
- if (obj instanceof IIDEBeanProxy) {
- return fBean.equals(((IIDEBeanProxy) obj).getBean());
- }
- return false;
- }
-
- public int hashCode() {
- return 12345 + (getBean() != null ? getBean().hashCode() : 0);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IBeanProxy#sameAs(org.eclipse.jem.internal.proxy.core.IBeanProxy)
- */
- public boolean sameAs(IBeanProxy aBeanProxy) {
- if (this == aBeanProxy)
- return true;
- if (aBeanProxy instanceof IIDEBeanProxy)
- return getBean() == ((IIDEBeanProxy) aBeanProxy).getBean();
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IProxy#isBeanProxy()
- */
- public final boolean isBeanProxy() {
- return true;
- }
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IProxy#isExpressionProxy()
- */
- public final boolean isExpressionProxy() {
- return false;
- }
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEBeanTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEBeanTypeProxy.java
deleted file mode 100644
index 4401b7e2a..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEBeanTypeProxy.java
+++ /dev/null
@@ -1,451 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- *******************************************************************************/
-/*
- * $RCSfile: IDEBeanTypeProxy.java,v $ $Revision: 1.16 $ $Date: 2006/05/17 20:13:05 $
- */
-package org.eclipse.jem.internal.proxy.ide;
-
-import org.eclipse.jem.internal.proxy.common.AmbiguousMethodException;
-import org.eclipse.jem.internal.proxy.core.*;
-
-import java.lang.reflect.*;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-
-public class IDEBeanTypeProxy extends IDEBeanProxy implements IBeanTypeProxy {
-
- protected IDEProxyFactoryRegistry fProxyFactoryRegistry;
-
- Class fClass;
-
- protected IDEBeanTypeProxy(IDEProxyFactoryRegistry aRegistry, Class aClass) {
- super(aRegistry, aClass);
- fProxyFactoryRegistry = aRegistry;
- fClass = aClass;
- }
-
- /**
- * Get Type Proxy. The type proxy of a BeanType is Class.
- */
- public IBeanTypeProxy getTypeProxy() {
- return ((IDEStandardBeanTypeProxyFactory) fProxyFactoryRegistry.getBeanTypeProxyFactory()).classClass;
- }
-
- public Class getTypeClass() {
- return fClass;
- }
-
- public String toBeanString() {
- return fClass.toString();
- }
-
- public ProxyFactoryRegistry getProxyFactoryRegistry() {
- return fProxyFactoryRegistry;
- }
-
- public String getTypeName() {
- return fClass.getName();
- }
-
- public boolean isKindOf(IBeanTypeProxy aBeanTypeProxy) {
- return ((IDEBeanTypeProxy) aBeanTypeProxy).fClass.isAssignableFrom(fClass);
- }
-
- public boolean isInterface() {
- return fClass.isInterface();
- }
-
- public boolean isPrimitive() {
- return fClass.isPrimitive();
- }
-
- public boolean isArray() {
- return fClass.isArray();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getConstructors()
- */
- public IMethodProxy[] getMethods() {
- return ((IDEMethodProxyFactory) fProxyFactoryRegistry.getMethodProxyFactory()).getMethods(fClass);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getConstructors()
- */
- public IMethodProxy[] getDeclaredMethods() {
- return ((IDEMethodProxyFactory) fProxyFactoryRegistry.getMethodProxyFactory()).getDeclaredMethods(fClass);
- }
-
- /**
- * We can use reflection on our class to find the java.reflect.Method instance and create the IDEMethodProxy directly
- */
- public IMethodProxy getMethodProxy(String methodName) {
-
- try {
- Method aMethod = fClass.getMethod(methodName, new Class[0]);
- return ((IDEMethodProxyFactory) fProxyFactoryRegistry.getMethodProxyFactory()).getMethodProxy(aMethod);
- } catch (Exception exc) {
- ProxyPlugin.getPlugin().getLogger().log(new Status(IStatus.WARNING, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "", exc)); //$NON-NLS-1$
- }
- return null;
-
- }
-
- public IMethodProxy getMethodProxy(String methodName, String[] argumentClassNames) {
- return ((IDEMethodProxyFactory) fProxyFactoryRegistry.getMethodProxyFactory()).getMethodProxy(this, methodName, argumentClassNames);
- }
-
- public IMethodProxy getMethodProxy(String methodName, String firstArgClass) {
- return getMethodProxy(methodName, new String[] { firstArgClass});
- }
-
- public IMethodProxy getMethodProxy(String methodName, IBeanTypeProxy[] args) {
- Class[] argClasses = new Class[args.length];
- for (int i = 0; i < args.length; i++) {
- argClasses[i] = ((IDEBeanTypeProxy) args[i]).fClass;
- }
- return ((IDEMethodProxyFactory) fProxyFactoryRegistry.getMethodProxyFactory()).getMethodProxy(fClass, methodName, argClasses);
- }
-
- public IMethodProxy getDeclaredMethodProxy(String methodName, String[] argumentClassNames) {
- return ((IDEMethodProxyFactory) fProxyFactoryRegistry.getMethodProxyFactory()).getDeclaredMethodProxy(fClass, methodName, argumentClassNames);
- }
-
- public IMethodProxy getDeclaredMethodProxy(String methodName, IBeanTypeProxy[] args) {
- Class[] argClasses = null;
- if (args != null) {
- argClasses = new Class[args.length];
- for (int i = 0; i < args.length; i++) {
- argClasses[i] = ((IDEBeanTypeProxy) args[i]).fClass;
- }
- }
- return ((IDEMethodProxyFactory) fProxyFactoryRegistry.getMethodProxyFactory()).getDeclaredMethodProxy(fClass, methodName, argClasses);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getInvokable(java.lang.String, org.eclipse.jem.internal.proxy.core.IBeanTypeProxy[])
- */
- public IInvokable getInvokable(String methodName, IBeanTypeProxy[] argumentTypes) {
- return getMethodProxy(methodName, argumentTypes);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getInvokable(java.lang.String, java.lang.String)
- */
- public IInvokable getInvokable(String methodName, String argumentClassName) {
- return getMethodProxy(methodName, argumentClassName);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getInvokable(java.lang.String, java.lang.String[])
- */
- public IInvokable getInvokable(String methodName, String[] argumentClassNames) {
- return getMethodProxy(methodName, argumentClassNames);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getInvokable(java.lang.String)
- */
- public IInvokable getInvokable(String methodName) {
- return getMethodProxy(methodName);
- }
-
- public IConstructorProxy getConstructorProxy(String[] argTypeNames) {
- IBeanTypeProxy[] argClasses = new IBeanTypeProxy[argTypeNames.length];
- IStandardBeanTypeProxyFactory btFactory = fProxyFactoryRegistry.getBeanTypeProxyFactory();
- for (int i = 0; i < argTypeNames.length; i++) {
- argClasses[i] = btFactory.getBeanTypeProxy(argTypeNames[i]);
- if (argClasses[i] == null) {
- ProxyPlugin.getPlugin().getLogger().log(
- new Status(IStatus.WARNING, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "Constructor not found - " //$NON-NLS-1$
- + fClass.getName() + " args=" + argTypeNames, null)); //$NON-NLS-1$
- return null;
- }
- }
- return getConstructorProxy(argClasses);
- }
-
- public IConstructorProxy getConstructorProxy(IBeanTypeProxy[] args) {
- Class[] argClasses = new Class[args.length];
- for (int i = 0; i < args.length; i++) {
- argClasses[i] = ((IDEBeanTypeProxy) args[i]).fClass;
- }
- return ((IDEMethodProxyFactory) fProxyFactoryRegistry.getMethodProxyFactory()).getConstructorProxy(fClass, argClasses);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getConstructors()
- */
- public IConstructorProxy[] getConstructors() {
- return ((IDEMethodProxyFactory) fProxyFactoryRegistry.getMethodProxyFactory()).getConstructors(fClass);
- }
-
- public IConstructorProxy getDeclaredConstructorProxy(String[] argTypeNames) {
- IBeanTypeProxy[] argClasses = new IBeanTypeProxy[argTypeNames.length];
- IStandardBeanTypeProxyFactory btFactory = fProxyFactoryRegistry.getBeanTypeProxyFactory();
- for (int i = 0; i < argTypeNames.length; i++) {
- argClasses[i] = btFactory.getBeanTypeProxy(argTypeNames[i]);
- if (argClasses[i] == null) {
- ProxyPlugin.getPlugin().getLogger().log(
- new Status(IStatus.WARNING, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "Constructor not found - " //$NON-NLS-1$
- + fClass.getName() + " args=" + argTypeNames, null)); //$NON-NLS-1$
- return null;
- }
- }
- return getDeclaredConstructorProxy(argClasses);
- }
-
- public IConstructorProxy getDeclaredConstructorProxy(IBeanTypeProxy[] args) {
- Class[] argClasses = new Class[args.length];
- for (int i = 0; i < args.length; i++) {
- argClasses[i] = ((IDEBeanTypeProxy) args[i]).fClass;
- }
- return ((IDEMethodProxyFactory) fProxyFactoryRegistry.getMethodProxyFactory()).getDeclaredConstructorProxy(fClass, argClasses);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getConstructors()
- */
- public IConstructorProxy[] getDeclaredConstructors() {
- return ((IDEMethodProxyFactory) fProxyFactoryRegistry.getMethodProxyFactory()).getDeclaredConstructors(fClass);
- }
-
- /**
- * Return the supertype for us Use the factory to get it rather than create it directly so that the factory has the chance to cache classes if
- * required This is required as part of the interface
- */
- public IBeanTypeProxy getSuperBeanTypeProxy() {
-
- if (fClass.isInterface())
- return null;
- else
- return fProxyFactoryRegistry.getBeanTypeProxyFactory().getBeanTypeProxy(fClass.getSuperclass().getName());
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getConstructors()
- */
- public IFieldProxy[] getFields() {
- return ((IDEMethodProxyFactory) fProxyFactoryRegistry.getMethodProxyFactory()).getFields(fClass);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getConstructors()
- */
- public IFieldProxy[] getDeclaredFields() {
- return ((IDEMethodProxyFactory) fProxyFactoryRegistry.getMethodProxyFactory()).getDeclaredFields(fClass);
- }
-
- public IFieldProxy getFieldProxy(String fieldName) {
- try {
- Field field = fClass.getField(fieldName);
- return ((IDEMethodProxyFactory) fProxyFactoryRegistry.getMethodProxyFactory()).getFieldProxy(field);
- } catch (NoSuchFieldException exc) {
- ProxyPlugin.getPlugin().getLogger().log(
- new Status(IStatus.WARNING, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "Field not found " + fClass.getName() //$NON-NLS-1$
- + " - " + fieldName, exc)); //$NON-NLS-1$
- return null;
- }
- }
-
- public IFieldProxy getDeclaredFieldProxy(String fieldName) {
- try {
- Field field = fClass.getDeclaredField(fieldName);
- return ((IDEMethodProxyFactory) fProxyFactoryRegistry.getMethodProxyFactory()).getFieldProxy(field);
- } catch (NoSuchFieldException exc) {
- ProxyPlugin.getPlugin().getLogger().log(
- new Status(IStatus.WARNING, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "Field not found " + fClass.getName() //$NON-NLS-1$
- + " - " + fieldName, exc)); //$NON-NLS-1$
- return null;
- }
- }
-
- /**
- * Return a proxy to the constructor for the target VM being the same as the IDE We can use the package protected contstructor on
- * IDEConstructorProxy
- */
- IConstructorProxy getConstructorProxy(Class[] parameterTypes) {
-
- Constructor aConstructor = null;
-
- // Use reflection to try and find a constructor. The argumentClassNames must be converted to classes
- try {
- aConstructor = fClass.getConstructor(parameterTypes);
- } catch (Exception e) {
- ProxyPlugin.getPlugin().getLogger().log(new Status(IStatus.WARNING, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "", e)); //$NON-NLS-1$
- }
- // If we have a constructor return it
- if (aConstructor != null) {
- return getNewConstructorProxy(aConstructor);
- } else {
- return null;
- }
-
- }
-
- /**
- * Factored into its own method so subclass can override
- */
- protected IConstructorProxy getNewConstructorProxy(Constructor aConstructor) {
-
- return ((IDEMethodProxyFactory) fProxyFactoryRegistry.getMethodProxyFactory()).getConstructorProxy(aConstructor);
-
- }
-
- /**
- * Return a proxy to the null constructor for the target VM being the same as the IDE We can use the package protected contstructor on
- * IDEConstructorProxy
- */
- public IConstructorProxy getNullConstructorProxy() {
-
- Constructor aConstructor = null;
-
- // Use reflection to try and find a constructor. The argumentClassNames must be converted to classes
- try {
- aConstructor = fClass.getConstructor(null);
- return ((IDEMethodProxyFactory) fProxyFactoryRegistry.getMethodProxyFactory()).getConstructorProxy(aConstructor);
- } catch (Exception e) {
- ProxyPlugin.getPlugin().getLogger().log(new Status(IStatus.WARNING, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "", e)); //$NON-NLS-1$
- return null;
- }
-
- }
-
- public IBeanProxy newInstance(String initializationString) {
- return ((IDEStandardBeanProxyFactory) fProxyFactoryRegistry.getBeanProxyFactory()).createBeanProxy(this, initializationString);
- }
-
- public IBeanProxy newInstance() {
- return ((IDEStandardBeanProxyFactory) fProxyFactoryRegistry.getBeanProxyFactory()).createBeanProxy(this);
- }
-
- /**
- * Create a new bean proxy with the specified object Use the constructor that allows the type proxy to be set as well as the bean because we are
- * the type and by setting it now we might avoid it being lookup for in the factory the first time it is asked for
- *
- * NOTE: All subclasses need to override this to return the appropriate IDEBeanProxy.
- */
- protected IIDEBeanProxy newBeanProxy(Object anObject) {
-
- return new IDEObjectBeanProxy(fProxyFactoryRegistry, anObject, this);
-
- }
-
- /**
- * Create a subclass beantype proxy.
- */
- public IDEBeanTypeProxy newBeanTypeForClass(Class type) {
- // Default is just another instance of this same class.
- return new IDEBeanTypeProxy(fProxyFactoryRegistry, type);
- }
-
- /**
- * @see IBeanTypeProxy#getFormalTypeName()
- */
- public String getFormalTypeName() {
- return getTypeName();
- }
-
- /**
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getInitializationError()
- */
- public String getInitializationError() {
- return null; // By default none have an initialization error. There is a special instance for init errors.
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getCompatibleConstructor(org.eclipse.jem.internal.proxy.core.IBeanTypeProxy[])
- */
- public IConstructorProxy getCompatibleConstructor(IBeanTypeProxy[] argumentTypes) throws AmbiguousMethodException, NoSuchMethodException, IllegalAccessException {
-
- Class[] argClasses = new Class[argumentTypes.length];
- for (int i = 0; i < argumentTypes.length; i++) {
- argClasses[i] = ((IDEBeanTypeProxy) argumentTypes[i]).fClass;
- }
- return ((IDEMethodProxyFactory) fProxyFactoryRegistry.getMethodProxyFactory()).getCompatibleConstructor(fClass, argClasses);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getCompatibleMethod(java.lang.String,
- * org.eclipse.jem.internal.proxy.core.IBeanTypeProxy[])
- */
- public IMethodProxy getCompatibleMethod(String methodName, IBeanTypeProxy[] argumentTypes) throws NoSuchMethodException, AmbiguousMethodException {
- Class[] argClasses = new Class[argumentTypes.length];
- for (int i = 0; i < argumentTypes.length; i++) {
- argClasses[i] = ((IDEBeanTypeProxy) argumentTypes[i]).fClass;
- }
- return ((IDEMethodProxyFactory) fProxyFactoryRegistry.getMethodProxyFactory()).getCompatibleMethod(fClass, methodName, argClasses);
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IProxyBeanType#getMethodProxy(org.eclipse.jem.internal.proxy.core.IExpression, java.lang.String, org.eclipse.jem.internal.proxy.core.IProxyBeanType[])
- */
- public IProxyMethod getMethodProxy(IExpression expression, String methodName, IProxyBeanType[] parameterTypes) {
- IProxyMethod method = ((IDEExpression) expression).getMethodExpressionProxy(this, methodName, parameterTypes);
- if (method == null) {
- // Need to go to the expression and create it.
- method = ((Expression) expression).createMethodExpressionProxy(this, methodName, parameterTypes);
- }
- return method;
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IProxyBeanType#getMethodProxy(org.eclipse.jem.internal.proxy.core.IExpression, java.lang.String, java.lang.String[])
- */
- public IProxyMethod getMethodProxy(IExpression expression, String methodName, String[] parameterTypes) {
- return ((IDEMethodProxyFactory) fProxyFactoryRegistry.getMethodProxyFactory()).getMethodProxy(expression, this, methodName, parameterTypes);
- }
-
- public IProxyMethod getMethodProxy(IExpression expression, String methodName) {
- return getMethodProxy(expression, methodName, (IProxyBeanType[]) null);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IProxyBeanType#getFieldProxy(org.eclipse.jem.internal.proxy.core.IExpression, java.lang.String)
- */
- public IProxyField getFieldProxy(IExpression expression, String fieldName) {
- IProxyField field = ((IDEExpression) expression).getFieldExpressionProxy(this, fieldName);
- if (field == null) {
- // Need to go to the expression and create it.
- field = ((Expression) expression).createFieldExpressionProxy(this, fieldName);
- }
- return field;
- }
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEBigDecimalBeanTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEBigDecimalBeanTypeProxy.java
deleted file mode 100644
index a49926ef7..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEBigDecimalBeanTypeProxy.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.ide;
-/*
-
-
- */
-
-import org.eclipse.jem.internal.proxy.core.*;
-import java.math.*;
-
-final class IDEBigDecimalBeanTypeProxy extends IDENumberBeanTypeProxy {
-// Some values are cache'd for speed
-IDEBigDecimalBeanTypeProxy(IDEProxyFactoryRegistry aRegistry, Class aClass) {
- super(aRegistry, aClass,new BigDecimal(0));
-}
-/**
- * Static helper to create a bean proxy
- * Package protected because everyone should go through the factory API
- * that is defined as part of IBeanProxyFactory
- */
-INumberBeanProxy createBigDecimalBeanProxy(BigDecimal aBigDecimal) {
- if ( aBigDecimal == null || aBigDecimal.intValue() == 0 ) {
- return zeroProxy;
- } else {
- return new IDENumberBeanProxy(fProxyFactoryRegistry,aBigDecimal,this);
- }
-}
-}
-
diff --git a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEBigIntegerBeanTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEBigIntegerBeanTypeProxy.java
deleted file mode 100644
index 07e3cae12..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEBigIntegerBeanTypeProxy.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.ide;
-/*
-
-
- */
-
-import org.eclipse.jem.internal.proxy.core.*;
-import java.math.*;
-/**
- * IDE Implementation of IIntegerBeanTypeProxy
- */
-final class IDEBigIntegerBeanTypeProxy extends IDENumberBeanTypeProxy {
-// Some values are cache'd for speed
-IDEBigIntegerBeanTypeProxy(IDEProxyFactoryRegistry aRegistry, Class aClass) {
- super(aRegistry, aClass, new BigInteger("0")); //$NON-NLS-1$
-}
-/**
- * Static helper to create a bean proxy
- * Package protected because everyone should go through the factory API
- * that is defined as part of IBeanProxyFactory
- */
-INumberBeanProxy createBigIntegerBeanProxy(BigInteger aBigInteger) {
- if ( aBigInteger == null || aBigInteger.intValue() == 0 ) {
- return zeroProxy;
- } else {
- return new IDENumberBeanProxy(fProxyFactoryRegistry,aBigInteger,this);
- }
-}
-}
-
diff --git a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEBooleanBeanProxy.java b/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEBooleanBeanProxy.java
deleted file mode 100644
index 607d78035..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEBooleanBeanProxy.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.ide;
-/*
-
-
- */
-
-import org.eclipse.jem.internal.proxy.core.*;
-/**
- * IDE Implementation of IBooleanBeanProxy..
- * Creation date: (2/6/00 9:02:54 AM)
- * @author: Joe Winchester
- */
-class IDEBooleanBeanProxy extends IDEObjectBeanProxy implements IBooleanBeanProxy {
- protected Boolean fBooleanValue;
-/**
- * As well as storing the bean store the boolean value so that we can return the booleanValue faster
- * without the need for repeated re-casting. It is package protected because it is created in
- * special way, so no one else should create these.
- * @param aBean java.lang.Object
- */
-IDEBooleanBeanProxy(IDEProxyFactoryRegistry aRegistry, Object aBean, IBeanTypeProxy aBeanTypeProxy) {
- super(aRegistry, aBean,aBeanTypeProxy);
- fBooleanValue = (Boolean)aBean;
-}
-public boolean booleanValue() {
- return fBooleanValue.booleanValue();
-}
-public Boolean getBooleanValue() {
- return fBooleanValue;
-}
-}
-
-
-
-
diff --git a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEBooleanBeanTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEBooleanBeanTypeProxy.java
deleted file mode 100644
index c06f941bc..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEBooleanBeanTypeProxy.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 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
- *******************************************************************************/
-/*
- * Created on Sep 15, 2003
- *
- * To change the template for this generated file go to
- * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
- */
-package org.eclipse.jem.internal.proxy.ide;
-
-import org.eclipse.jem.internal.proxy.core.IBeanProxy;
-import org.eclipse.jem.internal.proxy.core.IBeanTypeProxy;
-
-/**
- * @author richkulp
- *
- * To change the template for this generated type comment go to
- * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
- */
-public class IDEBooleanBeanTypeProxy extends IDEBooleanBeanProxy {
-
- /**
- * @param aRegistry
- * @param aBean
- * @param aBeanTypeProxy
- */
- public IDEBooleanBeanTypeProxy(IDEProxyFactoryRegistry aRegistry, Object aBean, IBeanTypeProxy aBeanTypeProxy) {
- super(aRegistry, aBean, aBeanTypeProxy);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IBeanProxy#sameAs(org.eclipse.jem.internal.proxy.core.IBeanProxy)
- */
- public boolean sameAs(IBeanProxy aBeanProxy) {
- return (aBeanProxy instanceof IDEBooleanBeanTypeProxy) ? getBooleanValue() == ((IDEBooleanBeanTypeProxy) aBeanProxy).getBooleanValue() : false;
- }
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEBooleanClassBeanTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEBooleanClassBeanTypeProxy.java
deleted file mode 100644
index 8a383952a..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEBooleanClassBeanTypeProxy.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.ide;
-/*
-
-
- */
-
-import org.eclipse.jem.internal.proxy.core.*;
-
-final public class IDEBooleanClassBeanTypeProxy extends IDEBeanTypeProxy {
-
- // Cache these instances. Since the BeanType proxies are cached also, only one instance
- // of true/false will be in system.
- protected final IDEBooleanBeanProxy trueProxy;
- protected final IDEBooleanBeanProxy falseProxy;
-
-IDEBooleanClassBeanTypeProxy(IDEProxyFactoryRegistry aRegistry, Class aClass) {
-
- super(aRegistry, aClass);
- trueProxy = new IDEBooleanBeanProxy( fProxyFactoryRegistry, Boolean.TRUE, this );
- falseProxy = new IDEBooleanBeanProxy( fProxyFactoryRegistry, Boolean.FALSE, this);
-}
-IBooleanBeanProxy createBooleanBeanProxy(Boolean aBoolean) {
- if ( aBoolean.booleanValue() ){
- return trueProxy;
- } else {
- return falseProxy;
- }
-}
-/* Specialized from IDEBeanTypeProxy to ensure IBooleanBeanProxies are created correctly
- */
-protected IIDEBeanProxy newBeanProxy(Object anObject){
-
- if ( anObject == null || anObject == Boolean.FALSE ) {
- return falseProxy;
- } else {
- return trueProxy;
- }
-}
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEBooleanTypeBeanTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEBooleanTypeBeanTypeProxy.java
deleted file mode 100644
index 29548f538..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEBooleanTypeBeanTypeProxy.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.ide;
-/*
-
-
- */
-
-import org.eclipse.jem.internal.proxy.core.*;
-
-final public class IDEBooleanTypeBeanTypeProxy extends IDEPrimitiveBeanTypeProxy {
-
- // Cache these instances. Since the BeanType proxies are cached also, only one instance
- // of true/false will be in system.
- protected final IDEBooleanBeanProxy trueProxy;
- protected final IDEBooleanBeanProxy falseProxy;
-
-IDEBooleanTypeBeanTypeProxy(IDEProxyFactoryRegistry aRegistry, Class aClass) {
-
- super(aRegistry, aClass);
- trueProxy = new IDEBooleanBeanTypeProxy( fProxyFactoryRegistry, Boolean.TRUE, this );
- falseProxy = new IDEBooleanBeanTypeProxy( fProxyFactoryRegistry, Boolean.FALSE, this );
-
- // TODO Need to go through all of the primitives, separate them out into a separate classes so
- // that sameAs can work with them correctly. Currently only boolean type will do sameAs correctly.
- // Should also look into storing the primitive in the proxy instead of creating a new wrapper object
- // for each for the non-boolean primitives.
-}
-/**
- * Static helper to create a bean proxy
- * Package protected because everyone should go through the factory API
- * that is defined as part of IBeanProxyFactory
- */
-IBooleanBeanProxy createBooleanBeanProxy(boolean aBoolean) {
- if ( aBoolean ){
- return trueProxy;
- } else {
- return falseProxy;
- }
-}
-/* Specialized from IDEBeanTypeProxy to ensure IBooleanBeanProxies are created correctly
- */
-protected IIDEBeanProxy newBeanProxy(Object anObject){
-
- return (IIDEBeanProxy)createBooleanBeanProxy( anObject != null ? ((Boolean)anObject).booleanValue() : false );
-
-}
-int getPrimitiveType(){
- return BOOLEAN;
-}
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEByteClassBeanTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEByteClassBeanTypeProxy.java
deleted file mode 100644
index a8e3e6af1..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEByteClassBeanTypeProxy.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.ide;
-/*
-
-
- */
-
-import org.eclipse.jem.internal.proxy.core.*;
-
-/**
- * Byte BeanType Proxy.
- */
-final class IDEByteClassBeanTypeProxy extends IDENumberBeanTypeProxy {
-
-protected IDEByteClassBeanTypeProxy(IDEProxyFactoryRegistry aRegistry, Class aClass) {
- super(aRegistry, aClass, new Byte((byte)0));
-}
-INumberBeanProxy createByteBeanProxy(Byte aByte){
- return new IDENumberBeanProxy(fProxyFactoryRegistry,aByte,this);
-}
-}
-
-
diff --git a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEByteTypeBeanTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEByteTypeBeanTypeProxy.java
deleted file mode 100644
index 5017110f1..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEByteTypeBeanTypeProxy.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.ide;
-/*
-
-
- */
-
-import org.eclipse.jem.internal.proxy.core.*;
-/**
- * Byte BeanType Proxy.
- */
-final class IDEByteTypeBeanTypeProxy extends IDEPrimitiveBeanTypeProxy {
-protected IDEByteTypeBeanTypeProxy(IDEProxyFactoryRegistry aRegistry, Class aClass) {
- super(aRegistry, aClass);
-}
-INumberBeanProxy createByteBeanProxy(byte aByte){
- return new IDENumberBeanProxy(fProxyFactoryRegistry,new Byte(aByte),this);
-}
-int getPrimitiveType(){
- return BYTE;
-}
-protected IIDEBeanProxy newBeanProxy(Object anObject){
- Number n = anObject instanceof Character ? new Byte((byte)((Character) anObject).charValue()) : (Number) anObject;
- return new IDENumberBeanProxy(fProxyFactoryRegistry, n, this);
-}
-}
-
diff --git a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDECallbackRegistry.java b/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDECallbackRegistry.java
deleted file mode 100644
index e25f76765..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDECallbackRegistry.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.ide;
-/*
-
-
- */
-
-import java.io.*;
-import java.lang.reflect.Method;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-
-import org.eclipse.jem.internal.proxy.core.*;
-import org.eclipse.jem.internal.proxy.core.ExpressionProxy.ProxyEvent;
-
-public class IDECallbackRegistry implements ICallbackRegistry {
-
- IDEVMServer fVMServer;
- int fNextCallbackID;
- IDEProxyFactoryRegistry fProxyFactoryRegistry;
- Map fCallbackIDToCallback = new HashMap(25);
- Map fBeanProxyToCallbackID = new HashMap(25);
- Map fCallbackIDToStream = new HashMap(25);
- private IProxyMethod initializeCallbackMethodProxy;
- private IBeanProxy vmServerProxy;
-
-IDECallbackRegistry(IDEProxyFactoryRegistry aRegistry){
- fProxyFactoryRegistry = aRegistry;
- fVMServer = new IDEVMServer(this);
-
- vmServerProxy = aRegistry.getBeanProxy(fVMServer.getClass(), fVMServer);
-
- try {
- Method initializeCallbackMethod = org.eclipse.jem.internal.proxy.common.ICallback.class.getMethod("initializeCallback", new Class[] {org.eclipse.jem.internal.proxy.common.IVMCallbackServer.class, Integer.TYPE}); //$NON-NLS-1$
- initializeCallbackMethodProxy = (IProxyMethod) aRegistry.getBeanProxy(Method.class, initializeCallbackMethod);
- } catch (SecurityException e) {
- e.printStackTrace();
- } catch (NoSuchMethodException e) {
- e.printStackTrace();
- }
-
-}
-
-
-/**
- * Add a callback. aBeanProxy is running on the target VM and ICallback runs on our VM
- * aBeanProxy will implement ICallback on the target side
- */
-public void registerCallback(IBeanProxy aBeanProxy, ICallback aCallback){
-
- // Get a handle to the remote VM callback
- org.eclipse.jem.internal.proxy.common.ICallback vmCallback = (org.eclipse.jem.internal.proxy.common.ICallback) ((IIDEBeanProxy)aBeanProxy).getBean();
- fNextCallbackID = fNextCallbackID + 1;
- int callbackID = fNextCallbackID;
- vmCallback.initializeCallback(
- fVMServer,
- callbackID);
- Integer callbackIntegerID = new Integer(callbackID);
- fCallbackIDToCallback.put(callbackIntegerID,aCallback);
- fBeanProxyToCallbackID.put(aBeanProxy,callbackIntegerID);
-
-}
-
-
-/* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.ICallbackRegistry#registerCallback(org.eclipse.jem.internal.proxy.core.IProxy, org.eclipse.jem.internal.proxy.core.ICallback, org.eclipse.jem.internal.proxy.core.IExpression)
- */
-public void registerCallback(IProxy callbackProxy, final ICallback cb, IExpression expression) {
- final Integer callbackID = new Integer(++fNextCallbackID);
- fCallbackIDToCallback.put(callbackID, cb);
- if (callbackProxy.isBeanProxy()) {
- fBeanProxyToCallbackID.put(callbackProxy, callbackID);
- } else {
- ((ExpressionProxy) callbackProxy).addProxyListener(new ExpressionProxy.ProxyAdapter() {
- public void proxyResolved(ProxyEvent event) {
- fBeanProxyToCallbackID.put(event.getProxy(), callbackID);
- }
- });
- }
- expression.createSimpleMethodInvoke(initializeCallbackMethodProxy, callbackProxy, new IProxy[] {vmServerProxy, fProxyFactoryRegistry.getBeanProxyFactory().createBeanProxyWith(callbackID.intValue())}, false);
-
-}
-
-OutputStream requestStream(final int aCallbackID, final int aMsgID){
- final PipedOutputStream result = new PipedOutputStream();
- PipedInputStream tempStream = null;
- try {
- tempStream = new PipedInputStream(result);
- } catch ( IOException exc ) {
- ProxyPlugin.getPlugin().getLogger().log(new Status(IStatus.WARNING, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "", exc)); //$NON-NLS-1$
- return null;
- }
- final PipedInputStream inputStream = tempStream;
- Thread streamProcessor = new Thread(){
- public void run(){
- ICallback ideCallback = (ICallback)fCallbackIDToCallback.get(new Integer(aCallbackID));
- if (ideCallback != null) {
- try {
- ideCallback.calledBackStream(aMsgID, inputStream);
- } finally {
- try {
- inputStream.close(); // Make sure it's closed.
- } catch ( IOException exc ){
- ProxyPlugin.getPlugin().getLogger().log(new Status(IStatus.WARNING, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "", exc)); //$NON-NLS-1$
- }
- }
- }
- }
- };
- streamProcessor.start();
- return result;
-}
-
-Object vmCallback(int aCallbackID ,int aMsgID, Object[] parms){
- // Find the bean proxy that registered with the ID
- ICallback ideCallback = (ICallback) fCallbackIDToCallback.get(new Integer(aCallbackID));
- Object callbackResult = null;
- if ( parms.length == 1 ) {
- callbackResult = ideCallback.calledBack(aMsgID,(IBeanProxy)parms[0]);
- } else {
- callbackResult = ideCallback.calledBack(aMsgID,parms);
- }
- return callbackResult;
-}
-
-Object vmCallback(int aCallbackID ,int aMsgID, Object parm){
- // Find the bean proxy that registered with the ID
- ICallback ideCallback = (ICallback) fCallbackIDToCallback.get(new Integer(aCallbackID));
- return ideCallback.calledBack(aMsgID,parm);
-}
-
-public void deregisterCallback(IBeanProxy aBeanProxy){
- // Remove the callback from both maps. The actual unregistering of the callback
- // on the target VM is done separately by the object that added the event handler on the target VM
- Integer callbackID = (Integer) fBeanProxyToCallbackID.remove(aBeanProxy);
- fCallbackIDToCallback.remove(callbackID);
-}
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDECharTypeBeanTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDECharTypeBeanTypeProxy.java
deleted file mode 100644
index 970d7f5a8..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDECharTypeBeanTypeProxy.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.ide;
-/*
-
-
- */
-
-import org.eclipse.jem.internal.proxy.core.*;
-
-/**
- * char BeanType Proxy.
- */
-final class IDECharTypeBeanTypeProxy extends IDEPrimitiveBeanTypeProxy {
-protected IDECharTypeBeanTypeProxy(IDEProxyFactoryRegistry aRegistry, Class aClass) {
- super(aRegistry, aClass);
-}
-ICharacterBeanProxy createCharBeanProxy(char aChar){
- return new IDECharacterBeanProxy(fProxyFactoryRegistry,new Character(aChar),this);
-}
-int getPrimitiveType(){
- return CHAR;
-}
-protected IIDEBeanProxy newBeanProxy(Object anObject){
- Character c = anObject instanceof Character ? (Character) anObject : new Character((char)((Number) anObject).intValue());
- return new IDECharacterBeanProxy(fProxyFactoryRegistry, c, this);
-
-}
-}
-
-
diff --git a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDECharacterBeanProxy.java b/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDECharacterBeanProxy.java
deleted file mode 100644
index cf5b69b6f..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDECharacterBeanProxy.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.ide;
-/*
- * $RCSfile: IDECharacterBeanProxy.java,v $ $Revision: 1.6 $ $Date: 2005/08/24 20:39:06 $
- */
-
-import org.eclipse.jem.internal.proxy.core.*;
-/**
- * IDE Implementation of ICharacterBeanBeanProxy..
- */
-class IDECharacterBeanProxy extends IDEObjectBeanProxy implements ICharacterBeanProxy {
- protected Character fCharacterValue;
- IDECharacterBeanProxy(IDEProxyFactoryRegistry aRegistry, Object aBean, IBeanTypeProxy aBeanTypeProxy) {
- super(aRegistry, aBean, aBeanTypeProxy);
- fCharacterValue = (Character) aBean;
- }
- public char charValue() {
- return fCharacterValue.charValue();
- }
- public Character characterValue() {
- return fCharacterValue;
- }
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IIntegerBeanProxy#intValue()
- */
- public int intValue() {
- return charValue();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.INumberBeanProxy#byteValue()
- */
- public byte byteValue() {
- return (byte) charValue();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.INumberBeanProxy#doubleValue()
- */
- public double doubleValue() {
- return charValue();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.INumberBeanProxy#floatValue()
- */
- public float floatValue() {
- return charValue();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.INumberBeanProxy#longValue()
- */
- public long longValue() {
- return charValue();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.INumberBeanProxy#numberValue()
- */
- public Number numberValue() {
- // This is a kludge. Need to new one up.
- return new Integer(charValue());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.INumberBeanProxy#shortValue()
- */
- public short shortValue() {
- return (short) charValue();
- }
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDECharacterClassBeanTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDECharacterClassBeanTypeProxy.java
deleted file mode 100644
index 8698759b0..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDECharacterClassBeanTypeProxy.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.ide;
-/*
-
-
- */
-
-import org.eclipse.jem.internal.proxy.core.*;
-
-/**
- * Char BeanType Proxy.
- */
-final class IDECharacterClassBeanTypeProxy extends IDEBeanTypeProxy {
-
-protected IDECharacterClassBeanTypeProxy(IDEProxyFactoryRegistry aRegistry, Class aClass) {
- super(aRegistry, aClass);
-}
-ICharacterBeanProxy createCharacterBeanProxy(Character aChar){
- return new IDECharacterBeanProxy(fProxyFactoryRegistry,aChar,this);
-}
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEClassBeanTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEClassBeanTypeProxy.java
deleted file mode 100644
index a95a6cfba..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEClassBeanTypeProxy.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 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.jem.internal.proxy.ide;
-
-import org.eclipse.jem.internal.proxy.core.IBeanProxy;
-
-/**
- * For java.lang.Class type.
- * @since 1.0.0
- */
-public class IDEClassBeanTypeProxy extends IDEBeanTypeProxy {
-
- /**
- * @param aRegistry
- * @param aClass
- *
- * @since 1.0.0
- */
- public IDEClassBeanTypeProxy(IDEProxyFactoryRegistry aRegistry, Class aClass) {
- super(aRegistry, aClass);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.ide.IDEBeanTypeProxy#newBeanProxy(java.lang.Object)
- */
- protected IIDEBeanProxy newBeanProxy(Object anObject) {
- return (IIDEBeanProxy) ((IDEStandardBeanTypeProxyFactory) fProxyFactoryRegistry.getBeanTypeProxyFactory()).getBeanTypeProxy((Class) anObject);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.ide.IDEBeanTypeProxy#newBeanTypeForClass(java.lang.Class)
- */
- public IDEBeanTypeProxy newBeanTypeForClass(Class type) {
- throw new UnsupportedOperationException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#newInstance()
- */
- public IBeanProxy newInstance() {
- throw new UnsupportedOperationException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#newInstance(java.lang.String)
- */
- public IBeanProxy newInstance(String initializationString) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEConstructorProxy.java b/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEConstructorProxy.java
deleted file mode 100644
index 1e2723bd2..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEConstructorProxy.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.ide;
-/*
-
-
- */
-
-import java.lang.reflect.Constructor;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-
-import org.eclipse.jem.internal.proxy.core.*;
-
-/**
- * This is an implementation of IConstructorProxy where the target VM is the same as
- * the IDE. The java.lang.reflect.Constructor instance is held in a field
- */
-class IDEConstructorProxy extends IDEAccessibleObjectProxy implements IConstructorProxy {
-
- /**
- * package protected constructor where the instance of java.lang.reflect.Constructor
- * can be passed in directly
- */
- IDEConstructorProxy(IDEProxyFactoryRegistry aRegistry, Constructor aConstructor) {
- super(aRegistry, aConstructor);
- }
- /**
- * The type proxy is constant proxy out of the method factory.
- */
- public IBeanTypeProxy getTypeProxy() {
- return ((IDEMethodProxyFactory) fProxyFactoryRegistry.getMethodProxyFactory()).constructorType;
- }
-
- /**
- * This is factored into a special method so that subclasses can override
- * if they wish.
- */
- protected IBeanProxy getNewIDEBeanProxy(Object aBean) {
-
- return IDEStandardBeanProxyFactory.createBeanProxy(fProxyFactoryRegistry, aBean); // Use local helper method to do this.
- }
- /**
- * Invoke the constructor and return an IDEBeanProxy with the result
- */
- public IBeanProxy newInstance() {
-
- // Invoke the constructor
- try {
- Object result = ((Constructor) getBean()).newInstance(null);
- return getNewIDEBeanProxy(result);
- } catch (Exception e) {
- ProxyPlugin.getPlugin().getLogger().log(
- new Status(IStatus.WARNING, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "", e)); //$NON-NLS-1$
- return null;
- }
-
- }
- public IBeanProxy newInstanceCatchThrowableExceptions() {
- return newInstance();
- }
- public IBeanProxy newInstanceCatchThrowableExceptions(IBeanProxy[] args) {
- return newInstance(args);
- }
- /**
- * Invoke the constructor and return an IDEBeanProxy with the result
- */
- public IBeanProxy newInstance(IBeanProxy[] creationArguments) {
-
- // Get an array of bean objects from the bean proxy arguments
- Object result = null;
- Object[] creationObjects = new Object[creationArguments.length];
- for (int i = 0; i < creationArguments.length; i++) {
- // It is possible the arguments are null which is perfectly valid
- if (creationArguments[i] != null)
- creationObjects[i] = ((IIDEBeanProxy) creationArguments[i]).getBean();
- }
-
- // Invoke the constructor
- try {
- result = ((Constructor) getBean()).newInstance(creationObjects);
- } catch (Exception e) {
- ProxyPlugin.getPlugin().getLogger().log(
- new Status(IStatus.WARNING, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "", e)); //$NON-NLS-1$
- }
-
- // If we have a non-null result create an IDEBeanProxy and return it
- if (result != null) {
- return getNewIDEBeanProxy(result);
- } else {
- return null;
- }
-
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IConstructorProxy#getParameterTypes()
- */
- public IBeanTypeProxy[] getParameterTypes() {
- Class[] parmClasses = ((Constructor) getBean()).getParameterTypes();
- IBeanTypeProxy[] parmTypes = new IBeanTypeProxy[parmClasses.length];
- IDEStandardBeanTypeProxyFactory factory = (IDEStandardBeanTypeProxyFactory) fProxyFactoryRegistry.getBeanTypeProxyFactory();
- for (int i = 0; i < parmClasses.length; i++) {
- parmTypes[i] = factory.getBeanTypeProxy(parmClasses[i]);
- }
- return parmTypes;
- }
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEConstructorTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEConstructorTypeProxy.java
deleted file mode 100644
index cbeb7547d..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEConstructorTypeProxy.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.ide;
-/*
-
-
- */
-
-
-/**
- * @version 1.0
- * @author
- */
-public class IDEConstructorTypeProxy extends IDEBeanTypeProxy {
-
- IDEConstructorTypeProxy(IDEProxyFactoryRegistry registry) {
- super(registry, java.lang.reflect.Constructor.class);
- }
-
- /*
- * @see IDEBeanTypeProxy#newBeanProxy(Object)
- */
- protected IIDEBeanProxy newBeanProxy(Object anObject) {
- return new IDEConstructorProxy(fProxyFactoryRegistry, (java.lang.reflect.Constructor) anObject);
- }
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEDoubleClassBeanTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEDoubleClassBeanTypeProxy.java
deleted file mode 100644
index 4fcb75172..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEDoubleClassBeanTypeProxy.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.ide;
-/*
-
-
- */
-
-import org.eclipse.jem.internal.proxy.core.*;
-
-/**
- * Double BeanType Proxy.
- */
-final class IDEDoubleClassBeanTypeProxy extends IDENumberBeanTypeProxy {
-
-protected IDEDoubleClassBeanTypeProxy(IDEProxyFactoryRegistry aRegistry, Class aClass) {
- super(aRegistry, aClass, new Double(0));
-}
-INumberBeanProxy createDoubleBeanProxy(Double aDouble){
- return new IDENumberBeanProxy(fProxyFactoryRegistry,aDouble,this);
-}
-}
-
-
diff --git a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEDoubleTypeBeanTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEDoubleTypeBeanTypeProxy.java
deleted file mode 100644
index 2945dfb2d..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEDoubleTypeBeanTypeProxy.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.ide;
-/*
-
-
- */
-
-import org.eclipse.jem.internal.proxy.core.*;
-
-/**
- * double BeanType Proxy.
- */
-final class IDEDoubleTypeBeanTypeProxy extends IDEPrimitiveBeanTypeProxy {
-protected IDEDoubleTypeBeanTypeProxy(IDEProxyFactoryRegistry aRegistry, Class aClass) {
- super(aRegistry, aClass);
-}
-INumberBeanProxy createDoubleBeanProxy(double aDouble){
- return new IDENumberBeanProxy(fProxyFactoryRegistry,new Double(aDouble),this);
-}
-int getPrimitiveType(){
- return DOUBLE;
-}
-
-protected IIDEBeanProxy newBeanProxy(Object anObject){
- Number n = anObject instanceof Character ? new Double(((Character) anObject).charValue()) : (Number) anObject;
- return new IDENumberBeanProxy(fProxyFactoryRegistry, n, this);
-}
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEExpression.java b/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEExpression.java
deleted file mode 100644
index ac8876292..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEExpression.java
+++ /dev/null
@@ -1,1077 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 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
- *******************************************************************************/
-/*
- * $RCSfile: IDEExpression.java,v $ $Revision: 1.12 $ $Date: 2005/08/24 20:39:06 $
- */
-package org.eclipse.jem.internal.proxy.ide;
-
-import java.util.*;
-
-import org.eclipse.core.runtime.Platform;
-
-import org.eclipse.jem.internal.proxy.common.MethodHelper;
-import org.eclipse.jem.internal.proxy.core.*;
-import org.eclipse.jem.internal.proxy.core.ExpressionProxy.ProxyEvent;
-import org.eclipse.jem.internal.proxy.initParser.tree.*;
-
-/**
- * IDE expression processing.
- *
- * @since 1.0.0
- */
-public class IDEExpression extends Expression {
-
- private final IDEStandardBeanTypeProxyFactory beantypefactory;
- protected final ExpressionProcesser eproc;
- {
- boolean useTracing = !isTraceSet() ?
- "true".equalsIgnoreCase(Platform.getDebugOption(ProxyPlugin.getPlugin().getBundle().getSymbolicName() + ProxyLaunchSupport.EXPRESSION_TRACING)) : //$NON-NLS-1$
- isTrace();
- long threshold = Long.getLong(Platform.getDebugOption(ProxyPlugin.getPlugin().getBundle().getSymbolicName() + ProxyLaunchSupport.EXPRESSION_TRACEING_TIMER_THRESHOLD), -1L).longValue();
- eproc = new ExpressionProcesser(useTracing, threshold);
- }
-
-
- private void processExpressionError() throws ThrowableProxy, NoExpressionValueException {
- if (!eproc.noErrors())
- if (eproc.isNoExpressionValue())
- throw (NoExpressionValueException) eproc.getErrorThrowable();
- else {
- Throwable t = eproc.getErrorThrowable();
- if (t instanceof ThrowableProxy)
- throw (ThrowableProxy) t;
- else
- throw new IDEThrowableProxy(eproc.getErrorThrowable(), beantypefactory.getBeanTypeProxy(t.getClass()));
- }
- }
-
- /**
- * Create the IDEExpression
- *
- * @param registry
- *
- * @since 1.0.0
- */
- public IDEExpression(ProxyFactoryRegistry registry) {
- super(registry);
- beantypefactory = (IDEStandardBeanTypeProxyFactory) registry.getBeanTypeProxyFactory();
- }
-
- protected final IDEProxyFactoryRegistry getIDERegistry() {
- return (IDEProxyFactoryRegistry) registry;
- }
-
- protected final IDEStandardBeanTypeProxyFactory getIDEBeanTypeFactory() {
- return beantypefactory;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.Expression#pushToProxy(org.eclipse.jem.internal.proxy.core.IProxy)
- */
- protected void pushToProxy(IProxy proxy) {
- if (proxy == null)
- eproc.pushExpression(null, MethodHelper.NULL_TYPE);
- else if (proxy.isBeanProxy())
- eproc.pushExpression(((IDEBeanProxy) proxy).getBean(), ((IDEBeanTypeProxy) ((IBeanProxy) proxy).getTypeProxy()).getTypeClass());
- else
- eproc.pushExpressionProxy(((ExpressionProxy) proxy).getProxyID());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.Expression#closeProxy()
- */
- protected void closeProxy() {
- methodExpressionProxies = fieldExpressionProxies = null;
- eproc.close();
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.Expression#pullProxyValue(int, java.util.List)
- */
- protected IBeanProxy pullProxyValue(int proxycount, List expressionProxies) throws ThrowableProxy, NoExpressionValueException {
- processExtensionProxies(proxycount, expressionProxies);
- processExpressionError();
- Object result[] = new Object[2];
- eproc.pullValue(result);
- IBeanProxy resultProxy = getIDERegistry().getBeanProxy((Class) result[1], result[0]);
- return resultProxy;
- }
-
- private void processExtensionProxies(int proxycount, List expressionProxies) {
- if (proxycount > 0) {
- int len = expressionProxies.size();
- Object[] proxyResolution = new Object[2];
- for (int i = 0; i < len; i++) {
- ExpressionProxy ep = (ExpressionProxy) expressionProxies.get(i);
- if (ep != null) {
- try {
- eproc.pullExpressionProxyValue(ep.getProxyID(), proxyResolution);
- if (proxyResolution[1] != Void.TYPE)
- fireProxyResolved(ep, getIDERegistry().getBeanProxy((Class) proxyResolution[1], proxyResolution[0]));
- else
- fireProxyVoid(ep);
- } catch (NoExpressionValueException e) {
- fireProxyNotResolved(ep);
- }
- }
- }
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.Expression#pushCastToProxy(org.eclipse.jem.internal.proxy.core.IProxyBeanType)
- */
- protected void pushCastToProxy(IProxyBeanType type) {
- try {
- eproc.pushCast(getIDEBeanTypeProxy(type).getTypeClass());
- } catch (ThrowableProxy e) {
- eproc.processException(e);
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.Expression#pushInstanceofToProxy(org.eclipse.jem.internal.proxy.core.IProxyBeanType)
- */
- protected void pushInstanceofToProxy(IProxyBeanType type) {
- try {
- eproc.pushInstanceof(getIDEBeanTypeProxy(type).getTypeClass());
- } catch (ThrowableProxy e) {
- eproc.processException(e);
- }
- }
-
- /**
- * Get the BeanType proxy and test if valid. Throw ThrowableProxy if not valid.
- *
- * @param type
- * @return
- * @throws ThrowableProxy
- *
- * @since 1.0.0
- */
- protected IDEBeanTypeProxy getIDEBeanTypeProxy(IProxyBeanType type) throws ThrowableProxy {
- IDEBeanTypeProxy typeProxy;
- if (type.isExpressionProxy()) {
- // It should already be resolved at this point.
- typeProxy = ((IDEBeanTypeExpressionProxy) type).getBeanTypeProxy();
- } else
- typeProxy = (IDEBeanTypeProxy) type;
- if (!typeProxy.isValid()) {
- throw new IDEThrowableProxy(
- new Exception(typeProxy.getInitializationError()),
- getIDEBeanTypeFactory().getBeanTypeProxy(Exception.class));
- } else
- return typeProxy;
- }
-
-
- /**
- * Get the BeanType proxy and test if valid. Throw ThrowableProxy if not valid.
- * @param type
- * @return
- * @throws ThrowableProxy
- *
- * @since 1.1.0
- */
- protected IDEBeanTypeProxy getIDEBeanTypeProxy(String type) throws ThrowableProxy {
- return (IDEBeanTypeProxy) registry.getBeanTypeProxyFactory().getBeanTypeProxy(type);
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.Expression#pushPrefixToProxy(org.eclipse.jem.internal.proxy.initParser.tree.PrefixOperator)
- */
- protected void pushPrefixToProxy(PrefixOperator operator) {
- eproc.pushPrefix(operator);
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.Expression#pushInfixToProxy(org.eclipse.jem.internal.proxy.initParser.tree.InfixOperator, org.eclipse.jem.internal.proxy.initParser.tree.InternalInfixOperandType)
- */
- protected void pushInfixToProxy(InfixOperator operator, InternalInfixOperandType operandType) {
- eproc.pushInfix(operator, operandType);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.Expression#pushArrayAccessToProxy(int)
- */
- protected void pushArrayAccessToProxy(int indexCount) {
- eproc.pushArrayAccess(indexCount);
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.Expression#pushArrayCreationToProxy(org.eclipse.jem.internal.proxy.core.IProxyBeanType, int)
- */
- protected void pushArrayCreationToProxy(IProxyBeanType type, int dimensionCount) {
- try {
- eproc.pushArrayCreation(getIDEBeanTypeProxy(type).getTypeClass(), dimensionCount);
- } catch (ThrowableProxy e) {
- eproc.processException(e);
- }
- }
-
- protected void pushArrayInitializerToProxy(IProxyBeanType type, int stripCount, int expressionCount) {
- try {
- eproc.pushArrayInitializer(getIDEBeanTypeProxy(type).getTypeClass(), stripCount, expressionCount);
- } catch (ThrowableProxy e) {
- eproc.processException(e);
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.Expression#pushClassInstanceCreationToProxy(org.eclipse.jem.internal.proxy.core.IProxyBeanType, int)
- */
- protected void pushClassInstanceCreationToProxy(IProxyBeanType type, int argumentCount) {
- try {
- eproc.pushClassInstanceCreation(getIDEBeanTypeProxy(type).getTypeClass(), argumentCount);
- } catch (ThrowableProxy e) {
- eproc.processException(e);
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.Expression#pushTypeReceiverToProxy(org.eclipse.jem.internal.proxy.core.IProxyBeanType)
- */
- protected void pushTypeReceiverToProxy(IProxyBeanType type) {
- try {
- Class c = getIDEBeanTypeProxy(type).getTypeClass();
- eproc.pushExpression(c, c); // When as a receiver, the type is the same as the receiver.
- } catch (ThrowableProxy e) {
- eproc.processException(e);
- } catch (RuntimeException e) {
- eproc.processException(e);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.Expression#pushFieldAccessToProxy(java.lang.Object, boolean)
- */
- protected void pushFieldAccessToProxy(Object field, boolean hasReceiver) {
- boolean isString = field instanceof String;
- try {
- eproc.pushFieldAccess(isString ? field : getIDEFieldProxy((IProxyField) field).getBean(), isString, hasReceiver);
- } catch (ThrowableProxy e) {
- eproc.processException(e);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.Expression#pushMethodInvocationToProxy(java.lang.Object, boolean, int)
- */
- protected void pushMethodInvocationToProxy(Object method, boolean hasReceiver, int argCount) {
- boolean isString = method instanceof String;
- try {
- eproc.pushMethodInvocation(isString ? method : getIDEMethodProxy((IProxyMethod) method).getBean(), isString, hasReceiver, argCount);
- } catch (ThrowableProxy e) {
- eproc.processException(e);
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.Expression#pushConditionalToProxy(org.eclipse.jem.internal.proxy.initParser.tree.InternalConditionalOperandType)
- */
- protected void pushConditionalToProxy(InternalConditionalOperandType expressionType) {
- eproc.pushConditional(expressionType);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.Expression#pushInvoke()
- */
- protected void pushInvoke(int proxycount, List expressionProxies) throws ThrowableProxy, NoExpressionValueException {
- // In the IDE case do nothing. Nothing is pending. But still need to handle proxy resolution.
- processExtensionProxies(proxycount, expressionProxies);
- processExpressionError();
- }
-
- /**
- * This is used as both an ExpressionProxy (i.e. IDE side) and the Expressions expression proxy result on the other side.
- * This makes it easier to just use same instance on both sides.
- *
- * @since 1.1.0
- */
- protected static class IDEExpressionProxy extends ExpressionProxy implements InternalExpressionProxy {
-
- protected IDEExpressionProxy(int proxyid, int proxyType, Expression expression) {
- super(proxyid, proxyType, expression);
- }
-
- private Object value;
- private Class type;
- private boolean set;
-
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.ExpressionProxy#dispose()
- */
- protected void dispose() {
- super.dispose();
- value = null;
- type = null;
- set = false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.initParser.tree.InternalExpressionProxy#getType()
- */
- public Class getType() {
- return type;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.initParser.tree.InternalExpressionProxy#getValue()
- */
- public Object getValue() {
- return value;
- }
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.initParser.tree.InternalExpressionProxy#setProxy(java.lang.Object, java.lang.Class)
- */
- public void setProxy(Object value, Class type) {
- this.value = value;
- this.type = type;
- set = true;
- }
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.initParser.tree.InternalExpressionProxy#isSet()
- */
- public boolean isSet() {
- return set;
- }
- }
-
- /**
- * The Expression proxy for IDE BeanTypes.
- *
- * @since 1.1.0
- */
- protected static class IDEBeanTypeExpressionProxy extends IDEExpressionProxy implements IBeanTypeExpressionProxy {
-
- private String typeName;
- private IDEBeanTypeProxy resolvedProxy;
-
- /**
- * @param proxyid
- *
- * @since 1.1.0
- */
- public IDEBeanTypeExpressionProxy(int proxyid, Expression expression) {
- super(proxyid, BEANTYPE_EXPRESSION_PROXY, expression);
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeExpressionProxy#setTypeName(java.lang.String)
- */
- public void setTypeName(String typeName) {
- this.typeName = typeName;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IProxyBeanType#getTypeName()
- */
- public String getTypeName() {
- return typeName;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.ExpressionProxy#toString()
- */
- public String toString() {
- return super.toString()+" - "+getTypeName(); //$NON-NLS-1$
- }
-
- /**
- * Called by IDEExpression to resolve the beantype.
- * @param beantypeProxy
- *
- * @since 1.1.0
- */
- void setProxy(IDEBeanTypeProxy beantypeProxy) {
- this.resolvedProxy = beantypeProxy;
- setProxy(resolvedProxy.getTypeClass(), Class.class);
- }
-
- /**
- * Called by IDEExpression to get the resolved beantype proxy.
- * @return
- *
- * @since 1.1.0
- */
- IDEBeanTypeProxy getBeanTypeProxy() {
- return resolvedProxy;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IProxyBeanType#getMethodProxy(org.eclipse.jem.internal.proxy.core.IExpression, java.lang.String, org.eclipse.jem.internal.proxy.core.IProxyBeanType[])
- */
- public IProxyMethod getMethodProxy(IExpression expression, String methodName, IProxyBeanType[] parameterTypes) {
- IProxyMethod method = ((IDEExpression) expression).getMethodExpressionProxy(this, methodName, parameterTypes);
- if (method == null) {
- // Need to go to the expression and create it.
- method = ((Expression) expression).createMethodExpressionProxy(this, methodName, parameterTypes);
- }
- return method;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IProxyBeanType#getMethodProxy(org.eclipse.jem.internal.proxy.core.IExpression, java.lang.String, java.lang.String[])
- */
- public IProxyMethod getMethodProxy(IExpression expression, String methodName, String[] parameterTypes) {
- return ((IDEMethodProxyFactory) expression.getRegistry().getMethodProxyFactory()).getMethodProxy(expression, this, methodName, parameterTypes);
- }
-
- public IProxyMethod getMethodProxy(IExpression expression, String methodName) {
- return getMethodProxy(expression, methodName, (IProxyBeanType[]) null);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IProxyBeanType#getFieldProxy(org.eclipse.jem.internal.proxy.core.IExpression, java.lang.String)
- */
- public IProxyField getFieldProxy(IExpression expression, String fieldName) {
- IProxyField field = ((IDEExpression) expression).getFieldExpressionProxy(this, fieldName);
- if (field == null) {
- // Need to go to the expression and create it.
- field = ((Expression) expression).createFieldExpressionProxy(this, fieldName);
- }
- return field;
- }
- }
-
- /**
- * The Expression proxy for IDE BeanTypes.
- *
- * @since 1.1.0
- */
- protected static class IDEMethodExpressionProxy extends IDEExpressionProxy implements IProxyMethod {
-
- private String methodName;
- private IDEMethodProxy resolvedProxy;
- private ThrowableProxy errorThrowable;
-
- /**
- * @param proxyid
- *
- * @since 1.1.0
- */
- public IDEMethodExpressionProxy(int proxyid, Expression expression) {
- super(proxyid, METHOD_EXPRESSION_PROXY, expression);
- }
-
- /**
- * Set by IDEExpression with the method name.
- * @param methodName
- *
- * @since 1.1.0
- */
- void setMethodName(String methodName) {
- this.methodName = methodName;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.ExpressionProxy#toString()
- */
- public String toString() {
- return super.toString()+" - "+methodName; //$NON-NLS-1$
- }
-
- /**
- * Called by IDEExpression to resolve the beantype.
- * @param methodProxy
- *
- * @since 1.1.0
- */
- void setProxy(IDEMethodProxy methodProxy) {
- this.resolvedProxy = methodProxy;
- setProxy(resolvedProxy.getBean(), Class.class);
- }
-
- /**
- * Called by IDEExpression to say there was error in creating the proxy.
- * @param errorThrowable
- *
- * @since 1.1.0
- */
- void setThrowable(ThrowableProxy errorThrowable) {
- this.errorThrowable = errorThrowable;
- }
-
- /**
- * Called by IDEExpression to get the resolved method proxy.
- * @return
- * @throws ThrowableProxy
- *
- * @since 1.1.0
- */
- IDEMethodProxy getMethodProxy() throws ThrowableProxy {
- if (errorThrowable != null)
- throw errorThrowable;
- return resolvedProxy;
- }
- }
-
- protected static class IDEFieldExpressionProxy extends IDEExpressionProxy implements IProxyField {
-
- private String fieldName;
- private IDEFieldProxy resolvedProxy;
- private ThrowableProxy errorThrowable;
-
- /**
- * @param proxyid
- *
- * @since 1.1.0
- */
- public IDEFieldExpressionProxy(int proxyid, Expression expression) {
- super(proxyid, FIELD_EXPRESSION_PROXY, expression);
- }
-
- /**
- * Set by IDEExpression with the method name.
- * @param fieldName
- *
- * @since 1.1.0
- */
- void setField(String fieldName) {
- this.fieldName = fieldName;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.ExpressionProxy#toString()
- */
- public String toString() {
- return super.toString()+" - "+fieldName; //$NON-NLS-1$
- }
-
- /**
- * Called by IDEExpression to resolve the beantype.
- * @param fieldProxy
- *
- * @since 1.1.0
- */
- void setProxy(IDEFieldProxy fieldProxy) {
- this.resolvedProxy = fieldProxy;
- setProxy(resolvedProxy.getBean(), Class.class);
- }
-
- /**
- * Called by IDEExpression to say there was error in creating the proxy.
- * @param errorThrowable
- *
- * @since 1.1.0
- */
- void setThrowable(ThrowableProxy errorThrowable) {
- this.errorThrowable = errorThrowable;
- }
-
- /**
- * Called by IDEExpression to get the resolved field proxy.
- * @return
- * @throws ThrowableProxy
- *
- * @since 1.1.0
- */
- IDEFieldProxy getFieldProxy() throws ThrowableProxy {
- if (errorThrowable != null)
- throw errorThrowable;
- return resolvedProxy;
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.Expression#createExpressionProxy(int, int)
- */
- protected ExpressionProxy createExpressionProxy(int proxyType, int proxyID) {
- switch (proxyType) {
- case NORMAL_EXPRESSION_PROXY:
- default:
- return new IDEExpressionProxy(proxyID, NORMAL_EXPRESSION_PROXY, this);
-
- case BEANTYPE_EXPRESSION_PROXY:
- return new IDEBeanTypeExpressionProxy(proxyID, this);
-
- case METHOD_EXPRESSION_PROXY:
- return new IDEMethodExpressionProxy(proxyID, this);
-
- case FIELD_EXPRESSION_PROXY:
- return new IDEFieldExpressionProxy(proxyID, this);
- }
-
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.Expression#pushAssignmentToProxy(org.eclipse.jem.internal.proxy.core.ExpressionProxy)
- */
- protected void pushAssignmentToProxy(ExpressionProxy proxy) {
- eproc.pushAssignment((InternalExpressionProxy) proxy);
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.Expression#pushAssignmentToProxy()
- */
- protected void pushAssignmentToProxy() {
- eproc.pushAssignment();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.Expression#pushBlockBeginToProxy(int)
- */
- protected void pushBlockBeginToProxy(int blockNumber) {
- eproc.pushBlockBegin(blockNumber);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.Expression#pushBlockEndToProxy(int)
- */
- protected void pushBlockEndToProxy(int blockNumber) {
- eproc.pushBlockEnd(blockNumber);
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.Expression#pushBlockBreakToProxy(int)
- */
- protected void pushBlockBreakToProxy(int blockNumber) {
- eproc.pushBlockBreak(blockNumber);
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.Expression#pushTryBeginToProxy(int)
- */
- protected void pushTryBeginToProxy(int tryNumber) {
- eproc.pushTryBegin(tryNumber);
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.Expression#pushTryCatchClauseToProxy(int, org.eclipse.jem.internal.proxy.core.IProxyBeanType, org.eclipse.jem.internal.proxy.core.ExpressionProxy)
- */
- protected void pushTryCatchClauseToProxy(int tryNumber, IProxyBeanType exceptionType, ExpressionProxy ep) {
- try {
- eproc.pushTryCatchClause(tryNumber, getIDEBeanTypeProxy(exceptionType).getTypeClass(), (InternalExpressionProxy) ep);
- } catch (ThrowableProxy e) {
- eproc.processException(e);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.Expression#pushTryFinallyClauseToProxy(int)
- */
- protected void pushTryFinallyClauseToProxy(int tryNumber) {
- eproc.pushTryFinallyClause(tryNumber);
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.Expression#pushTryEndToProxy(int)
- */
- protected void pushTryEndToProxy(int tryNumber) {
- eproc.pushTryEnd(tryNumber);
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.Expression#pushThrowToProxy()
- */
- protected void pushThrowToProxy() {
- eproc.pushThrowException();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.Expression#pushRethrowToProxy(int)
- */
- protected void pushRethrowToProxy(int tryNumber) {
- eproc.pushTryRethrow(tryNumber);
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.Expression#pushBeanTypeToProxy(org.eclipse.jem.internal.proxy.core.IBeanTypeExpressionProxy)
- */
- protected void pushBeanTypeToProxy(IBeanTypeExpressionProxy proxy) {
- try {
- IDEBeanTypeExpressionProxy ep = (IDEBeanTypeExpressionProxy) proxy;
- IDEBeanTypeProxy typeProxy = getIDEBeanTypeProxy(proxy.getTypeName());
- ep.setProxy(typeProxy);
- eproc.allocateExpressionProxy(ep);
- if (!typeProxy.isValid()) {
- Throwable cause = ((IDEInitErrorBeanTypeProxy) typeProxy).getCause();
- if (cause == null)
- throw new IDEThrowableProxy(
- new Exception(typeProxy.getInitializationError()),
- getIDEBeanTypeFactory().getBeanTypeProxy(Exception.class));
- else
- throw new IDEThrowableProxy(
- cause,
- getIDEBeanTypeFactory().getBeanTypeProxy(cause.getClass()));
-
- }
- } catch (ThrowableProxy e) {
- eproc.processException(e);
- }
- }
-
- /**
- * Get the map of IProxyBeanTypes for a beantype name. Meant to be used only in conjunction with IDEStandardBeanTypeFactory.
- * It is here so the IDDEStandardBeanTypeFactory can store pending proxies per expression.
- *
- * @param beanType
- * @return
- *
- * @since 1.1.0
- */
- public IProxyBeanType getBeanType(String beanTypeName) {
- if (beanTypeCache == null)
- beanTypeCache = new HashMap();
- return (IProxyBeanType) beanTypeCache.get(beanTypeName);
- }
-
- /**
- * Add the beantype expression proxy to the map of bean type expression proxies. Used in conjunction with IDEStandardBeanTypeFactory.
- * It is here so the IDEStandardBeanTypeFactory can store pending proxies per expression.
- * @param beanTypeName
- * @param beantype
- *
- * @since 1.1.0
- */
- public void addBeanType(String beanTypeName, IProxyBeanType beantype) {
- beanTypeCache.put(beanTypeName, beantype);
- }
-
- /**
- * Remove the beantype expression proxy from the map. This is called because there was a rollback due to an endmark.
- * @param beanTypeName
- *
- * @since 1.1.0
- */
- public void removeBeanType(String beanTypeName) {
- beanTypeCache.remove(beanTypeName);
- }
-
- /**
- * Keeping a local map of Method Expression Proxies so that we don't keep recreating them for each request from within this expression.
- * The map will be: declaringTypeName->(Map) methodName or IDEMethodKey -> method expression proxy.
- * @see IDEExpression#pushMethodToProxy(ExpressionProxy, IProxyBeanType, String, IProxyBeanType[]) for the actual implementation.
- */
- protected Map methodExpressionProxies;
-
- /**
- * Keeping a local map of Field Expression Proxies so that we don't keep recreating them for each request from within this expression.
- * The map will be: declaringTypeName->(Map) fieldname -> field expression proxy.
- * @see IDEExpression#pushFieldToProxy(ExpressionProxy, IProxyBeanType, String)
- */
- protected Map fieldExpressionProxies;
-
- /**
- * Keeping a local map of BeanType expression proxies so that we don't keep recreating them for each request from within this expression.
- * The map will be: typename->beanTypeExpressionProxy
- */
- protected Map beanTypeCache; // Use to cache pending BeanTypes. Used in conjunction with IDEStandardBeanTypeFactory.
-
- /*
- * Used as the key to the methodCache when there are parms.
- * It allows the parms to be either IProxyBeanType without the
- * overhead of creating complicated strings.
- *
- * It will compare method name and each individual parm name without fluffing
- * up a string and building it up.
- *
- * For no parm methods, just the name of the method as a string will be the key.
- *
- * @since 1.1.0
- */
- private static class MethodKey {
- public String methodName;
- public IProxyBeanType[] parmTypes;
- public MethodKey(String methodName, IProxyBeanType[] parmTypes) {
- this.methodName = methodName;
- this.parmTypes = parmTypes;
- }
-
-
- /* (non-Javadoc)
- * @see java.lang.Object#equals(java.lang.Object)
- */
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- try {
- return ((MethodKey) obj).compareParms(parmTypes);
- } catch (ClassCastException e) {
- return false;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.remote.REMProxyConstants.MethodKey#hashCode()
- */
- public int hashCode() {
- int h = methodName.hashCode();;
- for (int i = 0; i < parmTypes.length; i++) {
- h += parmTypes[i].getTypeName().hashCode();
- }
- return h;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.remote.REMProxyConstants.MethodKey#compareParms(java.lang.String[])
- */
- protected boolean compareParms(IProxyBeanType[] parms) {
- if (parms.length != parmTypes.length)
- return false;
- for (int i = 0; i < parms.length; i++) {
- if (!parmTypes[i].getTypeName().equals(parms[i].getTypeName()))
- return false;
- }
- return true;
- }
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.Expression#pushMethodToProxy(org.eclipse.jem.internal.proxy.core.ExpressionProxy, org.eclipse.jem.internal.proxy.core.IProxyBeanType, java.lang.String, org.eclipse.jem.internal.proxy.core.IProxyBeanType[])
- */
- protected void pushMethodToProxy(ExpressionProxy proxy, IProxyBeanType declaringType, String methodName, IProxyBeanType[] parameterTypes) {
- try {
- final Map methods = getMethods(declaringType);
- final Object key = getMethodKey(methodName, parameterTypes);
- methods.put(key, proxy);
- proxy.addProxyListener(new ExpressionProxy.ProxyAdapter() {
-
- public void proxyNotResolved(ProxyEvent event) {
- methods.remove(key); // Back it out. tis could happen due to endmark rollback.
- }
-
- });
-
- IDEMethodExpressionProxy ep = (IDEMethodExpressionProxy) proxy;
- ep.setMethodName(methodName);
- // We resolve immediately. Any expression proxies should also be resolved at this point too.
- Class declaringClass = getIDEBeanTypeProxy(declaringType).getTypeClass();
- Class[] parameterClasses;
- if (parameterTypes == null || parameterTypes.length == 0)
- parameterClasses = null;
- else {
- parameterClasses = new Class[parameterTypes.length];
- for (int i = 0; i < parameterClasses.length; i++) {
- parameterClasses[i] = getIDEBeanTypeProxy(parameterTypes[i]).getTypeClass();
- }
- }
- IDEMethodProxy methodProxy = ((IDEMethodProxyFactory) registry.getMethodProxyFactory()).getMethodProxy(declaringClass, methodName, parameterClasses);
- if (methodProxy == null) {
- String parms = ""; //$NON-NLS-1$
- if (parameterTypes != null && parameterTypes.length > 0) {
- StringBuffer st = new StringBuffer(100);
- for (int i = 0; i < parameterClasses.length; i++) {
- if (i > 0)
- st.append(',');
- st.append(parameterTypes[i].getTypeName());
- }
- parms = st.toString();
- }
- throw new IDEThrowableProxy(new NoSuchMethodException("No method: "+declaringType+'.'+methodName+"("+parms+')'), //$NON-NLS-1$ //$NON-NLS-2$
- getIDEBeanTypeFactory().getBeanTypeProxy(NoSuchMethodException.class));
- }
-
- ep.setProxy(methodProxy);
- eproc.allocateExpressionProxy(ep);
- } catch (ThrowableProxy e) {
- ((IDEMethodExpressionProxy) proxy).setThrowable(e); // So we don't recreate throwable all of the time.
- eproc.processException(e);
- }
- }
-
- private Map getMethods(IProxyBeanType classtype) {
- if (methodExpressionProxies == null)
- methodExpressionProxies = new HashMap();
- Map methods = (Map) methodExpressionProxies.get(classtype.getTypeName());
- if (methods == null)
- methodExpressionProxies.put(classtype.getTypeName(), methods = new HashMap());
- return methods;
- }
-
- private Object getMethodKey(String methodName, IProxyBeanType[] parameterTypes) {
- if (parameterTypes == null || parameterTypes.length == 0)
- return methodName;
- else
- return new MethodKey(methodName, parameterTypes);
- }
-
- private Map getFields(IProxyBeanType classtype) {
- if (fieldExpressionProxies == null)
- fieldExpressionProxies = new HashMap();
- Map fields = (Map) fieldExpressionProxies.get(classtype.getTypeName());
- if (fields == null)
- fieldExpressionProxies.put(classtype.getTypeName(), fields = new HashMap());
- return fields;
- }
-
- /**
- * This is used by IDEBeanTypes and IDEBeanTypeExpressionProxy to access any already created Method Expression Proxies.
- *
- * @param declaringType
- * @param methodName
- * @param parameterTypes
- * @return IProxyMethod or <code>null</code> if not yet created.
- *
- * @since 1.1.0
- */
- IProxyMethod getMethodExpressionProxy(IProxyBeanType declaringType, String methodName, IProxyBeanType[] parameterTypes) {
- Map methods = getMethods(declaringType);
- Object key = getMethodKey(methodName, parameterTypes);
- return (IProxyMethod) methods.get(key);
- }
-
- /**
- * This is used by IDEBeanTypes and IDEBeanTypeExpressionProxy to access any already created Field Expression Proxies.
- * @param declaringType
- * @param fieldName
- * @return
- *
- * @since 1.1.0
- */
- IProxyField getFieldExpressionProxy(IProxyBeanType declaringType, String fieldName) {
- Map fields = getFields(declaringType);
- return (IProxyField) fields.get(fieldName);
- }
-
- /**
- * Get the IDEMethodProxy out of the already resolved Expression Proxy or IDEMethodProxy itself.
- * @param method
- * @return
- * @throws ThrowableProxy
- *
- * @since 1.1.0
- */
- protected IDEMethodProxy getIDEMethodProxy(IProxyMethod method) throws ThrowableProxy {
- IDEMethodProxy methodProxy;
- if (method.isExpressionProxy()) {
- // It should already be resolved at this point.
- methodProxy = ((IDEMethodExpressionProxy) method).getMethodProxy();
- } else
- methodProxy = (IDEMethodProxy) method;
- return methodProxy;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.Expression#pushFieldToProxy(org.eclipse.jem.internal.proxy.core.ExpressionProxy, org.eclipse.jem.internal.proxy.core.IProxyBeanType, java.lang.String)
- */
- protected void pushFieldToProxy(ExpressionProxy proxy, IProxyBeanType declaringType, final String fieldName) {
-
- try {
- final Map fields = getFields(declaringType);
- fields.put(fieldName, proxy);
- proxy.addProxyListener(new ExpressionProxy.ProxyAdapter(){
- public void proxyNotResolved(ExpressionProxy.ProxyEvent event) {
- fields.remove(fieldName); // this can happen due to an endmark. It could be one of the ones that are rolled back.
- }
- });
-
-
- IDEFieldExpressionProxy ep = (IDEFieldExpressionProxy) proxy;
- // We resolve immediately. Any expression proxies should also be resolved at this point too.
- IDEFieldProxy fieldProxy = (IDEFieldProxy) getIDEBeanTypeProxy(declaringType).getFieldProxy(fieldName);
- if (fieldProxy == null) {
- throw new IDEThrowableProxy(new NoSuchFieldException("No field: "+declaringType+'.'+fieldName), //$NON-NLS-1$
- getIDEBeanTypeFactory().getBeanTypeProxy(NoSuchFieldException.class));
- }
-
- ep.setProxy(fieldProxy);
- eproc.allocateExpressionProxy(ep);
- } catch (ThrowableProxy e) {
- ((IDEFieldExpressionProxy) proxy).setThrowable(e); // So we don't recreate throwable all of the time.
- eproc.processException(e);
- }
-
- }
-
- /**
- * Get the IDEFieldProxy out of the already resolved Expression Proxy or IDEFieldProxy itself.
- * @param field
- * @return
- * @throws ThrowableProxy
- *
- * @since 1.1.0
- */
- protected IDEFieldProxy getIDEFieldProxy(IProxyField field) throws ThrowableProxy {
- IDEFieldProxy fieldProxy;
- if (field.isExpressionProxy()) {
- // It should already be resolved at this point.
- fieldProxy = ((IDEFieldExpressionProxy) field).getFieldProxy();
- } else
- fieldProxy = (IDEFieldProxy) field;
- return fieldProxy;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.Expression#pushIfTestToProxy()
- */
- protected void pushIfTestToProxy() {
- eproc.pushIfElse();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.Expression#pushIfElseToProxy(org.eclipse.jem.internal.proxy.initParser.tree.InternalIfElseOperandType)
- */
- protected void pushIfElseToProxy(InternalIfElseOperandType clauseType) {
- eproc.pushIfElse(clauseType);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.Expression#pushNewInstanceToProxy(java.lang.String, org.eclipse.jem.internal.proxy.core.IProxyBeanType)
- */
- protected void pushNewInstanceToProxy(String initializationString, IProxyBeanType resultType) {
- try {
- eproc.pushNewInstanceFromString(initializationString, getIDEBeanTypeProxy(resultType).getTypeClass(), getIDERegistry().fClassLoader);
- } catch (ThrowableProxy e) {
- eproc.processException(e);
- }
- }
-
- protected void pushMarkToProxy(int markID) {
- eproc.pushMark(markID);
- }
-
- protected void pushEndmarkToProxy(int markID, boolean restore) {
- eproc.pushEndmark(markID, restore);
- }
-
- protected void pushBeginTransferThreadToProxy() {
- // For IDE it doesn't matter. Just go ahead and continue processing.
- }
-
- protected void pushTransferThreadToProxy() {
- // For IDE it doesn't matter. Just go ahead and continue processing.
- }
-
- protected void pushSubexpressionBeginToProxy(int subexpressionNumber) {
- eproc.pushSubexpressionBegin(subexpressionNumber);
- }
-
- protected void pushSubexpressionEndToProxy(int subexpressionNumber) {
- eproc.pushSubexpressionEnd(subexpressionNumber);
- }
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEExtensionBeanTypeProxyFactory.java b/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEExtensionBeanTypeProxyFactory.java
deleted file mode 100644
index c3fb27721..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEExtensionBeanTypeProxyFactory.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.ide;
-/*
-
-
- */
-
-import org.eclipse.jem.internal.proxy.core.*;
-
-public interface IDEExtensionBeanTypeProxyFactory extends IBeanTypeProxyFactory {
-
-public IDEBeanTypeProxy getExtensionBeanTypeProxy(String className);
-
-public IDEBeanTypeProxy getExtensionBeanTypeProxy(String typeName, IBeanTypeProxy superType);
-
-public IProxyBeanType getExtensionBeanTypeProxy(String typeName, IExpression expression);
-
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEFieldProxy.java b/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEFieldProxy.java
deleted file mode 100644
index c23081bf2..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEFieldProxy.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.ide;
-/*
-
-
- */
-
-import java.lang.reflect.Field;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-
-import org.eclipse.jem.internal.proxy.core.*;
-
-/**
- * Implementation of IFieldProxy where the bean vm is the same as the IDE
- * Therefore we hold the instance of a java.lang.reflect.Field in a field
- * directly and have a package protected constructor to set this
- * Creation date: (1/17/00 12:32:24 PM)
- * @author: Joe Winchester
- */
-public class IDEFieldProxy extends IDEAccessibleObjectProxy implements IFieldProxy {
- protected IBeanTypeProxy fFieldType;
- /**
- * Package protected constructor that takes the field directly
- * This is package protected because only classes in the IDE package can construct
- * this. Everyone else must go via the typeProxy
- */
- IDEFieldProxy(IDEProxyFactoryRegistry aRegistry, Field aField) {
- super(aRegistry, aField);
- }
- /**
- * Get the value of the field and return it wrapped in a bean proxy
- */
- public IBeanProxy get(IBeanProxy aSubject) {
-
- Object result = null;
- // Get the field value and catch any errors
- try {
- result = ((Field) getBean()).get(aSubject != null ? ((IIDEBeanProxy) aSubject).getBean() : null);
- } catch (Exception e) {
- ProxyPlugin.getPlugin().getLogger().log(
- new Status(IStatus.WARNING, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "", e)); //$NON-NLS-1$
- }
-
- // If we have a non null result wrap it in an IBeanProxy and return it
- if (result != null) {
- return fProxyFactoryRegistry.getBeanProxy(((Field) getBean()).getType(), result);
- } else {
- return null;
- }
-
- }
- /**
- * Get the beans from both of the proxies and invoke the field set method
- * Cast to IDEBeanProxy and use package protected method
- */
- public void set(IBeanProxy aSubject, IBeanProxy argument) {
-
- // Set the field value and catch any errors
- try {
- ((Field) getBean()).set(
- aSubject != null ? ((IIDEBeanProxy) aSubject).getBean() : null,
- argument != null ? ((IIDEBeanProxy) argument).getBean() : null);
- } catch (Exception e) {
- ProxyPlugin.getPlugin().getLogger().log(
- new Status(IStatus.WARNING, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "", e)); //$NON-NLS-1$
- }
- }
- /**
- * The type proxy is constant proxy out of the method factory.
- */
- public IBeanTypeProxy getTypeProxy() {
- return ((IDEMethodProxyFactory) fProxyFactoryRegistry.getMethodProxyFactory()).fieldType;
- }
- /**
- * Return the type of the field.
- */
- public IBeanTypeProxy getFieldType() {
- if (fFieldType == null) {
- fFieldType =
- ((IDEStandardBeanTypeProxyFactory) fProxyFactoryRegistry.getBeanTypeProxyFactory()).getBeanTypeProxy(
- ((Field) getBean()).getType());
- }
- return fFieldType;
- }
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEFieldTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEFieldTypeProxy.java
deleted file mode 100644
index 6772f1fbe..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEFieldTypeProxy.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.ide;
-/*
-
-
- */
-
-/**
- * @version 1.0
- * @author
- */
-public class IDEFieldTypeProxy extends IDEBeanTypeProxy {
-
- IDEFieldTypeProxy(IDEProxyFactoryRegistry registry) {
- super(registry, java.lang.reflect.Field.class);
- }
-
- /*
- * @see IDEBeanTypeProxy#newBeanProxy(Object)
- */
- protected IIDEBeanProxy newBeanProxy(Object anObject) {
- return new IDEFieldProxy(fProxyFactoryRegistry, (java.lang.reflect.Field) anObject);
- }
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEFloatClassBeanTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEFloatClassBeanTypeProxy.java
deleted file mode 100644
index 26de58b9a..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEFloatClassBeanTypeProxy.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.ide;
-/*
-
-
- */
-
-import org.eclipse.jem.internal.proxy.core.*;
-/**
- * Float BeanType Proxy.
- */
-final class IDEFloatClassBeanTypeProxy extends IDENumberBeanTypeProxy {
-
-protected IDEFloatClassBeanTypeProxy(IDEProxyFactoryRegistry aRegistry, Class aClass) {
- super(aRegistry, aClass, new Float(0));
-}
-INumberBeanProxy createFloatBeanProxy(Float aFloat){
- return new IDENumberBeanProxy(fProxyFactoryRegistry,aFloat,this);
-}
-}
-
diff --git a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEFloatTypeBeanTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEFloatTypeBeanTypeProxy.java
deleted file mode 100644
index 86dbe3c0e..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEFloatTypeBeanTypeProxy.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.ide;
-/*
-
-
- */
-
-import org.eclipse.jem.internal.proxy.core.*;
-
-/**
- * Float BeanType Proxy.
- */
-final class IDEFloatTypeBeanTypeProxy extends IDEPrimitiveBeanTypeProxy {
-protected IDEFloatTypeBeanTypeProxy(IDEProxyFactoryRegistry aRegistry, Class aClass) {
- super(aRegistry, aClass);
-}
-INumberBeanProxy createFloatBeanProxy(float aFloat){
- return new IDENumberBeanProxy(fProxyFactoryRegistry,new Float(aFloat),this);
-}
-int getPrimitiveType(){
- return FLOAT;
-}
-
-protected IIDEBeanProxy newBeanProxy(Object anObject){
- Number n = anObject instanceof Character ? new Float(((Character) anObject).charValue()) : (Number) anObject;
- return new IDENumberBeanProxy(fProxyFactoryRegistry, n, this);
-
-}
-}
-
-
diff --git a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEInitErrorBeanTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEInitErrorBeanTypeProxy.java
deleted file mode 100644
index 3b1337589..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEInitErrorBeanTypeProxy.java
+++ /dev/null
@@ -1,260 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.ide;
-
-/*
-
-
- */
-
-import org.eclipse.jem.internal.proxy.core.*;
-
-/**
- * @author richkulp
- *
- * To change this generated comment edit the template variable "typecomment": Window>Preferences>Java>Templates. To enable and disable the creation of
- * type comments go to Window>Preferences>Java>Code Generation.
- */
-public class IDEInitErrorBeanTypeProxy extends IDEBeanTypeProxy {
-
- protected String classname;
-
- protected String initializationError;
-
- protected Throwable cause;
-
- protected IDEInitErrorBeanTypeProxy(IDEProxyFactoryRegistry registry, String classname, String initializationError, Throwable cause) {
- super(registry, null);
- this.classname = classname;
- this.initializationError = initializationError;
- this.cause = cause;
- }
-
- /**
- * Get the throwable (cause) that made this bean type bad.
- * @return the Throwable that was the cause, or null if not caused by an throwable.
- *
- * @since 1.1.0
- */
- public Throwable getCause() {
- return cause;
- }
- /**
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getConstructorProxy(String[])
- */
- public IConstructorProxy getConstructorProxy(String[] argumentClassNames) {
- return null;
- }
-
- /**
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getConstructorProxy(IBeanTypeProxy[])
- */
- public IConstructorProxy getConstructorProxy(IBeanTypeProxy[] argumentTypes) {
- return null;
- }
-
- public IConstructorProxy[] getConstructors() {
- return null;
- }
-
- /**
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getConstructorProxy(String[])
- */
- public IConstructorProxy getDeclaredConstructorProxy(String[] argumentClassNames) {
- return null;
- }
-
- /**
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getConstructorProxy(IBeanTypeProxy[])
- */
- public IConstructorProxy getDeclaredConstructorProxy(IBeanTypeProxy[] argumentTypes) {
- return null;
- }
-
- public IConstructorProxy[] getDeclaredConstructors() {
- return null;
- }
-
- public IFieldProxy[] getFields() {
- return null;
- }
-
- public IFieldProxy[] getDeclaredFields() {
- return null;
- }
-
- /**
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getFieldProxy(String)
- */
- public IFieldProxy getFieldProxy(String fieldName) {
- return null;
- }
-
- public IMethodProxy[] getMethods() {
- return null;
- }
-
- public IMethodProxy[] getDeclaredMethods() {
- return null;
- }
-
- /**
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getMethodProxy(String)
- */
- public IMethodProxy getMethodProxy(String methodName) {
- return null;
- }
-
- /**
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getMethodProxy(String, String[])
- */
- public IMethodProxy getMethodProxy(String methodName, String[] argumentClassNames) {
- return null;
- }
-
- /**
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getMethodProxy(String, String)
- */
- public IMethodProxy getMethodProxy(String methodName, String argumentClassName) {
- return null;
- }
-
- /**
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getMethodProxy(String, IBeanTypeProxy[])
- */
- public IMethodProxy getMethodProxy(String methodName, IBeanTypeProxy[] argumentTypes) {
- return null;
- }
-
- /**
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getMethodProxy(String, String[])
- */
- public IMethodProxy getDeclaredMethodProxy(String methodName, String[] argumentClassNames) {
- return null;
- }
-
- /**
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getMethodProxy(String, IBeanTypeProxy[])
- */
- public IMethodProxy getDeclaredMethodProxy(String methodName, IBeanTypeProxy[] argumentTypes) {
- return null;
- }
-
- /**
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getNullConstructorProxy()
- */
- public IConstructorProxy getNullConstructorProxy() {
- return null;
- }
-
- /**
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getSuperBeanTypeProxy()
- */
- public IBeanTypeProxy getSuperBeanTypeProxy() {
- return null;
- }
-
- /**
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getTypeName()
- */
- public String getTypeName() {
- return classname;
- }
-
- /**
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getFormalTypeName()
- */
- public String getFormalTypeName() {
- return getTypeName();
- }
-
- /**
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#isArray()
- */
- public boolean isArray() {
- return false;
- }
-
- /**
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#isInterface()
- */
- public boolean isInterface() {
- return false;
- }
-
- /**
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#isPrimitive()
- */
- public boolean isPrimitive() {
- return false;
- }
-
- /**
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#isKindOf(IBeanTypeProxy)
- */
- public boolean isKindOf(IBeanTypeProxy aBeanProxyType) {
- return false;
- }
-
- /**
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#newInstance()
- */
- public IBeanProxy newInstance() {
- return null;
- }
-
- /**
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#newInstance(String)
- */
- public IBeanProxy newInstance(String initializationString) {
- return null;
- }
-
- /**
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getInitializationError()
- */
- public String getInitializationError() {
- return initializationError;
- }
-
- /**
- * @see org.eclipse.jem.internal.proxy.core.IBeanProxy#toBeanString()
- */
- public String toBeanString() {
- return classname;
- }
-
- /**
- * @see org.eclipse.jem.internal.proxy.core.IBeanProxy#isValid()
- */
- public boolean isValid() {
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getCompatibleConstructor(org.eclipse.jem.internal.proxy.core.IBeanTypeProxy[])
- */
- public IConstructorProxy getCompatibleConstructor(IBeanTypeProxy[] argumentTypes) {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanTypeProxy#getCompatibleMethod(java.lang.String,
- * org.eclipse.jem.internal.proxy.core.IBeanTypeProxy[])
- */
- public IMethodProxy getCompatibleMethod(String methodName, IBeanTypeProxy[] argumentTypes) {
- return null;
- }
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEIntegerBeanProxy.java b/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEIntegerBeanProxy.java
deleted file mode 100644
index 09e3a43cd..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEIntegerBeanProxy.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.ide;
-/*
-
-
- */
-
-import org.eclipse.jem.internal.proxy.core.*;
-
-/**
- * IDE Proxy for Integers. Since Integers were first implemented
- * in the VCE, and because they are often referenced, we've created
- * a subclass to handle them. That way we wouldn't need to change
- * everyone that was using the IIntegerProxy interface and we
- * can store the int value to speed up access.
- */
-public class IDEIntegerBeanProxy extends IDENumberBeanProxy implements IIntegerBeanProxy {
- protected int fIntValue;
-IDEIntegerBeanProxy(IDEProxyFactoryRegistry aRegistry, Number anInteger, IBeanTypeProxy aBeanTypeProxy) {
- super(aRegistry, anInteger , aBeanTypeProxy);
- fIntValue = anInteger.intValue();
-}
-/**
- * Return the int value
- */
-public int intValue() {
- return fIntValue;
-}
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEIntegerClassBeanTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEIntegerClassBeanTypeProxy.java
deleted file mode 100644
index 5de18c03f..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEIntegerClassBeanTypeProxy.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.ide;
-/*
-
-
- */
-
-import org.eclipse.jem.internal.proxy.core.IIntegerBeanProxy;
-
-/**
- * IDE Implementation of IIntegerBeanTypeProxy
- */
-final class IDEIntegerClassBeanTypeProxy extends IDENumberBeanTypeProxy {
-// Some values are cache'd for speed
- private final IDEIntegerBeanProxy zeroIntProxy;
- private final IDEIntegerBeanProxy oneIntProxy;
- private final IDEIntegerBeanProxy twoIntProxy;
- private final IDEIntegerBeanProxy threeIntProxy;
-IDEIntegerClassBeanTypeProxy(IDEProxyFactoryRegistry aRegistry, Class aClass) {
- super(aRegistry, aClass, new Integer(0));
- // Create the cached values
- zeroIntProxy = new IDEIntegerBeanProxy(aRegistry, new Integer(0), this );
- oneIntProxy = new IDEIntegerBeanProxy(aRegistry, new Integer(1), this );
- twoIntProxy = new IDEIntegerBeanProxy(aRegistry, new Integer(2), this );
- threeIntProxy = new IDEIntegerBeanProxy(aRegistry, new Integer(3), this );
-
-}
-/**
- * Static helper to create a bean proxy
- * Package protected because everyone should go through the factory API
- * that is defined as part of IBeanProxyFactory
- */
-IIntegerBeanProxy createIntegerBeanProxy(Integer anInteger) {
- switch(anInteger.intValue()){
- case 0: return zeroIntProxy ;
- case 1: return oneIntProxy ;
- case 2: return twoIntProxy ;
- case 3: return threeIntProxy ;
- default: return new IDEIntegerBeanProxy(fProxyFactoryRegistry,anInteger,this);
- }
-}
-protected IIDEBeanProxy newBeanProxy(Object anObject){
-
- return (IIDEBeanProxy)createIntegerBeanProxy((Integer)anObject);
-
-}
-}
-
diff --git a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEIntegerTypeBeanTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEIntegerTypeBeanTypeProxy.java
deleted file mode 100644
index bf93debc7..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEIntegerTypeBeanTypeProxy.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.ide;
-/*
-
-
- */
-
-import org.eclipse.jem.internal.proxy.core.IIntegerBeanProxy;
-
-/**
- * IDE Implementation of IIntegerBeanTypeProxy
- */
-final class IDEIntegerTypeBeanTypeProxy extends IDEPrimitiveBeanTypeProxy {
-// Some values are cache'd for speed
- private final IDEIntegerBeanProxy zeroProxy;
- private final IDEIntegerBeanProxy oneProxy;
- private final IDEIntegerBeanProxy twoProxy;
- private final IDEIntegerBeanProxy threeProxy;
-IDEIntegerTypeBeanTypeProxy(IDEProxyFactoryRegistry aRegistry, Class aClass) {
- super(aRegistry, aClass);
- // Create the cached values
- zeroProxy = new IDEIntegerBeanProxy(aRegistry, new Integer(0), this );
- oneProxy = new IDEIntegerBeanProxy(aRegistry, new Integer(1), this );
- twoProxy = new IDEIntegerBeanProxy(aRegistry, new Integer(2), this );
- threeProxy = new IDEIntegerBeanProxy(aRegistry, new Integer(3), this );
-
-}
-/**
- * Static helper to create a bean proxy
- * Package protected because everyone should go through the factory API
- * that is defined as part of IBeanProxyFactory
- */
-IIntegerBeanProxy createIntegerBeanProxy(int anInt) {
- switch(anInt){
- case 0: return zeroProxy ;
- case 1: return oneProxy ;
- case 2: return twoProxy ;
- case 3: return threeProxy ;
- default: return new IDEIntegerBeanProxy(fProxyFactoryRegistry,new Integer(anInt),this);
- }
-}
-/* Specialized from IDEBeanTypeProxy to ensure IIntegerBeanProxies are created correctly
- */
-protected IIDEBeanProxy newBeanProxy(Object anObject){
- Number n = anObject instanceof Character ? new Integer(((Character) anObject).charValue()) : (Number) anObject;
- switch(n.intValue()){
- case 0: return zeroProxy ;
- case 1: return oneProxy ;
- case 2: return twoProxy ;
- case 3: return threeProxy ;
- default: return new IDEIntegerBeanProxy(fProxyFactoryRegistry, n, this);
- }
-
-
-}
-int getPrimitiveType(){
- return INTEGER;
-}
-}
-
diff --git a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDELongClassBeanTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDELongClassBeanTypeProxy.java
deleted file mode 100644
index 2bef122c4..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDELongClassBeanTypeProxy.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.ide;
-/*
-
-
- */
-
-import org.eclipse.jem.internal.proxy.core.*;
-
-/**
- * Long BeanType Proxy.
- */
-final class IDELongClassBeanTypeProxy extends IDENumberBeanTypeProxy {
-
-protected IDELongClassBeanTypeProxy(IDEProxyFactoryRegistry aRegistry, Class aClass) {
- super(aRegistry, aClass, new Long(0));
-}
-INumberBeanProxy createLongBeanProxy(Long aLong){
- return new IDENumberBeanProxy(fProxyFactoryRegistry,aLong,this);
-}
-}
-
-
diff --git a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDELongTypeBeanTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDELongTypeBeanTypeProxy.java
deleted file mode 100644
index 0c1d10a92..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDELongTypeBeanTypeProxy.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.ide;
-/*
-
-
- */
-
-import org.eclipse.jem.internal.proxy.core.*;
-/**
- * Long BeanType Proxy.
- */
-final class IDELongTypeBeanTypeProxy extends IDEPrimitiveBeanTypeProxy {
-
-protected IDELongTypeBeanTypeProxy(IDEProxyFactoryRegistry aRegistry, Class aClass) {
- super(aRegistry, aClass);
-}
-INumberBeanProxy createLongBeanProxy(long aLong){
- return new IDENumberBeanProxy(fProxyFactoryRegistry,new Long(aLong),this);
-}
-int getPrimitiveType(){
- return LONG;
-}
-
-protected IIDEBeanProxy newBeanProxy(Object anObject){
- Number n = anObject instanceof Character ? new Long(((Character) anObject).charValue()) : (Number) anObject;
- return new IDENumberBeanProxy(fProxyFactoryRegistry, n, this);
-}
-}
-
-
-
-
diff --git a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEMethodProxy.java b/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEMethodProxy.java
deleted file mode 100644
index 50ed31f8d..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEMethodProxy.java
+++ /dev/null
@@ -1,191 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.ide;
-/*
-
-
- */
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-
-import org.eclipse.jem.internal.proxy.core.*;
-
-public class IDEMethodProxy extends IDEAccessibleObjectProxy implements IMethodProxy {
-
- protected IDEMethodProxy(IDEProxyFactoryRegistry aRegistry, Method aMethod) {
- super(aRegistry, aMethod);
- }
-
- public IBeanTypeProxy getClassType() {
- return ((IDEStandardBeanTypeProxyFactory) fProxyFactoryRegistry.getBeanTypeProxyFactory()).getBeanTypeProxy(
- ((Method) getBean()).getDeclaringClass());
- }
- public IBeanTypeProxy getReturnType() {
- return ((IDEStandardBeanTypeProxyFactory) fProxyFactoryRegistry.getBeanTypeProxyFactory()).getBeanTypeProxy(
- ((Method) getBean()).getReturnType());
- }
- public IBeanTypeProxy[] getParameterTypes() {
- Class[] parmClasses = ((Method) getBean()).getParameterTypes();
- IBeanTypeProxy[] parmTypes = new IBeanTypeProxy[parmClasses.length];
- IDEStandardBeanTypeProxyFactory factory = (IDEStandardBeanTypeProxyFactory) fProxyFactoryRegistry.getBeanTypeProxyFactory();
- for (int i = 0; i < parmClasses.length; i++) {
- parmTypes[i] = factory.getBeanTypeProxy(parmClasses[i]);
- }
- return parmTypes;
- }
- public String getName() {
- return ((Method) getBean()).getName();
- }
-
- /**
- * The type proxy is constant proxy out of the method factory.
- */
- public IBeanTypeProxy getTypeProxy() {
- return ((IDEMethodProxyFactory) fProxyFactoryRegistry.getMethodProxyFactory()).methodType;
- }
-
- /**
- * Invoke the method directly. Because we are an IDEMethodProxy we can assume that IBeanProxy
- * is an IDEBeanProxy and we can get its bean directly
- */
- public IBeanProxy invoke(IBeanProxy subject) throws ThrowableProxy {
- try {
- Object result = ((Method) getBean()).invoke(subject != null ? ((IIDEBeanProxy) subject).getBean() : null, new Object[0]);
- if (result == null) {
- return null;
- } else {
- // The result may be a java.lang.Integer when we really want to create an int
- // Reflection always give you the big object
- Class returnType = ((Method) getBean()).getReturnType();
- return getBeanProxy(returnType, result);
- }
- } catch (InvocationTargetException e) {
- // This is a wrappered exception. Return the wrappered one so it looks like
- // it was the real one.
- IBeanTypeProxy exceptionTypeProxy =
- ((IDEStandardBeanTypeProxyFactory) fProxyFactoryRegistry.getBeanTypeProxyFactory()).getBeanTypeProxy(
- e.getTargetException().getClass());
- throw new IDEThrowableProxy(e.getTargetException(), exceptionTypeProxy);
- } catch (Exception exc) {
- IBeanTypeProxy exceptionTypeProxy =
- ((IDEStandardBeanTypeProxyFactory) fProxyFactoryRegistry.getBeanTypeProxyFactory()).getBeanTypeProxy(exc.getClass());
- throw new IDEThrowableProxy(exc, exceptionTypeProxy);
- }
- }
- /**
- * Do not throw an exception
- */
- public IBeanProxy invokeCatchThrowableExceptions(IBeanProxy subject) {
- try {
- return invoke(subject);
- } catch (ThrowableProxy exc) {
- ProxyPlugin.getPlugin().getLogger().log(
- new Status(IStatus.WARNING, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "", exc)); //$NON-NLS-1$
- }
- return null;
- }
- /**
- * Invoke the method with argument. The argument will be an IDEBeanProxy
- * ( because we are an IDEMethodProxy ) so we can cast to it and get the actual bean
- * itself and use this to invoke against method which is the actual
- * java.lang.Reflect instance
- */
- public IBeanProxy invoke(IBeanProxy subject, IBeanProxy argument) throws ThrowableProxy {
- try {
- Object result =
- ((Method) getBean()).invoke(
- subject != null ? ((IIDEBeanProxy) subject).getBean() : null,
- new Object[] { argument != null ? ((IIDEBeanProxy) argument).getBean() : null });
- if (result == null) {
- return null;
- } else {
- Class returnType = ((Method) getBean()).getReturnType();
- return getBeanProxy(returnType, result);
- }
- } catch (InvocationTargetException e) {
- // This is a wrappered exception. Return the wrappered one so it looks like
- // it was the real one.
- IBeanTypeProxy exceptionTypeProxy =
- ((IDEStandardBeanTypeProxyFactory) fProxyFactoryRegistry.getBeanTypeProxyFactory()).getBeanTypeProxy(
- e.getTargetException().getClass());
- throw new IDEThrowableProxy(e.getTargetException(), exceptionTypeProxy);
- } catch (Exception exc) {
- IBeanTypeProxy exceptionTypeProxy =
- ((IDEStandardBeanTypeProxyFactory) fProxyFactoryRegistry.getBeanTypeProxyFactory()).getBeanTypeProxy(exc.getClass());
- throw new IDEThrowableProxy(exc, exceptionTypeProxy);
- }
- }
- /**
- * Invoke without throwing an exception
- */
- public IBeanProxy invokeCatchThrowableExceptions(IBeanProxy subject, IBeanProxy argument) {
- try {
- return invoke(subject, argument);
- } catch (ThrowableProxy exc) {
- ProxyPlugin.getPlugin().getLogger().log(
- new Status(IStatus.WARNING, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "", exc)); //$NON-NLS-1$
- }
- return null;
- }
- /**
- * Invoke the method with arguments. The arguments will be IDEBeanProxy objects
- * ( because we are an IDEMethodProxy ) so we can cast to them and get the actual bean
- * objects themselves and use these to invoke against method which is the actual
- * java.lang.Reflect instance
- */
- public IBeanProxy invoke(IBeanProxy subject, IBeanProxy[] arguments) throws ThrowableProxy {
- Object[] beanArguments = new Object[arguments.length];
- for (int i = 0; i < arguments.length; i++) {
- if (arguments[i] != null) {
- beanArguments[i] = ((IIDEBeanProxy) arguments[i]).getBean();
- }
- }
- try {
- Object result = ((Method) getBean()).invoke(subject != null ? ((IIDEBeanProxy) subject).getBean() : null, beanArguments);
- if (result == null) {
- return null;
- } else {
- Class returnType = ((Method) getBean()).getReturnType();
- return getBeanProxy(returnType, result);
- }
- } catch (InvocationTargetException e) {
- // This is a wrappered exception. Return the wrappered one so it looks like
- // it was the real one.
- IBeanTypeProxy exceptionTypeProxy =
- ((IDEStandardBeanTypeProxyFactory) fProxyFactoryRegistry.getBeanTypeProxyFactory()).getBeanTypeProxy(
- e.getTargetException().getClass());
- throw new IDEThrowableProxy(e.getTargetException(), exceptionTypeProxy);
- } catch (Exception exc) {
- IBeanTypeProxy exceptionTypeProxy =
- ((IDEStandardBeanTypeProxyFactory) fProxyFactoryRegistry.getBeanTypeProxyFactory()).getBeanTypeProxy(exc.getClass());
- throw new IDEThrowableProxy(exc, exceptionTypeProxy);
- }
- }
- /**
- * Invoke without throwing an exception
- */
- public IBeanProxy invokeCatchThrowableExceptions(IBeanProxy subject, IBeanProxy[] arguments) {
- try {
- return invoke(subject, arguments);
- } catch (ThrowableProxy exc) {
- ProxyPlugin.getPlugin().getLogger().log(
- new Status(IStatus.WARNING, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "", exc)); //$NON-NLS-1$
- }
- return null;
- }
- IBeanProxy getBeanProxy(Class returnType, Object bean) {
- return fProxyFactoryRegistry.getBeanProxy(returnType, bean);
- }
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEMethodProxyFactory.java b/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEMethodProxyFactory.java
deleted file mode 100644
index 9122b678a..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEMethodProxyFactory.java
+++ /dev/null
@@ -1,337 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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
- *******************************************************************************/
-/*
- * $RCSfile: IDEMethodProxyFactory.java,v $ $Revision: 1.14 $ $Date: 2006/05/17 20:13:05 $
- */
-package org.eclipse.jem.internal.proxy.ide;
-
-import java.lang.reflect.*;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-
-import org.eclipse.jem.internal.proxy.common.AmbiguousMethodException;
-import org.eclipse.jem.internal.proxy.common.MethodHelper;
-import org.eclipse.jem.internal.proxy.core.*;
-
-public class IDEMethodProxyFactory implements IMethodProxyFactory {
-
- final protected IDEProxyFactoryRegistry fProxyFactoryRegistry;
-
- final protected static Map primLookup = new HashMap();
-
- IDEBeanTypeProxy accessibleType, fieldType, methodType, constructorType;
- // Cached copy of a few typical method type proxies.
- static {
- primLookup.put("int", Integer.TYPE); //$NON-NLS-1$
- primLookup.put("char", Character.TYPE); //$NON-NLS-1$
- primLookup.put("long", Long.TYPE); //$NON-NLS-1$
- primLookup.put("short", Short.TYPE); //$NON-NLS-1$
- primLookup.put("double", Double.TYPE); //$NON-NLS-1$
- primLookup.put("boolean", Boolean.TYPE); //$NON-NLS-1$
- primLookup.put("byte", Byte.TYPE); //$NON-NLS-1$
- primLookup.put("float", Float.TYPE); //$NON-NLS-1$
- }
-
- IDEMethodProxyFactory(IDEProxyFactoryRegistry aRegistry) {
- fProxyFactoryRegistry = aRegistry;
- fProxyFactoryRegistry.registerMethodProxyFactory(this);
- accessibleType = new IDEBeanTypeProxy(aRegistry, AccessibleObject.class);
- fieldType = new IDEFieldTypeProxy(aRegistry);
- methodType = new IDEMethodTypeProxy(aRegistry);
- constructorType = new IDEConstructorTypeProxy(aRegistry);
- fProxyFactoryRegistry.getBeanTypeProxyFactory().registerBeanTypeProxy(accessibleType, true);
- fProxyFactoryRegistry.getBeanTypeProxyFactory().registerBeanTypeProxy(fieldType, true);
- fProxyFactoryRegistry.getBeanTypeProxyFactory().registerBeanTypeProxy(methodType, true);
- fProxyFactoryRegistry.getBeanTypeProxyFactory().registerBeanTypeProxy(constructorType, true);
- }
-
- /**
- * Return an instance of an IDEConstructorProxy This is package protected because the only people who can use this are priveledge objects that
- * have the aMethod instance. These are part of the idevm package only. If you have to make this method public you are doing things incorrectly.
- * To get a method proxy you must use the interface methods on IMethodProxyFactory to do lookup by string or else on IBeanTypeProxy that has
- * getMethod(String) as well
- */
- IConstructorProxy getConstructorProxy(Constructor aConstructor) {
-
- return (IConstructorProxy) constructorType.newBeanProxy(aConstructor);
-
- }
-
- IConstructorProxy[] getConstructors(Class aClass) {
- Constructor[] ctors = aClass.getConstructors();
- IConstructorProxy[] ctorProxies = new IConstructorProxy[ctors.length];
- for (int i = 0; i < ctors.length; i++) {
- ctorProxies[i] = getConstructorProxy(ctors[i]);
- }
- return ctorProxies;
- }
-
- IConstructorProxy[] getDeclaredConstructors(Class aClass) {
- Constructor[] ctors = aClass.getDeclaredConstructors();
- IConstructorProxy[] ctorProxies = new IConstructorProxy[ctors.length];
- for (int i = 0; i < ctors.length; i++) {
- ctorProxies[i] = getConstructorProxy(ctors[i]);
- }
- return ctorProxies;
- }
-
- IConstructorProxy getConstructorProxy(Class aClass, Class[] args) {
-
- try {
- Constructor ctor = aClass.getConstructor(args);
- return getConstructorProxy(ctor);
- } catch (NoSuchMethodException exc) {
- return null;
- }
- }
-
- IConstructorProxy getDeclaredConstructorProxy(Class aClass, Class[] args) {
-
- try {
- Constructor ctor = aClass.getDeclaredConstructor(args);
- return getConstructorProxy(ctor);
- } catch (NoSuchMethodException exc) {
- return null;
- }
- }
-
- IFieldProxy[] getFields(Class aClass) {
- Field[] fields = aClass.getFields();
- IFieldProxy[] fieldProxies = new IFieldProxy[fields.length];
- for (int i = 0; i < fields.length; i++) {
- fieldProxies[i] = getFieldProxy(fields[i]);
- }
- return fieldProxies;
- }
-
- IFieldProxy[] getDeclaredFields(Class aClass) {
- Field[] fields = aClass.getDeclaredFields();
- IFieldProxy[] fieldProxies = new IFieldProxy[fields.length];
- for (int i = 0; i < fields.length; i++) {
- fieldProxies[i] = getFieldProxy(fields[i]);
- }
- return fieldProxies;
- }
-
- /**
- * Return an instance of an IDEFieldProxy This is package protected because the only people who can use this are priveledge objects that have the
- * aField instance. These are part of the idevm package only. If you have to make this method public you are doing things incorrectly. To get a
- * field proxy you must use the interface methods on IBeanTypeProxy that has getField(String) as well
- */
- IFieldProxy getFieldProxy(Field aField) {
-
- return (IFieldProxy) fieldType.newBeanProxy(aField);
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IMethodProxyFactory#getFieldProxy(org.eclipse.jem.internal.proxy.core.IExpression, java.lang.String, java.lang.String)
- */
- public IProxyField getFieldProxy(IExpression expression, String className, String fieldName) {
- // We are getting the class resolved through the expression. Might as well because it probably will
- // be needed again and this way when the expression is finished they will be resolved for later usage.
- IStandardBeanTypeProxyFactory beanTypeProxyFactory = fProxyFactoryRegistry.getBeanTypeProxyFactory();
- IProxyBeanType beanType = beanTypeProxyFactory.getBeanTypeProxy(expression, className);
- return beanType.getFieldProxy(expression, fieldName);
- }
-
- /**
- * Return an instance of an IDEMethodProxy This is package protected because the only people who can use this are priveledge objects that have the
- * aMethod instance. These are part of the idevm package only. If you have to make this method public you are doing things incorrectly. To get a
- * method proxy you must use the interface methods on IMethodProxyFactory to do lookup by string or else on IBeanTypeProxy that has
- * getMethod(String) as well
- */
- IDEMethodProxy getMethodProxy(Method aMethod) {
-
- return (IDEMethodProxy) methodType.newBeanProxy(aMethod);
-
- }
-
- public IMethodProxy getMethodProxy(String className, String methodName, String[] parameterTypes) {
- try {
- Class aClass = fProxyFactoryRegistry.loadClass(className);
- return getMethodProxy(aClass, methodName, parameterTypes);
- } catch (ClassNotFoundException exc) {
- ProxyPlugin.getPlugin().getLogger().log(new Status(IStatus.WARNING, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "", exc)); //$NON-NLS-1$
- return null;
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IMethodProxyFactory#getMethodProxy(org.eclipse.jem.internal.proxy.core.IExpression, java.lang.String, java.lang.String, java.lang.String[])
- */
- public IProxyMethod getMethodProxy(IExpression expression, String className, String methodName, String[] parameterTypes) {
- // We are getting the class and parmtypes resolved through the expression. Might as well because they probably will
- // be needed again and this way when the expression is finished they will be resolved for later usage.
- IStandardBeanTypeProxyFactory beanTypeProxyFactory = fProxyFactoryRegistry.getBeanTypeProxyFactory();
- IProxyBeanType beanType = beanTypeProxyFactory.getBeanTypeProxy(expression, className);
- IProxyBeanType[] parmTypes = getParameterTypes(expression, parameterTypes, beanTypeProxyFactory);
- return beanType.getMethodProxy(expression, methodName, parmTypes);
- }
-
- /**
- * Helper method for Beantypes and Proxy bean types to get the proxy.
- * @param expression
- * @param classType
- * @param methodName
- * @param parameterTypes
- * @return
- *
- * @since 1.1.0
- */
- public IProxyMethod getMethodProxy(IExpression expression, IProxyBeanType classType, String methodName, String[] parameterTypes) {
- // We are getting the parmtypes resolved through the expression. Might as well because they probably will
- // be needed again and this way when the expression is finished they will be resolved for later usage.
- IStandardBeanTypeProxyFactory beanTypeProxyFactory = fProxyFactoryRegistry.getBeanTypeProxyFactory();
- IProxyBeanType[] parmTypes = getParameterTypes(expression, parameterTypes, beanTypeProxyFactory);
- return classType.getMethodProxy(expression, methodName, parmTypes);
- }
-
- /**
- * @param expression
- * @param parameterTypes
- * @param beanTypeProxyFactory
- * @return
- *
- * @since 1.1.0
- */
- protected IProxyBeanType[] getParameterTypes(IExpression expression, String[] parameterTypes, IStandardBeanTypeProxyFactory beanTypeProxyFactory) {
- IProxyBeanType[] parmTypes;
- if (parameterTypes == null || parameterTypes.length == 0)
- parmTypes = null;
- else {
- parmTypes = new IProxyBeanType[parameterTypes.length];
- for (int i = 0; i < parameterTypes.length; i++) {
- parmTypes[i] = beanTypeProxyFactory.getBeanTypeProxy(expression, parameterTypes[i]);
- }
- }
- return parmTypes;
- }
-
- public IMethodProxy getMethodProxy(Class cls, String methodName, String[] parameterTypes) {
- try {
- Class[] parmClasses = null;
- if (parameterTypes != null) {
- parmClasses = new Class[parameterTypes.length];
- for (int i = 0; i < parmClasses.length; i++) {
- Class temp = (Class) primLookup.get(parameterTypes[i]);
- if (temp == null)
- temp = fProxyFactoryRegistry.loadClass(parameterTypes[i]);
- parmClasses[i] = temp;
- }
- }
- return getMethodProxy(cls.getMethod(methodName, parmClasses));
- } catch (ClassNotFoundException e) {
- ProxyPlugin.getPlugin().getLogger().log(new Status(IStatus.WARNING, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "", e)); //$NON-NLS-1$
- } catch (NoSuchMethodException e) {
- ProxyPlugin.getPlugin().getLogger().log(new Status(IStatus.WARNING, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "", e)); //$NON-NLS-1$
- }
- return null;
- }
-
- IMethodProxy getDeclaredMethodProxy(Class cls, String methodName, String[] parameterTypes) {
- try {
- Class[] parmClasses = null;
- if (parameterTypes != null) {
- parmClasses = new Class[parameterTypes.length];
- for (int i = 0; i < parmClasses.length; i++) {
- Class temp = (Class) primLookup.get(parameterTypes[i]);
- if (temp == null)
- temp = fProxyFactoryRegistry.loadClass(parameterTypes[i]);
- parmClasses[i] = temp;
- }
- }
- return getMethodProxy(cls.getDeclaredMethod(methodName, parmClasses));
- } catch (ClassNotFoundException e) {
- ProxyPlugin.getPlugin().getLogger().log(new Status(IStatus.WARNING, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "", e)); //$NON-NLS-1$
- } catch (NoSuchMethodException e) {
- ProxyPlugin.getPlugin().getLogger().log(new Status(IStatus.WARNING, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "", e)); //$NON-NLS-1$
- }
- return null;
- }
-
- IDEMethodProxy getMethodProxy(Class aClass, String methodName, Class[] args) {
- try {
- Method method = aClass.getMethod(methodName, args);
- return getMethodProxy(method);
- } catch (NoSuchMethodException exc) {
- ProxyPlugin.getPlugin().getLogger().log(
- new Status(IStatus.WARNING, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "Unable to find method " + aClass.getName() //$NON-NLS-1$
- + ":" + methodName + " args=" + args, exc)); //$NON-NLS-1$ //$NON-NLS-2$
- return null;
- }
- }
-
- IMethodProxy getDeclaredMethodProxy(Class aClass, String methodName, Class[] args) {
- try {
- Method method = aClass.getDeclaredMethod(methodName, args);
- return getMethodProxy(method);
- } catch (NoSuchMethodException exc) {
- ProxyPlugin.getPlugin().getLogger().log(
- new Status(IStatus.WARNING, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "Unable to find method " + aClass.getName() //$NON-NLS-1$
- + ":" + methodName + " args=" + args, exc)); //$NON-NLS-1$ //$NON-NLS-2$
- return null;
- }
- }
-
- IMethodProxy getMethodProxy(IDEBeanTypeProxy aTypeProxy, String methodName, String[] parameterTypes) {
- return getMethodProxy(aTypeProxy.fClass, methodName, parameterTypes);
- }
-
- IMethodProxy[] getMethods(Class aClass) {
- Method[] methods = aClass.getMethods();
- IMethodProxy[] methodProxies = new IMethodProxy[methods.length];
- for (int i = 0; i < methods.length; i++) {
- methodProxies[i] = getMethodProxy(methods[i]);
- }
- return methodProxies;
- }
-
- IMethodProxy getCompatibleMethod(Class aClass, String methodName, Class[] parmTypes) throws NoSuchMethodException, AmbiguousMethodException {
- Method method = MethodHelper.findCompatibleMethod(aClass, methodName, parmTypes);
- return getMethodProxy(method);
- }
-
- IConstructorProxy getCompatibleConstructor(Class aClass, Class[] parmTypes) throws AmbiguousMethodException, NoSuchMethodException, IllegalAccessException {
- Constructor method = MethodHelper.findCompatibleConstructor(aClass, parmTypes);
- return getConstructorProxy(method);
- }
-
-
- IMethodProxy[] getDeclaredMethods(Class aClass) {
- Method[] methods = aClass.getDeclaredMethods();
- IMethodProxy[] methodProxies = new IMethodProxy[methods.length];
- for (int i = 0; i < methods.length; i++) {
- methodProxies[i] = getMethodProxy(methods[i]);
- }
- return methodProxies;
- }
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IMethodProxyFactory#getInvokable(java.lang.String, java.lang.String, java.lang.String[])
- */
- public IInvokable getInvokable(String className, String methodName, String[] parameterTypes) {
- return getMethodProxy(className, methodName, parameterTypes);
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IBeanProxyFactory#terminateFactory(boolean)
- */
- public void terminateFactory(boolean wait) {
- }
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEMethodTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEMethodTypeProxy.java
deleted file mode 100644
index 681daca0b..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEMethodTypeProxy.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.ide;
-/*
-
-
- */
-
-
-/**
- * @version 1.0
- * @author
- */
-public class IDEMethodTypeProxy extends IDEBeanTypeProxy {
-
- IDEMethodTypeProxy(IDEProxyFactoryRegistry registry) {
- super(registry, java.lang.reflect.Method.class);
- }
-
- /*
- * @see IDEBeanTypeProxy#newBeanProxy(Object)
- */
- protected IIDEBeanProxy newBeanProxy(Object anObject) {
- return new IDEMethodProxy(fProxyFactoryRegistry, (java.lang.reflect.Method) anObject);
- }
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDENumberBeanProxy.java b/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDENumberBeanProxy.java
deleted file mode 100644
index 00069a214..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDENumberBeanProxy.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.ide;
-/*
-
-
- */
-
-import org.eclipse.jem.internal.proxy.core.*;
-/**
- * IDE Implementation of INumberBeanProxy for any Number (i.e. the non-primitives)
- * It can answer all of the primitive number types (int, long, short, byte, double, float).
- * Creation date: (2/6/00 9:02:54 AM)
- * @author: Joe Winchester
- */
-public class IDENumberBeanProxy extends IDEBeanProxy implements INumberBeanProxy {
- private final Number fNumberValue;
- protected IBeanTypeProxy fBeanTypeProxy;
-
-/**
- * It is package protected because they are created
- * in a special way and no one else should create them.
- * @param aBean java.lang.Object
- */
-IDENumberBeanProxy(IDEProxyFactoryRegistry aRegistry, Number aNumber , IBeanTypeProxy aBeanTypeProxy) {
- super(aRegistry,aNumber);
- fNumberValue = aNumber;
- fBeanTypeProxy = aBeanTypeProxy;
-}
-/**
- * equals: Equal if:
- * 1) This proxy == (identity) to the other object
- * 2) Else if other is an IBeanProxy and not a constant one, then if
- * equals on the server.
- * 3) If this is a constant proxy and the other is too or is a constant
- * value (e.g. IStringBeanProxy.equals(String), then true if values are equals.
- */
-public boolean equals(Object anObject) {
- if (this == anObject)
- return true; // Identity
- if (anObject instanceof IDENumberBeanProxy)
- return fNumberValue.equals(((IDENumberBeanProxy) anObject).numberValue());
- if (anObject instanceof Number)
- return fNumberValue.equals(anObject);
- return false;
-}
-/**
- * byteValue method comment.
- */
-public byte byteValue() {
- return fNumberValue.byteValue();
-}
-/**
- * doubleValue method comment.
- */
-public double doubleValue() {
- return fNumberValue.doubleValue();
-}
-/**
- * floatValue method comment.
- */
-public float floatValue() {
- return fNumberValue.floatValue();
-}
-/**
- * Return the int value
- */
-public int intValue() {
- return fNumberValue.intValue();
-}
-/**
- * longValue method comment.
- */
-public long longValue() {
- return fNumberValue.longValue();
-}
-/**
- * numberValue method comment.
- */
-public Number numberValue() {
- return fNumberValue;
-}
-/**
- * shortValue method comment.
- */
-public short shortValue() {
- return fNumberValue.shortValue();
-}
-
-/**
- * The bean's toString.
- */
-public String toBeanString() {
- return fNumberValue.toString();
-}
-public IBeanTypeProxy getTypeProxy(){
- return fBeanTypeProxy;
-}
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDENumberBeanTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDENumberBeanTypeProxy.java
deleted file mode 100644
index 0a96946d4..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDENumberBeanTypeProxy.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.ide;
-/*
-
-
- */
-
-import org.eclipse.jem.internal.proxy.core.*;
-/**
- * Number BeanType Proxy.
- */
-public abstract class IDENumberBeanTypeProxy extends IDEBeanTypeProxy {
- protected final IDENumberBeanProxy zeroProxy;
-/**
- * IDENumberBeanTypeProxy constructor comment.
- * @param aRegistry com.ibm.etools.vce.proxy.ProxyFactoryRegistry
- * @param aClass java.lang.Class
- */
-protected IDENumberBeanTypeProxy(IDEProxyFactoryRegistry aRegistry, Class aClass, Number zeroNumber) {
- super(aRegistry, aClass);
- // Cache a zero proxy of this type (though the number will be Long).
- zeroProxy = new IDENumberBeanProxy(aRegistry, zeroNumber , this);
-}
-/**
- * Helper to create a bean proxy
- * Package protected because everyone should go through the factory API
- * that is defined as part of IBeanProxyFactory
- */
-INumberBeanProxy createNumberBeanProxy(Number aNumber) {
- if (aNumber == null || zeroProxy.fBean.equals(aNumber))
- return zeroProxy;
- return new IDENumberBeanProxy(fProxyFactoryRegistry, aNumber, this);
-}
-/**
- * Specialized from IDEBeanTypeProxy to ensure INumberBeanProxies are created correctly.
- */
-protected IIDEBeanProxy newBeanProxy(Object anObject){
-
- return (IIDEBeanProxy)createNumberBeanProxy((Number) anObject);
-
-}
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEObjectBeanProxy.java b/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEObjectBeanProxy.java
deleted file mode 100644
index 55215e1e9..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEObjectBeanProxy.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.ide;
-/*
-
-
- */
-
-import org.eclipse.jem.internal.proxy.core.*;
-
-public class IDEObjectBeanProxy extends IDEBeanProxy {
-
- protected IBeanTypeProxy fBeanTypeProxy; // Cache the type proxy for speed
-
-protected IDEObjectBeanProxy(IDEProxyFactoryRegistry aRegistry){
- super(aRegistry);
-}
-/**
- * Constructor that lets the bean type be set on creation.
- * This saves the overhead of it being looked up the first time it is asked for.
- *
- * This is protected because the only person
- * who should use it is the IDEBeanTypeProxy or a subclass. Making it package protected stops people from
- * writing bogus code and doing casts and slamming new beans in without going through the proper API
- * that is based around any kind of VM artifact being proxied to support target VMs and pluggable JDK
- * levels
- */
-protected IDEObjectBeanProxy(IDEProxyFactoryRegistry aRegistry, Object aBean, IBeanTypeProxy aBeanTypeProxy){
-
- this(aRegistry, aBean);
- fBeanTypeProxy = aBeanTypeProxy;
-
-}
-/**
- * Set the bean we are proxying. We are a proxy for a bean running on the same IDE
- * so we hold the bean directly and can return it.
- */
-protected IDEObjectBeanProxy(IDEProxyFactoryRegistry aRegistry, Object aBean){
- this(aRegistry);
-
- fBean = aBean;
-
-}
-/**
- * The type proxy is got from our class name
- * If we have the type return it, otherwise go the factory for it
- * Don't new it up because the factory must be responsible for creating type proxies as it
- * has to perform instance management on them
- */
-public IBeanTypeProxy getTypeProxy() {
-
- if ( fBeanTypeProxy == null ) {
- fBeanTypeProxy = fProxyFactoryRegistry.getBeanTypeProxyFactory().getBeanTypeProxy( fBean.getClass().getName() );
- }
- return fBeanTypeProxy;
-}
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEPrimitiveBeanTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEPrimitiveBeanTypeProxy.java
deleted file mode 100644
index 36e970390..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEPrimitiveBeanTypeProxy.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.ide;
-/*
-
-
- */
-
-
-public abstract class IDEPrimitiveBeanTypeProxy extends IDEBeanTypeProxy {
-
- static final int BOOLEAN = 1;
- static final int BYTE = 2;
- static final int CHAR = 3;
- static final int DOUBLE = 4;
- static final int FLOAT = 5;
- static final int INTEGER = 6;
- static final int LONG = 7;
- static final int SHORT = 8;
-
-public IDEPrimitiveBeanTypeProxy(IDEProxyFactoryRegistry aRegistry,Class aClass){
- super(aRegistry,aClass);
-}
-public boolean isPrimitive() {
- return true;
-}
-abstract int getPrimitiveType();
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEProxyFactoryRegistry.java b/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEProxyFactoryRegistry.java
deleted file mode 100644
index fd2726e2f..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEProxyFactoryRegistry.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.ide;
-/*
-
-
- */
-
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.util.*;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.Platform;
-import org.osgi.framework.Bundle;
-
-import org.eclipse.jem.internal.proxy.common.IVMServer;
-import org.eclipse.jem.internal.proxy.core.*;
-/**
- * This implementation runs the Beans inside the Eclipse IDE
- * It should only be used by plugins that can guarantee their their beans do
- * not change during the lifetime of the IDE and can run at the same JDK level
- * that the Eclipse IDE is running
- */
-
-public class IDEProxyFactoryRegistry extends BaseProxyFactoryRegistry implements IVMServer {
-
- public static final String IDE_REGISTRY_TYPE_ID = "org.eclipse.jem.IDE"; //$NON-NLS-1$
- protected String fName;
- protected ClassLoader fClassLoader;
- protected IDECallbackRegistry fCallbackRegistry;
-
- /*
- * Special classloader that firsts tries to load from bundle then tries from url paths so
- * that bundle is treated as being at the head of the url paths.
- *
- * @since 1.0.0
- */
- private static class IDESpecialClassLoader extends URLClassLoader {
-
- private Bundle bundle;
- // This is the bundle that contains the IDE Eclipse code.
- // This must be checked first because there are IDE specific stuff that is used on the "remote vm" too and
- // so must be common.
- private Bundle ideBundle;
-
- public IDESpecialClassLoader(URL[] urls, Bundle bundle) {
- super(urls, null);
- ideBundle = ProxyPlugin.getPlugin().getBundle();
- this.bundle = bundle;
- }
-
- public IDESpecialClassLoader(URL[] urls) {
- this(urls, null);
- }
-
- /* (non-Javadoc)
- * @see java.lang.ClassLoader#findClass(java.lang.String)
- */
- protected Class findClass(String name) throws ClassNotFoundException {
- try {
- return ideBundle.loadClass(name);
- } catch (ClassNotFoundException e) {
- if (bundle != null) {
- try {
- return bundle.loadClass(name);
- } catch (ClassNotFoundException e1) {
- }
- }
- return super.findClass(name);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.ClassLoader#findResource(java.lang.String)
- */
- public URL findResource(String name) {
- URL r = ideBundle.getResource(name);
- if (r == null && bundle != null)
- r = bundle.getResource(name);
- return r != null ? r : super.findResource(name);
- }
-}
-
-/**
- * Create a special loader that has the plugin classloader of the passed in plugin
- * as the parent loader, plus all of the urls, plus the remotevm.jar file that is
- * needed by IDE Proxy to work.
- */
-public static ClassLoader createSpecialLoader(String pluginName, URL[] otherURLs) {
- Bundle bundle = pluginName != null ? Platform.getBundle(pluginName) : null;
-
- URL[] mustHaveUrls = ProxyPlugin.getPlugin().urlLocalizeAllFromBundleAndFragments(ProxyPlugin.getPlugin().getBundle(), "vm/remotevm.jar"); //$NON-NLS-1$
-
- URL[] urls = null;
- if (otherURLs != null) {
- urls = new URL[otherURLs.length+mustHaveUrls.length];
- System.arraycopy(mustHaveUrls, 0, urls, 0, mustHaveUrls.length);
- System.arraycopy(otherURLs, 0, urls, mustHaveUrls.length, otherURLs.length);
- } else
- urls = mustHaveUrls;
-
- return bundle != null ? new IDESpecialClassLoader(urls, bundle) : new IDESpecialClassLoader(urls);
-}
-
-public IDEProxyFactoryRegistry(String aName, ClassLoader loader) {
- super(IDE_REGISTRY_TYPE_ID);
- fName = aName;
- fClassLoader = loader;
-}
-
-ClassLoader getPluginClassLoader(){
- return fClassLoader;
-}
-
-protected void registryTerminated(boolean wait){
- List runnables = null;
- synchronized (this) {
- runnables = shutdownRunnables;
- shutdownRunnables = null;
- }
- if (runnables != null) {
- for (Iterator itr = runnables.iterator(); itr.hasNext();) {
- try {
- ((Runnable) itr.next()).run();
- } catch (RuntimeException e) {
- e.printStackTrace();
- }
- }
- }
-}
-
-Class loadClass(String aClassName) throws ClassNotFoundException, ExceptionInInitializerError, LinkageError {
- return fClassLoader.loadClass(aClassName);
-}
-
-public ICallbackRegistry getCallbackRegistry(){
- if ( fCallbackRegistry == null ){
- fCallbackRegistry = new IDECallbackRegistry(this);
- }
- return fCallbackRegistry;
-}
-
-
-/**
- * Get a bean proxy from the bean of the correct type.
- *
- * @param returnType
- * @param bean
- * @return
- *
- * @since 1.0.0
- */
-IBeanProxy getBeanProxy(Class returnType, Object bean) {
- IDEStandardBeanTypeProxyFactory proxyFactory = (IDEStandardBeanTypeProxyFactory) this.getBeanTypeProxyFactory();
- if (!returnType.isPrimitive()) {
- return IDEStandardBeanProxyFactory.createBeanProxy(this, bean);
- } else if (returnType == Integer.TYPE) {
- return proxyFactory.intType.newBeanProxy(bean);
- } else if (returnType == Boolean.TYPE) {
- return proxyFactory.booleanType.newBeanProxy(bean);
- } else if (returnType == Float.TYPE) {
- return proxyFactory.floatType.newBeanProxy(bean);
- } else if (returnType == Long.TYPE) {
- return proxyFactory.longType.newBeanProxy(bean);
- } else if (returnType == Short.TYPE) {
- return proxyFactory.shortType.newBeanProxy(bean);
- } else if (returnType == Double.TYPE) {
- return proxyFactory.doubleType.newBeanProxy(bean);
- } else if (returnType == Byte.TYPE) {
- return proxyFactory.byteType.newBeanProxy(bean);
- } else if (returnType == Character.TYPE) {
- return proxyFactory.charType.newBeanProxy(bean);
- } else {
- throw new RuntimeException("Unknown primitive type " + returnType.getName()); //$NON-NLS-1$
- }
-}
-
-List shutdownRunnables;
-
-public synchronized void addShutdownListener(Runnable runnable) {
- if (shutdownRunnables == null) {
- shutdownRunnables = new ArrayList();
- } else if (shutdownRunnables.contains(runnable))
- return;
- shutdownRunnables.add(runnable);
-}
-
-public synchronized void removeShutdownListener(Runnable runnable) {
- if (shutdownRunnables != null)
- shutdownRunnables.remove(runnable);
-}
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDERegistration.java b/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDERegistration.java
deleted file mode 100644
index 8af6861c9..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDERegistration.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2006 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.jem.internal.proxy.ide;
-/*
-
-
- */
-
-import java.net.URL;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.*;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.launching.JavaRuntime;
-
-import org.eclipse.jem.internal.proxy.core.*;
-import org.eclipse.jem.internal.proxy.ide.awt.IDERegisterAWT;
-import org.eclipse.jem.internal.proxy.remote.LocalFileConfigurationContributorController;
-/**
- * This is the registration class for starting an IDERemote VM.
- */
-
-public class IDERegistration {
-
- public static ProxyFactoryRegistry startAnImplementation(
- IConfigurationContributor[] contributors,
- boolean attachAWT,
- IProject project,
- String vmName,
- String pluginName,
- IProgressMonitor pm) throws CoreException {
- IDERegistration idereg = new IDERegistration(pluginName);
- return idereg.startImplementation(contributors, attachAWT, project, vmName, pm);
- }
-
- public IDERegistration() {
- }
-
- private IDERegistration(String pluginName) {
- this.pluginName = pluginName;
- }
- private String pluginName;
-
- /**
- * This will create a remote VM and return an initialized REMProxyFactoryRegistry.
- * Passed in are:
- * project: The project this is being started on. Must not be null and must be a JavaProject. (Currently ignored for IDE).
- * attachAWT: Should AWT be attached to this implementation.
- * contributors: Contributors to the configuration. Can be null.
- * pm: ProgressMonitor to use. Must not be null.
- * vmName: Name for the vm. Can be null.
- */
- public ProxyFactoryRegistry startImplementation(
- IConfigurationContributor[] contributors,
- boolean attachAWT,
- IProject project,
- String vmName,
- IProgressMonitor pm)
- throws CoreException {
-
- URL[] classPaths = null;
- IJavaProject javaProject = null;
- if (project != null) {
- javaProject = JavaCore.create(project);
- // Add in the paths for the project
- classPaths = ProxyLaunchSupport.convertStringPathsToURL(JavaRuntime.computeDefaultRuntimeClassPath(javaProject));
- } else
- classPaths = new URL[0];
-
- final IJavaProject jp = javaProject;
-
- final ProxyLaunchSupport.LaunchInfo launchInfo = new ProxyLaunchSupport.LaunchInfo();
- contributors = ProxyLaunchSupport.fillInLaunchInfo(contributors == null ? ProxyLaunchSupport.EMPTY_CONFIG_CONTRIBUTORS : contributors, launchInfo, jp != null ? jp.getElementName() : null);
- final LocalFileConfigurationContributorController controller = new LocalFileConfigurationContributorController(classPaths, new URL[3][], launchInfo);
- final IConfigurationContributor[] contribs = contributors;
- for (int i = 0; i < contributors.length; i++) {
- final int ii = i;
- // Run in safe mode so that anything happens we don't go away.
- SafeRunner.run(new ISafeRunnable() {
- public void handleException(Throwable exception) {
- // Don't need to do anything. Platform.run logs it for me.
- }
-
- public void run() throws Exception {
- contribs[ii].initialize(launchInfo.getConfigInfo());
- }
- });
- }
- for (int i = 0; i < contributors.length; i++) {
- final int ii = i;
- // Run in safe mode so that anything happens we don't go away.
- SafeRunner.run(new ISafeRunnable() {
- public void handleException(Throwable exception) {
- // Don't need to do anything. Platform.run logs it for me.
- }
-
- public void run() throws Exception {
- contribs[ii].contributeClasspaths(controller);
- }
- });
- }
- classPaths = controller.getFinalClasspath();
-
- final BaseProxyFactoryRegistry registry = (BaseProxyFactoryRegistry) createIDEProxyFactoryRegistry(vmName, pluginName, classPaths);
- ProxyLaunchSupport.performExtensionRegistrations(registry, launchInfo);
- for (int i = 0; i < contribs.length; i++) {
- final int ii = i;
- // Run in safe mode so that anything happens we don't go away.
- SafeRunner.run(new ISafeRunnable() {
- public void handleException(Throwable exception) {
- // Don't need to do anything. Platform.run logs it for me.
- }
-
- public void run() throws Exception {
- contribs[ii].contributeToRegistry(registry);
- }
- });
- }
-
- return registry;
- }
-
- public static ProxyFactoryRegistry createIDEProxyFactoryRegistry(String aName, String aPluginName, URL[] otherURLs) {
- // Create the registry.
- IDEProxyFactoryRegistry registry =
- new IDEProxyFactoryRegistry(aName, IDEProxyFactoryRegistry.createSpecialLoader(aPluginName, otherURLs));
- initRegistry(registry);
- return registry;
- }
-
- public static ProxyFactoryRegistry createIDEProxyFactoryRegistry(String aName, ClassLoader loader) {
- // Create the registry.
- IDEProxyFactoryRegistry registry = new IDEProxyFactoryRegistry(aName, loader);
- initRegistry(registry);
- return registry;
- }
-
- private static void initRegistry(IDEProxyFactoryRegistry registry) {
- new IDEStandardBeanTypeProxyFactory(registry);
- new IDEStandardBeanProxyFactory(registry);
- new IDEMethodProxyFactory(registry);
- // Always support AWT for now
- IDERegisterAWT.registerAWT(registry);
- }
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEShortClassBeanTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEShortClassBeanTypeProxy.java
deleted file mode 100644
index 2bac55d2a..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEShortClassBeanTypeProxy.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.ide;
-/*
-
-
- */
-
-import org.eclipse.jem.internal.proxy.core.*;
-/**
- * Short BeanType Proxy.
- */
-final class IDEShortClassBeanTypeProxy extends IDENumberBeanTypeProxy {
-protected IDEShortClassBeanTypeProxy(IDEProxyFactoryRegistry aRegistry, Class aClass) {
- super(aRegistry, aClass, new Short((short)0));
-}
-INumberBeanProxy createShortBeanProxy(Short aShort){
- return new IDENumberBeanProxy(fProxyFactoryRegistry,aShort,this);
-}
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEShortTypeBeanTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEShortTypeBeanTypeProxy.java
deleted file mode 100644
index 3ae6dfb64..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEShortTypeBeanTypeProxy.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.ide;
-/*
-
-
- */
-
-import org.eclipse.jem.internal.proxy.core.*;
-
-/**
- * Short BeanType Proxy.
- */
-final class IDEShortTypeBeanTypeProxy extends IDEPrimitiveBeanTypeProxy {
-protected IDEShortTypeBeanTypeProxy(IDEProxyFactoryRegistry aRegistry, Class aClass) {
- super(aRegistry, aClass);
-}
-INumberBeanProxy createShortBeanProxy(short aShort){
- return new IDENumberBeanProxy(fProxyFactoryRegistry,new Short(aShort),this);
-}
-int getPrimitiveType(){
- return SHORT;
-}
-protected IIDEBeanProxy newBeanProxy(Object anObject){
- Number n = anObject instanceof Character ? new Short((short) ((Character) anObject).charValue()) : (Number) anObject;
- return new IDENumberBeanProxy(fProxyFactoryRegistry, n, this);
-}
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEStandardBeanProxyFactory.java b/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEStandardBeanProxyFactory.java
deleted file mode 100644
index 85a852b28..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEStandardBeanProxyFactory.java
+++ /dev/null
@@ -1,262 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.ide;
-/*
- * $RCSfile: IDEStandardBeanProxyFactory.java,v $ $Revision: 1.11 $ $Date: 2005/08/24 20:39:06 $
- */
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-
-import org.eclipse.jem.internal.proxy.common.IVMServer;
-import org.eclipse.jem.internal.proxy.core.*;
-import org.eclipse.jem.internal.proxy.initParser.InitializationStringParser;
-
-public class IDEStandardBeanProxyFactory implements IStandardBeanProxyFactory {
-
-
- protected IDEProxyFactoryRegistry fRegistry;
- protected IDEStandardBeanTypeProxyFactory fBeanTypeProxyFactory;
- private IBeanProxy ivmServerProxy;
-
- /*
- * Return a bean proxy for the argument. To do this create through the correct BeanTypeProxy
- * Which ensures that special subclasses of IDEBeanProxy are created. This is just a local
- * helper method.
- */
- static IIDEBeanProxy createBeanProxy(ProxyFactoryRegistry aRegistry, Object anObject) {
-
- return ((IDEStandardBeanProxyFactory) aRegistry.getBeanProxyFactory()).createIDEBeanProxyWith(anObject);
- }
-
- IDEStandardBeanProxyFactory(IDEProxyFactoryRegistry aRegistry) {
- fRegistry = aRegistry;
- fRegistry.registerBeanProxyFactory(this);
- fBeanTypeProxyFactory = (IDEStandardBeanTypeProxyFactory) aRegistry.getBeanTypeProxyFactory();
- ivmServerProxy = fRegistry.getBeanProxy(IVMServer.class, fRegistry);
- }
-
- public IStringBeanProxy createBeanProxyWith(String aString) {
- return fBeanTypeProxyFactory.stringClass.createStringBeanProxy(aString);
- }
-
- public INumberBeanProxy createBeanProxyWith(float aFloat) {
- return fBeanTypeProxyFactory.floatType.createFloatBeanProxy(aFloat);
- }
-
- public INumberBeanProxy createBeanProxyWith(short aShort) {
- return fBeanTypeProxyFactory.shortType.createShortBeanProxy(aShort);
- }
-
- public ICharacterBeanProxy createBeanProxyWith(char aChar) {
- return fBeanTypeProxyFactory.charType.createCharBeanProxy(aChar);
- }
-
- public ICharacterBeanProxy createBeanProxyWith(Character aCharacter) {
- return fBeanTypeProxyFactory.charClass.createCharacterBeanProxy(aCharacter);
- }
-
- public IIntegerBeanProxy createBeanProxyWith(int anInt) {
- return fBeanTypeProxyFactory.intType.createIntegerBeanProxy(anInt);
- }
-
- public IIntegerBeanProxy createBeanProxyWith(Integer anInteger) {
- return fBeanTypeProxyFactory.integerClass.createIntegerBeanProxy(anInteger);
- }
-
- public INumberBeanProxy createBeanProxyWith(long aLong) {
- return fBeanTypeProxyFactory.longType.createLongBeanProxy(aLong);
- }
-
- public INumberBeanProxy createBeanProxyWith(Number aNumber) {
- IDENumberBeanTypeProxy numberTypeProxy = (IDENumberBeanTypeProxy) fBeanTypeProxyFactory.getBeanTypeProxy(aNumber.getClass());
- return numberTypeProxy.createNumberBeanProxy(aNumber);
- }
-
- public IBooleanBeanProxy createBeanProxyWith(boolean aBoolean) {
- return fBeanTypeProxyFactory.booleanType.createBooleanBeanProxy(aBoolean);
- }
-
- public IBooleanBeanProxy createBeanProxyWith(Boolean aBoolean) {
- return fBeanTypeProxyFactory.booleanClass.createBooleanBeanProxy(aBoolean);
- }
-
- public INumberBeanProxy createBeanProxyWith(byte aByte) {
- return fBeanTypeProxyFactory.byteType.createByteBeanProxy(aByte);
- }
-
- public INumberBeanProxy createBeanProxyWith(double aDouble) {
- return fBeanTypeProxyFactory.doubleType.createDoubleBeanProxy(aDouble);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IStandardBeanProxyFactory#convertToPrimitiveBeanProxy(org.eclipse.jem.internal.proxy.core.IBeanProxy)
- */
- public IBeanProxy convertToPrimitiveBeanProxy(IBeanProxy nonPrimitiveProxy) {
- if (nonPrimitiveProxy == null)
- return null;
- if (!nonPrimitiveProxy.isValid())
- return nonPrimitiveProxy;
- IDEBeanTypeProxy type = (IDEBeanTypeProxy) nonPrimitiveProxy.getTypeProxy();
- if (type.getClass() == Boolean.class)
- return this.createBeanProxyWith(((IBooleanBeanProxy) nonPrimitiveProxy).booleanValue());
- else if (type.getClass() == Byte.class)
- return this.createBeanProxyWith(((INumberBeanProxy) nonPrimitiveProxy).byteValue());
- else if (type.getClass() == Character.class)
- return this.createBeanProxyWith(((ICharacterBeanProxy) nonPrimitiveProxy).charValue());
- else if (type.getClass() == Double.class)
- return this.createBeanProxyWith(((INumberBeanProxy) nonPrimitiveProxy).doubleValue());
- else if (type.getClass() == Float.class)
- return this.createBeanProxyWith(((INumberBeanProxy) nonPrimitiveProxy).floatValue());
- else if (type.getClass() == Integer.class)
- return this.createBeanProxyWith(((INumberBeanProxy) nonPrimitiveProxy).intValue());
- else if (type.getClass() == Long.class)
- return this.createBeanProxyWith(((INumberBeanProxy) nonPrimitiveProxy).longValue());
- else if (type.getClass() == Short.class)
- return this.createBeanProxyWith(((INumberBeanProxy) nonPrimitiveProxy).shortValue());
- else
- return nonPrimitiveProxy;
- }
-
- /**
- * Create a one-dimensional array. The result will be the same as calling
- * createBeanProxyWith(IBeanTypeProxy type, new int[1] {x}) where 'x' is the value passed in as
- * the dimension.
- */
- public IArrayBeanProxy createBeanProxyWith(IBeanTypeProxy type, int dimension) throws ThrowableProxy {
- return createBeanProxyWith(type, new int[] { dimension });
- }
-
- /**
- * Create an array bean proxy.
- * - (int, new int[2] {3, 4}) will create: int [3] [4]
- * - (int[], new int[1] {1}) int [1]
- * - (int[], new int[2] {2,3}) int [2] [3]
- *
- * - (int[], null) or (int[], new int[0]) or (int, null) or (int, new int[0]) int [0]... or
- * (int[][]..., null) or (int[][]..., new int[0]) int[0][]... This is because an array instance
- * with no specified dimensions is not valid.
- * - (int[][], new int[1] {3}) int[3][]
- */
- public IArrayBeanProxy createBeanProxyWith(IBeanTypeProxy type, int[] dimensions) throws ThrowableProxy {
- if (type.isArray())
- return ((IDEArrayBeanTypeProxy) type).createBeanProxyWith(dimensions); // Already an
- // array type,
- // just pass it
- // on.
- else {
- // It is not an array type, so we need to get an array of this type and dimensions.
- IDEArrayBeanTypeProxy arrayType =
- (IDEArrayBeanTypeProxy) fBeanTypeProxyFactory.getBeanTypeProxy(type.getTypeName(), dimensions.length);
- return arrayType.createBeanProxyWith(dimensions);
- }
- }
-
- public void releaseProxy(IBeanProxy aProxy) {
- // Do nothing. This is more for remote proxies
- }
-
- /**
- * createIDEBeanProxyWith method comment. This is not part of the IStandardBeanProxyFactory
- * interface. It is available only from IDEBeanProxyFactory so that IDE registered extensions
- * can wrapper a bean. They will need to get current and explicitly cast to
- * IDEBeanProxyFactory, so they should only be IDE types themselves.
- */
- public IIDEBeanProxy createIDEBeanProxyWith(Object anObject) {
- if (anObject == null)
- return null;
- return ((IDEBeanTypeProxy) fBeanTypeProxyFactory.getBeanTypeProxy(anObject.getClass())).newBeanProxy(anObject);
- }
-
- /**
- * For the IDE Factory we will create an IDEBeanProxy using the initializationString. If the
- * format of the string is not one we understand, pass it onto the evaluator. The
- * initStringParser is passed to allow shortcut evaluation. Package protected so only
- * IDEBeanTypeProxies can create instances.
- */
- IBeanProxy createBeanProxy(IDEBeanTypeProxy aTypeProxy, String initializationString) {
- if (initializationString.equals("null")) //$NON-NLS-1$
- return null; // Value is initialized as null.
- // We have to evaluate the result of the initializationString
- try {
- ClassLoader pluginClassLoader = fRegistry.getPluginClassLoader();
- Object newValue = InitializationStringParser.evaluate(initializationString, pluginClassLoader);
- return newValue != null ? aTypeProxy.newBeanProxy(newValue) : null;
- } catch (Exception exc) {
- ProxyPlugin.getPlugin().getLogger().log(
- new Status(IStatus.WARNING, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "", exc)); //$NON-NLS-1$
- return null;
- }
- }
-
- /**
- * For the IDE Factory we will create an IDEBeanProxy using the null constructor Package
- * protected so only IDEBeanTypeProxies can create instances.
- */
- IBeanProxy createBeanProxy(IDEBeanTypeProxy aTypeProxy) {
-
- Class beanType = aTypeProxy.fClass;
-
- // If the beanType is a primitive, the creation will fail because you can't
- // create a primitive without a value.
- try {
- return aTypeProxy.newBeanProxy(!(aTypeProxy.isPrimitive()) ? beanType.newInstance() : null);
- } catch (Exception exc) {
- ProxyPlugin.getPlugin().getLogger().log(
- new Status(IStatus.WARNING, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "", exc)); //$NON-NLS-1$
- return null;
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IBeanProxyFactory#terminateFactory(boolean)
- */
- public void terminateFactory(boolean wait) {
- // Nothing really to do here - more applicable to remote proxy factories
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IStandardBeanProxyFactory#createExpression()
- */
- public IExpression createExpression() {
- return new IDEExpression(this.fRegistry);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IStandardBeanProxyFactory#createBeanProxyFrom(java.lang.String)
- */
- public IBeanProxy createBeanProxyFrom(String initializationString) throws ThrowableProxy {
- if (initializationString.equals("null")) //$NON-NLS-1$
- return null; // Value is initialized as null.
- // We have to evaluate the result of the initializationString
- try {
- ClassLoader pluginClassLoader = fRegistry.getPluginClassLoader();
- InitializationStringParser parser = InitializationStringParser.createParser(initializationString, pluginClassLoader);
- Object newValue = parser.evaluate();
- if (newValue != null) {
- return fRegistry.getBeanProxy(parser.getExpectedType(), newValue);
- } else
- return null;
- } catch (Exception exc) {
- ProxyPlugin.getPlugin().getLogger().log(
- new Status(IStatus.WARNING, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "", exc)); //$NON-NLS-1$
- return null;
- }
- }
-
- public IBeanProxy getIVMServerProxy() {
- return ivmServerProxy;
- }
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEStandardBeanTypeProxyFactory.java b/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEStandardBeanTypeProxyFactory.java
deleted file mode 100644
index 2dfd7fbc3..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEStandardBeanTypeProxyFactory.java
+++ /dev/null
@@ -1,465 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.ide;
-
-/*
- * $RCSfile: IDEStandardBeanTypeProxyFactory.java,v $ $Revision: 1.12 $ $Date: 2005/08/24 20:39:06 $
- */
-
-import java.lang.reflect.Array;
-import java.math.BigDecimal;
-import java.math.BigInteger;
-import java.text.MessageFormat;
-import java.util.*;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-
-import org.eclipse.jem.internal.proxy.common.MapTypes;
-import org.eclipse.jem.internal.proxy.core.*;
-import org.eclipse.jem.internal.proxy.core.ExpressionProxy.ProxyEvent;
-
-public class IDEStandardBeanTypeProxyFactory implements IStandardBeanTypeProxyFactory {
-
- protected final IDEProxyFactoryRegistry fFactoryRegistry;
-
- // Hashtable to cache proxies for classes so they are found on second and subsequent lookups
- protected Map beanProxies;
-
- public static Map MAP_SHORTSIG_TO_TYPE = new HashMap(8);
-
- public static Map MAP_TYPENAME_TO_SHORTSIG = new HashMap(8);
-
- static {
- MAP_SHORTSIG_TO_TYPE.put("B", Byte.TYPE); //$NON-NLS-1$
- MAP_SHORTSIG_TO_TYPE.put("C", Character.TYPE); //$NON-NLS-1$
- MAP_SHORTSIG_TO_TYPE.put("D", Double.TYPE); //$NON-NLS-1$
- MAP_SHORTSIG_TO_TYPE.put("F", Float.TYPE); //$NON-NLS-1$
- MAP_SHORTSIG_TO_TYPE.put("I", Integer.TYPE); //$NON-NLS-1$
- MAP_SHORTSIG_TO_TYPE.put("J", Long.TYPE); //$NON-NLS-1$
- MAP_SHORTSIG_TO_TYPE.put("S", Short.TYPE); //$NON-NLS-1$
- MAP_SHORTSIG_TO_TYPE.put("Z", Boolean.TYPE); //$NON-NLS-1$
-
- MAP_TYPENAME_TO_SHORTSIG.put("byte", "B"); //$NON-NLS-1$ //$NON-NLS-2$
- MAP_TYPENAME_TO_SHORTSIG.put("char", "C"); //$NON-NLS-1$ //$NON-NLS-2$
- MAP_TYPENAME_TO_SHORTSIG.put("double", "D"); //$NON-NLS-1$ //$NON-NLS-2$
- MAP_TYPENAME_TO_SHORTSIG.put("float", "F"); //$NON-NLS-1$ //$NON-NLS-2$
- MAP_TYPENAME_TO_SHORTSIG.put("int", "I"); //$NON-NLS-1$ //$NON-NLS-2$
- MAP_TYPENAME_TO_SHORTSIG.put("long", "J"); //$NON-NLS-1$ //$NON-NLS-2$
- MAP_TYPENAME_TO_SHORTSIG.put("short", "S"); //$NON-NLS-1$ //$NON-NLS-2$
- MAP_TYPENAME_TO_SHORTSIG.put("boolean", "Z"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // Cached copy of a few typical bean type proxies.
- IDEBeanTypeProxy objectClass;
-
- IDEBooleanTypeBeanTypeProxy booleanType;
-
- IDEBooleanClassBeanTypeProxy booleanClass;
-
- IDEIntegerTypeBeanTypeProxy intType;
-
- IDEIntegerClassBeanTypeProxy integerClass;
-
- IDEFloatTypeBeanTypeProxy floatType;
-
- IDEFloatClassBeanTypeProxy floatClass;
-
- IDELongTypeBeanTypeProxy longType;
-
- IDELongClassBeanTypeProxy longClass;
-
- IDEShortTypeBeanTypeProxy shortType;
-
- IDEShortClassBeanTypeProxy shortClass;
-
- IDEByteTypeBeanTypeProxy byteType;
-
- IDEByteClassBeanTypeProxy byteClass;
-
- IDECharTypeBeanTypeProxy charType;
-
- IDECharacterClassBeanTypeProxy charClass;
-
- IDEDoubleTypeBeanTypeProxy doubleType;
-
- IDEDoubleClassBeanTypeProxy doubleClass;
-
- IDEStringBeanTypeProxy stringClass;
-
- IDEClassBeanTypeProxy classClass;
-
- IDEBeanTypeProxy voidType;
-
- public IDEStandardBeanTypeProxyFactory(IDEProxyFactoryRegistry aRegistry) {
- fFactoryRegistry = aRegistry;
- aRegistry.registerBeanTypeProxyFactory(this);
-
- // Now initialize the cache.
- objectClass = new IDEBeanTypeProxy(fFactoryRegistry, Object.class);
- booleanType = new IDEBooleanTypeBeanTypeProxy(fFactoryRegistry, Boolean.TYPE);
- booleanClass = new IDEBooleanClassBeanTypeProxy(fFactoryRegistry, Boolean.class);
- intType = new IDEIntegerTypeBeanTypeProxy(fFactoryRegistry, Integer.TYPE);
- integerClass = new IDEIntegerClassBeanTypeProxy(fFactoryRegistry, Integer.class);
- floatType = new IDEFloatTypeBeanTypeProxy(fFactoryRegistry, Float.TYPE);
- floatClass = new IDEFloatClassBeanTypeProxy(fFactoryRegistry, Float.class);
- longType = new IDELongTypeBeanTypeProxy(fFactoryRegistry, Long.TYPE);
- longClass = new IDELongClassBeanTypeProxy(fFactoryRegistry, Long.class);
- shortType = new IDEShortTypeBeanTypeProxy(fFactoryRegistry, Short.TYPE);
- shortClass = new IDEShortClassBeanTypeProxy(fFactoryRegistry, Short.class);
- byteType = new IDEByteTypeBeanTypeProxy(fFactoryRegistry, Byte.TYPE);
- byteClass = new IDEByteClassBeanTypeProxy(fFactoryRegistry, Byte.class);
- charType = new IDECharTypeBeanTypeProxy(fFactoryRegistry, Character.TYPE);
- charClass = new IDECharacterClassBeanTypeProxy(fFactoryRegistry, Character.class);
- doubleType = new IDEDoubleTypeBeanTypeProxy(fFactoryRegistry, Double.TYPE);
- doubleClass = new IDEDoubleClassBeanTypeProxy(fFactoryRegistry, Double.class);
- stringClass = new IDEStringBeanTypeProxy(fFactoryRegistry, String.class);
- classClass = new IDEClassBeanTypeProxy(fFactoryRegistry, java.lang.Class.class);
- voidType = new IDEBeanTypeProxy(fFactoryRegistry, Void.TYPE);
-
- // Initialize the hashtable with the primitives, their lang equivalents, and also common classes like String
- beanProxies = new HashMap(20);
-
- // Primitives
- beanProxies.put(intType.getTypeName(), intType);
- beanProxies.put(booleanType.getTypeName(), booleanType);
- beanProxies.put(charType.getTypeName(), charType);
- beanProxies.put(byteType.getTypeName(), byteType);
- beanProxies.put(shortType.getTypeName(), shortType);
- beanProxies.put(longType.getTypeName(), longType);
- beanProxies.put(floatType.getTypeName(), floatType);
- beanProxies.put(doubleType.getTypeName(), doubleType);
-
- // java.lang primitive peers
- // Note that special classes are used for some of these which allow the IDE to get the
- // lang objects from the objects that are holding proxies
- beanProxies.put(integerClass.getTypeName(), integerClass);
- beanProxies.put(booleanClass.getTypeName(), booleanClass);
- beanProxies.put(charClass.getTypeName(), charClass);
- beanProxies.put(byteClass.getTypeName(), byteClass);
- beanProxies.put(shortClass.getTypeName(), shortClass);
- beanProxies.put(longClass.getTypeName(), longClass);
- beanProxies.put(floatClass.getTypeName(), floatClass);
- beanProxies.put(doubleClass.getTypeName(), doubleClass);
- beanProxies.put(BigDecimal.class.getName(), new IDEBigDecimalBeanTypeProxy(fFactoryRegistry, BigDecimal.class));//$NON-NLS-1$
- beanProxies.put(BigInteger.class.getName(), new IDEBigIntegerBeanTypeProxy(fFactoryRegistry, BigInteger.class));//$NON-NLS-1$
- beanProxies.put(stringClass.getTypeName(), stringClass);
-
- beanProxies.put(classClass.getTypeName(), classClass);
- beanProxies.put(voidType.getTypeName(), voidType);
- }
-
- /**
- * We are an IDE proxy and know that the type is in the same VM as the IDE. the IDEBeanTypeProxy object NOTE This is package protected because the
- * only person who can call it are priveledged classes that are also creating things in an IDEProxy environment. If anyone needs to make this
- * method public they are doing the wrong thing as they should use the public method getBeanTypeProxy(String) that is on the interface. The only
- * other object that can guarantee that they have the class for the argument are those that are part of the idevm package
- */
- IBeanTypeProxy getBeanTypeProxy(Class anIDEClass) {
- return getBeanTypeProxy(anIDEClass.getName());
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IStandardBeanTypeProxyFactory#getBeanTypeProxy(java.lang.String)
- */
- public synchronized IBeanTypeProxy getBeanTypeProxy(String typeName) {
- typeName = MapTypes.getJNIFormatName(typeName);
-
- // See whether we already have the proxy for the argument name
- IProxyBeanType beanTypeProxy = (IProxyBeanType) beanProxies.get(typeName);
- // See if there and resolved, if so, return it. If not resolved, that means we need it NOW
- // so we must go for it. When finally resolved the original ExpressionProxy will be deregistered and
- // the resolved beantypeproxy will be in its place.
- if (beanTypeProxy != null && beanTypeProxy.isBeanProxy()) {
- return (IBeanTypeProxy) beanTypeProxy;
- }
-
- // If not an array, then see if the package extension mechanism can find it.
- // Do this here so that if it is found in the package extension we won't necessarily create an
- // extra connection when not needed.
- if (typeName.charAt(0) != '[') {
- // It is not an array
- // First check with the factory for the package of the class.
- // Inner classes have to use the dollar notation since if they didn't we couldn't tell where
- // the package ended and the class started.
- int packageIndex = typeName.lastIndexOf('.');
- if (packageIndex != -1) {
- String packageName = typeName.substring(0, packageIndex);
- IDEExtensionBeanTypeProxyFactory packageFactory = (IDEExtensionBeanTypeProxyFactory) fFactoryRegistry
- .getBeanTypeProxyFactoryExtension(packageName);
- if (packageFactory != null) {
- beanTypeProxy = packageFactory.getExtensionBeanTypeProxy(typeName);
- if (beanTypeProxy != null) {
- registerBeanTypeProxy((IBeanTypeProxy) beanTypeProxy, false);
- return (IBeanTypeProxy) beanTypeProxy;
- }
- }
- }
- // There was not a registered factory that dealt with the class. Load it using the factory
- // registry which has the plugin's class loader
- try {
- Class ideClass = fFactoryRegistry.loadClass(typeName);
- IDEBeanTypeProxy superTypeProxy = null;
- if (ideClass.getSuperclass() != null) {
- // Get the beantype proxy of the superclass.
- superTypeProxy = (IDEBeanTypeProxy) getBeanTypeProxy(ideClass.getSuperclass());
- }
-
- // Ask the supertype
- // to create a beantype proxy of the same beantype proxy class.
- // This is so that any subclasses will get the same beantype proxy class
- // for it if it is special.
- if (superTypeProxy != null)
- beanTypeProxy = superTypeProxy.newBeanTypeForClass(ideClass);
-
- if (beanTypeProxy == null)
- beanTypeProxy = new IDEBeanTypeProxy(fFactoryRegistry, ideClass);
- } catch (ClassNotFoundException e) {
- ProxyPlugin.getPlugin().getLogger().log(new Status(IStatus.INFO, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "", e)); //$NON-NLS-1$
- String msg = MessageFormat.format("{0}({1})", new Object[] { e.getClass(), e.getMessage()}); //$NON-NLS-1$
- beanTypeProxy = new IDEInitErrorBeanTypeProxy(fFactoryRegistry, typeName, msg, e);
- } catch (ExceptionInInitializerError e) {
- ProxyPlugin.getPlugin().getLogger().log(new Status(IStatus.WARNING, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "", e)); //$NON-NLS-1$
- String msg = MessageFormat.format("{0}({1})", new Object[] { e.getClass(), e.getMessage()}); //$NON-NLS-1$
- beanTypeProxy = new IDEInitErrorBeanTypeProxy(fFactoryRegistry, typeName, msg, e.getCause());
- } catch (LinkageError e) {
- ProxyPlugin.getPlugin().getLogger().log(new Status(IStatus.WARNING, ProxyPlugin.getPlugin().getBundle().getSymbolicName(), 0, "", e)); //$NON-NLS-1$
- String msg = MessageFormat.format("{0}({1})", new Object[] { e.getClass(), e.getMessage()}); //$NON-NLS-1$
- beanTypeProxy = new IDEInitErrorBeanTypeProxy(fFactoryRegistry, typeName, msg, e);
- }
-
- // Cache the instance so we can re-use it again
- beanProxies.put(typeName, beanTypeProxy);
- return (IBeanTypeProxy) beanTypeProxy;
- } else {
- // need to create a array of this many dimensions so that we can get the appropriate class for it.
- int dims = typeName.lastIndexOf('[') + 1;
- Class finalComponentType = null;
- if (typeName.charAt(dims) == 'L') {
- // It is a class.
- // Strip off up to the 'L', and the trailing ';'. That is the class name.
- IDEBeanTypeProxy finalType = (IDEBeanTypeProxy) getBeanTypeProxy(typeName.substring(dims + 1, typeName.length() - 1));
- if (finalType != null)
- finalComponentType = finalType.fClass;
- } else {
- // It is a type. Need to map it.
- finalComponentType = (Class) IDEStandardBeanTypeProxyFactory.MAP_SHORTSIG_TO_TYPE.get(typeName.substring(dims, dims + 1));
- }
-
- if (finalComponentType != null) {
- Object dummyArray = Array.newInstance(finalComponentType, new int[dims]);
- beanTypeProxy = new IDEArrayBeanTypeProxy(fFactoryRegistry, typeName, dummyArray.getClass());
- beanProxies.put(typeName, beanTypeProxy);
- }
- return (IBeanTypeProxy) beanTypeProxy;
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IStandardBeanTypeProxyFactory#getBeanTypeProxy(org.eclipse.jem.internal.proxy.core.IExpression,
- * java.lang.String)
- */
- public synchronized IProxyBeanType getBeanTypeProxy(IExpression expression, String typeName) {
- typeName = MapTypes.getJNIFormatName(typeName);
-
- // See whether we already have the proxy for the argument name
- IProxyBeanType beanTypeProxy = (IProxyBeanType) beanProxies.get(typeName);
- if (beanTypeProxy != null) { return beanTypeProxy; }
-
- // Now see if an expression proxy cached.
- beanTypeProxy = ((IDEExpression) expression).getBeanType(typeName);
- if (beanTypeProxy != null)
- return beanTypeProxy;
-
-
- // If not an array, then see if the package extension mechanism can find it.
- // Do this here so that if it is found in the package extension we won't necessarily create an
- // extra connection when not needed.
- if (typeName.charAt(0) != '[') {
- // It is not an array
- // First check with the factory for the package of the class.
- // Inner classes have to use the dollar notation since if they didn't we couldn't tell where
- // the package ended and the class started.
- int packageIndex = typeName.lastIndexOf('.');
- if (packageIndex != -1) {
- String packageName = typeName.substring(0, packageIndex);
- IDEExtensionBeanTypeProxyFactory packageFactory = (IDEExtensionBeanTypeProxyFactory) fFactoryRegistry
- .getBeanTypeProxyFactoryExtension(packageName);
- if (packageFactory != null) {
- beanTypeProxy = packageFactory.getExtensionBeanTypeProxy(typeName, expression);
- if (beanTypeProxy != null) {
- registerBeanTypeProxy(beanTypeProxy, false);
- return beanTypeProxy;
- }
- }
- }
- }
-
- // There was not a registered factory that dealt with the class. So create the expression proxy.
- beanTypeProxy = ((Expression) expression).createBeanTypeExpressionProxy(typeName);
- registerBeanTypeProxy(beanTypeProxy, false);
- return beanTypeProxy;
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IStandardBeanTypeProxyFactory#getBeanTypeProxy(java.lang.String, int)
- */
- public IBeanTypeProxy getBeanTypeProxy(String componentClassName, int dimensions) {
- return getBeanTypeProxy(getArrayClassname(componentClassName, dimensions));
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IStandardBeanTypeProxyFactory#getBeanTypeProxy(org.eclipse.jem.internal.proxy.core.IExpression,
- * java.lang.String, int)
- */
- public IProxyBeanType getBeanTypeProxy(IExpression expression, String componentClassName, int dimensions) {
- return getBeanTypeProxy(expression, getArrayClassname(componentClassName, dimensions));
- }
-
- /**
- * @param componentClassName
- * @param dimensions
- * @return
- *
- * @since 1.1.0
- */
- protected String getArrayClassname(String componentClassName, int dimensions) {
- String jniComponentTypeName = MapTypes.getJNIFormatName(componentClassName);
- String compType = jniComponentTypeName;
- if (jniComponentTypeName.charAt(0) != '[') {
- // We're not already an array, so create correct template.
- compType = (String) MAP_TYPENAME_TO_SHORTSIG.get(componentClassName);
- if (compType == null) {
- // It is a class, and not a type.
- compType = "L" + jniComponentTypeName + ";"; //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- // Now create it with the appropriate number of '[' in front.
- StringBuffer buffer = new StringBuffer(dimensions + compType.length());
- for (int i = 0; i < dimensions; i++)
- buffer.append('[');
- buffer.append(compType);
- return buffer.toString();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IBeanProxyFactory#terminateFactory(boolean)
- */
- public void terminateFactory(boolean wait) {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IStandardBeanTypeProxyFactory#registerBeanTypeProxy(org.eclipse.jem.internal.proxy.core.IBeanTypeProxy,
- * boolean)
- */
- public synchronized void registerBeanTypeProxy(IBeanTypeProxy aBeanTypeProxy, boolean permanent) {
- beanProxies.put(aBeanTypeProxy.getTypeName(), aBeanTypeProxy);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IStandardBeanTypeProxyFactory#registerBeanTypeProxy(org.eclipse.jem.internal.proxy.core.IProxyBeanType,
- * boolean)
- */
- public void registerBeanTypeProxy(IProxyBeanType aProxyBeanType, boolean permanent) {
- if (aProxyBeanType.isBeanProxy())
- registerBeanTypeProxy((IBeanTypeProxy) aProxyBeanType, permanent); // A regular kind, do regular registration.
- else {
- ExpressionProxy beanExpressionProxy = ((ExpressionProxy) aProxyBeanType);
- final String typeName = aProxyBeanType.getTypeName();
- ((IDEExpression) beanExpressionProxy.getExpression()).addBeanType(typeName, aProxyBeanType);
- beanExpressionProxy.addProxyListener(new ExpressionProxy.ProxyAdapter() {
-
- public void proxyResolved(ProxyEvent event) {
- String typeName = ((IProxyBeanType) event.getSource()).getTypeName();
- synchronized (IDEStandardBeanTypeProxyFactory.this) {
- if (!beanProxies.containsKey(typeName)) {
- // It hasn't been resolved through some other means. So this is good. Actually this should never
- // occur because upon resolution we've already registered the bean type proxy through the
- // normal mechanisms. But to be safe, we'll do it here.
- beanProxies.put(typeName, event.getProxy());
- }
- }
- }
-
- public void proxyNotResolved(ExpressionProxy.ProxyEvent event) {
- ((IDEExpression) ((ExpressionProxy) event.getSource()).getExpression()).removeBeanType(typeName);
- }
- });
- }
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IStandardBeanTypeProxyFactory#isBeanTypeRegistered(String)
- */
- public synchronized boolean isBeanTypeRegistered(String className) {
- return beanProxies.containsKey(MapTypes.getJNIFormatName(className));
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IStandardBeanTypeProxyFactory#registeredTypes()
- */
- public Set registeredTypes() {
- return beanProxies.keySet();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IStandardBeanTypeProxyFactory#isBeanTypeNotFound(String)
- */
- public boolean isBeanTypeNotFound(String className) {
- // Do nothing. No need for it in IDE system because there will always be a proxy, even when not found.
- // In that case an IDEInitErrorBeanTypeProxy will be created.
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IStandardBeanTypeProxyFactory#isMaintainNotFoundTypes()
- */
- public boolean isMaintainNotFoundTypes() {
- // Do nothing. No need for it in IDE system because there will always be a proxy, even when not found.
- // In that case an IDEInitErrorBeanTypeProxy will be created.
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.core.IStandardBeanTypeProxyFactory#setMaintainNotFoundTypes(boolean)
- */
- public void setMaintainNotFoundTypes(boolean maintain) {
- // Do nothing. No need for it in IDE system because there will always be a proxy, even when not found.
- // In that case an IDEInitErrorBeanTypeProxy will be created.
- }
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEStringBeanProxy.java b/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEStringBeanProxy.java
deleted file mode 100644
index 7dfaa9c05..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEStringBeanProxy.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.ide;
-/*
-
-
- */
-
-import org.eclipse.jem.internal.proxy.core.*;
-/**
- * IDE Implementation of IStringBeanProxy
- * Creation date: (2/6/00 9:02:42 AM)
- * @author: Joe Winchester
- */
-final class IDEStringBeanProxy extends IDEObjectBeanProxy implements IStringBeanProxy {
- protected String fString;
-/**
- * Store the bean in the string field to save re-casting each time it is asked for.
- * It is package protected because they are created
- * in a special way and no one else should create them.
- */
-IDEStringBeanProxy(IDEProxyFactoryRegistry aRegistry, Object aBean, IBeanTypeProxy aBeanTypeProxy) {
- super(aRegistry, aBean,aBeanTypeProxy);
- fString = (String)aBean;
-}
-/**
- * Return the cache'd string that is a java.lang.String that the IDE can use
- */
-public String stringValue() {
- return fString;
-}
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEStringBeanTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEStringBeanTypeProxy.java
deleted file mode 100644
index 7df370dab..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEStringBeanTypeProxy.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.ide;
-/*
-
-
- */
-
-import org.eclipse.jem.internal.proxy.core.IStringBeanProxy;
-/**
- * IDE Implementation of the BeanType proxy for java.lang.String
- */
-final class IDEStringBeanTypeProxy extends IDEBeanTypeProxy {
- // Cache a proxy to an empty string for speed
- protected final IDEStringBeanProxy emptyStringProxy;
-
-IDEStringBeanTypeProxy(IDEProxyFactoryRegistry aRegistry, Class aClass) {
- super(aRegistry, aClass);
- // Cache a proxy to an empty string for speed
- emptyStringProxy = new IDEStringBeanProxy(aRegistry, "",this); //$NON-NLS-1$
-}
-/**
- * Helper to create string beans
- * Package protected because no-one else outside the package should use this, they
- * must go through the API where you look up a factory first.
- */
-IStringBeanProxy createStringBeanProxy(String aString){
- if ( aString.equals("") ) {//$NON-NLS-1$
- return emptyStringProxy;
- } else {
- return new IDEStringBeanProxy(fProxyFactoryRegistry,aString,this);
- }
-}
-/* Specialized from IDEBeanTypeProxy to ensure IStringBeanProxies are created correctly
- */
-protected IIDEBeanProxy newBeanProxy(Object anObject){
-
- return (IIDEBeanProxy)createStringBeanProxy( (String)anObject );
-
-}
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEThrowableProxy.java b/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEThrowableProxy.java
deleted file mode 100644
index 0ad0e81f6..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEThrowableProxy.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.ide;
-/*
-
-
- */
-
-import org.eclipse.jem.internal.proxy.core.*;
-
-public class IDEThrowableProxy extends ThrowableProxy implements IIDEBeanProxy {
-
- /**
- * Comment for <code>serialVersionUID</code>
- *
- * @since 1.1.0
- */
- private static final long serialVersionUID = 7162757961175978338L;
- protected IBeanTypeProxy fBeanTypeProxy;
-
- protected IDEThrowableProxy(Throwable exc, IBeanTypeProxy aBeanTypeProxy) {
- super(exc);
- fBeanTypeProxy = aBeanTypeProxy;
- }
-
- public boolean equals(Object obj) {
- if (super.equals(obj))
- return true;
- if (obj instanceof IIDEBeanProxy) {
- return getCause().equals(((IIDEBeanProxy) obj).getBean());
- }
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IBeanProxy#sameAs(org.eclipse.jem.internal.proxy.core.IBeanProxy)
- */
- public boolean sameAs(IBeanProxy aBeanProxy) {
- if (this == aBeanProxy)
- return true;
- if (aBeanProxy instanceof IIDEBeanProxy)
- return getCause() == ((IIDEBeanProxy) aBeanProxy).getBean();
- return false;
- }
-
- public String getProxyLocalizedMessage() {
- return getCause().getLocalizedMessage();
- }
- public String getProxyMessage() {
- return getCause().getMessage();
- }
- public void printProxyStackTrace(java.io.PrintWriter writer) {
- getCause().printStackTrace(writer);
- }
- public void printProxyStackTrace(java.io.PrintStream stream) {
- getCause().printStackTrace(stream);
- }
- public void printProxyStackTrace() {
- getCause().printStackTrace();
- }
- public IBeanTypeProxy getTypeProxy() {
- return fBeanTypeProxy;
- }
- public ProxyFactoryRegistry getProxyFactoryRegistry() {
- return fBeanTypeProxy.getProxyFactoryRegistry();
- }
- public String toBeanString() {
- return getCause().toString();
- }
- public boolean isValid() {
- return true;
- }
- /**
- * Return the exception which is the live bean
- */
- public Object getBean() {
- return getCause();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IProxy#isBeanProxy()
- */
- public final boolean isBeanProxy() {
- return true;
- }
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IProxy#isExpressionProxy()
- */
- public final boolean isExpressionProxy() {
- return false;
- }
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEVMServer.java b/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEVMServer.java
deleted file mode 100644
index 7ded239c5..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IDEVMServer.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.ide;
-/*
-
-
- */
-
-import java.io.OutputStream;
-
-import org.eclipse.jem.internal.proxy.common.*;
-
-public class IDEVMServer implements IVMCallbackServer {
-
- IDECallbackRegistry fCallbackRegistry;
- IDEStandardBeanProxyFactory fBeanProxyFactory;
-
-IDEVMServer(IDECallbackRegistry aCallbackRegistry){
- fCallbackRegistry = aCallbackRegistry;
- fBeanProxyFactory = (IDEStandardBeanProxyFactory)fCallbackRegistry.fProxyFactoryRegistry.getBeanProxyFactory();
-
-}
-public Object doCallback(ICallbackRunnable aRunnable){
- try {
- return aRunnable.run(new ICallbackHandler(){
- public Object callbackWithParms(int callbackID, int msgID, Object[] parms){
- // We are running in the same IDE so just call the registry directly
- // although we must convert the parms to bean proxies
- Object[] proxyParms = null;
- // If we have any parms then convert them to bean proxies
- if ( parms != null ) {
- proxyParms = new Object[parms.length];
- for ( int i=0;i<parms.length;i++){
- Object p = parms[i];
- proxyParms[i] = createNextParm(p);
- }
- }
- return fCallbackRegistry.vmCallback(callbackID,msgID,proxyParms);
- }
-
- private Object createNextParm(Object p) {
- if (!(p instanceof ICallbackHandler.TransmitableArray)) {
- return fBeanProxyFactory.createIDEBeanProxyWith(p);
- } else {
- Object[] array = ((ICallbackHandler.TransmitableArray) p).getArray();
- Object[] parm = new Object[array.length];
- for (int i = 0; i < array.length; i++) {
- parm[i] = createNextParm(array[i]);
- }
- return parm;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.common.ICallbackHandler#callbackAsConstants(int, int, java.lang.Object)
- */
- public Object callbackAsConstants(int callbackID, int msgID, Object parm) throws CommandException {
- return fCallbackRegistry.vmCallback(callbackID,msgID,parm);
- }
- });
-
- } catch ( CommandException exc ) {
- return null;
- }
-}
-
-public OutputStream requestStream(int callbackID, int msgID) throws CommandException {
- return fCallbackRegistry.requestStream(callbackID,msgID);
-}
-public IVMServer getIVMServer() {
- return fCallbackRegistry.fProxyFactoryRegistry;
-}
-
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IIDEBeanProxy.java b/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IIDEBeanProxy.java
deleted file mode 100644
index a0fc42db3..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/IIDEBeanProxy.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.ide;
-/*
-
-
- */
-
-import org.eclipse.jem.internal.proxy.core.IBeanProxy;
-
-
-/**
- * Interface that allows the IDE VM to get the actual bean.
- */
-public interface IIDEBeanProxy extends IBeanProxy {
-/**
- * Get the actual live bean.
- * USE with extreme care.
- */
-public Object getBean();
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/awt/IDEDimensionBeanProxy.java b/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/awt/IDEDimensionBeanProxy.java
deleted file mode 100644
index d42440dd5..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/awt/IDEDimensionBeanProxy.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.ide.awt;
-/*
-
-
- */
-
-import java.awt.Dimension;
-
-import org.eclipse.jem.internal.proxy.core.IBeanTypeProxy;
-import org.eclipse.jem.internal.proxy.core.IDimensionBeanProxy;
-import org.eclipse.jem.internal.proxy.ide.IDEObjectBeanProxy;
-import org.eclipse.jem.internal.proxy.ide.IDEProxyFactoryRegistry;
-
-public class IDEDimensionBeanProxy extends IDEObjectBeanProxy implements IDimensionBeanProxy {
-
- protected Dimension fDimension;
-
-IDEDimensionBeanProxy(IDEProxyFactoryRegistry aRegistry,Object aDimension, IBeanTypeProxy aBeanTypeProxy){
- super(aRegistry,aDimension,aBeanTypeProxy);
- fDimension = (Dimension)aDimension;
-}
-public int getWidth(){
- return fDimension.width;
-}
-public void setWidth(int aWidth){
- fDimension.width = aWidth;
-}
-public int getHeight(){
- return fDimension.height;
-}
-public void setHeight(int aHeight){
- fDimension.height = aHeight;
-}
-public void setSize(IDimensionBeanProxy aBeanProxy){
- fDimension.setSize(new Dimension(aBeanProxy.getWidth(),aBeanProxy.getHeight()));
-}
-public void setSize(int width, int height){
- fDimension.width = width;
- fDimension.height = height;
-}
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/awt/IDEDimensionBeanTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/awt/IDEDimensionBeanTypeProxy.java
deleted file mode 100644
index 30ca7e308..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/awt/IDEDimensionBeanTypeProxy.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.ide.awt;
-/*
-
-
- */
-
-import java.awt.Dimension;
-
-import org.eclipse.jem.internal.proxy.ide.*;
-
-public class IDEDimensionBeanTypeProxy extends IDEBeanTypeProxy {
-
-IDEDimensionBeanTypeProxy(IDEProxyFactoryRegistry aRegistry){
- this(aRegistry,Dimension.class);
-}
-
-private IDEDimensionBeanTypeProxy(IDEProxyFactoryRegistry aRegistry, Class type){
- super(aRegistry, type);
-}
-
-protected IIDEBeanProxy newBeanProxy(Object anObject){
-
- return new IDEDimensionBeanProxy(fProxyFactoryRegistry, anObject, this);
-
-}
-IDEDimensionBeanProxy createDimensionBeanProxy(int width, int height){
- return new IDEDimensionBeanProxy(fProxyFactoryRegistry,new Dimension(width,height),this);
-}
- /*
- * @see IDEBeanTypeProxy#newBeanTypeForClass(Class)
- */
- public IDEBeanTypeProxy newBeanTypeForClass(Class type) {
- return new IDEDimensionBeanTypeProxy(fProxyFactoryRegistry, type);
- }
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/awt/IDEPointBeanProxy.java b/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/awt/IDEPointBeanProxy.java
deleted file mode 100644
index 8d7ae78e9..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/awt/IDEPointBeanProxy.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.ide.awt;
-/*
-
-
- */
-
-import java.awt.Point;
-
-import org.eclipse.jem.internal.proxy.core.IBeanTypeProxy;
-import org.eclipse.jem.internal.proxy.core.IPointBeanProxy;
-import org.eclipse.jem.internal.proxy.ide.IDEObjectBeanProxy;
-import org.eclipse.jem.internal.proxy.ide.IDEProxyFactoryRegistry;
-
-public class IDEPointBeanProxy extends IDEObjectBeanProxy implements IPointBeanProxy {
-
- protected Point fPoint;
-
-IDEPointBeanProxy(IDEProxyFactoryRegistry aRegistry,Object aPoint, IBeanTypeProxy aBeanTypeProxy){
- super(aRegistry,aPoint,aBeanTypeProxy);
- fPoint = (Point)aPoint;
-}
-public int getX(){
- return fPoint.x;
-}
-public void setX(int anX){
- fPoint.x = anX;
-}
-public int getY(){
- return fPoint.y;
-}
-public void setY(int aY){
- fPoint.y = aY;
-}
-public void setLocation(IPointBeanProxy aBeanProxy){
- fPoint.setLocation(new Point(aBeanProxy.getX(),aBeanProxy.getY()));
-}
-public void setLocation(int anX, int aY){
- fPoint.x = anX;
- fPoint.y = aY;
-}
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/awt/IDEPointBeanTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/awt/IDEPointBeanTypeProxy.java
deleted file mode 100644
index 0d4fb9178..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/awt/IDEPointBeanTypeProxy.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.ide.awt;
-/*
-
-
- */
-
-import java.awt.Point;
-
-import org.eclipse.jem.internal.proxy.ide.*;
-
-public class IDEPointBeanTypeProxy extends IDEBeanTypeProxy {
-
-IDEPointBeanTypeProxy(IDEProxyFactoryRegistry aRegistry){
- this(aRegistry,Point.class);
-}
-private IDEPointBeanTypeProxy(IDEProxyFactoryRegistry aRegistry, Class type){
- super(aRegistry,type);
-}
-protected IIDEBeanProxy newBeanProxy(Object anObject){
-
- return new IDEPointBeanProxy(fProxyFactoryRegistry, anObject, this);
-
-}
-IDEPointBeanProxy createPointBeanProxy(int x, int y){
- return new IDEPointBeanProxy(fProxyFactoryRegistry,new Point(x,y),this);
-}
- /*
- * @see IDEBeanTypeProxy#newBeanTypeForClass(Class)
- */
- public IDEBeanTypeProxy newBeanTypeForClass(Class type) {
- return new IDEPointBeanTypeProxy(fProxyFactoryRegistry, type);
- }
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/awt/IDERectangleBeanProxy.java b/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/awt/IDERectangleBeanProxy.java
deleted file mode 100644
index baa2f6f82..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/awt/IDERectangleBeanProxy.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.ide.awt;
-/*
-
-
- */
-
-import java.awt.Rectangle;
-
-import org.eclipse.jem.internal.proxy.core.*;
-import org.eclipse.jem.internal.proxy.ide.IDEObjectBeanProxy;
-import org.eclipse.jem.internal.proxy.ide.IDEProxyFactoryRegistry;
-
-public class IDERectangleBeanProxy extends IDEObjectBeanProxy implements IRectangleBeanProxy {
-
- protected Rectangle fRectangle;
-
-IDERectangleBeanProxy(IDEProxyFactoryRegistry aRegistry,Object aRectangle, IBeanTypeProxy aBeanTypeProxy){
- super(aRegistry,aRectangle,aBeanTypeProxy);
- fRectangle = (Rectangle)aRectangle;
-}
-public int getX(){
- return fRectangle.x;
-}
-public void setX(int anX){
- fRectangle.x = anX;
-}
-public int getY(){
- return fRectangle.y;
-}
-public void setY(int aY){
- fRectangle.y = aY;
-}
-public int getHeight(){
- return fRectangle.height;
-}
-public void setHeight(int aHeight){
- fRectangle.height = aHeight;
-}
-public void setWidth(int aWidth){
- fRectangle.width = aWidth;
-}
-public int getWidth(){
- return fRectangle.width;
-}
-public void setBounds(IRectangleBeanProxy aBeanProxy){
- fRectangle.setBounds(aBeanProxy.getX(),aBeanProxy.getY(),aBeanProxy.getWidth(),aBeanProxy.getHeight());
-}
-public void setBounds(int x, int y, int width, int height){
- fRectangle.setBounds(x,y,width,height);
-}
-public void setSize(IDimensionBeanProxy aBeanProxy){
- fRectangle.setSize(aBeanProxy.getWidth(),aBeanProxy.getWidth());
-}
-public void setLocation(IPointBeanProxy aBeanProxy){
- fRectangle.setLocation(aBeanProxy.getX(),aBeanProxy.getY());
-}
-public void setLocation(int x, int y){
- fRectangle.setLocation(x,y);
-}
-public void setSize(int width, int height){
- fRectangle.setSize(width,height);
-}
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/awt/IDERectangleBeanTypeProxy.java b/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/awt/IDERectangleBeanTypeProxy.java
deleted file mode 100644
index fd533177f..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/awt/IDERectangleBeanTypeProxy.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.ide.awt;
-/*
-
-
- */
-
-import java.awt.Rectangle;
-
-import org.eclipse.jem.internal.proxy.ide.*;
-
-public class IDERectangleBeanTypeProxy extends IDEBeanTypeProxy {
-
-IDERectangleBeanTypeProxy(IDEProxyFactoryRegistry aRegistry){
- this(aRegistry,Rectangle.class);
-}
-
-private IDERectangleBeanTypeProxy(IDEProxyFactoryRegistry aRegistry, Class type){
- super(aRegistry,type);
-}
-protected IIDEBeanProxy newBeanProxy(Object anObject){
-
- return new IDERectangleBeanProxy(fProxyFactoryRegistry, anObject, this);
-
-}
-IDERectangleBeanProxy createRectangleBeanProxy(int x, int y, int width, int height){
- return new IDERectangleBeanProxy(fProxyFactoryRegistry,new Rectangle(x,y,width,height),this);
-}
- /*
- * @see IDEBeanTypeProxy#newBeanTypeForClass(Class)
- */
- public IDEBeanTypeProxy newBeanTypeForClass(Class type) {
- return new IDERectangleBeanTypeProxy(fProxyFactoryRegistry, type);
- }
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/awt/IDERegisterAWT.java b/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/awt/IDERegisterAWT.java
deleted file mode 100644
index 657487cc0..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/awt/IDERegisterAWT.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.ide.awt;
-/*
-
-
- */
-
-
-import org.eclipse.jem.internal.proxy.ide.IDEProxyFactoryRegistry;
-/**
- * This class is used to register the AWT factories.
- */
-public final class IDERegisterAWT {
- public static void registerAWT(IDEProxyFactoryRegistry registry) {
- new IDEStandardAWTBeanTypeProxyFactory(registry);
- new IDEStandardAWTBeanProxyFactory(registry);
- }
-}
-
-
diff --git a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/awt/IDEStandardAWTBeanProxyFactory.java b/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/awt/IDEStandardAWTBeanProxyFactory.java
deleted file mode 100644
index 77c36f934..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/awt/IDEStandardAWTBeanProxyFactory.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.ide.awt;
-/*
-
-
- */
-
-
-import org.eclipse.jem.internal.proxy.awt.*;
-import org.eclipse.jem.internal.proxy.core.*;
-import org.eclipse.jem.internal.proxy.ide.IDEProxyFactoryRegistry;
-/**
- * Standard AWT Bean Proxy Factory.
- * Package protected because it should not referenced
- * outside of the package other than through the interface.
- */
-class IDEStandardAWTBeanProxyFactory implements IStandardAwtBeanProxyFactory {
-
- final IDEStandardAWTBeanTypeProxyFactory fAWTBeanTypeFactory;
-
-public IDEStandardAWTBeanProxyFactory(IDEProxyFactoryRegistry factory) {
- factory.registerBeanProxyFactory(IStandardAwtBeanProxyFactory.REGISTRY_KEY, this);
- fAWTBeanTypeFactory = (IDEStandardAWTBeanTypeProxyFactory)factory.getBeanTypeProxyFactoryExtension(IDEStandardAWTBeanTypeProxyFactory.BEAN_TYPE_FACTORY_KEY);
-}
-public IDimensionBeanProxy createDimensionBeanProxyWith(int width, int height){
- return fAWTBeanTypeFactory.dimensionType.createDimensionBeanProxy(width,height);
-}
-
-public IPointBeanProxy createPointBeanProxyWith(int x, int y){
- return fAWTBeanTypeFactory.pointType.createPointBeanProxy(x,y);
-}
-public IRectangleBeanProxy createBeanProxyWith(int x, int y, int width, int height){
- return fAWTBeanTypeFactory.rectangleType.createRectangleBeanProxy(x,y,width,height);
-}
-public void terminateFactory(boolean wait) {
-}
-}
-
diff --git a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/awt/IDEStandardAWTBeanTypeProxyFactory.java b/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/awt/IDEStandardAWTBeanTypeProxyFactory.java
deleted file mode 100644
index e98a622a2..000000000
--- a/plugins/org.eclipse.jem.proxy/proxyide/org/eclipse/jem/internal/proxy/ide/awt/IDEStandardAWTBeanTypeProxyFactory.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.ide.awt;
-
-import org.eclipse.jem.internal.proxy.core.*;
-import org.eclipse.jem.internal.proxy.ide.*;
-
-/**
- * BeanType factory standard AWT bean types. This is package protected because it shouldn't be referenced outside the package. It should only be
- * accessed through the interface.
- */
-class IDEStandardAWTBeanTypeProxyFactory implements IDEExtensionBeanTypeProxyFactory {
-
- static final String BEAN_TYPE_FACTORY_KEY = "java.awt"; //$NON-NLS-1$
-
- protected final IDEProxyFactoryRegistry fFactoryRegistry;
-
- protected final IDEDimensionBeanTypeProxy dimensionType;
-
- protected final IDEPointBeanTypeProxy pointType;
-
- protected final IDERectangleBeanTypeProxy rectangleType;
-
- IDEStandardAWTBeanTypeProxyFactory(IDEProxyFactoryRegistry aRegistry) {
- fFactoryRegistry = aRegistry;
- fFactoryRegistry.registerBeanTypeProxyFactory(BEAN_TYPE_FACTORY_KEY, this);
- dimensionType = new IDEDimensionBeanTypeProxy(fFactoryRegistry);
- pointType = new IDEPointBeanTypeProxy(fFactoryRegistry);
- rectangleType = new IDERectangleBeanTypeProxy(fFactoryRegistry);
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.ide.IDEExtensionBeanTypeProxyFactory#getExtensionBeanTypeProxy(java.lang.String)
- */
- public IDEBeanTypeProxy getExtensionBeanTypeProxy(String className) {
-
- if ("java.awt.Dimension".equals(className)) //$NON-NLS-1$
- return dimensionType;
- else if ("java.awt.Point".equals(className)) //$NON-NLS-1$
- return pointType;
- else if ("java.awt.Rectangle".equals(className)) //$NON-NLS-1$
- return rectangleType;
- else
- return null;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.ide.IDEExtensionBeanTypeProxyFactory#getExtensionBeanTypeProxy(java.lang.String, org.eclipse.jem.internal.proxy.core.IBeanTypeProxy)
- */
- public IDEBeanTypeProxy getExtensionBeanTypeProxy(String className, IBeanTypeProxy beanTypeProxy) {
-
- return getExtensionBeanTypeProxy(className);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.internal.proxy.ide.IDEExtensionBeanTypeProxyFactory#getExtensionBeanTypeProxy(java.lang.String,
- * org.eclipse.jem.internal.proxy.core.IExpression)
- */
- public IProxyBeanType getExtensionBeanTypeProxy(String typeName, IExpression expression) {
- return getExtensionBeanTypeProxy(typeName);
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.core.IBeanProxyFactory#terminateFactory(boolean)
- */
- public void terminateFactory(boolean wait) {
- }
-}
diff --git a/plugins/org.eclipse.jem.proxy/remoteCommon/org/eclipse/jem/internal/proxy/common/remote/CommandErrorException.java b/plugins/org.eclipse.jem.proxy/remoteCommon/org/eclipse/jem/internal/proxy/common/remote/CommandErrorException.java
deleted file mode 100644
index 49979b982..000000000
--- a/plugins/org.eclipse.jem.proxy/remoteCommon/org/eclipse/jem/internal/proxy/common/remote/CommandErrorException.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.common.remote;
-/*
-
-
- */
-
-import org.eclipse.jem.internal.proxy.common.CommandException;
-/**
- * An error return from a command. This is clean return in that
- * the connection is still valid and alive.
- * After it has been processed the data will be the value retrieved
- * out of the valueobject and made into a proxy.
- */
-public class CommandErrorException extends CommandException {
- /**
- * Comment for <code>serialVersionUID</code>
- *
- * @since 1.1.0
- */
- private static final long serialVersionUID = 1701752035606593305L;
- private final Object fErrorObject;
- private final int fErrorCode;
-
- public CommandErrorException(int errorCode, Commands.ValueObject errorData) {
- super(errorData.clone()); // Clone it because typically these get reused and cleared out. This way we have our own.
- fErrorObject = null;
- fErrorCode = errorCode;
- }
-
- public CommandErrorException(String msg, int errorCode, Commands.ValueObject errorData, Object errorObject) {
- super(msg, errorData.clone());
- fErrorObject = errorObject;
- fErrorCode = errorCode;
- }
-
- public Commands.ValueObject getValue() {
- return (Commands.ValueObject) getExceptionData();
- }
-
- public boolean isRecoverable() {
- return true; // Command errors are recoverable.
- }
-
- /**
- * Return the error code.
- */
- public int getErrorCode() {
- return fErrorCode;
- }
-
- /**
- * Return the error object after conversion to proxy format.
- */
- public Object getErrorObject() {
- return fErrorObject;
- }
-
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- public String toString() {
- return super.toString() + "-- Error code:"+getErrorCode() + (getValue() != null ? " Value data:\"" + getValue().getAsObject() + "\"" : " ") + (fErrorObject != null ? " Error object:\""+fErrorObject.toString()+"\"" : " "); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$
- }
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/remoteCommon/org/eclipse/jem/internal/proxy/common/remote/Commands.java b/plugins/org.eclipse.jem.proxy/remoteCommon/org/eclipse/jem/internal/proxy/common/remote/Commands.java
deleted file mode 100644
index d8469252c..000000000
--- a/plugins/org.eclipse.jem.proxy/remoteCommon/org/eclipse/jem/internal/proxy/common/remote/Commands.java
+++ /dev/null
@@ -1,1450 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.common.remote;
-/*
-
-
- */
-
-import java.io.*;
-
-import org.eclipse.jem.internal.proxy.common.CommandException;
-/**
- * The commands that can be passed back and forth between
- * client and server. And other constants.
- *
- * - Contains helper methods for reading/writing commands.
- */
-public class Commands {
- // The commands will be written in writeByte format .
- public final static byte
- GET_CLASS = 1, // Get the class object,
- VALUE = 2, // Returning a value
- QUIT_CONNECTION = 4, // Close this connection
- TERMINATE_SERVER = 5, // Terminate the entire server.
- ERROR = 6, // Returning an error
- RELEASE_OBJECT = 7, // An object is no longer needed on the client side, so
- // it can be removed from the server id table and released.
- GET_CLASS_RETURN = 8, // The return command from GET_CLASS
- // Obsolete, not used anymore GET_METHOD = 9, // Return the id for a method
- // Obsolete, not used anymore GET_CTOR = 10, // Return the id for a constructor
- NEW_INIT_STRING = 11, // Create a new bean using the init string
- GET_CLASS_FROM_ID = 12, // We have an ID, return the class info for this id.
- GET_CLASS_ID_RETURN = 13, // The return command from GET_CLASS_FROM_ID
- GET_OBJECT_DATA = 14, // We have an ID, but we don't have the info, return it. This is a
- // corrective command only. This would happen if for some strange
- // reason the proxy has been removed but has not been released. This
- // really shouldn't happen except as a possible race condition between
- // GC and returning id from the server.
- INVOKE = 15, // Invoke a method.
-
-
- // These commands are to the Master Server thread in the IDE.
- ALIVE = 16, // Are you alive?
- REMOTE_STARTED = 17, // Remote VM has started.
- ATTACH_CALLBACK = 18, // Attach to a callback thread on the IDE side. The remote vm will use its socket as the callback socket.
- // it will return boolean <code>true</code> if attach worked or <code>false</code> if it failed.
-
- // These are more regular commands. They were historically added after the master server thread commands, so
- // they are shown here after them and with numbers greater than them.
- EXPRESSION_TREE_COMMAND = 19, // An expression tree subcommand has come in.
- INVOKE_WITH_METHOD_PASSED = 20, // Invoke where the description of the method is passed in with the command.
- GET_ARRAY_CONTENTS = 21; // Get the first dimension contents as an array of ids and send them back.
-
-
- // Callback commands
- public final static byte
- CALLBACK = (byte) 255, // A callback has come in.
- CALLBACK_DONE = (byte) 254, // A callback done command, sent to the remote vm upon callback completion.
- CALLBACK_STREAM = (byte) 253, // A callback for a byte stream has come in.
- // This is a special callback. When this comes in a special
- // input stream will be created that will take over control of
- // the connection until the stream is terminated on the remote
- // side. At this time the connection will be returned.
- CALLBACK_STREAM_TERMINATE = (byte) 252; // A callback stream is asked to terminate early.
-
- // The error values from the command on the server.
- public final static int
- NO_ERROR = 0, // No error status.
- UNKNOWN_COMMAND_SENT = 1, // An unknown command was sent to the server. Value is void.
- GET_CLASS_NOT_FOUND = 2, // The class was not found in GetClass. Value is void.
- CANNOT_EVALUATE_STRING = 3, // Evaluator couldn't evaluate the init string. Too complicated. Value is a throwable of the wrappered Init string error.
- CLASS_CAST_EXCEPTION = 4, // The result is not assignable to the expected type. Value is void.
- GET_METHOD_NOT_FOUND = 5, // Method requested wasn't found. Value is void.
- THROWABLE_SENT = 6, // A Throwable is being sent back as the error, not as just data for the error. Value is the Throwable.
- CALLBACK_RUNTIME_EXCEPTION = 7, // A runtime exception occurred during a callback. The data is the message.
- CALLBACK_NOT_REGISTERED = 8,
- MAX_ERROR_CODE = CALLBACK_NOT_REGISTERED; // This is just the max code. Not actually sent. Used as a flag.
-
- // Predefined standard id's for standard classes/objects. Both sides will assume these id's have been assigned
- // to these classes/types/objects
- public final static int
- NOT_AN_ID = -1, // This value means it is not an id. It is never a valid id.
- VOID_TYPE = 0,
- BOOLEAN_TYPE = 1,
- BOOLEAN_CLASS = 2,
- INTEGER_TYPE = 3,
- INTEGER_CLASS = 4,
- BYTE_TYPE = 5,
- BYTE_CLASS = 6,
- CHARACTER_TYPE = 7,
- CHARACTER_CLASS = 8,
- DOUBLE_TYPE = 9,
- DOUBLE_CLASS = 10,
- FLOAT_TYPE = 11,
- FLOAT_CLASS = 12,
- SHORT_TYPE = 13,
- SHORT_CLASS = 14,
- LONG_TYPE = 15,
- LONG_CLASS = 16,
- STRING_CLASS = 17,
- BIG_DECIMAL_CLASS = 18,
- BIG_INTEGER_CLASS = 19,
- NUMBER_CLASS = 20,
- THROWABLE_CLASS = 21,
- CLASS_CLASS = 22,
- OBJECT_CLASS = 23,
- ACCESSIBLEOBJECT_CLASS = 24,
- METHOD_CLASS = 25,
- FIELD_CLASS = 26,
- CONSTRUCTOR_CLASS = 27,
- GET_METHOD_ID = 28, // Class.getMethod(...) predefined id.
- IVMSERVER_CLASS = 29, // IVMServer.class
- ICALLBACK_CLASS = 30, // ICallback.class
- REMOTESERVER_ID = 31, // id of RemoteVMServerThread instance.
- REMOTEVMSERVER_CLASS = 32, // RemoteVMServer.class
- INITIALIZECALLBACK_METHOD_ID = 33, // ICallback.initializeCallback method.
- THREAD_CLASS = 34,
- EXPRESSIONPROCESSERCONTROLLER_CLASS = 35,
- FIRST_FREE_ID = 36;
-
- // The type flags written in writeByte format
- public final static byte
- VOID = VOID_TYPE, // null - nothing follows
- BYTE = BYTE_TYPE, // byte - writeByte
- L_BYTE = BYTE_CLASS, // java.lang.Byte - writeByte
- CHAR = CHARACTER_TYPE, // char - writeChar
- L_CHAR = CHARACTER_CLASS, // java.lang.Character - writeChar
- DOUBLE = DOUBLE_TYPE, // double - writeDouble
- L_DOUBLE = DOUBLE_CLASS, // java.lang.Double - writeDouble
- FLOAT = FLOAT_TYPE, // float - writeFloat
- L_FLOAT = FLOAT_CLASS, // java.lang.Float - writeFloat
- INT = INTEGER_TYPE, // int - writeInt
- L_INT = INTEGER_CLASS, // java.lang.Integer - writeInt
- LONG = LONG_TYPE, // long - writeLong
- L_LONG = LONG_CLASS, // java.lang.Long - writeLong
- SHORT = SHORT_TYPE, // short - writeShort
- L_SHORT = SHORT_CLASS, // java.lang.Short - writeShort
- BOOL = BOOLEAN_TYPE, // boolean - writeBoolean
- L_BOOL = BOOLEAN_CLASS, // java.lang.Boolean - writeBoolean
- STRING = STRING_CLASS, // java.lang.String - writeUTF
- OBJECT = OBJECT_CLASS, // Object - special, see below (Object can be used to return an array (except if the array contains any object_ids, that has a special type)
- OBJECT_ID = 50, // Object identity key - writeInt
- NEW_OBJECT_ID = 51, // New Object identity (this is a new object that didn't exist before)
- THROW = 52, // An exception occured. The value is a throwable, it is of the same format as NEW_OBJECT_ID.
- ARRAY_IDS = 53, // An array of values, where there are at least one ID in the array. If there were no
- // ID's (i.e. all just values), then use OBJECT type intead and have it written as
- // writeObject.
- FLAG = 54; // The value is a flag int. If this is allowed on a read, the anInt field will contain the flag value.
-
-
-
- // Unless specified below, the commands are one byte long.
- // Also, unless specified below, the commands do not return a confirmation response.
- //
- // NOTE: VERY IMPORTANT, after every command, flush() should be used so that the
- // the data is immediately sent to the server.
- //
- // n means int (e.g. 1)
- // nb means byte (e.g. 1b)
- // 'x' means Unicode char (i.e. writeChar())
- // "xxx" means UTF8 string (i.e. writeUTF)
- // bool means a one byte boolean value
- //
- // The commas aren't actually written, they are used as separaters in the comments below
- //
- // GET_CLASS: 1b, "classname"
- // Will return on the output stream GET_CLASS_RETURN command:
- // 8b, n1, bool1, bool2, "superclassname"
- // The "n1" is the class id.
- // The bool1 is whether this class is an interface (true if it is).
- // The bool2 is whether this class is abstract (true if it is).
- // The "superclassname" is the class name of the super class (0 length if no superclass)
- // If the class is not found, then it will return an error with a value for the error.
- //
- // GET_CLASS_FROM_ID: 12b, n
- // Where "n" is the class id.
- // Will return on the output stream GET_CLASS_ID_RETURN command:
- // 13b, "classname", bool1, bool2, "superclassname"
- // The bool1 is whether this class is an interface (true if it is).
- // The bool2 is whether this class is abstract (true if it is).
- //
- // VALUE: 2b, tb, value
- // Where tb is the type in byte, and value is the appropriate value shown in
- // table above.
- // OBJECT_ID: 50b, n
- // Where "n" is the object id.
- // NEW_OBJECT_ID: 51b, n1, n2
- // Where "n1" is class ObjectID of the object that the object_id ("n2") is made of.
- // OBJECT: 19b, n, writeObject
- // Where "n" is the classObjectID of the class of the type of the object.
- // NOTE: Object should be used only very rarely. Identity is lost, i.e.
- // a copy is made each time and it can't be referenced back on the remote
- // VM.
- // ARRAY_IDS: 52b, id, n, [tb, value, ...]
- // This is a very special array. It contains at least one ID. Therefor all of the
- // First level entries are value objects.
- // "id" is the id of the component type of the array(e.g. id for Object, or if multi-dimensional String[] (this will produce String[][]).
- // "n" is the number of entries in the array. Followed by the values, one of the
- // values could be an ARRAY_IDS too. The reading/writing of these are special because
- // there is a callback mechanism to process the individual entries. This is so that
- // temp arrays of ValueObjects won't need to be created to handle this, so it can
- // go directly from the array to/from the stream.
- //
- // RELEASE_OBJECT: 7b, n
- // Where the n is the object id to release. There is no confirmation to read back.
- //
- // ERROR: 6b, n, tb, ...
- // n is the error code for this error.
- // tb is a type flag, followed by the value. The value is dependent upon
- // the command that this is error is from. If a THROW, then the THROW is ALWAYS a new
- // ID, it can never be an existing id.
- //
- //
- // TO_BEAN_STRING: 9b, n
- // Where n is the object id to produce the bean string for.
- // It will return a VALUE command where the type is String.
- //
- // NEW_INSTANCE: 10b, n
- // Where n is the class object id of the class to create a new instance of using the default ctor.
- // It will return either a VALUE command containing the new value (of type OBJECT_ID/NEW_OBJECT_ID if not
- // one of the constant types with the true classID in it) or an ERROR command. (The ERROR could
- // be a THROW type). If the object created is not assignable to the type passed in, then
- // an ERROR is returned with CLASS_CAST_EXCEPTION flag.
- //
- // NEW_INIT_STRING: 11b, n, "initstring"
- // Where n is the class object id of the class this initstring is supposed to create for.
- // It will return either a VALUE command containing the new value (of type OBJECT_ID/NEW_OBJECT_ID if not
- // one of the constant types with the true classID in it) or an ERROR command. (The ERROR could
- // be a THROW type). The error could also be CANNOT_EVALUATE_STRING. This means that the string was too
- // complicated for the evaluator and needs to be compiled and tried again. (TBD)
- // If the object created is not assignable to the type passed in, then
- // an ERROR is returned with CLASS_CAST_EXCEPTION flag.
- //
- // GET_OBJECT_DATA: 14b, n
- // Where n is the id of the object being requested. It will return a NEW_OBJECT_ID value with the info.
- //
- // GET_METHOD: 9b, classId, "methodName", n1, [n2]...
- // Where classID is the id of the class the method should be found in.
- // Where n1 is the number of parm types following, and n2 is replicated that many times,
- // each entry is the id of class for the parm type. (0 is valid which means there are no parms).
- // The return will be a VALUE command containing the OBJECT_ID of the method.
- //
- // GET_CTOR: 10b, classId, n1, [n2]...
- // Where classID is the id of the class the method should be found in.
- // Where n1 is the number of parm types following, and n2 is replicated that many times,
- // each entry is the id of class for the parm type. (0 is valid which means there are no parms).
- // The return will be a VALUE command containing the OBJECT_ID of the method.
- //
- // GET_FIELD:
- //
- // GET_CTOR:
- //
- // INVOKE: 15b, n1, tb, value1, value2
- // Where "n1" is the id of the method to invoke.
- // tb, value1 is the value of who to invoke against (it is usually an OBJECT_ID for tb)
- // value2 is an ARRAY_IDS type or an OBJECT array of values if all constants.
- // What is returned is a VALUE command containing the return value, (the value will be null (VOID) if
- // there is no return type (i.e. the method was void). So null can be returned either if the value
- // was null or if the return type was void.
- //
- // EXPRESSION_TREE_COMMAND: 20b, n, b
- // Receiving an expression tree subcommand. Where "n" is a unique id number of the
- // expression being processed. Where "b" is byte code, defined in ExpressionCommands, that
- // determines the type of expression tree commands.
- // There can be more data following, but it is read by the
- // ExpressionProcesserController, not by the connection. See the controller for the subcommands.
- //
- // The id number is the id of the expression being processed. This allows more than one expression
- // to be processed at a time from this connection.
- //
- // @see ExpressionCommands
- // @see ExpressionProcessController
- //
- // INVOKE_WITH_METHOD_PASSED: 20b, classId, "methodName", value0, tb, value1, value2
- // Where classID is the id of the class the method should be found in.
- // value0 is an ARRAY_IDS type for the type of the parms, or null type for no parms.
- // tb, value1 is the value of who to invoke against (it is usually an OBJECT_ID for tb)
- // value2 is an ARRAY_IDS type or an OBJECT array of values if all constants.
- // What is returned is a VALUE command containing the return value, (the value will be null (VOID) if
- // there is no return type (i.e. the method was void). So null can be returned either if the value
- // was null or if the return type was void.
- //
- // GET_ARRAY_CONTENTS: 21b, arrayId
- // Where arrayID is the id of the array to get the contents of. What is returned is a value command
- // containing an array of ids of the first dimension contents.
- //
- // Callback commands:
- //
- // CALLBACK: 255b, n1, n2, value1
- // Where
- // "n1" is the id of callback type (these are registered with the callback server)
- // "n2" is the msgId for the callback (These are entirely callback dependent and are maintained by the callback developer)
- // value1 is an ARRAY_IDS type or an OBJECT array of values if all constants. These are
- // parms to send to the callback msg.
- // It will return a CALLBACK_DONE.
- //
- // CALLBACK_DONE: 254b, value command.
- // What comes back is a value command (i.e. Commands.VALUE followed by value). This allows
- // ERRORS to be sent back too.
- //
- // CALLBACK_STREAM: 253b, n1, n2
- // Where
- // "n1" is the id of callback type (these are registered with the callback server)
- // "n2" is the msgId for the callback (These are entirely callback dependent and are maintained by the callback developer)
- // It will create a CallbackInputStream and notify the registered callback that the
- // stream is available. It will send a callback_done when it has accepted the request
- // but before it notifies the registered callback with the stream. This lets the remote
- // vm know that it can start sending data.
-
-
- // To the MasterServer socket:
- // The MasterServer socket will expect input in DataInputStream format, and DataOutputStream for return.
- // The socket will be short-lived. It will be for one transaction only. Each request will return a new socket.
- //
- // ALIVE: 16b, n1
- // Where
- // "n1" is the id of the registry this is asking to test for aliveness
- // Will return bool, where false if registry is not alive, true if it is alive.
- // REMOTE_STARTED: 17b, n1, n2
- // Where
- // "n1" is the id of the registry this is telling that it is started
- // "n2" is the serversocket port number of the server socket in this remote vm.
- // Will return bool, where false if registry is not alive, true if it is alive. If false, then terminate the server because nothing to talk to.
- // GET_CALLBACK_PORT: 18b, n1
- // Where
- // "n1" is the id of the registry this is asking for the callback server port.
- // Will return int, where the value is the callback server port number. -1 if there is no callback server port.
-
- /**
- * This class is the return from a read value. It contains the
- * type of the value and the value itself. Since primitives can be
- * returned also, there is a slot for each one and the type should
- * be checked to see which one is set.
- *
- * Also, if the type is OBJECT, then the anObject has the object in it, AND
- * the classID field has the object_id of the class of the object so that the
- * appropriate beantypeproxy can be found to use that object. Also, only
- * IREMConstantBeanTypeProxies can be of type OBJECT. That is because those
- * are the only ones that know how to take the value object and interpret it.
- *
- * If the type is OBJECT_ID or NEW_OBJECT_ID, then the objectID field will be set with
- * the id.
- * If the type is NEW_OBJECT_ID, then the classID field will
- * have the class objectID of the class of the object for which object_id proxies.
- *
- * THROW is treated like NEW_OBJECT_ID in what fields are set since it is a new object.
- *
- * Note: so as not to create unnecessary objects, if the Object type of the primitive is being
- * sent, then the primitive field will be set instead, though the type
- * will still be the Object type (i.e. if type = L_BYTE, the aByte will
- * have the value in it).
- *
- * Note: Also flags can be send back. The type will be FLAG and the anInt field will be the
- * flag value. This is used to indicate special things that aren't values. Most useful in
- * arrays where one of the entries is not a value. This can only be used if readValue
- * is passed a flag indicating flags are valid, otherwise it will be treated as not valie.
- */
- public static class ValueObject implements Cloneable {
- public byte type; // Same as the types above
- public byte aByte;
- public char aChar;
- public double aDouble;
- public float aFloat;
- public int anInt;
- public short aShort;
- public long aLong;
- public boolean aBool;
- public int objectID; // The object id for either OBJECT_ID or NEW_OBJECT_ID.
- public int classID; // The class object id of the value in Object if the type is Object
- public Object anObject; // String also will be in here
-
- public ValueObject() {
- type = VOID;
- }
-
- public Object clone() {
- try {
- return super.clone();
- } catch (CloneNotSupportedException e) {
- return null;
- }
- }
-
- /**
- * Return whether the value stored here is a primitive.
- *
- * @return <code>true</code> if value is a primitive type.
- *
- * @since 1.0.0
- */
- public boolean isPrimitive() {
- return getPrimitiveType().isPrimitive();
- }
-
- /**
- * Get the primitive type of the value.
- * @return The primitive type, or if not primitive, it returns simply <code>Object.class</code>.
- *
- * @since 1.0.0
- */
- public Class getPrimitiveType() {
- switch (type) {
- case BYTE:
- return Byte.TYPE;
- case CHAR:
- return Character.TYPE;
- case DOUBLE:
- return Double.TYPE;
- case FLOAT:
- return Float.TYPE;
- case INT:
- return Integer.TYPE;
- case SHORT:
- return Short.TYPE;
- case LONG:
- return Long.TYPE;
- case BOOL:
- return Boolean.TYPE;
- default:
- return Object.class;
- }
-
- }
-
- /**
- * Get the type as one of the valid Commands.Types. VOID, BYTE, L_BYTE, etc.
- * @return
- *
- * @since 1.1.0
- */
- public int getType() {
- return type;
- }
-
- /**
- * Special getter to get the type as an Object, this is used by invoke for example.
- */
- public Object getAsObject() {
- switch (type) {
- case VOID:
- return null;
- case BYTE:
- case L_BYTE:
- return new Byte(aByte);
- case CHAR:
- case L_CHAR:
- return new Character(aChar);
- case DOUBLE:
- case L_DOUBLE:
- return new Double(aDouble);
- case FLOAT:
- case L_FLOAT:
- return new Float(aFloat);
- case INT:
- case L_INT:
- return new Integer(anInt);
- case SHORT:
- case L_SHORT:
- return new Short(aShort);
- case LONG:
- case L_LONG:
- return new Long(aLong);
- case BOOL:
- case L_BOOL:
- return aBool ? Boolean.TRUE : Boolean.FALSE;
- case STRING:
- return anObject;
- case OBJECT:
- return anObject;
-
- default:
- return null; // Can't handle others. Those need to be checked before calling.
- }
- }
-
- /**
- * Special setter to set the value depending upon the type.
- */
- public void setAsObject(Object value, int valueClassID) {
- switch (valueClassID) {
- case VOID:
- set();
- break;
- case BYTE_CLASS:
- set((Byte) value);
- break;
- case CHARACTER_CLASS:
- set((Character) value);
- break;
- case DOUBLE_CLASS:
- set((Double) value);
- break;
- case FLOAT_CLASS:
- set((Float) value);
- break;
- case INTEGER_CLASS:
- set((Integer) value);
- break;
- case SHORT_CLASS:
- set((Short) value);
- break;
- case LONG_CLASS:
- set((Long) value);
- break;
- case BOOLEAN_CLASS:
- set((Boolean) value);
- break;
- case STRING_CLASS:
- set((String) value);
- break;
- default:
- set(value, valueClassID);
- break;
- }
- }
-
- public void set() {
- type = VOID;
- anObject = null;
- }
-
- public void setFlag(int flag) {
- type = FLAG;
- anInt = flag;
- }
-
- public void set(byte value) {
- type = BYTE;
- aByte = value;
- anObject = null;
- }
- public void set(Byte value) {
- if (value != null) {
- type = L_BYTE;
- aByte = value.byteValue();
- anObject = null;
- } else
- set();
- }
- public void set(char value) {
- type = CHAR;
- aChar = value;
- anObject = null;
- }
- public void set(Character value) {
- if (value != null) {
- type = L_CHAR;
- aChar = value.charValue();
- anObject = null;
- } else
- set();
- }
- public void set(double value) {
- type = DOUBLE;
- aDouble = value;
- anObject = null;
- }
- public void set(Double value) {
- if (value != null) {
- type = L_DOUBLE;
- aDouble = value.doubleValue();
- anObject = null;
- } else
- set();
- }
- public void set(float value) {
- type = FLOAT;
- aFloat = value;
- anObject = null;
- }
- public void set(Float value) {
- if (value != null) {
- type = L_FLOAT;
- aFloat = value.floatValue();
- anObject = null;
- } else
- set();
- }
- public void set(int value) {
- type = INT;
- anInt = value;
- anObject = null;
- }
- public void set(Integer value) {
- if (value != null) {
- type = L_INT;
- anInt = value.intValue();
- anObject = null;
- } else
- set();
- }
- public void set(short value) {
- type = SHORT;
- aShort = value;
- anObject = null;
- }
- public void set(Short value) {
- if (value != null) {
- type = L_SHORT;
- aShort = value.shortValue();
- anObject = null;
- } else
- set();
- }
- public void set(long value) {
- type = LONG;
- aLong = value;
- anObject = null;
- }
- public void set(Long value) {
- type = L_LONG;
- aLong = value.longValue();
- anObject = null;
- }
- public void set(boolean value) {
- type = BOOL;
- aBool = value;
- anObject = null;
- }
- public void set(Boolean value) {
- if (value != null) {
- type = L_BOOL;
- aBool = value.booleanValue();
- anObject = null;
- } else
- set();
- }
- public void set(String value) {
- if (value != null) {
- type = STRING;
- anObject = value;
- } else
- set();
- }
- public void set(Object value, int classObjectID) {
- if (value != null) {
- type = OBJECT;
- classID = classObjectID;
- anObject = value;
- } else
- set();
- }
- public void setObjectID(int value) {
- type = OBJECT_ID;
- objectID = value;
- anObject = null;
- }
-
- // Use this if the object is an array containing IDs. The retriever
- // will be used to get the next value to write to the stream.
- public void setArrayIDS(ValueRetrieve retriever, int arraySize, int componentType) {
- type = ARRAY_IDS;
- classID = componentType;
- anInt = arraySize;
- anObject = retriever;
- }
-
-
- // Use this if this is a new object so that we can get the correct class type.
- public void setObjectID(int value, int classObjectID) {
- type = NEW_OBJECT_ID;
- objectID = value;
- classID = classObjectID;
- anObject = null;
- }
-
- // Use this to indicate an exception occured.
- public void setException(int throwID, int throwClassID) {
- type = THROW;
- objectID = throwID;
- classID = throwClassID;
- anObject = null;
- }
- }
-
- /************************
- * Helpful commands.
- * - If a command throws any exception except CommandErrorException, or
- * UnexpectedCommandException with recoverable true, then the connection is in a bad state
- * and needs to be closed.
- ************************/
-
- /**
- * Use this to read a value (inputstream should be pointing to the type byte as the next byte to read).
- * The primitive fields of "value" will not be changed if they are not the
- * type of the value being read. However, anObject will be set to null.
- */
-
- /**
- * Error flags for UnexpectedCommandExceptions that can be thrown.
- */
- public static final Object UNKNOWN_READ_TYPE = "UNKNOWN_READ_TYPE"; // The read type byte was not a valid type //$NON-NLS-1$
- public static final Object UNKNOWN_WRITE_TYPE = "UNKNOWN_WRITE_TYPE"; // The write type byte was not a valid type //$NON-NLS-1$
- public static final Object TYPE_INVALID_FOR_COMMAND = "TYPE_INVALID_FOR_COMMAND"; // The data type read is not valid for this command //$NON-NLS-1$
- public static final Object UNKNOWN_COMMAND = "UNKNOWN_COMMAND"; // The command flag is unknown //$NON-NLS-1$
- public static final Object SOME_UNEXPECTED_EXCEPTION = "SOME_UNEXPECTED_EXCEPTION"; // There was some kind of exception that wasn't expected. The data will be the exception. //$NON-NLS-1$
- public static final Object TOO_MANY_BYTES = "TOO_MANY_BYTES"; // Too many bytes were sent on a writeBytes. It was //$NON-NLS-1$
- // more than could be read into the buffer. The data will be the size sent.
-
- /**
- * Read a value from the stream into the value object. It will not allow values of type FLAG.
- *
- * @param is
- * @param value
- * @param allowFlag
- * @return the value object sent in. This allows <code>value = Commands.readValue(is, new Commands.ValueObject());</code>
- * @throws CommandException
- *
- *
- * @since 1.0.0
- */
- public static ValueObject readValue(DataInputStream is, ValueObject value) throws CommandException {
- readValue(is, value, false);
- return value;
- }
-
- /**
- * Read a value from the stream into the value object. It will allow values of type FLAG if allowFlag is true.
- * @param is
- * @param value
- * @param allowFlag <code>true</code> if values of type flag are allow.
- * @throws CommandException
- *
- * @since 1.1.0
- */
- public static void readValue(DataInputStream is, ValueObject value, boolean allowFlag) throws CommandException {
- try {
- value.anObject = null;
- value.type = is.readByte();
- switch (value.type) {
- case BYTE:
- case L_BYTE:
- value.aByte = is.readByte();
- break;
- case CHAR:
- case L_CHAR:
- value.aChar = is.readChar();
- break;
- case DOUBLE:
- case L_DOUBLE:
- value.aDouble = is.readDouble();
- break;
- case FLOAT:
- case L_FLOAT:
- value.aFloat = is.readFloat();
- break;
- case INT:
- case L_INT:
- value.anInt = is.readInt();
- break;
- case OBJECT_ID:
- value.objectID = is.readInt();
- break;
- case NEW_OBJECT_ID:
- value.classID = is.readInt();
- value.objectID = is.readInt();
- break;
- case THROW:
- value.classID = is.readInt();
- value.objectID = is.readInt();
- break;
- case SHORT:
- case L_SHORT:
- value.aShort = is.readShort();
- break;
- case LONG:
- case L_LONG:
- value.aLong = is.readLong();
- break;
- case BOOL:
- case L_BOOL:
- value.aBool = is.readBoolean();
- break;
- case STRING:
- value.anObject = readStringData(is);
- break;
- case OBJECT:
- value.classID = is.readInt(); // Read the class id
- ObjectInputStream oi = new ObjectInputStream(is);
- value.anObject = oi.readObject(); // Read the object itself
- oi = null; // Don't close it, that would close the stream itself.
- break;
- case ARRAY_IDS:
- // The header for an array of ids.
- value.classID = is.readInt(); // The component type of the array
- value.anInt = is.readInt(); // The size of the array.
- // At this point, it is the responsibility of the caller to use readArray to read in the array.
- break;
- case VOID:
- break;
- case FLAG:
- if (allowFlag) {
- value.anInt = is.readInt();
- break;
- }
- // Flags not allowed, so drop into default.
- default:
- throw new UnexpectedCommandException(UNKNOWN_READ_TYPE, false, new Byte(value.type));
- }
- } catch (CommandException e) {
- // rethrow this exception since we want these to go on out.
- throw e;
- } catch (Exception e) {
- // Wrapper this one.
- throw new UnexpectedExceptionCommandException(false, e);
- }
- }
-
- /**
- * Special interface used to read back arrays. It will be called when
- */
- public static interface ValueSender {
- /**
- * This is called for each entry from the array. It is assumed that the ValueSender has
- * the array that is being built.
- * @param value
- *
- * @since 1.1.0
- */
- public void sendValue(ValueObject value);
-
- /**
- * This is called when an ARRAY_IDS is found within the reading of the array (i.e. nested arrays)
- * It is asking for a new ValueSender to use while this nested array. The arrayValue contains
- * the valueobject for the array header (i.e. the class id of the array and the number of elements).
- * It is the responsibility of the ValueSender to store this array in the array that is being built.
- * @param arrayValue
- * @return
- *
- * @since 1.1.0
- */
- public ValueSender nestedArray(ValueObject arrayValue);
-
- /**
- * Called to initialize the sender with the given array header. This is not always called, each usage
- * knows whether it can be called or not. For example the implementation of nestedArray may not need to call initialize.
- * @param arrayHeader
- *
- * @since 1.1.0
- */
- public void initialize(ValueObject arrayHeader);
-
- }
-
- /*
- * NOTE: It is important that on the IDE side that this is called within a transaction.
- * If not, there could be some corruption if proxy cleanup occurs in the middle.
- */
- public static void readArray(DataInputStream is, int arraySize, ValueSender valueSender, ValueObject value, boolean allowFlag) throws CommandException {
- // Anything exception other than a CommandException, we will try to flush the input so that
- // it can continue with the next command and not close the connection.
- RuntimeException exception = null;
- for (int i=0; i<arraySize; i++) {
- readValue(is, value, allowFlag);
- if (exception == null)
- try {
- if (value.type != ARRAY_IDS)
- valueSender.sendValue(value);
- else {
- // We have a nested array.
- ValueSender nestedSender = null;
- try {
- nestedSender = valueSender.nestedArray(value);
- } catch (RuntimeException e) {
- // We still need to read in the array to flush. Create
- // a dummy sender that accepts everything sent to it.
- exception = e;
- nestedSender = new ValueSender() {
- public void sendValue(ValueObject value) {
- }
- public ValueSender nestedArray(ValueObject arrayValue) {
- return this;
- }
- public void initialize(ValueObject arrayHeader) {
- }
- };
- }
- readArray(is, value.anInt, nestedSender, value, allowFlag);
- if (exception != null)
- throw exception; // An exception ocurred in new sender request.
- }
- } catch (RuntimeException e) {
- // We want to flush the queue, so save the exception for later.
- exception = e;
- }
- }
- if (exception != null)
- throw exception;
- }
-
-
- /**
- * Special interface to handle writing the ARRAY_IDS type.
- * An instance of this object will be in the valueObject sent to writeValue when the type of the value
- * is ARRAY_IDS. Then write value will know to call this interface to write out the values.
- *
- * @since 1.1.0
- */
- public static interface ValueRetrieve {
- /**
- * Returns the next value object to send. It will be called the number of times that the size of
- * the array was set to be send.
- * @return The value object to send.
- * @throws EOFException
- *
- * @since 1.1.0
- */
- public ValueObject nextValue() throws EOFException;
- }
-
- public static void writeValue(DataOutputStream os, ValueObject value, boolean asValueCommand) throws CommandException {
- writeValue(os, value, asValueCommand, asValueCommand ? true : false);
- }
-
- public static void writeValue(DataOutputStream os, ValueObject value, boolean asValueCommand, boolean flush) throws CommandException {
- try {
- if (asValueCommand)
- os.writeByte(VALUE);
- switch (value.type) {
- case BYTE:
- case L_BYTE:
- os.writeByte(value.type);
- os.writeByte(value.aByte);
- break;
- case CHAR:
- case L_CHAR:
- os.writeByte(value.type);
- os.writeChar(value.aChar);
- break;
- case DOUBLE:
- case L_DOUBLE:
- os.writeByte(value.type);
- os.writeDouble(value.aDouble);
- break;
- case FLOAT:
- case L_FLOAT:
- os.writeByte(value.type);
- os.writeFloat(value.aFloat);
- break;
- case INT:
- case L_INT:
- os.writeByte(value.type);
- os.writeInt(value.anInt);
- break;
- case OBJECT_ID:
- os.writeByte(value.type);
- os.writeInt(value.objectID);
- break;
- case NEW_OBJECT_ID:
- os.writeByte(value.type);
- os.writeInt(value.classID);
- os.writeInt(value.objectID);
- break;
- case THROW:
- os.writeByte(value.type);
- os.writeInt(value.classID);
- os.writeInt(value.objectID);
- break;
- case SHORT:
- case L_SHORT:
- os.writeByte(value.type);
- os.writeShort(value.aShort);
- break;
- case LONG:
- case L_LONG:
- os.writeByte(value.type);
- os.writeLong(value.aLong);
- break;
- case BOOL:
- case L_BOOL:
- os.writeByte(value.type);
- os.writeBoolean(value.aBool);
- break;
- case STRING:
- os.writeByte(value.type);
- sendStringData(os, (String) value.anObject);
- break;
- case OBJECT:
- os.writeByte(value.type);
- os.writeInt(value.classID); // Write the class ID.
- ObjectOutputStream oos = new ObjectOutputStream(os);
- oos.writeObject(value.anObject);
- oos.flush();
- oos = null; // Don't close it, that would close the stream itself.
- break;
- case ARRAY_IDS:
- // We are writing out an array with ID's in it. The fields of the vale object will be:
- // classID: The class id of the component type of the array.
- // anObject: Contains the ValueRetriever to get the next value.
- os.writeByte(ARRAY_IDS);
- os.writeInt(value.classID);
- os.writeInt(value.anInt); // The size of the array.
- // Now comes the kludgy part, writing the values.
- ValueRetrieve retriever = (ValueRetrieve) value.anObject;
- int len = value.anInt;
- while (len-- > 0)
- writeValue(os, retriever.nextValue(), false);
- break;
- case VOID:
- os.writeByte(value.type);
- break;
- case FLAG:
- os.writeByte(FLAG);
- os.writeInt(value.anInt);
- break;
- default:
- os.writeByte(VOID);
- throw new UnexpectedCommandException(UNKNOWN_WRITE_TYPE, true, value);
- }
- if (flush)
- os.flush();
- } catch (CommandException e) {
- // rethrow this exception since we want these to go on out.
- throw e;
- } catch (Exception e) {
- // Wrapper this one.
- throw new UnexpectedExceptionCommandException(false, e);
- }
- }
-
- /**
- * For reading a large number of bytes. This is a value type, not a command. The command
- * needs to be handled separately. It returns the number of bytes read. -1 if there
- * is no more data to send and the stream should closed. If read something but not all,
- * then just what it could read will be returned. The next read will return -1 for EOF.
- *
- * It will read from the format:
- * int - number of bytes to read (retrieved from the stream).
- * bytes - the actual bytes.
- *
- * Note: A command exception will be thrown if the number of bytes to read
- * is larger than the size of the byte array.
- */
- public static int readBytes(DataInputStream is, byte[] bytes) throws CommandException {
- try {
- int bytesToRead = -1;
- try {
- bytesToRead = is.readInt();
- } catch (EOFException e) {
- }
- if (bytesToRead == -1)
- return -1;
- if (bytesToRead > bytes.length)
- throw new UnexpectedCommandException(TOO_MANY_BYTES, false, new Integer(bytesToRead));
- int start = 0;
- int toRead = bytesToRead;
- while (toRead > 0) {
- int bytesRead = is.read(bytes, start, toRead);
- if (bytesRead == -1)
- return bytesToRead != toRead ? bytesToRead-toRead : -1; // Actual number read, or if none read, then EOF
- start+=bytesRead;
- toRead-=bytesRead;
- }
- return bytesToRead;
- } catch (CommandException e) {
- // rethrow this exception since we want these to go on out.
- throw e;
- } catch (Exception e) {
- // Wrapper this one.
- throw new UnexpectedExceptionCommandException(false, e);
- }
- }
-
- /**
- * For writing a large number of bytes. This is a value type, not a command. The command
- * needs to be handled separately.
- *
- * It will write it in the format:
- * int - number of bytes
- * bytes - the actual bytes.
- *
- */
- public static void writeBytes(DataOutputStream os, byte[] bytes, int bytesToWrite) throws CommandException {
- try {
- os.writeInt(bytesToWrite);
- os.write(bytes, 0, bytesToWrite);
- } catch (Exception e) {
- // Wrapper this one.
- throw new UnexpectedExceptionCommandException(false, e);
- }
- }
-
- /************************
- * Send command helpers
- ************************/
-
- public static void sendQuitCommand(DataOutputStream os) throws IOException {
- os.writeByte(QUIT_CONNECTION);
- os.flush();
-
- }
-
- public static void sendTerminateCommand(DataOutputStream os) throws IOException {
- os.writeByte(TERMINATE_SERVER);
- os.flush();
- }
-
-
- public static void releaseObjectCommand(DataOutputStream os, int id) throws IOException {
- os.writeByte(Commands.RELEASE_OBJECT);
- os.writeInt(id);
- os.flush();
- }
-
- /**
- * Send a callback request. The value is to be send separately.
- */
- public static void sendCallbackCommand(DataOutputStream os, int callbackID, int msgID) throws CommandException {
- try {
- os.writeByte(CALLBACK);
- os.writeInt(callbackID);
- os.writeInt(msgID);
- } catch (Exception e) {
- // Wrapper this one.
- throw new UnexpectedExceptionCommandException(false, e);
- }
- }
-
- public static void sendCallbackDoneCommand(DataOutputStream os, ValueObject value, int errorCode) throws CommandException {
- try {
- os.writeByte(CALLBACK_DONE);
- if (errorCode == NO_ERROR) {
- writeValue(os, value, true);
- os.flush();
- } else
- sendErrorCommand(os, errorCode, value);
- } catch (CommandException e) {
- // rethrow this exception since we want these to go on out.
- throw e;
- } catch (Exception e) {
- // Wrapper this one.
- throw new UnexpectedExceptionCommandException(false, e);
- }
- }
-
- /**
- * Send a start callback stream request. The data will be written separately.
- * There will not be a callback done command. It will return as soon as the command
- * is sent.
- */
- public static void sendCallbackStreamCommand(DataOutputStream os, int callbackID, int msgID) throws CommandException {
- try {
- os.writeByte(CALLBACK_STREAM);
- os.writeInt(callbackID);
- os.writeInt(msgID);
- } catch (Exception e) {
- // Wrapper this one.
- throw new UnexpectedExceptionCommandException(false, e);
- }
- }
-
- protected static final byte STRING_NOT_CHUNKED = 0;
- protected static final byte STRING_CHUNKED = 1;
- protected static final byte MORE_CHUNKS = 2;
- protected static final byte LAST_CHUNK = 3;
- protected static final int CHUNK_SIZE = 65000/3;
-
- /**
- * Send string data. This is for general string data. It makes sure that if the string is too big (there is a UTF-8 limit)
- * that it will send it in chunks. Use the corresponding <code>readStringData</code> to read such data in.
- * @param os
- * @param string
- * @throws IOException
- *
- * @since 1.0.0
- */
- public static void sendStringData(DataOutputStream os, String string) throws IOException {
- // UTF-8 can take up to three bytes for each char. To be on safe side we will
- // not send a string larger than 65K/3 as one chunk.
- if (string.length() <= CHUNK_SIZE) {
- // Less than the limit, send byte to indicate not chunked.
- os.writeByte(STRING_NOT_CHUNKED);
- os.writeUTF(string);
- } else {
- // Over limit, need to chunk it.
- // send byte to indicate chunked, then send true length so that other side knows how big to create.
- os.writeByte(STRING_CHUNKED);
- os.writeInt(string.length());
- // Now send first chunk
- for(int i=0; i<string.length(); i+=CHUNK_SIZE) {
- int endIndex = i+CHUNK_SIZE;
- if (i == 0) {
- // The first chunk is just written as is. We know endIndex will be ok because we wouldn't get here unless LARGER than chunksize.
- os.writeUTF(string.substring(i, endIndex));
- } else {
- // Following chunks have either byte MORE_CHUNKS or LAST_CHUNK
- if (endIndex >= string.length()) {
- // This is last chunk.
- os.writeByte(LAST_CHUNK);
- os.writeUTF(string.substring(i));
- } else {
- // This is an intermediate chunk.
- os.writeByte(MORE_CHUNKS);
- os.writeUTF(string.substring(i, endIndex));
- }
- }
- }
- }
- }
-
- /**
- * Read a string that was sent using the sendStringData command.
- * @param in
- * @return
- * @throws IOException
- *
- * @since 1.0.0
- */
- public static String readStringData(DataInputStream is) throws IOException {
- byte chunked = is.readByte();
- if (chunked == STRING_NOT_CHUNKED)
- return is.readUTF(); // Not chunk, just read it.
- else {
- // It is chunked.
- int totalLength = is.readInt(); // Get the total length.
- StringBuffer sbr = new StringBuffer(totalLength);
- while(true) {
- sbr.append(is.readUTF());
- if (chunked != LAST_CHUNK)
- chunked = is.readByte();
- else
- break;
- }
- return sbr.toString();
- }
- }
-
- /**
- * Read back command, expecting either a VALUE or an ERROR. You can request that
- * it be of a specific type (if any type can be accepted then enter -1 for the type).
- */
- public static final byte NO_TYPE_CHECK = -1;
- public static void readBackValue(DataInputStream is, ValueObject value, byte expectedType) throws CommandException {
- try {
- byte v = is.readByte();
- switch (v) {
- case VALUE:
- readValue(is, value);
- if (expectedType != NO_TYPE_CHECK &&
- !(expectedType == value.type || (expectedType == Commands.OBJECT_ID && value.type == NEW_OBJECT_ID)))
- throw new UnexpectedCommandException(TYPE_INVALID_FOR_COMMAND, true, value);
- break;
- case ERROR:
- int code = is.readInt();
- readValue(is, value);
- throw new CommandErrorException(code, value);
- default:
- throw new UnexpectedCommandException(UNKNOWN_COMMAND, false, new Byte(v));
- }
- } catch (CommandException e) {
- // rethrow this exception since we want these to go on out.
- throw e;
- } catch (Exception e) {
- // Wrapper this one.
- throw new UnexpectedExceptionCommandException(false, e);
- }
- }
-
-
- /**
- * GetClass command returns a GetClassReturn object.
- */
- public static class GetClassReturn {
- public int classID;
- public boolean isInterface;
- public boolean isAbstract;
- public String superClassname;
- }
-
- public static GetClassReturn sendGetClassCommand(DataOutputStream os, DataInputStream is, String className) throws CommandException {
- try {
- os.writeByte(GET_CLASS);
- os.writeUTF(className);
- os.flush();
-
- GetClassReturn ret = new GetClassReturn();
- byte v = is.readByte();
- switch (v) {
- case GET_CLASS_RETURN:
- ret.classID = is.readInt(); // Get the new class id.
- ret.isInterface = is.readBoolean(); // Get the isInterface flag
- ret.isAbstract = is.readBoolean(); // Get the isAbstract flag.
- ret.superClassname = is.readUTF(); // Get the super class name.
- return ret;
- case ERROR:
- int code = is.readInt();
- ValueObject value = new ValueObject();
- readValue(is, value);
- throw new CommandErrorException(code, value);
- default:
- throw new UnexpectedCommandException(UNKNOWN_COMMAND, false, new Byte(v));
- }
- } catch (CommandException e) {
- // rethrow this exception since we want these to go on out.
- throw e;
- } catch (Exception e) {
- // Wrapper this one.
- throw new UnexpectedExceptionCommandException(false, e);
- }
- }
-
- /**
- * GetClassFromID command returns a GetClassIDReturn object.
- */
- public static class GetClassIDReturn {
- public String className;
- public boolean isInterface;
- public boolean isAbstract;
- public String superClassname;
- }
-
- public static GetClassIDReturn sendGetClassFromIDCommand(DataOutputStream os, DataInputStream is, int classID) throws CommandException {
- try {
- os.writeByte(GET_CLASS_FROM_ID);
- os.writeInt(classID);
- os.flush();
-
- GetClassIDReturn ret = new GetClassIDReturn();
- byte v = is.readByte();
- switch (v) {
- case GET_CLASS_ID_RETURN:
- ret.className = is.readUTF(); // Get the new class name.
- ret.isInterface = is.readBoolean(); // Get the isInterface flag
- ret.isAbstract = is.readBoolean(); // Get the isAbstract flag.
- ret.superClassname = is.readUTF(); // Get the super class name.
- return ret;
- case ERROR:
- int code = is.readInt();
- ValueObject value = new ValueObject();
- readValue(is, value);
- throw new CommandErrorException(code, value);
- default:
- throw new UnexpectedCommandException(UNKNOWN_COMMAND, false, new Byte(v));
- }
- } catch (CommandException e) {
- // rethrow this exception since we want these to go on out.
- throw e;
- } catch (Exception e) {
- // Wrapper this one.
- throw new UnexpectedExceptionCommandException(false, e);
- }
- }
-
- public static void sendGetObjectData(DataOutputStream os, DataInputStream is, int objectID, ValueObject valueReturn) throws CommandException {
- try {
- os.writeByte(GET_OBJECT_DATA);
- os.writeInt(objectID);
- os.flush();
- readBackValue(is, valueReturn, NEW_OBJECT_ID);
- } catch (CommandException e) {
- // rethrow this exception since we want these to go on out.
- throw e;
- } catch (Exception e) {
- // Wrapper this one.
- throw new UnexpectedExceptionCommandException(false, e);
- }
- }
-
- public static void sendErrorCommand(DataOutputStream os, int code, ValueObject errorValue) throws CommandException {
- try {
- os.writeByte(ERROR);
- os.writeInt(code);
- writeValue(os, errorValue, false);
- os.flush();
- } catch (Exception e) {
- // Wrapper this one.
- throw new UnexpectedExceptionCommandException(false, e);
- }
- }
-
- public static void sendNewInstance(DataOutputStream os, DataInputStream is, int classId, String initializationString, ValueObject newValueReturn) throws CommandException {
- try {
- os.writeByte(NEW_INIT_STRING);
- os.writeInt(classId);
- os.writeUTF(initializationString);
- os.flush();
- readBackValue(is, newValueReturn, NO_TYPE_CHECK);
- } catch (CommandException e) {
- // rethrow this exception since we want these to go on out.
- throw e;
- } catch (Exception e) {
- // Wrapper this one.
- throw new UnexpectedExceptionCommandException(false, e);
- }
- }
-
-
- public static void sendInvokeMethodCommand(DataOutputStream os, DataInputStream is, int methodID, ValueObject invokeOn, ValueObject parms, ValueObject valueReturn) throws CommandException {
- try {
- os.writeByte(INVOKE);
- os.writeInt(methodID);
- writeValue(os, invokeOn, false);
- writeValue(os, parms, false);
- os.flush();
- readBackValue(is, valueReturn, NO_TYPE_CHECK);
- } catch (CommandException e) {
- // rethrow this exception since we want these to go on out.
- throw e;
- } catch (Exception e) {
- // Wrapper this one.
- throw new UnexpectedExceptionCommandException(false, e);
- }
- }
-
- public static void sendInvokeMethodCommand(DataOutputStream os, DataInputStream is, ValueObject classType, String methodName, ValueObject parmTypes, ValueObject invokeOn, ValueObject parms, ValueObject valueReturn) throws CommandException {
- try {
- os.writeByte(INVOKE_WITH_METHOD_PASSED);
- writeValue(os, classType, false);
- os.writeUTF(methodName);
- writeValue(os, parmTypes, false);
- writeValue(os, invokeOn, false);
- writeValue(os, parms, false);
- os.flush();
- readBackValue(is, valueReturn, NO_TYPE_CHECK);
- } catch (CommandException e) {
- // rethrow this exception since we want these to go on out.
- throw e;
- } catch (Exception e) {
- // Wrapper this one.
- throw new UnexpectedExceptionCommandException(false, e);
- }
- }
-
- public static void sendGetArrayContentsCommand(DataOutputStream os, DataInputStream is, int arrayID, ValueObject valueReturn) throws CommandException {
- try {
- os.writeByte(GET_ARRAY_CONTENTS);
- os.writeInt(arrayID);
- os.flush();
- readBackValue(is, valueReturn, NO_TYPE_CHECK);
- } catch (CommandException e) {
- // rethrow this exception since we want these to go on out.
- throw e;
- } catch (Exception e) {
- // Wrapper this one.
- throw new UnexpectedExceptionCommandException(false, e);
- }
- }
-
- private Commands() {
- // Never intended to be instantiated.
- }
-}
diff --git a/plugins/org.eclipse.jem.proxy/remoteCommon/org/eclipse/jem/internal/proxy/common/remote/ExpressionCommands.java b/plugins/org.eclipse.jem.proxy/remoteCommon/org/eclipse/jem/internal/proxy/common/remote/ExpressionCommands.java
deleted file mode 100644
index 4337086fb..000000000
--- a/plugins/org.eclipse.jem.proxy/remoteCommon/org/eclipse/jem/internal/proxy/common/remote/ExpressionCommands.java
+++ /dev/null
@@ -1,345 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 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.jem.internal.proxy.common.remote;
-
-import java.io.*;
-
-import org.eclipse.jem.internal.proxy.common.CommandException;
-
-
-/**
- *
- * @since 1.0.0
- */
-public class ExpressionCommands {
-
- // These are the sub-commands under EXPRESSION_TREE_COMMANDS that can be send.
- public static final byte
- START_EXPRESSION_TREE_PROCESSING = 0,
- PUSH_EXPRESSION = 1,
- END_EXPRESSION_TREE_PROCESSING = 2,
- SYNC_REQUEST = 3,
- PULL_VALUE_REQUEST = 4,
- TRANSFER_EXPRESSION_REQUEST = 5,
- RESUME_EXPRESSION_REQUEST = 6;
-
- // These are the expression specific error codes (it can also send back general ones. See SYNC_REQUEST docs lower down).
- public static final int
- EXPRESSION_NOEXPRESSIONVALUE_EXCEPTION = Commands.MAX_ERROR_CODE+1; // No expression value occurred.
-
- // These are the flag values sent in proxy resolution when doesn't resolve to proxy.
- public static final int
- EXPRESSIONPROXY_VOIDTYPE = 0, // Expression proxy resolves to void type.
- EXPRESSIONPROXY_NOTRESOLVED = 1; // Expression proxy not resolved.
-
- // These are the trace values sent in START_EXPRESSION_TREE_PROCESSING
- public static final byte
- TRACE_DEFAULT = -1,
- TRACE_OFF = 0,
- TRACE_ON = 1;
-
- public static final String EXPRESSIONTRACE = "proxyvm.expressionTrace"; // The system property for turning on expression tracing. //$NON-NLS-1$
- public static final String EXPRESSIONTRACE_TIMER_THRESHOLD = "proxyvm.expressionTraceTimerThreshold"; // The system property for timer threshold. //$NON-NLS-1$
-
- /*
- * The format of the commands are:
- * Note: Most of the commands will not being doing a os.flush() at the end. We are just going to
- * be streaming the data over the line. At the end we will flush and then catch up. That way
- * we aren't waiting for the other side as we send the data.
- *
- * START_EXPRESSION_TREE_PROCESSING: 0b, trace
- * Start processing.
- * byte(trace): -1 : do default
- * 0 : no trace
- * 1 : do trace
- *
- * PUSH_EXPRESSION: 1b, b
- * Push an expression. Where "b" is the expression type from IInternalExpressionConstants.
- * The actual data that follows is expression type dependent and will be
- * sent in a following call to ExpressionCommands as it builds up the actual command.
- * See REMExpression and each type of push call method within it to see the actual
- * sent data.
- *
- * END_EXPRESSION_TREE_PROCESSING: 2b
- * End the processing and clean up.
- *
- * SYNC_REQUEST: 3b
- * This will return the current status. The reason it is called sync is because the
- * IDE will wait for it to complete and read back the value. It will send back:
- * 1: VALUE command with boolean true as the value.
- * 2: ERROR command with code of ExpressionClassNotFound, with value of String with message from exception.
- * 3: ERROR command with code of EXPRESSION_NOEXPRESSIONVALUE_EXCEPTION, with value of String with message from exception.
- * 4: THROWABLE command with the actual exception that occurred.
- *
- *
- * PULL_VALUE_REQUEST: 4b
- * This will do a sync up and return the value from the expression.
- * IDE will wait for it to compleate and read back the value. It will send back:
- * 1: VALUE command with the result as the value.
- * 2: ERROR or EXCEPTION if there were errors, see SYNC_REQUEST with the format they are sent back.
- *
- * TRANSFER_EXPRESSION_REQUEST: 5b
- * This will do a sync up, and return the ExpressionProcessorController that the request is for. And remove
- * the controller from its list of active expression controllers.
- *
- * RESUME_EXPRESSION_REQUEST: 6b, anExpressionProcessorController
- * This will take the given controller and add it to the list of controllers this connection is handling. It returns nothing.
- *
- * @see org.eclipse.jem.internal.proxy.initParser.tree.IInternalExpressionConstants
- * @see org.eclipse.jem.internal.proxy.remote.REMExpression
- *
- */
-
- /**
- * Send the start expression processing command.
- * @param expressionID
- * @param trace
- * @param os
- *
- * @throws IOException
- *
- * @since 1.0.0
- */
- public static void sendStartExpressionProcessingCommand(int expressionID, byte trace, DataOutputStream os) throws IOException {
- os.writeByte(Commands.EXPRESSION_TREE_COMMAND);
- os.writeInt(expressionID);
- os.writeByte(START_EXPRESSION_TREE_PROCESSING);
- os.writeByte(trace);
- }
-
- /**
- * Send the end expression processing command.
- * @param expressionID
- * @param os
- *
- * @throws IOException
- *
- * @since 1.0.0
- */
- public static void sendEndExpressionProcessingCommand(int expressionID, DataOutputStream os) throws IOException {
- os.writeByte(Commands.EXPRESSION_TREE_COMMAND);
- os.writeInt(expressionID);
- os.writeByte(END_EXPRESSION_TREE_PROCESSING);
- os.flush(); // Flushing because we are done and want to make sure everything goes out.
- }
-
- /**
- * Send an expression subcommand.
- * @param expressionID
- * @param os
- * @param subcommand
- *
- * @throws IOException
- *
- * @since 1.0.0
- */
- public static void sendExpressionCommand(int expressionID, DataOutputStream os, byte subcommand) throws IOException {
- os.writeByte(Commands.EXPRESSION_TREE_COMMAND);
- os.writeInt(expressionID);
- os.writeByte(PUSH_EXPRESSION);
- os.writeByte(subcommand);
- }
-
- /**
- * Send just a byte.
- *
- * @param os
- * @param aByte
- * @throws IOException
- *
- * @since 1.0.0
- */
- public static void sendByte(DataOutputStream os, byte aByte) throws IOException {
- os.writeByte(aByte);
- }
-
- /**
- * Send just an int.
- *
- * @param os
- * @param anInt
- * @throws IOException
- *
- * @since 1.0.0
- */
- public static void sendInt(DataOutputStream os, int anInt) throws IOException {
- os.writeInt(anInt);
- }
-
- /**
- * Send just a string.
- *
- * @param os
- * @param aString
- * @throws IOException
- *
- * @since 1.0.0
- */
- public static void sendString(DataOutputStream os, String aString) throws IOException {
- Commands.sendStringData(os, aString);
- }
-
- /**
- * Send just a boolean.
- *
- * @param os
- * @param aBool
- * @throws IOException
- *
- * @since 1.0.0
- */
- public static void sendBoolean(DataOutputStream os, boolean aBool) throws IOException {
- os.writeBoolean(aBool);
- }
-
- /**
- * Send the pull value command. After processing the proxies, caller should call getFinalValue() to get the value.
- * @param expressionID
- * @param os
- * @param is
- * @param proxyids if not <code>null</code>, then this is the list of expression proxy ids that need to be returned as rendered.
- * @param sender sender used to process the resolved proxy ids, or <code>null</code> if no proxy ids.
- * @throws CommandException
- *
- * @since 1.0.0
- */
- public static void sendPullValueCommand(int expressionID, DataOutputStream os, DataInputStream is, Commands.ValueObject proxyids, Commands.ValueSender sender) throws CommandException {
- try {
- os.writeByte(Commands.EXPRESSION_TREE_COMMAND);
- os.writeInt(expressionID);
- os.writeByte(PULL_VALUE_REQUEST);
- sendProxyIDs(os, proxyids);
- os.flush();
- if (proxyids != null) {
- Commands.readBackValue(is, proxyids, Commands.ARRAY_IDS); // Read the array header.
- sender.initialize(proxyids);
- Commands.readArray(is, proxyids.anInt, sender, proxyids, true); // Read the array.
- }
- } catch (CommandException e) {
- // rethrow this exception since we want these to go on out.
- throw e;
- } catch (IOException e) {
- // Wrapper this one.
- throw new UnexpectedExceptionCommandException(false, e);
- }
- }
-
- /**
- * Send a sync command. This does a synchronize with the remote expression processor. It makes sure that the
- * stream is caught and doesn't return until everything on the stream has been processed. Should then call
- * getFinalValue() to verify the expression is valid.
- * @param expressionID
- * @param os
- * @param is
- * @param proxyids if not <code>null</code>, then this is the list of expression proxy ids that need to be returned as rendered.
- * @param sender the sender used for reading back the proxyid resolutions, or <code>null</code> if no proxy ids.
- *
- * @throws CommandException
- *
- * @since 1.0.0
- */
- public static void sendSyncCommand(int expressionID, DataOutputStream os, DataInputStream is, Commands.ValueObject proxyids, Commands.ValueSender sender) throws CommandException {
- try {
- os.writeByte(Commands.EXPRESSION_TREE_COMMAND);
- os.writeInt(expressionID);
- os.writeByte(SYNC_REQUEST);
- sendProxyIDs(os, proxyids);
- os.flush();
- if (proxyids != null) {
- Commands.readBackValue(is, proxyids, Commands.ARRAY_IDS); // Read the array header.
- sender.initialize(proxyids);
- Commands.readArray(is, proxyids.anInt, sender, proxyids, true); // Read the array.
- }
- } catch (CommandException e) {
- // rethrow this exception since we want these to go on out.
- throw e;
- } catch (Exception e) {
- // Wrapper this one.
- throw new UnexpectedExceptionCommandException(false, e);
- }
- }
-
- /**
- * Send the proxyids (if not null) as part of a command. Used by sync and pullValue.
- * @param os
- * @param proxyids <code>null</code> if not requesting proxy ids.
- * @throws IOException
- * @throws CommandException
- *
- * @since 1.1.0
- */
- private static void sendProxyIDs(DataOutputStream os, Commands.ValueObject proxyids) throws IOException, CommandException {
- if (proxyids != null) {
- os.writeBoolean(true); // Indicates proxy ids being sent.
- Commands.writeValue(os, proxyids, false, false);
- } else
- os.writeBoolean(false); // No proxyids being sent.
- }
-
- /**
- * Send the transfer expression command and receive back the expression processor controller.
- *
- * @param expressionID
- * @param os
- * @param is
- * @param expressionProcesserController
- * @throws CommandException
- *
- * @since 1.1.0
- */
- public static void sendTransferExpressionCommand(int expressionID, DataOutputStream os, DataInputStream is, Commands.ValueObject expressionProcesserController) throws CommandException {
- try {
- os.writeByte(Commands.EXPRESSION_TREE_COMMAND);
- os.writeInt(expressionID);
- os.writeByte(TRANSFER_EXPRESSION_REQUEST);
- os.flush();
- Commands.readBackValue(is, expressionProcesserController, Commands.NO_TYPE_CHECK); // Read the expression processor controller
- } catch (CommandException e) {
- throw e;
- } catch (Exception e) {
- // Wrapper this one.
- throw new UnexpectedExceptionCommandException(false, e);
- }
- }
-
- /**
- * Send the resume expression command with given expression processor controller.
- *
- * @param expressionID
- * @param os
- * @param expressionProcessorController
- * @throws CommandException
- *
- * @since 1.1.0
- */
- public static void sendResumeExpressionCommand(int expressionID, DataOutputStream os, Commands.ValueObject expressionProcessorController) throws CommandException {
- try {
- os.writeByte(Commands.EXPRESSION_TREE_COMMAND);
- os.writeInt(expressionID);
- os.writeByte(RESUME_EXPRESSION_REQUEST);
- Commands.writeValue(os, expressionProcessorController, false, false);
- } catch (CommandException e) {
- throw e;
- } catch (Exception e) {
- // Wrapper this one.
- throw new UnexpectedExceptionCommandException(false, e);
- }
- }
-
- private ExpressionCommands() {
- // Never intended to be instantiated.
- }
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/remoteCommon/org/eclipse/jem/internal/proxy/common/remote/IOCommandException.java b/plugins/org.eclipse.jem.proxy/remoteCommon/org/eclipse/jem/internal/proxy/common/remote/IOCommandException.java
deleted file mode 100644
index eb51a70ea..000000000
--- a/plugins/org.eclipse.jem.proxy/remoteCommon/org/eclipse/jem/internal/proxy/common/remote/IOCommandException.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.common.remote;
-/*
-
-
- */
-
-import java.io.IOException;
-import org.eclipse.jem.internal.proxy.common.CommandException;
-
-/**
- * A command exception occured while processing an io request
- * in a callback stream. This exception wrappers the command exception.
- */
-
-public class IOCommandException extends IOException {
- /**
- * Comment for <code>serialVersionUID</code>
- *
- * @since 1.1.0
- */
- private static final long serialVersionUID = -2308947195164382779L;
- protected CommandException fException;
-
- public IOCommandException(CommandException e) {
- fException = e;
- }
-
- public CommandException getException() {
- return fException;
- }
-
- public String getMessage() {
- return fException.getMessage();
- }
-
- public void printStackTrace() {
- fException.printStackTrace();
- }
-
- public void printStackTrace(java.io.PrintStream p) {
- fException.printStackTrace(p);
- }
-
- public void printStackTrace(java.io.PrintWriter p) {
- fException.printStackTrace(p);
- }
-
-}
-
-
diff --git a/plugins/org.eclipse.jem.proxy/remoteCommon/org/eclipse/jem/internal/proxy/common/remote/TransmitableArray.java b/plugins/org.eclipse.jem.proxy/remoteCommon/org/eclipse/jem/internal/proxy/common/remote/TransmitableArray.java
deleted file mode 100644
index a6c4271ee..000000000
--- a/plugins/org.eclipse.jem.proxy/remoteCommon/org/eclipse/jem/internal/proxy/common/remote/TransmitableArray.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.common.remote;
-/*
-
-
- */
-
-
-/**
- * A value can be a TransmitableArray. This means this value is an array that
- * needs to have a ValueRetriever created for it. This is used if the array has ID's in
- * it and is not an existing array on the server or all constant values.
- *
- * NOTE: It is assumed that all IBeanTypeProxies of the parms have already been retrieved.
- * It should still work, but it could be asking for them in the middle of the request
- * if they are not first gotton. And this could throw a non-recoverable exception if not found.
- */
-public final class TransmitableArray {
- public int componentTypeID; // The id of the type of the component type of the array.
- public Object[] array; // The array it self.
- public TransmitableArray(int typeID, Object[] anArray) {
- componentTypeID = typeID;
- array = anArray;
- }
-}
-
-
diff --git a/plugins/org.eclipse.jem.proxy/remoteCommon/org/eclipse/jem/internal/proxy/common/remote/UnexpectedCommandException.java b/plugins/org.eclipse.jem.proxy/remoteCommon/org/eclipse/jem/internal/proxy/common/remote/UnexpectedCommandException.java
deleted file mode 100644
index 3afd47877..000000000
--- a/plugins/org.eclipse.jem.proxy/remoteCommon/org/eclipse/jem/internal/proxy/common/remote/UnexpectedCommandException.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.common.remote;
-/*
-
-
- */
-
-import org.eclipse.jem.internal.proxy.common.CommandException;
-/**
- * This is an exception that is thrown when the processing
- * of data was invalid for the command.
- * There will be a flag indicting error type, and a flag
- * indicating whether the connection is recoverable or not.
- * If not recoverable, then the connection needs to be closed.
- *
- */
-public class UnexpectedCommandException extends CommandException {
- /**
- * Comment for <code>serialVersionUID</code>
- *
- * @since 1.1.0
- */
- private static final long serialVersionUID = 7097693384453243113L;
- private final Object fErrorType;
- private final boolean fRecoverable;
-
- public UnexpectedCommandException(Object errorType, boolean recoverable) {
- fErrorType = errorType;
- fRecoverable = recoverable;
- }
-
- public UnexpectedCommandException(Object errorType, boolean recoverable, Object data) {
- super(data);
- fErrorType = errorType;
- fRecoverable = recoverable;
- }
-
- public UnexpectedCommandException(Object errorType, boolean recoverable, String msg, Object data) {
- super(msg, data);
- fErrorType = errorType;
- fRecoverable = recoverable;
- }
-
- public Object getErrorType() {
- return fErrorType;
- }
-
- public boolean isRecoverable() {
- return fRecoverable;
- }
-
- public String getMessage() {
- String m = super.getMessage();
- if (fErrorType != null) {
- String dataMsg = getExceptionData() != null ? " Errordata="+getExceptionData().toString() : ""; //$NON-NLS-1$ //$NON-NLS-2$
- if (m == null)
- return "Errortype="+fErrorType.toString() + dataMsg; //$NON-NLS-1$
- else
- return m + ':' + "Errortype="+fErrorType.toString() + dataMsg; //$NON-NLS-1$
- } else
- return m;
- }
-}
diff --git a/plugins/org.eclipse.jem.proxy/remoteCommon/org/eclipse/jem/internal/proxy/common/remote/UnexpectedExceptionCommandException.java b/plugins/org.eclipse.jem.proxy/remoteCommon/org/eclipse/jem/internal/proxy/common/remote/UnexpectedExceptionCommandException.java
deleted file mode 100644
index dc0316a3e..000000000
--- a/plugins/org.eclipse.jem.proxy/remoteCommon/org/eclipse/jem/internal/proxy/common/remote/UnexpectedExceptionCommandException.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.common.remote;
-/*
-
-
- */
-
-/**
- * Wrapper an unexpected exception in a Command Exception.
- */
-public class UnexpectedExceptionCommandException extends UnexpectedCommandException {
-
- /**
- * Comment for <code>serialVersionUID</code>
- *
- * @since 1.1.0
- */
- private static final long serialVersionUID = -1654134370115650969L;
-
- public UnexpectedExceptionCommandException(boolean recoverable, Throwable data) {
- super(Commands.SOME_UNEXPECTED_EXCEPTION, recoverable, data);
- }
-
- public UnexpectedExceptionCommandException(boolean recoverable, String msg, Throwable data) {
- super(Commands.SOME_UNEXPECTED_EXCEPTION, recoverable, msg, data);
- }
-
- public Throwable getException() {
- return (Throwable) getExceptionData();
- }
-
- public String getMessage() {
- String localMsg = super.getMessage();
- if (getException() != null)
- if (localMsg == null || localMsg.length() == 0)
- return getException().getLocalizedMessage();
- else
- return localMsg + ": " + getException().getLocalizedMessage(); //$NON-NLS-1$
- return
- localMsg;
- }
-
- public void printExceptionStackTrace() {
- getException().printStackTrace();
- }
-
- public void printStackTrace() {
- printExceptionStackTrace();
- }
-
- public void printStackTrace(java.io.PrintStream p) {
- getException().printStackTrace(p);
- }
-
- public void printStackTrace(java.io.PrintWriter p) {
- getException().printStackTrace(p);
- }
-}
diff --git a/plugins/org.eclipse.jem.proxy/schema/contributors.exsd b/plugins/org.eclipse.jem.proxy/schema/contributors.exsd
deleted file mode 100644
index 672a5520a..000000000
--- a/plugins/org.eclipse.jem.proxy/schema/contributors.exsd
+++ /dev/null
@@ -1,149 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.jem.proxy">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.jem.proxy" id="contributors" name="Proxy Configuration Contributors"/>
- </appInfo>
- <documentation>
- This extension point is used to supply configuration contributors for proxy support. You can supply a contributor for a specific classpath container or for a plugin.
-&lt;p&gt;
-The way configuration contributors work is that when a proxy vm is started, it first runs through all of the explicit contributors that were given to it. It then goes through the classpath of the project and finds the containers. If the container implements IConfigurationContributor, it will be called as a contributor. Then all of the extensions of this extension point will be searched for those have the same container id, and if so they will be called as a contributor.
-&lt;p&gt;
-The extensions will be called in plugin order. In other words if plugin A depends on plugin B, the contribution in plugin A will not be called before the contribution in plugin B.
-&lt;p&gt;
-If a plugin is in the classpath of the project (in other words the project is PDE plugin development project and requires a plugin) then the contributor with the given plugin id will be called.
-&lt;p&gt;
-Both container and plugin can be specified, but at least one of them must be specified. If both are specified, then this entry will be used if either the container or the plugin is found in the classpath.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="contributor" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="contributor">
- <annotation>
- <appInfo>
- <meta.element labelAttribute="class"/>
- </appInfo>
- <documentation>
- A contributor. Either the container and/or the plugin attributes must be set.
- </documentation>
- </annotation>
- <complexType>
- <attribute name="container" type="string">
- <annotation>
- <documentation>
- contributor is for a container. The value is the container id (e.g. &lt;b&gt;&quot;JRE_CONTAINER&quot;&lt;/b&gt;). This will match &quot;/JRE_CONTAINER&quot; or &quot;/JRE_CONTAINER/...&quot;. Or &lt;b&gt;&quot;JRE_CONTAINER/XYZ&quot;&lt;/b&gt; would match &quot;/JRE_CONTAINER/XYZ/...&quot;.
-&lt;p&gt;
-You can also use a regular expression. An expression such as &lt;b&gt;&quot;SWT_CONTAINER/(.*/)*PDE&quot;&lt;/b&gt; will match &quot;/SWT_CONTAINER/JFACE/PDE&quot; and &quot;/SWT_CONTAINER/PDE&quot; but will not match &quot;/SWT_CONTAINER&quot;.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="plugin" type="string">
- <annotation>
- <documentation>
- contributor is for a plugin. The value is the plugin id (e.g. &quot;org.eclipse.swt&quot;).
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- the class that implements this contributor. The class must implement IConfigurationContributor.
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn="org.eclipse.jem.internal.proxy.core.IConfigurationContributor"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- 1.0.0
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- The following is an example of a contributor:
-
-&lt;p&gt;
-&lt;pre&gt;
- &lt;extension point=&quot;org.eclipse.jem.proxy.contributors&quot;&gt;
- &lt;contributor
- class=&quot;com.example.ContributorImplementation&quot;
- container=&quot;MY_CONTAINER&quot;&gt;
- &lt;/contributor&gt;
- &lt;/extension&gt;
-&lt;/pre&gt;
-&lt;/p&gt;
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- The &lt;samp&gt;class&lt;/samp&gt; attribute must be a fully-qualified class that implements the &lt;samp&gt;org.eclipse.jem.internal.proxy.core.IConfigurationContributor&lt;/samp&gt; interface for contributor.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
- There is &lt;samp&gt;org.eclipse.jem.internal.proxy.core.ConfigurationContributorAdapter&lt;/samp&gt; available to subclass to provide specific overrides. The default for the adapter is that it doesn&apos;t do anything.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2004 IBM Corporation and others.&lt;br&gt;
-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
-&lt;a href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
- </documentation>
- </annotation>
-
-</schema>
diff --git a/plugins/org.eclipse.jem.proxy/schema/extensions.exsd b/plugins/org.eclipse.jem.proxy/schema/extensions.exsd
deleted file mode 100644
index 38dc8db58..000000000
--- a/plugins/org.eclipse.jem.proxy/schema/extensions.exsd
+++ /dev/null
@@ -1,157 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.jem.proxy">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.jem.proxy" id="extensions" name="Proxy Extension Registration Contributors"/>
- </appInfo>
- <documentation>
- This extension point is used to supply extension registrations for proxy support. You can supply an extension registration for a specific classpath container or for a plugin.
-&lt;p&gt;
-Just after the registry has been started and before any contributions to the registry can be made, the extension registrations for the given registry type (such as &quot;org.eclipse.jem.REMOTE&quot;) for any paths/plugins/containers that have that match will be executed. These are used to do extension registrations (such as BaseProxyFactroyRegistry.registerBeanTypeProxyFactory(String packageName, IBeanTypeProxyFactory aFactory)). These registrations shouldn&apos;t do any actual proxy calls because at this time not all of the extensions had been run yet and it may accidently reference a package that should have an extension factory on it, but that factory has not yet been registered. Instead the contributor extension point should be used for that because at that time all of the extensions will be registered.
-&lt;p&gt;
-The way extension registrations work is that when a proxy vm is started, it finds all of the extensions of this extension point will be searched for those have the same container id and registry type id, and if so they will be called as an extension registration.
-&lt;p&gt;
-If a plugin is in the classpath of the project (in other words the project is PDE plugin development project and requires a plugin) then the extension registration with the given plugin id will be called.
-&lt;p&gt;
-Both container and plugin can be specified, but at least one of them must be specified. If both are specified, then this entry will be used if either the container or the plugin is found in the classpath.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="registration" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="registration">
- <annotation>
- <appInfo>
- <meta.element labelAttribute="class"/>
- </appInfo>
- <documentation>
- Proxy Extension factories registration contributor. Used to contribute the factory extensions based upon the registry type (e.g. &quot;org.eclipse.jem.REMOTE&quot; for remote vm registries) depending upon the container or plugin path.
- </documentation>
- </annotation>
- <complexType>
- <attribute name="registryType" type="string" use="required">
- <annotation>
- <documentation>
- The type of the registry this extensionRegistration is for, such as &quot;org.eclipse.jem.REMOTE&quot; for the remote vm registry type.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="container" type="string">
- <annotation>
- <documentation>
- extension registration is for a container. The value is the container id (e.g. &lt;b&gt;&quot;JRE_CONTAINER&quot;&lt;/b&gt;). This will match &quot;/JRE_CONTAINER&quot; or &quot;/JRE_CONTAINER/...&quot;. Or &lt;b&gt;&quot;JRE_CONTAINER/XYZ&quot;&lt;/b&gt; would match &quot;/JRE_CONTAINER/XYZ/...&quot;.
-&lt;p&gt;
-You can also use a regular expression. An expression such as &lt;b&gt;&quot;SWT_CONTAINER/.*/JFACE&quot;&lt;/b&gt; will match &quot;/SWT_CONTAINER/PDE/JFACE&quot; but will not match &quot;/SWT_CONTAINER&quot;.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="plugin" type="string">
- <annotation>
- <documentation>
- extension registration is for a plugin. The value is the plugin id (e.g. &quot;org.eclipse.swt&quot;).
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- the class that implements this extension registration. The class must implement IExtensionRegistration.
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn="org.eclipse.jem.internal.proxy.core.IExtensionRegistration"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- 1.1.0
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- The following is an example of a contributor:
-
-&lt;p&gt;
-&lt;pre&gt;
- &lt;extension point=&quot;org.eclipse.jem.proxy.extensions&quot;&gt;
- &lt;contributor
- registryType=&quot;org.eclipse.jem.REMOTE&quot;
- class=&quot;com.example.ExtensionRegistrationImplementation&quot;
- container=&quot;MY_CONTAINER&quot;&gt;
- &lt;/contributor&gt;
- &lt;/extension&gt;
-&lt;/pre&gt;
-&lt;/p&gt;
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- The &lt;samp&gt;class&lt;/samp&gt; attribute must be a fully-qualified class that implements the &lt;samp&gt;org.eclipse.jem.internal.proxy.core.IExtensionRegistration&lt;/samp&gt; interface for extension registration.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2004 IBM Corporation and others.&lt;br&gt;
-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
-&lt;a href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
- </documentation>
- </annotation>
-
-</schema>
diff --git a/plugins/org.eclipse.jem.proxy/vm_remotevm/org/eclipse/jem/internal/proxy/vm/remote/AWTStarter.java b/plugins/org.eclipse.jem.proxy/vm_remotevm/org/eclipse/jem/internal/proxy/vm/remote/AWTStarter.java
deleted file mode 100644
index 9bebf327a..000000000
--- a/plugins/org.eclipse.jem.proxy/vm_remotevm/org/eclipse/jem/internal/proxy/vm/remote/AWTStarter.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 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.jem.internal.proxy.vm.remote;
-
-import java.awt.Toolkit;
-
-
-/**
- * This class is used to do start the AWT eventqueue ahead of time to try to parallel process it.
- * @since 1.1.0
- */
-public class AWTStarter {
-
- public static void startAWT() {
- Thread t = new Thread() {
- public void run() {
- Thread.yield(); // So as not to possibly hold up the guy doing the starting.
- Toolkit.getDefaultToolkit();
- }
- };
- t.start();
- }
-}
diff --git a/plugins/org.eclipse.jem.proxy/vm_remotevm/org/eclipse/jem/internal/proxy/vm/remote/ArrayHelper.java b/plugins/org.eclipse.jem.proxy/vm_remotevm/org/eclipse/jem/internal/proxy/vm/remote/ArrayHelper.java
deleted file mode 100644
index 64583c50e..000000000
--- a/plugins/org.eclipse.jem.proxy/vm_remotevm/org/eclipse/jem/internal/proxy/vm/remote/ArrayHelper.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.vm.remote;
-
-import java.util.Arrays;
-/*
-
-
- */
-
-
-/**
- * This class provides similiar function as the java.lang.reflect.Array class but
- * it handles multi-dimensional arrays. Without this helper, the client would have
- * to walk down through each dimension executing a get command. This would mean
- * many transactions instead of one provided by this helper.
- *
- * It also provides some other helper functions for arrays that Array doesn't provide.
- */
-
-public final class ArrayHelper {
- // It can never be instantiated.
- private ArrayHelper() {
- }
-
- public static Object get(Object array, int[] indexes) {
- Object answer = array;
- for (int i=0; i<indexes.length; i++)
- answer = java.lang.reflect.Array.get(answer, indexes[i]);
- return answer;
- }
-
- public static byte getByte(Object array, int[] indexes) {
- return ((Byte) get(array, indexes)).byteValue();
- }
- public static boolean getBoolean(Object array, int[] indexes) {
- return ((Boolean) get(array, indexes)).booleanValue();
- }
- public static char getChar(Object array, int[] indexes) {
- return ((Character) get(array, indexes)).charValue();
- }
- public static double getDouble(Object array, int[] indexes) {
- return ((Double) get(array, indexes)).doubleValue();
- }
- public static float getFloat(Object array, int[] indexes) {
- return ((Float) get(array, indexes)).floatValue();
- }
- public static int getInt(Object array, int[] indexes) {
- return ((Integer) get(array, indexes)).intValue();
- }
- public static long getLong(Object array, int[] indexes) {
- return ((Long) get(array, indexes)).longValue();
- }
- public static short getShort(Object array, int[] indexes) {
- return ((Short) get(array, indexes)).shortValue();
- }
-
- public static void set(Object array, int[] indexes, Object value) {
- Object subArray = array;
- int upTo = indexes.length-1;
- for (int i=0; i<upTo; i++)
- subArray = java.lang.reflect.Array.get(subArray, indexes[i]);
- java.lang.reflect.Array.set(subArray, indexes[upTo], value);
- }
-
- /**
- * See if the two arrays are "equal" (not identidy, but that the contents are equal).
- * @param array1 must be an array
- * @param array2 must be an array
- * @return true if semantically equal using {@link Arrays#equals(Object[], Object[])};
- *
- * @see Arrays#equals(Object[], Object[]);
- * @since 1.2.1
- */
- public static boolean equals(Object array1, Object array2) {
- if (array1 == array2)
- return true;
- if (array1 == null || array2 == null)
- return false;
- Class aclass = array1.getClass();
- Class bclass = array2.getClass();
- if (!aclass.isArray() || !bclass.isArray())
- return false;
- Class acomp = aclass.getComponentType();
- Class bcomp = bclass.getComponentType();
- if (acomp.isPrimitive() || bcomp.isPrimitive()) {
- if (acomp != bcomp)
- return false;
- if (acomp == Integer.TYPE)
- return Arrays.equals((int[]) array1, (int[]) array2);
- else if (acomp == Boolean.TYPE)
- return Arrays.equals((boolean[]) array1, (boolean[]) array2);
- else if (acomp == Long.TYPE)
- return Arrays.equals((long[]) array1, (long[]) array2);
- else if (acomp == Short.TYPE)
- return Arrays.equals((short[]) array1, (short[]) array2);
- else if (acomp == Double.TYPE)
- return Arrays.equals((double[]) array1, (double[]) array2);
- else if (acomp == Float.TYPE)
- return Arrays.equals((float[]) array1, (float[]) array2);
- else if (acomp == Character.TYPE)
- return Arrays.equals((char[]) array1, (char[]) array2);
- else if (acomp == Byte.TYPE)
- return Arrays.equals((byte[]) array1, (byte[]) array2);
- else
- return false;
- } else
- return Arrays.equals((Object[]) array1, (Object[]) array2);
- }
-}
diff --git a/plugins/org.eclipse.jem.proxy/vm_remotevm/org/eclipse/jem/internal/proxy/vm/remote/CallbackHandler.java b/plugins/org.eclipse.jem.proxy/vm_remotevm/org/eclipse/jem/internal/proxy/vm/remote/CallbackHandler.java
deleted file mode 100644
index 5757351c1..000000000
--- a/plugins/org.eclipse.jem.proxy/vm_remotevm/org/eclipse/jem/internal/proxy/vm/remote/CallbackHandler.java
+++ /dev/null
@@ -1,181 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.vm.remote;
-/*
-
-
- */
-
-import java.net.Socket;
-import java.io.*;
-import org.eclipse.jem.internal.proxy.common.remote.Commands;
-import org.eclipse.jem.internal.proxy.common.remote.UnexpectedExceptionCommandException;
-import org.eclipse.jem.internal.proxy.common.*;
-/**
- * This is a handler for doing callbacks to the
- * client.
- *
- * This is package protected because no one should
- * use it from the outside. It is too critical that
- * callback's work only in this specified way.
- */
-class CallbackHandler extends ConnectionHandler implements ICallbackHandler {
- public CallbackHandler(Socket sc, RemoteVMServerThread svr) {
- super(sc, svr, null);
- }
-
- /**
- * Initiate a stream callback request.
- */
- public void initiateCallbackStream(int callbackID, int msgID) throws CommandException {
- try {
- Commands.sendCallbackStreamCommand(out, callbackID, msgID);
- out.flush();
- } catch (CommandException e) {
- throw e;
- } catch (Exception e) {
- throw new UnexpectedExceptionCommandException(false, e);
- }
- run(); // Now run and wait for return. If no command exeception thrown, then it signals to continue.
- }
-
- /**
- * Write bytes to the client. If bytesToWrite is -1, then this is end and
- * no bytes are being written. Just write the -1 then.
- */
- public void writeBytes(byte[] bytes, int bytesToWrite) throws CommandException {
- try {
- if (bytesToWrite != -1)
- Commands.writeBytes(out, bytes, bytesToWrite);
- else
- out.writeInt(-1);
- } catch (CommandException e) {
- throw e;
- } catch (Exception e) {
- throw new UnexpectedExceptionCommandException(false, e);
- }
- }
-
-
- /**
- * Callback, but send the parm as an object, ie. it must
- * be nothing but constants, e.g. String, Integer, or an
- * array of constants. Constants should not be things like
- * regular objects. This is because only standard java.lang
- * type constants can be assured to be available on the other
- * client. Also you don't want to send big objects, except
- * maybe something like an array of bytes or strings. It must
- * be constants that don't need to be sent back for any reason
- * since their identity will be lost in the transfer.
- *
- * This should be used if there are no parms (i.e. it is null).
- */
- public Object callbackAsConstants(int callbackID, int msgID, Object parm) throws CommandException {
-
- try {
- Commands.sendCallbackCommand(out, callbackID, msgID);
- Commands.ValueObject v = new Commands.ValueObject();
- sendObject(parm, SEND_AS_IS, v, out, false);
- out.flush();
- } catch (CommandException e) {
- throw e;
- } catch (Exception e) {
- throw new UnexpectedExceptionCommandException(false, e);
- }
- return run(); // Now run and wait for return.
- }
-
-
- // A retriever is what handles the array part.
- private class Retriever implements Commands.ValueRetrieve {
- int index=0;
- Object[] array;
- Commands.ValueObject worker = new Commands.ValueObject();
-
-
- public Retriever(Object[] anArray) {
- array = anArray;
- }
-
- public Commands.ValueObject nextValue() {
- Object parm = array[index++];
- if (parm != null) {
- if (parm instanceof ICallbackHandler.TransmitableArray) {
- // It is another array, create a new retriever.
- worker.setArrayIDS(new Retriever(((ICallbackHandler.TransmitableArray) parm).getArray()), ((ICallbackHandler.TransmitableArray) parm).getArray().length, Commands.OBJECT_CLASS);
- } else {
- // They may add some new ID's and if there is an error, they
- // won't get released, but that is a slight chance we will have
- // to take because we don't know which ones were new and which
- // ones weren't.
- fillInValue(parm, NOT_A_PRIMITIVE, worker);
- }
- } else
- worker.set();
- return worker;
- }
- };
-
- private static final Object[] NULL_SENT = new Object[1];
- /**
- * Callback, but send the parm as IDs so that proxies
- * will be created for the objects and can be referenced.
- *
- * This should be used even if there is only one parm.
- */
- public Object callbackWithParms(int callbackID, int msgID, Object[] parms) throws CommandException {
- try {
- if (parms == null)
- parms = NULL_SENT;
-
- Commands.ValueObject v = new Commands.ValueObject();
-
- v.setArrayIDS(new Retriever(parms), parms.length, Commands.OBJECT_CLASS);
- Commands.sendCallbackCommand(out, callbackID, msgID);
- Commands.writeValue(out, v, false);
- out.flush();
- } catch (CommandException e) {
- throw e;
- } catch (Exception e) {
- throw new UnexpectedExceptionCommandException(false, e);
- }
- return run(); // Now run and wait for return.
- }
-
- /**
- * A closeHandler has been requested. This is called when
- * not waiting within a loop, so we need to do the cleanup ourselves.
- */
- public void closeHandler() {
- if (isConnected()) {
- try {
- Commands.sendQuitCommand(out);
- } catch (IOException e) {
- } finally {
- if (in != null)
- try {
- in.close();
- } catch (Exception e) {
- }
- if (out != null)
- try {
- out.close();
- } catch (Exception e) {
- }
- close();
- in = null;
- out = null;
- socket = null;
- }
- }
- }
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/vm_remotevm/org/eclipse/jem/internal/proxy/vm/remote/CallbackOutputStream.java b/plugins/org.eclipse.jem.proxy/vm_remotevm/org/eclipse/jem/internal/proxy/vm/remote/CallbackOutputStream.java
deleted file mode 100644
index c4d7ef73a..000000000
--- a/plugins/org.eclipse.jem.proxy/vm_remotevm/org/eclipse/jem/internal/proxy/vm/remote/CallbackOutputStream.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.vm.remote;
-/*
-
-
- */
-
-import java.io.OutputStream;
-import java.io.IOException;
-import java.io.InterruptedIOException;
-import org.eclipse.jem.internal.proxy.common.CommandException;
-import org.eclipse.jem.internal.proxy.common.remote.IOCommandException;
-/**
- * This is the special stream used to buffer and write a lot
- * of bytes to callback into the client.
- *
- * Before writing any bytes to the client, it will see if the
- * client has sent anything back. If it has, this is an indication
- * that that client has requested that the stream be closed. In that
- * case an InterruptedIOException is raised to indicate that
- * the stream will be closed and no more data will be sent.
- */
-public class CallbackOutputStream extends OutputStream {
-
- protected CallbackHandler fHandler;
- protected RemoteVMServerThread fSvr;
- protected byte[] fBuffer;
- protected int fNextByte = 0;
-
- public CallbackOutputStream(CallbackHandler handler, RemoteVMServerThread svr) {
- fHandler = handler;
- fSvr = svr;
-
- Integer bufSize = Integer.getInteger("proxyvm.bufsize"); //$NON-NLS-1$
- if (bufSize == null)
- bufSize = new Integer(5000);
- fBuffer = new byte[bufSize.intValue()];
- }
-
- protected void clearStream() {
- fSvr.returnCallbackHandler(fHandler);
- fSvr = null;
- fHandler = null;
- fBuffer = null;
- }
-
- protected void processException(CommandException e) throws IOException {
- clearStream();
- throw new IOCommandException(e);
- }
-
- public void flush() throws IOException {
- flushBuffer();
- fHandler.out.flush();
- }
-
- protected void flushBuffer() throws IOException {
- if (fHandler == null)
- throw new IOException("Stream closed. No more operations permitted."); //$NON-NLS-1$
- if (fNextByte > 0) {
- try {
- if (fHandler.in.available() > 0) {
- // There was something waiting. This means a cancel has been requested.
- fHandler.in.skip(fHandler.in.available());
- close(false); // Now close the stream. We need to have the close indicator sent so that the remote side, but we don't need to wait because the terminate response has already been sent.
- throw new InterruptedIOException();
- }
- fHandler.writeBytes(fBuffer, fNextByte);
- fNextByte = 0;
- } catch (CommandException e) {
- processException(e);
- }
- }
- }
-
- /**
- * Closes this output stream and releases any system resources
- * associated with this stream. The general contract of <code>close</code>
- * is that it closes the output stream. A closed stream cannot perform
- * output operations and cannot be reopened.
- * <p>
- * Close will send a -1 to the client and set to indicate it is closed.
- *
- * @exception IOException if an I/O error occurs.
- */
- public void close() throws IOException {
- close(true);
- }
-
-
- protected void close(boolean wait) throws IOException {
- if (fHandler != null) {
- try {
- flushBuffer();
- try {
- fHandler.writeBytes(null, -1);
- fHandler.out.flush();
- if (wait) {
- // Wait means wait for the remote side to send the terminated response.
- // A normal close will do this. If the remote side sent a cancel request, then it has already
- // sent the terminated response and it is waiting for us to send the end-of-file command.
-
- fHandler.in.readByte(); // Block and wait until the terminate request. There shouldn't be anything else in the pipeline.
- if (fHandler.in.available() > 0)
- // There was something else waiting. Let's just clear it out to be safe.
- fHandler.in.skip(fHandler.in.available());
- }
- } catch (CommandException e) {
- processException(e);
- }
- } finally {
- clearStream();
- }
- }
- }
-
- public void write(int b) throws IOException {
- fBuffer[fNextByte++] = (byte) b;
- if (fNextByte >= fBuffer.length)
- flushBuffer();
- }
-
- public void write(byte b[], int off, int len) throws IOException {
- if (b == null) {
- throw new NullPointerException();
- } else if ((off < 0) || (off > b.length) || (len < 0) ||
- ((off + len) > b.length) || ((off + len) < 0)) {
- throw new IndexOutOfBoundsException();
- } else if (len == 0) {
- return;
- }
-
- while (len > 0) {
- int move = fBuffer.length-fNextByte;
- if (len < move)
- move = len;
- System.arraycopy(b, off, fBuffer, fNextByte, move);
- len -= move;
- off += move;
- fNextByte += move;
- if (fNextByte >= fBuffer.length)
- flushBuffer();
- }
- }
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/vm_remotevm/org/eclipse/jem/internal/proxy/vm/remote/ClassHelper.java b/plugins/org.eclipse.jem.proxy/vm_remotevm/org/eclipse/jem/internal/proxy/vm/remote/ClassHelper.java
deleted file mode 100644
index d1fbc553d..000000000
--- a/plugins/org.eclipse.jem.proxy/vm_remotevm/org/eclipse/jem/internal/proxy/vm/remote/ClassHelper.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.vm.remote;
-/*
-
-
- */
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-
-/**
- * This class is a helper for Class accessing functions.
- * Its main function is to bypass security. This is because
- * we don't care about security for remote vm. Security is
- * handled by the IDE and compilor over there. We do what
- * we're told.
- *
- * @author richkulp
- */
-public class ClassHelper {
-
- /**
- * Constructor for ClassHelper.
- */
- private ClassHelper() {
- super();
- }
-
- private static final Class[] EMPTY_CLASS_ARRAY = new Class[0];
- private static final Object[] EMPTY_OBJECT_ARRAY = new Object[0];
- public static Object newInstance(Class targetClass) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException, InstantiationException {
- // We want to get the default ctor, which is in the declared list. No need
- // to worry about inheritance because ctors are never virtual.
- Constructor ctor = targetClass.getDeclaredConstructor(EMPTY_CLASS_ARRAY);
- ctor.setAccessible(true);
- return ctor.newInstance(EMPTY_OBJECT_ARRAY);
- }
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/vm_remotevm/org/eclipse/jem/internal/proxy/vm/remote/ConnectionHandler.java b/plugins/org.eclipse.jem.proxy/vm_remotevm/org/eclipse/jem/internal/proxy/vm/remote/ConnectionHandler.java
deleted file mode 100644
index 3fcf3a5f9..000000000
--- a/plugins/org.eclipse.jem.proxy/vm_remotevm/org/eclipse/jem/internal/proxy/vm/remote/ConnectionHandler.java
+++ /dev/null
@@ -1,950 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.vm.remote;
-/*
-
-
- */
-
-
-import java.io.*;
-import java.lang.reflect.Array;
-import java.net.Socket;
-import java.net.SocketException;
-import java.util.*;
-
-import org.eclipse.jem.internal.proxy.common.CommandException;
-import org.eclipse.jem.internal.proxy.common.remote.*;
-import org.eclipse.jem.internal.proxy.initParser.*;
-import org.eclipse.jem.internal.proxy.initParser.tree.NoExpressionValueException;
-
-/**
- * This handles one connection.
- */
-
-public class ConnectionHandler {
-
- protected Socket socket;
- final protected RemoteVMServerThread server;
- final protected Thread connectionThread;
- protected DataInputStream in;
- protected DataOutputStream out;
-
- // Kludge: Bug in Linux 1.3.xxx of JVM. Closing a socket while the socket is being read/accept will not interrupt the
- // wait. Need to timeout to the socket read/accept before the socket close will be noticed. This has been fixed
- // in Linux 1.4. So on Linux 1.3 need to put timeouts in on those sockets that can be separately closed while reading/accepting.
- static boolean LINUX_1_3 = "linux".equalsIgnoreCase(System.getProperty("os.name")) && System.getProperty("java.version","").startsWith("1.3"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
-
-
- static {
- try{
- Class.forName("java.awt.Dialog");
- }
- catch (ExceptionInInitializerError e){}
- catch (LinkageError e){}
- catch (ClassNotFoundException e) {}
-
- try{
- Class.forName("sun.awt.windows.WToolkit");
- }
- catch (ExceptionInInitializerError e){}
- catch (LinkageError e){}
- catch (ClassNotFoundException e) {}
-
- try{
- Class.forName("java.awt.Component");
- }
- catch (ExceptionInInitializerError e){}
- catch (LinkageError e){}
- catch (ClassNotFoundException e) {}
- }
-
- /**
- * This may be running as a callback, in that case there is no connectionThread.
- */
- public ConnectionHandler(Socket sc, RemoteVMServerThread svr, Thread connectionThread) {
- socket = sc;
- server = svr;
- this.connectionThread = connectionThread;
-
- Integer bufSize = Integer.getInteger("proxyvm.bufsize"); //$NON-NLS-1$
- if (bufSize == null)
- bufSize = new Integer(5000);
-
- try {
- out = new DataOutputStream(new BufferedOutputStream(socket.getOutputStream(), bufSize.intValue()));
- in = new DataInputStream(new BufferedInputStream(socket.getInputStream(), bufSize.intValue()));
- } catch (IOException e) {
- }
-
- }
-
- /**
- * Did this construct correctly.
- * This is needed because an exception could be thrown in the ctor and
- * that's not a good thing to do.
- */
- public boolean isConnected() {
- return socket != null;
- }
-
- /**
- * Request the thread to close down.
- */
- public void close() {
- if (socket != null) {
- try {
- Socket s = socket;
- socket = null;
- s.close();
- } catch (Exception e) {
- }
- }
- }
-
- // Map of ID to expression processers that are currently being processed.
- private Map expressionProcessors = new HashMap();
-
- /**
- * Process and loop until told to stop. A callback_done will stop
- * the loop and will return a result. Otherwise null is returned.
- */
- public Object run() throws CommandException {
- Object result = null;
- boolean shutdown = false;
- boolean closeWhenDone = true;
- Commands.ValueObject valueObject = new Commands.ValueObject(); // Working value object so not continually recreated.
- InvokableValueSender valueSender = new InvokableValueSender(); // Working valuesender so not continually recreated.
- try {
- boolean doLoop = true;
-
- /**
- * Note: In the cases below you will see a lot of finally clauses that null variables out.
- * This is because this is a long running loop, and variables declared within blocks are not
- * garbage collected until the method is terminated, so these variables once set would never
- * be GC'd. The nulling at the end of the case makes sure that any of those objects set are
- * now available for garbage collection when necessary.
- */
- while(doLoop && isConnected()) {
- byte cmd = 0;
- try {
- if (LINUX_1_3)
- socket.setSoTimeout(1000); // Linux 1.3 bug, see comment on LINUX_1_3
- cmd = in.readByte();
- if (LINUX_1_3 && isConnected())
- socket.setSoTimeout(0); // Linux 1.3 bug, see comment on LINUX_1_3
- } catch (InterruptedIOException e) {
- continue; // Timeout, try again
- }
- switch (cmd) {
- case Commands.QUIT_CONNECTION:
- doLoop = false;
- break; // Close this connection
-
- case Commands.TERMINATE_SERVER:
- doLoop = false;
- shutdown = true; // Shutdown everything
- break;
-
- case Commands.GET_CLASS:
- String className = in.readUTF();
- Class aClass = null;
- Class superClass = null;
- String superClassName = null;
- boolean added = false;
- try {
- aClass = Class.forName(className); // Turns out using JNI format for array type will work fine.
-
- added = server.getIdentityID(aClass, valueObject);
- boolean isInterface = aClass.isInterface();
- boolean isAbstract = java.lang.reflect.Modifier.isAbstract(aClass.getModifiers());
- superClass = aClass.getSuperclass();
- superClassName = (superClass != null) ? superClass.getName() : ""; //$NON-NLS-1$
- out.writeByte(Commands.GET_CLASS_RETURN);
- out.writeInt(valueObject.objectID);
- out.writeBoolean(isInterface);
- out.writeBoolean(isAbstract);
- out.writeUTF(superClassName);
- out.flush();
- } catch (ClassNotFoundException e) {
- valueObject.set();
- Commands.sendErrorCommand(out, Commands.GET_CLASS_NOT_FOUND, valueObject);
- } catch (ExceptionInInitializerError e) {
- sendException(e.getException(), valueObject, out);
- } catch (LinkageError e) {
- sendException(e, valueObject, out);
- } catch (Throwable e) {
- // Something bad, did we add a class? If we did remove it from the table.
- if (added)
- server.removeObject(server.getObject(valueObject.objectID));
- throw e;
- } finally {
- // clear out for GC to work.
- className = null;
- aClass = null;
- superClass = null;
- superClassName = null;
- valueObject.set();
- }
- break;
-
- case Commands.GET_CLASS_FROM_ID:
- int classID = in.readInt();
- try {
- aClass = (Class) server.getObject(classID);
- boolean isInterface = aClass.isInterface();
- boolean isAbstract = java.lang.reflect.Modifier.isAbstract(aClass.getModifiers());
- superClass = aClass.getSuperclass();
- superClassName = (superClass != null) ? superClass.getName() : ""; //$NON-NLS-1$
- out.writeByte(Commands.GET_CLASS_ID_RETURN);
- out.writeUTF(aClass.getName());
- out.writeBoolean(isInterface);
- out.writeBoolean(isAbstract);
- out.writeUTF(superClassName);
- out.flush();
- } catch (ClassCastException e) {
- valueObject.set();
- Commands.sendErrorCommand(out, Commands.CLASS_CAST_EXCEPTION, valueObject);
- } finally {
- // clear out for GC to work.
- aClass = null;
- superClass = null;
- superClassName = null;
- valueObject.set();
- }
- break;
-
- case Commands.GET_OBJECT_DATA:
- int objectID = in.readInt();
- Object anObject = null;
- try {
- anObject = server.getObject(objectID);
- valueObject.setObjectID(objectID, server.getIdentityID(anObject.getClass()));
- Commands.writeValue(out, valueObject, true);
- } catch (ClassCastException e) {
- valueObject.set();
- Commands.sendErrorCommand(out, Commands.CLASS_CAST_EXCEPTION, valueObject);
- } finally {
- anObject = null; // Clear out for GC to work
- valueObject.set();
- }
- break;
-
- case Commands.RELEASE_OBJECT:
- int id = in.readInt();
- server.removeObject(server.getObject(id));
- break;
-
- case Commands.NEW_INIT_STRING:
- classID = in.readInt(); // ID Of class to do new upon.
- String initString = in.readUTF(); // The init string.
- Object newValue = null;
- Class theClass = null;
- try {
- theClass = (Class) server.getObject(classID);
- if (theClass == null) {
- // The class wasn't found. So imply ClassNotFound exception.
- throw new ClassNotFoundException();
- }
-
- InitializationStringParser parser = null;
- try {
- parser = InitializationStringParser.createParser(initString);
- newValue = parser.evaluate();
- boolean primitive = parser.isPrimitive();
- // If expected class is Void.TYPE, that means don't test the type of the result
- // to verify if correct type, just return what it really is.
- if (theClass != Void.TYPE && primitive != theClass.isPrimitive()) {
- valueObject.set();
- Commands.sendErrorCommand(out, Commands.CLASS_CAST_EXCEPTION, valueObject);
- continue; // Goto next command.
- }
- if (primitive) {
- try {
- // Need to do special tests for compatibility and assignment.
- sendObject(newValue, classID != Commands.VOID_TYPE ? classID : server.getIdentityID(parser.getExpectedType()), valueObject, out, true); // This will make sure it goes out as the correct primitive type
- } catch (ClassCastException e) {
- // The returned type is not of the correct type for what is expected.
- valueObject.set();
- Commands.sendErrorCommand(out, Commands.CLASS_CAST_EXCEPTION, valueObject);
- continue; // Goto next command
- }
- } else {
- if (newValue != null) {
- // Test to see if they are compatible. (Null can be assigned to any object,
- // so that is why it was tested out above).
- // If expected class is Void.TYPE, that means don't test the type of the result
- // to verify if correct type, just return what it really is.
- if (theClass != Void.TYPE && !theClass.isInstance(newValue)) {
- // The returned type is not of the correct type for what is expected.
- valueObject.set();
- Commands.sendErrorCommand(out, Commands.CLASS_CAST_EXCEPTION, valueObject);
- continue; // Goto next command
- }
- }
- sendObject(newValue, NOT_A_PRIMITIVE, valueObject, out, true); // Send out as an object.
- }
- } catch (InitializationStringEvaluationException e) {
- if (e instanceof EvaluationException) {
- // Want to return the real exception.
- sendException(e.getOriginalException(), valueObject, out);
- } else {
- // Couldn't be evaluated, return an error for this.
- setExceptionIntoValue(e.getOriginalException(), valueObject);
- Commands.sendErrorCommand(out, Commands.CANNOT_EVALUATE_STRING, valueObject);
- }
- } finally {
- parser = null; // Clear out for GC to work
- }
- } catch (Throwable e) {
- sendException(e, valueObject, out);
- } finally {
- // Clear out for GC to work
- initString = null;
- theClass = null;
- newValue = null;
- valueObject.set();
- }
- break;
-
- case Commands.INVOKE:
- Object target = null;
- Object[] parms = null;
- Class returnType = null;
- java.lang.reflect.Method aMethod = null;
- try {
- int methodID = in.readInt(); // ID of method to invoke
- aMethod = (java.lang.reflect.Method) server.getObject(methodID); // Method to invoke
- Commands.readValue(in, valueObject);
- target = getInvokableObject(valueObject);
- Commands.readValue(in, valueObject);
- if (valueObject.type == Commands.ARRAY_IDS) {
- // It is an array containing IDs, as it normally would be.
- valueSender.initialize(valueObject);
- Commands.readArray(in, valueObject.anInt, valueSender, valueObject, false);
- parms = (Object[]) valueSender.getArray();
- } else {
- // It is all objects or null, so it should be an Object[] or null. If not, then this is an error.
- parms = (Object[]) valueObject.anObject;
- }
-
- if (!aMethod.isAccessible())
- aMethod.setAccessible(true); // We will allow all to occur. Let access control be handled by IDE and compiler.
- newValue = aMethod.invoke(target, parms);
- returnType = aMethod.getReturnType();
- if (returnType.isPrimitive()) {
- int returnTypeID = server.getIdentityID(returnType);
- // Need to tell sendObject the correct primitive type.
- sendObject(newValue, returnTypeID, valueObject, out, true);
-
- } else {
- sendObject(newValue, NOT_A_PRIMITIVE, valueObject, out, true); // Just send the object back. sendObject knows how to iterpret the type
- }
- } catch (CommandException e) {
- throw e; // Throw it again. These we don't want to come up as an exception proxy. These should end the thread.
- } catch (java.lang.reflect.InvocationTargetException e) {
- // This is a wrappered exception. Return the wrappered one so it looks like
- // it was the real one. (Sometimes the method being invoked is on a java.lang.reflect.Constructor.newInstance,
- // which in turn is an InvocationTargetException, so we will go until we don't have an InvocationTargetException.
- Throwable t = e;
- do {
- t = ((java.lang.reflect.InvocationTargetException) t).getTargetException();
- } while (t instanceof java.lang.reflect.InvocationTargetException);
- sendException(t, valueObject, out);
- } catch (Throwable e) {
- sendException(e, valueObject, out); // Turn it into a exception proxy on the client.
- } finally {
- // Clear out for GC to work
- valueObject.set();
- parms = null;
- target = null;
- aMethod = null;
- returnType = null;
- newValue = null;
- valueSender.clear();
- }
- break;
-
- case Commands.INVOKE_WITH_METHOD_PASSED:
- aClass = null;
- String methodName = null;
- Class[] parmTypes = null;
- target = null;
- parms = null;
- returnType = null;
- aMethod = null;
-
- try {
- Commands.readValue(in, valueObject);
- aClass = (Class) getInvokableObject(valueObject); // The class that has the method.
- methodName = in.readUTF();
- Commands.readValue(in, valueObject);
- if (valueObject.type == Commands.ARRAY_IDS) {
- // It is an array containing IDs, as it normally would be.
- valueSender.initialize(valueObject);
- Commands.readArray(in, valueObject.anInt, valueSender, valueObject, false);
- parmTypes = (Class[]) valueSender.getArray();
- } else {
- // It null, so it should be an null. If not, then this is an error.
- parmTypes = null;
- }
- aMethod = aClass.getMethod(methodName, parmTypes);
-
- // Now we get the info for the invocation of the method and execute it.
- Commands.readValue(in, valueObject);
- target = getInvokableObject(valueObject);
- Commands.readValue(in, valueObject);
- if (valueObject.type == Commands.ARRAY_IDS) {
- // It is an array containing IDs, as it normally would be.
- valueSender.initialize(valueObject);
- Commands.readArray(in, valueObject.anInt, valueSender, valueObject, false);
- parms = (Object[]) valueSender.getArray();
- } else {
- // It is all objects or null, so it should be an Object[] or null. If not, then this is an error.
- parms = (Object[]) valueObject.anObject;
- }
-
- if (!aMethod.isAccessible())
- aMethod.setAccessible(true); // We will allow all to occur. Let access control be handled by IDE and compiler.
- newValue = aMethod.invoke(target, parms);
- returnType = aMethod.getReturnType();
- if (returnType.isPrimitive()) {
- int returnTypeID = server.getIdentityID(returnType);
- // Need to tell sendObject the correct primitive type.
- sendObject(newValue, returnTypeID, valueObject, out, true);
-
- } else {
- sendObject(newValue, NOT_A_PRIMITIVE, valueObject, out, true); // Just send the object back. sendObject knows how to iterpret the type
- }
- } catch (CommandException e) {
- throw e; // Throw it again. These we don't want to come up as an exception proxy. These should end the thread.
- } catch (java.lang.reflect.InvocationTargetException e) {
- // This is a wrappered exception. Return the wrappered one so it looks like
- // it was the real one. (Sometimes the method being invoked is on a java.lang.reflect.Constructor.newInstance,
- // which in turn is an InvocationTargetException, so we will go until we don't have an InvocationTargetException.
- Throwable t = e;
- do {
- t = ((java.lang.reflect.InvocationTargetException) t).getTargetException();
- } while (t instanceof java.lang.reflect.InvocationTargetException);
- sendException(t, valueObject, out);
-
- } catch (Throwable e) {
- sendException(e, valueObject, out); // Turn it into a exception proxy on the client.
- } finally {
- aClass = null;
- methodName = null;
- parmTypes = null;
- // Clear out for GC to work
- valueObject.set();
- parms = null;
- target = null;
- aMethod = null;
- returnType = null;
- newValue = null;
- valueSender.clear();
- }
- break;
-
- case Commands.GET_ARRAY_CONTENTS:
- try {
- target = server.getObject(in.readInt()); // Array to get the ids for.
- valueObject.setArrayIDS(new ArrayContentsRetriever(target), Array.getLength(target), Commands.OBJECT_CLASS);
- Commands.writeValue(out, valueObject, true); // Write it back as a value command.
- } catch (CommandException e) {
- throw e; // Throw it again. These we don't want to come up as an exception proxy. These should end the thread.
- } catch (Throwable e) {
- sendException(e, valueObject, out); // Turn it into a exception proxy on the client.
- } finally {
- target = null;
- valueObject.set();
- }
- break;
-
- case Commands.CALLBACK_DONE:
- try {
- if (connectionThread != null) {
- valueObject.set();
- Commands.sendErrorCommand(out, Commands.UNKNOWN_COMMAND_SENT, valueObject);
- } else {
- try {
- Commands.readBackValue(in, valueObject, Commands.NO_TYPE_CHECK);
- if (valueObject.type == Commands.ARRAY_IDS) {
- // It is an array containing IDs, as it normally would be.
- valueSender.initialize(valueObject);
- Commands.readArray(in, valueObject.anInt, valueSender, valueObject, false);
- result = valueSender.getArray();
- } else {
- result = getInvokableObject(valueObject);
- }
- doLoop = false; // We need to terminate and return result
- closeWhenDone = false; // Don't close, we will continue.
- } catch (CommandErrorException e) {
- // There was an command error on the other side. This means
- // connection still good, but don't continue the callback processing.
- doLoop = false; // We need to terminate and return result
- closeWhenDone = false; // Don't close, we will continue.
- throw e; // Let it go on out.
- }
- }
- } finally {
- valueObject.set();
- valueSender.clear();
- }
- break;
-
- case Commands.ERROR:
- try {
- // Got an error command. Don't know what to do but read the
- // value and simply print it out.
- Commands.readValue(in, valueObject);
- result = getInvokableObject(valueObject);
- System.out.println("Error sent to server: Result=" + result); //$NON-NLS-1$
- } finally {
- valueObject.set();
- }
- break;
-
- case Commands.EXPRESSION_TREE_COMMAND:
- try {
- processExpressionCommand(valueObject, valueSender);
- } finally {
- valueObject.set();
- valueSender.clear();
- }
- break;
-
- default:
- // Unknown command. We don't know how long it is, so we need to shut the connection down.
- System.err.println("Error: Invalid cmd send to server: Cmd=" + cmd); //$NON-NLS-1$
- doLoop = false;
- closeWhenDone = true;
- break;
- }
- }
- } catch (EOFException e) {
- // This is ok. It means that the connection on the other side was terminated.
- // So just accept this and go down.
- } catch (CommandException e) {
- throw e;
- } catch (SocketException e) {
- if (socket != null)
- throw new UnexpectedExceptionCommandException(false, e); // socket null means a valid close request
- } catch (Throwable e) {
- e.printStackTrace();
- } finally {
- if (closeWhenDone) {
- try {
- for (Iterator itr = expressionProcessors.values().iterator(); itr.hasNext();) {
- ExpressionProcesserController exp = (ExpressionProcesserController) itr.next();
- exp.close();
- }
- } finally {
- expressionProcessors.clear();
- }
-
- if (in != null)
- try {
- in.close();
- } catch (Exception e) {
- }
- in = null;
- if (out != null)
- try {
- out.close();
- } catch (Exception e) {
- }
- out = null;
- close();
- }
- }
-
- if (closeWhenDone && connectionThread != null)
- server.removeConnectionThread(connectionThread);
- if (shutdown)
- server.requestShutdown();
-
- return result;
- }
-
- // A retriever is what handles the array get contents.
- private class ArrayContentsRetriever implements Commands.ValueRetrieve {
- int index=0;
- Object array;
- int length;
- int componentType;
- Commands.ValueObject worker = new Commands.ValueObject();
-
-
- public ArrayContentsRetriever(Object anArray) {
- array = anArray;
- length = Array.getLength(anArray);
- if (anArray.getClass().getComponentType().isPrimitive()) {
- componentType = server.getIdentityID(anArray.getClass().getComponentType());
- } else
- componentType = NOT_A_PRIMITIVE;
- }
-
- public Commands.ValueObject nextValue() {
- fillInValue(Array.get(array, index++), componentType, worker);
- return worker;
- }
- };
-
-
- private void processExpressionCommand(Commands.ValueObject valueObject, InvokableValueSender valueSender) throws IOException, CommandException {
- Integer expressionID = new Integer(in.readInt());
- byte cmdType = in.readByte();
- ExpressionProcesserController exp = null;
- switch (cmdType) {
- case ExpressionCommands.START_EXPRESSION_TREE_PROCESSING:
- byte trace = in.readByte();
- if (trace == ExpressionCommands.TRACE_DEFAULT)
- exp = new ExpressionProcesserController(server, this);
- else
- exp = new ExpressionProcesserController(server, this, trace == ExpressionCommands.TRACE_ON);
- expressionProcessors.put(expressionID, exp);
- break;
- case ExpressionCommands.TRANSFER_EXPRESSION_REQUEST:
- exp = (ExpressionProcesserController) expressionProcessors.remove(expressionID);
- sendObject(exp, NOT_A_PRIMITIVE, valueObject, out, true);
- break;
- case ExpressionCommands.RESUME_EXPRESSION_REQUEST:
- Commands.readValue(in, valueObject);
- exp = (ExpressionProcesserController) getInvokableObject(valueObject);
- expressionProcessors.put(expressionID, exp);
- break;
- case ExpressionCommands.PUSH_EXPRESSION:
- exp = (ExpressionProcesserController) expressionProcessors.get(expressionID);
- exp.process(in);
- break;
- case ExpressionCommands.SYNC_REQUEST:
- boolean haveProxies = in.readBoolean(); // See if we expression proxy ids that need to be resolved
- if (haveProxies) {
- Commands.readValue(in, valueObject);
- valueSender.initialize(valueObject);
- Commands.readArray(in, valueObject.anInt, valueSender, valueObject, false);
- }
-
- exp = (ExpressionProcesserController) expressionProcessors.get(expressionID);
- if (haveProxies)
- sendExpressionProxyResolutions(valueObject, (int[]) valueSender.getArray(), exp);
- if (exp.noErrors()) {
- valueObject.set(true); // Mark that all is good.
- Commands.writeValue(out, valueObject, true, true);
- } else {
- processExpressionError(exp, valueObject);
- }
- break;
- case ExpressionCommands.PULL_VALUE_REQUEST:
- haveProxies = in.readBoolean(); // See if we expression proxy ids that need to be resolved
- if (haveProxies) {
- Commands.readValue(in, valueObject);
- valueSender.initialize(valueObject);
- Commands.readArray(in, valueObject.anInt, valueSender, valueObject, false);
- }
-
- exp = (ExpressionProcesserController) expressionProcessors.get(expressionID);
- if (haveProxies)
- sendExpressionProxyResolutions(valueObject, (int[]) valueSender.getArray(), exp);
- if (exp.noErrors()) {
- try {
- Object[] pulledValue = exp.pullValue();
- // Send back the command code for pull value. Don't flush. We will flush when all done.
- if (((Class) pulledValue[1]).isPrimitive()) {
- int returnTypeID = server.getIdentityID(pulledValue[1]);
- // Need to tell sendObject the correct primitive type.
- sendObject(pulledValue[0], returnTypeID, valueObject, out, true, true);
-
- } else {
- sendObject(pulledValue[0], NOT_A_PRIMITIVE, valueObject, out, true, true); // Just send the object back. sendObject knows how to iterpret the type
- }
- } catch (NoExpressionValueException e) {
- sendNoValueErrorCommand(exp, valueObject);
- }
- } else
- processExpressionError(exp, valueObject);
- break;
- case ExpressionCommands.END_EXPRESSION_TREE_PROCESSING:
- exp = (ExpressionProcesserController) expressionProcessors.remove(expressionID);
- exp.close();
- break;
- }
- }
-
- /*
- * @param is
- * @param exp
- *
- * @since 1.1.0
- */
- private void sendExpressionProxyResolutions(Commands.ValueObject valueObject, final int[] proxyIDs, final ExpressionProcesserController exp) throws CommandException {
- class ExpressionProxyRetriever implements Commands.ValueRetrieve {
- int index = 0;
- Object[] proxyResolution = new Object[2];
- Commands.ValueObject worker = new Commands.ValueObject();
-
- public Commands.ValueObject nextValue() {
- int proxyID = proxyIDs[index++];
- if (exp.pullExpressionProxyValue(proxyID, proxyResolution)) {
- if (proxyResolution[1] != Void.TYPE) {
- if (((Class) proxyResolution[1]).isPrimitive()) {
- int returnTypeID = server.getIdentityID(proxyResolution[1]);
- // Need to tell worker the correct primitive type.
- fillInValue(proxyResolution[0], returnTypeID, worker);
- } else {
- fillInValue(proxyResolution[0], NOT_A_PRIMITIVE, worker);
- }
- } else
- worker.setFlag(ExpressionCommands.EXPRESSIONPROXY_VOIDTYPE); // It was resolved, but to not set due to void type of expression.
- } else
- worker.setFlag(ExpressionCommands.EXPRESSIONPROXY_NOTRESOLVED); // It wasn't resolved.
-
- return worker;
- }
- };
-
- valueObject.setArrayIDS(new ExpressionProxyRetriever(), proxyIDs.length, Commands.OBJECT_CLASS);
- Commands.writeValue(out, valueObject, true, false); // Write it back as a value command.
-
- }
-
- private void processExpressionError(ExpressionProcesserController exp, Commands.ValueObject valueObject) throws CommandException {
- if (exp.isNoExpressionValue()) {
- sendNoValueErrorCommand(exp, valueObject);
- } else
- sendException(exp.getErrorThrowable(), valueObject, out);
- }
-
- /*
- * @param exp
- * @param valueObject
- * @throws CommandException
- *
- * @since 1.1.0
- */
- private void sendNoValueErrorCommand(ExpressionProcesserController exp, Commands.ValueObject valueObject) throws CommandException {
- setExceptionIntoValue(exp.getErrorThrowable(), valueObject);
- Commands.sendErrorCommand(out, ExpressionCommands.EXPRESSION_NOEXPRESSIONVALUE_EXCEPTION, valueObject);
- }
-
-protected static final int NOT_A_PRIMITIVE = Commands.NOT_AN_ID;
-protected static final int SEND_AS_IS = -2; // This means sends as an object not as an id.
-
-public static final int CLASS_ADDED = 1;
-public static final int OBJECT_ADDED = 2;
-public int fillInValue(Object object, int primitiveTypeID, Commands.ValueObject valueObject) {
- int added = 0;
- if (object == null) {
- valueObject.set();
- } else {
- int classID = 0;
- if (primitiveTypeID != NOT_A_PRIMITIVE && primitiveTypeID != SEND_AS_IS) {
- classID = primitiveTypeID; // The object is really supposed to be a primitive of this type
- switch (classID) {
- case Commands.BOOLEAN_TYPE:
- valueObject.set(((Boolean) object).booleanValue());
- break;
- case Commands.INTEGER_TYPE:
- if (object instanceof Character)
- valueObject.set((int) ((Character) object).charValue()); // Because char can be widened to an int
- else
- valueObject.set(((Number) object).intValue());
- break;
- case Commands.BYTE_TYPE:
- valueObject.set(((Number) object).byteValue());
- break;
- case Commands.CHARACTER_TYPE:
- valueObject.set(((Character) object).charValue());
- break;
- case Commands.DOUBLE_TYPE:
- if (object instanceof Character)
- valueObject.set((double) ((Character) object).charValue()); // Because char can be widened to a double
- else
- valueObject.set(((Number) object).doubleValue());
- break;
- case Commands.FLOAT_TYPE:
- if (object instanceof Character)
- valueObject.set((float) ((Character) object).charValue()); // Because char can be widened to a float
- else
- valueObject.set(((Number) object).floatValue());
- break;
- case Commands.SHORT_TYPE:
- valueObject.set(((Number) object).shortValue());
- break;
- case Commands.LONG_TYPE:
- if (object instanceof Character)
- valueObject.set((long) ((Character) object).charValue()); // Because char can be widened to a long
- else
- valueObject.set(((Number) object).longValue());
- break;
- }
- } else {
- // It's not a primitive.
- boolean addObject = false, addClass = false;
- Class objClass = object.getClass();
- classID = server.getIdentityID(objClass);
- if (classID == RemoteVMServerThread.ID_NOT_FOUND) {
- Commands.ValueObject classValue = new Commands.ValueObject();
- addClass = server.getIdentityID(objClass, classValue);
- if (addClass)
- added |= CLASS_ADDED;
- classID = classValue.objectID;
- }
-
- switch (classID) {
- case Commands.BYTE_CLASS:
- valueObject.set((Byte) object);
- break;
- case Commands.CHARACTER_CLASS:
- valueObject.set((Character) object);
- break;
- case Commands.DOUBLE_CLASS:
- valueObject.set((Double) object);
- break;
- case Commands.FLOAT_CLASS:
- valueObject.set((Float) object);
- break;
- case Commands.INTEGER_CLASS:
- valueObject.set((Integer) object);
- break;
- case Commands.LONG_CLASS:
- valueObject.set((Long) object);
- break;
- case Commands.SHORT_CLASS:
- valueObject.set((Short) object);
- break;
- case Commands.BOOLEAN_CLASS:
- valueObject.set((Boolean) object);
- break;
- case Commands.STRING_CLASS:
- valueObject.set((String) object);
- break;
- case Commands.BIG_DECIMAL_CLASS:
- valueObject.set(object, Commands.BIG_DECIMAL_CLASS);
- break;
- case Commands.BIG_INTEGER_CLASS:
- valueObject.set(object, Commands.BIG_INTEGER_CLASS);
- break;
- default:
- if (primitiveTypeID != SEND_AS_IS) {
- addObject = server.getIdentityID(object, valueObject);
- if (addObject) {
- added |= OBJECT_ADDED;
- valueObject.setObjectID(valueObject.objectID, classID);
- } else
- valueObject.setObjectID(valueObject.objectID);
- } else
- valueObject.set(object, classID);
- break;
- }
- }
- }
-
- return added;
-}
-
-public void sendObject(Object object, int primitiveTypeID, Commands.ValueObject valueObject, DataOutputStream out, boolean writeAsCommand) throws CommandException {
- sendObject(object, primitiveTypeID, valueObject, out, writeAsCommand, writeAsCommand);
-}
-public void sendObject(Object object, int primitiveTypeID, Commands.ValueObject valueObject, DataOutputStream out, boolean writeAsCommand, boolean flush) throws CommandException {
- int added = fillInValue(object, primitiveTypeID, valueObject);
- boolean sent = false;
- try {
- Commands.writeValue(out, valueObject, writeAsCommand, flush); // Write it back as a value command.
- sent = true;
- } finally {
- if (!sent) {
- // Ending due to some problem, so clean up any added objects from the id table.
- if ((added & OBJECT_ADDED) != 0)
- server.removeObject(valueObject.objectID);
- if ((added & CLASS_ADDED) != 0)
- server.removeObject(valueObject.classID);
- }
- }
-}
-
-
- public void sendException(Throwable e, Commands.ValueObject value, DataOutputStream out) throws CommandException {
- // Exception ocurred, return a value command with the exception within it.
- setExceptionIntoValue(e, value);
- Commands.sendErrorCommand(out, Commands.THROWABLE_SENT, value);
- }
-
- public void setExceptionIntoValue(Throwable e, Commands.ValueObject value) {
- server.getIdentityID(e, value); // It should always create it so we don't need to know.
- int eID = value.objectID;
- Class eClass = e.getClass();
- server.getIdentityID(eClass, value);
- int eClassID = value.objectID;
- value.setException(eID, eClassID);
- }
-
- /**
- * From the valueObject, get an Object that is invokable (i.e. can be the target of an invoke, or one of its parms).
- * If it is an array type, the a ValueSender is returned. The invoker needs to then cast this
- * to a ValueSender and call the readArray routine.
- */
- public Object getInvokableObject(final Commands.ValueObject value) {
- switch (value.type) {
- case Commands.NEW_OBJECT_ID:
- case Commands.OBJECT_ID:
- // These need to have access to the server to get the real object
- return server.getObject(value.objectID);
- default:
- // These have all the info needed within the value object itself, so ask it.
- return value.getAsObject();
- }
- }
-
- // Helper class for getting an array.
- private class InvokableValueSender implements Commands.ValueSender {
- int index = 0;
- Object array;
-
- public InvokableValueSender() {
- }
-
- public InvokableValueSender(Commands.ValueObject arrayHeader) {
- initialize(arrayHeader);
- }
-
- public void initialize(Commands.ValueObject arrayHeader) {
- index = 0;
- Class arrayType = (Class) server.getObject(arrayHeader.classID);
- array = java.lang.reflect.Array.newInstance(arrayType, arrayHeader.anInt);
- }
-
- public void clear() {
- array = null;
- index = 0;
- }
-
- public Object getArray() {
- return array;
- }
-
- // A new value is being sent to the array
- public void sendValue(Commands.ValueObject value) {
- java.lang.reflect.Array.set(array, index++, getInvokableObject(value)); // add it to the array
- }
-
- // The next entry is an array too!
- public Commands.ValueSender nestedArray(Commands.ValueObject arrayHeader) {
- InvokableValueSender sender = new InvokableValueSender(arrayHeader);
- // Take the newly created array and put it into the current array.
- java.lang.reflect.Array.set(array, index++, sender.getArray());
- return sender;
- }
- }
-
-}
-
-
diff --git a/plugins/org.eclipse.jem.proxy/vm_remotevm/org/eclipse/jem/internal/proxy/vm/remote/ConnectionThread.java b/plugins/org.eclipse.jem.proxy/vm_remotevm/org/eclipse/jem/internal/proxy/vm/remote/ConnectionThread.java
deleted file mode 100644
index 723275392..000000000
--- a/plugins/org.eclipse.jem.proxy/vm_remotevm/org/eclipse/jem/internal/proxy/vm/remote/ConnectionThread.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.vm.remote;
-/*
-
-
- */
-
-
-import java.net.Socket;
-
-import org.eclipse.jem.internal.proxy.common.CommandException;
-/**
- * This is a thread to handle one connection.
- */
-
-public class ConnectionThread extends Thread {
-
- final protected ConnectionHandler connectionHandler;
-
- public ConnectionThread(Socket sc, RemoteVMServerThread svr, String name) {
- super(name);
-
- connectionHandler = new ConnectionHandler(sc, svr, this);
- }
-
- /**
- * Request the thread to close down.
- */
- public void close() {
- try {
- connectionHandler.close();
- } catch (Exception e) {
- }
- }
-
- public void run() {
- try {
- connectionHandler.run();
- } catch (CommandException e) {
- e.printStackTrace();
- }
- }
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/vm_remotevm/org/eclipse/jem/internal/proxy/vm/remote/ExpressionProcesserController.java b/plugins/org.eclipse.jem.proxy/vm_remotevm/org/eclipse/jem/internal/proxy/vm/remote/ExpressionProcesserController.java
deleted file mode 100644
index ce48b4e94..000000000
--- a/plugins/org.eclipse.jem.proxy/vm_remotevm/org/eclipse/jem/internal/proxy/vm/remote/ExpressionProcesserController.java
+++ /dev/null
@@ -1,809 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 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.jem.internal.proxy.vm.remote;
-
-import java.io.DataInputStream;
-import java.io.IOException;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.jem.internal.proxy.common.*;
-import org.eclipse.jem.internal.proxy.common.remote.Commands;
-import org.eclipse.jem.internal.proxy.common.remote.ExpressionCommands;
-import org.eclipse.jem.internal.proxy.initParser.tree.*;
-
-
-/**
- * This processes the commands for expression processing and sends them over
- * to the common expression processer.
- *
- * This will be instantiated on the start of an expression. And then
- * each expression request from the IDE will be sent into here. The
- * reason this guy doesn't hold onto the connection and process the
- * entire expression is because we need to return to the connection
- * handler to keep the connection live (there is timeouts and stuff
- * in there that we don't want to duplicate here).
- * <p>
- * If there are any expression processing errors (versus hard io errors) we
- * will save up the error but don't do any more processing other than to make
- * sure we read the complete subcommand. This is so that the inputstream is left
- * in a valid state without standed data.
- * <p>
- * The at the sync point (either get value or sync subcommand) we will send back
- * the error.
- *
- * @since 1.0.0
- */
-public class ExpressionProcesserController {
-
-
- protected final RemoteVMServerThread server;
- protected final ConnectionHandler connHandler;
- protected final ExpressionProcesser exp;
- protected Commands.ValueObject workerValue = new Commands.ValueObject(); // A worker value object so we don't need to keep creating them and releasing them.
- private ClassLoader classLoader;
-
- /**
- * Create with a default expression processer and use default flag for trace.
- * @param server
- *
- * @since 1.0.0
- */
- public ExpressionProcesserController(RemoteVMServerThread server, ConnectionHandler connHandler) {
- this(server, connHandler, new ExpressionProcesser(Boolean.getBoolean(ExpressionCommands.EXPRESSIONTRACE), Long.getLong(ExpressionCommands.EXPRESSIONTRACE_TIMER_THRESHOLD, -1L).longValue()));
- }
-
- /**
- * Construct with a default expression processer.
- * @param server
- * @param connHandler
- * @param trace
- *
- * @since 1.1.0
- */
- public ExpressionProcesserController(RemoteVMServerThread server, ConnectionHandler connHandler, boolean trace) {
- this(server, connHandler, new ExpressionProcesser(trace, Long.getLong(ExpressionCommands.EXPRESSIONTRACE_TIMER_THRESHOLD, -1L).longValue()));
- }
-
- /**
- * Create from a subclass with a given expression processer.
- *
- * @param server
- * @param exp
- *
- * @since 1.0.0
- */
- protected ExpressionProcesserController(RemoteVMServerThread server, ConnectionHandler connHandler, ExpressionProcesser exp) {
- this.server = server;
- this.connHandler = connHandler;
- this.exp = exp;
- }
-
- /**
- * Set the class loader to use for finding classes. If never set, or if <code>null</code>, then
- * <code>Class.forName</code> will be used.
- *
- * @param classLoader
- *
- * @since 1.0.0
- */
- public void setClassLoader(ClassLoader classLoader) {
- this.classLoader = classLoader;
- }
-
- /*
- * Array of primitive type names. Used to look up primtive types in primitive types array.
- *
- * @since 1.0.0
- */
- private static final List PRIMITIVE_NAMES = Arrays.asList(new String[] {"byte", "char", "short", "int", "long", "float", "double"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$
- private static final Class[] PRIMITIVE_TYPES = new Class[] {Byte.TYPE, Character.TYPE, Short.TYPE, Integer.TYPE, Long.TYPE, Float.TYPE, Double.TYPE};
- /**
- * Load the class given the name. If not found, return null.
- *
- * @param className
- * @return
- *
- * @since 1.0.0
- */
- protected Class loadClass(String className) throws ClassNotFoundException {
- if (className == null)
- return null;
- else if (className.endsWith("[]")) { //$NON-NLS-1$
- // We have an array request instead. This is trickier.
- return loadClass(MapTypes.getJNIFormatName(className));
- } else {
- int primIndex = PRIMITIVE_NAMES.indexOf(className);
- if (primIndex >= 0)
- return PRIMITIVE_TYPES[primIndex];
- else if (classLoader == null) {
- return Class.forName(className);
- } else {
- return classLoader.loadClass(className);
- }
- }
- }
-
- /**
- * Now process the input stream. If either throws occurs, this is a hard error and we must terminate
- * the entire connection. The input stream is in an unknown state.
- *
- * @param in The input stream to get the data for the current sub-command.
- *
- * @throws CommandException
- * @throws IOException
- * @since 1.0.0
- */
- public void process(DataInputStream in) throws CommandException, IOException {
- // In the following subcommand processing, we always read the entire subcommand from the stream.
- // This is so that any errors during processing will not mess up the stream with unread data.
- //
- // Then we check if an error has occurred in the past. If it has, we simply break. This is because
- // once an error occurred we don't want to continue wasting time evaluating, however we need to make
- // sure that the stream is read completely so that we don't have a corrupted input stream. That way
- // when all is done we can return the error and still have a valid connection socket.
- byte subcommand = in.readByte();
- try {
- switch (subcommand) {
- case InternalExpressionTypes.PUSH_TO_PROXY_EXPRESSION_VALUE:
- // Getting a proxy push. The value is sent as valueObject, so use that to read it in.
- Commands.readValue(in, workerValue);
- Object value = connHandler.getInvokableObject(workerValue);
- if (value == null)
- exp.pushExpression(null, MethodHelper.NULL_TYPE);
- else if (workerValue.isPrimitive())
- exp.pushExpression(value, workerValue.getPrimitiveType());
- else
- exp.pushExpression(value, value.getClass());
- break;
-
- case InternalExpressionTypes.CAST_EXPRESSION_VALUE:
- // Get a cast request. The type is sent as valueObject.
- Commands.readValue(in, workerValue);
- try {
- Class classValue = getBeanTypeValue(workerValue);
- exp.pushCast(classValue);
- } catch (FailedProxyException e) {
- exp.processException(e.getCause()); // Let the processor know we have a stopping error.
- }
- break;
-
- case InternalExpressionTypes.INSTANCEOF_EXPRESSION_VALUE:
- // Get a instanceof request. The type is sent as valueObject.
- Commands.readValue(in, workerValue);
- try {
- Class classValue = getBeanTypeValue(workerValue);
- exp.pushInstanceof(classValue);
- } catch (FailedProxyException e) {
- exp.processException(e.getCause()); // Let the processor know we have a stopping error.
- }
- break;
-
- case InternalExpressionTypes.INFIX_EXPRESSION_VALUE:
- // Get an infix request. The operator and operand type are sent as bytes.
- byte infix_operator = in.readByte();
- byte infix_operandType = in.readByte();
- exp.pushInfix(InfixOperator.get(infix_operator), InternalInfixOperandType.get(infix_operandType));
- break;
-
- case InternalExpressionTypes.PREFIX_EXPRESSION_VALUE:
- // Get a prefix request. The operator is sent as byte.
- byte prefix_operandType = in.readByte();
- exp.pushPrefix(PrefixOperator.get(prefix_operandType));
- break;
-
- case InternalExpressionTypes.ARRAY_ACCESS_EXPRESSION_VALUE:
- // Get an array access request. The index cound is sent as int.
- int arrayAccess_Indexcount = in.readInt();
- exp.pushArrayAccess(arrayAccess_Indexcount);
- break;
-
- case InternalExpressionTypes.ARRAY_CREATION_EXPRESSION_VALUE:
- // Get an array creation request. The type is sent as valueObject, followed by int dimension count.
- Commands.readValue(in, workerValue);
- int arrayCreation_dimCount = in.readInt();
- try {
- Class classValue = getBeanTypeValue(workerValue);
- exp.pushArrayCreation(classValue, arrayCreation_dimCount);
- } catch (FailedProxyException e) {
- exp.processException(e.getCause()); // Let the processor know we have a stopping error.
- }
- break;
-
- case InternalExpressionTypes.ARRAY_INITIALIZER_EXPRESSION_VALUE:
- // Get an array initializer request. The type is sent as valueObject, followed by int expression count.
- Commands.readValue(in, workerValue);
- int stripCount = in.readInt();
- int arrayInitializer_expressionCount = in.readInt();
- try {
- Class classValue = getBeanTypeValue(workerValue);
- exp.pushArrayInitializer(classValue, stripCount, arrayInitializer_expressionCount);
- } catch (FailedProxyException e) {
- exp.processException(e.getCause()); // Let the processor know we have a stopping error.
- }
- break;
-
- case InternalExpressionTypes.CLASS_INSTANCE_CREATION_EXPRESSION_VALUE:
- // Get a class instance creation request. The type is sent as valueObject, followed by int argument count.
- Commands.readValue(in, workerValue);
- int newInstance_argCount = in.readInt();
- try {
- Class classValue = getBeanTypeValue(workerValue);
- exp.pushClassInstanceCreation(classValue, newInstance_argCount);
- } catch (FailedProxyException e) {
- exp.processException(e.getCause()); // Let the processor know we have a stopping error.
- }
- break;
-
- case InternalExpressionTypes.TYPERECEIVER_EXPRESSION_VALUE:
- // Get a type receiver request. The type is sent as valueObject.
- Commands.readValue(in, workerValue);
- try {
- Class classValue = getBeanTypeValue(workerValue);
- exp.pushExpression(classValue, classValue);
- } catch (FailedProxyException e) {
- exp.processException(e.getCause()); // Let the processor know we have a stopping error.
- }
- break;
-
- case InternalExpressionTypes.FIELD_ACCESS_EXPRESSION_VALUE:
- // Get a field access request. Command.ValueObject, followed by hasReceiver as boolean.
- Commands.readValue(in, workerValue);
- boolean has_fieldAccess_receiver = in.readBoolean();
- try {
- Object fieldAccess = getFieldValue(workerValue);
- exp.pushFieldAccess(fieldAccess, workerValue.getType() == Commands.STRING, has_fieldAccess_receiver);
- } catch (ClassCastException e) {
- exp.processException(e); // Let the processor know we have a stopping error.
- } catch (FailedProxyException e) {
- exp.processException(e.getCause()); // Let the processor know we have a stopping error.
- }
- break;
-
- case InternalExpressionTypes.METHOD_EXPRESSION_VALUE:
- // Get a method invocation request. Sent as Commands.ValueObject, followed by hasReceiver as boolean., and argCount as int.
- Commands.readValue(in, workerValue);
- boolean has_method_receiver = in.readBoolean();
- int method_argCount = in.readInt();
- try {
- Object method = getMethodValue(workerValue);
- exp.pushMethodInvocation(method, workerValue.getType() == Commands.STRING, has_method_receiver, method_argCount);
- } catch (FailedProxyException e) {
- exp.processException(e.getCause()); // Let the processor know we have a stopping error.
- }
- break;
-
- case InternalExpressionTypes.CONDITIONAL_EXPRESSION_VALUE:
- // Get a conditional expression request. The expression type (ie. condition/true/false) is sent as a byte
- exp.pushConditional(InternalConditionalOperandType.get(in.readByte()));
- break;
-
- case InternalExpressionTypes.ASSIGNMENT_PROXY_EXPRESSION_VALUE:
- // Get an assignment expression request. The proxy id is sent as an int.
- int proxyid = in.readInt();
- exp.pushAssignment(new RemoteExpressionProxy(proxyid));
- break;
-
- case InternalExpressionTypes.ASSIGNMENT_EXPRESSION_VALUE:
- // Get an assignment expression request. Nothing else to read from stream.
- exp.pushAssignment();
- break;
-
- case InternalExpressionTypes.PUSH_TO_EXPRESSION_PROXY_EXPRESSION_VALUE:
- // Get a push expression proxy expression. The proxy id is sent as an int.
- // First test if a possible FailedExpressionProxy because we could of been pushing
- // a failed reflection proxy.
- proxyid = in.readInt();
- try {
- exp.getExpressionProxy(proxyid, new Object[] {null, null});
- } catch (NoExpressionValueException e1) {
- if (e1.getProxy() != null) {
- FailedRemoteExpressionProxy failure = (FailedRemoteExpressionProxy) e1.getProxy();
- exp.processException((Throwable) failure.getValue());
- break; // Don't go on, we processed it. A standard no expression value should be passed on and let following code handle it.
- }
- }
- exp.pushExpressionProxy(proxyid);
- break;
-
- case InternalExpressionTypes.BLOCK_BEGIN_EXPRESSION_VALUE:
- // Get a begin block proxy expression. The block id is sent as an int.
- exp.pushBlockBegin(in.readInt());
- break;
-
- case InternalExpressionTypes.BLOCK_BREAK_EXPRESSION_VALUE:
- // Get a break block proxy expression. The block id is sent as an int.
- exp.pushBlockBreak(in.readInt());
- break;
-
- case InternalExpressionTypes.BLOCK_END_EXPRESSION_VALUE:
- // Get a end block proxy expression. The block id is sent as an int.
- exp.pushBlockEnd(in.readInt());
- break;
-
- case InternalExpressionTypes.TRY_BEGIN_EXPRESSION_VALUE:
- // Get a try begin proxy expression. The try id is sent as an int.
- exp.pushTryBegin(in.readInt());
- break;
-
- case InternalExpressionTypes.TRY_CATCH_EXPRESSION_VALUE:
- int tryNumber = in.readInt();
- Commands.readValue(in, workerValue);
- proxyid = in.readInt();
- try {
- Class classValue = getBeanTypeValue(workerValue);
- exp.pushTryCatchClause(tryNumber, classValue, proxyid != -1 ? new RemoteExpressionProxy(proxyid) : null);
- } catch (FailedProxyException e) {
- exp.processException(e.getCause()); // Let the processor know we have a stopping error.
- }
- break;
-
- case InternalExpressionTypes.TRY_FINALLY_EXPRESSION_VALUE:
- // Get a try finally proxy expression. The try id is sent as an int.
- exp.pushTryFinallyClause(in.readInt());
- break;
-
- case InternalExpressionTypes.TRY_END_EXPRESSION_VALUE:
- // Get a try end proxy expression. The try id is sent as an int.
- exp.pushTryEnd(in.readInt());
- break;
-
- case InternalExpressionTypes.THROW_EXPRESSION_VALUE:
- exp.pushThrowException();
- break;
-
- case InternalExpressionTypes.RETHROW_EXPRESSION_VALUE:
- // Get a rethrow proxy expression. The try id is sent as an int.
- exp.pushTryRethrow(in.readInt());
- break;
-
- case InternalExpressionTypes.PUSH_BEANTYPE_EXPRESSIONPROXY_EXPRESSION_VALUE:
- // Get the beantype expression proxy and resolve it.
- proxyid = in.readInt();
- String typeName = Commands.readStringData(in);
- try {
- Class classValue = loadClass(typeName);
- RemoteExpressionProxy rep = new RemoteExpressionProxy(proxyid);
- rep.setProxy(classValue, Class.class);
- exp.allocateExpressionProxy(rep);
- } catch (ClassNotFoundException e) {
- FailedRemoteExpressionProxy rep = new FailedRemoteExpressionProxy(proxyid);
- rep.setProxy(e, e.getClass());
- exp.allocateExpressionProxy(rep);
- } catch (LinkageError e) {
- FailedRemoteExpressionProxy rep = new FailedRemoteExpressionProxy(proxyid);
- rep.setProxy(e, e.getClass());
- exp.allocateExpressionProxy(rep);
- }
- break;
-
- case InternalExpressionTypes.PUSH_METHOD_EXPRESSIONPROXY_EXPRESSION_VALUE:
- // Get the Method expression proxy and resolve it.
- // Comes over as:
- // int for proxy id for the method
- // beanTypeValue for declaring class (either beantype or expression proxy)
- // string for method name
- // int for arg count
- // beanTypeValue(s) for arg types (as many as arg count).
- proxyid = in.readInt();
- Commands.ValueObject decClassValue = Commands.readValue(in, new Commands.ValueObject());
- String methodName = Commands.readStringData(in);
- int argCount = in.readInt();
- Commands.ValueObject[] args = null;
- if (argCount > 0) {
- args = new Commands.ValueObject[argCount];
- for (int i = 0; i < argCount; i++) {
- args[i] = Commands.readValue(in, new Commands.ValueObject());
- }
- }
- Class decClass = null;
- Class[] argClasses = null;
- try {
- decClass = getBeanTypeValue(decClassValue);
- argClasses = null;
- if (argCount>0) {
- argClasses = new Class[argCount];
- for (int i = 0; i < argCount; i++) {
- argClasses[i] = getBeanTypeValue(args[i]);
- }
- }
- // Now get the method itself.
- Method m = decClass.getMethod(methodName, argClasses);
- RemoteExpressionProxy rep = new RemoteExpressionProxy(proxyid);
- rep.setProxy(m, Method.class);
- exp.allocateExpressionProxy(rep);
- } catch (FailedProxyException e) {
- FailedRemoteExpressionProxy rep = new FailedRemoteExpressionProxy(proxyid);
- rep.setProxy(e.getCause(), e.getCause().getClass());
- exp.allocateExpressionProxy(rep);
- } catch (NoSuchMethodException e) {
- // The default trace doesn't show what method was being searched for, so recreate with that.
- StringBuffer s = new StringBuffer();
- s.append(decClass.getName());
- s.append('.');
- s.append(methodName);
- s.append('(');
- if (argClasses != null) {
- for (int i = 0; i < argClasses.length; i++) {
- if (i > 0)
- s.append(',');
- s.append(argClasses[i].getName());
- }
- }
- s.append(')');
- NoSuchMethodException ne = new NoSuchMethodException(s.toString());
- ne.setStackTrace(e.getStackTrace());
- FailedRemoteExpressionProxy rep = new FailedRemoteExpressionProxy(proxyid);
- rep.setProxy(ne, ne.getClass());
- exp.allocateExpressionProxy(rep);
- }
- break;
-
- case InternalExpressionTypes.PUSH_FIELD_EXPRESSIONPROXY_EXPRESSION_VALUE:
- // Get the Filed expression proxy and resolve it.
- // Comes over as:
- // int for proxy id for the field
- // beanTypeValue for declaring class (either beantype or expression proxy)
- // string for field name
- proxyid = in.readInt();
- decClassValue = Commands.readValue(in, new Commands.ValueObject());
- String fieldName = Commands.readStringData(in);
- try {
- decClass = getBeanTypeValue(decClassValue);
- // Now get the field itself.
- Field f = decClass.getField(fieldName);
- RemoteExpressionProxy rep = new RemoteExpressionProxy(proxyid);
- rep.setProxy(f, Method.class);
- exp.allocateExpressionProxy(rep);
- } catch (FailedProxyException e) {
- FailedRemoteExpressionProxy rep = new FailedRemoteExpressionProxy(proxyid);
- rep.setProxy(e.getCause(), e.getCause().getClass());
- exp.allocateExpressionProxy(rep);
- } catch (NoSuchFieldException e) {
- FailedRemoteExpressionProxy rep = new FailedRemoteExpressionProxy(proxyid);
- rep.setProxy(e, e.getClass());
- exp.allocateExpressionProxy(rep);
- }
- break;
-
- case InternalExpressionTypes.IF_TEST_EXPRESSION_VALUE:
- // Get a if test expression request.
- exp.pushIfElse();
- break;
-
- case InternalExpressionTypes.IF_ELSE_EXPRESSION_VALUE:
- // Get a if/else expression clause request. The clause type (ie. true/false) is sent as a byte
- exp.pushIfElse(InternalIfElseOperandType.get(in.readByte()));
- break;
-
- case InternalExpressionTypes.NEW_INSTANCE_VALUE:
- // Get a new instance from string.
- String initString = Commands.readStringData(in);
- workerValue = Commands.readValue(in, new Commands.ValueObject());
- try {
- Class classValue = getBeanTypeValue(workerValue);
- exp.pushNewInstanceFromString(initString, classValue, classLoader);
- } catch (FailedProxyException e) {
- exp.processException(e.getCause()); // Let the processor know we have a stopping error.
- }
- break;
-
- case InternalExpressionTypes.MARK_VALUE:
- // Do a mark.
- int markID = in.readInt();
- exp.pushMark(markID);
- break;
-
- case InternalExpressionTypes.ENDMARK_VALUE:
- // Do an end mark.
- markID = in.readInt();
- boolean restore = in.readBoolean();
- exp.pushEndmark(markID, restore);
- break;
-
- case InternalExpressionTypes.SUBEXPRESSION_BEGIN_EXPRESSION_VALUE:
- // Get a begin subexpression proxy expression. The subexpression id is sent as an int.
- exp.pushSubexpressionBegin(in.readInt());
- break;
-
- case InternalExpressionTypes.SUBEXPRESSION_END_EXPRESSION_VALUE:
- // Get a end subexpression proxy expression. The subexpression id is sent as an int.
- exp.pushSubexpressionEnd(in.readInt());
- break;
-
- }
-
- } catch (RuntimeException e) {
- exp.processException(e);
- }
-
- workerValue.set(); // Clear it out so nothing being held onto.
- }
-
- /**
- * This is an exception that is thrown from the getBeanType, field, method (reflect type stuff)
- * that wrappers the real throwable that occurred during the previous reflection. This is
- * because reflection is done out of sequence with the use of the reflect value. So we need
- * to store the reflection exception in this exception and then store this exception in
- * a {@link FailedRemoteExpressionProxy}. This will then be picked up when trying to be
- * used and it will get the true exception out of the {@link Throwable#getCause()}.
- *
- * @since 1.1.0
- */
- private static class FailedProxyException extends Exception {
- /**
- * Comment for <code>serialVersionUID</code>
- *
- * @since 1.1.0
- */
- private static final long serialVersionUID = 2872325672166348923L;
-
- public FailedProxyException(Throwable realThrowable) {
- super(realThrowable);
- }
- }
-
- /**
- * Get the beantype (class) out of the value object sent in. It can handle the beantype sent or
- * as an expression proxy to a beantype expression proxy.
- *
- * @param value
- * @return
- * @throws FailedProxyException Wrappers the real throwable that caused the bean type to not be found.
- *
- * @since 1.1.0
- */
- protected Class getBeanTypeValue(Commands.ValueObject value) throws FailedProxyException {
- Object beantype = connHandler.getInvokableObject(value);
- // It is either a type directly or is an expression proxy.
- if (value.type == Commands.INT) {
- // It is an expression proxy request.
- Object[] expvalue = new Object[2];
- try {
- exp.getExpressionProxy(((Integer) beantype).intValue(), expvalue);
- beantype = expvalue[0];
- } catch (NoExpressionValueException e) {
- // See if there is a failed proxy.
- if (e.getProxy() != null) {
- FailedRemoteExpressionProxy failure = (FailedRemoteExpressionProxy) e.getProxy();
- throw new FailedProxyException((Throwable) failure.getValue());
- } else
- throw new FailedProxyException(new ClassNotFoundException()); // This shouldn't of occurred.
- }
- }
- return (Class) beantype;
- }
-
- /**
- * Get the method out of the value object sent in. It can handle the method sent or
- * as an expression proxy to a method expression proxy.
- * @param value
- * @return method if a method or string if a string or get the method if an expression proxy.
- * @throws FailedProxyException Wrappers the real Throwable that caused the method to not be found.
- *
- * @since 1.1.0
- */
- protected Object getMethodValue(Commands.ValueObject value) throws FailedProxyException {
- Object method = connHandler.getInvokableObject(value);
- // It is either a method directly or is an expression proxy.
- if (value.type == Commands.INT) {
- // It is an expression proxy request.
- Object[] expvalue = new Object[2];
- try {
- exp.getExpressionProxy(((Integer) method).intValue(), expvalue);
- method = expvalue[0];
- } catch (NoExpressionValueException e) {
- // See if there is a failed proxy.
- if (e.getProxy() != null) {
- FailedRemoteExpressionProxy failure = (FailedRemoteExpressionProxy) e.getProxy();
- throw new FailedProxyException((Throwable) failure.getValue());
- } else
- throw new FailedProxyException(new NoSuchMethodException()); // This shouldn't of occurred.
- }
- }
- return method;
- }
-
- /**
- * Get the field out of the value object sent in. It can handle the field sent or
- * as an expression proxy to a field expression proxy.
- * @param value
- * @return field if a field or string if a string or get the field if an expression proxy.
- * @throws FailedProxyException Wrappers the real throwable that caused the field to not be found.
- *
- * @since 1.1.0
- */
- protected Object getFieldValue(Commands.ValueObject value) throws FailedProxyException {
- Object field = connHandler.getInvokableObject(value);
- // It is either a field directly or is an expression proxy.
- if (value.type == Commands.INT) {
- // It is an expression proxy request.
- Object[] expvalue = new Object[2];
- try {
- exp.getExpressionProxy(((Integer) field).intValue(), expvalue);
- field = expvalue[0];
- } catch (NoExpressionValueException e) {
- // See if there is a failed proxy.
- if (e.getProxy() != null) {
- FailedRemoteExpressionProxy failure = (FailedRemoteExpressionProxy) e.getProxy();
- throw new FailedProxyException((Throwable) failure.getValue());
- } else
- throw new FailedProxyException(new NoSuchFieldException()); // This shouldn't of occurred.
-
- }
- }
- return field;
- }
-
- /**
- * Pull the Expression Proxy value into the result object.
- * @param proxyID
- * @param result
- * @return <code>true</code> if value could be returned, <code>false</code> if it was no expression value assigned.
- *
- * @since 1.1.0
- */
- public boolean pullExpressionProxyValue(int proxyID, Object[] result) {
- try {
- exp.pullExpressionProxyValue(proxyID, result);
- return true;
- } catch (NoExpressionValueException e) {
- }
- return false;
- }
-
- private static class RemoteExpressionProxy implements InternalExpressionProxy {
-
-
- private final int proxyID;
- private Object value;
- private Class type;
- private boolean set;
-
- public RemoteExpressionProxy(int proxyID) {
- this.proxyID = proxyID;
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.initParser.tree.InternalExpressionProxy#getProxyID()
- */
- public int getProxyID() {
- return proxyID;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.initParser.tree.InternalExpressionProxy#getType()
- */
- public Class getType() {
- return type;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.initParser.tree.InternalExpressionProxy#getValue()
- */
- public Object getValue() {
- return value;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.initParser.tree.InternalExpressionProxy#isSet()
- */
- public boolean isSet() {
- return set;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jem.internal.proxy.initParser.tree.InternalExpressionProxy#setProxy(java.lang.Object, java.lang.Class)
- */
- public void setProxy(Object value, Class type) {
- this.value = value;
- this.type = type;
- set = true;
- }
-
- public boolean isFailedExpression() {
- return false;
- }
- }
-
- /**
- * Used for the java.lang.reflect things (class, field, method) to indicate
- * why they aren't found.
- * <p>
- * The exception will be placed into value, BUT this should never be sent
- * back to the caller. It is intended only as a place-holder for subsequent
- * usage. Use the {@link RemoteExpressionProxy#isFailedExpression()} method
- * to determine if it is a failed one.
- * <p>
- * This is used because the reflect calls are done out of sequence from where
- * they are used and so if there was an error, the error is reported in the
- * wrong place.
- *
- * @since 1.1.0
- */
- private static class FailedRemoteExpressionProxy extends RemoteExpressionProxy {
-
- public FailedRemoteExpressionProxy(int proxyID) {
- super(proxyID);
- }
-
- public boolean isFailedExpression() {
- return true;
- }
-
- public boolean isSet() {
- return false; // This should never be considered to be set. It is holder of info only.
- }
-
- }
-
-
- /**
- * Pull the value.
- *
- * @return r[0] is the value, r[1] is the type of the value.
- * @throws NoExpressionValueException
- *
- * @since 1.0.0
- */
- public Object[] pullValue() throws NoExpressionValueException {
- Object[] result = new Object[2];
- exp.pullValue(result);
- return result;
- }
-
- /**
- * Close out things.
- *
- * @since 1.0.0
- */
- public void close() {
- exp.close();
- }
-
- /**
- * Get the throwable error.
- * @return
- *
- * @since 1.1.0
- */
- public Throwable getErrorThrowable() {
- return exp.getErrorThrowable();
- }
-
- /**
- * Return whether there were no errors or not.
- * @return
- *
- * @since 1.1.0
- */
- public boolean noErrors() {
- return exp.noErrors();
- }
-
- /**
- * Return whether there is a no expression value exception or not.
- * @return
- *
- * @since 1.1.0
- */
- public boolean isNoExpressionValue() {
- return exp.isNoExpressionValue();
- }
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/vm_remotevm/org/eclipse/jem/internal/proxy/vm/remote/IdentityMap.java b/plugins/org.eclipse.jem.proxy/vm_remotevm/org/eclipse/jem/internal/proxy/vm/remote/IdentityMap.java
deleted file mode 100644
index 0dc8d933d..000000000
--- a/plugins/org.eclipse.jem.proxy/vm_remotevm/org/eclipse/jem/internal/proxy/vm/remote/IdentityMap.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.vm.remote;
-/*
-
-
- */
-
-
-import java.util.*;
-/**
- * A HashMap where the key is
- * done as an identity (i.e. found by '==' not equals()).
- */
-
-public class IdentityMap extends HashMap{
-
- /**
- * Comment for <code>serialVersionUID</code>
- *
- * @since 1.1.0
- */
- private static final long serialVersionUID = -6817274833221383683L;
-
- /**
- * Key that returns true on equals() only
- * if the item it is wrappering is '=='
- * not equals()
- */
- static class IdentityKey {
-
- public static IdentityKey createKey(Object obj) {
- return obj != null ? new IdentityKey(obj) : null;
- }
-
- final Object o;
-
- public IdentityKey(Object obj) {
- o = obj;
- }
-
- public boolean equals(Object obj) {
- if (this == obj) return true;
- if (!(obj instanceof IdentityKey)) return false;
- if (this.o == (((IdentityKey) obj).o)) return true;
- return false;
- }
-
- public int hashCode() {
- return o.hashCode();
- }
- }
-
- public IdentityMap() {
- }
-
- public IdentityMap(int capacity) {
- super(capacity);
- }
-
- public IdentityMap(int capacity, float loadFactor) {
- super(capacity, loadFactor);
- }
-
- public boolean containsKey(Object key) {
- return super.containsKey(IdentityKey.createKey(key));
- }
-
- public Object get(Object key) {
- return super.get(IdentityKey.createKey(key));
- }
-
- public Object put(Object key, Object value) {
- return super.put(IdentityKey.createKey(key), value);
- }
-
- public Object remove(Object key) {
- return super.remove(IdentityKey.createKey(key));
- }
-
- /**
- * NOTE: Didn't bother implementing entrySet(). If that becomes
- * needed, then it will be implemented.
- */
- public Set entrySet() {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/plugins/org.eclipse.jem.proxy/vm_remotevm/org/eclipse/jem/internal/proxy/vm/remote/RemoteVMApplication.java b/plugins/org.eclipse.jem.proxy/vm_remotevm/org/eclipse/jem/internal/proxy/vm/remote/RemoteVMApplication.java
deleted file mode 100644
index 4930b1125..000000000
--- a/plugins/org.eclipse.jem.proxy/vm_remotevm/org/eclipse/jem/internal/proxy/vm/remote/RemoteVMApplication.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.vm.remote;
-/*
-
-
- */
-
-
-/**
- * The application to run to kick off the remote VM server side.
- *
- *
- * All this does is start the Server Thread and waits for it to finish.
- * This allows other mains to have a server thread, and some other
- * threads if they wished. They could start the server thread too
- * and some other thread, and then wait for both to finish.
- */
-
-public class RemoteVMApplication {
-
-public static void main(java.lang.String[] args) {
- String serverName = "Server Thread"; //$NON-NLS-1$
- if (System.getProperty("proxyvm.servername") != null) //$NON-NLS-1$
- serverName = serverName + "-" + System.getProperty("proxyvm.servername"); //$NON-NLS-1$ //$NON-NLS-2$
- Thread t = new RemoteVMServerThread(serverName);
- t.start();
- try {
- t.join();
- } catch (Exception e) {
- }
- System.exit(0);
-}
-
-
-
-}
diff --git a/plugins/org.eclipse.jem.proxy/vm_remotevm/org/eclipse/jem/internal/proxy/vm/remote/RemoteVMServerThread.java b/plugins/org.eclipse.jem.proxy/vm_remotevm/org/eclipse/jem/internal/proxy/vm/remote/RemoteVMServerThread.java
deleted file mode 100644
index 0b12eb765..000000000
--- a/plugins/org.eclipse.jem.proxy/vm_remotevm/org/eclipse/jem/internal/proxy/vm/remote/RemoteVMServerThread.java
+++ /dev/null
@@ -1,717 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.vm.remote;
-/*
-
-
- */
-
-
-import java.util.*;
-import java.io.*;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.net.*;
-import org.eclipse.jem.internal.proxy.common.remote.*;
-import org.eclipse.jem.internal.proxy.common.*;
-/**
- * RemoteVM Server Thread. This thread is the one
- * that waits for connections and spins off
- * server connection threads. It manages the
- * connection threads and handles shutting them
- * down.
- *
- * System Properties:
- * proxyvm.port - Port number to use for the ServerSocket (default is 8888)
- * proxyvm.bufsize - Buffer size to use for TCP/IP buffers (default is system default)
- */
-
-public class RemoteVMServerThread extends Thread implements IVMServer, IVMCallbackServer {
- protected List threads = Collections.synchronizedList(new LinkedList()); // List of active threads.
- protected ServerSocket server; // Server Socket for this application
- private int highestIdentityID = 0; // Identity codes to identify objects between server and client.
- private Map objectToIDMap;
- private HashMap idToObjectMap = new HashMap(100); // Map from identity id to object
-
- protected Stack fCallbackHandlerPool = new Stack(); // Stack of free callback handlers
- protected static int NUMBER_FREE_CALLBACKS = 5; // Number of free callback handlers to keep open.
-
- public static int ID_NOT_FOUND = Commands.NOT_AN_ID; // The id was not found in the table.
-
- protected int masterIDESocketPort = -1; // Port of master server socket on IDE. Used for special global requests.
- protected int registryKey = -1; // Key of registry on the IDE.
-
- // Kludge: Bug in Linux 1.3.xxx of JVM. Closing a socket while the socket is being read/accept will not interrupt the
- // wait. Need to timeout to the socket read/accept before the socket close will be noticed. This has been fixed
- // in Linux 1.4. So on Linux 1.3 need to put timeouts in on those sockets that can be separately closed while reading/accepting.
- static boolean LINUX_1_3 = "linux".equalsIgnoreCase(System.getProperty("os.name")) && System.getProperty("java.version","").startsWith("1.3"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
-
- // If version 1.3.x, we need to use our IdentidyMap, if 1.4 or greater then we can use Java's IdentidyHashMap, which is more efficient than ours.
- static Constructor IDENTIDYMAP_CLASS_CTOR;
- static {
- Class idClass;
- try {
- idClass = Class.forName("java.util.IdentityHashMap"); //$NON-NLS-1$
- } catch (ClassNotFoundException e) {
- idClass = IdentityMap.class;
- }
- try {
- IDENTIDYMAP_CLASS_CTOR = idClass.getConstructor(new Class[] {Integer.TYPE});
- } catch (SecurityException e) {
- e.printStackTrace();
- } catch (NoSuchMethodException e) {
- e.printStackTrace();
- }
- }
-
- public RemoteVMServerThread(String name) {
- super(name);
- try {
- objectToIDMap = (Map) IDENTIDYMAP_CLASS_CTOR.newInstance(new Object[] {new Integer(100)});
- } catch (IllegalArgumentException e) {
- e.printStackTrace();
- } catch (InstantiationException e) {
- e.printStackTrace();
- } catch (IllegalAccessException e) {
- e.printStackTrace();
- } catch (InvocationTargetException e) {
- e.printStackTrace();
- }
- }
-
- // The purpose of this thread is to wait 5 minutes, then see if the IDE is still
- // up. If it isn't it will go down. This is safety mechanism
- // in case the client went down without cleaning up and telling the server to go down.
- // That way it won't hang around forever.
- private boolean goingDown = false;
- private Thread safeClean = new Thread(new Runnable() {
- public void run() {
- while (!goingDown) {
- if (Thread.interrupted())
- continue; // Get to clean uninterrupted state.
- try {
- Thread.sleep(5 * 60 * 1000); // Sleep five minutes
- // Test if IDE still up.
- if (!isAlive()) {
- System.err.println("No registry available to connect with after five minutes. Shutting down."); //$NON-NLS-1$
- requestShutdown();
- break;
- }
- } catch (InterruptedException e) {
- }
- }
- }
-
- /*
- * See if still alive
- */
- private boolean isAlive() {
- Socket socket = getSocket();
- if (socket != null) {
- try {
- DataOutputStream out = new DataOutputStream(socket.getOutputStream());
- DataInputStream in = new DataInputStream(socket.getInputStream());
-
- try {
- out.writeByte(Commands.ALIVE);
- out.writeInt(registryKey);
- out.flush();
- return in.readBoolean();
- // Now get the result.
- } finally {
- try {
- in.close();
- } catch (IOException e) {
- }
- try {
- out.close();
- } catch (IOException e) {
- }
- }
- } catch (IOException e) {
- e.printStackTrace();
- } finally {
- try {
- socket.close();
- } catch (IOException e) {
- e.printStackTrace(); // They should be closing. If they aren't, then they accumulate and master server will start rejecting new ones.
- }
- }
- }
-
- return false;
- }
-
- }, "Timeout Termination Thread"); //$NON-NLS-1$
-
-
- public void run() {
-
- // Initialize the mapping table with certain pre-defined ids.
- synchronized(objectToIDMap) {
- objectToIDMap.put(Void.TYPE, new Integer(Commands.VOID_TYPE));
- idToObjectMap.put(new Integer(Commands.VOID_TYPE), Void.TYPE);
-
- objectToIDMap.put(Boolean.TYPE, new Integer(Commands.BOOLEAN_TYPE));
- idToObjectMap.put(new Integer(Commands.BOOLEAN_TYPE), Boolean.TYPE);
- objectToIDMap.put(Boolean.class, new Integer(Commands.BOOLEAN_CLASS));
- idToObjectMap.put(new Integer(Commands.BOOLEAN_CLASS), Boolean.class);
-
- objectToIDMap.put(Integer.TYPE, new Integer(Commands.INTEGER_TYPE));
- idToObjectMap.put(new Integer(Commands.INTEGER_TYPE), Integer.TYPE);
- objectToIDMap.put(Integer.class, new Integer(Commands.INTEGER_CLASS));
- idToObjectMap.put(new Integer(Commands.INTEGER_CLASS), Integer.class);
-
- objectToIDMap.put(Byte.TYPE, new Integer(Commands.BYTE_TYPE));
- idToObjectMap.put(new Integer(Commands.BYTE_TYPE), Byte.TYPE);
- objectToIDMap.put(Byte.class, new Integer(Commands.BYTE_CLASS));
- idToObjectMap.put(new Integer(Commands.BYTE_CLASS), Byte.class);
-
- objectToIDMap.put(Short.TYPE, new Integer(Commands.SHORT_TYPE));
- idToObjectMap.put(new Integer(Commands.SHORT_TYPE), Short.TYPE);
- objectToIDMap.put(Short.class, new Integer(Commands.SHORT_CLASS));
- idToObjectMap.put(new Integer(Commands.SHORT_CLASS), Short.class);
-
- objectToIDMap.put(Long.TYPE, new Integer(Commands.LONG_TYPE));
- idToObjectMap.put(new Integer(Commands.LONG_TYPE), Long.TYPE);
- objectToIDMap.put(Long.class, new Integer(Commands.LONG_CLASS));
- idToObjectMap.put(new Integer(Commands.LONG_CLASS), Long.class);
-
- objectToIDMap.put(Character.TYPE, new Integer(Commands.CHARACTER_TYPE));
- idToObjectMap.put(new Integer(Commands.CHARACTER_TYPE), Character.TYPE);
- objectToIDMap.put(Character.class, new Integer(Commands.CHARACTER_CLASS));
- idToObjectMap.put(new Integer(Commands.CHARACTER_CLASS), Character.class);
-
- objectToIDMap.put(Double.TYPE, new Integer(Commands.DOUBLE_TYPE));
- idToObjectMap.put(new Integer(Commands.DOUBLE_TYPE), Double.TYPE);
- objectToIDMap.put(Double.class, new Integer(Commands.DOUBLE_CLASS));
- idToObjectMap.put(new Integer(Commands.DOUBLE_CLASS), Double.class);
-
- objectToIDMap.put(Float.TYPE, new Integer(Commands.FLOAT_TYPE));
- idToObjectMap.put(new Integer(Commands.FLOAT_TYPE), Float.TYPE);
- objectToIDMap.put(Float.class, new Integer(Commands.FLOAT_CLASS));
- idToObjectMap.put(new Integer(Commands.FLOAT_CLASS), Float.class);
-
- objectToIDMap.put(String.class, new Integer(Commands.STRING_CLASS));
- idToObjectMap.put(new Integer(Commands.STRING_CLASS), String.class);
-
- objectToIDMap.put(java.math.BigDecimal.class, new Integer(Commands.BIG_DECIMAL_CLASS));
- idToObjectMap.put(new Integer(Commands.BIG_DECIMAL_CLASS), java.math.BigDecimal.class);
-
- objectToIDMap.put(java.math.BigInteger.class, new Integer(Commands.BIG_INTEGER_CLASS));
- idToObjectMap.put(new Integer(Commands.BIG_INTEGER_CLASS), java.math.BigInteger.class);
-
- objectToIDMap.put(Number.class, new Integer(Commands.NUMBER_CLASS));
- idToObjectMap.put(new Integer(Commands.NUMBER_CLASS), Number.class);
-
- objectToIDMap.put(Throwable.class, new Integer(Commands.THROWABLE_CLASS));
- idToObjectMap.put(new Integer(Commands.THROWABLE_CLASS), Throwable.class);
-
-
- objectToIDMap.put(Object.class, new Integer(Commands.OBJECT_CLASS));
- idToObjectMap.put(new Integer(Commands.OBJECT_CLASS), Object.class);
-
- objectToIDMap.put(Class.class, new Integer(Commands.CLASS_CLASS));
- idToObjectMap.put(new Integer(Commands.CLASS_CLASS), Class.class);
-
- objectToIDMap.put(java.lang.reflect.AccessibleObject.class, new Integer(Commands.ACCESSIBLEOBJECT_CLASS));
- idToObjectMap.put(new Integer(Commands.ACCESSIBLEOBJECT_CLASS), java.lang.reflect.AccessibleObject.class);
-
- objectToIDMap.put(java.lang.reflect.Method.class, new Integer(Commands.METHOD_CLASS));
- idToObjectMap.put(new Integer(Commands.METHOD_CLASS), java.lang.reflect.Method.class);
-
- objectToIDMap.put(java.lang.reflect.Constructor.class, new Integer(Commands.CONSTRUCTOR_CLASS));
- idToObjectMap.put(new Integer(Commands.CONSTRUCTOR_CLASS), java.lang.reflect.Constructor.class);
-
- objectToIDMap.put(java.lang.reflect.Field.class, new Integer(Commands.FIELD_CLASS));
- idToObjectMap.put(new Integer(Commands.FIELD_CLASS), java.lang.reflect.Field.class);
-
- objectToIDMap.put(IVMServer.class, new Integer(Commands.IVMSERVER_CLASS));
- idToObjectMap.put(new Integer(Commands.IVMSERVER_CLASS), IVMServer.class);
-
- objectToIDMap.put(ICallback.class, new Integer(Commands.ICALLBACK_CLASS));
- idToObjectMap.put(new Integer(Commands.ICALLBACK_CLASS), ICallback.class);
-
- objectToIDMap.put(this, new Integer(Commands.REMOTESERVER_ID));
- idToObjectMap.put(new Integer(Commands.REMOTESERVER_ID), this);
-
- objectToIDMap.put(RemoteVMServerThread.class, new Integer(Commands.REMOTEVMSERVER_CLASS));
- idToObjectMap.put(new Integer(Commands.REMOTEVMSERVER_CLASS), RemoteVMServerThread.class);
-
- objectToIDMap.put(Thread.class, new Integer(Commands.THREAD_CLASS));
- idToObjectMap.put(new Integer(Commands.THREAD_CLASS), Thread.class);
-
- objectToIDMap.put(ExpressionProcesserController.class, new Integer(Commands.EXPRESSIONPROCESSERCONTROLLER_CLASS));
- idToObjectMap.put(new Integer(Commands.EXPRESSIONPROCESSERCONTROLLER_CLASS), ExpressionProcesserController.class);
-
- try {
- java.lang.reflect.Method getMethod = Class.class.getMethod("getMethod", new Class[] {String.class, (new Class[0]).getClass()}); //$NON-NLS-1$
- objectToIDMap.put(getMethod, new Integer(Commands.GET_METHOD_ID));
- idToObjectMap.put(new Integer(Commands.GET_METHOD_ID), getMethod);
-
- java.lang.reflect.Method initMethod = ICallback.class.getMethod("initializeCallback", new Class[] {IVMCallbackServer.class, Integer.TYPE}); //$NON-NLS-1$
- objectToIDMap.put(initMethod, new Integer(Commands.INITIALIZECALLBACK_METHOD_ID));
- idToObjectMap.put(new Integer(Commands.INITIALIZECALLBACK_METHOD_ID), initMethod);
-
- } catch (NoSuchMethodException e) {
- // Shouldn't really ever occur.
- }
-
- highestIdentityID = Commands.FIRST_FREE_ID;
- }
-
- masterIDESocketPort = Integer.getInteger("proxyvm.masterPort", -1).intValue(); //$NON-NLS-1$
- if (masterIDESocketPort == -1) {
- // No ports specified, need to just shutdown.
- shutdown();
- return;
- }
-
- registryKey = Integer.getInteger("proxyvm.registryKey", -1).intValue(); //$NON-NLS-1$
- if (registryKey == -1) {
- // No registry specified, need to just shutdown.
- shutdown();
- return;
- }
-
- safeClean.setPriority(Thread.MIN_PRIORITY);
- safeClean.start();
- boolean trying = true;
- try {
- server = new ServerSocket(0, 50 , InetAddress.getByName("localhost")); //$NON-NLS-1$
- trying = false;
- if (LINUX_1_3)
- server.setSoTimeout(1000); // Linux 1.3 bug, see comment on LINUX_1_3
- if (registerServer(server.getLocalPort())) {
- while(server != null) {
- Socket incoming = null;
- try {
- incoming = server.accept();
- } catch (InterruptedIOException e) {
- continue; // Timeout, try again
- } catch (NullPointerException e) {
- continue; // Server could of gone null after test in while, means shutting down. This probably would only happen Linux 1.3.
- }
- Thread st = new ConnectionThread(incoming, this, "Connection Thread"); //$NON-NLS-1$
- threads.add(st);
- safeClean.interrupt(); // Let safeClean know there is a change
- st.start();
- // Null out locals so they can be GC'd since this is a long running loop.
- st = null;
- incoming = null;
- }
- }
- } catch (SocketException e) {
- if (trying || server != null)
- e.printStackTrace(); // Exception and not shutdown request, so print stack trace.
- } catch (Exception e) {
- e.printStackTrace();
- }
-
- // We've had an exception, either something really bad, or we were closed,
- // so go through shutdowns.
- shutdown();
- }
-
-
- /**
- * Get an identityID, return -1 if not found.
- */
- public int getIdentityID(Object anObject) {
- synchronized(objectToIDMap) {
- Integer id = (Integer) objectToIDMap.get(anObject);
- return id != null ? id.intValue() : ID_NOT_FOUND;
- }
- }
-
- /**
- * Get an identityID and add it if not found. Place the id in the
- * ValueObject passed in and return whether it was added (true) or was already in table (false)
- */
- public boolean getIdentityID(Object anObject, Commands.ValueObject intoValue ) {
- boolean added = false;
- synchronized(objectToIDMap) {
- Integer id = (Integer) objectToIDMap.get(anObject);
- if (id == null) {
- do {
- if (++highestIdentityID == Commands.NOT_AN_ID)
- ++highestIdentityID; // Don't let -1 be a valid id.
- id = new Integer(highestIdentityID);
- } while (idToObjectMap.containsKey(id)); // Make sure not in use, really shouldn't ever happen because we have over 4 billion before it wraps back
- objectToIDMap.put(anObject, id);
- idToObjectMap.put(id, anObject);
- added = true;
- }
- intoValue.setObjectID(id.intValue());
- }
- return added;
- }
-
- /**
- * Remove an identity object from the mapping.
- */
- public void removeObject(Object anObject) {
- synchronized(objectToIDMap) {
- Integer id = (Integer) objectToIDMap.remove(anObject);
- idToObjectMap.remove(id);
- }
- }
-
- /**
- * Remove an identity object from the mapping, given the id.
- */
- public void removeObject(int id) {
- synchronized(objectToIDMap) {
- Object o = idToObjectMap.remove(new Integer(id));
- objectToIDMap.remove(o);
- }
- }
-
- /**
- * Get the object for an identity id
- */
- public Object getObject(int id) {
- synchronized(objectToIDMap) {
- return idToObjectMap.get(new Integer(id));
- }
- }
-
- /**
- * Remove a thread from the list.
- */
- public void removeConnectionThread(Thread thread) {
- threads.remove(thread);
- safeClean.interrupt(); // Let safe clean know there is a change.
- }
-
- /**
- * Use this to request a shutdown. If the server hasn't even been
- * created yet, this will return false.
- */
- public boolean requestShutdown() {
- if (server == null)
- return false;
- // Closing the server socket should cause a break.
- try {
- ServerSocket srv = server;
- server = null; // So that server knows it is being shutdown and not print exception msg.
- srv.close();
- } catch (Exception e) {
- }
- return true;
- }
-
- /**
- * Request a callback stream to write to.
- * When done, the stream should be closed to release the connection.
- */
- public OutputStream requestStream(int callbackID, int msgID) throws CommandException {
- CallbackHandler h = (CallbackHandler) getFreeCallbackHandler();
- if (h == null)
- throw new CommandException("No callback handler retrieved.", null); //$NON-NLS-1$
- h.initiateCallbackStream(callbackID, msgID);
- return new CallbackOutputStream(h, this);
- }
-
- protected void shutdown() {
- goingDown = true;
- safeClean.interrupt(); // Let safeClean know to come down.
-
- if (server != null)
- try {
- server.close(); // Close it so that no more requests can be made.
- } catch (Exception e) {
- }
-
- // Go through each thread and ask it to close. Make a copy of the list so that we
- // won't get into deadlocks.
- ConnectionThread[] threadsArray = (ConnectionThread[]) threads.toArray(new ConnectionThread[0]);
- for (int i=0; i<threadsArray.length; i++) {
- // This is a harsh way to shut a connection down, but there's no
- // other way I know of to interrupt the read on a socket.
- threadsArray[i].close();
- }
-
- // Now that they've been told to close, wait on each one to finish.
- for (int i=0; i<threadsArray.length; i++)
- try {
- threadsArray[i].join(10000); // Wait ten seconds, if longer, just go on to next one.
- if (threadsArray[i].isAlive())
- System.out.println("*** Connection "+i+" did not die."); //$NON-NLS-1$ //$NON-NLS-2$
- } catch (InterruptedException e) {
- }
-
- if (safeClean.isAlive()) {
- try {
- safeClean.join(10000);
- if (safeClean.isAlive())
- System.out.println("*** Cleanup thread did not die."); //$NON-NLS-1$
- } catch (InterruptedException e) {
- }
- }
-
- // Now close the callbacks.
- synchronized(fCallbackHandlerPool) {
- // Now we walk through all of the free handlers and close them properly.
- Iterator itr = fCallbackHandlerPool.iterator();
- while (itr.hasNext()) {
- ((CallbackHandler) itr.next()).closeHandler();
- }
-
- fCallbackHandlerPool.clear();
- }
-
- List runnables = null;
- synchronized (this) {
- runnables = shutdownRunnables;
- shutdownRunnables = null;
- }
- if (runnables != null) {
- for (Iterator itr = runnables.iterator(); itr.hasNext();) {
- try {
- ((Runnable) itr.next()).run();
- } catch (RuntimeException e) {
- e.printStackTrace();
- }
- }
- }
- }
-
- /**
- * Return a free callback handler
- */
- public ICallbackHandler getFreeCallbackHandler() {
- synchronized(fCallbackHandlerPool) {
- if (!fCallbackHandlerPool.isEmpty())
- return (ICallbackHandler) fCallbackHandlerPool.pop();
- // else we need to allocate one.
- return createCallbackHandler();
- }
- }
-
- /**
- * Make a new callback handler
- */
- protected ICallbackHandler createCallbackHandler() {
- Socket callbackSocket = requestCallbackSocket();
- if (callbackSocket != null) {
- CallbackHandler handler = new CallbackHandler(callbackSocket, this);
- if (handler.isConnected())
- return handler;
-
- // Failed, close the socket.
- try {
- callbackSocket.close();
- } catch (IOException e) {
- }
- }
- return null;
- }
-
- /**
- * Free the handler
- */
- public void returnCallbackHandler(ICallbackHandler aHandler) {
- CallbackHandler handler = (CallbackHandler) aHandler;
- if (handler.isConnected())
- synchronized (fCallbackHandlerPool) {
- if (fCallbackHandlerPool.size() < NUMBER_FREE_CALLBACKS)
- fCallbackHandlerPool.push(handler);
- else
- handler.closeHandler(); // We don't need to maintain more than five free connections.
- }
- }
-
- /**
- * Process a callback.
- */
- public Object doCallback(ICallbackRunnable run) throws CommandException {
- CallbackHandler handler = (CallbackHandler) getFreeCallbackHandler();
- if (handler != null) {
- try {
- try {
- return run.run(handler);
- } catch (CommandErrorException e) {
- // This is command error, connection still good, don't retry, just pass it on.
- // It means the other side said I processed it, but there is an error.
- throw e;
- } catch (CommandException e) {
- if (!e.isRecoverable()) {
- // Close this handler and try a new one, one more time.
- handler.closeHandler();
- handler = (CallbackHandler) getFreeCallbackHandler();
- try {
- return run.run(handler);
- } catch (CommandException eAgain) {
- // It failed again, just close the connection and rethrow the exception.
- handler.closeHandler();
- throw eAgain;
- }
- } else
- throw e; // Recoverable, rethrow exception.
- }
- } finally {
- returnCallbackHandler(handler);
- }
- } else
- throw new CommandException("No callback handler retrieved.", null); //$NON-NLS-1$
-
- }
-
- /*
- * Register the server. Return if ide still active
- */
- private boolean registerServer(int vmserverPort) {
- Socket socket = getSocket();
- if (socket != null) {
- try {
- DataOutputStream out = new DataOutputStream(socket.getOutputStream());
- DataInputStream in = new DataInputStream(socket.getInputStream());
-
- try {
- out.writeByte(Commands.REMOTE_STARTED);
- out.writeInt(registryKey);
- out.writeInt(vmserverPort);
- out.flush();
- return in.readBoolean();
- } finally {
- try {
- in.close();
- } catch (IOException e) {
- }
- try {
- out.close();
- } catch (IOException e) {
- }
- }
- } catch (IOException e) {
- e.printStackTrace();
- } finally {
- try {
- socket.close();
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
-
- }
-
- return false;
- }
-
- /*
- * Request the callback socket. <code>null</code> if there isn't one.
- */
- private Socket requestCallbackSocket() {
- Socket socket = getSocket();
- if (socket != null) {
- boolean closeSocket = true;
- try {
- DataOutputStream out = new DataOutputStream(socket.getOutputStream());
- DataInputStream in = new DataInputStream(socket.getInputStream());
-
- try {
- out.writeByte(Commands.ATTACH_CALLBACK);
- out.writeInt(registryKey);
- out.flush();
- closeSocket = !in.readBoolean();
- return !closeSocket ? socket : null;
- } finally {
- if (closeSocket) {
- try {
- in.close();
- } catch (IOException e) {
- }
- try {
- out.close();
- } catch (IOException e) {
- }
- }
- }
- } catch (IOException e) {
- e.printStackTrace();
- } finally {
- if (closeSocket) {
- try {
- socket.close();
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- }
- }
-
- return null;
- }
-
-
-
- protected Socket getSocket() {
- // We are putting it off into a thread because there are no timeout capabilities on getting a socket.
- // So we need to allow for that.
- final Socket[] scArray = new Socket[1];
- final boolean[] waiting = new boolean[] {true};
- Thread doIt = new Thread(new Runnable() {
- public void run() {
- try {
- Socket sc = new Socket("localhost", masterIDESocketPort); //$NON-NLS-1$
- synchronized (this) {
- if (waiting[0])
- scArray[0] = sc;
- else
- sc.close(); // We are no longer waiting on this thread so close the socket since no one will use it.
- }
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- });
-
- doIt.start();
- while (true) {
- try {
- doIt.join(60000);
- synchronized (doIt) {
- waiting[0] = false; // To let it know we are no longer waiting
- }
- break;
- } catch (InterruptedException e) {
- }
- }
-
- if (scArray[0] == null) {
- System.out.println("Couldn't retrieve a socket from master server in 60 seconds."); //$NON-NLS-1$
- return null; // Couldn't get one, probably server is down.
- }
-
- return scArray[0];
- }
-
- private List shutdownRunnables;
-
- public synchronized void addShutdownListener(Runnable runnable) {
- if (shutdownRunnables == null) {
- shutdownRunnables = new ArrayList();
- } else if (shutdownRunnables.contains(runnable))
- return;
- shutdownRunnables.add(runnable);
- }
-
- public synchronized void removeShutdownListener(Runnable runnable) {
- if (shutdownRunnables != null)
- shutdownRunnables.remove(runnable);
- }
-
-
- public IVMServer getIVMServer() {
- return this;
- }
-}
diff --git a/plugins/org.eclipse.jem.proxy/vm_remotevm/org/eclipse/jem/internal/proxy/vm/remote/StackTraceUtility.java b/plugins/org.eclipse.jem.proxy/vm_remotevm/org/eclipse/jem/internal/proxy/vm/remote/StackTraceUtility.java
deleted file mode 100644
index acf0afb7a..000000000
--- a/plugins/org.eclipse.jem.proxy/vm_remotevm/org/eclipse/jem/internal/proxy/vm/remote/StackTraceUtility.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 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.jem.internal.proxy.vm.remote;
-/*
-
-
- */
-
-
-import java.io.*;
-/**
- * A utility to get the stack trace from an exception
- * back to the client.
- */
-public class StackTraceUtility {
-
- public static String printStackTrace(Throwable t) {
- StringWriter writer = new StringWriter();
- t.printStackTrace(new PrintWriter(writer));
- return writer.toString();
- }
-
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/.classpath b/plugins/org.eclipse.jst.j2ee.ui/.classpath
deleted file mode 100644
index 3dce472cb..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/.classpath
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="j2ee_ui"/>
- <classpathentry kind="src" path="property_files"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/plugins/org.eclipse.jst.j2ee.ui/.cvsignore b/plugins/org.eclipse.jst.j2ee.ui/.cvsignore
deleted file mode 100644
index 678089c03..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/.cvsignore
+++ /dev/null
@@ -1,8 +0,0 @@
-bin
-doc
-temp.folder
-build.xml
-j2ee_ui.jar
-@dot
-src.zip
-javaCompiler...args
diff --git a/plugins/org.eclipse.jst.j2ee.ui/.project b/plugins/org.eclipse.jst.j2ee.ui/.project
deleted file mode 100644
index 937fa4b6e..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/.project
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jst.j2ee.ui</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>com.ibm.etools.ctc.javaprojectnature</nature>
- </natures>
-</projectDescription>
diff --git a/plugins/org.eclipse.jst.j2ee.ui/.settings/org.eclipse.core.resources.prefs b/plugins/org.eclipse.jst.j2ee.ui/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 04a5d483f..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Wed Jul 25 14:00:45 EDT 2007
-eclipse.preferences.version=1
-encoding//j2ee_ui/org/eclipse/jst/j2ee/internal/wizard/earlibraries.properties=8859_1
diff --git a/plugins/org.eclipse.jst.j2ee.ui/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.jst.j2ee.ui/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index e2a8bcb0c..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,62 +0,0 @@
-#Thu May 10 18:35:45 EDT 2007
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-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.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
-org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
-org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-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=ignore
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
-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=ignore
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-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=ignore
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=error
-org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
-org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-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.5
diff --git a/plugins/org.eclipse.jst.j2ee.ui/.settings/org.eclipse.jdt.ui.prefs b/plugins/org.eclipse.jst.j2ee.ui/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index 6cf957904..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/.settings/org.eclipse.jdt.ui.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Fri Apr 13 14:16:39 EDT 2007
-eclipse.preferences.version=1
-internal.default.compliance=default
diff --git a/plugins/org.eclipse.jst.j2ee.ui/META-INF/MANIFEST.MF b/plugins/org.eclipse.jst.j2ee.ui/META-INF/MANIFEST.MF
deleted file mode 100644
index d5ff63129..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,76 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %Bundle-Name.0
-Bundle-SymbolicName: org.eclipse.jst.j2ee.ui; singleton:=true
-Bundle-Version: 1.1.206.qualifier
-Bundle-Activator: org.eclipse.jst.j2ee.internal.plugin.J2EEUIPlugin
-Bundle-Vendor: %Bundle-Vendor.0
-Bundle-Localization: plugin
-Export-Package: org.eclipse.jst.common.jdt.internal.integration.ui;x-internal:=true,
- org.eclipse.jst.j2ee.internal;x-internal:=true,
- org.eclipse.jst.j2ee.internal.actions;x-internal:=true,
- org.eclipse.jst.j2ee.internal.classpathdep.ui,
- org.eclipse.jst.j2ee.internal.client.actions;x-internal:=true,
- org.eclipse.jst.j2ee.internal.command;x-internal:=true,
- org.eclipse.jst.j2ee.internal.deployables;x-internal:=true,
- org.eclipse.jst.j2ee.internal.dialogs;x-internal:=true,
- org.eclipse.jst.j2ee.internal.ear.actions;x-internal:=true,
- org.eclipse.jst.j2ee.internal.ejb.provider;x-internal:=true,
- org.eclipse.jst.j2ee.internal.listeners;x-internal:=true,
- org.eclipse.jst.j2ee.internal.perspective;x-internal:=true,
- org.eclipse.jst.j2ee.internal.plugin;x-internal:=true,
- org.eclipse.jst.j2ee.internal.provider;x-internal:=true,
- org.eclipse.jst.j2ee.internal.ui;x-internal:=true,
- org.eclipse.jst.j2ee.internal.ui.util;x-internal:=true,
- org.eclipse.jst.j2ee.internal.war.ui.util;x-internal:=true,
- org.eclipse.jst.j2ee.internal.wizard;x-internal:=true,
- org.eclipse.jst.j2ee.ui.archive,
- org.eclipse.jst.j2ee.ui.archive.internal,
- org.eclipse.jst.j2ee.ui.project.facet,
- org.eclipse.jst.j2ee.ui.project.facet.appclient
-Require-Bundle: org.eclipse.ui.ide;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.core.resources;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.ui;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.wst.common.frameworks.ui;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.jst.j2ee;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.jst.j2ee.ejb;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.jst.j2ee.jca;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.jst.j2ee.web;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.emf.edit.ui;bundle-version="[2.2.0,3.0.0)",
- org.eclipse.jdt.ui;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.wst.validation;bundle-version="[1.2.0,2.0.0)",
- org.eclipse.jst.j2ee.core;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.wst.common.emfworkbench.integration;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.jem.workbench;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.jem;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.wst.common.frameworks;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.jdt.core;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.wst.server.core;bundle-version="[1.0.102,2.0.0)",
- org.eclipse.wst.server.ui;bundle-version="[1.0.102,2.0.0)",
- org.eclipse.wst.common.emf;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.emf.ecore.xmi;bundle-version="[2.2.0,3.0.0)",
- org.eclipse.ltk.core.refactoring;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.ltk.ui.refactoring;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.jface.text;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.wst.web;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.debug.ui;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.ui.editors;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.ui.workbench.texteditor;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.wst.sse.core;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.wst.common.modulecore;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.jst.common.frameworks;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.jem.util;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.jst.common.annotations.controller;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.jst.j2ee.ejb.annotation.model;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.wst.common.project.facet.core;bundle-version="[1.3.0,2.0.0)",
- org.eclipse.wst.common.project.facet.ui;bundle-version="[1.3.0,2.0.0)",
- org.eclipse.jst.server.core;bundle-version="[1.0.102,2.0.0)",
- org.eclipse.wst.web.ui;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.ui.navigator.resources;bundle-version="[3.2.0,4.0.0)",
- com.ibm.icu;bundle-version="[3.4.4,4.0.0)",
- org.eclipse.ui.forms;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.ui.navigator;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.jst.jee;bundle-version="[1.0.0,1.1.0)"
-Eclipse-LazyStart: true
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/plugins/org.eclipse.jst.j2ee.ui/about.html b/plugins/org.eclipse.jst.j2ee.ui/about.html
deleted file mode 100644
index 2199df3f0..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>June, 2008</P>
-
-<H3>License</H3>
-
-<P>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
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>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
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/plugins/org.eclipse.jst.j2ee.ui/build.properties b/plugins/org.eclipse.jst.j2ee.ui/build.properties
deleted file mode 100644
index 55ac8282a..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/build.properties
+++ /dev/null
@@ -1,22 +0,0 @@
-###############################################################################
-# Copyright (c) 2003, 2005 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
-###############################################################################
-bin.includes = plugin.xml,\
- icons/,\
- plugin.properties,\
- .,\
- META-INF/,\
- about.html
-jars.compile.order = .
-source.. = j2ee_ui/,\
- property_files/
-output.. = bin/
-src.includes = plugin.properties,\
- plugin.xml
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/20_cmpbean_obj.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/20_cmpbean_obj.gif
deleted file mode 100644
index 023fe8d4d..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/20_cmpbean_obj.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/adown.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/adown.gif
deleted file mode 100644
index 91e708f7c..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/adown.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/appclientgroup_obj.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/appclientgroup_obj.gif
deleted file mode 100644
index 276842824..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/appclientgroup_obj.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/arrow_down.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/arrow_down.gif
deleted file mode 100644
index 3c455c9ff..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/arrow_down.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/arrowp.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/arrowp.gif
deleted file mode 100644
index a9063201b..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/arrowp.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/cascade_left.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/cascade_left.gif
deleted file mode 100644
index 788e76d4a..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/cascade_left.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/cascade_left2.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/cascade_left2.gif
deleted file mode 100644
index 3e31054b1..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/cascade_left2.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/cascade_right.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/cascade_right.gif
deleted file mode 100644
index 573b60f0c..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/cascade_right.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/cmp.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/cmp.gif
deleted file mode 100644
index 20ed1f9a4..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/cmp.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/connectorgroup_obj.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/connectorgroup_obj.gif
deleted file mode 100644
index ad3af3c65..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/connectorgroup_obj.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/deadend.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/deadend.gif
deleted file mode 100644
index 5df61935f..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/deadend.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/ear-wiz-banner.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/ear-wiz-banner.gif
deleted file mode 100644
index 625e763c9..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/ear-wiz-banner.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/ear-wiz-icon.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/ear-wiz-icon.gif
deleted file mode 100644
index 8b409b507..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/ear-wiz-icon.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/ear.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/ear.gif
deleted file mode 100644
index f52fa9702..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/ear.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/eargroup_obj.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/eargroup_obj.gif
deleted file mode 100644
index 2eeb3ef01..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/eargroup_obj.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/ejbgroup_obj.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/ejbgroup_obj.gif
deleted file mode 100644
index b0adb3e59..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/ejbgroup_obj.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/folder.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/folder.gif
deleted file mode 100644
index c91b26723..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/folder.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/clcl16/ejb_client_remove_action_obj.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/clcl16/ejb_client_remove_action_obj.gif
deleted file mode 100644
index 182321138..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/clcl16/ejb_client_remove_action_obj.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/clcl16/ejb_deploy_action_obj.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/clcl16/ejb_deploy_action_obj.gif
deleted file mode 100644
index db8945f83..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/clcl16/ejb_deploy_action_obj.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/appclient_export.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/appclient_export.gif
deleted file mode 100644
index 6f83300c8..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/appclient_export.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/appclient_import_wiz.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/appclient_import_wiz.gif
deleted file mode 100644
index ce667f4ef..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/appclient_import_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/ejbclientjar_wiz.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/ejbclientjar_wiz.gif
deleted file mode 100644
index 6e65e7d54..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/ejbclientjar_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/export_ear.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/export_ear.gif
deleted file mode 100644
index 2270b1717..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/export_ear.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/export_ejbjar_wiz.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/export_ejbjar_wiz.gif
deleted file mode 100644
index 72cd417c4..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/export_ejbjar_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/export_rar.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/export_rar.gif
deleted file mode 100644
index befb3d4e8..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/export_rar.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/exportwar_wiz.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/exportwar_wiz.gif
deleted file mode 100644
index ced859dd4..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/exportwar_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/import_ear.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/import_ear.gif
deleted file mode 100644
index 099201bb5..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/import_ear.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/import_ejbjar.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/import_ejbjar.gif
deleted file mode 100644
index 5644b48df..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/import_ejbjar.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/import_rar.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/import_rar.gif
deleted file mode 100644
index 50f25a2f7..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/import_rar.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/importwar_wiz.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/importwar_wiz.gif
deleted file mode 100644
index 432c06679..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/importwar_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/newappclient_wiz.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/newappclient_wiz.gif
deleted file mode 100644
index 0ce86a13a..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/newappclient_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/newconnectionprj_wiz.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/newconnectionprj_wiz.gif
deleted file mode 100644
index 1bec6ba83..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/newconnectionprj_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/newear_wiz.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/newear_wiz.gif
deleted file mode 100644
index 8b409b507..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/newear_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/newejbprj_wiz.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/newejbprj_wiz.gif
deleted file mode 100644
index ecda22bf9..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/newejbprj_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/newwar_wiz.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/newwar_wiz.gif
deleted file mode 100644
index b9ac6be16..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/newwar_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/re_execute.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/re_execute.gif
deleted file mode 100644
index 8f943a8c3..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ctool16/re_execute.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/cview16/j2ee_perspective.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/cview16/j2ee_perspective.gif
deleted file mode 100644
index 20acd4c42..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/cview16/j2ee_perspective.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/cview16/j2ee_view.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/cview16/j2ee_view.gif
deleted file mode 100644
index 20acd4c42..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/cview16/j2ee_view.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/dlcl16/ejb_client_remove_action_obj.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/dlcl16/ejb_client_remove_action_obj.gif
deleted file mode 100644
index 928a0bf95..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/dlcl16/ejb_client_remove_action_obj.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/dlcl16/ejb_deploy_action_obj.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/dlcl16/ejb_deploy_action_obj.gif
deleted file mode 100644
index 965738888..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/dlcl16/ejb_deploy_action_obj.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/13_ear_obj.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/13_ear_obj.gif
deleted file mode 100644
index 54b9b1745..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/13_ear_obj.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/21_cmpbean_obj.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/21_cmpbean_obj.gif
deleted file mode 100644
index 35835bc25..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/21_cmpbean_obj.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/21_ejb_obj.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/21_ejb_obj.gif
deleted file mode 100644
index 673ba6aa6..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/21_ejb_obj.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/21_ejbjar_wiz.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/21_ejbjar_wiz.gif
deleted file mode 100644
index 9dae05280..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/21_ejbjar_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/annotation_positioned_overlay.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/annotation_positioned_overlay.gif
deleted file mode 100644
index cec1d2d54..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/annotation_positioned_overlay.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/appclient_14.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/appclient_14.gif
deleted file mode 100644
index b2483803b..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/appclient_14.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/appclient_14_deploy.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/appclient_14_deploy.gif
deleted file mode 100644
index b0d08af9e..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/appclient_14_deploy.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/extwebserviceitemprovider_obj.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/extwebserviceitemprovider_obj.gif
deleted file mode 100644
index f4cc6e3aa..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/extwebserviceitemprovider_obj.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/home_interface_positioned_overlay.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/home_interface_positioned_overlay.gif
deleted file mode 100644
index 91a756a3d..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/home_interface_positioned_overlay.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/library_obj.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/library_obj.gif
deleted file mode 100644
index cb55e33b5..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/library_obj.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/local_home_interface_positioned_overlay.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/local_home_interface_positioned_overlay.gif
deleted file mode 100644
index e5d6090fe..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/local_home_interface_positioned_overlay.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/local_interface_positioned_overlay.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/local_interface_positioned_overlay.gif
deleted file mode 100644
index 156febec2..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/local_interface_positioned_overlay.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/remote_interface_positioned_overlay.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/remote_interface_positioned_overlay.gif
deleted file mode 100644
index 203e398f4..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/remote_interface_positioned_overlay.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/service_interface_positioned_overlay.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/service_interface_positioned_overlay.gif
deleted file mode 100644
index 614666731..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/service_interface_positioned_overlay.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/webServiceItemProvider_obj.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/webServiceItemProvider_obj.gif
deleted file mode 100644
index 8fb844f5b..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/webServiceItemProvider_obj.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/webServicesFolder_obj.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/webServicesFolder_obj.gif
deleted file mode 100644
index ab3039ca2..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/webServicesFolder_obj.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/webapp_14.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/webapp_14.gif
deleted file mode 100644
index 83f916563..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/webapp_14.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/webapp_deploy.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/webapp_deploy.gif
deleted file mode 100644
index 80531e39b..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/obj16/webapp_deploy.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/annotation_bean_overlay.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/annotation_bean_overlay.gif
deleted file mode 100644
index f277755f6..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/annotation_bean_overlay.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/annotation_positioned_overlay.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/annotation_positioned_overlay.gif
deleted file mode 100644
index cec1d2d54..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/annotation_positioned_overlay.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/client_app_ovr.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/client_app_ovr.gif
deleted file mode 100644
index 3ff1ca57e..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/client_app_ovr.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/connector_ovr.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/connector_ovr.gif
deleted file mode 100644
index b7e77bc69..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/connector_ovr.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/dis_annotation_bean_overlay.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/dis_annotation_bean_overlay.gif
deleted file mode 100644
index dac498adf..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/dis_annotation_bean_overlay.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/ejb_module_ovr.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/ejb_module_ovr.gif
deleted file mode 100644
index cf50d6d66..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/ejb_module_ovr.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/enterprise_app_ovr.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/enterprise_app_ovr.gif
deleted file mode 100644
index ec19c473c..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/enterprise_app_ovr.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/externalWebServiceOverlay_obj.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/externalWebServiceOverlay_obj.gif
deleted file mode 100644
index daff412d7..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/externalWebServiceOverlay_obj.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/home_interface_overlay_obj.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/home_interface_overlay_obj.gif
deleted file mode 100644
index 48380fc8e..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/home_interface_overlay_obj.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/home_interface_positioned_overlay.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/home_interface_positioned_overlay.gif
deleted file mode 100644
index 91a756a3d..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/home_interface_positioned_overlay.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/key_interf_ov.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/key_interf_ov.gif
deleted file mode 100644
index 307044047..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/key_interf_ov.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/local_home_interface_overlay_obj.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/local_home_interface_overlay_obj.gif
deleted file mode 100644
index d7827341f..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/local_home_interface_overlay_obj.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/local_home_interface_positioned_overlay.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/local_home_interface_positioned_overlay.gif
deleted file mode 100644
index e5d6090fe..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/local_home_interface_positioned_overlay.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/local_interface_overlay_obj.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/local_interface_overlay_obj.gif
deleted file mode 100644
index 43e165576..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/local_interface_overlay_obj.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/local_interface_positioned_overlay.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/local_interface_positioned_overlay.gif
deleted file mode 100644
index 156febec2..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/local_interface_positioned_overlay.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/remote_interface_overlay_obj.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/remote_interface_overlay_obj.gif
deleted file mode 100644
index 19c9cae05..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/remote_interface_overlay_obj.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/remote_interface_positioned_overlay.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/remote_interface_positioned_overlay.gif
deleted file mode 100644
index 203e398f4..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/remote_interface_positioned_overlay.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/service_interface_overlay_obj.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/service_interface_overlay_obj.gif
deleted file mode 100644
index 93f0679d5..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/service_interface_overlay_obj.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/service_interface_positioned_overlay.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/service_interface_positioned_overlay.gif
deleted file mode 100644
index 614666731..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/service_interface_positioned_overlay.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/web_module_ovr.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/web_module_ovr.gif
deleted file mode 100644
index c1e96177a..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/ovr16/web_module_ovr.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/add_mess_dest_wiz_ban.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/add_mess_dest_wiz_ban.gif
deleted file mode 100644
index f9941cec6..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/add_mess_dest_wiz_ban.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/add_web_service_handler_wiz.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/add_web_service_handler_wiz.gif
deleted file mode 100644
index e1fa98a87..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/add_web_service_handler_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/addauthoritycontraints_wiz_.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/addauthoritycontraints_wiz_.gif
deleted file mode 100644
index 2ec0ffb08..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/addauthoritycontraints_wiz_.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/addcmpfiled_wiz_ban.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/addcmpfiled_wiz_ban.gif
deleted file mode 100644
index 879329ef0..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/addcmpfiled_wiz_ban.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/addcontextparameter_wiz_ban.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/addcontextparameter_wiz_ban.gif
deleted file mode 100644
index 6457e12be..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/addcontextparameter_wiz_ban.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/addenvirentry_wiz_ban.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/addenvirentry_wiz_ban.gif
deleted file mode 100644
index 653ab02a8..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/addenvirentry_wiz_ban.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/adderrorcodeerror_wiz_ban.g.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/adderrorcodeerror_wiz_ban.g.gif
deleted file mode 100644
index 2eb9efee5..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/adderrorcodeerror_wiz_ban.g.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/addexceptionerrorpage_wiz_ban.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/addexceptionerrorpage_wiz_ban.gif
deleted file mode 100644
index e12d2ac10..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/addexceptionerrorpage_wiz_ban.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/addfiltermapping_wiz_ban.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/addfiltermapping_wiz_ban.gif
deleted file mode 100644
index 5b5301060..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/addfiltermapping_wiz_ban.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/addhandlersoapheader_wiz_ba.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/addhandlersoapheader_wiz_ba.gif
deleted file mode 100644
index 189c3e9ac..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/addhandlersoapheader_wiz_ba.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/addjsppropgropu_wiz_ban.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/addjsppropgropu_wiz_ban.gif
deleted file mode 100644
index 624fe7ffc..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/addjsppropgropu_wiz_ban.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/addlocencodingmap_wiz_ban.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/addlocencodingmap_wiz_ban.gif
deleted file mode 100644
index 46e3e0875..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/addlocencodingmap_wiz_ban.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/addmimemapping_wiz_ban.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/addmimemapping_wiz_ban.gif
deleted file mode 100644
index bb856a40f..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/addmimemapping_wiz_ban.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/addservletmapping_wiz_ban.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/addservletmapping_wiz_ban.gif
deleted file mode 100644
index 2820c5a9b..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/addservletmapping_wiz_ban.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/addtaglibref_wiz_ban.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/addtaglibref_wiz_ban.gif
deleted file mode 100644
index d238b56db..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/addtaglibref_wiz_ban.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/addwebSecuritycontraint_wiz.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/addwebSecuritycontraint_wiz.gif
deleted file mode 100644
index fc97d8469..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/addwebSecuritycontraint_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/addwebrescollection_wiz_ban.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/addwebrescollection_wiz_ban.gif
deleted file mode 100644
index 7dfe6e91d..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/addwebrescollection_wiz_ban.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/addwebsecurityroleref_wiz_b.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/addwebsecurityroleref_wiz_b.gif
deleted file mode 100644
index aab4b505f..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/addwebsecurityroleref_wiz_b.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/addwelcomepage_wiz_ban.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/addwelcomepage_wiz_ban.gif
deleted file mode 100644
index e0f50ccf7..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/addwelcomepage_wiz_ban.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/appclient_wiz.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/appclient_wiz.gif
deleted file mode 100644
index 56d7fa704..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/appclient_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/connection_migration_wizard_wiz.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/connection_migration_wizard_wiz.gif
deleted file mode 100644
index e9ecba580..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/connection_migration_wizard_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/connector_wiz.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/connector_wiz.gif
deleted file mode 100644
index 231f8d3e7..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/connector_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/ear_wiz.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/ear_wiz.gif
deleted file mode 100644
index 625e763c9..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/ear_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/ejbclientjar_wizban.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/ejbclientjar_wizban.gif
deleted file mode 100644
index 231da6174..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/ejbclientjar_wizban.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/ejbproject_wiz.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/ejbproject_wiz.gif
deleted file mode 100644
index 7f2aa1e05..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/ejbproject_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/export_appclient_wiz.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/export_appclient_wiz.gif
deleted file mode 100644
index 351539638..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/export_appclient_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/export_ear_wiz.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/export_ear_wiz.gif
deleted file mode 100644
index a327fa68a..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/export_ear_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/export_ejbjar_obj.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/export_ejbjar_obj.gif
deleted file mode 100644
index adca79ef0..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/export_ejbjar_obj.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/export_rar_wiz.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/export_rar_wiz.gif
deleted file mode 100644
index 6047f1adc..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/export_rar_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/export_war_wiz.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/export_war_wiz.gif
deleted file mode 100644
index d25124251..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/export_war_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/import_appclient_wiz.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/import_appclient_wiz.gif
deleted file mode 100644
index 351a31dc9..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/import_appclient_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/import_class_file_wiz_ban.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/import_class_file_wiz_ban.gif
deleted file mode 100644
index 81b1e3f61..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/import_class_file_wiz_ban.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/import_ear_wiz.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/import_ear_wiz.gif
deleted file mode 100644
index 67754deee..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/import_ear_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/import_ejbjar_wiz.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/import_ejbjar_wiz.gif
deleted file mode 100644
index d123519da..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/import_ejbjar_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/import_rar_wiz.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/import_rar_wiz.gif
deleted file mode 100644
index ea9dff4f6..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/import_rar_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/import_war_wiz.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/import_war_wiz.gif
deleted file mode 100644
index 514274d38..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/import_war_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/init_param_wiz_ban.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/init_param_wiz_ban.gif
deleted file mode 100644
index 3fb6df46f..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/init_param_wiz_ban.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/mdb_2_1_jms_creation_wiz.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/mdb_2_1_jms_creation_wiz.gif
deleted file mode 100644
index 51b1d5a7f..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/mdb_2_1_jms_creation_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/mdb_2_1_non_jms_creation_wi.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/mdb_2_1_non_jms_creation_wi.gif
deleted file mode 100644
index 51b1d5a7f..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/mdb_2_1_non_jms_creation_wi.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/newservlet_wiz.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/newservlet_wiz.gif
deleted file mode 100644
index 147e57a52..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/newservlet_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/versionmigrate3_wiz.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/versionmigrate3_wiz.gif
deleted file mode 100644
index 9b72bf5de..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/versionmigrate3_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/war_wiz.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/war_wiz.gif
deleted file mode 100644
index d964e2e56..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/war_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/web_library_project_wiz_ban.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/web_library_project_wiz_ban.gif
deleted file mode 100644
index 767a416a0..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/full/wizban/web_library_project_wiz_ban.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/jar_obj.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/jar_obj.gif
deleted file mode 100644
index ec315d5ff..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/jar_obj.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/jcu_obj.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/jcu_obj.gif
deleted file mode 100644
index 36a73ace2..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/jcu_obj.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/key_interf_ov.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/key_interf_ov.gif
deleted file mode 100644
index 307044047..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/key_interf_ov.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/left_arrow.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/left_arrow.gif
deleted file mode 100644
index 3bc383173..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/left_arrow.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/right_arrow.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/right_arrow.gif
deleted file mode 100644
index d03e351aa..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/right_arrow.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/servlet.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/servlet.gif
deleted file mode 100644
index fc1bece72..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/servlet.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/sessionBean_obj.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/sessionBean_obj.gif
deleted file mode 100644
index 507b8a82e..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/sessionBean_obj.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/showerr_tsk.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/showerr_tsk.gif
deleted file mode 100644
index 0bc60689c..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/showerr_tsk.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/showwarn_tsk.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/showwarn_tsk.gif
deleted file mode 100644
index 14009e997..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/showwarn_tsk.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/srvce_elem_obj.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/srvce_elem_obj.gif
deleted file mode 100644
index 6fdcb3fe6..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/srvce_elem_obj.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/util-wiz-banner.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/util-wiz-banner.gif
deleted file mode 100644
index 9b93c9a7a..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/util-wiz-banner.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/util-wiz-icon.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/util-wiz-icon.gif
deleted file mode 100644
index 2038b22ad..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/util-wiz-icon.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/webgroup_obj.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/webgroup_obj.gif
deleted file mode 100644
index 274d361ca..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/webgroup_obj.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/webservicedesc.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/webservicedesc.gif
deleted file mode 100644
index 8fb844f5b..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/webservicedesc.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/icons/wsdl.gif b/plugins/org.eclipse.jst.j2ee.ui/icons/wsdl.gif
deleted file mode 100644
index 8fb844f5b..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/icons/wsdl.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/common/jdt/internal/integration/ui/WTPUIWorkingCopyManager.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/common/jdt/internal/integration/ui/WTPUIWorkingCopyManager.java
deleted file mode 100644
index 686b14e15..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/common/jdt/internal/integration/ui/WTPUIWorkingCopyManager.java
+++ /dev/null
@@ -1,474 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2006 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.jst.common.jdt.internal.integration.ui;
-
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jdt.core.IClassFile;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.internal.ui.JavaPlugin;
-import org.eclipse.jdt.internal.ui.javaeditor.ICompilationUnitDocumentProvider;
-import org.eclipse.jdt.internal.ui.javaeditor.InternalClassFileEditorInput;
-import org.eclipse.jdt.ui.IWorkingCopyManager;
-import org.eclipse.jdt.ui.JavaUI;
-import org.eclipse.jem.util.logger.proxy.Logger;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.source.IAnnotationModel;
-import org.eclipse.jst.common.jdt.internal.integration.WTPWorkingCopyManager;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.part.FileEditorInput;
-import org.eclipse.ui.texteditor.AbstractMarkerAnnotationModel;
-import org.eclipse.ui.texteditor.IDocumentProvider;
-import org.eclipse.wst.common.frameworks.internal.SaveFailedException;
-import org.eclipse.wst.common.frameworks.internal.plugin.WTPCommonPlugin;
-
-/**
- * Insert the type's description here. Creation date: (4/25/2001 7:05:36 PM)
- *
- * @author: Administrator
- */
-public class WTPUIWorkingCopyManager extends WTPWorkingCopyManager {
- private IWorkingCopyManager javaWorkingCopyManager;
- private ICompilationUnitDocumentProvider cuDocumentProvider;
- private HashMap editorInputs;
- private CoreException lastError;
-
- /**
- * WTPUIWorkingCopyManager constructor comment.
- */
- public WTPUIWorkingCopyManager() {
- super();
- cuDocumentProvider = JavaPlugin.getDefault().getCompilationUnitDocumentProvider();
- javaWorkingCopyManager = JavaUI.getWorkingCopyManager();
- }
-
- protected void syncConnect(final IEditorInput input, final ICompilationUnit cu) throws CoreException {
- Display d = Display.getCurrent();
- if (d != null) {
- lastError = null;
- d.syncExec(new Runnable() {
- public void run() {
- try {
- connect(input, cu);
- } catch (CoreException e) {
- lastError = e;
- }
- }
- });
- } else
- connect(input, cu);
- if (lastError != null)
- throw lastError;
- }
-
- /**
- * Connect the CompilationUnitDocumentProvider to the
- *
- * @input and connect the annotation model from the provider to the IDocument of the
- * @input.
- */
- protected void connect(IEditorInput input, ICompilationUnit cu) throws CoreException {
- if (input != null && javaWorkingCopyManager != null && cuDocumentProvider != null ) {
- javaWorkingCopyManager.connect(input);
- getEditorInputs().put(cu, input);
- IDocument doc = cuDocumentProvider.getDocument(input);
- if (doc != null && cuDocumentProvider.getAnnotationModel(input)!= null)
- cuDocumentProvider.getAnnotationModel(input).connect(doc);
- }
- }
-
- protected void revertWorkingCopies() {
- if (getEditorInputs().isEmpty())
- return;
- Iterator it = getEditorInputs().values().iterator();
- IEditorInput input;
- while (it.hasNext()) {
- input = (IEditorInput) it.next();
- revert(input);
- }
- }
-
- /**
- * Disonnect the CompilationUnitDocumentProvider from the
- *
- * @input and disconnect the annotation model from the provider from the IDocument of the
- * @input.
- */
- protected void disconnect(IEditorInput input) {
- IDocument doc = cuDocumentProvider.getDocument(input);
- cuDocumentProvider.getAnnotationModel(input).disconnect(doc);
- javaWorkingCopyManager.disconnect(input);
- }
-
- protected void revert(IEditorInput input) {
- try {
- cuDocumentProvider.resetDocument(input);
- } catch (CoreException e) {
- Logger.getLogger().logError(e);
- }
- IDocument doc = cuDocumentProvider.getDocument(input);
- IAnnotationModel model = cuDocumentProvider.getAnnotationModel(input);
-
- if (model instanceof AbstractMarkerAnnotationModel) {
- AbstractMarkerAnnotationModel markerModel = (AbstractMarkerAnnotationModel) model;
- markerModel.resetMarkers();
- }
- model.disconnect(doc);
- javaWorkingCopyManager.disconnect(input);
- }
-
- protected void disconnectEditorInputs() {
- Iterator it = getEditorInputs().values().iterator();
- IEditorInput input;
- while (it.hasNext()) {
- input = (IEditorInput) it.next();
- disconnect(input);
- }
- }
-
- protected void discardExistingCompilationUnits() {
- if (getEditorInputs().isEmpty())
- return;
- Iterator it = getEditorInputs().values().iterator();
- IEditorInput input;
- while (it.hasNext()) {
- input = (IEditorInput) it.next();
- disconnect(input);
- }
- }
-
- public Set getAffectedFiles() {
- Set aSet = new HashSet();
- Iterator it = getEditorInputs().keySet().iterator();
- ICompilationUnit unit = null;
- IResource resource = null;
- while (it.hasNext()) {
- unit = (ICompilationUnit) it.next();
- if (isDirty(unit)) {
- try {
- resource = unit.getUnderlyingResource();
- } catch (JavaModelException ignore) {
- continue;
- }
- if (resource instanceof IFile)
- aSet.add(resource);
- }
- }
- return aSet;
- }
-
- protected IEditorInput getEditorInput(ICompilationUnit cu) {
- IEditorInput input = primGetEditorInput(cu);
- if (input == null) {
- try {
- input = getEditorInput((IJavaElement) cu);
- } catch (JavaModelException e) {
- //Ignore
- }
- }
- return input;
- }
-
- protected IEditorInput getEditorInput(IJavaElement element) throws JavaModelException {
- while (element != null) {
- switch (element.getElementType()) {
- case IJavaElement.COMPILATION_UNIT : {
- ICompilationUnit cu = (ICompilationUnit) element;
- if (cu.isWorkingCopy())
- cu = cu.getPrimary();
- IResource resource = cu.getUnderlyingResource();
- if (resource.getType() == IResource.FILE)
- return new FileEditorInput((IFile) resource);
- break;
- }
- case IJavaElement.CLASS_FILE :
- return new InternalClassFileEditorInput((IClassFile) element);
- }
- element = element.getParent();
- }
- return null;
- }
-
- /**
- * Insert the method's description here. Creation date: (4/25/2001 7:30:20 PM)
- *
- * @return java.util.HashMap
- */
- protected java.util.HashMap getEditorInputs() {
- if (editorInputs == null)
- editorInputs = new HashMap(20);
- return editorInputs;
- }
-
- /**
- * Returns the working copy remembered for the compilation unit encoded in the given editor
- * input. Does not connect the edit model to the working copy.
- *
- * @param input
- * ICompilationUnit
- * @return the working copy of the compilation unit, or <code>null</code> if the input does
- * not encode an editor input, or if there is no remembered working copy for this
- * compilation unit
- */
- public org.eclipse.jdt.core.ICompilationUnit getExistingWorkingCopy(ICompilationUnit cu) throws CoreException {
- if (cu == null || cu.isWorkingCopy()) {
- return cu;
- }
- ICompilationUnit newCU = super.getExistingWorkingCopy(cu);
- if (newCU != null)
- return newCU;
- IEditorInput editorInput = getEditorInput(cu);
- return javaWorkingCopyManager.getWorkingCopy(editorInput);
- }
-
- /**
- * Returns the working copy remembered for the compilation unit.
- *
- * @param input
- * ICompilationUnit
- * @return the working copy of the compilation unit, or <code>null</code> if there is no
- * remembered working copy for this compilation unit
- */
- public org.eclipse.jdt.core.ICompilationUnit getWorkingCopy(ICompilationUnit cu, boolean forNewCU) throws org.eclipse.core.runtime.CoreException {
- if (forNewCU)
- return super.getWorkingCopy(cu, forNewCU);
- return primGetWorkingCopy(cu);
- }
-
- public boolean isDirty(ICompilationUnit cu) {
- if (cu == null)
- return false;
- IDocumentProvider p = cuDocumentProvider;
- return p == null ? false : p.canSaveDocument(getEditorInput(cu));
- }
-
- /**
- * mustSaveDocument method comment.
- */
- public boolean isSaveNeeded() {
- Iterator it = getEditorInputs().entrySet().iterator();
- while (it.hasNext()) {
- if (cuDocumentProvider.mustSaveDocument(it.next()))
- return true;
- }
- return false;
- }
-
- protected void primDispose() {
- super.primDispose();
- discardExistingCompilationUnits();
- editorInputs = null;
- javaWorkingCopyManager = null;
- }
-
- protected void primRevert() {
- super.primRevert();
- revertWorkingCopies();
- editorInputs = null;
- javaWorkingCopyManager = null;
- }
-
- protected IEditorInput primGetEditorInput(ICompilationUnit cu) {
- return (IEditorInput) getEditorInputs().get(cu);
- }
-
- /**
- * Returns the working copy remembered for the compilation unit encoded in the given editor
- * input.
- *
- * @param input
- * ICompilationUnit
- * @return the working copy of the compilation unit, or <code>null</code> if the input does
- * not encode an editor input, or if there is no remembered working copy for this
- * compilation unit
- */
- protected org.eclipse.jdt.core.ICompilationUnit primGetWorkingCopy(ICompilationUnit cu) throws CoreException {
- if (cu == null) {
- return cu;
- }
- ICompilationUnit primary = cu.getPrimary();
- ICompilationUnit newCU = getNewCompilationUnitWorkingCopy(primary);
- if (newCU != null)
- return newCU;
- IEditorInput editorInput = primGetEditorInput(primary);
- if (editorInput == null) {
- editorInput = getEditorInput(cu);
- syncConnect(editorInput, cu);
- }
- if (cu.isWorkingCopy())
- return cu;
- return javaWorkingCopyManager.getWorkingCopy(editorInput);
- }
-
- /**
- * This will save all of the referenced CompilationUnits to be saved.
- */
- protected void primSaveCompilationUnits(org.eclipse.core.runtime.IProgressMonitor monitor) {
- super.primSaveCompilationUnits(null);
- saveExistingCompilationUnits(monitor);
- }
-
- protected void primSaveDocument(IEditorInput input, IDocument doc, IProgressMonitor monitor) throws CoreException {
- try {
- cuDocumentProvider.saveDocument(monitor, input, doc, true); // overwrite if needed
- } catch (CoreException ex) {
- if (!isFailedWriteFileFailure(ex))
- throw ex;
- IResource resource = (IResource) input.getAdapter(IRESOURCE_CLASS);
- if (resource == null || resource.getType() != IResource.FILE || !resource.getResourceAttributes().isReadOnly())
- throw ex;
-
- if (getSaveHandler().shouldContinueAndMakeFileEditable((IFile) resource))
- cuDocumentProvider.saveDocument(monitor, input, doc, false);
- else
- throw ex;
- }
- }
-
- protected void saveDocument(IEditorInput input, IProgressMonitor monitor) {
- IDocument doc = cuDocumentProvider.getDocument(input);
- boolean canSave = cuDocumentProvider.canSaveDocument(input);
- try {
- if (canSave) {
- ICompilationUnit unit = javaWorkingCopyManager.getWorkingCopy(input);
- synchronized (unit) {
- cuDocumentProvider.aboutToChange(input);
- primSaveDocument(input, doc, monitor);
- }
- }
- } catch (CoreException e) {
- WTPCommonPlugin.getDefault().getLogger().logError(e);
- throw new SaveFailedException(e);
- } finally {
- if (canSave)
- cuDocumentProvider.changed(input);
- }
- }
-
- /**
- * This will save all of the referenced CompilationUnits to be saved.
- */
- protected void saveExistingCompilationUnits(org.eclipse.core.runtime.IProgressMonitor monitor) {
- if (getEditorInputs().isEmpty())
- return;
- if (!validateState()) {
- if (monitor != null)
- monitor.setCanceled(true);
- return;
- }
- Iterator it = getEditorInputs().entrySet().iterator();
- Map.Entry entry;
- // ICompilationUnit cu;
- IEditorInput input;
- try {
- while (it.hasNext()) {
- entry = (Map.Entry) it.next();
- // cu = (ICompilationUnit) entry.getKey();
- input = (IEditorInput) entry.getValue();
- try {
- saveDocument(input, null);
- } finally {
- disconnect(input);
- }
- }
- } finally {
- getEditorInputs().clear();
- }
- }
-
- /**
- * Call validateEdit for all read only IFiles corresponding to each WorkingCopy.
- *
- * @return boolean
- */
- private boolean validateState() {
- List readOnlyFiles = getReadOnlyModifiedFiles();
- if (readOnlyFiles != null && !readOnlyFiles.isEmpty()) {
- IFile[] files = new IFile[readOnlyFiles.size()];
- readOnlyFiles.toArray(files);
- IWorkbenchWindow win = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- Object ctx = win == null ? null : win.getShell();
- IStatus status = ResourcesPlugin.getWorkspace().validateEdit(files, ctx);
- return status.isOK();
- }
- return true;
- }
-
- private List getReadOnlyModifiedFiles() {
- List readOnlyFiles = null;
- IFile readOnlyFile = null;
- Iterator it = getEditorInputs().entrySet().iterator();
- Map.Entry entry;
- // ICompilationUnit cu;
- IEditorInput input;
- IDocumentProvider docProv = cuDocumentProvider;
- while (it.hasNext()) {
- readOnlyFile = null;
- entry = (Map.Entry) it.next();
- // cu = (ICompilationUnit) entry.getKey();
- input = (IEditorInput) entry.getValue();
- if (docProv.canSaveDocument(input))
- readOnlyFile = getReadOnlyFile(input);
- if (readOnlyFile != null) {
- if (readOnlyFiles == null)
- readOnlyFiles = new ArrayList();
- readOnlyFiles.add(readOnlyFile);
- }
- }
- return readOnlyFiles;
- }
-
- private IFile getReadOnlyFile(IEditorInput input) {
- if (input instanceof IFileEditorInput) {
- IFileEditorInput finput = (IFileEditorInput) input;
- IFile file = finput.getFile();
- if (file.isReadOnly())
- return file;
- }
- return null;
- }
-
-
- protected void addDeletedCompilationUnit(ICompilationUnit cu) {
- IEditorInput input = primGetEditorInput(cu);
- if (input != null)
- disconnect(input);
- getEditorInputs().remove(cu);
- super.addDeletedCompilationUnit(cu);
- }
-
- /**
- * @see com.ibm.etools.j2ee.workbench.IJ2EEWorkingCopyManager#hasWorkingCopies()
- */
- public boolean hasWorkingCopies() {
- return super.hasWorkingCopies() || (editorInputs != null && !editorInputs.isEmpty());
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/AddModulestoEARPropertiesPage.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/AddModulestoEARPropertiesPage.java
deleted file mode 100644
index 448a9f71e..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/AddModulestoEARPropertiesPage.java
+++ /dev/null
@@ -1,1357 +0,0 @@
-/*******************************************************************************
- * 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
- * David Schneider, david.schneider@unisys.com - [142500] WTP properties pages fonts don't follow Eclipse preferences
- * Stefan Dimov, stefan.dimov@sap.com - bugs 207826, 222651
- *******************************************************************************/
-package org.eclipse.jst.j2ee.internal;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.IWorkspaceRunnable;
-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.jdt.core.JavaCore;
-import org.eclipse.jdt.ui.wizards.BuildPathDialogAccess;
-import org.eclipse.jem.util.logger.proxy.Logger;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.CheckStateChangedEvent;
-import org.eclipse.jface.viewers.CheckboxTableViewer;
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.ICheckStateListener;
-import org.eclipse.jface.viewers.IContentProvider;
-import org.eclipse.jface.viewers.TableLayout;
-import org.eclipse.jst.j2ee.application.internal.operations.AddComponentToEnterpriseApplicationDataModelProvider;
-import org.eclipse.jst.j2ee.application.internal.operations.RemoveComponentFromEnterpriseApplicationDataModelProvider;
-import org.eclipse.jst.j2ee.application.internal.operations.UpdateManifestDataModelProperties;
-import org.eclipse.jst.j2ee.application.internal.operations.UpdateManifestDataModelProvider;
-import org.eclipse.jst.j2ee.classpathdep.ClasspathDependencyUtil;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveManifest;
-import org.eclipse.jst.j2ee.componentcore.J2EEModuleVirtualArchiveComponent;
-import org.eclipse.jst.j2ee.internal.common.J2EEVersionUtil;
-import org.eclipse.jst.j2ee.internal.common.classpath.J2EEComponentClasspathUpdater;
-import org.eclipse.jst.j2ee.internal.dialogs.ChangeLibDirDialog;
-import org.eclipse.jst.j2ee.internal.dialogs.DependencyConflictResolveDialog;
-import org.eclipse.jst.j2ee.internal.plugin.IJ2EEModuleConstants;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIMessages;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIPlugin;
-import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities;
-import org.eclipse.jst.j2ee.internal.ui.DoubleCheckboxTableItem;
-import org.eclipse.jst.j2ee.internal.ui.DoubleCheckboxTableViewer;
-import org.eclipse.jst.j2ee.model.IEARModelProvider;
-import org.eclipse.jst.j2ee.model.ModelProviderManager;
-import org.eclipse.jst.j2ee.project.EarUtilities;
-import org.eclipse.jst.j2ee.project.JavaEEProjectUtilities;
-import org.eclipse.jst.j2ee.project.facet.EarFacetRuntimeHandler;
-import org.eclipse.jst.j2ee.project.facet.IJ2EEFacetConstants;
-import org.eclipse.jst.j2ee.project.facet.IJavaProjectMigrationDataModelProperties;
-import org.eclipse.jst.j2ee.project.facet.JavaProjectMigrationDataModelProvider;
-import org.eclipse.jst.javaee.application.Application;
-import org.eclipse.jst.jee.project.facet.EarCreateDeploymentFilesDataModelProvider;
-import org.eclipse.jst.jee.project.facet.ICreateDeploymentFilesDataModelProperties;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.datamodel.properties.ICreateReferenceComponentsDataModelProperties;
-import org.eclipse.wst.common.componentcore.internal.builder.DependencyGraphManager;
-import org.eclipse.wst.common.componentcore.internal.operation.CreateReferenceComponentsDataModelProvider;
-import org.eclipse.wst.common.componentcore.internal.operation.RemoveReferenceComponentsDataModelProvider;
-import org.eclipse.wst.common.componentcore.internal.resources.VirtualArchiveComponent;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.common.componentcore.resources.IVirtualFile;
-import org.eclipse.wst.common.componentcore.resources.IVirtualReference;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider;
-import org.eclipse.wst.common.project.facet.core.IFacetedProject;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-
-
-public class AddModulestoEARPropertiesPage implements IJ2EEDependenciesControl, Listener {
-
- protected final String PATH_SEPARATOR = AvailableJ2EEComponentsForEARContentProvider.PATH_SEPARATOR;
- protected final IProject project;
- protected final J2EEDependenciesPage propPage;
- protected IVirtualComponent earComponent = null;
- protected Text componentNameText;
- protected Label availableModules;
- protected CheckboxTableViewer availableComponentsViewer;
- protected Button selectAllButton;
- protected Button deselectAllButton;
- protected Button projectJarButton;
- protected Button externalJarButton;
- protected Button addVariableButton;
- protected Button changeLibPathButton;
- protected Composite buttonColumn;
-
- protected String libDir = null;
- protected String oldLibDir;
- protected List j2eeComponentList = new ArrayList();
- protected List javaProjectsList = new ArrayList();
- protected List j2eeLibElementList = new ArrayList();
- protected List javaLibProjectsList = new ArrayList();
- protected static final IStatus OK_STATUS = IDataModelProvider.OK_STATUS;
- protected boolean isVersion5;
- protected Set libsToUncheck;
- protected Listener tableListener;
- protected Listener labelListener;
-
- //[Bug 238264] the cached list of jars selected using 'add jar' or 'add external jars'
- protected List<IVirtualComponent> addedJARComponents = new ArrayList<IVirtualComponent>();
-
-
- /**
- * Constructor for AddModulestoEARPropertiesControl.
- */
- public AddModulestoEARPropertiesPage(final IProject project, final J2EEDependenciesPage page) {
- this.project = project;
- this.propPage = page;
- earComponent = ComponentCore.createComponent(project);
- boolean hasEE5Facet = false;
- try {
- IFacetedProject facetedProject = ProjectFacetsManager.create(project);
- if(facetedProject != null){
- IProjectFacetVersion facetVersion = facetedProject.getProjectFacetVersion(EarUtilities.ENTERPRISE_APPLICATION_FACET);
- if(facetVersion.equals(EarUtilities.ENTERPRISE_APPLICATION_50)){
- hasEE5Facet = true;
- }
- }
- } catch (CoreException e) {
- Logger.getLogger().log(e);
- }
-
- if(hasEE5Facet){
- String earDDVersion = JavaEEProjectUtilities.getJ2EEDDProjectVersion(project);
- if (earDDVersion.equals(J2EEVersionConstants.VERSION_5_0_TEXT)) {
- isVersion5 = true;
- Application app = (Application)ModelProviderManager.getModelProvider(project).getModelObject();
- if (app != null)
- oldLibDir = app.getLibraryDirectory();
- if (oldLibDir == null) oldLibDir = J2EEConstants.EAR_DEFAULT_LIB_DIR;
- libDir = oldLibDir;
- }
- }
- libsToUncheck = new HashSet();
- }
-
- public Composite createContents(final Composite parent) {
- Composite composite = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.marginWidth = 0;
- layout.marginWidth = 0;
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
- J2EEDependenciesPage.createDescriptionComposite(composite, ManifestUIResourceHandler.EAR_Modules_Desc);
- createListGroup(composite);
- refresh();
- Dialog.applyDialogFont(parent);
- return composite;
- }
-
- protected void createListGroup(Composite parent) {
- Composite listGroup = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.numColumns = 1;
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- listGroup.setLayout(layout);
- GridData gData = new GridData(GridData.FILL_BOTH);
- gData.horizontalIndent = 5;
- listGroup.setLayoutData(gData);
-
- availableModules = new Label(listGroup, SWT.NONE);
- gData = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL);
- availableModules.setText(J2EEUIMessages.getResourceString("AVAILABLE_J2EE_COMPONENTS")); //$NON-NLS-1$ = "Available dependent JARs:"
- availableModules.setLayoutData(gData);
- createTableComposite(listGroup);
- }
-
- public boolean performOk() {
- NullProgressMonitor monitor = new NullProgressMonitor();
- if (isVersion5) {
- if (libDir.length() == 0) {
-
- MessageDialog dlg = new MessageDialog(null,
- J2EEUIMessages.getResourceString(J2EEUIMessages.BLANK_LIB_DIR),
- null, J2EEUIMessages.getResourceString(J2EEUIMessages.BLANK_LIB_DIR_WARN_QUESTION),
- MessageDialog.QUESTION, new String[] {J2EEUIMessages.YES_BUTTON,
- J2EEUIMessages.NO_BUTTON,
- J2EEUIMessages.CANCEL_BUTTON}, 1);
- switch (dlg.open()) {
- case 0: break;
- case 1: {
- handleChangeLibDirButton(false);
- return false;
- }
- case 2: return false;
- default: return false;
- }
- }
- updateLibDir(monitor);
- }
- removeModulesFromEAR(monitor);
- addModulesToEAR(monitor);
- refresh();
- return true;
- }
-
- public void performDefaults() {
- }
-
- public boolean performCancel() {
- return true;
- }
-
- public void dispose() {
- Table table = null;
- if (availableComponentsViewer != null) {
- table = availableComponentsViewer.getTable();
- if (table == null)
- return;
- }
- table.removeListener(SWT.Dispose, tableListener);
- table.removeListener(SWT.KeyDown, tableListener);
- table.removeListener(SWT.MouseMove, tableListener);
- table.removeListener(SWT.MouseHover, tableListener);
- }
-
- public void setVisible(boolean visible) {
- }
-
- private List newJ2EEModulesToAdd(boolean inLibFolder){
- if (inLibFolder && !isVersion5) return null;
- List newComps = new ArrayList();
- List comps = inLibFolder ? j2eeLibElementList : j2eeComponentList;
- if (comps != null && !comps.isEmpty()){
- for (int i = 0; i < comps.size(); i++){
- IVirtualComponent handle = (IVirtualComponent)comps.get(i);
- if (ClasspathDependencyUtil.isClasspathComponentDependency(handle)) {
- continue;
- }
- if( !inEARAlready(handle))
- newComps.add(handle);
- }
- }
- return newComps;
- }
-
- private void updateLibDir(IProgressMonitor monitor) {
- if (libDir.equals(oldLibDir)) return;
- final IEARModelProvider earModel = (IEARModelProvider)ModelProviderManager.getModelProvider(project);
- final Application app = (Application)ModelProviderManager.getModelProvider(project).getModelObject();
- oldLibDir = app.getLibraryDirectory();
- if (oldLibDir == null) oldLibDir = J2EEConstants.EAR_DEFAULT_LIB_DIR;
- earModel.modify(new Runnable() {
- public void run() {
- app.setLibraryDirectory(libDir);
- }}, null);
- }
-
- protected void createDD(IProgressMonitor monitor) {
- if( earComponent != null ){
- IDataModelOperation op = generateEARDDOperation();
- try {
- op.execute(monitor, null);
- } catch (ExecutionException e) {
- Logger.getLogger().log(e);
- }
- }
- }
-
- private void execAddOp(IProgressMonitor monitor, List componentList, String path) throws CoreException {
- if (componentList == null || componentList.isEmpty()) return;
- IDataModel dm = DataModelFactory.createDataModel(new AddComponentToEnterpriseApplicationDataModelProvider());
-
- dm.setProperty(ICreateReferenceComponentsDataModelProperties.SOURCE_COMPONENT, earComponent);
- dm.setProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENT_LIST, componentList);
-
- //[Bug 238264] the uri map needs to be manually set correctly
- Map uriMap = new HashMap();
- IVirtualComponent virtComp;
- String virtCompURIMapName;
- for(int i=0; i<componentList.size(); i++) {
- virtComp = (IVirtualComponent)componentList.get(i);
- virtCompURIMapName = getVirtualComponentNameWithExtension(virtComp);
- uriMap.put(virtComp, virtCompURIMapName);
- }
- dm.setProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENTS_TO_URI_MAP, uriMap);
-
- if (isVersion5) dm.setProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENTS_DEPLOY_PATH, path);
-
- IStatus stat = dm.validateProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENT_LIST);
- if (stat != OK_STATUS)
- throw new CoreException(stat);
- try {
- dm.getDefaultOperation().execute(monitor, null);
- } catch (ExecutionException e) {
- Logger.getLogger().log(e);
- }
- }
-
- private void execAddOp1(IProgressMonitor monitor, List jProjList, List j2eeCompList, String path)
- throws CoreException {
- if (!jProjList.isEmpty()) {
- Set moduleProjects = new HashSet();
- for (int i = 0; i < jProjList.size(); i++) {
- try {
- IProject proj = (IProject) jProjList.get(i);
- moduleProjects.add(proj);
- IDataModel migrationdm = DataModelFactory.createDataModel(new JavaProjectMigrationDataModelProvider());
- migrationdm.setProperty(IJavaProjectMigrationDataModelProperties.PROJECT_NAME, proj.getName());
- migrationdm.getDefaultOperation().execute(monitor, null);
-
-
- IDataModel refdm = DataModelFactory.createDataModel(new CreateReferenceComponentsDataModelProvider());
- List targetCompList = (List) refdm.getProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENT_LIST);
-
- IVirtualComponent targetcomponent = ComponentCore.createComponent(proj);
- targetCompList.add(targetcomponent);
-
- refdm.setProperty(ICreateReferenceComponentsDataModelProperties.SOURCE_COMPONENT, earComponent);
- refdm.setProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENT_LIST, targetCompList);
- if (isVersion5) refdm.setProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENTS_DEPLOY_PATH, path);
-
-
- // referenced java projects should have archiveName attribute
- ((Map)refdm.getProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENTS_TO_URI_MAP)).put(targetcomponent, proj.getName().replace(' ', '_') + IJ2EEModuleConstants.JAR_EXT);
-
- refdm.getDefaultOperation().execute(monitor, null);
- j2eeCompList.add(targetcomponent);
- } catch (ExecutionException e) {
- Logger.getLogger().log(e);
- }
- }
- EarFacetRuntimeHandler.updateModuleProjectRuntime(earComponent.getProject(), moduleProjects, new NullProgressMonitor());
- } // end
-
- }
-
- private IStatus addModulesToEAR(IProgressMonitor monitor) {
- IStatus stat = OK_STATUS;
- try {
- if( earComponent != null ){
- final List list = newJ2EEModulesToAdd(false);
- final List bndList = newJ2EEModulesToAdd(true);
- final boolean shouldRun = (list != null && !list.isEmpty()) || !javaProjectsList.isEmpty();
- final boolean shouldBndRun = isVersion5 &&
- ((bndList != null && !bndList.isEmpty()) || !javaLibProjectsList.isEmpty());
- if(shouldRun || shouldBndRun){
- IWorkspaceRunnable runnable = new IWorkspaceRunnable(){
-
- public void run(IProgressMonitor monitor) throws CoreException{
- if (shouldRun) {
- execAddOp(monitor, list, J2EEConstants.EAR_ROOT_DIR);
- execAddOp1(monitor, javaProjectsList, j2eeComponentList, J2EEConstants.EAR_ROOT_DIR);
- }
- if (shouldBndRun) {
- execAddOp(monitor, bndList, libDir);
- execAddOp1(monitor, javaLibProjectsList, j2eeLibElementList, libDir);
- }
- }
- };
- J2EEUIPlugin.getWorkspace().run(runnable, monitor);
- }
- }
- } catch (Exception e) {
- Logger.getLogger().log(e);
- }
-
- //[Bug 238264] clear out the cache because they should all either be added as references now
- // or no longer checked and therefor not wanted by the user
- this.addedJARComponents.clear();
-
- return OK_STATUS;
- }
-
- private void remComps(List list, String path) {
- if( !list.isEmpty()){
- try {
- // retrieve all dependencies on these components within the scope of the EAR
- Map dependentComps = getEARModuleDependencies(earComponent, list);
- // remove the components from the EAR
- IDataModelOperation op = removeComponentFromEAROperation(earComponent, list, path);
- op.execute(null, null);
- // if that succeeded, remove all EAR-scope J2EE dependencies on these components
- J2EEComponentClasspathUpdater.getInstance().queueUpdateEAR(earComponent.getProject());
- removeEARComponentDependencies(dependentComps);
- } catch (ExecutionException e) {
- Logger.getLogger().log(e);
- }
- }
- }
-
- private IStatus removeModulesFromEAR(IProgressMonitor monitor) {
- IStatus stat = OK_STATUS;
- if (!isVersion5) {
- if(earComponent != null && j2eeComponentList != null) {
- List list = getComponentsToRemove();
- remComps(list, J2EEConstants.EAR_ROOT_DIR);
- }
- } else {
- if( earComponent != null && j2eeComponentList != null) {
- List[] list = getComponentsToRemoveUpdate(!libDir.equals(oldLibDir));
- remComps(list[0], J2EEConstants.EAR_ROOT_DIR);
-
- remComps(list[1], oldLibDir);
- }
- }
- return stat;
- }
-
- private Map getEARModuleDependencies(final IVirtualComponent earComponent, final List components) {
- final Map dependentComps = new HashMap();
- // get all current references to project within the scope of this EAR
- for (int i = 0; i < components.size(); i++) {
-
- final List compsForProject = new ArrayList();
- final IVirtualComponent comp = (IVirtualComponent) components.get(i);
- final IProject[] dependentProjects = DependencyGraphManager.getInstance().getDependencyGraph().getReferencingComponents(comp.getProject());
- for (int j = 0; j < dependentProjects.length; j++) {
- final IProject project = dependentProjects[j];
- // if this is an EAR, can skip
- if (J2EEProjectUtilities.isEARProject(project)) {
- continue;
- }
- final IVirtualComponent dependentComp = ComponentCore.createComponent(project);
- // ensure that the project's share an EAR
- final IProject[] refEARs = J2EEProjectUtilities.getReferencingEARProjects(project);
- boolean sameEAR = false;
- for (int k = 0; k < refEARs.length; k++) {
- if (refEARs[k].equals(earComponent.getProject())) {
- sameEAR = true;
- break;
- }
- }
- if (!sameEAR) {
- continue;
- }
- // if the dependency is a web lib dependency, can skip
- if (J2EEProjectUtilities.isDynamicWebProject(project)) {
- IVirtualReference ref = dependentComp.getReference(comp.getName());
- if (ref != null && ref.getRuntimePath().equals(new Path("/WEB-INF/lib"))) { //$NON-NLS-1$
- continue;
- }
- }
- compsForProject.add(dependentComp);
- }
- dependentComps.put(comp, compsForProject);
- }
- return dependentComps;
- }
-
- private void removeEARComponentDependencies(final Map dependentComps) throws ExecutionException {
- final Iterator targets = dependentComps.keySet().iterator();
- while (targets.hasNext()) {
- final IVirtualComponent target = (IVirtualComponent) targets.next();
- final List sources = (List) dependentComps.get(target);
- for (int i = 0; i < sources.size(); i++) {
- final IVirtualComponent source = (IVirtualComponent) sources.get(i);
- final IDataModel model = DataModelFactory.createDataModel(new RemoveReferenceComponentsDataModelProvider());
- model.setProperty(ICreateReferenceComponentsDataModelProperties.SOURCE_COMPONENT, source);
- final List modHandlesList = (List) model.getProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENT_LIST);
- modHandlesList.add(target);
- model.setProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENT_LIST, modHandlesList);
- model.getDefaultOperation().execute(null, null);
- // update the manifest
- removeManifestDependency(source, target);
- }
- }
- }
-
- private void removeManifestDependency(final IVirtualComponent source, final IVirtualComponent target)
- throws ExecutionException {
- final String sourceProjName = source.getProject().getName();
- String targetProjName;
- if (target instanceof J2EEModuleVirtualArchiveComponent) {
- targetProjName = ((J2EEModuleVirtualArchiveComponent)target).getName();
- String[] pathSegments = targetProjName.split(PATH_SEPARATOR);
- targetProjName = pathSegments[pathSegments.length - 1];
- } else {
- targetProjName = target.getProject().getName();
- }
- final IProgressMonitor monitor = new NullProgressMonitor();
- final IFile manifestmf = J2EEProjectUtilities.getManifestFile(source.getProject());
- final ArchiveManifest mf = J2EEProjectUtilities.readManifest(source.getProject());
- if (mf == null)
- return;
- final IDataModel updateManifestDataModel = DataModelFactory.createDataModel(new UpdateManifestDataModelProvider());
- updateManifestDataModel.setProperty(UpdateManifestDataModelProperties.PROJECT_NAME, sourceProjName);
- updateManifestDataModel.setBooleanProperty(UpdateManifestDataModelProperties.MERGE, false);
- updateManifestDataModel.setProperty(UpdateManifestDataModelProperties.MANIFEST_FILE, manifestmf);
- String[] cp = mf.getClassPathTokenized();
- List cpList = new ArrayList();
- String cpToRemove = (targetProjName.endsWith(".jar")) ?
- targetProjName :
- targetProjName + ".jar";//$NON-NLS-1$
- for (int i = 0; i < cp.length; i++) {
- if (!cp[i].equals(cpToRemove)) {
- cpList.add(cp[i]);
- }
- }
- updateManifestDataModel.setProperty(UpdateManifestDataModelProperties.JAR_LIST, cpList);
- updateManifestDataModel.getDefaultOperation().execute(monitor, null );
- }
-
- protected IDataModelOperation generateEARDDOperation() {
- IDataModel model = DataModelFactory.createDataModel(new EarCreateDeploymentFilesDataModelProvider());
- model.setProperty(ICreateDeploymentFilesDataModelProperties.GENERATE_DD, earComponent);
- model.setProperty(ICreateDeploymentFilesDataModelProperties.TARGET_PROJECT, project);
- return model.getDefaultOperation();
- }
-
- protected IDataModelOperation removeComponentFromEAROperation(IVirtualComponent sourceComponent, List targetComponentsHandles, String dir) {
- IDataModel model = DataModelFactory.createDataModel(new RemoveComponentFromEnterpriseApplicationDataModelProvider());
- model.setProperty(ICreateReferenceComponentsDataModelProperties.SOURCE_COMPONENT, sourceComponent);
- List modHandlesList = (List) model.getProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENT_LIST);
- modHandlesList.addAll(targetComponentsHandles);
- model.setProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENT_LIST, modHandlesList);
- model.setProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENTS_DEPLOY_PATH, dir);
- return model.getDefaultOperation();
- }
-
- protected List getComponentsToRemove(){
- //j2eeComponentList = getCheckedJ2EEElementsAsList();
- List list = new ArrayList();
- if( earComponent != null && list != null ){
- IVirtualReference[] oldrefs = earComponent.getReferences();
- for (int j = 0; j < oldrefs.length; j++) {
- IVirtualReference ref = oldrefs[j];
- IVirtualComponent handle = ref.getReferencedComponent();
- if(!j2eeComponentList.contains(handle) && (isVersion5 ? !j2eeLibElementList.contains(handle) : true)){
- if ((handle instanceof VirtualArchiveComponent) && (isPhysicallyAdded((VirtualArchiveComponent)handle)))
- continue;
- list.add(handle);
- }
- }
- }
- return list;
- }
-
- // EAR5 case
- protected List[] getComponentsToRemoveUpdate(boolean dirUpdated){
- //j2eeComponentList = getCheckedJ2EEElementsAsList();
- List[] list = new ArrayList[2];
- list[0] = new ArrayList();
- list[1] = new ArrayList();
- if( earComponent != null && list != null ){
- IVirtualReference[] oldrefs = earComponent.getReferences();
- for (int j = 0; j < oldrefs.length; j++) {
- IVirtualReference ref = oldrefs[j];
- IVirtualComponent handle = ref.getReferencedComponent();
- if (handle instanceof VirtualArchiveComponent) {
- VirtualArchiveComponent comp = (VirtualArchiveComponent)handle;
- if (isPhysicallyAdded(comp))
- continue;
- }
- if(!j2eeComponentList.contains(handle) && ref.getRuntimePath().isRoot()) {
- list[0].add(handle);
- }
- if((!j2eeLibElementList.contains(handle) || dirUpdated) &&
- ref.getRuntimePath().toString().equals(oldLibDir)) {
- list[1].add(handle);
- }
- }
- }
- return list;
- }
-
-
- public void handleEvent(Event event) {
- if (event.widget == selectAllButton)
- handleSelectAllButtonPressed();
- else if (event.widget == deselectAllButton)
- handleDeselectAllButtonPressed();
- else if(event.widget == projectJarButton)
- handleSelectProjectJarButton();
- else if(event.widget == externalJarButton)
- handleSelectExternalJarButton();
- else if(event.widget == addVariableButton)
- handleSelectVariableButton();
- else if(event.widget == changeLibPathButton) {
- this.handleChangeLibDirButton(true);
- }
- }
-
- private void handleSelectAllButtonPressed() {
- availableComponentsViewer.setAllChecked(true);
- j2eeComponentList = getCheckedJ2EEElementsAsList(true);
- javaProjectsList = getCheckedJavaProjectsAsList(true);
- if (isVersion5) {
- j2eeLibElementList = getCheckedJ2EEElementsAsList(false);
- javaLibProjectsList = getCheckedJavaProjectsAsList(false);
- }
- }
-
- private void handleDeselectAllButtonPressed() {
- availableComponentsViewer.setAllChecked(false);
- if (isVersion5) {
- ((DoubleCheckboxTableViewer)availableComponentsViewer).setAllSecondChecked(false);
- libsToUncheck.clear();
- }
- j2eeComponentList = new ArrayList();
- javaProjectsList = new ArrayList();
- if (isVersion5) {
- j2eeLibElementList = new ArrayList();
- javaLibProjectsList = new ArrayList();
- }
- }
-
- /**
- * [Bug 238264]
- * Add an archive as a potential new reference for this.earComponent
- * NOTE1: the given archive will not be added as a potential reference if there is already a reference to it
- * NOTE2: the given archive will only be added as an actual reference when this.performOk is invoked
- *
- * @param archive the archive to add as a potential new reference in this.earComponent
- *
- */
- private void addPotentialNewReference(IVirtualComponent archive) {
- //check to see if a reference to the given archive already exists
- IVirtualReference [] existingRefs = earComponent.getReferences();
- IVirtualComponent referencedComponent;
- boolean refAlreadyExists = false;
- for(int i=0;i<existingRefs.length && !refAlreadyExists;i++){
- referencedComponent = existingRefs[i].getReferencedComponent();
- refAlreadyExists = referencedComponent.equals(archive);
- }
-
- //only add the archive as a potentialy new reference if it does not already exist
- if(!refAlreadyExists) {
- this.j2eeComponentList.add(archive);
- this.addedJARComponents.add(archive);
- } else {
- //TODO should inform user that they selected an already referenced archive?
- }
- }
-
- private void handleSelectExternalJarButton(){
- IPath[] selected= BuildPathDialogAccess.chooseExternalJAREntries(propPage.getShell());
-
- if (selected != null) {
- for (int i= 0; i < selected.length; i++) {
-
- String type = VirtualArchiveComponent.LIBARCHIVETYPE + IPath.SEPARATOR;
- IVirtualComponent archive = ComponentCore.createArchiveComponent( earComponent.getProject(), type +
- selected[i].toString());
-
- this.addPotentialNewReference(archive);
- }
- refresh();
- }
-
- }
-
- private void handleSelectVariableButton(){
- IPath existingPath[] = new Path[0];
- IPath[] paths = BuildPathDialogAccess.chooseVariableEntries(propPage.getShell(), existingPath);
-
- if (paths != null) {
- refresh();
- for (int i = 0; i < paths.length; i++) {
- IPath resolvedPath= JavaCore.getResolvedVariablePath(paths[i]);
-
- java.io.File file = new java.io.File(resolvedPath.toOSString());
- if( file.isFile() && file.exists()){
- String type = VirtualArchiveComponent.VARARCHIVETYPE + IPath.SEPARATOR;
-
- IVirtualComponent archive = ComponentCore.createArchiveComponent( earComponent.getProject(), type +
- paths[i].toString());
-
- this.addPotentialNewReference(archive);
- }else{
- //display error
- }
- }
- refresh();
- }
- }
-
- private void handleChangeLibDirButton(boolean warnBlank) {
- IVirtualFile vFile = earComponent.getRootFolder().getFile(new Path(J2EEConstants.APPLICATION_DD_URI));
- if (!vFile.exists()) {
- if (!MessageDialog.openQuestion(null,
- J2EEUIMessages.getResourceString(J2EEUIMessages.NO_DD_MSG_TITLE),
- J2EEUIMessages.getResourceString(J2EEUIMessages.GEN_DD_QUESTION))) return;
- createDD(new NullProgressMonitor());
- }
- Application app = (Application)ModelProviderManager.getModelProvider(project).getModelObject();
- if (libDir == null) {
- libDir = app.getLibraryDirectory();
- if (libDir == null) libDir = J2EEConstants.EAR_DEFAULT_LIB_DIR;
- }
-
- ChangeLibDirDialog dlg = new ChangeLibDirDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow()
- .getShell(), libDir, warnBlank);
- if (dlg.open() == Dialog.CANCEL) return;
- libDir = dlg.getValue().trim();
- if (libDir.length() > 0) {
- if (!libDir.startsWith(J2EEConstants.EAR_ROOT_DIR)) libDir = IPath.SEPARATOR + libDir;
- }
- setLibDirInContentProvider();
- refresh();
- }
-
-
- protected void createTableComposite(Composite parent) {
- Composite composite = new Composite(parent, SWT.NONE);
- GridData gData = new GridData(GridData.FILL_BOTH);
- composite.setLayoutData(gData);
- fillComposite(composite);
- }
-
- public void fillComposite(Composite parent) {
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- layout.marginHeight = 0;
- parent.setLayout(layout);
- parent.setLayoutData(new GridData(GridData.FILL_BOTH));
- createTable(parent);
- createButtonColumn(parent);
- }
-
- protected void createButtonColumn(Composite parent) {
- buttonColumn = createButtonColumnComposite(parent);
- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- buttonColumn.setLayoutData(data);
- createPushButtons();
- }
-
- protected void createPushButtons() {
- selectAllButton = createPushButton(SELECT_ALL_BUTTON);
- deselectAllButton = createPushButton(DE_SELECT_ALL_BUTTON);
- projectJarButton = createPushButton(J2EEUIMessages.getResourceString(J2EEUIMessages.PROJECT_JAR));//$NON-NLS-1$
- externalJarButton = createPushButton(J2EEUIMessages.getResourceString(J2EEUIMessages.EXTERNAL_JAR));//$NON-NLS-1$
- addVariableButton = createPushButton(J2EEUIMessages.getResourceString(J2EEUIMessages.ADDVARIABLE));//$NON-NLS-1$
- if (isVersion5) changeLibPathButton = createPushButton(J2EEUIMessages.getResourceString(J2EEUIMessages.CHANGE_LIB_DIR));//$NON-NLS-1$
- }
-
- protected Button createPushButton(String label) {
- Button aButton = primCreatePushButton(label, buttonColumn);
- aButton.addListener(SWT.Selection, this);
- aButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- return aButton;
- }
-
- public Button primCreatePushButton(String label, Composite aButtonColumn) {
- Button aButton = new Button(aButtonColumn, SWT.PUSH);
- aButton.setText(label);
- return aButton;
- }
-
- public Composite createButtonColumnComposite(Composite parent) {
- Composite aButtonColumn = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.numColumns = 1;
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- aButtonColumn.setLayout(layout);
- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_BEGINNING);
- aButtonColumn.setLayoutData(data);
- return aButtonColumn;
- }
-
- public Group createGroup(Composite parent) {
- return new Group(parent, SWT.NULL);
- }
-
- protected void createTable(Composite parent) {
- availableComponentsViewer = createavailableComponentsViewer(parent);
- GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.FILL_VERTICAL);
- availableComponentsViewer.getTable().setLayoutData(gd);
-
- if (earComponent != null) {
- int j2eeVersion = J2EEVersionUtil.convertVersionStringToInt(earComponent);
- AvailableJ2EEComponentsForEARContentProvider provider = new AvailableJ2EEComponentsForEARContentProvider(earComponent, j2eeVersion);
- availableComponentsViewer.setContentProvider(provider);
- availableComponentsViewer.setLabelProvider(provider);
- setLibDirInContentProvider();
- addTableListeners();
- }
- }
-
- private void setLibDirInContentProvider() {
- IContentProvider prov = availableComponentsViewer.getContentProvider();
- if (prov instanceof AvailableJ2EEComponentsForEARContentProvider)
- ((AvailableJ2EEComponentsForEARContentProvider)prov).setCurrentLibDir(libDir);
- }
-
- protected void addTableListeners() {
- addCheckStateListener();
- addHoverHelpListeners();
- }
-
- protected void addHoverHelpListeners() {
- final Table table = availableComponentsViewer.getTable();
- createLabelListener(table);
- createTableListener(table);
- table.addListener(SWT.Dispose, tableListener);
- table.addListener(SWT.KeyDown, tableListener);
- table.addListener(SWT.MouseMove, tableListener);
- table.addListener(SWT.MouseHover, tableListener);
- }
-
- protected void createLabelListener(final Table table) {
- labelListener = new Listener () {
- public void handleEvent (Event event) {
- Label label = (Label)event.widget;
- Shell shell = label.getShell ();
- switch (event.type) {
- case SWT.MouseDown:
- Event e = new Event ();
- e.item = (TableItem) label.getData ("_TABLEITEM");
- table.setSelection (new TableItem [] {(TableItem) e.item});
- table.notifyListeners (SWT.Selection, e);
- shell.dispose ();
- table.setFocus();
- break;
- case SWT.MouseExit:
- shell.dispose ();
- break;
- }
- }
- };
- }
-
- protected void createTableListener(final Table table) {
- tableListener = new Listener () {
- Shell tip = null;
- Label label = null;
- public void handleEvent (Event event) {
- switch (event.type) {
- case SWT.Dispose:
- case SWT.KeyDown:
- case SWT.MouseMove: {
- if (tip == null) break;
- tip.dispose ();
- tip = null;
- label = null;
- break;
- }
- case SWT.MouseHover: {
- TableItem item = table.getItem (new Point (event.x, event.y));
- if (item != null) {
- if (!item.getGrayed())
- return;
- if (tip != null && !tip.isDisposed ()) tip.dispose ();
- tip = new Shell (PlatformUI.getWorkbench().getActiveWorkbenchWindow()
- .getShell(), SWT.ON_TOP | SWT.NO_FOCUS | SWT.TOOL);
- tip.setBackground (Display.getDefault().getSystemColor (SWT.COLOR_INFO_BACKGROUND));
- FillLayout layout = new FillLayout ();
- layout.marginWidth = 2;
- tip.setLayout (layout);
- label = new Label (tip, SWT.WRAP);
- label.setForeground (Display.getDefault().getSystemColor (SWT.COLOR_INFO_FOREGROUND));
- label.setBackground (Display.getDefault().getSystemColor (SWT.COLOR_INFO_BACKGROUND));
- label.setData ("_TABLEITEM", item);
- label.setText (J2EEUIMessages.getResourceString(J2EEUIMessages.HOVER_HELP_FOR_DISABLED_LIBS));
- label.addListener (SWT.MouseExit, labelListener);
- label.addListener (SWT.MouseDown, labelListener);
- Point size = tip.computeSize (SWT.DEFAULT, SWT.DEFAULT);
- Rectangle rect = item.getBounds (0);
- Point pt = table.toDisplay (rect.x, rect.y);
- tip.setBounds (pt.x, pt.y - size.y, size.x, size.y);
- tip.setVisible (true);
- }
- }
- }
- }
- };
- }
-
- protected void addCheckStateListener() {
- availableComponentsViewer.addCheckStateListener(new ICheckStateListener() {
- public void checkStateChanged(CheckStateChangedEvent event) {
- CheckboxTableViewer vr = (CheckboxTableViewer)event.getSource();
- Object element = event.getElement();
- if (vr.getGrayed(element))
- vr.setChecked(element, !vr.getChecked(element));
- Object o = event.getSource();
- if (!(event instanceof SecondCheckBoxStateChangedEvent) && (isVersion5)) {
- Object[] items = ((DoubleCheckboxTableViewer)vr).getUncheckedItems();
- for (int i = 0; i < items.length; i++) {
- DoubleCheckboxTableItem item = (DoubleCheckboxTableItem)items[i];
- if (item.getSecondChecked()) {
- item.setSecondChecked(false);
- libsToUncheck.remove(event.getElement());
- }
- }
- }
- if ((event instanceof SecondCheckBoxStateChangedEvent)) {
- SecondCheckBoxStateChangedEvent evt = (SecondCheckBoxStateChangedEvent)event;
- DoubleCheckboxTableItem tblItem = evt.getTableItem();
- if (tblItem.getSecondChecked() && isConflict(tblItem.getData())) {
- DependencyConflictResolveDialog dlg = new DependencyConflictResolveDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow()
- .getShell(), DependencyConflictResolveDialog.DLG_TYPE_2);
- if (dlg.open() == DependencyConflictResolveDialog.BTN_ID_CANCEL) {
- tblItem.setSecondChecked(false);
- return;
- }
- }
- if (tblItem.getSecondChecked()) {
- if (!tblItem.getChecked())
- tblItem.setChecked(true);
- libsToUncheck.add(event.getElement());
- } else {
- libsToUncheck.remove(event.getElement());
- }
- }
- j2eeComponentList = getCheckedJ2EEElementsAsList(true);
- javaProjectsList = getCheckedJavaProjectsAsList(true);
- if (isVersion5) {
- j2eeLibElementList = getCheckedJ2EEElementsAsList(false);
- javaLibProjectsList = getCheckedJavaProjectsAsList(false);
-
- }
- }
- });
- }
-
- protected List getCPComponentsInEar(boolean inLibFolder) {
- List list = new ArrayList();
- Map pathToComp = new HashMap();
- IVirtualReference refs[] = earComponent.getReferences();
- for( int i=0; i< refs.length; i++){
- IVirtualReference ref = refs[i];
- if ((ref.getRuntimePath().isRoot() && !inLibFolder) ||
- (!ref.getRuntimePath().isRoot() && inLibFolder) ||
- !isVersion5) {
-
- IVirtualComponent comp = ref.getReferencedComponent();
- AvailableJ2EEComponentsForEARContentProvider.addClasspathComponentDependencies(list, pathToComp, comp);
- }
- }
- return list;
- }
-
- protected List getComponentsInEar(boolean inLibFolder) {
- List list = new ArrayList();
- IVirtualReference refs[] = earComponent.getReferences();
- for( int i=0; i< refs.length; i++){
- IVirtualReference ref = refs[i];
- if ((ref.getRuntimePath().isRoot() && !inLibFolder) ||
- (!ref.getRuntimePath().isRoot() && inLibFolder) ||
- !isVersion5) {
-
- IVirtualComponent comp = ref.getReferencedComponent();
- list.add(comp);
- }
- }
- return list;
- }
-
- /**
- *
- * @param componentHandle
- * @return
- * @description returns true is a component is already in the EAR as a dependent
- */
- protected boolean inEARAlready(IVirtualComponent component){
- IVirtualReference refs[] = earComponent.getReferences();
- for( int i=0; i< refs.length; i++){
- IVirtualReference ref = refs[i];
- if ( ref.getReferencedComponent().equals( component ))
- return true;
- }
- return false;
- }
-
- // The next two are used in EAR5 case
- protected List getCheckedJ2EEElementsAsList(boolean singleChecked) {
- Object[] elements;
- if (isVersion5) {
- elements = singleChecked ? ((DoubleCheckboxTableViewer)availableComponentsViewer).getSingleCheckedElements():
- ((DoubleCheckboxTableViewer)availableComponentsViewer).getDoubleCheckedElements();
-
- } else {
- elements = availableComponentsViewer.getCheckedElements();
- }
- List list;
- if (elements == null || elements.length == 0)
- list = new ArrayList(0); // Collections.EMPTY_LIST would cause UnsupportedOperationException when a later attempt to add to it is made
- else {
- list = new ArrayList();
- for (int i = 0; i < elements.length; i++) {
- if (elements[i] instanceof IVirtualComponent) {
- list.add(elements[i]);
- }
- }
- }
- return list;
- }
-
- protected List getCheckedJavaProjectsAsList(boolean single) {
- Object[] elements;
- if (isVersion5) {
- elements = single ? ((DoubleCheckboxTableViewer)availableComponentsViewer).getSingleCheckedElements() :
- ((DoubleCheckboxTableViewer)availableComponentsViewer).getDoubleCheckedElements();
- } else {
- elements = availableComponentsViewer.getCheckedElements();
- }
-
- List list;
- if (elements == null || elements.length == 0)
- list = new ArrayList(0); // Collections.EMPTY_LIST would cause UnsupportedOperationException when a later attempt to add to it is made
- else {
- list = new ArrayList();
- for (int i = 0; i < elements.length; i++) {
- if (elements[i] instanceof IProject) {
- list.add(elements[i]);
- }
- }
- }
- return list;
- }
-
- protected List getLibFolderLibsAsList() {
- Object[] items = ((DoubleCheckboxTableViewer)availableComponentsViewer).getSecondCheckedItems();
- List list;
- if (items == null || items.length == 0)
- list = new ArrayList(0); // Collections.EMPTY_LIST would cause UnsupportedOperationException when a later attempt to add to it is made
- else {
- list = new ArrayList();
- for (int i = 0; i < items.length; i++) {
- Object element = ((DoubleCheckboxTableItem)items[i]).getData();
- if (element instanceof IProject) {
- list.add(element);
- }
- }
- }
- return list;
- }
-
- public CheckboxTableViewer createavailableComponentsViewer(Composite parent) {
- int flags = SWT.CHECK | SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI;
-
- Table table = isVersion5 ? new Table(parent, flags) : new Table(parent, flags);
- availableComponentsViewer = isVersion5 ? new DoubleCheckboxTableViewer(table, 2) : new CheckboxTableViewer(table);
-
- // set up table layout
- TableLayout tableLayout = new org.eclipse.jface.viewers.TableLayout();
- tableLayout.addColumnData(new ColumnWeightData(200, true));
- tableLayout.addColumnData(new ColumnWeightData(200, true));
- if (isVersion5) tableLayout.addColumnData(new ColumnWeightData(200, true));
- table.setLayout(tableLayout);
- table.setHeaderVisible(true);
- table.setLinesVisible(true);
- availableComponentsViewer.setSorter(null);
-
- // table columns
- TableColumn fileNameColumn = new TableColumn(table, SWT.NONE, 0);
- fileNameColumn.setText(ManifestUIResourceHandler.JAR_Module_UI_);
- fileNameColumn.setResizable(true);
-
- TableColumn projectColumn = new TableColumn(table, SWT.NONE, 1);
- projectColumn.setText(ManifestUIResourceHandler.Project_UI_);
- projectColumn.setResizable(true);
-
- if (isVersion5) {
- TableColumn bndColumn = new TableColumn(table, SWT.NONE, 2);
- bndColumn.setText(ManifestUIResourceHandler.Packed_In_Lib_UI_);
- bndColumn.setResizable(true);
- }
-
- tableLayout.layout(table, true);
- return availableComponentsViewer;
-
- }
-
- private boolean secondShouldBeDisabled(IVirtualComponent component) {
- if(component.isBinary()) return false;
- if (JavaEEProjectUtilities.isApplicationClientComponent(component)) return true;
- if (JavaEEProjectUtilities.isEARProject(component.getProject()) && component.isBinary()) return false;
- if (JavaEEProjectUtilities.isEJBComponent(component)) return true;
- if (JavaEEProjectUtilities.isDynamicWebComponent(component)) return true;
- if (JavaEEProjectUtilities.isJCAComponent(component)) return true;
- if (JavaEEProjectUtilities.isStaticWebProject(component.getProject())) return true;
- if (JavaEEProjectUtilities.isProjectOfType(component.getProject(), IJ2EEFacetConstants.JAVA)) return false;
- return false;
- }
-
- private boolean isPhysicallyAdded(VirtualArchiveComponent component) {
- IPath p = null;
- try {
- p = component.getProjectRelativePath();
- return true;
- } catch (IllegalArgumentException e) {
- return false;
- }
- }
-
- private boolean isInLibDir(VirtualArchiveComponent comp) {
- IPath p = comp.getProjectRelativePath();
- if (p.segmentCount() == 2)
- return false;
- return true;
- }
-
-
- public void refresh() {
-
- IWorkspaceRoot input = ResourcesPlugin.getWorkspace().getRoot();
- availableComponentsViewer.setInput(input);
- GridData data = new GridData(GridData.FILL_BOTH);
- int numlines = Math.min(10, availableComponentsViewer.getTable().getItemCount());
- data.heightHint = availableComponentsViewer.getTable().getItemHeight() * numlines;
- availableComponentsViewer.getTable().setLayoutData(data);
-
- //[Bug 238264] for all the jars in the cache temparaly list them in the grid
- // until the user applys the changes
- for(IVirtualComponent jarComponent : this.addedJARComponents) {
- availableComponentsViewer.add(jarComponent);
- }
-
- TableItem [] items = availableComponentsViewer.getTable().getItems();
- List list = new ArrayList();
- //Object[] comps = getComponentsInEar();
- List cpComps;
- List cpLibComps = new LinkedList();
- HashSet j2eeComponentSet = new HashSet();
- HashSet j2eeLibComponentSet = new HashSet();
- if (isVersion5) {
- if( j2eeComponentList.isEmpty() ){
- List comps = getComponentsInEar(false);
- j2eeComponentList.addAll(comps);
- }
- if( j2eeLibElementList.isEmpty() ){
- List comps = getComponentsInEar(true);
- j2eeLibElementList.addAll(comps);
- }
- // get all Classpath contributions to the Ear
- cpComps = getCPComponentsInEar(false);
- j2eeComponentList.addAll(cpComps);
- cpLibComps = getCPComponentsInEar(true);
- j2eeLibElementList.addAll(cpLibComps);
- for (int i = 0; i < j2eeLibElementList.size(); i++) {
- j2eeLibComponentSet.add(j2eeLibElementList.get(i));
- }
-
- } else {
- if( j2eeComponentList.isEmpty() ){
- List comps = getComponentsInEar(false);
- j2eeComponentList.addAll(comps);
- }
- // get all Classpath contributions to the Ear
- cpComps = getCPComponentsInEar(false);
- j2eeComponentList.addAll(cpComps);
- }
- for (int i = 0; i < j2eeComponentList.size(); i++) {
- j2eeComponentSet.add(j2eeComponentList.get(i));
- }
-
- for (int i = 0; i < items.length; i++) {
- Object element = items[i].getData();
- try {
- if (element instanceof IVirtualComponent ||
- (element instanceof IProject && ((IProject) element).hasNature(JavaCore.NATURE_ID))) {
- if (j2eeComponentSet.contains(element)) {
- list.add(element);
- }
- boolean shouldBeDisabled = false;
- if (element instanceof VirtualArchiveComponent) {
- shouldBeDisabled = isPhysicallyAdded((VirtualArchiveComponent)element);
- if (shouldBeDisabled) {
- items[i].setChecked(true);
- items[i].setGrayed(true);
- }
- }
- if (isVersion5) {
- DoubleCheckboxTableItem dcbItem = (DoubleCheckboxTableItem)items[i];
- boolean secondEnabled = true;
- if (element instanceof IVirtualComponent)
- secondEnabled = !secondShouldBeDisabled((IVirtualComponent) element);
- if (shouldBeDisabled) {
- dcbItem.setSecondChecked(isInLibDir((VirtualArchiveComponent)element));
- dcbItem.setSecondEnabled(false);
- } else {
- dcbItem.setSecondChecked(j2eeLibComponentSet.contains(element));
- dcbItem.setSecondEnabled(secondEnabled);
- }
- if (j2eeLibComponentSet.contains(element)) list.add(element);
- }
- }
- } catch (CoreException e) {
- J2EEUIPlugin.logError(0, e.getMessage(), e);
- }
- }
-
- for (int i = 0; i < list.size(); i++)
- availableComponentsViewer.setChecked(list.get(i), true);
- GridData btndata = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_BEGINNING);
- buttonColumn.setLayoutData(btndata);
-
- }
-
- private boolean isConflict(Object lib) {
- IProject libProj = (lib instanceof IProject) ? (IProject)lib : ((IVirtualComponent)lib).getProject();
- IProject earProject = earComponent.getProject();
- try {
- IVirtualComponent cmp = ComponentCore.createComponent(earProject);
- IProject[] earRefProjects = earProject.getReferencedProjects();
- for (int i = 0; i < earRefProjects.length; i++) {
- if (!J2EEProjectUtilities.isEARProject(earRefProjects[i]) &&
- !earRefProjects[i].equals(libProj)) {
- IVirtualComponent cmp1 = ComponentCore.createComponent(earRefProjects[i]);
- IVirtualReference[] refs = cmp1.getReferences();
- for (int j = 0; j < refs.length; j++) {
- if (refs[j].getReferencedComponent().getProject().equals(libProj)) return true;
- }
- }
- }
- return false;
- } catch (CoreException ce) {
- Logger.getLogger().log(ce);
- }
- return false;
- }
-
- private void handleSelectProjectJarButton(){
- IPath[] selected= BuildPathDialogAccess.chooseJAREntries(propPage.getShell(), project.getLocation(), new IPath[0]);
-
- if (selected != null) {
- for (int i= 0; i < selected.length; i++) {
- //IPath fullPath = project.getFile(selected[i]).getFullPath();
- String type = VirtualArchiveComponent.LIBARCHIVETYPE + IPath.SEPARATOR;
- IVirtualComponent archive = ComponentCore.createArchiveComponent( earComponent.getProject(), type +
- selected[i].makeRelative().toString());
-
- this.addPotentialNewReference(archive);
- }
- refresh();
- }
-
- }
-
- /**
- * [Bug 238264]
- * determines a unique URI mapping name for a given component
- * this is in case two components have the same name.
- *
- * @return returns a valid (none duplicate) uri mapping name for the given component\
- */
- private String getURIMappingName(IVirtualComponent archive) {
-
- //get the default uri map name for the given archive
- IPath componentPath = Path.fromOSString(archive.getName());
- String uriMapName = componentPath.lastSegment().replace(' ', '_');
-
-
- //check to be sure this uri mapping is not already in use by another reference
- boolean dupeArchiveName;
- String refedCompName;
- int lastDotIndex;
- String increment;
- IVirtualReference [] existingRefs = earComponent.getReferences();
- for(int i=0;i<existingRefs.length;i++){
- refedCompName = existingRefs[i].getReferencedComponent().getName();
-
- //if uri mapping names of the refed component and the given archive are the same
- // find a new uri map name for the given archive
- if(existingRefs[i].getArchiveName().equals(uriMapName)){
- dupeArchiveName = true;
- //find a new uriMapName for the given component
- for(int j=1; dupeArchiveName; j++){
- lastDotIndex = uriMapName.lastIndexOf('.');
- increment = "_"+j; //$NON-NLS-1$
-
- //create the new potential name
- if(lastDotIndex != -1){
- uriMapName = uriMapName.substring(0, lastDotIndex) + increment + uriMapName.substring(lastDotIndex);
- } else {
- uriMapName = uriMapName.substring(0)+increment;
- }
-
- //determine if the new potential name is valid
- for(int k=0; k<existingRefs.length; k++) {
- dupeArchiveName = existingRefs[k].getArchiveName().equals(uriMapName);
- if(dupeArchiveName) {
- break;
- }
- }
- }
- }
- }
-
- return uriMapName;
- }
-
- /**
- * Method returns the name of the given IVirtualComponent being sure the correct extension
- * is on the end of the name, this is important for internal projects. Added for [Bug 241509]
- *
- * @param virtComp the IVirtualComponent to get the name of with the correct extension
- * @return the name of the given IVirtualComponent with the correct extension
- */
- private String getVirtualComponentNameWithExtension(IVirtualComponent virtComp) {
- String virtCompURIMapName = this.getURIMappingName(virtComp);
-
- boolean linkedToEAR = true;
- try {
- if(virtComp.isBinary()){
- linkedToEAR = ((J2EEModuleVirtualArchiveComponent)virtComp).isLinkedToEAR();
- ((J2EEModuleVirtualArchiveComponent)virtComp).setLinkedToEAR(false);
- }
- if(JavaEEProjectUtilities.isDynamicWebComponent(virtComp)) {
- if(!virtCompURIMapName.endsWith(IJ2EEModuleConstants.WAR_EXT)) {
- //web module URIs need to end in WAR
- virtCompURIMapName += IJ2EEModuleConstants.WAR_EXT;
- }
- } else if(JavaEEProjectUtilities.isJCAComponent(virtComp)) {
- if(!virtCompURIMapName.endsWith(IJ2EEModuleConstants.RAR_EXT)) {
- //connector module URIs need to end in RAR
- virtCompURIMapName += IJ2EEModuleConstants.RAR_EXT;
- }
- } else if(!virtCompURIMapName.endsWith(IJ2EEModuleConstants.JAR_EXT)) {
- //all other modules (EJB, AppClient, Utility) need to end in JAR
- virtCompURIMapName += IJ2EEModuleConstants.JAR_EXT;
- }
- } finally {
- if(virtComp.isBinary()){
- ((J2EEModuleVirtualArchiveComponent)virtComp).setLinkedToEAR(linkedToEAR);
- }
- }
- return virtCompURIMapName;
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/AvailableJ2EEComponentsForEARContentProvider.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/AvailableJ2EEComponentsForEARContentProvider.java
deleted file mode 100644
index 3eed372c7..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/AvailableJ2EEComponentsForEARContentProvider.java
+++ /dev/null
@@ -1,297 +0,0 @@
-/*******************************************************************************
- * 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
- * Stefan Dimov, stefan.dimov@sap.com - bug 207826
- *******************************************************************************/
-package org.eclipse.jst.j2ee.internal;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jem.util.logger.proxy.Logger;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jst.j2ee.application.internal.operations.ClassPathSelection;
-import org.eclipse.jst.j2ee.classpathdep.ClasspathDependencyUtil;
-import org.eclipse.jst.j2ee.classpathdep.IClasspathDependencyConstants;
-import org.eclipse.jst.j2ee.componentcore.J2EEModuleVirtualComponent;
-import org.eclipse.jst.j2ee.internal.common.J2EEVersionUtil;
-import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities;
-import org.eclipse.jst.j2ee.model.IEARModelProvider;
-import org.eclipse.jst.j2ee.model.IModelProvider;
-import org.eclipse.jst.j2ee.model.ModelProviderManager;
-import org.eclipse.jst.javaee.application.Application;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.ModuleCoreNature;
-import org.eclipse.wst.common.componentcore.internal.resources.VirtualArchiveComponent;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.common.componentcore.resources.IVirtualReference;
-
-public class AvailableJ2EEComponentsForEARContentProvider implements IStructuredContentProvider, ITableLabelProvider {
-
- final static String PATH_SEPARATOR = String.valueOf(IPath.SEPARATOR);
-
- private int j2eeVersion;
- private IVirtualComponent earComponent;
- private boolean isEE5 = false;
- private String libDir = null;
-
-
- public AvailableJ2EEComponentsForEARContentProvider(IVirtualComponent aEarComponent, int j2eeVersion) {
- super();
- this.j2eeVersion = j2eeVersion;
- earComponent = aEarComponent;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
- */
- public Object[] getElements(Object inputElement) {
- if (null != earComponent){
- isEE5 = J2EEProjectUtilities.isJEEProject(earComponent.getProject());
- }
- Object[] empty = new Object[0];
- if (!(inputElement instanceof IWorkspaceRoot))
- return empty;
- IProject[] projects = ((IWorkspaceRoot) inputElement).getProjects();
- if (projects == null || projects.length == 0)
- return empty;
- List validCompList = new ArrayList();
- Map pathToComp = new HashMap();
- for (int i = 0; i < projects.length; i++) {
- // get flexible project
- IProject project = projects[i];
- if(ModuleCoreNature.isFlexibleProject(project)){
- IVirtualComponent component = ComponentCore.createComponent(project);
- if (J2EEProjectUtilities.isApplicationClientProject(project) ||
- J2EEProjectUtilities.isEJBProject(project) ||
- J2EEProjectUtilities.isDynamicWebProject(project) ||
- J2EEProjectUtilities.isJCAProject(project) ||
- J2EEProjectUtilities.isUtilityProject(project) ){
- int compJ2EEVersion = J2EEVersionUtil.convertVersionStringToInt(component);
- if( compJ2EEVersion <= j2eeVersion){
- validCompList.add(component);
- } else if(isEE5){
- validCompList.add(component);
- }
- }else if(null != earComponent && J2EEProjectUtilities.isEARProject(project)){
- //find the ArchiveComponent
- if(component.equals( earComponent )){
- if (isEE5) {
- Application app = (Application)ModelProviderManager.getModelProvider(project).getModelObject();
- if (libDir == null)
- libDir = app.getLibraryDirectory();
- if (libDir == null)
- libDir = J2EEConstants.EAR_DEFAULT_LIB_DIR;
- }
- IVirtualReference[] newrefs = component.getReferences();
- for( int k=0; k< newrefs.length; k++ ){
- IVirtualReference tmpref = newrefs[k];
- IVirtualComponent referencedcomp = tmpref.getReferencedComponent();
- boolean isBinary = referencedcomp.isBinary();
- if( isBinary ){
- if (shouldShow(referencedcomp))
- validCompList.add(referencedcomp);
- } else {
- addClasspathComponentDependencies(validCompList, pathToComp, referencedcomp);
- }
- }
- }
- }
- } else
- try {
- if (project.exists() && project.isAccessible() && project.hasNature("org.eclipse.jdt.core.javanature") ){ //$NON-NLS-1$
- if( !project.getName().startsWith(".") ) //$NON-NLS-1$
- validCompList.add(project);
- }
- } catch (CoreException e) {
- Logger.getLogger().log(e);
- }
- }
- return validCompList.toArray();
- }
-
- public void setCurrentLibDir(String libDir) {
- this.libDir = libDir;
- }
-
- private boolean shouldShow(IVirtualComponent component) {
- if (!(component instanceof VirtualArchiveComponent))
- return true;
-
- VirtualArchiveComponent comp = (VirtualArchiveComponent)component;
- IPath p = null;
- try {
- p = comp.getProjectRelativePath();
- } catch (IllegalArgumentException e) {
- return true;
- }
- if ((p == null) && (p.segmentCount() == 0))
- return true;
- IContainer f = earComponent.getRootFolder().getUnderlyingFolder();
- String rootFolderName = f.getProjectRelativePath().segment(0);
- if (!p.segment(0).equals(rootFolderName))
- return false;
- if (p.segmentCount() == 2)
- return true;
- if (isEE5) {
- String strippedLibDir = stripSeparators(libDir);
- String[] libDirSegs = strippedLibDir.split(PATH_SEPARATOR);
- if (p.segmentCount() - 2 != libDirSegs.length)
- return false;
- for (int i = 0; i < libDirSegs.length; i++)
- if (!libDirSegs[i].equals(p.segment(i + 1)))
- return false;
- return true;
- }
- return false;
- }
-
- private String stripSeparators(String dir) {
- if (dir.startsWith(PATH_SEPARATOR))
- dir = dir.substring(1);
- if (dir.endsWith(PATH_SEPARATOR))
- dir = dir.substring(0, dir.length() - 1);
- return dir;
- }
-
- public static void addClasspathComponentDependencies(final List componentList, final Map pathToComp, final IVirtualComponent referencedComponent) {
- if (referencedComponent instanceof J2EEModuleVirtualComponent) {
- J2EEModuleVirtualComponent j2eeComp = (J2EEModuleVirtualComponent) referencedComponent;
- IVirtualReference[] cpRefs = j2eeComp.getJavaClasspathReferences();
- for (int j=0; j < cpRefs.length; j++) {
- String unresolvedURI = null;
- // only ../ mappings supported at this level
- if (!cpRefs[j].getRuntimePath().equals(IClasspathDependencyConstants.RUNTIME_MAPPING_INTO_CONTAINER_PATH)) {
- continue;
- }
- // if the absolute path for this component already has a mapping, skip (the comp might be contributed by more than
- // one child module)
- final IPath path = ClasspathDependencyUtil.getClasspathVirtualReferenceLocation(cpRefs[j]);
- final IVirtualComponent comp = (IVirtualComponent) pathToComp.get(path);
- if (comp != null) {
- // replace with a temp VirtualArchiveComponent whose IProject is set to a new pseudo name that is
- // the concatenation of all project contributions for that archive
- if (comp instanceof VirtualArchiveComponent) {
- final VirtualArchiveComponent oldComp = (VirtualArchiveComponent) comp;
- componentList.remove(comp);
- final VirtualArchiveComponent newComponent = ClassPathSelection.updateDisplayVirtualArchiveComponent(oldComp, cpRefs[j]);
- pathToComp.put(path, newComponent);
- componentList.add(newComponent);
- }
- continue;
- } else {
- pathToComp.put(path, cpRefs[j].getReferencedComponent());
- }
- componentList.add(cpRefs[j].getReferencedComponent());
- }
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object, int)
- */
- public Image getColumnImage(Object element, int columnIndex) {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, int)
- */
- public String getColumnText(Object element, int columnIndex) {
- if (element instanceof IVirtualComponent) {
- IVirtualComponent comp = (IVirtualComponent)element;
- String name = ""; //$NON-NLS-1$
- if( columnIndex == 0 ){
- if (ClasspathDependencyUtil.isClasspathComponentDependency(comp)) {
- return ClasspathDependencyUtil.getClasspathComponentDependencyDisplayString(comp);
- }
- IModelProvider provider = ModelProviderManager.getModelProvider(earComponent.getProject());
- if (provider instanceof IEARModelProvider)
- {
- name = ((IEARModelProvider)provider).getModuleURI(comp);
- }
- if( name == null || name == "" ){ //$NON-NLS-1$
- name = comp.getName();
- }
- return name;
- } else if (columnIndex == 1) {
- return comp.getProject().getName();
- } else if (columnIndex == 2) {
- return ""; //$NON-NLS-1$
- }
- } else if (element instanceof IProject){
- if (columnIndex != 2) {
- return ((IProject)element).getName();
- } else {
- return ""; //$NON-NLS-1$
- }
- }
- return null;
- }
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer,
- * java.lang.Object, java.lang.Object)
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- //do nothing
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.IBaseLabelProvider#addListener(org.eclipse.jface.viewers.ILabelProviderListener)
- */
- public void addListener(ILabelProviderListener listener) {
- //do nothing
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.IBaseLabelProvider#isLabelProperty(java.lang.Object,
- * java.lang.String)
- */
- public boolean isLabelProperty(Object element, String property) {
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.IBaseLabelProvider#removeListener(org.eclipse.jface.viewers.ILabelProviderListener)
- */
- public void removeListener(ILabelProviderListener listener) {
- //do nothing
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IContentProvider#dispose()
- */
- public void dispose() {
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ClassHelperAdapterFactory.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ClassHelperAdapterFactory.java
deleted file mode 100644
index 163ae74c2..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ClassHelperAdapterFactory.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2006 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.jst.j2ee.internal;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.jst.j2ee.internal.ejb.provider.J2EEJavaClassProviderHelper;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIPlugin;
-
-public class ClassHelperAdapterFactory implements IAdapterFactory {
-
- private static final Class IFILE_CLASS = IFile.class;
- private static final Class IRESOURCE_CLASS = IResource.class;
-
- private static final Class[] ADAPTER_TYPES = new Class[] {
- IFILE_CLASS, IRESOURCE_CLASS
- };
-
- public Object getAdapter(Object adaptableObject, Class adapterType) {
- if(IRESOURCE_CLASS == adapterType || IFILE_CLASS == adapterType) {
- if(adaptableObject instanceof J2EEJavaClassProviderHelper) {
- J2EEJavaClassProviderHelper provider = (J2EEJavaClassProviderHelper) adaptableObject;
- try {
- IResource resource = (IResource) provider.getAdapter(IRESOURCE_CLASS);
- return resource;
- } catch (RuntimeException e) {
- J2EEUIPlugin.logError(0, e.getMessage(), e);
- return null;
- }
- }
- }
- return null;
- }
-
- public Class[] getAdapterList() {
- return ADAPTER_TYPES;
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ClasspathTableManager.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ClasspathTableManager.java
deleted file mode 100644
index 9edc01159..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ClasspathTableManager.java
+++ /dev/null
@@ -1,647 +0,0 @@
-/*******************************************************************************
- * 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
- * Stefan Dimov, stefan.dimov@sap.com - bug 207826
- *******************************************************************************/
-/*
- * Created on Jan 17, 2005
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-package org.eclipse.jst.j2ee.internal;
-
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jface.viewers.CheckStateChangedEvent;
-import org.eclipse.jface.viewers.CheckboxTableViewer;
-import org.eclipse.jface.viewers.ICheckStateListener;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jst.j2ee.application.internal.operations.ClassPathSelection;
-import org.eclipse.jst.j2ee.application.internal.operations.ClasspathElement;
-import org.eclipse.jst.j2ee.componentcore.J2EEModuleVirtualArchiveComponent;
-import org.eclipse.jst.j2ee.internal.common.ClasspathModel;
-import org.eclipse.jst.j2ee.internal.listeners.IValidateEditListener;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIMessages;
-import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities;
-import org.eclipse.jst.j2ee.internal.wizard.AvailableJarsProvider;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.common.componentcore.resources.IVirtualReference;
-import org.eclipse.jst.j2ee.internal.common.ClasspathModelEvent;
-import org.eclipse.jst.j2ee.internal.dialogs.DependencyConflictResolveDialog;
-import org.eclipse.jst.j2ee.project.facet.IJ2EEFacetConstants;
-
-/**
- * @author jialin
- *
- * TODO To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-public class ClasspathTableManager implements Listener, ICommonManifestUIConstants {
-
- protected Button useClientJARsBtn;
- protected Button useServerJARsBtn;
- protected Button useAnyJARsBtn;
- protected Button upButton;
- protected Button downButton;
- protected Button selectAllButton;
- protected Button deselectAllButton;
- protected IClasspathTableOwner owner;
- protected Composite buttonColumn;
- protected ClasspathModel model;
- protected CheckboxTableViewer availableJARsViewer;
- protected IValidateEditListener validateEditListener;
- /**
- * @deprecated this field should be removed
- */
- protected boolean isWLPEntry;
- protected Group radioGroup;
-
- protected boolean readOnly;
- protected AvailableJarsProvider availableJarsProvider;
- protected Button externalJarButton;
- protected Button projectJarButton;
- protected Button addVariableButton;
-
- protected Set compsToUncheck = new HashSet();
-
- /**
- * Constructor for ButtonBarManager.
- */
- public ClasspathTableManager(IClasspathTableOwner owner, ClasspathModel model) {
- this(owner, model, null);
- }
-
- public ClasspathTableManager(IClasspathTableOwner owner, ClasspathModel model, IValidateEditListener listener) {
- super();
- this.owner = owner;
- this.model = model;
- this.validateEditListener = listener;
- }
- public void fillComposite(Composite parent) {
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- layout.marginHeight = 0;
- parent.setLayout(layout);
- parent.setLayoutData(new GridData(GridData.FILL_BOTH));
- createRadioGroup(parent);
- createTable(parent);
- createButtonColumn(parent);
- }
-
- public void fillWLPComposite(Composite parent) {
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- layout.marginHeight = 0;
- parent.setLayout(layout);
- parent.setLayoutData(new GridData(GridData.FILL_BOTH));
- createTable(parent);
- createWLPButtonColumn(parent);
- }
-
- public void fillWebRefComposite(Composite parent) {
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- layout.marginHeight = 0;
- parent.setLayout(layout);
- parent.setLayoutData(new GridData(GridData.FILL_BOTH));
- createTable(parent);
- createWebRefButtonColumn(parent);
- }
-
- private void initializeEJBClientDefaults() {
- if (model == null || model.getClassPathSelection() == null)
- return;
- boolean shouldUseServerJARs = false;
- ClassPathSelection selection = model.getClassPathSelection();
- int filterLevel;
- boolean ejbSelected = selection.isAnyEJBJarSelected();
- boolean clientSelected = selection.isAnyEJBClientJARSelected();
- if (ejbSelected && clientSelected)
- filterLevel = ClassPathSelection.FILTER_NONE;
- else if (shouldUseServerJARs) {
- if (clientSelected)
- filterLevel = ClassPathSelection.FILTER_NONE;
- else
- filterLevel = ClassPathSelection.FILTER_EJB_CLIENT_JARS;
- } else {
- if (ejbSelected)
- filterLevel = ClassPathSelection.FILTER_NONE;
- else
- filterLevel = ClassPathSelection.FILTER_EJB_SERVER_JARS;
- }
- initFilterLevel(filterLevel);
- }
-
- private void initFilterLevel(int filterLevel) {
- model.getClassPathSelection().setFilterLevel(filterLevel);
- switch (filterLevel) {
- case (ClassPathSelection.FILTER_NONE) :
- useAnyJARsBtn.setSelection(true);
- useClientJARsBtn.setSelection(false);
- useServerJARsBtn.setSelection(false);
- break;
- case (ClassPathSelection.FILTER_EJB_CLIENT_JARS) :
- useAnyJARsBtn.setSelection(false);
- useClientJARsBtn.setSelection(false);
- useServerJARsBtn.setSelection(true);
- break;
- case (ClassPathSelection.FILTER_EJB_SERVER_JARS) :
- useAnyJARsBtn.setSelection(false);
- useClientJARsBtn.setSelection(true);
- useServerJARsBtn.setSelection(false);
- break;
- }
- }
-
- private void createRadioGroup(Composite parent) {
- radioGroup = owner.createGroup(parent);
- radioGroup.setText(EJB_CLIENT_RADIO_UI_);
- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL);
- data.horizontalSpan = 2;
- data.horizontalIndent = 0;
- GridLayout layout = new GridLayout(3, false);
- radioGroup.setLayout(layout);
- radioGroup.setLayoutData(data);
-
- useServerJARsBtn = createRadioButton(USE_EJB_SERVER_JARs_UI_, radioGroup);
- useClientJARsBtn = createRadioButton(USE_EJB_CLIENT_JARs_UI_, radioGroup);
- useAnyJARsBtn = createRadioButton(USE_BOTH_UI_, radioGroup);
- initializeEJBClientDefaults();
- }
-
- protected void createButtonColumn(Composite parent) {
- buttonColumn = owner.createButtonColumnComposite(parent);
- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- buttonColumn.setLayoutData(data);
- createPushButtons();
- }
-
- protected void createWLPButtonColumn(Composite parent) {
- buttonColumn = owner.createButtonColumnComposite(parent);
- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- buttonColumn.setLayoutData(data);
- createWLPPushButtons();
- }
-
- protected void createWebRefButtonColumn(Composite parent) {
- buttonColumn = owner.createButtonColumnComposite(parent);
- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_END);
- buttonColumn.setLayoutData(data);
- createWebRefPushButtons();
- }
-
- protected void createTable(Composite parent) {
- availableJARsViewer = owner.createAvailableJARsViewer(parent);
- GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.FILL_VERTICAL);
- availableJARsViewer.getTable().setLayoutData(gd);
- availableJarsProvider = new AvailableJarsProvider();
- availableJARsViewer.setContentProvider(availableJarsProvider);
- availableJARsViewer.setLabelProvider(availableJarsProvider);
- addTableListeners();
- }
-
- protected void createWLPPushButtons() {
- selectAllButton = createPushButton(SELECT_ALL_BUTTON);
- deselectAllButton = createPushButton(DE_SELECT_ALL_BUTTON);
- projectJarButton = createPushButton(J2EEUIMessages.getResourceString("PROJECT_JAR")); //$NON-NLS-1$
- externalJarButton = createPushButton(J2EEUIMessages.getResourceString("EXTERNAL_JAR")); //$NON-NLS-1$
- addVariableButton = createPushButton(J2EEUIMessages.getResourceString("ADDVARIABLE"));//$NON-NLS-1$
- if (isReadOnly()) {
- selectAllButton.setEnabled(false);
- deselectAllButton.setEnabled(false);
- projectJarButton.setEnabled(false);
- externalJarButton.setEnabled(false);
- addVariableButton.setEnabled(false);
- }
- }
-
- protected void createWebRefPushButtons() {
- selectAllButton = createPushButton(SELECT_ALL_BUTTON);
- deselectAllButton = createPushButton(DE_SELECT_ALL_BUTTON);
- if (isReadOnly()) {
- selectAllButton.setEnabled(false);
- deselectAllButton.setEnabled(false);
- }
- }
-
- protected void createPushButtons() {
- upButton = createPushButton(UP_BUTTON);
- downButton = createPushButton(DOWN_BUTTON);
- selectAllButton = createPushButton(SELECT_ALL_BUTTON);
- deselectAllButton = createPushButton(DE_SELECT_ALL_BUTTON);
- if (isReadOnly()) {
- upButton.setEnabled(false);
- downButton.setEnabled(false);
- selectAllButton.setEnabled(false);
- deselectAllButton.setEnabled(false);
- }
- }
-
- protected void createWebLibPushButtons() {
- selectAllButton = createPushButton(SELECT_ALL_BUTTON);
- deselectAllButton = createPushButton(DE_SELECT_ALL_BUTTON);
- projectJarButton = createPushButton(J2EEUIMessages.getResourceString("PROJECT_JAR")); //$NON-NLS-1$
- externalJarButton = createPushButton(J2EEUIMessages.getResourceString("EXTERNAL_JAR")); //$NON-NLS-1$
- addVariableButton = createPushButton(J2EEUIMessages.getResourceString("ADDVARIABLE"));//$NON-NLS-1$
- if (isReadOnly()) {
- selectAllButton.setEnabled(false);
- deselectAllButton.setEnabled(false);
- }
- }
-
- protected Button createPushButton(String label) {
- Button aButton = owner.primCreatePushButton(label, buttonColumn);
- aButton.addListener(SWT.Selection, this);
- aButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- return aButton;
- }
-
- protected Button createRadioButton(String label, Composite parent) {
- Button aButton = owner.primCreateRadioButton(label, parent);
- aButton.addListener(SWT.Selection, this);
- return aButton;
- }
- /**
- * @see Listener#handleEvent(Event)
- */
- public void handleEvent(Event event) {
-
- ClasspathModelEvent evt = new ClasspathModelEvent(ClasspathModelEvent.CLASS_PATH_CHANGED);
- model.fireNotification(evt);
- if (event.widget == upButton)
- upButtonSelected();
- else if (event.widget == downButton)
- downButtonSelected();
- else if (event.widget == selectAllButton)
- selectAllButtonSelected();
- else if (event.widget == deselectAllButton)
- deselectAllButtonSelected();
- else if (event.widget == useServerJARsBtn)
- handleServerJARsButtonSelected();
- else if (event.widget == useClientJARsBtn)
- handleClientJARsButtonSelected();
- else if (event.widget == useAnyJARsBtn)
- handleAnyJARsButtonSelected();
- else if(event.widget == projectJarButton)
- handleSelectProjectJarButton();
- else if(event.widget == externalJarButton)
- handleSelectExternalJarButton();
- else if(event.widget == addVariableButton)
- handleSelectVariableButton();
- }
-
- private void handleSelectExternalJarButton(){
- //owner.handleSelectExternalJarButton();
- if( owner instanceof WebLibDependencyPropertiesPage){
- WebLibDependencyPropertiesPage control = (WebLibDependencyPropertiesPage)owner;
- control.handleSelectExternalJarButton();
- }
- }
- private void handleSelectProjectJarButton(){
- //owner.handleSelectExternalJarButton();
- if( owner instanceof WebLibDependencyPropertiesPage){
- WebLibDependencyPropertiesPage control = (WebLibDependencyPropertiesPage)owner;
- control.handleSelectProjectJarButton();
- }
- }
-
- private void handleSelectVariableButton(){
- //owner.handleSelectVariableButton();
- if( owner instanceof WebLibDependencyPropertiesPage){
- WebLibDependencyPropertiesPage control = (WebLibDependencyPropertiesPage)owner;
- control.handleSelectVariableButton();
- }
- }
-
- private void handleServerJARsButtonSelected() {
- model.selectFilterLevel(ClassPathSelection.FILTER_EJB_CLIENT_JARS);
- refresh();
- }
-
- private void handleClientJARsButtonSelected() {
- model.selectFilterLevel(ClassPathSelection.FILTER_EJB_SERVER_JARS);
- refresh();
- }
-
- private void handleAnyJARsButtonSelected() {
- model.selectFilterLevel(ClassPathSelection.FILTER_NONE);
- refresh();
- }
-
- public boolean validatateEdit() {
- return validateEditListener.validateState().isOK();
- }
-
- protected void deselectAllButtonSelected() {
- if (!validatateEdit())
- return;
- availableJARsViewer.setAllChecked(false);
- model.setAllClasspathElementsSelected(false);
- compsToUncheck.clear();
- }
-
- protected void selectAllButtonSelected() {
- if (!validatateEdit())
- return;
- availableJARsViewer.setAllChecked(true);
- Object[] elements = availableJARsViewer.getCheckedElements();
- model.setAllClasspathElementsSelected(Arrays.asList(elements), true);
- for (int i = 0; i < elements.length; i++) {
- ClasspathElement el = (ClasspathElement)elements[i];
- el.getComponent().getAdapter(IVirtualComponent.class);
- IVirtualComponent ar = el.getTargetComponent();
- IVirtualComponent comp = (ar instanceof J2EEModuleVirtualArchiveComponent) ? ar : el.getComponent();
- if (isLibrary(comp))
- compsToUncheck.add(comp);
- }
- }
-
- protected java.util.List getSelectionAsList() {
- return ((IStructuredSelection) availableJARsViewer.getSelection()).toList();
- }
-
- protected java.util.List getCheckedLibsAsList() {
- List res = new LinkedList();
- Iterator it = compsToUncheck.iterator();
- while (it.hasNext()) {
- IVirtualComponent comp = (IVirtualComponent)it.next();
- res.add(comp);
- }
- return res;
- }
-
- protected void downButtonSelected() {
- if (!validatateEdit())
- return;
- model.moveDown(getSelectionAsList());
- refresh();
- }
-
- protected void upButtonSelected() {
- if (!validatateEdit())
- return;
- model.moveUp(getSelectionAsList());
- refresh();
- }
-
- /*
- * Updates the enable state of the all buttons
- */
- protected void updateButtonEnablements() {
- int[] indices = availableJARsViewer.getTable().getSelectionIndices();
- if (upButton != null && downButton != null) {
- upButton.setEnabled(canMoveUp(indices));
- downButton.setEnabled(canMoveDown(indices, availableJARsViewer.getTable().getItemCount()));
- }
- }
-
- protected boolean canMoveUp(int[] indices) {
- return canMove(indices, 0);
- }
-
- protected boolean canMoveDown(int[] indices, int itemCount) {
- return canMove(indices, itemCount - 1);
- }
-
- protected boolean canMove(int[] indices, int referenceIndex) {
- int length = indices.length;
- if (length == 0)
- return false;
- for (int i = 0; i < length; i++) {
- if (indices[i] == referenceIndex)
- return false;
- }
- return true;
- }
-
- protected void addTableListeners() {
- addCheckStateListener();
- addSelectionListener();
- }
-
- protected void addCheckStateListener() {
- availableJARsViewer.addCheckStateListener(new ICheckStateListener() {
- public void checkStateChanged(CheckStateChangedEvent event) {
- availableJARCheckStateChanged(event);
- }
- });
- }
-
- private boolean isLibrary(IVirtualComponent component) {
- if (J2EEProjectUtilities.isApplicationClientComponent(component)) return false;
- if (J2EEProjectUtilities.isEARProject(component.getProject()) && component.isBinary()) return true;
- if (J2EEProjectUtilities.isEJBComponent(component)) return false;
- if (J2EEProjectUtilities.isDynamicWebComponent(component)) return false;
- if (J2EEProjectUtilities.isJCAComponent(component)) return false;
- if (J2EEProjectUtilities.isStaticWebProject(component.getProject())) return false;
- if (J2EEProjectUtilities.isProjectOfType(component.getProject(), IJ2EEFacetConstants.JAVA)) return true;
- return true;
- }
-
- protected void availableJARCheckStateChanged(CheckStateChangedEvent event) {
- ClasspathElement el = (ClasspathElement)event.getElement();
- //226823 targeting a regular java project from web libs
- if(el.getComponent() == null){
- ClasspathElement element = (ClasspathElement) event.getElement();
- model.setSelection(element, event.getChecked());
- return;
- }
- el.getComponent().getAdapter(IVirtualComponent.class);
- IVirtualComponent ar = el.getTargetComponent();
- IVirtualComponent comp = (ar instanceof J2EEModuleVirtualArchiveComponent) ? ar : el.getComponent();
- CheckboxTableViewer v = (CheckboxTableViewer)event.getSource();
- if (isLibrary(comp) && event.getChecked()) {
- if (isConflict(comp)) {
- DependencyConflictResolveDialog dlg = new DependencyConflictResolveDialog(PlatformUI.
- getWorkbench().
- getActiveWorkbenchWindow().
- getShell(),
- DependencyConflictResolveDialog.DLG_TYPE_1);
- if (dlg.open() == dlg.BTN_ID_CANCEL) {
- v.setChecked(el, false);
- return;
- }
-
- }
- compsToUncheck.add(comp);
- } else if (!event.getChecked()) {
- compsToUncheck.remove(comp);
- }
- if (!J2EEProjectUtilities.isStandaloneProject(model.getComponent().getProject()) && (isReadOnly() || !validatateEdit() || (isMyClientJAR(event) && !event.getChecked()))) {
- availableJARsViewer.setChecked(event.getElement(), !event.getChecked());
- return;
- }
- ClasspathElement element = (ClasspathElement) event.getElement();
- model.setSelection(element, event.getChecked());
- }
-
-
- private boolean isConflict(IVirtualComponent lib) {
- IProject[] ears = J2EEProjectUtilities.getReferencingEARProjects(lib.getProject());
- for (int i = 0; i < ears.length; i++) {
- if (J2EEProjectUtilities.isJEEProject(ears[i])) {
- IVirtualComponent cmp = ComponentCore.createComponent(ears[i]);
- IVirtualReference[] refs = cmp.getReferences();
- for (int j = 0; j < refs.length; j++) {
- if (model.getProject().equals(refs[j].getReferencedComponent().getProject())) {
- IVirtualReference ref = cmp.getReference(lib.getName());
- if (!ref.getRuntimePath().isRoot()) return true;
- }
- }
- }
- }
- return false;
- }
-
-
-
- /**
- * @param event
- * @return
- */
- private boolean isMyClientJAR(CheckStateChangedEvent event) {
- ClasspathElement element = (ClasspathElement) event.getElement();
- if(getClasspathSelection() != null)
- return getClasspathSelection().isMyClientJAR(element);
- return false;
- }
-
- protected void addSelectionListener() {
- availableJARsViewer.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- tableSelectionChanged();
- }
- });
- }
-
- protected void tableSelectionChanged() {
- if (!isReadOnly())
- updateButtonEnablements();
- }
-
- protected ClassPathSelection getClasspathSelection() {
- if (model == null || model.getSelectedEARComponent() == null && !(J2EEProjectUtilities.isStandaloneProject(model.getComponent().getProject())))
- return null;
- return model.getClassPathSelection();
- }
-
- public void refreshCheckedItems() {
- if (getClasspathSelection() == null)
- return;
- java.util.List elements = getClasspathSelection().getClasspathElements();
- for (int i = 0; i < elements.size(); i++) {
- ClasspathElement element = (ClasspathElement) elements.get(i);
- availableJARsViewer.setChecked(element, element.isSelected());
- if (element.isClasspathDependency()) {
- availableJARsViewer.setGrayed(element, true);
- }
- }
- }
-
- public void refresh() {
- final IProject project = model.getComponent().getProject();
- // if not a web project and it is either referenced by an EAR or a dynamic web project.
- if (!isWLPEntry() && (!J2EEProjectUtilities.isStandaloneProject(project) ||
- (J2EEProjectUtilities.getReferencingWebProjects(project).length > 0))) {
- availableJARsViewer.setInput(getClasspathSelection());
- GridData data = new GridData(GridData.FILL_BOTH);
- int numlines = Math.min(10, availableJARsViewer.getTable().getItemCount());
- data.heightHint = availableJARsViewer.getTable().getItemHeight() * numlines;
- availableJARsViewer.getTable().setLayoutData(data);
- refreshCheckedItems();
- updateButtonEnablements();
- } else {
- availableJARsViewer.setInput(model.getClassPathSelectionForWLPs());
- GridData data = new GridData(GridData.FILL_BOTH);
- int numlines = Math.min(10, availableJARsViewer.getTable().getItemCount());
- data.heightHint = availableJARsViewer.getTable().getItemHeight() * numlines;
- availableJARsViewer.getTable().setLayoutData(data);
- refreshWLPCheckedItems();
- }
- }
-
- private void refreshWLPCheckedItems() {
- if (availableJARsViewer.getInput() != null) {
- java.util.List elements = ((ClassPathSelection) availableJARsViewer.getInput()).getClasspathElements();
- for (int i = 0; i < elements.size(); i++) {
- ClasspathElement element = (ClasspathElement) elements.get(i);
- availableJARsViewer.setChecked(element, element.isSelected());
- if (element.isClasspathDependency()) {
- availableJARsViewer.setGrayed(element, true);
- }
- }
- }
- }
-
- /**
- * Gets the model.
- * @return Returns a ClasspathModel
- */
- public ClasspathModel getModel() {
- return model;
- }
-
- /**
- * Sets the model.
- * @param model The model to set
- */
- public void setModel(ClasspathModel model) {
- this.model = model;
- initializeEJBClientDefaults();
- }
-
- /**
- * Returns the readOnly.
- * @return boolean
- */
- public boolean isReadOnly() {
- return readOnly;
- }
-
-
- /**
- * Sets the readOnly.
- * @param readOnly The readOnly to set
- */
- public void setReadOnly(boolean readOnly) {
- this.readOnly = readOnly;
- }
-
- public boolean isWLPEntry() {
- return model.isWLPModel();
- }
-
- /**
- * @deprecated do not use this method
- * @param isWLPEntry
- */
- public void setWLPEntry(boolean isWLPEntry) {
- this.isWLPEntry = isWLPEntry;
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/IClasspathTableOwner.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/IClasspathTableOwner.java
deleted file mode 100644
index 94f64b383..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/IClasspathTableOwner.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 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
- *******************************************************************************/
-/*
- * Created on Jan 17, 2005
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-package org.eclipse.jst.j2ee.internal;
-
-import org.eclipse.jface.viewers.CheckboxTableViewer;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-
-/**
- * @author jialin
- *
- * TODO To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-public interface IClasspathTableOwner {
- Button primCreatePushButton(String label, Composite buttonColumn);
- Button primCreateRadioButton(String label, Composite parent);
- CheckboxTableViewer createAvailableJARsViewer(Composite parent);
- Composite createButtonColumnComposite(Composite parent);
- //Button createHideEJBClientJARsButton(Composite parent); This method is never used hence commeting it out - vkb
- Group createGroup(Composite parent);
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ICommonManifestUIConstants.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ICommonManifestUIConstants.java
deleted file mode 100644
index a6c4542a0..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ICommonManifestUIConstants.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 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
- *******************************************************************************/
-/*
- * Created on Jan 17, 2005
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-package org.eclipse.jst.j2ee.internal;
-
-import org.eclipse.jst.j2ee.internal.common.CommonEditResourceHandler;
-
-/**
- * @author jialin
- *
- * TODO To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-public interface ICommonManifestUIConstants {
- String UP_BUTTON = ManifestUIResourceHandler.Up_1;
- String DOWN_BUTTON = ManifestUIResourceHandler.Down_2;
- String SELECT_ALL_BUTTON = ManifestUIResourceHandler.Select_All_3;
- String DE_SELECT_ALL_BUTTON = ManifestUIResourceHandler.Deselect_All_4;
- String ERROR_READING_MANIFEST_DIALOG_TITLE = ManifestUIResourceHandler.ERROR_READING_MANIFEST_DIALOG_TITLE;
- String SAVE_MANIFEST_WITH_ERROR =ManifestUIResourceHandler.SAVE_MANIFEST_WITH_ERROR;
- String ERROR_READING_MANIFEST_DIALOG_MESSAGE_EDITOR = ManifestUIResourceHandler.ERROR_READING_MANIFEST_DIALOG_MESSAGE_EDITOR;
- String ERROR_READING_MANIFEST_DIALOG_MESSAGE_PROP_PAGE = ManifestUIResourceHandler.ERROR_READING_MANIFEST_DIALOG_MESSAGE_PROP_PAGE;
- String MANIFEST_PROBLEM_1 = ManifestUIResourceHandler.MANIFEST_PROBLEM_1;
- String MANIFEST_PROBLEM_2 = ManifestUIResourceHandler.MANIFEST_PROBLEM_2;
- String MANIFEST_PROBLEM_3 = ManifestUIResourceHandler.MANIFEST_PROBLEM_3;
- String MANIFEST_PROBLEM_4 = ManifestUIResourceHandler.MANIFEST_PROBLEM_4;
- String REDIRECT_TEXT_EDITOR_UI_ = ManifestUIResourceHandler.REDIRECT_TEXT_EDITOR_UI_;
-
- String EJB_CLIENT_RADIO_UI_ = CommonEditResourceHandler.getString("EJB_CLIENT_RADIO_UI_"); //$NON-NLS-1$
- String USE_EJB_SERVER_JARs_UI_ = CommonEditResourceHandler.getString("USE_EJB_SERVER_JARs_UI_"); //$NON-NLS-1$
- String USE_EJB_CLIENT_JARs_UI_ = CommonEditResourceHandler.getString("USE_EJB_CLIENT_JARs_UI_"); //$NON-NLS-1$
- String USE_BOTH_UI_ = CommonEditResourceHandler.getString("USE_BOTH_UI_"); //$NON-NLS-1$
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/IJ2EEDependenciesControl.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/IJ2EEDependenciesControl.java
deleted file mode 100644
index 6005131bb..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/IJ2EEDependenciesControl.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 BEA Systems, Inc.
- * 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:
- * rfrost@bea.com - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.j2ee.internal;
-
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Interface for classes that implement a portion the "J2EE Module Dependencies"
- * property page logic.
- */
-public interface IJ2EEDependenciesControl extends ICommonManifestUIConstants {
-
- /**
- * Creates the Composite associated with this control.
- * @param parent Parent Composite.
- * @return Composite for the control.
- */
- Composite createContents(Composite parent);
-
- /**
- * Called when the property page's <code>performOk()</code> method is called.
- * @return
- */
- boolean performOk();
-
- /**
- * Called when the property page's <code>performDefaults()</code> method is called.
- * @return
- */
- void performDefaults();
-
- /**
- * Called when the property page's <code>performCancel()</code> method is called.
- * @return
- */
- boolean performCancel();
-
- /**
- * Called when the property page's <code>setVisible()</code> method is called.
- * @return
- */
- void setVisible(boolean visible);
-
- /**
- * Called when the property page's <code>dispose()</code> method is called.
- * @return
- */
- void dispose();
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/J2EEComponentProjectMigrator.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/J2EEComponentProjectMigrator.java
deleted file mode 100644
index fdf5cb31d..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/J2EEComponentProjectMigrator.java
+++ /dev/null
@@ -1,643 +0,0 @@
-/*******************************************************************************
- * 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.jst.j2ee.internal;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IProjectDescription;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ProjectScope;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
-import org.eclipse.core.runtime.preferences.IScopeContext;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jem.util.emf.workbench.WorkbenchResourceHelperBase;
-import org.eclipse.jem.workbench.utility.JemProjectUtilities;
-import org.eclipse.jst.common.frameworks.CommonFrameworksPlugin;
-import org.eclipse.jst.common.project.facet.IJavaFacetInstallDataModelProperties;
-import org.eclipse.jst.common.project.facet.JavaFacetInstallDataModelProvider;
-import org.eclipse.jst.common.project.facet.WtpUtils;
-import org.eclipse.jst.j2ee.internal.common.classpath.J2EEComponentClasspathContainerUtils;
-import org.eclipse.jst.j2ee.internal.common.classpath.J2EEComponentClasspathUpdater;
-import org.eclipse.jst.j2ee.internal.earcreation.EarFacetInstallDataModelProvider;
-import org.eclipse.jst.j2ee.internal.ejb.project.operations.EjbFacetInstallDataModelProvider;
-import org.eclipse.jst.j2ee.internal.ejb.project.operations.IEjbFacetInstallDataModelProperties;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEPreferences;
-import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities;
-import org.eclipse.jst.j2ee.jca.project.facet.ConnectorFacetInstallDataModelProvider;
-import org.eclipse.jst.j2ee.project.facet.AppClientFacetInstallDataModelProvider;
-import org.eclipse.jst.j2ee.project.facet.IAppClientFacetInstallDataModelProperties;
-import org.eclipse.jst.j2ee.project.facet.IJ2EEModuleFacetInstallDataModelProperties;
-import org.eclipse.jst.j2ee.project.facet.UtilityFacetInstallDataModelProvider;
-import org.eclipse.jst.j2ee.web.project.facet.WebFacetInstallDataModelProvider;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.navigator.CommonViewer;
-import org.eclipse.ui.navigator.INavigatorContentService;
-import org.eclipse.wst.common.componentcore.datamodel.FacetProjectCreationDataModelProvider;
-import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties;
-import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetProjectCreationDataModelProperties;
-import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetProjectCreationDataModelProperties.FacetDataModelMap;
-import org.eclipse.wst.common.componentcore.internal.ComponentType;
-import org.eclipse.wst.common.componentcore.internal.ComponentcoreFactory;
-import org.eclipse.wst.common.componentcore.internal.IComponentProjectMigrator;
-import org.eclipse.wst.common.componentcore.internal.Property;
-import org.eclipse.wst.common.componentcore.internal.StructureEdit;
-import org.eclipse.wst.common.componentcore.internal.WorkbenchComponent;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.internal.SimpleValidateEdit;
-import org.eclipse.wst.project.facet.SimpleWebFacetInstallDataModelProvider;
-import org.eclipse.wst.server.core.IRuntime;
-import org.eclipse.wst.server.core.ServerUtil;
-
-public class J2EEComponentProjectMigrator implements IComponentProjectMigrator {
-
- private static final String WEB_LIB_CONTAINER = "org.eclipse.jst.j2ee.internal.web.container";
- private static final String WEB_LIB_PATH = "/WEB-INF/lib";
- private static final String OLD_DEPLOYABLES_PATH = ".deployables";
- private IProject project;
-
- private static final String[] J2EE_CONTENT_EXTENSION_IDS = new String[] {
- "org.eclipse.jst.navigator.j2ee.ui.EARDDContent", //$NON-NLS-1$
- "org.eclipse.jst.navigator.j2ee.ui.WebDDContent", //$NON-NLS-1$
- "org.eclipse.jst.navigator.j2ee.ui.EJBDDContent", //$NON-NLS-1$
- "org.eclipse.jst.navigator.j2ee.ui.ConnectorDDContent" //$NON-NLS-1$
- };
-
- private static final String PROJECT_EXPLORER = "org.eclipse.ui.navigator.ProjectExplorer"; //$NON-NLS-1$
-
- public J2EEComponentProjectMigrator() {
- super();
- // TODO Auto-generated constructor stub
- }
-
- public void migrateProject(IProject aProject) {
- if (aProject.isAccessible() && (aProject.getFile(StructureEdit.MODULE_META_FILE_NAME).exists())) {
- // The file corresponding to StructureEdit.MODULE_META_FILE_NAME is crucial to migration.
- // If it does not exist, the project cannot be migrated. We should never fail the test for existence
- // of the file, if we do then something has gone badly wrong.
- Resource resource = WorkbenchResourceHelperBase.getResource(aProject.getFile(StructureEdit.MODULE_META_FILE_NAME), false);
- if(resource != null && resource.isLoaded()){
- // Unload the resource because the model inside the StructureEdit was cached when the
- // the project was imported, and files may have moved due to migration (.wtpmodules for example).
- resource.unload();
- }
-
- final List files = new ArrayList();
- files.add(aProject.getFile(J2EEProjectUtilities.DOT_PROJECT));
- files.add(aProject.getFile(J2EEProjectUtilities.DOT_CLASSPATH));
- files.add(aProject.getFile(StructureEdit.MODULE_META_FILE_NAME));
- if(SimpleValidateEdit.validateEdit(files)){
- project = aProject;
-
- removeComponentBuilders(project);
- if (multipleComponentsDetected())
- createNewProjects();
- String facetid = getFacetFromProject(project);
- if (facetid.length() == 0)
- addFacets(project);
- J2EEComponentClasspathUpdater.getInstance().queueUpdate(project);
- }
- }
- ensureJ2EEContentExtensionsEnabled();
- }
-
- /**
- * Ensure the J2EE content extension ids are enabled on the project explorer
- * for the projects being migrated.
- */
- private void ensureJ2EEContentExtensionsEnabled() {
- IViewPart view = null;
- try {
- view = PlatformUI.getWorkbench().getWorkbenchWindows()[0].getActivePage().findView(PROJECT_EXPLORER);
- } catch (Exception e) {
- //Just bail and return if there is no view
- }
- if (view == null)
- return;
-
- INavigatorContentService contentService = (INavigatorContentService) view.getAdapter(INavigatorContentService.class);
- CommonViewer viewer = (CommonViewer) view.getAdapter(CommonViewer.class);
-
- // Set the J2EE content extensions as enabled now that we have set the J2EE facets
- if (contentService != null)
- contentService.getActivationService().activateExtensions(J2EE_CONTENT_EXTENSION_IDS, false);
-
- // Update the viewer if we are in the current UI thread
- if (viewer != null) {
- Display display = viewer.getControl().getDisplay();
- if (display!=null && Thread.currentThread().equals(display.getThread()))
- viewer.refresh();
- }
- }
-
- private void createNewProjects() {
-
- StructureEdit se = null;
- try {
- se = StructureEdit.getStructureEditForWrite(project);
- List comps = se.getComponentModelRoot().getComponents();
- List removedComps = new ArrayList();
- for (int i = 1;i<comps.size();i++) {
- WorkbenchComponent comp = (WorkbenchComponent) comps.get(i);
- IWorkspace ws = ResourcesPlugin.getWorkspace();
- IProject newProj = ws.getRoot().getProject(comp.getName());
- if (!newProj.exists()) {
- try {
- createProj(newProj,(!comp.getComponentType().getComponentTypeId().equals(J2EEProjectUtilities.ENTERPRISE_APPLICATION)));
- WtpUtils.addNatures(newProj);
- } catch (CoreException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- if (comp!=null && comp.getComponentType()!=null)
- addFacetsToProject(newProj,comp.getComponentType().getComponentTypeId(),comp.getComponentType().getVersion(),false);
- removedComps.add(comp);
- IFolder compFolder = project.getFolder(comp.getName());
- if (compFolder.exists())
- try {
- compFolder.delete(true,null);
- } catch (CoreException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- se.getComponentModelRoot().getComponents().removeAll(removedComps);
- se.save(null);
-
- } finally {
- if (se != null)
- se.dispose();
- }
-
-
- }
-
- private void createProj(IProject newProj, boolean isJavaProject) throws CoreException {
- newProj.create(null);
- IProjectDescription description = ResourcesPlugin.getWorkspace().newProjectDescription(newProj.getName());
-// if (isJavaProject)
-// description.setNatureIds(new String[]{JavaCore.NATURE_ID});
- description.setLocation(null);
- newProj.open(null);
- newProj.setDescription(description, null);
- }
-
- private boolean multipleComponentsDetected() {
- StructureEdit se = null;
- try {
- se = StructureEdit.getStructureEditForRead(project);
- if (se == null) return false;
- if (se.getComponentModelRoot() == null) return false;
- return se.getComponentModelRoot().getComponents().size() > 1;
- } finally {
- if (se != null)
- se.dispose();
- }
- }
-
- private void removeComponentBuilders(IProject aProject) {
- try {
- aProject.refreshLocal(IResource.DEPTH_INFINITE,null);
- } catch (CoreException e1) {
- // TODO Auto-generated catch block
- e1.printStackTrace();
- }
- //IJavaProject javaP = JemProjectUtilities.getJavaProject(aProject);
- List oldBuilders = new ArrayList();
- oldBuilders.add("org.eclipse.wst.common.modulecore.ComponentStructuralBuilder");
- oldBuilders.add("org.eclipse.wst.common.modulecore.ComponentStructuralBuilderDependencyResolver");
- oldBuilders.add("org.eclipse.wst.common.modulecore.DependencyGraphBuilder");
- try {
- J2EEProjectUtilities.removeBuilders(aProject,oldBuilders);
- } catch (CoreException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
-
- }
-
- public String getFacetFromProject(IProject aProject) {
- return J2EEProjectUtilities.getJ2EEProjectType(aProject);
- }
-
-
- protected IDataModel setupJavaInstallAction(IProject aProject, boolean existing,String srcFolder) {
- IDataModel dm = DataModelFactory.createDataModel(new JavaFacetInstallDataModelProvider());
- dm.setProperty(IFacetDataModelProperties.FACET_PROJECT_NAME, aProject.getName());
- String jVersion = "1.4";
- IScopeContext context = new ProjectScope( project );
- IEclipsePreferences prefs
- = context.getNode( JavaCore.PLUGIN_ID );
- if (JavaCore.VERSION_1_5.equals(prefs.get(JavaCore.COMPILER_COMPLIANCE,JavaCore.VERSION_1_4))) {
- jVersion = "5.0";
- }
- dm.setProperty(IFacetDataModelProperties.FACET_VERSION_STR, jVersion); //$NON-NLS-1$
- if (!existing)
- dm.setStringProperty(IJavaFacetInstallDataModelProperties.SOURCE_FOLDER_NAME, srcFolder); //$NON-NLS-1$
- return dm;
- }
-
- protected IDataModel setupUtilInstallAction(IProject aProject,String specVersion) {
- IDataModel aFacetInstallDataModel = DataModelFactory.createDataModel(new UtilityFacetInstallDataModelProvider());
- aFacetInstallDataModel.setProperty(IFacetDataModelProperties.FACET_PROJECT_NAME, aProject.getName());
- aFacetInstallDataModel.setProperty(IFacetDataModelProperties.FACET_VERSION_STR, specVersion);
- aFacetInstallDataModel.setBooleanProperty(IJ2EEModuleFacetInstallDataModelProperties.ADD_TO_EAR,false);
- aFacetInstallDataModel.setStringProperty(IJ2EEModuleFacetInstallDataModelProperties.EAR_PROJECT_NAME,null);
- return aFacetInstallDataModel;
- }
- protected IDataModel setupEarInstallAction(IProject aProject,String specVersion) {
- IDataModel earFacetInstallDataModel = DataModelFactory.createDataModel(new EarFacetInstallDataModelProvider());
- earFacetInstallDataModel.setProperty(IFacetDataModelProperties.FACET_PROJECT_NAME, aProject.getName());
- earFacetInstallDataModel.setProperty(IFacetDataModelProperties.FACET_VERSION_STR, specVersion);
-
- return earFacetInstallDataModel;
- }
- protected IDataModel setupAppClientInstallAction(IProject aProject,String specVersion) {
- IDataModel aFacetInstallDataModel = DataModelFactory.createDataModel(new AppClientFacetInstallDataModelProvider());
- aFacetInstallDataModel.setProperty(IFacetDataModelProperties.FACET_PROJECT_NAME, aProject.getName());
- aFacetInstallDataModel.setProperty(IFacetDataModelProperties.FACET_VERSION_STR, specVersion);
- aFacetInstallDataModel.setBooleanProperty(IJ2EEModuleFacetInstallDataModelProperties.ADD_TO_EAR,false);
- aFacetInstallDataModel.setStringProperty(IJ2EEModuleFacetInstallDataModelProperties.EAR_PROJECT_NAME,null);
- aFacetInstallDataModel.setBooleanProperty(IAppClientFacetInstallDataModelProperties.CREATE_DEFAULT_MAIN_CLASS,false);
- return aFacetInstallDataModel;
- }
- protected IDataModel setupConnectorInstallAction(IProject aProject,String specVersion) {
- IDataModel aFacetInstallDataModel = DataModelFactory.createDataModel(new ConnectorFacetInstallDataModelProvider());
- aFacetInstallDataModel.setProperty(IFacetDataModelProperties.FACET_PROJECT_NAME, aProject.getName());
- aFacetInstallDataModel.setProperty(IFacetDataModelProperties.FACET_VERSION_STR, specVersion);
- aFacetInstallDataModel.setBooleanProperty(IJ2EEModuleFacetInstallDataModelProperties.ADD_TO_EAR,false);
- aFacetInstallDataModel.setStringProperty(IJ2EEModuleFacetInstallDataModelProperties.EAR_PROJECT_NAME,null);
- return aFacetInstallDataModel;
- }
-
- private void addFacets(IProject aProject) {
- StructureEdit edit = null;
- try {
- edit = StructureEdit.getStructureEditForWrite(aProject);
- if (edit == null) return; // Not a component project....
- edit.getModuleStructuralModel().setUseOldFormat(true);
- if (edit.getComponent() == null) return; // Can't migrate
- ComponentType type = edit.getComponent().getComponentType();
- if (type == null) return; // Can't migrate
- String compId = type.getComponentTypeId();
- String specVersion = edit.getComponent().getComponentType().getVersion();
- moveMetaProperties(edit.getComponent(),type);
- addFacetsToProject(aProject, compId, specVersion,true);
- }
- finally {
- if (edit != null) {
- edit.save(null);
- edit.getModuleStructuralModel().setUseOldFormat(false);
- edit.dispose();
- }
- }
-
- }
-
- private void moveMetaProperties(WorkbenchComponent component, ComponentType type) {
- List props = type.getProperties();
- List compProps = component.getProperties();
- for (Iterator iter = props.iterator(); iter.hasNext();) {
- Property element = (Property) iter.next();
- Property newProp = ComponentcoreFactory.eINSTANCE.createProperty();
- newProp.setName(element.getName());
- newProp.setValue(element.getValue());
- compProps.add(newProp);
- }
- props.clear();
- }
-
- private void addFacetsToProject(IProject aProject, String compId, String specVersion,boolean existing) {
- if (compId.equals(J2EEProjectUtilities.DYNAMIC_WEB))
- installWEBFacets(aProject,specVersion,existing);
- else if (compId.equals(J2EEProjectUtilities.EJB))
- installEJBFacets(aProject,specVersion,existing);
- else if (compId.equals(J2EEProjectUtilities.APPLICATION_CLIENT))
- installAppClientFacets(aProject,specVersion,existing);
- else if (compId.equals(J2EEProjectUtilities.ENTERPRISE_APPLICATION))
- installEARFacets(aProject,specVersion,existing);
- else if (compId.equals(J2EEProjectUtilities.JCA))
- installConnectorFacets(aProject,specVersion,existing);
- else if (compId.equals(J2EEProjectUtilities.UTILITY))
- installUtilityFacets(aProject,specVersion,existing);
- else if (compId.equals(J2EEProjectUtilities.STATIC_WEB))
- installStaticWebFacets(aProject,specVersion,existing);
- }
-
- private void installStaticWebFacets(IProject project2, String specVersion, boolean existing) {
- IDataModel dm = DataModelFactory.createDataModel(new FacetProjectCreationDataModelProvider());
- dm.setProperty(IFacetProjectCreationDataModelProperties.FACET_PROJECT_NAME, project2.getName());
- FacetDataModelMap facetDMs = (FacetDataModelMap) dm.getProperty(IFacetProjectCreationDataModelProperties.FACET_DM_MAP);
- //facetDMs.add(setupJavaInstallAction(webProj,existing,CreationConstants.DEFAULT_WEB_SOURCE_FOLDER));
- IDataModel newModel = setupStaticWebInstallAction(project2);
- facetDMs.add(newModel);
- //setRuntime(webProj,dm); //Setting runtime property
- try {
- /**
- * Warning cleanup 12/07/2005
- */
- //IStatus stat = dm.getDefaultOperation().execute(null,null);
- dm.getDefaultOperation().execute(null,null);
- } catch (ExecutionException e) {
- Throwable realException = e.getCause();
- if (realException != null && realException instanceof CoreException) {
- IStatus st = ((CoreException)realException).getStatus();
- if (st != null)
- System.out.println(st);
- realException.printStackTrace();
- }
- }
- }
-
- private IDataModel setupStaticWebInstallAction(IProject project2) {
- IDataModel webFacetInstallDataModel = DataModelFactory.createDataModel(new SimpleWebFacetInstallDataModelProvider());
- webFacetInstallDataModel.setProperty(IFacetDataModelProperties.FACET_PROJECT_NAME, project2.getName());
- webFacetInstallDataModel.setProperty(IFacetDataModelProperties.FACET_VERSION_STR, "1.0");
-
- return webFacetInstallDataModel;
- }
-
- private void installUtilityFacets(IProject aProject, String specVersion, boolean existing) {
- replaceDeployablesOutputIfNecessary(project);
- IDataModel dm = DataModelFactory.createDataModel(new FacetProjectCreationDataModelProvider());
- dm.setProperty(IFacetProjectCreationDataModelProperties.FACET_PROJECT_NAME, aProject.getName());
- FacetDataModelMap facetDMs = (FacetDataModelMap) dm.getProperty(IFacetProjectCreationDataModelProperties.FACET_DM_MAP);
- facetDMs.add(setupJavaInstallAction(aProject,existing,"src"));
- IDataModel newModel = setupUtilInstallAction(aProject,specVersion);
- facetDMs.add(newModel);
- try {
- /**
- * Warning cleanup 12/07/2005
- */
- //IStatus stat = dm.getDefaultOperation().execute(null,null);
- dm.getDefaultOperation().execute(null,null);
- } catch (ExecutionException e) {
- Throwable realException = e.getCause();
- if (realException != null && realException instanceof CoreException) {
- IStatus st = ((CoreException)realException).getStatus();
- if (st != null)
- System.out.println(st);
- realException.printStackTrace();
- }
- }
-
- }
-
- private void installConnectorFacets(IProject aProject, String specVersion, boolean existing) {
- replaceDeployablesOutputIfNecessary(project);
- IDataModel dm = DataModelFactory.createDataModel(new FacetProjectCreationDataModelProvider());
- dm.setProperty(IFacetProjectCreationDataModelProperties.FACET_PROJECT_NAME, aProject.getName());
- FacetDataModelMap facetDMs = (FacetDataModelMap) dm.getProperty(IFacetProjectCreationDataModelProperties.FACET_DM_MAP);
- facetDMs.add(setupJavaInstallAction(aProject,existing,J2EEPlugin.getDefault().getJ2EEPreferences().getString(J2EEPreferences.Keys.JCA_CONTENT_FOLDER)));
- IDataModel newModel = setupConnectorInstallAction(aProject,specVersion);
- facetDMs.add(newModel);
- try {
- /**
- * Warning cleanup 12/07/2005
- */
- //IStatus stat = dm.getDefaultOperation().execute(null,null);
- dm.getDefaultOperation().execute(null,null);
- } catch (ExecutionException e) {
- Throwable realException = e.getCause();
- if (realException != null && realException instanceof CoreException) {
- IStatus st = ((CoreException)realException).getStatus();
- if (st != null)
- System.out.println(st);
- realException.printStackTrace();
- }
- }
-
- }
-
- private void installEARFacets(IProject aProject, String specVersion, boolean existing) {
- IDataModel dm = DataModelFactory.createDataModel(new FacetProjectCreationDataModelProvider());
- dm.setProperty(IFacetProjectCreationDataModelProperties.FACET_PROJECT_NAME, aProject.getName());
- FacetDataModelMap facetDMs = (FacetDataModelMap) dm.getProperty(IFacetProjectCreationDataModelProperties.FACET_DM_MAP);
- IDataModel newModel = setupEarInstallAction(aProject,specVersion);
- facetDMs.add(newModel);
- try {
- /**
- * Warning cleanup 12/07/2005
- */
- //IStatus stat = dm.getDefaultOperation().execute(null,null);
- dm.getDefaultOperation().execute(null,null);
- } catch (ExecutionException e) {
- Throwable realException = e.getCause();
- if (realException != null && realException instanceof CoreException) {
- IStatus st = ((CoreException)realException).getStatus();
- if (st != null)
- System.out.println(st);
- realException.printStackTrace();
- }
- }
-
- }
-
- private void installAppClientFacets(IProject aProject, String specVersion, boolean existing) {
- replaceDeployablesOutputIfNecessary(project);
- IDataModel dm = DataModelFactory.createDataModel(new FacetProjectCreationDataModelProvider());
- dm.setProperty(IFacetProjectCreationDataModelProperties.FACET_PROJECT_NAME, aProject.getName());
- FacetDataModelMap facetDMs = (FacetDataModelMap) dm.getProperty(IFacetProjectCreationDataModelProperties.FACET_DM_MAP);
- facetDMs.add(setupJavaInstallAction(aProject,existing,J2EEPlugin.getDefault().getJ2EEPreferences().getString(J2EEPreferences.Keys.APP_CLIENT_CONTENT_FOLDER)));
- IDataModel newModel = setupAppClientInstallAction(aProject,specVersion);
- facetDMs.add(newModel);
- try {
- /**
- * Warning cleanup 12/07/2005
- */
- //IStatus stat = dm.getDefaultOperation().execute(null,null);
- dm.getDefaultOperation().execute(null,null);
- } catch (ExecutionException e) {
- Throwable realException = e.getCause();
- if (realException != null && realException instanceof CoreException) {
- IStatus st = ((CoreException)realException).getStatus();
- if (st != null)
- System.out.println(st);
- realException.printStackTrace();
- }
- }
-
- }
-
- private void installEJBFacets(IProject ejbProject2,String ejbVersion, boolean existing) {
- replaceDeployablesOutputIfNecessary(project);
- IDataModel dm = DataModelFactory.createDataModel(new FacetProjectCreationDataModelProvider());
- dm.setProperty(IFacetProjectCreationDataModelProperties.FACET_PROJECT_NAME, ejbProject2.getName());
- FacetDataModelMap facetDMs = (FacetDataModelMap) dm.getProperty(IFacetProjectCreationDataModelProperties.FACET_DM_MAP);
- facetDMs.add(setupJavaInstallAction(ejbProject2,existing,J2EEPlugin.getDefault().getJ2EEPreferences().getString(J2EEPreferences.Keys.EJB_CONTENT_FOLDER)));
- IDataModel newModel = setupEjbInstallAction(ejbProject2,ejbVersion,existing);
- facetDMs.add(newModel);
- //setRuntime(ejbProject2,dm); //Setting runtime property
- try {
- /**
- * Warning cleanup 12/07/2005
- */
- //IStatus stat = dm.getDefaultOperation().execute(null,null);
- dm.getDefaultOperation().execute(null,null);
- } catch (ExecutionException e) {
- Throwable realException = e.getCause();
- if (realException != null && realException instanceof CoreException) {
- IStatus st = ((CoreException)realException).getStatus();
- if (st != null)
- System.out.println(st);
- realException.printStackTrace();
- }
- }
-
- }
- private void installWEBFacets(IProject webProj,String specVersion, boolean existing) {
- removeOldWebContainerIfNecessary(project);
- replaceDeployablesOutputIfNecessary(project);
-
- IDataModel dm = DataModelFactory.createDataModel(new FacetProjectCreationDataModelProvider());
- dm.setProperty(IFacetProjectCreationDataModelProperties.FACET_PROJECT_NAME, webProj.getName());
- FacetDataModelMap facetDMs = (FacetDataModelMap) dm.getProperty(IFacetProjectCreationDataModelProperties.FACET_DM_MAP);
- facetDMs.add(setupJavaInstallAction(webProj,existing, CommonFrameworksPlugin.getDefault().getPluginPreferences().getString(CommonFrameworksPlugin.DEFAULT_SOURCE_FOLDER)));
- IDataModel newModel = setupWebInstallAction(webProj,specVersion);
- facetDMs.add(newModel);
- //setRuntime(webProj,dm); //Setting runtime property
- try {
- /**
- * Warning cleanup 12/07/2005
- */
- //IStatus stat = dm.getDefaultOperation().execute(null,null);
- dm.getDefaultOperation().execute(null,null);
- } catch (ExecutionException e) {
- Throwable realException = e.getCause();
- if (realException != null && realException instanceof CoreException) {
- IStatus st = ((CoreException)realException).getStatus();
- if (st != null)
- System.out.println(st);
- realException.printStackTrace();
- }
- } catch (Exception ex) {
- if (ex != null && ex instanceof CoreException) {
- IStatus st = ((CoreException)ex).getStatus();
- if (st != null)
- System.out.println(st);
- ex.printStackTrace();
- }
- }
-
-
- }
- private void replaceDeployablesOutputIfNecessary(IProject proj) {
-
-
- IJavaProject jproj = JemProjectUtilities.getJavaProject(proj);
- final IClasspathEntry[] current;
- boolean deployablesFound = false;
- try {
- current = jproj.getRawClasspath();
- List updatedList = new ArrayList();
- IPath sourcePath = null;
- for (int i = 0; i < current.length; i++) {
- IClasspathEntry entry = current[i];
- if ((entry.getEntryKind() == IClasspathEntry.CPE_SOURCE) && (entry.getOutputLocation() != null && entry.getOutputLocation().toString().indexOf(OLD_DEPLOYABLES_PATH) != -1)) {
- sourcePath = entry.getPath();
- updatedList.add(JavaCore.newSourceEntry(sourcePath));
- deployablesFound = true;
- }
- else
- updatedList.add(entry);
- }
- if (deployablesFound) {
- IClasspathEntry[] updated = (IClasspathEntry[])updatedList.toArray(new IClasspathEntry[updatedList.size()]);
- jproj.setRawClasspath(updated, null);
- jproj.save(null, true);
- }
- } catch (JavaModelException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
-
-
-
- }
-
- private void removeOldWebContainerIfNecessary(IProject webProj) {
-
- IJavaProject jproj = JemProjectUtilities.getJavaProject(webProj);
- final IClasspathEntry[] current;
- try {
- current = jproj.getRawClasspath();
- List updatedList = new ArrayList();
- boolean useDefaultWebAppLibraries = J2EEComponentClasspathContainerUtils.getDefaultUseWebAppLibraries();
- for (int i = 0; i < current.length; i++) {
- IClasspathEntry entry = current[i];
- // the web container is added to the classpath if:
- // 1. they don't have an entry for WEB_LIB_CONTAINER AND
- // 2. they have an entry for WEB_LIB_PATH BUT
- // they do not have the preference checked to use the Web App classpath container
- if ((entry.getPath().toString().indexOf(WEB_LIB_CONTAINER) == -1) &&
- ((entry.getPath().toString().indexOf(WEB_LIB_PATH) == -1) || !useDefaultWebAppLibraries))
- updatedList.add(entry);
- }
- IClasspathEntry[] updated = (IClasspathEntry[])updatedList.toArray(new IClasspathEntry[updatedList.size()]);
- jproj.setRawClasspath(updated, null);
- jproj.save(null, true);
- } catch (JavaModelException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
-
- }
-
- protected IRuntime getRuntimeByID(String id) {
- IRuntime[] targets = ServerUtil.getRuntimes("", "");
- for (int i = 0; i < targets.length; i++) {
- IRuntime target = targets[i];
- if (id.equals(target.getId()))
- return target;
- }
- return null;
- }
-
- protected IDataModel setupEjbInstallAction(IProject aProject,String ejbVersion, boolean existing) {
- IDataModel ejbFacetInstallDataModel = DataModelFactory.createDataModel(new EjbFacetInstallDataModelProvider());
- ejbFacetInstallDataModel.setProperty(IFacetDataModelProperties.FACET_PROJECT_NAME, aProject.getName());
- ejbFacetInstallDataModel.setProperty(IFacetDataModelProperties.FACET_VERSION_STR, ejbVersion);
- ejbFacetInstallDataModel.setBooleanProperty(IJ2EEModuleFacetInstallDataModelProperties.ADD_TO_EAR,false);
- ejbFacetInstallDataModel.setStringProperty(IJ2EEModuleFacetInstallDataModelProperties.EAR_PROJECT_NAME,null);
- if (!existing)
- ejbFacetInstallDataModel.setProperty(IEjbFacetInstallDataModelProperties.CONFIG_FOLDER, J2EEPlugin.getDefault().getJ2EEPreferences().getString(J2EEPreferences.Keys.EJB_CONTENT_FOLDER));
- return ejbFacetInstallDataModel;
- }
-
- protected IDataModel setupWebInstallAction(IProject aProject,String specVersion) {
- IDataModel webFacetInstallDataModel = DataModelFactory.createDataModel(new WebFacetInstallDataModelProvider());
- webFacetInstallDataModel.setProperty(IFacetDataModelProperties.FACET_PROJECT_NAME, aProject.getName());
- webFacetInstallDataModel.setProperty(IFacetDataModelProperties.FACET_VERSION_STR, specVersion);
- webFacetInstallDataModel.setBooleanProperty(IJ2EEModuleFacetInstallDataModelProperties.ADD_TO_EAR,false);
- webFacetInstallDataModel.setStringProperty(IJ2EEModuleFacetInstallDataModelProperties.EAR_PROJECT_NAME,null);
- return webFacetInstallDataModel;
- }
-
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/J2EEDependenciesPage.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/J2EEDependenciesPage.java
deleted file mode 100644
index 31d0c7997..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/J2EEDependenciesPage.java
+++ /dev/null
@@ -1,237 +0,0 @@
-/*******************************************************************************
- * 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 implementation as prop page heirarchy
- * rfrost@bea.com - conversion to single property page impl
- *******************************************************************************/
-
-package org.eclipse.jst.j2ee.internal;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIMessages;
-import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.TabFolder;
-import org.eclipse.swt.widgets.TabItem;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.dialogs.PropertyPage;
-import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants;
-import org.eclipse.wst.common.project.facet.core.IFacetedProject;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-
-/**
- * Primary project property page for J2EE dependencies; content is dynamically
- * generated based on the project facets and will be comprised by a
- * set of IJ2EEDependenciesControl implementations.
- */
-public class J2EEDependenciesPage extends PropertyPage {
-
- public String DESCRIPTION = J2EEUIMessages.getResourceString("DESCRIPTION"); //$NON-NLS-1$
-
- private IProject project;
- private IJ2EEDependenciesControl[] controls = new IJ2EEDependenciesControl[0];
-
- public J2EEDependenciesPage() {
- super();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
- */
- protected Control createContents(Composite parent) {
-
- // Need to find out what type of project we are handling
- project = (IProject) getElement().getAdapter(IResource.class);
- boolean isEAR = false;
- boolean isWEB = false;
- try {
- final IFacetedProject facetedProject = ProjectFacetsManager.create(project);
- if (facetedProject == null) {
- return getFacetErrorComposite(parent);
- }
- isEAR = facetedProject.hasProjectFacet(ProjectFacetsManager.getProjectFacet(IModuleConstants.JST_EAR_MODULE));
- isWEB = facetedProject.hasProjectFacet(ProjectFacetsManager.getProjectFacet(IModuleConstants.JST_WEB_MODULE));
- } catch (CoreException ce) {
- return getFacetErrorComposite(parent);
- }
-
- if (isEAR) {
- return createEARContent(parent);
- } else if (isWEB) {
- return createWebContent(parent);
- } else {
- return createNonEARContent(parent);
- }
- }
-
- private Composite getFacetErrorComposite(final Composite parent) {
- final String errorCheckingFacet = ManifestUIResourceHandler.Error_Checking_Project_Facets;
- setErrorMessage(errorCheckingFacet);
- setValid(false);
- return getErrorComposite(parent, errorCheckingFacet);
- }
-
- private Composite getErrorComposite(final Composite parent, final String error) {
- final Composite composite = new Composite(parent, SWT.NONE);
- final GridLayout layout = new GridLayout();
- layout.marginWidth = 0;
- layout.marginWidth = 0;
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
- final Label label= new Label(composite, SWT.NONE);
- label.setText(error);
- return composite;
- }
-
- private Composite createEARContent(final Composite parent) {
- controls = new IJ2EEDependenciesControl[1];
- controls[0] = new AddModulestoEARPropertiesPage(project, this);
- return controls[0].createContents(parent);
- }
-
- private Composite createWebContent(final Composite parent) {
- final boolean standalone = J2EEProjectUtilities.isStandaloneProject(project);
-
- if (standalone) {
- // only need to create the Web Libraries page
- controls = new IJ2EEDependenciesControl[1];
- controls[0] = new WebLibDependencyPropertiesPage(project, this);
- return controls[0].createContents(parent);
- } else {
- // Create a tabbed folder with both "J2EE Modules" and "Web Libraries"
- final TabFolder folder = new TabFolder(parent, SWT.LEFT);
- folder.setLayoutData(new GridData(GridData.FILL_BOTH));
- folder.setFont(parent.getFont());
-
- // Create the two tabs
- controls = new IJ2EEDependenciesControl[2];
-
- controls[0] = new JARDependencyPropertiesPage(project, this);
- TabItem tab = new TabItem(folder, SWT.NONE);
- tab.setControl(controls[0].createContents(folder));
- tab.setText(ManifestUIResourceHandler.J2EE_Modules);
- controls[1] = new WebLibDependencyPropertiesPage(project, this);
- tab = new TabItem(folder, SWT.NONE);
- tab.setControl(controls[1].createContents(folder));
- tab.setText(ManifestUIResourceHandler.Web_Libraries);
-
- folder.setSelection(0);
- return folder;
- }
- }
-
- private Composite createNonEARContent(final Composite parent) {
- controls = new IJ2EEDependenciesControl[1];
- final boolean standalone = J2EEProjectUtilities.isStandaloneProject(project);
- if (standalone) {
- // if not referenced by an EAR, check if referenced by a dynamic web project
- if (J2EEProjectUtilities.getReferencingWebProjects(project).length > 0) {
- controls[0] = new WebRefDependencyPropertiesPage(project, this);
- } else {
- return getUnreferencedErrorComposite(parent);
- }
- } else {
- controls[0] = new JARDependencyPropertiesPage(project, this);
- }
-
- return controls[0].createContents(parent);
- }
-
- private Composite getUnreferencedErrorComposite(final Composite parent) {
- final String msg = ManifestUIResourceHandler.Unreferenced_Module_Error;
- setErrorMessage(msg);
- return getErrorComposite(parent, msg);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.IPreferencePage#performOk()
- */
- public boolean performOk() {
- for (int i = 0; i < controls.length; i++) {
- if (controls[i] != null) {
- if (!controls[i].performOk()) {
- return false;
- }
- }
- }
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.PreferencePage#performDefaults()
- */
- public void performDefaults() {
- for (int i = 0; i < controls.length; i++) {
- if (controls[i] != null) {
- controls[i].performDefaults();
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.IPreferencePage#performCancel()
- */
- public boolean performCancel() {
- for (int i = 0; i < controls.length; i++) {
- if (controls[i] != null) {
- if (!controls[i].performCancel()) {
- return false;
- }
- }
- }
- return super.performCancel();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.IDialogPage#setVisible(boolean)
- */
- public void setVisible(boolean visible) {
- super.setVisible(visible);
- for (int i = 0; i < controls.length; i++) {
- if (controls[i] != null) {
- controls[i].setVisible(visible);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.IDialogPage#dispose()
- */
- public void dispose() {
- super.dispose();
- for (int i = 0; i < controls.length; i++) {
- if(controls[i] != null){
- controls[i].dispose();
- }
- }
- }
-
- protected static void createDescriptionComposite(final Composite parent, final String description) {
- Composite descriptionComp = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.numColumns = 1;
- descriptionComp.setLayout(layout);
- descriptionComp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- fillDescription(descriptionComp, description);
- }
-
- private static void fillDescription(Composite c, String s) {
- GridData data = new GridData(GridData.FILL_HORIZONTAL);
- data.widthHint = 250;
- Text text = new Text(c, SWT.READ_ONLY | SWT.WRAP);
- text.setLayoutData(data);
- text.setText(s);
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/J2EEPropertiesConstants.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/J2EEPropertiesConstants.java
deleted file mode 100644
index ddfb3eec6..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/J2EEPropertiesConstants.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 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
- *******************************************************************************/
-/*
- * Created on Apr 8, 2004
- *
- * To change the template for this generated file go to
- * Window - Preferences - Java - Code Generation - Code and Comments
- */
-package org.eclipse.jst.j2ee.internal;
-
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIMessages;
-
-/**
- * @author vijayb
- *
- * To change the template for this generated type comment go to Window - Preferences - Java - Code
- * Generation - Code and Comments
- */
-public interface J2EEPropertiesConstants {
- //J2EEUIMessages.getResourceString("Import_Classes");
- public String J2EE_LEVEL = J2EEUIMessages.getResourceString("J2EE_Level"); //$NON-NLS-1$
- public String J2EE_12 = J2EEUIMessages.getResourceString("J2EE_12"); //$NON-NLS-1$
- public String J2EE_12_DESCRIPTION = J2EEUIMessages.getResourceString("J2EE_12_DESCRIPTION"); //$NON-NLS-1$
- public String J2EE_13 = J2EEUIMessages.getResourceString("J2EE_13"); //$NON-NLS-1$
- public String J2EE_13_DESCRIPTION = J2EEUIMessages.getResourceString("J2EE_13_DESCRIPTION"); //$NON-NLS-1$
- public String J2EE_14_DESCRIPTION = J2EEUIMessages.getResourceString("J2EE_14_DESCRIPTION"); //$NON-NLS-1$
- public String EJB_LEVEL = J2EEUIMessages.getResourceString("EJB_LEVEL"); //$NON-NLS-1$
- public String EJB_11 = J2EEUIMessages.getResourceString("EJB_11"); //$NON-NLS-1$
- public String EJB_11_DESCRIPTION = J2EEUIMessages.getResourceString("EJB_11_DESCRIPTION"); //$NON-NLS-1$
- public String EJB_20 = J2EEUIMessages.getResourceString("EJB_20"); //$NON-NLS-1$
- public String EJB_20_DESCRIPTION = J2EEUIMessages.getResourceString("EJB_20_DESCRIPTION"); //$NON-NLS-1$
- public String EJB_21_DESCRIPTION = J2EEUIMessages.getResourceString("EJB_21_DESCRIPTION"); //$NON-NLS-1$
- public String CONNECTOR_LEVEL = J2EEUIMessages.getResourceString("CONNECTOR_LEVEL"); //$NON-NLS-1$
- public String CONNECTOR_10 = J2EEUIMessages.getResourceString("CONNECTOR_10"); //$NON-NLS-1$
- public String CONNECTOR_15 = J2EEUIMessages.getResourceString("CONNECTOR_15"); //$NON-NLS-1$
- public String CONNECTOR_10_DESCRIPTION = J2EEUIMessages.getResourceString("CONNECTOR_10_DESCRIPTION"); //$NON-NLS-1$
- public String CONNECTOR_15_DESCRIPTION = J2EEUIMessages.getResourceString("CONNECTOR_15_DESCRIPTION"); //$NON-NLS-1$
- public String WEB_LEVEL = J2EEUIMessages.getResourceString("WEB_LEVEL"); //$NON-NLS-1$
- public String WEB_22_DESCRIPTION = J2EEUIMessages.getResourceString("WEB_22_DESCRIPTION"); //$NON-NLS-1$
- public String WEB_23_DESCRIPTION = J2EEUIMessages.getResourceString("WEB_23_DESCRIPTION"); //$NON-NLS-1$
- public String WEB_24_DESCRIPTION = J2EEUIMessages.getResourceString("WEB_24_DESCRIPTION"); //$NON-NLS-1$
- public String APP_CLIENT_LEVEL = J2EEUIMessages.getResourceString("APP_CLIENT_LEVEL"); //$NON-NLS-1$
- public String APP_CLIENT_12_DESCRIPTION = J2EEUIMessages.getResourceString("APP_CLIENT_12_DESCRIPTION"); //$NON-NLS-1$
- public String APP_CLIENT_13_DESCRIPTION = J2EEUIMessages.getResourceString("APP_CLIENT_13_DESCRIPTION"); //$NON-NLS-1$
- public String APP_CLIENT_14_DESCRIPTION = J2EEUIMessages.getResourceString("APP_CLIENT_14_DESCRIPTION"); //$NON-NLS-1$
- public String DESCRIPTION = J2EEUIMessages.getResourceString("DESCRIPTION"); //$NON-NLS-1$
- public String WEB_CONTEXT_ROOT = J2EEUIMessages.getResourceString("WEB_CONTEXT_ROOT"); //$NON-NLS-1$
- public String WEB_CONTENT_FOLDER_NAME = J2EEUIMessages.getResourceString("WEB_CONTENT_FOLDER_NAME"); //$NON-NLS-1$
-
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/JARDependencyPropertiesPage.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/JARDependencyPropertiesPage.java
deleted file mode 100644
index bdcab2f56..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/JARDependencyPropertiesPage.java
+++ /dev/null
@@ -1,1099 +0,0 @@
-/*******************************************************************************
- * 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
- * David Schneider, david.schneider@unisys.com - [142500] WTP properties pages fonts don't follow Eclipse preferences
- * Stefan Dimov, stefan.dimov@sap.com - bug 207826
- *******************************************************************************/
-package org.eclipse.jst.j2ee.internal;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.jar.Manifest;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.core.resources.IWorkspaceRunnable;
-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.emf.common.util.URI;
-import org.eclipse.jdt.core.ElementChangedEvent;
-import org.eclipse.jdt.core.IClasspathAttribute;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.IElementChangedListener;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaElementDelta;
-import org.eclipse.jdt.core.IJavaModel;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jem.util.logger.proxy.Logger;
-import org.eclipse.jem.workbench.utility.JemProjectUtilities;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.dialogs.ProgressMonitorDialog;
-import org.eclipse.jface.viewers.CheckboxTableViewer;
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.TableLayout;
-import org.eclipse.jst.j2ee.application.internal.operations.AddComponentToEnterpriseApplicationDataModelProvider;
-import org.eclipse.jst.j2ee.application.internal.operations.ClassPathSelection;
-import org.eclipse.jst.j2ee.application.internal.operations.ClasspathElement;
-import org.eclipse.jst.j2ee.application.internal.operations.RemoveComponentFromEnterpriseApplicationDataModelProvider;
-import org.eclipse.jst.j2ee.application.internal.operations.UpdateManifestDataModelProperties;
-import org.eclipse.jst.j2ee.application.internal.operations.UpdateManifestDataModelProvider;
-import org.eclipse.jst.j2ee.classpathdep.ClasspathDependencyUtil;
-import org.eclipse.jst.j2ee.classpathdep.IClasspathDependencyConstants;
-import org.eclipse.jst.j2ee.classpathdep.UpdateClasspathAttributeUtil;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveManifest;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveManifestImpl;
-import org.eclipse.jst.j2ee.componentcore.J2EEModuleVirtualArchiveComponent;
-import org.eclipse.jst.j2ee.internal.common.ClasspathModel;
-import org.eclipse.jst.j2ee.internal.common.ClasspathModelEvent;
-import org.eclipse.jst.j2ee.internal.common.ClasspathModelListener;
-import org.eclipse.jst.j2ee.internal.common.classpath.J2EEComponentClasspathUpdater;
-import org.eclipse.jst.j2ee.internal.listeners.IValidateEditListener;
-import org.eclipse.jst.j2ee.internal.listeners.ValidateEditListener;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIPlugin;
-import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities;
-import org.eclipse.jst.j2ee.model.IEARModelProvider;
-import org.eclipse.jst.j2ee.model.ModelProviderManager;
-import org.eclipse.jst.javaee.application.Application;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.ModuleCoreNature;
-import org.eclipse.wst.common.componentcore.UnresolveableURIException;
-import org.eclipse.wst.common.componentcore.datamodel.properties.ICreateReferenceComponentsDataModelProperties;
-import org.eclipse.wst.common.componentcore.internal.builder.DependencyGraphManager;
-import org.eclipse.wst.common.componentcore.internal.impl.ModuleURIUtil;
-import org.eclipse.wst.common.componentcore.internal.operation.RemoveReferenceComponentsDataModelProvider;
-import org.eclipse.wst.common.componentcore.internal.util.ComponentUtilities;
-import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.common.componentcore.resources.IVirtualFile;
-import org.eclipse.wst.common.componentcore.resources.IVirtualReference;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider;
-import org.eclipse.wst.common.frameworks.internal.ui.WTPUIPlugin;
-import org.eclipse.wst.common.frameworks.internal.ui.WorkspaceModifyComposedOperation;
-
-/**
- * @author jialin
- *
- * TODO To change the template for this generated type comment go to Window - Preferences - Java -
- * Code Style - Code Templates
- */
-public class JARDependencyPropertiesPage implements IJ2EEDependenciesControl, IClasspathTableOwner, Listener, ClasspathModelListener, IElementChangedListener {
-
- protected final IProject project;
- protected final J2EEDependenciesPage propPage;
- protected IOException caughtManifestException;
- protected boolean isDirty;
- protected Text classPathText;
- protected Text componentNameText;
- protected ClasspathModel model;
- protected CCombo availableAppsCombo;
- protected ClasspathTableManager tableManager;
- protected IValidateEditListener validateEditListener;
- protected Label manifestLabel;
- protected Label enterpriseApplicationLabel;
- protected Label availableDependentJars;
- private final Display display;
- private boolean isDisposed = false;
-
- /**
- * Constructor for JARDependencyPropertiesControl
- */
- public JARDependencyPropertiesPage(final IProject project, final J2EEDependenciesPage page) {
- super();
- J2EEComponentClasspathUpdater.getInstance().pauseUpdates();
- this.project = project;
- this.propPage = page;
- this.display = propPage.getShell().getDisplay();
- }
-
- /**
- * Returns false if page should not be displayed for the project.
- */
- protected void initialize() {
- model = createClasspathModel();
- model.setProject(project);
- if (model.getComponent() != null) {
- model.addListener(this);
- updateModelManifest();
- initializeValidateEditListener();
- }
- }
-
- protected ClasspathModel createClasspathModel(){
- return new ClasspathModel(null, false);
- }
-
- public void dispose() {
- isDisposed = true;
- JavaCore.removeElementChangedListener(this);
- J2EEComponentClasspathUpdater.getInstance().resumeUpdates();
- }
-
- private void updateModelManifest() {
- if (JemProjectUtilities.isBinaryProject(project) || model.getAvailableEARComponents().length == 0)
- return;
-
- IVirtualComponent component = ComponentCore.createComponent(project);
- if(component != null){
- IVirtualFile vManifest = component.getRootFolder().getFile(new Path(J2EEConstants.MANIFEST_URI));
- if(vManifest.exists()){
- IFile iManifest = vManifest.getUnderlyingFile();
- if(iManifest != null && iManifest.exists()){
- InputStream in = null;
- try {
- in = iManifest.getContents();
- ArchiveManifest mf = new ArchiveManifestImpl(new Manifest(in));
- model.primSetManifest(mf);
- } catch (CoreException e) {
- Logger.getLogger().logError(e);
- model.primSetManifest(new ArchiveManifestImpl());
- } catch (IOException iox) {
- Logger.getLogger().logError(iox);
- model.primSetManifest(new ArchiveManifestImpl());
- caughtManifestException = iox;
- } finally {
- if (in != null) {
- try {
- in.close();
- } catch (IOException weTried) {
- // Ignore
- }
- }
- }
- }
- }
- }
- }
-
-
- protected void initializeValidateEditListener() {
- validateEditListener = new ValidateEditListener(null, model);
- validateEditListener.setShell(propPage.getShell());
- }
-
- public void setVisible(boolean visible) {
- if (visible) {
- if (caughtManifestException != null && !model.isDirty()) {
- ManifestErrorPrompter.showManifestException(propPage.getShell(), ERROR_READING_MANIFEST_DIALOG_MESSAGE_PROP_PAGE, false, caughtManifestException);
- }
- }
- }
-
- /**
- * Refreshes the ClasspathModel if the project classpath is changed.
- */
- public void elementChanged(final ElementChangedEvent event) {
- if (event.getType() == ElementChangedEvent.POST_CHANGE && classpathChanged(event.getDelta())) {
- // trigger a recomputation and refresh for the currently selected EAR
- if (!isDisposed) {
- display.asyncExec (new Runnable () {
- public void run () {
- if (!isDisposed) {
- handleClasspathChange();
- }
- }
- });
- }
- }
- }
-
- /**
- * Called to refresh the UI when the classpath changes
- */
- protected void handleClasspathChange() {
- model.resetClassPathSelection();
- refresh();
- }
-
- private boolean classpathChanged(final IJavaElementDelta delta) {
- final int kind = delta.getKind();
- if (kind == IJavaElementDelta.CHANGED) {
- final int flags = delta.getFlags();
- final IJavaElement element = delta.getElement();
- if (element instanceof IJavaModel) {
- if ((flags & IJavaElementDelta.F_CHILDREN) == IJavaElementDelta.F_CHILDREN) {
- final IJavaElementDelta[] children = delta.getChangedChildren();
- for (int i = 0; i < children.length; i++) {
- // check all of the IJavaProject children
- if (classpathChanged(children[i])) {
- return true;
- }
- }
- }
- } else if (element instanceof IJavaProject) {
- // check if we either have a direct indication of a classpath change or a delta on the
- // .classpath file (changes to classpath entry attributes only give us this...)
- final IJavaProject jproject = (IJavaProject) element;
- final IProject eventProject = jproject.getProject();
- if (eventProject.equals(project)) {
- if ((flags & IJavaElementDelta.F_CLASSPATH_CHANGED) != 0) {
- return true;
- }
- final IResourceDelta[] deltas = delta.getResourceDeltas();
- if (deltas != null) {
- for (int i = 0; i < deltas.length; i++) {
- if (deltas[i].getProjectRelativePath().toString().equals(".classpath")) { //$NON-NLS-1$
- return true;
- }
- }
- }
- }
- }
- }
- return false;
- }
-
- public Composite createContents(Composite parent) {
- initialize();
- Composite composite = createBasicComposite(parent);
- GridLayout layout = new GridLayout();
- layout.marginWidth = 0;
- layout.marginWidth = 0;
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
- if (model.getComponent() != null) {
- if (!isValidComponent())
- return composite;
- J2EEDependenciesPage.createDescriptionComposite(composite, ManifestUIResourceHandler.J2EE_Modules_Desc);
- createProjectLabelsGroup(composite);
- createListGroup(composite);
- createTextGroup(composite);
- refresh();
- }
- Dialog.applyDialogFont(parent);
- postCreateContents();
- return composite;
- }
-
- /**
- * Called at the end of createContents().
- */
- protected void postCreateContents() {
- // register this object as an IElementChangedListener so that it will react to user changes to the Java build path
- JavaCore.addElementChangedListener(this);
- }
-
- /**
- * @param comp
- * @return
- */
- protected Composite createBasicComposite(Composite comp) {
- Composite composite = new Composite(comp, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.marginWidth = 0;
- layout.marginWidth = 0;
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
- return composite;
- }
-
- protected boolean isValidComponent() {
- if (J2EEProjectUtilities.isEARProject(project)) {
- propPage.setErrorMessage(ManifestUIResourceHandler.EAR_Module_Dep_Error);
- return false;
- } else if (J2EEProjectUtilities.isStandaloneProject(model.getComponent().getProject())) {
- propPage.setErrorMessage(ClasspathModel.NO_EAR_MESSAGE);
- return false;
- }
- return true;
- }
-
- protected void createProjectLabelsGroup(Composite parent) {
-
- Composite labelsGroup = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- labelsGroup.setLayout(layout);
- labelsGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- /*
- * Label label = new Label(labelsGroup, SWT.NONE);
- * label.setText(ManifestUIResourceHandler.Project_name__UI_);
- *
- * componentNameText = new Text(labelsGroup, SWT.BORDER); GridData data = new
- * GridData(GridData.FILL_HORIZONTAL); componentNameText.setEditable(false);
- * componentNameText.setLayoutData(data); componentNameText.setText(project.getName());
- */
-
- createEnterpriseAppsControls(labelsGroup);
-
- }
-
- private void createEnterpriseAppsControls(Composite labelsGroup) {
-
- enterpriseApplicationLabel = new Label(labelsGroup, SWT.NONE);
- enterpriseApplicationLabel.setText(ManifestUIResourceHandler.EAR_Project_Name__UI__UI_);
-
- availableAppsCombo = new CCombo(labelsGroup, SWT.READ_ONLY | SWT.BORDER);
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- availableAppsCombo.setLayoutData(gd);
-
- availableAppsCombo.addListener(SWT.Selection, this);
-
- }
-
- protected void createListGroup(Composite parent) {
- Composite listGroup = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.numColumns = 1;
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- listGroup.setLayout(layout);
- GridData gData = new GridData(GridData.FILL_BOTH);
- gData.horizontalIndent = 5;
- listGroup.setLayoutData(gData);
-
- availableDependentJars = new Label(listGroup, SWT.NONE);
- gData = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL);
- availableDependentJars.setText(ManifestUIResourceHandler.Available_dependent_JARs__UI_);
- availableDependentJars.setLayoutData(gData);
- createTableComposite(listGroup);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.etools.j2ee.common.ui.classpath.IClasspathTableOwner#createGroup(org.eclipse.swt.widgets.Composite)
- */
- public Group createGroup(Composite parent) {
- return new Group(parent, SWT.NULL);
- }
-
- protected void createTextGroup(Composite parent) {
-
- Composite textGroup = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.numColumns = 1;
- textGroup.setLayout(layout);
- textGroup.setLayoutData(new GridData(GridData.FILL_BOTH | GridData.GRAB_HORIZONTAL));
-
- createClassPathText(textGroup);
-
- }
-
- protected void createClassPathText(Composite textGroup) {
-
- manifestLabel = new Label(textGroup, SWT.NONE);
- manifestLabel.setText(ManifestUIResourceHandler.Manifest_Class_Path__UI_);
-
- classPathText = new Text(textGroup, SWT.BORDER | SWT.MULTI | SWT.WRAP | SWT.V_SCROLL);
- GridData gData = new GridData(GridData.FILL_BOTH);
- gData.widthHint = 400;
- gData.heightHint = 100;
- classPathText.setLayoutData(gData);
- classPathText.setEditable(false);
- }
-
- protected void createTableComposite(Composite parent) {
- Composite composite = new Composite(parent, SWT.NONE);
- GridData gData = new GridData(GridData.FILL_BOTH);
- composite.setLayoutData(gData);
- tableManager = new ClasspathTableManager(this, model, validateEditListener);
- tableManager.fillComposite(composite);
- }
-
- /**
- * @see IClasspathTableOwner#createAvailableJARsViewer(Composite)
- */
- public CheckboxTableViewer createAvailableJARsViewer(Composite parent) {
- int flags = SWT.CHECK | SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI;
-
- Table table = new Table(parent, flags);
- CheckboxTableViewer availableJARsViewer = new CheckboxTableViewer(table);
-
- // set up table layout
- TableLayout tableLayout = new org.eclipse.jface.viewers.TableLayout();
- tableLayout.addColumnData(new ColumnWeightData(200, true));
- tableLayout.addColumnData(new ColumnWeightData(200, true));
- table.setLayout(tableLayout);
- table.setHeaderVisible(true);
- table.setLinesVisible(true);
-
- // do not create sorter otherwise order will go wrong
- //availableJARsViewer.setSorter(new ViewerSorter());
-
- // table columns
- TableColumn fileNameColumn = new TableColumn(table, SWT.NONE, 0);
- fileNameColumn.setText(ManifestUIResourceHandler.JAR_Module_UI_);
- fileNameColumn.setResizable(true);
-
- TableColumn projectColumn = new TableColumn(table, SWT.NONE, 1);
- projectColumn.setText(ManifestUIResourceHandler.Project_UI_);
- projectColumn.setResizable(true);
- tableLayout.layout(table, true);
- return availableJARsViewer;
-
- }
-
- /**
- * @see IClasspathTableOwner#createButtonColumnComposite(Composite)
- */
- public Composite createButtonColumnComposite(Composite parent) {
- Composite buttonColumn = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.numColumns = 1;
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- buttonColumn.setLayout(layout);
- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_BEGINNING);
- buttonColumn.setLayoutData(data);
- return buttonColumn;
- }
-
- /**
- * @see IClasspathTableOwner
- */
- public Button primCreatePushButton(String label, Composite buttonColumn) {
- Button aButton = new Button(buttonColumn, SWT.PUSH);
- aButton.setText(label);
- return aButton;
- }
-
- /**
- * @see IClasspathTableOwner
- */
- public Button primCreateRadioButton(String label, Composite parent) {
- Button aButton = new Button(parent, SWT.RADIO);
- aButton.setText(label);
- return aButton;
- }
-
- /**
- * @see Listener#handleEvent(Event)
- */
- public void handleEvent(Event event) {
- if (event.widget == availableAppsCombo)
- availableAppsSelected(event);
- }
-
- protected void availableAppsSelected(Event event) {
- int index = availableAppsCombo.getSelectionIndex();
- model.selectEAR(index);
- }
-
- protected void populateApps() {
- IVirtualComponent[] components = model.getAvailableEARComponents();
- String[] values = new String[components.length];
- for (int i = 0; i < components.length; i++) {
- values[i] = components[i].getProject().getName();
- }
- if (availableAppsCombo != null) {
- availableAppsCombo.setItems(values);
- IVirtualComponent selected = model.getSelectedEARComponent();
- if (selected != null) {
- int index = Arrays.asList(components).indexOf(selected);
- availableAppsCombo.select(index);
- } else
- availableAppsCombo.clearSelection();
- }
- }
-
- protected void refresh() {
- populateApps();
- if (tableManager != null) {
- tableManager.refresh();
- }
- refreshText();
- }
-
-
- public void refreshText() {
- ClassPathSelection sel = model.getClassPathSelection();
- if (sel != null && classPathText != null)
- classPathText.setText(sel == null ? "" : sel.toString()); //$NON-NLS-1$
- }
-
- /**
- * @see ClasspathModelListener#modelChanged(ClasspathModelEvent)
- */
- public void modelChanged(ClasspathModelEvent evt) {
- if (evt.getEventType() == ClasspathModelEvent.CLASS_PATH_CHANGED) {
- isDirty = true;
- refreshText();
- } else if (evt.getEventType() == ClasspathModelEvent.EAR_PROJECT_CHANGED) {
- tableManager.refresh();
- }
- }
-
- public void performDefaults() {
- model.resetClassPathSelection();
- refresh();
- isDirty = false;
- model.dispose();
- }
-
- public boolean performCancel() {
- model.dispose();
- return true;
- }
-
- /**
- * @see org.eclipse.jface.preference.IPreferencePage#performOk()
- */
- public boolean performOk() {
- if (!isDirty)
- return true;
- modifyEARBundledLibs();
- WorkspaceModifyComposedOperation composed = new WorkspaceModifyComposedOperation(createManifestOperation());
- createClasspathAttributeUpdateOperation(composed, model.getClassPathSelection(), false);
- try {
- new ProgressMonitorDialog(propPage.getShell()).run(true, true, composed);
- } catch (InvocationTargetException ex) {
- String title = ManifestUIResourceHandler.An_internal_error_occurred_ERROR_;
- String msg = title;
- if (ex.getTargetException() != null && ex.getTargetException().getMessage() != null)
- msg = ex.getTargetException().getMessage();
- MessageDialog.openError(propPage.getShell(), title, msg);
- org.eclipse.jem.util.logger.proxy.Logger.getLogger().logError(ex);
- return false;
- } catch (InterruptedException e) {
- // cancelled
- return false;
- } finally {
- model.dispose();
- }
- isDirty = false;
- return true;
- }
-
- List getUnSelectedClassPathElementsForJ2EEDependency() {
- List unselectedForJ2EE = getUnSelectedClassPathSelection().getClasspathElements();
-
- List unselected = new ArrayList();
- if (model != null && model.getClassPathSelectionForWLPs() != null) {
- List wlpSelected = model.getClassPathSelectionForWLPs().getSelectedClasspathElements();
-
- java.util.Iterator it = unselectedForJ2EE.iterator();
-
- while (it.hasNext()) {
- ClasspathElement element = (ClasspathElement) it.next();
- java.util.Iterator wlpIterator = wlpSelected.iterator();
- boolean found = false;
- while (wlpIterator.hasNext()) {
- ClasspathElement wlpElement = (ClasspathElement) wlpIterator.next();
- String text = element.getText();
- int index = text.indexOf(".jar");
- if (index != -1) {
- text = text.substring(0, index);
- if (text.equals(wlpElement.getText())) {
- found = true;
- break;
- }
- }
- }
- if (!found) {
- if (!unselected.contains(element))
- unselected.add(element);
- }
-
- }
- }
- return unselected;
- }
-
-
- /**
- * @deprecated don't use this method it will be deleted
- * @return
- */
- List getUnSelectedClassPathElementsForWebDependency() {
- List unselectedForWLP = getUnSelectedClassPathSelectionForWLPs().getClasspathElements();
- List unselected = new ArrayList();
- if (model != null && model.getClassPathSelection() != null) {
- List j2eeSelected = model.getClassPathSelection().getSelectedClasspathElements();
- java.util.Iterator it = unselectedForWLP.iterator();
-
- while (it.hasNext()) {
- ClasspathElement element = (ClasspathElement) it.next();
- java.util.Iterator j2eeIterator = j2eeSelected.iterator();
- boolean found = false;
- while (j2eeIterator.hasNext()) {
- ClasspathElement j2eeElement = (ClasspathElement) j2eeIterator.next();
- String text = j2eeElement.getText();
- int index = text.indexOf(".jar");
- if( index != -1 ){
- text = text.substring(0, index);
- if (element.getText().equals(text)) {
- found = true;
- break;
- }
- }
- }
- if (!found) {
- if (!unselected.contains(element))
- unselected.add(element);
- }
-
- }
- } else {
- unselected = unselectedForWLP;
- }
- return unselected;
- }
-
- /**
- * DoNotUseMeThisWillBeDeletedPost15
- * @return
- */
- protected WorkspaceModifyComposedOperation createJ2EEComponentDependencyOperations() {
- WorkspaceModifyComposedOperation composedOp = null;
- List selected = getSelectedClassPathSelection().getClasspathElements();
- List unselected = getUnSelectedClassPathElementsForJ2EEDependency();
-
- List targetComponentsHandles = new ArrayList();
- for (int i = 0; i < selected.size(); i++) {
- ClasspathElement element = (ClasspathElement) selected.get(i);
- IVirtualComponent component = element.getComponent();
- if (null != component) {
- targetComponentsHandles.add(component);
- }
- }
- if (!targetComponentsHandles.isEmpty()) {
- composedOp = new WorkspaceModifyComposedOperation();
- composedOp.addRunnable(WTPUIPlugin.getRunnableWithProgress(ComponentUtilities.createReferenceComponentOperation(model.getComponent(), targetComponentsHandles)));
- }
- targetComponentsHandles = new ArrayList();
- for (int i = 0; i < unselected.size(); i++) {
- ClasspathElement element = (ClasspathElement) unselected.get(i);
- IProject elementProject = element.getProject();
- if (elementProject != null) {
- if (ModuleCoreNature.isFlexibleProject(elementProject)) {
- IVirtualComponent targetComp = ComponentCore.createComponent(elementProject);
- targetComponentsHandles.add(targetComp);
- }
- } else {
- URI archiveURI = element.getArchiveURI();
- if (archiveURI != null && !archiveURI.equals("")) { //$NON-NLS-1$
- String name = ""; //$NON-NLS-1$
- try {
- String type = ModuleURIUtil.getArchiveType(archiveURI);
- String tmpname = ModuleURIUtil.getArchiveName(archiveURI);
- name = type + IPath.SEPARATOR + tmpname;
- } catch (UnresolveableURIException e) {
- Logger.getLogger().logError(e.getMessage());
- }
- if (!name.equals("")) { //$NON-NLS-1$
- IVirtualReference ref = model.getComponent().getReference(name);
- if (ref != null) {
- IVirtualComponent referenced = ref.getReferencedComponent();
- targetComponentsHandles.add(referenced);
- }
- }
- }
- }
- }
- if (!targetComponentsHandles.isEmpty()) {
- if (composedOp == null)
- composedOp = new WorkspaceModifyComposedOperation();
- composedOp.addRunnable(WTPUIPlugin.getRunnableWithProgress(ComponentUtilities.removeReferenceComponentOperation(model.getComponent(), targetComponentsHandles)));
- }
- return composedOp;
- }
-
-
- /**
- * This should be moved to the {@link WebLibDependencyPropertiesPage} because it is only used there.
- * @return
- */
- protected WorkspaceModifyComposedOperation createComponentDependencyOperations() {
- WorkspaceModifyComposedOperation composedOp = null;
- final ClassPathSelection selectedWLPs = getSelectedClassPathSelectionForWLPs();
- List selected = selectedWLPs.getClasspathElements();
- List unselected = getUnSelectedClassPathSelectionForWLPs().getClasspathElements();
-
- List targetComponentsHandles = new ArrayList();
- for (int i = 0; i < selected.size(); i++) {
- ClasspathElement element = (ClasspathElement) selected.get(i);
- if (element.isClasspathDependency() || element.isClasspathEntry()) {
- continue;
- }
- IProject elementProject = element.getProject();
- if (elementProject != null) {
- IVirtualComponent targetComp = ComponentCore.createComponent(elementProject);
- targetComponentsHandles.add(targetComp);
- }
- }
- if (!targetComponentsHandles.isEmpty()) {
- composedOp = new WorkspaceModifyComposedOperation();
- composedOp.addRunnable(WTPUIPlugin.getRunnableWithProgress(ComponentUtilities.createWLPReferenceComponentOperation(model.getComponent(), targetComponentsHandles)));
- }
- targetComponentsHandles = new ArrayList();
- for (int i = 0; i < unselected.size(); i++) {
- ClasspathElement element = (ClasspathElement) unselected.get(i);
- if (element.isClasspathDependency() || element.isClasspathEntry()) {
- continue;
- }
- IProject elementProject = element.getProject();
- if (elementProject != null) {
- if (ModuleCoreNature.isFlexibleProject(elementProject)) {
- IVirtualComponent targetComp = ComponentCore.createComponent(elementProject);
- targetComponentsHandles.add(targetComp);
- }
- } else {
- URI archiveURI = element.getArchiveURI();
- if (archiveURI != null && !archiveURI.equals("")) { //$NON-NLS-1$
- String name = ""; //$NON-NLS-1$
- try {
- String type = ModuleURIUtil.getArchiveType(archiveURI);
- String tmpname = ModuleURIUtil.getArchiveName(archiveURI);
- name = type + IPath.SEPARATOR + tmpname;
- } catch (UnresolveableURIException e) {
- Logger.getLogger().logError(e.getMessage());
- }
- if (!name.equals("")) { //$NON-NLS-1$
- IVirtualReference ref = model.getComponent().getReference(name);
- IVirtualComponent referenced = ref.getReferencedComponent();
- targetComponentsHandles.add(referenced);
- }
- }
- }
- }
- if (!targetComponentsHandles.isEmpty()) {
- if (composedOp == null) {
- composedOp = new WorkspaceModifyComposedOperation();
- }
- composedOp.addRunnable(WTPUIPlugin.getRunnableWithProgress(ComponentUtilities.removeWLPReferenceComponentOperation(model.getComponent(), targetComponentsHandles)));
- }
-
- if (composedOp == null) {
- composedOp = new WorkspaceModifyComposedOperation();
- }
- createClasspathAttributeUpdateOperation(composedOp, model.getClassPathSelectionForWLPs(), true);
-
- return composedOp;
- }
-
- protected WorkspaceModifyComposedOperation createFlexProjectOperations() {
- WorkspaceModifyComposedOperation composedOp = null;
- Object[] elements = tableManager.availableJARsViewer.getCheckedElements();
- for (int i = 0; i < elements.length; i++) {
- ClasspathElement element = (ClasspathElement) elements[i];
- IProject elementProject = element.getProject();
- try {
- if (elementProject != null && !elementProject.hasNature(IModuleConstants.MODULE_NATURE_ID)) {
- if (composedOp == null) {
- composedOp = new WorkspaceModifyComposedOperation();
- }
- composedOp.addRunnable(WTPUIPlugin.getRunnableWithProgress(J2EEProjectUtilities.createFlexJavaProjectForProjectOperation(elementProject, false)));
- }
- } catch (CoreException e) {
- Logger.getLogger().logError(e);
- }
- }
- return composedOp;
- }
-
- protected ClassPathSelection getUnSelectedClassPathSelectionForWLPs() {
- ClassPathSelection selection = new ClassPathSelection();
- Object[] checkedElements = tableManager.availableJARsViewer.getCheckedElements();
- List modelElements = model.getClassPathSelectionForWLPs().getClasspathElements();
- for (int i = 0; i < modelElements.size(); i++) {
- List checkedElementsList = Arrays.asList(checkedElements);
- if (!checkedElementsList.contains(modelElements.get(i))) {
- selection.getClasspathElements().add(modelElements.get(i));
- }
- }
- return selection;
- }
-
- private ClassPathSelection getSelectedClassPathSelection() {
- ClassPathSelection selection = new ClassPathSelection();
- Object[] checkedElements = tableManager.availableJARsViewer.getCheckedElements();
- for (int i = 0; i < checkedElements.length; i++) {
- selection.getClasspathElements().add(checkedElements[i]);
- }
- return selection;
- }
-
- protected ClassPathSelection getUnSelectedClassPathSelection() {
- ClassPathSelection selection = new ClassPathSelection();
- Object[] checkedElements = tableManager.availableJARsViewer.getCheckedElements();
- List modelElements = model.getClassPathSelection().getClasspathElements();
- for (int i = 0; i < modelElements.size(); i++) {
- List checkedElementsList = Arrays.asList(checkedElements);
- if (!checkedElementsList.contains(modelElements.get(i))) {
- selection.getClasspathElements().add(modelElements.get(i));
- }
- }
- return selection;
- }
-
-
- private ClassPathSelection getSelectedClassPathSelectionForWLPs() {
- ClassPathSelection selection = new ClassPathSelection();
- Object[] checkedElements = tableManager.availableJARsViewer.getCheckedElements();
- for (int i = 0; i < checkedElements.length; i++) {
- selection.getClasspathElements().add(checkedElements[i]);
- }
- return selection;
- }
-
- protected UpdateManifestOperation createManifestOperation() {
- return new UpdateManifestOperation(project.getName(), model.getClassPathSelection().toString(), true);
- }
-
- protected void createClasspathAttributeUpdateOperation(final WorkspaceModifyComposedOperation composedOp, final ClassPathSelection selection, final boolean isWebApp) {
- final Map selectedEntriesToRuntimePath = new HashMap();
- final Map unselectedEntriesToRuntimePath = new HashMap();
- final List elements = selection.getClasspathElements();
- for (int i = 0; i < elements.size(); i++) {
- final ClasspathElement element = (ClasspathElement) elements.get(i);
- if (element.isClasspathEntry()) {
- final IClasspathEntry entry = element.getClasspathEntry();
- final IClasspathAttribute attrib = ClasspathDependencyUtil.checkForComponentDependencyAttribute(entry);
- boolean hasDepAttrib = false;
- if (attrib != null && attrib.getName().equals(IClasspathDependencyConstants.CLASSPATH_COMPONENT_DEPENDENCY)) {
- hasDepAttrib = true;
- }
- final IPath runtimePath = ClasspathDependencyUtil.getRuntimePath(attrib, isWebApp, ClasspathDependencyUtil.isClassFolderEntry(entry));
- if (element.isSelected()) {
- // only add if we don't already have the attribute
- if (!hasDepAttrib) {
- selectedEntriesToRuntimePath.put(entry, runtimePath);
- }
- } else {
- // only add if we already have the attribute
- if (hasDepAttrib) {
- unselectedEntriesToRuntimePath.put(entry, runtimePath);
- }
- }
- }
- }
-
- // if there are any attributes to add, create an operation to add all necessary attributes
- if (!selectedEntriesToRuntimePath.isEmpty()) {
- IDataModelOperation op = UpdateClasspathAttributeUtil.createAddDependencyAttributesOperation(project.getName(), selectedEntriesToRuntimePath);
- composedOp.addRunnable(WTPUIPlugin.getRunnableWithProgress(op));
- }
- // if there are any attributes to remove, create an operation to remove all necessary attributes
- if (!unselectedEntriesToRuntimePath.isEmpty()) {
- IDataModelOperation op = UpdateClasspathAttributeUtil.createRemoveDependencyAttributesOperation(project.getName(), unselectedEntriesToRuntimePath);
- composedOp.addRunnable(WTPUIPlugin.getRunnableWithProgress(op));
- }
- }
-
- protected boolean isReadOnly() {
- return JemProjectUtilities.isBinaryProject(project) && (project.findMember(IModuleConstants.COMPONENT_FILE_PATH) == null) ;
- }
-
- protected void modifyEARBundledLibs() {
- List compsToUncheckList = tableManager.getCheckedLibsAsList();
- if (compsToUncheckList.size() == 0) return;
- Set allCompsToUncheck = new HashSet();
- Set allCompNamesToUncheck = new HashSet();
- for (int i = 0; i < compsToUncheckList.size(); i++) {
- IVirtualComponent comp = (IVirtualComponent)compsToUncheckList.get(i);
- allCompsToUncheck.add(comp);
- if (comp instanceof J2EEModuleVirtualArchiveComponent) allCompNamesToUncheck.add(comp.getName());
- }
- IProject[] ears = J2EEProjectUtilities.getReferencingEARProjects(project);
- for (int i = 0; i < ears.length; i++) {
- IEARModelProvider earModel = (IEARModelProvider)ModelProviderManager.getModelProvider(ears[i]);
- if (J2EEProjectUtilities.isJEEProject(ears[i])) {
- IVirtualComponent earComponent = ComponentCore.createComponent(ears[i]);
- List listToUncheck = createListToUncheck(earComponent, allCompsToUncheck, allCompNamesToUncheck);
- if (listToUncheck.size() == 0) continue;
- removeModulesFromEAR(new NullProgressMonitor(), earComponent, listToUncheck);
- addModulesToEAR(new NullProgressMonitor(), earComponent, listToUncheck);
- }
- }
- }
- //---------------------------------
- private IStatus removeModulesFromEAR(IProgressMonitor monitor, final IVirtualComponent earComponent, final List compsToUncheckList) {
- IStatus stat = IDataModelProvider.OK_STATUS;
- String libDir = ((Application)ModelProviderManager.getModelProvider(earComponent.getProject()).getModelObject()).getLibraryDirectory();
- libDir = (libDir == null) ? J2EEConstants.EAR_DEFAULT_LIB_DIR : libDir;
- Map dependentComps = getEARModuleDependencies(earComponent, compsToUncheckList);
- try {
- IDataModelOperation op = removeComponentFromEAROperation(earComponent, compsToUncheckList, libDir);
- op.execute(null, null);
- J2EEComponentClasspathUpdater.getInstance().queueUpdateEAR(earComponent.getProject());
- removeEARComponentDependencies(dependentComps);
- } catch (ExecutionException e) {
- Logger.getLogger().log(e);
- }
- return stat;
- }
-
-
- private IStatus addModulesToEAR(IProgressMonitor monitor, final IVirtualComponent earComponent, final List compsToUncheckList) {
- IStatus stat = IDataModelProvider.OK_STATUS;
- try {
- IWorkspaceRunnable runnable = new IWorkspaceRunnable(){
- public void run(IProgressMonitor monitor) throws CoreException{
- execAddOp(monitor, compsToUncheckList, J2EEConstants.EAR_ROOT_DIR, earComponent);
- }
- };
- J2EEUIPlugin.getWorkspace().run(runnable, monitor);
- } catch (Exception e) {
- Logger.getLogger().log(e);
- }
- return IDataModelProvider.OK_STATUS;
- }
-
- private List createListToUncheck(IVirtualComponent earComponent, Set compsToUncheckList, Set compNamesToUncheck) {
- LinkedList res = new LinkedList();
- IVirtualReference[] refs = earComponent.getReferences();
- for (int j = 0; j < refs.length; j++) {
- if (!refs[j].getRuntimePath().isRoot() &&
- (compsToUncheckList.contains(refs[j].getReferencedComponent()) ||
- compNamesToUncheck.contains(refs[j].getReferencedComponent().getName()))) {
- res.add(refs[j].getReferencedComponent());
- }
- }
- return res;
- }
-
- private void execAddOp(IProgressMonitor monitor, List list, String path, IVirtualComponent earComponent) throws CoreException {
- IDataModel dm = DataModelFactory.createDataModel(new AddComponentToEnterpriseApplicationDataModelProvider());
-
- dm.setProperty(ICreateReferenceComponentsDataModelProperties.SOURCE_COMPONENT, earComponent);
- dm.setProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENT_LIST, list);
- dm.setProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENTS_DEPLOY_PATH, path);
-
- IStatus stat = dm.validateProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENT_LIST);
- if (stat != IDataModelProvider.OK_STATUS)
- throw new CoreException(stat);
- try {
- dm.getDefaultOperation().execute(monitor, null);
- } catch (ExecutionException e) {
- Logger.getLogger().log(e);
- }
- }
-
-
- protected IDataModelOperation removeComponentFromEAROperation(IVirtualComponent sourceComponent, List targetComponentsHandles, String dir) {
- IDataModel model = DataModelFactory.createDataModel(new RemoveComponentFromEnterpriseApplicationDataModelProvider());
- model.setProperty(ICreateReferenceComponentsDataModelProperties.SOURCE_COMPONENT, sourceComponent);
- List modHandlesList = (List) model.getProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENT_LIST);
- modHandlesList.addAll(targetComponentsHandles);
- model.setProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENT_LIST, modHandlesList);
- model.setProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENTS_DEPLOY_PATH, dir);
- return model.getDefaultOperation();
- }
-
- private Map getEARModuleDependencies(final IVirtualComponent earComponent, final List components) {
- final Map dependentComps = new HashMap();
- // get all current references to project within the scope of this EAR
- for (int i = 0; i < components.size(); i++) {
-
- final List compsForProject = new ArrayList();
- final IVirtualComponent comp = (IVirtualComponent) components.get(i);
- final IProject[] dependentProjects = DependencyGraphManager.getInstance().getDependencyGraph().getReferencingComponents(comp.getProject());
- for (int j = 0; j < dependentProjects.length; j++) {
- final IProject project = dependentProjects[j];
- // if this is an EAR, can skip
- if (J2EEProjectUtilities.isEARProject(project)) {
- continue;
- }
- final IVirtualComponent dependentComp = ComponentCore.createComponent(project);
- // ensure that the project's share an EAR
- final IProject[] refEARs = J2EEProjectUtilities.getReferencingEARProjects(project);
- boolean sameEAR = false;
- for (int k = 0; k < refEARs.length; k++) {
- if (refEARs[k].equals(earComponent.getProject())) {
- sameEAR = true;
- break;
- }
- }
- if (!sameEAR) {
- continue;
- }
- // if the dependency is a web lib dependency, can skip
- if (J2EEProjectUtilities.isDynamicWebProject(project)) {
- IVirtualReference ref = dependentComp.getReference(comp.getName());
- if (ref != null && ref.getRuntimePath().equals(new Path("/WEB-INF/lib"))) { //$NON-NLS-1$
- continue;
- }
- }
- compsForProject.add(dependentComp);
- }
- dependentComps.put(comp, compsForProject);
- }
- return dependentComps;
- }
-
- private void removeEARComponentDependencies(final Map dependentComps) throws ExecutionException {
- final Iterator targets = dependentComps.keySet().iterator();
- while (targets.hasNext()) {
- final IVirtualComponent target = (IVirtualComponent) targets.next();
- final List sources = (List) dependentComps.get(target);
- for (int i = 0; i < sources.size(); i++) {
- final IVirtualComponent source = (IVirtualComponent) sources.get(i);
- final IDataModel model = DataModelFactory.createDataModel(new RemoveReferenceComponentsDataModelProvider());
- model.setProperty(ICreateReferenceComponentsDataModelProperties.SOURCE_COMPONENT, source);
- final List modHandlesList = (List) model.getProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENT_LIST);
- modHandlesList.add(target);
- model.setProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENT_LIST, modHandlesList);
- model.getDefaultOperation().execute(null, null);
- // update the manifest
- removeManifestDependency(source, target);
- }
- }
- }
-
- private void removeManifestDependency(final IVirtualComponent source, final IVirtualComponent target)
- throws ExecutionException {
- final String sourceProjName = source.getProject().getName();
- final String targetProjName = target.getProject().getName();
- final IProgressMonitor monitor = new NullProgressMonitor();
- final IFile manifestmf = J2EEProjectUtilities.getManifestFile(source.getProject());
- final ArchiveManifest mf = J2EEProjectUtilities.readManifest(source.getProject());
- if (mf == null)
- return;
- final IDataModel updateManifestDataModel = DataModelFactory.createDataModel(new UpdateManifestDataModelProvider());
- updateManifestDataModel.setProperty(UpdateManifestDataModelProperties.PROJECT_NAME, sourceProjName);
- updateManifestDataModel.setBooleanProperty(UpdateManifestDataModelProperties.MERGE, false);
- updateManifestDataModel.setProperty(UpdateManifestDataModelProperties.MANIFEST_FILE, manifestmf);
- String[] cp = mf.getClassPathTokenized();
- List cpList = new ArrayList();
- String cpToRemove = targetProjName + ".jar";//$NON-NLS-1$
- for (int i = 0; i < cp.length; i++) {
- if (!cp[i].equals(cpToRemove)) {
- cpList.add(cp[i]);
- }
- }
- updateManifestDataModel.setProperty(UpdateManifestDataModelProperties.JAR_LIST, cpList);
- updateManifestDataModel.getDefaultOperation().execute(monitor, null );
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ManifestErrorPrompter.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ManifestErrorPrompter.java
deleted file mode 100644
index e70c7e7b1..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ManifestErrorPrompter.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 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
- *******************************************************************************/
-/*
- * Created on Jan 17, 2005
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-package org.eclipse.jst.j2ee.internal;
-
-import org.eclipse.jst.j2ee.internal.plugin.ErrorDialog;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * @author jialin
- *
- * TODO To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-public class ManifestErrorPrompter implements ICommonManifestUIConstants {
-
- /**
- * Constructor for ManifestErrorPrompter.
- */
- private ManifestErrorPrompter() {
- super();
- }
-
- public static boolean showManifestException(Shell shell, String baseMessage, boolean includeCancel, Throwable caught) {
- StringBuffer msg = new StringBuffer(baseMessage);
- msg.append("\n"); //$NON-NLS-1$
- msg.append(MANIFEST_PROBLEM_1);
- msg.append("\n"); //$NON-NLS-1$
- msg.append(MANIFEST_PROBLEM_2);
- msg.append("\n"); //$NON-NLS-1$
- msg.append(MANIFEST_PROBLEM_3);
- msg.append("\n"); //$NON-NLS-1$
- msg.append(MANIFEST_PROBLEM_4);
- return ErrorDialog.openError(shell,
- ERROR_READING_MANIFEST_DIALOG_TITLE,
- msg.toString(),
- caught,
- 0, includeCancel);
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ManifestUIResourceHandler.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ManifestUIResourceHandler.java
deleted file mode 100644
index 50c1f238b..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ManifestUIResourceHandler.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * 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
- * Stefan Dimov, stefan.dimov@sap.com - bug 207826
- *******************************************************************************/
-package org.eclipse.jst.j2ee.internal;
-
-import org.eclipse.osgi.util.NLS;
-
-public final class ManifestUIResourceHandler extends NLS {
-
- private static final String BUNDLE_NAME = "manifest_ui";//$NON-NLS-1$
-
- private ManifestUIResourceHandler() {
- // Do not instantiate
- }
-
- public static String Up_1;
- public static String Down_2;
- public static String Select_All_3;
- public static String Deselect_All_4;
- public static String ERROR_READING_MANIFEST_DIALOG_TITLE;
- public static String SAVE_MANIFEST_WITH_ERROR;
- public static String ERROR_READING_MANIFEST_DIALOG_MESSAGE_EDITOR;
- public static String ERROR_READING_MANIFEST_DIALOG_MESSAGE_PROP_PAGE;
- public static String MANIFEST_PROBLEM_1;
- public static String MANIFEST_PROBLEM_2;
- public static String MANIFEST_PROBLEM_3;
- public static String MANIFEST_PROBLEM_4;
- public static String An_internal_error_occurred_ERROR_;
- public static String Project_name__UI_;
- public static String EAR_Project_Name__UI__UI_;
- public static String Available_dependent_JARs__UI_;
- public static String Manifest_Class_Path__UI_;
- public static String JAR_Module_UI_;
- public static String Packed_In_Lib_UI_;
- public static String Project_UI_;
- public static String EAR_Modules;
- public static String EAR_Modules_Desc;
- public static String J2EE_Modules;
- public static String J2EE_Modules_Desc;
- public static String Web_Libraries;
- public static String Web_Libraries_Desc;
- public static String Web_Ref_Desc;
- public static String EAR_Module_Dep_Error;
- public static String Unreferenced_Module_Error;
- public static String Jar_Dep_One_Module_Error;
- public static String Web_Lib_Error;
- public static String REDIRECT_TEXT_EDITOR_UI_;
- public static String Error_Checking_Project_Facets;
- public static String WEB_LIB_LIST_DESCRIPTION;
- public static String Dynamic_Web_Error;
- public static String No_Web_Reference_Error;
-
- static {
- NLS.initializeMessages(BUNDLE_NAME, ManifestUIResourceHandler.class);
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/SecondCheckBoxStateChangedEvent.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/SecondCheckBoxStateChangedEvent.java
deleted file mode 100644
index df0df7ec2..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/SecondCheckBoxStateChangedEvent.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 SAP AG 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:
- * Stefan Dimov, stefan.dimov@sap.com - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.internal;
-
-import org.eclipse.jface.viewers.CheckStateChangedEvent;
-import org.eclipse.jface.viewers.ICheckable;
-import org.eclipse.jst.j2ee.internal.ui.DoubleCheckboxTableItem;
-
-public class SecondCheckBoxStateChangedEvent extends CheckStateChangedEvent {
-
- private DoubleCheckboxTableItem item = null;
-
- public SecondCheckBoxStateChangedEvent(ICheckable source,
- Object element,
- boolean state) {
- super(source, element, state);
- }
-
- public void setTableItem(DoubleCheckboxTableItem itm) {
- item = itm;
- }
-
- public DoubleCheckboxTableItem getTableItem() {
- return item;
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/UpdateManifestOperation.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/UpdateManifestOperation.java
deleted file mode 100644
index cdf1c19ae..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/UpdateManifestOperation.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 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
- *******************************************************************************/
-/*
- * Created on Jan 17, 2005
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-package org.eclipse.jst.j2ee.internal;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveManifest;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveManifestImpl;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.util.ArchiveUtil;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin;
-import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities;
-import org.eclipse.wst.common.frameworks.internal.enablement.nonui.WFTWrappedException;
-
-/**
- * @author jialin
- *
- * TODO To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-public class UpdateManifestOperation implements org.eclipse.jface.operation.IRunnableWithProgress {
- protected String projectName;
- protected String classPathValue;
- protected boolean replace;
-/**
- * UpdateManifestOperation constructor comment.
- */
-public UpdateManifestOperation(String aProjectName, String aSpaceDelimitedPath, boolean replaceInsteadOfMerge) {
- super();
- projectName = aProjectName;
- classPathValue = aSpaceDelimitedPath;
- replace = replaceInsteadOfMerge;
-}
-protected IProject getProject() {
- return J2EEPlugin.getWorkspace().getRoot().getProject(projectName);
-}
-/**
- * Runs this operation. Progress should be reported to the given progress monitor.
- * This method is usually invoked by an <code>IRunnableContext</code>'s <code>run</code> method,
- * which supplies the progress monitor.
- * A request to cancel the operation should be honored and acknowledged
- * by throwing <code>InterruptedException</code>.
- *
- * @param monitor the progress monitor to use to display progress and receive
- * requests for cancelation
- * @exception InvocationTargetException if the run method must propagate a checked exception,
- * it should wrap it inside an <code>InvocationTargetException</code>; runtime exceptions are automatically
- * wrapped in an <code>InvocationTargetException</code> by the calling context
- * @exception InterruptedException if the operation detects a request to cancel,
- * using <code>IProgressMonitor.isCanceled()</code>, it should exit by throwing
- * <code>InterruptedException</code>
- *
- * @see IRunnableContext#run
- */
-public void run(org.eclipse.core.runtime.IProgressMonitor monitor) throws java.lang.reflect.InvocationTargetException, InterruptedException {
- IProject p = getProject();
- try {
- ArchiveManifest mf = J2EEProjectUtilities.readManifest(p);
- if (mf == null)
- mf = new ArchiveManifestImpl();
- mf.addVersionIfNecessary();
- if (replace)
- mf.setClassPath(classPathValue);
- else
- mf.mergeClassPath(ArchiveUtil.getTokens(classPathValue));
- J2EEProjectUtilities.writeManifest(p, mf);
- } catch (java.io.IOException ex) {
- throw new WFTWrappedException(ex);
- }
-}
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/WebLibDependencyPropertiesPage.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/WebLibDependencyPropertiesPage.java
deleted file mode 100644
index d5045bc02..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/WebLibDependencyPropertiesPage.java
+++ /dev/null
@@ -1,274 +0,0 @@
-/*******************************************************************************
- * 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
- * David Schneider, david.schneider@unisys.com - [142500] WTP properties pages fonts don't follow Eclipse preferences
- *******************************************************************************/
-package org.eclipse.jst.j2ee.internal;
-
-import java.lang.reflect.InvocationTargetException;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.ui.wizards.BuildPathDialogAccess;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.dialogs.ProgressMonitorDialog;
-import org.eclipse.jst.j2ee.application.internal.operations.ClasspathElement;
-import org.eclipse.jst.j2ee.internal.common.ClasspathModel;
-import org.eclipse.jst.j2ee.internal.common.ClasspathModelListener;
-import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.internal.impl.ModuleURIUtil;
-import org.eclipse.wst.common.componentcore.internal.resources.VirtualArchiveComponent;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.common.componentcore.resources.IVirtualReference;
-import org.eclipse.wst.common.frameworks.internal.ui.WorkspaceModifyComposedOperation;
-
-public class WebLibDependencyPropertiesPage extends JARDependencyPropertiesPage implements IClasspathTableOwner, Listener, ClasspathModelListener {
-
- public WebLibDependencyPropertiesPage(final IProject project, final J2EEDependenciesPage page) {
- super(project, page);
- }
-
- protected ClasspathModel createClasspathModel() {
- return new ClasspathModel(null, true);
- }
-
- public Composite createContents(Composite parent) {
- initialize();
- Composite composite = createBasicComposite(parent);
- if (model.getComponent() != null) {
- if (!isValidWebModule())
- return composite;
- J2EEDependenciesPage.createDescriptionComposite(composite, ManifestUIResourceHandler.Web_Libraries_Desc);
- // createProjectLabelsGroup(composite);
- createListGroup(composite);
- handleWLPSupport();
- setEnablement();
- }
- Dialog.applyDialogFont(parent);
- postCreateContents();
- return composite;
- }
-
- protected void createProjectLabelsGroup(Composite parent) {
-
- Composite labelsGroup = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- labelsGroup.setLayout(layout);
- labelsGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- Label label = new Label(labelsGroup, SWT.NONE);
- label.setText(ManifestUIResourceHandler.Project_name__UI_);
-
- componentNameText = new Text(labelsGroup, SWT.BORDER);
- GridData data = new GridData(GridData.FILL_HORIZONTAL);
- componentNameText.setEditable(false);
- componentNameText.setLayoutData(data);
- componentNameText.setText(project.getName());
- }
-
- protected void createListGroup(Composite parent) {
- Composite listGroup = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.numColumns = 1;
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- listGroup.setLayout(layout);
- GridData gData = new GridData(GridData.FILL_BOTH);
- gData.horizontalIndent = 5;
- listGroup.setLayoutData(gData);
-
- availableDependentJars = new Label(listGroup, SWT.NONE);
- gData = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL);
- availableDependentJars.setText(ManifestUIResourceHandler.Available_dependent_JARs__UI_);
- availableDependentJars.setLayoutData(gData);
- createTableComposite(listGroup);
- }
-
- protected void createTableComposite(Composite parent) {
- Composite composite = new Composite(parent, SWT.NONE);
- GridData gData = new GridData(GridData.FILL_BOTH);
- composite.setLayoutData(gData);
- tableManager = new ClasspathTableManager(this, model, validateEditListener);
- tableManager.fillWLPComposite(composite);
- }
-
- protected boolean isValidWebModule() {
- if (!J2EEProjectUtilities.isDynamicWebProject(project)) {
- propPage.setErrorMessage(ManifestUIResourceHandler.Web_Lib_Error);
- return false;
- }
- return true;
- }
-
- protected void setEnablement() {
- if (tableManager.availableJARsViewer.getTable().getItems().length == 0) {
- tableManager.selectAllButton.setEnabled(false);
- tableManager.deselectAllButton.setEnabled(false);
- } else {
- tableManager.selectAllButton.setEnabled(true);
- tableManager.deselectAllButton.setEnabled(true);
- }
- }
-
- private void handleWLPSupport() {
- availableDependentJars.setText(ManifestUIResourceHandler.WEB_LIB_LIST_DESCRIPTION);
- tableManager.refresh();
- }
-
- @Override
- protected void handleClasspathChange() {
- model.resetClassPathSelectionForWLPs();
- super.handleClasspathChange();
- setEnablement();
- }
-
- public boolean performOk() {
- if (model.getComponent() == null || !isValidWebModule()) {
- return true;
- }
- if (!isDirty) {
- return true;
- }
- try {
- boolean createdFlexProjects = runWLPOp(createFlexProjectOperations());
- boolean createdComponentDependency = false;
- if (createdFlexProjects) {
- createdComponentDependency = runWLPOp(createComponentDependencyOperations());
- isDirty = false;
- }
- // treat as a classpath change for refresh purposes
- // XXX this refresh is not working - suspect it is because the virtual component dependencies are
- // not consistently being recomputed
- //handleClasspathChange();
- return createdComponentDependency;
- } finally {
- model.dispose();
- }
- }
-
- private boolean runWLPOp(WorkspaceModifyComposedOperation composed) {
- try {
- if (composed != null)
- new ProgressMonitorDialog(propPage.getShell()).run(true, true, composed);
- } catch (InvocationTargetException ex) {
- ex.printStackTrace();
- if (ex.getCause() != null) {
- ex.getCause().printStackTrace();
- }
- String title = ManifestUIResourceHandler.An_internal_error_occurred_ERROR_;
- String msg = title;
- if (ex.getTargetException() != null && ex.getTargetException().getMessage() != null)
- msg = ex.getTargetException().getMessage();
- MessageDialog.openError(propPage.getShell(), title, msg);
- org.eclipse.jem.util.logger.proxy.Logger.getLogger().logError(ex);
- return false;
- } catch (InterruptedException e) {
- // cancelled
- return false;
- }
- return true;
- }
-
- private void createRef(String aComponentName){
- IVirtualComponent archive = ComponentCore.createArchiveComponent(model.getComponent().getProject(), aComponentName);
-
- // To do: check if archive component already exists
- IVirtualReference ref = ComponentCore.createReference(model.getComponent(), archive, new Path("/WEB-INF/lib")); //$NON-NLS-1$
- model.getComponent().addReferences(new IVirtualReference [] { ref });
-
- ClasspathElement element = createClassPathElement(archive, archive.getName());
-// ClassPathSelection selection = createClassPathSelectionForExternalJar(element);
- model.getClassPathSelectionForWLPs().getClasspathElements().add(element);
- }
-
- public void handleSelectExternalJarButton() {
- if (J2EEProjectUtilities.isDynamicWebProject(project)) {
- IPath[] selected = BuildPathDialogAccess.chooseExternalJAREntries(propPage.getShell());
- if (selected != null) {
- String type = VirtualArchiveComponent.LIBARCHIVETYPE + IPath.SEPARATOR;
- for (int i = 0; i < selected.length; i++) {
- createRef(type + selected[i].toString());
- }
- refresh();
- }
- }
- }
-
- public void handleSelectVariableButton() {
- if (J2EEProjectUtilities.isDynamicWebProject(project)) {
- IPath existingPath[] = new Path[0];
- IPath[] selected = BuildPathDialogAccess.chooseVariableEntries(propPage.getShell(), existingPath);
-
- if (selected != null) {
- String type = VirtualArchiveComponent.VARARCHIVETYPE + IPath.SEPARATOR;
- for (int i = 0; i < selected.length; i++) {
- IPath resolvedPath = JavaCore.getResolvedVariablePath(selected[i]);
- java.io.File file = new java.io.File(resolvedPath.toOSString());
- if (file.isFile() && file.exists()) {
- createRef(type + selected[i].toString());
- } else {
- // display error
- }
- }
- refresh();
- }
- }
- }
-
- private ClasspathElement createClassPathElement(IVirtualComponent archiveComp, String unresolvedName) {
-
- URI uri = URI.createURI(ModuleURIUtil.getHandleString(archiveComp));
- ClasspathElement element = new ClasspathElement(uri);
- element.setValid(false);
- element.setSelected(true);
- element.setRelativeText(unresolvedName);
- element.setText(unresolvedName);
- element.setEarProject(null);
- return element;
- }
-
-// private ClassPathSelection createClassPathSelectionForExternalJar(ClasspathElement element) {
-// ClassPathSelection selection = new ClassPathSelection();
-// selection.getClasspathElements().add(element);
-// return selection;
-// }
-
-// private ClassPathSelection createClassPathSelectionForProjectJar(ClasspathElement element) {
-// ClassPathSelection selection = new ClassPathSelection();
-// selection.getClasspathElements().add(element);
-// return selection;
-// }
-
- public void handleSelectProjectJarButton() {
- if (J2EEProjectUtilities.isDynamicWebProject(project)) {
- IPath[] selected = BuildPathDialogAccess.chooseJAREntries(propPage.getShell(), project.getLocation(), new IPath[0]);
- if (selected != null) {
- String type = VirtualArchiveComponent.LIBARCHIVETYPE + IPath.SEPARATOR;
- for (int i = 0; i < selected.length; i++) {
- createRef(type + selected[i].makeRelative().toString());
- }
- refresh();
- }
- }
-
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/WebRefDependencyPropertiesPage.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/WebRefDependencyPropertiesPage.java
deleted file mode 100644
index 3827e1abb..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/WebRefDependencyPropertiesPage.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and BEA Systems, Inc.
- * 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:
- * rfrost@bea.com - derived from WebLibDependencyPropertiesPage for projects referenced just from a dynamic web project.
- *******************************************************************************/
-package org.eclipse.jst.j2ee.internal;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Supports UI manipulation of the published/exported classpath entries for projects referenced by dynamic web projects.
- */
-public class WebRefDependencyPropertiesPage extends JARDependencyPropertiesPage {
-
- public WebRefDependencyPropertiesPage(final IProject project, final J2EEDependenciesPage page) {
- super(project, page);
- }
-
- @Override
- public Composite createContents(Composite parent) {
- initialize();
- Composite composite = createBasicComposite(parent);
- if (model.getComponent() != null) {
- if (!isValidComponent()) {
- return composite;
- }
- J2EEDependenciesPage.createDescriptionComposite(composite, ManifestUIResourceHandler.Web_Ref_Desc);
- createListGroup(composite);
- tableManager.refresh();
- setEnablement();
- }
- Dialog.applyDialogFont(parent);
- postCreateContents();
- return composite;
- }
-
- @Override
- protected void createTableComposite(Composite parent) {
- Composite composite = new Composite(parent, SWT.NONE);
- GridData gData = new GridData(GridData.FILL_BOTH);
- composite.setLayoutData(gData);
- tableManager = new ClasspathTableManager(this, model, validateEditListener);
- tableManager.setReadOnly(isReadOnly());
- tableManager.fillWebRefComposite(composite);
- }
-
- @Override
- protected boolean isValidComponent() {
- // must have the Java nature and cannot be a dynamic web project
- boolean isJavaProject = false;
- try {
- isJavaProject = project.hasNature(JavaCore.NATURE_ID);
- } catch (CoreException ce) {}
- if (J2EEProjectUtilities.isDynamicWebProject(project) || !isJavaProject) {
- propPage.setErrorMessage(ManifestUIResourceHandler.Dynamic_Web_Error);
- return false;
- } else if (J2EEProjectUtilities.getReferencingWebProjects(project).length == 0) {
- propPage.setErrorMessage(ManifestUIResourceHandler.No_Web_Reference_Error);
- return false;
- }
- return true;
- }
-
- protected void setEnablement() {
- if (tableManager.availableJARsViewer.getTable().getItems().length == 0) {
- tableManager.selectAllButton.setEnabled(false);
- tableManager.deselectAllButton.setEnabled(false);
- } else {
- tableManager.selectAllButton.setEnabled(true);
- tableManager.deselectAllButton.setEnabled(true);
- }
- }
-
- @Override
- protected void handleClasspathChange() {
- super.handleClasspathChange();
- setEnablement();
- }
-
- @Override
- public boolean performOk() {
- if (model.getComponent() == null || !isValidComponent()) {
- return true;
- }
- if (!isDirty) {
- return true;
- }
- return super.performOk();
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/WorkspaceModifyComposedOperation.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/WorkspaceModifyComposedOperation.java
deleted file mode 100644
index 0b51edca2..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/WorkspaceModifyComposedOperation.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 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
- *******************************************************************************/
-/*
- * Created on Jan 17, 2005
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-package org.eclipse.jst.j2ee.internal;
-
-import java.util.List;
-
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-
-/**
- * WARNING: This class will be deleted
- *
- * @deprecated use {@link org.eclipse.wst.common.frameworks.internal.ui.WorkspaceModifyComposedOperation}
- */
-public class WorkspaceModifyComposedOperation extends org.eclipse.wst.common.frameworks.internal.ui.WorkspaceModifyComposedOperation {
- public WorkspaceModifyComposedOperation(ISchedulingRule rule) {
- super(rule);
- }
-
- public WorkspaceModifyComposedOperation() {
- super();
- }
-
- public WorkspaceModifyComposedOperation(ISchedulingRule rule, List nestedRunnablesWithProgress) {
- super(rule, nestedRunnablesWithProgress);
- }
-
- public WorkspaceModifyComposedOperation(List nestedRunnablesWithProgress) {
- super(nestedRunnablesWithProgress);
- }
-
- public WorkspaceModifyComposedOperation(IRunnableWithProgress nestedOp) {
- super(nestedOp);
- }
-
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/AbstractActionDelegate.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/AbstractActionDelegate.java
deleted file mode 100644
index 9d9a71ef2..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/AbstractActionDelegate.java
+++ /dev/null
@@ -1,225 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 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.jst.j2ee.internal.actions;
-
-
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jem.util.emf.workbench.ProjectUtilities;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIMessages;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIPlugin;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IWorkbenchWindow;
-
-
-public abstract class AbstractActionDelegate implements org.eclipse.ui.IActionDelegate {
- protected ISelection selection;
- protected boolean allowsMultiSelect = false;
- public static final Class IPROJECT_CLASS = IProject.class;
- private final static String ERROR_OCCURRED_TITLE = J2EEUIMessages.getResourceString("ERROR_OCCURRED_TITLE"); //$NON-NLS-1$
- private final static String ERROR_OCCURRED_MESSAGE = J2EEUIMessages.getResourceString("ERROR_OCCURRED_MESSAGE"); //$NON-NLS-1$
-
- /**
- * EditModuleDependencyAction constructor comment.
- */
- public AbstractActionDelegate() {
- super();
- }
-
- /**
- * Applicable only when this action does not allow multi select
- */
- protected IProject getProject() {
- return getProject(getSelectedElement());
- }
-
- protected List getProjects() {
- if ((selection == null) || !(selection instanceof IStructuredSelection))
- return Collections.EMPTY_LIST;
-
- List result = new ArrayList();
- IStructuredSelection struct = (IStructuredSelection) selection;
- Iterator it = struct.iterator();
- while (it.hasNext()) {
- IProject p = getProject(it.next());
- if (p != null)
- result.add(p);
- }
- return result;
- }
-
- protected IProject getProject(Object element) {
-
- if (isSupportedAction(element))
- return ProjectUtilities.getProject((EObject) element);
- else if (element instanceof IAdaptable)
- return (IProject) ((IAdaptable) element).getAdapter(IPROJECT_CLASS);
- else
- return null;
- }
-
- protected IStructuredSelection getStructuredSelection() {
- if ((selection == null) || !(selection instanceof IStructuredSelection))
- return null;
- else if (selection.isEmpty()) {
- selection = J2EEUIPlugin.getCurrentSelection();
- }
- return (IStructuredSelection) selection;
- }
-
- /*
- * Only return if there is exactly one item selected
- */
- protected Object getSelectedElement() {
- IStructuredSelection sel = getStructuredSelection();
- return sel == null ? null : sel.getFirstElement();
- }
-
- protected IWorkbenchWindow getWorkbenchWindow() {
- return J2EEUIPlugin.getActiveWorkbenchWindow();
- }
-
- /**
- * Can the receiver be executed for
- *
- * @element
- */
- protected abstract boolean isSupportedAction(Object element);
-
- /**
- * @deprecated use {@link #primRun(Shell)}
- */
- protected void primRun(IProject project, Shell shell) {
- //Deprecated
- }
-
- /**
- * Subclasses should override this instead of {@link #run(org.eclipse.jface.action.IAction)}
- */
- protected void primRun(Shell shell) {
- primRun(getProject(), shell);
- }
-
- /**
- * Performs this action.
- * <p>
- * This method is called when the delegating action has been triggered. Implement this method to
- * do the actual work.
- * </p>
- *
- * @param action
- * the action proxy that handles the presentation portion of the action
- */
- public void run(org.eclipse.jface.action.IAction action) {
-
- Shell shell = getWorkbenchWindow().getShell();
- setActionStateFromProjects(action);
- if (!action.isEnabled())
- MessageDialog.openInformation(shell, J2EEUIMessages.getResourceString("INFORMATION_UI_"), J2EEUIMessages.getResourceString("CHOSEN_OP_NOT_AVAILABLE")); //$NON-NLS-2$ = "The chosen operation is not currently available." //$NON-NLS-1$ = "Information"
- else {
- try {
- primRun(shell);
- } catch (Throwable t) {
- org.eclipse.jst.j2ee.internal.plugin.ErrorDialog.openError(shell, ERROR_OCCURRED_TITLE, ERROR_OCCURRED_MESSAGE, t, 0, false);
- }
- }
-
-
- }
-
- /**
- * Notifies this action delegate that the selection in the workbench has changed.
- * <p>
- * Implementers can use this opportunity to change the availability of the action or to modify
- * other presentation properties.
- * </p>
- *
- * @param action
- * the action proxy that handles presentation portion of the action
- * @param aSelection
- * the current selection in the workbench
- */
- public void selectionChanged(org.eclipse.jface.action.IAction action, org.eclipse.jface.viewers.ISelection aSelection) {
- this.selection = aSelection;
- setActionState(action);
- }
-
- protected void setActionState(IAction action) {
- if (allowsMultiSelect)
- setActionStateForMultiSelect(action);
- else
- setActionStateForSingleSelect(action);
- }
-
- protected void setActionStateForSingleSelect(IAction action) {
- IStructuredSelection sel = getStructuredSelection();
- if (sel == null || sel.size() != 1) {
- action.setEnabled(false);
- return;
- }
- setActionStateFromProjects(action);
- }
-
- protected void setActionStateForMultiSelect(IAction action) {
- setActionStateFromProjects(action);
- }
-
- protected void setActionStateFromProjects(IAction action) {
- IStructuredSelection sel = getStructuredSelection();
- boolean allOk = false;
- if (sel != null && !sel.isEmpty()) {
- allOk = true;
- Iterator it = sel.iterator();
- while (it.hasNext()) {
- Object o = it.next();
- IProject project = getProject(o);
- if (project == null || !project.isOpen()) {
- allOk = false;
- break;
- }
- }
- }
- action.setEnabled(allOk);
- }
-
- /**
- * Returns the allowsMultiSelect.
- *
- * @return boolean
- */
- public boolean allowsMultiSelect() {
- return allowsMultiSelect;
- }
-
-
- /**
- * Sets the allowsMultiSelect.
- *
- * @param allowsMultiSelect
- * The allowsMultiSelect to set
- */
- public void setAllowsMultiSelect(boolean allowsMultiSelect) {
- this.allowsMultiSelect = allowsMultiSelect;
- }
-
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/AbstractActionWithDelegate.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/AbstractActionWithDelegate.java
deleted file mode 100644
index 1dbce3ddc..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/AbstractActionWithDelegate.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2003, 2004 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.jst.j2ee.internal.actions;
-
-
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IActionDelegate;
-
-
-public abstract class AbstractActionWithDelegate extends org.eclipse.ui.actions.SelectionListenerAction {
- protected IActionDelegate delegate;
-
- /**
- * EditModuleDependencyAction constructor comment.
- *
- * @param text
- * java.lang.String
- */
- public AbstractActionWithDelegate() {
- super("");//$NON-NLS-1$
- initLabel();
- initDelegate();
- }
-
- protected abstract IActionDelegate createDelegate();
-
- protected abstract String getLabel();
-
- protected void initDelegate() {
- delegate = createDelegate();
- }
-
- protected void initLabel() {
- setText(getLabel());
- }
-
- /**
- * Implementation of method defined on <code>IAction</code>.
- */
- public void run() {
- delegate.run(this);
- }
-
- /**
- * Updates this action in response to the given selection.
- * <p>
- * The <code>SelectionListenerAction</code> implementation of this method returns
- * <code>true</code>. Subclasses may extend to react to selection changes; however, if the
- * super method returns <code>false</code>, the overriding method must also return
- * <code>false</code>.
- * </p>
- *
- * @param selection
- * the new selection
- * @return <code>true</code> if the action should be enabled for this selection, and
- * <code>false</code> otherwise
- */
- protected boolean updateSelection(IStructuredSelection selection) {
- delegate.selectionChanged(this, selection);
- return this.isEnabled();
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/AbstractOpenAction.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/AbstractOpenAction.java
deleted file mode 100644
index fbd602ea1..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/AbstractOpenAction.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2006 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.jst.j2ee.internal.actions;
-
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.ui.IActionDelegate2;
-import org.eclipse.ui.IEditorDescriptor;
-import org.eclipse.ui.IEditorRegistry;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.actions.SelectionListenerAction;
-
-/**
- * Action for opening a J2EE resource from the J2EE navigator.
- */
-public abstract class AbstractOpenAction extends SelectionListenerAction implements IActionDelegate2 {
- // //$NON-NLS-1$
- protected IEditorDescriptor currentDescriptor;
- protected Object srcObject;
-
- protected AbstractOpenAction(String text) {
- super(text);
- }
-
- protected static IEditorDescriptor findEditorDescriptor(String id) {
- IEditorRegistry registry = PlatformUI.getWorkbench().getEditorRegistry();
- return registry.findEditor(id);
- }
-
- protected void setAttributesFromDescriptor() {
- if (currentDescriptor == null)
- return;
- //setText(currentDescriptor.getLabel());
- setToolTipText(currentDescriptor.getLabel());
- //setImageDescriptor(currentDescriptor.getImageDescriptor());
- }
-
- /**
- * The structured selection has changed in the workbench. Subclasses should override this method
- * to react to the change. Returns true if the action should be enabled for this selection, and
- * false otherwise.
- *
- * When this method is overridden, the super method must always be invoked. If the super method
- * returns false, this method must also return false.
- *
- * @param sel
- * the new structured selection
- */
- public boolean updateSelection(IStructuredSelection s) {
- srcObject = null;
- if (!super.updateSelection(s))
- return false;
-
- if (s.size() != 1)
- return false;
-
- return true;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IActionDelegate2#dispose()
- */
- public void dispose() {
- //Dispose
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IActionDelegate2#init(org.eclipse.jface.action.IAction)
- */
- public void init(IAction action) {
- //init
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IActionDelegate2#runWithEvent(org.eclipse.jface.action.IAction,
- * org.eclipse.swt.widgets.Event)
- */
- public void runWithEvent(IAction action, Event event) {
- runWithEvent(event);
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- // TODO Auto-generated method stub
- run();
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction,
- * org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {
- // TODO HACK!
- updateSelection((IStructuredSelection) selection);
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/AbstractOpenWizardAction.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/AbstractOpenWizardAction.java
deleted file mode 100644
index d652982bd..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/AbstractOpenWizardAction.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 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.jst.j2ee.internal.actions;
-
-
-import java.util.Iterator;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIMessages;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIPlugin;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.IWorkbenchWizard;
-import org.eclipse.ui.activities.WorkbenchActivityHelper;
-
-
-public abstract class AbstractOpenWizardAction extends org.eclipse.jface.action.Action {
- // //$NON-NLS-1$
-
- private IWorkbench fWorkbench;
-
- private Class[] fActivatedOnTypes;
-
- private boolean fAcceptEmptySelection;
-
- protected AbstractOpenWizardAction() {
- //Default constructor
- }
-
- public AbstractOpenWizardAction(IWorkbench workbench, String label, Class[] activatedOnTypes, boolean acceptEmptySelection) {
- super(label);
- fWorkbench = workbench;
- fActivatedOnTypes = activatedOnTypes;
- fAcceptEmptySelection = acceptEmptySelection;
- }
-
- public AbstractOpenWizardAction(IWorkbench workbench, String label, boolean acceptEmptySelection) {
- this(workbench, label, null, acceptEmptySelection);
- }
-
- public boolean canActionBeAdded() {
- ISelection selection = getCurrentSelection();
- if (selection == null || selection.isEmpty()) {
- return fAcceptEmptySelection;
- }
- if (fActivatedOnTypes != null) {
- if (selection instanceof IStructuredSelection) {
- return isEnabled(((IStructuredSelection) selection).iterator());
- }
- return false;
- }
- return true;
- }
-
- /**
- * Create the specific Wizard (to be implemented by a subclass)
- */
- abstract protected Wizard createWizard();
-
- protected IStructuredSelection getCurrentSelection() {
- IWorkbenchWindow window = J2EEUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow();
- if (window != null) {
- ISelection selection = window.getSelectionService().getSelection();
- if (selection instanceof IStructuredSelection) {
- return (IStructuredSelection) selection;
- }
-
- }
- return null;
- }
-
- protected IWorkbench getWorkbench() {
- return fWorkbench;
- }
-
- private boolean isEnabled(Iterator iter) {
- while (iter.hasNext()) {
- Object obj = iter.next();
- if (!isOfAcceptedType(obj) || !shouldAcceptElement(obj)) {
- return false;
- }
- }
- return true;
- }
-
- private boolean isOfAcceptedType(Object obj) {
- for (int i = 0; i < fActivatedOnTypes.length; i++) {
- if (fActivatedOnTypes[i].isInstance(obj)) {
- return true;
- }
- }
- return false;
- }
-
- protected String getDialogText() {
- return J2EEUIMessages.getResourceString(J2EEUIMessages.NEW_LBL);
- }
-
- /**
- * The user has invoked this action.
- */
- public void run() {
- Wizard wizard = createWizard();
- if (wizard instanceof IWorkbenchWizard) {
- IStructuredSelection sel = null;
- if (null != getCurrentSelection())
- sel = getCurrentSelection();
- else
- sel = new StructuredSelection();
- ((IWorkbenchWizard) wizard).init(J2EEUIPlugin.getDefault().getWorkbench(), sel);
- }
- if (WorkbenchActivityHelper.allowUseOf(null,wizard)) {
- IWorkbenchWindow window = J2EEUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow();
- WizardDialog dialog = new WizardDialog(window.getShell(), wizard);
- dialog.create();
- String text = getDialogText();
- if (null != text) {
- dialog.getShell().setText(text);
- }
- dialog.open();
- }
- }
-
- protected void setWorkbench(IWorkbench workbench) {
- fWorkbench = workbench;
- }
-
- /**
- * can be overridden to add more checks obj is guaranteed to be instance of one of the accepted
- * types
- */
- protected boolean shouldAcceptElement(Object obj) {
- return true;
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/AbstractOpenWizardWorkbenchAction.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/AbstractOpenWizardWorkbenchAction.java
deleted file mode 100644
index 5c7093697..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/AbstractOpenWizardWorkbenchAction.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 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.jst.j2ee.internal.actions;
-
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchWindow;
-
-
-public abstract class AbstractOpenWizardWorkbenchAction extends AbstractOpenWizardAction implements org.eclipse.ui.IWorkbenchWindowActionDelegate {
- protected AbstractOpenWizardWorkbenchAction() {
- //Default
- }
-
- public AbstractOpenWizardWorkbenchAction(IWorkbench workbench, String label, Class[] activatedOnTypes, boolean acceptEmptySelection) {
- super(workbench, label, null, acceptEmptySelection);
- }
-
- public AbstractOpenWizardWorkbenchAction(IWorkbench workbench, String label, boolean acceptEmptySelection) {
- super(workbench, label, null, acceptEmptySelection);
- }
-
- /**
- * @see AbstractOpenWizardAction#dispose
- */
- public void dispose() {
- // do nothing.
- setWorkbench(null);
- }
-
- /**
- * @see AbstractOpenWizardAction#init
- */
- public void init(IWorkbenchWindow window) {
- setWorkbench(window.getWorkbench());
- }
-
- /**
- * @see IActionDelegate#run
- */
- public void run(IAction action) {
- run();
- }
-
- /**
- * @see IActionDelegate#selectionChanged
- */
- public void selectionChanged(IAction action, ISelection selection) {
- // do nothing. Action doesn't depend on selection.
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/BaseAction.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/BaseAction.java
deleted file mode 100644
index 7cc713191..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/BaseAction.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2006 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
- *******************************************************************************/
-/*
- * Created on Mar 27, 2003
- *
- * To change this generated comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-package org.eclipse.jst.j2ee.internal.actions;
-
-import org.eclipse.jem.util.logger.proxy.Logger;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jst.j2ee.internal.plugin.ErrorDialog;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIMessages;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIPlugin;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IActionDelegate;
-import org.eclipse.ui.IWorkbenchWindow;
-
-
-/**
- * @author jsholl
- *
- * To change this generated comment go to Window>Preferences>Java>Code Generation>Code and Comments
- */
-public abstract class BaseAction extends Action implements IActionDelegate {
-
- protected IStructuredSelection selection = null;
-
- protected IWorkbenchWindow getWorkbenchWindow() {
- return J2EEUIPlugin.getPluginWorkbench().getActiveWorkbenchWindow();
- }
-
- public void setSelection(IStructuredSelection selection) {
- this.selection = selection;
- }
-
- public void run() {
- Shell shell = getWorkbenchWindow().getShell();
- if (null == selection) {
- ISelection autoselection = getWorkbenchWindow().getSelectionService().getSelection();
- if (autoselection instanceof IStructuredSelection)
- this.selection = (IStructuredSelection) autoselection;
- }
-
- try {
- primRun(shell);
- this.selection = null;
- } catch (Throwable t) {
- Logger.getLogger().logError(t);
- String ERROR_OCCURRED_TITLE = J2EEUIMessages.getResourceString("ERROR_OCCURRED_TITLE"); //$NON-NLS-1$
- String ERROR_OCCURRED_MESSAGE = J2EEUIMessages.getResourceString("ERROR_OCCURRED_MESSAGE"); //$NON-NLS-1$
- ErrorDialog.openError(shell, ERROR_OCCURRED_TITLE, ERROR_OCCURRED_MESSAGE, t, 0, false);
- }
-
- }
-
- protected abstract void primRun(Shell shell);
-
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IActionDelegate2#dispose()
- */
- public void dispose() {
- //dispose
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IActionDelegate2#init(org.eclipse.jface.action.IAction)
- */
- public void init(IAction action) {
- //init
- }
-
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction,
- * org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection aSelection) {
- setSelection((IStructuredSelection) aSelection);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IActionDelegate2#runWithEvent(org.eclipse.jface.action.IAction,
- * org.eclipse.swt.widgets.Event)
- */
- public void runWithEvent(IAction action, Event event) {
- run();
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- run();
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/ComponentEditorInput.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/ComponentEditorInput.java
deleted file mode 100644
index 1f2bba954..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/ComponentEditorInput.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2006 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.jst.j2ee.internal.actions;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IPersistableElement;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-
-public class ComponentEditorInput implements IEditorInput {
-
- private IVirtualComponent component;
-
- public ComponentEditorInput(IVirtualComponent component){
- this.component = component;
- }
-
- public boolean exists() {
- return component.exists();
- }
-
- public ImageDescriptor getImageDescriptor() {
- return null;
- }
-
- public String getName() {
- return component.getName();
- }
-
- public IPersistableElement getPersistable() {
- return null;
- }
-
- public String getToolTipText() {
- return ""; //$NON-NLS-1$
- }
-
- public Object getAdapter(Class adapter) {
- return null;
- }
-
- public IVirtualComponent getComponent(){
- return component;
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/ForceClasspathUpdateAction.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/ForceClasspathUpdateAction.java
deleted file mode 100644
index 0122ba5e5..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/ForceClasspathUpdateAction.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c)2006 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.jst.j2ee.internal.actions;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jst.j2ee.internal.common.classpath.J2EEComponentClasspathUpdater;
-import org.eclipse.ui.IActionDelegate;
-
-public class ForceClasspathUpdateAction extends Action implements IActionDelegate{
-
- private List projectsList = new ArrayList();
-
- public void run() {
- J2EEComponentClasspathUpdater.getInstance().forceUpdate(projectsList);
- }
-
- public void run(IAction action) {
- J2EEComponentClasspathUpdater.getInstance().forceUpdate(projectsList);
- }
-
- public void selectionChanged(IAction action, ISelection selection) {
- action.setEnabled(setSelection(selection));
- }
-
- private boolean setSelection(ISelection selection){
- projectsList.clear();
- if(selection != null && selection instanceof IStructuredSelection) {
- IStructuredSelection structuredSelection = (IStructuredSelection)selection;
- if (structuredSelection.size() > 0) {
- Iterator iterator = structuredSelection.iterator();
- while(iterator.hasNext()){
- Object next = iterator.next();
- if (next instanceof IProject) {
- projectsList.add(next);
- } else {
- projectsList.clear();
- return false;
- }
- }
- } else { // empty selection
- return false;
- }
- return true;
- }
- return false;
- }
-
-
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/IJ2EEUIContextIds.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/IJ2EEUIContextIds.java
deleted file mode 100644
index e25fc0c3a..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/IJ2EEUIContextIds.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2006 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.jst.j2ee.internal.actions;
-
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIPlugin;
-
-
-/**
- * Insert the type's description here. Creation date: (9/6/2001 12:23:02 PM)
- *
- * @author: Administrator
- */
-public interface IJ2EEUIContextIds {
- // New creation wizards
- public static final String NEW_EAR_WIZARD_P1 = J2EEUIPlugin.PLUGIN_ID + ".EAR_NEW_EAR_WIZARD_PAGE1"; //$NON-NLS-1$
- public static final String NEW_EAR_ADD_MODULES_PAGE = J2EEUIPlugin.PLUGIN_ID + ".NEW_EAR_ADD_MODULES_PAGE"; //$NON-NLS-1$
- public static final String NEW_EAR_COMP_PAGE = J2EEUIPlugin.PLUGIN_ID + ".NEW_EAR_COMP_PAGE"; //$NON-NLS-1$
- public static final String EAR_NEW_MODULE_PROJECTS_PAGE = J2EEUIPlugin.PLUGIN_ID + ".EAR_NEW_MODULE_PROJECTS_PAGE"; //$NON-NLS-1$
- public static final String NEW_APPCLIENT_WIZARD_P1 = J2EEUIPlugin.PLUGIN_ID + ".APPCLIENT_NEW_APPCLIENT_WIZARD_PAGE1"; //$NON-NLS-1$
- public static final String NEW_APPCLIENT_WIZARD_P3 = J2EEUIPlugin.PLUGIN_ID + ".APPCLIENT_NEW_APPCLIENT_WIZARD_PAGE3"; //$NON-NLS-1$
- public static final String NEW_EJB_WIZARD_P1 = J2EEUIPlugin.PLUGIN_ID + ".EJB_NEW_EJB_WIZARD_PAGE1"; //$NON-NLS-1$
- public static final String NEW_EJB_WIZARD_P2 = J2EEUIPlugin.PLUGIN_ID + ".EJB_NEW_EJB_WIZARD_PAGE2"; //$NON-NLS-1$
- public static final String NEW_EJB_WIZARD_P3 = J2EEUIPlugin.PLUGIN_ID + ".EJB_NEW_EJB_WIZARD_PAGE3"; //$NON-NLS-1$
- public static final String NEW_CONNECTOR_WIZARD_P1 = J2EEUIPlugin.PLUGIN_ID + ".JCA_NEWIZARD_PAGE1"; //$NON-NLS-1$
- public static final String NEW_CONNECTOR_WIZARD_P3 = J2EEUIPlugin.PLUGIN_ID + ".JCA_NEWIZARD_PAGE3"; //$NON-NLS-1$
- public static final String NEW_JAVA_COMPONENT_WIZARD_P1 = J2EEUIPlugin.PLUGIN_ID + ".NEW_JAVA_COMPONENT_WIZARD_PAGE1"; //$NON-NLS-1$
- public static final String NEW_JAVA_CLASS_OPTION_WIZARD_P1 = J2EEUIPlugin.PLUGIN_ID + ".NEW_JAVA_CLASS_OPTION_WIZARD_PAGE1"; //$NON-NLS-1$
- public static final String NEW_UTILITY_WIZARD_P1 = J2EEUIPlugin.PLUGIN_ID + ".NEW_UTILITY_WIZARD_P1"; //$NON-NLS-1$
- public static final String NEW_UTILITY_WIZARD_P3 = J2EEUIPlugin.PLUGIN_ID + ".NEW_UTILITY_WIZARD_P3"; //$NON-NLS-1$
-
- // Import, export wizards
- public static final String IMPORT_EAR_WIZARD_P1 = J2EEUIPlugin.PLUGIN_ID + ".EAR_IMPORT_EAR_WIZARD_PAGE1"; //$NON-NLS-1$
- public static final String IMPORT_EAR_WIZARD_P2 = J2EEUIPlugin.PLUGIN_ID + ".EAR_IMPORT_EAR_WIZARD_PAGE2"; //$NON-NLS-1$
- public static final String IMPORT_EAR_WIZARD_P3 = J2EEUIPlugin.PLUGIN_ID + ".EAR_IMPORT_EAR_WIZARD_PAGE3"; //$NON-NLS-1$
- public static final String IMPORT_APPCLIENT_WIZARD_P1 = J2EEUIPlugin.PLUGIN_ID + ".APPCLIENT_IMPORT_APPCLIENT_WIZARD_PAGE1"; //$NON-NLS-1$
- public static final String IMPORT_EJB_WIZARD_P1 = J2EEUIPlugin.PLUGIN_ID + ".EJB_IMPORT_EJB_WIZARD_PAGE1"; //$NON-NLS-1$
- public static final String IMPORT_RAR_WIZARD_PAGE = J2EEUIPlugin.PLUGIN_ID + ".IMPORT_RAR_WIZARD_PAGE"; //$NON-NLS-1$
- public static final String IMPORT_UTILITY_JAR_WIZARD_P1 = J2EEUIPlugin.PLUGIN_ID + ".IMPORT_UTILITY_JAR_WIZARD_PAGE1"; //$NON-NLS-1$
- public static final String IMPORT_UTILITY_JAR_WIZARD_P2 = J2EEUIPlugin.PLUGIN_ID + ".IMPORT_UTILITY_JAR_WIZARD_PAGE2"; //$NON-NLS-1$
- public static final String IMPORT_CLASS_WIZARD_P1 = J2EEUIPlugin.PLUGIN_ID + ".IMPORT_CLASS_WIZARD_PAGE1"; //$NON-NLS-1$
- public static final String IMPORT_CLASS_WIZARD_P2 = J2EEUIPlugin.PLUGIN_ID + ".IMPORT_CLASS_WIZARD_PAGE2"; //$NON-NLS-1$
-
- public static final String EXPORT_EAR_WIZARD_P1 = J2EEUIPlugin.PLUGIN_ID + ".EAR_EXPORT_PAGE1"; //$NON-NLS-1$
- public static final String EXPORT_APPCLIENT_WIZARD_P1 = J2EEUIPlugin.PLUGIN_ID + ".APPCLIENT_EXPORT_APPCLIENT_WIZARD_PAGE1"; //$NON-NLS-1$
- public static final String EXPORT_EJB_WIZARD_P1 = J2EEUIPlugin.PLUGIN_ID + ".EJB_EXPORT_PAGE1"; //$NON-NLS-1$
- public static final String EXPORT_RAR_WIZARD_PAGE = J2EEUIPlugin.PLUGIN_ID + ".EXPORT_RAR_WIZARD_PAGE"; //$NON-NLS-1$
-
- // dialogs
- public static final String DELEATE_EAR_DIALOG_1 = J2EEUIPlugin.PLUGIN_ID + ".navm2000"; //$NON-NLS-1$
- public static final String DELEATE_MODULE_DIALOG_1 = J2EEUIPlugin.PLUGIN_ID + ".navm2010"; //$NON-NLS-1$
- public static final String RENAME_EAR_DIALOG_1 = J2EEUIPlugin.PLUGIN_ID + ".navm3000"; //$NON-NLS-1$
- public static final String RENAME_MODULE_DIALOG_1 = J2EEUIPlugin.PLUGIN_ID + ".navm3010"; //$NON-NLS-1$
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/ImportClassesAction.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/ImportClassesAction.java
deleted file mode 100644
index abff48694..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/ImportClassesAction.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 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
- *******************************************************************************/
-/*
- * Created on Mar 31, 2003
- *
- * To change this generated comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-package org.eclipse.jst.j2ee.internal.actions;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jem.util.emf.workbench.ProjectUtilities;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIMessages;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIPlugin;
-import org.eclipse.jst.j2ee.internal.wizard.ClassesImportWizard;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @author jsholl
- *
- * To change this generated comment go to Window>Preferences>Java>Code Generation>Code and Comments
- */
-public class ImportClassesAction extends WTPBaseAction {
-
- public static String LABEL = J2EEUIMessages.getResourceString("Import_Classes"); //$NON-NLS-1$
-
- public ImportClassesAction() {
- super();
- setText(LABEL);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.j2ee.internal.internal.common.actions.BaseAction#primRun(org.eclipse.swt.widgets.Shell)
- */
- protected void primRun(Shell shell) {
- IProject project = ProjectUtilities.getProject(getSelection().getFirstElement());
- ClassesImportWizard wizard = new ClassesImportWizard(project);
-
-
- wizard.init(PlatformUI.getWorkbench(), StructuredSelection.EMPTY);
- wizard.setDialogSettings(J2EEUIPlugin.getDefault().getDialogSettings());
-
- WizardDialog dialog = new WizardDialog(shell, wizard);
-
- dialog.create();
- dialog.getShell().setSize(550, 550);
- dialog.open();
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/J2EEDeleteAction.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/J2EEDeleteAction.java
deleted file mode 100644
index 4a833892f..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/J2EEDeleteAction.java
+++ /dev/null
@@ -1,419 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.jst.j2ee.internal.actions;
-
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.ui.actions.SelectionDispatchAction;
-import org.eclipse.jem.util.emf.workbench.ProjectUtilities;
-import org.eclipse.jem.util.logger.proxy.Logger;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jst.j2ee.application.Application;
-import org.eclipse.jst.j2ee.common.internal.util.CommonUtil;
-import org.eclipse.jst.j2ee.ejb.componentcore.util.EJBArtifactEdit;
-import org.eclipse.jst.j2ee.internal.delete.DeleteOptions;
-import org.eclipse.jst.j2ee.internal.dialogs.DeleteEARDialog;
-import org.eclipse.jst.j2ee.internal.dialogs.DeleteModuleDialog;
-import org.eclipse.jst.j2ee.internal.dialogs.J2EEDeleteDialog;
-import org.eclipse.jst.j2ee.internal.dialogs.J2EEDeleteUIConstants;
-import org.eclipse.jst.j2ee.internal.plugin.CommonEditorUtility;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIMessages;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIPlugin;
-import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IWorkbenchSite;
-import org.eclipse.ui.actions.DeleteResourceAction;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-
-public class J2EEDeleteAction extends SelectionDispatchAction implements J2EEDeleteUIConstants {
-
- protected Shell shell;
- //Used for EAR delete
- protected Set referencedProjects;
- protected List projects;
- protected DeleteOptions options;
- // added for IRefactoringAction behavior
- protected ISelectionProvider provider = null;
-
-
-
- /**
- * Constructor for DeleteModuleAction.
- *
- * @param text
- */
- public J2EEDeleteAction(IWorkbenchSite site, Shell parent) {
- super(site);
- setText(DELETE);
- shell = parent;
- }
-
- public J2EEDeleteAction(IWorkbenchSite site, ISelectionProvider newProvider) {
- super(site);
- setText(DELETE);
- shell = J2EEUIPlugin.getActiveWorkbenchWindow().getShell();
- provider = newProvider;
- }
-
- protected void reset() {
- referencedProjects = null;
- projects = null;
- options = null;
- }
-
- protected boolean getEnableStateBasedOnSelection(IStructuredSelection selection) {
- if (selection.isEmpty())
- return false;
- return isSelectionApplicable() && isSelectionSomeJ2EE();
- }
-
- /**
- * @see org.eclipse.ui.actions.SelectionListenerAction#updateSelection(IStructuredSelection)
- */
- protected void updateSelection(IStructuredSelection selection) {
- update(selection);
- }
-
- protected boolean isSelectionApplicable() {
- IStructuredSelection sel = (StructuredSelection) getSelection();
- Iterator it = sel.iterator();
- while (it.hasNext()) {
- Object o = it.next();
- if (!isJ2EEModule(o) && !isApplication(o) && !isProjectOrJavaProject(o))
- return false;
- }
- return true;
- }
-
- protected boolean isSelectionSomeJ2EE() {
- IStructuredSelection sel = (StructuredSelection) getSelection();
- Iterator it = sel.iterator();
- while (it.hasNext()) {
- Object o = it.next();
- if (isJ2EEModule(o) || isApplication(o))
- return true;
- }
- return false;
- }
-
-
- protected boolean isSelectionAllDDRoots() {
- IStructuredSelection sel = (StructuredSelection) getSelection();
- Iterator it = sel.iterator();
- while (it.hasNext()) {
- Object o = it.next();
- if (!isJ2EEModule(o))
- return false;
- }
- return true;
- }
-
- protected boolean isSelectionAllApplications() {
- IStructuredSelection sel = (StructuredSelection) getSelection();
- Iterator it = sel.iterator();
- while (it.hasNext()) {
- Object o = it.next();
- if (!isApplication(o))
- return false;
- }
- return true;
- }
-
- protected boolean isJ2EEModule(Object o) {
- //TODO switch to virtual comp
-// if (o instanceof WorkbenchComponent) {
-// WorkbenchComponent module = (WorkbenchComponent) o;
-// String moduleType = module.getComponentType().getComponentTypeId();
-// //TODO need to add connector, app client, ear, ejb client
-// return moduleType.equals(IModuleConstants.JST_WEB_MODULE) || moduleType.equals(IModuleConstants.JST_EJB_MODULE);
-// }
- return CommonUtil.isDeploymentDescriptorRoot(o, false);
- }
-
- protected boolean isApplication(Object o) {
- return (o instanceof Application) || isJ2EEApplicationProject(o);
- }
-
- protected boolean isProjectOrJavaProject(Object o) {
- return (o instanceof IProject) || (o instanceof IJavaProject);
- }
-
- protected List getProjects() {
- if (projects == null) {
- projects = new ArrayList();
- IStructuredSelection sel = (StructuredSelection) getSelection();
- Iterator iterator = sel.iterator();
- IProject project = null;
- Object o = null;
- while (iterator.hasNext()) {
- o = iterator.next();
- if (o instanceof IJavaProject)
- o = ((IJavaProject) o).getProject();
- if (o instanceof IProject) {
- projects.add(o);
- addEJBClientProjectIfNecessary((IProject) o, projects);
- } else if (o instanceof EObject) {
- EObject obj = (EObject) o;
- project = ProjectUtilities.getProject(obj);
- if (project == null)
- throw new RuntimeException(J2EEUIMessages.getResourceString("Project_should_not_be_null_1_EXC_")); //$NON-NLS-1$
- projects.add(project);
- addEJBClientProjectIfNecessary(project, projects);
- } else {
- throw new RuntimeException(J2EEUIMessages.getResourceString("Non-project_in_selection_2_EXC_")); //$NON-NLS-1$
- }
- }
- }
- return projects;
- }
-
- /**
- * @param project
- * @param localProjects
- */
- private void addEJBClientProjectIfNecessary(IProject project, List localProjects) {
- IVirtualComponent comp = ComponentCore.createComponent(project);
- EJBArtifactEdit edit = EJBArtifactEdit.getEJBArtifactEditForRead(comp);
- if (edit != null && edit.hasEJBClientJARProject())
- localProjects.add(edit.getEJBClientJarModule().getProject());
- }
-
- /**
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
- try {
- J2EEDeleteDialog dlg = null;
- if (isSelectionAllApplications())
- dlg = new DeleteEARDialog(shell, getReferencedProjects());
- else if (isSelectionAllDDRoots())
- dlg = new DeleteModuleDialog(shell);
- else {
- if (confirmStandardDelete())
- runResourceDeleteAction();
- return;
- }
-
- dlg.open();
- if (dlg.getReturnCode() == Window.CANCEL)
- return;
- options = dlg.getDeleteOptions();
- if (options != null)
- options.setSelectedProjects(getProjects());
- else
- return;
- if (!(ensureEditorsSaved() && validateState()))
- return;
- deleteProjectsIfNecessary();
- deleteMetadataIfNecessary();
- presentStatusIfNeccessary();
- } finally {
- reset();
- }
- }
-
- private boolean ensureEditorsSaved() {
- return CommonEditorUtility.promptToSaveAllDirtyEditors();
- }
-
- protected boolean confirmStandardDelete() {
- return MessageDialog.openConfirm(shell, DELETE_PROJECTS, CUSTOM_DELETE_MIX_MATCH);
- }
-
- protected Set getReferencedProjects() {
- if (referencedProjects == null)
- computeReferencedProjects();
- return referencedProjects;
- }
-
- protected void computeReferencedProjects() {
- //TODO fix up to use components
-// getProjects();
-// referencedProjects = new HashSet();
-// for (int i = 0; i < projects.size(); i++) {
-// IProject project = (IProject) projects.get(i);
-// EARNatureRuntime runtime = EARNatureRuntime.getRuntime(project);
-// if (runtime == null)
-// continue;
-// EAREditModel editModel = runtime.getEarEditModelForRead(this);
-// try {
-// referencedProjects.addAll(editModel.getModuleMappedProjects());
-// } finally {
-// editModel.releaseAccess(this);
-// }
-// }
- }
-
-// protected DeleteModuleOperation getDeleteModuleOperation() {
-// if (deleteModuleOperation == null)
-// deleteModuleOperation = new DeleteModuleOperation(options);
-// return deleteModuleOperation;
-// }
-
- protected void deleteMetadataIfNecessary() {
- if (!shouldDeleteMetaData())
- return;
-
-// IRunnableWithProgress runnable = WTPUIPlugin.getRunnableWithProgress(getDeleteModuleOperation());
-// ProgressMonitorDialog monitorDialog = new ProgressMonitorDialog(shell);
-//
-// try {
-// monitorDialog.run(false, false, runnable);
-// } catch (InvocationTargetException e) {
-// handleException(e);
-// } catch (InterruptedException e) {
-// //Ignore
-// }
- }
-
- protected boolean shouldDeleteMetaData() {
- if (deleteProjectsFailedOrCancelled())
- return false;
- return primShouldDeleteMetaData();
- }
-
- protected boolean primShouldDeleteMetaData() {
- return options != null && (options.shouldDeleteModules() || options.shouldDeleteModuleDependencies());
- }
-
- protected boolean deleteProjectsFailedOrCancelled() {
- if (options == null || !options.shouldDeleteProjects())
- return false;
- return deletedProjectsExist();
- }
-
- protected boolean deletedProjectsExist() {
- List deletedProjects = options.getAllProjectsToDelete();
- for (int i = 0; i < deletedProjects.size(); i++) {
- IProject project = (IProject) deletedProjects.get(i);
- if (project.exists())
- return true;
- }
- return false;
- }
-
- protected void deleteProjectsIfNecessary() {
- if (options.shouldDeleteProjects())
- runResourceDeleteAction();
- }
-
- protected void runResourceDeleteAction() {
- DeleteResourceAction action = new DeleteResourceAction(shell);
- List localProjects = null;
- if (options == null)
- localProjects = getProjects();
- else
- localProjects = options.getAllProjectsToDelete();
- Iterator it = localProjects.iterator();
- while (it.hasNext()) {
- IProject p = (IProject) it.next();
- if (!p.exists())
- it.remove();
- }
- IStructuredSelection sel = new StructuredSelection(localProjects);
- action.selectionChanged(sel);
- action.run();
- }
-
- public void handleException(InvocationTargetException e) {
- Logger.getLogger().logError(e);
- IStatus status = J2EEPlugin.newErrorStatus(IStatus.ERROR, DELETE_ERROR, e);
- ErrorDialog.openError(shell, DELETE_ERROR, DELETE_NOT_COMPLETED, status);
- }
-
- /**
- * Update the action's enable state according to the current selection of the used selection
- * provider.
- */
- public void update() {
- IStructuredSelection selection = null;
-
- if (provider != null) {
- selection = (IStructuredSelection) provider.getSelection();
- selectionChanged((ISelection) selection);
- } else {
- selection = (IStructuredSelection) getSelection();
-
- if (selection == null) {
- setEnabled(false);
- } else {
- updateSelection(selection);
- }
- }
- }
-
- protected boolean isJ2EEApplicationProject(Object o) {
- if (o instanceof IProject) {
- IProject project = (IProject) o;
- if (J2EEProjectUtilities.isEARProject(project))
- return true;
- }
- return false;
- }
-
- protected void setEnabledFromSelection(IStructuredSelection selection) {
- if (selection == null) {
- setEnabled(false);
- } else {
- setEnabled(getEnableStateBasedOnSelection(selection));
- }
- }
-
- /**
- * @see SelectionDispatchAction#selectionChanged(ISelection)
- */
- public void selectionChanged(ISelection selection) {
- if (selection instanceof IStructuredSelection)
- setEnabledFromSelection((IStructuredSelection) selection);
- else
- super.selectionChanged(selection);
- }
-
- protected boolean validateState() {
- // TODO Fix validateState
- // if (!primShouldDeleteMetaData())
- // return true;
- //
- // IValidateEditListener listener = new ValidateEditListener(null,
- // getDeleteModuleOperation().getDeleteEditModel());
- // listener.setShell(shell);
- // return listener.validateState().isOK();
- return true;
- }
-
- protected void presentStatusIfNeccessary() {
- IStatus status = null;
-// if (deleteModuleOperation != null)
-// status = deleteModuleOperation.getStatus();
-
- if (status == null || status.isOK())
- return;
-
- ErrorDialog.openError(shell, null, null, status, IStatus.ERROR);
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/J2EEDeleteModuleActionPopulator.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/J2EEDeleteModuleActionPopulator.java
deleted file mode 100644
index 97d00f3d1..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/J2EEDeleteModuleActionPopulator.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 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
- *******************************************************************************/
-/*
- * Created on Jun 16, 2004
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-package org.eclipse.jst.j2ee.internal.actions;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchSite;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-/**
- * @author mdelder
- *
- * TODO To change the template for this generated type comment go to Window - Preferences - Java -
- * Code Style - Code Templates
- */
-public class J2EEDeleteModuleActionPopulator {//implements WTPOperationDataModelUICreator {
-
-
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.frameworks.internal.operation.extension.ui.WTPOperationDataModelUICreator#createDataModel(java.lang.String,
- * java.lang.String, org.eclipse.jface.viewers.IStructuredSelection,
- * org.eclipse.ui.IWorkbenchSite)
- */
- public IDataModel createDataModel(String extendedOperationId, String operationClass, IStructuredSelection selection, IWorkbenchSite site) {
- //TODO fix up
-// J2EEDeleteAction deleteAction = new J2EEDeleteAction(site, (ISelectionProvider) null);
-// WTPOperationDataModel dataModel = IActionWTPOperationDataModel.createDataModel(deleteAction, selection, site.getSelectionProvider(), site.getShell());
-// return dataModel;
- return null;
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/J2EEDeployAction.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/J2EEDeployAction.java
deleted file mode 100644
index 47b6593e9..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/J2EEDeployAction.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2006 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
- *******************************************************************************/
-/*
- * Created on Mar 30, 2004
- *
- * To change the template for this generated file go to
- * Window - Preferences - Java - Code Generation - Code and Comments
- */
-package org.eclipse.jst.j2ee.internal.actions;
-
-import java.text.MessageFormat;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-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.core.runtime.jobs.Job;
-import org.eclipse.jem.util.logger.proxy.Logger;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jst.j2ee.internal.deploy.DeployerRegistry;
-import org.eclipse.jst.j2ee.internal.deploy.J2EEDeployOperation;
-import org.eclipse.jst.j2ee.internal.dialogs.RuntimeSelectionDialog;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIMessages;
-import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.common.frameworks.internal.WTPResourceHandler;
-import org.eclipse.wst.common.frameworks.internal.plugin.WTPCommonPlugin;
-import org.eclipse.wst.server.core.IRuntime;
-
-/**
- * @author cbridgha
- *
- * To change the template for this generated type comment go to Window - Preferences - Java - Code
- * Generation - Code and Comments
- */
-public class J2EEDeployAction extends BaseAction {
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.j2ee.internal.internal.ui.actions.BaseAction#primRun(org.eclipse.swt.widgets.Shell)
- */
- protected void primRun(Shell shell) {
-
- if (checkEnabled(shell)) {
- final IStructuredSelection deploySelection = selection;
- Job deployJob = new Job("Deploy") {
- protected IStatus run(IProgressMonitor monitor) {
- IStatus result = null;
- J2EEDeployOperation op = new J2EEDeployOperation(deploySelection.toArray());
- try {
- result = op.execute(monitor, null);
- } catch (Exception e) {
- result = new Status(IStatus.ERROR, WTPCommonPlugin.PLUGIN_ID, IStatus.ERROR, WTPResourceHandler.getString("27"), e); //$NON-NLS-1$
- Logger.getLogger().logError(e);
- } finally {
-
- }
- return result;
- }
- };
-
-
- try {
- deployJob.setUser(true);
- deployJob.schedule();
- } catch (Exception e) {
- //Ignore
- }
-
- }
-
- }
-
- /*
- *
- */
- public J2EEDeployAction() {
- super();
- // TODO Auto-generated constructor stub
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction,
- * org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection aSelection) {
- super.selectionChanged(action, aSelection);
- action.setEnabled(true);
- }
-
-
- public boolean checkEnabled(Shell shell) {
-
- try {
- DeployerRegistry reg = DeployerRegistry.instance();
-
- List components = DeployerRegistry.getSelectedModules(selection.toArray());
- for (int i = 0; i < components.size(); i++) {
- IVirtualComponent component = (IVirtualComponent) components.get(i);
- IProject proj = component.getProject();
- if (proj == null) {
- displayMessageDialog(J2EEUIMessages.getResourceString("DEPLOY_PROJECT_NOT_FOUND") , shell);
- return false;
- }
-
- IRuntime runtime = J2EEProjectUtilities.getServerRuntime(proj);
- if (runtime == null) {
- String message = MessageFormat.format(J2EEUIMessages.getResourceString("DEPLOY_RUNTIME_NOT_FOUND"), new String []{proj.getName()});
- RuntimeSelectionDialog selectionDialog = new RuntimeSelectionDialog(shell,
- J2EEUIMessages.getResourceString("DEPLOY_DIALOG_TITLE"),
- null /* default image */,
- message,
- MessageDialog.ERROR,
- new String[] { IDialogConstants.OK_LABEL }, 0, proj) ;
- selectionDialog.open();
- runtime = J2EEProjectUtilities.getServerRuntime(proj);
- if (runtime == null)
- return false;
- }
- List visitors = reg.getDeployModuleExtensions(proj, runtime);
- if (visitors.isEmpty()) {
- displayMessageDialog(MessageFormat.format(J2EEUIMessages.getResourceString("DEPLOY_PROJECT_NOT_SUPPORTED"), new String []{proj.getName()}), shell);
- return false;
- }
-
- }
-
- return true;
- } catch (CoreException e) {
- System.out.println("Deploy Action recovering from problem verifying enablement."); //$NON-NLS-1$
- e.printStackTrace();
- }
- return false;
- }
-
- private void displayMessageDialog(String message, Shell shell) {
- String title = J2EEUIMessages.getResourceString("DEPLOY_DIALOG_TITLE");
- MessageDialog dialog = new MessageDialog(shell,
- title,
- null /* default image */,
- message,
- MessageDialog.ERROR,
- new String[] { IDialogConstants.OK_LABEL }, 0) ;
- dialog.open();
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/J2EEModuleRenameChange.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/J2EEModuleRenameChange.java
deleted file mode 100644
index e4f227f29..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/J2EEModuleRenameChange.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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
- *******************************************************************************/
-/*
- * Created on Sep 26, 2004
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-package org.eclipse.jst.j2ee.internal.actions;
-
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jst.j2ee.internal.dialogs.J2EERenameUIConstants;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIPlugin;
-import org.eclipse.jst.j2ee.web.componentcore.util.WebArtifactEdit;
-import org.eclipse.ltk.core.refactoring.Change;
-import org.eclipse.ltk.core.refactoring.RefactoringStatus;
-
-
-/**
- *
- * TODO To change the template for this generated type comment go to Window - Preferences - Java -
- * Code Style - Code Templates
- */
-public class J2EEModuleRenameChange extends Change {
-
-// private String newName;
- private IProject target;
-// private boolean renameDependencies;
-
- public J2EEModuleRenameChange(IProject target, String newName, boolean renameDependencies) {
- this.target = target;
-// this.newName = newName;
-// this.renameDependencies = renameDependencies;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ltk.core.refactoring.Change#getName()
- */
- public String getName() {
- return J2EERenameUIConstants.RENAME_MODULES;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ltk.core.refactoring.Change#initializeValidationData(org.eclipse.core.runtime.IProgressMonitor)
- */
- public void initializeValidationData(IProgressMonitor pm) {
- //Do nothing
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ltk.core.refactoring.Change#isValid(org.eclipse.core.runtime.IProgressMonitor)
- */
- public RefactoringStatus isValid(IProgressMonitor pm) throws CoreException, OperationCanceledException {
- if (target != null)
- return RefactoringStatus.create(Status.OK_STATUS);
- return RefactoringStatus.create(new Status(IStatus.ERROR, J2EEUIPlugin.PLUGIN_ID, 0, "", null)); //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ltk.core.refactoring.Change#perform(org.eclipse.core.runtime.IProgressMonitor)
- */
- public Change perform(IProgressMonitor pm) throws CoreException {
-// try {
-
-// RenameModuleOperation renameOp = new RenameModuleOperation(getRenameOptions());
-// renameOp.run(pm);
-
- //String contextRoot = getServerContextRoot();
- // TODO fix up rename and context root operations
- //if (webNature != null) {
- //new UpdateWebContextRootMetadataOperation(newTarget, webNature.getContextRoot()).run(pm);
-// if(contextRoot.equals("") == false){ //$NON-NLS-1$
-// new UpdateWebContextRootMetadataOperation(target, contextRoot).run(pm);
-// } else if (J2EENature.getRegisteredRuntime(target) == null)
-// new RenameUtilityJarMetadataOperation(target, newTarget).run(pm);
-// } catch (InvocationTargetException e) {
-// //Ignore
-// } catch (InterruptedException e) {
-// //Ignore
-// }
- return null;
- }
-
- protected String getServerContextRoot() {
- WebArtifactEdit webEdit = null;
- try{
- webEdit = WebArtifactEdit.getWebArtifactEditForRead(target);
- if (webEdit != null)
- return webEdit.getServerContextRoot();
- } finally {
- if (webEdit != null )
- webEdit.dispose();
- }
- return ""; //$NON-NLS-1$
- }
-
- /**
- * @return
- */
- /**@deprecated
- * If this method is not used it should be removed at a later time, marking as deprecated
- * Warning cleanup 12/07/2005
- */
-// private RenameOptions getRenameOptions() {
-// RenameOptions options = new RenameOptions();
-// options.setNewName(this.newName);
-// options.setSelectedProjects(Collections.singletonList(this.target));
-// // TODO check module type for EAR type
-// //options.setIsEARRename(EARNatureRuntime.getRuntime(this.target) != null);
-// options.setRenameModuleDependencies(this.renameDependencies);
-// options.setRenameModules(true);
-// options.setRenameProjects(false);
-// return options;
-// }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ltk.core.refactoring.Change#getModifiedElement()
- */
- public Object getModifiedElement() {
- return null;
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/J2EERenameAction.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/J2EERenameAction.java
deleted file mode 100644
index 3890197bd..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/J2EERenameAction.java
+++ /dev/null
@@ -1,391 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.jst.j2ee.internal.actions;
-
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jdt.ui.actions.SelectionDispatchAction;
-import org.eclipse.jem.util.emf.workbench.ProjectUtilities;
-import org.eclipse.jem.util.logger.proxy.Logger;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jst.j2ee.application.Application;
-import org.eclipse.jst.j2ee.common.internal.util.CommonUtil;
-import org.eclipse.jst.j2ee.internal.dialogs.J2EERenameDialog;
-import org.eclipse.jst.j2ee.internal.dialogs.J2EERenameUIConstants;
-import org.eclipse.jst.j2ee.internal.dialogs.RenameModuleDialog;
-import org.eclipse.jst.j2ee.internal.plugin.CommonEditorUtility;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIMessages;
-import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities;
-import org.eclipse.jst.j2ee.internal.rename.RenameOptions;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IWorkbenchSite;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.actions.RenameResourceAction;
-import org.eclipse.wst.common.componentcore.UnresolveableURIException;
-import org.eclipse.wst.common.componentcore.internal.ComponentResource;
-import org.eclipse.wst.common.componentcore.internal.StructureEdit;
-import org.eclipse.wst.common.componentcore.internal.WorkbenchComponent;
-
-public class J2EERenameAction extends SelectionDispatchAction implements J2EERenameUIConstants {
-
- protected Shell shell;
- //Used for EAR rename
- protected Set referencedProjects;
- protected List modules;
- protected RenameOptions options;
- // added for IRefactoringAction behavior
- protected ISelectionProvider provider = null;
-// protected RenameModuleOperation renameModuleOperation = null;
-
- /**
- * Constructor for RenameModuleAction.
- *
- * @param text
- */
- public J2EERenameAction(IWorkbenchSite site, Shell parent) {
- super(site);
- setText(RENAME);
- shell = parent;
- }
-
- public J2EERenameAction(IWorkbenchSite site, ISelectionProvider newProvider) {
- super(site);
- setText(RENAME);
- shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
- provider = newProvider;
- }
-
- protected void reset() {
-// if (renameModuleOperation != null) {
-// renameModuleOperation.release();
-// renameModuleOperation = null;
-// }
- referencedProjects = null;
- modules = null;
- options = null;
- }
-
- /**
- * @see org.eclipse.ui.actions.SelectionListenerAction#updateSelection(IStructuredSelection)
- */
- protected void updateSelection(IStructuredSelection selection) {
- super.update(selection);
- }
-
- /**
- * @see SelectionDispatchAction#selectionChanged(ISelection)
- */
- public void selectionChanged(ISelection selection) {
- if (selection instanceof IStructuredSelection)
- setEnabledFromSelection((IStructuredSelection) selection);
- else
- super.selectionChanged(selection);
- }
-
- protected void setEnabledFromSelection(IStructuredSelection selection) {
- if (selection == null) {
- setEnabled(false);
- } else {
- if (selection.toList().size() != 1) {
- setEnabled(false);
- } else {
- setEnabled(getEnableStateBasedOnSelection(selection));
- }
- }
- }
-
- protected boolean getEnableStateBasedOnSelection(IStructuredSelection selection) {
- if (selection.isEmpty())
- return false;
- return isSelectionAllDDRoots() || isSelectionAllApplications();
- }
-
- protected boolean isSelectionAllDDRoots() {
- IStructuredSelection sel = (StructuredSelection) getSelection();
- Iterator it = sel.iterator();
- while (it.hasNext()) {
- Object o = it.next();
- //TODO check for j2ee workbench module selection
- if (!CommonUtil.isDeploymentDescriptorRoot(o, false) /*&& !isJ2EEProject(o)*/)
- return false;
- }
- return true;
- }
-
- protected boolean isSelectionAllApplications() {
- IStructuredSelection sel = (StructuredSelection) getSelection();
- Iterator it = sel.iterator();
- while (it.hasNext()) {
- Object o = it.next();
- if (!(o instanceof Application) && !isJ2EEApplicationProject(o))
- return false;
- }
- return true;
- }
-
-
- protected List getModules() {
- if (modules == null) {
- modules = new ArrayList();
- IStructuredSelection sel = (StructuredSelection) getSelection();
- Iterator iterator = sel.iterator();
- WorkbenchComponent module = null;
- Object o = null;
- while (iterator.hasNext()) {
- o = iterator.next();
- if (o instanceof WorkbenchComponent) {
- modules.add(o);
- } else if (o instanceof EObject) {
- EObject obj = (EObject) o;
- IProject project = ProjectUtilities.getProject(obj);
- StructureEdit moduleCore = null;
- try {
- moduleCore = StructureEdit.getStructureEditForRead(project);
- URI uri = obj.eResource().getURI();
- ComponentResource[] resources = moduleCore.findResourcesBySourcePath(uri);
- for (int i=0; i<resources.length; i++) {
- module = resources[i].getComponent();
- if (module !=null)
- break;
- }
- if (module == null)
- throw new RuntimeException(J2EEUIMessages.getResourceString("Project_should_not_be_null_1_ERROR_")); //$NON-NLS-1$
- modules.add(module);
- } catch (UnresolveableURIException e) {
- //Ignore
- } finally {
- if (moduleCore !=null)
- moduleCore.dispose();
- }
- } else {
- throw new RuntimeException(J2EEUIMessages.getResourceString("Non-project_in_selection_2_ERROR_")); //$NON-NLS-1$
- }
- }
- }
- return modules;
- }
-
- /**
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
- try {
- List localModules = getModules();
- if (localModules.size() != 1)
- return;
- WorkbenchComponent module = (WorkbenchComponent) localModules.get(0);
- J2EERenameDialog dlg = null;
-
- // if all we are doing is renaming an EAR, let the base platform do it
- if (isSelectionAllApplications()) {
- RenameResourceAction action = new RenameResourceAction(shell);
- action.selectionChanged(new StructuredSelection(module));
- action.run();
- } else {
- String contextRoot = ""; //$NON-NLS-1$
- //TODO add context root to the module model
- //contextRoot = module.getServerContextRoot();
- dlg = new RenameModuleDialog(shell, module.getName(), contextRoot);
- dlg.open();
- if (dlg.getReturnCode() == Window.CANCEL)
- return;
-
- options = dlg.getRenameOptions();
- if (options != null)
- options.setSelectedProjects(localModules);
-
- if (!(ensureEditorsSaved() && validateState()))
- return;
- renameProjectsIfNecessary();
- renameMetadataIfNecessary();
- presentStatusIfNeccessary();
- }
- } finally {
- reset();
- }
- }
-
-
- private boolean ensureEditorsSaved() {
- return CommonEditorUtility.promptToSaveAllDirtyEditors();
- }
-
- protected Set getReferencedProjects() {
- if (referencedProjects == null)
- computeReferencedProjects();
- return referencedProjects;
- }
-
- protected void computeReferencedProjects() {
- getModules();
- referencedProjects = new HashSet();
- for (int i = 0; i < modules.size(); i++) {
- //WorkbenchComponent module = (WorkbenchComponent) modules.get(i);
- //TODO fix up code here for modules instead of projects
-// EARNatureRuntime runtime = EARNatureRuntime.getRuntime(project);
-// if (runtime == null)
-// continue;
-// EAREditModel editModel = runtime.getEarEditModelForRead(this);
-// try {
-// referencedProjects.addAll(editModel.getModuleMappedProjects());
-// } finally {
-// editModel.releaseAccess(this);
-// }
- }
- }
-
- protected void renameMetadataIfNecessary() {
- if (!shouldRenameMetaData())
- return;
-// RenameModuleOperation op = getRenameModuleOperation();
-// IRunnableWithProgress runnable = WTPUIPlugin.getRunnableWithProgress(op);
-// ProgressMonitorDialog monitorDialog = new ProgressMonitorDialog(shell);
-//
-// try {
-// monitorDialog.run(false, false, runnable);
-// } catch (InvocationTargetException e) {
-// handleException(e);
-// } catch (InterruptedException e) {
-// //Ignore
-// }
- }
-
- protected boolean shouldRenameMetaData() {
- if (renameProjectsFailedOrCancelled())
- return false;
-
- return primShouldRenameMetaData();
- }
-
- protected boolean renameProjectsFailedOrCancelled() {
- if (options == null || !options.shouldRenameProjects())
- return false;
- return renamedProjectsExist();
- }
-
- protected boolean renamedProjectsExist() {
- List renamedProjects = options.getAllProjectsToRename();
- for (int i = 0; i < renamedProjects.size(); i++) {
- IProject project = (IProject) renamedProjects.get(i);
- if (project.exists())
- return true;
- }
- return false;
- }
-
- protected void renameProjectsIfNecessary() {
- if (options == null || !options.shouldRenameProjects())
- return;
- J2EERenameResourceAction action = new J2EERenameResourceAction(shell);
- action.setNewName(options.getNewName());
- IStructuredSelection sel = new StructuredSelection(options.getAllProjectsToRename());
- action.selectionChanged(sel);
- action.run();
-
- // only web projects should have a context root
- String newContextRoot = options.getNewContextRoot();
- if (newContextRoot != null && options.shouldRenameProjects()) {
- //WorkbenchComponent module = (WorkbenchComponent) getModules().get(0);
- try {
- // TODO add server context root to the module model
- //module.setServerContextRoot(newContextRoot);
- } catch (Throwable t) {
- //Ignore
- }
- }
- }
-
- public void handleException(InvocationTargetException e) {
- Logger.getLogger().logError(e);
- IStatus status = J2EEPlugin.newErrorStatus(IStatus.ERROR, RENAME_ERROR, e);
- ErrorDialog.openError(shell, RENAME_ERROR, RENAME_NOT_COMPLETED, status);
- }
-
- /**
- * Update the action's enable state according to the current selection of the used selection
- * provider.
- */
- public void update() {
- IStructuredSelection selection = null;
-
- if (provider != null) {
- selection = (IStructuredSelection) provider.getSelection();
- super.update(selection);
- } else {
- selection = (IStructuredSelection) getSelection();
-
- if (selection == null) {
- setEnabled(false);
- } else {
- updateSelection(selection);
- }
- }
- }
-
- protected boolean isJ2EEApplicationProject(Object o) {
- if (o instanceof IProject) {
- IProject project = (IProject) o;
- if (J2EEProjectUtilities.isEARProject(project))
- return true;
- }
- return false;
- }
-
- protected boolean validateState() {
- if (!primShouldRenameMetaData())
- return true;
-
-// IValidateEditListener listener = new ValidateEditListener(null, getRenameModuleOperation().getRenameEditModel());
-// listener.setShell(shell);
-// return listener.validateState().isOK();
- return false;
- }
-
- protected boolean primShouldRenameMetaData() {
- return options != null && (options.shouldRenameModules() || options.shouldRenameModuleDependencies());
- }
-
-// protected RenameModuleOperation getRenameModuleOperation() {
-// if (renameModuleOperation == null) {
-// renameModuleOperation = new RenameModuleOperation(options);
-// }
-// return renameModuleOperation;
-// }
-
- protected void presentStatusIfNeccessary() {
- IStatus status = null;
-
-// if (renameModuleOperation != null) {
-// status = renameModuleOperation.getStatus();
-// }
-
- if (status == null || status.isOK())
- return;
-
- ErrorDialog.openError(shell, null, null, status, IStatus.ERROR);
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/J2EERenameParticipant.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/J2EERenameParticipant.java
deleted file mode 100644
index e52b7c605..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/J2EERenameParticipant.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 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
- *******************************************************************************/
-/*
- * Created on Sep 26, 2004
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-package org.eclipse.jst.j2ee.internal.actions;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jst.j2ee.internal.dialogs.J2EERenameUIConstants;
-import org.eclipse.ltk.core.refactoring.Change;
-import org.eclipse.ltk.core.refactoring.RefactoringStatus;
-import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
-import org.eclipse.ltk.core.refactoring.participants.RenameParticipant;
-import org.eclipse.wst.common.frameworks.internal.AdaptabilityUtility;
-
-
-/**
- * TODO To change the template for this generated type comment go to Window - Preferences - Java -
- * Code Style - Code Templates
- */
-public class J2EERenameParticipant extends RenameParticipant {
-
- private static final Class IPROJECT_CLASS = IProject.class;
-
- public J2EERenameParticipant() {
- super();
- // TODO Auto-generated constructor stub
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#initialize(java.lang.Object)
- */
- protected boolean initialize(Object element) {
- if (element == null)
- return false;
-
- IProject project = (IProject) AdaptabilityUtility.getAdapter(element, IPROJECT_CLASS);
- if (project.isAccessible()) {
- return true;
- }
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#createChange(org.eclipse.core.runtime.IProgressMonitor)
- */
- public Change createChange(IProgressMonitor pm) throws CoreException, OperationCanceledException {
- Object[] targetElements = getProcessor().getElements();
- if (targetElements == null || targetElements.length != 1)
- return null;
- IProject project = (IProject) AdaptabilityUtility.getAdapter(targetElements[0], IPROJECT_CLASS);
-
- if (project != null)
- return new J2EEModuleRenameChange(project, getArguments().getNewName(), getArguments().getUpdateReferences());
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#getName()
- */
- public String getName() {
- return J2EERenameUIConstants.RENAME;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#checkConditions(org.eclipse.core.runtime.IProgressMonitor,
- * org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext)
- */
- public RefactoringStatus checkConditions(IProgressMonitor pm, CheckConditionsContext context) throws OperationCanceledException {
- return RefactoringStatus.create(Status.OK_STATUS);
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/J2EERenameResourceAction.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/J2EERenameResourceAction.java
deleted file mode 100644
index f927e1cac..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/J2EERenameResourceAction.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2003, 2004 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.jst.j2ee.internal.actions;
-
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.actions.RenameResourceAction;
-
-public class J2EERenameResourceAction extends RenameResourceAction {
- String newName = null;
-
- /**
- * Creates a new action. Using this constructor directly will rename using a dialog (if
- * necessary) rather than the inline editor of a ResourceNavigator. Note that a rename happens
- * on one and only one resource at a time.
- *
- * @param shell
- * the shell for any dialogs
- */
- public J2EERenameResourceAction(Shell shell) {
- super(shell);
- }
-
- /**
- * Return the new name to be given to the target resource.
- *
- * @return java.lang.String
- */
- protected String queryNewResourceName(final IResource resource) {
- String retVal = null;
-
- if (newName == null || newName.length() < 1) {
- retVal = super.queryNewResourceName(resource);
- } else {
- retVal = newName;
- }
-
- return retVal;
- }
-
- /**
- * Gets the newName.
- *
- * @return Returns a String
- */
- public String getNewName() {
- return newName;
- }
-
- /**
- * Sets the newName.
- *
- * @param newName
- * The newName to set
- */
- public void setNewName(String newName) {
- this.newName = newName;
- }
-
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/J2EEResourceOpenListener.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/J2EEResourceOpenListener.java
deleted file mode 100644
index 2d0657e3b..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/J2EEResourceOpenListener.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 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
- *******************************************************************************/
-/*
- * Created on Feb 2, 2005
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-package org.eclipse.jst.j2ee.internal.actions;
-
-import org.eclipse.jface.viewers.IOpenListener;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.OpenEvent;
-
-/**
- * @author Admin
- *
- * TODO To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-public class J2EEResourceOpenListener implements IOpenListener{
-
- private OpenJ2EEResourceAction action;
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IOpenListener#open(org.eclipse.jface.viewers.OpenEvent)
- */
-
- public void open(OpenEvent anEvent) {
- ISelection selection = anEvent.getSelection();
- if (selection instanceof IStructuredSelection) {
-
- if (getAction().updateSelection((IStructuredSelection)selection))
- action.run();
- }
-
- }
-
- /**
- * @return
- */
- private OpenJ2EEResourceAction getAction() {
- if (action == null)
- action = new OpenJ2EEResourceAction();
- return action;
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/NewAppClientComponentAction.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/NewAppClientComponentAction.java
deleted file mode 100644
index b8a2f7e0e..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/NewAppClientComponentAction.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 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.jst.j2ee.internal.actions;
-
-
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIMessages;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIPlugin;
-import org.eclipse.jst.j2ee.ui.project.facet.appclient.AppClientProjectWizard;
-import org.eclipse.ui.IWorkbench;
-
-
-public class NewAppClientComponentAction extends AbstractOpenWizardWorkbenchAction {
-
- // TODO MDE 02-28 Find correct label
- public static String LABEL = J2EEUIMessages.getResourceString("NewApplClientModuleAction_UI_0"); //$NON-NLS-1$
- private static final String ICON = "new_appclientproject_wiz"; //$NON-NLS-1$
-
- public NewAppClientComponentAction() {
- setText(LABEL);
- setImageDescriptor(J2EEUIPlugin.getDefault().getImageDescriptor(ICON));
- }
-
- public NewAppClientComponentAction(IWorkbench workbench, String label, Class[] acceptedTypes) {
- super(workbench, label, acceptedTypes, false);
- setImageDescriptor(J2EEUIPlugin.getDefault().getImageDescriptor(ICON));
- }
-
- protected Wizard createWizard() {
- return new AppClientProjectWizard();
- }
-
- protected boolean shouldAcceptElement(Object obj) {
- return true; /* NewGroup.isOnBuildPath(obj) && !NewGroup.isInArchive(obj); */
- }
-
- protected String getDialogText() {
- return null;
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/NewEARComponentAction.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/NewEARComponentAction.java
deleted file mode 100644
index 3c96cb23b..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/NewEARComponentAction.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 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.jst.j2ee.internal.actions;
-
-
-
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIMessages;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIPlugin;
-import org.eclipse.jst.j2ee.ui.project.facet.EarProjectWizard;
-import org.eclipse.ui.IWorkbench;
-
-
-public class NewEARComponentAction extends AbstractOpenWizardWorkbenchAction {
- // TODO MDE 02-28 Find correct label
- public static String LABEL = J2EEUIMessages.getResourceString("NewEARModuleAction_UI_0"); //$NON-NLS-1$
- private static final String ICON = "newear_wiz"; //$NON-NLS-1$
-
- public NewEARComponentAction() {
- setText(LABEL);
- setImageDescriptor(J2EEUIPlugin.getDefault().getImageDescriptor(ICON));
- }
-
- public NewEARComponentAction(IWorkbench workbench, String label, Class[] acceptedTypes) {
- super(workbench, label, acceptedTypes, false);
- setImageDescriptor(J2EEUIPlugin.getDefault().getImageDescriptor(ICON));
- }
-
- protected Wizard createWizard() {
- return new EarProjectWizard();
- }
-
- protected boolean shouldAcceptElement(Object obj) {
- return true; /* NewGroup.isOnBuildPath(obj) && !NewGroup.isInArchive(obj); */
- }
-
- protected String getDialogText() {
- return null;
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/NewJavaEEArtifactDropDownAction.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/NewJavaEEArtifactDropDownAction.java
deleted file mode 100644
index f92be5c99..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/NewJavaEEArtifactDropDownAction.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 SAP AG 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:
- * Kaloyan Raev, kaloyan.raev@sap.com - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.internal.actions;
-
-import org.eclipse.jface.action.IMenuCreator;
-import org.eclipse.ui.IWorkbenchWindowPulldownDelegate2;
-
-
-/**
- * A wizard is added to the "New Java EE Artifact" drop down if it has a parameter 'javaeeartifact':
- * <wizard
- * name="My Java EE Project Wizard"
- * icon="icons/wiz.gif"
- * category="mycategory"
- * id="xx.MyWizard">
- * <class class="org.xx.MyWizard">
- * <parameter name="javaeeartifact" value="true"/>
- * </class>
- * <description>
- * My Wizard
- * </description>
- * </wizard>
- */
-public class NewJavaEEArtifactDropDownAction extends NewJavaEEDropDownAction implements IMenuCreator, IWorkbenchWindowPulldownDelegate2 {
-
- private final static String ATT_JAVAEEARTIFACT = "javaeeartifact";//$NON-NLS-1$
-
- @Override
- protected String getTypeAttribute() {
- return ATT_JAVAEEARTIFACT;
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/NewJavaEEDropDownAction.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/NewJavaEEDropDownAction.java
deleted file mode 100644
index 67d9f3e38..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/NewJavaEEDropDownAction.java
+++ /dev/null
@@ -1,303 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 SAP AG 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:
- * Kaloyan Raev, kaloyan.raev@sap.com - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.internal.actions;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jdt.internal.ui.util.CoreUtility;
-import org.eclipse.jdt.internal.ui.util.PixelConverter;
-import org.eclipse.jem.util.logger.proxy.Logger;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuCreator;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIPlugin;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.INewWizard;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.IWorkbenchWindowPulldownDelegate2;
-import org.eclipse.ui.PlatformUI;
-
-public abstract class NewJavaEEDropDownAction extends Action implements IMenuCreator, IWorkbenchWindowPulldownDelegate2 {
-
- public static class NewJavaEEWizardAction extends Action implements Comparable {
-
- private final static String ATT_NAME = "name";//$NON-NLS-1$
- private final static String ATT_CLASS = "class";//$NON-NLS-1$
- private final static String ATT_ICON = "icon";//$NON-NLS-1$
- private final static String TAG_DESCRIPTION = "description"; //$NON-NLS-1$
-
- private Shell fShell;
- private IStructuredSelection fSelection;
- private IConfigurationElement fConfigurationElement;
-
- private int menuIndex;
-
- public NewJavaEEWizardAction(IConfigurationElement element) {
- fConfigurationElement= element;
- setText(element.getAttribute(ATT_NAME));
-
- String description = getDescriptionFromConfig(fConfigurationElement);
- setDescription(description);
- setToolTipText(description);
- setImageDescriptor(getIconFromConfig(fConfigurationElement));
- setMenuIndex(getMenuIndexFromConfig(fConfigurationElement));
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.Action#run()
- */
- public void run() {
- Shell shell = getShell();
- try {
- INewWizard wizard = createWizard();
- wizard.init(PlatformUI.getWorkbench(), getSelection());
-
- WizardDialog dialog = new WizardDialog(shell, wizard);
- PixelConverter converter = new PixelConverter(JFaceResources.getDialogFont());
- dialog.setMinimumPageSize(converter.convertWidthInCharsToPixels(70), converter.convertHeightInCharsToPixels(20));
- dialog.create();
- int res = dialog.open();
-
- notifyResult(res == Window.OK);
- } catch (CoreException e) {
- Logger.getLogger().log(e);
- }
- }
-
- /**
- * Returns the configured selection. If no selection has been configured using {@link #setSelection(IStructuredSelection)},
- * the currently selected element of the active workbench is returned.
- * @return the configured selection
- */
- protected IStructuredSelection getSelection() {
- if (fSelection == null) {
- return evaluateCurrentSelection();
- }
- return fSelection;
- }
-
- private IStructuredSelection evaluateCurrentSelection() {
- IWorkbenchWindow window = J2EEUIPlugin.getActiveWorkbenchWindow();
- if (window != null) {
- ISelection selection = window.getSelectionService().getSelection();
- if (selection instanceof IStructuredSelection) {
- return (IStructuredSelection) selection;
- }
- }
- return StructuredSelection.EMPTY;
- }
-
- /**
- * Configures the selection to be used as initial selection of the wizard.
- * @param selection the selection to be set or <code>null</code> to use the selection of the active workbench window
- */
- public void setSelection(IStructuredSelection selection) {
- fSelection = selection;
- }
-
- /**
- * Returns the configured shell. If no shell has been configured using {@link #setShell(Shell)},
- * the shell of the currently active workbench is returned.
- * @return the configured shell
- */
- protected Shell getShell() {
- if (fShell == null) {
- return J2EEUIPlugin.getActiveWorkbenchShell();
- }
- return fShell;
- }
-
- /**
- * Configures the shell to be used as parent shell by the wizard.
- * @param shell the shell to be set or <code>null</code> to use the shell of the active workbench window
- */
- public void setShell(Shell shell) {
- fShell = shell;
- }
-
- private String getDescriptionFromConfig(IConfigurationElement config) {
- IConfigurationElement [] children = config.getChildren(TAG_DESCRIPTION);
- if (children.length >= 1) {
- return children[0].getValue();
- }
- return ""; //$NON-NLS-1$
- }
-
- private ImageDescriptor getIconFromConfig(IConfigurationElement config) {
- String iconName = config.getAttribute(ATT_ICON);
- if (iconName != null) {
- return J2EEUIPlugin.imageDescriptorFromPlugin(config.getContributor().getName(), iconName);
- }
- return null;
- }
-
- private int getMenuIndexFromConfig(IConfigurationElement config) {
- IConfigurationElement[] classElements = config.getChildren(TAG_CLASS);
- if (classElements.length > 0) {
- for (IConfigurationElement classElement : classElements) {
- IConfigurationElement[] paramElements = classElement.getChildren(TAG_PARAMETER);
- for (IConfigurationElement paramElement : paramElements) {
- if (ATT_MENUINDEX.equals(paramElement.getAttribute(TAG_NAME))) {
- return Integer.parseInt(paramElement.getAttribute(TAG_VALUE));
- }
- }
- }
- }
- return Integer.MAX_VALUE;
- }
-
- protected INewWizard createWizard() throws CoreException {
- return (INewWizard) CoreUtility.createExtension(fConfigurationElement, ATT_CLASS);
- }
-
- public int getMenuIndex() {
- return menuIndex;
- }
-
- public void setMenuIndex(int menuIndex) {
- this.menuIndex = menuIndex;
- }
-
- public int compareTo(Object o) {
- NewJavaEEWizardAction action = (NewJavaEEWizardAction) o;
- return getMenuIndex() - action.getMenuIndex();
- }
- }
-
- protected final static String TAG_WIZARD = "wizard";//$NON-NLS-1$
- protected final static String TAG_PARAMETER = "parameter";//$NON-NLS-1$
- protected final static String TAG_NAME = "name";//$NON-NLS-1$
- protected final static String TAG_VALUE = "value";//$NON-NLS-1$
- protected final static String TAG_CLASS = "class"; //$NON-NLS-1$
- protected final static String ATT_MENUINDEX = "menuIndex";//$NON-NLS-1$
- protected final static String PL_NEW = "newWizards"; //$NON-NLS-1$
-
- protected Menu fMenu;
-
- protected Shell fWizardShell;
-
- public NewJavaEEDropDownAction() {
- fMenu = null;
- setMenuCreator(this);
- }
-
- public void dispose() {
- if (fMenu != null) {
- fMenu.dispose();
- fMenu = null;
- }
- }
-
- public Menu getMenu(Menu parent) {
- return null;
- }
-
- public Menu getMenu(Control parent) {
- if (fMenu == null) {
- fMenu = new Menu(parent);
- NewJavaEEWizardAction[] actions = getActionFromDescriptors();
- for (NewJavaEEWizardAction action : actions) {
- action.setShell(fWizardShell);
- ActionContributionItem item = new ActionContributionItem(action);
- item.fill(fMenu, -1);
- }
- }
- return fMenu;
- }
-
- public void run() {
- getDefaultAction().run();
- }
-
- public Action getDefaultAction() {
- Action[] actions = getActionFromDescriptors();
- if (actions.length > 0)
- return actions[0];
- return null;
- }
-
- public NewJavaEEWizardAction[] getActionFromDescriptors() {
- ArrayList<NewJavaEEWizardAction> containers = new ArrayList<NewJavaEEWizardAction>();
-
- IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(PlatformUI.PLUGIN_ID, PL_NEW);
- if (extensionPoint != null) {
- IConfigurationElement[] elements = extensionPoint.getConfigurationElements();
- for (IConfigurationElement element : elements) {
- if (element.getName().equals(TAG_WIZARD) && isJavaEEProjectWizard(element)) {
- containers.add(new NewJavaEEWizardAction(element));
- }
- }
- }
-
- NewJavaEEWizardAction[] actions = (NewJavaEEWizardAction[]) containers.toArray(new NewJavaEEWizardAction[containers.size()]);
- Arrays.sort(actions);
- return actions;
- }
-
- protected boolean isJavaEEProjectWizard(IConfigurationElement element) {
- IConfigurationElement[] classElements = element.getChildren(TAG_CLASS);
- if (classElements.length > 0) {
- for (IConfigurationElement classElement : classElements) {
- IConfigurationElement[] paramElements = classElement.getChildren(TAG_PARAMETER);
- for (IConfigurationElement paramElement : paramElements) {
- if (getTypeAttribute().equals(paramElement.getAttribute(TAG_NAME))) {
- return Boolean.valueOf(paramElement.getAttribute(TAG_VALUE)).booleanValue();
- }
- }
- }
- }
- // old way, deprecated
- if (Boolean.valueOf(element.getAttribute(getTypeAttribute())).booleanValue()) {
- return true;
- }
- return false;
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(org.eclipse.ui.IWorkbenchWindow)
- */
- public void init(IWorkbenchWindow window) {
- fWizardShell = window.getShell();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- run();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {
-
- }
-
- protected abstract String getTypeAttribute();
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/NewJavaEEProjectDropDownAction.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/NewJavaEEProjectDropDownAction.java
deleted file mode 100644
index 490cdaf1b..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/NewJavaEEProjectDropDownAction.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 SAP AG 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:
- * Kaloyan Raev, kaloyan.raev@sap.com - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.internal.actions;
-
-import org.eclipse.jface.action.IMenuCreator;
-import org.eclipse.ui.IWorkbenchWindowPulldownDelegate2;
-
-
-/**
- * A wizard is added to the "New Java EE Project" drop down if it has a parameter 'javaeeproject':
- * <wizard
- * name="My Java EE Project Wizard"
- * icon="icons/wiz.gif"
- * category="mycategory"
- * id="xx.MyWizard">
- * <class class="org.xx.MyWizard">
- * <parameter name="javaeeproject" value="true"/>
- * </class>
- * <description>
- * My Wizard
- * </description>
- * </wizard>
- */
-public class NewJavaEEProjectDropDownAction extends NewJavaEEDropDownAction implements IMenuCreator, IWorkbenchWindowPulldownDelegate2 {
-
- private final static String ATT_JAVAEEPROJECT = "javaeeproject";//$NON-NLS-1$
-
- @Override
- protected String getTypeAttribute() {
- return ATT_JAVAEEPROJECT;
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/OpenJ2EEResourceAction.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/OpenJ2EEResourceAction.java
deleted file mode 100644
index fff4abef4..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/OpenJ2EEResourceAction.java
+++ /dev/null
@@ -1,414 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2006 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.jst.j2ee.internal.actions;
-
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-
-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.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.internal.ui.javaeditor.EditorUtility;
-import org.eclipse.jem.java.JavaClass;
-import org.eclipse.jem.util.emf.workbench.ProjectUtilities;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.ModuleFile;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveOptions;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.util.ArchiveUtil;
-import org.eclipse.jst.j2ee.ejb.EJBJar;
-import org.eclipse.jst.j2ee.ejb.EnterpriseBean;
-import org.eclipse.jst.j2ee.ejb.componentcore.util.EJBArtifactEdit;
-import org.eclipse.jst.j2ee.internal.archive.JavaEEArchiveUtilities;
-import org.eclipse.jst.j2ee.internal.componentcore.ComponentArchiveOptions;
-import org.eclipse.jst.j2ee.internal.componentcore.JavaEEBinaryComponentHelper;
-import org.eclipse.jst.j2ee.internal.ejb.provider.J2EEJavaClassProviderHelper;
-import org.eclipse.jst.j2ee.internal.plugin.BinaryEditorUtilities;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEEditorUtility;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIMessages;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIPlugin;
-import org.eclipse.jst.j2ee.web.componentcore.util.WebArtifactEdit;
-import org.eclipse.jst.j2ee.webapplication.Servlet;
-import org.eclipse.jst.j2ee.webapplication.WebApp;
-import org.eclipse.jst.j2ee.webservice.wsdd.BeanLink;
-import org.eclipse.jst.j2ee.webservice.wsdd.EJBLink;
-import org.eclipse.jst.j2ee.webservice.wsdd.ServletLink;
-import org.eclipse.jst.jee.archive.IArchive;
-import org.eclipse.jst.jee.archive.IArchiveResource;
-import org.eclipse.jst.jee.util.internal.JavaEEQuickPeek;
-import org.eclipse.ui.IEditorDescriptor;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorRegistry;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.IDE;
-import org.eclipse.ui.part.FileEditorInput;
-import org.eclipse.ui.part.ISetSelectionTarget;
-import org.eclipse.wst.common.componentcore.internal.resources.VirtualArchiveComponent;
-import org.eclipse.wst.common.componentcore.internal.util.ComponentUtilities;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.common.internal.emfworkbench.WorkbenchResourceHelper;
-
-/**
- * Action for opening a J2EE resource from the J2EE navigator.
- */
-public class OpenJ2EEResourceAction extends AbstractOpenAction {
-
- public static final String ID = "org.eclipse.jst.j2ee.internal.internal.ui.actions.OpenJ2EEResourceAction"; //$NON-NLS-1$
- public static final String JAVA_EDITOR_ID = "org.eclipse.jst.j2ee.internal.internal.ejb.ui.java.EnterpriseBeanJavaEditor"; //$NON-NLS-1$
- public static final String BASE_JAVA_EDITOR_ID = "org.eclipse.jdt.ui.CompilationUnitEditor"; //$NON-NLS-1$
-
- protected static IEditorDescriptor javaEditorDescriptor;
- protected static IEditorDescriptor baseJavaEditorDescriptor;
-
- /**
- * Create an instance of this class
- */
- public OpenJ2EEResourceAction() {
- super("Open"); //$NON-NLS-1$
- }
-
- /**
- * Returns the action ID.
- */
- public String getID() {
- return ID;
- }
-
- public static IEditorDescriptor getJavaEditorDescriptor() {
- if (javaEditorDescriptor == null)
- javaEditorDescriptor = findEditorDescriptor(JAVA_EDITOR_ID);
- return javaEditorDescriptor;
- }
-
- public static IEditorDescriptor getBaseJavaEditorDescriptor() {
- if (baseJavaEditorDescriptor == null)
- baseJavaEditorDescriptor = findEditorDescriptor(BASE_JAVA_EDITOR_ID);
- return baseJavaEditorDescriptor;
- }
-
- protected void openAppropriateEditor(IVirtualComponent c){
- if (c == null){
- return;
- }
- IWorkbenchPage page = null;
- IEditorPart editor = null;
- try {
- page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
-
- IEditorInput editorInput = null;
-
- //[Bug 237794] if component c is a JEE 5 archive then editorInput needs to be a BinaryEditorInput
- if (c instanceof VirtualArchiveComponent) {
- JavaEEQuickPeek qp = JavaEEBinaryComponentHelper.getJavaEEQuickPeek(c);
- //[Bug 239440] because Connectors are opened with the basic XML editor and not a specialized editor they need binary editor input
- if( qp.getJavaEEVersion() == JavaEEQuickPeek.JEE_5_0_ID || qp.getType() == JavaEEQuickPeek.CONNECTOR_TYPE) {
- String path = ((EObject)srcObject).eResource().getURI().toString();
- editorInput = BinaryEditorUtilities.getBinaryEditorInput((VirtualArchiveComponent)c, path);
- }
- }
-
- //this is for all other cases
- if(editorInput == null) {
- editorInput = new ComponentEditorInput(c);
- }
-
- editor = page.openEditor(editorInput, currentDescriptor.getId());
- if (editor instanceof ISetSelectionTarget)
- ((ISetSelectionTarget) editor).selectReveal(getStructuredSelection());
- } catch (Exception e) {
- MessageDialog.openError(page.getWorkbenchWindow().getShell(), J2EEUIMessages.getResourceString("Problems_Opening_Editor_ERROR_"), e.getMessage()); //$NON-NLS-1$ = "Problems Opening Editor"
- }
- }
-
-
- /**
- * open the appropriate editor
- */
- protected void openAppropriateEditor(IResource r) {
- if (r == null)
- return;
- IWorkbenchPage page = null;
- IEditorPart editor = null;
- try {
- page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- editor = page.openEditor(new FileEditorInput((IFile) r), currentDescriptor.getId());
- if (editor instanceof ISetSelectionTarget)
- ((ISetSelectionTarget) editor).selectReveal(getStructuredSelection());
- } catch (Exception e) {
- MessageDialog.openError(page.getWorkbenchWindow().getShell(), J2EEUIMessages.getResourceString("Problems_Opening_Editor_ERROR_"), e.getMessage()); //$NON-NLS-1$ = "Problems Opening Editor"
- }
- }
-
- /**
- * The user has invoked this action
- */
- public void run() {
- if (!isEnabled())
- return;
-
- if (srcObject instanceof J2EEJavaClassProviderHelper) {
- ((J2EEJavaClassProviderHelper) srcObject).openInEditor();
- return;
- }
-
- if( isEJB3BeanObject(srcObject) ){
- String name = ""; //$NON-NLS-1$
- if( srcObject instanceof org.eclipse.jst.javaee.ejb.SessionBean ){
- org.eclipse.jst.javaee.ejb.SessionBean bean = (org.eclipse.jst.javaee.ejb.SessionBean)srcObject;
- name = bean.getEjbClass();
- }else if(srcObject instanceof org.eclipse.jst.javaee.ejb.MessageDrivenBean){
- org.eclipse.jst.javaee.ejb.MessageDrivenBean bean = (org.eclipse.jst.javaee.ejb.MessageDrivenBean)srcObject;
- name = bean.getEjbClass();
- }else if(srcObject instanceof org.eclipse.jst.javaee.ejb.EntityBean){
- org.eclipse.jst.javaee.ejb.EntityBean bean = (org.eclipse.jst.javaee.ejb.EntityBean)srcObject;
- name = bean.getEjbClass();
- }
-
- IResource resource = WorkbenchResourceHelper.getFile((EObject)srcObject);
- if(resource != null) {
- IProject project = resource.getProject();
- IJavaProject javaProject = JavaCore.create(project);
- if(javaProject.exists()){
- IType type = null;
- try {
- //if name is null then can't get type
- if(name != null) {
- type = javaProject.findType( name );
- }
-
- //if type is null then can't open its editor, so open editor for the resource
- if(type != null) {
- ICompilationUnit cu = type.getCompilationUnit();
- EditorUtility.openInEditor(cu);
- } else{
- openAppropriateEditor(resource);
- }
- } catch (JavaModelException e) {
- J2EEUIPlugin.logError(-1, e.getMessage(), e);
- } catch (PartInitException e) {
- J2EEUIPlugin.logError(-1, e.getMessage(), e);
- }
-
- }
- }
- return;
- }
-
- if (srcObject instanceof EObject) {
- EObject ro = (EObject) srcObject;
- IProject p = ProjectUtilities.getProject(ro);
-
- if (ro instanceof BeanLink) {
- openBeanLinkInJavaEditor((BeanLink) ro, p);
- return;
- }
- IResource resource = WorkbenchResourceHelper.getFile((EObject)srcObject);
- if(resource != null && resource.exists()){
- openAppropriateEditor(resource);
- } else if(ro.eResource() != null) {
- ModuleFile moduleFile = ArchiveUtil.getModuleFile(ro);
- if (moduleFile != null) {
- ArchiveOptions options = moduleFile.getOptions();
- if(options instanceof ComponentArchiveOptions) {
- IVirtualComponent component = ((ComponentArchiveOptions)options).getComponent();
- openAppropriateEditor(component);
- }
- } else {
- //if can't get a ModuleFile then get the component from the archive
- IArchive archive = JavaEEArchiveUtilities.findArchive(ro);
- if(archive != null) {
- IVirtualComponent component = JavaEEArchiveUtilities.findComponent(archive);
- if(component != null){
- openAppropriateEditor(component);
- }
- }
- }
- }
- } else if (srcObject instanceof Resource) {
- openAppropriateEditor(WorkbenchResourceHelper.getFile((Resource)srcObject));
- }
- }
-
- /**
- * The structured selection has changed in the workbench. Subclasses should override this method
- * to react to the change. Returns true if the action should be enabled for this selection, and
- * false otherwise.
- *
- * When this method is overridden, the super method must always be invoked. If the super method
- * returns false, this method must also return false.
- *
- * @param sel the new structured selection
- */
- public boolean updateSelection(IStructuredSelection s) {
- if (!super.updateSelection(s))
- return false;
-
- // Make sure this is one of the selections we can handle,
- // then set the source object as is. The run() will do the hard stuff.
- Object obj = s.getFirstElement();
-
- if (obj instanceof J2EEJavaClassProviderHelper) {
- currentDescriptor = getJavaEditorDescriptor();
- } else if (obj instanceof BeanLink) {
- currentDescriptor = getBaseJavaEditorDescriptor();
- } else if(isEJB3BeanObject(obj)) {
- //[241685] if it is a EJB 3 bean the class is specially opened by the run() method
- } else if (obj instanceof EObject) {
- IEditorRegistry registry = PlatformUI.getWorkbench().getEditorRegistry();
- IFile file = WorkbenchResourceHelper.getFile((EObject)obj);
- if(file != null) {
- if(file.exists()){
- IContentType contentType = IDE.getContentType(file);
- currentDescriptor = registry.getDefaultEditor(file.getName(), contentType);
- } else {
- currentDescriptor = null;
- return false;
- }
- } else if (((EObject)obj).eResource() != null) {
- //[Bug 237794] if the file is null then it maybe a binary resource in an archive
- // attempt to get the resource from the archive and the content type from that
- EObject eObj = (EObject) obj;
- IArchive archive = JavaEEArchiveUtilities.findArchive(eObj);
- if(archive != null) {
- IPath path = new Path(((EObject)obj).eResource().getURI().toString());
- if(archive.containsArchiveResource(path)) {
- InputStream stream = null;
- try {
- IArchiveResource resource = archive.getArchiveResource(path);
- stream = resource.getInputStream();
- IContentType type = Platform.getContentTypeManager().findContentTypeFor(stream, path.lastSegment());
- currentDescriptor = registry.getDefaultEditor(path.lastSegment(),type);
- } catch (FileNotFoundException e) {
- J2EEUIPlugin.logError(-1, e.getMessage(), e);
- } catch (IOException e) {
- J2EEUIPlugin.logError(-1, e.getMessage(), e);
- } finally {
- if(stream != null) {
- try {
- stream.close();
- } catch (IOException e) {
- J2EEUIPlugin.logError(-1, e.getMessage(), e);
- }
- }
- }
-
- }
- }
- }
- }
- else if (obj instanceof Resource) {
- IEditorRegistry registry = PlatformUI.getWorkbench().getEditorRegistry();
- IFile file = WorkbenchResourceHelper.getFile((Resource)obj);
- IContentType contentType = IDE.getContentType(file);
- currentDescriptor = registry.getDefaultEditor(file.getName(), contentType);
- }
- else {
- currentDescriptor = null;
- return false;
- }
- setAttributesFromDescriptor();
- srcObject = obj;
- return true;
- }
-
- /**
- * @param link
- */
- private void openBeanLinkInJavaEditor(BeanLink link, IProject p) {
- String linkName = null;
- JavaClass javaClass = null;
- IVirtualComponent comp = ComponentUtilities.findComponent(link);
- // Handle EJB Link case
- if (link instanceof EJBLink) {
- linkName = ((EJBLink) link).getEjbLink();
- EJBArtifactEdit artifactEdit = null;
- try {
- artifactEdit = EJBArtifactEdit.getEJBArtifactEditForRead(comp);
- EJBJar ejbJar = artifactEdit.getEJBJar();
- if (ejbJar == null)
- return;
- EnterpriseBean bean = ejbJar.getEnterpriseBeanNamed(linkName);
- if (bean == null)
- return;
- javaClass = bean.getEjbClass();
- } finally {
- if (artifactEdit!=null)
- artifactEdit.dispose();
- }
- }
- // Handle Servlet Link case
- else {
- linkName = ((ServletLink) link).getServletLink();
- WebArtifactEdit artifactEdit = null;
- try {
- artifactEdit = WebArtifactEdit.getWebArtifactEditForRead(comp);
- WebApp webApp = artifactEdit.getWebApp();
- if (webApp == null)
- return;
- Servlet servlet = webApp.getServletNamed(linkName);
- if (servlet == null)
- return;
- javaClass = servlet.getServletClass();
- } finally {
- if (artifactEdit!=null)
- artifactEdit.dispose();
- }
- }
- // Open java editor on the selected objects associated java file
- try {
- J2EEEditorUtility.openInEditor(javaClass, p);
- } catch (Exception cantOpen) {
- J2EEUIPlugin.logError(-1, cantOpen.getMessage(), cantOpen);
- }
- }
-
- protected EObject getRootObject(Object obj) {
- if (obj instanceof EObject) {
- EObject refObj = (EObject) obj;
- while (refObj != null && refObj.eContainer() != null)
- refObj = refObj.eContainer();
- return refObj;
- }
- return null;
- }
-
- /**
- * Determines if the given object is a EJB 3 Bean
- * [241685] first added
- *
- * @param obj determine weather this object is an EJB 3 bean or not
- * @return true if obj is a EJB 3 bean, false otherwise
- */
- private boolean isEJB3BeanObject(Object obj) {
- boolean isBean =
- obj instanceof org.eclipse.jst.javaee.ejb.SessionBean ||
- obj instanceof org.eclipse.jst.javaee.ejb.MessageDrivenBean ||
- obj instanceof org.eclipse.jst.javaee.ejb.EntityBean;
-
- return isBean;
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/WTPBaseAction.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/WTPBaseAction.java
deleted file mode 100644
index 5433410e9..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/WTPBaseAction.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 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
- *******************************************************************************/
-/*
- * Created on Jul 7, 2004
- *
- * TODO To change the template for this generated file go to Window - Preferences - Java - Code
- * Style - Code Templates
- */
-package org.eclipse.jst.j2ee.internal.actions;
-
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jst.j2ee.internal.plugin.ErrorDialog;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIMessages;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIPlugin;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IActionDelegate2;
-import org.eclipse.ui.IWorkbenchWindow;
-
-
-
-public abstract class WTPBaseAction extends Action implements IActionDelegate2 {
- private final static String ERROR_OCCURRED_TITLE = J2EEUIMessages.getResourceString("ERROR_OCCURRED_TITLE"); //$NON-NLS-1$
- private final static String ERROR_OCCURRED_MESSAGE = J2EEUIMessages.getResourceString("ERROR_OCCURRED_MESSAGE"); //$NON-NLS-1$
-
- protected IStructuredSelection selection = null;
-
- protected IWorkbenchWindow getWorkbenchWindow() {
- return J2EEUIPlugin.getPluginWorkbench().getActiveWorkbenchWindow();
- }
-
- public void setSelection(IStructuredSelection selection) {
- this.selection = selection;
- }
-
- public void run() {
- Shell shell = getWorkbenchWindow().getShell();
- if (null == selection) {
- ISelection autoselection = getWorkbenchWindow().getSelectionService().getSelection();
- if (autoselection instanceof IStructuredSelection)
- this.selection = (IStructuredSelection) autoselection;
- }
-
- try {
- primRun(shell);
- this.selection = null;
- } catch (Throwable t) {
- ErrorDialog.openError(shell, ERROR_OCCURRED_TITLE, ERROR_OCCURRED_MESSAGE, t, 0, false);
- }
-
- }
-
- protected abstract void primRun(Shell shell);
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IActionDelegate2#dispose()
- */
- public void dispose() {
- //dispose
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IActionDelegate2#init(org.eclipse.jface.action.IAction)
- */
- public void init(IAction action) {
- //init
- }
-
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction,
- * org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection aSelection) {
- setSelection((IStructuredSelection) aSelection);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IActionDelegate2#runWithEvent(org.eclipse.jface.action.IAction,
- * org.eclipse.swt.widgets.Event)
- */
- public void runWithEvent(IAction action, Event event) {
- run();
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- run();
- }
-
- /**
- * @return Returns the selection.
- */
- protected IStructuredSelection getSelection() {
- return selection;
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/WorkspaceModifyComposedOperation.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/WorkspaceModifyComposedOperation.java
deleted file mode 100644
index ec3fac904..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/WorkspaceModifyComposedOperation.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 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.jst.j2ee.internal.actions;
-
-import java.util.List;
-
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-
-/**
- * WARNING: This class will be deleted
- *
- * @deprecated use {@link org.eclipse.wst.common.frameworks.internal.ui.WorkspaceModifyComposedOperation}
- */
-public class WorkspaceModifyComposedOperation extends org.eclipse.wst.common.frameworks.internal.ui.WorkspaceModifyComposedOperation {
- public WorkspaceModifyComposedOperation(ISchedulingRule rule) {
- super(rule);
- }
-
- public WorkspaceModifyComposedOperation() {
- super();
- }
-
- public WorkspaceModifyComposedOperation(ISchedulingRule rule, List nestedRunnablesWithProgress) {
- super(rule, nestedRunnablesWithProgress);
- }
-
- public WorkspaceModifyComposedOperation(List nestedRunnablesWithProgress) {
- super(nestedRunnablesWithProgress);
- }
-
- public WorkspaceModifyComposedOperation(IRunnableWithProgress nestedOp) {
- super(nestedOp);
- }
-
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/classpathdep/ui/ClasspathDependencyAttributeConfiguration.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/classpathdep/ui/ClasspathDependencyAttributeConfiguration.java
deleted file mode 100644
index 3daf2e300..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/classpathdep/ui/ClasspathDependencyAttributeConfiguration.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 BEA Systems, Inc.
- * 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:
- * rfrost@bea.com - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.internal.classpathdep.ui;
-
-import java.net.URL;
-
-
-import org.eclipse.jdt.core.IClasspathAttribute;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.ui.wizards.ClasspathAttributeConfiguration;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jst.j2ee.classpathdep.IClasspathDependencyConstants;
-
-import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin;
-
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Shell;
-
-public class ClasspathDependencyAttributeConfiguration extends ClasspathAttributeConfiguration {
-
- private static ImageDescriptor descriptor = null;
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.ui.wizards.ClasspathAttributeConfiguration#canEdit(org.eclipse.jdt.ui.wizards.ClasspathAttributeConfiguration.ClasspathAttributeAccess)
- */
- public boolean canEdit(ClasspathAttributeAccess attribute) {
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.ui.wizards.ClasspathAttributeConfiguration#canRemove(org.eclipse.jdt.ui.wizards.ClasspathAttributeConfiguration.ClasspathAttributeAccess)
- */
- public boolean canRemove(ClasspathAttributeAccess attribute) {
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.ui.wizards.ClasspathAttributeConfiguration#getImageDescriptor(org.eclipse.jdt.ui.wizards.ClasspathAttributeConfiguration.ClasspathAttributeAccess)
- */
- public ImageDescriptor getImageDescriptor(ClasspathAttributeAccess attribute) {
- if (descriptor == null) {
- final URL gifImageURL = (URL) J2EEPlugin.getPlugin().getImage("CPDep"); //$NON-NLS-1$
- if (gifImageURL != null) {
- descriptor = ImageDescriptor.createFromURL(gifImageURL);
- }
- }
- return descriptor;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.ui.wizards.ClasspathAttributeConfiguration#getNameLabel(org.eclipse.jdt.ui.wizards.ClasspathAttributeConfiguration.ClasspathAttributeAccess)
- */
- public String getNameLabel(ClasspathAttributeAccess attribute) {
- return Resources.nameLabel;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.ui.wizards.ClasspathAttributeConfiguration#getValueLabel(org.eclipse.jdt.ui.wizards.ClasspathAttributeConfiguration.ClasspathAttributeAccess)
- */
- public String getValueLabel(ClasspathAttributeAccess attribute) {
- final IClasspathAttribute attrib = attribute.getClasspathAttribute();
- if (attrib != null) {
- final String value = attrib.getValue();
- if (value != null) {
- if (value.equals(IClasspathDependencyConstants.RUNTIME_MAPPING_INTO_CONTAINER)) {
- return Resources.containerMapping;
- }
- return value;
- }
- }
- return Resources.unspecified;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.ui.wizards.ClasspathAttributeConfiguration#performEdit(org.eclipse.swt.widgets.Shell, org.eclipse.jdt.ui.wizards.ClasspathAttributeConfiguration.ClasspathAttributeAccess)
- */
- public IClasspathAttribute performEdit(Shell shell,
- ClasspathAttributeAccess attribute) {
- // TODO Auto-generated method stub
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.ui.wizards.ClasspathAttributeConfiguration#performRemove(org.eclipse.jdt.ui.wizards.ClasspathAttributeConfiguration.ClasspathAttributeAccess)
- */
- public IClasspathAttribute performRemove(ClasspathAttributeAccess attribute) {
- return JavaCore.newClasspathAttribute(IClasspathDependencyConstants.CLASSPATH_COMPONENT_DEPENDENCY, null);
- }
-
- private static final class Resources extends NLS {
- public static String nameLabel;
- public static String unspecified;
- public static String containerMapping;
- static
- {
- initializeMessages( ClasspathDependencyAttributeConfiguration.class.getName(),
- Resources.class );
- }
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/classpathdep/ui/ClasspathDependencyAttributeConfiguration.properties b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/classpathdep/ui/ClasspathDependencyAttributeConfiguration.properties
deleted file mode 100644
index 3f050ff33..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/classpathdep/ui/ClasspathDependencyAttributeConfiguration.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2007 BEA Systems, Inc.
-# 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:
-# rfrost@bea.com - initial API and implementation
-###############################################################################
-nameLabel = Publish/export dependency
-unspecified = (None)
-containerMapping = Added to parent module \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/classpathdep/ui/ClasspathDependencyValidatorMarkerResolutions.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/classpathdep/ui/ClasspathDependencyValidatorMarkerResolutions.java
deleted file mode 100644
index 3d0a77886..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/classpathdep/ui/ClasspathDependencyValidatorMarkerResolutions.java
+++ /dev/null
@@ -1,187 +0,0 @@
-/******************************************************************************
- * Copyright (c) 2007 BEA Systems, Inc.
- * 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:
- * rfrost@bea.com - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jst.j2ee.internal.classpathdep.ui;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jem.util.logger.proxy.Logger;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jst.j2ee.classpathdep.UpdateClasspathAttributeUtil;
-import org.eclipse.jst.j2ee.internal.classpathdep.ClasspathDependencyValidator;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIPlugin;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.ui.IMarkerResolution;
-import org.eclipse.ui.IMarkerResolutionGenerator;
-import org.eclipse.wst.validation.internal.ConfigurationConstants;
-
-/**
- * IMarkerResolutionGenerator for classpath dependency validator problem markers.
- */
-public final class ClasspathDependencyValidatorMarkerResolutions implements IMarkerResolutionGenerator {
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IMarkerResolutionGenerator#getResolutions(org.eclipse.core.resources.IMarker)
- */
- public IMarkerResolution[] getResolutions(final IMarker marker) {
- // generate resolutions based on type of validation problem marker
- String messageId = null;
- String cpEntryPath = null;
- try {
- messageId = (String) marker.getAttribute(ConfigurationConstants.VALIDATION_MARKER_MESSAGEID);
- cpEntryPath = (String) marker.getAttribute(ConfigurationConstants.VALIDATION_MARKER_GROUP);
- } catch (CoreException ce) {
- Logger.getLogger(J2EEUIPlugin.PLUGIN_ID).logError(ce);
- return new IMarkerResolution[0];
- }
-
- if (messageId == null || cpEntryPath == null || cpEntryPath.length() == 0) {
- return new IMarkerResolution[0];
- }
-
- if (ClasspathDependencyValidator.AppClientProject.equals(messageId)) {
- // can apply to multiple cp entries so not currently supporting a quick fix...
- } else if (ClasspathDependencyValidator.DuplicateClassFolderEntry.equals(messageId)) {
- // quick fix removes the dependency
- return new IMarkerResolution[] { new UpdateClasspathDependencyAttributeResolution(cpEntryPath, false) };
- } else if (ClasspathDependencyValidator.DuplicateArchiveName.equals(messageId)) {
- // quick fix removes the dependency
- return new IMarkerResolution[] { new UpdateClasspathDependencyAttributeResolution(cpEntryPath, false) };
- } else if (ClasspathDependencyValidator.FilteredContainer.equals(messageId)) {
- // quick fix removes the dependency
- return new IMarkerResolution[] { new UpdateClasspathDependencyAttributeResolution(cpEntryPath, false) };
- } else if (ClasspathDependencyValidator.InvalidNonWebRuntimePath.equals(messageId)) {
- // quick fix removes the dependency
- return new IMarkerResolution[] { new UpdateClasspathDependencyAttributeResolution(cpEntryPath, false) };
- } else if (ClasspathDependencyValidator.InvalidWebRuntimePath.equals(messageId)) {
- // quick fix removes the dependency
- return new IMarkerResolution[] { new UpdateClasspathDependencyAttributeResolution(cpEntryPath, false) };
- } else if (ClasspathDependencyValidator.NonTaggedExportedClasses.equals(messageId)) {
- // quick fix adds the dependency
- return new IMarkerResolution[] { new UpdateClasspathDependencyAttributeResolution(cpEntryPath, true),
- new AddClasspathNonDependencyAttributeResolution(cpEntryPath)};
- } else if (ClasspathDependencyValidator.ProjectClasspathEntry.equals(messageId)) {
- // quick fix removes the dependency
- return new IMarkerResolution[] { new UpdateClasspathDependencyAttributeResolution(cpEntryPath, false) };
- } else if (ClasspathDependencyValidator.RootMappingNonEARWARRef.equals(messageId)) {
- // can apply to multiple cp entries so not currently supporting a quick fix...
- } else if (ClasspathDependencyValidator.SourceEntry.equals(messageId)) {
- // quick fix removes the dependency
- return new IMarkerResolution[] { new UpdateClasspathDependencyAttributeResolution(cpEntryPath, false) };
- }
-
- return new IMarkerResolution[0];
- }
-
- private static IClasspathEntry getClasspathEntryForMarker(final IMarker marker, final String cpEntryPath) throws CoreException {
- final IProject proj = marker.getResource().getProject();
- if (proj != null && proj.hasNature(JavaCore.NATURE_ID)) {
- final IJavaProject jProject = JavaCore.create(proj);
- if (cpEntryPath != null) {
- IClasspathEntry[] rawCp = jProject.getRawClasspath();
- for (int i = 0; i < rawCp.length; i++) {
- if (rawCp[i].getPath().toString().equals(cpEntryPath)) {
- return rawCp[i];
- }
- }
- }
- }
- return null;
- }
-
- /* Resolution that add/removes the classpath dependency attribute */
- private static final class UpdateClasspathDependencyAttributeResolution implements IMarkerResolution {
- private final boolean add;
- private final String cpEntryPath;
- public UpdateClasspathDependencyAttributeResolution(final String cpEntryPath, final boolean add) {
- this.add = add;
- this.cpEntryPath = cpEntryPath;
- }
-
- public String getLabel() {
- if (add) {
- return Resources.addClasspathDependencyAttribute;
- }
- return Resources.removeClasspathDependencyAttribute;
- }
-
- public void run(final IMarker marker) {
- final IProject proj = marker.getResource().getProject();
- try {
- final IClasspathEntry cpEntry = getClasspathEntryForMarker(marker, cpEntryPath);
- if (add) {
- UpdateClasspathAttributeUtil.addDependencyAttribute(null, proj.getName(), cpEntry);
- } else {
- UpdateClasspathAttributeUtil.removeDependencyAttribute(null, proj.getName(), cpEntry);
- }
- } catch (CoreException ce){
- ErrorDialog.openError(null, Resources.errorDialogTitle,
- Resources.errorDialogMessage,
- ce.getStatus());
- } catch (ExecutionException ee){
- ErrorDialog.openError(null, Resources.errorDialogTitle,
- Resources.errorDialogMessage,
- new Status(IStatus.ERROR, J2EEUIPlugin.PLUGIN_ID, 0, ee.getLocalizedMessage(), ee));
- }
- }
- }
-
- /* Resolution that adds the classpath nondependency attribute */
- private static final class AddClasspathNonDependencyAttributeResolution implements IMarkerResolution {
- private final String cpEntryPath;
- public AddClasspathNonDependencyAttributeResolution(final String cpEntryPath) {
- this.cpEntryPath = cpEntryPath;
- }
-
- public String getLabel() {
- return Resources.addClasspathNonDependencyAttribute;
- }
-
- public void run(final IMarker marker) {
- final IProject proj = marker.getResource().getProject();
- try {
- final IClasspathEntry cpEntry = getClasspathEntryForMarker(marker, cpEntryPath);
- UpdateClasspathAttributeUtil.addNonDependencyAttribute(null, proj.getName(), cpEntry);
- } catch (CoreException ce){
- ErrorDialog.openError(null, Resources.errorDialogTitle,
- Resources.errorDialogMessage,
- ce.getStatus());
- } catch (ExecutionException ee){
- ErrorDialog.openError(null, Resources.errorDialogTitle,
- Resources.errorDialogMessage,
- new Status(IStatus.ERROR, J2EEUIPlugin.PLUGIN_ID, 0, ee.getLocalizedMessage(), ee));
- }
- }
- }
-
- private static final class Resources extends NLS {
- public static String removeClasspathDependencyAttribute;
- public static String addClasspathDependencyAttribute;
- public static String addClasspathNonDependencyAttribute;
- public static String errorDialogTitle;
- public static String errorDialogMessage;
-
- static
- {
- initializeMessages( ClasspathDependencyValidatorMarkerResolutions.class.getName(),
- Resources.class );
- }
- }
-
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/classpathdep/ui/ClasspathDependencyValidatorMarkerResolutions.properties b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/classpathdep/ui/ClasspathDependencyValidatorMarkerResolutions.properties
deleted file mode 100644
index c21e5af92..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/classpathdep/ui/ClasspathDependencyValidatorMarkerResolutions.properties
+++ /dev/null
@@ -1,15 +0,0 @@
-###############################################################################
-# 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
-###############################################################################
-addClasspathDependencyAttribute = Mark the associated raw classpath entry as a publish/export dependency.
-addClasspathNonDependencyAttribute = Exclude the associated raw classpath entry from the set of potential publish/export dependencies.
-removeClasspathDependencyAttribute = Remove publish/export dependency on the associated raw classpath entry.
-errorDialogTitle = Error
-errorDialogMessage = Failed while applying the quick fix. \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/classpathdep/ui/ClasspathNonDependencyAttributeConfiguration.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/classpathdep/ui/ClasspathNonDependencyAttributeConfiguration.java
deleted file mode 100644
index 463feca59..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/classpathdep/ui/ClasspathNonDependencyAttributeConfiguration.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 BEA Systems, Inc.
- * 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:
- * rfrost@bea.com - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.internal.classpathdep.ui;
-
-import java.net.URL;
-
-
-import org.eclipse.jdt.core.IClasspathAttribute;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.ui.wizards.ClasspathAttributeConfiguration;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jst.j2ee.classpathdep.IClasspathDependencyConstants;
-
-import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin;
-
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Shell;
-
-public class ClasspathNonDependencyAttributeConfiguration extends ClasspathAttributeConfiguration {
-
- private static ImageDescriptor descriptor = null;
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.ui.wizards.ClasspathAttributeConfiguration#canEdit(org.eclipse.jdt.ui.wizards.ClasspathAttributeConfiguration.ClasspathAttributeAccess)
- */
- public boolean canEdit(ClasspathAttributeAccess attribute) {
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.ui.wizards.ClasspathAttributeConfiguration#canRemove(org.eclipse.jdt.ui.wizards.ClasspathAttributeConfiguration.ClasspathAttributeAccess)
- */
- public boolean canRemove(ClasspathAttributeAccess attribute) {
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.ui.wizards.ClasspathAttributeConfiguration#getImageDescriptor(org.eclipse.jdt.ui.wizards.ClasspathAttributeConfiguration.ClasspathAttributeAccess)
- */
- public ImageDescriptor getImageDescriptor(ClasspathAttributeAccess attribute) {
- if (descriptor == null) {
- final URL gifImageURL = (URL) J2EEPlugin.getPlugin().getImage("CPDep"); //$NON-NLS-1$
- if (gifImageURL != null) {
- descriptor = ImageDescriptor.createFromURL(gifImageURL);
- }
- }
- return descriptor;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.ui.wizards.ClasspathAttributeConfiguration#getNameLabel(org.eclipse.jdt.ui.wizards.ClasspathAttributeConfiguration.ClasspathAttributeAccess)
- */
- public String getNameLabel(ClasspathAttributeAccess attribute) {
- return Resources.nameLabel;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.ui.wizards.ClasspathAttributeConfiguration#getValueLabel(org.eclipse.jdt.ui.wizards.ClasspathAttributeConfiguration.ClasspathAttributeAccess)
- */
- public String getValueLabel(ClasspathAttributeAccess attribute) {
- return Resources.unspecified;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.ui.wizards.ClasspathAttributeConfiguration#performEdit(org.eclipse.swt.widgets.Shell, org.eclipse.jdt.ui.wizards.ClasspathAttributeConfiguration.ClasspathAttributeAccess)
- */
- public IClasspathAttribute performEdit(Shell shell,
- ClasspathAttributeAccess attribute) {
- // TODO Auto-generated method stub
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.ui.wizards.ClasspathAttributeConfiguration#performRemove(org.eclipse.jdt.ui.wizards.ClasspathAttributeConfiguration.ClasspathAttributeAccess)
- */
- public IClasspathAttribute performRemove(ClasspathAttributeAccess attribute) {
- return JavaCore.newClasspathAttribute(IClasspathDependencyConstants.CLASSPATH_COMPONENT_NON_DEPENDENCY, null);
- }
-
- private static final class Resources extends NLS {
- public static String nameLabel;
- public static String unspecified;
- static
- {
- initializeMessages( ClasspathNonDependencyAttributeConfiguration.class.getName(),
- Resources.class );
- }
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/classpathdep/ui/ClasspathNonDependencyAttributeConfiguration.properties b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/classpathdep/ui/ClasspathNonDependencyAttributeConfiguration.properties
deleted file mode 100644
index 5234408ef..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/classpathdep/ui/ClasspathNonDependencyAttributeConfiguration.properties
+++ /dev/null
@@ -1,12 +0,0 @@
-###############################################################################
-# Copyright (c) 2007 BEA Systems, Inc.
-# 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:
-# rfrost@bea.com - initial API and implementation
-###############################################################################
-nameLabel = Excluded from publish/export structure
-unspecified = (None) \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/client/actions/AppClientArchiveUIResourceHandler.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/client/actions/AppClientArchiveUIResourceHandler.java
deleted file mode 100644
index f610fcf6b..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/client/actions/AppClientArchiveUIResourceHandler.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2003, 2004 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.jst.j2ee.internal.client.actions;
-
-
-
-import java.text.MessageFormat;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-public class AppClientArchiveUIResourceHandler {
-
- private static ResourceBundle fgResourceBundle;
-
- /**
- * Returns the resource bundle used by all classes in this Project
- */
- public static ResourceBundle getResourceBundle() {
- try {
- return ResourceBundle.getBundle("appclientarchiveui");//$NON-NLS-1$
- } catch (MissingResourceException e) {
- // does nothing - this method will return null and
- // getString(String, String) will return the key
- // it was called with
- }
- return null;
- }
-
- public static String getString(String key) {
- if (fgResourceBundle == null) {
- fgResourceBundle = getResourceBundle();
- }
-
- if (fgResourceBundle != null) {
- try {
- return fgResourceBundle.getString(key);
- } catch (MissingResourceException e) {
- return "!" + key + "!";//$NON-NLS-2$//$NON-NLS-1$
- }
- }
- return "!" + key + "!";//$NON-NLS-2$//$NON-NLS-1$
- }
-
- public static String getString(String key, Object[] args) {
-
- try {
- return MessageFormat.format(getString(key), args);
- } catch (IllegalArgumentException e) {
- return getString(key);
- }
-
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/client/actions/ExportApplicationClientAction.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/client/actions/ExportApplicationClientAction.java
deleted file mode 100644
index 296fd5543..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/client/actions/ExportApplicationClientAction.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 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
- *******************************************************************************/
-/*
- * Created on Mar 27, 2003
- *
- * To change this generated comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-package org.eclipse.jst.j2ee.internal.client.actions;
-
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.jst.j2ee.internal.actions.BaseAction;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIPlugin;
-import org.eclipse.jst.j2ee.internal.wizard.AppClientComponentExportWizard;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * @author jsholl
- *
- * To change this generated comment go to Window>Preferences>Java>Code Generation>Code and Comments
- */
-public class ExportApplicationClientAction extends BaseAction {
- public static String LABEL = J2EEUIPlugin.getDefault().getDescriptor().getResourceString("%client.export.action.label_ui_"); //$NON-NLS-1$
- private static final String ICON = "appclient_export_wiz"; //$NON-NLS-1$
-
- public ExportApplicationClientAction() {
- super();
- setText(LABEL);
- setImageDescriptor(J2EEUIPlugin.getDefault().getImageDescriptor(ICON));
- }
-
- protected void primRun(Shell shell) {
- AppClientComponentExportWizard wizard = new AppClientComponentExportWizard();
- J2EEUIPlugin plugin = J2EEUIPlugin.getDefault();
- wizard.init(plugin.getWorkbench(), selection);
-
- WizardDialog dialog = new WizardDialog(shell, wizard);
- dialog.create();
- dialog.open();
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/client/actions/ImportApplicationClientAction.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/client/actions/ImportApplicationClientAction.java
deleted file mode 100644
index eec615500..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/client/actions/ImportApplicationClientAction.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 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
- *******************************************************************************/
-/*
- * Created on Mar 27, 2003
- *
- * To change this generated comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-package org.eclipse.jst.j2ee.internal.client.actions;
-
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.jst.j2ee.internal.actions.BaseAction;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIPlugin;
-import org.eclipse.jst.j2ee.internal.wizard.AppClientComponentImportWizard;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * @author jsholl
- *
- * To change this generated comment go to Window>Preferences>Java>Code Generation>Code and Comments
- */
-public class ImportApplicationClientAction extends BaseAction {
-
- public static String LABEL = AppClientArchiveUIResourceHandler.getString("Application_Client_Import_UI_"); //$NON-NLS-1$
- private static final String ICON = "appclient_import_wiz"; //$NON-NLS-1$
-
- public ImportApplicationClientAction() {
- super();
- setText(LABEL);
- setImageDescriptor(J2EEUIPlugin.getDefault().getImageDescriptor(ICON));
- }
-
- protected void primRun(Shell shell) {
-
- AppClientComponentImportWizard wizard = new AppClientComponentImportWizard();
-
- J2EEUIPlugin plugin = J2EEUIPlugin.getDefault();
-
- wizard.init(plugin.getWorkbench(), StructuredSelection.EMPTY);
-
- WizardDialog dialog = new WizardDialog(shell, wizard);
- dialog.create();
- dialog.open();
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/command/AbstractOverrideCommand.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/command/AbstractOverrideCommand.java
deleted file mode 100644
index 42564f6ca..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/command/AbstractOverrideCommand.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 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.jst.j2ee.internal.command;
-
-
-import java.util.Collection;
-
-import org.eclipse.emf.common.command.AbstractCommand;
-import org.eclipse.emf.edit.command.AbstractOverrideableCommand;
-import org.eclipse.emf.edit.domain.EditingDomain;
-
-/**
- * Insert the type's description here. Creation date: (06/07/01 10:56:08 AM)
- *
- * @author: Administrator
- */
-public abstract class AbstractOverrideCommand extends AbstractCommand {
- private AbstractOverrideableCommand overridable;
- private J2EEClipboard j2eeClipboard;
-
- /**
- * AbstractOverrideCommand constructor comment.
- */
- protected AbstractOverrideCommand() {
- super();
- }
-
- public AbstractOverrideCommand(AbstractOverrideableCommand command) {
- super(command.getLabel(), command.getDescription());
- setOverridable(command);
- }
-
- public boolean canExecute() {
- return super.canExecute() && overridable.doCanExecute();
- }
-
- public boolean canUndo() {
- return overridable.doCanUndo();
- }
-
- public Collection getAffectedObjects() {
- return overridable.doGetAffectedObjects();
- }
-
- public EditingDomain getDomain() {
- return getOverridable().getDomain();
- }
-
- /**
- * Insert the method's description here. Creation date: (06/07/01 11:19:27 AM)
- *
- * @return org.eclipse.jst.j2ee.internal.internal.internal.command.J2EEClipboard
- */
- public J2EEClipboard getJ2eeClipboard() {
- return j2eeClipboard;
- }
-
- /**
- * Insert the method's description here. Creation date: (06/07/01 10:58:33 AM)
- *
- * @return AbstractOverrideableCommand
- */
- public AbstractOverrideableCommand getOverridable() {
- return overridable;
- }
-
- public Collection getResult() {
- return getJ2eeClipboard();
- }
-
- /**
- * Insert the method's description here. Creation date: (06/07/01 11:19:27 AM)
- *
- * @param newJ2eeClipboard
- * org.eclipse.jst.j2ee.internal.internal.internal.command.J2EEClipboard
- */
- protected void setJ2eeClipboard(J2EEClipboard newJ2eeClipboard) {
- j2eeClipboard = newJ2eeClipboard;
- }
-
- /**
- * Insert the method's description here. Creation date: (06/07/01 10:58:33 AM)
- *
- * @param AbstractOverrideableCommand
- */
- protected void setOverridable(AbstractOverrideableCommand newOverridable) {
- overridable = newOverridable;
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/command/J2EEClipboard.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/command/J2EEClipboard.java
deleted file mode 100644
index 4e4ab253f..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/command/J2EEClipboard.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 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.jst.j2ee.internal.command;
-
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.emf.ecore.EObject;
-
-public class J2EEClipboard extends ArrayList {
- /**
- * Warning cleanup 12/07/2005
- */
- private static final long serialVersionUID = 8713021573099134096L;
- private Map bindings;
- private Map extensions;
-
- /**
- * J2EEClipboard constructor comment.
- */
- public J2EEClipboard(Collection defaultClipboard) {
- super(defaultClipboard);
- }
-
- public boolean addAll(Collection c) {
- boolean result = super.addAll(c);
- if (result && (c instanceof J2EEClipboard))
- addAllExtra((J2EEClipboard) c);
- return result;
- }
-
- protected void addAllExtra(J2EEClipboard c) {
- getBindings().putAll(c.getBindings());
- getExtensions().putAll(c.getExtensions());
- }
-
- protected void addBinding(EObject boundObject, EObject binding) {
- getBindings().put(boundObject, binding);
- }
-
- protected void addExtension(EObject extendedObject, EObject extension) {
- getExtensions().put(extendedObject, extension);
- }
-
- public EObject getBinding(EObject o) {
- return (EObject) getBindings().get(o);
- }
-
- protected Map getBindings() {
- if (bindings == null)
- bindings = new HashMap(10);
- return bindings;
- }
-
- public EObject getExtension(EObject o) {
- return (EObject) getExtensions().get(o);
- }
-
- protected Map getExtensions() {
- if (extensions == null)
- extensions = new HashMap(10);
- return extensions;
- }
-
- public boolean hasBindings() {
- return bindings != null && !bindings.isEmpty();
- }
-
- public boolean hasExtensions() {
- return extensions != null && !extensions.isEmpty();
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/command/J2EECompoundCommand.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/command/J2EECompoundCommand.java
deleted file mode 100644
index bf103abeb..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/command/J2EECompoundCommand.java
+++ /dev/null
@@ -1,191 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 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.jst.j2ee.internal.command;
-
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.emf.common.command.CompoundCommand;
-
-/**
- * Insert the type's description here. Creation date: (06/13/01 10:27:16 AM)
- *
- * @author: Administrator
- */
-public class J2EECompoundCommand extends CompoundCommand {
- /**
- * J2EECompoundCommand constructor comment.
- */
- public J2EECompoundCommand() {
- super();
- }
-
- /**
- * J2EECompoundCommand constructor comment.
- *
- * @param resultIndex
- * int
- */
- public J2EECompoundCommand(int resultIndex) {
- super(resultIndex);
- }
-
- /**
- * J2EECompoundCommand constructor comment.
- *
- * @param resultIndex
- * int
- * @param label
- * java.lang.String
- */
- public J2EECompoundCommand(int resultIndex, String label) {
- super(resultIndex, label);
- }
-
- /**
- * J2EECompoundCommand constructor comment.
- *
- * @param resultIndex
- * int
- * @param label
- * java.lang.String
- * @param description
- * java.lang.String
- */
- public J2EECompoundCommand(int resultIndex, String label, String description) {
- super(resultIndex, label, description);
- }
-
- /**
- * J2EECompoundCommand constructor comment.
- *
- * @param resultIndex
- * int
- * @param label
- * java.lang.String
- * @param description
- * java.lang.String
- * @param commandList
- * java.util.List
- */
- public J2EECompoundCommand(int resultIndex, String label, String description, java.util.List commandList) {
- super(resultIndex, label, description, commandList);
- }
-
- /**
- * J2EECompoundCommand constructor comment.
- *
- * @param resultIndex
- * int
- * @param label
- * java.lang.String
- * @param commandList
- * java.util.List
- */
- public J2EECompoundCommand(int resultIndex, String label, java.util.List commandList) {
- super(resultIndex, label, commandList);
- }
-
- /**
- * J2EECompoundCommand constructor comment.
- *
- * @param resultIndex
- * int
- * @param commandList
- * java.util.List
- */
- public J2EECompoundCommand(int resultIndex, java.util.List commandList) {
- super(resultIndex, commandList);
- }
-
- /**
- * J2EECompoundCommand constructor comment.
- *
- * @param label
- * java.lang.String
- */
- public J2EECompoundCommand(String label) {
- super(label);
- }
-
- /**
- * J2EECompoundCommand constructor comment.
- *
- * @param label
- * java.lang.String
- * @param description
- * java.lang.String
- */
- public J2EECompoundCommand(String label, String description) {
- super(label, description);
- }
-
- /**
- * J2EECompoundCommand constructor comment.
- *
- * @param label
- * java.lang.String
- * @param description
- * java.lang.String
- * @param commandList
- * java.util.List
- */
- public J2EECompoundCommand(String label, String description, java.util.List commandList) {
- super(label, description, commandList);
- }
-
- /**
- * J2EECompoundCommand constructor comment.
- *
- * @param label
- * java.lang.String
- * @param commandList
- * java.util.List
- */
- public J2EECompoundCommand(String label, java.util.List commandList) {
- super(label, commandList);
- }
-
- /**
- * J2EECompoundCommand constructor comment.
- *
- * @param commandList
- * java.util.List
- */
- public J2EECompoundCommand(java.util.List commandList) {
- super(commandList);
- }
-
- protected Collection getMergedAffectedObjectsCollection() {
- J2EEClipboard result = new J2EEClipboard(new ArrayList());
-
- for (Iterator commands = commandList.iterator(); commands.hasNext();) {
- Command command = (Command) commands.next();
- result.addAll(command.getAffectedObjects());
- }
-
- return result;
- }
-
- protected Collection getMergedResultCollection() {
- J2EEClipboard result = new J2EEClipboard(new ArrayList());
-
- for (Iterator commands = commandList.iterator(); commands.hasNext();) {
- Command command = (Command) commands.next();
- result.addAll(command.getResult());
- }
-
- return result;
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/command/J2EECopyCommand.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/command/J2EECopyCommand.java
deleted file mode 100644
index 51dc0bdc3..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/command/J2EECopyCommand.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 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.jst.j2ee.internal.command;
-
-
-import java.util.Collection;
-import java.util.Collections;
-
-import org.eclipse.emf.common.command.AbstractCommand;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.wst.common.internal.emf.utilities.CopyGroup;
-import org.eclipse.wst.common.internal.emf.utilities.EtoolsCopyUtility;
-
-
-public class J2EECopyCommand extends AbstractCommand {
- protected EObject objectToCopy;
- protected EObject bindingToCopy;
- protected EObject extensionToCopy;
- protected J2EEClipboard result;
- protected EtoolsCopyUtility copyUtil;
-
- public J2EECopyCommand(EObject object, EObject binding, EObject extension, EtoolsCopyUtility copyUtility) {
- objectToCopy = object;
- bindingToCopy = binding;
- extensionToCopy = extension;
- copyUtil = copyUtility;
- }
-
- /**
- * This will perform the command activity required for the effect. The effect of calling execute
- * when canExecute returns false, or when canExecute hasn't been called, is undefined.
- */
- public void execute() {
- CopyGroup group = new CopyGroup();
-
- group.add(objectToCopy);
-
- if (bindingToCopy != null)
- group.add(bindingToCopy);
- if (extensionToCopy != null)
- group.add(extensionToCopy);
- copyUtil.copy(group);
- EObject copy = copyUtil.getCopy(objectToCopy);
- result = new J2EEClipboard(Collections.singleton(copy));
-
- if (bindingToCopy != null)
- result.addBinding(copy, copyUtil.getCopy(bindingToCopy));
- if (extensionToCopy != null)
- result.addExtension(copy, copyUtil.getCopy(extensionToCopy));
- }
-
- public Collection getAffectedObjects() {
- return result;
- }
-
- public Collection getResult() {
- return result;
- }
-
- protected boolean prepare() {
- return true;
- }
-
- /**
- * This will again perform the command activity required to redo the effect after undoing the
- * effect. The effect, if any, of calling redo before undo is called is undefined. Note that if
- * you implement redo to call execute then any derived class will be restricted to by that
- * decision also.
- */
- public void redo() {
- //redo
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/command/J2EECopyFromClipboardCommand.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/command/J2EECopyFromClipboardCommand.java
deleted file mode 100644
index 5581decf7..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/command/J2EECopyFromClipboardCommand.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 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.jst.j2ee.internal.command;
-
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import org.eclipse.emf.common.command.AbstractCommand;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jst.j2ee.internal.provider.J2EEUIEditingDomain;
-import org.eclipse.wst.common.internal.emf.utilities.CopyGroup;
-import org.eclipse.wst.common.internal.emf.utilities.EtoolsCopyUtility;
-
-
-/**
- * Insert the type's description here. Creation date: (06/11/01 8:45:21 AM)
- *
- * @author: Administrator
- */
-public class J2EECopyFromClipboardCommand extends AbstractCommand {
- private J2EEUIEditingDomain domain;
- private J2EEClipboard result;
- private EtoolsCopyUtility copyUtil;
-
- public J2EECopyFromClipboardCommand(J2EEUIEditingDomain editingDomain) {
- domain = editingDomain;
-
- }
-
- /**
- * This will perform the command activity required for the effect. The effect of calling execute
- * when canExecute returns false, or when canExecute hasn't been called, is undefined.
- */
- public void execute() {
- if (copyUtil != null)
- return;
- copyUtil = new EtoolsCopyUtility();
- J2EEClipboard clipboard = domain.getJ2EEClipboard();
- result = new J2EEClipboard(new ArrayList(0));
- for (int i = 0; i < clipboard.size(); i++) {
- CopyGroup group = new CopyGroup();
- EObject o = (EObject) clipboard.get(i);
- group.add(o);
- EObject bnd = clipboard.getBinding(o);
- if (bnd != null)
- group.add(bnd);
- EObject ext = clipboard.getExtension(o);
- if (ext != null)
- group.add(ext);
- copyUtil.copy(group);
- EObject copy = copyUtil.getCopy(o);
- result.add(copy);
- if (bnd != null)
- result.addBinding(copy, copyUtil.getCopy(bnd));
- if (ext != null)
- result.addExtension(copy, copyUtil.getCopy(ext));
- }
- //Reset the util so redo will actuall redo
- copyUtil = null;
- }
-
- public Collection getAffectedObjects() {
- return result;
- }
-
- public Collection getResult() {
- return result;
- }
-
- protected boolean prepare() {
- return true;
- }
-
- /**
- * This will again perform the command activity required to redo the effect after undoing the
- * effect. The effect, if any, of calling redo before undo is called is undefined. Note that if
- * you implement redo to call execute then any derived class will be restricted to by that
- * decision also.
- */
- public void redo() {
- execute();
- }
-
- public void undo() {
- result = null;
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/command/J2EECopyToClipboardOverrideCommand.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/command/J2EECopyToClipboardOverrideCommand.java
deleted file mode 100644
index eb42b83f8..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/command/J2EECopyToClipboardOverrideCommand.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 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.jst.j2ee.internal.command;
-
-
-import java.util.Iterator;
-
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.emf.common.command.CompoundCommand;
-import org.eclipse.emf.common.command.UnexecutableCommand;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.edit.command.CopyToClipboardCommand;
-import org.eclipse.wst.common.internal.emf.utilities.EtoolsCopyUtility;
-
-
-public class J2EECopyToClipboardOverrideCommand extends CopyToClipboardCommand {
- //The collection of source objects, with bindings and extensions, if any exist
- protected J2EEClipboard extendedSourceObjects;
- protected boolean onlyRefObjects = true;
-
- public J2EECopyToClipboardOverrideCommand(CopyToClipboardCommand cmd) {
- super(cmd.getDomain(), cmd.getSourceObjects());
- }
-
- protected Command createCopyCommand() {
- CompoundCommand cmd = new J2EECompoundCommand(CompoundCommand.MERGE_COMMAND_ALL);
- Iterator it = extendedSourceObjects.iterator();
- EtoolsCopyUtility copyUtil = new EtoolsCopyUtility();
- while (it.hasNext()) {
- Object o = it.next();
- if (!(o instanceof EObject)) {
- cmd.append(UnexecutableCommand.INSTANCE);
- } else {
- EObject r = (EObject) o;
- cmd.append(new J2EECopyCommand(r, extendedSourceObjects.getBinding(r), extendedSourceObjects.getExtension(r), copyUtil));
- }
- }
- return cmd.unwrap();
- }
-
- protected boolean prepare() {
- prepareSourceObjects();
- if (!onlyRefObjects) {
- copyCommand = UnexecutableCommand.INSTANCE;
- return copyCommand.canExecute();
- }
-
- if (!extendedSourceObjects.hasBindings() && !extendedSourceObjects.hasExtensions())
- return super.prepare();
-
- copyCommand = createCopyCommand();
- return copyCommand.canExecute();
- }
-
- protected void prepareSourceObjects() {
- extendedSourceObjects = new J2EEClipboard(getSourceObjects());
- Iterator it = getSourceObjects().iterator();
- while (it.hasNext()) {
- Object o = it.next();
- if (o instanceof EObject) {
- // EObject r = (EObject) o;
- // TODO switch to adaptable commands
- // EObject bnd = BindingAndExtensionHelper.getBinding(r);
- // EObject ext = BindingAndExtensionHelper.getExtension(r);
- // if (bnd != null)
- // extendedSourceObjects.addBinding(r, bnd);
- // if (ext != null)
- // extendedSourceObjects.addExtension(r, ext);
- } else {
- //Right now we can only handle ref objects in the tree
- onlyRefObjects = false;
- return;
- }
- }
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/command/J2EEPasteFromClipboardOverrideCommand.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/command/J2EEPasteFromClipboardOverrideCommand.java
deleted file mode 100644
index d51a6d5d0..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/command/J2EEPasteFromClipboardOverrideCommand.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 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.jst.j2ee.internal.command;
-
-
-import java.util.Collection;
-
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.emf.common.command.CommandWrapper;
-import org.eclipse.emf.common.command.StrictCompoundCommand;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.edit.command.AddCommand;
-import org.eclipse.emf.edit.command.PasteFromClipboardCommand;
-import org.eclipse.jst.j2ee.common.internal.util.IDUtility;
-import org.eclipse.jst.j2ee.internal.provider.J2EEUIEditingDomain;
-
-
-public class J2EEPasteFromClipboardOverrideCommand extends PasteFromClipboardCommand {
- private J2EECopyFromClipboardCommand copyCommand;
- private Command addBindingsCommand;
- private Command addExtensionsCommand;
-
- public J2EEPasteFromClipboardOverrideCommand(PasteFromClipboardCommand p) {
- super(p.getDomain(), p.getOwner(), p.getFeature(), p.getIndex(), false);
- }
-
- public void doExecute() {
- super.doExecute();
- executeAddBindings();
- executeAddExtensions();
- J2EEClipboard result = (J2EEClipboard) doGetResult();
- for (int i = 0; i < result.size(); i++) {
- EObject o = (EObject) result.get(i);
- if (result.getBinding(o) != null || result.getExtension(o) != null)
- IDUtility.setDefaultID(o, true);
- }
- }
-
- public Collection doGetAffectedObjects() {
- return copyCommand.getAffectedObjects();
- }
-
- public Collection doGetResult() {
- return copyCommand.getResult();
- }
-
- public void doRedo() {
- super.doRedo();
- if (addBindingsCommand != null)
- addBindingsCommand.redo();
- if (addExtensionsCommand != null)
- addExtensionsCommand.redo();
- }
-
- public void doUndo() {
- super.doUndo();
- if (addBindingsCommand != null)
- addBindingsCommand.undo();
- if (addExtensionsCommand != null)
- addExtensionsCommand.undo();
- }
-
- protected void executeAddBindings() {
- if (addBindingsCommand != null && addBindingsCommand.canExecute())
- addBindingsCommand.execute();
- }
-
- protected void executeAddExtensions() {
- if (addExtensionsCommand != null && addExtensionsCommand.canExecute())
- addExtensionsCommand.execute();
- }
-
- public J2EEClipboard getCopiedClipoard() {
- return (J2EEClipboard) copyCommand.getResult();
- }
-
- protected J2EEClipboard getJ2EEClipboard() {
- return (J2EEClipboard) domain.getClipboard();
- }
-
- protected boolean prepare() {
- if (getJ2EEClipboard() == null)
- return false;
- command = new StrictCompoundCommand();
-
- copyCommand = new J2EECopyFromClipboardCommand((J2EEUIEditingDomain) domain);
- command.append(copyCommand);
-
- command.append(new CommandWrapper() {
- protected Command createCommand() {
- Command addCommand = AddCommand.create(getDomain(), getOwner(), getFeature(), copyCommand.getResult(), getIndex());
- return addCommand;
- }
- });
- prepareBindingCommand(copyCommand);
- prepareExtensionCommand(copyCommand);
-
- boolean result;
- if (optimize) {
- // This will determine canExecute as efficiently as possible.
- //
- result = optimizedCanExecute();
- } else {
- // This will actually execute the copy command in order to check if the add can execute.
- //
- result = command.canExecute();
- }
-
- return result;
- }
-
- protected void prepareBindingCommand(final J2EECopyFromClipboardCommand cmd) {
- if (!getJ2EEClipboard().hasBindings())
- return;
- //TODO make adaptable command
- // addBindingsCommand = new CommandWrapper() {
- // protected Command createCommand() {
- // Object bindingOwner = BindingAndExtensionHelper.getBindingAddOwner((EObject)getOwner());
- // Collection bindingsCopies = getCopiedClipoard().getBindings().values();
- // Command addCommand = AddCommand.create(getDomain(), bindingOwner, null, bindingsCopies,
- // CommandParameter.NO_INDEX);
- // return addCommand;
- // }
- // };
- }
-
- protected void prepareExtensionCommand(final J2EECopyFromClipboardCommand cmd) {
- if (!getJ2EEClipboard().hasExtensions())
- return;
- // TODO make adaptable command
- // addExtensionsCommand = new CommandWrapper() {
- // protected Command createCommand() {
- // Object extensionOwner =
- // BindingAndExtensionHelper.getExtensionAddOwner((EObject)getOwner());
- // Collection extensionsCopies = getCopiedClipoard().getExtensions().values();
- // Command addCommand = AddCommand.create(getDomain(), extensionOwner, null,
- // extensionsCopies, CommandParameter.NO_INDEX);
- // return addCommand;
- // }
- // };
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/command/J2EERemoveOverrideCommand.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/command/J2EERemoveOverrideCommand.java
deleted file mode 100644
index ab6103904..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/command/J2EERemoveOverrideCommand.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 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.jst.j2ee.internal.command;
-
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.edit.command.RemoveCommand;
-
-/**
- * Insert the type's description here. Creation date: (06/07/01 10:44:02 AM)
- *
- * @author: Administrator
- */
-public class J2EERemoveOverrideCommand extends AbstractOverrideCommand {
- private RemoveCommand bindingsRemoveCommand;
- private RemoveCommand extensionsRemoveCommand;
- private ResourceSet resourceSet;
-
- /**
- * J2EERemoveOverrideCommand constructor comment.
- */
- protected J2EERemoveOverrideCommand() {
- super();
- }
-
- public J2EERemoveOverrideCommand(RemoveCommand command) {
- super(command);
- }
-
- protected RemoveCommand createRemoveCommand(Collection elements) {
- return (RemoveCommand) RemoveCommand.create(getDomain(), elements);
- }
-
- /**
- * This will perform the command activity required for the effect. The effect of calling execute
- * when canExecute returns false, or when canExecute hasn't been called, is undefined.
- */
- public void execute() {
- /*
- * For each object being removed, check if it has a binding, and an extension Make
- * collections of these, make a command parameter for each collection, an instantiate a
- * remove command
- */
-
- Collection objects = getRemoveCommand().getCollection();
- List bindings = new ArrayList(objects.size());
- List extensions = new ArrayList(objects.size());
- Iterator it = objects.iterator();
- while (it.hasNext()) {
- EObject o = (EObject) it.next();
- if (resourceSet == null)
- resourceSet = o.eResource().getResourceSet();
- // TODO make command adaptable
- // EObject binding = BindingAndExtensionHelper.getBinding(o);
- // if (binding != null) {
- // bindings.add(binding);
- // getJ2eeClipboard().addBinding(o, binding);
- // }
- // EObject extension = BindingAndExtensionHelper.getExtension(o);
- // if (extension != null) {
- // extensions.add(extension);
- // getJ2eeClipboard().addExtension(o, extension);
- // }
- }
- if (!bindings.isEmpty())
- setBindingsRemoveCommand(createRemoveCommand(bindings));
-
- if (!extensions.isEmpty())
- setExtensionsRemoveCommand(createRemoveCommand(extensions));
-
- executeAllChildren();
- }
-
- protected void executeAllChildren() {
- executeNested(bindingsRemoveCommand);
- executeNested(extensionsRemoveCommand);
- getOverridable().doExecute();
- }
-
- protected void executeNested(RemoveCommand cmd) {
- if (cmd != null && cmd.doCanExecute()) {
- cmd.doExecute();
- // Collection result = cmd.getResult();
- //TODO
- // BindingAndExtensionHelper.resolveAllProxies(result, resourceSet);
- }
- }
-
- /**
- * Insert the method's description here. Creation date: (06/07/01 1:32:44 PM)
- *
- * @return RemoveCommand
- */
- protected RemoveCommand getBindingsRemoveCommand() {
- return bindingsRemoveCommand;
- }
-
- /**
- * Insert the method's description here. Creation date: (06/07/01 1:32:44 PM)
- *
- * @return RemoveCommand
- */
- protected RemoveCommand getExtensionsRemoveCommand() {
- return extensionsRemoveCommand;
- }
-
- public RemoveCommand getRemoveCommand() {
- return (RemoveCommand) getOverridable();
- }
-
- protected boolean prepare() {
- setJ2eeClipboard(new J2EEClipboard(getRemoveCommand().getCollection()));
- return true;
- }
-
- /**
- * This will again perform the command activity required to redo the effect after undoing the
- * effect. The effect, if any, of calling redo before undo is called is undefined. Note that if
- * you implement redo to call execute then any derived class will be restricted to by that
- * decision also.
- */
- public void redo() {
- executeAllChildren();
- }
-
- /**
- * Insert the method's description here. Creation date: (06/07/01 1:32:44 PM)
- *
- * @param newBindingsRemoveCommand
- * RemoveCommand
- */
- protected void setBindingsRemoveCommand(RemoveCommand newBindingsRemoveCommand) {
- bindingsRemoveCommand = newBindingsRemoveCommand;
- }
-
- /**
- * Insert the method's description here. Creation date: (06/07/01 1:32:44 PM)
- *
- * @param newExtensionsRemoveCommand
- * RemoveCommand
- */
- protected void setExtensionsRemoveCommand(RemoveCommand newExtensionsRemoveCommand) {
- extensionsRemoveCommand = newExtensionsRemoveCommand;
- }
-
- public void undo() {
- getRemoveCommand().doUndo();
- undoNested(bindingsRemoveCommand);
- undoNested(extensionsRemoveCommand);
- }
-
- protected void undoNested(RemoveCommand cmd) {
- if (cmd != null && cmd.doCanUndo())
- cmd.doUndo();
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/command/J2EEStrictCompoundCommand.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/command/J2EEStrictCompoundCommand.java
deleted file mode 100644
index e0df82ab7..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/command/J2EEStrictCompoundCommand.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 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.jst.j2ee.internal.command;
-
-import org.eclipse.emf.common.command.StrictCompoundCommand;
-
-
-
-/**
- * Overridden to provide an accessor to the pessimistic field. This is needed for the case of
- * undo/redo paste. We need the nested copy commmand in the paste command to redo itself when the
- * paste command is copied, otherwise we run into sed exception.
- */
-public class J2EEStrictCompoundCommand extends StrictCompoundCommand {
- /**
- * J2EEStrictCompoundCommand constructor comment.
- */
- public J2EEStrictCompoundCommand() {
- super();
- }
-
- /**
- * J2EEStrictCompoundCommand constructor comment.
- *
- * @param label
- * java.lang.String
- */
- public J2EEStrictCompoundCommand(String label) {
- super(label);
- }
-
- /**
- * J2EEStrictCompoundCommand constructor comment.
- *
- * @param label
- * java.lang.String
- * @param description
- * java.lang.String
- */
- public J2EEStrictCompoundCommand(String label, String description) {
- super(label, description);
- }
-
- /**
- * J2EEStrictCompoundCommand constructor comment.
- *
- * @param label
- * java.lang.String
- * @param description
- * java.lang.String
- * @param commandList
- * java.util.List
- */
- public J2EEStrictCompoundCommand(String label, String description, java.util.List commandList) {
- super(label, description, commandList);
- }
-
- /**
- * J2EEStrictCompoundCommand constructor comment.
- *
- * @param label
- * java.lang.String
- * @param commandList
- * java.util.List
- */
- public J2EEStrictCompoundCommand(String label, java.util.List commandList) {
- super(label, commandList);
- }
-
- /**
- * J2EEStrictCompoundCommand constructor comment.
- *
- * @param commandList
- * java.util.List
- */
- public J2EEStrictCompoundCommand(java.util.List commandList) {
- super(commandList);
- }
-
- /**
- * J2EEStrictCompoundCommand constructor comment.
- */
- public J2EEStrictCompoundCommand(boolean pessimistic) {
- super();
- setIsPessismistic(pessimistic);
- }
-
- public void setIsPessismistic(boolean aBool) {
- isPessimistic = aBool;
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/deployables/EnterpriseDeployableArtifactAdapterFactory.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/deployables/EnterpriseDeployableArtifactAdapterFactory.java
deleted file mode 100644
index ea7adc712..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/deployables/EnterpriseDeployableArtifactAdapterFactory.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 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
- *******************************************************************************/
-/*
- * Created on Jan 18, 2005
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-package org.eclipse.jst.j2ee.internal.deployables;
-
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.debug.ui.actions.ILaunchable;
-import org.eclipse.wst.server.core.IModuleArtifact;
-import org.eclipse.wst.server.core.model.ModuleArtifactAdapterDelegate;
-
-public class EnterpriseDeployableArtifactAdapterFactory extends ModuleArtifactAdapterDelegate implements IAdapterFactory {
-
- public Object getAdapter(Object adaptableObject, Class adapterType) {
- return null;
- }
-
- public Class[] getAdapterList() {
- return new Class[] {ILaunchable.class };
- }
-
- public IModuleArtifact getModuleArtifact(Object obj) {
- return EnterpriseApplicationDeployableAdapterUtil.getModuleObject(obj);
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/deployables/EnterpriseModuleArtifact.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/deployables/EnterpriseModuleArtifact.java
deleted file mode 100644
index b3cb39e4e..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/deployables/EnterpriseModuleArtifact.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 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
- *******************************************************************************/
-/*
- * Created on Feb 21, 2005
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-package org.eclipse.jst.j2ee.internal.deployables;
-
-import org.eclipse.debug.ui.actions.ILaunchable;
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IModuleArtifact;
-
-/**
- * @author blancett
- *
- * TODO To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-public class EnterpriseModuleArtifact implements IModuleArtifact {
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.server.core.IModuleArtifact#getModule()
- */
- public IModule getModule() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public Class[] getAdapterList() {
- return new Class[] { IModuleArtifact.class, ILaunchable.class };
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/deployables/J2EEDeployableAdapterFactory.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/deployables/J2EEDeployableAdapterFactory.java
deleted file mode 100644
index 212774545..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/deployables/J2EEDeployableAdapterFactory.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 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
- *******************************************************************************/
-/*
- * Created on Feb 21, 2005
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-package org.eclipse.jst.j2ee.internal.deployables;
-
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.debug.ui.actions.ILaunchable;
-import org.eclipse.wst.server.core.IModuleArtifact;
-
-
-public class J2EEDeployableAdapterFactory implements IAdapterFactory {
- public Object getAdapter(Object adaptableObject, Class adapterType) {
- IModuleArtifact moduleArtifact = null;
-/* if (adapterType == IModuleArtifact.class ) {
-
- if (moduleArtifact == null && Platform.getAdapterManager().hasAdapter(adaptableObject, "org.eclipse.jst.j2ee.internal.web.deployables.WebModuleArtifact")) {
- moduleArtifact = (IModuleArtifact) Platform.getAdapterManager().loadAdapter(adaptableObject, "org.eclipse.jst.j2ee.internal.web.deployables.WebModuleArtifact");
- }
- if (moduleArtifact == null && Platform.getAdapterManager().hasAdapter(adaptableObject, "org.eclipse.jst.j2ee.ejb.internal.deployables.IEJBModuleArtifact")) {
- moduleArtifact = (IModuleArtifact) Platform.getAdapterManager().loadAdapter(adaptableObject, "org.eclipse.jst.j2ee.ejb.internal.deployables.IEJBModuleArtifact");
- }
- if (moduleArtifact == null && Platform.getAdapterManager().hasAdapter(adaptableObject, "org.eclipse.jst.j2ee.internal.deployables.EnterpriseModuleArtifact")) {
- moduleArtifact = (IModuleArtifact) Platform.getAdapterManager().loadAdapter(adaptableObject, "org.eclipse.jst.j2ee.internal.deployables.EnterpriseModuleArtifact");
- }
- if (moduleArtifact == null && Platform.getAdapterManager().hasAdapter(adaptableObject, "org.eclipse.wst.web.internal.deployables.IStaticWebModuleArtifact")) {
- moduleArtifact = (IModuleArtifact) Platform.getAdapterManager().loadAdapter(adaptableObject, "org.eclipse.wst.web.internal.deployables.IStaticWebModuleArtifact");
- }
- }*/
- return moduleArtifact;
- }
-
- public Class[] getAdapterList() {
- return new Class[]{IModuleArtifact.class, ILaunchable.class};
- }
-
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/ChangeLibDirDialog.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/ChangeLibDirDialog.java
deleted file mode 100644
index 0326fa4da..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/ChangeLibDirDialog.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 SAP AG 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:
- * Stefan Dimov, stefan.dimov@sap.com - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.internal.dialogs;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.InputDialog;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIMessages;
-import org.eclipse.swt.widgets.Shell;
-
-public class ChangeLibDirDialog extends InputDialog {
- private boolean warnBlank;
-
- public ChangeLibDirDialog(Shell parentShell, String initialValue, boolean warnBlank) {
- super(parentShell, J2EEUIMessages.getResourceString(J2EEUIMessages.CHANGE_LIB_DIR_HEAD),
- J2EEUIMessages.getResourceString(J2EEUIMessages.NEW_LIB_DIR_PROPMPT), initialValue, null);
- this.warnBlank = warnBlank;
- }
-
- protected void buttonPressed(int buttonId) {
- if (buttonId == IDialogConstants.OK_ID) {
- String res = getText().getText().trim();
- if (res.length() == 0) {
- if (warnBlank)
- if (!MessageDialog.openQuestion(this.getShell(),
- J2EEUIMessages.getResourceString(J2EEUIMessages.BLANK_LIB_DIR),
- J2EEUIMessages.getResourceString(J2EEUIMessages.BLANK_LIB_DIR_CONFIRM))) return;
- } else {
- if (res.startsWith("" + IPath.SEPARATOR)); //$NON-NLS-1$
- res = res.substring(1);
- String[] segments = res.split("" + IPath.SEPARATOR); //$NON-NLS-1$
- Path p = new Path(""); //$NON-NLS-1$
- boolean valid = true;
- for (int i = 0; i < segments.length; i++) {
- valid = p.isValidSegment(segments[i]);
- if (!valid)
- break;
- }
- if (!valid) {
- MessageDialog.openError(null,
- J2EEUIMessages.getResourceString(J2EEUIMessages.INVALID_PATH),
- J2EEUIMessages.getResourceString(J2EEUIMessages.INVALID_PATH_MSG));
- return;
- }
- }
- }
- super.buttonPressed(buttonId);
- }
-}
-
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/DeleteEARComposite.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/DeleteEARComposite.java
deleted file mode 100644
index fa025152a..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/DeleteEARComposite.java
+++ /dev/null
@@ -1,270 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 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.jst.j2ee.internal.dialogs;
-
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.viewers.CheckStateChangedEvent;
-import org.eclipse.jface.viewers.CheckboxTableViewer;
-import org.eclipse.jface.viewers.ICheckStateListener;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.ViewerSorter;
-import org.eclipse.jst.j2ee.internal.delete.DeleteOptions;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.ui.model.WorkbenchLabelProvider;
-
-
-public class DeleteEARComposite extends Composite implements J2EEDeleteUIConstants, Listener, ICheckStateListener {
-
- protected DeleteEARDialog dialog;
- protected Button deleteAppProjectsBtn;
- protected Button deleteRefProjectsBtn;
- protected Composite radioComposite;
- protected Button detailsBtn;
- protected DeleteModuleReferencesComposite moduleRefsComposite;
- protected CheckboxTableViewer projectsList;
- protected boolean listCreated = false;
- protected Map referencedProjects;
- protected WorkbenchLabelProvider workbenchLabelProvider = new WorkbenchLabelProvider();
-
- /**
- * Constructor for DeleteEARComposite.
- *
- * @param parent
- * @param style
- */
- public DeleteEARComposite(Composite parent, DeleteEARDialog dialog, int style, Set referencedProjects) {
- super(parent, style);
- this.dialog = dialog;
- initReferencedProjects(referencedProjects);
- addChildren();
- }
-
- /**
- * Answer the referenced projects which the user has chosen to also delete
- */
- public java.util.List getSelectedReferencedProjects() {
- if (deleteAppProjectsBtn.getSelection())
- return Collections.EMPTY_LIST;
- java.util.List result = new ArrayList();
- for (Iterator iter = referencedProjects.entrySet().iterator(); iter.hasNext();) {
- Map.Entry element = (Map.Entry) iter.next();
- boolean isSelected = ((Boolean) element.getValue()).booleanValue();
- if (isSelected)
- result.add(element.getKey());
- }
- return result;
- }
-
- /**
- * @see J2EEDeleteDialog#createDeleteOptions()
- */
- public DeleteOptions createDeleteOptions() {
- DeleteOptions opts = new DeleteOptions();
- opts.setIsEARDelete(true);
- opts.setDeleteProjects(true);
- opts.setDeleteModuleDependencies(moduleRefsComposite.shouldDeleteModuleDependencies());
- opts.setDeleteModules(moduleRefsComposite.shouldDeleteModules());
- opts.setSelectedReferencedProjects(getSelectedReferencedProjects());
- return opts;
- }
-
-
-
- protected void initReferencedProjects(Set projects) {
- referencedProjects = new HashMap();
- for (Iterator iter = projects.iterator(); iter.hasNext();) {
- IProject project = (IProject) iter.next();
- referencedProjects.put(project, Boolean.TRUE);
- }
- }
-
- protected void addChildren() {
- setLayout();
- addRadioComposite();
- moduleRefsComposite = new DeleteModuleReferencesComposite(this, SWT.NONE, true);
- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
- data.horizontalIndent = 10;
- moduleRefsComposite.setLayoutData(data);
- //setup defaults
- deleteAppProjectsBtn.setSelection(true);
- deleteAppProjectsBtnSelected();
- }
-
- protected void setLayout() {
- GridLayout lay = new GridLayout();
- lay.numColumns = 1;
- setLayout(lay);
- GridData data = new GridData(GridData.FILL_BOTH);
- setLayoutData(data);
- }
-
- protected void addRadioComposite() {
- radioComposite = new Composite(this, SWT.NONE);
- GridLayout lay = new GridLayout();
- lay.numColumns = 2;
- radioComposite.setLayout(lay);
- GridData data = new GridData(GridData.FILL_BOTH);
- radioComposite.setLayoutData(data);
- deleteAppProjectsBtn = new Button(radioComposite, SWT.RADIO);
- deleteAppProjectsBtn.setText(DELETE_EAR_PROJECTS);
- deleteAppProjectsBtn.addListener(SWT.Selection, this);
- data = new GridData(GridData.FILL_HORIZONTAL);
- data.horizontalSpan = 2;
- deleteAppProjectsBtn.setLayoutData(data);
-
- deleteRefProjectsBtn = new Button(radioComposite, SWT.RADIO);
- deleteRefProjectsBtn.setText(DELETE_REFERENCED_PROJECTS);
- deleteRefProjectsBtn.addListener(SWT.Selection, this);
- deleteRefProjectsBtn.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
- detailsBtn = new Button(radioComposite, SWT.PUSH);
- detailsBtn.setText(IDialogConstants.SHOW_DETAILS_LABEL);
- detailsBtn.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
- detailsBtn.addListener(SWT.Selection, this);
- detailsBtn.setEnabled(false);
- }
-
- /**
- * @see Listener#handleEvent(Event)
- */
- public void handleEvent(Event event) {
- if (event.widget == deleteAppProjectsBtn)
- deleteAppProjectsBtnSelected();
- else if (event.widget == deleteRefProjectsBtn)
- deleteRefProjectsBtnSelected();
- else if (event.widget == detailsBtn)
- detailsBtnSelected();
- }
-
- protected void deleteAppProjectsBtnSelected() {
- if (deleteAppProjectsBtn.getSelection()) {
- if (listCreated)
- toggleDetailsArea();
- detailsBtn.setEnabled(false);
- moduleRefsComposite.setButtonsEnabled(false);
- }
- }
-
- protected void deleteRefProjectsBtnSelected() {
- if (deleteRefProjectsBtn.getSelection()) {
- detailsBtn.setEnabled(true);
- moduleRefsComposite.setButtonsEnabled(true);
- }
- }
-
- /**
- * Toggles the unfolding of the details area. This is triggered by the user pressing the details
- * button.
- */
- protected void toggleDetailsArea() {
- Point windowSize = getShell().getSize();
- Point oldSize = dialog.getContents().computeSize(SWT.DEFAULT, SWT.DEFAULT);
-
- if (listCreated) {
- projectsList.getControl().dispose();
- listCreated = false;
- detailsBtn.setText(IDialogConstants.SHOW_DETAILS_LABEL);
- } else {
- createDropDownList();
- detailsBtn.setText(IDialogConstants.HIDE_DETAILS_LABEL);
- }
-
- Point newSize = dialog.getContents().computeSize(SWT.DEFAULT, SWT.DEFAULT);
-
- getShell().setSize(new Point(windowSize.x, windowSize.y + (newSize.y - oldSize.y)));
- }
-
- protected void createDropDownList() {
- // create the list
- projectsList = CheckboxTableViewer.newCheckList(radioComposite, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
- projectsList.setLabelProvider(createLabelProvider());
- projectsList.setSorter(new ViewerSorter() {/*viewersorter*/});
- projectsList.addCheckStateListener(this);
- // fill the list
- populateList();
-
- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL | GridData.GRAB_VERTICAL);
- data.heightHint = projectsList.getTable().getItemHeight() * referencedProjects.size();
- data.horizontalSpan = 2;
- data.horizontalIndent = 10;
- projectsList.getTable().setLayoutData(data);
-
- listCreated = true;
- }
-
- protected void populateList() {
- for (Iterator iter = referencedProjects.entrySet().iterator(); iter.hasNext();) {
- Map.Entry entry = (Map.Entry) iter.next();
- projectsList.add(entry.getKey());
- boolean checked = ((Boolean) entry.getValue()).booleanValue();
- projectsList.setChecked(entry.getKey(), checked);
- }
- }
-
- protected void detailsBtnSelected() {
- toggleDetailsArea();
- }
-
- /**
- * @see ICheckStateListener#checkStateChanged(CheckStateChangedEvent)
- */
- public void checkStateChanged(CheckStateChangedEvent event) {
- referencedProjects.put(event.getElement(), new Boolean(event.getChecked()));
- }
-
- protected ITableLabelProvider createLabelProvider() {
- return new ITableLabelProvider() {
- public void dispose() {
- //dispose
- }
-
- public Image getColumnImage(Object element, int columnIndex) {
- return workbenchLabelProvider.getImage(element);
- }
-
- /**
- * @see ITableLabelProvider#getColumnText(Object, int)
- */
- public String getColumnText(Object element, int columnIndex) {
- return workbenchLabelProvider.getText(element);
- }
-
- public void addListener(ILabelProviderListener listener) {
- //do nothing
- }
-
- public boolean isLabelProperty(Object element, String property) {
- return false;
- }
-
- public void removeListener(ILabelProviderListener listener) {
- //do nothing
- }
- };
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/DeleteEARDialog.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/DeleteEARDialog.java
deleted file mode 100644
index 48f41f5e1..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/DeleteEARDialog.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.jst.j2ee.internal.dialogs;
-
-
-import java.util.Set;
-
-import org.eclipse.jst.j2ee.internal.actions.IJ2EEUIContextIds;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.PlatformUI;
-
-public class DeleteEARDialog extends J2EEDeleteDialog {
- protected DeleteEARComposite deleteComposite;
- protected Set referencedProjects;
-
- /**
- * Constructor for DeleteEARDialog.
- *
- * @param parentShell
- * @param dialogTitle
- */
- public DeleteEARDialog(Shell parentShell, Set referencedProjects) {
- super(parentShell, DELETE_EAR_OPTIONS);
- this.referencedProjects = referencedProjects;
- }
-
-
- /**
- * @see org.eclipse.jface.dialogs.MessageDialog#createCustomArea(Composite)
- */
- protected Control createCustomArea(Composite parent) {
- PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IJ2EEUIContextIds.DELEATE_EAR_DIALOG_1); //$NON-NLS-1$
- deleteComposite = new DeleteEARComposite(parent, this, SWT.NONE, referencedProjects);
- GridData data = new GridData(GridData.FILL_BOTH);
- data.horizontalIndent = 10;
- deleteComposite.setLayoutData(data);
- return deleteComposite;
- }
-
- /**
- * @see J2EEDeleteDialog#createDeleteOptions()
- */
- public void createDeleteOptions() {
- deleteOptions = deleteComposite.createDeleteOptions();
- }
-
- /**
- * @see org.eclipse.jface.window.Window#getContents()
- */
- public Control getContents() {
- return super.getContents();
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/DeleteModuleComposite.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/DeleteModuleComposite.java
deleted file mode 100644
index ceda40a34..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/DeleteModuleComposite.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2003, 2004 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.jst.j2ee.internal.dialogs;
-
-
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-
-public class DeleteModuleComposite extends Composite implements J2EEDeleteUIConstants, Listener {
-
- // protected Button deleteProjectsCheckBox;
- protected Button deleteAppProjectsBtn;
- protected Button deleteRefProjectsBtn;
- protected Composite radioComposite;
- protected DeleteModuleReferencesComposite moduleRefsComposite;
-
-
- /**
- * Constructor for DeleteModuleComposite.
- *
- * @param parent
- * @param style
- */
- public DeleteModuleComposite(Composite parent, int style) {
- super(parent, style);
- addChildren();
-
- }
-
- protected void addChildren() {
- addDeleteProjectsGroup();
- addDeleteModuleRefsComposite();
- //set default values
- deleteAppProjectsBtn.setSelection(true);
- deleteAppProjectsBtnSelected();
- }
-
- protected void addDeleteProjectsGroup() {
- GridLayout lay = new GridLayout();
- lay.numColumns = 1;
- setLayout(lay);
- GridData data = new GridData(GridData.FILL_BOTH);
- setLayoutData(data);
-
- radioComposite = new Composite(this, SWT.NONE);
- lay = new GridLayout();
- lay.numColumns = 2;
- radioComposite.setLayout(lay);
- data = new GridData(GridData.FILL_BOTH);
- radioComposite.setLayoutData(data);
- deleteAppProjectsBtn = new Button(radioComposite, SWT.RADIO);
- deleteAppProjectsBtn.setText(DELETE_PROJECTS_ONLY);
- deleteAppProjectsBtn.addListener(SWT.Selection, this);
- data = new GridData(GridData.FILL_HORIZONTAL);
- data.horizontalSpan = 2;
- deleteAppProjectsBtn.setLayoutData(data);
-
- deleteRefProjectsBtn = new Button(radioComposite, SWT.RADIO);
- deleteRefProjectsBtn.setText(DELETE_PROJECT_REFERENCES);
- deleteRefProjectsBtn.addListener(SWT.Selection, this);
- deleteRefProjectsBtn.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
- }
-
- protected void addDeleteModuleRefsComposite() {
- moduleRefsComposite = new DeleteModuleReferencesComposite(this, SWT.NONE, false);
- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
- data.horizontalIndent = 10;
- moduleRefsComposite.setLayoutData(data);
- }
-
-
- protected void addSeparator() {
- Label sep = new Label(this, SWT.SEPARATOR | SWT.HORIZONTAL);
- GridData data = new GridData(GridData.FILL_HORIZONTAL);
- sep.setLayoutData(data);
- }
-
- public boolean shouldDeleteProjects() {
- // return deleteProjectsCheckBox.getSelection();
- // the project should be deleted, since delete was the selected action
- return true;
- }
-
-
- public boolean shouldDeleteModuleDependencies() {
- return moduleRefsComposite.shouldDeleteModuleDependencies();
- }
-
- public boolean shouldDeleteModules() {
- return moduleRefsComposite.shouldDeleteModules();
- }
-
- /**
- * @see Listener#handleEvent(Event)
- */
- public void handleEvent(Event event) {
- if (event.widget == deleteAppProjectsBtn)
- deleteAppProjectsBtnSelected();
- else if (event.widget == deleteRefProjectsBtn)
- deleteRefProjectsBtnSelected();
- }
-
- protected void deleteAppProjectsBtnSelected() {
- if (deleteAppProjectsBtn.getSelection()) {
- moduleRefsComposite.setButtonsEnabled(false);
- }
- }
-
- protected void deleteRefProjectsBtnSelected() {
- if (deleteRefProjectsBtn.getSelection()) {
- moduleRefsComposite.setButtonsEnabled(true);
- }
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/DeleteModuleDialog.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/DeleteModuleDialog.java
deleted file mode 100644
index cfb80fe79..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/DeleteModuleDialog.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 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.jst.j2ee.internal.dialogs;
-
-
-
-import org.eclipse.jst.j2ee.internal.actions.IJ2EEUIContextIds;
-import org.eclipse.jst.j2ee.internal.delete.DeleteOptions;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.PlatformUI;
-
-
-public class DeleteModuleDialog extends J2EEDeleteDialog implements J2EEDeleteUIConstants {
-
- protected DeleteModuleComposite deleteComposite;
-
- public DeleteModuleDialog(Shell parentShell) {
- super(parentShell, DELETE_MODULE_OPTIONS);
- }
-
- protected Control createCustomArea(Composite parent) {
- PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IJ2EEUIContextIds.DELEATE_MODULE_DIALOG_1); //$NON-NLS-1$
- deleteComposite = new DeleteModuleComposite(parent, SWT.NONE);
- GridData data = new GridData(GridData.FILL_BOTH);
- data.horizontalIndent = 10;
- deleteComposite.setLayoutData(data);
- return deleteComposite;
- }
-
- public void createDeleteOptions() {
- deleteOptions = new DeleteOptions();
- deleteOptions.setDeleteProjects(deleteComposite.shouldDeleteProjects());
- deleteOptions.setDeleteModules(deleteComposite.shouldDeleteModules());
- deleteOptions.setDeleteModuleDependencies(deleteComposite.shouldDeleteModuleDependencies());
- }
-
-}
-
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/DeleteModuleReferencesComposite.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/DeleteModuleReferencesComposite.java
deleted file mode 100644
index 393189d18..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/DeleteModuleReferencesComposite.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2003, 2004 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.jst.j2ee.internal.dialogs;
-
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-
-public class DeleteModuleReferencesComposite extends Composite implements J2EEDeleteUIConstants, Listener {
-
- protected Button deleteModulesCheckbox;
- protected Button deleteModuleDependenciesCheckbox;
- protected boolean isEARDelete;
-
- /**
- * Constructor for DeleteModuleReferencesComposite.
- *
- * @param parent
- * @param style
- */
- public DeleteModuleReferencesComposite(Composite parent, int style, boolean isEARDelete) {
- super(parent, style);
- this.isEARDelete = isEARDelete;
- addChildren();
- }
-
- protected void addChildren() {
- GridLayout lay = new GridLayout();
- lay.numColumns = 1;
- setLayout(lay);
- GridData data = new GridData(GridData.FILL_BOTH);
- setLayoutData(data);
-
- addDeleteModulesCheckbox();
- addDeleteModuleDependenciesCheckbox();
- }
-
- protected void addDeleteModuleDependenciesCheckbox() {
- deleteModuleDependenciesCheckbox = new Button(this, SWT.CHECK);
- deleteModuleDependenciesCheckbox.setText(DELETE_MODULE_DEPENDENCIES);
-
- }
-
- protected void addDeleteModulesCheckbox() {
- deleteModulesCheckbox = new Button(this, SWT.CHECK);
- String label = isEARDelete ? DELETE_MODULES_OTHER : DELETE_MODULES;
- deleteModulesCheckbox.setText(label);
- deleteModulesCheckbox.addListener(SWT.Selection, this);
- }
-
- public boolean shouldDeleteModuleDependencies() {
- return deleteModuleDependenciesCheckbox.getSelection();
- }
-
- public boolean shouldDeleteModules() {
- return deleteModulesCheckbox.getSelection();
- }
-
- public void setButtonsEnabled(boolean enabled) {
- deleteModuleDependenciesCheckbox.setSelection(enabled);
- deleteModulesCheckbox.setSelection(enabled);
- deleteModuleDependenciesCheckbox.setEnabled(enabled);
- deleteModulesCheckbox.setEnabled(enabled);
- }
-
- /**
- * @see Listener#handleEvent(Event)
- */
- public void handleEvent(Event event) {
- if (event.widget == deleteModulesCheckbox && deleteModulesCheckbox.getSelection() && !deleteModuleDependenciesCheckbox.getSelection())
- deleteModuleDependenciesCheckbox.setSelection(true);
- }
-
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/DependencyConflictResolveDialog.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/DependencyConflictResolveDialog.java
deleted file mode 100644
index 985c2aebb..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/DependencyConflictResolveDialog.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 SAP AG 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:
- * Stefan Dimov, stefan.dimov@sap.com - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.internal.dialogs;
-
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.dialogs.MessageDialogWithToggle;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIMessages;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIPlugin;
-import org.eclipse.swt.widgets.*;
-
-public class DependencyConflictResolveDialog extends MessageDialogWithToggle {
-
- public static final int BTN_ID_OK = 0;
- public static final int BTN_ID_CANCEL = 1;
-
- public static final int DLG_TYPE_1 = 1;
- public static final int DLG_TYPE_2 = 2;
-
- public static final String DONT_SHOW_AGAIN = "DependencyConflictResolveDialog.DONT_SHOW_AGAIN"; //$NON-NLS-1$
-
- public DependencyConflictResolveDialog(Shell parentShell,
- int dlgType) {
-
- super(parentShell,
- J2EEUIMessages.getResourceString(J2EEUIMessages.DEPENDENCY_CONFLICT_TITLE),
- null,
- J2EEUIMessages.getResourceString((dlgType == DLG_TYPE_1) ?
- J2EEUIMessages.DEPENDENCY_CONFLICT_MSG_1 :
- J2EEUIMessages.DEPENDENCY_CONFLICT_MSG_2)
-
- , MessageDialog.WARNING,
-
- new String[] { J2EEUIMessages.OK_BUTTON,
- J2EEUIMessages.CANCEL_BUTTON },
- BTN_ID_CANCEL,
- J2EEUIMessages.getResourceString(J2EEUIMessages.DO_NOT_SHOW_WARNING_AGAIN),
- false);
- }
-
- public int open() {
- if (getPrefStore().getBoolean(DONT_SHOW_AGAIN))
- return BTN_ID_OK;
- setToggleState(getPrefStore().getBoolean(DONT_SHOW_AGAIN));
- return super.open();
- }
-
- public boolean close() {
- getPrefStore().setValue(DONT_SHOW_AGAIN, getToggleState());
- return super.close();
- }
-
- public IPreferenceStore getPrefStore() {
- return J2EEUIPlugin.getDefault().getPreferenceStore();
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/FilteredFileSelectionDialog.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/FilteredFileSelectionDialog.java
deleted file mode 100644
index 5442f2c17..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/FilteredFileSelectionDialog.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 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.jst.j2ee.internal.dialogs;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jdt.internal.ui.wizards.TypedElementSelectionValidator;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIMessages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
-import org.eclipse.ui.model.WorkbenchContentProvider;
-import org.eclipse.ui.model.WorkbenchLabelProvider;
-
-public class FilteredFileSelectionDialog extends ElementTreeSelectionDialog {
- protected String[] fExtensions;
- /**
- * FilteredFileSelectionDialog constructor comment.
- *
- * @param parent
- * Shell
- * @parent extensions String[]
- */
- public FilteredFileSelectionDialog(Shell parent, String[] extensions) {
- this(parent, null, null, extensions, false);
- }
- /**
- * FilteredFileSelectionDialog constructor comment.
- *
- * @param parent
- * Shell
- * @param title
- * String
- * @param message
- * String
- * @parent extensions String[]
- * @param allowMultiple
- * boolean
- */
- public FilteredFileSelectionDialog(Shell parent, String title, String message, String[] extensions, boolean allowMultiple) {
- super(parent, new WorkbenchLabelProvider(), new WorkbenchContentProvider());
- setShellStyle(SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL | SWT.RESIZE);
-
- setTitle(title);
- if (title == null)
- setTitle(J2EEUIMessages.getResourceString("File_Selection_UI_")); //$NON-NLS-1$
- if (message == null)
- message = J2EEUIMessages.getResourceString("Select_a_file__UI_"); //$NON-NLS-1$
- setMessage(message);
- setAllowMultiple(true);
- setExtensions(extensions);
- addFilter(new TypedFileViewerFilter(extensions));
- setValidator(new TypedElementSelectionValidator(new Class[]{IFile.class}, allowMultiple));
-
- }
- public String[] getExtensions() {
- return fExtensions;
- }
- public void setExtensions(String[] extensions) {
- fExtensions = extensions;
- }
-
- public void setHelp(String helpCode) {
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this.getParentShell(), helpCode); //$NON-NLS-1$
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/J2EEDeleteDialog.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/J2EEDeleteDialog.java
deleted file mode 100644
index be97f20db..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/J2EEDeleteDialog.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2003, 2004 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.jst.j2ee.internal.dialogs;
-
-
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jst.j2ee.internal.delete.DeleteOptions;
-import org.eclipse.swt.widgets.Shell;
-
-
-public abstract class J2EEDeleteDialog extends MessageDialog implements J2EEDeleteUIConstants {
-
- protected DeleteOptions deleteOptions;
-
- /**
- * Constructor for J2EEDeleteDialog.
- *
- * @param parentShell
- * @param dialogTitle
- * @param dialogTitleImage
- * @param dialogMessage
- * @param dialogImageType
- * @param dialogButtonLabels
- * @param defaultIndex
- */
- public J2EEDeleteDialog(Shell parentShell, String dialogTitle) {
- super(parentShell, dialogTitle, null, DELETE_DIALOG_MESSAGE, QUESTION, new String[]{IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL}, 0);
- }
-
- public DeleteOptions getDeleteOptions() {
- return deleteOptions;
- }
-
-
- public abstract void createDeleteOptions();
-
- protected void buttonPressed(int buttonId) {
- if (buttonId == 0)
- createDeleteOptions();
- super.buttonPressed(buttonId);
- }
-
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/J2EEDeleteUIConstants.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/J2EEDeleteUIConstants.java
deleted file mode 100644
index 2ae744b61..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/J2EEDeleteUIConstants.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2003, 2004 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.jst.j2ee.internal.dialogs;
-
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIMessages;
-
-public interface J2EEDeleteUIConstants {
- String DELETE = J2EEUIMessages.getResourceString("Delete_1"); //$NON-NLS-1$
- String DELETE_PROJECTS = J2EEUIMessages.getResourceString("Delete_selected_project(s)_2"); //$NON-NLS-1$
- String DELETE_MODULES = J2EEUIMessages.getResourceString("Remove_module(s)_from_all_Enterprise_Applications_3"); //$NON-NLS-1$
- String DELETE_MODULES_OTHER = J2EEUIMessages.getResourceString("Remove_module(s)_from_all_other_Enterprise_Applications_4"); //$NON-NLS-1$
- String DELETE_MODULE_DEPENDENCIES = J2EEUIMessages.getResourceString("Remove_module_dependencies_referencing_selected_project(s)_5"); //$NON-NLS-1$
- String DELETE_MODULE_OPTIONS = J2EEUIMessages.getResourceString("Delete_Module_Options_6"); //$NON-NLS-1$
- String DELETE_EAR_OPTIONS = J2EEUIMessages.getResourceString("Delete_Enterprise_Application_Options_7"); //$NON-NLS-1$
- String DELETE_NOT_COMPLETED = J2EEUIMessages.getResourceString("Delete_could_not_be_completed_8"); //$NON-NLS-1$
- String DELETE_ERROR = J2EEUIMessages.getResourceString("Delete_error_9"); //$NON-NLS-1$
- String DELETE_DIALOG_MESSAGE = J2EEUIMessages.getResourceString("What_would_you_like_to_delete__10"); //$NON-NLS-1$
- String DELETE_EAR_PROJECTS = J2EEUIMessages.getResourceString("Delete_selected_Enterprise_Application_project(s)_only_11"); //$NON-NLS-1$
- String DELETE_REFERENCED_PROJECTS = J2EEUIMessages.getResourceString("Also_delete_module_and_utility_Java_projects_12"); //$NON-NLS-1$
- String DELETE_PROJECTS_ONLY = J2EEUIMessages.getResourceString("Delete_selected_project(s)_only_13"); //$NON-NLS-1$
- String DELETE_PROJECT_REFERENCES = J2EEUIMessages.getResourceString("Also_delete_references_to_selected_project(s)_14"); //$NON-NLS-1$
- String CUSTOM_DELETE_MIX_MATCH = J2EEUIMessages.getResourceString("CUSTOM_DELETE_MIX_MATCH_UI_"); //$NON-NLS-1$
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/J2EEDeployStatusDialog.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/J2EEDeployStatusDialog.java
deleted file mode 100644
index 9e29ba990..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/J2EEDeployStatusDialog.java
+++ /dev/null
@@ -1,334 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 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
- *******************************************************************************/
-/*
- * Created on May 11, 2004
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Generation - Code and Comments
- */
-package org.eclipse.jst.j2ee.internal.dialogs;
-
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jem.util.logger.proxy.Logger;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.ProgressMonitorDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * @author sagarwal
- *
- * TODO To change the template for this generated type comment go to Window - Preferences - Java -
- * Code Generation - Code and Comments
- */
-public class J2EEDeployStatusDialog extends ProgressMonitorDialog implements J2EEDeployUIConstants {
-
- /**
- * Reserve room for this many list items.
- */
- private static final int LIST_ITEM_COUNT = 7;
- private int severity = IStatus.OK;
- public Color DESC_COLOR = new Color(null, 255, 255, 255);
- /**
- * The Details button.
- */
- private Button detailsButton;
-
- /**
- * The SWT list control that displays the error details.
- */
- private Text text;
-
- /**
- * Indicates whether the error details viewer is currently created.
- */
- private boolean textCreated = false;
-
- /**
- * List of the main error object's detailed errors (element type:
- * <code>J2EEMigrationStatus</code>).
- */
- private java.util.List statusList;
-
- /**
- * @param parent
- */
- public J2EEDeployStatusDialog(Shell parent, List status) {
- super(parent);
- setShellStyle(SWT.BORDER | SWT.TITLE | SWT.APPLICATION_MODAL | SWT.RESIZE); // no
- statusList = status;
- }
-
- /**
- * Called just after the operation is run. Default behaviour is to decrement the nesting depth,
- * and close the dialog.
- *
- * @plannedfor 3.0
- */
- protected void finishedRun() {
- decrementNestingDepth();
- clearCursors();
- cancel.setEnabled(true);
- detailsButton.setEnabled(true);
- computeSeverity();
- setDeploymentStatus();
- }
-
- /**
- *
- */
- private void setDeploymentStatus() {
- setMessageOrDefault();
- imageLabel.setImage(getImage());
- }
-
- protected void setMessageOrDefault() {
- switch (getSeverity()) {
- case IStatus.ERROR :
- message = DEPLOY_ERRORS_REPORT;
- break;
- case IStatus.WARNING :
- message = DEPLOY_WARNINGS_REPORT;
- break;
- default :
- message = DEPLOY_SUCCESS_REPORT;
- break;
- }
- setMessage(message);
- }
-
-
- protected void createCancelButton(Composite parent) {
- super.createCancelButton(parent);
- cancel.setText(IDialogConstants.OK_LABEL);
- }
-
- /*
- * (non-Javadoc) Method declared on Dialog.
- */
- protected void createButtonsForButtonBar(Composite parent) {
- // cancel button
- createCancelButton(parent);
- detailsButton = createButton(parent, IDialogConstants.DETAILS_ID, IDialogConstants.SHOW_DETAILS_LABEL, false);
- detailsButton.setEnabled(false);
- }
-
- /*
- * (non-Javadoc) Method declared on Dialog. Handles the pressing of the Ok or Details button in
- * this dialog. If the Ok button was pressed then close this dialog. If the Details button was
- * pressed then toggle the displaying of the error details area. Note that the Details button
- * will only be visible if the error being displayed specifies child details.
- */
- protected void buttonPressed(int id) {
- if (id == IDialogConstants.DETAILS_ID) { // was the details button pressed?
- toggleDetailsArea();
- } else {
- logStatus();
- super.buttonPressed(id);
-
- }
- }
-
- /*
- * @see org.eclipse.jface.dialogs.IconAndMessageDialog#getImage()
- */
-
-
- protected Image getImage() {
- switch (getSeverity()) {
- case IStatus.ERROR :
- return this.getErrorImage();
- case IStatus.WARNING :
- return this.getWarningImage();
- default :
- return this.getInfoImage();
- }
- }
-
- protected Text createDropDownText(Composite parent) {
- // create the list
- text = new Text(parent, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI);
- // fill the list
- populateText(text);
-
- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL | GridData.GRAB_VERTICAL);
- data.horizontalSpan = 2;
- data.heightHint = text.getLineHeight() * LIST_ITEM_COUNT;
- text.setLayoutData(data);
- textCreated = true;
- return text;
- }
-
- private void logStatus() {
- Iterator aenum = statusList.iterator();
- StringBuffer sb = new StringBuffer();
- sb.append(message);
- while (aenum.hasNext()) {
- IStatus childStatus = (IStatus) aenum.next();
- populateText(sb, childStatus, 0);
- }
- Logger.getLogger().logInfo(sb.toString());
-
- }
-
- /**
- * Populates the list using this error dialog's status object. This walks the child stati of the
- * status object and displays them in a list. The format for each entry is status_path :
- * status_message If the status's path was null then it (and the colon) are omitted.
- */
- private void populateText(Text someText) {
- Iterator aenum = statusList.iterator();
- StringBuffer sb = new StringBuffer();
- while (aenum.hasNext()) {
- IStatus childStatus = (IStatus) aenum.next();
- //sb.append("Deployment results for " + childStatus.);
- populateText(sb, childStatus, 0);
- }
- someText.setText(sb.toString());
-
- }
-
- private void populateText(StringBuffer sb, IStatus status, int nesting) {
- for (int i = 0; i < nesting; i++) {
- sb.append(" "); //$NON-NLS-1$
- }
- sb.append(getMessageForDisplay(status));
- sb.append('\n');
- IStatus[] children = status.getChildren();
- for (int i = 0; i < children.length; i++) {
- populateText(sb, children[i], nesting + 1);
- }
- }
-
- /**
- * Toggles the unfolding of the details area. This is triggered by the user pressing the details
- * button.
- */
- private void toggleDetailsArea() {
- Point windowSize = getShell().getSize();
- Point oldSize = getContents().computeSize(SWT.DEFAULT, SWT.DEFAULT);
-
- if (textCreated) {
- text.dispose();
- textCreated = false;
- detailsButton.setText(IDialogConstants.SHOW_DETAILS_LABEL);
- } else {
- text = createDropDownText((Composite) getContents());
- detailsButton.setText(IDialogConstants.HIDE_DETAILS_LABEL);
- text.setEditable(false);
- text.setBackground(DESC_COLOR);
- }
-
- Point newSize = getContents().computeSize(SWT.DEFAULT, SWT.DEFAULT);
-
- getShell().setSize(new Point(windowSize.x, windowSize.y + (newSize.y - oldSize.y)));
- }
-
- public String getMessageForDisplay(IStatus status) {
- String messageString = status.getMessage();
- return messageString;
-
- }
-
- protected String getSeverityText(IStatus status) {
- switch (status.getSeverity()) {
- case IStatus.ERROR :
- return ERROR_TEXT;
- case IStatus.WARNING :
- return WARNING_TEXT;
- case IStatus.INFO :
- return INFO_TEXT;
- case IStatus.OK :
- return OK_TEXT;
- default :
- return ""; //$NON-NLS-1$
- }
- }
-
- private void setSeverity(int sev) {
- if (severity == IStatus.ERROR)
- return;
- if (sev == IStatus.ERROR)
- severity = IStatus.ERROR;
- else if (sev == IStatus.WARNING) {
- severity = IStatus.WARNING;
- }
- }
-
- private int getSeverity() {
- return severity;
- }
-
- private int computeSeverity() {
- Iterator aenum = statusList.iterator();
- while (aenum.hasNext()) {
- IStatus childStatus = (IStatus) aenum.next();
- setSeverity(childStatus.getSeverity());
- if (getSeverity() == IStatus.ERROR)
- return getSeverity();
- computeSeverity(childStatus);
- if (getSeverity() == IStatus.ERROR)
- getSeverity();
- }
- return getSeverity();
- }
-
- private void computeSeverity(IStatus status) {
- IStatus[] children = status.getChildren();
- for (int i = 0; i < children.length; i++) {
- computeSeverity(children[i]);
- if (getSeverity() == IStatus.ERROR)
- return;
- }
- }
-
- /*
- * (non-Javadoc) Method declared in Window.
- */
- protected void configureShell(Shell shell) {
- super.configureShell(shell);
- shell.setText(DEPLOY_DIALOG_TITLE);
- //shell.setSize(600,200); don't set the size this breaks the dialog for linux.
- }
-
- /*
- * (non-Javadoc) Method declared on Dialog.
- */
- protected Control createDialogArea(Composite parent) {
- Control control = super.createDialogArea(parent);
- setMessage(DEPLOYMENT_IN_PROGRESS);
- return control;
- }
-
- /**
- * Set the message in the message label.
- */
- private void setMessage(String messageString) {
- //must not set null text in a label
- message = messageString == null ? "" : messageString; //$NON-NLS-1$
- if (messageLabel == null || messageLabel.isDisposed())
- return;
- messageLabel.setText(message);
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/J2EEDeployUIConstants.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/J2EEDeployUIConstants.java
deleted file mode 100644
index dfe358952..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/J2EEDeployUIConstants.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2003, 2004 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.jst.j2ee.internal.dialogs;
-
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIMessages;
-
-public interface J2EEDeployUIConstants {
- public static final String ERROR_TEXT = J2EEUIMessages.getResourceString("DEPLOY_ERROR_TEXT"); //$NON-NLS-1$
- public static final String WARNING_TEXT = J2EEUIMessages.getResourceString("DEPLOY_WARNING_TEXT"); //$NON-NLS-1$
- public static final String INFO_TEXT = J2EEUIMessages.getResourceString("DEPLOY_INFO_TEXT"); //$NON-NLS-1$
- public static final String OK_TEXT = J2EEUIMessages.getResourceString("DEPLOY_OK_TEXT"); //$NON-NLS-1$
- public static final String DEPLOYMENT_IN_PROGRESS = J2EEUIMessages.getResourceString("DEPLOYMENT_IN_PROGRESS"); //$NON-NLS-1$
- public static final String DEPLOY_SUCCESS_REPORT = J2EEUIMessages.getResourceString("DEPLOY_SUCCESS_REPORT"); //$NON-NLS-1$
- public static final String DEPLOY_WARNINGS_REPORT = J2EEUIMessages.getResourceString("DEPLOY_WARNINGS_REPORT"); //$NON-NLS-1$
- public static final String DEPLOY_ERRORS_REPORT = J2EEUIMessages.getResourceString("DEPLOY_ERRORS_REPORT"); //$NON-NLS-1$
- public static final String DEPLOY_DIALOG_TITLE = J2EEUIMessages.getResourceString("DEPLOY_DIALOG_TITLE"); //$NON-NLS-1$
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/J2EERenameDialog.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/J2EERenameDialog.java
deleted file mode 100644
index 6dcbf118d..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/J2EERenameDialog.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2003, 2004 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.jst.j2ee.internal.dialogs;
-
-
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jst.j2ee.internal.rename.RenameOptions;
-import org.eclipse.swt.widgets.Shell;
-
-
-public abstract class J2EERenameDialog extends MessageDialog implements J2EERenameUIConstants {
-
- protected RenameOptions renameOptions;
- protected String currentName = null;
-
- /**
- * Constructor for J2EERenameDialog.
- *
- * @param parentShell
- * @param dialogTitle
- * @param dialogTitleImage
- * @param dialogMessage
- * @param dialogImageType
- * @param dialogButtonLabels
- * @param defaultIndex
- */
- public J2EERenameDialog(Shell parentShell, String dialogTitle, String name) {
- super(parentShell, dialogTitle, null, RENAME_DIALOG_MESSAGE, QUESTION, new String[]{IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL}, 0);
- currentName = name;
- }
-
- public RenameOptions getRenameOptions() {
- return renameOptions;
- }
-
-
- public abstract void createRenameOptions();
-
- protected void buttonPressed(int buttonId) {
- if (buttonId == 0)
- createRenameOptions();
- super.buttonPressed(buttonId);
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/J2EERenameUIConstants.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/J2EERenameUIConstants.java
deleted file mode 100644
index baa574d2a..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/J2EERenameUIConstants.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2003, 2004 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.jst.j2ee.internal.dialogs;
-
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIMessages;
-
-public interface J2EERenameUIConstants {
- String RENAME = J2EEUIMessages.getResourceString("Rename_1"); //$NON-NLS-1$
- String RENAME_PROJECTS = J2EEUIMessages.getResourceString("Rename_selected_project_2"); //$NON-NLS-1$
- String RENAME_MODULES = J2EEUIMessages.getResourceString("Rename_module_in_all_Enterprise_Applications_3"); //$NON-NLS-1$
- String RENAME_MODULES_OTHER = J2EEUIMessages.getResourceString("Rename_module_in_all_other_Enterprise_Applications_4"); //$NON-NLS-1$
- String RENAME_MODULE_DEPENDENCIES = J2EEUIMessages.getResourceString("Rename_module_dependencies_referencing_selected_project_5"); //$NON-NLS-1$
- String RENAME_MODULE_OPTIONS = J2EEUIMessages.getResourceString("Rename_Module_Options_6"); //$NON-NLS-1$
- String RENAME_EAR_OPTIONS = J2EEUIMessages.getResourceString("Rename_Enterprise_Application_Options_7"); //$NON-NLS-1$
- String RENAME_NOT_COMPLETED = J2EEUIMessages.getResourceString("Rename_could_not_be_completed_8"); //$NON-NLS-1$
- String RENAME_ERROR = J2EEUIMessages.getResourceString("Rename_error_9"); //$NON-NLS-1$
- String RENAME_DIALOG_MESSAGE = J2EEUIMessages.getResourceString("What_would_you_like_to_rename_this_to__10"); //$NON-NLS-1$
- String RENAME_CONTEXT_ROOT = J2EEUIMessages.getResourceString("Context_Root__11"); //$NON-NLS-1$
- String RENAME_EAR_PROJECTS = J2EEUIMessages.getResourceString("Rename_selected_Enterprise_Application_project_only_12"); //$NON-NLS-1$
- String RENAME_REFERENCED_PROJECTS = J2EEUIMessages.getResourceString("Also_rename_module_and_utility_Java_projects_13"); //$NON-NLS-1$
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/ListMessageDialog.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/ListMessageDialog.java
deleted file mode 100644
index 8808b1db2..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/ListMessageDialog.java
+++ /dev/null
@@ -1,211 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 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.jst.j2ee.internal.dialogs;
-
-
-
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.List;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * Insert the type's description here. Creation date: (9/7/2001 11:28:24 AM)
- *
- * @author: Administrator
- */
-public class ListMessageDialog extends org.eclipse.jface.dialogs.MessageDialog {
- protected String[] listItems;
- protected List list;
-
- /**
- * EJBSelectiveImportDialog constructor comment.
- *
- * @param parentShell
- * org.eclipse.swt.widgets.Shell
- * @param dialogTitle
- * java.lang.String
- * @param dialogTitleImage
- * org.eclipse.swt.graphics.Image
- * @param dialogMessage
- * java.lang.String
- * @param dialogImageType
- * int
- * @param dialogButtonLabels
- * java.lang.String[]
- * @param defaultIndex
- * int
- */
- public ListMessageDialog(org.eclipse.swt.widgets.Shell parentShell, String dialogTitle, org.eclipse.swt.graphics.Image dialogTitleImage, String dialogMessage, int dialogImageType, java.lang.String[] dialogButtonLabels, int defaultIndex) {
- super(parentShell, dialogTitle, dialogTitleImage, dialogMessage, dialogImageType, dialogButtonLabels, defaultIndex);
- }
-
- /**
- * ListMessageDialog constructor comment.
- *
- * @param parentShell
- * org.eclipse.swt.widgets.Shell
- * @param dialogTitle
- * java.lang.String
- * @param dialogTitleImage
- * org.eclipse.swt.graphics.Image
- * @param dialogMessage
- * java.lang.String
- * @param dialogImageType
- * int
- * @param dialogButtonLabels
- * java.lang.String[]
- * @param defaultIndex
- * int
- */
- public ListMessageDialog(org.eclipse.swt.widgets.Shell parentShell, String dialogTitle, org.eclipse.swt.graphics.Image dialogTitleImage, String dialogMessage, int dialogImageType, java.lang.String[] dialogButtonLabels, int defaultIndex, String[] names) {
- super(parentShell, dialogTitle, dialogTitleImage, dialogMessage, dialogImageType, dialogButtonLabels, defaultIndex);
- listItems = names;
- }
-
- /**
- * Creates and returns the contents of an area of the dialog which appears below the message and
- * above the button bar.
- * <p>
- * The default implementation of this framework method returns <code>null</code>. Subclasses
- * may override.
- * </p>
- *
- * @param the
- * parent composite to contain the custom area
- * @return the custom area control, or <code>null</code>
- */
- protected Control createCustomArea(Composite parent) {
-
- Composite composite = new Composite(parent, 0);
- GridLayout layout = new GridLayout();
- layout.numColumns = 1;
- layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
- layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
- layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- if (listItems != null) {
- list = new List(composite, SWT.BORDER);
- GridData data = new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_CENTER);
- list.setLayoutData(data);
- list.setItems(listItems);
- }
-
- return composite;
-
- }
-
- /**
- * Convenience method to open a simple confirm (OK/Cancel) dialog.
- *
- * @param parent
- * the parent shell of the dialog, or <code>null</code> if none
- * @param title
- * the dialog's title, or <code>null</code> if none
- * @param message
- * the message
- * @return <code>true</code> if the user presses the OK button, <code>false</code> otherwise
- */
- public static boolean openConfirm(Shell parent, String title, String message, String[] items) {
- ListMessageDialog dialog = new ListMessageDialog(parent, title, null, // accept the default
- // window icon
- message, QUESTION, new String[]{IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL}, 0, items); // OK
- // is
- // the
- // default
- return dialog.open() == 0;
- }
-
- /**
- * Convenience method to open a standard error dialog.
- *
- * @param parent
- * the parent shell of the dialog, or <code>null</code> if none
- * @param title
- * the dialog's title, or <code>null</code> if none
- * @param message
- * the message
- */
- public static void openError(Shell parent, String title, String message, String[] items) {
- ListMessageDialog dialog = new ListMessageDialog(parent, title, null, // accept the default
- // window icon
- message, ERROR, new String[]{IDialogConstants.OK_LABEL}, 0, items); // ok is the
- // default
- dialog.open();
- return;
- }
-
- /**
- * Convenience method to open a standard information dialog.
- *
- * @param parent
- * the parent shell of the dialog, or <code>null</code> if none
- * @param title
- * the dialog's title, or <code>null</code> if none
- * @param message
- * the message
- */
- public static void openInformation(Shell parent, String title, String message, String[] items) {
- ListMessageDialog dialog = new ListMessageDialog(parent, title, null, // accept the default
- // window icon
- message, INFORMATION, new String[]{IDialogConstants.OK_LABEL}, 0, items);
- // ok is the default
- dialog.open();
- return;
- }
-
- /**
- * Convenience method to open a simple Yes/No question dialog.
- *
- * @param parent
- * the parent shell of the dialog, or <code>null</code> if none
- * @param title
- * the dialog's title, or <code>null</code> if none
- * @param message
- * the message
- * @return <code>true</code> if the user presses the OK button, <code>false</code> otherwise
- */
- public static boolean openQuestion(Shell parent, String title, String message, String[] items) {
- ListMessageDialog dialog = new ListMessageDialog(parent, title, null, // accept the default
- // window icon
- message, QUESTION, new String[]{IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL}, 0, items); // yes
- // is
- // the
- // default
- return dialog.open() == 0;
- }
-
- /**
- * Convenience method to open a standard warning dialog.
- *
- * @param parent
- * the parent shell of the dialog, or <code>null</code> if none
- * @param title
- * the dialog's title, or <code>null</code> if none
- * @param message
- * the message
- */
- public static void openWarning(Shell parent, String title, String message, String[] items) {
- ListMessageDialog dialog = new ListMessageDialog(parent, title, null, // accept the default
- // window icon
- message, WARNING, new String[]{IDialogConstants.OK_LABEL}, 0, items); // ok is
- // the
- // default
- dialog.open();
- return;
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/RenameEARComposite.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/RenameEARComposite.java
deleted file mode 100644
index c74e3b81d..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/RenameEARComposite.java
+++ /dev/null
@@ -1,265 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 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.jst.j2ee.internal.dialogs;
-
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.viewers.CheckStateChangedEvent;
-import org.eclipse.jface.viewers.CheckboxTableViewer;
-import org.eclipse.jface.viewers.ICheckStateListener;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.ViewerSorter;
-import org.eclipse.jst.j2ee.internal.rename.RenameOptions;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.ui.model.WorkbenchLabelProvider;
-
-
-public class RenameEARComposite extends Composite implements J2EERenameUIConstants, Listener, ICheckStateListener {
-
- protected Button renameAppProjectsBtn;
- protected Button renameRefProjectsBtn;
- protected Composite radioComposite;
- protected Button detailsBtn;
- protected RenameModuleReferencesComposite moduleRefsComposite;
- protected CheckboxTableViewer projectsList;
- protected boolean listCreated = false;
- protected Map referencedProjects;
- protected WorkbenchLabelProvider workbenchLabelProvider = new WorkbenchLabelProvider();
-
- /**
- * Constructor for RenameEARComposite.
- *
- * @param parent
- * @param style
- */
- public RenameEARComposite(Composite parent, int style, Set referencedProjects) {
- super(parent, style);
- initReferencedProjects(referencedProjects);
- addChildren();
- }
-
- /**
- * Answer the referenced projects which the user has chosen to also rename
- */
- public java.util.List getSelectedReferencedProjects() {
- if (renameAppProjectsBtn.getSelection())
- return Collections.EMPTY_LIST;
- java.util.List result = new ArrayList();
- for (Iterator iter = referencedProjects.entrySet().iterator(); iter.hasNext();) {
- Map.Entry element = (Map.Entry) iter.next();
- boolean isSelected = ((Boolean) element.getValue()).booleanValue();
- if (isSelected)
- result.add(element.getKey());
- }
- return result;
- }
-
- /**
- * @see J2EERenameDialog#createRenameOptions()
- */
- public RenameOptions createRenameOptions() {
- RenameOptions opts = new RenameOptions();
- opts.setIsEARRename(true);
- opts.setRenameProjects(true);
- opts.setRenameModuleDependencies(moduleRefsComposite.shouldRenameModuleDependencies());
- opts.setRenameModules(moduleRefsComposite.shouldRenameModules());
- opts.setSelectedReferencedProjects(getSelectedReferencedProjects());
- return opts;
- }
-
-
-
- protected void initReferencedProjects(Set projects) {
- referencedProjects = new HashMap();
- for (Iterator iter = projects.iterator(); iter.hasNext();) {
- IProject project = (IProject) iter.next();
- referencedProjects.put(project, Boolean.TRUE);
- }
- }
-
- protected void addChildren() {
- setLayout();
- addRadioComposite();
- moduleRefsComposite = new RenameModuleReferencesComposite(this, SWT.NONE, true);
- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
- data.horizontalIndent = 10;
- moduleRefsComposite.setLayoutData(data);
- }
-
- protected void setLayout() {
- GridLayout lay = new GridLayout();
- lay.numColumns = 1;
- setLayout(lay);
- GridData data = new GridData(GridData.FILL_BOTH);
- setLayoutData(data);
- }
-
- protected void addRadioComposite() {
- radioComposite = new Composite(this, SWT.NONE);
- GridLayout lay = new GridLayout();
- lay.numColumns = 2;
- radioComposite.setLayout(lay);
- GridData data = new GridData(GridData.FILL_BOTH);
- radioComposite.setLayoutData(data);
- renameAppProjectsBtn = new Button(radioComposite, SWT.RADIO);
- renameAppProjectsBtn.setText(RENAME_EAR_PROJECTS);
- renameAppProjectsBtn.addListener(SWT.Selection, this);
- data = new GridData(GridData.FILL_HORIZONTAL);
- data.horizontalSpan = 2;
- renameAppProjectsBtn.setLayoutData(data);
-
- renameRefProjectsBtn = new Button(radioComposite, SWT.RADIO);
- renameRefProjectsBtn.setText(RENAME_REFERENCED_PROJECTS);
- renameRefProjectsBtn.addListener(SWT.Selection, this);
- renameRefProjectsBtn.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
- detailsBtn = new Button(radioComposite, SWT.PUSH);
- detailsBtn.setText(IDialogConstants.SHOW_DETAILS_LABEL);
- detailsBtn.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
- detailsBtn.addListener(SWT.Selection, this);
- detailsBtn.setEnabled(false);
- }
-
- /**
- * @see Listener#handleEvent(Event)
- */
- public void handleEvent(Event event) {
- if (event.widget == renameAppProjectsBtn)
- renameAppProjectsBtnSelected();
- else if (event.widget == renameRefProjectsBtn)
- renameRefProjectsBtnSelected();
- else if (event.widget == detailsBtn)
- detailsBtnSelected();
- }
-
- protected void renameAppProjectsBtnSelected() {
- if (renameAppProjectsBtn.getSelection()) {
- if (listCreated)
- toggleDetailsArea();
- detailsBtn.setEnabled(false);
- moduleRefsComposite.setButtonsEnabled(false);
- }
- }
-
- protected void renameRefProjectsBtnSelected() {
- if (renameRefProjectsBtn.getSelection()) {
- detailsBtn.setEnabled(true);
- moduleRefsComposite.setButtonsEnabled(true);
- }
- }
-
- /**
- * Toggles the unfolding of the details area. This is triggered by the user pressing the details
- * button.
- */
- protected void toggleDetailsArea() {
- Point windowSize = getShell().getSize();
- Point oldSize = getParent().computeSize(SWT.DEFAULT, SWT.DEFAULT);
-
- if (listCreated) {
- projectsList.getControl().dispose();
- listCreated = false;
- detailsBtn.setText(IDialogConstants.SHOW_DETAILS_LABEL);
- } else {
- createDropDownList();
- detailsBtn.setText(IDialogConstants.HIDE_DETAILS_LABEL);
- }
-
- Point newSize = getParent().computeSize(SWT.DEFAULT, SWT.DEFAULT);
-
- getShell().setSize(new Point(windowSize.x, windowSize.y + (newSize.y - oldSize.y)));
- }
-
- protected void createDropDownList() {
- // create the list
- projectsList = CheckboxTableViewer.newCheckList(radioComposite, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
- projectsList.setLabelProvider(createLabelProvider());
- projectsList.setSorter(new ViewerSorter() {/*viewersorter*/});
- projectsList.addCheckStateListener(this);
- // fill the list
- populateList();
-
- GridData data = new GridData(GridData.FILL_BOTH);
- data.heightHint = projectsList.getTable().getItemHeight() * referencedProjects.size();
- data.horizontalSpan = 2;
- data.horizontalIndent = 10;
- projectsList.getTable().setLayoutData(data);
-
- listCreated = true;
- }
-
- protected void populateList() {
- for (Iterator iter = referencedProjects.entrySet().iterator(); iter.hasNext();) {
- Map.Entry entry = (Map.Entry) iter.next();
- projectsList.add(entry.getKey());
- boolean checked = ((Boolean) entry.getValue()).booleanValue();
- projectsList.setChecked(entry.getKey(), checked);
- }
- }
-
- protected void detailsBtnSelected() {
- toggleDetailsArea();
- }
-
- /**
- * @see ICheckStateListener#checkStateChanged(CheckStateChangedEvent)
- */
- public void checkStateChanged(CheckStateChangedEvent event) {
- referencedProjects.put(event.getElement(), new Boolean(event.getChecked()));
- }
-
- protected ITableLabelProvider createLabelProvider() {
- return new ITableLabelProvider() {
- public void dispose() {
- //dispose
- }
-
- public Image getColumnImage(Object element, int columnIndex) {
- return workbenchLabelProvider.getImage(element);
- }
-
- /**
- * @see ITableLabelProvider#getColumnText(Object, int)
- */
- public String getColumnText(Object element, int columnIndex) {
- return workbenchLabelProvider.getText(element);
- }
-
- public void addListener(ILabelProviderListener listener) {
- //do nothing
- }
-
- public boolean isLabelProperty(Object element, String property) {
- return false;
- }
-
- public void removeListener(ILabelProviderListener listener) {
- //do nothing
- }
- };
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/RenameEARDialog.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/RenameEARDialog.java
deleted file mode 100644
index 770e058c6..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/RenameEARDialog.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.jst.j2ee.internal.dialogs;
-
-
-import java.util.Set;
-
-import org.eclipse.jst.j2ee.internal.actions.IJ2EEUIContextIds;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.PlatformUI;
-
-public class RenameEARDialog extends J2EERenameDialog {
- protected RenameEARComposite renameComposite;
- protected Set referencedProjects;
-
- /**
- * Constructor for RenameEARDialog.
- *
- * @param parentShell
- * @param dialogTitle
- */
- public RenameEARDialog(Shell parentShell, Set referencedProjects, String name) {
- super(parentShell, RENAME_EAR_OPTIONS, name);
- this.referencedProjects = referencedProjects;
- }
-
-
- /**
- * @see org.eclipse.jface.dialogs.MessageDialog#createCustomArea(Composite)
- */
- protected Control createCustomArea(Composite parent) {
- PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IJ2EEUIContextIds.RENAME_EAR_DIALOG_1); //$NON-NLS-1$
- renameComposite = new RenameEARComposite(parent, SWT.NONE, referencedProjects);
- // renameComposite.setNewName(currentName);
- GridData data = new GridData(GridData.FILL_BOTH);
- data.horizontalIndent = 10;
- renameComposite.setLayoutData(data);
- return renameComposite;
- }
-
- /**
- * @see J2EERenameDialog#createRenameOptions()
- */
- public void createRenameOptions() {
- renameOptions = renameComposite.createRenameOptions();
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/RenameModuleComposite.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/RenameModuleComposite.java
deleted file mode 100644
index 0923fced8..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/RenameModuleComposite.java
+++ /dev/null
@@ -1,181 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2003, 2004 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.jst.j2ee.internal.dialogs;
-
-
-import java.text.MessageFormat;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.jface.resource.JFaceColors;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIMessages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Text;
-
-
-public class RenameModuleComposite extends Composite implements J2EERenameUIConstants, Listener {
-
- // protected Button renameProjectsCheckBox;
- protected RenameModuleReferencesComposite moduleRefsComposite;
- protected Text newNameText = null;
- protected Text newContextRootText = null;
- protected Label newContextRootLabel = null;
- protected String oldName = null;
- protected Button OKButton = null;
- protected Label statusMessageLabel = null;
-
- /**
- * Constructor for RenameModuleComposite.
- *
- * @param parent
- * @param style
- */
- public RenameModuleComposite(Composite parent, int style) {
- super(parent, style);
- addChildren();
- }
-
- protected void addChildren() {
- addRenameProjectsGroup();
- addSeparator();
- addRenameModuleRefsComposite();
- //Add in a label for status messages if required
- statusMessageLabel = new Label(this, SWT.NONE);
- GridData data = new GridData(GridData.FILL_BOTH);
- data.horizontalSpan = 2;
- statusMessageLabel.setLayoutData(data);
- statusMessageLabel.setFont(this.getFont());
- }
-
- protected void addRenameProjectsGroup() {
- GridLayout lay = new GridLayout();
- lay.numColumns = 2;
- setLayout(lay);
- GridData data = new GridData(GridData.FILL_BOTH);
- setLayoutData(data);
-
- newNameText = new Text(this, SWT.BORDER);
- data = new GridData(GridData.FILL_HORIZONTAL);
- data.horizontalSpan = 2;
- newNameText.setLayoutData(data);
-
- newContextRootLabel = new Label(this, SWT.NONE);
- newContextRootLabel.setText(RENAME_CONTEXT_ROOT);
- data = new GridData(GridData.FILL_HORIZONTAL);
- newContextRootLabel.setLayoutData(data);
-
- newContextRootText = new Text(this, SWT.BORDER);
- data = new GridData(GridData.FILL_HORIZONTAL);
- newContextRootText.setLayoutData(data);
-
- /*
- * renameProjectsCheckBox = new Button(this, SWT.CHECK);
- * renameProjectsCheckBox.setText(RENAME_PROJECTS);
- * renameProjectsCheckBox.setSelection(true);
- * renameProjectsCheckBox.addListener(SWT.Selection, this); data = new
- * GridData(GridData.FILL_HORIZONTAL); data.horizontalSpan = 2;
- * renameProjectsCheckBox.setLayoutData(data);
- */
- }
-
- protected void addRenameModuleRefsComposite() {
- moduleRefsComposite = new RenameModuleReferencesComposite(this, SWT.NONE, false);
- }
-
- protected void addSeparator() {
- Label sep = new Label(this, SWT.SEPARATOR | SWT.HORIZONTAL);
- GridData data = new GridData(GridData.FILL_HORIZONTAL);
- data.horizontalSpan = 2;
- sep.setLayoutData(data);
- }
-
- public boolean shouldRenameProjects() {
- // return renameProjectsCheckBox.getSelection();
- // always rename the project
- return true;
- }
-
- public boolean shouldRenameModuleDependencies() {
- return moduleRefsComposite.shouldRenameModuleDependencies();
- }
-
- public boolean shouldRenameModules() {
- return moduleRefsComposite.shouldRenameModules();
- }
-
- /**
- * @see Listener#handleEvent(Event)
- */
- public void handleEvent(Event event) {
- if (event.widget == newNameText && OKButton != null) {
- String newName = newNameText.getText();
- if (newName.trim().length() == 0) {
- statusMessageLabel.setText("");//$NON-NLS-1$
- OKButton.setEnabled(false);
- return;
- }
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- IProject newProject = root.getProject(newName);
- if (newProject.exists()) {
- statusMessageLabel.setForeground(JFaceColors.getErrorText(statusMessageLabel.getDisplay()));
- String[] names = {newName};
- statusMessageLabel.setText(MessageFormat.format(J2EEUIMessages.getResourceString("Project_already_exists."), names)); //$NON-NLS-1$
- OKButton.setEnabled(false);
- } else {
- statusMessageLabel.setText("");//$NON-NLS-1$
- OKButton.setEnabled(true);
- }
- }
- }
-
- public String getNewName()
-
- {
- return newNameText.getText();
- }
-
- public void setNewName(String newName) {
- oldName = newName;
- newNameText.setText(newName);
- newNameText.selectAll();
- newNameText.addListener(SWT.Modify, this);
- }
-
- public String getNewContextRoot() {
- return newContextRootText.getText();
- }
-
- public void setNewContextRoot(String newContextRoot) {
- if (newContextRoot != null && newContextRoot.length() > 1) {
- newContextRootText.setText(newContextRoot);
- } else {
- newContextRootLabel.setVisible(false);
- newContextRootText.setVisible(false);
- }
- }
-
- /**
- * Sets the OKButton.
- *
- * @param OKButton
- * The OKButton to set
- */
- public void setOKButton(Button oKButton) {
- OKButton = oKButton;
- OKButton.setEnabled(false);
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/RenameModuleDialog.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/RenameModuleDialog.java
deleted file mode 100644
index a5ea814b8..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/RenameModuleDialog.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 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.jst.j2ee.internal.dialogs;
-
-
-
-import org.eclipse.jst.j2ee.internal.actions.IJ2EEUIContextIds;
-import org.eclipse.jst.j2ee.internal.rename.RenameOptions;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.PlatformUI;
-
-
-public class RenameModuleDialog extends J2EERenameDialog implements J2EERenameUIConstants {
-
- protected RenameModuleComposite renameComposite;
- protected String contextRoot = null;
-
- public RenameModuleDialog(Shell parentShell, String name, String oldContextRoot) {
- super(parentShell, RENAME_MODULE_OPTIONS, name);
- contextRoot = oldContextRoot;
- }
-
- protected Control createCustomArea(Composite parent) {
- PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IJ2EEUIContextIds.RENAME_MODULE_DIALOG_1); //$NON-NLS-1$
- renameComposite = new RenameModuleComposite(parent, SWT.NONE);
- renameComposite.setNewName(currentName);
- GridData data = new GridData(GridData.FILL_BOTH);
- data.horizontalIndent = 10;
- renameComposite.setLayoutData(data);
- renameComposite.setNewContextRoot(contextRoot);
- return renameComposite;
- }
-
- public void createRenameOptions() {
- renameOptions = new RenameOptions();
- renameOptions.setRenameProjects(renameComposite.shouldRenameProjects());
- renameOptions.setRenameModules(renameComposite.shouldRenameModules());
- renameOptions.setRenameModuleDependencies(renameComposite.shouldRenameModuleDependencies());
- renameOptions.setNewName(renameComposite.getNewName());
- renameOptions.setNewContextRoot(renameComposite.getNewContextRoot());
- }
-
- /*
- * (non-Javadoc) Method declared on Dialog.
- */
- protected void createButtonsForButtonBar(Composite parent) {
- Button OKButton = null;
- super.createButtonsForButtonBar(parent);
- OKButton = getButton(0);
- renameComposite.setOKButton(OKButton);
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/RenameModuleReferencesComposite.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/RenameModuleReferencesComposite.java
deleted file mode 100644
index 7614aabb0..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/RenameModuleReferencesComposite.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2003, 2004 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.jst.j2ee.internal.dialogs;
-
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-
-public class RenameModuleReferencesComposite extends Composite implements J2EERenameUIConstants, Listener {
-
- protected Button renameModulesCheckbox;
- protected Button renameModuleDependenciesCheckbox;
- protected boolean isEARRename;
-
- /**
- * Constructor for RenameModuleReferencesComposite.
- *
- * @param parent
- * @param style
- */
- public RenameModuleReferencesComposite(Composite parent, int style, boolean isEARRename) {
- super(parent, style);
- this.isEARRename = isEARRename;
- addChildren();
- }
-
- protected void addChildren() {
- GridLayout lay = new GridLayout();
- lay.numColumns = 1;
- setLayout(lay);
- GridData data = new GridData(GridData.FILL_BOTH);
- data.horizontalSpan = 2;
- setLayoutData(data);
-
- addRenameModulesCheckbox();
- addRenameModuleDependenciesCheckbox();
- }
-
- protected void addRenameModuleDependenciesCheckbox() {
- renameModuleDependenciesCheckbox = new Button(this, SWT.CHECK);
- renameModuleDependenciesCheckbox.setSelection(true);
- renameModuleDependenciesCheckbox.setText(RENAME_MODULE_DEPENDENCIES);
-
- }
-
- protected void addRenameModulesCheckbox() {
- renameModulesCheckbox = new Button(this, SWT.CHECK);
- renameModulesCheckbox.setSelection(true);
- String label = isEARRename ? RENAME_MODULES_OTHER : RENAME_MODULES;
- renameModulesCheckbox.setText(label);
- renameModulesCheckbox.addListener(SWT.Selection, this);
- }
-
- public boolean shouldRenameModuleDependencies() {
- return renameModuleDependenciesCheckbox.getSelection();
- }
-
- public boolean shouldRenameModules() {
- return renameModulesCheckbox.getSelection();
- }
-
- public void setButtonsEnabled(boolean enabled) {
- renameModuleDependenciesCheckbox.setSelection(enabled);
- renameModulesCheckbox.setSelection(enabled);
- renameModuleDependenciesCheckbox.setEnabled(enabled);
- renameModulesCheckbox.setEnabled(enabled);
- }
-
- /**
- * @see Listener#handleEvent(Event)
- */
- public void handleEvent(Event event) {
- if (event.widget == renameModulesCheckbox && renameModulesCheckbox.getSelection() && !renameModuleDependenciesCheckbox.getSelection())
- renameModuleDependenciesCheckbox.setSelection(true);
- }
-
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/RuntimeSelectionDialog.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/RuntimeSelectionDialog.java
deleted file mode 100644
index a49b9220a..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/RuntimeSelectionDialog.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*******************************************************************************
- * 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.jst.j2ee.internal.dialogs;
-
-import java.text.MessageFormat;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIMessages;
-import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.dialogs.PreferencesUtil;
-import org.eclipse.ui.forms.events.IHyperlinkListener;
-import org.eclipse.ui.forms.widgets.Hyperlink;
-import org.eclipse.wst.server.core.IRuntime;
-
-
-/**
- * @author Administrator
- *
- */
-public class RuntimeSelectionDialog extends MessageDialog {
- private IProject project = null;
- private String configuredMessage;
-
- /**
- * @param parentShell
- * @param dialogTitle
- * @param dialogTitleImage
- * @param dialogMessage
- * @param dialogImageType
- * @param dialogButtonLabels
- * @param defaultIndex
- */
- public RuntimeSelectionDialog(Shell parentShell, String dialogTitle,
- Image dialogTitleImage, String dialogMessage, int dialogImageType,
- String[] dialogButtonLabels, int defaultIndex, IProject project) {
- super(parentShell, dialogTitle, dialogTitleImage, dialogMessage,
- dialogImageType, dialogButtonLabels, defaultIndex);
- this.project = project;
- this.configuredMessage = MessageFormat.format(J2EEUIMessages.getResourceString("DEPLOY_RUNTIME_CONFIGURED"), new String []{project.getName()});
- }
-
- protected Control createCustomArea(Composite parent) {
-
- //Composite composite = new Composite(parent, 0);
- createHyperLink(parent);
- return parent;
-
- }
-
- private void createHyperLink(Composite parent) {
- Hyperlink link = new Hyperlink(parent,SWT.None);
- GridData layout = new GridData(GridData.HORIZONTAL_ALIGN_END);
- layout.horizontalSpan = 2;
- link.setLayoutData(layout);
- link.setUnderlined(true);
- Color color = new Color(parent.getDisplay(),new RGB(0,0,255) );
- link.setForeground(color);
- link.setText("Configure Target Runtime...");
- link.addHyperlinkListener(new IHyperlinkListener() {
- public static final String DATA_NO_LINK = "PropertyAndPreferencePage.nolink"; //$NON-NLS-1$
-
- public void linkEntered(org.eclipse.ui.forms.events.HyperlinkEvent e) {
- }
-
- public void linkExited(org.eclipse.ui.forms.events.HyperlinkEvent e) {
- }
-
- public void linkActivated(org.eclipse.ui.forms.events.HyperlinkEvent e) {
- String id = getPreferencePageID();
- PreferencesUtil.createPropertyDialogOn(getShell(), project, id, new String[]{id}, DATA_NO_LINK).open(); //
- //(getShell(), id, new String[]{id}, DATA_NO_LINK).open();
- try {
- updateWidgets();
- } catch (Exception ie) {
-
- }
- }
-
- private String getPreferencePageID() {
- return "org.eclipse.wst.common.project.facet.ui.internal.RuntimesPropertyPage";
- }
- });
-
- }
-
- private void updateWidgets() {
- if (getTargetRuntime() != null) {
- messageLabel.setText(configuredMessage);
- imageLabel.setImage(this.getInfoImage());
- } else {
- messageLabel.setText(message);
- imageLabel.setImage(getErrorImage());
- }
-
- }
-
- private IRuntime getTargetRuntime() {
- try {
- IRuntime runtime = J2EEProjectUtilities.getServerRuntime(project);
- return runtime;
- } catch (CoreException e) {
- e.printStackTrace();
- }
- return null;
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/TwoArrayQuickSorter.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/TwoArrayQuickSorter.java
deleted file mode 100644
index 62d6907f2..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/TwoArrayQuickSorter.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 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.jst.j2ee.internal.dialogs;
-
-/**
- * @author jialin
- *
- * To change the template for this generated type comment go to Window -
- * Preferences - Java - Code Generation - Code and Comments
- */
-import java.util.Comparator;
-
-import org.eclipse.jface.util.Assert;
-
-/**
- * Quick sort to sort key-value pairs. The keys and arrays are specified in
- * separate arrays.
- *
- * @plannedfor 2.0
- */
-public class TwoArrayQuickSorter {
-
- private Comparator fComparator;
-
- /**
- * Default comparator.
- */
- public static final class StringComparator implements Comparator {
- private boolean fIgnoreCase;
-
- StringComparator(boolean ignoreCase) {
- fIgnoreCase = ignoreCase;
- }
-
- public int compare(Object left, Object right) {
- return fIgnoreCase ? ((String) left).compareToIgnoreCase((String) right) : ((String) left).compareTo((String) right);
- }
- }
-
- /**
- * Creates a sorter with default string comparator. The keys are assumed to
- * be strings.
- *
- * @param ignoreCase
- * specifies whether sorting is case sensitive or not.
- */
- public TwoArrayQuickSorter(boolean ignoreCase) {
- fComparator = new StringComparator(ignoreCase);
- }
-
- /**
- * Creates a sorter with a comparator.
- *
- * @param comparator
- * the comparator to order the elements. The comparator must not
- * be <code>null</code>.
- */
- public TwoArrayQuickSorter(Comparator comparator) {
- fComparator = comparator;
- }
-
- /**
- * Sorts keys and values in parallel.
- *
- * @param keys
- * the keys to use for sorting.
- * @param values
- * the values associated with the keys.
- */
- public void sort(Object[] keys, Object[] values) {
- if ((keys == null) || (values == null)) {
- Assert.isTrue(false, "Either keys or values in null"); //$NON-NLS-1$
- return;
- }
-
- if (keys.length <= 1)
- return;
-
- internalSort(keys, values, 0, keys.length - 1);
- }
-
- private void internalSort(Object[] keys, Object[] values, int left, int right) {
- int original_left = left;
- int original_right = right;
-
- Object mid = keys[(left + right) / 2];
- do {
- while (fComparator.compare(keys[left], mid) < 0)
- left++;
-
- while (fComparator.compare(mid, keys[right]) < 0)
- right--;
-
- if (left <= right) {
- swap(keys, left, right);
- swap(values, left, right);
- left++;
- right--;
- }
- } while (left <= right);
-
- if (original_left < right)
- internalSort(keys, values, original_left, right);
-
- if (left < original_right)
- internalSort(keys, values, left, original_right);
- }
-
- /*
- * Swaps x[a] with x[b].
- */
- private static final void swap(Object x[], int a, int b) {
- Object t = x[a];
- x[a] = x[b];
- x[b] = t;
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/TypeJavaSearchScope.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/TypeJavaSearchScope.java
deleted file mode 100644
index 6c430f694..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/TypeJavaSearchScope.java
+++ /dev/null
@@ -1,352 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 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.jst.j2ee.internal.dialogs;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaModel;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IMember;
-import org.eclipse.jdt.core.IOpenable;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.search.IJavaSearchScope;
-
-/**
- * This class was derived from JavaSearchScope as that class did not have a
- * provision to exclude classpath entries that are not exported A Java-specific
- * scope for searching relative to one or more java elements.
- */
-public class TypeJavaSearchScope implements IJavaSearchScope {
-
- private boolean includeExportedClassPathEntriesOnly = true;
-
- private ArrayList elements;
-
- /*
- * The paths of the resources in this search scope (or the classpath
- * entries' paths if the resources are projects)
- */
- private IPath[] paths;
- private boolean[] pathWithSubFolders;
- private int pathsCount;
-
- private IPath[] enclosingProjectsAndJars;
-
- public TypeJavaSearchScope() {
- this.initialize();
-
- // disabled for now as this could be expensive
- // JavaModelManager.getJavaModelManager().rememberScope(this);
- }
-
- private void addEnclosingProjectOrJar(IPath path) {
- int length = this.enclosingProjectsAndJars.length;
- for (int i = 0; i < length; i++) {
- if (this.enclosingProjectsAndJars[i].equals(path))
- return;
- }
- System.arraycopy(this.enclosingProjectsAndJars, 0, this.enclosingProjectsAndJars = new IPath[length + 1], 0, length);
- this.enclosingProjectsAndJars[length] = path;
- }
-
- /**
- * Method addProject. This method adds all the classpath entries for the
- * current project to the search scope.
- *
- * @param javaProject
- * @param includesPrereqProjects
- * @param visitedProjects
- * @throws JavaModelException
- */
- public void addProject(IJavaProject javaProject, boolean includesPrereqProjects, HashSet visitedProjects) throws JavaModelException {
- IProject project = javaProject.getProject();
- if (!project.isAccessible() || !visitedProjects.add(project))
- return;
-
- this.addEnclosingProjectOrJar(project.getFullPath());
-
- IClasspathEntry[] entries = javaProject.getResolvedClasspath(true);
- IJavaModel model = javaProject.getJavaModel();
- for (int i = 0, length = entries.length; i < length; i++) {
- IClasspathEntry entry = entries[i];
- switch (entry.getEntryKind()) {
- case IClasspathEntry.CPE_LIBRARY :
- IPath path = entry.getPath();
- this.add(path, true);
- this.addEnclosingProjectOrJar(path);
- break;
- case IClasspathEntry.CPE_PROJECT :
- if (includesPrereqProjects) {
- this.add(model.getJavaProject(entry.getPath().lastSegment()), true, visitedProjects);
- }
- break;
- case IClasspathEntry.CPE_SOURCE :
- this.add(entry.getPath(), true);
- break;
- }
- }
- }
-
- /**
- * Method add. This method filters out all the classpath entries of the
- * project which are not exported.
- *
- * @param javaProject
- * @param includesPrereqProjects
- * @param visitedProjects
- * @throws JavaModelException
- */
- public void add(IJavaProject javaProject, boolean includesPrereqProjects, HashSet visitedProjects) throws JavaModelException {
- IProject project = javaProject.getProject();
- if (!project.isAccessible() || !visitedProjects.add(project))
- return;
-
- this.addEnclosingProjectOrJar(project.getFullPath());
-
- IClasspathEntry[] entries = javaProject.getResolvedClasspath(true);
- IJavaModel model = javaProject.getJavaModel();
- for (int i = 0, length = entries.length; i < length; i++) {
- IClasspathEntry entry = entries[i];
- if (includeExportedClassPathEntriesOnly()) {
- if (!entry.isExported() && entry.getEntryKind() != IClasspathEntry.CPE_SOURCE)
- continue;
- }
- switch (entry.getEntryKind()) {
- case IClasspathEntry.CPE_LIBRARY :
- IPath path = entry.getPath();
- this.add(path, true);
- this.addEnclosingProjectOrJar(path);
- break;
- case IClasspathEntry.CPE_PROJECT :
- if (includesPrereqProjects) {
- this.add(model.getJavaProject(entry.getPath().lastSegment()), true, visitedProjects);
- }
- break;
- case IClasspathEntry.CPE_SOURCE :
- this.add(entry.getPath(), true);
- break;
- }
- }
- }
- public void add(IJavaElement element) throws JavaModelException {
- IPackageFragmentRoot root = null;
- switch (element.getElementType()) {
- case IJavaElement.JAVA_MODEL :
- // a workspace sope should be used
- break;
- case IJavaElement.JAVA_PROJECT :
- this.add((IJavaProject) element, true, new HashSet(2));
- break;
- case IJavaElement.PACKAGE_FRAGMENT_ROOT :
- root = (IPackageFragmentRoot) element;
- this.add(root.getPath(), true);
- break;
- case IJavaElement.PACKAGE_FRAGMENT :
- root = (IPackageFragmentRoot) element.getParent();
- if (root.isArchive()) {
- this.add(root.getPath().append(new Path(element.getElementName().replace('.', '/'))), false);
- } else {
- IResource resource = element.getUnderlyingResource();
- if (resource != null && resource.isAccessible()) {
- this.add(resource.getFullPath(), false);
- }
- }
- break;
- default :
- // remember sub-cu (or sub-class file) java elements
- if (element instanceof IMember) {
- if (this.elements == null) {
- this.elements = new ArrayList();
- }
- this.elements.add(element);
- }
- this.add(this.fullPath(element), true);
-
- // find package fragment root including this java element
- IJavaElement parent = element.getParent();
- while (parent != null && !(parent instanceof IPackageFragmentRoot)) {
- parent = parent.getParent();
- }
- if (parent instanceof IPackageFragmentRoot) {
- root = (IPackageFragmentRoot) parent;
- }
- }
-
- if (root != null) {
- if (root.getKind() == IPackageFragmentRoot.K_BINARY) {
- this.addEnclosingProjectOrJar(root.getPath());
- } else {
- this.addEnclosingProjectOrJar(root.getJavaProject().getProject().getFullPath());
- }
- }
- }
-
- /**
- * Adds the given path to this search scope. Remember if subfolders need to
- * be included as well.
- */
- private void add(IPath path, boolean withSubFolders) {
- if (this.paths.length == this.pathsCount) {
- System.arraycopy(this.paths, 0, this.paths = new IPath[this.pathsCount * 2], 0, this.pathsCount);
- System.arraycopy(this.pathWithSubFolders, 0, this.pathWithSubFolders = new boolean[this.pathsCount * 2], 0, this.pathsCount);
- }
- this.paths[this.pathsCount] = path;
- this.pathWithSubFolders[this.pathsCount++] = withSubFolders;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see IJavaSearchScope#encloses(String)
- */
- public boolean encloses(String resourcePathString) {
- IPath resourcePath;
- int separatorIndex = resourcePathString.indexOf(JAR_FILE_ENTRY_SEPARATOR);
- if (separatorIndex != -1) {
- resourcePath = new Path(resourcePathString.substring(0, separatorIndex)).append(new Path(resourcePathString.substring(separatorIndex + 1)));
- } else {
- resourcePath = new Path(resourcePathString);
- }
- return this.encloses(resourcePath);
- }
-
- /**
- * Returns whether this search scope encloses the given path.
- */
- private boolean encloses(IPath path) {
- for (int i = 0; i < this.pathsCount; i++) {
- if (this.pathWithSubFolders[i]) {
- if (this.paths[i].isPrefixOf(path)) {
- return true;
- }
- } else {
- IPath scopePath = this.paths[i];
- if (scopePath.isPrefixOf(path) && (scopePath.segmentCount() == path.segmentCount() - 1)) {
- return true;
- }
- }
- }
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see IJavaSearchScope#encloses(IJavaElement)
- */
- public boolean encloses(IJavaElement element) {
- if (this.elements != null) {
- for (int i = 0, length = this.elements.size(); i < length; i++) {
- IJavaElement scopeElement = (IJavaElement) this.elements.get(i);
- IJavaElement searchedElement = element;
- while (searchedElement != null) {
- if (searchedElement.equals(scopeElement)) {
- return true;
- }
- searchedElement = searchedElement.getParent();
- }
- }
- return false;
- }
- return this.encloses(this.fullPath(element));
- }
-
- /*
- * (non-Javadoc)
- *
- * @see IJavaSearchScope#enclosingProjectsAndJars()
- */
- public IPath[] enclosingProjectsAndJars() {
- return this.enclosingProjectsAndJars;
- }
- private IPath fullPath(IJavaElement element) {
- if (element instanceof IPackageFragmentRoot) {
- return ((IPackageFragmentRoot) element).getPath();
- }
- IJavaElement parent = element.getParent();
- IPath parentPath = parent == null ? null : this.fullPath(parent);
- IPath childPath;
- if (element instanceof IPackageFragment) {
- childPath = new Path(element.getElementName().replace('.', '/'));
- } else if (element instanceof IOpenable) {
- childPath = new Path(element.getElementName());
- } else {
- return parentPath;
- }
- return parentPath == null ? childPath : parentPath.append(childPath);
- }
-
- protected void initialize() {
- this.paths = new IPath[1];
- this.pathWithSubFolders = new boolean[1];
- this.pathsCount = 0;
- this.enclosingProjectsAndJars = new IPath[0];
- }
- /**
- * Gets the includeExportedClassPathEntriesOnly.
- *
- * @return Returns a boolean
- */
- public boolean includeExportedClassPathEntriesOnly() {
- return includeExportedClassPathEntriesOnly;
- }
-
- /**
- * Sets the includeExportedClassPathEntriesOnly.
- *
- * @param includeExportedClassPathEntriesOnly
- * The includeExportedClassPathEntriesOnly to set
- */
- public void setIncludeExportedClassPathEntriesOnly(boolean includeExportedClassPathEntriesOnly) {
- this.includeExportedClassPathEntriesOnly = includeExportedClassPathEntriesOnly;
- }
- /**
- * @see IJavaSearchScope#includesBinaries()
- * @deprecated
- */
- public boolean includesBinaries() {
- return true;
- }
-
- /**
- * @see IJavaSearchScope#includesClasspaths()
- * @deprecated
- */
- public boolean includesClasspaths() {
- return true;
- }
-
- /**
- * @see IJavaSearchScope#setIncludesBinaries(boolean)
- * @deprecated
- */
- public void setIncludesBinaries(boolean includesBinaries) {
- //Default nothing
- }
-
- /**
- * @see IJavaSearchScope#setIncludesClasspaths(boolean)
- * @deprecated
- */
- public void setIncludesClasspaths(boolean includesClasspaths) {
- //Default nothing
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/TypeSearchEngine.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/TypeSearchEngine.java
deleted file mode 100644
index 353d443b8..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/TypeSearchEngine.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 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.jst.j2ee.internal.dialogs;
-
-import java.util.HashSet;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.search.IJavaSearchScope;
-import org.eclipse.jdt.core.search.SearchEngine;
-
-public class TypeSearchEngine extends SearchEngine {
-
- /**
- * Constructor for TypeSearchEngine.
- */
- public TypeSearchEngine() {
- super();
- }
-
- /**
- * Constructor for TypeSearchEngine.
- *
- * @param workingCopies
- */
- public TypeSearchEngine(ICompilationUnit[] workingCopies) {
- super(workingCopies);
- }
-
- /**
- * Method createJavaSearchScopeForAProject. Given a project it returns the
- * scope of the classes within the project's scope
- *
- * @param project
- * @param includeReferencedProjects
- * @param includeExportedClassPathEntriesOnly
- * @return IJavaSearchScope
- */
- public static IJavaSearchScope createJavaSearchScopeForAProject(IJavaProject project, boolean includeReferencedProjects, boolean includeExportedClassPathEntriesOnly) {
- if (!includeExportedClassPathEntriesOnly) {
- IJavaElement javaElements[] = new IJavaElement[]{project};
- return SearchEngine.createJavaSearchScope(javaElements, includeReferencedProjects);
- }
- TypeJavaSearchScope scope = new TypeJavaSearchScope();
- scope.setIncludeExportedClassPathEntriesOnly(true);
- HashSet visitedProjects = new HashSet(2);
- try {
- scope.addProject(project, includeReferencedProjects, visitedProjects);
- } catch (JavaModelException e) {
- // ignore
- }
- return scope;
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/TypedFileViewerFilter.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/TypedFileViewerFilter.java
deleted file mode 100644
index 7b4253487..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/TypedFileViewerFilter.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 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.jst.j2ee.internal.dialogs;
-
-import java.util.Hashtable;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.viewers.Viewer;
-
-public class TypedFileViewerFilter extends org.eclipse.jface.viewers.ViewerFilter {
- private String[] fAcceptedExtensions;
- private Hashtable visitedElements;
- public TypedFileViewerFilter(String[] acceptedExtensions) {
- fAcceptedExtensions = acceptedExtensions;
- visitedElements = new Hashtable();
- }
- public boolean isFilterProperty(Object element, Object property) {
- return false;
- }
- public boolean isValid(Object element) {
- if (IFile.class.isInstance(element))
- return isValidFile((IFile) element);
- if (IContainer.class.isInstance(element))
- return isValidContainer((IContainer) element);
- return false;
- }
- /*
- * A valid container is one that contains at least one valid member.
- */
- public boolean isValidContainer(IContainer container) {
- IResource[] members;
- Object valid = visitedElements.get(container);
- if (valid != null)
- return ((Boolean) valid).booleanValue();
- try {
- members = container.members();
- for (int i = 0; i < members.length; i++) {
- if (isValid(members[i])) {
- visitedElements.put(container, Boolean.TRUE);
- return true;
- }
- }
- } catch (CoreException e) {
- // Do nothing
- }
- visitedElements.put(container, Boolean.FALSE);
- return false;
- }
- public boolean isValidFile(IFile file) {
- String ext = file.getFileExtension();
- for (int i = 0; i < fAcceptedExtensions.length; i++) {
- if (fAcceptedExtensions[i].equalsIgnoreCase(ext)) {
- return true;
- }
- }
- return false;
- }
- public boolean select(Viewer viewer, Object parentElement, Object element) {
- return isValid(element);
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ear/actions/ArchiveEARUIResourceHandler.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ear/actions/ArchiveEARUIResourceHandler.java
deleted file mode 100644
index 1682ee1a2..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ear/actions/ArchiveEARUIResourceHandler.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2003, 2004 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.jst.j2ee.internal.ear.actions;
-
-
-
-import java.text.MessageFormat;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-public class ArchiveEARUIResourceHandler {
-
- private static ResourceBundle fgResourceBundle;
-
- /**
- * Returns the resource bundle used by all classes in this Project
- */
- public static ResourceBundle getResourceBundle() {
- try {
- return ResourceBundle.getBundle("archiveearui");//$NON-NLS-1$
- } catch (MissingResourceException e) {
- // does nothing - this method will return null and
- // getString(String, String) will return the key
- // it was called with
- }
- return null;
- }
-
- public static String getString(String key) {
- if (fgResourceBundle == null) {
- fgResourceBundle = getResourceBundle();
- }
-
- if (fgResourceBundle != null) {
- try {
- return fgResourceBundle.getString(key);
- } catch (MissingResourceException e) {
- return "!" + key + "!";//$NON-NLS-2$//$NON-NLS-1$
- }
- }
- return "!" + key + "!";//$NON-NLS-2$//$NON-NLS-1$
- }
-
- public static String getString(String key, Object[] args) {
-
- try {
- return MessageFormat.format(getString(key), args);
- } catch (IllegalArgumentException e) {
- return getString(key);
- }
-
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ear/actions/EARImportListContentProvider.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ear/actions/EARImportListContentProvider.java
deleted file mode 100644
index 31c247184..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ear/actions/EARImportListContentProvider.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 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.jst.j2ee.internal.ear.actions;
-
-
-import org.eclipse.jst.j2ee.internal.wizard.TableObjects;
-
-/**
- * Insert the type's description here. Creation date: (5/7/2001 11:39:11 AM)
- *
- * @author: Administrator
- */
-public class EARImportListContentProvider implements org.eclipse.jface.viewers.IStructuredContentProvider {
- /**
- * EARImportListContentProvider constructor comment.
- */
- public EARImportListContentProvider() {
- super();
- }
-
- /**
- * Disposes of this content provider. This is called by the viewer when it is disposed.
- */
- public void dispose() {
- //dispose
- }
-
- /**
- * Returns the elements to display in the viewer when its input is set to the given element.
- * These elements can be presented as rows in a table, items in a list, etc. The result is not
- * modified by the viewer.
- *
- * @param inputElement
- * the input element
- * @return the array of elements to display in the viewer
- */
- public java.lang.Object[] getElements(Object inputElement) {
- if (inputElement instanceof TableObjects)
- return ((TableObjects) inputElement).getTableObjects().toArray();
- return new Object[0]; //should throw exception instead
- }
-
- /**
- * Notifies this content provider that the given viewer's input has been switched to a different
- * element.
- * <p>
- * A typical use for this method is registering the content provider as a listener to changes on
- * the new input (using model-specific means), and deregistering the viewer from the old input.
- * In response to these change notifications, the content provider propagates the changes to the
- * viewer.
- * </p>
- *
- * @param viewer
- * the viewer
- * @param oldInput
- * the old input element, or <code>null</code> if the viewer did not previously
- * have an input
- * @param newInput
- * the new input element, or <code>null</code> if the viewer does not have an input
- */
- public void inputChanged(org.eclipse.jface.viewers.Viewer viewer, Object oldInput, Object newInput) {
- //do nothing
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ear/actions/ExportEARAction.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ear/actions/ExportEARAction.java
deleted file mode 100644
index a7078ae50..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ear/actions/ExportEARAction.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 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
- *******************************************************************************/
-/*
- * Created on Mar 27, 2003
- *
- * To change this generated comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-package org.eclipse.jst.j2ee.internal.ear.actions;
-
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.jst.j2ee.internal.actions.BaseAction;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIPlugin;
-import org.eclipse.jst.j2ee.internal.wizard.EARComponentExportWizard;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * @author jsholl
- *
- * To change this generated comment go to Window>Preferences>Java>Code Generation>Code and Comments
- */
-public class ExportEARAction extends BaseAction {
-
- public static String LABEL = J2EEUIPlugin.getDefault().getDescriptor().getResourceString("%ear.export.action.description_ui_");//$NON-NLS-1$
- private static final String ICON = "export_ear_wiz"; //$NON-NLS-1$
-
- public ExportEARAction() {
- super();
- setText(LABEL);
- setImageDescriptor(J2EEUIPlugin.getDefault().getImageDescriptor(ICON));
- }
-
- public void primRun(Shell shell) {
- EARComponentExportWizard wizard = new EARComponentExportWizard();
- J2EEUIPlugin plugin = J2EEUIPlugin.getDefault();
-
- wizard.init(plugin.getWorkbench(), selection);
-
- WizardDialog dialog = new WizardDialog(shell, wizard);
- dialog.create();
- dialog.open();
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ear/actions/ImportEARAction.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ear/actions/ImportEARAction.java
deleted file mode 100644
index 305c3ec95..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ear/actions/ImportEARAction.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 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
- *******************************************************************************/
-/*
- * Created on Mar 27, 2003
- *
- * To change this generated comment go to Window>Preferences>Java>Code
- * Generation>Code and Comments
- */
-package org.eclipse.jst.j2ee.internal.ear.actions;
-
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.jst.j2ee.internal.actions.BaseAction;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIPlugin;
-import org.eclipse.jst.j2ee.internal.wizard.EARComponentImportWizard;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * @author jsholl
- *
- * To change this generated comment go to Window>Preferences>Java>Code Generation>Code and Comments
- */
-public class ImportEARAction extends BaseAction {
- public static String LABEL = ArchiveEARUIResourceHandler.getString("Import_EAR"); //$NON-NLS-1$
- private static final String ICON = "import_ear_wiz"; //$NON-NLS-1$
-
- public ImportEARAction() {
- super();
- setText(LABEL);
- setImageDescriptor(J2EEUIPlugin.getDefault().getImageDescriptor(ICON));
- }
-
- protected void primRun(Shell shell) {
-
- EARComponentImportWizard wizard = new EARComponentImportWizard();
-
- J2EEUIPlugin plugin = J2EEUIPlugin.getDefault();
-
- wizard.init(plugin.getWorkbench(), StructuredSelection.EMPTY);
-
- WizardDialog dialog = new WizardDialog(shell, wizard);
- dialog.create();
- dialog.open();
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ear/actions/ModulesProvider.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ear/actions/ModulesProvider.java
deleted file mode 100644
index 4914e7f12..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ear/actions/ModulesProvider.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 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.jst.j2ee.internal.ear.actions;
-
-
-import org.eclipse.jst.j2ee.application.internal.operations.ClassPathSelection;
-
-/**
- * Insert the type's description here. Creation date: (8/22/2001 2:27:24 PM)
- *
- * @author: Administrator
- */
-public class ModulesProvider implements org.eclipse.jface.viewers.ILabelProvider, org.eclipse.jface.viewers.IStructuredContentProvider {
- /**
- * ModulesProvider constructor comment.
- */
- public ModulesProvider() {
- super();
- }
-
- /**
- * Adds a listener to this label provider. Has no effect if an identical listener is already
- * registered.
- * <p>
- * Label provider listeners are informed about state changes that affect the rendering of the
- * viewer that uses this label provider.
- * </p>
- *
- * @param listener
- * a label provider listener
- */
- public void addListener(org.eclipse.jface.viewers.ILabelProviderListener listener) {
- //do nothing
- }
-
- /**
- * Disposes of this content provider. This is called by the viewer when it is disposed.
- */
- public void dispose() {
- //dispose
- }
-
- /**
- * Returns the elements to display in the viewer when its input is set to the given element.
- * These elements can be presented as rows in a table, items in a list, etc. The result is not
- * modified by the viewer.
- *
- * @param inputElement
- * the input element
- * @return the array of elements to display in the viewer
- */
- public java.lang.Object[] getElements(java.lang.Object inputElement) {
- return ((java.util.List) inputElement).toArray();
- }
-
- /**
- * Returns the image for the label of the given element. The image is owned by the label
- * provider and must not be disposed directly. Instead, dispose the label provider when no
- * longer needed.
- *
- * @param element
- * the element for which to provide the label image
- * @return the image used to label the element, or <code>null</code> if these is no image for
- * the given object
- */
- public org.eclipse.swt.graphics.Image getImage(Object element) {
- return null;
- }
-
- /**
- * Returns the text for the label of the given element.
- *
- * @param element
- * the element for which to provide the label text
- * @return the text string used to label the element, or <code>null</code> if these is no text
- * label for the given object
- */
- public String getText(Object element) {
- return ((ClassPathSelection) element).getText();
- }
-
- /**
- * Notifies this content provider that the given viewer's input has been switched to a different
- * element.
- * <p>
- * A typical use for this method is registering the content provider as a listener to changes on
- * the new input (using model-specific means), and deregistering the viewer from the old input.
- * In response to these change notifications, the content provider propagates the changes to the
- * viewer.
- * </p>
- *
- * @param viewer
- * the viewer
- * @param oldInput
- * the old input element, or <code>null</code> if the viewer did not previously
- * have an input
- * @param newInput
- * the new input element, or <code>null</code> if the viewer does not have an input
- */
- public void inputChanged(org.eclipse.jface.viewers.Viewer viewer, Object oldInput, Object newInput) {
- //do nothing
- }
-
- /**
- * Returns whether the label would be affected by a change to the given property of the given
- * element. This can be used to optimize a non-structural viewer update. If the property
- * mentioned in the update does not affect the label, then the viewer need not update the label.
- *
- * @param element
- * the element
- * @param property
- * the property
- * @return <code>true</code> if the label would be affected, and <code>false</code> if it
- * would be unaffected
- */
- public boolean isLabelProperty(Object element, String property) {
- return false;
- }
-
- /**
- * Removes a listener to this label provider. Has no affect if an identical listener is not
- * registered.
- *
- * @param listener
- * a label provider listener
- */
- public void removeListener(org.eclipse.jface.viewers.ILabelProviderListener listener) {
- //do nothing
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/AbstractMethodsContentProvider.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/AbstractMethodsContentProvider.java
deleted file mode 100644
index 1eccf4525..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/AbstractMethodsContentProvider.java
+++ /dev/null
@@ -1,316 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 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.jst.j2ee.internal.ejb.provider;
-
-
-import java.util.Arrays;
-import java.util.Comparator;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.EcorePackage;
-import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jst.j2ee.ejb.AssemblyDescriptor;
-import org.eclipse.jst.j2ee.ejb.CMPAttribute;
-import org.eclipse.jst.j2ee.ejb.EjbMethodElementComparator;
-import org.eclipse.jst.j2ee.ejb.EnterpriseBean;
-import org.eclipse.jst.j2ee.ejb.MethodElement;
-import org.eclipse.jst.j2ee.ejb.internal.impl.EjbFactoryImpl;
-import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.wst.common.frameworks.internal.ui.DisplayUtility;
-
-
-public abstract class AbstractMethodsContentProvider extends AdapterFactoryContentProvider {
- protected static EStructuralFeature ME_EJB_SF = EjbFactoryImpl.getPackage().getMethodElement_EnterpriseBean();
- protected static EStructuralFeature JAR_ASSEMBLY_SF = EjbFactoryImpl.getPackage().getEJBJar_AssemblyDescriptor();
- private static final EStructuralFeature ECORE_BEAN_NAME = EcorePackage.eINSTANCE.getENamedElement_Name(); //ENAMED_ELEMENT__NAME
- protected Comparator meComparator;
- protected boolean isRoot = true;
-
- public class EJBMethodItem {
- public EObject refObject;
- public EnterpriseBean ejb;
-
- public EJBMethodItem(EObject aRefObject, EnterpriseBean anEJB) {
- refObject = aRefObject;
- ejb = anEJB;
- }
-
- }
-
- /**
- * Constructor for AbstractMethodsContentProvider.
- *
- * @param adapterFactory
- */
- public AbstractMethodsContentProvider(AdapterFactory adapterFactory) {
- super(adapterFactory);
- }
-
- public AbstractMethodsContentProvider(AdapterFactory adapterFactory, boolean root) {
- super(adapterFactory);
- isRoot = root;
- }
-
- protected Comparator getEnterpriseBeanComparator() {
- return EJBNameComparator.singleton();
- }
-
- protected Comparator getMethodElementComparator() {
- if (meComparator == null)
- meComparator = new EjbMethodElementComparator();
- return meComparator;
- }
-
- /*
- * @see ITreeContentProvider#getChildren(Object)
- */
- public Object[] getChildren(Object parentElement) {
- if (parentElement instanceof AbstractMethodsContentProvider.EJBMethodItem)
- return getMethodElements((AbstractMethodsContentProvider.EJBMethodItem) parentElement);
- return new Object[0];
- }
-
- protected Object[] getMethodElements(AbstractMethodsContentProvider.EJBMethodItem ejbItem) {
- EObject refObject = ejbItem.refObject;
- if (refObject == null)
- return new Object[0];
- List elements = getMethodElements(refObject, ejbItem.ejb);
- Object[] result = elements.toArray();
- if (result.length == 1)
- return result;
- Arrays.sort(result, getMethodElementComparator());
- return result;
- }
-
- protected abstract List getMethodElements(EObject aRefObject, EnterpriseBean anEJB);
-
- protected Object[] getEnterpriseBeans(EObject parentElement, List someMethodElements) {
- if (someMethodElements.isEmpty())
- return new Object[0];
- Set ejbs = new HashSet();
- EnterpriseBean ejb = null;
- MethodElement me = null;
- for (int i = 0; i < someMethodElements.size(); i++) {
- me = (MethodElement) someMethodElements.get(i);
- ejb = me.getEnterpriseBean();
- if (ejb != null)
- ejbs.add(ejb);
- }
- Object[] result = ejbs.toArray();
- if (result.length != 1)
- Arrays.sort(result, getEnterpriseBeanComparator());
- ejb = null;
- for (int i = 0; i < result.length; i++) {
- ejb = (EnterpriseBean) result[i];
- result[i] = new EJBMethodItem(parentElement, ejb);
- }
- return result;
- }
-
- protected AssemblyDescriptor getAssemblyDescriptor(EnterpriseBean ejb) {
- if (ejb == null)
- return null;
- return ejb.getEjbJar().getAssemblyDescriptor();
- }
-
- /*
- * @see ITreeContentProvider#hasChildren(Object)
- */
- public boolean hasChildren(Object element) {
- if (element instanceof AbstractMethodsContentProvider.EJBMethodItem)
- return true;
- return false;
- }
-
- protected TreeViewer getTreeViewer() {
- return (TreeViewer) viewer;
- }
-
- protected void refreshTreeViewer(Object obj) {
- if (viewer != null)
- DisplayUtility.asyncExec(createRefreshTreeRunnable(obj));
- }
-
- protected void refreshTreeViewer() {
- if (viewer != null)
- DisplayUtility.asyncExec(createRefreshTreeRunnable(null));
- }
-
- protected void refreshTreeViewer(MethodElement me) {
- refreshTreeViewer(me.eContainer());
- }
-
- protected void refreshTreeViewer(List aList) {
- if (aList.isEmpty())
- return;
- refreshTreeViewer((MethodElement) aList.get(0));
- }
-
- protected void addToTreeViewer(final MethodElement me) {
- if (viewer == null)
- return;
- DisplayUtility.asyncExec(new Runnable() {
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Runnable#run()
- */
- public void run() {
- // findMethodItem() should be run in a Display thread
- EJBMethodItem item = findMethodItem(me);
- if (item != null)
- DisplayUtility.asyncExec(createAddItemTreeRunnable(item, me));
- else
- refreshTreeViewer(me.eContainer());
-
- }
- });
- }
-
- protected void removeFromTreeViewer(final EObject parent, final MethodElement me) {
- if (viewer == null)
- return;
- DisplayUtility.asyncExec(new Runnable() {
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Runnable#run()
- */
- public void run() {
- EnterpriseBean ejb = me.getEnterpriseBean();
- EJBMethodItem item = findMethodItem(ejb, parent);
- if (item != null)
- refreshTreeViewer(item);
- else
- refreshTreeViewer((Object) null);
- }
- });
- }
-
- protected EJBMethodItem findMethodItem(MethodElement me) {
- return findMethodItem(me.getEnterpriseBean(), me.eContainer());
- }
-
- protected EJBMethodItem findMethodItem(EnterpriseBean ejb, EObject parentMethod) {
- TreeItem[] items = getTreeViewer().getTree().getItems();
- return findMethodItem(ejb, parentMethod, items);
- }
-
- protected EJBMethodItem findMethodItem(EnterpriseBean ejb, EObject parentMethod, TreeItem[] items) {
- TreeItem item = null;
- Object data = null;
- EJBMethodItem methodItem = null, found = null;
- for (int i = 0; i < items.length; i++) {
- item = items[i];
- data = item.getData();
- if (data instanceof EJBMethodItem) {
- methodItem = (EJBMethodItem) data;
- if (methodItem.ejb == ejb && methodItem.refObject == parentMethod)
- return methodItem;
- }
- found = findMethodItem(ejb, parentMethod, item.getItems());
- if (found != null)
- return found;
- }
- return null;
- }
-
- /*
- * @see INotifyChangedListener#notifyChanged(new ENotificationImpl((InternalEObject)Object,
- * int,(EStructuralFeature) Object, Object, Object, int))
- */
- public void notifyChanged(Notification notifier) {
- if (notifier.getEventType() == Notification.RESOLVE)
- return;
- else if (notifier.getOldValue() instanceof CMPAttribute && notifier.getNewValue() == null)
- return;
- else if (notifier.getFeature() == ME_EJB_SF) {
- refreshTreeViewer((MethodElement) notifier.getNotifier());
- return;
- } else if (notifier.getFeature() == ECORE_BEAN_NAME) {
- refreshTreeViewer();
- return;
- } else if (getMethodElementsReference() == notifier.getFeature()) {
- if (notifier.getEventType() == Notification.ADD)
- addToTreeViewer((MethodElement) notifier.getNewValue());
- else if (notifier.getEventType() == Notification.REMOVE)
- removeFromTreeViewer((EObject) notifier.getNotifier(), (MethodElement) notifier.getOldValue());
- return;
- } else if (notifier.getFeature() == JAR_ASSEMBLY_SF && isRoot) {
- updateTreeInput(notifier.getNewValue());
- } else if (notifier.getFeature() == getMethodElementsContainerReference())
- super.notifyChanged(notifier);
- }
-
- /**
- * @param notifier
- */
- protected void updateTreeInput(final Object target) {
- DisplayUtility.asyncExec(new Runnable() {
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Runnable#run()
- */
- public void run() {
-
- getTreeViewer().setInput(target); //reset the input
- getTreeViewer().refresh(target);
-
- }
- });
- }
-
- private Runnable createAddItemTreeRunnable(final Object parent, final MethodElement me) {
- return new Runnable() {
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Runnable#run()
- */
- public void run() {
- getTreeViewer().add(parent, me);
- }
- };
- }
-
- private Runnable createRefreshTreeRunnable(final Object target) {
- return new Runnable() {
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Runnable#run()
- */
- public void run() {
- if (target != null)
- getTreeViewer().refresh(target);
- else
- getTreeViewer().refresh();
- }
- };
- }
-
- protected abstract EStructuralFeature getMethodElementsReference();
-
- protected abstract EStructuralFeature getMethodElementsContainerReference();
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/BeanClassProviderHelper.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/BeanClassProviderHelper.java
deleted file mode 100644
index 38a42ebce..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/BeanClassProviderHelper.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 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.jst.j2ee.internal.ejb.provider;
-
-
-import org.eclipse.jem.java.JavaClass;
-import org.eclipse.jst.j2ee.ejb.EnterpriseBean;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIMessages;
-import org.eclipse.swt.graphics.Image;
-
-
-/**
- * Insert the type's description here. Creation date: (6/21/2001 12:29:49 AM)
- *
- * @author: Administrator
- */
-public class BeanClassProviderHelper extends J2EEJavaClassProviderHelper {
- private static Image image;
-
- /**
- * BeanClassProviderHelper constructor comment.
- */
- public BeanClassProviderHelper(EnterpriseBean anEJB) {
- super(anEJB);
- }
-
- public Image getImage() {
- if (image == null)
- image = createImage();
- return image;
- }
-
- /**
- * Insert the method's description here. Creation date: (7/11/2001 1:53:09 PM)
- *
- * @return org.eclipse.jem.internal.java.JavaClass
- */
- public JavaClass getJavaClass() {
- return getEjb().getEjbClass();
- }
-
- protected String getOverlayKey() {
- return "ejb_module_ovr";//$NON-NLS-1$
- }
-
- public String getTypeString(String className) {
- return J2EEUIMessages.getResourceString("EJB_Class_UI_", new Object[]{className}); //$NON-NLS-1$ = "EJB Class"
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/EJBUIMessages.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/EJBUIMessages.java
deleted file mode 100644
index d03ed28bf..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/EJBUIMessages.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 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.jst.j2ee.internal.ejb.provider;
-
-import org.eclipse.osgi.util.NLS;
-
-
-public class EJBUIMessages extends NLS {
-
- private static final String BUNDLE_NAME = "j2ee_ejb_ui";//$NON-NLS-1$
-
- private EJBUIMessages() {
- // Do not instantiate
- }
-
- public static String GroupedEJBJarItemProvider_UI_0;
- public static String GroupedEJBJarItemProvider_UI_1;
- public static String GroupedEJBJarItemProvider_UI_2;
-
- static {
- NLS.initializeMessages(BUNDLE_NAME, EJBUIMessages.class);
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/ExcludeListContentProvider.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/ExcludeListContentProvider.java
deleted file mode 100644
index 12c91ca8d..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/ExcludeListContentProvider.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 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.jst.j2ee.internal.ejb.provider;
-
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.EcorePackage;
-import org.eclipse.jst.j2ee.ejb.AssemblyDescriptor;
-import org.eclipse.jst.j2ee.ejb.CMPAttribute;
-import org.eclipse.jst.j2ee.ejb.EJBJar;
-import org.eclipse.jst.j2ee.ejb.EnterpriseBean;
-import org.eclipse.jst.j2ee.ejb.ExcludeList;
-import org.eclipse.jst.j2ee.ejb.internal.impl.EjbFactoryImpl;
-
-
-public class ExcludeListContentProvider extends AbstractMethodsContentProvider {
- private static final EStructuralFeature EXCLUDE_ME_SF = EjbFactoryImpl.getPackage().getExcludeList_MethodElements();
- private static final EStructuralFeature AD_EL_SF = EjbFactoryImpl.getPackage().getAssemblyDescriptor_ExcludeList();
- protected static final EStructuralFeature ECORE_BEAN_NAME = EcorePackage.eINSTANCE.getENamedElement_Name(); //ENAMED_ELEMENT__NAME
-
- /**
- * Constructor for ExcludeListContentProvider.
- *
- * @param adapterFactory
- * @param root
- * @param viewer
- */
- public ExcludeListContentProvider(AdapterFactory adapterFactory, boolean root) {
- super(adapterFactory, root);
- }
-
- /**
- * Constructor for ExcludesListContentProvider.
- *
- * @param adapterFactory
- */
- public ExcludeListContentProvider(AdapterFactory adapterFactory) {
- super(adapterFactory);
- }
-
- protected Object[] getEnterpriseBeans(ExcludeList list) {
- List mes = list.getMethodElements();
- return getEnterpriseBeans(list, mes);
- }
-
- /*
- * @see AbstractMethodsContentProvider#getMethodElements(EObject, EnterpriseBean)
- */
- protected List getMethodElements(EObject aRefObject, EnterpriseBean anEJB) {
- if (!(aRefObject instanceof ExcludeList))
- return Collections.EMPTY_LIST;
- ExcludeList parentList = (ExcludeList) aRefObject;
- if (parentList == null)
- return Collections.EMPTY_LIST;
- return parentList.getMethodElements(anEJB);
- }
-
- /*
- * @see IStructuredContentProvider#getElements(Object)
- */
- public Object[] getElements(Object inputElement) {
- super.getElements(inputElement);
- ExcludeList list = null;
- if (inputElement instanceof EJBJar) {
- EJBJar jar = (EJBJar) inputElement;
- if (jar.getAssemblyDescriptor() != null)
- list = jar.getAssemblyDescriptor().getExcludeList();
- if (list != null)
- return getEnterpriseBeans(list);
- }
- if (inputElement instanceof AssemblyDescriptor) {
- list = ((AssemblyDescriptor) inputElement).getExcludeList();
- if (list != null)
- return getEnterpriseBeans(list);
- }
- return new Object[0];
- }
-
- /**
- * @see org.eclipse.jst.j2ee.internal.internal.ejb.ui.providers.AbstractMethodsContentProvider#getChildren(Object)
- */
- public Object[] getChildren(Object parentElement) {
- if (parentElement instanceof ExcludeList)
- return getEnterpriseBeans((ExcludeList) parentElement);
- return super.getChildren(parentElement);
- }
-
- /**
- * @see org.eclipse.jst.j2ee.internal.internal.ejb.ui.providers.AbstractMethodsContentProvider#hasChildren(Object)
- */
- public boolean hasChildren(Object element) {
- if (element instanceof ExcludeList)
- return !((ExcludeList) element).getMethodElements().isEmpty();
- return super.hasChildren(element);
- }
-
- public void notifyChanged(Notification notifier) {
- if ((notifier.getFeature() == EXCLUDE_ME_SF && notifier.getNotifier() instanceof ExcludeList) || notifier.getFeature() == ECORE_BEAN_NAME) {
- if (notifier.getEventType() == Notification.RESOLVE)
- return;
- if (isRoot)
- refreshTreeViewer();
- else
- refreshTreeViewer(notifier.getNotifier());
- }
- if (notifier.getOldValue() instanceof CMPAttribute && notifier.getNewValue() == null)
- return;
- if (notifier.getFeature() == getMethodElementsReference() || notifier.getFeature() == getMethodElementsContainerReference())
- super.notifyChanged(notifier);
- }
-
- /*
- * @see AbstractMethodsContentProvider#getMethodElementsReference()
- */
- protected EStructuralFeature getMethodElementsReference() {
- return EXCLUDE_ME_SF;
- }
-
- /**
- * @see org.eclipse.jst.j2ee.internal.internal.ejb.ui.providers.AbstractMethodsContentProvider#getMethodElementsContainerReference()
- */
- protected EStructuralFeature getMethodElementsContainerReference() {
- return AD_EL_SF;
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/GroupedEJBItemProvider.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/GroupedEJBItemProvider.java
deleted file mode 100644
index 6645c6f34..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/GroupedEJBItemProvider.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2006 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.jst.j2ee.internal.ejb.provider;
-
-import java.util.Collection;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.jem.util.emf.workbench.WorkbenchResourceHelperBase;
-import org.eclipse.jst.j2ee.ejb.EJBJar;
-import org.eclipse.jst.j2ee.internal.provider.J2EEItemProvider;
-
-
-
-/**
- * This class is the item provider for EJB groups
- */
-public abstract class GroupedEJBItemProvider extends J2EEItemProvider {
-
- public GroupedEJBItemProvider(AdapterFactory adapterFactory, String text, Object image, Object parent, Collection children) {
- super(adapterFactory, text, image, parent, children);
- }
-
- public IFile getAssociatedFile() {
-
- try {
- EJBJar ejbJar = (EJBJar) getParent();
- if(ejbJar != null && ejbJar.eResource() != null) {
- return WorkbenchResourceHelperBase.getIFile(ejbJar.eResource().getURI());
- }
- } catch (Throwable t) {
-
- }
- return null;
- }
-
- public abstract String getText(Object object);
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/GroupedEJBJarItemProvider.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/GroupedEJBJarItemProvider.java
deleted file mode 100644
index 5efe5cb94..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/GroupedEJBJarItemProvider.java
+++ /dev/null
@@ -1,376 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2006 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.jst.j2ee.internal.ejb.provider;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationWrapper;
-import org.eclipse.emf.common.notify.impl.NotificationImpl;
-import org.eclipse.jst.j2ee.ejb.EJBJar;
-import org.eclipse.jst.j2ee.ejb.EjbPackage;
-import org.eclipse.jst.j2ee.ejb.EnterpriseBean;
-import org.eclipse.jst.j2ee.ejb.Entity;
-import org.eclipse.jst.j2ee.ejb.MessageDriven;
-import org.eclipse.jst.j2ee.ejb.Session;
-import org.eclipse.jst.j2ee.internal.J2EEVersionConstants;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin;
-import org.eclipse.jst.j2ee.internal.provider.J2EEItemProvider;
-
-
-/**
- * @author Sachin P Patel
- *
- * To change this generated comment edit the template variable "typecomment":
- * Window>Preferences>Java>Templates. To enable and disable the creation of type comments go to
- * Window>Preferences>Java>Code Generation.
- */
-public class GroupedEJBJarItemProvider extends EJBJarItemProvider {
-
- private GroupedSessionItemProvider sessionProvider = null;
- private GroupedEntityItemProvider entityProvider = null;
- private GroupedMessageItemProvider messageProvider = null;
-
- private static Hashtable sessionTable = new Hashtable();
- private static Hashtable entityTable = new Hashtable();
- private static Hashtable messageTable = new Hashtable();
-
- private static final String SESSION = EJBUIMessages.GroupedEJBJarItemProvider_UI_0;
- private static final String ENTITY = EJBUIMessages.GroupedEJBJarItemProvider_UI_1;
- private static final String MESSAGE = EJBUIMessages.GroupedEJBJarItemProvider_UI_2;
-
- // Normally there is one instance of an item provider for all instances of the objecct
- // in the tree. The item provider would be stateless. However, because we are doing tricks
- // here, we are keeping track of all items this provider manages. The key in the map is the
- // object (EJBJar), and the value is the children nodes that we inserted
-
- protected Map children = new HashMap();
- private boolean showAssemblyDescriptor;
- private boolean isDisposing;
-
- public GroupedEJBJarItemProvider(AdapterFactory adapterFactory, boolean showAssemblyDescriptor) {
- super(adapterFactory);
- this.showAssemblyDescriptor = showAssemblyDescriptor;
- }
-
- public Collection getChildren(Object object) {
- List result = initChildren(object);
- if (showAssemblyDescriptor) {
- if (((EJBJar) object).getAssemblyDescriptor() != null)
- result.add(((EJBJar) object).getAssemblyDescriptor());
- }
- return result;
- }
-
- protected List initChildren(Object object) {
- EJBJar ejbJar = (EJBJar) object;
- List allRootBeans = getAllRootBeans(ejbJar);
-
- boolean is20Jar = is20Jar(ejbJar);
-
- List localChildren = new ArrayList(5);
-
- List entityBeans = new ArrayList();
- List sessionBeans = new ArrayList();
- List messageBeans = new ArrayList();
-
- catagorizeBeans(allRootBeans, entityBeans, sessionBeans, messageBeans);
- orderBeans(entityBeans);
- orderBeans(sessionBeans);
- orderBeans(messageBeans);
-
- //ENABLE FOR: NOT TO SHOW EMPTY GROUPS
- //if (sessionBeans.size() > 0) {
- if (sessionTable.get(ejbJar) == null) {
- //create new item provider instance
- sessionProvider = new GroupedSessionItemProvider(adapterFactory, null, getImage(SESSION), object, sessionBeans);
- sessionTable.put(ejbJar, sessionProvider);
- localChildren.add(sessionProvider);
- } else {
- //use existing instance from table
- localChildren.add(sessionTable.get(ejbJar));
- }
- //}
-
- //ENABLE FOR: NOT TO SHOW EMPTY GROUPS
- //if (entityBeans.size() > 0) {
- if (entityTable.get(ejbJar) == null) {
- //create new item provider instance
- entityProvider = new GroupedEntityItemProvider(adapterFactory, null, getImage(ENTITY), object, entityBeans);
- entityTable.put(ejbJar, entityProvider);
- localChildren.add(entityProvider);
- } else {
- //use existing instance from table
- localChildren.add(entityTable.get(ejbJar));
- }
- //}
-
- //ENABLE FOR: NOT TO SHOW EMPTY GROUPS
- //if (is20Jar && messageBeans.size() > 0) {
- if (is20Jar) {
- if (messageTable.get(ejbJar) == null) {
- //create new item provider instance
- messageProvider = new GroupedMessageItemProvider(adapterFactory, null, getImage(MESSAGE), object, messageBeans);
- messageTable.put(ejbJar, messageProvider);
- localChildren.add(messageProvider);
- } else {
- //use existing instance from table
- localChildren.add(messageTable.get(ejbJar));
- }
- }
- //}
-
- children.put(object, localChildren);
-
- return localChildren;
- }
-
- protected void orderBeans(List beans) {
- Object[] beansArray = beans.toArray();
- Arrays.sort(beansArray, EJBNameComparator.singleton());
- beans.clear();
- beans.addAll(Arrays.asList(beansArray));
- }
-
- protected static List getAllRootBeans(EJBJar ejbJar) {
- return ejbJar.getEnterpriseBeans();
- }
-
- protected void catagorizeBeans(List allRootBeans, List entityBeans, List sessionBeans, List messageBeans) {
- for (int i = 0; i < allRootBeans.size(); i++) {
- if (((EnterpriseBean) allRootBeans.get(i)).isSession()) {
- sessionBeans.add(allRootBeans.get(i));
- } else if (((EnterpriseBean) allRootBeans.get(i)).isEntity()) {
- entityBeans.add(allRootBeans.get(i));
- } else if (((EnterpriseBean) allRootBeans.get(i)).isMessageDriven()) {
- messageBeans.add(allRootBeans.get(i));
- }
- }
- }
-
- static protected GroupedSessionItemProvider getSessionNode(Object object) {
- return (GroupedSessionItemProvider) sessionTable.get(object);
- }
-
- static protected GroupedEntityItemProvider getEntityNode(Object object) {
- return (GroupedEntityItemProvider) entityTable.get(object);
- }
-
- static protected GroupedMessageItemProvider getMessageNode(Object object) {
- return (GroupedMessageItemProvider) messageTable.get(object);
- }
-
- public Object getImage(String type) {
- if (type.equals(SESSION))
- return J2EEPlugin.getPlugin().getImage("sessionBean_obj"); //$NON-NLS-1$
- else if (type.equals(MESSAGE))
- return J2EEPlugin.getPlugin().getImage("message_bean_obj"); //$NON-NLS-1$
- else if (type.equals(ENTITY))
- return J2EEPlugin.getPlugin().getImage("entitybean_obj"); //$NON-NLS-1$
- else
- return null;
- }
-
- private boolean is20Jar(EJBJar ejbJar) {
- switch (ejbJar.getVersionID()) {
- case J2EEVersionConstants.EJB_1_0_ID :
- case J2EEVersionConstants.EJB_1_1_ID :
- return false;
- case J2EEVersionConstants.EJB_2_0_ID :
- case J2EEVersionConstants.EJB_2_1_ID :
- default :
- return true;
- }
- }
-
- public void notifyChanged(Notification notification) {
- if (notification.getEventType() == Notification.REMOVING_ADAPTER && notification.getOldValue() == this && !isDisposing) {
- removeTarget(notification);
- return;
- }
- if (notification.getFeature() == EjbPackage.eINSTANCE.getEJBJar_EnterpriseBeans()) {
- J2EEItemProvider provider = beansChanged((EJBJar) notification.getNotifier(), notification.getEventType(), notification.getOldValue(), notification.getNewValue(), notification.getPosition());
-
- //EJB's group has not been added yet, need to add group to tree before EJB can be added
- if (provider == null) {
- Notification msg = new NotificationImpl(Notification.ADD, null, getEJBItemProvider((EnterpriseBean) notification.getNewValue()), 1);
- NotificationWrapper notificationWrapper = new NotificationWrapper(notification.getNotifier(), msg);
- fireNotifyChanged(notificationWrapper);
- provider = beansChanged((EJBJar) notification.getNotifier(), notification.getEventType(), notification.getOldValue(), notification.getNewValue(), notification.getPosition());
- }
-
- //Fire notification for EJB add or remove
- NotificationWrapper notificationWrapper = new NotificationWrapper(provider, notification);
- fireNotifyChanged(notificationWrapper);
-
- //ENABLE FOR: NOT TO SHOW EMPTY GROUPS
- //If Group is empty remove the group
- /*
- * if (provider != null && provider.getChildren().size() == 0) { Notification msg = new
- * NotificationImpl(Notification.REMOVE, provider, null, 1); notificationWrapper = new
- * NotificationWrapper(notification.getNotifier(), msg);
- * fireNotifyChanged(notificationWrapper);
- *
- * //Group is removed so flush out table entry if (provider instanceof
- * GroupedSessionItemProvider) { sessionTable.remove(notification.getNotifier());
- * provider = null; } else if (provider instanceof GroupedEntityItemProvider) {
- * entityTable.remove(notification.getNotifier()); provider = null; } else if (provider
- * instanceof GroupedMessageItemProvider) {
- * messageTable.remove(notification.getNotifier()); provider = null; }
- *
- * //If all groups are removed remove the extended children List allChildren = new
- * ArrayList(this.getChildren((EJBJar) notification.getNotifier()));
- * if(sessionTable.get(notification.getNotifier()) == null &&
- * entityTable.get(notification.getNotifier()) == null &&
- * messageTable.get(notification.getNotifier()) == null) { for(int i = 0; i <
- * allChildren.size(); i++) { Notification message = new
- * NotificationImpl(Notification.REMOVE, allChildren.get(i), null, 1);
- * notificationWrapper = new NotificationWrapper(notification.getNotifier(), message);
- * fireNotifyChanged(notificationWrapper); } this.getChildren((EJBJar)
- * notification.getNotifier()).clear(); } }
- */
- } else {
- super.notifyChanged(notification);
- }
- }
-
- protected J2EEItemProvider beansChanged(EJBJar ejbJar, int eventType, Object oldValue, Object newValue, int pos) {
- J2EEItemProvider provider = getItemProvider(ejbJar, oldValue, newValue);
-
- if (provider != null) {
- Collection grandChildren = provider.getChildren();
-
- switch (eventType) {
- case Notification.ADD : {
- if (!grandChildren.contains(newValue))
- grandChildren.add(newValue);
-
- break;
- }
- case Notification.ADD_MANY : {
- grandChildren.addAll((Collection) newValue);
- break;
- }
- case Notification.REMOVE : {
- grandChildren.remove(oldValue);
- break;
- }
- case Notification.REMOVE_MANY : {
- grandChildren.removeAll((Collection) oldValue);
- break;
- }
- }
- } else {
- //GroupedProvider for new bean does not exist, create one.
- List allRootBeans = getAllRootBeans(ejbJar);
-
- List entityBeans = new ArrayList();
- List sessionBeans = new ArrayList();
- List messageBeans = new ArrayList();
-
- catagorizeBeans(allRootBeans, entityBeans, sessionBeans, messageBeans);
-
- if (newValue instanceof Session) {
- sessionProvider = new GroupedSessionItemProvider(adapterFactory, null, getImage(SESSION), ejbJar, sessionBeans);
- sessionTable.put(ejbJar, sessionProvider);
- } else if (newValue instanceof Entity) {
- entityProvider = new GroupedEntityItemProvider(adapterFactory, null, getImage(ENTITY), ejbJar, entityBeans);
- entityTable.put(ejbJar, entityProvider);
- } else if (newValue instanceof MessageDriven) {
- messageProvider = new GroupedMessageItemProvider(adapterFactory, null, getImage(MESSAGE), ejbJar, messageBeans);
- messageTable.put(ejbJar, messageProvider);
- }
- }
- return provider;
- }
-
- static public J2EEItemProvider getEJBJarItemProvider(EJBJar ejbJar, Object bean) {
- J2EEItemProvider provider = null;
- if (ejbJar != null && bean != null) {
- if (bean instanceof Session) {
- provider = getSessionNode(ejbJar);
- } else if (bean instanceof Entity) {
- provider = getEntityNode(ejbJar);
- } else if (bean instanceof MessageDriven) {
- provider = getMessageNode(ejbJar);
- }
- }
- return provider;
- }
-
- static public J2EEItemProvider getEJBItemProvider(EnterpriseBean bean) {
- if (bean != null) {
- EJBJar ejbJar = bean.getEjbJar();
- return getEJBJarItemProvider(ejbJar, bean);
- }
- return null;
- }
-
- protected J2EEItemProvider getItemProvider(EJBJar ejbJar, Object oldValue, Object newValue) {
- if (newValue != null)
- return getEJBJarItemProvider(ejbJar, newValue);
- else if (oldValue != null)
- return getEJBJarItemProvider(ejbJar, oldValue);
- else
- return null;
- }
-
- public static boolean isRootBean(EnterpriseBean bean) {
- List allRootBeans = getAllRootBeans(bean.getEjbJar());
- if (allRootBeans != null && allRootBeans.contains(bean)) {
- return true;
- }
- return false;
- }
-
- // Utility method for garbage collection - if EJBJar removed, remove
- // all entires in table for EJBJar
- static public void flushOutTableEntriesForEJBJar(EJBJar ejbJar) {
- sessionTable.remove(ejbJar);
- entityTable.remove(ejbJar);
- messageTable.remove(ejbJar);
- }
-
- public boolean hasChildren(Object parent) {
- return true;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.j2ee.internal.internal.ejb.provider.EJBJarItemProvider#removeTarget(org.eclipse.emf.common.notify.Notification)
- */
- protected void removeTarget(Notification not) {
- if (not.getNotifier() instanceof EJBJar)
- flushOutTableEntriesForEJBJar((EJBJar) not.getNotifier());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#dispose()
- */
- public void dispose() {
- try {
- isDisposing = true;
- super.dispose();
- } finally {
- isDisposing = false;
- }
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/GroupedEntityItemProvider.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/GroupedEntityItemProvider.java
deleted file mode 100644
index 0dbb40b2d..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/GroupedEntityItemProvider.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 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.jst.j2ee.internal.ejb.provider;
-
-import java.util.Collection;
-
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIMessages;
-
-
-/**
- * @author Sachin Patel
- *
- * To change this generated comment edit the template variable "typecomment":
- * Window>Preferences>Java>Templates. To enable and disable the creation of type comments go to
- * Window>Preferences>Java>Code Generation.
- */
-public class GroupedEntityItemProvider extends GroupedEJBItemProvider {
-
- public static final String ENTITY = J2EEUIMessages.getResourceString("Entity_UI_"); //$NON-NLS-1$
-
- public GroupedEntityItemProvider(AdapterFactory adapterFactory, String text, Object image, Object parent, Collection children) {
- super(adapterFactory, text, image, parent, children);
- }
-
- public String getText(Object object) {
- return ENTITY;
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/GroupedMessageItemProvider.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/GroupedMessageItemProvider.java
deleted file mode 100644
index 6c977b2d2..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/GroupedMessageItemProvider.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 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.jst.j2ee.internal.ejb.provider;
-
-import java.util.Collection;
-
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIMessages;
-
-
-
-/**
- * @author Sachin Patel
- *
- * To change this generated comment edit the template variable "typecomment":
- * Window>Preferences>Java>Templates. To enable and disable the creation of type comments go to
- * Window>Preferences>Java>Code Generation.
- */
-public class GroupedMessageItemProvider extends GroupedEJBItemProvider {
-
- public static final String MESSAGE_BEANS = J2EEUIMessages.getResourceString("Message_Driven_Beans_UI_"); //$NON-NLS-1$
-
- public GroupedMessageItemProvider(AdapterFactory adapterFactory, String text, Object image, Object parent, Collection children) {
- super(adapterFactory, text, image, parent, children);
- }
-
- public String getText(Object object) {
- return MESSAGE_BEANS;
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/GroupedSessionItemProvider.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/GroupedSessionItemProvider.java
deleted file mode 100644
index 15c28172c..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/GroupedSessionItemProvider.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 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.jst.j2ee.internal.ejb.provider;
-
-import java.util.Collection;
-
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIMessages;
-
-
-/**
- * @author Sachin Patel
- *
- * To change this generated comment edit the template variable "typecomment":
- * Window>Preferences>Java>Templates. To enable and disable the creation of type comments go to
- * Window>Preferences>Java>Code Generation.
- */
-public class GroupedSessionItemProvider extends GroupedEJBItemProvider {
-
- public static final String SESSION_BEANS = J2EEUIMessages.getResourceString("Session_Beans_UI_"); //$NON-NLS-1$
-
- public GroupedSessionItemProvider(AdapterFactory adapterFactory, String text, Object image, Object parent, Collection children) {
- super(adapterFactory, text, image, parent, children);
- }
-
- public String getText(Object object) {
- return SESSION_BEANS;
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/HomeInterfaceProviderHelper.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/HomeInterfaceProviderHelper.java
deleted file mode 100644
index 6c37abe75..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/HomeInterfaceProviderHelper.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 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.jst.j2ee.internal.ejb.provider;
-
-
-import org.eclipse.jem.java.JavaClass;
-import org.eclipse.jst.j2ee.ejb.EnterpriseBean;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIMessages;
-import org.eclipse.swt.graphics.Image;
-
-
-/**
- * Insert the type's description here. Creation date: (6/20/2001 11:23:30 PM)
- *
- * @author: Administrator
- */
-public class HomeInterfaceProviderHelper extends J2EEJavaClassProviderHelper {
- private static Image image;
-
- /**
- * HomeInterfaceProviderHelper constructor comment.
- *
- * @param cls
- * org.eclipse.jem.internal.java.JavaClass
- */
- public HomeInterfaceProviderHelper(EnterpriseBean anEJB) {
- super(anEJB);
- }
-
- public Image getImage() {
- if (image == null)
- image = createImage();
- return image;
- }
-
- /**
- * Insert the method's description here. Creation date: (7/11/2001 1:53:49 PM)
- *
- * @return org.eclipse.jem.internal.java.JavaClass
- */
- public JavaClass getJavaClass() {
- return getEjb().getHomeInterface();
- }
-
- protected String getOverlayKey() {
- return "home_interface_overlay_obj";//$NON-NLS-1$
- }
-
- public String getTypeString(String className) {
- return J2EEUIMessages.getResourceString("Home_Interface_UI_", new Object[]{className}); //$NON-NLS-1$ = "Home Interface"
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/J2EEContainerManagedEntityItemProvider.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/J2EEContainerManagedEntityItemProvider.java
deleted file mode 100644
index ec5f13c6b..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/J2EEContainerManagedEntityItemProvider.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 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.jst.j2ee.internal.ejb.provider;
-
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import org.eclipse.jst.j2ee.ejb.ContainerManagedEntity;
-import org.eclipse.jst.j2ee.ejb.EnterpriseBean;
-
-
-/**
- * Insert the type's description here. Creation date: (6/20/2001 6:58:51 PM)
- *
- * @author: Administrator
- */
-public class J2EEContainerManagedEntityItemProvider extends ContainerManagedEntityItemProvider {
- /**
- * J2EEContainerManagedEntityItemProvider constructor comment.
- *
- * @param adapterFactory
- * org.eclipse.emf.common.notify.AdapterFactory
- */
- public J2EEContainerManagedEntityItemProvider(EjbItemProviderAdapterFactory adapterFactory) {
- super(adapterFactory);
- }
-
- public Collection getChildren(Object object) {
- List result = new ArrayList();
- result.addAll(super.getChildren(object));
- J2EEJavaClassProviderHelper.addChildren((ContainerManagedEntity) object, result);
- result.addAll(((ContainerManagedEntity) object).getEnvironmentProperties());
- result.addAll(J2EEReferenceProviderHelper.getReferences((EnterpriseBean) object));
- return result;
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/J2EEEjbItemProviderAdapterFactory.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/J2EEEjbItemProviderAdapterFactory.java
deleted file mode 100644
index f888d86cc..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/J2EEEjbItemProviderAdapterFactory.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 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.jst.j2ee.internal.ejb.provider;
-
-import org.eclipse.emf.common.notify.Adapter;
-
-
-/**
- * Insert the type's description here. Creation date: (6/20/2001 7:20:07 PM)
- *
- * @author: Administrator
- */
-public class J2EEEjbItemProviderAdapterFactory extends org.eclipse.jst.j2ee.internal.ejb.provider.EjbItemProviderAdapterFactory {
- /**
- * J2EEEjbItemProviderAdapterFactory constructor comment.
- */
- public J2EEEjbItemProviderAdapterFactory() {
- super();
- }
-
- /**
- * This creates an adapter for a
- * {@link org.eclipse.jst.j2ee.internal.internal.ejb.ContainerManagedEntity}.
- */
- public Adapter createContainerManagedEntityAdapter() {
- if (containerManagedEntityItemProvider == null) {
- containerManagedEntityItemProvider = new J2EEContainerManagedEntityItemProvider(this);
- }
-
- return containerManagedEntityItemProvider;
- }
-
- /**
- * This creates an adapter for a {@link org.eclipse.jst.j2ee.internal.internal.ejb.EJBJar}.
- */
- public Adapter createEJBJarAdapter() {
- if (eJBJarItemProvider == null) {
- eJBJarItemProvider = new GroupedEJBJarItemProvider(this, true);
- }
-
- return eJBJarItemProvider;
- }
-
- /**
- * This creates an adapter for a {@link org.eclipse.jst.j2ee.internal.internal.ejb.Entity}.
- */
- public Adapter createEntityAdapter() {
- if (entityItemProvider == null) {
- entityItemProvider = new J2EEEntityItemProvider(this);
- }
-
- return entityItemProvider;
- }
-
- /**
- * This creates an adapter for a {@link org.eclipse.jst.j2ee.internal.internal.ejb.Session}.
- */
- public Adapter createSessionAdapter() {
- if (sessionItemProvider == null) {
- sessionItemProvider = new J2EESessionItemProvider(this);
- }
-
- return sessionItemProvider;
- }
-
- public Adapter createMessageDrivenAdapter() {
- if (messageDrivenItemProvider == null) {
- messageDrivenItemProvider = new J2EEMessageDrivenItemProvider(this);
- }
- return messageDrivenItemProvider;
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/J2EEEntityItemProvider.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/J2EEEntityItemProvider.java
deleted file mode 100644
index 037d4d67e..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/J2EEEntityItemProvider.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 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.jst.j2ee.internal.ejb.provider;
-
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import org.eclipse.jst.j2ee.ejb.Entity;
-
-
-/**
- * Insert the type's description here. Creation date: (6/20/2001 11:10:06 PM)
- *
- * @author: Administrator
- */
-public class J2EEEntityItemProvider extends EntityItemProvider {
- /**
- * J2EEEntityItemProvider constructor comment.
- *
- * @param adapterFactory
- * org.eclipse.emf.common.notify.AdapterFactory
- */
- public J2EEEntityItemProvider(org.eclipse.emf.common.notify.AdapterFactory adapterFactory) {
- super(adapterFactory);
- }
-
- public Collection getChildren(Object object) {
- List result = new ArrayList();
- result.addAll(super.getChildrenSuper(object));
- J2EEJavaClassProviderHelper.addChildren((Entity) object, result);
- return result;
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/J2EEJavaClassProviderHelper.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/J2EEJavaClassProviderHelper.java
deleted file mode 100644
index 00fe427db..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/J2EEJavaClassProviderHelper.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 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.jst.j2ee.internal.ejb.provider;
-
-
-import java.util.Collection;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jem.java.JavaClass;
-import org.eclipse.jem.util.emf.workbench.ProjectUtilities;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jst.j2ee.ejb.EnterpriseBean;
-import org.eclipse.jst.j2ee.ejb.Entity;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEEditorUtility;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIPlugin;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.common.frameworks.internal.ui.OverlayIcon;
-
-public abstract class J2EEJavaClassProviderHelper implements IAdaptable {
- private EnterpriseBean ejb;
- public static final Class IRESOURCE_CLASS = IResource.class;
- public static final Class IPROJECT_CLASS = IProject.class;
-
- /**
- * J2EEJavaClassProviderHelper constructor comment.
- */
- public J2EEJavaClassProviderHelper(EnterpriseBean anEJB) {
- super();
- setEjb(anEJB);
- }
-
- public static void addChildren(Entity ejb, Collection children) {
- addChildren((EnterpriseBean) ejb, children);
- if (ejb.getPrimaryKey() != null)
- children.add(new PrimaryKeyClassProviderHelper(ejb));
- }
-
- public static void addChildren(EnterpriseBean ejb, Collection children) {
-
- if (ejb.getHomeInterface() != null)
- children.add(new HomeInterfaceProviderHelper(ejb));
- if (ejb.getRemoteInterface() != null)
- children.add(new RemoteInterfaceProviderHelper(ejb));
- if (ejb.getLocalHomeInterface() != null)
- children.add(new LocalHomeInterfaceProviderHelper(ejb));
- if (ejb.getLocalInterface() != null)
- children.add(new LocalInterfaceProviderHelper(ejb));
- if (ejb.getEjbClass() != null)
- children.add(new BeanClassProviderHelper(ejb));
- }
-
- protected Image createImage() {
- ImageDescriptor base = J2EEUIPlugin.getDefault().getImageDescriptor("jcu_obj");//$NON-NLS-1$
- if (base == null)
- return null;
- ImageDescriptor overlay = getOverlayDescriptor();
- if (overlay == null)
- return base.createImage();
- return new OverlayIcon(base, new ImageDescriptor[][]{{overlay}}).createImage();
- }
-
- /**
- * Insert the method's description here. Creation date: (7/11/2001 1:47:24 PM)
- *
- * @return org.eclipse.jst.j2ee.internal.internal.ejb.EnterpriseBean
- */
- public org.eclipse.jst.j2ee.ejb.EnterpriseBean getEjb() {
- return ejb;
- }
-
- public Image getImage() {
- return null;
- }
-
- /**
- * Insert the method's description here. Creation date: (6/20/2001 10:30:54 PM)
- *
- * @return JavaClass
- */
- public abstract JavaClass getJavaClass();
-
- protected ImageDescriptor getOverlayDescriptor() {
- return J2EEUIPlugin.getDefault().getImageDescriptor(getOverlayKey());
- }
-
- protected abstract String getOverlayKey();
-
- protected IProject getProject() {
- return ProjectUtilities.getProject(getJavaClass());
- }
-
- public String getStatusLineMessage() {
- if (getJavaClass() != null)
- return getTypeString(getJavaClass().getQualifiedName());
- return ""; //$NON-NLS-1$
- }
-
- public String getText() {
- if (getJavaClass() != null)
- return getJavaClass().getName();
- return ""; //$NON-NLS-1$
- }
-
- public abstract String getTypeString(String className);
-
- public void openInEditor() {
- IProject project = ProjectUtilities.getProject(getJavaClass());
- try {
- J2EEEditorUtility.openInEditor(getJavaClass(), project);
- } catch (Exception cantOpen) {
- //Ignore
- }
- }
-
- /**
- * Insert the method's description here. Creation date: (7/11/2001 1:47:24 PM)
- *
- * @param newEjb
- * org.eclipse.jst.j2ee.internal.internal.ejb.EnterpriseBean
- */
- public void setEjb(org.eclipse.jst.j2ee.ejb.EnterpriseBean newEjb) {
- ejb = newEjb;
- }
-
- /**
- * @see IAdaptable#EcoreUtil.getAdapter(eAdapters(),Class)
- */
- public Object getAdapter(Class adapter) {
- if (adapter == IRESOURCE_CLASS)
- return J2EEEditorUtility.getFile(getJavaClass());
- if (adapter == IPROJECT_CLASS)
- return getProject();
- return null;
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/J2EEMessageDrivenItemProvider.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/J2EEMessageDrivenItemProvider.java
deleted file mode 100644
index a01558641..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/J2EEMessageDrivenItemProvider.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 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.jst.j2ee.internal.ejb.provider;
-
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import org.eclipse.jst.j2ee.ejb.MessageDriven;
-
-
-/**
- * @author jsholl
- *
- * To change this generated comment edit the template variable "typecomment":
- * Window>Preferences>Java>Templates. To enable and disable the creation of type comments go to
- * Window>Preferences>Java>Code Generation.
- */
-public class J2EEMessageDrivenItemProvider extends MessageDrivenItemProvider {
-
- public J2EEMessageDrivenItemProvider(org.eclipse.emf.common.notify.AdapterFactory adapterFactory) {
- super(adapterFactory);
- }
-
- public Collection getChildren(Object object) {
- List result = new ArrayList();
- result.addAll(super.getChildrenSuper(object));
- J2EEJavaClassProviderHelper.addChildren((MessageDriven) object, result);
- return result;
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/J2EEReferenceProviderHelper.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/J2EEReferenceProviderHelper.java
deleted file mode 100644
index b8b894876..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/J2EEReferenceProviderHelper.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 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
- *******************************************************************************/
-/*
- * Created on May 6, 2003
- *
- * To change the template for this generated file go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-package org.eclipse.jst.j2ee.internal.ejb.provider;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import org.eclipse.jst.j2ee.ejb.EnterpriseBean;
-
-
-/**
- * @author jsholl
- *
- * To change the template for this generated type comment go to Window>Preferences>Java>Code
- * Generation>Code and Comments
- */
-public class J2EEReferenceProviderHelper {
-
- public static Collection getReferences(EnterpriseBean bean) {
- List result = new ArrayList();
- if (!bean.getEjbRefs().isEmpty())
- result.addAll(bean.getEjbRefs());
- if (!bean.getEjbLocalRefs().isEmpty())
- result.addAll(bean.getEjbLocalRefs());
- if (!bean.getResourceRefs().isEmpty())
- result.addAll(bean.getResourceRefs());
- if (!bean.getSecurityRoleRefs().isEmpty())
- result.addAll(bean.getSecurityRoleRefs());
- if (!bean.getResourceEnvRefs().isEmpty())
- result.addAll(bean.getResourceEnvRefs());
- return result;
- }
-
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/J2EESessionItemProvider.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/J2EESessionItemProvider.java
deleted file mode 100644
index d64d2751b..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/J2EESessionItemProvider.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 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.jst.j2ee.internal.ejb.provider;
-
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import org.eclipse.jst.j2ee.ejb.Session;
-import org.eclipse.jst.j2ee.internal.J2EEVersionConstants;
-
-
-/**
- * Insert the type's description here. Creation date: (6/20/2001 11:10:48 PM)
- *
- * @author: Administrator
- */
-public class J2EESessionItemProvider extends org.eclipse.jst.j2ee.internal.ejb.provider.SessionItemProvider {
- /**
- * J2EESessionItemProvider constructor comment.
- *
- * @param adapterFactory
- * org.eclipse.emf.common.notify.AdapterFactory
- */
- public J2EESessionItemProvider(org.eclipse.emf.common.notify.AdapterFactory adapterFactory) {
- super(adapterFactory);
- }
-
- public Collection getChildren(Object object) {
- List result = new ArrayList();
- result.addAll(super.getChildrenSuper(object));
- addServiceEndpointInterface((Session) object, result);
- J2EEJavaClassProviderHelper.addChildren((Session) object, result);
- return result;
- }
-
- /**
- * @param session
- * @param result
- */
- private void addServiceEndpointInterface(Session session, Collection children) {
- if (session.getVersionID() >= J2EEVersionConstants.EJB_2_1_ID && session.getServiceEndpoint() != null)
- children.add(new ServiceEndpointInterfaceProviderHelper(session));
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/LocalHomeInterfaceProviderHelper.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/LocalHomeInterfaceProviderHelper.java
deleted file mode 100644
index cfea51ac7..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/LocalHomeInterfaceProviderHelper.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2003, 2004 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.jst.j2ee.internal.ejb.provider;
-
-
-import org.eclipse.jem.java.JavaClass;
-import org.eclipse.jst.j2ee.ejb.EnterpriseBean;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIMessages;
-import org.eclipse.swt.graphics.Image;
-
-
-public class LocalHomeInterfaceProviderHelper extends J2EEJavaClassProviderHelper {
-
- private static Image image;
-
- /**
- * Constructor for LocalHomeInterfaceProviderHelper.
- *
- * @param anEJB
- */
- public LocalHomeInterfaceProviderHelper(EnterpriseBean anEJB) {
- super(anEJB);
- }
-
- /**
- * @see J2EEJavaClassProviderHelper#getJavaClass()
- */
- public JavaClass getJavaClass() {
- return getEjb().getLocalHomeInterface();
- }
-
- public Image getImage() {
- if (image == null)
- image = createImage();
- return image;
- }
-
- /**
- * @see J2EEJavaClassProviderHelper#getOverlayKey()
- */
- protected String getOverlayKey() {
- return "local_home_interface_overlay_obj"; //$NON-NLS-1$
- }
-
- /**
- * @see J2EEJavaClassProviderHelper#getTypeString(String)
- */
- public String getTypeString(String className) {
- return J2EEUIMessages.getResourceString("Local_Home_Interface_UI_", new Object[]{className}); //$NON-NLS-1$ = "Local Home Interface";
- }
-
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/LocalInterfaceProviderHelper.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/LocalInterfaceProviderHelper.java
deleted file mode 100644
index 9a9af2dcb..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/LocalInterfaceProviderHelper.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2003, 2004 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.jst.j2ee.internal.ejb.provider;
-
-
-import org.eclipse.jem.java.JavaClass;
-import org.eclipse.jst.j2ee.ejb.EnterpriseBean;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIMessages;
-import org.eclipse.swt.graphics.Image;
-
-
-public class LocalInterfaceProviderHelper extends J2EEJavaClassProviderHelper {
-
- private static Image image;
-
- /**
- * Constructor for LocalInterfaceProviderHelper.
- *
- * @param anEJB
- */
- public LocalInterfaceProviderHelper(EnterpriseBean anEJB) {
- super(anEJB);
- }
-
- public Image getImage() {
- if (image == null)
- image = createImage();
- return image;
- }
-
- /**
- * @see J2EEJavaClassProviderHelper#getJavaClass()
- */
- public JavaClass getJavaClass() {
- return getEjb().getLocalInterface();
- }
-
- /**
- * @see J2EEJavaClassProviderHelper#getOverlayKey()
- */
- protected String getOverlayKey() {
- return "local_interface_overlay_obj";//$NON-NLS-1$
- }
-
- /**
- * @see J2EEJavaClassProviderHelper#getTypeString(String)
- */
- public String getTypeString(String className) {
- return J2EEUIMessages.getResourceString("Local_Interface_UI_", new Object[]{className}); //$NON-NLS-1$ = "Local Interface"
- }
-
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/MethodPermissionsContentProvider.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/MethodPermissionsContentProvider.java
deleted file mode 100644
index e2109e970..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/MethodPermissionsContentProvider.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 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.jst.j2ee.internal.ejb.provider;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jst.j2ee.ejb.AssemblyDescriptor;
-import org.eclipse.jst.j2ee.ejb.CMPAttribute;
-import org.eclipse.jst.j2ee.ejb.EJBJar;
-import org.eclipse.jst.j2ee.ejb.EnterpriseBean;
-import org.eclipse.jst.j2ee.ejb.MethodPermission;
-import org.eclipse.jst.j2ee.ejb.internal.impl.EjbFactoryImpl;
-
-
-public class MethodPermissionsContentProvider extends AbstractMethodsContentProvider {
- private static final EStructuralFeature PERMISSION_MES_SF = EjbFactoryImpl.getPackage().getMethodPermission_MethodElements();
- private static final EStructuralFeature PERMISSION_MES_UNCHECKED_SF = EjbFactoryImpl.getPackage().getMethodPermission_Unchecked();
- private static final EStructuralFeature PERMISSION_MES_ROLES_SF = EjbFactoryImpl.getPackage().getMethodPermission_Roles();
- private static final EStructuralFeature AD_MP_SF = EjbFactoryImpl.getPackage().getAssemblyDescriptor_MethodPermissions();
-
- /**
- * Constructor for MethodPermissionsContentProvider.
- *
- * @param adapterFactory
- * @param root
- * @param viewer
- */
- public MethodPermissionsContentProvider(AdapterFactory adapterFactory, boolean root) {
- super(adapterFactory, root);
- }
-
- /**
- * Constructor for MethodPermissionsContentProvider.
- *
- * @param adapterFactory
- */
- public MethodPermissionsContentProvider(AdapterFactory adapterFactory) {
- super(adapterFactory);
- }
-
- /*
- * @see ITreeContentProvider#getChildren(Object)
- */
- public Object[] getChildren(Object parentElement) {
- if (parentElement instanceof MethodPermission)
- return getEnterpriseBeans((MethodPermission) parentElement);
- return super.getChildren(parentElement);
- }
-
- protected Object[] getEnterpriseBeans(MethodPermission mp) {
- List mes = mp.getMethodElements();
- return getEnterpriseBeans(mp, mes);
- }
-
- /*
- * @see AbstractMethodsContentProvider#getMethodElements(EObject, EnterpriseBean)
- */
- protected List getMethodElements(EObject aRefObject, EnterpriseBean anEJB) {
- if (!(aRefObject instanceof MethodPermission))
- return Collections.EMPTY_LIST;
- MethodPermission parentMP = (MethodPermission) aRefObject;
- if (parentMP == null)
- return Collections.EMPTY_LIST;
- return parentMP.getMethodElements(anEJB);
- }
-
- /*
- * @see IStructuredContentProvider#getElements(Object)
- */
- public Object[] getElements(Object inputElement) {
- super.getElements(inputElement);
- if (inputElement instanceof EJBJar) {
- EJBJar jar = (EJBJar) inputElement;
- if (jar.getAssemblyDescriptor() != null)
- return jar.getAssemblyDescriptor().getMethodPermissions().toArray();
- }
- if (inputElement instanceof AssemblyDescriptor)
- return ((AssemblyDescriptor) inputElement).getMethodPermissions().toArray();
- return new Object[0];
- }
-
- /*
- * @see ITreeContentProvider#hasChildren(Object)
- */
- public boolean hasChildren(Object element) {
- if (element instanceof MethodPermission)
- return !((MethodPermission) element).getMethodElements().isEmpty();
- return super.hasChildren(element);
- }
-
- /*
- * @see AbstractMethodsContentProvider#getMethodElementsReference()
- */
- protected EStructuralFeature getMethodElementsReference() {
- return PERMISSION_MES_SF;
- }
-
- /**
- * @see org.eclipse.jst.j2ee.internal.internal.ejb.ui.providers.AbstractMethodsContentProvider#getMethodElementsContainerReference()
- */
- protected EStructuralFeature getMethodElementsContainerReference() {
- return AD_MP_SF;
- }
-
- /**
- * @see org.eclipse.emf.edit.provider.INotifyChangedListener#notifyChanged(Notification)
- */
- public void notifyChanged(Notification notification) {
- if (notification.getFeature() == PERMISSION_MES_SF || notification.getFeature() == AD_MP_SF)
- refreshTreeViewer();
- else if (notification.getOldValue() instanceof CMPAttribute && notification.getNewValue() == null)
- return;
- if (notification.getFeature() == PERMISSION_MES_UNCHECKED_SF || notification.getFeature() == PERMISSION_MES_ROLES_SF || notification.getFeature() == getMethodElementsReference() || notification.getFeature() == getMethodElementsContainerReference())
- super.notifyChanged(notification);
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/MethodTransactionContentProvider.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/MethodTransactionContentProvider.java
deleted file mode 100644
index fe0e1b797..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/MethodTransactionContentProvider.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 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.jst.j2ee.internal.ejb.provider;
-
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jst.j2ee.ejb.AssemblyDescriptor;
-import org.eclipse.jst.j2ee.ejb.EJBJar;
-import org.eclipse.jst.j2ee.ejb.EnterpriseBean;
-import org.eclipse.jst.j2ee.ejb.MethodTransaction;
-import org.eclipse.jst.j2ee.ejb.internal.impl.EjbFactoryImpl;
-
-
-public class MethodTransactionContentProvider extends AbstractMethodsContentProvider {
- private static final EStructuralFeature TRANSACTION_MES_SF = EjbFactoryImpl.getPackage().getMethodTransaction_MethodElements();
- private static final EStructuralFeature AD_MT_SF = EjbFactoryImpl.getPackage().getAssemblyDescriptor_MethodTransactions();
-
- /**
- * Constructor for MethodTransactionContentProvider.
- *
- * @param adapterFactory
- * @param root
- * @param viewer
- */
- public MethodTransactionContentProvider(AdapterFactory adapterFactory, boolean root) {
- super(adapterFactory, root);
- }
-
- /**
- * Constructor for MethodTransationContentProvider.
- *
- * @param adapterFactory
- */
- public MethodTransactionContentProvider(AdapterFactory adapterFactory) {
- super(adapterFactory);
- }
-
- /*
- * @see ITreeContentProvider#getChildren(Object)
- */
- public Object[] getChildren(Object parentElement) {
- if (parentElement instanceof MethodTransaction)
- return getEnterpriseBeans((MethodTransaction) parentElement);
- return super.getChildren(parentElement);
- }
-
- protected Object[] getEnterpriseBeans(MethodTransaction mt) {
- List mes = mt.getMethodElements();
- return getEnterpriseBeans(mt, mes);
- }
-
- /*
- * @see AbstractMethodsContentProvider#getMethodElements(EObject, EnterpriseBean)
- */
- protected List getMethodElements(EObject aRefObject, EnterpriseBean anEJB) {
- if (!(aRefObject instanceof MethodTransaction))
- return Collections.EMPTY_LIST;
- MethodTransaction parentMT = (MethodTransaction) aRefObject;
- if (parentMT == null)
- return Collections.EMPTY_LIST;
- return parentMT.getMethodElements(anEJB);
- }
-
- /*
- * @see IStructuredContentProvider#getElements(Object)
- */
- public Object[] getElements(Object inputElement) {
- super.getElements(inputElement);
- if (inputElement instanceof EJBJar) {
- EJBJar jar = (EJBJar) inputElement;
- if (jar.getAssemblyDescriptor() != null)
- return jar.getAssemblyDescriptor().getMethodTransactions().toArray();
- }
- if (inputElement instanceof AssemblyDescriptor)
- return ((AssemblyDescriptor) inputElement).getMethodTransactions().toArray();
- return new Object[0];
- }
-
- /*
- * @see ITreeContentProvider#hasChildren(Object)
- */
- public boolean hasChildren(Object element) {
- if (element instanceof MethodTransaction)
- return !((MethodTransaction) element).getMethodElements().isEmpty();
- return super.hasChildren(element);
- }
-
- /*
- * @see AbstractMethodsContentProvider#getMethodElementsReference()
- */
- protected EStructuralFeature getMethodElementsReference() {
- return TRANSACTION_MES_SF;
- }
-
- /**
- * @see org.eclipse.jst.j2ee.internal.internal.ejb.ui.providers.AbstractMethodsContentProvider#getMethodElementsContainerReference()
- */
- protected EStructuralFeature getMethodElementsContainerReference() {
- return AD_MT_SF;
- }
-
-
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/PrimaryKeyClassProviderHelper.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/PrimaryKeyClassProviderHelper.java
deleted file mode 100644
index a2893b519..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/PrimaryKeyClassProviderHelper.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 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.jst.j2ee.internal.ejb.provider;
-
-
-import org.eclipse.jem.java.JavaClass;
-import org.eclipse.jst.j2ee.ejb.EnterpriseBean;
-import org.eclipse.jst.j2ee.ejb.Entity;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIMessages;
-import org.eclipse.swt.graphics.Image;
-
-
-/**
- * Insert the type's description here. Creation date: (6/21/2001 12:28:55 AM)
- *
- * @author: Administrator
- */
-public class PrimaryKeyClassProviderHelper extends J2EEJavaClassProviderHelper {
- private static Image image;
-
- /**
- * PrimaryKeyClassProviderHelper constructor comment.
- *
- * @param cls
- * org.eclipse.jem.internal.java.JavaClass
- */
- public PrimaryKeyClassProviderHelper(EnterpriseBean anEJB) {
- super(anEJB);
- }
-
- public Image getImage() {
- if (image == null)
- image = createImage();
- return image;
- }
-
- /**
- * Insert the method's description here. Creation date: (7/11/2001 1:54:22 PM)
- *
- * @return org.eclipse.jem.internal.java.JavaClass
- */
- public JavaClass getJavaClass() {
- return ((Entity) getEjb()).getPrimaryKey();
- }
-
- protected String getOverlayKey() {
- return "key_interf_ov";//$NON-NLS-1$
- }
-
- public String getTypeString(String className) {
- return J2EEUIMessages.getResourceString("Primary_Key_Class_UI_", new Object[]{className}); //$NON-NLS-1$ = "Primary Key Class"
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/RemoteInterfaceProviderHelper.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/RemoteInterfaceProviderHelper.java
deleted file mode 100644
index 3fcb79009..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/RemoteInterfaceProviderHelper.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 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.jst.j2ee.internal.ejb.provider;
-
-
-import org.eclipse.jem.java.JavaClass;
-import org.eclipse.jst.j2ee.ejb.EnterpriseBean;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIMessages;
-import org.eclipse.swt.graphics.Image;
-
-
-/**
- * Insert the type's description here. Creation date: (6/21/2001 12:28:12 AM)
- *
- * @author: Administrator
- */
-public class RemoteInterfaceProviderHelper extends J2EEJavaClassProviderHelper {
- private static Image image;
-
- /**
- * RemoteInterfaceProviderHelper constructor comment.
- *
- * @param cls
- * org.eclipse.jem.internal.java.JavaClass
- */
- public RemoteInterfaceProviderHelper(EnterpriseBean anEJB) {
- super(anEJB);
- }
-
- public Image getImage() {
- if (image == null)
- image = createImage();
- return image;
- }
-
- /**
- * Insert the method's description here. Creation date: (7/11/2001 1:55:48 PM)
- *
- * @return org.eclipse.jem.internal.java.JavaClass
- */
- public JavaClass getJavaClass() {
- return getEjb().getRemoteInterface();
- }
-
- protected String getOverlayKey() {
- return "remote_interface_overlay_obj";//$NON-NLS-1$
- }
-
- public String getTypeString(String className) {
- return J2EEUIMessages.getResourceString("Remote_Interface_UI_", new Object[]{className}); //$NON-NLS-1$ = "Remote Interface"
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/ServiceEndpointInterfaceProviderHelper.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/ServiceEndpointInterfaceProviderHelper.java
deleted file mode 100644
index 5ad2b0c2e..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ejb/provider/ServiceEndpointInterfaceProviderHelper.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 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
- *******************************************************************************/
-/*
- * Created on Mar 19, 2004
- *
- * To change the template for this generated file go to
- * Window - Preferences - Java - Code Generation - Code and Comments
- */
-package org.eclipse.jst.j2ee.internal.ejb.provider;
-
-import org.eclipse.jem.java.JavaClass;
-import org.eclipse.jst.j2ee.ejb.EnterpriseBean;
-import org.eclipse.jst.j2ee.ejb.Session;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIMessages;
-import org.eclipse.swt.graphics.Image;
-
-
-/**
- * @author dfholttp
- *
- * To change the template for this generated type comment go to Window - Preferences - Java - Code
- * Generation - Code and Comments
- */
-public class ServiceEndpointInterfaceProviderHelper extends J2EEJavaClassProviderHelper {
- private static Image image;
-
- /**
- * @param anEJB
- */
- public ServiceEndpointInterfaceProviderHelper(EnterpriseBean anEJB) {
- super(anEJB);
- }
-
- public Image getImage() {
- if (image == null)
- image = createImage();
- return image;
- }
-
- /**
- * Insert the method's description here. Creation date: (7/11/2001 1:53:49 PM)
- *
- * @return org.eclipse.jem.internal.java.JavaClass
- */
- public JavaClass getJavaClass() {
- return ((Session) getEjb()).getServiceEndpoint();
- }
-
- protected String getOverlayKey() {
- //TODO: DFH we need an icon
- return "";//$NON-NLS-1$
- }
-
- public String getTypeString(String className) {
- return J2EEUIMessages.getResourceString("Service_Endpoint_Interface_UI_", new Object[]{className}); //$NON-NLS-1$ = "Home Interface"
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/listeners/IValidateEditListener.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/listeners/IValidateEditListener.java
deleted file mode 100644
index 0544eb584..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/listeners/IValidateEditListener.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2003, 2004 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.jst.j2ee.internal.listeners;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.swt.events.ShellListener;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IPartListener;
-import org.eclipse.wst.common.internal.emfworkbench.validateedit.ResourceStateValidatorPresenter;
-
-
-public interface IValidateEditListener extends ResourceStateValidatorPresenter, IPartListener, ShellListener {
- /**
- * This method should be called by any action that is about to edit any contents of any IFile.
- */
- public IStatus validateState();
-
- /**
- * Return true if there are any read only IFiles that are being managed.
- *
- * @return boolean
- * @see com.ibm.etools.emf.workbench.ResourceStateInputProvider#getResources()
- */
- boolean hasReadOnlyFiles();
-
- /**
- * This method should be called prior to saving the contents. It returns true if the contents
- * can be saved.
- */
- boolean checkSave() throws CoreException;
-
- /**
- * Use this method to set the Shell that will be used to prompt to the user.
- */
- void setShell(Shell aShell);
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/listeners/ValidateEditListener.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/listeners/ValidateEditListener.java
deleted file mode 100644
index d8c8a9636..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/listeners/ValidateEditListener.java
+++ /dev/null
@@ -1,330 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.jst.j2ee.internal.listeners;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jst.j2ee.internal.dialogs.ListMessageDialog;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIMessages;
-import org.eclipse.swt.events.ShellAdapter;
-import org.eclipse.swt.events.ShellEvent;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.common.internal.emfworkbench.WorkbenchResourceHelper;
-import org.eclipse.wst.common.internal.emfworkbench.integration.EditModel;
-import org.eclipse.wst.common.internal.emfworkbench.validateedit.IValidateEditContext;
-import org.eclipse.wst.common.internal.emfworkbench.validateedit.ResourceStateValidator;
-
-public class ValidateEditListener extends ShellAdapter implements IValidateEditListener, IValidateEditContext {
-
- protected ResourceStateValidator fValidator;
- private boolean fNeedsStateValidation = true;
- private Shell fShell;
- private IWorkbenchPart fPart;
- private boolean fHasReadOnlyFiles = false;
- private boolean firstReadOnlyFileAttempt = true;
- private boolean fMessageUp = false;
- private boolean fIsActivating = false;
- private boolean fIsDeactivating = false;
- private boolean inconsistentResult;
- private boolean inconsistentOverwriteResult;
-
- public ValidateEditListener() {
- super();
- try {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- IWorkbench wb = PlatformUI.getWorkbench();
- if (wb == null) return;
- IWorkbenchWindow window = wb.getActiveWorkbenchWindow();
- if (window == null && wb.getWorkbenchWindowCount()>0) {
- for (int i=0; i<wb.getWorkbenchWindows().length; i++) {
- window = wb.getWorkbenchWindows()[i];
- if (window != null)
- break;
- }
-
- }
- if (window!=null)
- setShell(window.getShell());
- }
- });
-
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- /**
- * Constructor for ValidateEditHandler.
- */
- public ValidateEditListener(IWorkbenchPart part, ResourceStateValidator aValidator) {
- super();
- fPart = part;
- fValidator = aValidator;
- if (part != null)
- part.getSite().getPage().addPartListener(this);
- if (getShell() != null)
- getShell().addShellListener(this);
- }
-
- protected Shell getShell() {
- if (fShell == null) {
- if (fPart != null && fPart.getSite() != null)
- fShell = fPart.getSite().getShell();
- }
- return fShell;
- }
-
- /**
- * @see IValidateEditListener#getValidator()
- */
- public ResourceStateValidator getValidator() {
- return fValidator;
- }
-
- /**
- * @see IValidateEditListener#getNeedsStateValidation()
- */
- public boolean getNeedsStateValidation() {
- return fNeedsStateValidation;
- }
-
- /**
- * @see IValidateEditListener#setNeedsStateValidation(boolean)
- */
- public void setNeedsStateValidation(boolean needsStateValidation) {
- fNeedsStateValidation = needsStateValidation;
- }
-
- /**
- * @see org.eclipse.wst.common.internal.emfworkbench.validateedit.ResourceStateValidatorPresenter#promptForInconsistentFileRefresh(List)
- */
- public boolean promptForInconsistentFileRefresh(List inconsistentFiles) {
- if (inconsistentFiles == null || inconsistentFiles.size() == 0) // this case should never
- // occur.
- return false;
-
- List inconsistentFileNames = new ArrayList();
- for (int i = 0; inconsistentFiles.size() > i; i++) {
- Object file = inconsistentFiles.get(i);
- if (file instanceof Resource) {
- IFile aFile = WorkbenchResourceHelper.getFile((Resource) file);
- inconsistentFileNames.add(aFile.getFullPath().toOSString());
- } else if (file instanceof IResource) {
- IResource resfile = (IResource) file;
- if (!resfile.exists()) {
- return false;
- }
- inconsistentFileNames.add(resfile.getFullPath().toOSString());
- }
- }
-
- final String title = J2EEUIMessages.getResourceString("Inconsistent_Files_3"); //$NON-NLS-1$
- final String message = J2EEUIMessages.getResourceString("The_following_workspace_files_are_inconsistent_with_the_editor_4") + J2EEUIMessages.getResourceString("Update_the_editor_with_the_workspace_contents__5"); //$NON-NLS-1$ //$NON-NLS-2$
- final String[] fileNames = (String[])inconsistentFileNames.toArray(new String[inconsistentFileNames.size()]);
-
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- inconsistentResult = ListMessageDialog.openQuestion(getShell(), title, message, fileNames);
- }
- });
- return inconsistentResult;
- }
-
- /**
- * @see org.eclipse.wst.common.internal.emfworkbench.validateedit.ResourceStateValidatorPresenter#getValidateEditContext()
- */
- public Object getValidateEditContext() {
- return getShell();
- }
-
- /**
- * @see org.eclipse.ui.IPartListener#partActivated(IWorkbenchPart)
- */
- public void partActivated(IWorkbenchPart part) {
- if (part == fPart) {
- handleActivation();
- }
- }
-
- protected void handleActivation() {
- if (fIsActivating)
- return;
- fIsActivating = true;
- try {
- fValidator.checkActivation(this);
- updatePartReadOnly();
- } catch (CoreException e) {
- // do nothing for now
- } finally {
- fIsActivating = false;
- }
- }
-
- /**
- * @see org.eclipse.swt.events.ShellListener#shellActivated(ShellEvent)
- */
- public void shellActivated(ShellEvent event) {
- handleActivation();
- }
-
- /**
- * @see org.eclipse.ui.IPartListener#partBroughtToTop(IWorkbenchPart)
- */
- public void partBroughtToTop(IWorkbenchPart part) {
- //do nothing
- }
-
- /**
- * @see org.eclipse.ui.IPartListener#partClosed(IWorkbenchPart)
- */
- public void partClosed(IWorkbenchPart part) {
- if (part == fPart)
- part.getSite().getPage().removePartListener(this);
- if (getShell() != null)
- getShell().removeShellListener(this);
- }
-
- /**
- * @see org.eclipse.ui.IPartListener#partDeactivated(IWorkbenchPart)
- */
- public void partDeactivated(IWorkbenchPart part) {
- if (part == fPart) {
- if (fIsDeactivating)
- return;
- fIsDeactivating = true;
- try {
- fValidator.lostActivation(this);
- updatePartReadOnly();
- } catch (CoreException e) {
- // do nothing for now
- } finally {
- fIsDeactivating = true;
- }
- }
- }
-
- /**
- * @see org.eclipse.ui.IPartListener#partOpened(IWorkbenchPart)
- */
- public void partOpened(IWorkbenchPart part) {
- //do nothing
- }
-
- public IStatus validateState() {
- IWorkbench wb = PlatformUI.getWorkbench();
- if ((fShell==null) && (wb != null && (wb.getActiveWorkbenchWindow() != null)))
- fShell=wb.getActiveWorkbenchWindow().getShell();
- if (fNeedsStateValidation) {
- setNeedsStateValidation(false);
- try {
- final IStatus status = fValidator.validateState(this);
- if (status.getSeverity() == IStatus.ERROR) {
- setNeedsStateValidation(true);
- if (!fMessageUp) {
- fMessageUp = true;
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- MessageDialog.openError(getShell(), J2EEUIMessages.getResourceString("Error_checking_out_files_10"), status.getMessage()); //$NON-NLS-1$
- }
- });
- fMessageUp = false;
- }
- }
- fValidator.checkActivation(this);
- updatePartReadOnly();
- return status;
- } catch (CoreException e) {
- // do nothing for now
- }
- }
- return ResourceStateValidator.OK_STATUS;
- }
-
- /**
- * @see org.eclipse.wst.common.internal.emfworkbench.validateedit.ResourceStateValidatorPresenter#promptForInconsistentFileOverwrite(List)
- */
- public boolean promptForInconsistentFileOverwrite(List inconsistentFiles) {
- int size = inconsistentFiles.size();
- List files = new ArrayList();
- IFile file = null;
- for (int i = 0; i < size; i++) {
- file = (IFile) inconsistentFiles.get(i);
- files.add(file.getFullPath().toString());
- }
- final String[] items = (String[])files.toArray(new String[files.size()]);
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- inconsistentOverwriteResult = ListMessageDialog.openQuestion(getShell(), J2EEUIMessages.getResourceString("Inconsistent_files_detected_11"), //$NON-NLS-1$
- J2EEUIMessages.getResourceString("The_following_files_are_inconsistent_with_the_file_system._Do_you_want_to_save_and_overwrite_these_files_on_the_file_system__12_WARN_"), //$NON-NLS-1$
- items);
- }
- });
- return inconsistentOverwriteResult;
- }
-
- protected boolean checkReadOnly() {
- fHasReadOnlyFiles = fValidator.checkReadOnly();
- return fHasReadOnlyFiles;
- }
-
- /**
- * @see IValidateEditListener#hasReadOnlyFiles()
- */
- public boolean hasReadOnlyFiles() {
- if (firstReadOnlyFileAttempt) {
- checkReadOnly();
- firstReadOnlyFileAttempt = false;
- }
- return fHasReadOnlyFiles;
- }
-
- /**
- * Method updatePartReadOnly.
- */
- protected void updatePartReadOnly() {
- if (!getNeedsStateValidation()) {
- checkReadOnly();
- setNeedsStateValidation(true);
- } else { //So that J2EEXMLActionBarContributor get updated info when editor Activated.
- firstReadOnlyFileAttempt = true;
- }
- }
-
- public boolean checkSave() throws CoreException {
- return validateState().isOK() && getValidator().checkSave(this);
- }
-
- public void setShell(Shell aShell) {
- fShell = aShell;
- }
-
- public void setEditModel(EditModel anEditModel) {
- fValidator = anEditModel;
-
- }
-
- public IStatus validateState(EditModel anEditModel) {
- setEditModel(anEditModel);
- return validateState();
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/perspective/J2EEPerspective.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/perspective/J2EEPerspective.java
deleted file mode 100644
index 34fee6673..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/perspective/J2EEPerspective.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 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
- *******************************************************************************/
-/*
- * Created on Dec 7, 2004
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-package org.eclipse.jst.j2ee.internal.perspective;
-
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jdt.ui.JavaUI;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEPreferences;
-import org.eclipse.ui.IFolderLayout;
-import org.eclipse.ui.IPageLayout;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.progress.IProgressConstants;
-import org.eclipse.ui.views.IViewDescriptor;
-
-/**
- *
- * TODO To change the template for this generated type comment go to Window - Preferences - Java -
- * Code Style - Code Templates
- */
-public class J2EEPerspective implements org.eclipse.ui.IPerspectiveFactory {
-
- protected static String ID_SERVERS_VIEW = "org.eclipse.wst.server.ui.ServersView"; //$NON-NLS-1$
- protected static String ID_J2EE_HIERARCHY_VIEW = "org.eclipse.ui.navigator.ProjectExplorer"; //$NON-NLS-1$
-
- private static String ID_WST_SNIPPETS_VIEW = "org.eclipse.wst.common.snippets.internal.ui.SnippetsView"; //$NON-NLS-1$
- private static final String ID_SEARCH_VIEW = "org.eclipse.search.ui.views.SearchView"; //$NON-NLS-1$
- private static final String ID_DATA_VIEW = "org.eclipse.datatools.connectivity.DataSourceExplorerNavigator"; //$NON-NLS-1$
- public static final String ID_CONSOLE_VIEW= "org.eclipse.ui.console.ConsoleView"; //$NON-NLS-1$
-
- public J2EEPerspective() {
- super();
- //If preference exists for alternate view, replace.
- String viewerID = J2EEPlugin.getDefault().getJ2EEPreferences().getString(J2EEPreferences.Keys.ID_PERSPECTIVE_HIERARCHY_VIEW);
- if (viewerID != null)
- ID_J2EE_HIERARCHY_VIEW = viewerID;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IPerspectiveFactory#createInitialLayout(org.eclipse.ui.IPageLayout)
- */
- public void createInitialLayout(IPageLayout layout) {
- defineLayout(layout);
- defineActions(layout);
- }
-
-
-
- public void defineActions(IPageLayout layout) {
- layout.addActionSet("org.eclipse.jst.j2ee.J2eeMainActionSet"); //$NON-NLS-1$
- layout.addActionSet("org.eclipse.jdt.ui.JavaActionSet"); //$NON-NLS-1$
-
- layout.addActionSet(IDebugUIConstants.LAUNCH_ACTION_SET);
- layout.addActionSet(IDebugUIConstants.DEBUG_ACTION_SET);
-
- layout.addActionSet(IPageLayout.ID_NAVIGATE_ACTION_SET);
-
- layout.addShowViewShortcut(ID_J2EE_HIERARCHY_VIEW);
- layout.addShowViewShortcut(ID_SERVERS_VIEW);
- layout.addShowViewShortcut(ID_DATA_VIEW);
- layout.addShowViewShortcut(IPageLayout.ID_BOOKMARKS);
- layout.addShowViewShortcut(IPageLayout.ID_OUTLINE);
- layout.addShowViewShortcut(IPageLayout.ID_PROBLEM_VIEW);
- layout.addShowViewShortcut(IPageLayout.ID_PROP_SHEET);
- layout.addShowViewShortcut(IPageLayout.ID_RES_NAV);
- layout.addShowViewShortcut(IPageLayout.ID_TASK_LIST);
- layout.addShowViewShortcut(ID_WST_SNIPPETS_VIEW);
-
- // views - search
- layout.addShowViewShortcut(ID_SEARCH_VIEW);
- // views - debugging
- layout.addShowViewShortcut(ID_CONSOLE_VIEW);
-
- layout.addShowInPart(ID_J2EE_HIERARCHY_VIEW);
- }
-
- public void defineLayout(IPageLayout layout) {
- // Editors are placed for free.
- String editorArea = layout.getEditorArea();
-
- // Top left.
- IFolderLayout topLeft = layout.createFolder("topLeft", IPageLayout.LEFT, 0.25f, editorArea);//$NON-NLS-1$
- topLeft.addView(ID_J2EE_HIERARCHY_VIEW);
- topLeft.addPlaceholder(IPageLayout.ID_RES_NAV);
- topLeft.addPlaceholder(JavaUI.ID_TYPE_HIERARCHY);
- topLeft.addPlaceholder(JavaUI.ID_PACKAGES_VIEW);
-
- // Bottom right.
- IFolderLayout bottomRight = layout.createFolder("bottomRight", IPageLayout.BOTTOM, 0.7f, editorArea);//$NON-NLS-1$
- bottomRight.addView(IPageLayout.ID_PROBLEM_VIEW);
- bottomRight.addView(IPageLayout.ID_TASK_LIST);
- bottomRight.addView(IPageLayout.ID_PROP_SHEET);
- bottomRight.addView(ID_SERVERS_VIEW);
- addDBViewIfPresent(layout,bottomRight);
- bottomRight.addView(ID_WST_SNIPPETS_VIEW);
-
- bottomRight.addPlaceholder(ID_CONSOLE_VIEW);
- bottomRight.addPlaceholder(IPageLayout.ID_BOOKMARKS);
- bottomRight.addPlaceholder(IProgressConstants.PROGRESS_VIEW_ID);
- bottomRight.addPlaceholder(ID_SEARCH_VIEW);
-
- // Top right.
- IFolderLayout topRight = layout.createFolder("topRight", IPageLayout.RIGHT, 0.7f, editorArea);//$NON-NLS-1$
- topRight.addView(IPageLayout.ID_OUTLINE);
- }
- private void addDBViewIfPresent(IPageLayout page,IFolderLayout bottomRight) {
- // TODO Auto-generated method stub
- IViewDescriptor dbView = PlatformUI.getWorkbench().getViewRegistry().find(ID_DATA_VIEW);
- if (dbView != null)
- bottomRight.addView(ID_DATA_VIEW);
- }
-}
-
-
-
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/plugin/BinaryEditorUtilities.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/plugin/BinaryEditorUtilities.java
deleted file mode 100644
index 143a99a46..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/plugin/BinaryEditorUtilities.java
+++ /dev/null
@@ -1,240 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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.jst.j2ee.internal.plugin;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IStorage;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.PlatformObject;
-import org.eclipse.jdt.core.IJavaModelStatusConstants;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.internal.core.JavaModelManager;
-import org.eclipse.jdt.internal.core.JavaModelStatus;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jst.jee.archive.internal.ArchiveUtil;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorRegistry;
-import org.eclipse.ui.IPersistableElement;
-import org.eclipse.ui.IStorageEditorInput;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.common.componentcore.internal.resources.VirtualArchiveComponent;
-
-public class BinaryEditorUtilities {
-
- private static class JarEntryFile extends PlatformObject implements
- IStorage {
- private String entryName;
- private String zipName;
- private IPath path;
-
- public JarEntryFile(String entryName, String zipName) {
- this.entryName = entryName;
- this.zipName = zipName;
- this.path = new Path(this.entryName);
- }
-
- public InputStream getContents() throws CoreException {
-
- try {
- if (JavaModelManager.ZIP_ACCESS_VERBOSE) {
- //$ANALYSIS-IGNORE
- System.out.println("(" + Thread.currentThread() + ") [JarEntryFile.getContents()] Creating ZipFile on " + this.zipName);
- }
- ZipFile zipFile = ArchiveUtil.newZipFile(this.zipName);
- ZipEntry zipEntry = zipFile.getEntry(this.entryName);
- if (zipEntry == null) {
- throw new JavaModelException(new JavaModelStatus(
- IJavaModelStatusConstants.INVALID_PATH,
- this.entryName));
- }
- return zipFile.getInputStream(zipEntry);
- } catch (IOException e) {
- throw new JavaModelException(e,
- IJavaModelStatusConstants.IO_EXCEPTION);
- }
- }
-
- /**
- * @see IStorage#getFullPath
- */
- public IPath getFullPath() {
- return this.path;
- }
-
- /**
- * @see IStorage#getName
- */
- public String getName() {
- return this.path.lastSegment();
- }
-
- /**
- * @see IStorage#isReadOnly()
- */
- public boolean isReadOnly() {
- return true;
- }
-
- /**
- * @see IStorage#isReadOnly()
- */
- public String toString() {
- return "JarEntryFile[" + this.zipName + "::" + this.entryName + "]"; //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-1$
- }
- }
-
- private static class JarEntryEditorInput implements IStorageEditorInput {
-
- private IStorage fJarEntryFile;
-
- public JarEntryEditorInput(IStorage jarEntryFile) {
- fJarEntryFile = jarEntryFile;
- }
-
- /*
- */
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (!(obj instanceof JarEntryEditorInput))
- return false;
- JarEntryEditorInput other = (JarEntryEditorInput) obj;
- return fJarEntryFile.equals(other.fJarEntryFile);
- }
-
- /*
- * @see IEditorInput#getPersistable()
- */
- public IPersistableElement getPersistable() {
- return null;
- }
-
- /*
- * @see IEditorInput#getName()
- */
- public String getName() {
- return fJarEntryFile.getName();
- }
-
- /*
- * @see IEditorInput#getFullPath()
- */
- public String getFullPath() {
- return fJarEntryFile.getFullPath().toString();
- }
-
- /*
- * @see IEditorInput#getContentType()
- */
- public String getContentType() {
- return fJarEntryFile.getFullPath().getFileExtension();
- }
-
- /*
- * @see IEditorInput#getToolTipText()
- */
- public String getToolTipText() {
- return fJarEntryFile.getFullPath().toString();
- }
-
- /*
- * @see IEditorInput#getImageDescriptor()
- */
- public ImageDescriptor getImageDescriptor() {
- IEditorRegistry registry = PlatformUI.getWorkbench()
- .getEditorRegistry();
- return registry.getImageDescriptor(fJarEntryFile.getFullPath()
- .getFileExtension());
- }
-
- /*
- * @see IEditorInput#exists()
- */
- public boolean exists() {
- // JAR entries can't be deleted
- return true;
- }
-
- /*
- * @see IAdaptable#getAdapter(Class)
- */
- public Object getAdapter(Class adapter) {
- return null;
- }
-
- /*
- * see IStorageEditorInput#getStorage()
- */
- public IStorage getStorage() {
- return fJarEntryFile;
- }
- }
-
- public static IEditorInput getBinaryEditorInput(
- VirtualArchiveComponent component, String archiveRelativePath) {
-
- IEditorInput input = null;
- IPath archivePath = component.getWorkspaceRelativePath();
-
- //[Bug 238616] if there is no workspace relative path then the archive is outside
- // the workspace so get the OS path directly from the file
- if(archivePath != null) {
- input = getBinaryEditorInput(archivePath, archiveRelativePath);
- } else {
- String archiveOSPath = component.getUnderlyingDiskFile().getPath();
- input = getBinaryEditorInput(archiveOSPath, archiveRelativePath);
- }
-
- return input;
- }
-
- public static IEditorInput getBinaryEditorInput(IPath archivePath,
- String archiveRelativePath) {
- IWorkspace workspace = ResourcesPlugin.getWorkspace();
- IWorkspaceRoot root = workspace.getRoot();
- IResource resource = root.findMember(archivePath);
- if (resource == null) {
- return null;
- }
- String archiveOSPath = resource.getLocation().toOSString();
- IEditorInput editorInput = getBinaryEditorInput(archiveOSPath, archiveRelativePath);
- return editorInput;
- }
-
- /**
- * [Bug 238616]
- *
- * Gets binary editor input given an OS relative path to an archive and
- * the archive relative path to a file
- *
- * @param archiveOSPath the OS relative path to the archive
- * @param archiveRelativePath the archive relative path to the file to get binary editor input for
- * @return
- */
- public static IEditorInput getBinaryEditorInput(String archiveOSPath,
- String archiveRelativePath) {
- JarEntryFile jarFile = new JarEntryFile(archiveRelativePath, archiveOSPath);
- JarEntryEditorInput editorInput = new JarEntryEditorInput(jarFile);
- return editorInput;
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/plugin/CommonEditorUtility.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/plugin/CommonEditorUtility.java
deleted file mode 100644
index 6bad64ff4..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/plugin/CommonEditorUtility.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2006 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.jst.j2ee.internal.plugin;
-
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.internal.EditorManager;
-
-
-
-/**
- * @author cbridgha
- *
- */
-public class CommonEditorUtility {
-
- public static final Class IRESOURCE_CLASS = IResource.class;
-
- private CommonEditorUtility() {
- super();
- }
-
- /**
- * Returns an array of all editors that have an unsaved content. If the identical content is
- * presented in more than one editor, only one of those editor parts is part of the result.
- *
- * @return an array of all dirty editor parts.
- */
- public static IEditorPart[] getDirtyEditors() {
- return getDirtyEditors(null);
- }
-
- /**
- * Returns an array of all editors that have an unsaved content, where the content is include in
- * one of the projects in the List parameter. If the identical content is presented in more than
- * one editor, only one of those editor parts is part of the result.
- *
- * @return an array of all dirty editor parts.
- */
- public static IEditorPart[] getDirtyEditors(List projects) {
- Set inputs = new HashSet();
- List result = new ArrayList(0);
- IWorkbench workbench = J2EEUIPlugin.getPluginWorkbench();
- IWorkbenchWindow[] windows = workbench.getWorkbenchWindows();
- for (int i = 0; i < windows.length; i++) {
- IWorkbenchPage[] pages = windows[i].getPages();
- for (int x = 0; x < pages.length; x++) {
- IEditorPart[] editors = pages[x].getDirtyEditors();
- for (int z = 0; z < editors.length; z++) {
- IEditorPart ep = editors[z];
- IEditorInput input = ep.getEditorInput();
- if (!inputs.contains(input) && (projects == null || inputInProjects(input, projects))) {
- inputs.add(input);
- result.add(ep);
- }
- }
- }
- }
- return (IEditorPart[]) result.toArray(new IEditorPart[result.size()]);
- }
-
- public static boolean inputInProjects(IEditorInput input, List projects) {
- IResource res = (IResource) input.getAdapter(IRESOURCE_CLASS);
- IProject project = res == null ? null : res.getProject();
- if (project == null)
- return false;
- for (int i = 0; i < projects.size(); i++) {
- if (project.equals(projects.get(i)))
- return true;
- }
- return false;
- }
-
- public static boolean promptToSaveAllDirtyEditors() {
- return promptToSaveDirtyEditors(Arrays.asList(getDirtyEditors()));
- }
-
- public static boolean promptToSaveDirtyEditors(List dirtyEditors) {
- if (dirtyEditors.isEmpty())
- return true;
- return EditorManager.saveAll(dirtyEditors, true, true,false, J2EEUIPlugin.getActiveWorkbenchWindow());
- }
-
- /**
- * This will close all editors without prompting for save.
- * @param dirtyEditors
- * @return true is succeeded, false if not
- */
- public static void closeAllEditors() {
-
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- page.closeAllEditors(false);
-
- }
-
- public static boolean promptToSaveDirtyEditorsInProjects(List projects) {
- return promptToSaveDirtyEditors(Arrays.asList(getDirtyEditors(projects)));
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/plugin/ErrorDialog.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/plugin/ErrorDialog.java
deleted file mode 100644
index 60f11eef6..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/plugin/ErrorDialog.java
+++ /dev/null
@@ -1,192 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 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.jst.j2ee.internal.plugin;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.PrintStream;
-
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.SWTError;
-import org.eclipse.swt.SWTException;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * Added a Details button to the MessageDialog to show the exception stack trace.
- *
- * Borrowed from an eclipse InternalErrorDialog
- */
-public class ErrorDialog extends MessageDialog {
- protected static final String[] LABELS_OK = {IDialogConstants.OK_LABEL};
- protected static final String[] LABELS_OK_CANCEL = {IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL};
- protected static final String[] LABELS_OK_DETAILS = {IDialogConstants.OK_LABEL, IDialogConstants.SHOW_DETAILS_LABEL};
- protected static final String[] LABELS_OK_CANCEL_DETAILS = {IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL, IDialogConstants.SHOW_DETAILS_LABEL};
- private Throwable detail;
- private int detailButtonID = -1;
- private Text text;
- private String message;
- //Workaround. SWT does not seem to set the default button if
- //there is not control with focus. Bug: 14668
- private int defaultButtonIndex = 0;
- /**
- * Size of the text in lines.
- */
- private static final int TEXT_LINE_COUNT = 15;
-
- public ErrorDialog(Shell parentShell, String dialogTitle, Image dialogTitleImage, String dialogMessage, Throwable detail, int dialogImageType, String[] dialogButtonLabels, int defaultIndex) {
- super(parentShell, dialogTitle, dialogTitleImage, dialogMessage, dialogImageType, dialogButtonLabels, defaultIndex);
- defaultButtonIndex = defaultIndex;
- this.detail = detail;
- message = dialogMessage;
- setShellStyle(getShellStyle() | SWT.APPLICATION_MODAL | SWT.RESIZE);
- }
-
- //Workaround. SWT does not seem to set rigth the default button if
- //there is not control with focus. Bug: 14668
- public int open() {
- create();
- Button b = getButton(defaultButtonIndex);
- b.setFocus();
- b.getShell().setDefaultButton(b);
- return super.open();
- }
-
- /**
- * Set the detail button;
- */
- public void setDetailButton(int index) {
- detailButtonID = index;
- }
-
- /*
- * (non-Javadoc) Method declared on Dialog.
- */
- protected void buttonPressed(int buttonId) {
- if (buttonId == detailButtonID) {
- toggleDetailsArea();
- } else {
- setReturnCode(buttonId);
- close();
- }
- }
-
- /**
- * Toggles the unfolding of the details area. This is triggered by the user pressing the details
- * button.
- */
- private void toggleDetailsArea() {
- Point windowSize = getShell().getSize();
- Point oldSize = getContents().computeSize(SWT.DEFAULT, SWT.DEFAULT);
- if (text != null) {
- text.dispose();
- text = null;
- getButton(detailButtonID).setText(IDialogConstants.SHOW_DETAILS_LABEL);
- } else {
- createDropDownText((Composite) getContents());
- getButton(detailButtonID).setText(IDialogConstants.HIDE_DETAILS_LABEL);
- }
- Point newSize = getContents().computeSize(SWT.DEFAULT, SWT.DEFAULT);
- getShell().setSize(new Point(windowSize.x, windowSize.y + (newSize.y - oldSize.y)));
- }
-
- /**
- * Create this dialog's drop-down list component.
- *
- * @param parent
- * the parent composite
- * @return the drop-down list component
- */
- protected void createDropDownText(Composite parent) {
- // create the list
- text = new Text(parent, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
- // print the stacktrace in the text field
- try {
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- PrintStream ps = new PrintStream(baos);
- detail.printStackTrace(ps);
- if ((detail instanceof SWTError) && (((SWTError) detail).throwable != null)) {
- ps.println("\n*** Stack trace of contained exception ***"); //$NON-NLS-1$
- ((SWTError) detail).throwable.printStackTrace(ps);
- } else if ((detail instanceof SWTException) && (((SWTException) detail).throwable != null)) {
- ps.println("\n*** Stack trace of contained exception ***"); //$NON-NLS-1$
- ((SWTException) detail).throwable.printStackTrace(ps);
- }
- ps.flush();
- baos.flush();
- text.setText(baos.toString());
- } catch (IOException e) {
- //Ignore
- }
- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL | GridData.GRAB_VERTICAL);
- data.heightHint = text.getLineHeight() * TEXT_LINE_COUNT;
- text.setLayoutData(data);
- }
-
- public static boolean openError(Shell parent, String title, String message, Throwable detail, int defaultIndex, boolean showCancel) {
- String[] labels;
- if (detail == null)
- labels = showCancel ? LABELS_OK_CANCEL : LABELS_OK;
- else
- labels = showCancel ? LABELS_OK_CANCEL_DETAILS : LABELS_OK_DETAILS;
- ErrorDialog dialog = new ErrorDialog(parent, title, null, // accept
- // the
- // default
- // window
- // icon
- message, detail, ERROR, labels, defaultIndex);
- if (detail != null)
- dialog.setDetailButton(labels.length - 1);
- return dialog.open() == 0;
- }
-
- protected Control createDialogArea(Composite parent) {
- // create a composite with standard margins and spacing
- Composite composite = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
- layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
- layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
- layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
- composite.setFont(parent.getFont());
- ((GridLayout) composite.getLayout()).numColumns = 2;
- // create image
- Image image = composite.getDisplay().getSystemImage(SWT.ICON_ERROR);
- if (image != null) {
- Label label = new Label(composite, 0);
- image.setBackground(label.getBackground());
- label.setImage(image);
- label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_CENTER | GridData.VERTICAL_ALIGN_BEGINNING));
- }
- // create message
- if (message != null) {
- Label label = new Label(composite, SWT.WRAP);
- label.setText(message);
- GridData data = new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_CENTER);
- data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);
- label.setLayoutData(data);
- label.setFont(parent.getFont());
- }
- return composite;
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/plugin/FacetedProjectActionFilter.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/plugin/FacetedProjectActionFilter.java
deleted file mode 100644
index 844f4de72..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/plugin/FacetedProjectActionFilter.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/******************************************************************************
- * Copyright (c) 2005 BEA Systems, Inc.
- * 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:
- * Konstantin Komissarchik - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jst.j2ee.internal.plugin;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jem.util.logger.proxy.Logger;
-import org.eclipse.ui.IActionFilter;
-import org.eclipse.wst.common.project.facet.core.IFacetedProject;
-import org.eclipse.wst.common.project.facet.core.IProjectFacet;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-
-/**
- * @author <a href="mailto:kosta@bea.com">Konstantin Komissarchik</a>
- */
-
-public final class FacetedProjectActionFilter
-
- implements IActionFilter
-
-{
- public boolean testAttribute( final Object target,
- final String name,
- final String value )
- {
-
- if( name.equals( "facet" ) ) //$NON-NLS-1$
- {
- IProject project = (IProject)target;
- IFacetedProject fproj = null;
- if(project.isAccessible()){
- try {
- fproj = ProjectFacetsManager.create( project );
- } catch (CoreException e1) {
- Logger.getLogger().logError(e1);
- }
- }
-
- if( fproj != null ){
- final int colon = value.indexOf( ':' );
- final String fid;
- final String vexprstr;
-
- if( colon == -1 || colon == value.length() - 1 )
- {
- fid = value;
- vexprstr = null;
- }
- else
- {
- fid = value.substring( 0, colon );
- vexprstr = value.substring( colon + 1 );
- }
-
- if( ! ProjectFacetsManager.isProjectFacetDefined( fid ) )
- {
- return false;
- }
-
- final IProjectFacet f = ProjectFacetsManager.getProjectFacet( fid );
-
- if( ! fproj.hasProjectFacet( f ) )
- {
- return false;
- }
-
- if( vexprstr == null )
- {
- return true;
- }
- else
- {
- final IProjectFacetVersion fv = fproj.getInstalledVersion( f );
-
- try
- {
- if( f.getVersions( vexprstr ).contains( fv ) )
- {
- return true;
- }
- }
- catch( CoreException e )
- {
- //EJBUIPlugin.getDefault().log
- }
- }
-
- return false;
- }
- else
- {
- return false;
- }
- }
- return true;
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/plugin/FacetedProjectAdapterFactory.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/plugin/FacetedProjectAdapterFactory.java
deleted file mode 100644
index 4ee36d0aa..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/plugin/FacetedProjectAdapterFactory.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 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.jst.j2ee.internal.plugin;
-
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.ui.IActionFilter;
-
-public class FacetedProjectAdapterFactory implements IAdapterFactory {
-
-
- private static final Class[] ADAPTER_TYPES = { IActionFilter.class };
-
- public Object getAdapter( final Object adaptable,
- final Class adapterType )
- {
- if( adapterType == IActionFilter.class )
- {
- return new FacetedProjectActionFilter();
- }
- else
- {
- return null;
- }
- }
-
- public Class[] getAdapterList()
- {
- return ADAPTER_TYPES;
- }
-
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/plugin/J2EEEditorUtility.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/plugin/J2EEEditorUtility.java
deleted file mode 100644
index 6fce02a03..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/plugin/J2EEEditorUtility.java
+++ /dev/null
@@ -1,196 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2005 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.jst.j2ee.internal.plugin;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IJavaModel;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.internal.ui.javaeditor.EditorUtility;
-import org.eclipse.jem.internal.adapters.jdom.JavaClassJDOMAdaptor;
-import org.eclipse.jem.internal.java.adapters.ReadAdaptor;
-import org.eclipse.jem.java.JavaClass;
-import org.eclipse.jem.java.JavaPackage;
-import org.eclipse.jem.util.emf.workbench.ProjectUtilities;
-import org.eclipse.jem.workbench.utility.JemProjectUtilities;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.part.FileEditorInput;
-import org.eclipse.wst.common.internal.emfworkbench.WorkbenchResourceHelper;
-
-/**
- * A number of routines for working with JavaElements in editors
- *
- * Use 'isOpenInEditor' to test if an element is already open in a editor Use 'openInEditor' to
- * force opening an element in a editor With 'getWorkingCopy' you get the working copy (element in
- * the editor) of an element
- */
-public class J2EEEditorUtility {
- // //$NON-NLS-1$
- public static final String EJB_JAVA_EDITOR_ID = "org.eclipse.jst.j2ee.internal.internal.ejb.ui.misc.EJBJavaEditor"; //$NON-NLS-1$
-
- public static ICompilationUnit getCompilationUnit(JavaClass javaClass) {
- IProject project = ProjectUtilities.getProject(javaClass);
- if (project == null)
- return null;
- return getCompilationUnit(javaClass, project);
- }
-
- public static ICompilationUnit getCompilationUnit(JavaClass javaClass, IProject project) {
- if (javaClass == null)
- return null;
- IJavaProject javaProj = getJavaProject(project);
- if (javaProj == null)
- return null;
- return getCompilationUnit(javaClass, javaProj);
- }
-
- public static ICompilationUnit getCompilationUnit(JavaClass javaClass, IJavaProject javaProject) {
- if (javaClass == null)
- return null;
- IType type = getType(javaClass);
- if (type != null)
- return type.getCompilationUnit();
- return null;
- }
-
- public static IType getType(JavaClass javaClass) {
- if (javaClass != null) {
- JavaClassJDOMAdaptor adaptor = (JavaClassJDOMAdaptor) EcoreUtil.getRegisteredAdapter(javaClass, ReadAdaptor.TYPE_KEY);
- if (adaptor != null)
- return adaptor.getSourceType();
- }
- return null;
- }
-
- public static IEditorInput getEditorInput(Object input) {
- if (input instanceof EObject)
- return new FileEditorInput(WorkbenchResourceHelper.getFile((EObject) input));
- if (input instanceof IFile)
- return new FileEditorInput((IFile) input);
- return null;
- }
-
- public static IFile getFile(JavaClass javaClass) {
- ICompilationUnit comp = getCompilationUnit(javaClass);
- if (comp == null)
- return null;
- IEditorInput input = null;
- input = EditorUtility.getEditorInput(comp);
- if (input != null) {
- return (IFile) input.getAdapter(IFile.class);
- }
- return null;
- }
-
- public static IJavaProject getJavaProject(IProject aProject) {
- if (aProject == null)
- return null;
- IJavaModel javaModel = JemProjectUtilities.getJavaModel();
- return javaModel.getJavaProject(aProject.getName());
- }
-
- /**
- * Return the IPackageFragment for the JavaPackage for
- *
- * @javaClass.
- */
- public static IPackageFragment getPackageFragment(JavaClass javaClass, IJavaProject javaProject) {
- if (javaProject != null) {
- try {
- JavaPackage javaPackage = (JavaPackage) javaClass.eContainer();
- String packageName = javaPackage.getName();
- IPackageFragment[] pkgFrags = javaProject.getPackageFragments();
- for (int i = 0; i < pkgFrags.length; i++) {
- if ((pkgFrags[i].getElementName().equals(packageName)))
- return pkgFrags[i];
- }
- } catch (JavaModelException e) {
- //Ignore
- }
- }
- return null;
- }
-
- /**
- * Opens a Java editor for the given element if the element is a Java compilation unit or a Java
- * class file.
- *
- * @return the IEditorPart or null if wrong element type or opening failed
- */
- public static IEditorPart openInEditor(JavaClass javaClass, IProject aProject) throws JavaModelException, PartInitException {
- return openInEditor(javaClass, getJavaProject(aProject));
- }
-
- /**
- * Opens a Java editor for the given element if the element is a Java compilation unit or a Java
- * class file.
- *
- * @return the IEditorPart or null if wrong element type or opening failed
- */
- public static IEditorPart openInEditor(JavaClass javaClass, IJavaProject javaProject) throws JavaModelException, PartInitException {
- if (javaClass == null || javaProject == null)
- return null;
- IType type = getType(javaClass);
- if (type == null)
- return openInEditor(getCompilationUnit(javaClass, javaProject));
- return EditorUtility.openInEditor(type);
- }
-
-
- /**
- * Opens a Java editor for the given element if the element is a Java compilation unit or a Java
- * class file.
- *
- * @return the IEditorPart or null if wrong element type or opening failed
- */
- public static IEditorPart openInEditor(JavaClass javaClass, IJavaProject javaProject, String editorId) throws JavaModelException, PartInitException {
- return openInEditor(getCompilationUnit(javaClass, javaProject), editorId);
- }
-
- /**
- * Opens a Java editor for the given element if the element is a Java compilation unit or a Java
- * class file.
- *
- * @return the IEditorPart or null if wrong element type or opening failed
- */
- public static IEditorPart openInEditor(ICompilationUnit aCompilationUnit) throws JavaModelException, PartInitException {
- return EditorUtility.openInEditor(aCompilationUnit);
- }
-
- /**
- * Opens a Java editor for the given element if the element is a Java compilation unit or a Java
- * class file.
- *
- * @return the IEditorPart or null if wrong element type or opening failed
- */
- public static IEditorPart openInEditor(ICompilationUnit aCompilationUnit, String editorId) throws JavaModelException, PartInitException {
- return openInEditor(EditorUtility.getEditorInput(aCompilationUnit), editorId);
- }
-
- private static IEditorPart openInEditor(IEditorInput input, String editorID) throws PartInitException {
- if (input != null) {
- IWorkbenchPage p = J2EEUIPlugin.getActiveWorkbenchWindow().getActivePage();
- if (p != null)
- return p.openEditor(input, editorID, true);
- }
- return null;
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/plugin/J2EEUIAdapterFactory.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/plugin/J2EEUIAdapterFactory.java
deleted file mode 100644
index 372f44c2e..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/plugin/J2EEUIAdapterFactory.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 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
- *******************************************************************************/
-/*
- * Created on Jun 30, 2004
- */
-package org.eclipse.jst.j2ee.internal.plugin;
-
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.debug.ui.actions.ILaunchable;
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * @author jlanuti
- */
-public class J2EEUIAdapterFactory implements IAdapterFactory {
-
- protected static final Class ILAUNCHABLE_CLASS = ILaunchable.class;
-
- /**
- * Default Constructor
- */
- public J2EEUIAdapterFactory() {
- super();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
- */
- public Object getAdapter(Object adaptableObject, Class adapterType) {
- if (adaptableObject instanceof EObject) {
- if (adapterType == ILAUNCHABLE_CLASS)
- return adaptableObject;
- }
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
- */
- public Class[] getAdapterList() {
- return new Class[]{ILAUNCHABLE_CLASS};
- }
-
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/plugin/J2EEUIContextIds.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/plugin/J2EEUIContextIds.java
deleted file mode 100644
index 7d8053c05..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/plugin/J2EEUIContextIds.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 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
- *******************************************************************************/
-/*
- * Created on Feb 27, 2004
- *
- * To change the template for this generated file go to
- * Window - Preferences - Java - Code Generation - Code and Comments
- */
-package org.eclipse.jst.j2ee.internal.plugin;
-
-/**
- * @author vijayb
- *
- * To change the template for this generated type comment go to Window - Preferences - Java - Code
- * Generation - Code and Comments
- */
-public interface J2EEUIContextIds {
-
- // Delete Enterprise Bean Dialog
- public static final String DELETE_ENTERPRISE_BEAN_DIALOG = J2EEUIPlugin.PLUGIN_ID + ".delb1000"; //$NON-NLS-1$
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/plugin/J2EEUIMessages.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/plugin/J2EEUIMessages.java
deleted file mode 100644
index 28b07a8ef..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/plugin/J2EEUIMessages.java
+++ /dev/null
@@ -1,243 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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
- * Stefan Dimov, stefan.dimov@sap.com - bug 207826
- *******************************************************************************/
-package org.eclipse.jst.j2ee.internal.plugin;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-import org.eclipse.wst.common.frameworks.internal.Messages;
-
-
-public class J2EEUIMessages extends Messages {
-
- private static final J2EEUIMessages INSTANCE = new J2EEUIMessages();
-
- public static final String PROJECT_LOC_LBL = "1"; //$NON-NLS-1$
- public static final String TARGET_RUNTIME_LBL = "2"; //$NON-NLS-1$
- public static final String J2EE_VERSION_LBL = "3"; //$NON-NLS-1$
- public static final String IMAGE_LOAD_ERROR = "4"; //$NON-NLS-1$
- public static final String APP_PROJECT_WIZ_TITLE = "5"; //$NON-NLS-1$
- public static final String APP_PROJECT_MAIN_PG_TITLE = "6"; //$NON-NLS-1$
- public static final String APP_PROJECT_MAIN_PG_DESC = "7"; //$NON-NLS-1$
- public static final String APP_PROJECT_MODULES_PG_TITLE = "8"; //$NON-NLS-1$
- public static final String APP_PROJECT_MODULES_PG_DESC = "9"; //$NON-NLS-1$
- public static final String APP_PROJECT_MODULES_PG_SELECT = "10"; //$NON-NLS-1$
- public static final String APP_PROJECT_MODULES_PG_DESELECT = "11"; //$NON-NLS-1$
- public static final String APP_PROJECT_MODULES_PG_NEW = "12"; //$NON-NLS-1$
- public static final String EAR_PROJECT_FOR_MODULE_CREATION = "13"; //$NON-NLS-1$
- public static final String NEW_THREE_DOTS_E = "14"; //$NON-NLS-1$
- public static final String NEW_THREE_DOTS_W = "14a"; //$NON-NLS-1$
- public static final String LINK_MODULETO_EAR_PROJECT = "15"; //$NON-NLS-1$
- public static final String NEW_MOD_SEL_PG_TITLE = "16"; //$NON-NLS-1$
- public static final String NEW_MOD_SEL_PG_DESC = "17"; //$NON-NLS-1$
- public static final String NEW_MOD_WIZ_TITLE = "18"; //$NON-NLS-1$
- public static final String NEW_MOD_SEL_PG_DEF_BTN = "19"; //$NON-NLS-1$
- public static final String APP_CLIENT_PROJ_LBL = "20"; //$NON-NLS-1$
- public static final String EJB_PROJ_LBL = "21"; //$NON-NLS-1$
- public static final String WEB_PROJ_LBL = "22"; //$NON-NLS-1$
- public static final String JCA_PROJ_LBL = "23"; //$NON-NLS-1$
-
- public static final String APP_CLIENT_PROJECT_WIZ_TITLE = "24"; //$NON-NLS-1$
- public static final String APP_CLIENT_VERSION_LBL = "3"; //$NON-NLS-1$
- public static final String APP_CLIENT_PROJECT_MAIN_PG_TITLE = "25"; //$NON-NLS-1$
- public static final String APP_CLIENT_SETTINGS = "101"; //$NON-NLS-1$
-
- public static final String APP_CLIENT_PROJECT_MAIN_PG_DESC = "26"; //$NON-NLS-1$
- public static final String MODULES_DEPENDENCY_PAGE_TITLE = "27"; //$NON-NLS-1$
-
- public static final String MODULES_DEPENDENCY_PAGE_DESC = "28"; //$NON-NLS-1$
- public static final String MODULES_DEPENDENCY_PAGE_AVAILABLE_JARS = "29"; //$NON-NLS-1$
- public static final String MODULES_DEPENDENCY_PAGE_CLASSPATH = "30"; //$NON-NLS-1$
- public static final String MODULES_DEPENDENCY_PAGE_TABLE_MODULE = "31"; //$NON-NLS-1$
- public static final String MODULES_DEPENDENCY_PAGE_TABLE_PROJECT = "32"; //$NON-NLS-1$
- public static final String NEW_LBL = "33"; //$NON-NLS-1$
- public static final String APP_CLIENT_IMPORT_MAIN_PG_DESC = "34"; //$NON-NLS-1$
- public static final String APP_CLIENT_IMPORT_MAIN_PG_TITLE = "35"; //$NON-NLS-1$
- public static final String APP_CLIENT_IMPORT_FILE_LABEL = "36"; //$NON-NLS-1$
-
- public static final String APP_CLIENT_IMPORT_PROJECT_LABEL = "37"; //$NON-NLS-1$
-
- public static final String IMPORT_WIZ_TITLE = "38"; //$NON-NLS-1$
- public static final String EAR_IMPORT_MAIN_PG_DESC = "39"; //$NON-NLS-1$
- public static final String EAR_IMPORT_MAIN_PG_TITLE = "40"; //$NON-NLS-1$
- public static final String EAR_IMPORT_FILE_LABEL = "41"; //$NON-NLS-1$
- public static final String OVERWRITE_RESOURCES = "42"; //$NON-NLS-1$
- public static final String EAR_IMPORT_PROJECT_TYPE = "43"; //$NON-NLS-1$
- public static final String EAR_IMPORT_PROJECT_TYPE_BINARY = "44"; //$NON-NLS-1$
- public static final String EAR_IMPORT_PROJECT_TYPE_SOURCE = "45"; //$NON-NLS-1$
- public static final String EAR_IMPORT_PARTIAL_DEVELOPMENT = "46"; //$NON-NLS-1$
- public static final String EAR_IMPORT_DESELECT_ALL_UTIL_BUTTON = "48"; //$NON-NLS-1$
- public static final String EAR_IMPORT_SELECT_ALL_UTIL_BUTTON = "47"; //$NON-NLS-1$
- public static final String EAR_IMPORT_JARS_GROUP = "49"; //$NON-NLS-1$
- public static final String EAR_IMPORT_SELECT_UTIL_JARS_TO_BE_PROJECTS = "50"; //$NON-NLS-1$
- public static final String EAR_IMPORT_PROJECT_PG_DESC = "51"; //$NON-NLS-1$
- public static final String EAR_IMPORT_PROJECT_PG_TITLE = "52"; //$NON-NLS-1$
- public static final String PROJECT_LOCATIONS_GROUP = "53"; //$NON-NLS-1$
- public static final String NEW_PROJECT_GROUP_DESCRIPTION = "54"; //$NON-NLS-1$
- public static final String USE_DEFAULT_ROOT_RADIO = "55"; //$NON-NLS-1$
- public static final String USE_ALTERNATE_ROOT_RADIO = "56"; //$NON-NLS-1$
- public static final String SELECT_DIRECTORY_DLG = "57"; //$NON-NLS-1$
- public static final String EAR_IMPORT_Modules_in_EAR = "58"; //$NON-NLS-1$
- public static final String EAR_IMPORT_New_Project_Name = "59"; //$NON-NLS-1$
- public static final String EAR_IMPORT_FILENAMES = "60"; //$NON-NLS-1$
- public static final String EAR_IMPORT_PROJECTNAMES = "61"; //$NON-NLS-1$
- public static final String J2EE_EXPORT_DESTINATION = "62"; //$NON-NLS-1$
- public static final String J2EE_EXPORT_OVERWRITE_CHECKBOX = "63"; //$NON-NLS-1$
- public static final String J2EE_EXPORT_SOURCE_CHECKBOX = "64"; //$NON-NLS-1$
- public static final String APP_CLIENT_EXPORT_MAIN_PG_TITLE = "65"; //$NON-NLS-1$
- public static final String APP_CLIENT_EXPORT_MAIN_PG_DESC = "66"; //$NON-NLS-1$
- public static final String EXPORT_WIZ_TITLE = "67"; //$NON-NLS-1$
- public static final String EAR_EXPORT_MAIN_PG_TITLE = "68"; //$NON-NLS-1$
- public static final String EAR_EXPORT_MAIN_PG_DESC = "69"; //$NON-NLS-1$
- public static final String EAR_EXPORT_INCLUDE_PROJECT_FILES = "70"; //$NON-NLS-1$
- public static final String EAR_EXPORT_INCLUDE_PROJECT_FILES_DESC = "71"; //$NON-NLS-1$
- public static final String EAR_IMPORT_INCLUDE_PROJECT = "72"; //$NON-NLS-1$
- public static final String EAR_IMPORT_OVERWRITE_NESTED = "74"; //$NON-NLS-1$
- public static final String DELETE_PROJECT = "75"; //$NON-NLS-1$
- public static final String EAR_IMPORT_PROJECT_LABEL = "76"; //$NON-NLS-1$
-
- //string for migration
- public static final String ERROR_OCCURRED_TITLE = "77"; //$NON-NLS-1$
- public static final String ERROR_OCCURRED_MESSAGE = "78"; //$NON-NLS-1$
- public static final String BINARY_PROJECT = "79"; //$NON-NLS-1$
- public static final String ACTION_CANNOT_BE_PERFORMED_ON_BIN_PROJECT = "80"; //$NON-NLS-1$
- public static final String INFORMATION_UI_ = "81"; //$NON-NLS-1$
- public static final String CHOSEN_OP_NOT_AVAILABLE = "82"; //$NON-NLS-1$
-
- public static final String CREATE_EJB_CLIENT_JAR = "90"; //$NON-NLS-1$
- public static final String USE_ANNOTATIONS = "91"; //$NON-NLS-1$
- public static final String USE_ANNOTATIONS_SERVLET = "98"; //$NON-NLS-1$
- public static final String ADD_ANNOTATIONS_SUPPORT = "92"; //$NON-NLS-1$
- public static final String BROWSE_LABEL = "93"; //$NON-NLS-1$
- public static final String NAME_LABEL = "94"; //$NON-NLS-1$
-
- public static final String APP_CLIENT_CREATE_MAIN = "95"; //$NON-NLS-1$
- public static final String CREATE_DEFAULT_SESSION_BEAN = "96"; //$NON-NLS-1$
-
- public static final String MODULE_NAME = "99"; //$NON-NLS-1$
- public static final String MODULE_VERSION_LABEL = "100"; //$NON-NLS-1$
-
- public static final String J2EE_UTILITY_JAR_LISTEAR_IMPORT_SELECT_UTIL_JARS_TO_BE_PROJECTS = "97"; //$NON-NLS-1$
-
- public static final String J2EE_EXPORT_RUNTIME = "103"; //$NON-NLS-1$
-
- public static final String FLEXIBLE_PROJECT_WIZ_TITLE = "FlexibleProjectCreationWizard.title"; //$NON-NLS-1$
- public static final String FLEXIBLE_PROJECT_MAIN_PG_TITLE = "FlexibleProjectCreationWizard.mainPage.title"; //$NON-NLS-1$
- public static final String FLEXIBLE_PROJECT_MAIN_PG_DESC = "FlexibleProjectCreationWizard.mainPage.desc"; //$NON-NLS-1$
- public static final String EAR_COMPONENT_WIZ_TITLE = "EARComponentCreationWizard.title"; //$NON-NLS-1$
- public static final String EAR_COMPONENT_MAIN_PG_TITLE = "EARComponentCreationWizard.mainPage.title"; //$NON-NLS-1$
- public static final String EAR_COMPONENT_MAIN_PG_DESC = "EARComponentCreationWizard.mainPage.desc"; //$NON-NLS-1$
- public static final String EAR_COMPONENT_SECOND_PG_TITLE = "EARComponentCreationWizard.secondPage.title"; //$NON-NLS-1$
- public static final String EAR_COMPONENT_SECOND_PG_DESC = "EARComponentCreationWizard.secondPage.desc"; //$NON-NLS-1$
- public static final String J2EE_MODULE_DEPENDENCIES_LABEL = "J2EEModuleDependencies.label"; //$NON-NLS-1$
- public static final String APPCLIENT_COMPONENT_WIZ_TITLE = "AppClientComponentCreationWizard.title"; //$NON-NLS-1$
- public static final String APPCLIENT_COMPONENT_MAIN_PG_TITLE = "AppClientComponentCreationWizard.mainPage.title"; //$NON-NLS-1$
- public static final String APPCLIENT_COMPONENT_MAIN_PG_DESC = "AppClientComponentCreationWizard.mainPage.desc"; //$NON-NLS-1$
- public static final String DEFAULT_COMPONENT_WIZ_TITLE = "DefaultJ2EEComponentCreationWizard.title"; //$NON-NLS-1$
- public static final String DEFAULT_COMPONENT_PAGE_TITLE = "DefaultJ2EEComponentCreationWizard.page.title"; //$NON-NLS-1$
- public static final String DEFAULT_COMPONENT_PAGE_DESC = "DefaultJ2EEComponentCreationWizard.page.desc"; //$NON-NLS-1$
- public static final String DEFAULT_COMPONENT_PAGE_EJB_MODULE_LBL = "DefaultJ2EEComponentCreationWizard.page.label.ejb"; //$NON-NLS-1$
- public static final String DEFAULT_COMPONENT_PAGE_WEB_MODULE_LBL = "DefaultJ2EEComponentCreationWizard.page.label.web"; //$NON-NLS-1$
- public static final String DEFAULT_COMPONENT_PAGE_JCA_MODULE_LBL = "DefaultJ2EEComponentCreationWizard.page.label.jca"; //$NON-NLS-1$
- public static final String DEFAULT_COMPONENT_PAGE_APPCLIENT_MODULE_LBL = "DefaultJ2EEComponentCreationWizard.page.label.appclient"; //$NON-NLS-1$
- public static final String DEFAULT_COMPONENT_PAGE_NEW_MOD_SEL_PG_DEF_BTN = "DefaultJ2EEComponentCreationWizard.page.button.select"; //$NON-NLS-1$
-
- public final static String EMPTY_STRING = ""; //$NON-NLS-1$
- public final static String FOLDER_LABEL = getResourceString("FOLDER_LABEL"); //$NON-NLS-1$
- public final static String BROWSE_BUTTON_LABEL = getResourceString("BROWSE_BUTTON_LABEL"); //$NON-NLS-1$
- public final static String JAVA_PACKAGE_LABEL = getResourceString("JAVA_PACKAGE_LABEL"); //$NON-NLS-1$
- public final static String CLASS_NAME_LABEL = getResourceString("CLASS_NAME_LABEL"); //$NON-NLS-1$
- public final static String SUPERCLASS_LABEL = getResourceString("SUPERCLASS_LABEL"); //$NON-NLS-1$
- public final static String CONTAINER_SELECTION_DIALOG_TITLE = getResourceString("CONTAINER_SELECTION_DIALOG_TITLE"); //$NON-NLS-1$
- public final static String CONTAINER_SELECTION_DIALOG_DESC = getResourceString("CONTAINER_SELECTION_DIALOG_DESC"); //$NON-NLS-1$
- public final static String CONTAINER_SELECTION_DIALOG_VALIDATOR_MESG = getResourceString("CONTAINER_SELECTION_DIALOG_VALIDATOR_MESG"); //$NON-NLS-1$
- public final static String PACKAGE_SELECTION_DIALOG_TITLE = getResourceString("PACKAGE_SELECTION_DIALOG_TITLE"); //$NON-NLS-1$
- public final static String PACKAGE_SELECTION_DIALOG_DESC = getResourceString("PACKAGE_SELECTION_DIALOG_DESC"); //$NON-NLS-1$
- public final static String PACKAGE_SELECTION_DIALOG_MSG_NONE = getResourceString("PACKAGE_SELECTION_DIALOG_MSG_NONE"); //$NON-NLS-1$
- public final static String SUPERCLASS_SELECTION_DIALOG_TITLE = getResourceString("SUPERCLASS_SELECTION_DIALOG_TITLE"); //$NON-NLS-1$
- public final static String SUPERCLASS_SELECTION_DIALOG_DESC = getResourceString("SUPERCLASS_SELECTION_DIALOG_DESC"); //$NON-NLS-1$
- public final static String JAVA_CLASS_MODIFIERS_LABEL = getResourceString("JAVA_CLASS_MODIFIERS_LABEL"); //$NON-NLS-1$
- public final static String JAVA_CLASS_INTERFACES_LABEL = getResourceString("JAVA_CLASS_INTERFACES_LABEL"); //$NON-NLS-1$
- public final static String JAVA_CLASS_METHOD_STUBS_LABEL = getResourceString("JAVA_CLASS_METHOD_STUBS_LABEL"); //$NON-NLS-1$
- public final static String JAVA_CLASS_PUBLIC_CHECKBOX_LABEL = getResourceString("JAVA_CLASS_PUBLIC_CHECKBOX_LABEL"); //$NON-NLS-1$
- public final static String JAVA_CLASS_ABSTRACT_CHECKBOX_LABEL = getResourceString("JAVA_CLASS_ABSTRACT_CHECKBOX_LABEL"); //$NON-NLS-1$
- public final static String JAVA_CLASS_FINAL_CHECKBOX_LABEL = getResourceString("JAVA_CLASS_FINAL_CHECKBOX_LABEL"); //$NON-NLS-1$
- public final static String JAVA_CLASS_CONSTRUCTOR_CHECKBOX_LABEL = getResourceString("JAVA_CLASS_CONSTRUCTOR_CHECKBOX_LABEL"); //$NON-NLS-1$
- public final static String JAVA_CLASS_MAIN_CHECKBOX_LABEL = getResourceString("JAVA_CLASS_MAIN_CHECKBOX_LABEL"); //$NON-NLS-1$
- public final static String JAVA_CLASS_INHERIT_CHECKBOX_LABEL = getResourceString("JAVA_CLASS_INHERIT_CHECKBOX_LABEL"); //$NON-NLS-1$
- public final static String ADD_BUTTON_LABEL = getResourceString("ADD_BUTTON_LABEL"); //$NON-NLS-1$
- public static final String REMOVE_BUTTON = getResourceString("REMOVE_BUTTON"); //$NON-NLS-1$
- public static final String YES_BUTTON = getResourceString("YES_BUTTON"); //$NON-NLS-1$
- public static final String NO_BUTTON = getResourceString("NO_BUTTON"); //$NON-NLS-1$
- public static final String OK_BUTTON = getResourceString("OK_BUTTON"); //$NON-NLS-1$
- public static final String CANCEL_BUTTON = getResourceString("CANCEL_BUTTON"); //$NON-NLS-1$
- public static final String BINARY = getResourceString("BINARY"); //$NON-NLS-1$
- public final static String INTERFACE_SELECTION_DIALOG_TITLE = getResourceString("INTERFACE_SELECTION_DIALOG_TITLE"); //$NON-NLS-1$
-
- public static final String JAVAUTIL_COMPONENT_WIZ_TITLE="JAVAUTIL_COMPONENT_WIZ_TITLE"; //$NON-NLS-1$
- public static final String JAVAUTILITY_MAIN_PG_TITLE = "JAVAUTILITY_MAIN_PG_TITLE";//$NON-NLS-1$
- public final static String JAVAUTILITY_MAIN_PG_DESC = "JAVAUTILITY_MAIN_PG_DESC";//$NON-NLS-1$
- public static final String AVAILABLE_J2EE_COMPONENTS="AVAILABLE_J2EE_COMPONENTS"; //$NON-NLS-1$
- public static final String EXTERNAL_JAR="EXTERNAL_JAR";//$NON-NLS-1$
- public static final String PROJECT_JAR="PROJECT_JAR";//$NON-NLS-1$
- public static final String ADDVARIABLE="ADDVARIABLE";//$NON-NLS-1$
- public static final String CHANGE_LIB_DIR ="CHANGE_LIB_DIR";//$NON-NLS-1$
- public static final String NO_DD_MSG_TITLE = "NO_DD_MSG_TITLE";//$NON-NLS-1$
- public static final String GEN_DD_QUESTION = "GEN_DD_QUESTION";//$NON-NLS-1$
-
- public static final String CHANGE_LIB_DIR_HEAD = "CHANGE_LIB_DIR_HEAD";//$NON-NLS-1$
- public static final String NEW_LIB_DIR_PROPMPT = "NEW_LIB_DIR_PROPMPT";//$NON-NLS-1$
- public static final String BLANK_LIB_DIR = "BLANK_LIB_DIR";//$NON-NLS-1$
- public static final String BLANK_LIB_DIR_CONFIRM = "BLANK_LIB_DIR_CONFIRM";//$NON-NLS-1$
- public static final String BLANK_LIB_DIR_WARN_QUESTION = "BLANK_LIB_DIR_WARN_QUESTION";//$NON-NLS-1$
- public static final String INVALID_PATH = "INVALID_PATH";//$NON-NLS-1$
- public static final String INVALID_PATH_MSG = "INVALID_PATH_MSG";//$NON-NLS-1$
- public static final String DEPENDENCY_CONFLICT_TITLE = "DEPENDENCY_CONFLICT_TITLE";//$NON-NLS-1$
- public static final String DEPENDENCY_CONFLICT_MSG_1 = "DEPENDENCY_CONFLICT_MSG_1";//$NON-NLS-1$
- public static final String DEPENDENCY_CONFLICT_MSG_2 = "DEPENDENCY_CONFLICT_MSG_2";//$NON-NLS-1$
- public static final String DO_NOT_SHOW_WARNING_AGAIN = "DO_NOT_SHOW_WARNING_AGAIN";//$NON-NLS-1$
-
- public static final String SUPPORTMULTIPLEMODULES="SUPPORTMULTIPLEMODULES";//$NON-NLS-1$
- public static final String SOURCEFOLDER="SOURCEFOLDER";//$NON-NLS-1$
- public static final String CONTENT_FOLDER = "102"; //$NON-NLS-1$
-
- public static final String HOVER_HELP_FOR_DISABLED_LIBS = "HOVER_HELP_FOR_DISABLED_LIBS"; //$NON-NLS-1$
-
- /**
- * Returns the string from the resource bundle, or 'key' if not found.
- */
- public static String getResourceString(String key) {
- return INSTANCE.doGetResourceString(key);
- }
-
- public static String getResourceString(String key, Object[] args) {
- return INSTANCE.doGetResourceString(key, args);
- }
-
- private J2EEUIMessages() {
- super();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.frameworks.internal.Messages#initializeBundle()
- */
- protected void initializeBundle() {
- try {
- resourceBundle = ResourceBundle.getBundle("j2ee_ui"); //$NON-NLS-1$
- } catch (MissingResourceException x) {
- //Ignore
- }
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/plugin/J2EEUIPlugin.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/plugin/J2EEUIPlugin.java
deleted file mode 100644
index 153124942..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/plugin/J2EEUIPlugin.java
+++ /dev/null
@@ -1,343 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2006 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.jst.j2ee.internal.plugin;
-
-import java.io.IOException;
-import java.net.URL;
-import java.util.HashSet;
-
-import org.eclipse.core.internal.boot.PlatformURLConnection;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-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.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive;
-import org.eclipse.jst.j2ee.internal.wizard.ImportUtil;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-
-
-/**
- * The main plugin class to be used in the desktop.
- */
-public class J2EEUIPlugin extends AbstractUIPlugin {
-
- public static final String PLUGIN_ID = "org.eclipse.jst.j2ee.ui"; //$NON-NLS-1$
-
- //The shared instance.
- private static J2EEUIPlugin plugin;
- private static IPath location;
-
- /**
- * The constructor.
- */
- public J2EEUIPlugin() {
- super();
- plugin = this;
- }
-
- /**
- * Returns the shared instance.
- */
- public static J2EEUIPlugin getDefault() {
- return plugin;
- }
-
- /**
- * Returns the workspace instance.
- */
- public static IWorkspace getWorkspace() {
- return ResourcesPlugin.getWorkspace();
- }
-
- public static IPath getInstallLocation() {
- if (location == null) {
- URL url = getInstallURL();
- try {
- String installLocation = ((PlatformURLConnection) url.openConnection()).getURLAsLocal().getFile();
- location = new Path(installLocation);
- } catch (IOException e) {
- org.eclipse.jem.util.logger.proxy.Logger.getLogger().logWarning(J2EEPluginResourceHandler.getString("Install_Location_Error_", new Object[]{url}) + e); //$NON-NLS-1$
- }
- }
- return location;
- }
-
- public static URL getInstallURL() {
- return getDefault().getBundle().getEntry("/"); //$NON-NLS-1$
- }
-
- public static String getArchiveDefaultProjectName(Archive anArchive) {
- if (anArchive == null)
- return null;
- int type = getArchiveType(anArchive);
- return getTypeDefaultProjectName(anArchive.getURI(), type);
- }
-
- public static String getArchiveDefaultUtilProjectName(Archive anArchive) {
- if (anArchive == null)
- return null;
- int type = getArchiveType(anArchive);
- return getTypeDefaultUtilProjectName(anArchive.getName(), type);
- }
-
- public static String getArchiveDefaultProjectName(Archive anArchive, HashSet moduleNames) {
- if (anArchive == null)
- return null;
- int type = getArchiveType(anArchive);
- return getTypeDefaultProjectName(anArchive.getURI(), type, moduleNames);
- }
-
- public static int getArchiveType(Archive anArchive) {
- int type = ImportUtil.UNKNOWN;
- try {
- try {
- if (anArchive.isEJBJarFile())
- type = ImportUtil.EJBJARFILE;
- else if (anArchive.isWARFile())
- type = ImportUtil.WARFILE;
- else if (anArchive.isApplicationClientFile())
- type = ImportUtil.CLIENTJARFILE;
- else if (anArchive.isRARFile())
- type = ImportUtil.RARFILE;
- else if (anArchive.isEARFile())
- type = ImportUtil.EARFILE;
- } catch (Exception e) {
- //Ignore
- }
- } finally {
- if (anArchive != null)
- anArchive.close();
- }
- return type;
- }
-
- public static String getTypeDefaultProjectName(String text, int type) {
- IPath path = new Path(text);
- text = path.makeRelative().removeFileExtension().lastSegment();
-
- boolean exists = false;
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(text);
- if (project != null && project.exists())
- exists = true;
- if (exists && text.toLowerCase().indexOf(ImportUtil.SUFFIXES[type].toLowerCase()) == -1)
- text = text + ImportUtil.SUFFIXES[type];
- IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
- for (int j = 1; j < 10; j++) {
- boolean found = false;
- String iteratedProjectName = text + ((j == 1) ? "" : Integer.toString(j)); //$NON-NLS-1$
- for (int i = 0; !found && (i < projects.length); i++) {
- if ((projects[i]).getName().equalsIgnoreCase(iteratedProjectName)) {
- found = true;
- }
- }
- if (!found)
- return iteratedProjectName;
- }
- return text;
- }
-
- private static String getTypeDefaultProjectName(String text, int type, HashSet moduleNames) {
- IPath path = new Path(text);
- text = path.makeRelative().removeFileExtension().lastSegment();
-
- boolean isValidName = moduleNames.add(text);
- boolean exists = false;
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(text);
- if (project != null && project.exists())
- exists = true;
- if (!isValidName || (exists && text.toLowerCase().indexOf(ImportUtil.SUFFIXES[type].toLowerCase()) == -1))
- text = text + ImportUtil.SUFFIXES[type];
- IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
- for (int j = 1; j < 10; j++) {
- boolean found = false;
- String iteratedProjectName = text + ((j == 1) ? "" : Integer.toString(j)); //$NON-NLS-1$
- for (int i = 0; !found && (i < projects.length); i++) {
- if ((projects[i]).getName().equalsIgnoreCase(iteratedProjectName)) {
- found = true;
- }
- }
- if (!found)
- return iteratedProjectName;
- }
- return text;
- }
-
- // the following two methods are used by web editor
-
- private static String getTypeDefaultUtilProjectName(String text, int type) {
- text = text.substring(text.lastIndexOf(java.io.File.separator) + 1);
- int i = text.lastIndexOf('.');
- if (i > 0)
- text = text.substring(0, i);
- if (text.toLowerCase().indexOf(ImportUtil.SUFFIXES[type].toLowerCase()) == -1)
- text = text + ImportUtil.SUFFIXES[type];
- IProject[] projects = getWorkspace().getRoot().getProjects();
- for (int j = 0; j < 10; j++) {
- boolean found = false;
- String iteratedProjectName = text + ((j == 0) ? "" : Integer.toString(j)); //$NON-NLS-1$
- for (i = 0; !found && (i < projects.length); i++) {
- if ((projects[i]).getName().equalsIgnoreCase(iteratedProjectName)) {
- found = true;
- }
- }
- if (!found)
- return iteratedProjectName;
- }
- return text;
- }
-
- /**
- * Get a .gif from the image registry.
- */
- public Image getImage(String key) {
- ImageRegistry imageRegistry = getImageRegistry();
- Image image = imageRegistry.get(key);
- if (image == null || image.isDisposed()) {
- ImageDescriptor descriptor = getImageDescriptor(key);
- if (descriptor != null) {
- image = descriptor.createImage();
- imageRegistry.put(key, image);
- }
- }
- return image;
- }
-
- /**
- * This gets a .gif from the icons folder.
- */
- public ImageDescriptor getImageDescriptor(String key) {
- ImageDescriptor imageDescriptor = null;
- URL gifImageURL = getImageURL(key);
- if (gifImageURL != null)
- imageDescriptor = ImageDescriptor.createFromURL(gifImageURL);
- return imageDescriptor;
- }
-
- /**
- * @param key
- * @return
- */
- private URL getImageURL(String key) {
- return J2EEPlugin.getImageURL(key, getBundle());
- }
-
- public static IWorkbenchWindow getActiveWorkbenchWindow() {
- return getPluginWorkbench().getActiveWorkbenchWindow();
- }
-
- /**
- * Return the workbench
- *
- * This method is internal to the j2ee plugin and must not be called by any other plugins.
- */
-
- public static IWorkbench getPluginWorkbench() {
- return getDefault().getWorkbench();
- }
-
- public static Shell getActiveWorkbenchShell() {
- IWorkbenchWindow window = getActiveWorkbenchWindow();
- if (window != null) {
- return window.getShell();
- }
- return null;
- }
-
- public static IStructuredSelection getCurrentSelection() {
- IWorkbenchWindow window = getActiveWorkbenchWindow();
- if (window != null) {
- ISelection selection = window.getSelectionService().getSelection();
- if (selection instanceof IStructuredSelection) {
- return (IStructuredSelection) selection;
- }
-
- }
- return null;
- }
-
-
- /**
- * Record an error against this plugin's log.
- *
- * @param aCode
- * @param aMessage
- * @param anException
- */
- public static void logError(int aCode, String aMessage,
- Throwable anException) {
- getDefault().getLog().log(
- createErrorStatus(aCode, aMessage, anException));
- }
-
- /**
- *
- * Record a message against this plugin's log.
- *
- * @param severity
- * @param aCode
- * @param aMessage
- * @param exception
- */
- public static void log(int severity, int aCode, String aMessage,
- Throwable exception) {
- log(createStatus(severity, aCode, aMessage, exception));
- }
-
- /**
- *
- * Record a status against this plugin's log.
- *
- * @param aStatus
- */
- public static void log(IStatus aStatus) {
- getDefault().getLog().log(aStatus);
- }
-
- /**
- * Create a status associated with this plugin.
- *
- * @param severity
- * @param aCode
- * @param aMessage
- * @param exception
- * @return A status configured with this plugin's id and the given parameters.
- */
- public static IStatus createStatus(int severity, int aCode,
- String aMessage, Throwable exception) {
- return new Status(severity, PLUGIN_ID, aCode,
- aMessage != null ? aMessage : "No message.", exception); //$NON-NLS-1$
- }
-
- /**
- *
- * @param aCode
- * @param aMessage
- * @param exception
- * @return A status configured with this plugin's id and the given parameters.
- */
- public static IStatus createErrorStatus(int aCode, String aMessage,
- Throwable exception) {
- return createStatus(IStatus.ERROR, aCode, aMessage, exception);
- }
-
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/plugin/J2EEUIPluginIcons.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/plugin/J2EEUIPluginIcons.java
deleted file mode 100644
index 674084238..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/plugin/J2EEUIPluginIcons.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 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
- *******************************************************************************/
-/*
- * Created on Nov 10, 2003
- *
- * To change the template for this generated file go to
- * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
- */
-package org.eclipse.jst.j2ee.internal.plugin;
-
-/**
- * @author jsholl
- *
- * To change the template for this generated type comment go to
- * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
- */
-public class J2EEUIPluginIcons {
-
- public static String EAR_IMPORT_WIZARD_BANNER = "import_ear_wiz"; //$NON-NLS-1$
- public static final String JCA_IMPORT_WIZARD_BANNER = "import_rar_wiz"; //$NON-NLS-1$
- public static final String EJB_IMPORT_WIZARD_BANNER = "import_ejbjar_wiz"; //$NON-NLS-1$
- public static final String APP_CLIENT_IMPORT_WIZARD_BANNER = "import_appclient_wiz"; //$NON-NLS-1$
- public static final String WEB_IMPORT_WIZARD_BANNER = "import_war_wiz"; //$NON-NLS-1$
- public static final String EAR_WIZ_BANNER = "ear_wiz"; //$NON-NLS-1$
- public static final String APP_CLIENT_PROJECT_WIZARD_BANNER = "appclient_wiz"; //$NON-NLS-1$
- //EJB Icons
- public static final String EJB_PROJECT_WIZARD_BANNER = "ejbproject_wiz"; //$NON-NLS-1$
- //WEB Icons
- public static final String WEB_PROJECT_WIZARD_BANNER = "war_wiz"; //$NON-NLS-1$
- //JCA Icons
- public static final String JCA_PROJECT_WIZARD_BANNER = "connector_wiz"; //$NON-NLS-1$
- public static final String APP_CLIENT_EXPORT_WIZARD_BANNER = "export_appclient_wiz"; //$NON-NLS-1$
- public static final String EJB_EXPORT_WIZARD_BANNER = "export_ejbjar_obj"; //$NON-NLS-1$;
- public static final String WEB_EXPORT_WIZARD_BANNER = "export_war_wiz"; //$NON-NLS-1$;
- public static final String JCA_EXPORT_WIZARD_BANNER = "export_rar_wiz"; //$NON-NLS-1$;
- public static final String EAR_EXPORT_WIZARD_BANNER = "export_ear_wiz"; //$NON-NLS-1$;
-
- //Migration Wizard Icons
-
- public static final String WARNING_TASK = "showwarn_tsk"; //$NON-NLS-1$
-
- public static final String CLIENT_BANNER = "ejbclientjar_wizban"; //$NON-NLS-1$
-
- public static final String MIGRATION_WIZARD_BANNER = "versionmigrate3_wiz"; //$NON-NLS-1$
-
-
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/plugin/J2EEViewerSorter.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/plugin/J2EEViewerSorter.java
deleted file mode 100644
index 27dcf804b..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/plugin/J2EEViewerSorter.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 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.jst.j2ee.internal.plugin;
-
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerSorter;
-import org.eclipse.jst.j2ee.common.internal.util.CommonUtil;
-import org.eclipse.jst.j2ee.ejb.EnterpriseBean;
-
-public class J2EEViewerSorter extends ViewerSorter {
-
- /**
- * Constructor for J2EEViewerSorter.
- */
- public J2EEViewerSorter() {
- super();
- }
-
-
-
- /**
- * @see ViewerSorter#compare(Viewer, Object, Object)
- */
- public int compare(Viewer viewer, Object e1, Object e2) {
- if (shouldSort(e1, e2))
- return super.compare(viewer, e1, e2);
- return 0;
- }
-
- protected boolean isEnterpriseBean(Object o) {
- return o instanceof EnterpriseBean;
- }
-
- protected boolean isDeploymentDescriptorRoot(Object o) {
- return CommonUtil.isDeploymentDescriptorRoot(o);
- }
-
- protected boolean shouldSort(Object e1, Object e2) {
- return (isDeploymentDescriptorRoot(e1) && isDeploymentDescriptorRoot(e2)) || (isEnterpriseBean(e1) && isEnterpriseBean(e2)) || ((e1 instanceof IFile) && (e2 instanceof IFile));
- }
-
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/plugin/UIProjectUtilities.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/plugin/UIProjectUtilities.java
deleted file mode 100644
index deb4f97e1..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/plugin/UIProjectUtilities.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2006 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
- *******************************************************************************/
-/*
- * Created on Feb 2, 2004
- *
- * To change the template for this generated file go to
- * Window - Preferences - Java - Code Generation - Code and Comments
- */
-package org.eclipse.jst.j2ee.internal.plugin;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.edit.provider.ItemProvider;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jem.util.emf.workbench.ProjectUtilities;
-import org.eclipse.jface.viewers.IStructuredSelection;
-
-/**
- * Utility class for retrieving the project from the specified selection
- */
-public class UIProjectUtilities {
-
- /**
- * @param selection
- * The current selection
- * @return The first project (regardless of nature) in the selection
- */
- public static IProject getSelectedProject(IStructuredSelection selection) {
- return getSelectedProject(selection, (String[]) null);
- }
-
- /**
- * @param selection
- * The current selection
- * @param expectedNatureId
- * The required Nature ID
- * @return The first project, only if the first project has the given nature
- */
- public static IProject getSelectedProject(IStructuredSelection selection, String expectedNatureId) {
- return getSelectedProject(selection, new String[] {expectedNatureId});
- }
-
- /**
- *
- * @param selection
- * The current selection
- * @param possibleNatureIds
- * A list of possible nature ids
- * @return The first project selected, only if it has AT LEAST ONE of the possible nature ids
- */
- public static IProject getSelectedProject(IStructuredSelection selection, String[] possibleNatureIds) {
- IProject[] projects = getAllSelectedProjects(selection, possibleNatureIds);
- if (projects == null || projects.length==0)
- return null;
- return projects[0];
- }
-
- /**
- *
- * @param selection
- * The current selection
- * @return All selected Projects, regardless of nature
- */
- public static IProject[] getAllSelectedProjects(IStructuredSelection selection) {
- return getAllSelectedProjects(selection, (String[]) null);
- }
-
- /**
- *
- * @param selection
- * The current selection
- * @param expectedNatureId
- * The expected nature id
- * @return All selected Projects which have the expected nature id
- */
- public static IProject[] getAllSelectedProjects(IStructuredSelection selection, String expectedNatureId) {
- return getAllSelectedProjects(selection, new String[] {expectedNatureId});
- }
-
- /**
- *
- * @param selection
- * The current selection
- * @param possibleNatureIds
- * a list of possible nature ids
- * @return All selected Projects which have AT LEAST ONE of the given nature ids
- */
- public static IProject[] getAllSelectedProjects(IStructuredSelection selection, String[] possibleNatureIds) {
- if (selection != null && !selection.isEmpty()) {
- Object obj = null;
- List projects = new ArrayList();
- Iterator selectionIterator = selection.iterator();
- while (selectionIterator.hasNext()) {
- obj = selectionIterator.next();
- IProject project = null;
- if (obj instanceof IProject)
- project = (IProject) obj;
- else if (obj instanceof IAdaptable) {
- project = (IProject) ((IAdaptable) obj).getAdapter(IProject.class);
- if (project == null) {
- //Check for IJavaElements.
- IJavaElement javaElement = (IJavaElement) ((IAdaptable) obj).getAdapter(IJavaElement.class);
- if (javaElement != null) {
- project = javaElement.getJavaProject().getProject();
- }
- }
- }
- // Selection may not be adaptable to a project so continue trying to get selected project
- if (project == null && obj instanceof EObject)
- project = ProjectUtilities.getProject((EObject) obj);
- else if (project == null && obj instanceof ItemProvider) {
- Object temp = ((ItemProvider) obj).getParent(EObject.class);
- if (temp != null && temp instanceof EObject)
- project = ProjectUtilities.getProject((EObject) temp);
- }
- else if (project == null && obj instanceof IFile)
- project = ProjectUtilities.getProject(obj);
-
- if (project != null && possibleNatureIds != null && possibleNatureIds.length > 0) {
- try {
- for (int i = 0; i < possibleNatureIds.length; i++)
- if (project.hasNature(possibleNatureIds[i]))
- projects.add(project);
- } catch (CoreException e) {
- //Ignore
- }
- }
-
- else
- projects.add(project);
- }
- IProject[] finalProjects = new IProject[projects.size()];
- projects.toArray(finalProjects);
- return finalProjects;
- }
- return new IProject[0];
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/provider/J2EEAdapterFactoryContentProvider.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/provider/J2EEAdapterFactoryContentProvider.java
deleted file mode 100644
index f71fc3026..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/provider/J2EEAdapterFactoryContentProvider.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 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.jst.j2ee.internal.provider;
-
-
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
-import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jst.j2ee.ejb.EnterpriseBean;
-import org.eclipse.jst.j2ee.internal.ejb.provider.GroupedEJBJarItemProvider;
-
-
-public class J2EEAdapterFactoryContentProvider extends AdapterFactoryContentProvider {
- protected MethodsProviderDelegate methodsProviderDelegate;
- protected static final Class ITreeItemContentProviderClass = ITreeItemContentProvider.class;
- protected List roots = new ArrayList();
-
- /**
- * J2EEAdapterFactoryContentProvider constructor comment.
- *
- * @param adapterFactory
- * org.eclipse.emf.common.notify.AdapterFactory
- */
- public J2EEAdapterFactoryContentProvider(org.eclipse.emf.common.notify.AdapterFactory adapterFactory) {
- super(adapterFactory);
- methodsProviderDelegate = new MethodsProviderDelegate(adapterFactory);
- }
-
- public Object getParent(Object object) {
-
- if (MethodsProviderDelegate.providesContentFor(object))
- return methodsProviderDelegate.getParent(object);
-
- //Added so internalExpand() in AbstractTreeViewer knows that EJB's parent is now instance
- // of J2EEItemProvider
- //rather than EJBJar only if bean is root bean
- if (object instanceof EnterpriseBean && GroupedEJBJarItemProvider.isRootBean((EnterpriseBean) object)) {
- J2EEItemProvider provider = GroupedEJBJarItemProvider.getEJBItemProvider((EnterpriseBean) object);
- if (provider != null) {
- return provider;
- }
- }
-
- Object parent = super.getParent(object);
-
- // if (parent == null) {
- // if (object instanceof EObject)
- // return J2EERoot.instance().groupFor((EObject) object);
- // }
- return parent;
- }
-
- protected boolean isEMFEditObject(Object object) {
- ITreeItemContentProvider treeItemContentProvider = (ITreeItemContentProvider) adapterFactory.adapt(object, ITreeItemContentProviderClass);
- return treeItemContentProvider != null;
- }
-
- /*
- * @see ITreeContentProvider#getChildren(Object)
- */
- public Object[] getChildren(Object parentElement) {
-
- if (MethodsProviderDelegate.providesContentFor(parentElement))
- return methodsProviderDelegate.getChildren(parentElement);
- else if (isEMFEditObject(parentElement))
- return super.getChildren(parentElement);
- else
- return null;
- }
-
- /*
- * @see IStructuredContentProvider#getElements(Object)
- */
- public Object[] getElements(Object inputElement) {
- return getRoots(inputElement);
- // else if (MethodsProviderDelegate.providesContentFor(inputElement))
- // return methodsProviderDelegate.getChildren(inputElement);
- // return super.getElements(inputElement);
- }
-
- public Object[] getRoots(Object parent) {
- if (roots.isEmpty()) {
- Object[] j2eeGroups = super.getChildren(parent);
- roots.addAll(Arrays.asList(j2eeGroups));
- }
- return roots.toArray();
- }
-
- /*
- * @see ITreeContentProvider#hasChildren(Object)
- */
- public boolean hasChildren(Object element) {
- if (MethodsProviderDelegate.providesContentFor(element))
- return methodsProviderDelegate.hasChildren(element);
- else if (isEMFEditObject(element))
- return super.hasChildren(element);
- else
- return false;
- }
-
- /**
- * @see IContentProvider#dispose()
- */
- public void dispose() {
- super.dispose();
- if (methodsProviderDelegate != null)
- methodsProviderDelegate.dispose();
- }
-
- /**
- * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(Viewer, Object, Object)
- */
- public void inputChanged(Viewer aViewer, Object oldInput, Object newInput) {
- super.inputChanged(aViewer, oldInput, newInput);
- methodsProviderDelegate.inputChanged(aViewer, oldInput, newInput);
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/provider/J2EEAdapterFactoryLabelProvider.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/provider/J2EEAdapterFactoryLabelProvider.java
deleted file mode 100644
index 026758bc3..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/provider/J2EEAdapterFactoryLabelProvider.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2006 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.jst.j2ee.internal.provider;
-
-
-import java.io.File;
-import java.net.URL;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.edit.provider.IItemLabelProvider;
-import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jst.j2ee.common.CommonPackage;
-import org.eclipse.jst.j2ee.common.internal.util.CommonUtil;
-import org.eclipse.jst.j2ee.ejb.internal.impl.EjbFactoryImpl;
-import org.eclipse.jst.j2ee.internal.ejb.provider.AbstractMethodsContentProvider;
-import org.eclipse.jst.j2ee.internal.ejb.provider.J2EEJavaClassProviderHelper;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIMessages;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.model.WorkbenchLabelProvider;
-
-/**
- * Insert the type's description here. Creation date: (6/20/2001 10:40:41 PM)
- *
- * @author: Administrator
- */
-public class J2EEAdapterFactoryLabelProvider extends AdapterFactoryLabelProvider {
- // //$NON-NLS-1$
- protected static final Class IItemLabelProviderClass = IItemLabelProvider.class;
- private static final EStructuralFeature ROLE_NAME_SF = CommonPackage.eINSTANCE.getSecurityRole_RoleName();
- private static final EStructuralFeature ROLES_SF = EjbFactoryImpl.getPackage().getMethodPermission_Roles();
-
-
- /**
- * This is used for delegation to get labels for server objects, which don't fit into EMF edit
- */
- protected WorkbenchLabelProvider wbLabelProvider;
-
- public J2EEAdapterFactoryLabelProvider(org.eclipse.emf.common.notify.AdapterFactory adapterFactory) {
- super(adapterFactory);
- wbLabelProvider = new WorkbenchLabelProvider();
- }
-
- public Image getImage(Object object) {
- if (object instanceof J2EEJavaClassProviderHelper)
- return ((J2EEJavaClassProviderHelper) object).getImage();
- else if (isEMFEditObject(object))
- return super.getImage(object);
- else if (object instanceof AbstractMethodsContentProvider.EJBMethodItem)
- return super.getImage(((AbstractMethodsContentProvider.EJBMethodItem) object).ejb);
- else if (object instanceof File) {
- URL url = (URL) J2EEPlugin.getPlugin().getImage("jar_obj"); //$NON-NLS-1$
- return ImageDescriptor.createFromURL(url).createImage();
- }
- return wbLabelProvider.getImage(object);
- }
-
- public String getText(Object object) {
-
- if (object instanceof J2EEJavaClassProviderHelper)
- return ((J2EEJavaClassProviderHelper) object).getText();
- else if (isEMFEditObject(object)) {
- if (CommonUtil.isDeploymentDescriptorRoot(object))
- return J2EEUIMessages.getResourceString("Deployment_Descriptor_UI_") + ": " + super.getText(object); //$NON-NLS-1$ //$NON-NLS-2$
- return super.getText(object);
- } else if (object instanceof AbstractMethodsContentProvider.EJBMethodItem)
- return super.getText(((AbstractMethodsContentProvider.EJBMethodItem) object).ejb);
- else if (object instanceof IFile) {
- return ((IFile) object).getName();
- } else if (object instanceof File) {
- return ((File)object).getName();
- }
- return wbLabelProvider.getText(object);
- }
-
- protected boolean isEMFEditObject(Object object) {
- IItemLabelProvider itemLabelProvider = (IItemLabelProvider) adapterFactory.adapt(object, IItemLabelProviderClass);
- return itemLabelProvider != null;
- }
-
- /*
- * @see INotifyChangedListener#notifyChanged(new ENotificationImpl((InternalEObject)Object,
- * int,(EStructuralFeature) Object, Object, Object, int))
- */
- public void notifyChanged(Notification notification) {
- Object feature = notification.getFeature();
- if (feature == ROLE_NAME_SF || feature == ROLES_SF)
- fireLabelProviderChanged();
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/provider/J2EEApplicationItemProvider.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/provider/J2EEApplicationItemProvider.java
deleted file mode 100644
index d37e20823..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/provider/J2EEApplicationItemProvider.java
+++ /dev/null
@@ -1,193 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.jst.j2ee.internal.provider;
-
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.jst.j2ee.application.Application;
-import org.eclipse.jst.j2ee.application.ApplicationPackage;
-import org.eclipse.jst.j2ee.application.internal.impl.ApplicationFactoryImpl;
-import org.eclipse.jst.j2ee.internal.application.provider.ApplicationItemProvider;
-import org.eclipse.jst.j2ee.internal.ejb.provider.J2EENotificationImpl;
-
-public class J2EEApplicationItemProvider extends ApplicationItemProvider implements IAdaptable {
-
- protected static final Class IRESOURCE_CLASS = IResource.class;
- protected static final Class IPROJECT_CLASS = IProject.class;
-
- protected Map children = new HashMap();
- protected List resourceAdapters = null;
-
- /**
- * Constructor for J2EEApplicationItemProvider.
- *
- * @param adapterFactory
- */
- public J2EEApplicationItemProvider(AdapterFactory adapterFactory) {
- super(adapterFactory);
- }
-
- /**
- * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#getChildren(Object)
- */
- public Collection getChildren(Object object) {
- List localChildren = (List) children.get(object);
- if (localChildren == null)
- return initChildren(object);
- return localChildren;
- }
-
- protected List initChildren(Object object) {
- Application app = (Application) object;
- List localChildren = new ArrayList(2);
- // MDE: changed getParent(object) to just app
- localChildren.add(new ModulesItemProvider(getAdapterFactory(), null, null, app));
-
- // IProject project = ProjectUtilities.getProject(app);
- // IVirtualComponent ear = ComponentUtilities.findComponent(app);
- // TODO switch to retrieve referenceComponents
- // EAREditModel editModel = null;
- // try {
- // EARNatureRuntime runtime = EARNatureRuntime.getRuntime(project);
- // if (runtime != null) {
- // editModel = runtime.getEarEditModelForRead(this);
- // EARProjectMap map = editModel.getEARProjectMap();
- // localChildren.add(map);
- // map.eResource().eAdapters().add(getNewAdapter(app));
- // }
- // } finally {
- // if (editModel != null)
- // editModel.releaseAccess(this);
- // }
- localChildren.add(new J2EEUtilityJarItemProvider(app, getAdapterFactory(), this));
-
- children.put(object, localChildren);
- return localChildren;
- }
-
- protected ModulesItemProvider getModulesNode(Object object) {
- return (ModulesItemProvider) ((List) getChildren(object)).get(0);
- }
-
-
- /**
- * @see Adapter#notifyChanged(new ENotificationImpl((InternalEObject)Notifier,
- * int,(EStructuralFeature) EObject, Object, Object, int))
- * @deprecated
- */
- public void notifyChanged(Notification notification) {
- switch (notification.getFeatureID(Application.class)) {
- case ApplicationPackage.APPLICATION__MODULES :
- break;
- default :
- super.notifyChanged(notification);
- }
- if (notification.getEventType() == Notification.REMOVING_ADAPTER && notification.getOldValue() == this)
- children.remove(notification.getNotifier());
- else if (notification.getFeature() == ApplicationFactoryImpl.getPackage().getApplication_Modules())
- modulesChanged((Application) notification.getNotifier(), notification.getEventType(), notification.getOldValue(), notification.getNewValue(), notification.getPosition());
- }
-
- protected void modulesChanged(Application app, int eventType, Object oldValue, Object newValue, int pos) {
- ModulesItemProvider provider = getModulesNode(app);
- Collection grandChildren = provider.getChildren();
- switch (eventType) {
- case Notification.ADD : {
- grandChildren.add(newValue);
- break;
- }
- case Notification.ADD_MANY : {
- grandChildren.addAll((Collection) newValue);
- break;
- }
- case Notification.REMOVE : {
- grandChildren.remove(oldValue);
- break;
- }
- case Notification.REMOVE_MANY : {
- grandChildren.removeAll((Collection) oldValue);
- break;
- }
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#dispose()
- */
- public void dispose() {
- super.dispose();
- List adapters = getResourceAdapters();
- ResourceAdapter adapter = null;
- for (int i = 0; i < adapters.size(); i++) {
- adapter = (ResourceAdapter) adapters.get(i);
- adapter.getTarget().eAdapters().remove(adapter);
- }
- }
-
- protected class ResourceAdapter extends AdapterImpl {
-
- private Application app = null;
-
- public ResourceAdapter(Application app) {
- this.app = app;
- }
-
- public void notifyChanged(Notification notification) {
-
- Resource res = (Resource) notification.getNotifier();
- if (notification.getEventType() == Notification.SET && notification.getFeatureID(null) == Resource.RESOURCE__IS_LOADED && !res.isLoaded()) {
- J2EEApplicationItemProvider.this.children.remove(app);
- res.eAdapters().remove(ResourceAdapter.this);
- fireNotifyChanged(new J2EENotificationImpl(app, Notification.MOVE, (Object) null, (Object) null, 0));
-
- }
- }
- }
-
- protected ResourceAdapter getNewAdapter(Application key) {
- ResourceAdapter adapter = new ResourceAdapter(key);
- getResourceAdapters().add(adapter);
- return adapter;
- }
-
- /**
- * @return Returns the resourceAdapters.
- */
- protected List getResourceAdapters() {
- if (resourceAdapters == null)
- resourceAdapters = new ArrayList();
- return resourceAdapters;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
- */
- public Object getAdapter(Class adapter) {
- return null;
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/provider/J2EEApplicationItemProviderAdapterFactory.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/provider/J2EEApplicationItemProviderAdapterFactory.java
deleted file mode 100644
index 0434b30f5..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/provider/J2EEApplicationItemProviderAdapterFactory.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 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.jst.j2ee.internal.provider;
-
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.jst.j2ee.internal.application.provider.ApplicationItemProviderAdapterFactory;
-
-
-public class J2EEApplicationItemProviderAdapterFactory extends ApplicationItemProviderAdapterFactory {
-
- /**
- * Constructor for J2EEApplicationAdapterFactory.
- */
- public J2EEApplicationItemProviderAdapterFactory() {
- super();
- }
-
- /**
- * @see ApplicationAdapterFactory#createApplicationAdapter()
- */
- public Adapter createApplicationAdapter() {
- return new J2EEApplicationItemProvider(this);
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/provider/J2EEBinaryModulesItemProvider.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/provider/J2EEBinaryModulesItemProvider.java
deleted file mode 100644
index bf14b2df7..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/provider/J2EEBinaryModulesItemProvider.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2006 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.jst.j2ee.internal.provider;
-
-import java.util.Collection;
-
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.jst.j2ee.application.Application;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIMessages;
-
-public class J2EEBinaryModulesItemProvider extends J2EEItemProvider {
-
- public J2EEBinaryModulesItemProvider(Application app, AdapterFactory adapterFactory, Collection children) {
- super(adapterFactory, children);
- }
-
- public String getText(Object obj) {
- return J2EEUIMessages.BINARY;
- }
-
- public Object getImage(Object object) {
- return J2EEPlugin.getPlugin().getImage("folder"); //$NON-NLS-1$
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/provider/J2EEEditingDomain.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/provider/J2EEEditingDomain.java
deleted file mode 100644
index ab07bd12f..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/provider/J2EEEditingDomain.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 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.jst.j2ee.internal.provider;
-
-
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.emf.edit.command.AddCommand;
-import org.eclipse.emf.edit.command.CopyToClipboardCommand;
-import org.eclipse.emf.edit.command.CreateCopyCommand;
-import org.eclipse.emf.edit.command.DragAndDropCommand;
-import org.eclipse.emf.edit.command.InitializeCopyCommand;
-import org.eclipse.emf.edit.command.MoveCommand;
-import org.eclipse.emf.edit.command.OverrideableCommand;
-import org.eclipse.emf.edit.command.PasteFromClipboardCommand;
-import org.eclipse.emf.edit.command.RemoveCommand;
-import org.eclipse.emf.edit.command.ReplaceCommand;
-import org.eclipse.emf.edit.command.SetCommand;
-import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
-
-/**
- * Custom editing domain which provides hooks for creating override commands; should not be used
- * directly but can be subclassed to override commands as necessary. All the override methods by
- * default return null, so a subclass may override only a subset of the commands.
- */
-public class J2EEEditingDomain extends AdapterFactoryEditingDomain {
- /**
- * J2EEEditingDomain constructor comment.
- *
- * @param adapterFactory
- * org.eclipse.emf.common.notify.AdapterFactory
- * @param commandStack
- * CommandStack
- */
- public J2EEEditingDomain(org.eclipse.emf.common.notify.AdapterFactory adapterFactory, CommandStack commandStack) {
- super(adapterFactory, commandStack);
- }
-
- /**
- * The default is not to override this command; subclasses can override if necessary
- */
- protected Command createAddOverrideCommand(AddCommand addCommand) {
- return null;
- }
-
- /**
- * The default is not to override this command; subclasses can override if necessary
- */
- protected Command createCopyToClipboardOverrideCommand(CopyToClipboardCommand copyToClipboardCommand) {
- return null;
- }
-
- /**
- * The default is not to override this command; subclasses can override if necessary
- */
- protected Command createCreateCopyOverrideCommand(CreateCopyCommand createCopyCommand) {
- return null;
- }
-
- /**
- * The default is not to override this command; subclasses can override if necessary
- */
- protected Command createDragAndDropOverrideCommand(DragAndDropCommand dragAndDropCommand) {
- return null;
- }
-
- /**
- * The default is not to override this command; subclasses can override if necessary
- */
- protected Command createInitializeCopyOverrideCommand(InitializeCopyCommand initializeCopyCommand) {
- return null;
- }
-
- /**
- * The default is not to override this command; subclasses can override if necessary
- */
- protected Command createMoveOverrideCommand(MoveCommand moveCommand) {
- return null;
- }
-
- public Command createOverrideCommand(OverrideableCommand command) {
- if (command instanceof AddCommand) {
- AddCommand addCommand = (AddCommand) command;
- return createAddOverrideCommand(addCommand);
- } else if (command instanceof RemoveCommand) {
- RemoveCommand removeCommand = (RemoveCommand) command;
- return createRemoveOverrideCommand(removeCommand);
- } else if (command instanceof SetCommand) {
- SetCommand setCommand = (SetCommand) command;
- return createSetOverrideCommand(setCommand);
- } else if (command instanceof ReplaceCommand) {
- ReplaceCommand replaceCommand = (ReplaceCommand) command;
- return createReplaceOverrideCommand(replaceCommand);
- } else if (command instanceof MoveCommand) {
- MoveCommand moveCommand = (MoveCommand) command;
- return createMoveOverrideCommand(moveCommand);
- } else if (command instanceof CreateCopyCommand) {
- CreateCopyCommand createCopyCommand = (CreateCopyCommand) command;
- return createCreateCopyOverrideCommand(createCopyCommand);
- } else if (command instanceof InitializeCopyCommand) {
- InitializeCopyCommand initializeCopyCommand = (InitializeCopyCommand) command;
- return createInitializeCopyOverrideCommand(initializeCopyCommand);
- } else if (command instanceof CopyToClipboardCommand) {
- CopyToClipboardCommand copyToClipboardCommand = (CopyToClipboardCommand) command;
- return createCopyToClipboardOverrideCommand(copyToClipboardCommand);
- } else if (command instanceof PasteFromClipboardCommand) {
- PasteFromClipboardCommand pasteFromClipboardCommand = (PasteFromClipboardCommand) command;
- return createPasteFromClipboardOverrideCommand(pasteFromClipboardCommand);
- } else if (command instanceof DragAndDropCommand) {
- DragAndDropCommand dragAndDropCommand = (DragAndDropCommand) command;
- return createDragAndDropOverrideCommand(dragAndDropCommand);
- } else {
- return null;
- }
- }
-
- /**
- * The default is not to override this command; subclasses can override if necessary
- */
- protected Command createPasteFromClipboardOverrideCommand(PasteFromClipboardCommand pasteFromClipboardCommand) {
- return null;
- }
-
- /**
- * The default is not to override this command; subclasses can override if necessary
- */
- protected Command createRemoveOverrideCommand(RemoveCommand removeCommand) {
- return null;
- }
-
- /**
- * The default is not to override this command; subclasses can override if necessary
- */
- protected Command createReplaceOverrideCommand(ReplaceCommand replaceCommand) {
- return null;
- }
-
- /**
- * The default is not to override this command; subclasses can override if necessary
- */
- protected Command createSetOverrideCommand(SetCommand setCommand) {
- return null;
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/provider/J2EEModulemapItemProviderAdapterFactory.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/provider/J2EEModulemapItemProviderAdapterFactory.java
deleted file mode 100644
index 4d620b019..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/provider/J2EEModulemapItemProviderAdapterFactory.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 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.jst.j2ee.internal.provider;
-
-
-import org.eclipse.emf.common.notify.Adapter;
-
-public class J2EEModulemapItemProviderAdapterFactory extends ModulemapItemProviderAdapterFactory {
-
- /**
- * Constructor for J2EEModulemapItemProviderAdapterFactory.
- */
- public J2EEModulemapItemProviderAdapterFactory() {
- super();
- }
-
- /**
- * @see ModulemapAdapterFactory#createEARProjectMapAdapter()
- */
- public Adapter createEARProjectMapAdapter() {
- return new J2EEUtilityJavaProjectsItemProvider(this, false);
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/provider/J2EEProviderUtility.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/provider/J2EEProviderUtility.java
deleted file mode 100644
index 3839ba39c..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/provider/J2EEProviderUtility.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2003, 2004 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.jst.j2ee.internal.provider;
-
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.wst.common.internal.emfworkbench.WorkbenchResourceHelper;
-
-public class J2EEProviderUtility {
-
- private J2EEProviderUtility() {
- super();
- }
-
- public static String prependProjectName(EObject object, String label) {
- String projectName = null;
- if (object.eResource() != null) {
- IProject proj = WorkbenchResourceHelper.getProject(object.eResource());
- if (proj != null)
- projectName = proj.getName();
- }
-
- if (projectName == null || projectName.equals(label))
- return label;
- else if (label == null || label.length() == 0)
- return projectName;
- else
- return projectName + ": " + label; //$NON-NLS-1$
- }
-
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/provider/J2EEUIEditingDomain.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/provider/J2EEUIEditingDomain.java
deleted file mode 100644
index 4ce6309ac..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/provider/J2EEUIEditingDomain.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2003, 2004 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.jst.j2ee.internal.provider;
-
-
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.edit.command.CopyToClipboardCommand;
-import org.eclipse.emf.edit.command.PasteFromClipboardCommand;
-import org.eclipse.emf.edit.command.RemoveCommand;
-import org.eclipse.jst.j2ee.internal.command.J2EEClipboard;
-import org.eclipse.jst.j2ee.internal.command.J2EECopyToClipboardOverrideCommand;
-import org.eclipse.jst.j2ee.internal.command.J2EEPasteFromClipboardOverrideCommand;
-import org.eclipse.jst.j2ee.internal.command.J2EERemoveOverrideCommand;
-
-
-public class J2EEUIEditingDomain extends J2EEEditingDomain {
- /**
- * J2EEUIEditingDomain constructor comment.
- *
- * @param adapterFactory
- * org.eclipse.emf.common.notify.AdapterFactory
- * @param commandStack
- * CommandStack
- */
- public J2EEUIEditingDomain(org.eclipse.emf.common.notify.AdapterFactory adapterFactory, CommandStack commandStack) {
- super(adapterFactory, commandStack);
- turnTraceOnIfDebugging();
- }
-
- protected Command createCopyToClipboardOverrideCommand(CopyToClipboardCommand copyToClipboardCommand) {
-
- if (copyToClipboardCommand instanceof J2EECopyToClipboardOverrideCommand)
- return null;
- return new J2EECopyToClipboardOverrideCommand(copyToClipboardCommand);
- }
-
- protected Command createPasteFromClipboardOverrideCommand(PasteFromClipboardCommand pasteFromClipboardCommand) {
- if (pasteFromClipboardCommand instanceof J2EEPasteFromClipboardOverrideCommand)
- return null;
- if (!(getClipboard() instanceof J2EEClipboard))
- return null;
- return new J2EEPasteFromClipboardOverrideCommand(pasteFromClipboardCommand);
- }
-
- protected Command createRemoveOverrideCommand(RemoveCommand removeCommand) {
- return new J2EERemoveOverrideCommand(removeCommand);
- }
-
- public J2EEClipboard getJ2EEClipboard() {
- return (J2EEClipboard) getClipboard();
- }
-
- public Object getParent(Object object) {
- Object parent = super.getParent(object);
- if (parent != null)
- return parent;
- if (object instanceof EObject)
- return ((EObject) object).eContainer();
- return null;
- }
-
- protected void turnTraceOnIfDebugging() {
- //AbstractCommand.Trace.enable();
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/provider/J2EEUtilityJarItemProvider.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/provider/J2EEUtilityJarItemProvider.java
deleted file mode 100644
index 5e8e8797d..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/provider/J2EEUtilityJarItemProvider.java
+++ /dev/null
@@ -1,304 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.jst.j2ee.internal.provider;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-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.resources.IResourceChangeEvent;
-import org.eclipse.core.resources.IResourceChangeListener;
-import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.core.resources.IResourceDeltaVisitor;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.jem.util.emf.workbench.ProjectUtilities;
-import org.eclipse.jem.util.emf.workbench.WorkbenchResourceHelperBase;
-import org.eclipse.jst.j2ee.application.Application;
-import org.eclipse.jst.j2ee.componentcore.util.EARArtifactEdit;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIMessages;
-import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities;
-import org.eclipse.wst.common.componentcore.internal.resources.VirtualArchiveComponent;
-import org.eclipse.wst.common.componentcore.internal.util.ComponentUtilities;
-import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.common.componentcore.resources.IVirtualReference;
-
-/**
- * @author jsholl
- *
- * To change this generated comment edit the template variable "typecomment":
- * Window>Preferences>Java>Templates. To enable and disable the creation of type comments go to
- * Window>Preferences>Java>Code Generation.
- */
-public class J2EEUtilityJarItemProvider extends J2EEItemProvider {
-
- public final static String UTILITY_JARS = J2EEUIMessages.getResourceString("Utility_JARs_UI_"); //$NON-NLS-1$
-
- private boolean childrenLoaded = false;
- private Application application = null;
-
- /**
- * Constructor for J2EEUtilityJarItemProvider.
- */
- public J2EEUtilityJarItemProvider(Application app, AdapterFactory adapterFactory, Object parent) {
- super(adapterFactory);
- setParent(parent);
- application = app;
- UtilityJarResourceChangeListener.INSTANCE.addUtilityJarItemProvider(ProjectUtilities.getProject(application), this);
- }
-
- public boolean hasChildren(Object object) {
- getChildren(object);
- return !children.isEmpty();
- }
-
- public Collection getChildren(final Object object) {
- if (!childrenLoaded) {
- try {
- disableNotification();
- org.eclipse.swt.custom.BusyIndicator.showWhile(null, new Runnable() {
- public void run() {
- computeChildren();
- }
- });
- } finally {
- enableNotification();
- }
- }
- return children;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.emf.edit.provider.ItemProvider#dispose()
- */
- public void dispose() {
- super.dispose();
- UtilityJarResourceChangeListener.INSTANCE.removeUtilityJarItemProvider(ProjectUtilities.getProject(application), this);
-
- }
-
- /**
- * @see org.eclipse.emf.edit.provider.ItemProvider#getChildren(Object)
- */
- private void computeChildren() {
- childrenLoaded = true;
- IVirtualComponent ear = ComponentUtilities.findComponent(application);
- if (ear != null) {
- EARArtifactEdit earEdit = null;
- try {
- earEdit = EARArtifactEdit.getEARArtifactEditForRead(ear);
- IVirtualReference[] modules = earEdit.getUtilityModuleReferences();
- for (int i = 0; i < modules.length; i++) {
- IVirtualComponent module = modules[i].getReferencedComponent();
- if (module.isBinary()) {
- VirtualArchiveComponent virtualArchiveComponent = (VirtualArchiveComponent) module;
- java.io.File diskFile = virtualArchiveComponent.getUnderlyingDiskFile();
- if (diskFile.exists())
- children.add(diskFile);
- else {
- // we will assume the component name is in synch with the module uri
- IFile utilityJar = virtualArchiveComponent.getUnderlyingWorkbenchFile();
- if (utilityJar != null)
- children.add(utilityJar);
- }
- } else {
-
- }
- if (module.getProject() == null || !module.getProject().isAccessible())
- continue;
- // return only jars for utility components
- if (J2EEProjectUtilities.isUtilityProject(module.getProject())) {
- IProject project = ProjectUtilities.getProject(application);
- if (project == null)
- continue;
- // we will assume the component name is in synch with the module uri
- IFile utilityJar = project.getFile(module.getName() + ".jar"); //$NON-NLS-1$
- if (utilityJar != null) {
- if (utilityJar.exists())
- children.add(utilityJar);
- else
- children.add(new UtilityModuleProjectItemProvider(getAdapterFactory(),module.getProject(),this));
- }
-
- }
- }
- } finally {
- if (earEdit != null) {
- earEdit.dispose();
- }
- }
- }
- }
-
- // private Collection getJars(List list, IResource[] members) {
- // for (int i = 0; i < members.length; i++) {
- // if (isJarFile(members[i])) {
- // list.add(members[i]);
- // } else if (members[i].getType() == IResource.FOLDER) {
- // try {
- // getJars(list, ((IFolder) members[i]).members());
- // } catch (CoreException e) {
- // Logger.getLogger().logError(e);
- // }
- // }
- // }
- // return list;
- // }
-
- public static boolean isJarFile(IResource member) {
- return member.getType() == IResource.FILE && member.getName().toLowerCase().endsWith(".jar"); //$NON-NLS-1$
- }
-
- public static boolean isComponentFile(IResource member) {
- return member.getType() == IResource.FILE && member.getName().toLowerCase().endsWith(IModuleConstants.COMPONENT_FILE_NAME);
- }
-
-
- /**
- * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#getImage(Object)
- */
- public Object getImage(Object object) {
- return J2EEPlugin.getPlugin().getImage("folder"); //$NON-NLS-1$
- }
-
- /**
- * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#getText(Object)
- */
- public String getText(Object object) {
- return UTILITY_JARS;
- }
-
- // assume this resource is a jar resource
- public void utilityJarChanged(IResource resource, IResourceDelta delta) {
- if (childrenLoaded) {
- if (delta.getKind() == IResourceDelta.ADDED && !children.contains(resource)) {
- children.add(resource);
- } else if (delta.getKind() == IResourceDelta.REMOVED && children.contains(resource)) {
- children.remove(resource);
- }
- }
- }
-
- protected static class UtilityJarResourceChangeListener implements IResourceChangeListener, IResourceDeltaVisitor {
-
- protected static final UtilityJarResourceChangeListener INSTANCE = new UtilityJarResourceChangeListener();
-
- private boolean listening = false;
- private Map earProjectsToUtilityJarProviderMap;
-
- public void addUtilityJarItemProvider(IProject project, J2EEUtilityJarItemProvider utilityJarItemProvider) {
- List providers = getProviders(project);
- if (providers != null)
- providers.add(utilityJarItemProvider);
- if (!listening) {
- ResourcesPlugin.getWorkspace().addResourceChangeListener(this, IResourceChangeEvent.POST_CHANGE);
- listening = true;
- }
- }
-
- /**
- * @param project
- * @return
- */
- private List getProviders(IProject project) {
- List result = (List) getEarProjectsToUtilityJarProviderMap().get(project);
- if (result == null && project != null)
- getEarProjectsToUtilityJarProviderMap().put(project, (result = new ArrayList()));
- return result;
- }
-
- /**
- * @return
- */
- private Map getEarProjectsToUtilityJarProviderMap() {
- if (earProjectsToUtilityJarProviderMap == null)
- earProjectsToUtilityJarProviderMap = new HashMap();
- return earProjectsToUtilityJarProviderMap;
- }
-
- public void removeUtilityJarItemProvider(IProject project, J2EEUtilityJarItemProvider utilityJarItemProvider) {
- List providers = getProviders(project);
- providers.remove(utilityJarItemProvider);
- if (providers.isEmpty())
- getEarProjectsToUtilityJarProviderMap().remove(project);
-
- if (getEarProjectsToUtilityJarProviderMap().isEmpty()) {
- ResourcesPlugin.getWorkspace().removeResourceChangeListener(this);
- listening = false;
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.resources.IResourceChangeListener#resourceChanged(org.eclipse.core.resources.IResourceChangeEvent)
- */
- public void resourceChanged(IResourceChangeEvent event) {
- try {
- event.getDelta().accept(this);
- } catch (CoreException e) {
- e.printStackTrace();
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.resources.IResourceDeltaVisitor#visit(org.eclipse.core.resources.IResourceDelta)
- */
- public boolean visit(IResourceDelta delta) {
- switch (delta.getResource().getType()) {
- case IResource.ROOT :
- case IResource.FOLDER :
- return true;
-
- case IResource.PROJECT :
- return getEarProjectsToUtilityJarProviderMap().containsKey(delta.getResource());
- case IResource.FILE : {
- IResource resource = delta.getResource();
- if (isComponentFile(resource)) {
- List utilityJarItemProviders = getProviders(resource.getProject());
- for (int i = 0; i < utilityJarItemProviders.size(); i++) {
- ((J2EEUtilityJarItemProvider) utilityJarItemProviders.get(i)).getChildren().clear();
- ((J2EEUtilityJarItemProvider) utilityJarItemProviders.get(i)).computeChildren();
- }
- }
- return false;
- }
-
- }
- return false;
- }
- }
-
- public IFile getAssociatedFile() {
-
- try {
- if (application != null && application.eResource() != null) {
- return WorkbenchResourceHelperBase.getIFile(application.eResource().getURI());
- }
- } catch (Throwable t) {
-
- }
- return null;
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/provider/J2EEUtilityJavaProjectsItemProvider.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/provider/J2EEUtilityJavaProjectsItemProvider.java
deleted file mode 100644
index 7a2fe62c8..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/provider/J2EEUtilityJavaProjectsItemProvider.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 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.jst.j2ee.internal.provider;
-
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIMessages;
-
-public class J2EEUtilityJavaProjectsItemProvider extends EARProjectMapItemProvider {
-
- public final static String UTILITY_JAVA_PROJECTS = J2EEUIMessages.getResourceString("Utility_Java_Projects_UI_"); //$NON-NLS-1$
-
- /**
- * Constructor for UtilityJARsItemProvider.
- *
- * @param adapterFactory
- */
- public J2EEUtilityJavaProjectsItemProvider(AdapterFactory adapterFactory) {
- super(adapterFactory);
- }
-
- /**
- * Constructor for UtilityJARsItemProvider.
- *
- * @param adapterFactory
- * @param includeModules
- */
- public J2EEUtilityJavaProjectsItemProvider(AdapterFactory adapterFactory, boolean includeModules) {
- super(adapterFactory, includeModules);
- }
-
- /**
- * @see ItemProviderAdapter#getImage(Object)
- */
- public Object getImage(Object object) {
- return J2EEPlugin.getPlugin().getImage("folder"); //$NON-NLS-1$
- }
-
- /**
- * @see ItemProviderAdapter#getText(Object)
- */
- public String getText(Object object) {
- return UTILITY_JAVA_PROJECTS;
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/provider/MethodsProviderDelegate.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/provider/MethodsProviderDelegate.java
deleted file mode 100644
index 1200806d7..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/provider/MethodsProviderDelegate.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 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.jst.j2ee.internal.provider;
-
-
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jst.j2ee.ejb.ExcludeList;
-import org.eclipse.jst.j2ee.ejb.MethodPermission;
-import org.eclipse.jst.j2ee.ejb.MethodTransaction;
-import org.eclipse.jst.j2ee.ejb.internal.impl.EjbFactoryImpl;
-import org.eclipse.jst.j2ee.internal.ejb.provider.AbstractMethodsContentProvider;
-import org.eclipse.jst.j2ee.internal.ejb.provider.ExcludeListContentProvider;
-import org.eclipse.jst.j2ee.internal.ejb.provider.MethodPermissionsContentProvider;
-import org.eclipse.jst.j2ee.internal.ejb.provider.MethodTransactionContentProvider;
-
-
-public class MethodsProviderDelegate implements ITreeContentProvider {
-
- protected ExcludeListContentProvider excludeListContentProvider;
- protected MethodPermissionsContentProvider methodPermissionsContentProvider;
- protected MethodTransactionContentProvider methodTransactionContentProvider;
-
- protected static EObject EL_META = EjbFactoryImpl.getPackage().getExcludeList();
- protected static EObject MP_META = EjbFactoryImpl.getPackage().getMethodPermission();
- protected static EObject MT_META = EjbFactoryImpl.getPackage().getMethodTransaction();
-
- public static boolean providesContentFor(Object object) {
- return object instanceof AbstractMethodsContentProvider.EJBMethodItem || object instanceof MethodPermission || object instanceof MethodTransaction || object instanceof ExcludeList;
- }
-
- public MethodsProviderDelegate(AdapterFactory adapterFactory) {
- super();
- excludeListContentProvider = new ExcludeListContentProvider(adapterFactory, false);
- methodPermissionsContentProvider = new MethodPermissionsContentProvider(adapterFactory, false);
- methodTransactionContentProvider = new MethodTransactionContentProvider(adapterFactory, false);
- }
-
- /**
- * @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose()
- */
- public void dispose() {
- if (excludeListContentProvider != null)
- excludeListContentProvider.dispose();
- if (methodPermissionsContentProvider != null)
- methodPermissionsContentProvider.dispose();
- if (methodTransactionContentProvider != null)
- methodTransactionContentProvider.dispose();
- }
-
- public AbstractMethodsContentProvider getContentProvider(Object object) {
- EObject metaClass = null;
- if (object instanceof AbstractMethodsContentProvider.EJBMethodItem)
- metaClass = ((AbstractMethodsContentProvider.EJBMethodItem) object).refObject.eClass();
- else
- metaClass = ((EObject) object).eClass();
-
- if (metaClass == EL_META)
- return excludeListContentProvider;
- else if (metaClass == MP_META)
- return methodPermissionsContentProvider;
- else if (metaClass == MT_META)
- return methodTransactionContentProvider;
-
- return null;
- }
-
-
- /**
- * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(Viewer, Object, Object)
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- excludeListContentProvider.inputChanged(viewer, oldInput, newInput);
- methodPermissionsContentProvider.inputChanged(viewer, oldInput, newInput);
- methodTransactionContentProvider.inputChanged(viewer, oldInput, newInput);
- }
-
- /**
- * @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(Object)
- */
- public Object[] getChildren(Object parentElement) {
- AbstractMethodsContentProvider prov = getContentProvider(parentElement);
- return prov == null ? null : prov.getChildren(parentElement);
- }
-
- /**
- * @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(Object)
- */
- public Object getParent(Object element) {
- AbstractMethodsContentProvider prov = getContentProvider(element);
- return prov == null ? null : prov.getParent(element);
- }
-
- /**
- * @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(Object)
- */
- public boolean hasChildren(Object element) {
- AbstractMethodsContentProvider prov = getContentProvider(element);
- return prov != null && prov.hasChildren(element);
- }
-
- /**
- * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(Object)
- */
- public Object[] getElements(Object inputElement) {
- AbstractMethodsContentProvider prov = getContentProvider(inputElement);
- return prov == null ? null : prov.getElements(inputElement);
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/provider/ModulesItemProvider.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/provider/ModulesItemProvider.java
deleted file mode 100644
index 038cf30b7..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/provider/ModulesItemProvider.java
+++ /dev/null
@@ -1,287 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.jst.j2ee.internal.provider;
-
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.jem.util.emf.workbench.WorkbenchResourceHelperBase;
-import org.eclipse.jst.j2ee.application.Application;
-import org.eclipse.jst.j2ee.application.Module;
-import org.eclipse.jst.j2ee.internal.componentcore.JavaEEBinaryComponentHelper;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIMessages;
-import org.eclipse.wst.common.componentcore.internal.util.ComponentUtilities;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.common.componentcore.resources.IVirtualReference;
-
-public class ModulesItemProvider extends J2EEItemProvider {
- public static final String MODULES = J2EEUIMessages.getResourceString("Modules_UI_"); //$NON-NLS-1$
-
- /**
- * Constructor for ModulesItemProvider.
- */
- public ModulesItemProvider() {
- super();
- }
-
- /**
- * Constructor for ModulesItemProvider.
- *
- * @param children
- */
- public ModulesItemProvider(Collection children) {
- super(children);
- }
-
- /**
- * Constructor for ModulesItemProvider.
- *
- * @param text
- */
- public ModulesItemProvider(String text) {
- super(text);
- }
-
- /**
- * Constructor for ModulesItemProvider.
- *
- * @param text
- * @param children
- */
- public ModulesItemProvider(String text, Collection children) {
- super(text, children);
- }
-
- /**
- * Constructor for ModulesItemProvider.
- *
- * @param text
- * @param image
- */
- public ModulesItemProvider(String text, Object image) {
- super(text, image);
- }
-
- /**
- * Constructor for ModulesItemProvider.
- *
- * @param text
- * @param image
- * @param children
- */
- public ModulesItemProvider(String text, Object image, Collection children) {
- super(text, image, children);
- }
-
- /**
- * Constructor for ModulesItemProvider.
- *
- * @param text
- * @param image
- * @param parent
- */
- public ModulesItemProvider(String text, Object image, Object parent) {
- super(text, image, parent);
- }
-
- /**
- * Constructor for ModulesItemProvider.
- *
- * @param text
- * @param image
- * @param parent
- * @param children
- */
- public ModulesItemProvider(String text, Object image, Object parent, Collection children) {
- super(text, image, parent, children);
- }
-
- /**
- * Constructor for ModulesItemProvider.
- *
- * @param adapterFactory
- */
- public ModulesItemProvider(AdapterFactory adapterFactory) {
- super(adapterFactory);
- }
-
- /**
- * Constructor for ModulesItemProvider.
- *
- * @param adapterFactory
- * @param text
- */
- public ModulesItemProvider(AdapterFactory adapterFactory, String text) {
- super(adapterFactory, text);
- }
-
- /**
- * Constructor for ModulesItemProvider.
- *
- * @param adapterFactory
- * @param text
- * @param image
- */
- public ModulesItemProvider(AdapterFactory adapterFactory, String text, Object image) {
- super(adapterFactory, text, image);
- }
-
- /**
- * Constructor for ModulesItemProvider.
- *
- * @param adapterFactory
- * @param text
- * @param image
- * @param parent
- */
- public ModulesItemProvider(AdapterFactory adapterFactory, String text, Object image, Object parent) {
- super(adapterFactory, text, image, parent);
- }
-
- /**
- * Constructor for ModulesItemProvider.
- *
- * @param adapterFactory
- * @param children
- */
- public ModulesItemProvider(AdapterFactory adapterFactory, Collection children) {
- super(adapterFactory, children);
- }
-
- /**
- * Constructor for ModulesItemProvider.
- *
- * @param adapterFactory
- * @param text
- * @param children
- */
- public ModulesItemProvider(AdapterFactory adapterFactory, String text, Collection children) {
- super(adapterFactory, text, children);
- }
-
- /**
- * Constructor for ModulesItemProvider.
- *
- * @param adapterFactory
- * @param text
- * @param image
- * @param children
- */
- public ModulesItemProvider(AdapterFactory adapterFactory, String text, Object image, Collection children) {
- super(adapterFactory, text, image, children);
- }
-
- /**
- * Constructor for ModulesItemProvider.
- *
- * @param adapterFactory
- * @param text
- * @param image
- * @param parent
- * @param children
- */
- public ModulesItemProvider(AdapterFactory adapterFactory, String text, Object image, Object parent, Collection children) {
- super(adapterFactory, text, image, parent, children);
- }
-
-
- /**
- * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#getImage(Object)
- */
- public Object getImage(Object object) {
- return J2EEPlugin.getPlugin().getImage("folder"); //$NON-NLS-1$
- }
-
- public Application getParentApplication() {
- return (Application) getParent();
- }
-
- public IFile getAssociatedFile() {
-
- try {
- Application application = getParentApplication();
- if (application != null && application.eResource() != null) {
- return WorkbenchResourceHelperBase.getIFile(application.eResource().getURI());
- }
- } catch (Throwable t) {
-
- }
- return null;
- }
-
-
- /**
- * @see org.eclipse.emf.edit.provider.IItemLabelProvider#getText(Object)
- */
- public String getText(Object object) {
- return MODULES;
- }
-
- public boolean hasChildren(Object object) {
- getChildren(object);
- return !localChildren.isEmpty();
- }
-
- private List localChildren = null;
-
- public Collection getChildren(Object object) {
- return initChildren(object);
- }
-
- protected List initChildren(Object object) {
- localChildren = new ArrayList();
- Application app = (Application) getParent();
- IVirtualComponent ear = ComponentUtilities.findComponent(app);
- List modules = app.getModules();
- List binaryModules = new ArrayList();
- IVirtualReference[] refs = ear.getReferences();
- for (int i = 0; i < modules.size(); i++) {
- Module module = (Module) modules.get(i);
- String moduleURI = module.getUri();
- boolean foundBinary = false;
- for (int j = 0; j < refs.length && !foundBinary; j++) {
- IVirtualComponent component = refs[j].getReferencedComponent();
- if (component.isBinary()) {
- if (refs[j].getArchiveName().equals(moduleURI)) {
- foundBinary = true;
- JavaEEBinaryComponentHelper helper = null;
- try {
- helper = new JavaEEBinaryComponentHelper(component);
- Object binaryModule = helper.getPrimaryRootObject();
- if (binaryModule != null) {
- binaryModules.add(binaryModule);
- }
- } finally {
- if(helper != null){
- helper.dispose();
- }
- }
- }
- }
- }
- if (!foundBinary) {
- localChildren.add(module);
- }
- }
-
- if (!binaryModules.isEmpty()) {
- localChildren.add(new J2EEBinaryModulesItemProvider(app, getAdapterFactory(), binaryModules));
- }
-
- return localChildren;
-
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/provider/UtilityModuleProjectItemProvider.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/provider/UtilityModuleProjectItemProvider.java
deleted file mode 100644
index d3c650e7c..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/provider/UtilityModuleProjectItemProvider.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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.jst.j2ee.internal.provider;
-
-import java.util.Collection;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.edit.provider.ItemProviderAdapter;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin;
-
-public class UtilityModuleProjectItemProvider extends J2EEItemProvider {
-
- private IProject utilProject;
-
- public UtilityModuleProjectItemProvider(AdapterFactory adapterFactory, IProject project, Object parent) {
- super(adapterFactory);
- setParent(parent);
- utilProject = project;
- // TODO Auto-generated constructor stub
- }
-
- /**
- * @see ItemProviderAdapter#getImage(Object)
- */
- public Object getImage(Object object) {
- return J2EEPlugin.getPlugin().getImage("icons/full/obj16/prjutiljar_obj"); //$NON-NLS-1$
- }
-
- /**
- * @see ItemProviderAdapter#getText(Object)
- */
- public String getText(Object object) {
-
- return utilProject.getName();
- }
-
- @Override
- public Collection<?> getChildren(Object object) {
- // TODO Auto-generated method stub
- return super.getChildren(object);
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ui/DoubleCheckboxTableItem.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ui/DoubleCheckboxTableItem.java
deleted file mode 100644
index 7ffb5a95d..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ui/DoubleCheckboxTableItem.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 SAP AG 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:
- * Stefan Dimov, stefan.dimov@sap.com - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.internal.ui;
-
-import org.eclipse.jface.viewers.ICheckStateListener;
-import org.eclipse.jst.j2ee.internal.SecondCheckBoxStateChangedEvent;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableItem;
-
-public class DoubleCheckboxTableItem extends TableItem {
-
- protected int mSecondCheckboxColumnIndex;
- protected Button secondCheckBox;
- protected SelectionListener selLstnr;
- protected ICheckStateListener tblLstnr = null;
- protected DoubleCheckboxTableViewer tableViewer;
-
- public DoubleCheckboxTableItem (Table parent, int style, int secondCheckboxColumnIndex, DoubleCheckboxTableViewer tableViewer) {
- super(parent, style);
- mSecondCheckboxColumnIndex = secondCheckboxColumnIndex;
- this.tableViewer = tableViewer;
- createCheckBox(parent);
- }
-
- public DoubleCheckboxTableItem(Table parent, int style, int index, int secondCheckboxColumnIndex, DoubleCheckboxTableViewer tableViewer) {
- super(parent, style, index);
- mSecondCheckboxColumnIndex = secondCheckboxColumnIndex;
- this.tableViewer = tableViewer;
- createCheckBox(parent);
- }
-
- public void setSecondChecked (boolean checked) {
- secondCheckBox.setSelection(checked);
- }
-
- public boolean getSecondChecked() {
- return secondCheckBox.getSelection();
- }
-
- public void setSecondGrayed(boolean grayed) {
- secondCheckBox.setGrayed(grayed);
- }
-
- public boolean getSecondGrayed() {
- return secondCheckBox.getGrayed();
- }
-
- public void setSecondEnabled(boolean enabled) {
- secondCheckBox.setEnabled(enabled);
- }
-
- public boolean getSecondEnabled() {
- return secondCheckBox.getEnabled();
- }
-
- public boolean isSecondEnabled() {
- return secondCheckBox.isEnabled();
- }
-
- private void createCheckBox(Table parentTable) {
- secondCheckBox = new Button(parentTable, SWT.CHECK | SWT.FLAT);
- secondCheckBox.pack();
- final DoubleCheckboxTableItem th = this;
- selLstnr = new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- SecondCheckBoxStateChangedEvent evt = new SecondCheckBoxStateChangedEvent(tableViewer,
- getData(),
- getChecked());
- evt.setTableItem(th);
- tblLstnr.checkStateChanged(evt);
- }
- public void widgetDefaultSelected(SelectionEvent e) {}
- };
- secondCheckBox.addSelectionListener(selLstnr);
- }
-
- public Button getSecondCheckBox() {
- return secondCheckBox;
- }
-
- public void dispose() {
- disposeSecondCheckbox();
- super.dispose();
- }
-
- protected void disposeSecondCheckbox() {
- if (secondCheckBox != null) {
- secondCheckBox.removeSelectionListener(selLstnr);
- secondCheckBox.dispose();
- secondCheckBox = null;
- }
- selLstnr = null;
- }
-
- void setTableListener(ICheckStateListener tblLstnr) {
- this.tblLstnr = tblLstnr;
- }
-
- protected void checkSubclass () {}
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ui/DoubleCheckboxTableViewer.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ui/DoubleCheckboxTableViewer.java
deleted file mode 100644
index f837b9213..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ui/DoubleCheckboxTableViewer.java
+++ /dev/null
@@ -1,181 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 SAP AG 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:
- * Stefan Dimov, stefan.dimov@sap.com - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.j2ee.internal.ui;
-
-import java.util.ArrayList;
-import java.util.Hashtable;
-
-import org.eclipse.jface.viewers.CheckboxTableViewer;
-import org.eclipse.jface.viewers.ICheckStateListener;
-import org.eclipse.jface.viewers.ViewerRow;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.TableEditor;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableItem;
-
-public class DoubleCheckboxTableViewer extends CheckboxTableViewer {
-
- protected int mSecondCheckboxColumnIndex;
- protected ICheckStateListener lstnr = null;
-
- public DoubleCheckboxTableViewer(Table table, int secondCheckBoxColumnIndex) {
- super(table);
- if (secondCheckBoxColumnIndex < 1)
- throw new IllegalArgumentException(
- "The index of the second column with check box must be bigger than zero"); //$NON-NLS-1$
-
- mSecondCheckboxColumnIndex = secondCheckBoxColumnIndex;
- }
-
- public void addCheckStateListener(ICheckStateListener listener) {
- super.addCheckStateListener(listener);
- lstnr = listener;
- }
-
- public void removeCheckStateListener(ICheckStateListener listener) {
- super.removeCheckStateListener(listener);
- lstnr = null;
- getTable().getItems();
- for (int i = 0; i < getTable().getItems().length; i++) {
- DoubleCheckboxTableItem it = (DoubleCheckboxTableItem)getTable().getItem(i);
- it.setTableListener(null);
- }
- }
-
- protected ViewerRow internalCreateNewRowPart(int style, int rowIndex) {
- DoubleCheckboxTableItem item;
- if (rowIndex >= 0) {
- item = new DoubleCheckboxTableItem(getTable(), style, rowIndex, mSecondCheckboxColumnIndex, this);
- } else {
- item = new DoubleCheckboxTableItem(getTable(), style, mSecondCheckboxColumnIndex, this);
- }
- item.setTableListener(lstnr);
- TableEditor editor = new TableEditor(getTable());
- editor.minimumWidth = item.getSecondCheckBox().getSize ().x;
- editor.horizontalAlignment = SWT.CENTER;
- editor.setEditor(item.getSecondCheckBox(), item, mSecondCheckboxColumnIndex);
- return getViewerRowFromItem(item);
- }
-
- public Object[] getSecondCheckedItems() {
- TableItem[] children = getTable().getItems();
- ArrayList v = new ArrayList(children.length);
- for (int i = 0; i < children.length; i++) {
- DoubleCheckboxTableItem item = (DoubleCheckboxTableItem)children[i];
- if (item.getSecondChecked()) {
- v.add(item);
- }
- }
- return v.toArray();
- }
-
- public void setAllSecondChecked(boolean state) {
- TableItem[] children = getTable().getItems();
- for (int i = 0; i < children.length; i++) {
- DoubleCheckboxTableItem item = (DoubleCheckboxTableItem)children[i];
- item.setSecondChecked(state);
- }
- }
-
- public Object[] getSingleCheckedElements() {
- TableItem[] children = getTable().getItems();
- ArrayList v = new ArrayList(children.length);
- for (int i = 0; i < children.length; i++) {
- DoubleCheckboxTableItem item = (DoubleCheckboxTableItem)children[i];
- if (item.getChecked() && (!item.getSecondChecked())) {
- v.add(item.getData());
- }
- }
- return v.toArray();
- }
-
- public Object[] getDoubleCheckedElements() {
- TableItem[] children = getTable().getItems();
- ArrayList v = new ArrayList(children.length);
- for (int i = 0; i < children.length; i++) {
- DoubleCheckboxTableItem item = (DoubleCheckboxTableItem)children[i];
- if (item.getChecked() && item.getSecondChecked()) {
- v.add(item.getData());
- }
- }
- return v.toArray();
- }
-
- public Object[] getUncheckedItems() {
- TableItem[] children = getTable().getItems();
- ArrayList v = new ArrayList(children.length);
- for (int i = 0; i < children.length; i++) {
- TableItem item = children[i];
- if (!item.getChecked()) {
- v.add(item);
- }
- }
- return v.toArray();
- }
-
-
- public Object[] getSecondUncheckedElements() {
- TableItem[] children = getTable().getItems();
- ArrayList v = new ArrayList(children.length);
- for (int i = 0; i < children.length; i++) {
- DoubleCheckboxTableItem item = (DoubleCheckboxTableItem)children[i];
- if (!item.getSecondChecked()) {
- v.add(item.getData());
- }
- }
- return v.toArray();
- }
-
- public void setSecondCheckedItems(Object[] inputItems) {
- assertElementsNotNull(inputItems);
- Hashtable set = new Hashtable();
- for (int i = 0; i < inputItems.length; ++i) {
- set.put(inputItems[i], inputItems[i]);
- }
- TableItem[] items = getTable().getItems();
- for (int i = 0; i < items.length; ++i) {
- DoubleCheckboxTableItem item = (DoubleCheckboxTableItem)items[i];
- boolean check = set.containsKey(item);
- if (item.getSecondChecked() != check) {
- item.setSecondChecked(check);
- }
-
- }
- }
-
- @Override
- protected void doRemove(int start, int end) {
- // ensure that the second check box is disposed
- for (int i = start; i <= end; i++) {
- disposeSecondCheckboxOfItem(i);
- }
-
- super.doRemove(start, end);
- }
-
- @Override
- protected void doRemove(int[] indices) {
- // ensure that the second check box is disposed
- for (int i : indices) {
- disposeSecondCheckboxOfItem(i);
- }
-
- super.doRemove(indices);
- }
-
- private void disposeSecondCheckboxOfItem(int index) {
- TableItem item = getTable().getItem(index);
- if (item instanceof DoubleCheckboxTableItem) {
- ((DoubleCheckboxTableItem) item).disposeSecondCheckbox();
- }
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ui/J2EEPropertiesPage.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ui/J2EEPropertiesPage.java
deleted file mode 100644
index fff1160ac..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ui/J2EEPropertiesPage.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 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
- * David Schneider, david.schneider@unisys.com - [142500] WTP properties pages fonts don't follow Eclipse preferences
- *******************************************************************************/
-
-package org.eclipse.jst.j2ee.internal.ui;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.layout.GridDataFactory;
-import org.eclipse.jface.layout.GridLayoutFactory;
-import org.eclipse.jst.j2ee.internal.J2EEPropertiesConstants;
-import org.eclipse.jst.j2ee.internal.ui.refactoring.RenameContextRootChange;
-import org.eclipse.jst.j2ee.internal.ui.refactoring.RenameContextRootRefactoringProcessor;
-import org.eclipse.jst.j2ee.internal.ui.refactoring.RenameContextRootWizard;
-import org.eclipse.jst.j2ee.project.JavaEEProjectUtilities;
-import org.eclipse.ltk.ui.refactoring.RefactoringWizard;
-import org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.dialogs.PropertyPage;
-import org.eclipse.wst.common.componentcore.internal.util.ComponentUtilities;
-
-public class J2EEPropertiesPage extends PropertyPage implements J2EEPropertiesConstants {
-
- private Text contextRootNameField;
- private boolean dirty = false;
-
- /**
- * @see org.eclipse.jface.preference.PreferencePage#createContents(Composite)
- */
- protected Control createContents(Composite parent) {
- Composite c = parent;
- IProject project = getProject();
- if (project != null
- && JavaEEProjectUtilities.getJ2EEProjectType(project).equals(
- JavaEEProjectUtilities.DYNAMIC_WEB)
- || JavaEEProjectUtilities.getJ2EEProjectType(project).equals(
- JavaEEProjectUtilities.STATIC_WEB)) {
-
- c = new Composite(parent, SWT.NONE);
-
- Label contextRootLabel = new Label(c, SWT.NONE);
- contextRootLabel.setText(J2EEPropertiesConstants.WEB_CONTEXT_ROOT);
-
- contextRootNameField = new Text(c, SWT.BORDER);
- contextRootNameField.addModifyListener(new ModifyListener() {
-
- public void modifyText(ModifyEvent e) {
- dirty = !contextRootNameField.getText().equals(
- ComponentUtilities.getServerContextRoot(getProject()));
- validateText();
- }
- });
- GridLayoutFactory.fillDefaults().numColumns(2).applyTo(c);
- GridDataFactory.defaultsFor(contextRootLabel).applyTo(contextRootLabel);
- GridDataFactory.defaultsFor(contextRootNameField).grab(true, false).applyTo(
- contextRootNameField);
- }
- applyDialogFont(c);
- return c;
- }
-
- @Override
- public void createControl(Composite parent) {
- super.createControl(parent);
- refresh();
- refreshApplyButton();
- }
-
- private void validateText() {
- IStatus status = RenameContextRootChange
- .validateContextRoot(contextRootNameField.getText());
- if (!status.isOK()) {
- setErrorMessage(status.getMessage());
- setValid(false);
- }
- else {
- setErrorMessage(null);
- setValid(true);
- refreshApplyButton();
- }
- }
-
- private void refreshApplyButton() {
- if (dirty) {
- if (getApplyButton() != null) {
- getApplyButton().setEnabled(true);
- }
- }
- else {
- if (getApplyButton() != null) {
- getApplyButton().setEnabled(false);
- }
- }
- }
-
- public void refresh() {
- if (contextRootNameField != null) {
- String s = ComponentUtilities.getServerContextRoot(getProject());
- if (s == null) {
- s = ""; //$NON-NLS-1$
- }
- contextRootNameField.setText(s);
- validateText();
- }
- }
-
- private IProject getProject() {
-
- Object element = getElement();
- if (element == null) {
- return null;
- }
- if (element instanceof IProject) {
- IProject project = (IProject) element;
- return project;
- }
- return null;
-
- }
-
- private int doRefactor() {
- int id = IDialogConstants.OK_ID;
- if (dirty) {
- RenameContextRootRefactoringProcessor processor = new RenameContextRootRefactoringProcessor();
- processor.setProject(getProject());
- processor.setNewName(contextRootNameField.getText());
- RenameContextRootWizard wizard = new RenameContextRootWizard(processor,
- RefactoringWizard.DIALOG_BASED_USER_INTERFACE);
- wizard.setPrompt(false);
- RefactoringWizardOpenOperation operation = new RefactoringWizardOpenOperation(wizard);
-
- try {
- id = operation.run(getShell(), ""); //$NON-NLS-1$
- }
- catch (InterruptedException ee) {
-
- }
- if (id == IDialogConstants.OK_ID) {
- dirty = false;
- refresh();
- }
- }
-
- return id;
- }
-
- @Override
- protected void performApply() {
- doRefactor();
- }
-
- @Override
- protected void performDefaults() {
- refresh();
- }
-
- public boolean performOk() {
- return doRefactor() == IDialogConstants.OK_ID;
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ui/refactoring/ContextRootInputPage.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ui/refactoring/ContextRootInputPage.java
deleted file mode 100644
index 4c49b496c..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ui/refactoring/ContextRootInputPage.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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.jst.j2ee.internal.ui.refactoring;
-
-import org.eclipse.jface.layout.GridLayoutFactory;
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIMessages;
-import org.eclipse.ltk.core.refactoring.RefactoringStatus;
-import org.eclipse.ltk.ui.refactoring.UserInputWizardPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-
-public class ContextRootInputPage extends UserInputWizardPage {
-
- private final RenameContextRootRefactoringProcessor fProcessor;
- private Text fNameField;
-
- public ContextRootInputPage(String name, RenameContextRootRefactoringProcessor processor) {
- super(name);
- this.fProcessor = processor;
- }
-
- public void createControl(Composite parent) {
- Composite c = new Composite(parent, SWT.NONE);
-
- Label label = new Label(c, SWT.NONE);
- label.setText(J2EEUIMessages.getResourceString("NewContextRoot")); //$NON-NLS-1$
-
- fNameField = new Text(c, SWT.BORDER);
- fNameField.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false));
-
- fNameField.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- validatePage();
- }
-
- });
- String oldName = fProcessor.getOldContextRoot();
- if (oldName != null && oldName.length() > 0) {
- fNameField.setText(oldName);
- fNameField.setSelection(0, oldName.length());
- }
-
- GridLayoutFactory.swtDefaults().numColumns(2).applyTo(c);
-
- setControl(c);
- fNameField.setFocus();
-
- validatePage();
- }
-
- private void validatePage() {
- String text = fNameField.getText();
- RefactoringStatus status = fProcessor.validateNewElementName(text);
- setPageComplete(status);
- }
-
- @Override
- protected boolean performFinish() {
- initializeRefactoring();
- return super.performFinish();
- }
-
- @Override
- public IWizardPage getNextPage() {
- initializeRefactoring();
- return super.getNextPage();
- }
-
- private void initializeRefactoring() {
- fProcessor.setNewName(fNameField.getText());
- }
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ui/refactoring/RenameContextRootChange.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ui/refactoring/RenameContextRootChange.java
deleted file mode 100644
index d42229eef..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ui/refactoring/RenameContextRootChange.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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.jst.j2ee.internal.ui.refactoring;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIMessages;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIPlugin;
-import org.eclipse.jst.j2ee.internal.project.ProjectSupportResourceHandler;
-import org.eclipse.ltk.core.refactoring.Change;
-import org.eclipse.ltk.core.refactoring.RefactoringStatus;
-import org.eclipse.wst.common.componentcore.internal.util.ComponentUtilities;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-import com.ibm.icu.util.StringTokenizer;
-
-public class RenameContextRootChange extends Change {
-
- private final IProject project;
- private final String newContextRoot;
- private final String oldContextRoot;
- private IDataModel model;
-
- public RenameContextRootChange(IProject project, String newContextRoot, String oldContextRoot) {
- this.project = project;
- this.oldContextRoot = oldContextRoot;
- this.newContextRoot = newContextRoot;
- }
-
- @Override
- public Object getModifiedElement() {
- return project;
- }
-
- @Override
- public String getName() {
- return J2EEUIMessages.getResourceString("RenameContextRootFromXtoY", new String[]{oldContextRoot, //$NON-NLS-1$
- newContextRoot});
- }
-
- @Override
- public void initializeValidationData(IProgressMonitor pm) {
-
- }
-
- public static IStatus validateContextRoot(String name) {
- IStatus status = Status.OK_STATUS;
- if (name == null || name.length() == 0) {
- // this was added because the error message shouldnt be shown
- // initially. It should be shown only if context
- // root field is edited to
- status = new Status(IStatus.ERROR, J2EEUIPlugin.PLUGIN_ID,
- ProjectSupportResourceHandler.getString(
- ProjectSupportResourceHandler.Context_Root_cannot_be_empty_2,
- new Object[0]));
-
- }
-
- if (!(name.indexOf(' ') > -1)) {
- StringTokenizer stok = new StringTokenizer(name, "."); //$NON-NLS-1$
- while (stok.hasMoreTokens()) {
- String token = stok.nextToken();
- for (int i = 0; i < token.length(); i++) {
- if (!(token.charAt(i) == '_') && !(token.charAt(i) == '-')
- && !(token.charAt(i) == '/')
- && Character.isLetterOrDigit(token.charAt(i)) == false) {
- if (Character.isWhitespace(token.charAt(i)) == false) {
- status = new Status(
- IStatus.ERROR,
- J2EEUIPlugin.PLUGIN_ID,
- ProjectSupportResourceHandler
- .getString(
- ProjectSupportResourceHandler.The_character_is_invalid_in_a_context_root,
- new Object[] {
- (new Character(token.charAt(i))).toString()
- }));
-
- }
- }
- }
- }
- } // en/ end of if(name.trim
- else {
- status = new Status(IStatus.ERROR, J2EEUIPlugin.PLUGIN_ID,
- ProjectSupportResourceHandler.getString(
- ProjectSupportResourceHandler.Names_cannot_contain_whitespace_,
- new Object[0]));
-
- }
- return status;
-
- }
-
- @Override
- public RefactoringStatus isValid(IProgressMonitor pm) throws CoreException,
- OperationCanceledException {
- IStatus phase1 = validateContextRoot(newContextRoot);
- if (phase1.isOK())
- return new RefactoringStatus();
- else
- return RefactoringStatus.create(phase1);
- }
-
- @Override
- public Change perform(IProgressMonitor pm) throws CoreException {
-
- ComponentUtilities.setServerContextRoot(project, newContextRoot);
-
- return new RenameContextRootChange(project, oldContextRoot, newContextRoot);
- }
-
-}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ui/refactoring/RenameContextRootRefactoringProcessor.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ui/refactoring/RenameContextRootRefactoringProcessor.java
deleted file mode 100644
index 2564e1b5c..000000000
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/ui/refactoring/RenameContextRootRefactoringProcessor.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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.jst.j2ee.internal.ui.refactoring;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIMessages;
-import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities;
-import org.eclipse.ltk.core.refactoring.Change;
-import org.eclipse.ltk.core.refactoring.RefactoringStatus;
-import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
-import org.eclipse.ltk.core.refactoring.participants.ParticipantManager;
-import org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant;
-import org.eclipse.ltk.core.refactoring.participants.RenameArguments;
-import org.eclipse.ltk.core.refactoring.participants.RenameProcessor;
-import org.eclipse.ltk.core.refactoring.participants.SharableParticipants;
-
-public class RenameContextRootRefactoringProcessor extends RenameProcessor {
-
- private IProject fProject;
- private String fNewName;
- private boolean fUpdateReferences;
-
- @Override
- public RefactoringStatus checkFinalConditions(IProgressMonitor pm,
- CheckConditionsContext context) throws CoreException, OperationCanceledException {
- if (!isApplicable())
- return RefactoringStatus.createErrorStatus(J2EEUIMessages
- .getResourceString("RefactoringNoInit")); //$NON-NLS-1$
- return validateNewElementName(fNewName);
- }
-
- @Override
- public RefactoringStatus checkInitialConditions(IProgressMonitor pm) throws CoreException,
- OperationCanceledException {
- return new RefactoringStatus();
- }
-
- @Override
- public Change createChange(IProgressMonitor pm) throws CoreException,
- OperationCanceledException {
- if (isApplicable() && fNewName != null)
- return new RenameContextRootChange(getProject(), fNewName, getOldContextRoot());
- return null;
- }
-
- @Override
- public Object[] getElements() {
- if (getProject() == null)
- return new Object[0];
- return new Object[] {
- getProject()
- };
- }
-
- @Override
- public String getIdentifier() {
- return "org.eclipse.jst.j2ee.ChangeContextRootRefactoringProcessor"; //$NON-NLS-1$
- }
-
- @Override
- public String getProcessorName() {
- return J2EEUIMessages.getResourceString("RenameContextRoot"); //$NON-NLS-1$
- }
-
- public IProject getProject() {
- return fProject;
- }
-
- @Override
- public boolean isApplicable() throws CoreException {
- return getProject() != null;
- }
-
- private RenameArguments getRenameArguments() {
- return new RenameArguments(fNewName, fUpdateReferences);
- }
-
- @Override
- public RefactoringParticipant[] loadParticipants(RefactoringStatus status,
- SharableParticipants sharedParticipants) throws CoreException {
- String[] natures = new String[0];
- IProject project = getProject();
- if (project != null && fNewName != null) {
- natures = project.getDescription().getNatureIds();
- return ParticipantManager.loadRenameParticipants(status, this, project,
- getRenameArguments(), natures, sharedParticipants);
- }
- return new RefactoringParticipant[0];
- }
-
- public void setProject(IProject project) {
- this.fProject = project;
- }