Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/org.eclipse.objectteams.eclipse.monitor/.classpath8
-rw-r--r--plugins/org.eclipse.objectteams.eclipse.monitor/.project29
-rw-r--r--plugins/org.eclipse.objectteams.eclipse.monitor/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--plugins/org.eclipse.objectteams.eclipse.monitor/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--plugins/org.eclipse.objectteams.eclipse.monitor/META-INF/MANIFEST.MF13
-rw-r--r--plugins/org.eclipse.objectteams.eclipse.monitor/build.properties6
-rw-r--r--plugins/org.eclipse.objectteams.eclipse.monitor/icons/auto_refresh.pngbin0 -> 1049 bytes
-rw-r--r--plugins/org.eclipse.objectteams.eclipse.monitor/icons/monitor.pngbin0 -> 306 bytes
-rw-r--r--plugins/org.eclipse.objectteams.eclipse.monitor/icons/refresh_nav.gifbin0 -> 327 bytes
-rw-r--r--plugins/org.eclipse.objectteams.eclipse.monitor/icons/refresh_nav_dis.gifbin0 -> 211 bytes
-rw-r--r--plugins/org.eclipse.objectteams.eclipse.monitor/plugin.xml41
-rw-r--r--plugins/org.eclipse.objectteams.eclipse.monitor/src/org/eclipse/objectteams/eclipse/monitor/Activator.java82
-rw-r--r--plugins/org.eclipse.objectteams.eclipse.monitor/src/org/eclipse/objectteams/eclipse/monitor/MonitorMessages.java46
-rw-r--r--plugins/org.eclipse.objectteams.eclipse.monitor/src/org/eclipse/objectteams/eclipse/monitor/MonitorMessages.properties14
-rw-r--r--plugins/org.eclipse.objectteams.eclipse.monitor/src/org/eclipse/objectteams/eclipse/monitor/MonitorView.java261
-rw-r--r--plugins/org.eclipse.objectteams.otdt.apt/.classpath8
-rw-r--r--plugins/org.eclipse.objectteams.otdt.apt/.project29
-rw-r--r--plugins/org.eclipse.objectteams.otdt.apt/.settings/org.eclipse.jdt.core.prefs19
-rw-r--r--plugins/org.eclipse.objectteams.otdt.apt/META-INF/MANIFEST.MF11
-rw-r--r--plugins/org.eclipse.objectteams.otdt.apt/build.properties5
-rw-r--r--plugins/org.eclipse.objectteams.otdt.apt/plugin.xml23
-rw-r--r--plugins/org.eclipse.objectteams.otdt.apt/src/org/eclipse/objectteams/otdt/apt/VisitorsAdaptor.java82
-rw-r--r--plugins/org.eclipse.objectteams.otdt.compiler.adaptor/.classpath8
-rw-r--r--plugins/org.eclipse.objectteams.otdt.compiler.adaptor/.project19
-rw-r--r--plugins/org.eclipse.objectteams.otdt.compiler.adaptor/.settings/org.eclipse.jdt.core.prefs85
-rw-r--r--plugins/org.eclipse.objectteams.otdt.compiler.adaptor/META-INF/MANIFEST.MF16
-rw-r--r--plugins/org.eclipse.objectteams.otdt.compiler.adaptor/build.properties5
-rw-r--r--plugins/org.eclipse.objectteams.otdt.compiler.adaptor/plugin.xml67
-rw-r--r--plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/AdaptedBaseBundle.java115
-rw-r--r--plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/AdaptorActivator.java371
-rw-r--r--plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/AspectBindingReader.java364
-rw-r--r--plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/BaseImportChecker.java289
-rw-r--r--plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/BuildManager.java345
-rw-r--r--plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/BuildManager/ClassFileChangeTracker.java62
-rw-r--r--plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/BuildManager/ImageBuilder.java269
-rw-r--r--plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/CompilationThreadWatcher.java48
-rw-r--r--plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/IllegalReusedBinaryRoleException.java29
-rw-r--r--plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/PDEAdaptor.java273
-rw-r--r--plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/PlainProjectWatcher.java57
-rw-r--r--plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/ProjectUtil.java63
-rw-r--r--plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/ResourceProjectAdaptor.java86
-rw-r--r--plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/RoleReuseGuard.java197
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.adaptor/.classpath8
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.adaptor/.project29
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.adaptor/.settings/org.eclipse.jdt.core.prefs28
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.adaptor/META-INF/MANIFEST.MF28
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.adaptor/build.properties6
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.adaptor/plugin.properties8
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.adaptor/plugin.xml206
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/DebugMessages.java35
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/LaunchUtils.java58
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/OTDebugAdaptorPlugin.java39
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/PreferenceInitializer.java38
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/PresentationAdaptor.java325
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/PresentationAdaptorActivator.java110
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/RetargettableActionAdaptor.java41
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/SourceLookupAdaptor.java118
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/VariablesViewAdaptor.java131
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/actions/ShowOTInternalVariablesAction.java64
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/debugMessages.properties5
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/launching/DebugUIDialogAdaptor.java105
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/launching/DebugUIDialogAdaptor2.java35
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/launching/DebugUIDialogAdaptor3.java35
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/launching/JDTDebugUILaunchingAdaptor.java136
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/launching/JDTLaunchingAdaptor.java209
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/launching/JUnitLaunchingAdaptor.java37
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/launching/LaunchConfigurationInitializer.java81
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/launching/OTLaunchConfigurationTab.java216
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/launching/OTREBlock.java126
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/launching/PDELaunchingAdaptor.java254
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/launching/TeamConfig.java453
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.ui/.classpath7
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.ui/.cvsignore1
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.ui/.project28
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.ui/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.ui/.settings/org.eclipse.jdt.core.prefs57
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.ui/META-INF/MANIFEST.MF30
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.ui/build.properties10
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.ui/icons/refresh.gifbin0 -> 254 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.ui/icons/sample.gifbin0 -> 983 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.ui/icons/sort_by_activation.gifbin0 -> 339 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.ui/icons/sort_by_activationtime.gifbin0 -> 399 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.ui/icons/sort_by_instantiation.gifbin0 -> 615 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.ui/icons/sort_by_name.gifbin0 -> 157 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.ui/icons/team_act.gifbin0 -> 990 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.ui/icons/team_act_implicit.gifbin0 -> 616 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.ui/icons/team_inact.gifbin0 -> 163 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.ui/icons/tm.gifbin0 -> 1072 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.ui/plugin.xml60
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/OTDebugImages.java86
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/OTDebugUIPlugin.java157
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/BreakpointMessages.java36
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/BreakpointMessages.properties2
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/CopyInheritanceBreakpointManager.java426
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/OTDebugElementAdapterFactory.java94
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/actions/ActionMessages.java41
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/actions/ActionMessages.properties7
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/actions/ChangeTeamActivationAction.java176
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/actions/OTBreakpointLocationVerifierJob.java306
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/actions/OTToggleBreakpointAdapter.java1243
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/actions/OTValidBreakpointLocationLocator.java1153
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/actions/SortTeamAction.java89
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/actions/UpdateTeamViewAction.java51
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/model/OTDebugElementsContainerContentProvider.java78
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/model/OTDebugElementsContainerLabelProvider.java40
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/model/OTDefaultModelProxyFactory.java48
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/model/OTDefaultVariableViewModelProxy.java90
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/model/OTVariableColumnFactoryAdapter.java64
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/model/TeamInstanceContentProvider.java41
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/model/TeamInstanceLabelProvider.java99
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/preferences/OTDebugPreferencePage.java214
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/preferences/OTDebugPreferences.java160
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/preferences/OTDebugPreferencesMessages.java45
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/preferences/OTDebugPreferencesMessages.properties11
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/views/TeamView.java286
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/views/TeamViewMessages.java52
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/views/TeamViewMessages.properties28
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug/.classpath7
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug/.cvsignore1
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug/.project28
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug/.settings/org.eclipse.jdt.core.prefs57
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug/META-INF/MANIFEST.MF19
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug/build.properties8
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug/scripts/genIOOTBreakPoints.launch12
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug/scripts/genIOOTBreakPoints.sh86
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/IOTDTDebugPreferenceConstants.java33
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/IOTDebugEventListener.java34
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/IOTLaunchConstants.java43
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/OTDebugElementsContainer.java228
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/OTDebugPlugin.java370
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/OTLaunchConfigMigrationDelegate.java89
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/OTVMRunnerAdaptor.java258
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/TeamBreakpointInstaller.java117
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/TeamInstance.java192
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/TeamThread.java48
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/core/breakpoints/IOOTBreakPoints.java38
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/core/breakpoints/OOTBreakpoints.java213
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/core/breakpoints/OTJavaWatchpoint.java143
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/internal/Logger.java57
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/internal/OTDebugElementsContainerFactory.java81
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/internal/RoleBreakpointListener.java84
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/internal/StepFromLinenumberGenerator.java196
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/internal/TeamBreakpointListener.java196
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/internal/TempFileManager.java83
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/internal/util/TeamActivationOrderComparator.java45
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/internal/util/TeamActivationTimeComparator.java45
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/internal/util/TeamInstantiantionComparator.java45
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/internal/util/TeamNameComparator.java49
-rw-r--r--plugins/org.eclipse.objectteams.otdt.jdt.ui/.classpath8
-rw-r--r--plugins/org.eclipse.objectteams.otdt.jdt.ui/.project29
-rw-r--r--plugins/org.eclipse.objectteams.otdt.jdt.ui/.settings/org.eclipse.jdt.core.prefs17
-rw-r--r--plugins/org.eclipse.objectteams.otdt.jdt.ui/META-INF/MANIFEST.MF30
-rw-r--r--plugins/org.eclipse.objectteams.otdt.jdt.ui/build.properties5
-rw-r--r--plugins/org.eclipse.objectteams.otdt.jdt.ui/plugin.properties2
-rw-r--r--plugins/org.eclipse.objectteams.otdt.jdt.ui/plugin.xml185
-rw-r--r--plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/corext/BindingHierarchyAdaptor.java52
-rw-r--r--plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/corext/CallHierarchyAdaptor.java355
-rw-r--r--plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/corext/CodeManipulationAdaptor.java223
-rw-r--r--plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/corext/DOMAdaptor.java55
-rw-r--r--plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/corext/RoleFileAdaptor.java128
-rw-r--r--plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/Messages.java50
-rw-r--r--plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/Messages.properties16
-rw-r--r--plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/assist/BaseImportRewriting.java283
-rw-r--r--plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/assist/CompletionAdaptor.java694
-rw-r--r--plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/assist/CompletionAdaptor/CallinRHSCompletionProposal.java145
-rw-r--r--plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/assist/CompletionAdaptor/CalloutToFieldCompletionProposal.java104
-rw-r--r--plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/assist/CompletionAdaptor/CreateMethodMappingCompletionProposal.java237
-rw-r--r--plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/assist/CompletionAdaptor/MethodMappingCompletionProposal.java171
-rw-r--r--plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/assist/CompletionAdaptor/MethodSpecCompletionProposal.java83
-rw-r--r--plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/assist/CompletionAdaptor/StubUtility2.java382
-rw-r--r--plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/assist/CorrectionAdaptor.java206
-rw-r--r--plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/assist/LinkedModeAdaptor.java74
-rw-r--r--plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/assist/OTQuickFixes.java500
-rw-r--r--plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/assist/QuickFixCoreAdaptor.java123
-rw-r--r--plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/javaeditor/AnnotationAdaptor.java87
-rw-r--r--plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/javaeditor/HighlightingAdaptor.java74
-rw-r--r--plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/javaeditor/JavaEditorAdaptor.java148
-rw-r--r--plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/javaeditor/JavaOutlinePageAdaptor.java53
-rw-r--r--plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/packageview/OTLayoutActionGroup.java100
-rw-r--r--plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/packageview/PackageExplorerAdaptor.java389
-rw-r--r--plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/packageview/PackageExplorerAdaptor/ContentProvider.java275
-rw-r--r--plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/search/FindActionAdaptor.java68
-rw-r--r--plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/search/SearchAdaptor.java46
-rw-r--r--plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/text/OutlineAdaptor.java139
-rw-r--r--plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/text/correction/ChangeModifierProposalSubProcessor.java265
-rw-r--r--plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/text/correction/CorrectionMessages.java76
-rw-r--r--plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/text/correction/CorrectionMessages.properties44
-rw-r--r--plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/text/correction/JavadocProposalSubProcessor.java73
-rw-r--r--plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/text/correction/MappingProposalSubProcessor.java602
-rw-r--r--plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/text/correction/PrecedenceProposalSubProcessor.java359
-rw-r--r--plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/text/correction/QuickFixProcessor.java506
-rw-r--r--plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/text/correction/StringLinkedModeProposal.java110
-rw-r--r--plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/text/correction/TypeProposalSubProcessor.java405
-rw-r--r--plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/typehierarchy/TypeHierarchyViewAdaptor.java347
-rw-r--r--plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/util/HierarchyUtilAdaptor.java124
-rw-r--r--plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/util/Images.java39
-rw-r--r--plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/viewsupport/DecoratorManagerAdaptor.java79
-rw-r--r--plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/viewsupport/DummyDecorator.java53
-rw-r--r--plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/viewsupport/JFaceDecapsulator.java42
-rw-r--r--plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/viewsupport/JavaElementAdaptation.java50
-rw-r--r--plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/viewsupport/PretendAllRoleFilesArePublic.java59
-rw-r--r--plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/viewsupport/TeamPackageUtil.java72
-rw-r--r--plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/viewsupport/ViewAdaptor.java550
-rw-r--r--plugins/org.eclipse.objectteams.otdt.pde.ui/.classpath8
-rw-r--r--plugins/org.eclipse.objectteams.otdt.pde.ui/.project29
-rw-r--r--plugins/org.eclipse.objectteams.otdt.pde.ui/.settings/org.eclipse.jdt.core.prefs21
-rw-r--r--plugins/org.eclipse.objectteams.otdt.pde.ui/META-INF/MANIFEST.MF27
-rw-r--r--plugins/org.eclipse.objectteams.otdt.pde.ui/build.properties11
-rw-r--r--plugins/org.eclipse.objectteams.otdt.pde.ui/icons/ot/newotpprj_obj.gifbin0 -> 596 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.pde.ui/icons/ot/plugin_forcedExports.pngbin0 -> 515 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.pde.ui/icons/ot/wizard/newotpprj_wiz.pngbin0 -> 5781 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.pde.ui/plugin.properties5
-rw-r--r--plugins/org.eclipse.objectteams.otdt.pde.ui/plugin.xml122
-rw-r--r--plugins/org.eclipse.objectteams.otdt.pde.ui/src/org/eclipse/objectteams/otdt/internal/pde/ui/ApiToolsAdapter.java38
-rw-r--r--plugins/org.eclipse.objectteams.otdt.pde.ui/src/org/eclipse/objectteams/otdt/internal/pde/ui/AspectBindingsTreeNode.java128
-rw-r--r--plugins/org.eclipse.objectteams.otdt.pde.ui/src/org/eclipse/objectteams/otdt/internal/pde/ui/ClasspathComputerAdapter.java89
-rw-r--r--plugins/org.eclipse.objectteams.otdt.pde.ui/src/org/eclipse/objectteams/otdt/internal/pde/ui/ExtensionEditorAdaptor.java354
-rw-r--r--plugins/org.eclipse.objectteams.otdt.pde.ui/src/org/eclipse/objectteams/otdt/internal/pde/ui/ImageManager.java59
-rw-r--r--plugins/org.eclipse.objectteams.otdt.pde.ui/src/org/eclipse/objectteams/otdt/internal/pde/ui/OTEquinoxCommonLaunching.java83
-rw-r--r--plugins/org.eclipse.objectteams.otdt.pde.ui/src/org/eclipse/objectteams/otdt/internal/pde/ui/OTNewPluginProjectWizard.java88
-rw-r--r--plugins/org.eclipse.objectteams.otdt.pde.ui/src/org/eclipse/objectteams/otdt/internal/pde/ui/OTPDEUIMessages.java40
-rw-r--r--plugins/org.eclipse.objectteams.otdt.pde.ui/src/org/eclipse/objectteams/otdt/internal/pde/ui/OTPDEUIMessages.properties10
-rw-r--r--plugins/org.eclipse.objectteams.otdt.pde.ui/src/org/eclipse/objectteams/otdt/internal/pde/ui/OTPDEUIPlugin.java88
-rw-r--r--plugins/org.eclipse.objectteams.otdt.pde.ui/src/org/eclipse/objectteams/otdt/internal/pde/ui/OTPluginDependenciesAdapter.java69
-rw-r--r--plugins/org.eclipse.objectteams.otdt.pde.ui/src/org/eclipse/objectteams/otdt/internal/pde/ui/OTPluginProject.java70
-rw-r--r--plugins/org.eclipse.objectteams.otdt.pde.ui/src/org/eclipse/objectteams/otdt/internal/pde/ui/PackageExplorerAdaptor.java399
-rw-r--r--plugins/org.eclipse.objectteams.otdt.pde.ui/src/org/eclipse/objectteams/otdt/internal/pde/ui/ToggleOTSupportAction.java136
-rw-r--r--plugins/org.eclipse.objectteams.otdt.pde.ui/src/org/eclipse/objectteams/otdt/internal/pde/validation/BundleValidation.java202
-rw-r--r--plugins/org.eclipse.objectteams.otdt.refactoring/.classpath8
-rw-r--r--plugins/org.eclipse.objectteams.otdt.refactoring/.project19
-rw-r--r--plugins/org.eclipse.objectteams.otdt.refactoring/.settings/org.eclipse.jdt.core.prefs16
-rw-r--r--plugins/org.eclipse.objectteams.otdt.refactoring/META-INF/MANIFEST.MF27
-rw-r--r--plugins/org.eclipse.objectteams.otdt.refactoring/build.properties6
-rw-r--r--plugins/org.eclipse.objectteams.otdt.refactoring/plugin.properties13
-rw-r--r--plugins/org.eclipse.objectteams.otdt.refactoring/plugin.xml150
-rw-r--r--plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/OTRefactoringPlugin.java33
-rw-r--r--plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/adaptor/ActionGroupAdaptor.java144
-rw-r--r--plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/adaptor/CorextAdaptor.java228
-rw-r--r--plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/adaptor/MoveAdaptor.java76
-rw-r--r--plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/adaptor/MoveInstanceMethodAdaptor.java69
-rw-r--r--plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/adaptor/NotSuppoertedRefactoringAdaptor.java125
-rw-r--r--plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/adaptor/PhantomTypeAdaptor.java41
-rw-r--r--plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/adaptor/RenameAdaptor.java339
-rw-r--r--plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/adaptor/RenameTypeAdaptor.java730
-rw-r--r--plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/adaptor/ReorgAdaptor.java199
-rw-r--r--plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/adaptor/ReorgAdaptor/OTASTNodeSearchUtil.java113
-rw-r--r--plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/adaptor/extractmethod/ExtractMethodAmbuguityMsgCreator.java17
-rw-r--r--plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/adaptor/extractmethod/ExtractMethodOverloadingMsgCreator.java17
-rw-r--r--plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/adaptor/pullup/OTTypeHierarchyAdaptor.java35
-rw-r--r--plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/adaptor/pullup/PullUpAdaptor.java548
-rw-r--r--plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/adaptor/pushdown/PushDownAdaptor.java408
-rw-r--r--plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/adaptor/rename/RenameMethodAmbuguityMsgCreator.java16
-rw-r--r--plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/adaptor/rename/RenameMethodOverloadingMsgCreator.java16
-rw-r--r--plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/corext/OTRefactoringCoreMessages.java80
-rw-r--r--plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/corext/base/OTRefactoringStatusCodes.java48
-rw-r--r--plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/corext/refactoring.properties79
-rw-r--r--plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/corext/rename/BaseCallFinder.java50
-rw-r--r--plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/corext/rename/RippleMethodFinder.java242
-rw-r--r--plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/corext/rename/RolePartsUnifier.java50
-rw-r--r--plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/otrefactorings/AbstractCallinRefactoringAction.java166
-rw-r--r--plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/otrefactorings/SelectionActionCommon.java102
-rw-r--r--plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/otrefactorings/extractcallin/ExtractCallinAction.java74
-rw-r--r--plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/otrefactorings/extractcallin/ExtractCallinInputPage.java247
-rw-r--r--plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/otrefactorings/extractcallin/ExtractCallinRefactoring.java774
-rw-r--r--plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/otrefactorings/extractcallin/ExtractCallinWizard.java16
-rw-r--r--plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/otrefactorings/inlinecallin/CallinBaseMethodInfo.java38
-rw-r--r--plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/otrefactorings/inlinecallin/InlineCallinAction.java95
-rw-r--r--plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/otrefactorings/inlinecallin/InlineCallinInputPage.java294
-rw-r--r--plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/otrefactorings/inlinecallin/InlineCallinRefactoring.java1550
-rw-r--r--plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/otrefactorings/inlinecallin/InlineCallinWizard.java16
-rw-r--r--plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/util/IAmbuguityMessageCreator.java19
-rw-r--r--plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/util/IOverloadingMessageCreator.java19
-rw-r--r--plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/util/ITeamConstants.java66
-rw-r--r--plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/util/RefactoringUtil.java1392
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/.classpath8
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/.project29
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/META-INF/MANIFEST.MF27
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/build.properties14
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/css/samples.css17
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/css/swt.properties27
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/ctool/overview48.gifbin0 -> 2397 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/ctool/overview48sel.gifbin0 -> 2573 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/ctool/overview72.gifbin0 -> 3675 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/ctool/samples48.gifbin0 -> 2749 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/ctool/samples48sel.gifbin0 -> 2954 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/ctool/samples72.gifbin0 -> 4569 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/ctool/tutorials48.gifbin0 -> 2413 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/ctool/tutorials48sel.gifbin0 -> 2525 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/ctool/tutorials72.gifbin0 -> 3684 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/ctool/wb48.gifbin0 -> 1754 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/ctool/whatsnew48.gifbin0 -> 2145 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/ctool/whatsnew48sel.gifbin0 -> 2359 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/ctool/whatsnew72.gifbin0 -> 3322 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/dtool/back.gifbin0 -> 827 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/dtool/forward.gifbin0 -> 822 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/etool/back.gifbin0 -> 1264 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/etool/forward.gifbin0 -> 1261 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/etool/overview48.gifbin0 -> 2212 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/etool/overview48sel.gifbin0 -> 2764 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/etool/overview72.gifbin0 -> 3490 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/etool/samples48.gifbin0 -> 2636 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/etool/samples48sel.gifbin0 -> 3099 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/etool/samples72.gifbin0 -> 4455 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/etool/tutorials48.gifbin0 -> 2219 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/etool/tutorials48sel.gifbin0 -> 2654 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/etool/tutorials72.gifbin0 -> 3449 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/etool/wb48.gifbin0 -> 1511 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/etool/whatsnew48.gifbin0 -> 1925 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/etool/whatsnew48sel.gifbin0 -> 2580 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/etool/whatsnew72.gifbin0 -> 2940 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/newprj_wiz.gifbin0 -> 356 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/community_obj.gifbin0 -> 1921 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/communityhov_obj.gifbin0 -> 2153 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/features_obj.gifbin0 -> 1922 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/featureshov_obj.gifbin0 -> 2131 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/javaapp_obj.gifbin0 -> 1607 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/javaapphov_obj.gifbin0 -> 1800 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/javaapplet_obj.gifbin0 -> 1696 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/javaapplethov_obj.gifbin0 -> 1899 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/javadev_obj.gifbin0 -> 2117 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/javadevhov_obj.gifbin0 -> 2330 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/migrate_obj.gifbin0 -> 1719 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/migratehov_obj.gifbin0 -> 1954 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/new_obj.gifbin0 -> 1814 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/newhov_obj.gifbin0 -> 2045 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/plugin_obj.gifbin0 -> 1390 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/pluginhov_obj.gifbin0 -> 1609 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/rcpapp_obj.gifbin0 -> 1677 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/rcpapphov_obj.gifbin0 -> 1883 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/samplepurp_obj.gifbin0 -> 2259 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/samplepurphov_obj.gifbin0 -> 2472 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/samplered_obj.gifbin0 -> 2264 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/sampleredhov_obj.gifbin0 -> 2476 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/script_obj.gifbin0 -> 1794 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/scripthov_obj.gifbin0 -> 2027 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/swtapp_obj.gifbin0 -> 1450 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/swtapphov_obj.gifbin0 -> 1634 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/teamsup_obj.gifbin0 -> 1954 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/teamsuphov_obj.gifbin0 -> 2185 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/updates_obj.gifbin0 -> 1733 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/updateshov_obj.gifbin0 -> 1953 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/wbbasics_obj.gifbin0 -> 1626 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/wbbasicshov_obj.gifbin0 -> 1858 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/community_obj.gifbin0 -> 1921 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/communityhov_obj.gifbin0 -> 2153 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/features_obj.gifbin0 -> 1922 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/featureshov_obj.gifbin0 -> 2131 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/javaapp_obj.gifbin0 -> 1607 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/javaapphov_obj.gifbin0 -> 1800 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/javaapplet_obj.gifbin0 -> 1696 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/javaapplethov_obj.gifbin0 -> 1899 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/javadev_obj.gifbin0 -> 2117 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/javadevhov_obj.gifbin0 -> 2330 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/migrate_obj.gifbin0 -> 1719 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/migratehov_obj.gifbin0 -> 1954 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/new_obj.gifbin0 -> 1814 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/newhov_obj.gifbin0 -> 2045 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/plugin_obj.gifbin0 -> 1390 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/pluginhov_obj.gifbin0 -> 1609 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/rcpapp_obj.gifbin0 -> 1677 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/rcpapphov_obj.gifbin0 -> 1883 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/samplepurp_obj.gifbin0 -> 2259 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/samplepurphov_obj.gifbin0 -> 2472 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/samplered_obj.gifbin0 -> 2264 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/sampleredhov_obj.gifbin0 -> 2476 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/script_obj.gifbin0 -> 1794 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/scripthov_obj.gifbin0 -> 2027 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/swtapp_obj.gifbin0 -> 1450 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/swtapphov_obj.gifbin0 -> 1634 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/teamsup_obj.gifbin0 -> 1954 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/teamsuphov_obj.gifbin0 -> 2185 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/updates_obj.gifbin0 -> 1733 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/updateshov_obj.gifbin0 -> 1953 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/wbbasics_obj.gifbin0 -> 1626 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/wbbasicshov_obj.gifbin0 -> 1858 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/intro/css/graphics/otapp_obj.gifbin0 -> 1914 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/intro/css/graphics/otapphov_obj.pngbin0 -> 2845 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/intro/css/graphics/sample.gifbin0 -> 1362 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/intro/css/graphics/sample_hov.gifbin0 -> 1553 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/intro/css/samples.css16
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/intro/css/swt-intro.properties21
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/intro/samplesExtension.xml66
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/intro/samplesExtensionContentOT.xml106
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/plugin.properties12
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/plugin.xml168
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/src/org/eclipse/objectteams/otdt/internal/samples/OTSamplesPlugin.java50
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/src/org/eclipse/objectteams/otdt/internal/samples/SampleMessages.java38
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/src/org/eclipse/objectteams/otdt/internal/samples/SampleMessages.properties2
-rw-r--r--plugins/org.eclipse.objectteams.otdt.samples/src/org/eclipse/objectteams/otdt/internal/samples/SamplesAdapter.java461
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/.classpath7
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/.cvsignore1
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/.project28
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/META-INF/MANIFEST.MF24
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/book.css1
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/build.properties44
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/buildDoc.xml108
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/cheatsheets/SimpleOTApplication.xml172
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/css/book.css1
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/css/graphics/obj_48/ot_obj.gifbin0 -> 1870 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/css/graphics/obj_48/othov_obj.gifbin0 -> 2048 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/css/graphics/obj_48/otjdev_obj.gifbin0 -> 2117 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/css/graphics/obj_48/otjdevhov_obj.gifbin0 -> 2330 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/css/ot-overview.properties37
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/css/overview.css75
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/css/root.css200
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/css/root_swt.properties29
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/css/shared.css217
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/css/swt.properties24
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/css/tutorials.css3
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/customBuildCallbacks.xml151
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/builder.html29
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/callhierarchy.html37
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/callinmarker.html65
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/compilation.html47
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/completion.html99
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/contentassist.html26
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/debugging.html40
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/develop.html61
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/editor.html62
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/features.html417
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/brkp_obj.gifbin0 -> 197 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/bundle_obj.gifbin0 -> 335 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/debugt_obj.gifbin0 -> 243 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/disconnect_co.gifbin0 -> 114 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/eclipse_launcher.gifbin0 -> 308 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/java_app.gifbin0 -> 376 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/java_attach.gifbin0 -> 583 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/julaunch.gifbin0 -> 207 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/julaunchpgn.gifbin0 -> 236 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/junit.gifbin0 -> 207 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/library_obj.gifbin0 -> 338 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/over_co.gifbin0 -> 131 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/AspectBindingsInPackageExplorer.pngbin0 -> 99029 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/CallHierarchy.pngbin0 -> 24823 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/CompareMenu.pngbin0 -> 80001 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/CompareWithBaseMethod.pngbin0 -> 99484 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/ForcedExports.pngbin0 -> 4914 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/JRETab.pngbin0 -> 64256 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/OSGiLaunchSettings.pngbin0 -> 93006 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/RemoteDebugging.pngbin0 -> 78691 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/RuntimeWorkbenchMainTab.pngbin0 -> 104903 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/addOTNature.pngbin0 -> 51810 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/callinMarker.jpgbin0 -> 12659 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/callinmarker-menu.pngbin0 -> 53920 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/callinmarker-menu3.pngbin0 -> 48480 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/callinmarkers.pngbin0 -> 63174 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/calloutmarker.pngbin0 -> 58437 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/complete_binding_1.pngbin0 -> 53914 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/complete_binding_2.pngbin0 -> 24226 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/complete_binding_3.pngbin0 -> 30465 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/completion1.pngbin0 -> 43354 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/debug_prefs_callin_stepping.pngbin0 -> 48842 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/debug_prefs_filtering.pngbin0 -> 49438 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/implicitRoleHierarchy.jpgbin0 -> 47806 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/langdef.pngbin0 -> 89790 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/launchConfig.jpgbin0 -> 59214 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/launchConfig.pngbin0 -> 59407 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/outline.jpgbin0 -> 17093 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/packageExplorer.jpgbin0 -> 22741 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/packageExplorer.pngbin0 -> 43285 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/packageExplorer_logical.pngbin0 -> 40990 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/perspective.jpgbin0 -> 2463 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/perspective.pngbin0 -> 5747 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/projectWizard.jpgbin0 -> 27895 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/roleWizard.jpgbin0 -> 68357 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/stack_entered_callin.pngbin0 -> 53229 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/stack_entered_earnCredit.pngbin0 -> 56055 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/stack_hit_callin.pngbin0 -> 60763 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/stack_lifting.pngbin0 -> 56897 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/teamWizard.jpgbin0 -> 55898 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/team_monitor_marked.pngbin0 -> 45960 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/typeHierarchy.jpgbin0 -> 11177 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/stepinto_co.gifbin0 -> 197 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/stepover_co.gifbin0 -> 211 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/stepreturn_co.gifbin0 -> 208 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/team_act.gifbin0 -> 990 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/team_act_implicit.gifbin0 -> 616 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/team_inact.gifbin0 -> 163 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/methodcompare.html42
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otguide.css2
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/css/ot.css468
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/css/ot.fix-ie6.css45
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/css/otjld.css291
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/css/heading_left.pngbin0 -> 2326 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/css/heading_right.pngbin0 -> 796 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/css/line.gifbin0 -> 319 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/css/otjld.css474
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/css/valid-xhtml11-blue.pngbin0 -> 2037 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/images/Layering.pngbin0 -> 9194 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/images/foo.pngbin0 -> 16999 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/images/guards.pngbin0 -> 58048 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/images/implicitly_overriding_playedby.pngbin0 -> 19123 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/images/implicitly_overriding_playedby_base.pngbin0 -> 21261 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/images/smart_lifting_small.pngbin0 -> 26494 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/images/team_nesting_hor.pngbin0 -> 1993 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/index.html127
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/s0.html179
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/s1.html1711
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/s2.html1868
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/s3.html973
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/s4.html1385
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/s5.html669
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/s6.html405
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/s7.html253
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/s8.html86
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/s9.html216
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/sA.html507
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/sB.html401
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/xhtml11-flat.dtd4615
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/Layering.pngbin0 -> 9194 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/WebHead1.pngbin0 -> 6920 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/WebHead2.pngbin0 -> 826 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/WebHeadBar.pngbin0 -> 182 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/arrow-left-trans.pngbin0 -> 479 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/arrow-right-trans.pngbin0 -> 593 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/arrow-right2-trans.pngbin0 -> 679 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/bend-trans.pngbin0 -> 661 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/bottom-left-small.pngbin0 -> 426 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/bottom-right-small.pngbin0 -> 411 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/button.down.gifbin0 -> 164 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/favicon.icobin0 -> 1150 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/feed.pngbin0 -> 787 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/guards.pngbin0 -> 58048 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/heading-left-small.pngbin0 -> 582 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/heading-left.pngbin0 -> 687 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/heading-right-small.pngbin0 -> 617 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/heading-right.pngbin0 -> 750 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/implicitly_overriding_playedby.pngbin0 -> 19123 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/implicitly_overriding_playedby_base.pngbin0 -> 21261 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/jira.pngbin0 -> 752 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/junit.gifbin0 -> 207 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/line.gifbin0 -> 319 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/linkto_help.gifbin0 -> 618 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/ot32.pngbin0 -> 1795 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/pass.gifbin0 -> 537 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/pdficon_small.gifbin0 -> 361 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/permalink.pngbin0 -> 197 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/smart_lifting_small.pngbin0 -> 26494 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/team_nesting_hor.pngbin0 -> 1993 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/trac_logo_16.pngbin0 -> 281 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/trac_logo_mini.pngbin0 -> 689 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/valid-css2-blue.pngbin0 -> 2075 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/valid-xhtml10-blue.pngbin0 -> 2026 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/css/heading_left.pngbin0 -> 2326 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/css/heading_right.pngbin0 -> 796 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/css/line.gifbin0 -> 319 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/css/otjld.css401
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/css/valid-xhtml11-blue.pngbin0 -> 2037 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/images/Layering.pngbin0 -> 9194 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/images/foo.pngbin0 -> 16999 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/images/guards.pngbin0 -> 58048 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/images/implicitly_overriding_playedby.pngbin0 -> 19123 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/images/implicitly_overriding_playedby_base.pngbin0 -> 21261 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/images/smart_lifting_small.pngbin0 -> 26494 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/images/team_nesting_hor.pngbin0 -> 1993 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/index.html127
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s0.1.html48
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s0.2.a.html43
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s0.2.b.html43
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s0.2.html96
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s0.3.html47
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s0.4.html55
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s0.5.html49
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s0.html181
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.1.html110
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.1.a.html45
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.1.b.html46
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.1.c.html45
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.1.d.html61
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.1.e.html64
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.1.f.html54
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.1.g.html55
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.1.html156
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.2.a.html43
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.2.b.html59
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.2.c.html48
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.2.d.html61
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.2.e.html47
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.2.f.html65
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.2.g.html68
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.2.h.html51
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.2.html367
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.2.i.html54
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.3.a.html41
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.3.b.html44
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.3.c.html47
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.3.d.html47
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.3.html83
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.4.a.html45
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.4.b.html45
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.4.c.html46
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.4.html69
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.5.a.html44
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.5.b.html45
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.5.c.html45
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.5.d.html44
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.5.e.html43
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.5.f.html45
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.5.html174
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.html742
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.1.a.html55
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.1.b.html49
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.1.c.html68
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.1.d.html47
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.1.e.html72
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.1.f.html69
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.1.g.html58
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.1.h.html47
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.1.html512
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.1.i.html56
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.1.j.html45
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.1.k.html67
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.2.a.html49
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.2.b.html50
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.2.c.html48
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.2.d.html45
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.2.e.html46
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.2.html97
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.html587
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.4.a.html44
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.4.b.html58
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.4.html71
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.5.a.html54
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.5.b.html56
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.5.c.html43
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.5.d.html46
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.5.e.html62
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.5.f.html53
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.5.html272
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.html1708
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.1.1.html52
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.1.2.a.html52
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.1.2.b.html53
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.1.2.c.html71
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.1.2.d.html82
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.1.2.e.html182
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.1.2.html305
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.1.a.html67
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.1.b.html47
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.1.c.html50
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.1.d.html50
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.1.e.html47
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.1.f.html56
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.1.html420
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.2.a.html44
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.2.b.html141
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.2.c.html44
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.2.d.html89
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.2.e.html49
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.2.f.html46
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.2.html235
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.1.a.html53
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.1.b.html57
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.1.c.html50
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.1.html94
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.2.a.html60
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.2.b.html46
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.2.c.html48
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.2.d.html55
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.2.e.html65
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.2.html197
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.3.a.html55
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.3.b.html53
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.3.c.html49
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.3.d.html44
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.3.html175
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.4.a.html101
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.4.b.html90
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.4.c.html97
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.4.d.html123
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.4.html308
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.a.html49
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.b.html54
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.c.html46
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.d.html48
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.html727
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.4.1.a.html45
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.4.1.b.html45
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.4.1.c.html53
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.4.1.html77
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.4.2.a.html44
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.4.2.b.html55
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.4.2.c.html75
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.4.2.html134
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.4.3.html123
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.4.html267
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.5.a.html62
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.5.b.html70
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.5.html103
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.6.a.html81
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.6.b.html47
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.6.c.html45
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.6.d.html48
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.6.e.html47
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.6.f.html44
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.6.g.html50
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.6.html151
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.7.a.html44
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.7.b.html44
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.7.c.html60
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.7.d.html84
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.7.html129
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.html1864
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.1.a.html44
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.1.b.html80
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.1.c.html85
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.1.d.html45
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.1.e.html51
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.1.f.html44
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.1.g.html44
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.1.h.html45
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.1.html282
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.1.i.html56
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.1.j.html68
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.1.k.html67
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.2.a.html45
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.2.b.html46
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.2.c.html72
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.2.d.html59
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.2.e.html65
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.2.html308
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.3.a.html44
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.3.b.html46
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.3.c.html47
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.3.d.html61
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.3.e.html46
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.3.html102
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.4.a.html48
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.4.b.html45
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.4.c.html63
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.4.d.html108
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.4.html177
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.5.a.html69
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.5.b.html52
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.5.c.html68
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.5.d.html45
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.5.e.html53
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.5.f.html55
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.5.g.html47
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.5.h.html78
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.5.html214
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.html972
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.1.a.html44
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.1.b.html48
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.1.c.html58
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.1.d.html51
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.1.e.html50
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.1.f.html46
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.1.g.html44
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.1.h.html44
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.1.html131
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.10.a.html51
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.10.b.html45
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.10.c.html48
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.10.d.html47
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.10.e.html96
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.10.html248
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.2.a.html45
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.2.b.html87
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.2.c.html46
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.2.d.html70
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.2.html140
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.3.a.html47
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.3.b.html52
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.3.c.html46
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.3.d.html49
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.3.e.html58
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.3.f.html58
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.3.html201
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.4.a.html53
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.4.b.html80
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.4.c.html52
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.4.d.html47
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.4.html123
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.5.a.html50
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.5.b.html44
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.5.c.html44
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.5.d.html76
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.5.e.html46
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.5.f.html44
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.5.html128
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.6.a.html54
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.6.html73
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.7.a.html44
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.7.b.html45
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.7.c.html44
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.7.d.html44
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.7.e.html66
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.7.html128
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.8.a.html47
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.8.b.html52
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.8.c.html44
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.8.d.html46
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.8.e.html53
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.8.html173
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.9.1.a.html51
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.9.1.b.html48
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.9.1.html76
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.9.2.html48
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.9.3.a.html48
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.9.3.b.html53
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.9.3.c.html200
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.9.3.html255
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.9.html312
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.html1384
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.1.1.html45
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.1.2.html44
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.1.html64
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.2.a.html57
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.2.b.html53
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.2.c.html57
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.2.html96
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.3.a.html49
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.3.b.html47
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.3.c.html48
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.3.d.html58
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.3.html113
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.4.1.a.html69
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.4.1.b.html47
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.4.1.c.html61
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.4.1.d.html47
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.4.1.html130
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.4.2.a.html44
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.4.2.b.html56
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.4.2.c.html44
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.4.2.d.html49
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.4.2.e.html45
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.4.2.f.html45
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.4.2.html137
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.4.3.html130
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.4.a.html52
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.4.b.html45
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.4.c.html49
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.4.html376
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.5.html135
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.html669
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s6.1.a.html181
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s6.1.b.html60
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s6.1.c.html57
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s6.1.html230
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s6.2.a.html70
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s6.2.b.html51
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s6.2.c.html53
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s6.2.d.html83
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s6.2.e.html78
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s6.2.html190
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s6.html404
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s7.1.html65
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s7.2.a.html46
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s7.2.b.html50
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s7.2.html194
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s7.html255
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s8.1.html42
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s8.2.html40
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s8.3.html40
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s8.html88
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s9.1.a.html49
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s9.1.b.html45
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s9.1.c.html44
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s9.1.html68
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s9.2.1.a.html60
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s9.2.1.html83
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s9.2.2.a.html63
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s9.2.2.b.html44
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s9.2.2.html78
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s9.2.html133
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s9.3.a.html44
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s9.3.b.html45
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s9.3.html55
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s9.html217
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sA.0.1.html50
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sA.0.2.html45
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sA.0.3.html44
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sA.0.html74
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sA.1.html72
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sA.10.html56
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sA.2.html60
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sA.3.html131
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sA.4.html85
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sA.5.html91
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sA.6.html88
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sA.7.html65
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sA.8.html54
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sA.9.html66
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sA.html509
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sB.1.1.html68
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sB.1.2.html105
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sB.1.3.html90
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sB.1.html192
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sB.2.1.html94
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sB.2.2.html114
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sB.2.3.html81
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sB.2.html218
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sB.html387
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/xhtml11-flat.dtd4615
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xhtml1-strict.dtd978
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/outline.html28
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/packageexplorer.html103
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/perspective.html42
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/project.html51
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/quickfix.html65
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/refactoring.html32
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/running.html84
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/stepping.html149
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/syntaxhighlight.html18
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/teammonitor.html42
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/toc.xml52
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/typehierarchy.html61
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/views.html20
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/webindex.html56
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/guide/wizards.html89
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/icons/clcl16/nav_backward.gifbin0 -> 541 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/icons/clcl16/nav_forward.gifbin0 -> 541 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/icons/clcl16/nav_home.gifbin0 -> 595 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/icons/dlcl16/nav_backward.gifbin0 -> 317 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/icons/dlcl16/nav_forward.gifbin0 -> 318 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/icons/dlcl16/nav_home.gifbin0 -> 358 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/icons/elcl16/nav_backward.gifbin0 -> 541 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/icons/elcl16/nav_forward.gifbin0 -> 541 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/icons/elcl16/nav_home.gifbin0 -> 595 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/icons/ot_paragraph.gifbin0 -> 604 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/icons/sample.gifbin0 -> 983 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/images/baseguard_obj.gifbin0 -> 96 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/images/boundrole_co.gifbin0 -> 73 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/images/built-on-eclipse.gifbin0 -> 6752 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/images/callinbinding_obj.gifbin0 -> 91 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/images/callinbindingafter_obj.gifbin0 -> 116 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/images/callinbindingbefore_obj.gifbin0 -> 117 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/images/callinbindingreplace_obj.gifbin0 -> 117 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/images/callinmethod_co.gifbin0 -> 155 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/images/callout_marker.gifbin0 -> 92 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/images/calloutbinding_obj.gifbin0 -> 117 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/images/class_hi.gifbin0 -> 242 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/images/class_public.gifbin0 -> 588 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/images/external_roles.gifbin0 -> 121 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/images/file_obj.gifbin0 -> 354 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/images/guard_obj.gifbin0 -> 95 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/images/heading_left.pngbin0 -> 2326 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/images/heading_right.pngbin0 -> 796 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/images/jar_src_obj.gifbin0 -> 596 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/images/jcu_obj.gifbin0 -> 570 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/images/line.rainbow.gifbin0 -> 319 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/images/newpprj_wiz.gifbin0 -> 596 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/images/newprj_wiz.gifbin0 -> 356 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/images/ot-eclipse.gifbin0 -> 323 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/images/ot_paragraph.gifbin0 -> 604 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/images/ot_paragraph.pngbin0 -> 856 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/images/ote_launch.gifbin0 -> 561 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/images/ote_osgi_launch.gifbin0 -> 588 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/images/otj_launch.gifbin0 -> 604 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/images/over_co_ovr16.gifbin0 -> 79 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/images/package.gifbin0 -> 227 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/images/playedBy_obj.gifbin0 -> 159 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/images/plugin_obj.gifbin0 -> 328 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/images/role_obj.gifbin0 -> 602 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/images/role_obj.pngbin0 -> 558 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/images/role_ovr.pngbin0 -> 192 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/images/run_exc.gifbin0 -> 379 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/images/team_act.gifbin0 -> 990 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/images/team_act_implicit.gifbin0 -> 616 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/images/team_inact.gifbin0 -> 163 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/images/team_obj.gifbin0 -> 163 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/images/team_ovr.gifbin0 -> 130 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/images/team_package.gifbin0 -> 109 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/images/team_role_obj.gifbin0 -> 186 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/images/team_role_ovr.gifbin0 -> 82 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/images/tm.gifbin0 -> 1072 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/intro/css/graphics/obj_48/ot_obj.gifbin0 -> 2654 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/intro/css/graphics/obj_48/otapp_obj.gifbin0 -> 1914 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/intro/css/graphics/obj_48/otapphov_obj.pngbin0 -> 2845 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/intro/css/graphics/obj_48/otdt_obj.pngbin0 -> 2960 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/intro/css/graphics/obj_48/otdthov_obj.pngbin0 -> 3345 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/intro/css/graphics/obj_48/othov_obj.gifbin0 -> 2812 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/intro/css/overview.css4
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/intro/css/swt-intro.properties26
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/intro/css/tutorials.css3
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/intro/overviewExtensionContent.xml20
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/intro/tutorialsExtensionContentOT.xml19
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/ot.html151
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/plugin.properties3
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/plugin.xml129
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/schema.css71
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/src/org/eclipse/objectteams/otdt/ui/help/OTHelpPlugin.java70
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/src/org/eclipse/objectteams/otdt/ui/help/OTJLDError.java184
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/src/org/eclipse/objectteams/otdt/ui/help/actions/OTJLDViewActionDelegate.java55
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/src/org/eclipse/objectteams/otdt/ui/help/actions/ShowOTJLDAction.java120
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui.help/src/org/eclipse/objectteams/otdt/ui/help/views/OTJLDView.java52
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/.classpath7
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/.cvsignore3
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/.project28
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/.settings/org.eclipse.jdt.core.prefs58
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/META-INF/MANIFEST.MF43
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/build.properties7
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/icons/jdt/full/ctool16/opentype.gifbin0 -> 236 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/icons/jdt/full/obj16/over_co.gifbin0 -> 131 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/icons/ot/baseguard_obj.gifbin0 -> 96 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/icons/ot/boundrole_co.gifbin0 -> 73 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/icons/ot/callinbinding_obj.gifbin0 -> 91 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/icons/ot/callinbindingafter_obj.gifbin0 -> 116 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/icons/ot/callinbindingbefore_obj.gifbin0 -> 117 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/icons/ot/callinbindingreplace_obj.gifbin0 -> 117 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/icons/ot/callinmethod_co.gifbin0 -> 79 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/icons/ot/callout_marker.gifbin0 -> 92 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/icons/ot/calloutbinding_obj.gifbin0 -> 117 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/icons/ot/default/hide_team_package.gifbin0 -> 170 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/icons/ot/disabled/hide_team_package.gifbin0 -> 170 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/icons/ot/guard_obj.gifbin0 -> 95 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/icons/ot/hover/hide_team_package.gifbin0 -> 121 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/icons/ot/jcu_obj.gifbin0 -> 157 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/icons/ot/newrole_obj.pngbin0 -> 589 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/icons/ot/newteam_obj.gifbin0 -> 372 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/icons/ot/ot.pngbin0 -> 850 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/icons/ot/ot_bare_10.pngbin0 -> 329 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/icons/ot/playedBy_obj.gifbin0 -> 159 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/icons/ot/role_obj.pngbin0 -> 558 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/icons/ot/role_ovr.pngbin0 -> 192 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/icons/ot/role_protected_obj.pngbin0 -> 608 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gifbin0 -> 384 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/icons/ot/team_ovr.gifbin0 -> 130 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/icons/ot/team_role_obj.gifbin0 -> 389 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/icons/ot/team_role_ovr.gifbin0 -> 82 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/icons/ot/team_role_protected_obj.gifbin0 -> 610 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/icons/ot/wizard/newotjprj_wiz.pngbin0 -> 4866 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/icons/ot/wizard/newprj_wiz.gifbin0 -> 356 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/icons/ot/wizard/newrole_wiz.pngbin0 -> 5230 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/icons/ot/wizard/newteam_wiz.pngbin0 -> 4040 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/plugin.properties39
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/plugin.xml472
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/OTDTUIMessages.java37
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/OTDTUIMessages.properties26
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/OTElementAdapterFactory.java55
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/OTJavaPerspectiveFactory.java33
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/WorkbenchAdapter.java170
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/bindingeditor/AddTypeBindingDialog.java523
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/bindingeditor/BindingConfiguration.java1408
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/bindingeditor/BindingEditor.java721
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/bindingeditor/BindingEditorDialog.java210
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/bindingeditor/CallinMappingConfiguration.java447
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/bindingeditor/CalloutMappingConfiguration.java436
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/bindingeditor/Messages.java68
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/bindingeditor/Messages.properties27
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/bindingeditor/RadioButtonComposite.java154
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/callinmarkers/AbstractMarkable.java238
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/callinmarkers/AnnotationHelper.java114
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/callinmarkers/CallinMarker.java119
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/callinmarkers/CallinMarkerCreator2.java785
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/callinmarkers/CallinMarkerJob.java82
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/callinmarkers/CallinMarkerRemover.java106
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/callinmarkers/JavaElementMarkable.java110
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/callinmarkers/JobListener.java62
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/callinmarkers/MySubProgressMonitor.java45
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/callinmarkers/ResourceMarkable.java103
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/callinmarkers/RoleBindingChangedListener.java153
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/compare/BaseMethodCompareElement.java133
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/compare/CompareBoundMethodsEditorInput.java301
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/compare/RoleMethodNode.java262
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/javaeditor/OTJavaEditorMessages.java41
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/javaeditor/OTJavaEditorMessages.properties4
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/javaeditor/RoleOverrideIndicatorManager.java239
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/preferences/CompilerConfigurationBlock.java382
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/preferences/GeneralPreferences.java37
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/preferences/OTCompilerPreferencePage.java165
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/preferences/OTGeneralPreferencePage.java99
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/preferences/OTPreferencesMessages.java78
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/preferences/OTPreferencesMessages.properties52
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/templates/ParameterMappingTemplateResolver.java112
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/NewRoleCreationWizard.java107
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/NewRoleWizardPage.java273
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/NewTeamCreationWizard.java110
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/NewTeamWizardPage.java156
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/NewTypeCreationWizard.java148
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/NewTypeWizardPage.java1418
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/OTNewProjectWizard.java188
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/OTNewWizardMessages.java102
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/OTNewWizardMessages.properties68
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/OpenOTProjectWizardAction.java48
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/OpenRoleWizardAction.java52
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/OpenTeamWizardAction.java52
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/listeners/NewRoleWizardPageListener.java379
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/listeners/NewTeamWizardPageListener.java256
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/listeners/NewTypeWizardPageListener.java908
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/listeners/SuperInterfacesListener.java84
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/typecreation/RoleCreator.java99
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/typecreation/RoleTypeInfo.java65
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/typecreation/TeamCreator.java58
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/typecreation/TypeCreator.java992
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/typecreation/TypeInfo.java193
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/ui/ImageConstants.java73
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/ui/ImageManager.java172
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/ui/JavaEditorActivationListener.java157
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/ui/OTDTUIPlugin.java213
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/ui/OTDTUIPluginConstants.java45
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/ui/OTPluginResources.properties86
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/ui/UpdateRulerAction.java301
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/ui/Util.java178
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/ui/dialogs/ISearchFilter.java39
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/ui/dialogs/OTTypeSelectionLabelProvider.java76
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/ui/dialogs/TeamSelectionDialog.java339
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/ui/handlers/CompareWithBaseMethodHandler.java245
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/ui/handlers/OpenBindingEditorHandler.java98
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/templates/OT-templates.properties3
-rw-r--r--plugins/org.eclipse.objectteams.otdt.ui/templates/OT-templates.xml25
-rw-r--r--plugins/org.eclipse.objectteams.otdt/.classpath7
-rw-r--r--plugins/org.eclipse.objectteams.otdt/.cvsignore4
-rw-r--r--plugins/org.eclipse.objectteams.otdt/.project28
-rw-r--r--plugins/org.eclipse.objectteams.otdt/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--plugins/org.eclipse.objectteams.otdt/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--plugins/org.eclipse.objectteams.otdt/META-INF/MANIFEST.MF18
-rw-r--r--plugins/org.eclipse.objectteams.otdt/META-INF/p2.inf12
-rw-r--r--plugins/org.eclipse.objectteams.otdt/OT-Icon_32x32.pngbin0 -> 1728 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt/OTDT_32x32.pngbin0 -> 1785 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt/OTlogo.gifbin0 -> 1182 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt/about.html28
-rw-r--r--plugins/org.eclipse.objectteams.otdt/about.ini12
-rw-r--r--plugins/org.eclipse.objectteams.otdt/build.properties14
-rw-r--r--plugins/org.eclipse.objectteams.otdt/lib/otre_min.jarbin0 -> 274 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt/plugin.properties2
-rw-r--r--plugins/org.eclipse.objectteams.otdt/plugin.xml68
-rw-r--r--plugins/org.eclipse.objectteams.otdt/splash.bmpbin0 -> 536954 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otdt/src/org/eclipse/objectteams/otdt/core/ext/OTCoreExtMessages.java38
-rw-r--r--plugins/org.eclipse.objectteams.otdt/src/org/eclipse/objectteams/otdt/core/ext/OTCoreExtMessages.properties2
-rw-r--r--plugins/org.eclipse.objectteams.otdt/src/org/eclipse/objectteams/otdt/core/ext/OTDTPlugin.java155
-rw-r--r--plugins/org.eclipse.objectteams.otdt/src/org/eclipse/objectteams/otdt/core/ext/OTJavaNature.java172
-rw-r--r--plugins/org.eclipse.objectteams.otdt/src/org/eclipse/objectteams/otdt/core/ext/OTREContainer.java151
-rw-r--r--plugins/org.eclipse.objectteams.otdt/src/org/eclipse/objectteams/otdt/core/ext/OTREContainerInitializer.java60
-rw-r--r--plugins/org.eclipse.objectteams.otdt/src/org/eclipse/objectteams/otdt/core/ext/OTRuntimeClasspathProvider.java123
-rw-r--r--plugins/org.eclipse.objectteams.otdt/src/org/eclipse/objectteams/otdt/core/ext/OTRuntimeVariableInitializer.java39
-rw-r--r--plugins/org.eclipse.objectteams.otdt/src/org/eclipse/objectteams/otdt/core/ext/OTVariableInitializer.java74
-rw-r--r--plugins/org.eclipse.objectteams.otequinox.branding/.classpath8
-rw-r--r--plugins/org.eclipse.objectteams.otequinox.branding/.project18
-rw-r--r--plugins/org.eclipse.objectteams.otequinox.branding/.settings/org.eclipse.jdt.core.prefs16
-rw-r--r--plugins/org.eclipse.objectteams.otequinox.branding/META-INF/MANIFEST.MF14
-rw-r--r--plugins/org.eclipse.objectteams.otequinox.branding/build.properties8
-rw-r--r--plugins/org.eclipse.objectteams.otequinox.branding/icons/signed_adapted.gifbin0 -> 365 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otequinox.branding/icons/unsigned_adapted.gifbin0 -> 581 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otequinox.branding/plugin.xml16
-rw-r--r--plugins/org.eclipse.objectteams.otequinox.branding/src/org/eclipse/objectteams/otequinox/branding/Activator.java98
-rw-r--r--plugins/org.eclipse.objectteams.otequinox.branding/src/org/eclipse/objectteams/otequinox/internal/branding/BrandingAdaptor.java103
-rw-r--r--plugins/org.eclipse.objectteams.otequinox.branding/src/org/eclipse/objectteams/otequinox/internal/branding/BrandingMessages.java33
-rw-r--r--plugins/org.eclipse.objectteams.otequinox.branding/src/org/eclipse/objectteams/otequinox/internal/branding/BrandingMessages.properties2
-rw-r--r--plugins/org.eclipse.objectteams.otequinox.hook/.classpath8
-rw-r--r--plugins/org.eclipse.objectteams.otequinox.hook/.project28
-rw-r--r--plugins/org.eclipse.objectteams.otequinox.hook/.settings/org.eclipse.jdt.core.prefs65
-rw-r--r--plugins/org.eclipse.objectteams.otequinox.hook/META-INF/MANIFEST.MF9
-rw-r--r--plugins/org.eclipse.objectteams.otequinox.hook/build.properties10
-rw-r--r--plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/hook/AspectPermission.java33
-rw-r--r--plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/hook/ClassScanner.java141
-rw-r--r--plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/hook/HookConfigurator.java127
-rw-r--r--plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/hook/IAspectRegistry.java66
-rw-r--r--plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/hook/IByteCodeAnalyzer.java32
-rw-r--r--plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/hook/ILogger.java39
-rw-r--r--plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/hook/IOTEquinoxService.java29
-rw-r--r--plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/hook/ITeamLoader.java62
-rw-r--r--plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/internal/hook/AspectBundleRole.java45
-rw-r--r--plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/internal/hook/BaseBundleRole.java197
-rw-r--r--plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/internal/hook/BundleRegistry.java98
-rw-r--r--plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/internal/hook/ByteCodeAnalyzer.java85
-rw-r--r--plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/internal/hook/Logger.java81
-rw-r--r--plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/internal/hook/OTEquinoxServiceWatcher.java127
-rw-r--r--plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/internal/hook/OTStorageHook.java390
-rw-r--r--plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/internal/hook/SafeAspectRegistry.java131
-rw-r--r--plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/internal/hook/TransformerHook.java654
-rw-r--r--plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/internal/hook/Util.java138
-rw-r--r--plugins/org.eclipse.objectteams.otequinox.runtime/.classpath4
-rw-r--r--plugins/org.eclipse.objectteams.otequinox.runtime/.project28
-rw-r--r--plugins/org.eclipse.objectteams.otequinox.runtime/META-INF/MANIFEST.MF10
-rw-r--r--plugins/org.eclipse.objectteams.otequinox.runtime/README.txt5
-rw-r--r--plugins/org.eclipse.objectteams.otequinox.runtime/build.properties8
-rw-r--r--plugins/org.eclipse.objectteams.otequinox.sunjvm/.project22
-rw-r--r--plugins/org.eclipse.objectteams.otequinox.sunjvm/META-INF/MANIFEST.MF9
-rw-r--r--plugins/org.eclipse.objectteams.otequinox.sunjvm/META-INF/p2.inf6
-rw-r--r--plugins/org.eclipse.objectteams.otequinox.sunjvm/build.properties1
-rw-r--r--plugins/org.eclipse.objectteams.otequinox/.classpath7
-rw-r--r--plugins/org.eclipse.objectteams.otequinox/.project28
-rw-r--r--plugins/org.eclipse.objectteams.otequinox/.settings/org.eclipse.jdt.core.prefs70
-rw-r--r--plugins/org.eclipse.objectteams.otequinox/META-INF/MANIFEST.MF18
-rw-r--r--plugins/org.eclipse.objectteams.otequinox/META-INF/p2.inf10
-rw-r--r--plugins/org.eclipse.objectteams.otequinox/about.ini14
-rw-r--r--plugins/org.eclipse.objectteams.otequinox/build.properties13
-rw-r--r--plugins/org.eclipse.objectteams.otequinox/ote_32n.pngbin0 -> 1733 bytes
-rw-r--r--plugins/org.eclipse.objectteams.otequinox/plugin.xml6
-rw-r--r--plugins/org.eclipse.objectteams.otequinox/schema/aspectBindingNegotiators.exsd145
-rw-r--r--plugins/org.eclipse.objectteams.otequinox/schema/aspectBindings.exsd278
-rw-r--r--plugins/org.eclipse.objectteams.otequinox/src/org/eclipse/objectteams/otequinox/ActivationKind.java32
-rw-r--r--plugins/org.eclipse.objectteams.otequinox/src/org/eclipse/objectteams/otequinox/AspectBindingRequestAnswer.java47
-rw-r--r--plugins/org.eclipse.objectteams.otequinox/src/org/eclipse/objectteams/otequinox/Constants.java61
-rw-r--r--plugins/org.eclipse.objectteams.otequinox/src/org/eclipse/objectteams/otequinox/IAspectRequestNegotiator.java49
-rw-r--r--plugins/org.eclipse.objectteams.otequinox/src/org/eclipse/objectteams/otequinox/TransformerPlugin.java565
-rw-r--r--plugins/org.eclipse.objectteams.otequinox/src/org/eclipse/objectteams/otequinox/internal/ASMByteCodeAnalyzer.java152
-rw-r--r--plugins/org.eclipse.objectteams.otequinox/src/org/eclipse/objectteams/otequinox/internal/AspectBinding.java64
-rw-r--r--plugins/org.eclipse.objectteams.otequinox/src/org/eclipse/objectteams/otequinox/internal/AspectPermissionManager.java616
-rw-r--r--plugins/org.eclipse.objectteams.otequinox/src/org/eclipse/objectteams/otequinox/internal/MasterTeamLoader.java292
1194 files changed, 119964 insertions, 0 deletions
diff --git a/plugins/org.eclipse.objectteams.eclipse.monitor/.classpath b/plugins/org.eclipse.objectteams.eclipse.monitor/.classpath
new file mode 100644
index 000000000..987380a81
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.eclipse.monitor/.classpath
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <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="con" path="OTRE"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/org.eclipse.objectteams.eclipse.monitor/.project b/plugins/org.eclipse.objectteams.eclipse.monitor/.project
new file mode 100644
index 000000000..81c3cebb8
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.eclipse.monitor/.project
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.objectteams.eclipse.monitor</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.objectteams.otdt.builder.OTJBuilder</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>org.objectteams.otdt.OTJavaNature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/org.eclipse.objectteams.eclipse.monitor/.settings/org.eclipse.core.resources.prefs b/plugins/org.eclipse.objectteams.eclipse.monitor/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 000000000..4fafd6347
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.eclipse.monitor/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,3 @@
+#Sun Apr 08 14:46:15 CEST 2007
+eclipse.preferences.version=1
+encoding//src/org/objectteams/eclipse/monitor/MonitorMessages.properties=8859_1
diff --git a/plugins/org.eclipse.objectteams.eclipse.monitor/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.objectteams.eclipse.monitor/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..12e9c3e2b
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.eclipse.monitor/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,12 @@
+#Thu Mar 12 15:22:18 CET 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.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.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/plugins/org.eclipse.objectteams.eclipse.monitor/META-INF/MANIFEST.MF b/plugins/org.eclipse.objectteams.eclipse.monitor/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..b9b7c48f6
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.eclipse.monitor/META-INF/MANIFEST.MF
@@ -0,0 +1,13 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: OT/Equinox Monitor Plug-in
+Bundle-SymbolicName: org.eclipse.objectteams.eclipse.monitor;singleton:=true
+Bundle-Version: 1.3.0.qualifier
+Bundle-Vendor: objectteams.org
+Bundle-Activator: org.eclipse.objectteams.eclipse.monitor.Activator
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.objectteams.otequinox
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/plugins/org.eclipse.objectteams.eclipse.monitor/build.properties b/plugins/org.eclipse.objectteams.eclipse.monitor/build.properties
new file mode 100644
index 000000000..0d3d3a745
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.eclipse.monitor/build.properties
@@ -0,0 +1,6 @@
+source.. = src/
+output.. = bin/
+bin.includes = plugin.xml,\
+ META-INF/,\
+ .,\
+ icons/
diff --git a/plugins/org.eclipse.objectteams.eclipse.monitor/icons/auto_refresh.png b/plugins/org.eclipse.objectteams.eclipse.monitor/icons/auto_refresh.png
new file mode 100644
index 000000000..1de43d56b
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.eclipse.monitor/icons/auto_refresh.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.eclipse.monitor/icons/monitor.png b/plugins/org.eclipse.objectteams.eclipse.monitor/icons/monitor.png
new file mode 100644
index 000000000..d9295e6fc
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.eclipse.monitor/icons/monitor.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.eclipse.monitor/icons/refresh_nav.gif b/plugins/org.eclipse.objectteams.eclipse.monitor/icons/refresh_nav.gif
new file mode 100644
index 000000000..3ca04d06f
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.eclipse.monitor/icons/refresh_nav.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.eclipse.monitor/icons/refresh_nav_dis.gif b/plugins/org.eclipse.objectteams.eclipse.monitor/icons/refresh_nav_dis.gif
new file mode 100644
index 000000000..478cff5fb
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.eclipse.monitor/icons/refresh_nav_dis.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.eclipse.monitor/plugin.xml b/plugins/org.eclipse.objectteams.eclipse.monitor/plugin.xml
new file mode 100644
index 000000000..b6780633e
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.eclipse.monitor/plugin.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+ <extension
+ point="org.eclipse.ui.views">
+ <category
+ name="Object Teams"
+ id="org.eclipse.objectteams.otdt.ui">
+ </category>
+ <view
+ name="OT/Equinox Monitor"
+ icon="icons/monitor.png"
+ category="org.eclipse.objectteams.otdt.ui"
+ class="org.eclipse.objectteams.eclipse.monitor.MonitorView"
+ id="org.eclipse.objectteams.eclipse.monitor.MonitorView">
+ <description>
+ Presentation of all teams instantiated by OT/Equinox.
+Allows to interactively (de)activate a selected team.
+ </description>
+ </view>
+ </extension>
+
+ <extension
+ point="org.eclipse.ui.perspectiveExtensions">
+ <perspectiveExtension
+ targetID="org.eclipse.ui.resourcePerspective">
+ <view
+ ratio="0.5"
+ relative="org.eclipse.ui.views.TaskList"
+ relationship="right"
+ id="org.eclipse.objectteams.eclipse.monitor.MonitorView">
+ </view>
+ </perspectiveExtension>
+ <perspectiveExtension
+ targetID="org.eclipse.objectteams.otdt.ui.OTJavaPerspective">
+ <viewShortcut
+ id="org.eclipse.objectteams.eclipse.monitor.MonitorView">
+ </viewShortcut>
+ </perspectiveExtension>
+ </extension>
+</plugin>
diff --git a/plugins/org.eclipse.objectteams.eclipse.monitor/src/org/eclipse/objectteams/eclipse/monitor/Activator.java b/plugins/org.eclipse.objectteams.eclipse.monitor/src/org/eclipse/objectteams/eclipse/monitor/Activator.java
new file mode 100644
index 000000000..b57463370
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.eclipse.monitor/src/org/eclipse/objectteams/eclipse/monitor/Activator.java
@@ -0,0 +1,82 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2005, 2006 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute and Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: Activator.java 23468 2010-02-04 22:34:27Z stephan $
+ *
+ * Please visit http://www.objectteams.org for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.eclipse.monitor;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ * (only used for access to local icons).
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.objectteams.eclipse.monitor"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Returns an image descriptor for the image file at the given
+ * plug-in relative path
+ *
+ * @param path the path
+ * @return the image descriptor
+ */
+ public static ImageDescriptor getImageDescriptor(String path) {
+ return imageDescriptorFromPlugin(PLUGIN_ID, path);
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.eclipse.monitor/src/org/eclipse/objectteams/eclipse/monitor/MonitorMessages.java b/plugins/org.eclipse.objectteams.eclipse.monitor/src/org/eclipse/objectteams/eclipse/monitor/MonitorMessages.java
new file mode 100644
index 000000000..61386d0be
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.eclipse.monitor/src/org/eclipse/objectteams/eclipse/monitor/MonitorMessages.java
@@ -0,0 +1,46 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2010 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: MonitorMessages.java 23462 2010-02-04 22:13:22Z stephan $
+ *
+ * Please visit http://www.objectteams.org for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.eclipse.monitor;
+
+import org.eclipse.osgi.util.NLS;
+
+public class MonitorMessages extends NLS {
+ private static final String BUNDLE_NAME = MonitorMessages.class.getName();
+
+ public static String button_text_refresh;
+ public static String button_tooltip_refresh;
+
+ public static String button_text_auto_refresh;
+ public static String button_tooltip_auto_refresh;
+
+ public static String job_name_refresh;
+
+ public static String heading_team_class;
+ public static String heading_num_roles;
+
+ public static String tooltip_not_computed;
+ public static String tooltip_roles_of;
+ public static String tooltip_no_roles;
+
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, MonitorMessages.class);
+ }
+
+ private MonitorMessages() {
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.eclipse.monitor/src/org/eclipse/objectteams/eclipse/monitor/MonitorMessages.properties b/plugins/org.eclipse.objectteams.eclipse.monitor/src/org/eclipse/objectteams/eclipse/monitor/MonitorMessages.properties
new file mode 100644
index 000000000..1fedab6c0
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.eclipse.monitor/src/org/eclipse/objectteams/eclipse/monitor/MonitorMessages.properties
@@ -0,0 +1,14 @@
+heading_team_class=Team class
+heading_num_roles=\# roles
+
+button_text_refresh=Refresh
+button_tooltip_refresh=Recompute all table data
+
+button_text_auto_refresh=Auto Refresh
+button_tooltip_auto_refresh=Periodically update the number of roles
+
+job_name_refresh=OT/Equinox Monitor Refresher
+
+tooltip_not_computed=no data computed, please select row to compute its details.
+tooltip_roles_of=Roles of
+tooltip_no_roles=No roles.
diff --git a/plugins/org.eclipse.objectteams.eclipse.monitor/src/org/eclipse/objectteams/eclipse/monitor/MonitorView.java b/plugins/org.eclipse.objectteams.eclipse.monitor/src/org/eclipse/objectteams/eclipse/monitor/MonitorView.java
new file mode 100644
index 000000000..e7b4854cc
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.eclipse.monitor/src/org/eclipse/objectteams/eclipse/monitor/MonitorView.java
@@ -0,0 +1,261 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2010 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: MonitorView.java 23462 2010-02-04 22:13:22Z stephan $
+ *
+ * Please visit http://www.objectteams.org for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.eclipse.monitor;
+
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map.Entry;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.action.Action;
+import org.eclipse.objectteams.otequinox.TransformerPlugin;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseTrackAdapter;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.swt.widgets.Widget;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.part.ViewPart;
+import org.objectteams.Team;
+
+// Copy&Paste: the GUI-stuff is partly inspired by the AboutPluginsDialog.
+public class MonitorView extends ViewPart {
+
+ private static final String IMG_AUTO_REFRESH = "icons/auto_refresh.png"; //$NON-NLS-1$
+ private static final String IMG_REFRESH = "icons/refresh_nav.gif"; //$NON-NLS-1$
+ private static final String IMG_REFRESH_DISABLED = "icons/refresh_nav_dis.gif"; //$NON-NLS-1$
+
+ /** The main widget: */
+ private Table table;
+ // actions:
+ private Action refreshAction;
+ private Action toggleAutoRefreshAction;
+ private boolean autoRefresh = true;
+
+ /** Stored texts for tooltips: */
+ private HashMap<Widget, String> hoverTexts = new HashMap<Widget, String>();
+
+ /**
+ * Setup the GUI.
+ */
+ public void createPartControl(Composite parent) {
+ table = new Table(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.CHECK);
+ table.setHeaderVisible(true);
+ table.setLinesVisible(true);
+ table.setFont(parent.getFont());
+
+
+ // create table headers
+ String[] columnTitles = { MonitorMessages.heading_team_class, MonitorMessages.heading_num_roles };
+ int [] columnWidths = { 500, 50 };
+ for (int i = 0; i < columnTitles.length; i++) {
+ TableColumn column = new TableColumn(table, SWT.NULL);
+ column.setWidth(columnWidths[i]);
+ column.setText(columnTitles[i]);
+ }
+
+ readTeams();
+
+ table.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ printDetails(e.item);
+ }
+ });
+ table.addMouseTrackListener(new MouseTrackAdapter() {
+ @Override
+ public void mouseHover(MouseEvent e) {
+ TableItem item = table.getItem(new Point(e.x, e.y));
+ String hoverText = hoverTexts.get(item);
+ if (hoverText != null)
+ table.setToolTipText(hoverText);
+ else
+ table.setToolTipText(MonitorMessages.tooltip_not_computed);
+ }
+ });
+
+ GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
+ table.setLayoutData(gridData);
+
+ final Display display = parent.getDisplay();
+ makeActions(display);
+ contributeToActionBars();
+ }
+
+ private void makeActions(final Display display) {
+ refreshAction = new Action() {
+ public void run() {
+ refreshAll();
+ }
+ };
+ refreshAction.setText(MonitorMessages.button_text_refresh);
+ refreshAction.setToolTipText(MonitorMessages.button_tooltip_refresh);
+ refreshAction.setDisabledImageDescriptor(Activator.getImageDescriptor(IMG_REFRESH_DISABLED));
+ refreshAction.setImageDescriptor(Activator.getImageDescriptor(IMG_REFRESH));
+
+ toggleAutoRefreshAction = new Action() {
+ public void run() {
+ autoRefresh = !autoRefresh;
+ if (autoRefresh)
+ startAutoRefreshJob(display);
+ }
+ };
+ toggleAutoRefreshAction.setChecked(true); // make this a checkbox.
+ toggleAutoRefreshAction.setText(MonitorMessages.button_text_auto_refresh);
+ toggleAutoRefreshAction.setToolTipText(MonitorMessages.button_tooltip_auto_refresh);
+ toggleAutoRefreshAction.setImageDescriptor(Activator.getImageDescriptor(IMG_AUTO_REFRESH));
+
+ startAutoRefreshJob(display); // on by default.
+ }
+
+ private void contributeToActionBars() {
+ IActionBars bars = getViewSite().getActionBars();
+ bars.getToolBarManager().add(refreshAction);
+ bars.getToolBarManager().add(toggleAutoRefreshAction);
+ }
+
+ /**
+ * Start a background job that will call back into the UI every second for refresh.
+ */
+ void startAutoRefreshJob(final Display display) {
+ Job job = new Job(MonitorMessages.job_name_refresh) {
+ protected IStatus run(IProgressMonitor monitor) {
+ // need asyncExec to call GUI code from a non-GUI thread:
+ display.asyncExec(new Runnable() {
+ public void run() {
+ refreshTableData();
+ }
+ });
+ if (autoRefresh)
+ this.schedule(1000); // keep going.
+ return Status.OK_STATUS;
+ }
+ };
+ job.setPriority(Job.SHORT);
+ job.schedule(1000);
+ }
+
+ /**
+ * Passing the focus request to the viewer's control.
+ */
+ public void setFocus() {
+ table.setFocus();
+ }
+
+ // ==== contents computations only below: ====
+
+ void readTeams() {
+ // fetch instantiated teams:
+ List<Team> teamList = new ArrayList<Team>();
+ TransformerPlugin.getTeamInstances(teamList);
+
+ // create rows and fill with data:
+ for (int i = 0; i < teamList.size(); ++i) {
+ Team aTeam = teamList.get(i);
+ TableItem item = new TableItem(table, SWT.NULL);
+ item.setData(aTeam);
+ item.setChecked(aTeam.isActive(Team.ALL_THREADS));
+ setupData(item);
+ }
+ }
+
+ void refreshAll() {
+ this.table.removeAll();
+ readTeams();
+ refreshTableData();
+ }
+
+ /** Set the texts from the contained Team instance. */
+ private boolean setupData(TableItem item) {
+ Team aTeam = (Team)item.getData();
+ item.setText(0, aTeam.getClass().getName());
+ String oldLength = item.getText(1);
+ String newLength = String.valueOf(aTeam.getAllRoles().length);
+ item.setText(1, newLength);
+ return oldLength == null || !oldLength.equals(newLength);
+ }
+
+ /** re-read the role statistics from all known teams
+ */
+ void refreshTableData() {
+ if (table.isDisposed()) {
+ autoRefresh = false;
+ return;
+ }
+ for(TableItem item : table.getItems()) {
+ if (setupData(item))
+ hoverTexts.remove(item);
+ }
+ }
+
+ /** Print to std out details about the selected team:
+ * How many roles of which class are registered?
+ * Also store these infos for display in tooltips.
+ */
+ void printDetails(Widget item) {
+ StringBuilder buf = new StringBuilder();
+
+ Team aTeam = (Team)item.getData();
+ String teamName = aTeam.getClass().getName();
+ buf.append(MonitorMessages.tooltip_roles_of+teamName);
+
+ Object[] allRoles = aTeam.getAllRoles();
+ if (allRoles.length == 0) {
+ buf.append('\n');
+ buf.append(MonitorMessages.tooltip_no_roles);
+ } else {
+ // sort roles by class:
+ HashMap<Class<?>, Integer> stats = new HashMap<Class<?>, Integer>();
+ for (Object aRole : allRoles) {
+ Integer i = stats.get(aRole.getClass());
+ if (i != null)
+ i = i+1;
+ else
+ i = 1;
+ stats.put(aRole.getClass(), i);
+ }
+ // append stats per class:
+ for (Entry<Class<?>, Integer> stat: stats.entrySet()) {
+ int prefixLen = teamName.length() + "$__OT__".length(); // single name for roles //$NON-NLS-1$
+ String roleName = stat.getKey().getName().substring(prefixLen);
+ buf.append("\n"+stat.getValue()+"\t"+roleName); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+ System.out.println(buf.toString());
+ hoverTexts.put(item, buf.toString());
+
+ boolean checked = ((TableItem)item).getChecked();
+ if (checked != aTeam.isActive(Team.ALL_THREADS)) {
+ if (checked)
+ aTeam.activate(Team.ALL_THREADS);
+ else
+ aTeam.deactivate(Team.ALL_THREADS);
+ }
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.apt/.classpath b/plugins/org.eclipse.objectteams.otdt.apt/.classpath
new file mode 100644
index 000000000..a44caa70a
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.apt/.classpath
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <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="src" path="src"/>
+ <classpathentry kind="con" path="OTRE"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/org.eclipse.objectteams.otdt.apt/.project b/plugins/org.eclipse.objectteams.otdt.apt/.project
new file mode 100644
index 000000000..5fe09fafc
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.apt/.project
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.objectteams.otdt.apt</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.objectteams.otdt.builder.OTJBuilder</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>org.objectteams.otdt.OTJavaNature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/org.eclipse.objectteams.otdt.apt/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.objectteams.otdt.apt/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..9eeb57139
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.apt/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,19 @@
+#Wed Mar 04 21:29:01 CET 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
+org.objectteams.otdt.compiler.option.joinpoint_queries=disabled
+org.objectteams.otdt.compiler.option.scoped_keywords=enabled
+org.objectteams.otdt.compiler.problem.abstract_potential_relevant_role=warning
+org.objectteams.otdt.compiler.problem.basecall=warning
+org.objectteams.otdt.compiler.problem.binding_conventions=warning
+org.objectteams.otdt.compiler.problem.decapsulation=warning
+org.objectteams.otdt.compiler.problem.deprecated_path_syntax=warning
+org.objectteams.otdt.compiler.problem.fragile_callin=warning
+org.objectteams.otdt.compiler.problem.inferred_callout=warning
+org.objectteams.otdt.compiler.problem.potential_ambiguous_playedby=warning
+org.objectteams.otdt.compiler.problem.unsafe_role_instantiation=warning
+org.objectteams.otdt.compiler.problem.weave_into_system_class=warning
diff --git a/plugins/org.eclipse.objectteams.otdt.apt/META-INF/MANIFEST.MF b/plugins/org.eclipse.objectteams.otdt.apt/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..9679f6b23
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.apt/META-INF/MANIFEST.MF
@@ -0,0 +1,11 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Adaptor for the JDT/APT
+Bundle-SymbolicName: org.eclipse.objectteams.otdt.apt;singleton:=true
+Bundle-Version: 1.4.0.qualifier
+Bundle-Vendor: objectteams.org
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Require-Bundle: org.eclipse.objectteams.otequinox;bundle-version="[1.2.6,2.0.0)",
+ org.eclipse.osgi;bundle-version="[3.4.2,4.0.0)",
+ org.eclipse.jdt.core;bundle-version="[3.5.0.v_OTDT_r130,4.0.0)"
+Bundle-ActivationPolicy: lazy
diff --git a/plugins/org.eclipse.objectteams.otdt.apt/build.properties b/plugins/org.eclipse.objectteams.otdt.apt/build.properties
new file mode 100644
index 000000000..e9863e281
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.apt/build.properties
@@ -0,0 +1,5 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml
diff --git a/plugins/org.eclipse.objectteams.otdt.apt/plugin.xml b/plugins/org.eclipse.objectteams.otdt.apt/plugin.xml
new file mode 100644
index 000000000..2a8237743
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.apt/plugin.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension
+ point="org.eclipse.objectteams.otequinox.aspectBindings">
+ <aspectBinding
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/calloutbinding_obj.gif">
+ <basePlugin
+ icon="platform:/plugin/org.eclipse.pde.ui/icons/obj16/plugin_obj.gif"
+ id="org.eclipse.jdt.core">
+ <requiredFragment
+ id="org.eclipse.jdt.compiler.apt">
+ </requiredFragment>
+ </basePlugin>
+ <team
+ activation="ALL_THREADS"
+ class="org.eclipse.objectteams.otdt.apt.VisitorsAdaptor"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif">
+ </team>
+ </aspectBinding>
+ </extension>
+
+</plugin>
diff --git a/plugins/org.eclipse.objectteams.otdt.apt/src/org/eclipse/objectteams/otdt/apt/VisitorsAdaptor.java b/plugins/org.eclipse.objectteams.otdt.apt/src/org/eclipse/objectteams/otdt/apt/VisitorsAdaptor.java
new file mode 100644
index 000000000..02ca6df19
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.apt/src/org/eclipse/objectteams/otdt/apt/VisitorsAdaptor.java
@@ -0,0 +1,82 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2009 Stephan Herrmann
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: VisitorsAdaptor.java 23449 2010-02-04 20:26:45Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.apt;
+
+import org.eclipse.jdt.internal.compiler.ast.Annotation;
+import org.eclipse.jdt.internal.compiler.ast.Argument;
+import org.eclipse.jdt.internal.compiler.ast.TypeDeclaration;
+import org.eclipse.jdt.internal.compiler.lookup.AptSourceLocalVariableBinding;
+import org.eclipse.jdt.internal.compiler.lookup.Binding;
+import org.eclipse.jdt.internal.compiler.lookup.BlockScope;
+import org.eclipse.jdt.internal.compiler.lookup.MethodBinding;
+import org.eclipse.jdt.internal.compiler.lookup.Scope;
+import org.eclipse.objectteams.otdt.internal.core.compiler.ast.AbstractMethodMappingDeclaration;
+import org.eclipse.objectteams.otdt.internal.core.compiler.control.Dependencies;
+import org.eclipse.objectteams.otdt.internal.core.compiler.control.ITranslationStates;
+import org.eclipse.objectteams.otdt.internal.core.compiler.model.RoleModel;
+
+import base org.eclipse.jdt.internal.compiler.apt.dispatch.AnnotationDiscoveryVisitor;
+
+/**
+ * This class adapts visitors used in annotation processing that need to be aware of
+ * OT extensions of the compiler ast -
+ * currently only {@link org.eclipse.jdt.internal.compiler.apt.dispatch.AnnotationDiscoveryVisitor}.
+ *
+ * @author stephan
+ * @since 1.2.7
+ */
+@SuppressWarnings("restriction")
+public team class VisitorsAdaptor {
+ protected class AnnotationDiscoveryVisitor playedBy AnnotationDiscoveryVisitor {
+
+ @SuppressWarnings("decapsulation")
+ void resolveAnnotations(BlockScope arg0, Annotation[] arg1, Binding arg2)
+ -> void resolveAnnotations(BlockScope arg0, Annotation[] arg1, Binding arg2);
+
+
+ boolean visit(Argument argument, BlockScope scope)
+ <- replace boolean visit(Argument argument, BlockScope scope);
+
+
+ @SuppressWarnings("basecall")
+ callin boolean visit(Argument argument, BlockScope scope) {
+ if (scope.kind == Scope.BINDING_SCOPE) { // don't blindly assume that we're inside a method
+ Annotation[] annotations = argument.annotations;
+ // the payload (orig uses cast to AbstractMethodDeclaration):
+ AbstractMethodMappingDeclaration mapping = (AbstractMethodMappingDeclaration) scope.referenceContext();
+ RoleModel roleModel = scope.referenceType().getRoleModel();
+ if (roleModel != null)
+ Dependencies.ensureRoleState(roleModel, ITranslationStates.STATE_MAPPINGS_RESOLVED); // needed for accessing the method binding.
+ MethodBinding binding = mapping.getRoleMethod();
+ //
+ if (binding != null) {
+ TypeDeclaration typeDeclaration = scope.referenceType();
+ typeDeclaration.binding.resolveTypesFor(binding);
+ if (argument.binding != null) {
+ argument.binding = new AptSourceLocalVariableBinding(argument.binding, binding);
+ }
+ }
+ if (annotations != null) {
+ this.resolveAnnotations(
+ scope,
+ annotations,
+ argument.binding);
+ }
+ return false;
+ } else {
+ return base.visit(argument, scope);
+ }
+ }
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/.classpath b/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/.classpath
new file mode 100644
index 000000000..987380a81
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/.classpath
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <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="con" path="OTRE"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/.project b/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/.project
new file mode 100644
index 000000000..12e57b376
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/.project
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.objectteams.otdt.compiler.adaptor</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.objectteams.otdt.builder.OTJBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.objectteams.otdt.OTJavaNature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..3b916835b
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,85 @@
+#Sun Nov 09 02:20:07 CET 2008
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.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=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
+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=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=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=warning
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+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.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.5
+org.objectteams.otdt.compiler.option.joinpoint_queries=disabled
+org.objectteams.otdt.compiler.option.scoped_keywords=enabled
+org.objectteams.otdt.compiler.problem.abstract_potential_relevant_role=warning
+org.objectteams.otdt.compiler.problem.basecall=warning
+org.objectteams.otdt.compiler.problem.binding_conventions=error
+org.objectteams.otdt.compiler.problem.decapsulation=warning
+org.objectteams.otdt.compiler.problem.deprecated_path_syntax=warning
+org.objectteams.otdt.compiler.problem.effectless_fieldaccess=warning
+org.objectteams.otdt.compiler.problem.fragile_callin=warning
+org.objectteams.otdt.compiler.problem.incomplete_build=error
+org.objectteams.otdt.compiler.problem.inferred_callout=error
+org.objectteams.otdt.compiler.problem.potential_ambiguous_playedby=warning
+org.objectteams.otdt.compiler.problem.unsafe_liftctor=warning
+org.objectteams.otdt.compiler.problem.unsafe_role_instantiation=warning
+org.objectteams.otdt.compiler.problem.unused_parammap=warning
diff --git a/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/META-INF/MANIFEST.MF b/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..b43819b9e
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/META-INF/MANIFEST.MF
@@ -0,0 +1,16 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: OT/J Compiler Adaptor Plug-in
+Bundle-SymbolicName: org.eclipse.objectteams.otdt.compiler.adaptor;singleton:=true
+Bundle-Version: 1.4.0.qualifier
+Bundle-Vendor: objectteams.org
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.jdt.core;bundle-version="[3.4.2.vOTDT_r124,4.0.0)",
+ org.eclipse.objectteams.otequinox,
+ org.eclipse.core.runtime,
+ org.eclipse.core.resources,
+ org.eclipse.pde.core,
+ org.eclipse.objectteams.otdt
+Export-Package: org.eclipse.objectteams.otdt.internal.compiler.adaptor
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ActivationPolicy: lazy
diff --git a/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/build.properties b/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/build.properties
new file mode 100644
index 000000000..e9863e281
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/build.properties
@@ -0,0 +1,5 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml
diff --git a/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/plugin.xml b/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/plugin.xml
new file mode 100644
index 000000000..36e273231
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/plugin.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+ <extension
+ point="org.eclipse.objectteams.otequinox.aspectBindings">
+ <aspectBinding
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/calloutbinding_obj.gif">
+ <basePlugin
+ icon="platform:/plugin/org.eclipse.pde.ui/icons/obj16/plugin_obj.gif"
+ id="org.eclipse.jdt.core"/>
+ <team
+ activation="ALL_THREADS"
+ class="org.eclipse.objectteams.otdt.internal.compiler.adaptor.AdaptorActivator"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif"/>
+ <team
+ activation="NONE"
+ class="org.eclipse.objectteams.otdt.internal.compiler.adaptor.BuildManager"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif"
+ superclass="org.eclipse.objectteams.otdt.internal.compiler.adaptor.CompilationThreadWatcher"/>
+ <team
+ activation="NONE"
+ class="org.eclipse.objectteams.otdt.internal.compiler.adaptor.CompilationThreadWatcher"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif"/>
+ <team
+ activation="NONE"
+ class="org.eclipse.objectteams.otdt.internal.compiler.adaptor.BaseImportChecker"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif"
+ superclass="org.eclipse.objectteams.otdt.internal.compiler.adaptor.CompilationThreadWatcher"/>
+ <team
+ activation="NONE"
+ class="org.eclipse.objectteams.otdt.internal.compiler.adaptor.RoleReuseGuard"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif">
+ </team>
+ <team
+ activation="NONE"
+ class="org.eclipse.objectteams.otdt.internal.compiler.adaptor.PlainProjectWatcher"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif"
+ superclass="org.eclipse.objectteams.otdt.internal.compiler.adaptor.CompilationThreadWatcher">
+ </team>
+ </aspectBinding>
+ <aspectBinding
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/calloutbinding_obj.gif">
+ <basePlugin
+ icon="platform:/plugin/org.eclipse.pde.ui/icons/obj16/plugin_obj.gif"
+ id="org.eclipse.pde.core">
+ </basePlugin>
+ <team
+ activation="ALL_THREADS"
+ class="org.eclipse.objectteams.otdt.internal.compiler.adaptor.PDEAdaptor"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif">
+ </team>
+ </aspectBinding>
+ <aspectBinding
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/calloutbinding_obj.gif">
+ <basePlugin
+ icon="platform:/plugin/org.eclipse.pde.ui/icons/obj16/plugin_obj.gif"
+ id="org.eclipse.core.resources">
+ </basePlugin>
+ <team
+ activation="ALL_THREADS"
+ class="org.eclipse.objectteams.otdt.internal.compiler.adaptor.ResourceProjectAdaptor"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif">
+ </team>
+ </aspectBinding>
+ </extension>
+
+</plugin>
diff --git a/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/AdaptedBaseBundle.java b/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/AdaptedBaseBundle.java
new file mode 100644
index 000000000..fa33586ac
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/AdaptedBaseBundle.java
@@ -0,0 +1,115 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2007 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: AdaptedBaseBundle.java 23451 2010-02-04 20:33:32Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.compiler.adaptor;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * Objects of this class encode the information about aspectBindings
+ * affecting a given type/package within a base bundle.
+ *
+ * @author stephan
+ * @since 1.1.5
+ */
+public class AdaptedBaseBundle
+{
+ // the Object-value is used as a time stamp for reloading after the reader has been reloaded:
+ private HashMap<AspectBindingReader,Object> readers= new HashMap<AspectBindingReader, Object>();
+
+
+ /** Symbolic name of this base bundle. */
+ String symbolicName;
+ /** Teams adapting this base bundle. */
+ Set<String> adaptingTeams;
+
+ /** Does this aspect bundle have one or more split packages? */
+ public boolean hasPackageSplit = false;
+
+ public AdaptedBaseBundle(String symbolicName,
+ AspectBindingReader reader)
+ {
+ this.symbolicName = symbolicName;
+ this.adaptingTeams= reader.getTeamsForBase(symbolicName);
+ this.readers.put(reader, reader.token);
+ }
+ public boolean isAdaptedBy(String teamName) {
+ checkReload();
+ for (String aTeam : adaptingTeams)
+ if (aTeam.equals(teamName))
+ return true;
+ return false;
+ }
+
+ public String getSymbolicName() {
+ return this.symbolicName;
+ }
+
+ public synchronized boolean merge(AdaptedBaseBundle otherData) {
+ if (this.symbolicName.equals(otherData.symbolicName)) {
+ this.adaptingTeams.addAll(otherData.adaptingTeams);
+ this.readers.putAll(otherData.readers);
+ return true;
+ } else {
+ // different base bundle but same package: split package
+ return false;
+ }
+ }
+
+ /** Check whether the AspectBindingReader has been reloaded, and if so,
+ * also reload our data (adaptingTeams) from the reader. */
+ private void checkReload() {
+ synchronized (this.readers) {
+ boolean reloadNeeded= false;
+ for (Map.Entry<AspectBindingReader,Object> readerEntry : this.readers.entrySet()) {
+ AspectBindingReader reader= readerEntry.getKey();
+ if (readerEntry.getValue() != reader.token) {
+ // token changed means: reader has reloaded.
+ reloadNeeded= true;
+ this.readers.put(reader, reader.token);
+ }
+ }
+ if (!reloadNeeded)
+ return;
+ // perform the reload:
+ HashSet<String> newSet= new HashSet<String>();
+ for (AspectBindingReader reader: this.readers.keySet())
+ newSet.addAll(reader.getTeamsForBase(this.symbolicName));
+ this.adaptingTeams= newSet; // only now assign, because querying the readers might call back into this!
+ }
+ }
+
+ @SuppressWarnings("nls")
+ @Override
+ public String toString() {
+ String result= "bundle "+this.symbolicName+" is adapted by";
+ if (this.adaptingTeams == null)
+ return result+" (null)";
+ if (this.adaptingTeams.isEmpty())
+ return result+" no teams";
+ for (String aTeam : this.adaptingTeams) {
+ result+= "\n\t"+aTeam;
+ }
+ return result;
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/AdaptorActivator.java b/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/AdaptorActivator.java
new file mode 100644
index 000000000..59e30c19e
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/AdaptorActivator.java
@@ -0,0 +1,371 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2007 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: AdaptorActivator.java 23451 2010-02-04 20:33:32Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.compiler.adaptor;
+
+import static org.eclipse.core.resources.IncrementalProjectBuilder.FULL_BUILD;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+
+import org.eclipse.core.internal.resources.Project;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jdt.core.IAccessRule;
+import org.eclipse.jdt.core.IClasspathAttribute;
+import org.eclipse.jdt.core.IClasspathContainer;
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.core.WorkingCopyOwner;
+import org.eclipse.jdt.internal.compiler.CompilationResult;
+import org.eclipse.jdt.internal.compiler.SourceElementParser;
+import org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration;
+import org.eclipse.jdt.internal.compiler.ast.TypeDeclaration;
+import org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding;
+import org.eclipse.jdt.internal.compiler.util.ObjectVector;
+import org.eclipse.jdt.internal.compiler.util.SimpleLookupTable;
+import org.eclipse.jdt.internal.core.ClasspathAccessRule;
+import org.eclipse.jdt.internal.core.CompilationUnit;
+import org.eclipse.pde.internal.core.RequiredPluginsClasspathContainer;
+import org.objectteams.LiftingVetoException;
+import org.objectteams.Team;
+import org.eclipse.objectteams.otdt.core.compiler.IOTConstants;
+import org.eclipse.objectteams.otdt.core.compiler.OTNameUtils;
+
+import base org.eclipse.jdt.core.JavaCore;
+import base org.eclipse.jdt.internal.core.CompilationUnitProblemFinder;
+import base org.eclipse.jdt.internal.core.JavaProject;
+import base org.eclipse.jdt.internal.core.builder.IncrementalImageBuilder;
+import base org.eclipse.jdt.internal.core.builder.JavaBuilder;
+import base org.eclipse.objectteams.otdt.internal.core.compiler.statemachine.copyinheritance.CopyInheritance;
+
+/**
+ * This team is activated via the OT/Equinox transformer plugin.
+ * It controls the activation of the BuildManager and BaseImportChecker teams.
+ *
+ * Control entry for BuildManager: IncrementalImageBuilder.
+ * Control entries for BaseImportChecker: JavaBuilder and CompilationUnitProblemFinder
+ * @author stephan
+ */
+@SuppressWarnings("restriction")
+public team class AdaptorActivator
+{
+ /**
+ * Name of classpath attributes denoting the base bundle from which a classpath entry originates.
+ * Persistently stored so we can later associate aspect binding data to that classpath entry.
+ */
+ public static final String CPENTRY_ATTR_ORIGIN_BASE_BUNDLE = "org.eclipse.objectteams.originBaseBundle"; //$NON-NLS-1$
+
+ /**
+ * Copy of a constant from PDECore to reduce dependencies (must be compared with .equals())).
+ */
+ public static final IPath REQUIRED_PLUGINS_CONTAINER_PATH = new Path("org.eclipse.pde.core.requiredPlugins"); //$NON-NLS-1$
+
+
+ public static AdaptorActivator instance;
+ public AdaptorActivator() {
+ instance= this;
+ }
+
+ /**
+ * Pass the AspectBindingReader from a JavaProject to its RequiredPluginsClasspathContainer,
+ * and pass aspect binding data from the reader to individual classpath entries having a
+ * originBaseBundle attribute.
+ */
+ @SuppressWarnings("decapsulation") // base class is final
+ protected class JavaCore playedBy JavaCore
+ {
+ IClasspathAttribute newClasspathAttribute(String name, String value) -> IClasspathAttribute newClasspathAttribute(String name, String value);
+
+// (see TODO above) Attention:
+// this solution would require partial array lifting if an element throws LiftingVetoException:
+// void setClasspathContainer(OTEquinoxProject[] javaProjects, IClasspathContainer[] container)
+ void setClasspathContainer(IJavaProject[] javaProjects, IClasspathContainer[] containers)
+ <- before void setClasspathContainer(IPath container, IJavaProject[] affectedProjects, IClasspathContainer[] respectiveContainers, IProgressMonitor pm)
+ with { javaProjects <- affectedProjects,
+ containers <- respectiveContainers
+ }
+// static void setClasspathContainer(OTEquinoxProject[] javaProject, IClasspathContainer[] container)
+ static void setClasspathContainer(IJavaProject[] javaProjects, IClasspathContainer[] containers)
+ {
+ try {
+ for (int i=0; i<javaProjects.length; i++) {
+ Project project= (Project)javaProjects[i].getProject();
+ if ( containers[i] != null
+ && REQUIRED_PLUGINS_CONTAINER_PATH.equals(containers[i].getPath())
+ && ProjectUtil.isOTPluginProject(project)) // avoid LiftingVetoException
+ {
+ AspectBindingReader aspectBindingReader = ResourceProjectAdaptor.getDefault().getAspectBindingReader(project);
+ if (PDEAdaptor.instance != null)
+ //otherwise PDEAdaptor has not been activated yet (PDE neither) hoping this can be ignored.
+ PDEAdaptor.instance.setAspectBindingReader(aspectBindingReader, (RequiredPluginsClasspathContainer)containers[i]);
+ else
+ org.eclipse.jdt.core.JavaCore.getJavaCore().getLog().log(new Status(Status.WARNING, "org.eclipse.objectteams.otdt.internal.compiler.adaptor", //$NON-NLS-1$
+ "PDEAdaptor not yet initialized while setting classpath for "+project.getName())); //$NON-NLS-1$
+ }
+ }
+ } catch (LiftingVetoException lve) {
+ // ignore, aspect just didn't apply
+ } catch (Throwable t) {
+ org.eclipse.jdt.core.JavaCore.getJavaCore().getLog().log(new Status(Status.ERROR, "org.eclipse.objectteams.otdt.internal.compiler.adaptor", "Error initializing AspectBindingReader", t)); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+
+ void addBaseBundleAttribute(IAccessRule[] accessRules, IClasspathAttribute[] extraAttributes)
+ <- replace IClasspathEntry newLibraryEntry(IPath path1, IPath path2, IPath path3, IAccessRule[] accessRules, IClasspathAttribute[] extraAttributes, boolean isExported)
+ when (accessRules != null && accessRules.length > 0)
+ with { accessRules <- accessRules, extraAttributes <- extraAttributes }
+
+ void addBaseBundleAttribute(IAccessRule[] accessRules, IClasspathAttribute[] extraAttributes)
+ <- replace IClasspathEntry newProjectEntry(IPath path, IAccessRule[] accessRules, boolean combineAccessRules, IClasspathAttribute[] extraAttributes, boolean isExported)
+ when (accessRules != null && accessRules.length > 0)
+ with { accessRules <- accessRules, extraAttributes <- extraAttributes }
+
+ /**
+ * when creating a new classpath entry for a require plugin, check whether this plugin is affected by aspect bindings.
+ * If so, add a classpath attribute to denote the base plugin from which this entry originates.
+ * If a package is split among several plugins, a rule may carry one aspectBindingData for each part of the split.
+ */
+ static callin void addBaseBundleAttribute(IAccessRule[] accessRules, IClasspathAttribute[] extraAttributes) {
+ if (accessRules[0] instanceof ClasspathAccessRule) {
+ Object[] datas = ((ClasspathAccessRule)accessRules[0]).aspectBindingData;
+ int i = 0;
+ if (datas != null)
+ for (Object data : datas)
+ if (data instanceof AdaptedBaseBundle) {
+ // note: more than one data is rather infrequent, no need to optimize array copying
+ int len = extraAttributes.length;
+ System.arraycopy(extraAttributes, 0, extraAttributes=new IClasspathAttribute[len+1], 1, len);
+ String baseBundleName = ((AdaptedBaseBundle) data).getSymbolicName();
+ extraAttributes[0] = newClasspathAttribute(CPENTRY_ATTR_ORIGIN_BASE_BUNDLE+(i++), baseBundleName);
+ }
+ }
+ base.addBaseBundleAttribute(accessRules, extraAttributes);
+ }
+ }
+
+ /**
+ * When a JavaProject computes its package fragment roots from its classpath entries,
+ * enhance the classpath entries with aspect binding data, using the classpath attribute
+ * to determine the corresponding base bundle.
+ *
+ * @author stephan
+ * @since 1.2.5
+ */
+ protected class CPEntryEnhancer playedBy JavaProject {
+
+ IProject getProject() -> IProject getProject();
+
+ @SuppressWarnings("rawtypes")
+ void enhanceCPEntry(IClasspathEntry[] resolvedEntries)
+ <- before void computePackageFragmentRoots(IClasspathEntry[] resolvedEntries, ObjectVector accumulatedRoots,
+ HashSet rootIDs, IClasspathEntry referringEntry,
+ boolean retrieveExportedRoots, Map rootToResolvedEntries);
+
+ /**
+ * @param entry the entry to enhance
+ * @throws LiftingVetoException when the project is not an OT/Equinox project.
+ */
+ void enhanceCPEntry(IClasspathEntry[] entries) throws LiftingVetoException
+ {
+ IProject project = getProject();
+ AspectBindingReader reader = ResourceProjectAdaptor.getDefault().getAspectBindingReader((Project)project);
+ for (IClasspathEntry entry : entries) {
+ IClasspathAttribute[] attributes = entry.getExtraAttributes();
+ attributes_loop:
+ for (IClasspathAttribute attribute : attributes) {
+ if (attribute.getName().startsWith(CPENTRY_ATTR_ORIGIN_BASE_BUNDLE)) {
+ AdaptedBaseBundle aspectBindingData = reader.getAdaptationInfo(attribute.getValue());
+ if (aspectBindingData == null) continue; // means reader and attr are inconsistent
+ rules_loop:
+ for (IAccessRule rule : entry.getAccessRules())
+ if (rule instanceof ClasspathAccessRule)
+ if (!PDEAdaptor.addAspectBindingData((ClasspathAccessRule)rule, aspectBindingData))
+ break rules_loop; // when not adding assume all rules share the same aspect data
+ break attributes_loop;
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Interface to the controlling builder. Tasks:
+ * <ul>
+ * <li>Life-cycle management for the BuildManager</li>
+ * <li>cflow like bracket [initializeBuilder,cleanup]
+ * for temporary activation of BaseImportChecker.
+ * Note, that build() is not a suitable join point,
+ * because javaProject is not yes assigned.</li>
+ * </ul>
+ */
+ protected class JavaBuilderObserver playedBy JavaBuilder
+ {
+ @SuppressWarnings("decapsulation")
+ Project getProject() -> get JavaProject javaProject
+ with { result <- (Project)javaProject.getProject() }
+
+ Team projectWatcher= null;
+
+ // initialize local data structures when a full build is started:
+ void initialize(int kind) <- after int initializeBuilder(int kind, boolean forBuild);
+ void initialize(int kind) {
+ if (kind == FULL_BUILD)
+ manager.initializeDependencyStorage();
+ try {
+ this.projectWatcher= ResourceProjectAdaptor.getDefault().getChecker(getProject());
+ } catch (LiftingVetoException lve) {
+ this.projectWatcher= new PlainProjectWatcher();
+ }
+ this.projectWatcher.activate();
+ }
+
+ cleanup <- after cleanup;
+ void cleanup() {
+ if (this.projectWatcher != null)
+ this.projectWatcher.deactivate();
+ this.projectWatcher= null;
+ }
+
+ // need to recompute the classpath if aspect binding data have changed:
+ @SuppressWarnings("decapsulation")
+ boolean aspectBindingHasChanged() <- replace boolean hasClasspathChanged();
+ @SuppressWarnings("basecall")
+ callin boolean aspectBindingHasChanged() {
+ try {
+ if (ResourceProjectAdaptor.getDefault().hasAspectDataChanged(getProject()))
+ return true;
+ } catch (LiftingVetoException lve) {
+ // thrown while lifting project, means that javaProject is not OT-Project.
+ }
+ return base.aspectBindingHasChanged();
+ }
+
+ }
+
+ /**
+ * This role observes another entry into the compiler to activate a BaseImportChecker if needed.
+ */
+ protected class CompilationUnitProblemFinder playedBy CompilationUnitProblemFinder
+ {
+ @SuppressWarnings("rawtypes")
+ void activateChecker(ICompilationUnit unitElement)
+ <- replace CompilationUnitDeclaration process(CompilationUnit unitElement,
+ SourceElementParser parser,
+ WorkingCopyOwner workingCopyOwner,
+ HashMap problems,
+ boolean creatingAST,
+ int reconcileFlags,
+ IProgressMonitor monitor)
+ with { unitElement <- unitElement }
+
+ static callin void activateChecker(ICompilationUnit unitElement)
+ throws JavaModelException
+ {
+ within (getChecker(unitElement))
+ base.activateChecker(unitElement);
+ }
+
+ static Team getChecker(ICompilationUnit unitElement) {
+ try {
+ Project project= ProjectUtil.safeGetOTPluginProject(unitElement);
+ if (project != null) {
+ Team baseChecker= ResourceProjectAdaptor.getDefault().getChecker(project);
+ if (baseChecker != null)
+ return baseChecker;
+ }
+ } catch (LiftingVetoException lve) {
+ // shouldn't happen, have checked above.
+ }
+ return new PlainProjectWatcher(); // fallback for non OT-Plugin projects
+ }
+ }
+
+ private BuildManager manager = new BuildManager();
+
+ /**
+ * This role observes the IncrementalImageBuilder.
+ * It enables all callins of BuildManager only while
+ * performing an incremental build (method build(deltas)).
+ */
+ protected class BuilderGuard playedBy IncrementalImageBuilder
+ {
+ build <- replace build;
+ callin boolean build(SimpleLookupTable deltas)
+ {
+ // Activation only for this thread/control flow:
+ within (manager) {
+ return base.build(deltas);
+ }
+ }
+ }
+
+ /**
+ * This role class simply tracks all executions of CopyInheritance.copyRole(..)
+ *
+ * Purpose: collect data for recompiling sub-teams if tsuper roles have been changed.
+ */
+ protected class CopyInheritanceObserver playedBy CopyInheritance
+ {
+ // This trigger applies to source and binary tsupers being copied into source:
+ void observeCopyRole(ReferenceBinding superRole, char[] subTeamFileName)
+ <- after TypeDeclaration copyRole(ReferenceBinding tsuperRole,
+ boolean isNestedType,
+ TypeDeclaration subTeamDecl,
+ boolean isTsuperTeam)
+ base when (result != null)
+ with { superRole <- tsuperRole,
+ subTeamFileName <- subTeamDecl.compilationResult.getFileName() }
+
+ // static for optimization: avoid lifting.
+ static void observeCopyRole(ReferenceBinding superRole, char[] subTeamFileName)
+ {
+ if (superRole.enclosingType().id == IOTConstants.T_OrgObjectTeamsTeam)
+ return;
+ if (subTeamFileName == null || subTeamFileName[0] != '/')
+ return; // only useful if an absolute path is given.
+
+ // no need to recompile these:
+ char[] superRoleName = superRole.internalName();
+ if ( BuildManager.isPredefinedRole(superRoleName)
+ || OTNameUtils.isTSuperMarkerInterface(superRoleName))
+ return;
+ AdaptorActivator.this.manager.recordCopiedRole(superRole.attributeName(), subTeamFileName);
+ }
+
+ @SuppressWarnings("decapsulation")
+ boolean shouldPreserveBinary(ReferenceBinding role, CompilationResult cResult)
+ <-replace boolean shouldPreserveBinaryRole(ReferenceBinding role, CompilationResult cResult);
+ static callin boolean shouldPreserveBinary(ReferenceBinding role, CompilationResult cResult)
+ {
+ if (!base.shouldPreserveBinary(role, cResult))
+ return false;
+ if (!AdaptorActivator.this.manager.isActive())
+ return true;
+ return AdaptorActivator.this.manager.shouldPreserveBinaryRole(role, cResult);
+ }
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/AspectBindingReader.java b/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/AspectBindingReader.java
new file mode 100644
index 000000000..bae44d03e
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/AspectBindingReader.java
@@ -0,0 +1,364 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2007 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: AspectBindingReader.java 23451 2010-02-04 20:33:32Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.compiler.adaptor;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.Map.Entry;
+
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jdt.core.IClasspathContainer;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.objectteams.otdt.core.ext.OTDTPlugin;
+import org.eclipse.pde.core.build.IBuild;
+import org.eclipse.pde.core.plugin.IPluginModelBase;
+import org.eclipse.pde.internal.core.ClasspathUtilCore;
+import org.eclipse.pde.internal.core.PDECore;
+import org.eclipse.pde.internal.core.PluginModelManager;
+import org.eclipse.pde.internal.core.RequiredPluginsClasspathContainer;
+import org.objectteams.LiftingVetoException;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.DefaultHandler;
+
+/**
+ * Utility to read the aspectBinding extension from a projects plugin.xml,
+ * in order to provide this information during compilation.
+ *
+ * References to an AspectBindingReader are passed along the full information flow
+ * from PDEAdaptor to BaseImportChecker as a source for fetching aspect binding information.
+ *
+ * @author stephan
+ * @since 1.1.5
+ */
+@SuppressWarnings("restriction")
+public class AspectBindingReader {
+
+ // XML-Structure of aspectBindings in plugin.xml:
+ private final static String ASPECT_BINDING = "aspectBinding"; //$NON-NLS-1$
+ private final static String BASE_PLUGIN = "basePlugin"; //$NON-NLS-1$
+ private final static String ID = "id"; //attribute //$NON-NLS-1$
+ private final static String FORCED_EXPORTS = "forcedExports"; //$NON-NLS-1$
+ private final static String TEAM = "team"; //$NON-NLS-1$
+ private final static String CLASS = "class"; //attribute //$NON-NLS-1$
+
+ private static final String SELF = "SELF"; //value //$NON-NLS-1$
+ // Note: we do NOT read the requiredFragment element, because when creating access rules
+ // the packages of the fragment will report the host bundle as their providingBundle.
+ // (see PDEAdaptor.RequiredPluginsClasspathContainer#updateRule())
+
+ private static SAXParserFactory fSAXFactory;
+
+ // == local cached storage: ==
+
+ // main date storage: teamClassName -> basePluginName*
+ private HashMap<String, HashSet<String>> team2basePlugins = null;
+
+ private HashMap<String, HashSet<String>> base2forcedExports = null;
+ private HashSet<String> teamsAdaptingSelf= new HashSet<String>();
+
+ // reverse info with more details: basePluginName -> AdaptedBaseBundle
+ private HashMap<String, AdaptedBaseBundle> adaptationInfos= new HashMap<String, AdaptedBaseBundle>();
+
+ private String project;
+ private IProject iProject;
+
+ /** This field serves as a time stamp to track whether an
+ * aspect binding reader has been reloaded. */
+ Object token;
+
+ private boolean hasChanges;
+
+ // for accessing objects of type IPluginModelBase:
+ PluginModelManager fPluginModelManager;
+
+ /**
+ * Create and initialize an AspectBindingReader, i.e., try to read aspect binding info from the project's plugin.xml.
+ *
+ * @param project the project whose aspect bindings should be analyzed.
+ * @throws LiftingVetoException if the project was not ready for reading plugin.xml.
+ */
+ public AspectBindingReader(IProject project) throws LiftingVetoException {
+ if (!this.readAspectBindings(project, getSaxParserFactory()))
+ throw new LiftingVetoException();
+ this.project= project.getName();
+ this.iProject= project;
+ this.fPluginModelManager = PDECore.getDefault().getModelManager();
+ }
+
+ /** Is the given team declared to adapt classes from its own plug-in ("self")? */
+ public boolean isAdaptingSelf(String teamName) {
+ return this.teamsAdaptingSelf.contains(teamName);
+ }
+
+ /** Get the base plug-in adapted by the given team. */
+ public Set<String> getBasePlugins(String teamName) {
+ if (this.team2basePlugins != null)
+ return this.team2basePlugins.get(teamName);
+ return null;
+ }
+
+ /** Is the bundle identified by this symbolic name an adapted base bundle.? */
+ public boolean isAdaptedBase(String symbolicName) {
+ return this.adaptationInfos.containsKey(symbolicName);
+ }
+
+ /** Get the names of all teams that adapt the given base bundle. */
+ public Set<String> getTeamsForBase(String basePluginName) {
+ AdaptedBaseBundle info = this.adaptationInfos.get(basePluginName);
+ if (info == null)
+ return new HashSet<String>();
+ return info.adaptingTeams;
+ }
+
+ /** Get (lazily create) the detailed info for an adapted base bundle. */
+ public AdaptedBaseBundle getAdaptationInfo(String basePluginName) {
+ AdaptedBaseBundle result= this.adaptationInfos.get(basePluginName);
+ if (result == null) {
+ result= new AdaptedBaseBundle(basePluginName, this);
+ this.adaptationInfos.put(basePluginName, result);
+ }
+ return result;
+ }
+
+
+ /** Is the given package force-exported? */
+ public String getForcedExportingBase(String packageName) {
+ if (this.base2forcedExports == null)
+ return null;
+ for (Entry<String, HashSet<String>> entry: this.base2forcedExports.entrySet()) {
+ if (entry.getValue().contains(packageName))
+ return entry.getKey();
+ }
+ return null;
+ }
+
+ public HashSet<String> getForcedExports(String symbolicName) {
+ if (this.base2forcedExports == null)
+ return null;
+ return this.base2forcedExports.get(symbolicName);
+ }
+
+ static SAXParserFactory getSaxParserFactory() {
+ if (fSAXFactory == null)
+ fSAXFactory = SAXParserFactory.newInstance();
+ return fSAXFactory;
+ }
+
+
+ /** Read all the <aspectBinding> declarations from plugin.xml.
+ * @return whether or not reading plugin.xml was successful.
+ */
+ private boolean readAspectBindings (IProject project, SAXParserFactory factory) {
+ SAXParser parser;
+ try {
+ parser = factory.newSAXParser();
+ IFile file = project.getFile("plugin.xml"); //$NON-NLS-1$
+ if (!file.exists())
+ return false;
+ collectAspectBindings(file, parser);
+ this.token= new Object();
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ return true;
+ }
+
+ /** Stage 1: remember which team declares to adapt classes from which base plug-in. */
+ void recordAspectBinding(String teamClass, String basePluginID) {
+ if (SELF.equals(basePluginID.toUpperCase())) {
+ this.teamsAdaptingSelf.add(teamClass);
+ return;
+ }
+ if (this.team2basePlugins == null)
+ this.team2basePlugins = new HashMap<String, HashSet<String>>();
+ HashSet<String> plugins = this.team2basePlugins.get(teamClass);
+ if (plugins == null) {
+ plugins = new HashSet<String>();
+ this.team2basePlugins.put(teamClass, plugins);
+ }
+ plugins.add(basePluginID);
+
+ // and store detailed reverse info:
+ AdaptedBaseBundle adaptationInfo = getAdaptationInfo(basePluginID);
+ adaptationInfo.adaptingTeams.add(teamClass);
+ }
+
+ void recordForcedExports(String basePlugin, String exports) {
+ if (this.base2forcedExports == null)
+ this.base2forcedExports= new HashMap<String, HashSet<String>>();
+ HashSet<String> baseExports= this.base2forcedExports.get(basePlugin);
+ if (baseExports == null)
+ this.base2forcedExports.put(basePlugin, baseExports= new HashSet<String>());
+ String[] singleExports= exports.split(","); //$NON-NLS-1$
+ for (int i = 0; i < singleExports.length; i++)
+ baseExports.add(singleExports[i].trim());
+ // TODO(SH): not yet checked: are the exports really packages of basePlugin?
+ }
+
+ void collectAspectBindings(IFile file, SAXParser parser) {
+ try {
+ parser.parse(file.getContents(), new DefaultHandler() {
+ String basePluginID = null;
+ ArrayList<String> teamClasses = null;
+ StringBuffer forcedExports= null;
+ @Override
+ public void startElement(String uri, String localName, String name, Attributes attributes)
+ throws SAXException
+ {
+ if (name.equals(ASPECT_BINDING))
+ this.teamClasses = new ArrayList<String>();
+ else if (this.teamClasses != null) { // within an aspectBinding element?
+ if (name.equals(BASE_PLUGIN)) {
+ this.basePluginID = attributes.getValue(ID);
+ } else if (name.equals(TEAM)) {
+ String teamClass = attributes.getValue(CLASS);
+ if (teamClass == null)
+ throw new SAXException("team element lacking \"class\" attribute"); //$NON-NLS-1$
+ this.teamClasses.add(teamClass);
+ } else if (name.equals(FORCED_EXPORTS)) {
+ this.forcedExports= new StringBuffer();
+ }
+ }
+ }
+ @Override
+ public void characters(char[] ch, int start, int length) throws SAXException
+ {
+ if (this.forcedExports != null)
+ this.forcedExports.append(ch, start, length);
+ }
+ @Override
+ public void endElement(String uri, String localName, String name)
+ throws SAXException
+ {
+ if (name.equals(ASPECT_BINDING)) {
+ if (this.basePluginID == null)
+ throw new SAXException("aspectBinding missing a \"basePlugin\" element"); //$NON-NLS-1$
+ for (String teamClass : this.teamClasses)
+ recordAspectBinding(teamClass, this.basePluginID);
+ this.basePluginID = null;
+ this.teamClasses = null;
+ } else if (name.equals(FORCED_EXPORTS)) {
+ if (this.forcedExports != null && this.forcedExports.length() > 0)
+ recordForcedExports(this.basePluginID, this.forcedExports.toString());
+ this.forcedExports= null;
+ }
+ }
+ });
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ // ===== Below: Updating. =====
+
+ /** When plugin.xml has changed re-read our data and perhaps clear
+ * cached data in the JavaModelManager and RequirePluginsClasspathContainer. */
+ void reload() {
+ this.hasChanges= true;
+
+ HashMap<String,HashSet<String>> oldForcedExports= this.base2forcedExports;
+ HashMap<String,HashSet<String>> oldTeamBindings= this.team2basePlugins;
+ // clear internal storage:
+ this.team2basePlugins = null; // be sure to initialize new sets if needed, so we can compare sets using mapHasChanged
+ this.base2forcedExports = null;
+ this.adaptationInfos.clear(); // these two are created by default (and no need to compare old/new)
+ this.teamsAdaptingSelf.clear();
+
+ if (!this.readAspectBindings(this.iProject, getSaxParserFactory())) {
+ OTDTPlugin.getDefault().getLog().log(new Status(Status.ERROR, OTDTPlugin.PLUGIN_ID, "Unable to re-read plugin.xml!;")); //$NON-NLS-1$
+ return ;
+ }
+
+ // remove cached data if forced exports or team bindings have changed:
+ if ( mapHasChanged(oldForcedExports, this.base2forcedExports)
+ || mapHasChanged(oldTeamBindings, this.team2basePlugins))
+ {
+ resetRequiredPluginsClasspathContainer(this.iProject);
+ }
+ }
+
+ /** Destructively read the flag indicating changed aspect binding data. */
+ boolean fetchHasChanges() {
+ try {
+ return this.hasChanges;
+ } finally {
+ this.hasChanges= false;
+ }
+ }
+
+ private void resetRequiredPluginsClasspathContainer(IProject project) {
+ IJavaProject jProject = JavaCore.create(project);
+ IPluginModelBase model = fPluginModelManager.findModel(project);
+ try {
+ IBuild build = ClasspathUtilCore.getBuild(model);
+ RequiredPluginsClasspathContainer container = new RequiredPluginsClasspathContainer(model, build);
+ // this triggers recomputing the classpath:
+ JavaCore.setClasspathContainer(PDECore.REQUIRED_PLUGINS_CONTAINER_PATH, new IJavaProject[]{jProject}, new IClasspathContainer[] {container}, null);
+ // AspectBindingReader is automatically shared via the ResourceProjectAdaptor.OTEquinoxProject
+ // see org.eclipse.objectteams.otdt.internal.compiler.adaptor.AdaptorActivator.JavaCore.setClasspathContainer(..)
+ } catch (CoreException ce) {
+ OTDTPlugin.getExceptionHandler().logException("Failed to reload classpath container for "+project, ce); //$NON-NLS-1$
+ }
+ }
+
+ private <T> boolean mapHasChanged(HashMap<String,T> oldMap,
+ HashMap<String,T> newMap)
+ {
+ if (oldMap == null || newMap== null)
+ return oldMap != newMap; // null and non-null?
+ HashSet<String> newKeys= new HashSet<String>(newMap.keySet());
+ for (Map.Entry<String, T> oldEntry : oldMap.entrySet()) {
+ T newVal= newMap.get(oldEntry.getKey());
+ if (newVal == null)
+ return true; // removed entry
+ if (!newVal.equals(oldEntry.getValue()))
+ return true; // changed value (simple or complex)
+ newKeys.remove(oldEntry.getKey());
+ }
+ return !newKeys.isEmpty(); // added entries in newKeys?
+ }
+
+ // ===== Debug: =====
+ @SuppressWarnings("nls")
+ @Override
+ public String toString() {
+ String result= "AspectBindingReader for project "+this.project;
+ if (this.team2basePlugins != null)
+ result+= "\n\t known teams: "+this.team2basePlugins.size();
+ if (this.teamsAdaptingSelf != null)
+ result+= "\n\t self-adaption teams: "+this.teamsAdaptingSelf.size();
+ if (this.base2forcedExports != null)
+ result+= "\n\t plugins with forced exports: "+this.base2forcedExports.size();
+ return result;
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/BaseImportChecker.java b/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/BaseImportChecker.java
new file mode 100644
index 000000000..c8f33cf11
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/BaseImportChecker.java
@@ -0,0 +1,289 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2007 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: BaseImportChecker.java 23451 2010-02-04 20:33:32Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.compiler.adaptor;
+
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+
+import org.eclipse.jdt.core.Flags;
+import org.eclipse.jdt.core.compiler.CharOperation;
+import org.eclipse.jdt.core.compiler.IProblem;
+import org.eclipse.jdt.internal.compiler.ast.ASTNode;
+import org.eclipse.jdt.internal.compiler.ast.AllocationExpression;
+import org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration;
+import org.eclipse.jdt.internal.compiler.ast.Expression;
+import org.eclipse.jdt.internal.compiler.ast.ImportReference;
+import org.eclipse.jdt.internal.compiler.ast.MessageSend;
+import org.eclipse.jdt.internal.compiler.ast.TypeDeclaration;
+import org.eclipse.jdt.internal.compiler.ast.Expression.DecapsulationState;
+import org.eclipse.jdt.internal.compiler.env.AccessRestriction;
+import org.eclipse.jdt.internal.compiler.env.AccessRule;
+import org.eclipse.jdt.internal.compiler.impl.ReferenceContext;
+import org.eclipse.jdt.internal.compiler.lookup.FieldBinding;
+import org.eclipse.jdt.internal.compiler.lookup.ImportBinding;
+import org.eclipse.jdt.internal.compiler.lookup.MethodBinding;
+import org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding;
+import org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
+import org.eclipse.objectteams.otdt.core.exceptions.InternalCompilerError;
+
+import base org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope;
+import base org.eclipse.jdt.internal.compiler.problem.ProblemReporter;
+
+/**
+ * This team checks whether base-imports are backed up by proper aspectBinding declarations.
+ * (Only activated if the project has the PluginNature).
+ * This team is only temporarily instantiated/activated by AdaptorActivator.JavaProject(JavaProject).
+ *
+ * This team also handles the forcedExport declarations from aspectBindings extensions
+ * and correspondingly converts some diagnostics from forbiddenAccess to decapsulationByForcedExport.
+ *
+ * Other parts involved:
+ *
+ * + PDEAdaptor is responsible for adding aspectBindingData (of type AdaptedBaseBundle)
+ * to ClasspathAccessRules and adjusting the problemID
+ *
+ * + org.eclipse.jdt.internal.core.builder.NameEnvironment
+ * - computeClasspathLocations(IWorkspaceRoot, JavaProject, SimpleLookupTable)
+ * Feed AccessRuleSet from ClasspathEntry into ClasspathLocations like ClasspathDirectory.
+ *
+ * + org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment
+ * - setAccessRestriction(ReferenceBinding, AccessRestriction)
+ * - AccessRestriction getAccessRestriction(TypeBinding type)
+ * Pass AccessRestriction from sources like ClasspathDirectory.accessRuleSet into the compiler.
+ *
+ * @author stephan
+ * @since 1.1.2
+ */
+@SuppressWarnings("restriction")
+public team class BaseImportChecker extends CompilationThreadWatcher
+{
+ private AspectBindingReader aspectBindingReader;
+
+ public BaseImportChecker() {/* emtpy ctor for OT/Equinox */ }
+
+ /**
+ * @param aspectBindingReader must be non-null (and initialized).
+ */
+ public BaseImportChecker(AspectBindingReader aspectBindingReader) {
+ this.aspectBindingReader= aspectBindingReader;
+ }
+
+ /**
+ * If a forced exports exist convert some diagnostics from forbiddenAccess
+ * to decapsulationByForcedExport.
+ */
+ protected class ProblemReporter playedBy ProblemReporter
+ {
+ // imports via callout:
+ protected void baseImportInRegularClass(TypeDeclaration firstType, ImportReference reference)
+ -> void baseImportInRegularClass(TypeDeclaration firstType, ImportReference reference);
+ protected void illegalBaseImportNoAspectBinding(ImportReference ref, String teamName)
+ -> void illegalBaseImportNoAspectBinding(ImportReference ref, String teamName);
+ protected void illegalBaseImport(ImportReference ref, String expectedBasePlugin, String actualBasePlugin)
+ -> void illegalBaseImport(ImportReference ref, String expectedBasePlugin, String actualBasePlugin);
+ void illegalUseOfForcedExport(ReferenceBinding type, ASTNode reference)
+ -> void illegalUseOfForcedExport(ReferenceBinding type, ASTNode reference);
+ void decapsulationByForcedExport(ReferenceBinding type, ASTNode reference)
+ -> void decapsulationByForcedExport(ReferenceBinding type, ASTNode reference);
+ void baseImportFromSplitPackage(ImportReference ref, String expectedPlugin)
+ -> void baseImportFromSplitPackage(ImportReference ref, String expectedPlugin);
+
+
+ ReferenceContext getReferenceContext() -> get ReferenceContext referenceContext;
+
+ /** The callin entry into this role: analyze and report various access situations. */
+ @SuppressWarnings("basecall")
+ callin void forbiddenReference(TypeBinding type, ASTNode location, AccessRestriction restriction)
+ {
+ switch (restriction.getProblemId()) {
+ case IProblem.BaseclassDecapsulationForcedExport:
+ switch (getBaseclassDecapsulation(location)) {
+ case ALLOWED:
+ decapsulationByForcedExport((ReferenceBinding)type, location);
+ case REPORTED:
+ break;
+ default:
+ // no forced export for regular use!
+ illegalUseOfForcedExport((ReferenceBinding)type, location);
+ }
+ break;
+ case IProblem.AdaptedPluginAccess:
+ // not a real error but requires consistency check against aspectBinding:
+ if (location instanceof ImportReference) {
+ ImportReference imp= (ImportReference)location;
+ if (imp.isBase()) {
+ String teamName= getReferenceTeam();
+ if (teamName == null)
+ baseImportInRegularClass(getPublicType(), imp);
+
+ Set<String> basePlugins= aspectBindingReader.getBasePlugins(teamName);
+ if (basePlugins == null || basePlugins.isEmpty()) {
+ illegalBaseImportNoAspectBinding(imp, teamName);
+ return;
+ }
+ String baseString = flattenSet(basePlugins);
+ Set<String> actualBases = new HashSet<String>();
+ AccessRule rule= restriction.getAccessRule();
+ if (rule.aspectBindingData != null) {
+ for (Object data : rule.aspectBindingData) {
+ AdaptedBaseBundle info= (AdaptedBaseBundle) data;
+ if (info.isAdaptedBy(teamName)) {
+ // OK, no error
+ if (info.hasPackageSplit)
+ baseImportFromSplitPackage(imp, baseString); // just a warning
+ return;
+ }
+ actualBases.add(info.getSymbolicName());
+ }
+ }
+ illegalBaseImport(imp, baseString, flattenSet(actualBases));
+ }
+ }
+ break;
+ default:
+ base.forbiddenReference(type, location, restriction);
+ }
+ }
+ void forbiddenReference(TypeBinding type, ASTNode location, AccessRestriction restriction)
+ <- replace void forbiddenReference(TypeBinding type, ASTNode location, byte entryType, AccessRestriction restriction)
+ with { type <- type, location <- location, restriction <- restriction }
+
+ void forbiddenReference(TypeBinding type, ASTNode location, AccessRestriction restriction)
+ <- replace void forbiddenReference(MethodBinding method, ASTNode location, byte entryType, AccessRestriction restriction)
+ with { type <- method.declaringClass, location <- location, restriction <- restriction }
+
+ void forbiddenReference(TypeBinding type, ASTNode location, AccessRestriction restriction)
+ <- replace void forbiddenReference(FieldBinding field, ASTNode location, byte entryType, AccessRestriction restriction)
+ with { type <- field.declaringClass, location <- location, restriction <- restriction }
+
+
+ private DecapsulationState getBaseclassDecapsulation(ASTNode location) {
+ if (location instanceof Expression) {
+ if (location instanceof AllocationExpression)
+ return DecapsulationState.REPORTED; // base-ctor expression.
+ if (location instanceof MessageSend)
+ return DecapsulationState.REPORTED; // callout message send.
+ Expression expr= (Expression) location;
+ DecapsulationState result= expr.getBaseclassDecapsulation();
+ if (result == DecapsulationState.ALLOWED)
+ expr.tagReportedBaseclassDecapsulation();
+ return result;
+ }
+ if (location instanceof ImportReference) {
+ ImportReference impRef= (ImportReference)location;
+ if (impRef.isBase())
+ return DecapsulationState.ALLOWED; // always need to report
+ }
+ return DecapsulationState.NONE;
+ }
+ private String getReferenceTeam() {
+ TypeDeclaration type= getPublicType();
+ if (type != null && type.isTeam())
+ return new String(type.binding.readableName());
+ return null;
+ }
+ private TypeDeclaration getPublicType() {
+ ReferenceContext context= getReferenceContext();
+ if (context instanceof CompilationUnitDeclaration) {
+ CompilationUnitDeclaration unit= (CompilationUnitDeclaration)context;
+ if (unit.types == null) return null;
+ for (TypeDeclaration type : unit.types)
+ if (Flags.isPublic(type.modifiers))
+ return type;
+ }
+ return null;
+ }
+ }
+
+
+ protected class ImportTracker playedBy CompilationUnitScope
+ {
+ ReferenceBinding[] getTopLevelTypes() -> get ReferenceBinding[] topLevelTypes;
+ private // don't publically expose protected role ProblemReporter
+ ProblemReporter problemReporter() -> ProblemReporter problemReporter();
+
+ /** When setting the base imports to a CUScope, check for imports from undeclared plug-ins. */
+ void setBaseImports(ImportBinding[] resolvedBaseImports, int baseCount, ImportReference[] refs)
+ <- before void setBaseImports(ImportBinding[] resolvedBaseImports, int baseCount, ImportReference[] refs);
+ void setBaseImports(ImportBinding[] resolvedBaseImports, int baseCount, ImportReference[] refs)
+ {
+ if (baseCount == 0) return;
+ ReferenceBinding teamType = findMainType();
+ String teamName= (teamType != null)
+ ? new String(teamType.readableName()) : null;
+ for (int i=0; i<baseCount; i++) {
+ if (teamType == null) {
+ problemReporter().baseImportInRegularClass(null, refs[i]);
+ continue;
+ }
+ if (resolvedBaseImports[i].onDemand) // syntactically impossible
+ throw new InternalCompilerError("Ondemand base import not supported"); //$NON-NLS-1$
+ String basePlugins= null;
+ if (resolvedBaseImports[i].resolvedImport instanceof ReferenceBinding) {
+ ReferenceBinding importedType= (ReferenceBinding)resolvedBaseImports[i].resolvedImport;
+ if (!importedType.isValidBinding())
+ continue; // already reported
+ if (importedType.hasRestrictedAccess())
+ continue; // checked by forbiddenAccess()
+ if (aspectBindingReader.isAdaptingSelf(teamName)) {
+ char[][] current= CharOperation.splitOn('/', teamType.getFileName());
+ char[][] imported= CharOperation.splitOn('/', importedType.getFileName());
+ if (CharOperation.equals(current[1], imported[1]))
+ return;
+ basePlugins= "<self>"; //$NON-NLS-1$
+ }
+ }
+ if (basePlugins == null)
+ basePlugins= flattenSet(aspectBindingReader.getBasePlugins(teamName));
+ if (basePlugins != null)
+ problemReporter().illegalBaseImport(refs[i], basePlugins, null);
+ else
+ problemReporter().illegalBaseImportNoAspectBinding(refs[i], teamName);
+ }
+ }
+ private ReferenceBinding findMainType() {
+ ReferenceBinding[] toplevelTypes = getTopLevelTypes();
+ if (toplevelTypes != null)
+ for (ReferenceBinding referenceBinding : toplevelTypes)
+ if (referenceBinding.isPublic())
+ return referenceBinding;
+
+ return null;
+ }
+ }
+ @SuppressWarnings("nls")
+ String flattenSet(Set<String> stringSet) {
+ if (stringSet == null) return null;
+ Iterator<String> iterator = stringSet.iterator();
+ if (stringSet.size()==1) {
+ return iterator.next();
+ } else {
+ String result = "[";
+ while(true) {
+ result += iterator.next();
+ if (!iterator.hasNext()) break;
+ result += ", ";
+ }
+ return result + "]";
+ }
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/BuildManager.java b/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/BuildManager.java
new file mode 100644
index 000000000..6be0534bc
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/BuildManager.java
@@ -0,0 +1,345 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: BuildManager.java 23451 2010-02-04 20:33:32Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.compiler.adaptor;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.jdt.core.compiler.CharOperation;
+import org.eclipse.jdt.core.compiler.IProblem;
+import org.eclipse.jdt.internal.compiler.ast.ASTNode;
+import org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration;
+import org.eclipse.jdt.internal.compiler.ast.TypeDeclaration;
+import org.eclipse.jdt.internal.compiler.impl.ReferenceContext;
+import org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding;
+import org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding;
+import org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
+import org.eclipse.objectteams.otdt.core.compiler.IOTConstants;
+
+import base org.eclipse.jdt.core.compiler.CategorizedProblem;
+import base org.eclipse.jdt.internal.compiler.CompilationResult;
+import base org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader; // base-class of a role file
+import base org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding;
+import base org.eclipse.jdt.internal.compiler.lookup.ClassScope;
+import base org.eclipse.jdt.internal.compiler.problem.AbortCompilation;
+import base org.eclipse.jdt.internal.compiler.problem.AbortType;
+import base org.eclipse.jdt.internal.compiler.problem.ProblemReporter;
+import base org.eclipse.objectteams.otdt.internal.core.compiler.lifting.LiftingEnvironment;
+import base org.eclipse.jdt.internal.core.builder.IncrementalImageBuilder; // base-class of a role file
+
+/**
+ * This Team observes the build/compile process and advises the IncrementalImageBuilder,
+ * when and what to recompile due to OT-specific dependencies.
+ *
+ * @author stephan
+ * @version $Id: BuildManager.java 23451 2010-02-04 20:33:32Z stephan $
+ */
+@SuppressWarnings("restriction")
+public team class BuildManager extends CompilationThreadWatcher
+{
+ public static int DEBUG = 0; // levels: 0 nothing, 1 some, 2 more.
+
+ /** Remember the (one) ImageBuilder role. */
+ ImageBuilder builder = null;
+
+ // ====== Data common for all roles (incl. accessors and life-cycle). ======
+
+
+ /** Manage cross-ref table for copied roles:
+ * PRODUCER: RoleCopyTracker.trackCopyRole()
+ * CONSUMER: ClassFileChangeTracker.nonStructuralChange()
+ *
+ * ENCODING: RoleTypeName -> Set<TeamSourceFileName> */
+ HashMap<String, Set<String>> roleToSubTeams = new HashMap<String, Set<String>>();
+
+ void recordCopiedRole(char[] roleName, char[] subTeamSourceFileName) {
+ String roleString = new String(roleName);
+ Set<String> teams = roleToSubTeams.get(roleString);
+ if (teams == null)
+ roleToSubTeams.put(roleString, teams = new HashSet<String>());
+ teams.add(new String(subTeamSourceFileName));
+ if (DEBUG >= 2)
+ System.out.println("role "+roleString+" is COPIED to "+new String(subTeamSourceFileName)); //$NON-NLS-1$//$NON-NLS-2$
+ }
+// // debug helper
+// void printCopyTable() {
+// System.out.print("-------------------------");
+// for (Map.Entry<String, Set<String>> entry : roleToSubTeams.entrySet()) {
+// System.out.print("\nRole "+entry.getKey());
+// for (String value : entry.getValue()) {
+// System.out.print("\n\t"+value);
+// }
+// }
+// System.out.println("\n-------------------------");
+// }
+
+ /** If a tsuper role has non-structural changes, some sub-teams need to be recompiled.
+ * This set holds the teams to be recompiled.
+ *
+ * PRODUCERS: ClassFileChangeTracker.nonStructuralChange()
+ * ImageBuilder.shouldPreserveBinary() (during compile->finishedWith)
+ * CONSUMER: ImageBuilder.addAffectedTeamFiles()
+ *
+ * ENCODING: source file name
+ */
+ HashSet<String> teamsToRecompile = new HashSet<String>();
+
+ /** Get and clear the set of teams waiting for recompilation. */
+ HashSet<String> fetchTeamsToRecompile() {
+ HashSet<String> result = teamsToRecompile;
+ teamsToRecompile = new HashSet<String>();
+ return result;
+ }
+
+ /** If a tsuper role has non-structural changes, some sub-teams need to be recompiled.
+ * This set holds the roles that should NOT be preserved.
+ * PRODUCER: ClassFileChangeTracker.nonStructuralChange()
+ * CONSUMER: shouldPreserveBinary() (via shouldCandidateBePreserved())
+ *
+ * ENCODING: Qualified Type Name. p.T$I, canonical form, i.e., __OT__ prefixes removed.
+ */
+ HashSet<String> staleRoles = new HashSet<String>();
+
+ synchronized void initializeDependencyStorage() {
+ this.roleToSubTeams = new HashMap<String, Set<String>>();
+ this.teamsToRecompile = new HashSet<String>();
+ this.staleRoles = new HashSet<String>();
+ }
+
+ protected class BinaryType playedBy BinaryTypeBinding
+ {
+ /** Record if a given type depends on an unresolvable type.
+ * More specifically, we look for roles depending on unresolvable tsuper roles.
+ */
+ superInterfaces <- replace superInterfaces;
+ callin ReferenceBinding[] superInterfaces() {
+ try {
+ return base.superInterfaces();
+ } catch (AbortCompilation as Abort abort) {
+ abort.referencedBinaries.add(this);
+ throw abort;
+ }
+ }
+
+ // ==== Callouts: ====
+
+ char[][] compoundName() -> get char[][] compoundName;
+
+ // DEBUGGING:
+ String internalName() -> char[] internalName()
+ with { result <- new String(result) }
+ }
+
+ protected class ClassScope playedBy ClassScope
+ {
+ @SuppressWarnings("decapsulation")
+ void connectTypeHierarchy() <- replace void connectTypeHierarchy();
+ @SuppressWarnings("basecall")
+ callin void connectTypeHierarchy() {
+ try {
+ base.connectTypeHierarchy();
+ } catch (org.eclipse.jdt.internal.compiler.problem.AbortType at) {
+ TypeDeclaration referenceContext = referenceContext();
+ SourceTypeBinding sourceType = referenceContext.binding;
+ at.updateContext(referenceContext, referenceCompilationUnit().compilationResult);
+ referenceContext.ignoreFurtherInvestigation = true;
+ if (sourceType.superInterfaces == null)
+ sourceType.superInterfaces = TypeBinding.NO_SUPERINTERFACES; // TODO(SH): recurse?
+ // don't rethrow, marking ignoreFurtherInvestigation is enough abortion
+ }
+ }
+ TypeDeclaration referenceContext() -> get TypeDeclaration referenceContext;
+ CompilationUnitDeclaration referenceCompilationUnit() -> CompilationUnitDeclaration referenceCompilationUnit();
+ }
+
+ protected class LiftingEnv playedBy LiftingEnvironment
+ {
+ callin void init(TypeDeclaration teamType) {
+ try {
+ base.init(teamType);
+ } catch (org.eclipse.jdt.internal.compiler.problem.AbortType at) {
+ teamType.ignoreFurtherInvestigation = true;
+ BuildManager.this.teamsToRecompile.add(String.valueOf(teamType.compilationResult.fileName));
+ throw at; // TODO(SH): might want to mark certain AT-instances as recoverable?
+ }
+ }
+ init <- replace init;
+ }
+
+ /** This role helps to link Problem->Abort->BinaryType,
+ * in order to determine whether a problem was caused by an unresolvable tsuper role.
+ */
+ protected class Abort playedBy AbortCompilation
+ {
+ public List<BinaryType> referencedBinaries = new ArrayList<BinaryType>();
+
+ /** Trigger: this role has more to be updated from the context. */
+ void updateContext(ASTNode astNode, CompileResult unitResult)
+ <- after void updateContext(ASTNode astNode, CompilationResult unitResult);
+
+ /**
+ * If the current abort exception could possibly be fixed by a recompile,
+ * + convert the exception onto a less drastic AbortType
+ * + record the link Problem->Abort.
+ */
+ public void updateContext(ASTNode astNode, CompileResult unitResult) {
+ Problem problem = getProblem();
+ if ( problem != null
+ && problem.couldBeFixedByRecompile()
+ && unitResult.isReusingBinaryMember())
+ {
+ // convert AbortCompilation into AbortType
+ Abort abort = new AbortType(
+ new org.eclipse.jdt.internal.compiler.problem.AbortType(
+ unitResult, problem));
+ abort.referencedBinaries = this.referencedBinaries;
+ problem.abortException = abort;
+ RuntimeException ex = abort;
+ throw ex;
+ }
+ }
+
+ protected Problem getProblem() -> get CategorizedProblem problem;
+ }
+
+ protected class AbortType extends Abort playedBy AbortType
+ {
+// // FIXME : this ctor gives a VerifyError:
+// AbortType (CompileResult result, Problem problem) {
+// base(result, problem);
+// problem.abortException = this;
+// }
+ @Override
+ public void updateContext(ASTNode astNode, CompileResult unitResult) {
+ // no super call: would cause recursive creation of roles
+ Problem problem = getProblem();
+ if (problem != null) {
+ problem.abortException = this;
+ }
+ }
+ }
+
+ /** Intermediate purely callout role. */
+ protected class CompileResult playedBy CompilationResult
+ {
+ protected // don't publically export protected role Problem
+ Problem[] problems() -> get CategorizedProblem[] problems;
+
+ // TODO(SH): workaround for lowering problem concerning base call in ImageBuilder.shouldPreserveBinary()
+ boolean hasBinaryMember(char[] typeName) -> boolean hasBinaryMember(char[] typeName);
+
+ @SuppressWarnings({"decapsulation", "unchecked"})
+ protected
+ boolean isReusingBinaryMember() -> get ArrayList binaryMemberNames
+ with { result <- !(result == null || result.isEmpty()) }
+
+ char[] getFileName() -> char[] getFileName();
+ // debugging:
+ toString => toString;
+ }
+
+ /** Let a problem know about the associated exception. */
+ protected class Problem playedBy CategorizedProblem
+ {
+ public Abort abortException = null;
+ public char[] typeToRemove= null;
+
+ /** Certain problem reasons might be fixed by recompilation. */
+ protected boolean couldBeFixedByRecompile() {
+ switch (getID()) {
+ case IProblem.IsClassPathCorrect:
+ case IProblem.StaleTSuperRole:
+ case IProblem.StaleSubRole:
+ case IProblem.MissingRoleInBinaryTeam:
+ case IProblem.RoleFileInBinaryTeam:
+ case IProblem.CorruptBytecode:
+ case IProblem.MissingAccessorInBinary:
+ case IProblem.MismatchingRoleParts:
+ case IProblem.InconsistentlyResolvedRole:
+ case IProblem.NotGeneratingCallinBinding:
+ return true;
+ default:
+ return false;
+ }
+ }
+
+ int getID() -> int getID();
+ // debugging:
+ toString => getMessage;
+ }
+
+ /** Watch specific error reports. */
+ protected class ProblemReporter playedBy ProblemReporter {
+
+ // a missing role in a binary team means the binary team should probably be deleted.
+ void missingRoleInBinaryTeam(ReferenceBinding type)
+ <- replace void missingRoleInBinaryTeam(char[] roleName, ReferenceBinding enclosingTeam)
+ with { type <- enclosingTeam }
+
+ callin void missingRoleInBinaryTeam(ReferenceBinding type) {
+ ReferenceContext context= getReferenceContext();
+ try {
+ base.missingRoleInBinaryTeam(type);
+ } finally {
+ if (context != null && context.compilationResult() != null) {
+ int count= context.compilationResult().problemCount;
+ recordTypeToRemove(context.compilationResult().problems[count-1],
+ type.constantPoolName());
+ }
+ }
+ }
+
+ ReferenceContext getReferenceContext() -> get ReferenceContext referenceContext;
+ }
+
+ // ---- ImageBuilder is a role file ----
+
+
+ // ---- Team level features: ----
+ void recordTypeToRemove(CategorizedProblem as Problem prob, char[] roleName) {
+ prob.typeToRemove= roleName;
+ }
+
+ public static boolean isPredefinedRole(char[] roleName) {
+ int dollarPos = CharOperation.lastIndexOf('$', roleName);
+ if (dollarPos != -1)
+ roleName = CharOperation.subarray(roleName, dollarPos+1, -1);
+ return CharOperation.equals(roleName, IOTConstants.CONFINED)
+ || CharOperation.equals(roleName, IOTConstants.OTCONFINED)
+ || CharOperation.equals(roleName, IOTConstants.ICONFINED)
+ || CharOperation.equals(roleName, IOTConstants.IBOUNDBASE)
+ || CharOperation.equals(roleName, IOTConstants.ILOWERABLE);
+ }
+
+ /** Answer whether the given role type should be re-used (ask the ImageBuilder). */
+ public boolean shouldPreserveBinaryRole(ReferenceBinding role, CompilationResult as CompileResult cResult) {
+ if (builder == null)
+ return true;
+ return builder.shouldPreserveBinaryRole(role, cResult);
+ }
+
+ public String canonicalName(String roleName) {
+ return roleName.replace(IOTConstants.OT_DELIM, ""); //$NON-NLS-1$
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/BuildManager/ClassFileChangeTracker.java b/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/BuildManager/ClassFileChangeTracker.java
new file mode 100644
index 000000000..f1d9b756e
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/BuildManager/ClassFileChangeTracker.java
@@ -0,0 +1,62 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: ClassFileChangeTracker.java 23451 2010-02-04 20:33:32Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+team package org.eclipse.objectteams.otdt.internal.compiler.adaptor.BuildManager;
+
+import org.eclipse.objectteams.otdt.core.compiler.IOTConstants;
+
+
+/**
+ * This class tracks whenever a classfile has non-structural changes.
+ * In that case a re-compile is needed iff the class is a role of
+ * which copies exist in subteams within the workspace/project.
+ *
+ * @author stephan
+ */
+@SuppressWarnings("restriction")
+public class ClassFileChangeTracker playedBy ClassFileReader
+{
+ void nonStructuralChange(String className) <- after boolean hasStructuralChanges(byte[] newBytes)
+ when (!result)
+ with {className <- new String(base.getName())}
+
+ /** No structural changes where detected, yet bytes differ.*/
+ // static for optimization (avoid lifting).
+ protected static void nonStructuralChange(String className) {
+ className = className.replace('/', '.');
+ if (DEBUG >= 2)
+ System.out.println("Non-structural change for "+className); //$NON-NLS-1$
+ int dollarPos = className.lastIndexOf('$');
+ if (dollarPos == -1)
+ return; // not a role
+ String roleName = canonicalName(className.substring(dollarPos+1)); //excluding '$'
+ Set<String> teamSourceFileNames = BuildManager.this.roleToSubTeams.get(className);
+ if (teamSourceFileNames != null)
+ for (String teamSourceFileName : teamSourceFileNames) {
+ if (DEBUG > 0)
+ System.out.println("need to recompile "+teamSourceFileName); //$NON-NLS-1$
+ BuildManager.this.teamsToRecompile.add(teamSourceFileName);
+ String teamTypeName = teamSourceFileName.substring(0, teamSourceFileName.length()-5); // .java
+ // mark both parts (class/ifc) as stale:
+ BuildManager.this.staleRoles.add(teamTypeName+'$'+roleName);
+ BuildManager.this.staleRoles.add(teamTypeName+'$'+IOTConstants.OT_DELIM+roleName);
+ }
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/BuildManager/ImageBuilder.java b/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/BuildManager/ImageBuilder.java
new file mode 100644
index 000000000..f434f764e
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/BuildManager/ImageBuilder.java
@@ -0,0 +1,269 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: ImageBuilder.java 23451 2010-02-04 20:33:32Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+team package org.eclipse.objectteams.otdt.internal.compiler.adaptor.BuildManager;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jdt.core.compiler.CharOperation;
+import org.eclipse.jdt.internal.core.builder.SourceFile;
+import org.eclipse.jdt.internal.core.builder.WorkQueue;
+import org.eclipse.objectteams.otdt.core.compiler.OTNameUtils;
+
+/**
+ * @author stephan
+ */
+@SuppressWarnings("restriction")
+protected class ImageBuilder playedBy IncrementalImageBuilder
+{
+ ImageBuilder (IncrementalImageBuilder builder) {
+ BuildManager.this.builder = this;
+ }
+
+ // Set of teams being compiled due to our special request.
+ // don't preserve binary roles within such a team.
+ private HashSet<String> teamsForcedRecompilation = new HashSet<String>();
+ resetQueue:
+ void resetQueue() <- after void compile(SourceFile[] files);
+ void resetQueue() {
+ teamsForcedRecompilation.clear();
+ }
+
+ /**
+ * Trigger B1: During processing a type with errors ...
+ */
+ storeProblemsFor <- replace storeProblemsFor;
+
+ /** Before storing problems for a given source file, check whether the problem
+ * could be due to a binary role referring to a stale or missing tsuper-copy.
+ * In that case trigger recompilation.
+ * The binary file will be deleted later ...
+ */
+ callin void storeProblemsFor(SourceFile sourceFile, Problem[] problems)
+ throws org.eclipse.core.runtime.CoreException
+ {
+ if (sourceFile != null && problems != null && problems.length > 0) {
+ Problem[] remainingProblems = new Problem[problems.length];
+ int count = 0;
+ for (int i = 0; i < problems.length; i++) {
+ if (problems[i].couldBeFixedByRecompile()) {
+ // record the source file for recompilation:
+ ArrayList<SourceFile> sourceFiles = sourceFiles();
+ if (!sourceFiles.contains(sourceFile)) {
+ sourceFiles.add(sourceFile);
+ if (DEBUG>0)
+ System.out.println("Abort causes recompile of "+sourceFile); //$NON-NLS-1$
+ }
+ // don't add the problem to remainingProblems, because any IProblem.IsClassPathCorrect
+ // will abort this compilation! (we still think, we can fix this problem..)
+ char[] typePath= problems[i].typeToRemove;
+ if (typePath != null)
+ this.scheduleForRemoval(sourceFile, String.valueOf(typePath));
+ } else {
+ remainingProblems[count++] = problems[i];
+ }
+ }
+ if (count < problems.length)
+ System.arraycopy(remainingProblems, 0, problems = new Problem[count], 0, count);
+ }
+ base.storeProblemsFor(sourceFile, problems);
+ }
+
+ void scheduleForRemoval(SourceFile sourceFile, String typePath)
+ -> void scheduleForRemoval(SourceFile sourceFile, String typePath);
+
+ /**
+ * Trigger B2: During finishedWith() generated binary files are deleted, but some
+ * should perhaps be preserved...
+ */
+ shouldPreserveBinary <- replace shouldPreserveBinary;
+
+ /**
+ * If the given binary type is a re-used member (role) preserve the binary file,
+ * HOWEVER, if it has dependency problems do NOT preserve it.
+ *
+ * @param cResult
+ * @param sourceFolder
+ * @param packagePath
+ * @param binaryTypeName
+ * @return
+ */
+ callin boolean shouldPreserveBinary(CompileResult cResult,
+ IPath sourceFolder,
+ IPath packagePath,
+ char[] binaryTypeName)
+ {
+ // don't preserve re-used binary types with problems. They might be stale.
+ if (!base.shouldPreserveBinary(cResult, sourceFolder, packagePath, binaryTypeName))
+ return false;
+ return shouldPreserveBinaryRole(cResult, sourceFolder, packagePath, binaryTypeName);
+ }
+ /** Entry from AdaptorActivator.CopyInheritanceObserver (via BuildManager): */
+ protected boolean shouldPreserveBinaryRole(ReferenceBinding role, CompileResult cResult) {
+ String fileName = new String(cResult.getFileName());
+ IPath packagePath = new Path(fileName).removeLastSegments(1);
+ int packageDepth = role.getPackage().compoundName.length;
+ IPath sourceFolder = packagePath.removeLastSegments(packageDepth);
+ packagePath = packagePath.removeFirstSegments(sourceFolder.segmentCount());
+ char[][] roleName = CharOperation.splitOn('.', role.attributeName());
+ boolean result = shouldPreserveBinaryRole(cResult, sourceFolder, packagePath, roleName[roleName.length-1]); // Team$Role
+ if (!result)
+ scheduleForRemoval(findTeamSourceFile(fileName), new String(role.constantPoolName()));
+ return result;
+ }
+ /** Common implementation for the two entries above.
+ * Both clients when receiving a 'false' answer will remove the stale binary class.
+ * This will ensure that during the next cycle this type will be compiled from source.
+ */
+ boolean shouldPreserveBinaryRole(CompileResult cResult, IPath sourceFolder, IPath packagePath, char[] binaryTypeName)
+ {
+ // binary type with problem -> NO
+ if (binaryHasProblem(cResult.problems(), binaryTypeName))
+ return false;
+
+ String binaryTypeString = packagePath.toString()+"/"+new String(binaryTypeName);
+ if (DEBUG >= 2)
+ System.out.print("candidate for preserving: "+binaryTypeString); //$NON-NLS-1$
+
+ // predefined type -> YES
+ if (isPredefinedRole(binaryTypeName)) {
+ if (DEBUG >= 2)
+ System.out.println(" YES(predefined)."); //$NON-NLS-1$
+ return true;
+ }
+ // others: further investigate.
+ boolean shouldPreserve = shouldCandidateBePreserved(sourceFolder, binaryTypeString);
+ if (!shouldPreserve)
+ // propagate changes down to sub-teams:
+ ClassFileChangeTracker.nonStructuralChange(binaryTypeString);
+ return shouldPreserve;
+ }
+ /** Checks the following reasons against preserving:<ul>
+ * <li> the enclosing team is forced for recompilation (meaning: full recompilation)
+ * <li> the given type is a role known to be stale */
+ boolean shouldCandidateBePreserved(IPath sourceFolder, String binaryTypeString)
+ {
+ int dollarPos = binaryTypeString.lastIndexOf('$');
+ String enclosingRelativeFileString = binaryTypeString.substring(0, dollarPos)+".java"; //$NON-NLS-1$
+ String enclosingAbsoluteFileString = sourceFolder.append(enclosingRelativeFileString).toString();
+ for (String teamFileName : teamsForcedRecompilation) {
+ if (teamFileName.equals(enclosingAbsoluteFileString)) {
+ if (DEBUG >= 2)
+ System.out.println(" NO(forced)."); //$NON-NLS-1$
+ BuildManager.this.teamsToRecompile.add(teamFileName); // let binary roles be removed and try again.
+ return false;
+ }
+ }
+ binaryTypeString = sourceFolder.append(binaryTypeString).toString();
+ if (BuildManager.this.staleRoles.contains(binaryTypeString)) {
+ BuildManager.this.staleRoles.remove(binaryTypeString);
+ if (DEBUG >= 2)
+ System.out.println(" NO(changed).");
+ return false;
+ }
+
+ if (DEBUG >= 2)
+ System.out.println(" YES");
+ return true;
+ }
+
+ /** Is the given binary type known to have an unresolved dependency? */
+ boolean binaryHasProblem(Problem[] problems, char[] binaryTypeName) {
+ if (problems != null)
+ for (Problem problem : problems)
+ if (problem != null && problem.abortException != null) {
+ Abort abort = problem.abortException;
+ for (BinaryType binding : abort.referencedBinaries) {
+ char[][] compoundName = binding.compoundName();
+ if (CharOperation.equals(compoundName[compoundName.length-1], binaryTypeName))
+ return true;
+ }
+ }
+ // remove "__OT__" from binaryTypeName
+ char[] strippedName = OTNameUtils.removeOTDelim(binaryTypeName);
+ if (strippedName != binaryTypeName)
+ return binaryHasProblem(problems, strippedName);
+ return false;
+ }
+
+ // Trigger: after adding source files to compile,
+ // consider any roles which have been copied:
+ // if the source changed, all sub teams must be recompiled.
+ void addAffectedTeamFiles() <- after void addAffectedSourceFiles();
+
+ void addAffectedTeamFiles() {
+ // fetch sets of teams:
+ Set<String> teamFiles = fetchTeamsToRecompile();
+
+ ArrayList<SourceFile> sourceFiles = sourceFiles();
+
+ // add all relevant teams to sourceFiles:
+ for (String teamName : teamFiles) {
+ SourceFile teamFile = findTeamSourceFile(teamName);
+ if ( teamFile != null
+ && !sourceFiles.contains(teamFile))
+ {
+ if (DEBUG>0)
+ System.out.println("Scheduling for recompilation: teamFile "+teamFile+" for "+teamName); //$NON-NLS-1$ //$NON-NLS-2$
+ sourceFiles.add(teamFile);
+ teamsForcedRecompilation.add(teamName);
+ }
+ }
+ }
+ SourceFile findTeamSourceFile(String teamName) {
+ IWorkspace ws = ResourcesPlugin.getWorkspace();
+ IFile file = ws.getRoot().getFile(new Path(teamName));
+ return findSourceFile(file);
+ }
+
+ // ==== GENERAL ACCESS TO BASE ELEMENTS: ====
+
+ @SuppressWarnings("decapsulation")
+ SourceFile findSourceFile(IFile file) -> SourceFile findSourceFile(IFile file, boolean mustExist)
+ with { file -> file, true -> mustExist, result <- result }
+
+ @SuppressWarnings({"decapsulation", "unchecked"})
+ ArrayList<SourceFile> sourceFiles() -> get ArrayList<SourceFile> sourceFiles;
+
+ @SuppressWarnings("decapsulation")
+ WorkQueue getWorkQueue() -> get WorkQueue workQueue;
+
+ // ==== LOGGING ====
+ void logCompile(String msg) <- before void compile(SourceFile[] units)
+ with { msg <- "Starting" }
+
+ logDone:
+ void logCompile(String msg) <- after void compile(SourceFile[] units)
+ with { msg <- "Done" }
+
+ void logCompile(String msg)
+ when (DEBUG > 0)
+ {
+ System.out.println("Incremental compilation: "+msg+" for "+getWorkQueue());
+ }
+
+ precedence resetQueue, logDone;
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/CompilationThreadWatcher.java b/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/CompilationThreadWatcher.java
new file mode 100644
index 000000000..7b4ca0cb5
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/CompilationThreadWatcher.java
@@ -0,0 +1,48 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2008 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: CompilationThreadWatcher.java 23451 2010-02-04 20:33:32Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.compiler.adaptor;
+
+import base org.eclipse.jdt.internal.compiler.ProcessTaskManager;
+
+/**
+ * This team observes the ProcessTaskManager in order to extend team activation
+ * of sub-teams to the processingTask once it is created.
+ *
+ * @author stephan
+ * @since 1.2.0
+ */
+@SuppressWarnings("restriction")
+public team class CompilationThreadWatcher
+{
+ protected class ProcessTaskManager playedBy ProcessTaskManager
+ {
+
+ @SuppressWarnings("decapsulation")
+ Thread getProcessingThread() -> get Thread processingThread;
+
+
+ extendActivation <- after setConfig;
+ void extendActivation() {
+ CompilationThreadWatcher.this.activate(getProcessingThread());
+ }
+
+
+ void cleanup() <- after void run();
+ void cleanup() { CompilationThreadWatcher.this.deactivate(); }
+
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/IllegalReusedBinaryRoleException.java b/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/IllegalReusedBinaryRoleException.java
new file mode 100644
index 000000000..04f52fb47
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/IllegalReusedBinaryRoleException.java
@@ -0,0 +1,29 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: IllegalReusedBinaryRoleException.java 23451 2010-02-04 20:33:32Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.compiler.adaptor;
+
+@SuppressWarnings("serial")
+public class IllegalReusedBinaryRoleException extends RuntimeException {
+ public IllegalReusedBinaryRoleException(String msg) {
+ super(msg);
+ }
+
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/PDEAdaptor.java b/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/PDEAdaptor.java
new file mode 100644
index 000000000..ff3c44829
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/PDEAdaptor.java
@@ -0,0 +1,273 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2007 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: PDEAdaptor.java 23451 2010-02-04 20:33:32Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.compiler.adaptor;
+
+import java.io.InputStream;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jdt.core.IAccessRule;
+import org.eclipse.jdt.core.compiler.IProblem;
+import org.eclipse.jdt.internal.core.ClasspathAccessRule;
+import org.eclipse.osgi.service.resolver.BundleDescription;
+import org.eclipse.osgi.service.resolver.ExportPackageDescription;
+import org.eclipse.osgi.service.resolver.StateHelper;
+import org.eclipse.pde.core.plugin.IPluginModelBase;
+import org.eclipse.pde.internal.core.ibundle.IBundlePluginModelBase;
+
+import base org.eclipse.pde.internal.core.PDEClasspathContainer;
+import base org.eclipse.pde.internal.core.RequiredPluginsClasspathContainer;
+import base org.eclipse.pde.internal.core.PDEClasspathContainer.Rule;
+import base org.eclipse.pde.internal.core.bundle.BundlePluginModel;
+import base org.eclipse.pde.internal.core.plugin.WorkspaceExtensionsModel;
+
+/**
+ * Adapt classes from the PDE core as to feed information about aspectBindings
+ * into the compilation process (to be consumed by BaseImportChecker).
+ *
+ * Final target as expected by the BaseImportChecker:
+ * + aspectBindingData (of type AdaptedBaseBundle) have been added to ClasspathAccessRules
+ * and the problemID has been adjusted.
+ *
+ *
+ * @author stephan
+ * @since 1.1.5
+ */
+@SuppressWarnings("restriction")
+public team class PDEAdaptor
+{
+ static PDEAdaptor instance;
+
+ public PDEAdaptor() {
+ instance= this;
+ }
+
+ /**
+ * <ul>
+ * <li>Store aspectBinding info in Role objects.</li>
+ * <li>Add additional rules for forcedExports.</li>
+ * </ul>
+ */
+ protected class RequiredPluginsClasspathContainer
+ extends PDEClasspathContainer
+ playedBy RequiredPluginsClasspathContainer
+ {
+
+ protected AspectBindingReader aspectBindingReader;
+
+ void updateRule(String providingBundle, Rule rule)
+ <- after Rule getRule(StateHelper helper, BundleDescription desc, ExportPackageDescription export)
+ with { providingBundle <- export.getExporter().getSymbolicName(),
+ rule <- result
+ }
+ /** Handles adaptation info for exported packages, Rule role created via regular lifting. */
+ void updateRule(String providingBundle, Rule rule) {
+ if (aspectBindingReader != null && aspectBindingReader.isAdaptedBase(providingBundle)) {
+ // no merging because rule (base & role) are fresh instances
+ rule.aspectBindingData= aspectBindingReader.getAdaptationInfo(providingBundle);
+ }
+ }
+
+ @SuppressWarnings({ "decapsulation", "rawtypes" })
+ Rule[] addForcedExports(BundleDescription desc)
+ <- replace Rule[] getInclusions(Map map, BundleDescription desc)
+ with { desc <- desc }
+ /** Handles adaptation info for non-exported packages, Rule role explicitly created. */
+ callin Rule[] addForcedExports(BundleDescription desc)
+ {
+ Rule[] regularRules= base.addForcedExports(desc);
+ if (aspectBindingReader == null)
+ return regularRules; // done: no aspect bindings
+ HashSet<String> forcedExports= aspectBindingReader.getForcedExports(desc.getSymbolicName());
+ if (forcedExports == null)
+ return regularRules; // done: no forced exports
+
+ AdaptedBaseBundle aspectBindingData= aspectBindingReader.getAdaptationInfo(desc.getSymbolicName());
+ // create additional rules:
+ Rule[] additionalRules= new Rule[forcedExports.size()];
+ Iterator<String> exportIter= forcedExports.iterator();
+ for (int i = 0; i < additionalRules.length; i++)
+ additionalRules[i]= new Rule(this, aspectBindingData, exportIter.next());
+
+ // merge arrays:
+ int len1= regularRules.length, len2= additionalRules.length;
+ Rule[] result= new Rule[len1+len2];
+ System.arraycopy(additionalRules, 0, result, 0, len2);
+ System.arraycopy(regularRules, 0, result, len2, len1);
+
+ return result;
+ }
+
+ @SuppressWarnings("decapsulation")
+ protected
+ BundleModel getBundleModel() -> get IPluginModelBase fModel
+ with { result <- (BundlePluginModel)fModel }
+
+ // -- debug: --
+ String baseToString() => String toString();
+
+ @SuppressWarnings("nls")
+ @Override
+ public String toString() {
+ return "Role for "+baseToString()+" with aspectBindingReader\n "
+ + ((this.aspectBindingReader != null) ? this.aspectBindingReader.toString() : "null");
+ }
+ }
+
+ /**
+ * Synthetic rules representing adapted or forcedExports.
+ */
+ @SuppressWarnings("decapsulation")
+ protected class Rule playedBy Rule
+ {
+ void setPath(IPath path) -> set IPath path;
+
+ // intermediate storage between AspectBindingReader and ClasspathAccessRule:
+ protected AdaptedBaseBundle aspectBindingData;
+ protected boolean isForcedExport;
+
+ /** Ctor for force-exported packages (merely adapted packages instantiate via lifting ctor). */
+ protected Rule(RequiredPluginsClasspathContainer encl, AdaptedBaseBundle aspectBindingData, String packageName)
+ {
+ encl.base();
+ String pattern= packageName.replace('.', '/')+"/*"; //$NON-NLS-1$
+ setPath(new Path(pattern));
+ this.aspectBindingData= aspectBindingData;
+ this.isForcedExport= true;
+ }
+ // -- debug: --
+ String baseToString() => String toString();
+
+ @SuppressWarnings("nls")
+ @Override
+ public String toString() {
+ String result= baseToString();
+ if (this.isForcedExport)
+ result+= " (forced export)";
+ return result+" with aspect data\n "
+ + ((this.aspectBindingData == null) ? "null" : this.aspectBindingData.toString());
+ }
+ }
+
+ /** After converting Rules to IAccessRules transfer adaptation info and adjust problemId. */
+ protected class PDEClasspathContainer playedBy PDEClasspathContainer
+ {
+ void getAccessRules(Rule[] rules, IAccessRule[] accessRules)
+ <- after IAccessRule[] getAccessRules(Rule[] rules)
+ with { rules <- rules, accessRules <- result }
+ static void getAccessRules(Rule[] rules, IAccessRule[] accessRules) {
+ for (int i = 0; i < rules.length; i++) {
+ Rule rule = rules[i];
+ if (rule.aspectBindingData != null) {
+ ClasspathAccessRule classpathAccessRule = (ClasspathAccessRule)accessRules[i];
+ if (rule.isForcedExport) {
+ // don't let this rule leak to other clients
+ classpathAccessRule = new ClasspathAccessRule(classpathAccessRule.pattern, IProblem.BaseclassDecapsulationForcedExport);
+ classpathAccessRule.aspectBindingData = new Object[] { rule.aspectBindingData };
+ accessRules[i] = classpathAccessRule;
+ } else {
+ addAspectBindingData(classpathAccessRule, rule.aspectBindingData);
+ }
+ }
+ }
+ }
+ }
+ /**
+ * Add the given aspect binding data to the given access rule.
+ * @return: has data been added (vs. merged or already present)?
+ */
+ public static boolean addAspectBindingData(ClasspathAccessRule accessRule, AdaptedBaseBundle aspectBindingData) {
+ // nothing present yet?
+ if (accessRule.aspectBindingData == null) {
+ accessRule.aspectBindingData = new Object[] { aspectBindingData };
+ if (accessRule.problemId == 0)
+ accessRule.problemId= IProblem.AdaptedPluginAccess;
+ return true;
+ }
+ // exact binding data already present?
+ for (Object data : accessRule.aspectBindingData)
+ if (data == aspectBindingData)
+ return false;
+ // different binding data for the same base bundle present?
+ for (Object data : accessRule.aspectBindingData)
+ if (((AdaptedBaseBundle)data).merge(aspectBindingData))
+ return false;
+ // different base bundles, must be the case of split packages
+ for (Object data : accessRule.aspectBindingData)
+ ((AdaptedBaseBundle)data).hasPackageSplit = true;
+ aspectBindingData.hasPackageSplit = true;
+ int len = accessRule.aspectBindingData.length;
+ System.arraycopy(accessRule.aspectBindingData, 0, accessRule.aspectBindingData = new Object[len+1], 0, len);
+ accessRule.aspectBindingData[len] = aspectBindingData;
+ return true;
+ }
+
+ /** Helper role for updating aspect binding information. */
+ protected class BundleModel playedBy BundlePluginModel {
+ protected AspectBindingReader aspectBindingReader;
+
+ }
+
+ /**
+ * This role listens to updates on its base.
+ * If the associated bundle model has a role with a registered
+ * aspect binding reader, trigger reloading when the model has changed.
+ */
+ protected class ModelListener playedBy WorkspaceExtensionsModel {
+ void resetAspectReader() <- after void load(InputStream is, boolean reload);
+ void resetAspectReader () throws CoreException {
+ try {
+ BundleModel bundle= getFBundleModel();
+ if (bundle != null && bundle.aspectBindingReader != null)
+ bundle.aspectBindingReader.reload();
+ } catch (ClassCastException cce) {
+ // CCE could be thrown by parameter mapping of getFBundleModel().
+ }
+ }
+ /** This declaration is for documentation only: read the fBundleModel field.
+ * @return a BundleModel role
+ * @throws ClassCastException thrown when fBundleModel is not a BundlePluginModel.
+ */
+ abstract BundleModel getFBundleModel() throws ClassCastException;
+ @SuppressWarnings("decapsulation")
+ BundleModel getFBundleModel() -> get IBundlePluginModelBase fBundleModel
+ with { result <- (BundlePluginModel)fBundleModel }
+ }
+
+ /** Register an aspect binding reader for a given RequiredPluginsClasspathContainer. */
+ void setAspectBindingReader(AspectBindingReader aspectBindingReader,
+ RequiredPluginsClasspathContainer as RequiredPluginsClasspathContainer container)
+ {
+ container.aspectBindingReader= aspectBindingReader;
+ try {
+ // link bundle model and reader for updating lateron:
+ BundleModel bundle= container.getBundleModel();
+ if (bundle != null)
+ bundle.aspectBindingReader= aspectBindingReader;
+ } catch (ClassCastException cce) {
+ // can happen in param mapping of c-t-f, wrong model type, ignore.
+ }
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/PlainProjectWatcher.java b/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/PlainProjectWatcher.java
new file mode 100644
index 000000000..d1258cebb
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/PlainProjectWatcher.java
@@ -0,0 +1,57 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2007 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: PlainProjectWatcher.java 23451 2010-02-04 20:33:32Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.compiler.adaptor;
+
+import org.eclipse.jdt.core.compiler.IProblem;
+import org.eclipse.jdt.internal.compiler.ast.ASTNode;
+import org.eclipse.jdt.internal.compiler.env.AccessRestriction;
+import org.eclipse.jdt.internal.compiler.lookup.FieldBinding;
+import org.eclipse.jdt.internal.compiler.lookup.MethodBinding;
+import org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
+
+import base org.eclipse.jdt.internal.compiler.problem.ProblemReporter;
+
+/**
+ * This team advises the ProblemReporter for non-OT-Plugin projects.
+ * These projects must simply ignore `AccessRestrictions' with
+ * problemId AdaptedPluginAccess, which is not a real problem.
+ *
+ * @author stephan
+ * @since 1.1.5
+ */
+@SuppressWarnings("restriction")
+public team class PlainProjectWatcher extends CompilationThreadWatcher
+{
+ protected class ProblemReporter playedBy ProblemReporter
+ {
+ void forbiddenReference(AccessRestriction restriction)
+ <- replace void forbiddenReference(TypeBinding type, ASTNode location, byte entryType, AccessRestriction restriction),
+ void forbiddenReference(FieldBinding field, ASTNode location, byte entryType, AccessRestriction restriction),
+ void forbiddenReference(MethodBinding method, ASTNode location, byte entryType, AccessRestriction restriction)
+ with { restriction <- restriction }
+
+ @SuppressWarnings("basecall")
+ callin void forbiddenReference(AccessRestriction restriction) {
+ if (restriction.getProblemId() != IProblem.AdaptedPluginAccess)
+ base.forbiddenReference(restriction);
+ }
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/ProjectUtil.java b/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/ProjectUtil.java
new file mode 100644
index 000000000..a7d4b5cb1
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/ProjectUtil.java
@@ -0,0 +1,63 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2007 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: ProjectUtil.java 23451 2010-02-04 20:33:32Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.compiler.adaptor;
+
+import org.eclipse.core.internal.resources.Project;
+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.ICompilationUnit;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.internal.core.ExternalJavaProject;
+import org.eclipse.objectteams.otdt.core.ext.OTJavaNature;
+
+@SuppressWarnings("restriction")
+public class ProjectUtil {
+
+ static final String PLUGIN_ID = "org.eclipse.objectteams.otdt.internal.compiler.adaptor"; //$NON-NLS-1$
+
+ // Don't use API from from PDE, to reduce dependencies.
+ static final String PLUGIN_NATURE = "org.eclipse.pde.PluginNature"; //$NON-NLS-1$
+
+ public static Project safeGetOTPluginProject(ICompilationUnit unitElem) {
+ IJavaProject project= unitElem.getJavaProject();
+ if (ProjectUtil.isOTPluginProject(project.getProject()))
+ return (Project)project.getProject();
+ return null;
+ }
+
+ public static boolean isOTPluginProject(IProject project) {
+ if (project == null) return false;
+ try {
+ return project.hasNature(PLUGIN_NATURE)
+ && OTJavaNature.hasOTJavaNature(project);
+ } catch (CoreException e) {
+ if (!ExternalJavaProject.EXTERNAL_PROJECT_NAME.equals(project.getName())) // see JavaProject.hasJavaNature()
+ JavaCore.getJavaCore().getLog().log(new Status(IStatus.ERROR,
+ PLUGIN_ID,
+ "Error reading project natures", //$NON-NLS-1$
+ e));
+ return false;
+ }
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/ResourceProjectAdaptor.java b/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/ResourceProjectAdaptor.java
new file mode 100644
index 000000000..333aa95f5
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/ResourceProjectAdaptor.java
@@ -0,0 +1,86 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2008, 2010 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: ResourceProjectAdaptor.java 23451 2010-02-04 20:33:32Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.compiler.adaptor;
+
+import org.objectteams.LiftingVetoException;
+import org.objectteams.Team;
+
+import base org.eclipse.core.internal.resources.Project;
+
+/**
+ * Simple decoration of class Project from org.eclipse.core.resources.
+ *
+ * @author stephan
+ * @since 1.1.8
+ */
+@SuppressWarnings("restriction")
+public team class ResourceProjectAdaptor
+{
+ private static ResourceProjectAdaptor instance;
+ public ResourceProjectAdaptor() {
+ instance= this;
+ }
+ public static ResourceProjectAdaptor getDefault() { return instance; }
+
+ /** Associate an AspectBindingReader and a BaseImportChecker to each OT Plugin project. */
+ protected class OTEquinoxProject playedBy Project
+ {
+ protected AspectBindingReader aspectBindingReader;
+ protected BaseImportChecker checker;
+
+ /**
+ * Lifting constructor which refuses lifting for non OT-plugin projects,
+ * or if the project is not yet ready for reading plugin.xml.
+ */
+ public OTEquinoxProject(Project baseProject) {
+ try {
+ if (!ProjectUtil.isOTPluginProject(baseProject))
+ throw new org.objectteams.LiftingVetoException();
+ this.aspectBindingReader = new AspectBindingReader(baseProject); // may also throw LVE.
+ this.checker= new BaseImportChecker(this.aspectBindingReader);
+ } catch (LiftingVetoException lve) {
+ // no success: unregister this useless role
+ ResourceProjectAdaptor.this.unregisterRole(this, OTEquinoxProject.class);
+ throw lve; // will be caught in several clients within AdaptorActivator
+ }
+ }
+ /** ask for changes to determine if classpath has to be recomputed: */
+ protected boolean hasAspectDataChanged () {
+ return this.aspectBindingReader != null
+ && this.aspectBindingReader.fetchHasChanges();
+ }
+ }
+
+ // ======== API: =========
+
+ public Team getChecker(Project as OTEquinoxProject project)
+ throws LiftingVetoException
+ {
+ return project.checker;
+ }
+ public AspectBindingReader getAspectBindingReader(Project as OTEquinoxProject project)
+ throws LiftingVetoException
+ {
+ return project.aspectBindingReader;
+ }
+ public boolean hasAspectDataChanged(Project as OTEquinoxProject project)
+ throws LiftingVetoException
+ {
+ return project.hasAspectDataChanged();
+ }
+
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/RoleReuseGuard.java b/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/RoleReuseGuard.java
new file mode 100644
index 000000000..634518702
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/RoleReuseGuard.java
@@ -0,0 +1,197 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2006, 2010 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: RoleReuseGuard.java 23451 2010-02-04 20:33:32Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.compiler.adaptor;
+
+import org.eclipse.jdt.core.compiler.CharOperation;
+import org.eclipse.jdt.internal.compiler.classfmt.ClassFileStruct;
+import org.eclipse.jdt.internal.compiler.env.AccessRestriction;
+import org.eclipse.jdt.internal.compiler.env.IBinaryType;
+import org.eclipse.jdt.internal.compiler.lookup.PackageBinding;
+import org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding;
+import org.eclipse.objectteams.otdt.core.compiler.IOTConstants;
+
+import base org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding;
+import base org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment;
+import base org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding;
+import base org.eclipse.objectteams.otdt.internal.core.compiler.ast.RoleFileCache;
+import base org.eclipse.objectteams.otdt.internal.core.compiler.bytecode.AbstractAttribute;
+import base org.eclipse.objectteams.otdt.internal.core.compiler.bytecode.WordValueAttribute;
+
+/**
+ * This team avoids the situation that a source team when loading its RoFi cache
+ * loads a binary role which is neither purely copied nor a role file.
+ * Such roles are either stale (no longer present in the team) or in some other
+ * way conflict with a role currently being translated.
+ *
+ * By intervening in classfile lookup we prevent conflicting binaries to be
+ * stored by the LookupEnvironment.
+ *
+ * @author stephan
+ */
+@SuppressWarnings("restriction")
+public team class RoleReuseGuard
+{
+ public static int DEBUG = 2; // levels: 0 nothing, 1 some, 2 more.
+
+ // ==== the following roles communicate a cflow-dependency via this field: ====
+ static ThreadLocal<Object> isLoadingRolesOfSourceType = new ThreadLocal<Object>();
+
+ /** Reflect base super-class by a corresponding role super-class. */
+ protected class AbstractAttribute playedBy AbstractAttribute {
+ protected boolean nameEquals(char[] name) -> boolean nameEquals(char[] name);
+ }
+
+ /** This role is a trigger in UseCase A. */
+ protected class WordValueAttribute
+ extends AbstractAttribute
+ playedBy WordValueAttribute
+ {
+ void checkClassFlags(WordValueAttribute attr)
+ <- after WordValueAttribute readClassFlags(ClassFileStruct reader,
+ int readOffset,
+ int[] constantPoolOffsets)
+ with { attr <- result }
+
+ static void checkClassFlags(WordValueAttribute attr) {
+ if (RoleReuseGuard.isLoadingRolesOfSourceType.get() != null)
+ checkNonReusableRole(attr.getValue());
+ }
+ @SuppressWarnings("decapsulation")
+ protected
+ int getValue() -> get int _value;
+ toString => toString;
+ }
+
+ /** A pure cflow-guard. */
+ protected class RoFiTracker
+ playedBy RoleFileCache
+ {
+ @SuppressWarnings("decapsulation")
+ cflow <- replace readBinary;
+ @SuppressWarnings("basecall")
+ callin void cflow() {
+ Object save = isLoadingRolesOfSourceType.get();
+ isLoadingRolesOfSourceType.set(new Object());
+ try {
+ base.cflow();
+ } catch (IllegalReusedBinaryRoleException irbre) {
+ // do nothing. role could simply not be re-used.
+ } finally {
+ isLoadingRolesOfSourceType.set(save);
+ }
+ }
+ }
+
+ protected class SourceTypeBinding playedBy SourceTypeBinding
+ {
+ getMemberType <- replace getMemberType;
+ @SuppressWarnings("basecall")
+ callin ReferenceBinding getMemberType(char[] name) {
+ Object save = isLoadingRolesOfSourceType.get();
+ isLoadingRolesOfSourceType.set(new Object());
+ try {
+ return base.getMemberType(name);
+ } catch (IllegalReusedBinaryRoleException ex) {
+ if (DEBUG>0)
+ System.out.println("refused reusing type "+new String(name)); //$NON-NLS-1$
+ return null; // pretend type was not found.
+ } finally {
+ isLoadingRolesOfSourceType.set(save);
+ }
+ }
+ ReferenceBinding[] getSuperInterfaces() -> get ReferenceBinding[] superInterfaces;
+ void setSuperInterfaces(ReferenceBinding[] superIfcs) -> set ReferenceBinding[] superInterfaces;
+ }
+
+ protected class SafeEnvironment playedBy LookupEnvironment {
+ ReferenceBinding askForType(char[][] typeName)
+ <- replace ReferenceBinding askForType(char[][] typeName);
+ @SuppressWarnings("basecall")
+ callin ReferenceBinding askForType(char[][] typeName) {
+ try {
+ return base.askForType(typeName);
+ } catch (IllegalReusedBinaryRoleException irbre) {
+ if (DEBUG>0) {
+ String rn = new String(CharOperation.concatWith(typeName, '.'));
+ System.out.println("rejected binary role "+rn); //$NON-NLS-1$
+ }
+ return null;
+ }
+ }
+
+ void checkEnclosing(ReferenceBinding created)
+ <- after BinaryTypeBinding createBinaryTypeFrom(IBinaryType binaryType,
+ PackageBinding packageBinding,
+ boolean needFieldsAndMethods,
+ AccessRestriction accessRestriction)
+ with { created <- result }
+
+ /**
+ * When reading a binary type as a member of a source type,
+ * check whether this is OK or whether the binary member
+ * should be discarded.
+ */
+ void checkEnclosing(ReferenceBinding type) {
+ ReferenceBinding enclosing = type.enclosingType();
+ if (enclosing != null && !enclosing.isBinaryBinding() && type.isRole()) {
+ int flags = type.roleModel.getExtraRoleFlags();
+ checkNonReusableRole(flags);
+ }
+ }
+ }
+
+
+ protected class BinaryType playedBy BinaryTypeBinding
+ {
+
+ // reverse the effect from SourceTypeBinding in case of nested lookup.
+ getMemberType <- replace getMemberType;
+ callin ReferenceBinding getMemberType(char[] name) {
+ Object save = isLoadingRolesOfSourceType.get();
+ isLoadingRolesOfSourceType.remove();
+ try {
+ return base.getMemberType(name);
+ } finally {
+ isLoadingRolesOfSourceType.set(save);
+ }
+ }
+
+ // ==== Callouts: ====
+
+ // DEBUGGING:
+ String internalName() -> char[] internalName()
+ with { result <- new String(result) }
+ }
+
+
+ /** Trigger of UseCase A. */
+ static void checkNonReusableRole(int otClassFlags)
+ throws IllegalReusedBinaryRoleException
+ {
+ if ((otClassFlags & IOTConstants.OT_CLASS_ROLE) == 0)
+ return;
+ int specialRoleFlags = IOTConstants.OT_CLASS_PURELY_COPIED|IOTConstants.OT_CLASS_ROLE_FILE;
+ if ((otClassFlags & specialRoleFlags) == 0)
+ {
+ if (DEBUG>0)
+ System.out.println("throwing!!! "+otClassFlags); //$NON-NLS-1$
+ RuntimeException t = new IllegalReusedBinaryRoleException("don't reuse explicit inline role"); //$NON-NLS-1$
+ //t.printStackTrace();
+ throw t;
+ }
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.adaptor/.classpath b/plugins/org.eclipse.objectteams.otdt.debug.adaptor/.classpath
new file mode 100644
index 000000000..987380a81
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.adaptor/.classpath
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <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="con" path="OTRE"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.adaptor/.project b/plugins/org.eclipse.objectteams.otdt.debug.adaptor/.project
new file mode 100644
index 000000000..1dececd55
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.adaptor/.project
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.objectteams.otdt.debug.adaptor</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.objectteams.otdt.builder.OTJBuilder</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>org.objectteams.otdt.OTJavaNature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.adaptor/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.objectteams.otdt.debug.adaptor/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..5fbade38e
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.adaptor/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,28 @@
+#Sat Oct 03 22:14:54 CEST 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.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.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
+org.objectteams.otdt.compiler.option.joinpoint_queries=disabled
+org.objectteams.otdt.compiler.option.scoped_keywords=enabled
+org.objectteams.otdt.compiler.problem.abstract_potential_relevant_role=warning
+org.objectteams.otdt.compiler.problem.adapting_deprecated=error
+org.objectteams.otdt.compiler.problem.ambiguous_lowering=warning
+org.objectteams.otdt.compiler.problem.basecall=warning
+org.objectteams.otdt.compiler.problem.binding_conventions=error
+org.objectteams.otdt.compiler.problem.decapsulation=warning
+org.objectteams.otdt.compiler.problem.deprecated_path_syntax=warning
+org.objectteams.otdt.compiler.problem.exception_in_guard=error
+org.objectteams.otdt.compiler.problem.fragile_callin=warning
+org.objectteams.otdt.compiler.problem.inferred_callout=warning
+org.objectteams.otdt.compiler.problem.override_final_role=error
+org.objectteams.otdt.compiler.problem.potential_ambiguous_playedby=warning
+org.objectteams.otdt.compiler.problem.unsafe_role_instantiation=warning
+org.objectteams.otdt.compiler.problem.weave_into_system_class=warning
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.adaptor/META-INF/MANIFEST.MF b/plugins/org.eclipse.objectteams.otdt.debug.adaptor/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..199ef5ff1
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.adaptor/META-INF/MANIFEST.MF
@@ -0,0 +1,28 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: DebugAdaptor Plug-in
+Bundle-SymbolicName: org.eclipse.objectteams.otdt.debug.adaptor;singleton:=true
+Bundle-Version: 1.4.0.qualifier
+Bundle-Vendor: objectteams.org
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.objectteams.otequinox,
+ org.eclipse.core.runtime,
+ org.eclipse.jdt.core,
+ org.eclipse.jdt.ui,
+ org.eclipse.debug.ui,
+ org.eclipse.jdt.debug,
+ org.eclipse.jdt.debug.ui,
+ org.eclipse.objectteams.otdt.debug.ui,
+ org.eclipse.jface,
+ org.eclipse.ui,
+ org.eclipse.pde.ui,
+ org.eclipse.jdt.launching,
+ org.eclipse.jdt.junit,
+ org.eclipse.objectteams.otdt,
+ org.eclipse.objectteams.otdt.debug,
+ org.eclipse.objectteams.otdt.ui,
+ org.eclipse.ui.editors,
+ org.eclipse.jface.text
+Bundle-Activator: org.eclipse.objectteams.otdt.internal.debug.adaptor.OTDebugAdaptorPlugin
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ActivationPolicy: lazy
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.adaptor/build.properties b/plugins/org.eclipse.objectteams.otdt.debug.adaptor/build.properties
new file mode 100644
index 000000000..0dc34f783
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.adaptor/build.properties
@@ -0,0 +1,6 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ plugin.properties
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.adaptor/plugin.properties b/plugins/org.eclipse.objectteams.otdt.debug.adaptor/plugin.properties
new file mode 100644
index 000000000..29c17aa17
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.adaptor/plugin.properties
@@ -0,0 +1,8 @@
+OtGeneratedCodeColorDescription.label=OT/J generated code
+OtGeneratedCodeColorDescription.description=The color by which the debug view marks stack frames that do not correspond to source code\n(generated by compiler or runtime-environment)
+OtSpecialCodeColorDescription.label=OT/J special source code
+OtSpecialCodeColorDescription.description=The color by which the debug view highlights special OT/J source code\n(method bindings, guard predicates etc.)
+
+showOTInternalAction.label=Show &OT/J Internal Variables
+showOTInternalAction.tooltip=Show internal variables which the OT/J compiler and weaver have generated.
+VariablesViewJavaSubmenu.label=&Java
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.adaptor/plugin.xml b/plugins/org.eclipse.objectteams.otdt.debug.adaptor/plugin.xml
new file mode 100644
index 000000000..b7f076b91
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.adaptor/plugin.xml
@@ -0,0 +1,206 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+ <extension
+ point="org.eclipse.objectteams.otequinox.aspectBindings">
+ <aspectBinding
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/calloutbinding_obj.gif">
+ <basePlugin
+ icon="platform:/plugin/org.eclipse.pde.ui/icons/obj16/plugin_obj.gif"
+ id="org.eclipse.debug.ui">
+ </basePlugin>
+ <team
+ activation="ALL_THREADS"
+ class="org.eclipse.objectteams.otdt.internal.debug.adaptor.VariablesViewAdaptor"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif">
+ </team>
+ <team
+ activation="ALL_THREADS"
+ class="org.eclipse.objectteams.otdt.internal.debug.adaptor.launching.DebugUIDialogAdaptor"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif">
+ </team>
+ <team
+ activation="ALL_THREADS"
+ class="org.eclipse.objectteams.otdt.internal.debug.adaptor.PresentationAdaptorActivator"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif">
+ </team>
+ </aspectBinding>
+ <aspectBinding
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/calloutbinding_obj.gif">
+ <basePlugin
+ icon="platform:/plugin/org.eclipse.pde.ui/icons/obj16/plugin_obj.gif"
+ id="org.eclipse.jdt.debug.ui">
+ </basePlugin>
+ <team
+ activation="ALL_THREADS"
+ class="org.eclipse.objectteams.otdt.internal.debug.adaptor.PresentationAdaptorActivator"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif">
+ </team>
+ <team
+ activation="ALL_THREADS"
+ class="org.eclipse.objectteams.otdt.internal.debug.adaptor.launching.JDTDebugUILaunchingAdaptor"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif">
+ </team>
+ <team
+ activation="NONE"
+ class="org.eclipse.objectteams.otdt.internal.debug.adaptor.launching.DebugUIDialogAdaptor2"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif"
+ superclass="org.eclipse.objectteams.otdt.internal.debug.adaptor.launching.DebugUIDialogAdaptor">
+ </team>
+ <team
+ activation="ALL_THREADS"
+ class="org.eclipse.objectteams.otdt.internal.debug.adaptor.RetargettableActionAdaptor"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif">
+ </team>
+ </aspectBinding>
+ <aspectBinding
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/calloutbinding_obj.gif">
+ <basePlugin
+ icon="platform:/plugin/org.eclipse.pde.ui/icons/obj16/plugin_obj.gif"
+ id="org.eclipse.jdt.debug">
+ </basePlugin>
+ <team
+ activation="NONE"
+ class="org.eclipse.objectteams.otdt.internal.debug.adaptor.PresentationAdaptor"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif">
+ </team>
+ <team
+ activation="ALL_THREADS"
+ class="org.eclipse.objectteams.otdt.internal.debug.adaptor.SourceLookupAdaptor"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif">
+ </team>
+ </aspectBinding>
+ <aspectBinding
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/calloutbinding_obj.gif">
+ <basePlugin
+ icon="platform:/plugin/org.eclipse.pde.ui/icons/obj16/plugin_obj.gif"
+ id="org.eclipse.pde.ui">
+ </basePlugin>
+ <team
+ activation="ALL_THREADS"
+ class="org.eclipse.objectteams.otdt.internal.debug.adaptor.SourceLookupAdaptor"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif">
+ </team>
+ <team
+ activation="ALL_THREADS"
+ class="org.eclipse.objectteams.otdt.internal.debug.adaptor.launching.PDELaunchingAdaptor"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif">
+ </team>
+ </aspectBinding>
+ <aspectBinding
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/calloutbinding_obj.gif">
+ <basePlugin
+ icon="platform:/plugin/org.eclipse.pde.ui/icons/obj16/plugin_obj.gif"
+ id="org.eclipse.debug.core">
+ </basePlugin>
+ <team
+ activation="ALL_THREADS"
+ class="org.eclipse.objectteams.otdt.internal.debug.adaptor.launching.LaunchConfigurationInitializer"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif">
+ </team>
+ </aspectBinding>
+ <aspectBinding
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/calloutbinding_obj.gif">
+ <basePlugin
+ icon="platform:/plugin/org.eclipse.pde.ui/icons/obj16/plugin_obj.gif"
+ id="org.eclipse.jdt.launching">
+ </basePlugin>
+ <team
+ activation="ALL_THREADS"
+ class="org.eclipse.objectteams.otdt.internal.debug.adaptor.launching.JDTLaunchingAdaptor"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif">
+ </team>
+ </aspectBinding>
+ <aspectBinding
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/calloutbinding_obj.gif">
+ <basePlugin
+ icon="platform:/plugin/org.eclipse.pde.ui/icons/obj16/plugin_obj.gif"
+ id="org.eclipse.jdt.junit.core">
+ </basePlugin>
+ <team
+ activation="NONE"
+ class="org.eclipse.objectteams.otdt.internal.debug.adaptor.launching.JUnitLaunchingAdaptor"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif"
+ superclass="org.eclipse.objectteams.otdt.internal.debug.adaptor.launching.JDTLaunchingAdaptor">
+ </team>
+ </aspectBinding>
+ <aspectBinding
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/calloutbinding_obj.gif">
+ <basePlugin
+ icon="platform:/plugin/org.eclipse.pde.ui/icons/obj16/plugin_obj.gif"
+ id="org.eclipse.jdt.junit">
+ </basePlugin>
+ <team
+ activation="NONE"
+ class="org.eclipse.objectteams.otdt.internal.debug.adaptor.launching.DebugUIDialogAdaptor3"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif"
+ superclass="org.eclipse.objectteams.otdt.internal.debug.adaptor.launching.DebugUIDialogAdaptor2">
+ </team>
+ </aspectBinding>
+ <aspectBinding
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/calloutbinding_obj.gif">
+ <basePlugin
+ icon="platform:/plugin/org.eclipse.pde.ui/icons/obj16/plugin_obj.gif"
+ id="org.eclipse.jdt.ui">
+ </basePlugin>
+ <team
+ activation="NONE"
+ class="org.eclipse.objectteams.otdt.internal.debug.adaptor.PresentationAdaptor"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif">
+ </team>
+ </aspectBinding>
+ <aspectBinding
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/calloutbinding_obj.gif">
+ <basePlugin
+ icon="platform:/plugin/org.eclipse.pde.ui/icons/obj16/plugin_obj.gif"
+ id="org.eclipse.pde.launching">
+ </basePlugin>
+ <team
+ activation="ALL_THREADS"
+ class="org.eclipse.objectteams.otdt.internal.debug.adaptor.launching.PDELaunchingAdaptor"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif">
+ </team>
+ </aspectBinding>
+ </extension>
+ <extension
+ point="org.eclipse.ui.viewActions">
+ <viewContribution
+ targetID="org.eclipse.debug.ui.VariableView"
+ id="org.eclipse.objectteams.otdt.internal.debug.adaptor.VariableViewActions">
+ <action
+ style="toggle"
+ id="org.eclipse.objectteams.otdt.internal.debug.adaptor.variableViewActions.ShowOTInternal"
+ class="org.eclipse.objectteams.otdt.internal.debug.adaptor.actions.ShowOTInternalVariablesAction"
+ helpContextId="show_otinternal_action_context"
+ label="%showOTInternalAction.label"
+ menubarPath="org.eclipse.jdt.debug.ui.VariableView.javaSubmenu/javaPart"
+ tooltip="%showOTInternalAction.tooltip">
+ </action>
+ </viewContribution>
+ <viewContribution
+ targetID="org.eclipse.objectteams.otdt.debug.ui.views.team"
+ id="org.eclipse.objectteams.otdt.internal.debug.adaptor.VariableViewActions">
+ <action
+ style="toggle"
+ id="org.eclipse.objectteams.otdt.internal.debug.adaptor.variableViewActions.ShowOTInternal"
+ class="org.eclipse.objectteams.otdt.internal.debug.adaptor.actions.ShowOTInternalVariablesAction"
+ helpContextId="show_otinternal_action_context"
+ label="%showOTInternalAction.label"
+ menubarPath="org.eclipse.jdt.debug.ui.VariableView.javaSubmenu/javaPart"
+ tooltip="%showOTInternalAction.tooltip">
+ </action>
+ <menu
+ id="org.eclipse.jdt.debug.ui.VariableView.javaSubmenu"
+ label="%VariablesViewJavaSubmenu.label"
+ path="javaActions">
+ <groupMarker name="org.eclipse.jdt.debug.ui.javaPart"/>
+ </menu>
+ </viewContribution>
+ </extension>
+ <extension
+ point="org.eclipse.core.runtime.preferences">
+ <initializer
+ class="org.eclipse.objectteams.otdt.internal.debug.adaptor.PreferenceInitializer">
+ </initializer>
+ </extension>
+</plugin>
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/DebugMessages.java b/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/DebugMessages.java
new file mode 100644
index 000000000..388aa05f9
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/DebugMessages.java
@@ -0,0 +1,35 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2008 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: DebugMessages.java 23456 2010-02-04 20:44:45Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.debug.adaptor;
+
+import org.eclipse.osgi.util.NLS;
+
+public class DebugMessages extends NLS {
+ private static final String BUNDLE_NAME = "org.eclipse.objectteams.otdt.internal.debug.adaptor.debugMessages"; //$NON-NLS-1$
+ public static String OTLaunching_loading_failed_msg;
+ public static String OTLaunching_OTRE_checkbox_label;
+ public static String OTLaunching_OTRE_group_title;
+ public static String OTLaunching_OTEquinox_checkbox_label;
+ public static String OTLaunching_no_OTJ_project_found;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, DebugMessages.class);
+ }
+
+ private DebugMessages() {
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/LaunchUtils.java b/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/LaunchUtils.java
new file mode 100644
index 000000000..66f2b35b1
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/LaunchUtils.java
@@ -0,0 +1,58 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2008 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: LaunchUtils.java 23456 2010-02-04 20:44:45Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.debug.adaptor;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.model.IDebugElement;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.objectteams.otdt.debug.OTDebugPlugin;
+
+/**
+ * Simple queries relating to launches/launch-configs.
+ * @author stephan
+ * @since 1.2.1
+ */
+public class LaunchUtils {
+
+ /** Does elem belong to an OT launch? */
+ static boolean isOTLaunch(Object elem) {
+ try {
+ if (!(elem instanceof IDebugElement))
+ return false;
+ ILaunchConfiguration launchConfiguration = ((IDebugElement)elem).getLaunch().getLaunchConfiguration();
+ return launchConfiguration.getAttribute(OTDebugPlugin.OT_LAUNCH, false);
+ } catch (Exception e) {
+ return false;
+ }
+ }
+
+ /** Does projectName denote an OT/J-enabled project? */
+ public static boolean isOTJProject(String projectName) {
+ if (projectName != null && projectName.length() > 0) {
+ IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
+ if (project != null && project.exists())
+ try {
+ return project.hasNature(JavaCore.OTJ_NATURE_ID);
+ } catch (CoreException e) { /* ignore */ }
+ }
+ return false;
+ }
+
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/OTDebugAdaptorPlugin.java b/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/OTDebugAdaptorPlugin.java
new file mode 100644
index 000000000..8adc4fd10
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/OTDebugAdaptorPlugin.java
@@ -0,0 +1,39 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2008 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: OTDebugAdaptorPlugin.java 23456 2010-02-04 20:44:45Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.debug.adaptor;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+
+/** This Activator enables the debug adaptor to manage preferences of its own.
+ *
+ * @author stephan
+ * @since 1.2.0
+ */
+public class OTDebugAdaptorPlugin extends AbstractUIPlugin {
+
+ public static final String PLUGIN_ID = "org.eclipse.objectteams.otdt.internal.debug.adaptor"; //$NON-NLS-1$
+
+ private static OTDebugAdaptorPlugin instance;
+
+ public OTDebugAdaptorPlugin() {
+ instance = this;
+ }
+
+ public static AbstractUIPlugin getDefault() {
+ return instance;
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/PreferenceInitializer.java b/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/PreferenceInitializer.java
new file mode 100644
index 000000000..a7dec9a2f
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/PreferenceInitializer.java
@@ -0,0 +1,38 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2008 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: PreferenceInitializer.java 23456 2010-02-04 20:44:45Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.debug.adaptor;
+
+import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
+import org.eclipse.jface.preference.IPreferenceStore;
+
+/**
+ * Provide defaults for this plugin's preferences.
+ *
+ * @author stephan
+ * @since 1.2.0
+ */
+public class PreferenceInitializer extends AbstractPreferenceInitializer {
+
+ public static final String PREF_SHOW_OTINTERNAL_VARIABLES = OTDebugAdaptorPlugin.PLUGIN_ID+".show_otinternal_variables"; //$NON-NLS-1$
+
+ @Override
+ public void initializeDefaultPreferences() {
+ IPreferenceStore store = OTDebugAdaptorPlugin.getDefault().getPreferenceStore();
+ store.setDefault(PreferenceInitializer.PREF_SHOW_OTINTERNAL_VARIABLES, false);
+ }
+
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/PresentationAdaptor.java b/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/PresentationAdaptor.java
new file mode 100644
index 000000000..26b3687a2
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/PresentationAdaptor.java
@@ -0,0 +1,325 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2007 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: PresentationAdaptor.java 23456 2010-02-04 20:44:45Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.debug.adaptor;
+
+import java.util.List;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.debug.core.DebugException;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.ISourceRange;
+import org.eclipse.jdt.core.ISourceReference;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.internal.core.Member;
+import org.eclipse.jdt.internal.debug.ui.DebugUIMessages;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.texteditor.IDocumentProvider;
+import org.eclipse.objectteams.otdt.core.compiler.ISMAPConstants;
+import org.eclipse.objectteams.otdt.debug.ui.internal.preferences.OTDebugPreferences;
+
+import base org.eclipse.jdt.internal.debug.core.model.JDIReferenceType;
+import base org.eclipse.jdt.internal.debug.core.model.JDIStackFrame;
+import base org.eclipse.jdt.internal.ui.javaeditor.JavaEditor;
+
+/**
+ * Adapt the String representation of stack frames in the debug view.
+ *
+ * @author stephan
+ * @since 1.1.7
+ */
+@SuppressWarnings("restriction")
+public team class PresentationAdaptor
+{
+ enum MethodKind {
+ PLAIN, INITIAL, CHAIN, ORIG, TEAM_WRAPPER, BASE_CALL, LIFT, WHEN, BASE_WHEN, FIELD_ACCESS
+ }
+
+ @SuppressWarnings("nls")
+ public static final String[] enhancementTypes = {
+ "org.objectteams.Team[]", "int[]", "int", "int", "int", "java.lang.Object[]"
+ };
+
+ // while working for some clients we have an editor that we can use for adapted source lookup:
+ private ThreadLocal<JavaEditor> javaEditor = new ThreadLocal<JavaEditor>();
+
+
+ private static PresentationAdaptor instance;
+ public static PresentationAdaptor getInstance() {
+ if (instance == null)
+ instance= new PresentationAdaptor();
+ return instance;
+ }
+
+ @SuppressWarnings("unchecked")
+ protected class OTJStackFrame playedBy JDIStackFrame
+ {
+ // === imports: ===
+ boolean isStatic() -> boolean isStatic();
+ int modifiers() -> com.sun.jdi.Method getUnderlyingMethod()
+ with { result <- result.modifiers() }
+
+ // store analyzed method kind between calls:
+ protected MethodKind kind= MethodKind.PLAIN;
+
+ // == currently unused: ==
+ boolean isRole;
+ boolean isTeam;
+
+ protected boolean isPurelyGenerated() {
+ switch(this.kind) {
+ case LIFT:
+ case INITIAL:
+ case CHAIN:
+ return true;
+ }
+ return false;
+ }
+ protected boolean isOTSpecialSrc() {
+ switch(this.kind) {
+ case TEAM_WRAPPER:
+ case BASE_CALL:
+ case WHEN:
+ case BASE_WHEN:
+ case FIELD_ACCESS:
+ return true;
+ }
+ return false;
+ }
+
+ getTypeName <- replace getReceivingTypeName, getDeclaringTypeName;
+ callin String getTypeName() throws DebugException {
+ return analyzeType(base.getTypeName());
+ }
+
+ String analyzeType(String typeName) {
+// this.isRole= typeName.contains("__OT__");
+// this.isTeam= (modifiers() & 0x8000) != 0;
+// if (this.isRole)
+ return typeName.replaceAll("__OT__", ""); //$NON-NLS-1$ //$NON-NLS-2$
+// return typeName;
+ }
+
+ String getMethodName() <- replace String getMethodName();
+ @SuppressWarnings("nls")
+ callin String getMethodName() throws DebugException {
+ String result= base.getMethodName();
+ String[] segments= analyzeMethod(result);
+ if (segments != null) {
+ switch (this.kind) {
+ // INITIAL is not yet analyzed
+ case ORIG:
+ return segments[1];
+ case CHAIN:
+ return "{{Dispatch callins for "+segments[1]+"}}";
+ case TEAM_WRAPPER:
+ return "["+segments[1]+"."+segments[2]+"<-"+segments[3]+"]";
+ case LIFT:
+ return "{{Lift to "+segments[2]+"}}";
+ case BASE_CALL:
+ return "base."+segments[1];
+ case WHEN:
+ return "[when]";
+ case BASE_WHEN:
+ return "[base when]";
+ case FIELD_ACCESS:
+ return "[access to field "+segments[3]+"]";
+ }
+ }
+ return result;
+ }
+
+ /** Analyze the method name and store the kind.
+ * @param methodName
+ * @return an array of segments split at '$'.
+ */
+ @SuppressWarnings("nls")
+ String[] analyzeMethod(String methodName)
+ {
+ if (methodName != null && methodName.startsWith("_OT$"))
+ {
+ String[] segments= methodName.split("[$]");
+
+ switch (segments.length) {
+ case 2:
+ if (segments[1].equals("when"))
+ this.kind= MethodKind.WHEN;
+ else if (segments[1].equals("base_when"))
+ this.kind= MethodKind.BASE_WHEN;
+ break;
+ case 3:
+ if (segments[2].equals("orig")) // _OT$bm$orig
+ this.kind= MethodKind.ORIG;
+ else if (segments[2].equals("chain")) // _OT$bm$chain
+ this.kind= MethodKind.CHAIN;
+ else if (segments[1].equals("liftTo")) // _OT$liftTo$R
+ this.kind= MethodKind.LIFT;
+ else if (segments[2].equals("base")) // _OT$rm$base
+ this.kind= MethodKind.BASE_CALL;
+ break;
+ case 4:
+ if (segments[1].equals("_fieldget_")
+ ||segments[1].equals("_fieldset_"))
+ this.kind = MethodKind.FIELD_ACCESS;
+ else
+ // further analysis needed?
+ this.kind= MethodKind.TEAM_WRAPPER; // _OT$R$rm$bm
+ }
+ return segments;
+ }
+ return null;
+ }
+
+ getArgumentTypeNames <- replace getArgumentTypeNames;
+ @SuppressWarnings("rawtypes")
+ callin List getArgumentTypeNames() throws DebugException {
+ return stripGeneratedParams(base.getArgumentTypeNames());
+ }
+
+ int getLineNumber() <- replace int getLineNumber();
+ callin int getLineNumber() throws DebugException {
+ int result= base.getLineNumber();
+ if (result >= ISMAPConstants.STEP_INTO_LINENUMBER) {
+ if (this.kind == MethodKind.PLAIN) // re-classify, if linenumber was the only unusual property
+ this.kind = MethodKind.INITIAL;
+ return -1;
+ }
+ if (this.kind == MethodKind.CHAIN) {
+ JavaEditor editor = PresentationAdaptor.this.javaEditor.get();
+ if (editor != null) {
+ try {
+ return editor.getStartLineOfEnclosingElement(result-1)+1; // map between 0/1 based counting.
+ } catch (BadLocationException e) {
+ OTDebugAdaptorPlugin.getDefault().getLog().log(new Status(IStatus.WARNING, OTDebugAdaptorPlugin.PLUGIN_ID, "Failed to retrieve line number", e));
+ }
+ }
+ }
+ return result;
+ }
+
+ // -- helpers --
+ private List<String> stripGeneratedParams(List<String> typeNames)
+ throws DebugException
+ {
+ switch (this.kind) {
+ case TEAM_WRAPPER:
+ if (!isStatic())
+ typeNames= typeNames.subList(1, typeNames.size()); // remove role arg
+ break;
+ case BASE_WHEN:
+ typeNames= typeNames.subList(2, typeNames.size()); // remove 2 synth args: dummy,Team
+ break;
+ }
+ // may need to strip multiple sets of enhance-args:
+ List<String> stripped= stripEnhancementParams(typeNames);
+ while (stripped != typeNames) {
+ typeNames= stripped;
+ stripped= stripEnhancementParams(typeNames);
+ }
+ // go into details: strip __OT__ prefix of individual types
+ for (int i=0; i<stripped.size(); i++)
+ stripped.set(i, analyzeType(stripped.get(i)));
+ return stripped;
+ }
+ private List<String> stripEnhancementParams(List<String> typeNames) {
+ if (typeNames != null && typeNames.size() >= 6) {
+ for (int i = 0; i < enhancementTypes.length; i++) {
+ if (!enhancementTypes[i].equals(typeNames.get(i)))
+ return typeNames;
+ }
+ return typeNames.subList(6, typeNames.size());
+ }
+ return typeNames;
+ }
+ }
+ /** While assembling the display string (ie., while this team is active)
+ * pretend the "OTJ" stratum is "Java", in order to enable Java name assembly.
+ */
+ protected class ReferenceType playedBy JDIReferenceType
+ {
+ String getDefaultStratum() <- replace String getDefaultStratum();
+ callin String getDefaultStratum() throws DebugException {
+ String stratum= base.getDefaultStratum();
+ if (stratum.equals("OTJ")) //$NON-NLS-1$
+ return "Java"; // this is where we lie ;-) //$NON-NLS-1$
+ return stratum;
+ }
+ }
+
+ /** Gateway to java editors for requesting line numbers using info from the java model. */
+ protected class JavaEditor playedBy JavaEditor
+ {
+ @SuppressWarnings("decapsulation")
+ IJavaElement getElementAt(int offset) -> IJavaElement getElementAt(int offset);
+ IDocumentProvider getDocumentProvider() -> IDocumentProvider getDocumentProvider();
+ IEditorInput getEditorInput() -> IEditorInput getEditorInput();
+
+ protected int getStartLineOfEnclosingElement(int line) throws BadLocationException
+ {
+ IDocument doc = getDocumentProvider().getDocument(getEditorInput());
+ IJavaElement element = getElementAt(doc.getLineOffset(line));
+ if (!(element instanceof ISourceReference))
+ throw new BadLocationException("Element is not an ISourceReference: "+element);
+ try {
+ ISourceRange range = (element instanceof Member)
+ ? ((Member) element).getNameRange()
+ : ((ISourceReference) element).getSourceRange();
+
+ return doc.getLineOfOffset(range.getOffset());
+ } catch (JavaModelException e) {
+ throw new BadLocationException(e.getMessage());
+ }
+ }
+ }
+
+ /** Answer the symbolic name of the color that should be used for displaying
+ * the given stackframe.
+ * @param element stackframe
+ * @return symbolic color name or null.
+ */
+ public String getFrameColorName(JDIStackFrame as OTJStackFrame element) {
+ if (element.isPurelyGenerated())
+ return OTDebugPreferences.OT_GENERATED_CODE_COLOR;
+ if (element.isOTSpecialSrc())
+ return OTDebugPreferences.OT_SPECIAL_CODE_COLOR;
+ return null;
+ }
+
+ /**
+ * When this team is activated in a JavaEditor-aware-context, remember the java editor.
+ * @param javaEditor new java editor to be remembered, may be null (= reset).
+ * @return previously remembered editor, may be null.
+ */
+ public org.eclipse.jdt.internal.ui.javaeditor.JavaEditor setTextEditor(JavaEditor as JavaEditor javaEditor)
+ {
+ JavaEditor previous = this.javaEditor.get();
+ this.javaEditor.set(javaEditor);
+ return previous;
+ }
+
+ /** Final embellishment of a label after everything has been analyzed. */
+ public String postProcess(JDIStackFrame as OTJStackFrame stackFrame, String labelText)
+ {
+ if (stackFrame.kind == MethodKind.INITIAL) // this we didn't know when creating the label text
+ return labelText.replace(DebugUIMessages.JDIModelPresentation_line__76+' '+DebugUIMessages.JDIModelPresentation_not_available,
+ "[about to enter]");
+
+ return labelText;
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/PresentationAdaptorActivator.java b/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/PresentationAdaptorActivator.java
new file mode 100644
index 000000000..65f52689b
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/PresentationAdaptorActivator.java
@@ -0,0 +1,110 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2007 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: PresentationAdaptorActivator.java 23456 2010-02-04 20:44:45Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.debug.adaptor;
+
+import org.eclipse.debug.core.DebugException;
+import org.eclipse.debug.core.model.IStackFrame;
+import org.eclipse.objectteams.otdt.debug.ui.OTDebugUIPlugin;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.ui.texteditor.ITextEditor;
+import org.eclipse.jdt.internal.debug.core.model.JDIStackFrame;
+import org.eclipse.jdt.internal.ui.javaeditor.JavaEditor;
+import org.eclipse.jface.text.source.Annotation;
+
+import base org.eclipse.debug.internal.ui.InstructionPointerManager;
+import base org.eclipse.debug.internal.ui.sourcelookup.SourceLookupFacility;
+import base org.eclipse.jdt.internal.debug.ui.JDIModelPresentation;
+
+/**
+ * This team watches over a method from JDTModelPresentation
+ * to enable adaptation of String representations by PresentationAdaptor,
+ * given that the current launch is some OT/J launch.
+ *
+ * @author stephan
+ * @since 1.1.7
+ */
+@SuppressWarnings("restriction")
+public team class PresentationAdaptorActivator
+{
+ /** Generalized role for different editor-based contexts. */
+ protected class EditorBasedAdaptation
+ {
+ /**
+ * When the current editor is a java editor make it available to the
+ * to-be-activated {@link PresentationAdaptor}.
+ * @param textEditor
+ */
+ callin void adaptedRun(ITextEditor textEditor)
+ when (textEditor instanceof JavaEditor)
+ {
+ PresentationAdaptor adaptor = PresentationAdaptor.getInstance();
+ JavaEditor previous = adaptor.setTextEditor((JavaEditor)textEditor);
+ try {
+ within(adaptor)
+ base.adaptedRun(textEditor);
+ } finally {
+ adaptor.setTextEditor(previous);
+ }
+ }
+ }
+ /** Let the {@link PresentationAdaptor} adapt positioning of the editor. */
+ protected class EditorPositioningAdaptor extends EditorBasedAdaptation playedBy SourceLookupFacility
+ {
+ @SuppressWarnings("decapsulation")
+ void adaptedRun(ITextEditor editor)
+ <- replace void positionEditor(ITextEditor editor, IStackFrame frame)
+ base when (LaunchUtils.isOTLaunch(frame));
+ }
+ /** Let the {@link PresentationAdaptor} adapt positioning of "current instruction" annotations. */
+ protected class AnnotationAdaptor extends EditorBasedAdaptation playedBy InstructionPointerManager
+ {
+ void adaptedRun(ITextEditor textEditor)
+ <- replace void addAnnotation(ITextEditor textEditor, IStackFrame frame, Annotation annotation)
+ base when (LaunchUtils.isOTLaunch(frame));
+ }
+ /** Let the {@link PresentationAdaptor} adapt composing labels for the debug view. */
+ protected class ModelPresentation playedBy JDIModelPresentation
+ {
+ String getStackFrameText(IStackFrame frame) <- replace String getStackFrameText(IStackFrame frame)
+ base when (LaunchUtils.isOTLaunch(frame));
+ callin String getStackFrameText(IStackFrame stackFrame)
+ throws DebugException
+ {
+ // while constructing the text for a stack frame use the PresentationAdaptor:
+ PresentationAdaptor adaptor = PresentationAdaptor.getInstance();
+ String result;
+ within (adaptor)
+ result = base.getStackFrameText(stackFrame);
+ if (stackFrame instanceof JDIStackFrame)
+ result = adaptor.postProcess((JDIStackFrame)stackFrame, result);
+ return result;
+ }
+
+ Color getForeground(Object element) <- replace Color getForeground(Object element)
+ base when (LaunchUtils.isOTLaunch(element));
+ @SuppressWarnings("basecall")
+ callin Color getForeground(Object element) {
+ if (element instanceof JDIStackFrame) {
+ PresentationAdaptor adaptor = PresentationAdaptor.getInstance();
+ String colorName= adaptor.getFrameColorName((JDIStackFrame)element);
+ if (colorName != null)
+ return OTDebugUIPlugin.getPreferenceColor(colorName);
+ }
+ return base.getForeground(element);
+ }
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/RetargettableActionAdaptor.java b/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/RetargettableActionAdaptor.java
new file mode 100644
index 000000000..485ab582c
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/RetargettableActionAdaptor.java
@@ -0,0 +1,41 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2009 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: RetargettableActionAdaptor.java 23456 2010-02-04 20:44:45Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.debug.adaptor;
+
+import org.eclipse.debug.ui.actions.IToggleBreakpointsTarget;
+import org.eclipse.objectteams.otdt.debug.ui.internal.actions.OTToggleBreakpointAdapter;
+
+import base org.eclipse.jdt.internal.debug.ui.actions.RetargettableActionAdapterFactory;
+
+/**
+ * This team replaces the former OTRetargettableActionAdapterFactory class.
+ *
+ * @author mosconi
+ */
+@SuppressWarnings("restriction")
+public team class RetargettableActionAdaptor {
+ protected class RetargettableActionAdapterFactory playedBy RetargettableActionAdapterFactory {
+ @SuppressWarnings({ "basecall", "rawtypes" })
+ callin Object getAdapter(Object adaptableObject, Class adapterType) {
+ if (adapterType == IToggleBreakpointsTarget.class) {
+ return new OTToggleBreakpointAdapter();
+ }
+ return base.getAdapter(adaptableObject, adapterType);
+ }
+ getAdapter <- replace getAdapter;
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/SourceLookupAdaptor.java b/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/SourceLookupAdaptor.java
new file mode 100644
index 000000000..661bd75c5
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/SourceLookupAdaptor.java
@@ -0,0 +1,118 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2008 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: RoFiBreakpointTests.java 18812 2008-07-27 18:01:43Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.debug.adaptor;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.debug.core.IJavaType;
+import org.eclipse.objectteams.otdt.core.compiler.IOTConstants;
+
+import base org.eclipse.jdt.internal.debug.core.JavaDebugUtils;
+//import base org.eclipse.pde.internal.ui.launcher.PDESourceLookupQuery;
+
+/**
+ * This team makes the PDE source lookup aware of role files.
+ *
+ * @author stephan
+ * @since 1.2.1
+ */
+@SuppressWarnings("restriction")
+public team class SourceLookupAdaptor {
+
+ // field stored in the team, because intercepted base method generateSourceName() has static context.
+ Object currentElement;
+
+// /**
+// * This role is needed because its base class over-eagerly discards
+// * the names of inner classes when looking for the source file.
+// */
+// protected class PDESourceLookupQuery playedBy PDESourceLookupQuery {
+//
+// @SuppressWarnings("decapsulation")
+// Object getFElement() -> get Object fElement;
+//
+// keepElement <- before run;
+// void keepElement() {
+// currentElement = getFElement();
+// }
+//
+// @SuppressWarnings("decapsulation")
+// String generateSourceName(String qualifiedTypeName) <- replace String generateSourceName(String qualifiedTypeName);
+//
+// @SuppressWarnings("basecall")
+// static callin String generateSourceName(String qualifiedTypeName) {
+// try {
+// return JavaDebugUtils.getSourceName(currentElement);
+// } catch (CoreException e) {
+// OTDebugAdaptorPlugin.getDefault().getLog().log(new Status(Status.ERROR, OTDebugAdaptorPlugin.PLUGIN_ID, "Source lookup failed", e));
+// return base.generateSourceName(qualifiedTypeName);
+// }
+// }
+// }
+
+ protected class JavaDebugUtils playedBy JavaDebugUtils
+ {
+ String getSourceName(Object object) -> String getSourceName(Object object);
+
+ // FIXME(SH): workaround, problem with overload between callin and inferred callout
+ IType resolveType(String qualifiedName, IJavaElement javaElement)
+ -> IType resolveType(String qualifiedName, IJavaElement javaElement);
+
+ IType resolveType(IJavaType type) <- replace IType resolveType(IJavaType type);
+
+ @SuppressWarnings({ "basecall", "inferredcallout" })
+ static callin IType resolveType(IJavaType type) throws CoreException {
+ // copied from base method:
+ IJavaElement element = resolveJavaElement(type, type.getLaunch());
+ if (element != null ) {
+ IType result = resolveType(type.getName(), element);
+ // start OT-adaptation: check result:
+ if (result != null && result.exists())
+ return result;
+ // the given compilation unit doesn't have a type `type.getName()`
+ try {
+ ICompilationUnit resolvedCU = (ICompilationUnit) element;
+ String typeName = type.getName();
+ int lastDollar = typeName.lastIndexOf('$');
+ if (lastDollar != -1) {
+ // find a type that is (a) superclass of `type` and (b) contained in `resolvedCU`
+ String enclosingName = typeName.substring(0, lastDollar);
+ IJavaProject javaProject = resolvedCU.getJavaProject();
+ IType enclosingType = javaProject.findType(enclosingName);
+ while (enclosingType != null) {
+ if (resolvedCU.equals(enclosingType.getAncestor(IJavaElement.COMPILATION_UNIT))) {
+ // got the enclosing team, now find the corresponding role:
+ String roleName = typeName.substring(lastDollar+1);
+ if (roleName.startsWith(IOTConstants.OT_DELIM))
+ roleName = roleName.substring(IOTConstants.OT_DELIM_LEN);
+ return enclosingType.getType(roleName);
+ }
+ String[][] superclassName = enclosingType.resolveType((enclosingType.getSuperclassName()));
+ enclosingType = javaProject.findType(superclassName[0][0], superclassName[0][1]);
+ }
+ }
+ } catch (Exception e) {
+ return null;
+ }
+ }
+ return null;
+ }
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/VariablesViewAdaptor.java b/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/VariablesViewAdaptor.java
new file mode 100644
index 000000000..082aee752
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/VariablesViewAdaptor.java
@@ -0,0 +1,131 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2007, 2008 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: VariablesViewAdaptor.java 23456 2010-02-04 20:44:45Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.debug.adaptor;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.DebugException;
+import org.eclipse.debug.core.model.IDebugElement;
+import org.eclipse.debug.core.model.IValue;
+import org.eclipse.debug.core.model.IVariable;
+import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
+import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate;
+import org.eclipse.debug.ui.IDebugUIConstants;
+import org.eclipse.jdt.debug.core.IJavaFieldVariable;
+import org.eclipse.objectteams.otdt.core.compiler.IOTConstants;
+import org.eclipse.objectteams.otdt.debug.ui.OTDebugUIPlugin;
+import org.eclipse.objectteams.otdt.internal.debug.adaptor.actions.ShowOTInternalVariablesAction;
+
+import base org.eclipse.debug.internal.ui.model.elements.StackFrameContentProvider;
+import base org.eclipse.debug.internal.ui.model.elements.VariableContentProvider;
+
+/**
+ * Implements variables filtering for VariablesView and TeamView.
+ * <ul>
+ * <li>TeamView always filters statics.</li>
+ * <li>Conditionally filter internal OT/J variables (starting with _OT$);
+ * This filter is controlled by view specific preferences.</li>
+ * </ul>
+ *
+ * @author stephan
+ * @since 1.1.6
+ */
+@SuppressWarnings("restriction")
+public team class VariablesViewAdaptor
+{
+ /** Adapt the content provider for root elements of the variables view. */
+ protected class StackFrameContentProvider playedBy StackFrameContentProvider {
+
+ Object[] getAllChildren(Object parent, IPresentationContext context, IViewerUpdate monitor)
+ <- replace Object[] getAllChildren(Object parent, IPresentationContext context, IViewerUpdate monitor);
+
+ callin Object[] getAllChildren(Object parent, IPresentationContext context, IViewerUpdate monitor)
+ throws CoreException
+ {
+ Object[] rawChildren = base.getAllChildren(parent, context, monitor);
+
+ if (!context.getId().equals(IDebugUIConstants.ID_VARIABLE_VIEW))
+ return rawChildren;
+
+ // is filtering needed?
+ if (ShowOTInternalVariablesAction.includeOTInternal(context))
+ return rawChildren;
+
+ // at this point always filter internals, but toplevel never has statics to filter:
+ return filterChildren(rawChildren, true/*OTInternals*/, false/*statics*/);
+ }
+
+ }
+
+ /** Adapt the content provider for non-toplevel elements. */
+ protected class ContentProvider playedBy VariableContentProvider
+ {
+ Object[] getValueChildren(IDebugElement parent, IValue value, IPresentationContext context)
+ <- replace Object[] getValueChildren(IDebugElement parent, IValue value, IPresentationContext context);
+
+ callin Object[] getValueChildren(IDebugElement parent, IValue value, IPresentationContext context)
+ throws CoreException
+ {
+ Object[] rawChildren = base.getValueChildren(parent, value, context);
+
+ // is filtering needed?
+ boolean filterOTInternals = ! ShowOTInternalVariablesAction.includeOTInternal(context);
+
+ // TeamView constantly filters statics:
+ boolean filterStatics = context.getId().equals(OTDebugUIPlugin.TEAM_VIEW_ID);
+
+ if (filterOTInternals || filterStatics)
+ return filterChildren(rawChildren, filterOTInternals, filterStatics);
+
+ return rawChildren;
+ }
+
+ }
+
+ /**
+ * Filter from rawChildren ot-internal variables and/or static fields.
+ */
+ static Object[] filterChildren(Object[] rawChildren, boolean filterOTInternals, boolean filterStatics) {
+ List<Object> visible = new ArrayList<Object>();
+
+ for (int i= 0; i<rawChildren.length; i++)
+ if (!isFiltered((IVariable)rawChildren[i], filterOTInternals, filterStatics))
+ visible.add(rawChildren[i]);
+
+ // has filtering taken place?
+ if (visible.size() == rawChildren.length)
+ return rawChildren;
+ return visible.toArray(new Object[visible.size()]);
+ }
+ // helper checking conditions for above method:
+ static boolean isFiltered(IVariable var, boolean filterOTInternals, boolean filterStatics) {
+ try {
+ if (filterOTInternals && var.getName().startsWith(IOTConstants.OT_DOLLAR))
+ return true;
+ if (filterStatics && var instanceof IJavaFieldVariable)
+ if (((IJavaFieldVariable)var).isStatic())
+ return true;
+ } catch (DebugException e) {
+ return true; // cannot display any way.
+ }
+ return false;
+ }
+
+
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/actions/ShowOTInternalVariablesAction.java b/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/actions/ShowOTInternalVariablesAction.java
new file mode 100644
index 000000000..f0643d62e
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/actions/ShowOTInternalVariablesAction.java
@@ -0,0 +1,64 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2008 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: ShowOTInternalVariablesAction.java 23456 2010-02-04 20:44:45Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.debug.adaptor.actions;
+
+import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
+import org.eclipse.jdt.internal.debug.ui.actions.ToggleBooleanPreferenceAction;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.objectteams.otdt.internal.debug.adaptor.OTDebugAdaptorPlugin;
+import org.eclipse.objectteams.otdt.internal.debug.adaptor.PreferenceInitializer;
+
+/**
+ * Toggle action for filtering OT-Internal variables (starting with "_OT$").
+ * This action can be used by different views (currently: TeamView and VariablesView).
+ *
+ * @author stephan
+ * @since 1.2.0
+ */
+@SuppressWarnings("restriction")
+public class ShowOTInternalVariablesAction extends ToggleBooleanPreferenceAction {
+
+ public ShowOTInternalVariablesAction() {
+ super();
+ }
+
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jdt.internal.debug.ui.actions.ViewFilterAction#getPreferenceKey()
+ */
+ protected String getPreferenceKey() {
+ return PreferenceInitializer.PREF_SHOW_OTINTERNAL_VARIABLES;
+ }
+
+ protected IPreferenceStore getPreferenceStore() {
+ return OTDebugAdaptorPlugin.getDefault().getPreferenceStore();
+ }
+
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jdt.internal.debug.ui.actions.ToggleBooleanPreferenceAction#getViewKey()
+ */
+ protected String getViewKey() {
+ return getCompositeKey();
+ }
+
+ public static boolean includeOTInternal(IPresentationContext context){
+ IPreferenceStore store = OTDebugAdaptorPlugin.getDefault().getPreferenceStore();
+ String key = context.getId() + "." + PreferenceInitializer.PREF_SHOW_OTINTERNAL_VARIABLES; //$NON-NLS-1$
+ return store.getBoolean(key);
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/debugMessages.properties b/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/debugMessages.properties
new file mode 100644
index 000000000..fe10c2c72
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/debugMessages.properties
@@ -0,0 +1,5 @@
+OTLaunching_loading_failed_msg=Unable to read from launch configuration
+OTLaunching_OTRE_checkbox_label=Enable OTRE
+OTLaunching_OTEquinox_checkbox_label=Enable OT/Equinox
+OTLaunching_OTRE_group_title=Object Teams Runtime
+OTLaunching_no_OTJ_project_found=No OT/J plug-in project found, debug functionality not fully available.
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/launching/DebugUIDialogAdaptor.java b/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/launching/DebugUIDialogAdaptor.java
new file mode 100644
index 000000000..e551404c2
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/launching/DebugUIDialogAdaptor.java
@@ -0,0 +1,105 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2008 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: DebugUIDialogAdaptor.java 23456 2010-02-04 20:44:45Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.debug.adaptor.launching;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
+import org.eclipse.debug.ui.ILaunchConfigurationDialog;
+import org.eclipse.debug.ui.ILaunchConfigurationTab;
+import org.eclipse.objectteams.otdt.debug.OTDebugPlugin;
+import org.eclipse.pde.internal.ui.IPDEUIConstants;
+
+import base org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup;
+import base org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationTabGroupViewer;
+import base org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog;
+
+/**
+ * This team conditionally adds the "Team Activation" tab to the launch configuration dialog.
+ * Only the most specific subteam is activated.
+ *
+ * @author stephan
+ * @since 1.2.1
+ */
+@SuppressWarnings("restriction")
+public team class DebugUIDialogAdaptor {
+
+
+ protected class LaunchConfigurationTabGroup playedBy AbstractLaunchConfigurationTabGroup {
+
+ boolean isOTJlaunch = false;
+
+ /** Catch the dialog to find out if the current launch is ot-enabled. */
+ void checkProject(LaunchConfigurationsDialog dialog)
+ <- before void createTabs(ILaunchConfigurationDialog dialog, String mode)
+ with { dialog <- (LaunchConfigurationsDialog)dialog }
+ void checkProject(LaunchConfigurationsDialog dialog) {
+ isOTJlaunch = dialog != null && dialog.isOTJlaunch();
+ }
+
+ /** Intercept installation of the tabs, as to conditionally insert our tab. */
+ void setTabs(ILaunchConfigurationTab[] tabs) <- replace void setTabs(ILaunchConfigurationTab[] tabs)
+ when(this.isOTJlaunch && tabs != null);
+ callin void setTabs(ILaunchConfigurationTab[] tabs) {
+ int len = tabs.length;
+ int insertPos = tabs.length;
+ for(int i=0; i<len; i++) {
+ if (tabs[i] instanceof AbstractLaunchConfigurationTab) {
+ AbstractLaunchConfigurationTab launchConfigurationTab = (AbstractLaunchConfigurationTab)tabs[i];
+ if ("org.eclipse.jdt.debug.ui.javaArgumentsTab".equals(launchConfigurationTab.getId())) { //$NON-NLS-1$
+ insertPos = i+1;
+ break;
+ }
+ } else if (tabs[i] instanceof OTLaunchConfigurationTab) {
+ base.setTabs(tabs); // already present, don't insert again (for legacy launches).
+ return;
+ }
+ }
+ ILaunchConfigurationTab[] newTabs = new ILaunchConfigurationTab[len+1];
+ for (int i=0,j=0; j<=len; j++)
+ if (j != insertPos)
+ newTabs[j] = tabs[i++];
+ newTabs[insertPos] = new OTLaunchConfigurationTab();
+ base.setTabs(newTabs);
+ }
+ }
+ /** Gate to base-level information, here: whether current launch is ot-enabled. */
+ protected class LaunchConfigurationsDialog playedBy LaunchConfigurationsDialog
+ {
+ @SuppressWarnings("decapsulation")
+ LaunchConfigurationTabGroupViewer getTabViewer() -> LaunchConfigurationTabGroupViewer getTabViewer();
+
+ protected boolean isOTJlaunch() {
+ LaunchConfigurationTabGroupViewer viewer = getTabViewer();
+ if (viewer == null) return false;
+ ILaunchConfigurationWorkingCopy workingCopy = viewer.getWorkingCopy();
+ if (workingCopy == null) return false;
+ try {
+ return workingCopy.getAttribute(OTDebugPlugin.OT_LAUNCH, false)
+ && workingCopy.getAttribute(IPDEUIConstants.LAUNCHER_PDE_VERSION, (String)null) == null;
+ } catch (CoreException e) {
+ return false;
+ }
+ }
+ }
+ /** Only exposing one inaccessible method. */
+ protected class LaunchConfigurationTabGroupViewer playedBy LaunchConfigurationTabGroupViewer {
+ @SuppressWarnings("decapsulation")
+ ILaunchConfigurationWorkingCopy getWorkingCopy() -> ILaunchConfigurationWorkingCopy getWorkingCopy();
+ }
+
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/launching/DebugUIDialogAdaptor2.java b/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/launching/DebugUIDialogAdaptor2.java
new file mode 100644
index 000000000..23c50e214
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/launching/DebugUIDialogAdaptor2.java
@@ -0,0 +1,35 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2008 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: DebugUIDialogAdaptor2.java 23456 2010-02-04 20:44:45Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.debug.adaptor.launching;
+
+import base org.eclipse.jdt.internal.debug.ui.launcher.LocalJavaApplicationTabGroup;
+
+/**
+ * Apply adaptations of the super team to a class from org.eclipse.jdt.debug.ui.
+ *
+ * @author stephan
+ * @since 1.2.1
+ */
+@SuppressWarnings("restriction")
+public team class DebugUIDialogAdaptor2 extends DebugUIDialogAdaptor {
+ protected class JDTTabGroup
+ extends LaunchConfigurationTabGroup
+ playedBy LocalJavaApplicationTabGroup
+ {
+ // empty role, just advise OT/Equinox to weave into one more base class. See Trac #145
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/launching/DebugUIDialogAdaptor3.java b/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/launching/DebugUIDialogAdaptor3.java
new file mode 100644
index 000000000..81d475a26
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/launching/DebugUIDialogAdaptor3.java
@@ -0,0 +1,35 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2008 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: DebugUIDialogAdaptor3.java 23456 2010-02-04 20:44:45Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.debug.adaptor.launching;
+
+import base org.eclipse.jdt.internal.junit.launcher.JUnitTabGroup;
+
+/**
+ * Apply adaptations of the super team to a class from org.eclipse.jdt.junit
+ *
+ * @author stephan
+ * @since 1.2.1
+ */
+@SuppressWarnings("restriction")
+public team class DebugUIDialogAdaptor3 extends DebugUIDialogAdaptor2 {
+ protected class JUnitTabGroup
+ extends LaunchConfigurationTabGroup
+ playedBy JUnitTabGroup
+ {
+ // empty, just advise OT/Equinox to weave into one more base class. See Trac #145
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/launching/JDTDebugUILaunchingAdaptor.java b/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/launching/JDTDebugUILaunchingAdaptor.java
new file mode 100644
index 000000000..a7fbbf822
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/launching/JDTDebugUILaunchingAdaptor.java
@@ -0,0 +1,136 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2008 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: JDTDebugUILaunchingAdaptor.java 23456 2010-02-04 20:44:45Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.debug.adaptor.launching;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.jdt.internal.debug.ui.jres.JREsComboBlock;
+import org.eclipse.objectteams.otdt.debug.IOTLaunchConstants;
+import org.eclipse.objectteams.otdt.ui.OTDTUIPlugin;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Group;
+
+import base org.eclipse.jdt.debug.ui.launchConfigurations.JavaConnectTab;
+import base org.eclipse.jdt.debug.ui.launchConfigurations.JavaJRETab;
+
+/**
+ * This team adds a new section to the JRE tab containing
+ * <ul>
+ * <li>a checkbox "Enable OTRE"
+ * <li>a checkbox "Use JPLIS (experimental)"
+ * </ul>
+ * If this box is enabled, launching will happen in OT/J mode, which is
+ * managed by the {@link JDTLaunchingAdaptor}.
+ *
+ * @author stephan
+ * @since 1.2.1
+ */
+@SuppressWarnings("restriction")
+public team class JDTDebugUILaunchingAdaptor {
+
+ /**
+ * Adds the "use JPLIS" option to an OTREBlock, and also connects the OTREBlock to its base.
+ */
+ protected class JavaJRETab extends OTREBlock playedBy JavaJRETab {
+
+ Button _jplisToggleButton;
+ boolean _useJPLIS = true;
+
+ // === Imports (callout) : ===
+ @SuppressWarnings("decapsulation")
+ Control getJREControl() -> get JREsComboBlock fJREBlock
+ with { result <- fJREBlock.getControl() }
+
+ @SuppressWarnings("decapsulation")
+ Button createCheckButton(Composite arg0, String arg1) -> Button createCheckButton(Composite arg0, String arg1);
+
+ @SuppressWarnings("decapsulation")
+ void setDirty(boolean dirty) -> void setDirty(boolean dirty);
+
+ @SuppressWarnings("decapsulation")
+ void updateLaunchConfigurationDialog() -> void updateLaunchConfigurationDialog();
+
+ // build the GUI:
+ Group createOTRESection(Composite parent) <- after void createControl(Composite parent);
+ public Group createOTRESection(Composite parent) {
+ Composite enclosingComposite = (Composite) this.getJREControl();
+ Group group = super.createOTRESection(enclosingComposite, true/*useSWTFactory*/);
+ this._jplisToggleButton = createCheckButton(group, OTDTUIPlugin.getResourceString("OTJavaMainTab.jplis_checkbox_label")); //$NON-NLS-1$
+ this._jplisToggleButton.addSelectionListener(new SelectionAdapter()
+ {
+ public void widgetSelected(SelectionEvent e)
+ {
+ JavaJRETab.this._useJPLIS = JavaJRETab.this._jplisToggleButton.getSelection();
+ setDirty(true);
+ updateLaunchConfigurationDialog();
+ }
+ });
+ return group;
+ }
+
+ // read stored value:
+ void initializeFrom(ILaunchConfiguration config) <- after void initializeFrom(ILaunchConfiguration config);
+
+ protected void tryInitializeFrom(ILaunchConfiguration config, boolean hasOTJProject) throws CoreException {
+ super.tryInitializeFrom(config, hasOTJProject);
+ this._jplisToggleButton.setEnabled(hasOTJProject);
+ this._useJPLIS = config.getAttribute(IOTLaunchConstants.ATTR_USE_JPLIS, this._useJPLIS);
+ this._jplisToggleButton.setSelection(this._useJPLIS);
+ }
+
+ // apply value change:
+ void performApply(ILaunchConfigurationWorkingCopy config)
+ <- after void performApply(ILaunchConfigurationWorkingCopy config);
+ public void performApply(ILaunchConfigurationWorkingCopy config) {
+ super.performApply(config);
+ config.setAttribute(IOTLaunchConstants.ATTR_USE_JPLIS, this._useJPLIS);
+ }
+ }
+
+ /** Add an OTRE block to the "Connect" tab for remote debugging. */
+ @SuppressWarnings("decapsulation")
+ protected class JavaConnectTab extends OTREBlock playedBy JavaConnectTab {
+
+ Control getControl() -> Control getControl();
+
+ void createVerticalSpacer(Composite comp, int colSpan) -> void createVerticalSpacer(Composite comp, int colSpan);
+
+ Button createCheckButton(Composite parent, String label) -> Button createCheckButton(Composite parent, String label);
+
+ void setDirty(boolean dirty) -> void setDirty(boolean dirty);
+
+ void updateLaunchConfigurationDialog() -> void updateLaunchConfigurationDialog();
+
+ // build the GUI:
+ Group createOTRESection(Composite parent) <- after void createControl(Composite parent);
+ public Group createOTRESection(Composite parent) {
+ Composite enclosingComposite = (Composite) this.getControl();
+ createVerticalSpacer(enclosingComposite, 10);
+ Group group = super.createOTRESection(enclosingComposite, true/*useSWTFactory*/);
+ return group;
+ }
+
+ // hook the trigger for passing the ot-launch attribute:
+ void performApply(ILaunchConfigurationWorkingCopy config)
+ <- after void performApply(ILaunchConfigurationWorkingCopy config);
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/launching/JDTLaunchingAdaptor.java b/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/launching/JDTLaunchingAdaptor.java
new file mode 100644
index 000000000..397e51431
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/launching/JDTLaunchingAdaptor.java
@@ -0,0 +1,209 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2008 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: JDTLaunchingAdaptor.java 23456 2010-02-04 20:44:45Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.debug.adaptor.launching;
+
+
+import java.util.LinkedList;
+import java.util.List;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
+import org.eclipse.jdt.launching.JavaRuntime;
+import org.eclipse.objectteams.otdt.core.ext.OTREContainer;
+import org.eclipse.objectteams.otdt.core.ext.OTRuntimeClasspathProvider;
+import org.eclipse.objectteams.otdt.debug.IOTLaunchConstants;
+import org.eclipse.objectteams.otdt.debug.OTDebugPlugin;
+import org.eclipse.objectteams.otdt.debug.OTVMRunnerAdaptor;
+import org.eclipse.objectteams.otdt.debug.TeamBreakpointInstaller;
+import org.eclipse.pde.internal.ui.IPDEUIConstants;
+
+import base org.eclipse.jdt.launching.AbstractJavaLaunchConfigurationDelegate;
+import base org.eclipse.jdt.launching.StandardClasspathProvider;
+
+/**
+ * This team observes java launches and potentially modifies them for OT/J capabilities.
+ * <ul>
+ * <li>Add BCEL and JMangler to the classpath (role {@link ClasspathExtender})
+ * <li>Maintain an OTVMRunnerAdaptor for adapting vm- and program args (role {@link JDTLaunchingAdaptor.AbstractJavaLaunchConfigurationDelegate}).
+ * </ul>
+ * Role {@link JDTLaunchingAdaptor.JavaLaunchDelegate} only binds the above behavior into Java launches.
+ * See {@link JUnitLaunchingAdaptor.JUnitLaunchConfigurationDelegate} for equal binding to JUnit launches.
+ *
+ * @author stephan
+ * @since 1.2.1
+ */
+@SuppressWarnings("restriction")
+public team class JDTLaunchingAdaptor {
+
+ /**
+ * This role extends the classpath with BCEL and JMangler paths if OT/J is enabled for the launch.
+ */
+ protected class ClasspathExtender playedBy StandardClasspathProvider {
+
+ IRuntimeClasspathEntry[] computeUnresolvedClasspath(ILaunchConfiguration config)
+ <- replace IRuntimeClasspathEntry[] computeUnresolvedClasspath(ILaunchConfiguration config);
+
+ callin IRuntimeClasspathEntry[] computeUnresolvedClasspath(ILaunchConfiguration config) throws CoreException
+ {
+ IRuntimeClasspathEntry[] origEntries = base.computeUnresolvedClasspath(config);
+
+ boolean useJMangler = isNormalOTJLaunch(config);
+ if (!useJMangler && !isJPLISOTJLaunch(config))
+ return origEntries;
+
+ // add BCEL, JMangler-core and JMangler-start (classpath / bootclasspath)
+ int oldLength = origEntries.length;
+ IRuntimeClasspathEntry[] otRuntimeEntries = computePathsToAdd(origEntries, useJMangler);
+
+ // merge results:
+ IRuntimeClasspathEntry[] result = new IRuntimeClasspathEntry[oldLength + otRuntimeEntries.length];
+ System.arraycopy(origEntries, 0, result, 0, oldLength);
+ System.arraycopy(otRuntimeEntries, 0, result, oldLength, otRuntimeEntries.length);
+ return result;
+ }
+
+ static IRuntimeClasspathEntry[] computePathsToAdd( IRuntimeClasspathEntry[] origEntries, boolean useJMangler )
+ {
+ boolean hasBCEL = false;
+ boolean hasJManglerCore = false;
+ boolean hasJManglerStart = false;
+ boolean hasOTRE_min = false;
+
+ for (int i = 0; i < origEntries.length; i++)
+ {
+ IRuntimeClasspathEntry entry = origEntries[i];
+ if (OTRuntimeClasspathProvider.BCEL_JAR.equals(entry.getPath()))
+ hasBCEL = true;
+ else if (OTREContainer.OTRE_JAR_PATH.equals(entry.getPath().toString()))
+ hasOTRE_min = true;
+ }
+
+ List<IRuntimeClasspathEntry> result = new LinkedList<IRuntimeClasspathEntry>();
+ IRuntimeClasspathEntry entry;
+
+ if (!hasBCEL) {
+ entry = JavaRuntime.newArchiveRuntimeClasspathEntry(OTRuntimeClasspathProvider.BCEL_JAR);
+ entry.setClasspathProperty(IRuntimeClasspathEntry.BOOTSTRAP_CLASSES);
+ result.add(entry);
+ }
+
+ if (!hasJManglerCore && useJMangler) {
+ throw new RuntimeException("JMangler is no longer supported");
+ }
+
+ if (!hasJManglerStart && useJMangler) {
+ throw new RuntimeException("JMangler is no longer supported");
+ }
+
+ if (!hasOTRE_min && !useJMangler) {
+ entry = JavaRuntime.newArchiveRuntimeClasspathEntry(JavaCore.getResolvedVariablePath(new Path(OTREContainer.OTRE_MIN_JAR_PATH)));
+ entry.setClasspathProperty(IRuntimeClasspathEntry.BOOTSTRAP_CLASSES);
+ result.add(entry);
+ }
+
+ return result.toArray(new IRuntimeClasspathEntry[result.size()]);
+ }
+
+ }
+
+ /**
+ * This role performs the adaptations of vmargs and program args (including main class name).
+ */
+ protected class AbstractJavaLaunchConfigurationDelegate playedBy AbstractJavaLaunchConfigurationDelegate
+ {
+ IJavaProject getJavaProject(ILaunchConfiguration arg0) -> IJavaProject getJavaProject(ILaunchConfiguration arg0);
+
+ OTVMRunnerAdaptor fAdaptor;
+ boolean useJMangler = false;
+ String fOriginalMain;
+
+ // --- Initiate adaptations: (this callin actually applies to sub-base-classes)
+ void prepareLaunch(ILaunchConfiguration config, String mode, ILaunch launch)
+ <- before void launch(ILaunchConfiguration config, String mode, ILaunch launch, IProgressMonitor monitor);
+ void prepareLaunch(ILaunchConfiguration config, String mode, ILaunch launch) throws CoreException
+ {
+ this.fOriginalMain = null; // reset potential left over from previous launching
+ this.useJMangler = isNormalOTJLaunch(config);
+ if (!this.useJMangler && !isJPLISOTJLaunch(config)) {
+ this.fAdaptor = null;
+ return;
+ }
+ this.fAdaptor = new OTVMRunnerAdaptor();
+ this.fAdaptor.setAdaptationArgs(config, mode, launch);
+ // install OT-breakpoints
+ if (ILaunchManager.DEBUG_MODE.equals(mode))
+ TeamBreakpointInstaller.installTeamBreakpoints(getJavaProject(config));
+ }
+
+ // --- Main Type Name: ---
+ String verifyMainTypeName(ILaunchConfiguration config)
+ <- replace String verifyMainTypeName(ILaunchConfiguration config)
+ when (this.useJMangler);
+
+ callin String verifyMainTypeName(ILaunchConfiguration config) throws CoreException {
+ throw new RuntimeException("JMangler is no longer supported");
+ }
+
+ // --- VM Arguments: ---
+ String getVMArguments(ILaunchConfiguration configuration)
+ <- replace String getVMArguments(ILaunchConfiguration configuration)
+ when (this.fAdaptor != null);
+
+
+ callin String getVMArguments(ILaunchConfiguration config) throws CoreException {
+ String vmArgs = base.getVMArguments(config);
+ return this.fAdaptor.adaptVMArgumentString(vmArgs);
+ }
+
+ // --- Program Arguments: ---
+ String getProgramArguments(ILaunchConfiguration config)
+ <- replace String getProgramArguments(ILaunchConfiguration config)
+ when (this.fOriginalMain != null);
+
+ callin String getProgramArguments(ILaunchConfiguration config) throws CoreException {
+ String programArguments = base.getProgramArguments(config);
+ return this.fOriginalMain + ' ' + programArguments;
+ }
+ }
+
+ static boolean isNormalOTJLaunch(ILaunchConfiguration config) {
+ try {
+ return config.getAttribute(OTDebugPlugin.OT_LAUNCH, false) // OT/J ?
+ && !config.getAttribute(IOTLaunchConstants.ATTR_USE_JPLIS, false) // not JPLIS ?
+ && (config.getAttribute(IPDEUIConstants.LAUNCHER_PDE_VERSION, (String)null) == null); // not PDE ?
+ } catch (CoreException e) {
+ return false; // don't apply adaptations to bogus config
+ }
+ }
+
+ static boolean isJPLISOTJLaunch(ILaunchConfiguration config) {
+ try {
+ return config.getAttribute(OTDebugPlugin.OT_LAUNCH, false) // OT/J ?
+ && config.getAttribute(IOTLaunchConstants.ATTR_USE_JPLIS, false) // JPLIS ?
+ && (config.getAttribute(IPDEUIConstants.LAUNCHER_PDE_VERSION, (String)null) == null); // not PDE ?
+ } catch (CoreException e) {
+ return false; // don't apply adaptations to bogus config
+ }
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/launching/JUnitLaunchingAdaptor.java b/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/launching/JUnitLaunchingAdaptor.java
new file mode 100644
index 000000000..1c5b3ef98
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/launching/JUnitLaunchingAdaptor.java
@@ -0,0 +1,37 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2008 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: JUnitLaunchingAdaptor.java 23456 2010-02-04 20:44:45Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.debug.adaptor.launching;
+
+import base org.eclipse.jdt.junit.launcher.JUnitLaunchConfigurationDelegate;
+
+/**
+ * This team hooks the adaptation of its super team into JUnit launches.
+ * Note, that only an instance of this sub-team is activated a boot-time.
+ *
+ * @author stephan
+ * @since 1.2.1
+ */
+public team class JUnitLaunchingAdaptor extends JDTLaunchingAdaptor {
+
+ protected class JUnitLaunchConfigurationDelegate
+ extends AbstractJavaLaunchConfigurationDelegate
+ playedBy JUnitLaunchConfigurationDelegate
+ {
+ // empty: this role only helps OT/Equinox so that it will weave into an overriding method.
+ // all adaptations are defined in the super role.
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/launching/LaunchConfigurationInitializer.java b/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/launching/LaunchConfigurationInitializer.java
new file mode 100644
index 000000000..8ca229aba
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/launching/LaunchConfigurationInitializer.java
@@ -0,0 +1,81 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2008 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: LaunchConfigurationInitializer.java 23456 2010-02-04 20:44:45Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.debug.adaptor.launching;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
+import org.eclipse.objectteams.otdt.debug.OTDebugPlugin;
+import org.eclipse.objectteams.otdt.internal.debug.adaptor.LaunchUtils;
+
+import base org.eclipse.debug.internal.core.LaunchConfigurationType;
+import base org.eclipse.debug.internal.core.LaunchConfigurationWorkingCopy;
+
+/**
+ * This team observes creation of launch configurations and initializes the
+ * org.eclipse.objectteams.launch attribute accordingly.
+ *
+ * @author stephan
+ * @since 1.2.1
+ */
+@SuppressWarnings("restriction")
+public team class LaunchConfigurationInitializer {
+
+ /**
+ * Observe creation of new instances.
+ */
+ protected class LaunchConfigurationType playedBy LaunchConfigurationType {
+
+ void acceptInstance(LaunchConfigWC inst)
+ <- after ILaunchConfigurationWorkingCopy newInstance(IContainer container, String name)
+ with { inst <- (LaunchConfigurationWorkingCopy)result }
+
+ void acceptInstance(LaunchConfigWC inst) {
+ // nop, just lifting. Role will take over.
+ }
+ }
+
+ /**
+ * While an instance is still new (= role exists) wait for the project name to be set.
+ */
+ protected class LaunchConfigWC playedBy LaunchConfigurationWorkingCopy
+ base when (LaunchConfigurationInitializer.this.hasRole(base, LaunchConfigWC.class))
+ {
+ // callout interface:
+ boolean getAttribute(String key, boolean dflt) -> boolean getAttribute(String key, boolean dflt);
+ void setAttribute(String key, boolean val) -> void setAttribute(String key, boolean val);
+
+ void setAttribute(String key, String value) <- after void setAttribute(String key, String value);
+ void setAttribute(String key, String value) {
+ if (key.equals(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME)) {
+ try {
+ if ( LaunchUtils.isOTJProject(value)
+ && !getAttribute(OTDebugPlugin.OT_LAUNCH, false))
+ {
+ setAttribute(OTDebugPlugin.OT_LAUNCH, true);
+ }
+ } catch (CoreException e) {
+ OTDebugPlugin.getExceptionHandler().logException("Error getting a launch configuration attribute", e); //$NON-NLS-1$
+ }
+ // this role has served its purpose - unregister now:
+ LaunchConfigurationInitializer.this.unregisterRole(this, LaunchConfigWC.class);
+ }
+ return;
+ }
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/launching/OTLaunchConfigurationTab.java b/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/launching/OTLaunchConfigurationTab.java
new file mode 100644
index 000000000..bc85d8cfd
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/launching/OTLaunchConfigurationTab.java
@@ -0,0 +1,216 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2009 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: OTLaunchConfigurationTab.java 23456 2010-02-04 20:44:45Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.debug.adaptor.launching;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
+import org.eclipse.debug.ui.ILaunchConfigurationTab;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
+import org.eclipse.jface.operation.IRunnableContext;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.objectteams.otdt.core.IOTType;
+import org.eclipse.objectteams.otdt.core.OTModelManager;
+import org.eclipse.objectteams.otdt.debug.IOTLaunchConstants;
+import org.eclipse.objectteams.otdt.ui.ImageConstants;
+import org.eclipse.objectteams.otdt.ui.ImageManager;
+import org.eclipse.objectteams.otdt.ui.OTDTUIPlugin;
+
+/**
+ * This class provides the "Team Activation" tab to the launch dialog.
+ *
+ * @author gis
+ * @version $Id: OTLaunchConfigurationTab.java 23456 2010-02-04 20:44:45Z stephan $
+ */
+public class OTLaunchConfigurationTab extends AbstractLaunchConfigurationTab implements ILaunchConfigurationTab
+{
+ private List<IType> _teamModel = new ArrayList<IType>();
+
+ private TeamConfig _teamConfig;
+ private IProject _project = null;
+
+ public void createControl(Composite parent)
+ {
+ _teamConfig = new TeamConfig(parent, SWT.NONE, this);
+ setControl(_teamConfig);
+ setMessage(OTDTUIPlugin.getResourceString("TeamConfig.cannot_instantiate_message")); //$NON-NLS-1$
+ }
+
+ public void setDefaults(ILaunchConfigurationWorkingCopy configuration)
+ {
+ // nothing to do -- empty defaults
+ }
+
+ public void initializeFrom(ILaunchConfiguration configuration)
+ {
+ _teamModel.clear();
+
+ List teamHandles = new LinkedList();
+ boolean teamsActive = true;
+ try {
+ teamHandles = configuration.getAttribute(IOTLaunchConstants.ATTR_TEAMCONFIG_LIST, teamHandles);
+ teamsActive = configuration.getAttribute(IOTLaunchConstants.ATTR_TEAMCONFIG_ACTIVE, true);
+ } catch (CoreException ce) {
+ OTDTUIPlugin.getExceptionHandler().logCoreException("Cannot read team configuration", ce); //$NON-NLS-1$
+ }
+
+ _teamConfig.clearTeamList();
+ List<String> badTeams = new LinkedList<String>();
+ for (Iterator iter = teamHandles.iterator(); iter.hasNext();) {
+ String teamHandle = (String) iter.next();
+ IType type = (IType) JavaCore.create(teamHandle);
+ if (type != null)
+ {
+ if (type.exists())
+ {
+ IOTType otType = OTModelManager.getOTElement(type);
+ if (otType != null)
+ {
+ _teamModel.add(otType);
+ continue;
+ }
+ }
+ badTeams.add(type.getFullyQualifiedName());
+ }
+ else
+ badTeams.add(teamHandle);
+ }
+
+ reportBadTeams(badTeams);
+
+ _teamConfig.setActive(teamsActive);
+ _teamConfig.setTeamInput(_teamModel);
+ _teamConfig.checkEnablement();
+
+ String projectName = getProjectFromConfig(configuration);
+ if (projectName.length() != 0)
+ _project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
+ else
+ _project = null;
+ }
+
+ private void reportBadTeams(List<String> badTeams)
+ {
+ // TODO (carp): ideally, we need some sort of listener that notices renaming and deleting of classes
+ // so that the launch configuration can be updated.
+ if (!badTeams.isEmpty())
+ {
+ StringBuffer message = new StringBuffer(OTDTUIPlugin.getResourceString("TeamConfig.not_found_message")); //$NON-NLS-1$
+ for (Iterator<String> iter = badTeams.iterator(); iter.hasNext();)
+ {
+ String badTeam = iter.next();
+ message.append(badTeam + '\n');
+ }
+ setModified(); // otherwise, the bad configuration will be kept!
+ setErrorMessage(message.toString()); // this should actually be a warning, not an error
+ }
+ }
+
+ public void performApply(ILaunchConfigurationWorkingCopy configuration)
+ {
+ removeUnavailableTeamsErrorMessage(); // not really
+
+ List<String> teamHandles = getTeamModelAsHandles();
+
+ configuration.setAttribute(IOTLaunchConstants.ATTR_TEAMCONFIG_LIST, teamHandles);
+ configuration.setAttribute(IOTLaunchConstants.ATTR_TEAMCONFIG_ACTIVE, _teamConfig.isActive());
+ }
+
+ private void removeUnavailableTeamsErrorMessage()
+ {
+ // well, actually this removes any error message of this tab, but this is our
+ // only one, so far (and actually should be a warning instead of an error)
+ setErrorMessage(null);
+ getLaunchConfigurationDialog().updateMessage();
+ }
+
+ public String getName()
+ {
+ return OTDTUIPlugin.getResourceString("TeamConfig.tab_title"); //$NON-NLS-1$
+ }
+
+ public Image getImage()
+ {
+ return ImageManager.getSharedInstance().get(ImageConstants.TEAM_IMG);
+ }
+
+ /**
+ *
+ */
+ public void setModified()
+ {
+ setDirty(true);
+ updateLaunchConfigurationDialog();
+ }
+
+ private String getProjectFromConfig(ILaunchConfiguration config)
+ {
+ String projectName= ""; //$NON-NLS-1$
+ try {
+ projectName= config.getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, ""); //$NON-NLS-1$
+ } catch (CoreException ce) {
+ OTDTUIPlugin.getExceptionHandler().logCoreException("Unable to retrieve _project from launch configuration", ce); //$NON-NLS-1$
+ }
+ return projectName;
+ }
+
+ public IProject getProject() {
+ return _project;
+ }
+
+ public List<IType> getTeamModel()
+ {
+ return _teamModel;
+ }
+
+ /**
+ * Converts the List<IOTType> _teamModel to a new List<String>, consisting of all
+ * ITypes' HandleIdentifiers.
+ * @return the new list
+ */
+ private List<String> getTeamModelAsHandles()
+ {
+ List<String> teamHandles = new LinkedList<String>();
+ for (Iterator<IType> iter = _teamModel.iterator(); iter.hasNext();)
+ {
+ IType type = iter.next();
+ teamHandles.add(type.getHandleIdentifier());
+ }
+ return teamHandles;
+ }
+
+ public IRunnableContext getRunnableContext()
+ {
+ return getLaunchConfigurationDialog();
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/launching/OTREBlock.java b/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/launching/OTREBlock.java
new file mode 100644
index 000000000..45655c69d
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/launching/OTREBlock.java
@@ -0,0 +1,126 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2008 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: OTREBlock.java 23456 2010-02-04 20:44:45Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.debug.adaptor.launching;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.internal.debug.ui.SWTFactory;
+import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
+import org.eclipse.objectteams.otdt.debug.OTDebugPlugin;
+import org.eclipse.objectteams.otdt.internal.debug.adaptor.DebugMessages;
+import org.eclipse.objectteams.otdt.internal.debug.adaptor.OTDebugAdaptorPlugin;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+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.Group;
+
+/**
+ * Common addition for all launches, Java App or OSGi.
+ * Adds the "Object Teams Runtime" section.
+ *
+ * Applied via subclasses (roles).
+ *
+ * @author stephan
+ * @since 1.2.2
+ */
+@SuppressWarnings("restriction")
+public abstract class OTREBlock
+{
+ protected String enableCheckboxLabel = DebugMessages.OTLaunching_OTRE_checkbox_label; // overidable default
+
+ Button _otreToggleButton;
+ boolean _useOTRE;
+
+ public abstract Button createCheckButton(Composite group, String resourceString);
+ public abstract void setDirty(boolean dirty);
+ public abstract void updateLaunchConfigurationDialog();
+
+ // create the "Object Teams Runtime" section:
+ public Group createOTRESection(Composite parent, boolean useSWTFactory) {
+ Group group;
+ if (useSWTFactory) {
+ group = SWTFactory.createGroup(parent, DebugMessages.OTLaunching_OTRE_group_title+':', 1, 1, GridData.FILL_HORIZONTAL);
+ } else {
+ group = new Group(parent, SWT.NONE);
+ group.setText(DebugMessages.OTLaunching_OTRE_group_title);
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 1;
+ group.setLayout(layout);
+ group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ }
+
+ this._otreToggleButton = createCheckButton(group, this.enableCheckboxLabel);
+ this._otreToggleButton.addSelectionListener(new SelectionAdapter()
+ {
+ public void widgetSelected(SelectionEvent e) {
+ OTREBlock.this._useOTRE = OTREBlock.this._otreToggleButton.getSelection();
+ setDirty(true);
+ updateLaunchConfigurationDialog();
+ }
+ });
+
+ return group;
+ }
+
+ // read values from 'config':
+ public void initializeFrom(ILaunchConfiguration config) {
+ try {
+ tryInitializeFrom(config, hasOTJProject(config));
+ }
+ catch (CoreException ex) {
+ OTDebugAdaptorPlugin.getDefault().getLog().log(
+ new Status(Status.ERROR,
+ OTDebugAdaptorPlugin.PLUGIN_ID,
+ DebugMessages.OTLaunching_loading_failed_msg,
+ ex));
+ }
+ }
+ protected void tryInitializeFrom(ILaunchConfiguration config, boolean hasOTJProject) throws CoreException {
+ this._otreToggleButton.setEnabled(hasOTJProject);
+ this._useOTRE = config.getAttribute(OTDebugPlugin.OT_LAUNCH, this._useOTRE);
+ this._otreToggleButton.setSelection(this._useOTRE);
+ }
+
+ boolean hasOTJProject(ILaunchConfiguration config) {
+ try {
+ String projectName = config.getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, (String)null);
+ if (projectName != null) {
+ IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
+ if (project != null && project.hasNature(JavaCore.OTJ_NATURE_ID))
+ return true;
+ }
+ } catch (CoreException e) {
+ // problems with either config or project, obviously not a sound OT-launch
+ }
+ return false;
+ }
+
+ // apply the value from the checkbox:
+ public void performApply(ILaunchConfigurationWorkingCopy config) {
+ if (this._otreToggleButton != null)
+ config.setAttribute(OTDebugPlugin.OT_LAUNCH, this._useOTRE);
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/launching/PDELaunchingAdaptor.java b/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/launching/PDELaunchingAdaptor.java
new file mode 100644
index 000000000..b651668a0
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/launching/PDELaunchingAdaptor.java
@@ -0,0 +1,254 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2008 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: PDELaunchingAdaptor.java 23461 2010-02-04 22:10:39Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.debug.adaptor.launching;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.internal.core.util.Util;
+import org.eclipse.objectteams.otdt.debug.OTDebugPlugin;
+import org.eclipse.objectteams.otdt.debug.TeamBreakpointInstaller;
+import org.eclipse.objectteams.otdt.internal.debug.adaptor.DebugMessages;
+import org.eclipse.objectteams.otdt.internal.debug.adaptor.OTDebugAdaptorPlugin;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+
+import base org.eclipse.pde.internal.ui.launcher.JREBlock;
+import base org.eclipse.pde.ui.launcher.AbstractLauncherTab;
+import base org.eclipse.pde.launching.AbstractPDELaunchConfiguration;
+import base org.eclipse.pde.launching.JUnitLaunchConfigurationDelegate;
+
+/**
+ * This team adapts all Eclipse and OSGi launches (Launcher) and launch configurations (JREBlock and LauncherTab).
+ *
+ * @author stephan
+ * @since 1.2.2
+ */
+@SuppressWarnings("restriction")
+public team class PDELaunchingAdaptor {
+
+ /** Mediating between LauncherTab and JREBlock: */
+ LauncherTab currentTab = null;
+
+ static final String OSGI_EXTENSIONS = "-Dosgi.framework.extensions=org.eclipse.objectteams.otequinox.hook"; //$NON-NLS-1$
+ static final String HOOK_CONFIGURATOR = "-Dosgi.hook.configurators.include=org.eclipse.objectteams.otequinox.hook.HookConfigurator";//$NON-NLS-1$
+ static final String CLASSLOADER_LOCKING = "-Dosgi.classloader.lock=classname"; //$NON-NLS-1$
+ static final String ENABLE_OTEQUINOX = "-Dot.equinox=1"; //$NON-NLS-1$ // this also causes the WORKAROUND_REPOSITORY flag being set to true in OTRE.
+ static final String DISABLE_OTEQUINOX = "-Dot.equinox=false"; //$NON-NLS-1$ // prevents TransformerHook installation and start of TransformerPlugin
+ static final String OT_DEBUG_VMARG = "-Dot.debug"; //$NON-NLS-1$
+ static final String[] OT_VM_ARGS = { OSGI_EXTENSIONS, HOOK_CONFIGURATOR, CLASSLOADER_LOCKING, ENABLE_OTEQUINOX };
+ static final String[] OT_VM_DEBUG_ARGS = { OSGI_EXTENSIONS, HOOK_CONFIGURATOR, CLASSLOADER_LOCKING, ENABLE_OTEQUINOX, OT_DEBUG_VMARG };
+ static final String[] VM_ARGS = { CLASSLOADER_LOCKING, DISABLE_OTEQUINOX };
+ static final String[] VM_DEBUG_ARGS = { CLASSLOADER_LOCKING, DISABLE_OTEQUINOX, OT_DEBUG_VMARG };
+
+ /**
+ * Extend pre-built vm arguments with OT/Equinox specifics (depending on run/debug mode).
+ */
+ static String[] extendVMArguments(String[] args, String mode) {
+ String[] otArgs = OT_VM_ARGS;
+ if (mode != null && mode.equals(ILaunchManager.DEBUG_MODE))
+ otArgs = OT_VM_DEBUG_ARGS;
+
+ if (args == null || args.length == 0)
+ return otArgs;
+
+ String[] combinedArgs = new String[args.length + otArgs.length];
+ System.arraycopy(args, 0, combinedArgs, 0, args.length);
+ System.arraycopy(otArgs, 0, combinedArgs, args.length, otArgs.length);
+ return combinedArgs;
+ }
+ static String[] addDisableOTEquinoxArgument(String[] args) {
+ String[] combinedArgs = new String[args.length + 1];
+ System.arraycopy(args, 0, combinedArgs, 0, args.length);
+ combinedArgs[args.length] = DISABLE_OTEQUINOX;
+ return combinedArgs;
+ }
+ /* alternate version for single string signature. */
+ static String extendVMArguments(String args, String mode) {
+ String otArgs;
+ if (mode != null && mode.equals(ILaunchManager.DEBUG_MODE))
+ otArgs = Util.concatWith(OT_VM_DEBUG_ARGS, ' ');
+ else
+ otArgs = Util.concatWith(OT_VM_ARGS, ' ');
+
+ if (args == null || args.length() == 0)
+ return otArgs;
+
+ return args+' '+otArgs;
+ }
+
+ /**
+ * Installs breakpoints needed for the TeamMonitor into org.objectteams.Team.
+ * Needs to find a project with OTJavaNature to do this.
+ */
+ static void installOOTBreakpoints(IProject[] projects) throws CoreException
+ {
+ if (projects != null)
+ for (IProject project : projects)
+ // find org.objectteams.Team in any OT/J Project:
+ if (project.getNature(JavaCore.OTJ_NATURE_ID) != null) {
+ TeamBreakpointInstaller.installTeamBreakpoints(JavaCore.create(project));
+ return; // good, done.
+ }
+ logException(null, Status.WARNING, DebugMessages.OTLaunching_no_OTJ_project_found);
+ }
+
+ static void logException(CoreException ex, int level, String msg) {
+ OTDebugPlugin.getDefault().getLog().log(
+ new Status(level, OTDebugAdaptorPlugin.PLUGIN_ID, 0, msg, ex));
+ }
+
+ // helper needed to protect a guard from exception:
+ static boolean isOTLaunch (ILaunchConfiguration configuration) {
+ try {
+ return configuration.getAttribute(OTDebugPlugin.OT_LAUNCH, false);
+ } catch (CoreException ce) {
+ return false;
+ }
+ }
+
+ /** Generalizes over normal pde launches and JUnit plugin launches. */
+ abstract protected class AbstractLauncher
+ {
+ abstract IProject[] getProjectsForProblemSearch(ILaunchConfiguration config, String mode)
+ throws CoreException;
+
+ String mode;
+
+ void prepareLaunch(ILaunchConfiguration configuration, String mode)
+ {
+ this.mode = mode;
+ if (isOTLaunch(configuration) && ILaunchManager.DEBUG_MODE.equals(mode))
+ try {
+ PDELaunchingAdaptor.installOOTBreakpoints(getProjectsForProblemSearch(configuration, mode));
+ } catch (CoreException ex) {
+ logException(ex, Status.WARNING, DebugMessages.OTLaunching_no_OTJ_project_found);
+ }
+ }
+ }
+
+ /**
+ * This role adapts any pde-launch where the OT/Equinox flag is set to true:
+ * <ul>
+ * <li>add OT-specific arguments to the vm args (extendVMArguments)</li>
+ * <li>install the breakpoints needed by the TeamMonitor (prepareLaunch)</li>
+ * </ul>
+ */
+ protected class Launcher extends AbstractLauncher playedBy AbstractPDELaunchConfiguration
+ {
+ @SuppressWarnings("decapsulation")
+ getProjectsForProblemSearch -> getProjectsForProblemSearch;
+
+ // Extend VM arguments:
+ String[] extendVMArguments(ILaunchConfiguration config) <- replace String[] getVMArguments(ILaunchConfiguration config);
+ callin String[] extendVMArguments(ILaunchConfiguration config) throws CoreException
+ {
+ String[] args = base.extendVMArguments(config);
+ if (isOTLaunch(config))
+ return PDELaunchingAdaptor.extendVMArguments(args, this.mode);
+ else
+ return PDELaunchingAdaptor.addDisableOTEquinoxArgument(args);
+ }
+
+ // install breakpoints and record launch mode (run/debug):
+ prepareLaunch <- before launch;
+ }
+
+ /** Unfortunately JUnit launches are slightly different (and not related by inheritance) */
+ protected class JUnitLauncher extends AbstractLauncher playedBy JUnitLaunchConfigurationDelegate
+ {
+ @SuppressWarnings("decapsulation")
+ getProjectsForProblemSearch -> getProjectsForProblemSearch;
+
+ // Extend VM arguments:
+ String extendVMArgument(ILaunchConfiguration config) <- replace String getVMArguments(ILaunchConfiguration config);
+ callin String extendVMArgument(ILaunchConfiguration config) throws CoreException
+ {
+ String result = base.extendVMArgument(config);
+ if (isOTLaunch(config))
+ return PDELaunchingAdaptor.extendVMArguments(result, this.mode);
+ else
+ return result+' '+DISABLE_OTEQUINOX;
+ }
+
+ // install breakpoints and record launch mode (run/debug):
+ prepareLaunch <- before launch;
+ }
+
+ /**
+ * UI: This role allows us to insert our "Object Teams Runtime" block just after the JREBlock.
+ */
+ protected class JREBlock playedBy JREBlock {
+ // build the GUI:
+ void appendOTOption(Composite parent) <- after void createControl(Composite parent)
+ base when (PDELaunchingAdaptor.this.currentTab != null); // only within the LauncherTab#launcherTabCFlow() (see below)
+
+ void appendOTOption(Composite parent) {
+ PDELaunchingAdaptor.this.currentTab.createOTRESection(parent, false/*useSWTFactory*/);
+ }
+ }
+
+ /**
+ * This role manages the UI-part of this team:
+ * <ul>
+ * <li>insert a new group after the JREBlock.</li>
+ * <li>read (initializeFrom) and apply (performApply) the new flag.</li></ul>
+ */
+ protected class LauncherTab extends OTREBlock playedBy AbstractLauncherTab {
+
+ LauncherTab(AbstractLauncherTab b) {
+ // different label than default:
+ this.enableCheckboxLabel = DebugMessages.OTLaunching_OTEquinox_checkbox_label;
+ }
+
+ // callout interface:
+ @SuppressWarnings("decapsulation")
+ Button createCheckButton(Composite parent, String label) -> Button createCheckButton(Composite parent, String label);
+
+ @SuppressWarnings("decapsulation")
+ void setDirty(boolean dirty) -> void setDirty(boolean dirty);
+
+ void updateLaunchConfigurationDialog() -> void updateLaunchConfigurationDialog();
+
+ // CFlow to let the JREBlock trigger building the GUI:
+ launcherTabCFlow <- replace createControl;
+ callin void launcherTabCFlow(Composite parent) {
+ try {
+ PDELaunchingAdaptor.this.currentTab = this;
+ base.launcherTabCFlow(parent);
+ } finally {
+ PDELaunchingAdaptor.this.currentTab = null;
+ }
+ }
+
+ // connect triggers to inherited methods:
+ void initializeFrom(ILaunchConfiguration config) <- after void initializeFrom(ILaunchConfiguration config)
+ when (this._otreToggleButton != null); // i.e.: is this the tab containing the JREBlock?
+
+ @Override
+ boolean hasOTJProject(ILaunchConfiguration config) {
+ return true; // assume we might have an OT project - even without scanning through all projects; always want to enable our options
+ }
+
+ void performApply(ILaunchConfigurationWorkingCopy config)
+ <- after void performApply(ILaunchConfigurationWorkingCopy config);
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/launching/TeamConfig.java b/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/launching/TeamConfig.java
new file mode 100644
index 000000000..41b7c951d
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/launching/TeamConfig.java
@@ -0,0 +1,453 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2005, 2009 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: TeamConfig.java 23456 2010-02-04 20:44:45Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.debug.adaptor.launching;
+
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jdt.core.Flags;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.search.IJavaSearchScope;
+import org.eclipse.jdt.core.search.SearchEngine;
+import org.eclipse.jdt.internal.ui.viewsupport.AppearanceAwareLabelProvider;
+import org.eclipse.jdt.ui.JavaElementLabels;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+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.objectteams.otdt.core.IOTType;
+import org.eclipse.objectteams.otdt.core.OTModelManager;
+import org.eclipse.objectteams.otdt.ui.OTDTUIPlugin;
+import org.eclipse.objectteams.otdt.ui.dialogs.ISearchFilter;
+import org.eclipse.objectteams.otdt.ui.dialogs.TeamSelectionDialog;
+
+/**
+ * Configuration data for the "Team Activation" tab.
+ *
+ * Created on 02.02.2005
+ * @author gis
+ */
+@SuppressWarnings("restriction")
+public class TeamConfig extends Composite
+{
+
+ private Button _downButton;
+ private Button _upButton;
+ private Button _removeButton;
+ private Button _addButton;
+ private OTLaunchConfigurationTab _otLaunchConfigTab;
+ private TableViewer _teamList;
+ private Button _activeCheckButton;
+
+ public TeamConfig(Composite parent, int style, OTLaunchConfigurationTab otlcTab)
+ {
+ super(parent, style);
+ _otLaunchConfigTab = otlcTab;
+
+ GridLayout grid = new GridLayout();
+ grid.numColumns = 1;
+ grid.marginWidth = 3;
+ setLayout(grid);
+
+ _activeCheckButton = new Button(this, SWT.CHECK);
+ _activeCheckButton.setText(OTDTUIPlugin.getResourceString("TeamConfig.activate_checkbox_description")); //$NON-NLS-1$
+ GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_BEGINNING);
+ _activeCheckButton.setLayoutData(data);
+ _activeCheckButton.setFont(this.getFont());
+ _activeCheckButton.addSelectionListener(new SelectionListener() {
+ public void widgetSelected(SelectionEvent e) {
+ boolean active = isActive();
+ _teamList.getControl().setEnabled(active);
+ _otLaunchConfigTab.setModified();
+ }
+ public void widgetDefaultSelected(SelectionEvent e) {
+ widgetSelected(e);
+ }
+ });
+
+ Composite mainCompo = new Composite(this, SWT.NULL);
+ mainCompo.setLayout(new FormLayout());
+ data = new GridData(GridData.FILL_BOTH);
+ mainCompo.setLayoutData(data);
+
+ _teamList = new TableViewer(mainCompo, SWT.BORDER|SWT.H_SCROLL|SWT.V_SCROLL);
+ AppearanceAwareLabelProvider labelProvider = new AppearanceAwareLabelProvider();
+ labelProvider.setTextFlags(JavaElementLabels.T_POST_QUALIFIED);
+ _teamList.setLabelProvider(labelProvider);
+
+ _teamList.setContentProvider(new IStructuredContentProvider() {
+ @SuppressWarnings("unchecked") // cast to generic list not supported
+ public Object[] getElements(Object inputElement)
+ {
+ if (inputElement instanceof List)
+ {
+ List<IType> list = (List<IType>) inputElement;
+ return list.toArray(new IType[list.size()]);
+ }
+ return null;
+ }
+
+ public void dispose() {}
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
+ });
+
+ _teamList.addPostSelectionChangedListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event)
+ {
+ checkEnablement();
+ }
+ });
+
+ final FormData formData = new FormData();
+ formData.right = new FormAttachment(100, -162);
+ formData.bottom = new FormAttachment(100, -5);
+ formData.top = new FormAttachment(0, 5);
+ formData.left = new FormAttachment(0, 2);
+ Control teamListControl = _teamList.getControl();
+ teamListControl.setLayoutData(formData);
+
+ final Composite composite_1 = new Composite(mainCompo, SWT.NONE);
+ final GridLayout gridLayout = new GridLayout();
+ gridLayout.horizontalSpacing = 0;
+ gridLayout.marginWidth = 0;
+ gridLayout.marginHeight = 0;
+ composite_1.setLayout(gridLayout);
+ final FormData formData_1 = new FormData();
+ formData_1.left = new FormAttachment(teamListControl, 5, SWT.RIGHT);
+ formData_1.bottom = new FormAttachment(teamListControl, 0, SWT.BOTTOM);
+ formData_1.right = new FormAttachment(100, -5);
+ formData_1.top = new FormAttachment(teamListControl, 0, SWT.TOP);
+ composite_1.setLayoutData(formData_1);
+ _addButton = new Button(composite_1, SWT.NONE);
+ final GridData gridData = new GridData(GridData.FILL_HORIZONTAL| GridData.VERTICAL_ALIGN_BEGINNING);
+ _addButton.setLayoutData(gridData);
+ _addButton.addSelectionListener(new SelectionListener() {
+ public void widgetSelected(SelectionEvent e) {
+ askAddTeam();
+ }
+ public void widgetDefaultSelected(SelectionEvent e) {
+ widgetSelected(e);
+ }
+ });
+ _addButton.setText(OTDTUIPlugin.getResourceString("TeamConfig.add_team_button_label")); //$NON-NLS-1$
+
+ _removeButton = new Button(composite_1, SWT.NONE);
+ final GridData gridData_1 = new GridData(GridData.FILL_HORIZONTAL| GridData.VERTICAL_ALIGN_BEGINNING);
+ _removeButton.setLayoutData(gridData_1);
+ _removeButton.addSelectionListener(new SelectionListener() {
+ public void widgetSelected(SelectionEvent e) {
+ removeSelected();
+ }
+ public void widgetDefaultSelected(SelectionEvent e) {
+ widgetSelected(e);
+ }
+ });
+ _removeButton.setText(OTDTUIPlugin.getResourceString("TeamConfig.remove_team_button_label")); //$NON-NLS-1$
+
+ _upButton = new Button(composite_1, SWT.NONE);
+ final GridData gridData_2 = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING);
+ gridData_2.horizontalSpan = 2;
+ _upButton.setLayoutData(gridData_2);
+ _upButton.addSelectionListener(new SelectionListener() {
+ public void widgetSelected(SelectionEvent e) {
+ moveSelectedUp();
+ }
+ public void widgetDefaultSelected(SelectionEvent e) {
+ widgetSelected(e);
+ }
+ });
+ _upButton.setText(OTDTUIPlugin.getResourceString("TeamConfig.team_up_button_label")); //$NON-NLS-1$
+
+ _downButton = new Button(composite_1, SWT.NONE);
+ final GridData gridData_3 = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING);
+ _downButton.setLayoutData(gridData_3);
+ _downButton.addSelectionListener(new SelectionListener() {
+ public void widgetSelected(SelectionEvent e) {
+ moveSelectedDown();
+ }
+ public void widgetDefaultSelected(SelectionEvent e) {
+ widgetSelected(e);
+ }
+ });
+ _downButton.setText(OTDTUIPlugin.getResourceString("TeamConfig.team_down_button_label")); //$NON-NLS-1$
+
+ }
+
+ public void dispose()
+ {
+ super.dispose();
+ }
+
+ protected void checkSubclass()
+ {
+ super.checkSubclass();
+ }
+
+// private class WidgetListener implements ModifyListener {
+// public void modifyText(ModifyEvent e) {
+// _otLaunchConfigTab.setModified();
+// }
+// public void widgetDefaultSelected(SelectionEvent e) {
+// }
+// }
+// private WidgetListener fListener = new WidgetListener();
+
+
+ private void addTeam(IType chosenTeam)
+ {
+ if (chosenTeam != null)
+ {
+ IType teamType = chosenTeam;
+ if (!(chosenTeam instanceof IOTType))
+ teamType = OTModelManager.getOTElement(chosenTeam);
+
+ if (teamType != null)
+ {
+ // TODO (carp): perform further checks (e.g. must have public default constructor)
+ _otLaunchConfigTab.getTeamModel().add(teamType);
+ _otLaunchConfigTab.setModified();
+ checkEnablement();
+ _teamList.refresh();
+ }
+ else
+ {
+ MessageDialog.openError(
+ getShell(),
+ OTDTUIPlugin.getResourceString("TeamConfig.error_adding_team_title"), //$NON-NLS-1$
+ MessageFormat.format(
+ OTDTUIPlugin.getResourceString("TeamConfig.error_adding_team_message"), new Object[] { chosenTeam.getFullyQualifiedName() })); //$NON-NLS-1$
+ }
+ }
+ }
+
+ public void clearTeamList() {
+ _otLaunchConfigTab.getTeamModel().clear();
+ checkEnablement();
+ _teamList.refresh();
+ }
+
+ public boolean isActive() {
+ return _activeCheckButton.getSelection();
+ }
+
+ public void setActive(boolean active) {
+ _activeCheckButton.setSelection(active);
+ _teamList.getControl().setEnabled(active);
+ }
+
+ private IType chooseTeamFromClasspath(IProject project) {
+ if (project == null || !project.exists())
+ return null;
+
+ IJavaProject java_project = JavaCore.create(project);
+ IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[]{ java_project});
+
+ TeamSelectionDialog dialog = new TeamSelectionDialog(
+ TeamConfig.this.getShell(),
+ _otLaunchConfigTab.getRunnableContext(),
+ scope);
+
+ dialog.setTitle(OTDTUIPlugin.getResourceString("TeamConfig.choose_team_dialog_title")); //$NON-NLS-1$
+ dialog.setMessage(OTDTUIPlugin.getResourceString("TeamConfig.choose_team_dialog_description")); //$NON-NLS-1$
+ dialog.setFilter("*"); //$NON-NLS-1$
+ dialog.addSearchFilter(new ISearchFilter() {
+ public IOTType[] filterTypes(IOTType[] types)
+ {
+ List teamModel = _otLaunchConfigTab.getTeamModel();
+ List<IOTType> result = new ArrayList<IOTType>(types.length);
+ for (int i = 0; i < types.length; i++)
+ {
+ IOTType type = types[i];
+ // hide abstract teams and those already in the list
+ if (!Flags.isAbstract(type.getFlags()) && !teamModel.contains(type))
+ result.add(type);
+ }
+
+ return result.toArray(new IOTType[result.size()]);
+ }
+ });
+
+
+ if (dialog.open() == Window.OK) {
+ IType selectedType = (IType) dialog.getFirstResult();
+ return selectedType;
+ }
+
+ return null;
+ }
+
+ private void removeSelected()
+ {
+ IStructuredSelection selection = (IStructuredSelection)_teamList.getSelection();
+ for (Iterator iterator = selection.iterator(); iterator.hasNext();)
+ {
+ IType selectedType = (IType) iterator.next();
+ _otLaunchConfigTab.getTeamModel().remove(selectedType);
+ }
+ _otLaunchConfigTab.setModified();
+ checkEnablement();
+ _teamList.refresh();
+ }
+
+ private void askAddTeam()
+ {
+ IProject project = _otLaunchConfigTab.getProject();
+ if (project == null)
+ {
+ MessageDialog.openInformation(getShell(), OTDTUIPlugin.getResourceString("TeamConfig.project_not_set_title"), OTDTUIPlugin.getResourceString("TeamConfig.project_not_set_message")); //$NON-NLS-1$ //$NON-NLS-2$
+ return;
+ }
+
+ // TODO: check if the selected team has a default constructor, otherwise give an error message.
+ IType chosenTeam = chooseTeamFromClasspath(project);
+ if (chosenTeam != null)
+ {
+ addTeam(chosenTeam);
+ }
+ }
+
+ private void moveSelectedUp()
+ {
+ List<IType> teamModel = _otLaunchConfigTab.getTeamModel();
+
+ final int currentIndex = getTeamSelectionIndex();
+ if (currentIndex > 0) {
+ IType currentTeam = teamModel.get(currentIndex);
+ IType aboveTeam = teamModel.get(currentIndex - 1);
+ teamModel.set(currentIndex - 1, currentTeam);
+ teamModel.set(currentIndex, aboveTeam);
+ _teamList.refresh();
+ _otLaunchConfigTab.setModified();
+
+ checkMoveEnablement();
+ }
+ }
+
+ private void moveSelectedDown()
+ {
+ List<IType> teamModel = _otLaunchConfigTab.getTeamModel();
+
+ final int currentIndex = getTeamSelectionIndex();
+ if (currentIndex < _otLaunchConfigTab.getTeamModel().size() - 1) {
+ IType currentTeam = teamModel.get(currentIndex);
+ IType belowTeam = teamModel.get(currentIndex + 1);
+ teamModel.set(currentIndex + 1, currentTeam);
+ teamModel.set(currentIndex, belowTeam);
+ _teamList.refresh();
+ _otLaunchConfigTab.setModified();
+
+ checkMoveEnablement();
+ }
+ }
+
+
+ void checkEnablement()
+ {
+ checkMoveEnablement();
+ checkActiveEnablement();
+
+ if (_teamList.getSelection().isEmpty())
+ {
+ _removeButton.setEnabled(false);
+ }
+ else
+ {
+ _removeButton.setEnabled(true);
+ }
+ }
+
+ private void checkActiveEnablement()
+ {
+ boolean enable = !_otLaunchConfigTab.getTeamModel().isEmpty();
+ _activeCheckButton.setEnabled(enable);
+ }
+
+ private void checkMoveEnablement()
+ {
+ final int index = getTeamSelectionIndex();
+
+ if (index == -1)
+ {
+ _upButton.setEnabled(false);
+ _downButton.setEnabled(false);
+ return;
+ }
+
+ final int count = _otLaunchConfigTab.getTeamModel().size();
+ boolean canMove = count >= 2;
+
+ if (index == 0)
+ {
+ _upButton.setEnabled(false);
+ _downButton.setEnabled(canMove);
+ }
+ else if (index == count - 1)
+ {
+ _downButton.setEnabled(false);
+ _upButton.setEnabled(canMove);
+ }
+ else
+ {
+ _upButton.setEnabled(canMove);
+ _downButton.setEnabled(canMove);
+ }
+ }
+
+ private int getTeamIndex(Object element)
+ {
+ return _otLaunchConfigTab.getTeamModel().indexOf(element);
+ }
+
+ private int getTeamSelectionIndex()
+ {
+ IStructuredSelection selection = (IStructuredSelection) _teamList.getSelection();
+ if (selection == null || selection.isEmpty())
+ return -1;
+
+ return getTeamIndex(selection.getFirstElement());
+ }
+
+ public void setTeamInput(List teamModel)
+ {
+ _teamList.setInput(teamModel);
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.ui/.classpath b/plugins/org.eclipse.objectteams.otdt.debug.ui/.classpath
new file mode 100644
index 000000000..304e86186
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.ui/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <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.objectteams.otdt.debug.ui/.cvsignore b/plugins/org.eclipse.objectteams.otdt.debug.ui/.cvsignore
new file mode 100644
index 000000000..ba077a403
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.ui/.cvsignore
@@ -0,0 +1 @@
+bin
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.ui/.project b/plugins/org.eclipse.objectteams.otdt.debug.ui/.project
new file mode 100644
index 000000000..cc7431314
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.ui/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.objectteams.otdt.debug.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>
+ </natures>
+</projectDescription>
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.ui/.settings/org.eclipse.core.resources.prefs b/plugins/org.eclipse.objectteams.otdt.debug.ui/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 000000000..99679bd19
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.ui/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,3 @@
+#Tue Oct 17 14:45:23 CEST 2006
+eclipse.preferences.version=1
+encoding//src/org/objectteams/otdt/debug/ui/views/TeamViewMessages.properties=8859_1
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.ui/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.objectteams.otdt.debug.ui/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..e10b5f141
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.ui/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,57 @@
+#Tue Sep 18 18:19:58 CEST 2007
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+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=ignore
+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=ignore
+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=warning
+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.objectteams.otdt.debug.ui/META-INF/MANIFEST.MF b/plugins/org.eclipse.objectteams.otdt.debug.ui/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..ab56ecda8
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.ui/META-INF/MANIFEST.MF
@@ -0,0 +1,30 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: OTDebugUI Plug-in
+Bundle-SymbolicName: org.eclipse.objectteams.otdt.debug.ui;singleton:=true
+Bundle-Version: 1.3.2.qualifier
+Bundle-Activator: org.eclipse.objectteams.otdt.debug.ui.OTDebugUIPlugin
+Bundle-Vendor: Fraunhofer FIRST
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.ui,
+ org.eclipse.jdt.core,
+ org.eclipse.debug.core,
+ org.eclipse.debug.ui,
+ org.eclipse.jdt.debug,
+ org.eclipse.jdt.debug.ui,
+ org.eclipse.objectteams.otdt.debug,
+ org.eclipse.ui.workbench.texteditor,
+ org.eclipse.jface.text,
+ org.eclipse.ui.editors,
+ org.eclipse.core.resources,
+ org.eclipse.ui.ide,
+ org.eclipse.jdt.ui,
+ org.eclipse.jdt.launching,
+ org.eclipse.objectteams.otdt.ui
+Export-Package: org.eclipse.objectteams.otdt.debug.ui,
+ org.eclipse.objectteams.otdt.debug.ui.internal,
+ org.eclipse.objectteams.otdt.debug.ui.internal.actions,
+ org.eclipse.objectteams.otdt.debug.ui.internal.preferences,
+ org.eclipse.objectteams.otdt.debug.ui.views
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.ui/build.properties b/plugins/org.eclipse.objectteams.otdt.debug.ui/build.properties
new file mode 100644
index 000000000..feed1da5d
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.ui/build.properties
@@ -0,0 +1,10 @@
+source.. = src/
+output.. = bin/
+bin.includes = plugin.xml,\
+ META-INF/,\
+ .,\
+ icons/
+src.includes = src/,\
+ .classpath,\
+ .project,\
+ build.properties
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.ui/icons/refresh.gif b/plugins/org.eclipse.objectteams.otdt.debug.ui/icons/refresh.gif
new file mode 100644
index 000000000..6f13b0ab2
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.ui/icons/refresh.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.ui/icons/sample.gif b/plugins/org.eclipse.objectteams.otdt.debug.ui/icons/sample.gif
new file mode 100644
index 000000000..34fb3c9d8
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.ui/icons/sample.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.ui/icons/sort_by_activation.gif b/plugins/org.eclipse.objectteams.otdt.debug.ui/icons/sort_by_activation.gif
new file mode 100644
index 000000000..0e8daade8
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.ui/icons/sort_by_activation.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.ui/icons/sort_by_activationtime.gif b/plugins/org.eclipse.objectteams.otdt.debug.ui/icons/sort_by_activationtime.gif
new file mode 100644
index 000000000..3d7a794c0
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.ui/icons/sort_by_activationtime.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.ui/icons/sort_by_instantiation.gif b/plugins/org.eclipse.objectteams.otdt.debug.ui/icons/sort_by_instantiation.gif
new file mode 100644
index 000000000..db4062c15
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.ui/icons/sort_by_instantiation.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.ui/icons/sort_by_name.gif b/plugins/org.eclipse.objectteams.otdt.debug.ui/icons/sort_by_name.gif
new file mode 100644
index 000000000..907d34fc8
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.ui/icons/sort_by_name.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.ui/icons/team_act.gif b/plugins/org.eclipse.objectteams.otdt.debug.ui/icons/team_act.gif
new file mode 100644
index 000000000..58a8638cc
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.ui/icons/team_act.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.ui/icons/team_act_implicit.gif b/plugins/org.eclipse.objectteams.otdt.debug.ui/icons/team_act_implicit.gif
new file mode 100644
index 000000000..41dc6c2aa
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.ui/icons/team_act_implicit.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.ui/icons/team_inact.gif b/plugins/org.eclipse.objectteams.otdt.debug.ui/icons/team_inact.gif
new file mode 100644
index 000000000..2b5ea0d1e
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.ui/icons/team_inact.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.ui/icons/tm.gif b/plugins/org.eclipse.objectteams.otdt.debug.ui/icons/tm.gif
new file mode 100644
index 000000000..67fd7ccab
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.ui/icons/tm.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.ui/plugin.xml b/plugins/org.eclipse.objectteams.otdt.debug.ui/plugin.xml
new file mode 100644
index 000000000..3b15ac9a3
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.ui/plugin.xml
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+<plugin>
+
+ <extension
+ point="org.eclipse.ui.views">
+ <view
+ class="org.eclipse.objectteams.otdt.debug.ui.views.TeamView"
+ icon="icons/tm.gif"
+ name="Team Monitor"
+ category="org.eclipse.objectteams.otdt.ui"
+ id="org.eclipse.objectteams.otdt.debug.ui.views.team">
+ <description>
+ Debug view showing all team instances.
+Supports drill in and interactive (de)activation of teams.
+ </description>
+ </view>
+ </extension>
+
+
+ <extension
+ point="org.eclipse.ui.perspectiveExtensions">
+ <perspectiveExtension
+ targetID="org.eclipse.objectteams.otdt.ui.OTJavaPerspective">
+ <actionSet
+ id="org.eclipse.debug.ui.breakpointActionSet">
+ </actionSet>
+ <actionSet
+ id="org.eclipse.jdt.debug.ui.JDTDebugActionSet">
+ </actionSet>
+ <viewShortcut
+ id="org.eclipse.objectteams.otdt.debug.ui.views.team">
+ </viewShortcut>
+ </perspectiveExtension>
+ <perspectiveExtension targetID="org.eclipse.debug.ui.DebugPerspective">
+ <viewShortcut id="org.eclipse.objectteams.otdt.debug.ui.views.team"/>
+ </perspectiveExtension>
+ </extension>
+
+
+ <extension
+ point="org.eclipse.ui.preferencePages">
+
+ <!-- General Object Teams configuration options -->
+ <page
+ id="org.eclipse.objectteams.otdt.debug.ui.preferences.PreferencePage"
+ name="Debug"
+ class="org.eclipse.objectteams.otdt.debug.ui.internal.preferences.OTDebugPreferencePage"
+ category="org.eclipse.objectteams.otdt.ui.preferences.GeneralPreferencePage">
+ </page>
+
+ </extension>
+ <extension
+ point="org.eclipse.core.runtime.preferences">
+ <initializer
+ class="org.eclipse.objectteams.otdt.debug.ui.internal.preferences.OTDebugPreferences">
+ </initializer>
+ </extension>
+
+</plugin>
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/OTDebugImages.java b/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/OTDebugImages.java
new file mode 100644
index 000000000..a04871ebe
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/OTDebugImages.java
@@ -0,0 +1,86 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute and Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: OTDebugImages.java 23432 2010-02-03 23:13:42Z stephan $
+ *
+ * Please visit http://www.objectteams.org for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.debug.ui;
+
+import java.net.URL;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ImageRegistry;
+import org.osgi.framework.Bundle;
+
+
+/**
+ * @author ike
+ *
+ * $Id: OTDebugImages.java 23432 2010-02-03 23:13:42Z stephan $
+ */
+
+@SuppressWarnings("nls")
+public class OTDebugImages
+{
+ public static final String TEAM_ACTIVATED = "icons/team_act.gif";
+ public static final String TEAM_IMPLICIT_ACTIVATED = "icons/team_act_implicit.gif";
+ public static final String TEAM_INACTIVATED = "icons/team_inact.gif";
+ public static final String SORT_TEAMS_BY_ACTIVATION_TIME = "icons/sort_by_activationtime.gif";
+ public static final String SORT_TEAMS_BY_ACTIVATION_ORDER = "icons/sort_by_activation.gif";
+ public static final String SORT_TEAMS_BY_NAME = "icons/sort_by_name.gif";
+ public static final String SORT_TEAMS_BY_INSTANTIATION = "icons/sort_by_instantiation.gif";
+ public static final String UPDATE_TEAM_VIEW_ACTION = "icons/refresh.gif";
+
+
+ public static void register()
+ {
+ checkBundleState();
+
+ OTDebugUIPlugin plugin = OTDebugUIPlugin.getDefault();
+ Bundle bundle = plugin.getBundle();
+ ImageRegistry registry = plugin.getImageRegistry();
+
+ register(TEAM_ACTIVATED, bundle, registry);
+ register(TEAM_IMPLICIT_ACTIVATED, bundle, registry);
+ register(TEAM_INACTIVATED, bundle, registry);
+ register(SORT_TEAMS_BY_ACTIVATION_TIME, bundle, registry);
+ register(SORT_TEAMS_BY_ACTIVATION_ORDER, bundle, registry);
+ register(SORT_TEAMS_BY_NAME, bundle, registry);
+ register(SORT_TEAMS_BY_INSTANTIATION, bundle, registry);
+ register(UPDATE_TEAM_VIEW_ACTION, bundle, registry);
+ }
+
+ public static ImageDescriptor get(String image)
+ {
+ checkBundleState();
+ return OTDebugUIPlugin.getDefault().getImageRegistry().getDescriptor(image);
+ }
+
+ static void register(String icon, Bundle bundle, ImageRegistry registry)
+ {
+ URL imageURL = bundle.getEntry(icon);
+ ImageDescriptor desc = ImageDescriptor.createFromURL(imageURL);
+ registry.put(icon, desc);
+ }
+
+ private static void checkBundleState()
+ {
+ if (OTDebugUIPlugin.getDefault().getBundle().getState() != Bundle.ACTIVE)
+ throw new IllegalStateException("Bundle not active: " + OTDebugUIPlugin.getDefault().getBundle().getBundleId());
+ }
+
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/OTDebugUIPlugin.java b/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/OTDebugUIPlugin.java
new file mode 100644
index 000000000..83fad2572
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/OTDebugUIPlugin.java
@@ -0,0 +1,157 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute and Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: OTDebugUIPlugin.java 23432 2010-02-03 23:13:42Z stephan $
+ *
+ * Please visit http://www.objectteams.org for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.debug.ui;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+import org.eclipse.core.resources.IResourceChangeEvent;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IAdapterManager;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.debug.internal.ui.ColorManager;
+import org.eclipse.jdt.debug.core.JDIDebugModel;
+import org.eclipse.jface.preference.PreferenceConverter;
+import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.objectteams.otdt.core.exceptions.ExceptionHandler;
+import org.eclipse.objectteams.otdt.debug.OTDebugElementsContainer;
+import org.eclipse.objectteams.otdt.debug.TeamInstance;
+import org.eclipse.objectteams.otdt.debug.ui.internal.CopyInheritanceBreakpointManager;
+import org.eclipse.objectteams.otdt.debug.ui.internal.OTDebugElementAdapterFactory;
+import org.eclipse.objectteams.otdt.debug.ui.internal.preferences.OTDebugPreferences;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The main plugin class to be used in the desktop.
+ */
+public class OTDebugUIPlugin extends AbstractUIPlugin
+{
+ // preference constants
+ public static final String PLUGIN_ID = "org.eclipse.objectteams.otdt.debug.ui"; //$NON-NLS-1$
+ public static final String TEAM_DETAIL_PANE_ORIENTATION = "ot.teamview.detail.orientation"; //$NON-NLS-1$
+
+ // this id is also used in plugin.xml:
+ public static final String TEAM_VIEW_ID = "org.eclipse.objectteams.otdt.debug.ui.views.team"; //$NON-NLS-1$
+
+
+ private static final String PREFIX = PLUGIN_ID + "."; //$NON-NLS-1$
+ public static final String HELP_TEAM_VIEW = PREFIX + "team_view_context"; //$NON-NLS-1$
+
+ //The shared instance.
+ private static OTDebugUIPlugin plugin;
+ //Resource bundle.
+ private ResourceBundle resourceBundle;
+ private CopyInheritanceBreakpointManager _copyInheritanceBPManager;
+
+ // TODO: use JDIDebugUIPlugin to contribute to the UI
+
+ /**
+ * The constructor.
+ */
+ public OTDebugUIPlugin()
+ {
+ super();
+ plugin = this;
+ try {
+ resourceBundle = ResourceBundle.getBundle("org.eclipse.objectteams.otdt.debug.ui.OTDebugUIPluginResources"); //$NON-NLS-1$
+ } catch (MissingResourceException x) {
+ resourceBundle = null;
+ }
+ }
+
+ /**
+ * This method is called upon plug-in activation
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ OTDebugPreferences.propagateFilterFlag(getPreferenceStore());
+
+ // this breakpoint manager listens to two kinds of changes:
+ _copyInheritanceBPManager = new CopyInheritanceBreakpointManager();
+ JDIDebugModel.addJavaBreakpointListener(_copyInheritanceBPManager);
+ ResourcesPlugin.getWorkspace().addResourceChangeListener(_copyInheritanceBPManager, IResourceChangeEvent.POST_CHANGE);
+
+ IAdapterManager manager= Platform.getAdapterManager();
+ OTDebugElementAdapterFactory propertiesFactory = new OTDebugElementAdapterFactory();
+ manager.registerAdapters(propertiesFactory, OTDebugElementsContainer.class);
+ manager.registerAdapters(propertiesFactory, TeamInstance.class);
+
+ }
+
+ /**
+ * This method is called when the plug-in is stopped
+ */
+ public void stop(BundleContext context) throws Exception {
+ JDIDebugModel.removeJavaBreakpointListener(_copyInheritanceBPManager);
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance.
+ */
+ public static OTDebugUIPlugin getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Returns the string from the plugin's resource bundle,
+ * or 'key' if not found.
+ */
+ public static String getResourceString(String key) {
+ ResourceBundle bundle = OTDebugUIPlugin.getDefault().getResourceBundle();
+ try {
+ return (bundle != null) ? bundle.getString(key) : key;
+ } catch (MissingResourceException e) {
+ return key;
+ }
+ }
+
+ /**
+ * Returns the plugin's resource bundle,
+ */
+ public ResourceBundle getResourceBundle() {
+ return resourceBundle;
+ }
+
+ /**
+ * Returns the a color based on the type of output.
+ * Valid types:
+ * <li>OT_GENERATED_CODE_COLOR</li>
+ * <li>CONSOLE_SYS_ERR_RGB</li>
+ */
+ public static Color getPreferenceColor(String type) {
+ return ColorManager.getDefault().getColor(PreferenceConverter.getColor(getDefault().getPreferenceStore(), type));
+ }
+
+
+ public static ExceptionHandler getExceptionHandler()
+ {
+ return new ExceptionHandler(PLUGIN_ID);
+ }
+
+ protected void initializeImageRegistry(ImageRegistry reg)
+ {
+ super.initializeImageRegistry(reg);
+ OTDebugImages.register();
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/BreakpointMessages.java b/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/BreakpointMessages.java
new file mode 100644
index 000000000..864cb2e75
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/BreakpointMessages.java
@@ -0,0 +1,36 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute and Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: BreakpointMessages.java 23432 2010-02-03 23:13:42Z stephan $
+ *
+ * Please visit http://www.objectteams.org for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.debug.ui.internal;
+
+import org.eclipse.osgi.util.NLS;
+
+public class BreakpointMessages extends NLS {
+ private static final String BUNDLE_NAME = "org.eclipse.objectteams.otdt.debug.ui.internal.BreakpointMessages"; //$NON-NLS-1$
+ public static String CopyInheritanceBreakpointManager_find_tsub_types_task;
+ public static String CopyInheritanceBreakpointManager_toggle_enablement_job;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, BreakpointMessages.class);
+ }
+
+ private BreakpointMessages() {
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/BreakpointMessages.properties b/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/BreakpointMessages.properties
new file mode 100644
index 000000000..976c95f1e
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/BreakpointMessages.properties
@@ -0,0 +1,2 @@
+CopyInheritanceBreakpointManager_find_tsub_types_task=Finding tsub-types...
+CopyInheritanceBreakpointManager_toggle_enablement_job=Toggle copied breakpoint enablement
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/CopyInheritanceBreakpointManager.java b/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/CopyInheritanceBreakpointManager.java
new file mode 100644
index 000000000..fbcebcf89
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/CopyInheritanceBreakpointManager.java
@@ -0,0 +1,426 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute and Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: CopyInheritanceBreakpointManager.java 23432 2010-02-03 23:13:42Z stephan $
+ *
+ * Please visit http://www.objectteams.org for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.debug.ui.internal;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IMarkerDelta;
+import org.eclipse.core.resources.IResourceChangeEvent;
+import org.eclipse.core.resources.IResourceChangeListener;
+import org.eclipse.core.resources.IResourceDelta;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.debug.core.DebugException;
+import org.eclipse.debug.core.model.IBreakpoint;
+import org.eclipse.jdt.core.Flags;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.core.dom.Message;
+import org.eclipse.jdt.debug.core.IJavaBreakpoint;
+import org.eclipse.jdt.debug.core.IJavaBreakpointListener;
+import org.eclipse.jdt.debug.core.IJavaDebugTarget;
+import org.eclipse.jdt.debug.core.IJavaInterfaceType;
+import org.eclipse.jdt.debug.core.IJavaLineBreakpoint;
+import org.eclipse.jdt.debug.core.IJavaThread;
+import org.eclipse.jdt.debug.core.IJavaType;
+import org.eclipse.jdt.debug.core.JDIDebugModel;
+import org.eclipse.jdt.internal.debug.ui.BreakpointUtils;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.objectteams.otdt.core.IOTType;
+import org.eclipse.objectteams.otdt.core.IOTTypeHierarchy;
+import org.eclipse.objectteams.otdt.core.IRoleType;
+import org.eclipse.objectteams.otdt.core.OTModelManager;
+import org.eclipse.objectteams.otdt.core.compiler.ISMAPConstants;
+import org.eclipse.objectteams.otdt.debug.ui.OTDebugUIPlugin;
+
+/**
+ * This class deals with the problem that a breakpoint in role-method won't have an effect
+ * in tsub-classes. This is due to the fact, that methods are inherited through CopyInheritance,
+ * that is, their byte-code is copied to the tsub-class.
+ *
+ * This class sort of performs copy-inheritance for breakpoints. I.e. whenever a breakpoint
+ * is installed for a role-method, it will be installed in the copied methods of all tsub-classes
+ * as well.
+ *
+ * When uninstalling a breakpoint for a target, the copies are removed from that target,
+ * and completely removed if no longer installed in any targets.
+ *
+ * Mapping of line numbers is handled by a JavaStratumLineBreakpoint for stratum "OTJ".
+ *
+ * @author gis, stephan
+ */
+public class CopyInheritanceBreakpointManager implements IJavaBreakpointListener, IResourceChangeListener
+{
+ private static final Object OT_BREAKPOINT_COPY = "OT_BREAKPOINT_COPY"; //$NON-NLS-1$
+
+ private static final String ROLE_CLASS_SEPARATOR = "$__OT__"; //$NON-NLS-1$
+
+ /** keep our own mapping from original breakpoints to copies (the breakpoint manager only knows installed breakpoints). */
+ private Map<IMarker, List<IJavaBreakpoint>> copiedBreakpoints = new HashMap<IMarker, List<IJavaBreakpoint>>();
+
+ public CopyInheritanceBreakpointManager()
+ {
+ super();
+ }
+
+ public void addingBreakpoint(IJavaDebugTarget target, IJavaBreakpoint breakpoint) {}
+ public void breakpointInstalled(IJavaDebugTarget target, IJavaBreakpoint breakpoint) {}
+ public void breakpointHasRuntimeException(IJavaLineBreakpoint breakpoint, DebugException exception) {}
+ public void breakpointHasCompilationErrors(IJavaLineBreakpoint breakpoint, Message[] errors) {}
+ public int breakpointHit(IJavaThread thread, IJavaBreakpoint breakpoint)
+ {
+ return IJavaBreakpointListener.DONT_CARE;
+ }
+
+ /**
+ * The debugger signals that a breakpoint is being installed into the VM.
+ * Check if we need to add copies into tsub roles.
+ */
+ public int installingBreakpoint(IJavaDebugTarget target, IJavaBreakpoint breakpoint, IJavaType type)
+ {
+ try {
+ if (isBreakpointCopy(breakpoint))
+ return IJavaBreakpointListener.INSTALL; // yes please! (no further copying needed)
+
+ if (!(type instanceof IJavaInterfaceType))
+ return IJavaBreakpointListener.DONT_CARE; // only use ifc part, (tsuper-) class may not be loaded
+
+ if (breakpoint instanceof IJavaLineBreakpoint)
+ addTSubBreakpointsFor(type, (IJavaLineBreakpoint) breakpoint, target);
+ }
+ catch (CoreException ex)
+ {
+ OTDebugUIPlugin.getExceptionHandler().logCoreException("Problem with breakpoint handling", ex); //$NON-NLS-1$
+ }
+
+ return IJavaBreakpointListener.DONT_CARE;
+ }
+
+ private boolean isBreakpointCopy(IJavaBreakpoint breakpoint) throws CoreException
+ {
+ IMarker marker = breakpoint.getMarker();
+ if (marker == null)
+ return false;
+
+ Map properties = marker.getAttributes();
+ return properties.containsKey(OT_BREAKPOINT_COPY);
+ }
+
+ private void addTSubBreakpointsFor(IJavaType triggerType, IJavaLineBreakpoint breakpoint, IJavaDebugTarget target)
+ throws CoreException
+ {
+ IMarker marker = breakpoint.getMarker();
+ IType type = BreakpointUtils.getType(breakpoint);
+
+ // only act when triggered by the class of the breakpoint (which must be a role):
+ IOTType otType = OTModelManager.getOTElement(type);
+ if (otType == null)
+ return;
+ if (!otType.getFullyQualifiedName('$').equals(triggerType.getName()))
+ return;
+
+ // check whether copies have already been created:
+ List<IJavaBreakpoint> existingCopies = this.copiedBreakpoints.get(marker);
+ if (existingCopies != null) {
+ // tsub breakpoints are already created, only add them to this target:
+ for (IJavaBreakpoint existingCopy : existingCopies)
+ target.breakpointAdded(existingCopy);
+ return;
+ }
+
+ // find tsub roles to install into:
+ IType[] tsubClasses = new TSubClassComputer((IRoleType) otType).getSubClasses();
+ if (tsubClasses == null || tsubClasses.length == 0)
+ return;
+
+ // perform:
+ String fileName = type.getCompilationUnit().getElementName();
+ List<IJavaBreakpoint> newBreakpoints = new ArrayList<IJavaBreakpoint>(tsubClasses.length);
+ for (IType tsubClass : tsubClasses) {
+ IJavaLineBreakpoint newBreakpoint = propagateBreakpoint(breakpoint, fileName, tsubClass, target);
+ if (newBreakpoint != null)
+ newBreakpoints.add(newBreakpoint);
+ }
+
+ this.copiedBreakpoints.put(marker, newBreakpoints);
+
+ }
+
+ /**
+ * Propagate the given breakpoint to one tsub role.
+ *
+ * @param breakpoint breakpoint to copy
+ * @param fileName name of the source file that implements the given line
+ * @param destType the tsub role into which to install
+ * @param target the debug target into which the breakpoint should be installed
+ * @return a new breakpoint or null
+ * @throws CoreException when accessing the existing breakpoint fails or the marker for the new breakpoint could not be created
+ */
+ private IJavaLineBreakpoint propagateBreakpoint(IJavaLineBreakpoint breakpoint, String fileName, IType destType, IJavaDebugTarget target)
+ throws CoreException
+ {
+ if (destType == null)
+ {
+ OTDebugUIPlugin.getDefault().getLog().log(new Status(IStatus.ERROR,
+ OTDebugUIPlugin.PLUGIN_ID,
+ "CopyInheritanceBreakpointManager.propagateBreakpoint(): tsub type is null")); //$NON-NLS-1$
+ return null;
+ }
+
+ Exception ex = null;
+ int sourceLineNumber = -1;
+ try {
+ sourceLineNumber = breakpoint.getLineNumber();
+ } catch (CoreException ce) {
+ ex = ce;
+ }
+ if (sourceLineNumber == -1 || ex != null)
+ {
+ OTDebugUIPlugin.getDefault().getLog().log(new Status(IStatus.ERROR,
+ OTDebugUIPlugin.PLUGIN_ID,
+ "CopyInheritanceBreakpointManager.propagateBreakpoint(): source line number not found", //$NON-NLS-1$
+ ex));
+ return null;
+ }
+
+ return duplicateBreakpoint(breakpoint, fileName, destType, sourceLineNumber, target);
+ }
+
+ /**
+ * Duplicate the given breakpoint for the given tsub-role.
+ *
+ * @param breakpoint breakpoint to copy
+ * @param fileName name of the source file that implements the given line
+ * @param destType the tsub role into which to install
+ * @param sourceLineNumber line number within fileName
+ * @param target the debug target into which the breakpoint should be installed
+ * @return a new breakpoint, never null;
+ * @throws CoreException when accessing the existing breakpoint fails or the marker for the new breakpoint could not be created
+ */
+ private IJavaLineBreakpoint duplicateBreakpoint(IJavaLineBreakpoint breakpoint, String fileName, IType destType, int sourceLineNumber, IJavaDebugTarget target)
+ throws CoreException
+ {
+ // FIXME: other breakpoint types, exception, properties (null)
+ Map properties = getBreakpointProperties(breakpoint);
+ Boolean origEnabled = (Boolean) properties.get(IBreakpoint.ENABLED);
+ String destName = getClassPartName(destType);
+ // Note: by marking the breakpoint as unregistered, we prevent it from showing up in the breakpoints view.
+ // Conversely this means that we can not rely on the breakpoint manager but must maintain our own registry (copiedBreakpoints)
+ IJavaLineBreakpoint newBreakpoint = JDIDebugModel.createStratumBreakpoint(
+ breakpoint.getMarker().getResource(),
+ ISMAPConstants.OTJ_STRATUM_NAME,
+ fileName,
+ null, //sourcePath,
+ destName, // classNamePattern
+ sourceLineNumber,
+ -1, -1, // charStart, charEnd
+ breakpoint.getHitCount(),
+ false,
+ properties);
+ // restore one attribute that is hardcoded in JavaStratumLineBreakpoint.<init>:
+ if (!origEnabled)
+ try {
+ newBreakpoint.getMarker().setAttribute(IBreakpoint.ENABLED, Boolean.FALSE);
+ } catch (CoreException ex) {
+ OTDebugUIPlugin.getExceptionHandler().logCoreException("Unable to disable breakpoint", ex); //$NON-NLS-1$
+ }
+ target.getDebugTarget().breakpointAdded(newBreakpoint);
+
+ return newBreakpoint;
+ }
+
+ /**
+ * If type is a role return the name of its class-part,
+ * and ensure all enclosing role-teams are given by their class-part, too.
+ */
+ String getClassPartName(IType type) {
+ IType enclosing = type.getDeclaringType();
+ try {
+ if ( enclosing != null
+ && Flags.isTeam(enclosing.getFlags()))
+ return getClassPartName(enclosing)+ROLE_CLASS_SEPARATOR+type.getElementName();
+ } catch (JavaModelException e) {
+ // fall through
+ }
+ return type.getFullyQualifiedName();
+ }
+
+ /** Initialize breakpoint properties from `breakpoint' and add a few values specific to copies. */
+ private Map getBreakpointProperties(IJavaLineBreakpoint breakpoint)
+ {
+ Map properties = new HashMap(13);
+ try {
+ properties.putAll(breakpoint.getMarker().getAttributes());
+ } catch (CoreException e) {
+ // couldn't read marker attributes
+ }
+ properties.put(IBreakpoint.PERSISTED, Boolean.FALSE);
+ properties.put(IMarker.SEVERITY, new Integer(IMarker.SEVERITY_WARNING)); // hide from the ruler
+ properties.put(OT_BREAKPOINT_COPY, Boolean.TRUE);
+
+ return properties;
+ }
+
+ /**
+ * A breakpoint has been removed from a target. Do the same for copies of this breakpoint.
+ *
+ * @param target the debug target from which the breakpoint has been removed
+ * @param breakpoint the breakpoint (potential tsuper).
+ */
+ public void breakpointRemoved(IJavaDebugTarget target, IJavaBreakpoint breakpoint)
+ {
+ IMarker marker = breakpoint.getMarker();
+ if (marker == null || !marker.exists())
+ return;
+
+ // retrieve breakpoint and disable it:
+ List<IJavaBreakpoint> copies = this.copiedBreakpoints.get(marker);
+ if (copies == null)
+ return;
+
+ List<IJavaBreakpoint> remainingCopies = new ArrayList<IJavaBreakpoint>(copies.size());
+ for (IJavaBreakpoint copy : copies) {
+ target.getDebugTarget().breakpointRemoved(copy, null);
+ try {
+ if (copy.isInstalled())
+ remainingCopies.add(copy);
+ else
+ copy.delete();
+ } catch (CoreException ex) {
+ OTDebugUIPlugin.getExceptionHandler().logCoreException("Unable to query copied breakpoint", ex); //$NON-NLS-1$
+ }
+ }
+ // cleanup if no more copies are active:
+ if (remainingCopies.size() == 0)
+ this.copiedBreakpoints.remove(marker);
+ // cleanup if fewer copies are active:
+ else if (remainingCopies.size() != copies.size())
+ this.copiedBreakpoints.put(marker, remainingCopies);
+ }
+
+ private class TSubClassComputer implements IRunnableWithProgress
+ {
+ private IOTTypeHierarchy _hierarchy;
+ private IRoleType _roleType;
+ private IType[] _subClasses;
+
+ public TSubClassComputer(IRoleType otType)
+ {
+ _roleType = otType;
+ }
+
+ public void run(IProgressMonitor monitor)
+ throws InvocationTargetException, InterruptedException
+ {
+ monitor.beginTask(BreakpointMessages.CopyInheritanceBreakpointManager_find_tsub_types_task, 1);
+ IProgressMonitor mon = new SubProgressMonitor(monitor, 1);
+ try
+ {
+ _hierarchy = _roleType.newOTTypeHierarchy(mon);
+ _hierarchy.setPhantomMode(true);
+ _subClasses = _hierarchy.getAllTSubtypes((IType)_roleType);
+
+ }
+ catch (JavaModelException ex)
+ {
+ throw new InvocationTargetException(ex);
+ }
+ finally
+ {
+ mon.done();
+ }
+ }
+
+ /**
+ * @return null or the computed tsub classes
+ */
+ public IType[] getSubClasses()
+ {
+ try
+ {
+// PlatformUI.getWorkbench().getProgressService().busyCursorWhile(this);
+ run(new NullProgressMonitor());
+ }
+ catch (InvocationTargetException ex)
+ {
+ if (ex.getCause() instanceof CoreException)
+ OTDebugUIPlugin.getExceptionHandler().logCoreException("Error creating type hiearchy", (CoreException) ex.getCause()); //$NON-NLS-1$
+ else
+ OTDebugUIPlugin.getExceptionHandler().logException("Error creating type hiearchy", ex); //$NON-NLS-1$
+ }
+ catch (InterruptedException ex)
+ {
+ OTDebugUIPlugin.getExceptionHandler().logException("Error creating type hiearchy", ex); //$NON-NLS-1$
+ }
+
+ return _subClasses;
+ }
+ }
+
+ /**
+ * Watch for changes of the ENABLED attribute of breakpoint markers.
+ *
+ * @param event the change event.
+ */
+ public void resourceChanged(IResourceChangeEvent event)
+ {
+ IMarkerDelta[] markerDeltas = event.findMarkerDeltas(IBreakpoint.BREAKPOINT_MARKER, true);
+ if (markerDeltas == null)
+ return;
+ for (IMarkerDelta markerDelta : markerDeltas) {
+ if (markerDelta.getKind() == IResourceDelta.CHANGED) {
+ IMarker marker = markerDelta.getMarker();
+ final Boolean oldEnabled = markerDelta.getAttribute(IBreakpoint.ENABLED, Boolean.FALSE);
+ final Boolean newEnabled = marker.getAttribute(IBreakpoint.ENABLED, Boolean.FALSE);
+ if (!oldEnabled.equals(newEnabled)) {
+ // we have a change wrt enablement
+ List<IJavaBreakpoint> breakpoints = this.copiedBreakpoints.get(marker);
+ if (breakpoints != null) {
+ for (final IJavaBreakpoint copy : breakpoints) {
+ Job job = new Job(BreakpointMessages.CopyInheritanceBreakpointManager_toggle_enablement_job) {
+ protected IStatus run(IProgressMonitor monitor) {
+ try {
+ copy.setEnabled(newEnabled);
+ return Status.OK_STATUS;
+ } catch (CoreException e) {
+ return new Status(IStatus.ERROR, OTDebugUIPlugin.PLUGIN_ID, "Error toggling copied breakpoint enablement", e); //$NON-NLS-1$
+ }
+ }
+ };
+ job.setRule(event.getResource());
+ job.schedule();
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/OTDebugElementAdapterFactory.java b/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/OTDebugElementAdapterFactory.java
new file mode 100644
index 000000000..2e3c4be55
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/OTDebugElementAdapterFactory.java
@@ -0,0 +1,94 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2003, 2007 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute and Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: OTDebugElementAdapterFactory.java 23432 2010-02-03 23:13:42Z stephan $
+ *
+ * Please visit http://www.objectteams.org for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.debug.ui.internal;
+
+import org.eclipse.core.runtime.IAdapterFactory;
+import org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentationFactory;
+import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementContentProvider;
+import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementLabelProvider;
+import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelProxyFactory;
+import org.eclipse.objectteams.otdt.debug.OTDebugElementsContainer;
+import org.eclipse.objectteams.otdt.debug.TeamInstance;
+import org.eclipse.objectteams.otdt.debug.ui.internal.model.OTDebugElementsContainerContentProvider;
+import org.eclipse.objectteams.otdt.debug.ui.internal.model.OTDebugElementsContainerLabelProvider;
+import org.eclipse.objectteams.otdt.debug.ui.internal.model.OTDefaultModelProxyFactory;
+import org.eclipse.objectteams.otdt.debug.ui.internal.model.OTVariableColumnFactoryAdapter;
+import org.eclipse.objectteams.otdt.debug.ui.internal.model.TeamInstanceContentProvider;
+import org.eclipse.objectteams.otdt.debug.ui.internal.model.TeamInstanceLabelProvider;
+
+/**
+ * This factory installs our content/label providers into the TeamView
+ */
+public class OTDebugElementAdapterFactory implements IAdapterFactory
+{
+
+ private static IModelProxyFactory fgModelProxyFactoryAdapter= new OTDefaultModelProxyFactory();
+ private static IColumnPresentationFactory fgVariableColumnFactory = new OTVariableColumnFactoryAdapter();
+
+ private static IElementLabelProvider _LPElementContainer= new OTDebugElementsContainerLabelProvider();
+ private static IElementLabelProvider _LPTeamInstance= new TeamInstanceLabelProvider();
+
+ private static IElementContentProvider _CPElementContainer= new OTDebugElementsContainerContentProvider();
+ private static IElementContentProvider _CPTeamInstance= new TeamInstanceContentProvider();
+
+
+ public Object getAdapter(Object adaptableObject, Class adapterType)
+ {
+ if (adapterType.equals(IElementContentProvider.class))
+ {
+ if(adaptableObject instanceof OTDebugElementsContainer)
+ return _CPElementContainer;
+
+ if(adaptableObject instanceof TeamInstance)
+ return _CPTeamInstance;
+ }
+
+ if (adapterType.equals(IElementLabelProvider.class))
+ {
+ if(adaptableObject instanceof OTDebugElementsContainer)
+ return _LPElementContainer;
+
+ if(adaptableObject instanceof TeamInstance)
+ return _LPTeamInstance;
+ }
+ if (adapterType.equals(IModelProxyFactory.class)) {
+ if (adaptableObject instanceof OTDebugElementsContainer)
+ return fgModelProxyFactoryAdapter;
+ }
+
+ if (adapterType.equals(IColumnPresentationFactory.class)) {
+ if (adaptableObject instanceof OTDebugElementsContainer) {
+ return fgVariableColumnFactory;
+ }
+ }
+
+ return null;
+ }
+
+ public Class[] getAdapterList()
+ {
+ return new Class[]{IElementContentProvider.class,
+ IElementLabelProvider.class,
+ IModelProxyFactory.class,
+ IColumnPresentationFactory.class};
+ }
+
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/actions/ActionMessages.java b/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/actions/ActionMessages.java
new file mode 100644
index 000000000..51ba74a87
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/actions/ActionMessages.java
@@ -0,0 +1,41 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute and Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: ActionMessages.java 23432 2010-02-03 23:13:42Z stephan $
+ *
+ * Please visit http://www.objectteams.org for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.debug.ui.internal.actions;
+
+import org.eclipse.osgi.util.NLS;
+
+public class ActionMessages extends NLS {
+ private static final String BUNDLE_NAME = "org.eclipse.objectteams.otdt.debug.ui.internal.actions.ActionMessages"; //$NON-NLS-1$
+ public static String ChangeTeamActivationAction_activate_label;
+ public static String ChangeTeamActivationAction_activate_description;
+ public static String ChangeTeamActivationAction_deactivate_label;
+ public static String ChangeTeamActivationAction_deactivate_description;
+ public static String ChangeTeamActivationAction_error_title;
+ public static String ChangeTeamActivationAction_error_exception;
+ public static String ChangeTeamActivationAction_error_no_thread_suspended;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, ActionMessages.class);
+ }
+
+ private ActionMessages() {
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/actions/ActionMessages.properties b/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/actions/ActionMessages.properties
new file mode 100644
index 000000000..ad558f317
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/actions/ActionMessages.properties
@@ -0,0 +1,7 @@
+ChangeTeamActivationAction_activate_label=Activate Team
+ChangeTeamActivationAction_activate_description=Activate this team for the selected thread
+ChangeTeamActivationAction_deactivate_label=Deactivate Team
+ChangeTeamActivationAction_deactivate_description=Deactivate this team for the selected thread
+ChangeTeamActivationAction_error_title=Debug operation failed
+ChangeTeamActivationAction_error_no_thread_suspended=Unable to change team activation:\n\nNo thread is suspended to perform this operation.
+ChangeTeamActivationAction_error_exception=Unable to change team activation.
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/actions/ChangeTeamActivationAction.java b/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/actions/ChangeTeamActivationAction.java
new file mode 100644
index 000000000..b5ec97cdc
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/actions/ChangeTeamActivationAction.java
@@ -0,0 +1,176 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute and Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: ChangeTeamActivationAction.java 23432 2010-02-03 23:13:42Z stephan $
+ *
+ * Please visit http://www.objectteams.org for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.debug.ui.internal.actions;
+
+import java.util.Iterator;
+
+import org.eclipse.core.runtime.Status;
+import org.eclipse.debug.core.DebugException;
+import org.eclipse.debug.core.model.IDebugTarget;
+import org.eclipse.debug.core.model.IThread;
+import org.eclipse.debug.core.model.IValue;
+import org.eclipse.debug.core.model.IVariable;
+import org.eclipse.debug.internal.ui.DebugUIPlugin;
+import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
+import org.eclipse.jdt.debug.core.IJavaFieldVariable;
+import org.eclipse.jdt.debug.core.IJavaObject;
+import org.eclipse.jdt.debug.core.IJavaThread;
+import org.eclipse.jdt.debug.core.IJavaValue;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.objectteams.otdt.debug.TeamInstance;
+import org.eclipse.objectteams.otdt.debug.ui.OTDebugImages;
+import org.eclipse.objectteams.otdt.debug.ui.OTDebugUIPlugin;
+import org.eclipse.objectteams.otdt.debug.ui.views.TeamView;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.actions.SelectionProviderAction;
+
+public class ChangeTeamActivationAction extends SelectionProviderAction {
+
+ // selectors of methods to invoke:
+ private static final String DEACTIVATE = "deactivate"; //$NON-NLS-1$
+ private static final String ACTIVATE = "activate"; //$NON-NLS-1$
+ // signatures of (de)activate() methods:
+ private static final String SIGNATURE = "()V"; //$NON-NLS-1$
+ private static final String SIGNATURE_THREAD_ARG = "(Ljava/lang/Thread;)V"; //$NON-NLS-1$
+ // for constant org.objectteams.Team.ALL_THREADS:
+ private static final String ALL_THREADS = "ALL_THREADS"; //$NON-NLS-1$
+
+ protected IVariable fVariable;
+ private TeamView fView;
+ String selector;
+ private boolean isActivate;
+
+ /**
+ * Creates a new ChangeTeamActivationAction for the given variables view
+ * @param view the variables view in which this action will appear
+ */
+ public ChangeTeamActivationAction(TeamView view, boolean isActivate) {
+ super(view.getViewer(), isActivate
+ ? ActionMessages.ChangeTeamActivationAction_activate_label
+ : ActionMessages.ChangeTeamActivationAction_deactivate_label);
+ this.selector= isActivate ? ACTIVATE : DEACTIVATE;
+ this.isActivate= isActivate;
+ this.setEnabled(false);
+
+ if (isActivate) {
+ setDescription(ActionMessages.ChangeTeamActivationAction_activate_description);
+ setImageDescriptor(OTDebugImages.get(OTDebugImages.TEAM_ACTIVATED));
+ } else {
+ setDescription(ActionMessages.ChangeTeamActivationAction_deactivate_description);
+ setImageDescriptor(OTDebugImages.get(OTDebugImages.TEAM_INACTIVATED));
+ }
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(
+ this,
+ IDebugHelpContextIds.CHANGE_VALUE_ACTION);
+ fView= view;
+ }
+
+ protected void doActionPerformed(Object element)
+ {
+ if (! (element instanceof TeamInstance))
+ return;
+ TeamInstance teamInstance= (TeamInstance)element;
+ try {
+ IValue value= teamInstance.getValue();
+ if (value instanceof IJavaObject) {
+ IJavaObject teamObject= (IJavaObject) value;
+ String methodSignature = SIGNATURE; // default
+ IJavaValue[] args= null; // default
+ IJavaThread thread= fView.getSelectedThread();
+ if (thread == null) {
+ // no thread selected means: (de)activate for all threads.
+ methodSignature= SIGNATURE_THREAD_ARG;
+
+ // create argument ALL_THREADS
+ IJavaFieldVariable field= teamObject.getField(ALL_THREADS, true);
+ args= new IJavaValue[]{(IJavaValue) field.getValue()};
+
+ // search for a suspended thread:
+ IDebugTarget target= teamObject.getDebugTarget();
+ for (IThread tThread: target.getThreads()) {
+ if (tThread.isSuspended()) {
+ thread= (IJavaThread)tThread;
+ break;
+ }
+ }
+ if (thread == null) {
+ String cause= ActionMessages.ChangeTeamActivationAction_error_no_thread_suspended;
+ DebugUIPlugin.errorDialog(fView.getViewSite().getShell(),
+ ActionMessages.ChangeTeamActivationAction_error_title,
+ cause,
+ new Status(Status.ERROR, OTDebugUIPlugin.PLUGIN_ID, cause));
+ return;
+ }
+ }
+ teamObject.sendMessage(this.selector, methodSignature, args, thread, false);
+ Viewer viewer = fView.getViewer();
+ viewer.setSelection(viewer.getSelection()); // refresh action enablement
+ }
+ } catch (DebugException de) {
+ DebugUIPlugin.errorDialog(fView.getViewSite().getShell(),
+ ActionMessages.ChangeTeamActivationAction_error_title,
+ ActionMessages.ChangeTeamActivationAction_error_exception,
+ de);
+ }
+ }
+
+ /**
+ * Updates the enabled state of this action based
+ * on the selection
+ */
+ protected void update(IStructuredSelection sel) {
+ if (sel.size() > 1) {
+ setEnabled(false); // can only activate one team at a time.
+ return;
+ }
+ Iterator iter= sel.iterator();
+ if (iter.hasNext()) {
+ Object object= iter.next();
+ if (object instanceof TeamInstance) {
+ TeamInstance instance= (TeamInstance)object;
+ if ( instance.isActiveFor(fView.getSelectedThread())
+ != isActivate)
+ {
+ setEnabled(true);
+ return;
+ }
+ }
+ }
+ setEnabled(false); // no team instance selected
+ }
+
+ /**
+ * @see IAction#run()
+ */
+ public void run() {
+ Iterator iterator= getStructuredSelection().iterator();
+ doActionPerformed(iterator.next());
+ }
+
+ /**
+ * @see SelectionProviderAction#selectionChanged(org.eclipse.jface.viewers.IStructuredSelection)
+ */
+ public void selectionChanged(IStructuredSelection sel) {
+ update(sel);
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/actions/OTBreakpointLocationVerifierJob.java b/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/actions/OTBreakpointLocationVerifierJob.java
new file mode 100644
index 000000000..d27cadcd7
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/actions/OTBreakpointLocationVerifierJob.java
@@ -0,0 +1,306 @@
+/*******************************************************************************
+ * 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
+ * $Id: OTBreakpointLocationVerifierJob.java 23432 2010-02-03 23:13:42Z stephan $
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * Fraunhofer FIRST - extended API and implementation
+ * Technical University Berlin - extended API and implementation
+ *******************************************************************************/
+package org.eclipse.objectteams.otdt.debug.ui.internal.actions;
+
+import java.text.MessageFormat;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.core.resources.IResource;
+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.debug.core.DebugPlugin;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.dom.AST;
+import org.eclipse.jdt.core.dom.ASTParser;
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jdt.debug.core.IJavaLineBreakpoint;
+import org.eclipse.jdt.debug.core.JDIDebugModel;
+import org.eclipse.jdt.internal.debug.ui.BreakpointUtils;
+import org.eclipse.jdt.internal.debug.ui.JDIDebugUIPlugin;
+import org.eclipse.jdt.internal.debug.ui.actions.ActionMessages;
+import org.eclipse.jdt.internal.debug.core.breakpoints.ValidBreakpointLocationLocator;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.TextSelection;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.texteditor.IEditorStatusLine;
+
+/**
+ * Job used to verify the position of a breakpoint
+ * copied from BreakpointLocationVerifierJob
+ * $Id: OTBreakpointLocationVerifierJob.java 23432 2010-02-03 23:13:42Z stephan $
+ */
+//{OT_COPY_PASTE: class copied from org.eclipse.jdt.internal.debug.ui.actions.BreakpointLocationVerifierJob
+// modified just to instantiate OTValidBreakpointLocationLocator in favor of ValidBreakpointLocationLocator
+public class OTBreakpointLocationVerifierJob extends Job {
+
+ /**
+ * The document which contains the code source.
+ */
+ private IDocument fDocument;
+
+ /**
+ * The temporary breakpoint that has been set. Can be <code>null</code> if the callee was not able
+ * to check if a breakpoint was already set at this position.
+ */
+ private IJavaLineBreakpoint fBreakpoint;
+
+ /**
+ * The number of the line where the breakpoint has been requested.
+ */
+ private int fLineNumber;
+
+ /**
+ * The qualified type name of the class where the temporary breakpoint as been set.
+ * Can be <code>null</code> if fBreakpoint is null.
+ */
+ private String fTypeName;
+
+ /**
+ * The type in which should be set the breakpoint.
+ */
+ private IType fType;
+
+ /**
+ * Indicate if the search for a valid location should be limited to a line
+ * or expanded to field and method declaration.
+ */
+ private boolean fBestMatch;
+
+ /**
+ * The resource in which should be set the breakpoint.
+ */
+ private IResource fResource;
+
+ /**
+ * The current IEditorPart
+ */
+ private IEditorPart fEditorPart;
+
+ /**
+ * The status line to use to display errors
+ */
+ private IEditorStatusLine fStatusLine;
+
+ public OTBreakpointLocationVerifierJob(IDocument document, IJavaLineBreakpoint breakpoint, int lineNumber, boolean bestMatch, String typeName, IType type, IResource resource, IEditorPart editorPart) {
+ super(ActionMessages.BreakpointLocationVerifierJob_breakpoint_location);
+ fDocument= document;
+ fBreakpoint= breakpoint;
+ fLineNumber= lineNumber;
+ fBestMatch= bestMatch;
+ fTypeName= typeName;
+ fType= type;
+ fResource= resource;
+ fEditorPart= editorPart;
+ fStatusLine= (IEditorStatusLine) editorPart.getAdapter(IEditorStatusLine.class);
+ setSystem(true);
+ }
+
+ public IStatus run(IProgressMonitor monitor) {
+ ASTParser parser = ASTParser.newParser(AST.JLS3);
+ char[] source = fDocument.get().toCharArray();
+ parser.setSource(source);
+ IJavaElement javaElement = JavaCore.create(fResource);
+ IJavaProject project= null;
+ if (javaElement != null) {
+ Map options=JavaCore.getDefaultOptions();
+ project= javaElement.getJavaProject();
+ String compilerCompliance = JavaCore.VERSION_1_5;
+ String compilerSource = JavaCore.VERSION_1_5;
+ if (project != null) {
+ compilerCompliance = project.getOption(JavaCore.COMPILER_COMPLIANCE, true);
+ compilerSource = project.getOption(JavaCore.COMPILER_SOURCE, true);
+ }
+ options.put(JavaCore.COMPILER_COMPLIANCE, compilerCompliance);
+ options.put(JavaCore.COMPILER_SOURCE, compilerSource);
+ parser.setCompilerOptions(options);
+ }
+ CompilationUnit compilationUnit= (CompilationUnit)parser.createAST(null);
+//{ObjectTeams: replace ValidBreakpointLocationLocator with own OTValidBreakpointLocationLocator
+ OTValidBreakpointLocationLocator locator= new OTValidBreakpointLocationLocator(compilationUnit, fLineNumber, false, fBestMatch);
+//ike}
+ compilationUnit.accept(locator);
+ if (locator.isBindingsRequired()) {
+ if (javaElement != null) {
+ // try again with bindings if required and available
+ String unitName = null;
+ if (fType == null) {
+ String name = fResource.getName();
+ if (JavaCore.isJavaLikeFileName(name)) {
+ unitName = name;
+ }
+ } else {
+ if (fType.isBinary()) {
+ String className= fType.getClassFile().getElementName();
+ int nameLength= className.indexOf('$');
+ if (nameLength < 0) {
+ nameLength= className.indexOf('.');
+ }
+ unitName= className.substring(0, nameLength) + ".java"; //$NON-NLS-1$
+ } else {
+ unitName= fType.getCompilationUnit().getElementName();
+ }
+ }
+ if (unitName != null) {
+ parser = ASTParser.newParser(AST.JLS3);
+ parser.setSource(source);
+ parser.setProject(project);
+ parser.setUnitName(unitName);
+ parser.setResolveBindings(true);
+ compilationUnit= (CompilationUnit)parser.createAST(null);
+//{ObjectTeams: replace ValidBreakpointLocationLocator with own OTValidBreakpointLocationLocator
+ locator= new OTValidBreakpointLocationLocator(compilationUnit, fLineNumber, true, fBestMatch);
+//ike}
+ compilationUnit.accept(locator);
+ }
+ }
+ }
+ int lineNumber= locator.getLineLocation();
+ String typeName= locator.getFullyQualifiedTypeName();
+
+ try {
+ switch (locator.getLocationType()) {
+ case ValidBreakpointLocationLocator.LOCATION_LINE:
+ return manageLineBreakpoint(typeName, lineNumber);
+ case ValidBreakpointLocationLocator.LOCATION_METHOD:
+ if (fBreakpoint != null) {
+ DebugPlugin.getDefault().getBreakpointManager().removeBreakpoint(fBreakpoint, true);
+ }
+//{ObjectTeams use OTToggleBreakpointAdapter
+ new OTToggleBreakpointAdapter().toggleMethodBreakpoints(fEditorPart, new TextSelection(locator.getMemberOffset(), 0));
+//carp}
+ break;
+ case ValidBreakpointLocationLocator.LOCATION_FIELD:
+ if (fBreakpoint != null) {
+ DebugPlugin.getDefault().getBreakpointManager().removeBreakpoint(fBreakpoint, true);
+ }
+//{ObjectTeams use OTToggleBreakpointAdapter
+ new OTToggleBreakpointAdapter().toggleWatchpoints(fEditorPart, new TextSelection(locator.getMemberOffset(), 0));
+//carp}
+ break;
+ default:
+ // cannot find a valid location
+ report(ActionMessages.BreakpointLocationVerifierJob_not_valid_location);
+ if (fBreakpoint != null) {
+ DebugPlugin.getDefault().getBreakpointManager().removeBreakpoint(fBreakpoint, true);
+ }
+ return new Status(IStatus.OK, JDIDebugUIPlugin.getUniqueIdentifier(), IStatus.ERROR, ActionMessages.BreakpointLocationVerifierJob_not_valid_location, null);
+ }
+ } catch (CoreException e) {
+ JDIDebugUIPlugin.log(e);
+ }
+ return new Status(IStatus.OK, JDIDebugUIPlugin.getUniqueIdentifier(), IStatus.OK, ActionMessages.BreakpointLocationVerifierJob_breakpoint_set, null);
+
+ }
+
+ /**
+ * Determines the placement of the line breakpoint, and ensures that duplicates are not created
+ * and that notification is sent in the event of collisions
+ * @param typeName the fully qualified name of the type to add the line breakpoint to
+ * @param lineNumber the number we wish to put the breakpoint on
+ * @return the status of the line breakpoint placement
+ */
+ public IStatus manageLineBreakpoint(String typeName, int lineNumber) {
+ try {
+ boolean differentLineNumber= lineNumber != fLineNumber;
+ IJavaLineBreakpoint breakpoint= JDIDebugModel.lineBreakpointExists(fResource, typeName, lineNumber);
+ boolean breakpointExist= breakpoint != null;
+ if (fBreakpoint == null) {
+ if (breakpointExist) {
+ if (differentLineNumber) {
+ // There is already a breakpoint on the valid line.
+ report(MessageFormat.format(ActionMessages.BreakpointLocationVerifierJob_0, new String[]{Integer.toString(lineNumber)}));
+ return new Status(IStatus.OK, JDIDebugUIPlugin.getUniqueIdentifier(), IStatus.ERROR, ActionMessages.BreakpointLocationVerifierJob_not_valid_location, null);
+ }
+ // There is already a breakpoint on the valid line, but it's also the requested line.
+ // Removing the existing breakpoint.
+ DebugPlugin.getDefault().getBreakpointManager().removeBreakpoint(breakpoint, true);
+ return new Status(IStatus.OK, JDIDebugUIPlugin.getUniqueIdentifier(), IStatus.OK, ActionMessages.BreakpointLocationVerifierJob_breakpointRemoved, null);
+ }
+ createNewBreakpoint(lineNumber, typeName);
+ return new Status(IStatus.OK, JDIDebugUIPlugin.getUniqueIdentifier(), IStatus.OK, ActionMessages.BreakpointLocationVerifierJob_breakpoint_set, null);
+ }
+ if (differentLineNumber) {
+ if (breakpointExist) {
+ // there is already a breakpoint on the valid line.
+ DebugPlugin.getDefault().getBreakpointManager().removeBreakpoint(fBreakpoint, true);
+ report(MessageFormat.format(ActionMessages.BreakpointLocationVerifierJob_0, new String[]{Integer.toString(lineNumber)}));
+ return new Status(IStatus.OK, JDIDebugUIPlugin.getUniqueIdentifier(), IStatus.ERROR, ActionMessages.BreakpointLocationVerifierJob_not_valid_location, null);
+ }
+ replaceBreakpoint(lineNumber, typeName);
+ return new Status(IStatus.OK, JDIDebugUIPlugin.getUniqueIdentifier(), IStatus.WARNING, ActionMessages.BreakpointLocationVerifierJob_breakpointMovedToValidPosition, null);
+ }
+ if (!typeName.equals(fTypeName)) {
+ replaceBreakpoint(lineNumber, typeName);
+ return new Status(IStatus.OK, JDIDebugUIPlugin.getUniqueIdentifier(), IStatus.WARNING, ActionMessages.BreakpointLocationVerifierJob_breakpointSetToRightType, null);
+ }
+ } catch (CoreException e) {
+ JDIDebugUIPlugin.log(e);
+ }
+ return new Status(IStatus.OK, JDIDebugUIPlugin.getUniqueIdentifier(), IStatus.OK, ActionMessages.BreakpointLocationVerifierJob_breakpoint_set, null);
+ }
+
+ /**
+ * Remove the temporary breakpoint and create a new breakpoint at the right position.
+ */
+ private void replaceBreakpoint(int lineNumber, String typeName) throws CoreException {
+ createNewBreakpoint(lineNumber, typeName);
+ DebugPlugin.getDefault().getBreakpointManager().removeBreakpoint(fBreakpoint, true);
+ }
+
+ /**
+ * Create a new breakpoint at the right position.
+ */
+ private void createNewBreakpoint(int lineNumber, String typeName) throws CoreException {
+ Map newAttributes = new HashMap(10);
+ if (fType != null) {
+ try {
+ IRegion line= fDocument.getLineInformation(lineNumber - 1);
+ int start= line.getOffset();
+ int end= start + line.getLength() - 1;
+ BreakpointUtils.addJavaBreakpointAttributesWithMemberDetails(newAttributes, fType, start, end);
+ } catch (BadLocationException ble) {
+ JDIDebugUIPlugin.log(ble);
+ }
+ }
+ JDIDebugModel.createLineBreakpoint(fResource, typeName, lineNumber, -1, -1, 0, true, newAttributes);
+ }
+
+ /**
+ * Reports any status to the current active workbench shell
+ * @param message the message to display
+ */
+ protected void report(final String message) {
+ JDIDebugUIPlugin.getStandardDisplay().asyncExec(new Runnable() {
+ public void run() {
+ if (fStatusLine != null) {
+ fStatusLine.setMessage(true, message, null);
+ }
+ if (message != null && JDIDebugUIPlugin.getActiveWorkbenchShell() != null) {
+ Display.getCurrent().beep();
+ }
+ }
+ });
+ }
+}
+//ike} \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/actions/OTToggleBreakpointAdapter.java b/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/actions/OTToggleBreakpointAdapter.java
new file mode 100644
index 000000000..bba4f4f2a
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/actions/OTToggleBreakpointAdapter.java
@@ -0,0 +1,1243 @@
+/*******************************************************************************
+ * 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
+ * $Id: OTToggleBreakpointAdapter.java 23432 2010-02-03 23:13:42Z stephan $
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * Fraunhofer FIRST - extended API and implementation
+ * Technical University Berlin - extended API and implementation
+ *******************************************************************************/
+package org.eclipse.objectteams.otdt.debug.ui.internal.actions;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+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.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.debug.core.DebugException;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.IBreakpointManager;
+import org.eclipse.debug.core.model.IBreakpoint;
+import org.eclipse.debug.ui.actions.IToggleBreakpointsTargetExtension;
+import org.eclipse.jdt.core.Flags;
+import org.eclipse.jdt.core.IClassFile;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IField;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IMember;
+import org.eclipse.jdt.core.IMethod;
+import org.eclipse.jdt.core.IPackageDeclaration;
+import org.eclipse.jdt.core.ISourceRange;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.ITypeParameter;
+import org.eclipse.jdt.core.ITypeRoot;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.core.Signature;
+import org.eclipse.jdt.core.dom.AST;
+import org.eclipse.jdt.core.dom.ASTParser;
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jdt.debug.core.IJavaBreakpoint;
+import org.eclipse.jdt.debug.core.IJavaClassPrepareBreakpoint;
+import org.eclipse.jdt.debug.core.IJavaFieldVariable;
+import org.eclipse.jdt.debug.core.IJavaLineBreakpoint;
+import org.eclipse.jdt.debug.core.IJavaMethodBreakpoint;
+import org.eclipse.jdt.debug.core.IJavaType;
+import org.eclipse.jdt.debug.core.IJavaWatchpoint;
+import org.eclipse.jdt.debug.core.JDIDebugModel;
+import org.eclipse.jdt.internal.debug.core.JavaDebugUtils;
+import org.eclipse.jdt.internal.debug.ui.BreakpointUtils;
+import org.eclipse.jdt.internal.debug.ui.DebugWorkingCopyManager;
+import org.eclipse.jdt.internal.debug.ui.JDIDebugUIPlugin;
+import org.eclipse.jdt.internal.debug.ui.actions.ActionDelegateHelper;
+import org.eclipse.jdt.internal.debug.ui.actions.ActionMessages;
+import org.eclipse.jdt.ui.IWorkingCopyManager;
+import org.eclipse.jdt.ui.JavaUI;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.ITextSelection;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.texteditor.IDocumentProvider;
+import org.eclipse.ui.texteditor.IEditorStatusLine;
+import org.eclipse.ui.texteditor.ITextEditor;
+import org.eclipse.objectteams.otdt.core.IOTJavaElement;
+import org.eclipse.objectteams.otdt.core.IOTType;
+import org.eclipse.objectteams.otdt.core.OTModelManager;
+import org.eclipse.objectteams.otdt.core.compiler.IOTConstants;
+
+/**
+ * @author ike
+ * Toggles a line breakpoint in a OTJava editor.
+ *
+ * @since 3.0
+ */
+//{OT_COPY_PASTE: class copied from org.eclipse.jdt.internal.debug.ui.actions.ToggleBreakpointAdapter
+// to instantiate OTBreakpointLocationVerifierJob in favor of BreakpointLocationVerifierJob
+// and to access a protected method of ValidBreakpointLocationLocator
+public class OTToggleBreakpointAdapter implements IToggleBreakpointsTargetExtension {
+
+
+ private static final String EMPTY_STRING = ""; //$NON-NLS-1$
+
+ /**
+ * Constructor
+ */
+ public OTToggleBreakpointAdapter() {
+ // initialize helper in UI thread
+ ActionDelegateHelper.getDefault();
+ }
+
+ /**
+ * Convenience method for printing messages to the status line
+ * @param message the message to be displayed
+ * @param part the currently active workbench part
+ */
+ protected void report(final String message, final IWorkbenchPart part) {
+ JDIDebugUIPlugin.getStandardDisplay().asyncExec(new Runnable() {
+ public void run() {
+ IEditorStatusLine statusLine = (IEditorStatusLine) part.getAdapter(IEditorStatusLine.class);
+ if (statusLine != null) {
+ if (message != null) {
+ statusLine.setMessage(true, message, null);
+ } else {
+ statusLine.setMessage(true, null, null);
+ }
+ }
+ if (message != null && JDIDebugUIPlugin.getActiveWorkbenchShell() != null) {
+ JDIDebugUIPlugin.getActiveWorkbenchShell().getDisplay().beep();
+ }
+ }
+ });
+ }
+
+ /**
+ * Returns the <code>IType</code> for the given selection
+ * @param selection the current text selection
+ * @return the <code>IType</code> for the text selection or <code>null</code>
+ */
+ protected IType getType(ITextSelection selection) {
+ IMember member = ActionDelegateHelper.getDefault().getCurrentMember(selection);
+ IType type = null;
+ if (member instanceof IType) {
+ type = (IType) member;
+ } else if (member != null) {
+ type = member.getDeclaringType();
+ }
+ // bug 52385: we don't want local and anonymous types from compilation
+ // unit,
+ // we are getting 'not-always-correct' names for them.
+ try {
+ while (type != null && !type.isBinary() && type.isLocal()) {
+ type = type.getDeclaringType();
+ }
+ } catch (JavaModelException e) {
+ JDIDebugUIPlugin.log(e);
+ }
+ return type;
+ }
+
+ /**
+ * Returns the IType associated with the <code>IJavaElement</code> passed in
+ * @param element the <code>IJavaElement</code> to get the type from
+ * @return the corresponding <code>IType</code> for the <code>IJavaElement</code>, or <code>null</code> if there is not one.
+ * @since 3.3
+ */
+ protected IType getType(IJavaElement element) {
+ switch(element.getElementType()) {
+ case IJavaElement.FIELD: {
+ return ((IField)element).getDeclaringType();
+ }
+ case IJavaElement.METHOD: {
+ return ((IMethod)element).getDeclaringType();
+ }
+ case IJavaElement.TYPE: {
+ return (IType)element;
+ }
+ default: {
+ return null;
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.ui.actions.IToggleBreakpointsTarget#toggleLineBreakpoints(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
+ */
+ public void toggleLineBreakpoints(IWorkbenchPart part, ISelection selection) throws CoreException {
+ toggleLineBreakpoints(part, selection, false);
+ }
+
+ /**
+ * Toggles a line breakpoint.
+ * @param part the currently active workbench part
+ * @param selection the current selection
+ * @param bestMatch if we should make a best match or not
+ */
+ public void toggleLineBreakpoints(final IWorkbenchPart part, final ISelection selection, final boolean bestMatch) {
+ Job job = new Job("Toggle Line Breakpoint") { //$NON-NLS-1$
+ protected IStatus run(IProgressMonitor monitor) {
+ ITextEditor editor = getTextEditor(part);
+ if (editor != null && selection instanceof ITextSelection) {
+ if (monitor.isCanceled()) {
+ return Status.CANCEL_STATUS;
+ }
+ try {
+ report(null, part);
+ ISelection sel = selection;
+ if(!(selection instanceof IStructuredSelection)) {
+ sel = translateToMembers(part, selection);
+ }
+ if(isInterface(sel, part)) {
+ report(ActionMessages.ToggleBreakpointAdapter_6, part);
+ return Status.OK_STATUS;
+ }
+ if(sel instanceof IStructuredSelection) {
+ IMember member = (IMember) ((IStructuredSelection)sel).getFirstElement();
+ IType type = null;
+//{ObjectTeams: also handle IOTJavaElement.{ROLE,TEAM}:
+/* orig:
+ if(member.getElementType() == IJavaElement.TYPE) {
+ :giro */
+ if(member instanceof IType) {
+// SH}
+ type = (IType) member;
+ }
+ else {
+ type = member.getDeclaringType();
+ }
+ String tname = createQualifiedTypeName(type);
+ IResource resource = BreakpointUtils.getBreakpointResource(type);
+ int lnumber = ((ITextSelection) selection).getStartLine() + 1;
+ IJavaLineBreakpoint existingBreakpoint = JDIDebugModel.lineBreakpointExists(resource, tname, lnumber);
+ if (existingBreakpoint != null) {
+ DebugPlugin.getDefault().getBreakpointManager().removeBreakpoint(existingBreakpoint, true);
+ return Status.OK_STATUS;
+ }
+ Map attributes = new HashMap(10);
+ IDocumentProvider documentProvider = editor.getDocumentProvider();
+ if (documentProvider == null) {
+ return Status.CANCEL_STATUS;
+ }
+ IDocument document = documentProvider.getDocument(editor.getEditorInput());
+ try {
+ IRegion line = document.getLineInformation(lnumber - 1);
+ int start = line.getOffset();
+ int end = start + line.getLength() - 1;
+ BreakpointUtils.addJavaBreakpointAttributesWithMemberDetails(attributes, type, start, end);
+ }
+ catch (BadLocationException ble) {JDIDebugUIPlugin.log(ble);}
+ IJavaLineBreakpoint breakpoint = JDIDebugModel.createLineBreakpoint(resource, tname, lnumber, -1, -1, 0, true, attributes);
+//{ObjectTeams: replace BreakpointLocationVerifierJob with own OTBreakpointLocationVerifierJob
+ new OTBreakpointLocationVerifierJob(document, breakpoint, lnumber, bestMatch, tname, type, resource, editor).schedule();
+// ike}
+ }
+ else {
+ report(ActionMessages.ToggleBreakpointAdapter_3, part);
+ return Status.OK_STATUS;
+ }
+ }
+ catch (CoreException ce) {return ce.getStatus();}
+ }
+ return Status.OK_STATUS;
+ }
+ };
+ job.setSystem(true);
+ job.schedule();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.debug.ui.actions.IToggleBreakpointsTarget#canToggleLineBreakpoints(IWorkbenchPart,
+ * ISelection)
+ */
+ public boolean canToggleLineBreakpoints(IWorkbenchPart part, ISelection selection) {
+ if (isRemote(part, selection)) {
+ return false;
+ }
+ return selection instanceof ITextSelection;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.debug.ui.actions.IToggleBreakpointsTarget#toggleMethodBreakpoints(org.eclipse.ui.IWorkbenchPart,
+ * org.eclipse.jface.viewers.ISelection)
+ */
+ public void toggleMethodBreakpoints(final IWorkbenchPart part, final ISelection finalSelection) {
+ Job job = new Job("Toggle Method Breakpoints") { //$NON-NLS-1$
+ protected IStatus run(IProgressMonitor monitor) {
+ if (monitor.isCanceled()) {
+ return Status.CANCEL_STATUS;
+ }
+ try {
+ report(null, part);
+ ISelection selection = finalSelection;
+ if(!(selection instanceof IStructuredSelection)) {
+ selection = translateToMembers(part, selection);
+ }
+ if(isInterface(selection, part)) {
+ report(ActionMessages.ToggleBreakpointAdapter_7, part);
+ return Status.OK_STATUS;
+ }
+ if (selection instanceof IStructuredSelection) {
+ IMethod[] members = getMethods((IStructuredSelection) selection);
+ if (members.length == 0) {
+ report(ActionMessages.ToggleBreakpointAdapter_9, part);
+ return Status.OK_STATUS;
+ }
+ IJavaBreakpoint breakpoint = null;
+ ISourceRange range = null;
+ Map attributes = null;
+ IType type = null;
+ String signature = null;
+ String mname = null;
+ for (int i = 0, length = members.length; i < length; i++) {
+ breakpoint = getMethodBreakpoint(members[i]);
+ if (breakpoint == null) {
+ int start = -1;
+ int end = -1;
+ range = members[i].getNameRange();
+ if (range != null) {
+ start = range.getOffset();
+ end = start + range.getLength();
+ }
+ attributes = new HashMap(10);
+ BreakpointUtils.addJavaBreakpointAttributes(attributes, members[i]);
+ type = members[i].getDeclaringType();
+ signature = members[i].getSignature();
+ mname = members[i].getElementName();
+ if (members[i].isConstructor()) {
+ mname = "<init>"; //$NON-NLS-1$
+ if (type.isEnum()) {
+ signature = "(Ljava.lang.String;I" + signature.substring(1); //$NON-NLS-1$
+ }
+ }
+ if (!type.isBinary()) {
+ signature = resolveMethodSignature(members[i]);
+ if (signature == null) {
+ report(ActionMessages.ManageMethodBreakpointActionDelegate_methodNonAvailable, part);
+ return Status.OK_STATUS;
+ }
+ }
+ JDIDebugModel.createMethodBreakpoint(BreakpointUtils.getBreakpointResource(members[i]), createQualifiedTypeName(type), mname, signature, true, false, false, -1, start, end, 0, true, attributes);
+ } else {
+ DebugPlugin.getDefault().getBreakpointManager().removeBreakpoint(breakpoint, true);
+ }
+ }
+ }
+ else {
+ report(ActionMessages.ToggleBreakpointAdapter_4, part);
+ return Status.OK_STATUS;
+ }
+ } catch (CoreException e) {
+ return e.getStatus();
+ }
+ return Status.OK_STATUS;
+ }
+ };
+ job.setSystem(true);
+ job.schedule();
+ }
+
+ /**
+ * Toggles a class load breakpoint
+ * @param part the part
+ * @param selection the current selection
+ * @since 3.3
+ */
+ public void toggleClassBreakpoints(final IWorkbenchPart part, final ISelection selection) {
+ Job job = new Job("Toggle Class Load Breakpoints") { //$NON-NLS-1$
+ protected IStatus run(IProgressMonitor monitor) {
+ if (monitor.isCanceled()) {
+ return Status.CANCEL_STATUS;
+ }
+ try {
+ report(null, part);
+ ISelection sel = selection;
+ if(!(selection instanceof IStructuredSelection)) {
+ sel = translateToMembers(part, selection);
+ }
+ if(isInterface(sel, part)) {
+ report(ActionMessages.ToggleBreakpointAdapter_1, part);
+ return Status.OK_STATUS;
+ }
+ if(sel instanceof IStructuredSelection) {
+ IMember member = (IMember)((IStructuredSelection)sel).getFirstElement();
+ IType type = (IType) member;
+ IBreakpoint existing = getClassLoadBreakpoint(type);
+ if (existing != null) {
+ existing.delete();
+ }
+ else {
+ HashMap map = new HashMap(10);
+ BreakpointUtils.addJavaBreakpointAttributes(map, type);
+ ISourceRange range= type.getNameRange();
+ int start = -1;
+ int end = -1;
+ if (range != null) {
+ start = range.getOffset();
+ end = start + range.getLength();
+ }
+ JDIDebugModel.createClassPrepareBreakpoint(BreakpointUtils.getBreakpointResource(member), createQualifiedTypeName(type), IJavaClassPrepareBreakpoint.TYPE_CLASS, start, end, true, map);
+ }
+ }
+ else {
+ report(ActionMessages.ToggleBreakpointAdapter_0, part);
+ return Status.OK_STATUS;
+ }
+ }
+ catch (CoreException e) {
+ return e.getStatus();
+ }
+ return Status.OK_STATUS;
+ }
+ };
+ job.setSystem(true);
+ job.schedule();
+ }
+
+ /**
+ * Returns the class load breakpoint for the specified type or null if none found
+ * @param type the type to search for a class load breakpoint for
+ * @return the existing class load breakpoint, or null if none
+ * @throws CoreException
+ * @since 3.3
+ */
+ protected IBreakpoint getClassLoadBreakpoint(IType type) throws CoreException {
+ IBreakpoint[] breakpoints = DebugPlugin.getDefault().getBreakpointManager().getBreakpoints(JDIDebugModel.getPluginIdentifier());
+ IBreakpoint existing = null;
+ IJavaBreakpoint breakpoint = null;
+ for (int i = 0; i < breakpoints.length; i++) {
+ breakpoint = (IJavaBreakpoint) breakpoints[i];
+ if (breakpoint instanceof IJavaClassPrepareBreakpoint && createQualifiedTypeName(type).equals(breakpoint.getTypeName())) {
+ existing = breakpoint;
+ break;
+ }
+ }
+ return existing;
+ }
+
+ /**
+ * Returns the package qualified name, while accounting for the fact that a source file might
+ * not have a project
+ * @param type the type to ensure the package qualified name is created for
+ * @return the package qualified name
+ * @since 3.3
+ */
+//{ObjectTeams: made API for RoFiBreakpointTests (was private non-static):
+ public static String createQualifiedTypeName(IType type) {
+// SH}
+ String tname = pruneAnonymous(type);
+ try {
+ String packName = null;
+ if (type.isBinary()) {
+ packName = type.getPackageFragment().getElementName();
+ } else {
+ IPackageDeclaration[] pd = type.getCompilationUnit().getPackageDeclarations();
+ if(pd.length > 0) {
+ packName = pd[0].getElementName();
+ }
+ }
+ if(packName != null && !packName.equals(EMPTY_STRING)) {
+//{ObjectTeams: package of a role must be a team package:
+ if (tname.startsWith(IOTConstants.OT_DELIM))
+ tname = packName+'$'+tname;
+ else
+// SH}
+ tname = packName+"."+tname; //$NON-NLS-1$
+ }
+ }
+ catch (JavaModelException e) {}
+ return tname;
+ }
+
+ /**
+ * Prunes out all naming occurrences of anonymous inner types, since these types have no names
+ * and cannot be derived visiting an AST (no positive type name matching while visiting ASTs)
+ * @param type
+ * @return the compiled type name from the given {@link IType} with all occurrences of anonymous inner types removed
+ * @since 3.4
+ */
+ private static String pruneAnonymous(IType type) {
+ StringBuffer buffer = new StringBuffer();
+ IJavaElement parent = type;
+ while(parent != null) {
+ if(parent.getElementType() == IJavaElement.TYPE){
+ IType atype = (IType) parent;
+ try {
+ if(!atype.isAnonymous()) {
+ if(buffer.length() > 0) {
+ buffer.insert(0, '$');
+ }
+//{ObjectTeams: use prefixed role type if appropriate:
+// cf. OTValidBreakpointLocationLocator.computeTypeName()
+/* orig:
+ buffer.insert(0, atype.getElementName());
+ :giro */
+ buffer.insert(0, getSimpleTypeName(atype));
+// SH}
+ }
+ }
+ catch(JavaModelException jme) {}
+ }
+ parent = parent.getParent();
+ }
+ return buffer.toString();
+ }
+
+//{ObjectTeams: new util:
+ /** Make sure each role type is prefixed with __OT__. */
+ private static String getSimpleTypeName(IType type) {
+ String name= type.getElementName();
+ if (name.startsWith(IOTConstants.OT_DELIM))
+ return name; // already prefixed
+
+ boolean isRole= false;
+ if (type.getElementType() == IOTJavaElement.ROLE)
+ isRole= true;
+ else if (OTModelManager.hasOTElementFor(type)) {
+ IOTType otType= OTModelManager.getOTElement(type);
+ isRole= otType.isRole();
+ }
+ if (isRole)
+ return IOTConstants.OT_DELIM + name;
+ return name;
+ }
+// SH}
+
+ /**
+ * gets the <code>IJavaElement</code> from the editor input
+ * @param input the current editor input
+ * @return the corresponding <code>IJavaElement</code>
+ * @since 3.3
+ */
+ private IJavaElement getJavaElement(IEditorInput input) {
+ IJavaElement je = JavaUI.getEditorInputJavaElement(input);
+ if(je != null) {
+ return je;
+ }
+ //try to get from the working copy manager
+ return DebugWorkingCopyManager.getWorkingCopy(input, false);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.debug.ui.actions.IToggleBreakpointsTarget#canToggleMethodBreakpoints(org.eclipse.ui.IWorkbenchPart,
+ * org.eclipse.jface.viewers.ISelection)
+ */
+ public boolean canToggleMethodBreakpoints(IWorkbenchPart part, ISelection selection) {
+ if (isRemote(part, selection)) {
+ return false;
+ }
+ if (selection instanceof IStructuredSelection) {
+ IStructuredSelection ss = (IStructuredSelection) selection;
+ return getMethods(ss).length > 0;
+ }
+ return (selection instanceof ITextSelection) && isMethod((ITextSelection) selection, part);
+ }
+
+ /**
+ * Returns whether the given part/selection is remote (viewing a repository)
+ *
+ * @param part
+ * @param selection
+ * @return
+ */
+ protected boolean isRemote(IWorkbenchPart part, ISelection selection) {
+ if (selection instanceof IStructuredSelection) {
+ IStructuredSelection ss = (IStructuredSelection) selection;
+ Object element = ss.getFirstElement();
+ if(element instanceof IMember) {
+ IMember member = (IMember) element;
+ return !member.getJavaProject().getProject().exists();
+ }
+ }
+ ITextEditor editor = getTextEditor(part);
+ if (editor != null) {
+ IEditorInput input = editor.getEditorInput();
+ Object adapter = Platform.getAdapterManager().getAdapter(input, "org.eclipse.team.core.history.IFileRevision"); //$NON-NLS-1$
+ return adapter != null;
+ }
+ return false;
+ }
+
+ /**
+ * Returns the text editor associated with the given part or <code>null</code>
+ * if none. In case of a multi-page editor, this method should be used to retrieve
+ * the correct editor to perform the breakpoint operation on.
+ *
+ * @param part workbench part
+ * @return text editor part or <code>null</code>
+ */
+ protected ITextEditor getTextEditor(IWorkbenchPart part) {
+ if (part instanceof ITextEditor) {
+ return (ITextEditor) part;
+ }
+ return (ITextEditor) part.getAdapter(ITextEditor.class);
+ }
+
+ /**
+ * Returns the methods from the selection, or an empty array
+ * @param selection the selection to get the methods from
+ * @return an array of the methods from the selection or an empty array
+ */
+ protected IMethod[] getMethods(IStructuredSelection selection) {
+ if (selection.isEmpty()) {
+ return new IMethod[0];
+ }
+ List methods = new ArrayList(selection.size());
+ Iterator iterator = selection.iterator();
+ while (iterator.hasNext()) {
+ Object thing = iterator.next();
+ try {
+ if (thing instanceof IMethod) {
+ IMethod method = (IMethod) thing;
+ if (!Flags.isAbstract(method.getFlags())) {
+ methods.add(method);
+ }
+ }
+ }
+ catch (JavaModelException e) {}
+ }
+ return (IMethod[]) methods.toArray(new IMethod[methods.size()]);
+ }
+
+ /**
+ * Returns if the text selection is a valid method or not
+ * @param selection the text selection
+ * @param part the associated workbench part
+ * @return true if the selection is a valid method, false otherwise
+ */
+ private boolean isMethod(ITextSelection selection, IWorkbenchPart part) {
+ ITextEditor editor = getTextEditor(part);
+ if(editor != null) {
+ IJavaElement element = getJavaElement(editor.getEditorInput());
+ if(element != null) {
+ try {
+ if(element instanceof ICompilationUnit) {
+ element = ((ICompilationUnit) element).getElementAt(selection.getOffset());
+ }
+ else if(element instanceof IClassFile) {
+ element = ((IClassFile) element).getElementAt(selection.getOffset());
+ }
+ return element != null && element.getElementType() == IJavaElement.METHOD;
+ }
+ catch (JavaModelException e) {return false;}
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Returns a list of <code>IField</code> and <code>IJavaFieldVariable</code> in the given selection.
+ * When an <code>IField</code> can be resolved for an <code>IJavaFieldVariable</code>, it is
+ * returned in favour of the variable.
+ *
+ * @param selection
+ * @return list of <code>IField</code> and <code>IJavaFieldVariable</code>, possibly empty
+ * @throws CoreException
+ */
+ protected List getFields(IStructuredSelection selection) throws CoreException {
+ if (selection.isEmpty()) {
+ return Collections.EMPTY_LIST;
+ }
+ List fields = new ArrayList(selection.size());
+ Iterator iterator = selection.iterator();
+ while (iterator.hasNext()) {
+ Object thing = iterator.next();
+ if (thing instanceof IField) {
+ fields.add(thing);
+ } else if (thing instanceof IJavaFieldVariable) {
+ IField field = getField((IJavaFieldVariable) thing);
+ if (field == null) {
+ fields.add(thing);
+ } else {
+ fields.add(field);
+ }
+ }
+ }
+ return fields;
+ }
+
+ /**
+ * Returns if the structured selection is itself or is part of an interface
+ * @param selection the current selection
+ * @return true if the selection is part of an interface, false otherwise
+ * @since 3.2
+ */
+ private boolean isInterface(ISelection selection, IWorkbenchPart part) {
+ try {
+ ISelection sel = selection;
+ if(!(sel instanceof IStructuredSelection)) {
+ sel = translateToMembers(part, selection);
+ }
+ if(sel instanceof IStructuredSelection) {
+ Object obj = ((IStructuredSelection)sel).getFirstElement();
+ if(obj instanceof IMember) {
+ IMember member = (IMember) ((IStructuredSelection)sel).getFirstElement();
+ if(member.getElementType() == IJavaElement.TYPE) {
+ return ((IType)member).isInterface();
+ }
+ return member.getDeclaringType().isInterface();
+ }
+ else if(obj instanceof IJavaFieldVariable) {
+ IJavaFieldVariable var = (IJavaFieldVariable) obj;
+ IType type = JavaDebugUtils.resolveType(var.getDeclaringType());
+ return type != null && type.isInterface();
+ }
+ }
+ }
+ catch (CoreException e1) {}
+ return false;
+ }
+
+ /**
+ * Returns if the text selection is a field selection or not
+ * @param selection the text selection
+ * @param part the associated workbench part
+ * @return true if the text selection is a valid field for a watchpoint, false otherwise
+ * @since 3.3
+ */
+ private boolean isField(ITextSelection selection, IWorkbenchPart part) {
+ ITextEditor editor = getTextEditor(part);
+ if(editor != null) {
+ IJavaElement element = getJavaElement(editor.getEditorInput());
+ if(element != null) {
+ try {
+ if(element instanceof ICompilationUnit) {
+ element = ((ICompilationUnit) element).getElementAt(selection.getOffset());
+ }
+ else if(element instanceof IClassFile) {
+ element = ((IClassFile) element).getElementAt(selection.getOffset());
+ }
+ return element != null && element.getElementType() == IJavaElement.FIELD;
+ }
+ catch (JavaModelException e) {return false;}
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Determines if the selection is a field or not
+ * @param selection the current selection
+ * @return true if the selection is a field false otherwise
+ */
+ private boolean isFields(IStructuredSelection selection) {
+ if (!selection.isEmpty()) {
+ try {
+ Iterator iterator = selection.iterator();
+ while (iterator.hasNext()) {
+ Object thing = iterator.next();
+ if (thing instanceof IField) {
+ int flags = ((IField)thing).getFlags();
+ return !Flags.isFinal(flags) & !(Flags.isFinal(flags) & Flags.isStatic(flags));
+ }
+ else if(thing instanceof IJavaFieldVariable) {
+ IJavaFieldVariable fv = (IJavaFieldVariable)thing;
+ return !fv.isFinal() & !(fv.isFinal() & fv.isStatic());
+ }
+ }
+ }
+ catch(JavaModelException e) {return false;}
+ catch(DebugException de) {return false;}
+ }
+ return false;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.debug.ui.actions.IToggleBreakpointsTarget#toggleWatchpoints(org.eclipse.ui.IWorkbenchPart,
+ * org.eclipse.jface.viewers.ISelection)
+ */
+ public void toggleWatchpoints(final IWorkbenchPart part, final ISelection finalSelection) {
+ Job job = new Job("Toggle Watchpoints") { //$NON-NLS-1$
+ protected IStatus run(IProgressMonitor monitor) {
+ if (monitor.isCanceled()) {
+ return Status.CANCEL_STATUS;
+ }
+ try {
+ report(null, part);
+ ISelection selection = finalSelection;
+ if(!(selection instanceof IStructuredSelection)) {
+ selection = translateToMembers(part, finalSelection);
+ }
+ if(isInterface(selection, part)) {
+ report(ActionMessages.ToggleBreakpointAdapter_5, part);
+ return Status.OK_STATUS;
+ }
+ boolean allowed = false;
+ if (selection instanceof IStructuredSelection) {
+ List fields = getFields((IStructuredSelection) selection);
+ if (fields.isEmpty()) {
+ report(ActionMessages.ToggleBreakpointAdapter_10, part);
+ return Status.OK_STATUS;
+ }
+ Iterator theFields = fields.iterator();
+ IField javaField = null;
+ IResource resource = null;
+ String typeName = null;
+ String fieldName = null;
+ Object element = null;
+ Map attributes = null;
+ IJavaBreakpoint breakpoint = null;
+ while (theFields.hasNext()) {
+ element = theFields.next();
+ if (element instanceof IField) {
+ javaField = (IField) element;
+ IType type = javaField.getDeclaringType();
+ typeName = createQualifiedTypeName(type);
+ fieldName = javaField.getElementName();
+ int f = javaField.getFlags();
+ boolean fin = Flags.isFinal(f);
+ allowed = !(fin) & !(Flags.isStatic(f) & fin);
+ } else if (element instanceof IJavaFieldVariable) {
+ IJavaFieldVariable var = (IJavaFieldVariable) element;
+ typeName = var.getDeclaringType().getName();
+ fieldName = var.getName();
+ boolean fin = var.isFinal();
+ allowed = !(fin) & !(var.isStatic() & fin);
+ }
+ breakpoint = getWatchpoint(typeName, fieldName);
+ if (breakpoint == null) {
+ if(!allowed) {
+ toggleLineBreakpoints(part, finalSelection);
+ return Status.OK_STATUS;
+ }
+ int start = -1;
+ int end = -1;
+ attributes = new HashMap(10);
+ if (javaField == null) {
+ resource = ResourcesPlugin.getWorkspace().getRoot();
+ } else {
+ IType type = javaField.getDeclaringType();
+ ISourceRange range = javaField.getNameRange();
+ if (range != null) {
+ start = range.getOffset();
+ end = start + range.getLength();
+ }
+ BreakpointUtils.addJavaBreakpointAttributes(attributes, javaField);
+ resource = BreakpointUtils.getBreakpointResource(type);
+ }
+ JDIDebugModel.createWatchpoint(resource, typeName, fieldName, -1, start, end, 0, true, attributes);
+ } else {
+ DebugPlugin.getDefault().getBreakpointManager().removeBreakpoint(breakpoint, true);
+ }
+ }
+ }
+ else {
+ report(ActionMessages.ToggleBreakpointAdapter_2, part);
+ return Status.OK_STATUS;
+ }
+ } catch (CoreException e) {return e.getStatus();}
+ return Status.OK_STATUS;
+ }
+ };
+ job.setSystem(true);
+ job.schedule();
+ }
+
+ /**
+ * Returns any existing watchpoint for the given field, or <code>null</code> if none.
+ *
+ * @param typeName fully qualified type name on which watchpoint may exist
+ * @param fieldName field name
+ * @return any existing watchpoint for the given field, or <code>null</code> if none
+ * @throws CoreException
+ */
+ private IJavaWatchpoint getWatchpoint(String typeName, String fieldName) throws CoreException {
+ IBreakpointManager breakpointManager = DebugPlugin.getDefault().getBreakpointManager();
+ IBreakpoint[] breakpoints = breakpointManager.getBreakpoints(JDIDebugModel.getPluginIdentifier());
+ for (int i = 0; i < breakpoints.length; i++) {
+ IBreakpoint breakpoint = breakpoints[i];
+ if (breakpoint instanceof IJavaWatchpoint) {
+ IJavaWatchpoint watchpoint = (IJavaWatchpoint) breakpoint;
+ if (typeName.equals(watchpoint.getTypeName()) && fieldName.equals(watchpoint.getFieldName())) {
+ return watchpoint;
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Returns the resolved signature of the given method
+ * @param method method to resolve
+ * @return the resolved method signature or <code>null</code> if none
+ * @throws JavaModelException
+ * @since 3.4
+ */
+ public static String resolveMethodSignature(IMethod method) throws JavaModelException {
+ String signature = method.getSignature();
+ String[] parameterTypes = Signature.getParameterTypes(signature);
+ int length = parameterTypes.length;
+ String[] resolvedParameterTypes = new String[length];
+ for (int i = 0; i < length; i++) {
+ resolvedParameterTypes[i] = resolveTypeSignature(method, parameterTypes[i]);
+ if (resolvedParameterTypes[i] == null) {
+ return null;
+ }
+ }
+ String resolvedReturnType = resolveTypeSignature(method, Signature.getReturnType(signature));
+ if (resolvedReturnType == null) {
+ return null;
+ }
+ return Signature.createMethodSignature(resolvedParameterTypes, resolvedReturnType);
+ }
+
+ /**
+ * Returns the resolved type signature for the given signature in the given
+ * method, or <code>null</code> if unable to resolve.
+ *
+ * @param method method containing the type signature
+ * @param typeSignature the type signature to resolve
+ * @return the resolved type signature
+ * @throws JavaModelException
+ */
+ private static String resolveTypeSignature(IMethod method, String typeSignature) throws JavaModelException {
+ int count = Signature.getArrayCount(typeSignature);
+ String elementTypeSignature = Signature.getElementType(typeSignature);
+ if (elementTypeSignature.length() == 1) {
+ // no need to resolve primitive types
+ return typeSignature;
+ }
+ String elementTypeName = Signature.toString(elementTypeSignature);
+ IType type = method.getDeclaringType();
+ String[][] resolvedElementTypeNames = type.resolveType(elementTypeName);
+ if (resolvedElementTypeNames == null || resolvedElementTypeNames.length != 1) {
+ // check if type parameter
+ ITypeParameter typeParameter = method.getTypeParameter(elementTypeName);
+ if (!typeParameter.exists()) {
+ typeParameter = type.getTypeParameter(elementTypeName);
+ }
+ if (typeParameter.exists()) {
+ String[] bounds = typeParameter.getBounds();
+ if (bounds.length == 0) {
+ return "Ljava/lang/Object;"; //$NON-NLS-1$
+ } else {
+ String bound = Signature.createTypeSignature(bounds[0], false);
+ return resolveTypeSignature(method, bound);
+ }
+ }
+ // the type name cannot be resolved
+ return null;
+ }
+
+ String[] types = resolvedElementTypeNames[0];
+ types[1] = types[1].replace('.', '$');
+
+ String resolvedElementTypeName = Signature.toQualifiedName(types);
+ String resolvedElementTypeSignature = EMPTY_STRING;
+ if(types[0].equals(EMPTY_STRING)) {
+ resolvedElementTypeName = resolvedElementTypeName.substring(1);
+ resolvedElementTypeSignature = Signature.createTypeSignature(resolvedElementTypeName, true);
+ }
+ else {
+ resolvedElementTypeSignature = Signature.createTypeSignature(resolvedElementTypeName, true).replace('.', '/');
+ }
+
+ return Signature.createArraySignature(resolvedElementTypeSignature, count);
+ }
+
+ /**
+ * Returns the resource associated with the specified editor part
+ * @param editor the currently active editor part
+ * @return the corresponding <code>IResource</code> from the editor part
+ */
+ protected static IResource getResource(IEditorPart editor) {
+ IEditorInput editorInput = editor.getEditorInput();
+ IResource resource = (IResource) editorInput.getAdapter(IFile.class);
+ if (resource == null) {
+ resource = ResourcesPlugin.getWorkspace().getRoot();
+ }
+ return resource;
+ }
+
+ /**
+ * Returns a handle to the specified method or <code>null</code> if none.
+ *
+ * @param editorPart
+ * the editor containing the method
+ * @param typeName
+ * @param methodName
+ * @param signature
+ * @return handle or <code>null</code>
+ */
+ protected IMethod getMethodHandle(IEditorPart editorPart, String typeName, String methodName, String signature) throws CoreException {
+ IJavaElement element = (IJavaElement) editorPart.getEditorInput().getAdapter(IJavaElement.class);
+ IType type = null;
+ if (element instanceof ICompilationUnit) {
+ IType[] types = ((ICompilationUnit) element).getAllTypes();
+ for (int i = 0; i < types.length; i++) {
+ if (types[i].getFullyQualifiedName().equals(typeName)) {
+ type = types[i];
+ break;
+ }
+ }
+ } else if (element instanceof IClassFile) {
+ type = ((IClassFile) element).getType();
+ }
+ if (type != null) {
+ String[] sigs = Signature.getParameterTypes(signature);
+ return type.getMethod(methodName, sigs);
+ }
+ return null;
+ }
+
+ /**
+ * Returns the <code>IJavaBreakpoint</code> from the specified <code>IMember</code>
+ * @param element the element to get the breakpoint from
+ * @return the current breakpoint from the element or <code>null</code>
+ */
+ protected IJavaBreakpoint getMethodBreakpoint(IMember element) {
+ IBreakpointManager breakpointManager = DebugPlugin.getDefault().getBreakpointManager();
+ IBreakpoint[] breakpoints = breakpointManager.getBreakpoints(JDIDebugModel.getPluginIdentifier());
+ if (element instanceof IMethod) {
+ IMethod method = (IMethod) element;
+ for (int i = 0; i < breakpoints.length; i++) {
+ IBreakpoint breakpoint = breakpoints[i];
+ if (breakpoint instanceof IJavaMethodBreakpoint) {
+ IJavaMethodBreakpoint methodBreakpoint = (IJavaMethodBreakpoint) breakpoint;
+ IMember container = null;
+ try {
+ container = BreakpointUtils.getMember(methodBreakpoint);
+ } catch (CoreException e) {
+ JDIDebugUIPlugin.log(e);
+ return null;
+ }
+ if (container == null) {
+ try {
+ if (method.getDeclaringType().getFullyQualifiedName().equals(methodBreakpoint.getTypeName()) &&
+ method.getElementName().equals(methodBreakpoint.getMethodName()) &&
+ methodBreakpoint.getMethodSignature().equals(resolveMethodSignature(method))) {
+ return methodBreakpoint;
+ }
+ } catch (CoreException e) {
+ JDIDebugUIPlugin.log(e);
+ }
+ } else {
+ if (container instanceof IMethod) {
+ if (method.getDeclaringType().getFullyQualifiedName().equals(container.getDeclaringType().getFullyQualifiedName())) {
+ if (method.isSimilar((IMethod) container)) {
+ return methodBreakpoint;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Returns the compilation unit from the editor
+ * @param editor the editor to get the compilation unit from
+ * @return the compilation unit or <code>null</code>
+ */
+ protected CompilationUnit parseCompilationUnit(ITextEditor editor) {
+ ITypeRoot root = getTypeRoot(editor.getEditorInput());
+ if(root != null) {
+ ASTParser parser = ASTParser.newParser(AST.JLS3);
+ parser.setSource(root);
+ return (CompilationUnit) parser.createAST(null);
+ }
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.debug.ui.actions.IToggleBreakpointsTarget#canToggleWatchpoints(org.eclipse.ui.IWorkbenchPart,
+ * org.eclipse.jface.viewers.ISelection)
+ */
+ public boolean canToggleWatchpoints(IWorkbenchPart part, ISelection selection) {
+ if (isRemote(part, selection)) {
+ return false;
+ }
+ if (selection instanceof IStructuredSelection) {
+ IStructuredSelection ss = (IStructuredSelection) selection;
+ return isFields(ss);
+ }
+ return (selection instanceof ITextSelection) && isField((ITextSelection) selection, part);
+ }
+
+ /**
+ * Returns a selection of the member in the given text selection, or the
+ * original selection if none.
+ *
+ * @param part
+ * @param selection
+ * @return a structured selection of the member in the given text selection,
+ * or the original selection if none
+ * @exception CoreException
+ * if an exception occurs
+ */
+ protected ISelection translateToMembers(IWorkbenchPart part, ISelection selection) throws CoreException {
+ ITextEditor textEditor = getTextEditor(part);
+ if (textEditor != null && selection instanceof ITextSelection) {
+ ITextSelection textSelection = (ITextSelection) selection;
+ IEditorInput editorInput = textEditor.getEditorInput();
+ IDocumentProvider documentProvider = textEditor.getDocumentProvider();
+ if (documentProvider == null) {
+ throw new CoreException(Status.CANCEL_STATUS);
+ }
+ IDocument document = documentProvider.getDocument(editorInput);
+ int offset = textSelection.getOffset();
+ if (document != null) {
+ try {
+ IRegion region = document.getLineInformationOfOffset(offset);
+ int end = region.getOffset() + region.getLength();
+ while (Character.isWhitespace(document.getChar(offset)) && offset < end) {
+ offset++;
+ }
+ } catch (BadLocationException e) {}
+ }
+ IMember m = null;
+ ITypeRoot root = getTypeRoot(editorInput);
+ if(root instanceof ICompilationUnit) {
+ ICompilationUnit unit = (ICompilationUnit) root;
+ synchronized (unit) {
+ unit.reconcile(ICompilationUnit.NO_AST , false, null, null);
+ }
+ }
+ if(root != null){
+ IJavaElement e = root.getElementAt(offset);
+ if (e instanceof IMember) {
+ m = (IMember) e;
+ }
+ }
+ if (m != null) {
+ return new StructuredSelection(m);
+ }
+ }
+ return selection;
+ }
+
+ /**
+ * Returns the {@link ITypeRoot} for the given {@link IEditorInput}
+ * @param input
+ * @return the type root or <code>null</code> if one cannot be derived
+ * @since 3.4
+ */
+ private ITypeRoot getTypeRoot(IEditorInput input) {
+ ITypeRoot root = (ITypeRoot) input.getAdapter(IClassFile.class);
+ if(root == null) {
+ IWorkingCopyManager manager = JavaUI.getWorkingCopyManager();
+ root = manager.getWorkingCopy(input);
+ }
+ if(root == null) {
+ root = DebugWorkingCopyManager.getWorkingCopy(input, false);
+ }
+ return root;
+ }
+
+ /**
+ * Return the associated IField (Java model) for the given
+ * IJavaFieldVariable (JDI model)
+ */
+ private IField getField(IJavaFieldVariable variable) throws CoreException {
+ String varName = null;
+ try {
+ varName = variable.getName();
+ } catch (DebugException x) {
+ JDIDebugUIPlugin.log(x);
+ return null;
+ }
+ IField field;
+ IJavaType declaringType = variable.getDeclaringType();
+ IType type = JavaDebugUtils.resolveType(declaringType);
+ if (type != null) {
+ field = type.getField(varName);
+ if (field.exists()) {
+ return field;
+ }
+ }
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.debug.ui.actions.IToggleBreakpointsTargetExtension#toggleBreakpoints(org.eclipse.ui.IWorkbenchPart,
+ * org.eclipse.jface.viewers.ISelection)
+ */
+ public void toggleBreakpoints(IWorkbenchPart part, ISelection selection) throws CoreException {
+ ISelection sel = translateToMembers(part, selection);
+ if(sel instanceof IStructuredSelection) {
+ IMember member = (IMember) ((IStructuredSelection)sel).getFirstElement();
+ int mtype = member.getElementType();
+ if(mtype == IJavaElement.FIELD || mtype == IJavaElement.METHOD) {
+ // remove line breakpoint if present first
+ if (selection instanceof ITextSelection) {
+ ITextSelection ts = (ITextSelection) selection;
+ IType declaringType = member.getDeclaringType();
+ IResource resource = BreakpointUtils.getBreakpointResource(declaringType);
+ IJavaLineBreakpoint breakpoint = JDIDebugModel.lineBreakpointExists(resource, createQualifiedTypeName(declaringType), ts.getStartLine() + 1);
+ if (breakpoint != null) {
+ breakpoint.delete();
+ return;
+ }
+ CompilationUnit unit = parseCompilationUnit(getTextEditor(part));
+//ObjectTeams: (visibility) OTValidBreakpointLocationLocator instead of ValidBreakpointLocationLocator
+ OTValidBreakpointLocationLocator loc = new OTValidBreakpointLocationLocator(unit, ts.getStartLine()+1, true, true);
+ unit.accept(loc);
+ if(loc.getLocationType() == OTValidBreakpointLocationLocator.LOCATION_METHOD) {
+ toggleMethodBreakpoints(part, sel);
+ }
+ else if(loc.getLocationType() == OTValidBreakpointLocationLocator.LOCATION_FIELD) {
+ toggleWatchpoints(part, ts);
+ }
+ else if(loc.getLocationType() == OTValidBreakpointLocationLocator.LOCATION_LINE) {
+ toggleLineBreakpoints(part, ts);
+ }
+// carp}
+ }
+ }
+ else if(member.getElementType() == IJavaElement.TYPE) {
+ toggleClassBreakpoints(part, sel);
+ }
+ else {
+ //fall back to old behavior, always create a line breakpoint
+ toggleLineBreakpoints(part, selection, true);
+ }
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.debug.ui.actions.IToggleBreakpointsTargetExtension#canToggleBreakpoints(org.eclipse.ui.IWorkbenchPart,
+ * org.eclipse.jface.viewers.ISelection)
+ */
+ public boolean canToggleBreakpoints(IWorkbenchPart part, ISelection selection) {
+ if (isRemote(part, selection)) {
+ return false;
+ }
+ return canToggleLineBreakpoints(part, selection);
+ }
+}
+
+//ike} \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/actions/OTValidBreakpointLocationLocator.java b/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/actions/OTValidBreakpointLocationLocator.java
new file mode 100644
index 000000000..dc88fc7ba
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/actions/OTValidBreakpointLocationLocator.java
@@ -0,0 +1,1153 @@
+/*******************************************************************************
+ * 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
+ * $Id: OTValidBreakpointLocationLocator.java 23432 2010-02-03 23:13:42Z stephan $
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * Fraunhofer FIRST - extended API and implementation
+ * Technical University Berlin - extended API and implementation
+ *******************************************************************************/
+package org.eclipse.objectteams.otdt.debug.ui.internal.actions;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.jdt.core.dom.*;
+import org.eclipse.jdt.core.dom.PrefixExpression.Operator;
+import org.eclipse.objectteams.otdt.core.compiler.IOTConstants;
+
+/**
+ * Compute a valid location where to put a breakpoint from an JDOM CompilationUnit.
+ * The result is the first valid location with a line number greater or equals than the given position.
+ *
+ * The Visitor visits now also OT-nodes like Callout-/CallinMappingDeclaration and decides wheather a breakpoint
+ * is allowed in this node or not.
+*
+ * @author ike
+ * $Id: OTValidBreakpointLocationLocator.java 23432 2010-02-03 23:13:42Z stephan $
+ */
+//{OT_COPY_PASTE from org.eclipse.jdt.internal.debug.ui.action.ValidBreakpointLocationLocator
+// due to private visibility of visit(ASTNode, boolean) (added visitor-methods can't call it)
+// -> could easily be ported to OT, together with OTBreakpointLocationVerifierJob
+public class OTValidBreakpointLocationLocator extends ASTVisitor {
+
+ public static final int LOCATION_NOT_FOUND= 0;
+ public static final int LOCATION_LINE= 1;
+ public static final int LOCATION_METHOD= 2;
+ public static final int LOCATION_FIELD= 3;
+
+ private CompilationUnit fCompilationUnit;
+ private int fLineNumber;
+ private boolean fBindingsResolved;
+ private boolean fNeedBindings = false;
+ private boolean fBestMatch;
+
+ private int fLocationType;
+ private boolean fLocationFound;
+ private String fTypeName;
+ private int fLineLocation;
+ private int fMemberOffset;
+ private List fLabels;
+
+ /**
+ * @param compilationUnit the JDOM CompilationUnit of the source code.
+ * @param lineNumber the line number in the source code where to put the breakpoint.
+ * @param bestMatch if <code>true</code> look for the best match, otherwise look only for a valid line
+ */
+ public OTValidBreakpointLocationLocator(CompilationUnit compilationUnit, int lineNumber, boolean bindingsResolved, boolean bestMatch) {
+ fCompilationUnit= compilationUnit;
+ fLineNumber= lineNumber;
+ fBindingsResolved= bindingsResolved;
+ fBestMatch= bestMatch;
+ fLocationFound= false;
+ }
+
+ /**
+ * Returns whether binding information would be helpful in validating a breakpoint
+ * location. If this locator makes a pass of the tree and determines that binding
+ * information would be helpful but was not available, this method returns
+ * <code>true</code>.
+ *
+ * @return whether binding information would be helpful in validating a breakpoint location
+ */
+ public boolean isBindingsRequired() {
+ return fNeedBindings;
+ }
+
+ /**
+ * Return the type of the valid location found
+ * @return one of LOCATION_NOT_FOUND, LOCATION_LINE, LOCATION_METHOD or LOCATION_FIELD
+ */
+ public int getLocationType() {
+ return fLocationType;
+ }
+
+ /**
+ * Return of the type where the valid location is.
+ */
+ public String getFullyQualifiedTypeName() {
+ return fTypeName;
+ }
+
+ /**
+ * Return the line number of the computed valid location, if the location type is LOCATION_LINE.
+ */
+ public int getLineLocation() {
+ if (fLocationType == LOCATION_LINE) {
+ return fLineLocation;
+ }
+ return -1;
+ }
+
+ /**
+ * Return the offset of the member which is the valid location,
+ * if the location type is LOCATION_METHOD or LOCATION_FIELD.
+ */
+ public int getMemberOffset() {
+ return fMemberOffset;
+ }
+
+ /**
+ * Compute the name of the type which contains this node.
+ * Result will be the name of the type or the inner type which contains this node, but not of the local or anonymous type.
+ */
+ static protected String computeTypeName(ASTNode node) {
+//{ObjectTeams: several modifications to cope with role classes (inline and role file):
+
+ // type part:
+ String typeName = null;
+ while (!(node instanceof CompilationUnit)) {
+ if (node instanceof AbstractTypeDeclaration) {
+ String identifier= ((AbstractTypeDeclaration)node).getName().getIdentifier();
+ if (typeName == null) {
+ typeName= identifier;
+ if ( node instanceof RoleTypeDeclaration
+ && !typeName.startsWith(IOTConstants.OT_DELIM))
+ typeName= IOTConstants.OT_DELIM+typeName;
+ } else {
+ typeName= identifier + '$' + typeName;
+ }
+ } else {
+ typeName= null;
+ }
+ node= node.getParent();
+ }
+
+ // package part (may be team package):
+ PackageDeclaration packageDecl= ((CompilationUnit)node).getPackage();
+ char sep= '.'; // for regular toplevel types
+ if (typeName.startsWith(IOTConstants.OT_DELIM))
+ sep= '$'; // for role files
+ String packageIdentifier= ""; //$NON-NLS-1$
+ if (packageDecl != null) {
+ Name packageName= packageDecl.getName();
+ while (packageName.isQualifiedName()) {
+ QualifiedName qualifiedName= (QualifiedName) packageName;
+ packageIdentifier= qualifiedName.getName().getIdentifier() + sep + packageIdentifier;
+ sep= '.';
+ packageName= qualifiedName.getQualifier();
+ }
+ packageIdentifier= ((SimpleName)packageName).getIdentifier() + sep + packageIdentifier;
+ }
+
+ return packageIdentifier + typeName;
+// SH}
+ }
+
+ /**
+ * Return <code>true</code> if this node children may contain a valid location
+ * for the breakpoint.
+ * @param node the node.
+ * @param isCode true indicated that the first line of the given node always
+ * contains some executable code, even if split in multiple lines.
+ */
+ private boolean visit(ASTNode node, boolean isCode) {
+ // if we already found a correct location
+ // no need to check the element inside.
+ if (fLocationFound) {
+ return false;
+ }
+ int startPosition= node.getStartPosition();
+ int endLine= lineNumber(startPosition + node.getLength() - 1);
+ // if the position is not in this part of the code
+ // no need to check the element inside.
+ if (endLine < fLineNumber) {
+ return false;
+ }
+ // if the first line of this node always represents some executable code and the
+ // breakpoint is requested on this line or on a previous line, this is a valid
+ // location
+ int startLine = lineNumber(startPosition);
+ if (isCode && (fLineNumber <= startLine)) {
+ fLineLocation= startLine;
+ fLocationFound= true;
+ fLocationType= LOCATION_LINE;
+ fTypeName= computeTypeName(node);
+ return false;
+ }
+ return true;
+ }
+
+ private boolean isReplacedByConstantValue(Expression node) {
+ switch (node.getNodeType()) {
+ // litterals are constant
+ case ASTNode.BOOLEAN_LITERAL:
+ case ASTNode.CHARACTER_LITERAL:
+ case ASTNode.NUMBER_LITERAL:
+ case ASTNode.STRING_LITERAL:
+ return true;
+ case ASTNode.SIMPLE_NAME:
+ case ASTNode.QUALIFIED_NAME:
+ return isReplacedByConstantValue((Name)node);
+ case ASTNode.FIELD_ACCESS:
+ return isReplacedByConstantValue((FieldAccess)node);
+ case ASTNode.SUPER_FIELD_ACCESS:
+ return isReplacedByConstantValue((SuperFieldAccess)node);
+ case ASTNode.INFIX_EXPRESSION:
+ return isReplacedByConstantValue((InfixExpression)node);
+ case ASTNode.PREFIX_EXPRESSION:
+ return isReplacedByConstantValue((PrefixExpression)node);
+ case ASTNode.CAST_EXPRESSION:
+ return isReplacedByConstantValue(((CastExpression)node).getExpression());
+ default:
+ return false;
+ }
+ }
+
+ private boolean isReplacedByConstantValue(InfixExpression node) {
+ // if all operands are constant value, the expression is replaced by a constant value
+ if (!(isReplacedByConstantValue(node.getLeftOperand()) && isReplacedByConstantValue(node.getRightOperand()))) {
+ return false;
+ }
+ if (node.hasExtendedOperands()) {
+ for (Iterator iter = node.extendedOperands().iterator(); iter.hasNext(); ) {
+ if (!isReplacedByConstantValue((Expression) iter.next())) {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+
+ private boolean isReplacedByConstantValue(PrefixExpression node) {
+ // for '-', '+', '~' and '!', if the operand is a constant value,
+ // the expression is replaced by a constant value
+ Operator operator = node.getOperator();
+ if (operator != PrefixExpression.Operator.INCREMENT && operator != PrefixExpression.Operator.DECREMENT) {
+ return isReplacedByConstantValue(node.getOperand());
+ }
+ return false;
+ }
+
+ private boolean isReplacedByConstantValue(Name node) {
+ if (!fBindingsResolved) {
+ fNeedBindings = true;
+ return false;
+ }
+ // if node is a variable with a constant value (static final field)
+ IBinding binding= node.resolveBinding();
+ if (binding != null && binding.getKind() == IBinding.VARIABLE) {
+ return ((IVariableBinding)binding).getConstantValue() != null;
+ }
+ return false;
+ }
+
+ private boolean isReplacedByConstantValue(FieldAccess node) {
+ if (!fBindingsResolved) {
+ fNeedBindings = true;
+ return false;
+ }
+ // if the node is 'this.<field>', and the field is static final
+ Expression expression= node.getExpression();
+ IVariableBinding binding= node.resolveFieldBinding();
+ if (binding != null && expression.getNodeType() == ASTNode.THIS_EXPRESSION) {
+ return binding.getConstantValue() != null;
+ }
+ return false;
+ }
+
+ private boolean isReplacedByConstantValue(SuperFieldAccess node) {
+ if (!fBindingsResolved) {
+ fNeedBindings = true;
+ return false;
+ }
+ // if the field is static final
+ IVariableBinding binding= node.resolveFieldBinding();
+ if (binding != null) {
+ return binding.getConstantValue() != null;
+ }
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.AnnotationTypeDeclaration)
+ */
+ public boolean visit(AnnotationTypeDeclaration node) {
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.AnnotationTypeMemberDeclaration)
+ */
+ public boolean visit(AnnotationTypeMemberDeclaration node) {
+ return false;
+ }
+
+ /**
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.AnonymousClassDeclaration)
+ */
+ public boolean visit(AnonymousClassDeclaration node) {
+ return visit(node, false);
+ }
+
+ /**
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.ArrayAccess)
+ */
+ public boolean visit(ArrayAccess node) {
+ return visit(node, true);
+ }
+
+ /**
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.ArrayCreation)
+ */
+ public boolean visit(ArrayCreation node) {
+ return visit(node, node.getInitializer() == null);
+ }
+
+ /**
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.ArrayInitializer)
+ */
+ public boolean visit(ArrayInitializer node) {
+ return visit(node, true);
+ }
+
+ /**
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.ArrayType)
+ */
+ public boolean visit(ArrayType node) {
+ return false;
+ }
+
+ /**
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.AssertStatement)
+ */
+ public boolean visit(AssertStatement node) {
+ return visit(node, true);
+ }
+
+ /**
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.Assignment)
+ */
+ public boolean visit(Assignment node) {
+ if (visit(node, false)) {
+ // if the left hand side represent a local variable, or a static field
+ // and the breakpoint was requested on a line before the line where
+ // starts the assigment, set the location to be the first executable
+ // instruction of the right hand side, as it will be the first part of
+ // this assigment to be executed
+ Expression leftHandSide= node.getLeftHandSide();
+ if (leftHandSide instanceof Name) {
+ int startLine = lineNumber(node.getStartPosition());
+ if (fLineNumber < startLine) {
+ if (fBindingsResolved) {
+ IVariableBinding binding= (IVariableBinding)((Name)leftHandSide).resolveBinding();
+ if (binding != null && (!binding.isField() || Modifier.isStatic(binding.getModifiers()))) {
+ node.getRightHandSide().accept(this);
+ }
+ } else {
+ fNeedBindings = true;
+ }
+ }
+ }
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.Block)
+ */
+ public boolean visit(Block node) {
+ if (visit(node, false)) {
+ if (node.statements().isEmpty() && node.getParent().getNodeType() == ASTNode.METHOD_DECLARATION) {
+ // in case of an empty method, set the breakpoint on the last line of the empty block.
+ fLineLocation= lineNumber(node.getStartPosition() + node.getLength() - 1);
+ fLocationFound= true;
+ fLocationType= LOCATION_LINE;
+ fTypeName= computeTypeName(node);
+ return false;
+ }
+ return true;
+ }
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.BlockComment)
+ */
+ public boolean visit(BlockComment node) {
+ return false;
+ }
+
+ /**
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.BooleanLiteral)
+ */
+ public boolean visit(BooleanLiteral node) {
+ return visit(node, true);
+ }
+
+ /**
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.BreakStatement)
+ */
+ public boolean visit(BreakStatement node) {
+ return visit(node, true);
+ }
+
+ /**
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.CastExpression)
+ */
+ public boolean visit(CastExpression node) {
+ return visit(node, true);
+ }
+
+ /**
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.CatchClause)
+ */
+ public boolean visit(CatchClause node) {
+ return visit(node, false);
+ }
+
+ /**
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.CharacterLiteral)
+ */
+ public boolean visit(CharacterLiteral node) {
+ return visit(node, true);
+ }
+
+ /**
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.ClassInstanceCreation)
+ */
+ public boolean visit(ClassInstanceCreation node) {
+ return visit(node, true);
+ }
+
+ /**
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.CompilationUnit)
+ */
+ public boolean visit(CompilationUnit node) {
+ return visit(node, false);
+ }
+
+ /**
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.ConditionalExpression)
+ */
+ public boolean visit(ConditionalExpression node) {
+ return visit(node, true);
+ }
+
+ /**
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.ConstructorInvocation)
+ */
+ public boolean visit(ConstructorInvocation node) {
+ return visit(node, true);
+ }
+
+ /**
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.ContinueStatement)
+ */
+ public boolean visit(ContinueStatement node) {
+ return visit(node, true);
+ }
+
+ /**
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.DoStatement)
+ */
+ public boolean visit(DoStatement node) {
+ return visit(node, false);
+ }
+
+ /**
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.EmptyStatement)
+ */
+ public boolean visit(EmptyStatement node) {
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.EnhancedForStatement)
+ */
+ public boolean visit(EnhancedForStatement node) {
+ if (visit(node, false)) {
+ node.getExpression().accept(this);
+ node.getBody().accept(this);
+ }
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.EnumConstantDeclaration)
+ */
+ public boolean visit(EnumConstantDeclaration node) {
+ if (visit(node, false)) {
+ List arguments= node.arguments();
+ for (Iterator iter= arguments.iterator(); iter.hasNext();) {
+ ((Expression)iter.next()).accept(this);
+ }
+ AnonymousClassDeclaration decl= node.getAnonymousClassDeclaration();
+ if (decl != null) {
+ decl.accept(this);
+ }
+ }
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.EnumDeclaration)
+ */
+ public boolean visit(EnumDeclaration node) {
+ if (visit(node, false)) {
+ List enumConstants= node.enumConstants();
+ for (Iterator iter = enumConstants.iterator(); iter.hasNext();) {
+ ((EnumConstantDeclaration) iter.next()).accept(this);
+ }
+ List bodyDeclaration= node.bodyDeclarations();
+ for (Iterator iter= bodyDeclaration.iterator(); iter.hasNext();) {
+ ((BodyDeclaration)iter.next()).accept(this);
+ }
+ }
+ return false;
+ }
+
+ /**
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.ExpressionStatement)
+ */
+ public boolean visit(ExpressionStatement node) {
+ return visit(node, false);
+ }
+
+ /**
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.FieldAccess)
+ */
+ public boolean visit(FieldAccess node) {
+ return visit(node, false);
+ }
+
+ /**
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.FieldDeclaration)
+ */
+ public boolean visit(FieldDeclaration node) {
+ if (visit(node, false)) {
+ if (fBestMatch) {
+ // check if the line contains a single field declaration.
+ List fragments = node.fragments();
+ if (fragments.size() == 1) {
+ int offset= ((VariableDeclarationFragment)fragments.get(0)).getName().getStartPosition();
+ // check if the breakpoint is to be set on the line which contains the name of the field
+ if (lineNumber(offset) == fLineNumber) {
+ fMemberOffset= offset;
+ fLocationType= LOCATION_FIELD;
+ fLocationFound= true;
+ return false;
+ }
+ }
+ }
+ // visit only the variable declaration fragments, no the variable names.
+ List fragments= node.fragments();
+ for (Iterator iter= fragments.iterator(); iter.hasNext();) {
+ ((VariableDeclarationFragment)iter.next()).accept(this);
+ }
+ }
+ return false;
+ }
+
+ /**
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.ForStatement)
+ */
+ public boolean visit(ForStatement node) {
+ // in case on a "for(;;)", the breakpoint can be set on the first token of the node.
+ return visit(node, node.initializers().isEmpty() && node.getExpression() == null && node.updaters().isEmpty());
+ }
+
+ /**
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.IfStatement)
+ */
+ public boolean visit(IfStatement node) {
+ return visit(node, false);
+ }
+
+ /**
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.ImportDeclaration)
+ */
+ public boolean visit(ImportDeclaration node) {
+ return false;
+ }
+
+ /**
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.InfixExpression)
+ */
+ public boolean visit(InfixExpression node) {
+ // if the breakpoint is to be set on a constant operand, the breakpoint needs to be
+ // set on the first constant operand after the previous non-constant operand
+ // (or the beginning of the expression, if there is no non-constant operand before).
+ // ex: foo() + // previous non-constant operand
+ // 1 + // breakpoint set here
+ // 2 // breakpoint asked to be set here
+ if (visit(node, false)) {
+ Expression leftOperand= node.getLeftOperand();
+ Expression firstConstant= null;
+ if (visit(leftOperand, false)) {
+ leftOperand.accept(this);
+ return false;
+ }
+ if (isReplacedByConstantValue(leftOperand)) {
+ firstConstant= leftOperand;
+ }
+ Expression rightOperand= node.getRightOperand();
+ if (visit(rightOperand, false)) {
+ if (firstConstant == null || !isReplacedByConstantValue(rightOperand)) {
+ rightOperand.accept(this);
+ return false;
+ }
+ } else {
+ if (isReplacedByConstantValue(rightOperand)) {
+ if (firstConstant == null) {
+ firstConstant= rightOperand;
+ }
+ } else {
+ firstConstant= null;
+ }
+ List extendedOperands= node.extendedOperands();
+ for (Iterator iter= extendedOperands.iterator(); iter.hasNext();) {
+ Expression operand= (Expression) iter.next();
+ if (visit(operand, false)) {
+ if (firstConstant == null || !isReplacedByConstantValue(operand)) {
+ operand.accept(this);
+ return false;
+ }
+ break;
+ }
+ if (isReplacedByConstantValue(operand)) {
+ if (firstConstant == null) {
+ firstConstant= operand;
+ }
+ } else {
+ firstConstant= null;
+ }
+
+ }
+ }
+ fLineLocation= lineNumber(firstConstant.getStartPosition());
+ fLocationFound= true;
+ fLocationType= LOCATION_LINE;
+ fTypeName= computeTypeName(firstConstant);
+ }
+ return false;
+ }
+
+ /**
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.Initializer)
+ */
+ public boolean visit(Initializer node) {
+ return visit(node, false);
+ }
+
+ /**
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.InstanceofExpression)
+ */
+ public boolean visit(InstanceofExpression node) {
+ return visit(node, true);
+ }
+
+ /**
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.Javadoc)
+ */
+ public boolean visit(Javadoc node) {
+ return false;
+ }
+
+ /**
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.LabeledStatement)
+ */
+ public boolean visit(LabeledStatement node) {
+ nestLabel(node.getLabel().getFullyQualifiedName());
+ return visit(node, false);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#endVisit(org.eclipse.jdt.core.dom.LabeledStatement)
+ */
+ public void endVisit(LabeledStatement node) {
+ popLabel();
+ super.endVisit(node);
+ }
+
+ private String getLabel() {
+ if (fLabels == null || fLabels.isEmpty()) {
+ return null;
+ }
+ return (String) fLabels.get(fLabels.size() - 1);
+ }
+
+ private void nestLabel(String label) {
+ if (fLabels == null) {
+ fLabels = new ArrayList();
+ }
+ fLabels.add(label);
+ }
+
+ private void popLabel() {
+ if (fLabels == null || fLabels.isEmpty()) {
+ return;
+ }
+ fLabels.remove(fLabels.size() - 1);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.LineComment)
+ */
+ public boolean visit(LineComment node) {
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.MarkerAnnotation)
+ */
+ public boolean visit(MarkerAnnotation node) {
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.MemberRef)
+ */
+ public boolean visit(MemberRef node) {
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.MemberValuePair)
+ */
+ public boolean visit(MemberValuePair node) {
+ return false;
+ }
+
+ /**
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.MethodDeclaration)
+ */
+ public boolean visit(MethodDeclaration node) {
+ if (visit(node, false)) {
+ if (fBestMatch) {
+ // check if we are on the line which contains the method name
+ int nameOffset= node.getName().getStartPosition();
+ if (lineNumber(nameOffset) == fLineNumber) {
+ fMemberOffset= nameOffset;
+ fLocationType= LOCATION_METHOD;
+ fLocationFound= true;
+ return false;
+ }
+ }
+ // visit only the body
+ Block body = node.getBody();
+ if (body != null) { // body is null for abstract methods
+ body.accept(this);
+ }
+ }
+ return false;
+ }
+
+ /**
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.MethodInvocation)
+ */
+ public boolean visit(MethodInvocation node) {
+ return visit(node, true);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.MethodRef)
+ */
+ public boolean visit(MethodRef node) {
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.MethodRefParameter)
+ */
+ public boolean visit(MethodRefParameter node) {
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.Modifier)
+ */
+ public boolean visit(Modifier node) {
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.NormalAnnotation)
+ */
+ public boolean visit(NormalAnnotation node) {
+ return false;
+ }
+
+ /**
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.NullLiteral)
+ */
+ public boolean visit(NullLiteral node) {
+ return visit(node, true);
+ }
+
+ /**
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.NumberLiteral)
+ */
+ public boolean visit(NumberLiteral node) {
+ return visit(node, true);
+ }
+
+ /**
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.PackageDeclaration)
+ */
+ public boolean visit(PackageDeclaration node) {
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.ParameterizedType)
+ */
+ public boolean visit(ParameterizedType node) {
+ return false;
+ }
+
+ /**
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.ParenthesizedExpression)
+ */
+ public boolean visit(ParenthesizedExpression node) {
+ return visit(node, false);
+ }
+
+ /**
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.PostfixExpression)
+ */
+ public boolean visit(PostfixExpression node) {
+ return visit(node, true);
+ }
+
+ /**
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.PrefixExpression)
+ */
+ public boolean visit(PrefixExpression node) {
+ if (visit(node, false)) {
+ if (isReplacedByConstantValue(node)) {
+ fLineLocation= lineNumber(node.getStartPosition());
+ fLocationFound= true;
+ fLocationType= LOCATION_LINE;
+ fTypeName= computeTypeName(node);
+ return false;
+ }
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.PrimitiveType)
+ */
+ public boolean visit(PrimitiveType node) {
+ return false;
+ }
+
+ /**
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.QualifiedName)
+ */
+ public boolean visit(QualifiedName node) {
+ visit(node, true);
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.QualifiedType)
+ */
+ public boolean visit(QualifiedType node) {
+ return false;
+ }
+
+ /**
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.ReturnStatement)
+ */
+ public boolean visit(ReturnStatement node) {
+ return visit(node, true);
+ }
+
+ /**
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.SimpleName)
+ */
+ public boolean visit(SimpleName node) {
+ // the name is only code if its not the current label (if any)
+ return visit(node, !node.getFullyQualifiedName().equals(getLabel()));
+ }
+
+ /**
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.SimpleType)
+ */
+ public boolean visit(SimpleType node) {
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.SingleMemberAnnotation)
+ */
+ public boolean visit(SingleMemberAnnotation node) {
+ return false;
+ }
+
+ /**
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.SingleVariableDeclaration)
+ */
+ public boolean visit(SingleVariableDeclaration node) {
+ return visit(node, false);
+ }
+
+ /**
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.StringLiteral)
+ */
+ public boolean visit(StringLiteral node) {
+ return visit(node, true);
+ }
+
+ /**
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.SuperConstructorInvocation)
+ */
+ public boolean visit(SuperConstructorInvocation node) {
+ return visit(node, true);
+ }
+
+ /**
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.SuperFieldAccess)
+ */
+ public boolean visit(SuperFieldAccess node) {
+ return visit(node, true);
+ }
+
+ /**
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.SuperMethodInvocation)
+ */
+ public boolean visit(SuperMethodInvocation node) {
+ return visit(node, true);
+ }
+
+ /**
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.SwitchCase)
+ */
+ public boolean visit(SwitchCase node) {
+ return false;
+ }
+
+ /**
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.SwitchStatement)
+ */
+ public boolean visit(SwitchStatement node) {
+ return visit(node, false);
+ }
+
+ /**
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.SynchronizedStatement)
+ */
+ public boolean visit(SynchronizedStatement node) {
+ return visit(node, false);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.TagElement)
+ */
+ public boolean visit(TagElement node) {
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.TextElement)
+ */
+ public boolean visit(TextElement node) {
+ return false;
+ }
+
+ /**
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.ThisExpression)
+ */
+ public boolean visit(ThisExpression node) {
+ return visit(node, true);
+ }
+
+ /**
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.ThrowStatement)
+ */
+ public boolean visit(ThrowStatement node) {
+ return visit(node, true);
+ }
+
+ /**
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.TryStatement)
+ */
+ public boolean visit(TryStatement node) {
+ return visit(node, false);
+ }
+
+ /**
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.TypeDeclaration)
+ */
+ public boolean visit(TypeDeclaration node) {
+ if (visit(node, false)) {
+ // visit only the elements of the type declaration
+ List bodyDeclaration= node.bodyDeclarations();
+ for (Iterator iter= bodyDeclaration.iterator(); iter.hasNext();) {
+ ((BodyDeclaration)iter.next()).accept(this);
+ }
+ }
+ return false;
+ }
+
+ /**
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.TypeDeclarationStatement)
+ */
+ public boolean visit(TypeDeclarationStatement node) {
+ return visit(node, false);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.TypeParameter)
+ */
+ public boolean visit(TypeParameter node) {
+ return false;
+ }
+
+ /**
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.TypeLiteral)
+ */
+ public boolean visit(TypeLiteral node) {
+ return false;
+ }
+
+ /**
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.VariableDeclarationExpression)
+ */
+ public boolean visit(VariableDeclarationExpression node) {
+ return visit(node, false);
+ }
+
+ /**
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.VariableDeclarationFragment)
+ */
+ public boolean visit(VariableDeclarationFragment node) {
+ Expression initializer = node.getInitializer();
+ if (visit(node, false) && initializer != null) {
+ int startLine = lineNumber(node.getName().getStartPosition());
+
+ if (fLineNumber == startLine) {
+ fLineLocation= startLine;
+ fLocationFound= true;
+ fLocationType= LOCATION_LINE;
+ fTypeName= computeTypeName(node);
+ return false;
+ }
+ initializer.accept(this);
+ }
+ return false;
+ }
+
+ private int lineNumber(int offset) {
+ int lineNumber = fCompilationUnit.getLineNumber(offset);
+ return lineNumber < 1 ? 1 : lineNumber;
+ }
+
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.WildcardType)
+ */
+ public boolean visit(WildcardType node) {
+ return false;
+ }
+
+ /**
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.VariableDeclarationStatement)
+ */
+ public boolean visit(VariableDeclarationStatement node) {
+ return visit(node, false);
+ }
+
+ /**
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.WhileStatement)
+ */
+ public boolean visit(WhileStatement node) {
+ return visit(node, false);
+ }
+
+//{ObjectTeams: visit also ot-specific nodes or skip some
+
+ public boolean visit(GuardPredicateDeclaration node) {
+ // visit only the expression (don't want a method-entry breakpoint but stop directly at the expression).
+ ASTNode expression = node.getExpression();
+ expression.accept(this);
+ return false;
+ }
+
+ public boolean visit(CallinMappingDeclaration node)
+ {
+ return visit(node, false);
+ }
+
+ public boolean visit(CalloutMappingDeclaration node)
+ {
+ return visit(node, false);
+ }
+
+ public boolean visit(FieldAccessSpec node)
+ {
+ return visit(node, false);
+ }
+
+ public boolean visit(LiftingType node)
+ {
+ return false;
+ }
+
+ public boolean visit(TypeAnchor node)
+ {
+ return false;
+ }
+
+ public boolean visit(MethodSpec node)
+ {
+ return visit(node, false);
+ }
+
+ public boolean visit(ParameterMapping node)
+ {
+ return false;
+ }
+
+ public boolean visit(RoleTypeDeclaration node)
+ {
+ if (visit(node, false)) {
+ // guards first: appear before body declarations:
+ GuardPredicateDeclaration guard = node.getGuardPredicate();
+ if (guard != null)
+ guard.accept(this);
+ // visit only the elements of the type declaration
+ List bodyDeclaration= node.bodyDeclarations();
+ for (Iterator iter= bodyDeclaration.iterator(); iter.hasNext();) {
+ ((BodyDeclaration)iter.next()).accept(this);
+ }
+ }
+ return false;
+ }
+
+ public boolean visit(WithinStatement node)
+ {
+ return visit(node, false);
+ }
+//ike}
+}
+//ike}
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/actions/SortTeamAction.java b/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/actions/SortTeamAction.java
new file mode 100644
index 000000000..f91a469dc
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/actions/SortTeamAction.java
@@ -0,0 +1,89 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute and Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: SortTeamAction.java 23432 2010-02-03 23:13:42Z stephan $
+ *
+ * Please visit http://www.objectteams.org for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.debug.ui.internal.actions;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.objectteams.otdt.debug.IOTDTDebugPreferenceConstants;
+import org.eclipse.objectteams.otdt.debug.OTDebugElementsContainer;
+import org.eclipse.objectteams.otdt.debug.ui.OTDebugImages;
+import org.eclipse.objectteams.otdt.debug.ui.views.TeamView;
+import org.eclipse.objectteams.otdt.debug.ui.views.TeamViewMessages;
+
+/**
+ * @author ike
+ * This Action sorts the teams in TeamMonitor.
+ *
+ * $Id: SortTeamAction.java 23432 2010-02-03 23:13:42Z stephan $
+ */
+public class SortTeamAction extends Action
+{
+ private TeamView _teamView;
+ private String _sortMode;
+
+ public SortTeamAction(TeamView teamView, String sortMode)
+ {
+ super("", AS_RADIO_BUTTON); //$NON-NLS-1$
+
+ if (sortMode == IOTDTDebugPreferenceConstants.TEAMS_BY_ACTIVATION_TIME)
+ {
+ setText(TeamViewMessages.SortTeamByActivation_0);
+ setImageDescriptor(OTDebugImages.get(OTDebugImages.SORT_TEAMS_BY_ACTIVATION_TIME));
+ }
+
+ if (sortMode == IOTDTDebugPreferenceConstants.TEAMS_BY_ACTIVATION_ORDER)
+ {
+ setText(TeamViewMessages.SortTeamByActivation_1);
+ setImageDescriptor(OTDebugImages.get(OTDebugImages.SORT_TEAMS_BY_ACTIVATION_ORDER));
+ }
+
+ if (sortMode == IOTDTDebugPreferenceConstants.TEAMS_BY_INSTANTIATION)
+ {
+ setText(TeamViewMessages.SortTeamByInstantiation_0);
+ setImageDescriptor(OTDebugImages.get(OTDebugImages.SORT_TEAMS_BY_INSTANTIATION));
+ }
+
+ if (sortMode == IOTDTDebugPreferenceConstants.TEAMS_BY_NAME)
+ {
+ setText(TeamViewMessages.SortTeamByName_0);
+ setImageDescriptor(OTDebugImages.get(OTDebugImages.SORT_TEAMS_BY_NAME));
+ }
+
+ _teamView = teamView;
+ _sortMode = sortMode;
+ setChecked(sortMode == _teamView.getDefaultSortMode());
+ }
+
+ public void run()
+ {
+ if (isChecked())
+ {
+ _teamView.setSortMode(getSortMode());
+ OTDebugElementsContainer container = (OTDebugElementsContainer)_teamView.getViewer().getInput();
+ container.setSortMode(getSortMode());
+ _teamView.getViewer().setInput(container);
+ }
+ }
+
+ private String getSortMode()
+ {
+ return _sortMode;
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/actions/UpdateTeamViewAction.java b/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/actions/UpdateTeamViewAction.java
new file mode 100644
index 000000000..0eb143c0c
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/actions/UpdateTeamViewAction.java
@@ -0,0 +1,51 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute and Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: UpdateTeamViewAction.java 23432 2010-02-03 23:13:42Z stephan $
+ *
+ * Please visit http://www.objectteams.org for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.debug.ui.internal.actions;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.objectteams.otdt.debug.OTDebugElementsContainer;
+import org.eclipse.objectteams.otdt.debug.ui.OTDebugImages;
+import org.eclipse.objectteams.otdt.debug.ui.views.TeamView;
+
+public class UpdateTeamViewAction extends Action
+{
+ private TeamView _teamView;
+
+ public UpdateTeamViewAction(TeamView teamView)
+ {
+ super("", AS_CHECK_BOX);
+ setToolTipText("Permanently update Team Monitor");
+ setDescription("Shows teams and their activation state while the application is running.");
+ setImageDescriptor(OTDebugImages.get(OTDebugImages.UPDATE_TEAM_VIEW_ACTION));
+ _teamView = teamView;
+ }
+
+ @Override
+ public void run()
+ {
+ _teamView.setUpdatePermanently(isChecked());
+ OTDebugElementsContainer container = (OTDebugElementsContainer)_teamView.getViewer().getInput();
+ if(isChecked())
+ {
+ _teamView.getViewer().setInput(container);
+ }
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/model/OTDebugElementsContainerContentProvider.java b/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/model/OTDebugElementsContainerContentProvider.java
new file mode 100644
index 000000000..827ca92bc
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/model/OTDebugElementsContainerContentProvider.java
@@ -0,0 +1,78 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2003, 2007 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute and Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: OTDebugElementsContainerContentProvider.java 23432 2010-02-03 23:13:42Z stephan $
+ *
+ * Please visit http://www.objectteams.org for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.debug.ui.internal.model;
+
+import java.util.ArrayList;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.internal.ui.model.elements.ElementContentProvider;
+import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
+import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate;
+import org.eclipse.objectteams.otdt.debug.OTDebugElementsContainer;
+import org.eclipse.objectteams.otdt.debug.TeamInstance;
+import org.eclipse.objectteams.otdt.debug.ui.OTDebugUIPlugin;
+
+/**
+ * Provide top level nodes for the TeamView:
+ * + team instances from an OTDebugElementsContainer
+ *
+ * @author stephan
+ * @since 1.1.2
+ */
+public class OTDebugElementsContainerContentProvider extends ElementContentProvider
+{
+
+ @Override
+ protected int getChildCount(Object element,
+ IPresentationContext context,
+ IViewerUpdate monitor)
+ throws CoreException
+ {
+ OTDebugElementsContainer container = (OTDebugElementsContainer) element;
+ return container.getChildCount();
+ }
+
+ @Override
+ protected Object[] getChildren(Object parent,
+ int index,
+ int length,
+ IPresentationContext context,
+ IViewerUpdate monitor)
+ throws CoreException
+ {
+ OTDebugElementsContainer container = (OTDebugElementsContainer) parent;
+ if(container.hasTeamInstances())
+ {
+ ArrayList<TeamInstance> teamInstances = container.getTeamInstances();
+ Object[] result= new Object[length];
+ for (int i=0; i<length; i++)
+ result[i]= teamInstances.get(index+i);
+ return result;
+ }
+ return null;
+
+ }
+
+ @Override
+ protected boolean supportsContextId(String id) {
+ return id.equals(OTDebugUIPlugin.TEAM_VIEW_ID);
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/model/OTDebugElementsContainerLabelProvider.java b/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/model/OTDebugElementsContainerLabelProvider.java
new file mode 100644
index 000000000..c9b63edd2
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/model/OTDebugElementsContainerLabelProvider.java
@@ -0,0 +1,40 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2003, 2007 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute and Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: OTDebugElementsContainerLabelProvider.java 23432 2010-02-03 23:13:42Z stephan $
+ *
+ * Please visit http://www.objectteams.org for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.debug.ui.internal.model;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.internal.ui.model.elements.ElementLabelProvider;
+import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
+import org.eclipse.jface.viewers.TreePath;
+
+/** Label for the root node of the TeamView (which does not have a label). */
+public class OTDebugElementsContainerLabelProvider extends ElementLabelProvider {
+
+ @Override
+ protected String getLabel(TreePath elementPath,
+ IPresentationContext presentationContext,
+ String columnId)
+ throws CoreException
+ {
+ return "never-seen-OTDebugLabel"; //$NON-NLS-1$
+ }
+
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/model/OTDefaultModelProxyFactory.java b/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/model/OTDefaultModelProxyFactory.java
new file mode 100644
index 000000000..9e825ab76
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/model/OTDefaultModelProxyFactory.java
@@ -0,0 +1,48 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2003, 2007 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute and Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: OTDefaultModelProxyFactory.java 23432 2010-02-03 23:13:42Z stephan $
+ *
+ * Please visit http://www.objectteams.org for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.debug.ui.internal.model;
+
+import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelProxy;
+import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
+import org.eclipse.debug.internal.ui.viewers.update.DefaultModelProxyFactory;
+import org.eclipse.objectteams.otdt.debug.OTDebugElementsContainer;
+import org.eclipse.objectteams.otdt.debug.ui.OTDebugUIPlugin;
+
+/**
+ * Install OTDefaultVariableViewModelProxy.
+ *
+ * @author stephan
+ * @since 1.1.2
+ */
+public class OTDefaultModelProxyFactory extends DefaultModelProxyFactory
+{
+ @Override
+ public IModelProxy createModelProxy(Object element, IPresentationContext context)
+ {
+ String id= context.getId();
+ if (OTDebugUIPlugin.TEAM_VIEW_ID.equals(id)) {
+ if (element instanceof OTDebugElementsContainer)
+ return new OTDefaultVariableViewModelProxy((OTDebugElementsContainer)element);
+ }
+ return super.createModelProxy(element, context);
+ }
+
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/model/OTDefaultVariableViewModelProxy.java b/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/model/OTDefaultVariableViewModelProxy.java
new file mode 100644
index 000000000..04584b4e9
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/model/OTDefaultVariableViewModelProxy.java
@@ -0,0 +1,90 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2003, 2007 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute and Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: OTDefaultVariableViewModelProxy.java 23432 2010-02-03 23:13:42Z stephan $
+ *
+ * Please visit http://www.objectteams.org for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.debug.ui.internal.model;
+
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta;
+import org.eclipse.debug.internal.ui.viewers.model.provisional.ModelDelta;
+import org.eclipse.debug.internal.ui.viewers.provisional.AbstractModelProxy;
+import org.eclipse.objectteams.otdt.debug.IOTDebugEventListener;
+import org.eclipse.objectteams.otdt.debug.OTDebugElementsContainer;
+import org.eclipse.objectteams.otdt.debug.OTDebugPlugin;
+import org.eclipse.objectteams.otdt.debug.TeamInstance;
+
+/**
+ * This class mediates between the model and its view:
+ *
+ * + Receive triggers from TeamBreakpointListener (via IOTDebugEventListener)
+ * + Create and fire ModelDelta events (received by TreeModelContentProvider)
+ *
+ * Installation:
+ * + TreeModelContentProvider.inputChanged()->installModelProxy()
+ * -> makes TreeModelContentProvider an fListener (modelChangedListener) of this
+ *
+ *
+ * @author stephan
+ * @since 1.1.2
+ */
+public class OTDefaultVariableViewModelProxy
+ extends AbstractModelProxy
+ implements IOTDebugEventListener
+{
+
+ private OTDebugElementsContainer container;
+
+ public OTDefaultVariableViewModelProxy(OTDebugElementsContainer debugElementsContainer) {
+ super();
+ this.container= debugElementsContainer;
+ OTDebugPlugin.getDefault().addOTDebugEventListener(this);
+ }
+
+ public void launched(ILaunch launch) {
+ // TODO Auto-generated method stub
+ }
+
+ public void teamInstantiated(TeamInstance newTeam)
+ {
+ int idx= container.getIndexOfTeamInstance(newTeam);
+ ModelDelta delta= new ModelDelta(container, IModelDelta.NO_CHANGE);
+ delta.addNode(newTeam, idx, IModelDelta.INSERTED);
+ fireModelChanged(delta);
+ }
+
+ public void teamDisposed(int idx) {
+ ModelDelta delta= new ModelDelta(container, IModelDelta.NO_CHANGE);
+ delta.addNode(null, idx, IModelDelta.REMOVED);
+ fireModelChanged(delta);
+ }
+
+ public void activationStateChanged(TeamInstance teamInstance)
+ {
+ int idx= container.getIndexOfTeamInstance(teamInstance);
+ ModelDelta delta= new ModelDelta(container, IModelDelta.NO_CHANGE);
+ delta.addNode(teamInstance, idx, IModelDelta.STATE);
+ fireModelChanged(delta);
+ }
+
+ @Override
+ public synchronized void dispose() {
+ super.dispose();
+ OTDebugPlugin.getDefault().removeOTDebugEventListener(this);
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/model/OTVariableColumnFactoryAdapter.java b/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/model/OTVariableColumnFactoryAdapter.java
new file mode 100644
index 000000000..bca3f62f6
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/model/OTVariableColumnFactoryAdapter.java
@@ -0,0 +1,64 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2003, 2007 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute and Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: OTVariableColumnFactoryAdapter.java 23432 2010-02-03 23:13:42Z stephan $
+ *
+ * Please visit http://www.objectteams.org for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.debug.ui.internal.model;
+
+import org.eclipse.debug.internal.ui.elements.adapters.VariableColumnPresentation;
+import org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentation;
+import org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentationFactory;
+import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
+import org.eclipse.objectteams.otdt.debug.OTDebugElementsContainer;
+import org.eclipse.objectteams.otdt.debug.ui.OTDebugUIPlugin;
+
+/**
+ * Factory for default variable column presentation.
+ * (from VariableColumnFactoryAdaptor (since 3.2))
+ *
+ * @since 1.1.2
+ */
+public class OTVariableColumnFactoryAdapter implements IColumnPresentationFactory {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.internal.ui.viewers.provisional.IColumnPresenetationFactoryAdapter#createColumnPresentation(org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext, java.lang.Object)
+ */
+ public IColumnPresentation createColumnPresentation(IPresentationContext context, Object element) {
+ String id = context.getId();
+ if (OTDebugUIPlugin.TEAM_VIEW_ID.equals(id)) {
+ if (element instanceof OTDebugElementsContainer) {
+ return new VariableColumnPresentation();
+ }
+ }
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.internal.ui.viewers.provisional.IColumnPresenetationFactoryAdapter#getColumnPresentationId(org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext, java.lang.Object)
+ */
+ public String getColumnPresentationId(IPresentationContext context, Object element) {
+ String id = context.getId();
+ if (OTDebugUIPlugin.TEAM_VIEW_ID.equals(id)) {
+ if (element instanceof OTDebugElementsContainer) {
+ return VariableColumnPresentation.DEFAULT_VARIABLE_COLUMN_PRESENTATION;
+ }
+ }
+ return null;
+ }
+
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/model/TeamInstanceContentProvider.java b/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/model/TeamInstanceContentProvider.java
new file mode 100644
index 000000000..3892b2954
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/model/TeamInstanceContentProvider.java
@@ -0,0 +1,41 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2003, 2007 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute and Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: TeamInstanceContentProvider.java 23432 2010-02-03 23:13:42Z stephan $
+ *
+ * Please visit http://www.objectteams.org for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.debug.ui.internal.model;
+
+import org.eclipse.debug.internal.ui.model.elements.VariableContentProvider;
+import org.eclipse.objectteams.otdt.debug.ui.OTDebugUIPlugin;
+
+/**
+ * Content provider for the fields of a team instance.
+ * Sole purpose compared to its superclass: make it applicable to the TeamView, too.
+ *
+ * Note, that filtering takes place within the debug.adaptor.VariablesViewAdaptor.
+ *
+ * @author stephan
+ * @since 1.1.2
+ */
+public class TeamInstanceContentProvider extends VariableContentProvider
+{
+ @Override
+ protected boolean supportsContextId(String id) {
+ return id.equals(OTDebugUIPlugin.TEAM_VIEW_ID);
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/model/TeamInstanceLabelProvider.java b/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/model/TeamInstanceLabelProvider.java
new file mode 100644
index 000000000..befa3b328
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/model/TeamInstanceLabelProvider.java
@@ -0,0 +1,99 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2003, 2007 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute and Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: TeamInstanceLabelProvider.java 23432 2010-02-03 23:13:42Z stephan $
+ *
+ * Please visit http://www.objectteams.org for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.debug.ui.internal.model;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.model.IVariable;
+import org.eclipse.debug.internal.ui.elements.adapters.VariableColumnPresentation;
+import org.eclipse.debug.internal.ui.model.elements.VariableLabelProvider;
+import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.TreePath;
+import org.eclipse.objectteams.otdt.debug.OTDebugElementsContainer;
+import org.eclipse.objectteams.otdt.debug.TeamInstance;
+import org.eclipse.objectteams.otdt.debug.ui.OTDebugImages;
+
+/**
+ * Labels (text/image) for team instances in the TeamView.
+ *
+ * @author stephan
+ * @since 1.1.2
+ */
+public class TeamInstanceLabelProvider extends VariableLabelProvider
+{
+ @Override
+ protected String getLabel(TreePath elementPath, IPresentationContext context, String columnId)
+ throws CoreException
+ {
+//{ObjecgtTeams: new implementation, re-using only getColumnText():
+ Object element = elementPath.getLastSegment();
+ if (element instanceof TeamInstance) {
+ IVariable variable= (IVariable) element;
+ if (isNameColumn(columnId))
+ return variable.getReferenceTypeName();
+ else
+ return getColumnText(variable, variable.getValue(), context, columnId);
+ }
+ return "<unknown element>"; //$NON-NLS-1$ // should never be seen
+// SH}
+ }
+ @Override
+ protected ImageDescriptor getImageDescriptor(
+ TreePath elementPath, IPresentationContext presentationContext, String columnId)
+ throws CoreException
+ {
+ // completely new implementation for the OTDT:
+ if (isNameColumn(columnId)) {
+ TeamInstance teamInstance = (TeamInstance) elementPath.getLastSegment();
+ OTDebugElementsContainer _otDebugElementsContainer = (OTDebugElementsContainer) teamInstance.getLaunch().getAdapter(OTDebugElementsContainer.class);
+
+ if (_otDebugElementsContainer != null && _otDebugElementsContainer.getTeamInstance(teamInstance) != null)
+ {
+ int activationState = teamInstance.getActivationState(_otDebugElementsContainer.getContext());
+ return getImageForState(activationState);
+ }
+
+ //DefaultImage for Teams is inactive-Image
+ return getImageForState(0);
+ }
+ return null;
+ }
+
+ private boolean isNameColumn(String columnId) {
+ return columnId == null
+ || VariableColumnPresentation.COLUMN_VARIABLE_NAME.equals(columnId);
+ }
+
+ private ImageDescriptor getImageForState(int activationState)
+ {
+ switch (activationState)
+ {
+ case TeamInstance.IS_INACTIVE:
+ return OTDebugImages.get(OTDebugImages.TEAM_INACTIVATED);
+ case TeamInstance.IS_IMPLICITACTIVE:
+ return OTDebugImages.get(OTDebugImages.TEAM_IMPLICIT_ACTIVATED);
+ case TeamInstance.IS_ACTIVE:
+ return OTDebugImages.get(OTDebugImages.TEAM_ACTIVATED);
+ default:
+ return OTDebugImages.get(OTDebugImages.TEAM_INACTIVATED);
+ }
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/preferences/OTDebugPreferencePage.java b/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/preferences/OTDebugPreferencePage.java
new file mode 100644
index 000000000..654d6fec3
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/preferences/OTDebugPreferencePage.java
@@ -0,0 +1,214 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute and Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: OTDebugPreferencePage.java 23432 2010-02-03 23:13:42Z stephan $
+ *
+ * Please visit http://www.objectteams.org for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.debug.ui.internal.preferences;
+
+import static org.eclipse.objectteams.otdt.debug.ui.internal.preferences.OTDebugPreferences.CALLIN_STEPPING_TOKENS;
+import static org.eclipse.objectteams.otdt.debug.ui.internal.preferences.OTDebugPreferences.DEBUG_CALLIN_STEPPING;
+import static org.eclipse.objectteams.otdt.debug.ui.internal.preferences.OTDebugPreferences.DEBUG_FILTERS_ENABLED_BOOL;
+import static org.eclipse.objectteams.otdt.debug.ui.internal.preferences.OTDebugPreferences.OT_GENERATED_CODE_COLOR;
+import static org.eclipse.objectteams.otdt.debug.ui.internal.preferences.OTDebugPreferences.OT_SPECIAL_CODE_COLOR;
+
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.debug.internal.ui.SWTFactory;
+import org.eclipse.debug.internal.ui.preferences.BooleanFieldEditor2;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.preference.ColorFieldEditor;
+import org.eclipse.jface.preference.FieldEditorPreferencePage;
+import org.eclipse.jface.preference.IPreferencePage;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferenceManager;
+import org.eclipse.jface.preference.PreferenceNode;
+import org.eclipse.objectteams.otdt.debug.ui.OTDebugUIPlugin;
+import org.eclipse.objectteams.otdt.debug.ui.internal.preferences.OTDebugPreferences;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.eclipse.ui.internal.Workbench;
+
+/**
+ * @author gis, stephan
+ */
+public class OTDebugPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage
+{
+ private static final String JAVA_STEP_FILTER_PREFERENCE_PAGE = "org.eclipse.jdt.debug.ui.JavaStepFilterPreferencePage"; //$NON-NLS-1$
+
+ protected boolean _debugFiltersEnabled;
+
+ private Composite _parentComposite;
+ private ColorFieldEditor fGeneratedCodeColorFieldEditor;
+ private ColorFieldEditor fSpecialCodeColorFieldEditor;
+ private BooleanFieldEditor2 fDebugFilter;
+ /** sync with {@link OTDebugPreferences#CALLIN_STEPPING_TOKENS}: */
+ private String[] callinLabels = {OTDebugPreferencesMessages.OTDebugPreferencePage_callin_step_role_label,
+ OTDebugPreferencesMessages.OTDebugPreferencePage_callin_step_recurse_label,
+ OTDebugPreferencesMessages.OTDebugPreferencePage_callin_step_base_label};
+
+ public OTDebugPreferencePage()
+ {
+ super(GRID);
+ setTitle(OTDebugPreferencesMessages.OTDebugPreferencePage_title);
+ }
+
+ public void createControl(Composite parent)
+ {
+ super.createControl(parent);
+ _parentComposite = parent;
+ }
+
+ protected IPreferenceStore doGetPreferenceStore()
+ {
+ return OTDebugUIPlugin.getDefault().getPreferenceStore();
+ }
+
+ protected void createFieldEditors()
+ {
+ // container group:
+ Composite groupAll= new Composite(getFieldEditorParent(), SWT.NONE);
+ GridLayout layout= new GridLayout();
+ layout.marginHeight= convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
+ layout.marginWidth= 0;
+ layout.verticalSpacing= convertVerticalDLUsToPixels(10);
+ layout.horizontalSpacing= convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
+ groupAll.setLayout(layout);
+
+ // block 1 group: stack frame filtering:
+ Group group = new Group(groupAll, SWT.NONE);
+ group.setLayout(new GridLayout());
+ group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ group.setText(OTDebugPreferencesMessages.OTDebugPreferencePage_enable_filter_title);
+
+ fDebugFilter = new BooleanFieldEditor2(DEBUG_FILTERS_ENABLED_BOOL,
+ OTDebugPreferencesMessages.OTDebugPreferencePage_enableFilter_label,
+ SWT.NONE, group);
+ addField(fDebugFilter);
+ fDebugFilter.getChangeControl(groupAll).addSelectionListener(new SelectionListener() {
+ public void widgetDefaultSelected(SelectionEvent e) { }
+ public void widgetSelected(SelectionEvent e) {
+ setDebugFiltersEnabled(fDebugFilter.getBooleanValue());
+ }
+ });
+
+ // block 2 group: stack frame coloring:
+ group = new Group(groupAll, SWT.NONE);
+ group.setLayout(new GridLayout());
+ group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ group.setText(OTDebugPreferencesMessages.OTDebugPreferencePage_stackFrameColoringGroup_label);
+
+ Composite spacer = SWTFactory.createComposite(group, 2, 1, GridData.FILL_HORIZONTAL);
+ fGeneratedCodeColorFieldEditor = new ColorFieldEditor(OT_GENERATED_CODE_COLOR,
+ OTDebugPreferencesMessages.OTDebugPreferencePage_colorGeneratedCode_label,
+ spacer);
+ fGeneratedCodeColorFieldEditor.fillIntoGrid(spacer, 2);
+ addField(fGeneratedCodeColorFieldEditor);
+
+ fSpecialCodeColorFieldEditor = new ColorFieldEditor(OT_SPECIAL_CODE_COLOR,
+ OTDebugPreferencesMessages.OTDebugPreferencePage_colorSpecialCode_label,
+ spacer);
+ fSpecialCodeColorFieldEditor.fillIntoGrid(spacer, 2);
+ addField(fSpecialCodeColorFieldEditor);
+
+ // block 3 group: callin dispatch visualization:
+ group = new Group(groupAll, SWT.NONE);
+ group.setLayout(new GridLayout());
+ group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ group.setText(OTDebugPreferencesMessages.OTDebugPreferencePage_callin_stepping_title);
+
+ for (int i=0; i<CALLIN_STEPPING_TOKENS.length; i++) {
+ final String token = CALLIN_STEPPING_TOKENS[i];
+ final BooleanFieldEditor2 editor = new BooleanFieldEditor2(DEBUG_CALLIN_STEPPING+token,
+ this.callinLabels[i],
+ SWT.NONE, group);
+ addField(editor);
+ editor.getChangeControl(group).addSelectionListener(new SelectionListener() {
+ public void widgetDefaultSelected(SelectionEvent e) { }
+ public void widgetSelected(SelectionEvent e) {
+ OTDebugPreferences.setCallinStepping(token, editor.getBooleanValue());
+ }
+ });
+ }
+ Label description= new Label(group, SWT.LEFT | SWT.WRAP);
+ Font font = description.getFont();
+ FontData[] data = font.getFontData();
+ data[0].setStyle(SWT.ITALIC);
+ description.setFont(new Font(font.getDevice(), data[0]));
+ description.setText(OTDebugPreferencesMessages.OTDebugPreferencePage_callin_stepping_hint);
+ description.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, true, false, 0, 1));
+
+ }
+
+ protected void performDefaults()
+ {
+ OTDebugPreferences.propagateFilterFlag(getPreferenceStore());
+ super.performDefaults();
+ }
+
+ /////////////// HACK synchronizing with JDT Debug step filter configuration
+
+ private void setDebugFiltersEnabled(boolean enable)
+ {
+ if (_debugFiltersEnabled == enable)
+ return;
+
+ _debugFiltersEnabled = enable;
+
+ OTDebugPreferences.setUseOTStepFilters(enable);
+ updateStepFilteringPrefPage();
+ }
+
+ private void updateStepFilteringPrefPage()
+ {
+ List prefs = Workbench.getInstance().getPreferenceManager().getElements(PreferenceManager.PRE_ORDER);
+ for (Iterator iter = prefs.iterator(); iter.hasNext();)
+ {
+ PreferenceNode node = (PreferenceNode) iter.next();
+ if(node.getId().indexOf(JAVA_STEP_FILTER_PREFERENCE_PAGE) != -1)
+ {
+ forcePreferencePageRecreation(node);
+ }
+ }
+ }
+
+ private void forcePreferencePageRecreation(PreferenceNode node)
+ {
+ IPreferencePage oldPage = node.getPage();
+ if (oldPage != null)
+ {
+ node.setPage(null);
+ node.createPage();
+ node.getPage().createControl(_parentComposite);
+
+ oldPage.dispose();
+ }
+ }
+
+ public void init(IWorkbench workbench) { }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/preferences/OTDebugPreferences.java b/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/preferences/OTDebugPreferences.java
new file mode 100644
index 000000000..542a34b91
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/preferences/OTDebugPreferences.java
@@ -0,0 +1,160 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute and Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: OTDebugPreferences.java 23435 2010-02-04 00:14:38Z stephan $
+ *
+ * Please visit http://www.objectteams.org for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.debug.ui.internal.preferences;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
+import org.eclipse.debug.internal.core.StepFilterManager;
+import org.eclipse.debug.internal.ui.DebugUIPlugin;
+import org.eclipse.jdt.internal.debug.ui.IJDIPreferencesConstants;
+import org.eclipse.jdt.internal.debug.ui.JDIDebugUIPlugin;
+import org.eclipse.jdt.internal.debug.ui.JavaDebugOptionsManager;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferenceConverter;
+import org.eclipse.objectteams.otdt.debug.OTDebugPlugin;
+import org.eclipse.objectteams.otdt.debug.ui.OTDebugUIPlugin;
+import org.eclipse.swt.graphics.RGB;
+
+/**
+ * @author gis
+ */
+public class OTDebugPreferences extends AbstractPreferenceInitializer {
+
+ // preference keys:
+ public final static String OT_GENERATED_CODE_COLOR = "org.eclipse.objectteams.otdt.debug.ui.OtGeneratedCodeColor"; //$NON-NLS-1$
+ public final static String OT_SPECIAL_CODE_COLOR = "org.eclipse.objectteams.otdt.debug.ui.OtSpecialCodeColor"; //$NON-NLS-1$
+ public static final String DEBUG_FILTERS_ENABLED_BOOL = "prefs.ot.debugfilters.enabled"; //$NON-NLS-1$
+
+ // key is the first constant plugs one of the tokens:
+ public static final String DEBUG_CALLIN_STEPPING = "org.eclipse.objectteams.otdt.debug.ui.OtCallinStepping."; // need to append token //$NON-NLS-1$
+ public static final String[] CALLIN_STEPPING_TOKENS = {"role", "recurse", "orig"}; //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
+ // special value:
+ public static final String CALLIN_STEPPING_NONE = "none"; //$NON-NLS-1$
+
+ public static final String[] STEP_FILTER_PACKAGES =
+ {
+ "de.fub.bytecode.*", //$NON-NLS-1$
+ "gnu.regexp.*", //$NON-NLS-1$
+ "org.eclipse.objectteams.otre", //$NON-NLS-1$
+ "org.eclipse.objectteams.otre.jplis", //$NON-NLS-1$
+ "org.eclipse.objectteams.otre.util" //$NON-NLS-1$
+ };
+
+ @Override
+ public void initializeDefaultPreferences() {
+ IPreferenceStore prefs = OTDebugUIPlugin.getDefault().getPreferenceStore();
+
+ PreferenceConverter.setDefault(prefs, OTDebugPreferences.OT_GENERATED_CODE_COLOR, new RGB(182, 182, 209));
+ PreferenceConverter.setDefault(prefs, OTDebugPreferences.OT_SPECIAL_CODE_COLOR, new RGB(24, 152, 16));
+
+ prefs.setDefault(OTDebugPreferences.DEBUG_FILTERS_ENABLED_BOOL, true);
+
+ for (String token : CALLIN_STEPPING_TOKENS)
+ prefs.setDefault(OTDebugPreferences.DEBUG_CALLIN_STEPPING+token, true);
+ }
+
+ public static void propagateFilterFlag(IPreferenceStore prefs)
+ {
+ setUseOTStepFilters(prefs.getBoolean(DEBUG_FILTERS_ENABLED_BOOL));
+ }
+
+ public static void setUseOTStepFilters(boolean enable)
+ {
+ IPreferenceStore jdiDebugStore = JDIDebugUIPlugin.getDefault().getPreferenceStore();
+ IPreferenceStore debugUIStore = DebugUIPlugin.getDefault().getPreferenceStore();
+
+ String stepFilterPackages = jdiDebugStore.getString(IJDIPreferencesConstants.PREF_ACTIVE_FILTERS_LIST);
+ String newStepFilterPackages;
+ if (enable)
+ {
+ newStepFilterPackages = addOTStepFilters(stepFilterPackages);
+ }
+ else
+ {
+ newStepFilterPackages = removeOTStepFilters(stepFilterPackages);
+ }
+
+ debugUIStore.setValue(StepFilterManager.PREF_USE_STEP_FILTERS, enable);
+ jdiDebugStore.setValue(IJDIPreferencesConstants.PREF_ACTIVE_FILTERS_LIST, newStepFilterPackages);
+ jdiDebugStore.setValue(IJDIPreferencesConstants.PREF_FILTER_SYNTHETICS, enable);
+ }
+
+ private static String addOTStepFilters(String values)
+ {
+ List result = new ArrayList();
+ String[] origEntries = JavaDebugOptionsManager.parseList(values);
+ for (int i = 0; i < origEntries.length; i++)
+ result.add(origEntries[i]);
+
+ String[] entriesToAdd = OTDebugPreferences.STEP_FILTER_PACKAGES;
+
+ for (int i = 0; i < entriesToAdd.length; i++)
+ {
+ String entryToAdd = entriesToAdd[i];
+ if (!result.contains(entryToAdd))
+ result.add(entryToAdd);
+ }
+
+ return JavaDebugOptionsManager.serializeList((String[])result.toArray(new String[result.size()]));
+ }
+
+ private static String removeOTStepFilters(String values)
+ {
+ String[] entriesToRemove = OTDebugPreferences.STEP_FILTER_PACKAGES;
+ Arrays.sort(entriesToRemove);
+ String[] orig = JavaDebugOptionsManager.parseList(values);
+ List result = new ArrayList(entriesToRemove.length);
+
+ for (int i = 0; i < orig.length; i++)
+ {
+ String origValue = orig[i];
+ if (Arrays.binarySearch(entriesToRemove, origValue) < 0)
+ result.add(origValue);
+ }
+
+ return JavaDebugOptionsManager.serializeList((String[])result.toArray(new String[result.size()]));
+ }
+ /** Propagate callin stepping configuration down to the org.eclipse.objectteams.otdt.debug plugin. */
+ public static void setCallinStepping(String token, boolean value) {
+ IPreferenceStore prefs = OTDebugUIPlugin.getDefault().getPreferenceStore();
+ prefs.setValue(DEBUG_CALLIN_STEPPING+token, value);
+ OTDebugPlugin.getDefault().setCallinSteppingConfig(getCallinSteppingString());
+ }
+
+ public static String getCallinSteppingString() {
+ IPreferenceStore prefs = OTDebugUIPlugin.getDefault().getPreferenceStore();
+ String callinStepping = null;
+ for (String token : CALLIN_STEPPING_TOKENS) {
+ if (prefs.getBoolean(DEBUG_CALLIN_STEPPING+token)) {
+ if (callinStepping == null)
+ callinStepping = token;
+ else
+ callinStepping = callinStepping + ',' +token;
+ }
+ }
+ if (callinStepping == null)
+ callinStepping = CALLIN_STEPPING_NONE;
+ return callinStepping;
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/preferences/OTDebugPreferencesMessages.java b/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/preferences/OTDebugPreferencesMessages.java
new file mode 100644
index 000000000..69530f0a8
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/preferences/OTDebugPreferencesMessages.java
@@ -0,0 +1,45 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute and Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: OTDebugPreferencesMessages.java 23432 2010-02-03 23:13:42Z stephan $
+ *
+ * Please visit http://www.objectteams.org for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.debug.ui.internal.preferences;
+
+import org.eclipse.osgi.util.NLS;
+
+public class OTDebugPreferencesMessages extends NLS {
+ private static final String BUNDLE_NAME = "org.eclipse.objectteams.otdt.debug.ui.internal.preferences.OTDebugPreferencesMessages"; //$NON-NLS-1$
+ public static String OTDebugPreferencePage_title;
+ public static String OTDebugPreferencePage_enable_filter_title;
+ public static String OTDebugPreferencePage_enableFilter_label;
+ public static String OTDebugPreferencePage_stackFrameColoringGroup_label;
+ public static String OTDebugPreferencePage_colorGeneratedCode_label;
+ public static String OTDebugPreferencePage_colorSpecialCode_label;
+ public static String OTDebugPreferencePage_callin_stepping_title;
+ public static String OTDebugPreferencePage_callin_step_base_label;
+ public static String OTDebugPreferencePage_callin_step_recurse_label;
+ public static String OTDebugPreferencePage_callin_step_role_label;
+ public static String OTDebugPreferencePage_callin_stepping_hint;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, OTDebugPreferencesMessages.class);
+ }
+
+ private OTDebugPreferencesMessages() {
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/preferences/OTDebugPreferencesMessages.properties b/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/preferences/OTDebugPreferencesMessages.properties
new file mode 100644
index 000000000..fa738c533
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/internal/preferences/OTDebugPreferencesMessages.properties
@@ -0,0 +1,11 @@
+OTDebugPreferencePage_title=Debug
+OTDebugPreferencePage_enable_filter_title=Stack frame filtering
+OTDebugPreferencePage_enableFilter_label=Hide stack frames of the Object Teams Runtime Environment
+OTDebugPreferencePage_stackFrameColoringGroup_label=Displaying OT/J-specific stack frames
+OTDebugPreferencePage_colorGeneratedCode_label=generated code
+OTDebugPreferencePage_colorSpecialCode_label=special OT/J code (method bindings etc.)
+OTDebugPreferencePage_callin_stepping_title=Visualization of callin dispatch
+OTDebugPreferencePage_callin_step_base_label=Show pending dispatch to original base method
+OTDebugPreferencePage_callin_step_recurse_label=Show pending recursive dispatch
+OTDebugPreferencePage_callin_step_role_label=Show pending dispatch to callin binding
+OTDebugPreferencePage_callin_stepping_hint=Unchecked steps will be skipped, the debugger will automatically step into the next action.
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/views/TeamView.java b/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/views/TeamView.java
new file mode 100644
index 000000000..22c95a4c9
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/views/TeamView.java
@@ -0,0 +1,286 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2003, 2007 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute and Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: TeamView.java 23432 2010-02-03 23:13:42Z stephan $
+ *
+ * Please visit http://www.objectteams.org for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ * IBM Corporation - copies of individual methods from super class.
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.debug.ui.views;
+
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.ILaunchesListener2;
+import org.eclipse.debug.core.model.IDebugElement;
+import org.eclipse.debug.core.model.IDebugTarget;
+import org.eclipse.debug.core.model.IStackFrame;
+import org.eclipse.debug.core.model.IThread;
+import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta;
+import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelProxy;
+import org.eclipse.debug.internal.ui.viewers.model.provisional.TreeModelViewer;
+import org.eclipse.debug.internal.ui.views.variables.VariablesView;
+import org.eclipse.debug.ui.IDebugUIConstants;
+import org.eclipse.jdt.debug.core.IJavaThread;
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.objectteams.otdt.debug.IOTDTDebugPreferenceConstants;
+import org.eclipse.objectteams.otdt.debug.OTDebugElementsContainer;
+import org.eclipse.objectteams.otdt.debug.ui.OTDebugUIPlugin;
+import org.eclipse.objectteams.otdt.debug.ui.internal.actions.ChangeTeamActivationAction;
+import org.eclipse.objectteams.otdt.debug.ui.internal.actions.SortTeamAction;
+import org.eclipse.objectteams.otdt.debug.ui.internal.actions.UpdateTeamViewAction;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IActionBars;
+
+/**
+ * The TeamView aka "Team Monitor" for observing instantiation
+ * and (de)activation of teams.
+ *
+ * This class was originally developed against Eclipse <= 3.2.
+ * For changes in VariablesView see
+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=153500
+ *
+ * @author gis
+ *
+ * $Id: TeamView.java 23432 2010-02-03 23:13:42Z stephan $
+ */
+public class TeamView extends VariablesView implements ILaunchesListener2
+{
+ private static final String ACTION_ACTIVATE_TEAM = "ActivateTeam"; //$NON-NLS-1$
+ private static final String ACTION_DEACTIVATE_TEAM = "DeactivateTeam"; //$NON-NLS-1$
+ private static final String ACTION_UPDATE_TEAMVIEW = "action.update.teamview"; //$NON-NLS-1$
+ private String _sortMode;
+ private boolean _updatePermantently = false;
+
+ private static boolean DEBUG= false;
+
+ public TeamView()
+ {
+ DebugPlugin.getDefault().getLaunchManager().addLaunchListener(this);
+ _sortMode = getDefaultSortMode();
+ }
+
+ @Override
+ protected String getPresentationContextId() {
+ return OTDebugUIPlugin.TEAM_VIEW_ID;
+ }
+
+ public String getDefaultSortMode()
+ {
+ return IOTDTDebugPreferenceConstants.TEAMS_BY_ACTIVATION_ORDER;
+ }
+
+ @Override // COPY_AND_PASTE from super, edited:
+ public void contextActivated(ISelection selection)
+ {
+ if (DEBUG) System.out.println("TV: contextActivated: "+selection); //$NON-NLS-1$
+
+ if (!isAvailable() || !isVisible()) {
+ return;
+ }
+
+ if (selection instanceof IStructuredSelection) {
+//ObjectTeams: if there are multiselected DebugElements - show nothing
+ IStructuredSelection structuredSelection = (IStructuredSelection)selection;
+ if(structuredSelection.size() == 1)
+ // orig:
+ setViewerInput(structuredSelection.getFirstElement());
+ // :giro
+ else
+ setViewerInput(null);
+// carp+SH}
+ }
+ showViewer();
+
+ updateAction(VARIABLES_FIND_ELEMENT_ACTION);
+ updateAction(FIND_ACTION);
+ }
+
+ @Override // COPY_AND_PASTE from super, edited:
+ protected void setViewerInput(Object context)
+ {
+ if (DEBUG) System.out.println("TV: setViewerInput: "+context); //$NON-NLS-1$
+
+//{ObjectTeams
+ if(!isSuspended(context) && !_updatePermantently)
+ return;
+// SH}
+
+ if (context == null) {
+ // Clear the detail pane
+//{ObjectTeams: workaround invisible field fDetailPane:
+ /* orig:
+ fDetailPane.display(null);
+ :giro */
+ refreshDetailPaneContents();
+// SH}
+ }
+
+ Object current= getViewer().getInput();
+
+ if (current == null && context == null) {
+ return;
+ }
+
+//{ObjectTeams:
+ boolean hasContextChanged= false;
+ if ((context instanceof IStackFrame) || (context instanceof IThread) || (context instanceof IDebugTarget))
+ {
+ ILaunch launch = ((IDebugElement)context).getLaunch();
+ OTDebugElementsContainer newInput = (OTDebugElementsContainer) launch.getAdapter(OTDebugElementsContainer.class);
+ if (newInput != null) { // null for non-OT launches!
+ hasContextChanged= newInput.setContext((IDebugElement)context);
+ newInput.setSortMode(_sortMode);
+ context= newInput;
+ }
+ }
+// SH}
+ // OT: first condition added:
+ if (!hasContextChanged && current != null && current.equals(context)) {
+ return;
+ }
+
+ showViewer();
+ getViewer().setInput(context);
+ }
+
+ private boolean isSuspended(Object context)
+ {
+ if (context instanceof OTDebugElementsContainer)
+ return ((OTDebugElementsContainer)context).isSuspended();
+ return true;
+ }
+
+ public IJavaThread getSelectedThread() {
+ Object input= getViewer().getInput();
+ if (input instanceof OTDebugElementsContainer)
+ return ((OTDebugElementsContainer)input).getContextThread();
+ return null; // no input!
+ }
+
+ @Override
+ public void modelChanged(IModelDelta delta, IModelProxy proxy) {
+ throw new RuntimeException("TeamView.modelChanged() should not be called"); //$NON-NLS-1$
+ }
+
+ public void launchesTerminated(ILaunch[] launches)
+ {
+ //clear TeamView
+ ;
+ }
+
+ public void launchesRemoved(ILaunch[] launches) {}
+ public void launchesAdded(ILaunch[] launches) {}
+ public void launchesChanged(ILaunch[] launches) {}
+
+ public void dispose()
+ {
+ DebugPlugin.getDefault().getLaunchManager().removeLaunchListener(this);
+ super.dispose();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.ui.AbstractDebugView#createViewer(Composite)
+ */
+ public Viewer createViewer(Composite parent)
+ {
+ TreeModelViewer variablesViewer = (TreeModelViewer) super.createViewer(parent);
+ variablesViewer.removeModelChangedListener(this); // only register the proxy.
+ return variablesViewer;
+ }
+
+ protected void createActions()
+ {
+ super.createActions();
+ IActionBars actionBars = getViewSite().getActionBars();
+ IMenuManager viewMenu = actionBars.getMenuManager();
+ createSortActions(viewMenu);
+ // button:
+ setAction(ACTION_UPDATE_TEAMVIEW, new UpdateTeamViewAction(this));
+
+ setAction(ACTION_ACTIVATE_TEAM, new ChangeTeamActivationAction(this, true));
+ setAction(ACTION_DEACTIVATE_TEAM, new ChangeTeamActivationAction(this, false));
+ }
+
+ private void createSortActions(IMenuManager viewMenu)
+ {
+ final SortTeamAction sortAction1 = new SortTeamAction(this, IOTDTDebugPreferenceConstants.TEAMS_BY_ACTIVATION_ORDER);
+ final SortTeamAction sortAction2 = new SortTeamAction(this, IOTDTDebugPreferenceConstants.TEAMS_BY_ACTIVATION_TIME);
+ final SortTeamAction sortAction3 = new SortTeamAction(this, IOTDTDebugPreferenceConstants.TEAMS_BY_INSTANTIATION);
+ final SortTeamAction sortAction4 = new SortTeamAction(this, IOTDTDebugPreferenceConstants.TEAMS_BY_NAME);
+
+ final MenuManager layoutSubMenu = new MenuManager(TeamViewMessages.TeamView_0);
+ layoutSubMenu.setRemoveAllWhenShown(true);
+ layoutSubMenu.add(sortAction1);
+ layoutSubMenu.add(sortAction2);
+ layoutSubMenu.add(sortAction3);
+ layoutSubMenu.add(sortAction4);
+ viewMenu.add(layoutSubMenu);
+ viewMenu.add(new Separator());
+
+ layoutSubMenu.addMenuListener(new IMenuListener()
+ {
+ public void menuAboutToShow(IMenuManager manager)
+ {
+ layoutSubMenu.add(sortAction1);
+ layoutSubMenu.add(sortAction2);
+ layoutSubMenu.add(sortAction3);
+ layoutSubMenu.add(sortAction4);
+ }
+ });
+ }
+
+ @Override
+ protected void fillContextMenu(IMenuManager menu) {
+ super.fillContextMenu(menu);
+ menu.add(getAction(ACTION_ACTIVATE_TEAM));
+ menu.add(getAction(ACTION_DEACTIVATE_TEAM));
+ }
+
+ protected String getToggleActionLabel()
+ {
+ return TeamViewMessages.TeamView_1;
+ }
+
+ public void setSortMode(String sortMode)
+ {
+ _sortMode = sortMode;
+ }
+
+ protected void configureToolBar(IToolBarManager tbm)
+ {
+ super.configureToolBar(tbm);
+ tbm.add(new Separator(IDebugUIConstants.EMPTY_REGISTER_GROUP));
+ tbm.add(new Separator(IDebugUIConstants.REGISTER_GROUP));
+ tbm.add(getAction(ACTION_UPDATE_TEAMVIEW));
+ }
+
+ public void setUpdatePermanently(boolean updatePermanently)
+ {
+ _updatePermantently = updatePermanently;
+
+ //by default clear viewer
+ if(!updatePermanently)
+ setViewerInput(null);
+
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/views/TeamViewMessages.java b/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/views/TeamViewMessages.java
new file mode 100644
index 000000000..43327776a
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/views/TeamViewMessages.java
@@ -0,0 +1,52 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute and Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: TeamViewMessages.java 23432 2010-02-03 23:13:42Z stephan $
+ *
+ * Please visit http://www.objectteams.org for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.debug.ui.views;
+
+import org.eclipse.osgi.util.NLS;
+
+public class TeamViewMessages extends NLS
+{
+ private static final String BUNDLE_NAME = "org.eclipse.objectteams.otdt.debug.ui.views.TeamViewMessages"; //$NON-NLS-1$
+
+ public static String SortTeamByName_0;
+
+ public static String SortTeamByActivation_0;
+
+ public static String SortTeamByActivation_1;
+
+ public static String SortTeamByInstantiation_0;
+
+ public static String SortTeamDescription_0;
+
+ public static String TeamView_0;
+
+ public static String TeamView_1;
+
+ static
+ {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, TeamViewMessages.class);
+ }
+
+ private TeamViewMessages()
+ {
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/views/TeamViewMessages.properties b/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/views/TeamViewMessages.properties
new file mode 100644
index 000000000..4c3538cdf
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug.ui/src/org/eclipse/objectteams/otdt/debug/ui/views/TeamViewMessages.properties
@@ -0,0 +1,28 @@
+###############################################################################
+ # This file is part of "Object Teams Development Tooling"-Software
+ #
+ # Copyright 2004, 2005, 2006 Fraunhofer Gesellschaft, Munich, Germany,
+ # for its Fraunhofer Institute and Computer Architecture and Software
+ # Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ # Germany.
+ #
+ # All rights reserved. This program and the accompanying materials
+ # are made available under the terms of the Eclipse Public License v1.0
+ # which accompanies this distribution, and is available at
+ # http://www.eclipse.org/legal/epl-v10.html
+ # $Id: AspectBundleRole.java 14430 2006-09-23 12:06:21Z stephan $
+ #
+ # Please visit http://www.objectteams.org for updates and contact.
+ #
+ # Contributors:
+ # Fraunhofer FIRST - Initial API and implementation
+ # Technical University Berlin - Initial API and implementation
+ ###############################################################################
+
+TeamView_0=Sort Teams
+TeamView_1=Team View Only
+SortTeamByName_0=Sort Teams by Name
+SortTeamByActivation_0=Sort Teams by Activation Time
+SortTeamByActivation_1=Sort Teams by Activation Order
+SortTeamByInstantiation_0=Sort Teams by Instantiation Time
+SortTeamDescription_0=By Default Teams are sorted by Activation Order.
diff --git a/plugins/org.eclipse.objectteams.otdt.debug/.classpath b/plugins/org.eclipse.objectteams.otdt.debug/.classpath
new file mode 100644
index 000000000..304e86186
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <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.objectteams.otdt.debug/.cvsignore b/plugins/org.eclipse.objectteams.otdt.debug/.cvsignore
new file mode 100644
index 000000000..ba077a403
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug/.cvsignore
@@ -0,0 +1 @@
+bin
diff --git a/plugins/org.eclipse.objectteams.otdt.debug/.project b/plugins/org.eclipse.objectteams.otdt.debug/.project
new file mode 100644
index 000000000..0cca0d46d
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.objectteams.otdt.debug</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.objectteams.otdt.debug/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.objectteams.otdt.debug/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..6305acaa3
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,57 @@
+#Tue Sep 18 18:19:36 CEST 2007
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+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=ignore
+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=ignore
+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=warning
+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.objectteams.otdt.debug/META-INF/MANIFEST.MF b/plugins/org.eclipse.objectteams.otdt.debug/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..37af2cbdb
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug/META-INF/MANIFEST.MF
@@ -0,0 +1,19 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: OTDebug Plug-in
+Bundle-SymbolicName: org.eclipse.objectteams.otdt.debug;singleton:=true
+Bundle-Version: 1.4.0.qualifier
+Bundle-Activator: org.eclipse.objectteams.otdt.debug.OTDebugPlugin
+Bundle-Vendor: Fraunhofer FIRST
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.debug.core,
+ org.eclipse.jdt.debug,
+ org.eclipse.jdt.launching,
+ org.eclipse.jdt.core,
+ org.eclipse.core.resources,
+ org.eclipse.objectteams.otdt
+Bundle-ActivationPolicy: lazy
+Export-Package: org.eclipse.objectteams.otdt.debug,
+ org.eclipse.objectteams.otdt.debug.core.breakpoints,
+ org.eclipse.objectteams.otdt.debug.internal
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/plugins/org.eclipse.objectteams.otdt.debug/build.properties b/plugins/org.eclipse.objectteams.otdt.debug/build.properties
new file mode 100644
index 000000000..0c93900ea
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug/build.properties
@@ -0,0 +1,8 @@
+source.. = src/
+output.. = bin/
+bin.includes = plugin.xml,\
+ META-INF/,\
+ .
+src.includes = .project,\
+ .classpath,\
+ build.properties
diff --git a/plugins/org.eclipse.objectteams.otdt.debug/scripts/genIOOTBreakPoints.launch b/plugins/org.eclipse.objectteams.otdt.debug/scripts/genIOOTBreakPoints.launch
new file mode 100644
index 000000000..814e92138
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug/scripts/genIOOTBreakPoints.launch
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.ui.externaltools.ProgramLaunchConfigurationType">
+<stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${working_set:&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;resources&gt;&#10;&lt;item path=&quot;/org.eclipse.objectteams.otdt.debug&quot; type=&quot;4&quot;/&gt;&#10;&lt;/resources&gt;}"/>
+<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
+<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
+<listEntry value="org.eclipse.ui.externaltools.launchGroup"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LAUNCH_CONFIGURATION_BUILD_SCOPE" value="${none}"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/org.eclipse.objectteams.otdt.debug/scripts/genIOOTBreakPoints.sh}"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="${project_loc:OTRE}"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/org.eclipse.objectteams.otdt.debug}"/>
+</launchConfiguration>
diff --git a/plugins/org.eclipse.objectteams.otdt.debug/scripts/genIOOTBreakPoints.sh b/plugins/org.eclipse.objectteams.otdt.debug/scripts/genIOOTBreakPoints.sh
new file mode 100644
index 000000000..0b700bdc0
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug/scripts/genIOOTBreakPoints.sh
@@ -0,0 +1,86 @@
+#!/bin/sh
+#
+# This script is inteded to be invoked from within eclipse
+# using the launch configuration genIOOTBreakPoints.launch
+# in the same directory.
+# Prerequisite:
+# You must have the project OTRE within the same workspace.
+#
+# author: stephan@cs.tu-berlin.de
+
+
+# Let's identify ourselves:
+CWD=`pwd`
+PROG=`echo $0 | sed "s|${CWD}/||"`
+
+HEADER="/**********************************************************************
+ * This file is part of \"Object Teams Development Tooling\"-Software
+ *
+ * Copyright 2006, 2010 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * \$Id\$
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.debug.core.breakpoints;
+
+/**
+ * Do not edit: This interface is auto-generated from org/objectteams/Team.java
+ * using ${PROG}
+ *
+ * Purpose: make specific line numbers of Team.java available for the debugger.
+ */
+public interface IOOTBreakPoints
+{"
+
+
+# INPUT:
+OTRE=$1
+if [ ! -d ${OTRE} ]; then
+ echo "Project root of OTRE not found at ${OTRE}".
+ echo "Perhaps you don't have project OTRE in your workspace?"
+ exit
+fi
+TEAM=${OTRE}/src/org/objectteams/Team.java
+if [ ! -f ${TEAM} ]; then
+ echo "Team.java not found at ${TEAM}."
+ exit
+fi
+
+# OUTPUT:
+OUT=src/org/objectteams/otdt/debug/core/breakpoints/IOOTBreakPoints.java
+
+if [ "$2" != "RUN" ]
+then
+ # fetch stdin from Team.java, write to IOOTBreakPoints.java and restart:
+ $0 $1 RUN 0<"$TEAM" | tee $OUT
+ echo ">>>> Please refresh the source folder. <<<<"
+ exit
+else
+
+ echo "${HEADER}"
+ i=0
+ while read
+ do
+ i=`expr $i + 1`
+ l=`echo "$REPLY" | sed -e "s/^.*[$]Debug(\(.*\))/\1/"`
+ if [ "$REPLY" != "$l" ]
+ then
+ echo " int LINE_$l = $i;"
+ fi
+ done
+ echo "}"
+fi
+
+
diff --git a/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/IOTDTDebugPreferenceConstants.java b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/IOTDTDebugPreferenceConstants.java
new file mode 100644
index 000000000..59cfc620b
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/IOTDTDebugPreferenceConstants.java
@@ -0,0 +1,33 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id$
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.debug;
+
+public interface IOTDTDebugPreferenceConstants
+{
+
+ /**
+ * The sort mode for teams in Teamview
+ */
+ public static final String TEAMS_BY_NAME = "Teams.by.name"; //$NON-NLS-1$
+ public static final String TEAMS_BY_INSTANTIATION = "Teams.by.instantiation"; //$NON-NLS-1$
+ public static final String TEAMS_BY_ACTIVATION_TIME = "Teams.by.activationtime"; //$NON-NLS-1$
+ public static final String TEAMS_BY_ACTIVATION_ORDER = "Teams.by.activationorder"; //$NON-NLS-1$
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/IOTDebugEventListener.java b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/IOTDebugEventListener.java
new file mode 100644
index 000000000..6b912cee8
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/IOTDebugEventListener.java
@@ -0,0 +1,34 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: IOTDebugEventListener.java 23427 2010-02-03 22:23:59Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.debug;
+
+import org.eclipse.debug.core.ILaunch;
+
+/**
+ * @author gis
+ */
+public interface IOTDebugEventListener
+{
+ public void launched(ILaunch launch);
+ public void teamInstantiated(TeamInstance newTeam);
+ public void teamDisposed(int idx);
+ public void activationStateChanged(TeamInstance teamInstance);
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/IOTLaunchConstants.java b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/IOTLaunchConstants.java
new file mode 100644
index 000000000..26cbed332
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/IOTLaunchConstants.java
@@ -0,0 +1,43 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: IOTLaunchConstants.java 23427 2010-02-03 22:23:59Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.debug;
+
+
+/**
+ * @author resix
+ */
+public interface IOTLaunchConstants {
+ public static final String uniquePrefix = "org.eclipse.objectteams.otdt.debug"; //$NON-NLS-1$
+ /**
+ * Launch configuration attribute key. The value is a list of team names
+ * to be woven and activated automatically in this objectteams launch configuration.
+ */
+ public static final String ATTR_TEAMCONFIG_LIST = uniquePrefix + ".TEAMCONFIG_ATTR"; //$NON-NLS-1$
+
+ /**
+ * Launch configuration attribute key. The value states, if the teams in the objectteams
+ * launch configuration will be actually used while launching.
+ */
+ public static final String ATTR_TEAMCONFIG_ACTIVE = uniquePrefix + ".TEAMCONFIG_ACTIVE_ATTR"; //$NON-NLS-1$
+
+ public static final String ATTR_USE_JPLIS = uniquePrefix + ".USE_JPLIS"; //$NON-NLS-1$
+
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/OTDebugElementsContainer.java b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/OTDebugElementsContainer.java
new file mode 100644
index 000000000..7a75e4c08
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/OTDebugElementsContainer.java
@@ -0,0 +1,228 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: OTDebugElementsContainer.java 23427 2010-02-03 22:23:59Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.debug;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+
+import org.eclipse.core.internal.runtime.AdapterManager;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.debug.core.DebugException;
+import org.eclipse.debug.core.model.IDebugElement;
+import org.eclipse.debug.core.model.IDebugTarget;
+import org.eclipse.debug.core.model.IStackFrame;
+import org.eclipse.jdt.debug.core.IJavaThread;
+import org.eclipse.jdt.debug.core.IJavaVariable;
+import org.eclipse.jdt.internal.debug.core.model.JDIThisVariable;
+import org.eclipse.objectteams.otdt.debug.internal.util.TeamActivationOrderComparator;
+import org.eclipse.objectteams.otdt.debug.internal.util.TeamActivationTimeComparator;
+import org.eclipse.objectteams.otdt.debug.internal.util.TeamInstantiantionComparator;
+import org.eclipse.objectteams.otdt.debug.internal.util.TeamNameComparator;
+
+/**
+ * One instance of this class exists per launch (ensured by OTDebugElementsContainerFactory).
+ * At each point in time, each OTDebugElementsContainer also refers to a specific "context" -
+ * either of:
+ * <ul>
+ * <li> ILaunch </li>
+ * <li> IThread </li>
+ * <li> IStackFrame </li>
+ * </ul>
+ * Depending on the context of the Container a current thread can be requested (IThread/IStackFrame).
+ *
+ * A list of known team instances is maintained, which is always sorted according to the
+ * current sorting mode.
+ *
+ * @author ike
+ * $Id: OTDebugElementsContainer.java 23427 2010-02-03 22:23:59Z stephan $
+ */
+public class OTDebugElementsContainer implements IAdaptable
+{
+ private ArrayList<TeamInstance> _teamInstances = new ArrayList<TeamInstance>();
+ private IDebugElement _context;
+ private String _sortMode;
+
+ /** @category lifecycle */
+ public Object getAdapter(Class adapter)
+ {
+ return AdapterManager.getDefault().getAdapter(this, adapter);
+ }
+
+ /** @category lifecycle */
+ public IDebugElement getContext()
+ {
+ return _context;
+ }
+
+ /**
+ * @category lifecycle
+ *
+ * @param context
+ * @return true if the context actually changed (refresh needed).
+ */
+ public boolean setContext(IDebugElement context)
+ {
+ if (this._context == context)
+ return false;
+ _context = context;
+ return true;
+ }
+
+ /** @category lifecycle */
+ public void dispose()
+ {
+ _teamInstances.clear();
+ }
+
+ /** @throws DebugException
+ * @category modification */
+ public TeamInstance addTeamInstance(JDIThisVariable teamVariable)
+ throws DebugException
+ {
+ TeamInstance teamInstance = getTeamInstance(teamVariable);
+ if (teamInstance== null)
+ {
+ teamInstance = new TeamInstance(teamVariable);
+ _teamInstances.add(teamInstance);
+ sortTeamInstances();
+ }
+
+ return teamInstance;
+ }
+
+ /** @category modification */
+ public int removeTeamInstance(IJavaVariable teamVariable)
+ {
+ for (int i=0; i<this._teamInstances.size(); i++)
+ {
+ if(this._teamInstances.get(i).equals(teamVariable))
+ {
+ _teamInstances.remove(i);
+ return i;
+ }
+ }
+ return -1;
+ }
+
+ /** @category modification */
+ public void setSortMode(String sortMode)
+ {
+ String oldSortMode= _sortMode;
+ _sortMode = sortMode;
+ if (sortMode != null && !sortMode.equals(oldSortMode))
+ sortTeamInstances();
+ }
+
+ /** @category modification */
+ private void sortTeamInstances()
+ {
+ if (_sortMode == null)
+ return;
+ if(_sortMode.equals(IOTDTDebugPreferenceConstants.TEAMS_BY_ACTIVATION_TIME))
+ {
+ Collections.sort(_teamInstances, new TeamActivationTimeComparator());
+ }
+ if(_sortMode.equals(IOTDTDebugPreferenceConstants.TEAMS_BY_ACTIVATION_ORDER))
+ {
+ Collections.sort(_teamInstances, new TeamActivationOrderComparator());
+ }
+ if(_sortMode.equals(IOTDTDebugPreferenceConstants.TEAMS_BY_INSTANTIATION))
+ {
+ Collections.sort(_teamInstances, new TeamInstantiantionComparator());
+ }
+ if(_sortMode.equals(IOTDTDebugPreferenceConstants.TEAMS_BY_NAME))
+ {
+ Collections.sort(_teamInstances, new TeamNameComparator());
+ }
+ }
+
+ /** @category query */
+ public boolean hasTeamInstances()
+ {
+ return !_teamInstances.isEmpty();
+ }
+
+ /** @category query */
+ public int getChildCount() {
+ return _teamInstances.size();
+ }
+
+ /** @category query */
+ public TeamInstance getTeamInstance(IJavaVariable teamVariable)
+ {
+ for (Iterator iter = _teamInstances.iterator(); iter.hasNext();)
+ {
+ TeamInstance teamInstance = (TeamInstance) iter.next();
+ if(teamInstance.equals(teamVariable))
+ return teamInstance;
+ }
+ return null;
+ }
+
+ /** @category query */
+ public int getIndexOfTeamInstance(TeamInstance teamInstance) {
+ for (int i = 0; i < this._teamInstances.size(); i++)
+ if (this._teamInstances.get(i).equals(teamInstance))
+ return i;
+
+ return -1;
+ }
+
+ /** @category query */
+ public ArrayList<TeamInstance> getTeamInstances()
+ {
+ return _teamInstances;
+ }
+
+ /**
+ * @category query
+ *
+ * If the current context is either an IJavaThread or an IStackFrame,
+ * return the (corresponding) thread.
+ */
+ public IJavaThread getContextThread() {
+ if (this._context instanceof IJavaThread)
+ return (IJavaThread) this._context;
+ if (this._context instanceof IStackFrame)
+ return (IJavaThread)((IStackFrame) this._context).getThread();
+ return null; // no specific thread selected
+ }
+
+ /**
+ * @category query
+ *
+ * If the current context has a thread, ask whether it is suspended,
+ * otherwise ask whether some thread is suspended (by using canResume()).
+ */
+ public boolean isSuspended() {
+ IJavaThread contextThread = getContextThread();
+ if (contextThread != null && contextThread.isSuspended())
+ return true;
+ IDebugTarget target= null;
+ if (this._context instanceof IDebugTarget)
+ target = (IDebugTarget) this._context;
+ else
+ target= this._context.getDebugTarget();
+ return target.canResume();
+ }
+
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/OTDebugPlugin.java b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/OTDebugPlugin.java
new file mode 100644
index 000000000..5a76d1d57
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/OTDebugPlugin.java
@@ -0,0 +1,370 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: OTDebugPlugin.java 23427 2010-02-03 22:23:59Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.debug;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+import java.util.Vector;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Plugin;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.debug.core.DebugException;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.debug.core.ILaunchesListener2;
+import org.eclipse.jdt.internal.debug.core.JDIDebugPlugin;
+import org.eclipse.objectteams.otdt.core.exceptions.ExceptionHandler;
+import org.eclipse.objectteams.otdt.debug.internal.Logger;
+import org.eclipse.objectteams.otdt.debug.internal.OTDebugElementsContainerFactory;
+import org.eclipse.objectteams.otdt.debug.internal.RoleBreakpointListener;
+import org.eclipse.objectteams.otdt.debug.internal.StepFromLinenumberGenerator;
+import org.eclipse.objectteams.otdt.debug.internal.TeamBreakpointListener;
+import org.eclipse.objectteams.otdt.debug.internal.TempFileManager;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The main plugin class to be used in the desktop.
+ */
+public class OTDebugPlugin extends Plugin
+{
+ public static final String PLUGIN_ID = "org.eclipse.objectteams.otdt.debug"; //$NON-NLS-1$
+ public static final String OT_LAUNCH = "org.eclipse.objectteams.launch"; //$NON-NLS-1$
+ /**
+ * @deprecated reference to a removed launch configuration type.
+ */
+ public static final String OT_LAUNCH_CONFIGURATION_TYPE = "org.objectteams.otdt.debug.LaunchConfigurationType"; //$NON-NLS-1$
+
+ private OTDebugElementsContainerFactory _containerFactory;
+
+ class OTDebugLaunchManager implements ILaunchesListener2
+ {
+ private Vector<ILaunch> _otLaunches;
+
+ public OTDebugLaunchManager()
+ {
+ ILaunch[] launches = DebugPlugin.getDefault().getLaunchManager().getLaunches();
+
+ if (launches != null)
+ {
+ _otLaunches = new Vector<ILaunch>();
+ for (int i = 0; i < launches.length; i++)
+ {
+ if (isOTDebugLaunch(launches[i]))
+ _otLaunches.add(launches[i]);
+ }
+ checkOTLaunches(_otLaunches.size());
+ }
+ }
+
+ public void terminateOTLaunches()
+ {
+ // operate on a copy of _otLaunches to prevent concurrent modification
+ ILaunch[] launches = new ILaunch[_otLaunches.size()];
+ _otLaunches.copyInto(launches);
+
+ for (int i = 0; i < launches.length; i++)
+ {
+ try {
+ launches[i].terminate();
+ }
+ catch (DebugException ex) { // only log
+ OTDebugPlugin.getExceptionHandler().logCoreException("Unable to terminate launch on bundle shutdown", ex); //$NON-NLS-1$
+ }
+ }
+ }
+
+ public int getOTLaunchesCount()
+ {
+ return _otLaunches.size();
+ }
+
+ private boolean isOTDebugLaunch(ILaunch launch)
+ {
+ try
+ {
+ if (ILaunchManager.DEBUG_MODE.equals(launch.getLaunchMode())) {
+ String isOTLaunch = launch.getAttribute(OT_LAUNCH);
+ if (isOTLaunch != null && isOTLaunch.equals("true")) //$NON-NLS-1$
+ return true;
+ if (launch.getLaunchConfiguration() != null)
+ return launch.getLaunchConfiguration().getAttribute(OT_LAUNCH, false);
+ }
+ }
+ catch (CoreException ex)
+ {}
+ return false;
+ }
+
+ public void launchesAdded(ILaunch[] launches)
+ {
+ for (int idx = 0; idx < launches.length; idx++)
+ {
+ ILaunch launch = launches[idx];
+ if (isOTDebugLaunch(launch) && !_otLaunches.contains(launch))
+ {
+ _otLaunches.add(launch);
+ checkOTLaunches(_otLaunches.size());
+ }
+ }
+ }
+
+ public void launchesTerminated(ILaunch[] launches)
+ {
+ forgetOTLaunches(launches);
+ }
+
+ private void forgetOTLaunches(ILaunch[] launches)
+ {
+ for (int idx = 0; idx < launches.length; idx++)
+ {
+ ILaunch launch = launches[idx];
+ if (isOTDebugLaunch(launch) && _otLaunches.contains(launch))
+ {
+ _otLaunches.remove(launch);
+ checkOTLaunches(_otLaunches.size());
+ otLaunchFinished(launch);
+ }
+ }
+ assert(_otLaunches.size() >= 0);
+ }
+
+ //we're not interested in this
+ public void launchesRemoved(ILaunch[] launches){}
+ public void launchesChanged(ILaunch[] launches){}
+ }
+
+ private void otLaunchFinished(ILaunch launch)
+ {
+ if (_tempFileManager != null) // we're really cautious today
+ _tempFileManager.deleteTempFile(launch);
+ }
+
+ //The shared instance.
+ private static OTDebugPlugin plugin;
+ //Resource bundle.
+ private ResourceBundle resourceBundle;
+
+ private OTDebugLaunchManager _otLaunchManager;
+ private TeamBreakpointListener _otTeamBreakpointListener;
+ private RoleBreakpointListener _otRoleBreakpointListener;
+ private IOTDebugEventListener[] _listeners = new IOTDebugEventListener[0];
+ private TempFileManager _tempFileManager;
+ private StepFromLinenumberGenerator _stepGenerator;
+ private String _callinSteppingConfig = null;
+
+ public OTDebugPlugin()
+ {
+ super();
+ plugin = this;
+ try {
+ resourceBundle = ResourceBundle.getBundle("org.eclipse.objectteams.otdt.debug.OTDebugPluginResources"); //$NON-NLS-1$
+ } catch (MissingResourceException x) {
+ resourceBundle = null;
+ }
+ }
+
+ public void setCallinSteppingConfig(String config) {
+ this._callinSteppingConfig = config;
+ }
+ public String getCallinSteppingConfig() {
+ return this._callinSteppingConfig;
+ }
+
+ public static Status createErrorStatus(String message)
+ {
+ return new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, message, null);
+ }
+
+ public static Status createErrorStatus(String message, Throwable exception)
+ {
+ return new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, message, exception);
+ }
+
+ /**
+ * This method is called upon plug-in activation
+ */
+ public void start(BundleContext context) throws Exception
+ {
+ super.start(context);
+
+ _otLaunchManager = new OTDebugLaunchManager();
+ DebugPlugin.getDefault().getLaunchManager().addLaunchListener(_otLaunchManager);
+ }
+
+ /**
+ * This method is called when the plug-in is stopped
+ */
+ public void stop(BundleContext context) throws Exception
+ {
+ // when this plugin is stopped, terminate any running OT launches
+ unregisterOTDebugSupport();
+ _otLaunchManager.terminateOTLaunches();
+
+ DebugPlugin.getDefault().getLaunchManager().removeLaunchListener(_otLaunchManager);
+ _otLaunchManager = null;
+ if (_tempFileManager != null)
+ {
+ _tempFileManager.deleteAll();
+ _tempFileManager = null;
+ }
+
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance.
+ */
+ public static OTDebugPlugin getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Returns the string from the plugin's resource bundle,
+ * or 'key' if not found.
+ */
+ public static String getResourceString(String key) {
+ ResourceBundle bundle = OTDebugPlugin.getDefault().getResourceBundle();
+ try {
+ return (bundle != null) ? bundle.getString(key) : key;
+ } catch (MissingResourceException e) {
+ return key;
+ }
+ }
+
+ /**
+ * Returns the plugin's resource bundle,
+ */
+ public ResourceBundle getResourceBundle() {
+ return resourceBundle;
+ }
+
+ public static ExceptionHandler getExceptionHandler()
+ {
+ return new ExceptionHandler(PLUGIN_ID);
+ }
+
+ public TempFileManager getTempFileManager()
+ {
+ if (_tempFileManager == null)
+ _tempFileManager = new TempFileManager();
+
+ return _tempFileManager;
+ }
+
+ public IOTDebugEventListener[] getOTDebugEventListeners()
+ {
+ return _listeners;
+ }
+
+ public void addOTDebugEventListener(IOTDebugEventListener listener)
+ {
+ int newLength = _listeners.length + 1;
+ IOTDebugEventListener[] newListeners = new IOTDebugEventListener[newLength];
+ System.arraycopy(_listeners, 0, newListeners, 0, _listeners.length);
+ newListeners[_listeners.length] = listener;
+ _listeners = newListeners;
+ }
+
+ public void removeOTDebugEventListener(IOTDebugEventListener listener)
+ {
+ int occurrences = 0;
+ for (int i = 0; i < _listeners.length; i++)
+ {
+ if (listener.equals(_listeners[i]))
+ occurrences++;
+ }
+
+ if (occurrences > 0)
+ {
+ int newLength = _listeners.length - occurrences;
+ IOTDebugEventListener[] newListeners = new IOTDebugEventListener[newLength];
+
+ int insertionIndex = 0;
+ for (int i = 0; i < _listeners.length; i++)
+ {
+ if (!listener.equals(_listeners[i]))
+ newListeners[insertionIndex++] = _listeners[i];
+ }
+
+ _listeners = newListeners;
+ }
+ }
+
+ public void checkOTLaunches(int otLaunchCount)
+ {
+ // Note: the order seems to be undefined! After finishing a launch, we do not
+ // immediately get the launchRemoved event. We may first get another launchAdded
+ // and then the previous launchRemoved. So we can't rely on the counter being
+ // 0 or 1 here.
+ if (otLaunchCount <= 0)
+ {
+ unregisterOTDebugSupport();
+ }
+ else if (_otTeamBreakpointListener == null)
+ registerOTDebugSupport();
+ }
+
+ private void registerOTDebugSupport()
+ {
+ assert(_otTeamBreakpointListener == null);
+
+ _containerFactory= new OTDebugElementsContainerFactory();
+ Platform.getAdapterManager().registerAdapters(_containerFactory, ILaunch.class);
+
+ _otTeamBreakpointListener = TeamBreakpointListener.getInstance();
+ _otRoleBreakpointListener = RoleBreakpointListener.getInstance();
+ _stepGenerator = StepFromLinenumberGenerator.getInstance();
+
+ DebugPlugin.getDefault().addDebugEventFilter(_stepGenerator);
+ JDIDebugPlugin.getDefault().addJavaBreakpointListener(_otTeamBreakpointListener);
+ JDIDebugPlugin.getDefault().addJavaBreakpointListener(_otRoleBreakpointListener);
+ }
+
+ private void unregisterOTDebugSupport()
+ {
+ if (_otTeamBreakpointListener != null)
+ {
+ DebugPlugin.getDefault().removeDebugEventFilter(_stepGenerator);
+ JDIDebugPlugin.getDefault().removeJavaBreakpointListener(_otTeamBreakpointListener);
+ JDIDebugPlugin.getDefault().removeJavaBreakpointListener(_otRoleBreakpointListener);
+ try
+ {
+ TeamBreakpointInstaller.uninstallTeamBreakpoints();
+ }
+ catch (CoreException e)
+ {
+ Logger.log(0,"OTDebugPlugin.unregisterOTDebugSupport()","ERROR unable to remove Breakpoints"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ _otTeamBreakpointListener.dispose();
+ _otTeamBreakpointListener = null;
+
+ _otRoleBreakpointListener.dispose();
+ _otRoleBreakpointListener = null;
+ }
+ if (_containerFactory != null)
+ _containerFactory.dispose();
+ _containerFactory= null;
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/OTLaunchConfigMigrationDelegate.java b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/OTLaunchConfigMigrationDelegate.java
new file mode 100644
index 000000000..b289ec722
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/OTLaunchConfigMigrationDelegate.java
@@ -0,0 +1,89 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: OTLaunchConfigMigrationDelegate.java 23427 2010-02-03 22:23:59Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.debug;
+
+import java.util.HashMap;
+import java.util.TreeMap;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationMigrationDelegate;
+import org.eclipse.debug.core.ILaunchConfigurationType;
+import org.eclipse.debug.internal.core.LaunchConfiguration;
+import org.eclipse.debug.internal.core.LaunchConfigurationInfo;
+import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
+
+/**
+ * This class migrates old OT-launches (Java App, OT/Equinox FW, OTEclipse App) into regular
+ * Eclipse launches, but marked as OTlaunch, thereby enabling the OTRE, OT/Equinox, resp.
+ *
+ * @author stephan
+ * @since 1.2.2
+ */
+public class OTLaunchConfigMigrationDelegate implements ILaunchConfigurationMigrationDelegate {
+
+ final static HashMap<String,String> oldToNew = new HashMap<String, String>();
+ static {
+ oldToNew.put(OTDebugPlugin.OT_LAUNCH_CONFIGURATION_TYPE, IJavaLaunchConfigurationConstants.ID_JAVA_APPLICATION);
+ // 'referencing' constants from downstream plug-ins (old, removed launch configuration types)
+ oldToNew.put("org.objectteams.otdt.pde.ui.OTEquinoxLaunchConfigurationType", "org.eclipse.pde.ui.EquinoxLauncher"); //$NON-NLS-1$ //$NON-NLS-2$
+ oldToNew.put("org.objectteams.otdt.pde.ui.EclipseApplicationLaunchConfigurationType", "org.eclipse.pde.ui.RuntimeWorkbench"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+
+ @SuppressWarnings("nls")
+ public boolean isCandidate(ILaunchConfiguration candidate) throws CoreException {
+ String candidateType = candidate.getType().getIdentifier();
+ return candidateType.startsWith("org.objectteams.otdt")
+ && oldToNew.containsKey(candidateType);
+ }
+
+ public void migrate(final ILaunchConfiguration candidate) throws CoreException {
+ final String newId = oldToNew.get(candidate.getType().getIdentifier());
+ if (newId == null) return;
+ ILaunchConfiguration wrapper = new LaunchConfiguration(candidate.getMemento()) {
+ @Override
+ protected LaunchConfigurationInfo getInfo() throws CoreException {
+ return new LaunchConfigurationInfo() {
+ @Override
+ protected ILaunchConfigurationType getType() {
+ // revert to plain Eclipse launch type:
+ return DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationType(newId);
+ }
+ @SuppressWarnings("unchecked")
+ @Override
+ protected TreeMap getAttributes() {
+ try {
+ TreeMap orig = (TreeMap) candidate.getWorkingCopy().getAttributes();
+ // but ensure it is marked as an OT-launch:
+ orig.put(OTDebugPlugin.OT_LAUNCH, Boolean.TRUE);
+ return orig;
+ } catch (CoreException e) { /* silent. */ }
+ return new TreeMap(); // must not return null
+ }
+ };
+ }
+ };
+ wrapper.getWorkingCopy().doSave();
+ }
+
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/OTVMRunnerAdaptor.java b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/OTVMRunnerAdaptor.java
new file mode 100644
index 000000000..cc48eb624
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/OTVMRunnerAdaptor.java
@@ -0,0 +1,258 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id$
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.debug;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.PrintStream;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.launching.VMRunnerConfiguration;
+import org.eclipse.objectteams.otdt.core.ext.OTDTPlugin;
+import org.eclipse.objectteams.otdt.debug.internal.TempFileManager;
+
+
+/**
+ * @author gis
+ * @version $Id: OTLaunchConfigurationDelegate.java 11843 2006-05-09 10:36:01Z carp $
+ */
+@SuppressWarnings("nls")
+public class OTVMRunnerAdaptor
+{
+ private static final String OT_DEBUG_VMARG = "-Dot.debug";
+ private static final String OT_DEBUG_CALLIN_STEPPING_VMARG = "-Dot.debug.callin.stepping";
+ private static final String OT_TEAMCONFIG_VMARG = "-Dot.teamconfig";
+ private static List<String> JPLIS_VMARGS;
+ static {
+ JPLIS_VMARGS = new ArrayList<String>();
+ JPLIS_VMARGS.add("-Dot.otdt");
+ JPLIS_VMARGS.add("-javaagent:" + OTDTPlugin.calculateAbsoluteRuntimePath("/lib/otre_agent.jar"));
+ }
+
+ final static private boolean _useJPLIS = true;
+ private ILaunchConfiguration _launchConfig;
+ private String _mode;
+ private ILaunch _launch;
+
+ public void setAdaptationArgs(ILaunchConfiguration configuration, String mode, ILaunch launch) throws CoreException
+ {
+ _launchConfig = configuration;
+ _mode = mode;
+ _launch = launch;
+ }
+
+ public boolean usesJPLIS() {
+ return _useJPLIS;
+ }
+
+ public VMRunnerConfiguration adapt(VMRunnerConfiguration vmRunnerConfig) throws CoreException
+ {
+ adaptVMArgs(vmRunnerConfig);
+
+ return vmRunnerConfig;
+ }
+
+ protected void cloneRunner(VMRunnerConfiguration vmRunnerConfig, VMRunnerConfiguration newConfig)
+ {
+ // Only main type and class path have to be set in the constructor already
+ newConfig.setBootClassPath(vmRunnerConfig.getBootClassPath());
+ newConfig.setEnvironment(vmRunnerConfig.getEnvironment());
+ newConfig.setProgramArguments(vmRunnerConfig.getProgramArguments());
+ newConfig.setResumeOnStartup(vmRunnerConfig.isResumeOnStartup());
+ newConfig.setVMArguments(vmRunnerConfig.getVMArguments());
+ newConfig.setVMSpecificAttributesMap(vmRunnerConfig.getVMSpecificAttributesMap());
+ newConfig.setWorkingDirectory(vmRunnerConfig.getWorkingDirectory());
+ }
+
+ protected void adaptVMArgs(VMRunnerConfiguration newConfig) throws CoreException
+ {
+ List<String> otVMArgs = getOTVMArgs();
+ String teamConfigArg = generateTeamConfigArgument(_launch, _launchConfig);
+ if (teamConfigArg != null)
+ otVMArgs.add(teamConfigArg);
+ if (ILaunchManager.DEBUG_MODE.equals(_mode))
+ {
+ otVMArgs.add(OT_DEBUG_VMARG);
+
+ String callinSteppingVMArg = getCallinSteppingVMArg();
+ if (callinSteppingVMArg != null)
+ otVMArgs.add(callinSteppingVMArg);
+ }
+
+ String[] vmArgs = newConfig.getVMArguments();
+ if (vmArgs.length > 0)
+ {
+ for (int i = 0; i < vmArgs.length; i++)
+ otVMArgs.add(vmArgs[i]);
+ }
+
+ String[] newArgs = new String[otVMArgs.size()];
+
+ // new launches need to enclose file paths in quotes (cmdline is one string parsed by ArgumentParser),
+ // which are removed here (cmdline is array of strings):
+ for (int i = 0; i<newArgs.length; i++) {
+ newArgs[i] = otVMArgs.get(i).replaceAll("\"", "");
+ }
+ newConfig.setVMArguments(newArgs);
+ }
+
+ /**
+ * API version: given a list of vm arguments add ot-specific vm arguments.
+ *
+ * @param vmArguments list to be augmented.
+ * @throws CoreException
+ */
+ public void adaptVMArguments(List vmArguments) throws CoreException
+ {
+ vmArguments.addAll(getOTVMArgs());
+ String teamConfigArg = generateTeamConfigArgument(_launch, _launchConfig);
+ if (teamConfigArg != null)
+ vmArguments.add(teamConfigArg);
+ if (ILaunchManager.DEBUG_MODE.equals(_mode))
+ vmArguments.add(OT_DEBUG_VMARG);
+ }
+
+ public String adaptVMArgumentString(String vmArguments) throws CoreException
+ {
+ String sep = " ";
+ StringBuffer result = new StringBuffer(vmArguments);
+
+ if (_useJPLIS)
+ for (String arg : JPLIS_VMARGS)
+ result.append(sep).append(arg);
+
+ String callinSteppingVMArg = getCallinSteppingVMArg();
+ if (callinSteppingVMArg != null)
+ result.append(sep).append(callinSteppingVMArg);
+
+ String teamConfigArg = generateTeamConfigArgument(_launch, _launchConfig);
+ if (teamConfigArg != null)
+ result.append(sep).append(teamConfigArg);
+ if (ILaunchManager.DEBUG_MODE.equals(_mode))
+ result.append(sep).append(OT_DEBUG_VMARG);
+
+ return result.toString();
+ }
+
+ private String getCallinSteppingVMArg() {
+ String value = OTDebugPlugin.getDefault().getCallinSteppingConfig();
+ if (value == null) return null;
+ return OT_DEBUG_CALLIN_STEPPING_VMARG+'='+value;
+ }
+
+ protected List<String> getOTVMArgs()
+ {
+ return new ArrayList<String>(JPLIS_VMARGS);
+ }
+
+ /**
+ * Teams to activate are read from ILaunchConfiguration configuration.
+ * The list of team names are written to temporary file.
+ * The commandline par -Dot.teamconfig=filename is returned and can
+ * be added to the vmArgs variable.
+ * @param launch
+ * @param configuration The launch configuration object.
+ * @return
+ */
+ private String generateTeamConfigArgument(ILaunch launch, ILaunchConfiguration configuration) throws CoreException
+ {
+ List<String> teamList = getTeamConfigList(configuration);
+ if (teamList.isEmpty())
+ return null;
+
+ // write the teams into a temporary file:
+ File teamFile = createTeamConfigFile(launch, teamList);
+
+ return OT_TEAMCONFIG_VMARG+"=\"" + teamFile.getAbsolutePath()+'"';
+ }
+
+ private File createTeamConfigFile(ILaunch launch, List<String> teamList) throws CoreException
+ {
+ try {
+ TempFileManager manager = OTDebugPlugin.getDefault().getTempFileManager();
+ File tempFile = manager.createTempFile(launch, ".otteamconfig", ".conf");
+
+ PrintStream printStream = new PrintStream(new FileOutputStream(tempFile));
+ for (Iterator<String> iter = teamList.iterator(); iter.hasNext();) {
+ String element = iter.next();
+ printStream.println(element);
+ }
+ printStream.close();
+ return tempFile;
+ } catch (Exception e) {
+ IStatus status = OTDebugPlugin.createErrorStatus("Error writing static teams configuration", e);
+ throw new CoreException(status);
+ }
+ }
+
+ /**
+ * Returns the list of teams which will be woven into the launched application
+ * specified by the given launch configuration, as a list of strings.
+ * The returned list is empty if no teams are are specified or if the teams
+ * are deactivated in the configuratio tab.
+ *
+ * @param configuration
+ * launch configuration
+ * @return the list of teams from the team configuration specified by the given launch
+ * configuration, possibly an empty list
+ * @exception CoreException
+ * if unable to retrieve the attribute
+ */
+ private List<String> getTeamConfigList(ILaunchConfiguration configuration)
+ throws CoreException
+ {
+ boolean teamsActive = configuration.getAttribute(IOTLaunchConstants.ATTR_TEAMCONFIG_ACTIVE, true);
+ if (!teamsActive)
+ return new LinkedList<String>();
+
+ List teamHandles = configuration.getAttribute(IOTLaunchConstants.ATTR_TEAMCONFIG_LIST, new LinkedList());
+ List<String> teamNames = new LinkedList<String>();
+ List<String> badHandles = new LinkedList<String>();
+
+ for (Iterator iter = teamHandles.iterator(); iter.hasNext();)
+ {
+ String teamHandle = (String) iter.next();
+ IType teamType = (IType) JavaCore.create(teamHandle);
+ if (teamType != null && teamType.exists())
+ teamNames.add(teamType.getFullyQualifiedName());
+ else
+ badHandles.add(teamHandle);
+ }
+
+ if (!badHandles.isEmpty())
+ {
+ IStatus status = OTDebugPlugin.createErrorStatus("Cannot determine types: " + badHandles.toString());
+ throw new CoreException(status);
+ }
+
+ return teamNames;
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/TeamBreakpointInstaller.java b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/TeamBreakpointInstaller.java
new file mode 100644
index 000000000..aab296134
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/TeamBreakpointInstaller.java
@@ -0,0 +1,117 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id$
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.debug;
+
+import java.util.Hashtable;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.debug.core.DebugEvent;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.IDebugEventSetListener;
+import org.eclipse.debug.core.model.IBreakpoint;
+import org.eclipse.debug.core.model.IDebugTarget;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.debug.core.IJavaDebugTarget;
+import org.eclipse.objectteams.otdt.core.compiler.IOTConstants;
+import org.eclipse.objectteams.otdt.debug.core.breakpoints.OOTBreakpoints;
+
+public class TeamBreakpointInstaller
+{
+ private static Hashtable<String, IBreakpoint> OT_BREAKPOINTS = new Hashtable<String, IBreakpoint>(5);
+ public static boolean OOT_BREAKPOINTS_ENABLED = true;
+ static {
+ String prop = System.getProperty("ot.oot.breakpoints"); //$NON-NLS-1$
+ if ("DISABLE".equals(prop)) //$NON-NLS-1$
+ OOT_BREAKPOINTS_ENABLED = false;
+ }
+
+ public static void installTeamBreakpoints(IJavaProject project) throws CoreException
+ {
+ if (!OOT_BREAKPOINTS_ENABLED)
+ return;
+
+ DebugPlugin.getDefault().addDebugEventListener(new IDebugEventSetListener() {
+ // since we want to avoid using the breakpoint manager (thus hiding synthetic breakpoints from the UI),
+ // we have to track creation of the debug target in order to manually install our breakpoints into the target:
+ public void handleDebugEvents(DebugEvent[] events) {
+ boolean done = false;
+ if (OT_BREAKPOINTS.size() == 0) {
+ done = true;
+ } else {
+ for (DebugEvent event : events) {
+ if (event.getKind() == DebugEvent.CREATE) {
+ if (event.getSource() instanceof IJavaDebugTarget) {
+ IDebugTarget debugTarget = ((IJavaDebugTarget) event.getSource()).getDebugTarget();
+ for (IBreakpoint bp : OT_BREAKPOINTS.values())
+ debugTarget.breakpointAdded(bp);
+ done = true;
+ break;
+ }
+ }
+ }
+ }
+ if (done)
+ DebugPlugin.getDefault().removeDebugEventListener(this);
+ }
+ });
+ try
+ {
+ IType oot = project.findType(new String(IOTConstants.STR_ORG_OBJECTTEAMS_TEAM));
+ if (oot != null)
+ {
+ // Breakpoints in class org.objectteams.Team:
+ // bp on ctor, finalize()-, activate()-, deactivate(), -methods
+ if(!OT_BREAKPOINTS.containsKey(OOTBreakpoints.ATTR_OT_BREAKPOINT_CTOR))
+ OT_BREAKPOINTS.put(OOTBreakpoints.ATTR_OT_BREAKPOINT_CTOR, OOTBreakpoints.createOOTConstructorBreakpoint(oot));
+
+ if(!OT_BREAKPOINTS.containsKey(OOTBreakpoints.ATTR_OT_BREAKPOINT_FINALIZE))
+ OT_BREAKPOINTS.put(OOTBreakpoints.ATTR_OT_BREAKPOINT_FINALIZE, OOTBreakpoints.createOOTFinalizeBreakpoint(oot));
+
+ if(!OT_BREAKPOINTS.containsKey(OOTBreakpoints.ATTR_OT_BREAKPOINT_ACT))
+ OT_BREAKPOINTS.put(OOTBreakpoints.ATTR_OT_BREAKPOINT_ACT, OOTBreakpoints.createOOTActivateBreakpoint(oot));
+
+ if(!OT_BREAKPOINTS.containsKey(OOTBreakpoints.ATTR_OT_BREAKPOINT_DEACT))
+ OT_BREAKPOINTS.put(OOTBreakpoints.ATTR_OT_BREAKPOINT_DEACT, OOTBreakpoints.createOOTDeactivateBreakpoint(oot));
+
+ if(!OT_BREAKPOINTS.containsKey(OOTBreakpoints.ATTR_OT_BREAKPOINT_IMPLICIT_ACT))
+ OT_BREAKPOINTS.put(OOTBreakpoints.ATTR_OT_BREAKPOINT_IMPLICIT_ACT, OOTBreakpoints.createOOTImplicitActivateBreakpoint(oot));
+
+ if(!OT_BREAKPOINTS.containsKey(OOTBreakpoints.ATTR_OT_BREAKPOINT_IMPLICIT_DEACT))
+ OT_BREAKPOINTS.put(OOTBreakpoints.ATTR_OT_BREAKPOINT_IMPLICIT_DEACT, OOTBreakpoints.createOOTImplicitDeactivateBreakpoint(oot));
+ }
+ }
+ catch (JavaModelException ex)
+ {
+ throw new CoreException(new Status(IStatus.WARNING, OTDebugPlugin.PLUGIN_ID, IStatus.OK, "Cannot set breakpoints for team-activation tracking", ex)); //$NON-NLS-1$
+ }
+ }
+
+ public static void uninstallTeamBreakpoints() throws CoreException
+ {
+ if (!OOT_BREAKPOINTS_ENABLED)
+ return;
+ OT_BREAKPOINTS.clear();
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/TeamInstance.java b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/TeamInstance.java
new file mode 100644
index 000000000..a8707c7ac
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/TeamInstance.java
@@ -0,0 +1,192 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: TeamInstance.java 23427 2010-02-03 22:23:59Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.debug;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.internal.runtime.AdapterManager;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.debug.core.DebugException;
+import org.eclipse.debug.core.model.IDebugElement;
+import org.eclipse.debug.core.model.IStackFrame;
+import org.eclipse.debug.core.model.IThread;
+import org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget;
+import org.eclipse.jdt.internal.debug.core.model.JDIObjectValue;
+import org.eclipse.jdt.internal.debug.core.model.JDIThisVariable;
+import org.eclipse.jdt.internal.debug.core.model.JDIThread;
+
+import com.sun.jdi.ThreadReference;
+
+/**
+ * @author ike
+ */
+//TODO(ike): what about launches and thread termination->notify and update _activethreads
+public class TeamInstance extends JDIThisVariable implements IAdaptable
+{
+ public static final int IS_INACTIVE = 0;
+ public static final int IS_IMPLICITACTIVE = 1;
+ public static final int IS_ACTIVE = 2;
+
+ private List<TeamThread> _activethreads;
+ private List<TeamThread> _deactivethreads;
+ private List<TeamThread> _implicitActivethreads;
+ private int _activationState; // TODO(SH): use for caching
+ private TeamThread _globalThread;;
+ private long _creationTime;
+ private long _activationTime;
+
+ public TeamInstance(JDIThisVariable var) throws DebugException
+ {
+ super((JDIDebugTarget)var.getDebugTarget(),
+ ((JDIObjectValue)var.getValue()).getUnderlyingObject());
+ _activethreads = new ArrayList<TeamThread>();
+ _deactivethreads = new ArrayList<TeamThread>();
+ _implicitActivethreads = new ArrayList<TeamThread>();
+ _globalThread = new TeamThread(-1, 0);
+ _creationTime = System.currentTimeMillis();
+ _activationTime = 0;
+ }
+
+ public long getCreationTime()
+ {
+ return _creationTime;
+ }
+
+ public long getActivationTime()
+ {
+ return _activationTime;
+ }
+
+ public void setImplicitActiveForThreadID(long threadID)
+ {
+ TeamThread teamThread = new TeamThread(threadID, System.currentTimeMillis());
+ _implicitActivethreads.add(teamThread);
+ }
+
+ public void setImplicitInactiveForThreadID(long threadID)
+ {
+ TeamThread teamThread = new TeamThread(threadID, 0);
+ _implicitActivethreads.remove(teamThread);
+ }
+
+ public void setActiveForThreadID(long threadID)
+ {
+ TeamThread teamThread = new TeamThread(threadID, System.currentTimeMillis());
+ _activethreads.add(teamThread);
+ _deactivethreads.remove(teamThread);
+ }
+
+ public void setInactiveForThreadID(long threadID)
+ {
+ TeamThread teamThread = new TeamThread(threadID, System.currentTimeMillis());
+ _activethreads.remove(teamThread);
+ _deactivethreads.add(teamThread);
+ }
+
+ public List getThreads()
+ {
+ return _activethreads;
+ }
+
+ public Object getAdapter(Class adapter)
+ {
+ return AdapterManager.getDefault().getAdapter(this, adapter);
+ }
+
+ public int getActivationState(IDebugElement debugElement)
+ {
+ IThread thread= null;
+ if (debugElement instanceof IStackFrame) {
+ IStackFrame stackFrame= (IStackFrame)debugElement;
+ thread= stackFrame.getThread();
+ } else if (debugElement instanceof IThread) {
+ thread = (IThread)debugElement;
+ } if (thread != null)
+ return getActivationState(thread);
+ return globalActivationState();
+ }
+
+ private int getActivationState(IThread thread)
+ {
+ if(isActiveFor(thread))
+ return TeamInstance.IS_ACTIVE;
+ else
+ if(isImplicitActiveFor(thread))
+ return TeamInstance.IS_IMPLICITACTIVE;
+ else
+ return TeamInstance.IS_INACTIVE;
+ }
+
+ public boolean isActiveFor(IThread thread)
+ {
+ boolean isActive= false;
+ ThreadReference threadRef= null;
+ if (thread != null) {
+ threadRef= ((JDIThread)thread).getUnderlyingThread();
+ TeamThread teamThread = new TeamThread(threadRef.uniqueID(), 0);
+ isActive = _activethreads.contains(teamThread);
+ if (isActive) {
+ setActivationTime(_activethreads.get(_activethreads.indexOf(teamThread)).time);
+ return true;
+ }
+ if (_deactivethreads.contains(teamThread))
+ return false;
+ }
+
+ //team is perhaps global active
+ if(!isActive)
+ isActive = (_activethreads.contains(_globalThread));
+
+ return isActive;
+ }
+
+ private int globalActivationState() {
+ if (_activethreads.contains(_globalThread))
+ return IS_ACTIVE;
+ return IS_INACTIVE;
+ }
+
+ private void setActivationTime(long time)
+ {
+ _activationTime = time;
+ }
+
+ public boolean isImplicitActiveFor(IThread thread)
+ {
+ ThreadReference threadRef = ((JDIThread)thread).getUnderlyingThread();
+ long threadID = threadRef.uniqueID();
+ TeamThread teamThread= new TeamThread(threadID, 0);
+ boolean isImplicitActive = _implicitActivethreads.contains(teamThread);
+
+ if(isImplicitActive)
+ {
+ setActivationTime(_implicitActivethreads.get(_implicitActivethreads.indexOf(teamThread)).time);
+ }
+
+ return isImplicitActive;
+ }
+
+ public void setGlobalThreadID(long globalThreadID)
+ {
+ _globalThread.threadID = globalThreadID;
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/TeamThread.java b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/TeamThread.java
new file mode 100644
index 000000000..48856bf2b
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/TeamThread.java
@@ -0,0 +1,48 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id$
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.debug;
+
+public class TeamThread
+{
+ public long threadID = 0;
+ public long time = 0;
+
+ public TeamThread(long threadID, long time)
+ {
+ this.threadID = threadID;
+ this.time = time;
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (obj instanceof TeamThread)
+ return (threadID == ((TeamThread)obj).threadID);
+
+ return super.equals(obj);
+ }
+
+ @Override
+ public String toString()
+ {
+ return "threadID="+threadID+",time="+time; //$NON-NLS-1$ //$NON-NLS-2$
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/core/breakpoints/IOOTBreakPoints.java b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/core/breakpoints/IOOTBreakPoints.java
new file mode 100644
index 000000000..7eb40cedf
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/core/breakpoints/IOOTBreakPoints.java
@@ -0,0 +1,38 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2006, 2010 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: IOOTBreakPoints.java 23427 2010-02-03 22:23:59Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.debug.core.breakpoints;
+
+/**
+ * Do not edit: This interface is auto-generated from org/objectteams/Team.java
+ * using scripts/genIOOTBreakPoints.sh
+ *
+ * Purpose: make specific line numbers of Team.java available for the debugger.
+ */
+public interface IOOTBreakPoints
+{
+ int LINE_TeamConstructor = 60;
+ int LINE_ConfinedGetTeam = 91;
+ int LINE_ActivateMethod = 162;
+ int LINE_DeactivateMethod = 196;
+ int LINE_ImplicitActivateMethod = 243;
+ int LINE_ImplicitDeactivateMethod = 278;
+ int LINE_FinalizeMethod = 489;
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/core/breakpoints/OOTBreakpoints.java b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/core/breakpoints/OOTBreakpoints.java
new file mode 100644
index 000000000..586d3a3b1
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/core/breakpoints/OOTBreakpoints.java
@@ -0,0 +1,213 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: OOTBreakpoints.java 23427 2010-02-03 22:23:59Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.debug.core.breakpoints;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.model.IBreakpoint;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.debug.core.IJavaBreakpoint;
+import org.eclipse.jdt.debug.core.JDIDebugModel;
+import org.eclipse.objectteams.otdt.debug.OTDebugPlugin;
+
+import static org.eclipse.objectteams.otdt.debug.core.breakpoints.IOOTBreakPoints.*;
+
+/**
+ * @author ike
+ *
+ * This class provides methods to create OOT-specific (org.objectteams.Team) breakpoints
+ *
+ * $Id: OOTBreakpoints.java 23427 2010-02-03 22:23:59Z stephan $
+ */
+@SuppressWarnings("nls")
+public class OOTBreakpoints
+{
+ public static final String FIELD_THIS = "this";
+ public static final String LOCAL_THREAD_ACT_DEACT = "thread";
+ public static final String LOCAL_THREAD_IMPLICIT_ACT_DEACT = "currentThread";
+ public static final String FIELD_ALL_THREADS = "ALL_THREADS";
+
+ public static final String ATTR_OT_BREAKPOINT = OTDebugPlugin.PLUGIN_ID + ".TeamBreakpoint";
+ public static final String ATTR_OT_BREAKPOINT_CTOR = OTDebugPlugin.PLUGIN_ID + ".TeamBreakpoint.Constructor";
+ public static final String ATTR_OT_BREAKPOINT_FINALIZE = OTDebugPlugin.PLUGIN_ID + ".TeamBreakpoint.FinalizeMethod";
+ public static final String ATTR_OT_BREAKPOINT_ACT = OTDebugPlugin.PLUGIN_ID + ".TeamBreakpoint.ActivateMethod";
+ public static final String ATTR_OT_BREAKPOINT_DEACT = OTDebugPlugin.PLUGIN_ID + ".TeamBreakpoint.DeactivateMethod";
+ public static final String ATTR_OT_BREAKPOINT_IMPLICIT_ACT = OTDebugPlugin.PLUGIN_ID + ".TeamBreakpoint.ImplicitActivateMethod";
+ public static final String ATTR_OT_BREAKPOINT_IMPLICIT_DEACT = OTDebugPlugin.PLUGIN_ID + ".TeamBreakpoint.ImplicitDeactivateMethod";
+
+
+ //associated with "public Team() {}"
+ public static int getTeamConstructorLineNumber()
+ {
+ return LINE_TeamConstructor;
+ }
+
+ //associated with "doRegistration();"
+ public static int getActivateMethodLineNumber()
+ {
+ return LINE_ActivateMethod;
+ }
+
+ //associated with "_OT$lazyGlobalActiveFlag = false;"
+ public static int getDeactivateMethodLineNumber()
+ {
+ return LINE_DeactivateMethod;
+ }
+
+ //associated with "implicitActivationsPerThread.set(Integer.valueOf(implActCount + 1 ));"
+ public static int getImplicitActivateMethodLineNumber()
+ {
+ return LINE_ImplicitActivateMethod;
+ }
+
+ //implicitActivationsPerThread.set(Integer.valueOf(implActCount - 1));
+ public static int getImplicitDeactivateMethodLineNumber()
+ {
+ return LINE_ImplicitDeactivateMethod;
+ }
+
+ // implicit "return;"
+ public static int getFinalizeMethodLineNumber() {
+ return LINE_FinalizeMethod;
+ }
+
+ public static Map<String, Boolean> getBreakpointAttributes()
+ {
+ Map<String, Boolean> attrs = new HashMap<String, Boolean>();
+ attrs.put(OOTBreakpoints.ATTR_OT_BREAKPOINT, Boolean.TRUE);
+ return attrs;
+ }
+
+ public static IBreakpoint createOOTConstructorBreakpoint(IType oot)
+ throws CoreException
+ {
+ Map<String, Boolean> constructorAttributes = getBreakpointAttributes();
+ constructorAttributes.put(OOTBreakpoints.ATTR_OT_BREAKPOINT_CTOR, Boolean.TRUE);
+ return createOOTBreakpoint(oot, getTeamConstructorLineNumber(), constructorAttributes);
+ }
+
+ public static IBreakpoint createOOTFinalizeBreakpoint(IType oot)
+ throws CoreException
+ {
+ Map<String, Boolean> finalizeMethodAttributes = getBreakpointAttributes();
+ finalizeMethodAttributes.put(OOTBreakpoints.ATTR_OT_BREAKPOINT_FINALIZE, Boolean.TRUE);
+ return createOOTMethodBreakpoint(oot, getFinalizeMethodLineNumber(), finalizeMethodAttributes);
+ }
+
+ public static IBreakpoint createOOTActivateBreakpoint(IType oot)throws CoreException
+ {
+ Map<String, Boolean> activateMethodAttributes = getBreakpointAttributes();
+ activateMethodAttributes.put(OOTBreakpoints.ATTR_OT_BREAKPOINT_ACT, Boolean.TRUE);
+ return createOOTBreakpoint(oot, getActivateMethodLineNumber(), activateMethodAttributes);
+ }
+
+ public static IBreakpoint createOOTDeactivateBreakpoint(IType oot) throws CoreException
+ {
+ Map<String, Boolean> deactivateMethodAttributes = getBreakpointAttributes();
+ deactivateMethodAttributes.put(OOTBreakpoints.ATTR_OT_BREAKPOINT_DEACT, Boolean.TRUE);
+ return createOOTBreakpoint(oot, getDeactivateMethodLineNumber(), deactivateMethodAttributes);
+ }
+
+ public static IBreakpoint createOOTImplicitActivateBreakpoint(IType oot)throws CoreException
+ {
+ Map<String, Boolean> implicitActivateMethodAttributes = getBreakpointAttributes();
+ implicitActivateMethodAttributes.put(OOTBreakpoints.ATTR_OT_BREAKPOINT_IMPLICIT_ACT, Boolean.TRUE);
+ return createOOTBreakpoint(oot, getImplicitActivateMethodLineNumber(), implicitActivateMethodAttributes);
+ }
+
+ public static IBreakpoint createOOTImplicitDeactivateBreakpoint(IType oot)throws CoreException
+ {
+ Map<String, Boolean> implicitDeactivateMethodAttributes = getBreakpointAttributes();
+ implicitDeactivateMethodAttributes.put(OOTBreakpoints.ATTR_OT_BREAKPOINT_IMPLICIT_DEACT, Boolean.TRUE);
+ return createOOTBreakpoint(oot, getImplicitDeactivateMethodLineNumber(), implicitDeactivateMethodAttributes);
+ }
+ public static IBreakpoint createOOTBreakpoint(IType oot, int linenumber, Map attributes)
+ throws CoreException
+ {
+ IResource teamResource = oot.getJavaProject().getResource();
+ IJavaBreakpoint breakpoint = JDIDebugModel.createLineBreakpoint(
+ teamResource,
+ oot.getFullyQualifiedName(),
+ linenumber,
+ -1, -1, 0,
+ false /*register*/,
+ attributes);
+ breakpoint.setPersisted(false);
+
+ return breakpoint;
+ }
+
+ public static IBreakpoint createOOTMethodBreakpoint(IType oot, int linenumber, Map attributes)
+ throws CoreException
+ {
+ IResource teamResource = oot.getJavaProject().getResource();
+ IJavaBreakpoint breakpoint = JDIDebugModel.createMethodBreakpoint(
+ teamResource,
+ oot.getFullyQualifiedName(),
+ "finalize",
+ "()V",
+ true /*entry*/, false /*exit*/, false /*native*/,
+ linenumber,
+ -1, -1, 0,
+ false /*register*/,
+ attributes);
+ breakpoint.setPersisted(false);
+ return breakpoint;
+ }
+
+ public static final boolean isOOTBreakpoint(IBreakpoint breakpoint) throws CoreException
+ {
+ return breakpoint.getMarker().getAttribute(OOTBreakpoints.ATTR_OT_BREAKPOINT) != null;
+ }
+
+ public static final boolean isOOTConstructorBreakpoint(IBreakpoint breakpoint) throws CoreException
+ {
+ return breakpoint.getMarker().getAttribute(OOTBreakpoints.ATTR_OT_BREAKPOINT_CTOR) != null;
+ }
+
+ public static final boolean isOOTFinalizeBreakpoint(IBreakpoint breakpoint) throws CoreException
+ {
+ return breakpoint.getMarker().getAttribute(OOTBreakpoints.ATTR_OT_BREAKPOINT_FINALIZE) != null;
+ }
+
+ public static final boolean isOOTActiveMethodBreakpoint(IBreakpoint breakpoint) throws CoreException
+ {
+ return breakpoint.getMarker().getAttribute(OOTBreakpoints.ATTR_OT_BREAKPOINT_ACT) != null;
+ }
+
+ public static final boolean isOOTDeactiveMethodBreakpoint(IBreakpoint breakpoint) throws CoreException
+ {
+ return breakpoint.getMarker().getAttribute(OOTBreakpoints.ATTR_OT_BREAKPOINT_DEACT) != null;
+ }
+
+ public static final boolean isOOTImplicitActiveMethodBreakpoint(IBreakpoint breakpoint) throws CoreException
+ {
+ return breakpoint.getMarker().getAttribute(OOTBreakpoints.ATTR_OT_BREAKPOINT_IMPLICIT_ACT) != null;
+ }
+
+ public static final boolean isOOTImplicitDeactiveMethodBreakpoint(IBreakpoint breakpoint) throws CoreException
+ {
+ return breakpoint.getMarker().getAttribute(OOTBreakpoints.ATTR_OT_BREAKPOINT_IMPLICIT_DEACT) != null;
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/core/breakpoints/OTJavaWatchpoint.java b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/core/breakpoints/OTJavaWatchpoint.java
new file mode 100644
index 000000000..abf5f8887
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/core/breakpoints/OTJavaWatchpoint.java
@@ -0,0 +1,143 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: OTJavaWatchpoint.java 23427 2010-02-03 22:23:59Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.debug.core.breakpoints;
+
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.Map;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.debug.core.DebugException;
+import org.eclipse.jdt.debug.core.IJavaThread;
+import org.eclipse.jdt.debug.core.IJavaVariable;
+import org.eclipse.jdt.internal.debug.core.breakpoints.JavaWatchpoint;
+import org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget;
+import org.eclipse.jdt.internal.debug.core.model.JDIObjectValue;
+import org.eclipse.jdt.internal.debug.core.model.JDIThread;
+
+import com.sun.jdi.ObjectReference;
+import com.sun.jdi.Value;
+import com.sun.jdi.event.Event;
+import com.sun.jdi.event.ModificationWatchpointEvent;
+
+/**
+ * FIXME(SH): THIS CLASS IS NOT USED.
+ *
+ * @author ike
+ *
+ * This class is for dealing with the Modification Watchpoint and getting the modified value.
+ *
+ * $Id: OTJavaWatchpoint.java 23427 2010-02-03 22:23:59Z stephan $
+ */
+public class OTJavaWatchpoint extends JavaWatchpoint
+{
+ private Hashtable _threadToObjectRefTable;
+// unused private String _searchField;
+
+ public OTJavaWatchpoint(IResource resource, String typeName, String fieldName, int lineNumber, int charStart, int charEnd, int hitCount, boolean register, Map attributes, String searchString) throws DebugException
+ {
+ super(resource, typeName, fieldName, lineNumber, charStart, charEnd, hitCount, register, attributes);
+
+ _threadToObjectRefTable = new Hashtable();
+// unused _searchField = searchString;
+ }
+
+ /** Overrides the JavaWatchpoint.handleBreakpointEvent() method to handle
+ * the ModificationWatchpointEvent and to store the value, which
+ * will be set.
+ */
+ @Override
+ public boolean handleBreakpointEvent(Event event, JDIThread thread, boolean suspendVote)
+ {
+ if (event instanceof ModificationWatchpointEvent)
+ {
+ ModificationWatchpointEvent modEvent = (ModificationWatchpointEvent)event;
+ Value currentValue = modEvent.valueCurrent();
+ Value valueToBe = modEvent.valueToBe();
+ ObjectReference objectRef = modEvent.object();
+
+ Hashtable objectRefs;
+ if (!_threadToObjectRefTable.containsKey(thread))
+ {
+ objectRefs = new Hashtable();
+ }
+ else
+ {
+ objectRefs = (Hashtable)_threadToObjectRefTable.get(thread);
+ }
+
+ Value [] values;
+ if (!objectRefs.containsKey(objectRef))
+ {
+ values = new Value[2];
+
+ }
+ else
+ {
+ values = (Value [])objectRefs.get(objectRef);
+ }
+
+ values[0] = currentValue;
+ values[1] = valueToBe;
+ objectRefs.put(objectRef, values);
+
+ _threadToObjectRefTable.put(thread, objectRefs);
+ }
+ return super.handleBreakpointEvent(event, thread, suspendVote);
+ }
+
+ public Value getValueToBe(IJavaThread thread, IJavaVariable variable) throws DebugException
+ {
+ Value [] values = getValues(thread, variable);
+
+ if (values != null && values.length >=2)
+ return values[1];
+ else
+ return null;
+ }
+
+ public Value getCurrentValue(IJavaThread thread, IJavaVariable variable) throws DebugException
+ {
+ Value [] values = getValues(thread, variable);
+
+ if (values != null && values.length >=2)
+ return values[0];
+ else
+ return null;
+ }
+
+ private Value[] getValues(IJavaThread thread, IJavaVariable variable) throws DebugException
+ {
+ Hashtable objRefTable = (Hashtable) _threadToObjectRefTable.get(thread);
+
+ for (Iterator iter = objRefTable.keySet().iterator(); iter.hasNext();)
+ {
+ Value objRef = (ObjectReference) iter.next();
+ JDIObjectValue value = (JDIObjectValue)variable.getValue();
+
+ if (value.getUnderlyingObject().equals(objRef))
+ {
+ return (Value [])objRefTable.get(objRef);
+ }
+ }
+ return null;
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/internal/Logger.java b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/internal/Logger.java
new file mode 100644
index 000000000..e471989c9
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/internal/Logger.java
@@ -0,0 +1,57 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: Logger.java 23427 2010-02-03 22:23:59Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.debug.internal;
+
+
+@SuppressWarnings("nls")
+public class Logger
+{
+
+ public static boolean ON = true;
+
+ public static void log(int level, String caller, String message)
+ {
+ switch (level) {
+ case 0:
+
+ printLog("# ",caller, message);
+ break;
+
+ case 1:
+
+ printLog("## ",caller, message);
+ break;
+ case 2:
+
+ printLog("## ",caller, message);
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ private static void printLog(String prefix, String caller, String message)
+ {
+ if (ON)
+ System.out.println(prefix + caller + " -> " +message);
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/internal/OTDebugElementsContainerFactory.java b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/internal/OTDebugElementsContainerFactory.java
new file mode 100644
index 000000000..106b2128d
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/internal/OTDebugElementsContainerFactory.java
@@ -0,0 +1,81 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: OTDebugElementsContainerFactory.java 23427 2010-02-03 22:23:59Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.debug.internal;
+
+import java.util.HashMap;
+
+import org.eclipse.core.runtime.IAdapterFactory;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.ILaunchesListener2;
+import org.eclipse.objectteams.otdt.debug.OTDebugElementsContainer;
+
+/**
+ * @author ike
+ *
+ * $Id: OTDebugElementsContainerFactory.java 23427 2010-02-03 22:23:59Z stephan $
+ */
+public class OTDebugElementsContainerFactory implements IAdapterFactory, ILaunchesListener2 {
+
+ private HashMap<Object, OTDebugElementsContainer> _launchToDebugModel = new HashMap<Object, OTDebugElementsContainer>();
+
+ public OTDebugElementsContainerFactory()
+ {
+ DebugPlugin.getDefault().getLaunchManager().addLaunchListener(this);
+ }
+
+ public Object getAdapter(Object adaptableObject, Class adapterType)
+ {
+ if (!_launchToDebugModel.containsKey(adaptableObject))
+ {
+ if (OTDebugElementsContainer.class.equals(adapterType))
+ {
+ _launchToDebugModel.put(adaptableObject, new OTDebugElementsContainer());
+ }
+ }
+
+ return _launchToDebugModel.get(adaptableObject);
+ }
+
+ public Class[] getAdapterList()
+ {
+ return new Class [] { OTDebugElementsContainer.class };
+ }
+
+ //TODO(ike): check, why there are sometimes 2 launches
+ public void launchesTerminated(ILaunch[] launches)
+ {
+ for (int idx = 0; idx < launches.length; idx++)
+ {
+ _launchToDebugModel.remove(launches[idx]);
+ }
+ }
+
+ public void launchesRemoved(ILaunch[] launches) {}
+ public void launchesAdded(ILaunch[] launches) {}
+ public void launchesChanged(ILaunch[] launches) {}
+
+ public void dispose()
+ {
+ DebugPlugin.getDefault().getLaunchManager().removeLaunchListener(this);
+ _launchToDebugModel.clear();
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/internal/RoleBreakpointListener.java b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/internal/RoleBreakpointListener.java
new file mode 100644
index 000000000..e47df9a21
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/internal/RoleBreakpointListener.java
@@ -0,0 +1,84 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id$
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.debug.internal;
+
+import org.eclipse.debug.core.DebugException;
+import org.eclipse.jdt.core.dom.Message;
+import org.eclipse.jdt.debug.core.IJavaBreakpoint;
+import org.eclipse.jdt.debug.core.IJavaBreakpointListener;
+import org.eclipse.jdt.debug.core.IJavaDebugTarget;
+import org.eclipse.jdt.debug.core.IJavaLineBreakpoint;
+import org.eclipse.jdt.debug.core.IJavaThread;
+import org.eclipse.jdt.debug.core.IJavaType;
+import org.eclipse.objectteams.otdt.core.compiler.IOTConstants;
+
+/**
+ * The purpose of this listener is to prevent that attempts are made
+ * to install a breakpoint of a role into the enclosing team or a
+ * sibling role. In Java, all inner classes reside in the file of
+ * the same outermost enclosing type. This is not true for roles.
+ *
+ * @author stephan
+ * @since 1.1.4
+ */
+public class RoleBreakpointListener implements IJavaBreakpointListener
+{
+ private static RoleBreakpointListener _singleton= null;
+ public static RoleBreakpointListener getInstance() {
+ if(_singleton == null)
+ _singleton = new RoleBreakpointListener();
+ return _singleton;
+ }
+
+ public void addingBreakpoint(IJavaDebugTarget target, IJavaBreakpoint breakpoint) {}
+ public void breakpointHasCompilationErrors(IJavaLineBreakpoint breakpoint, Message[] errors) {}
+ public void breakpointHasRuntimeException(IJavaLineBreakpoint breakpoint, DebugException exception) {}
+ public void breakpointInstalled(IJavaDebugTarget target, IJavaBreakpoint breakpoint) {}
+ public void breakpointRemoved(IJavaDebugTarget target, IJavaBreakpoint breakpoint) {}
+
+ public int breakpointHit(IJavaThread thread, IJavaBreakpoint breakpoint) {
+ return IJavaBreakpointListener.DONT_CARE;
+ }
+
+ public int installingBreakpoint(IJavaDebugTarget target, IJavaBreakpoint breakpoint, IJavaType type)
+ {
+ try {
+ String typeName = type.getName();
+ String breakpointTypeName = breakpoint.getTypeName();
+ if ( typeName.contains(IOTConstants.OT_DELIM)
+ || breakpointTypeName.contains(IOTConstants.OT_DELIM))
+ {
+ if (!breakpointTypeName.equals(typeName))
+ // for roles we need to be stricter than for regular inner classes:
+ // don't try to install a role breakpoint into any other type
+ return IJavaBreakpointListener.DONT_INSTALL;
+ }
+ } catch (Exception e) {
+ // could not retrieve name, don't interfere with current action.
+ }
+ return IJavaBreakpointListener.DONT_CARE;
+ }
+
+ public void dispose()
+ {
+ _singleton = null;
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/internal/StepFromLinenumberGenerator.java b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/internal/StepFromLinenumberGenerator.java
new file mode 100644
index 000000000..71fa483e3
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/internal/StepFromLinenumberGenerator.java
@@ -0,0 +1,196 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id$
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.debug.internal;
+
+import org.eclipse.debug.core.DebugEvent;
+import org.eclipse.debug.core.DebugException;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.IDebugEventFilter;
+import org.eclipse.debug.core.model.IStackFrame;
+import org.eclipse.jdt.debug.core.IJavaDebugTarget;
+import org.eclipse.jdt.internal.debug.core.model.JDIThread;
+import org.eclipse.objectteams.otdt.core.compiler.ISMAPConstants;
+
+/**
+ * @author ike
+ *
+ */
+public class StepFromLinenumberGenerator implements IDebugEventFilter, ISMAPConstants
+{
+ private static StepFromLinenumberGenerator _stepGenerator;
+
+ public static StepFromLinenumberGenerator getInstance()
+ {
+ if (_stepGenerator == null)
+ {
+ _stepGenerator = new StepFromLinenumberGenerator();
+ }
+
+ return _stepGenerator;
+ }
+
+ public DebugEvent[] filterDebugEvents(DebugEvent[] events)
+ {
+ for (int index = 0; index < events.length; index++)
+ {
+ DebugEvent event = events[index];
+
+ JDIThread thread = getThreadFromEvent(event);
+
+ if (thread == null)
+ {
+ return events;
+ }
+
+ try
+ {
+ IStackFrame topStackframe = getStackFrame(thread);
+
+ if (isResumeEvent(event) || (topStackframe == null))
+ {
+ return events;
+ }
+
+ //every time a STEP_OVER_LINENUMBER is detected, step over it
+ if (isStepOverElement(topStackframe) && isSuspendEvent(event))
+ {
+ generateStepOver(thread);
+ return filterEvent(events, index);
+ }
+
+ //every time a STEP_INTO_LINENUMBER is detected step into it
+ if (isStepIntoElement(topStackframe) && isSuspendEvent(event))
+ {
+ generateStepInto(thread);
+ return filterEvent(events, index);
+ }
+
+ }
+ catch (DebugException e)
+ {
+ //TODO(ike): handle exception
+ e.printStackTrace();
+ return events;
+ }
+ }
+
+ return events;
+ }
+
+ private boolean isResumeEvent(DebugEvent event)
+ {
+ return (event.getKind() == DebugEvent.RESUME);
+ }
+
+ private boolean isSuspendEvent(DebugEvent event)
+ {
+ return (event.getKind() == DebugEvent.SUSPEND);
+ }
+
+ private boolean isStepOverElement(IStackFrame topStackframe) throws DebugException
+ {
+ if (topStackframe.getLineNumber() == STEP_OVER_LINENUMBER)
+ return true;
+
+ return false;
+ }
+
+ private boolean isStepIntoElement(IStackFrame topStackframe) throws DebugException
+ {
+ if (topStackframe.getLineNumber() == STEP_INTO_LINENUMBER)
+ return true;
+
+ return false;
+ }
+
+ private IStackFrame getStackFrame(JDIThread thread) throws DebugException
+ {
+ if (thread.hasStackFrames())
+ {
+ return thread.getTopStackFrame();
+ }
+ return null;
+ }
+
+ private JDIThread getThreadFromEvent(DebugEvent event)
+ {
+ if (event.getSource() instanceof JDIThread)
+ {
+ return (JDIThread) event.getSource();
+ }
+
+ return null;
+ }
+
+
+ /** Filter event with given index.
+ */
+ private DebugEvent[] filterEvent(DebugEvent[] events, int index)
+ {
+ DebugEvent[] filtered = new DebugEvent[events.length - 1];
+ if (filtered.length > 0)
+ {
+ int j = 0;
+ for (int idx = 0; idx < events.length; idx++)
+ {
+ if (idx != index)
+ {
+ filtered[j] = events[idx];
+ j++;
+ }
+ }
+ }
+ return filtered;
+ }
+
+ /** Generates and performs a single stepInto in the given thread.
+ */
+ private void generateStepInto(JDIThread thread)
+ {
+ IJavaDebugTarget debugTarget = (IJavaDebugTarget) thread.getDebugTarget();
+
+ try
+ {
+ thread.stepInto();
+ }
+ catch (DebugException e)
+ {
+ DebugPlugin.getDefault().fireDebugEventSet( new DebugEvent[] { new DebugEvent(debugTarget, DebugEvent.CHANGE) });
+ }
+ }
+
+
+ /** Generates and performs a single stepOver in the given thread.
+ */
+ private void generateStepOver(JDIThread thread)
+ {
+ IJavaDebugTarget debugTarget = (IJavaDebugTarget) thread.getDebugTarget();
+
+ try
+ {
+ thread.stepOver();
+ }
+ catch (DebugException e)
+ {
+ DebugPlugin.getDefault().fireDebugEventSet( new DebugEvent[] { new DebugEvent(debugTarget, DebugEvent.CHANGE) });
+ }
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/internal/TeamBreakpointListener.java b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/internal/TeamBreakpointListener.java
new file mode 100644
index 000000000..dbb2e629c
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/internal/TeamBreakpointListener.java
@@ -0,0 +1,196 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id$
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.debug.internal;
+
+import org.eclipse.debug.core.DebugException;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.model.IValue;
+import org.eclipse.jdt.core.dom.Message;
+import org.eclipse.jdt.debug.core.IJavaBreakpoint;
+import org.eclipse.jdt.debug.core.IJavaBreakpointListener;
+import org.eclipse.jdt.debug.core.IJavaDebugTarget;
+import org.eclipse.jdt.debug.core.IJavaLineBreakpoint;
+import org.eclipse.jdt.debug.core.IJavaThread;
+import org.eclipse.jdt.debug.core.IJavaType;
+import org.eclipse.jdt.debug.core.IJavaVariable;
+import org.eclipse.jdt.internal.debug.core.model.JDIObjectValue;
+import org.eclipse.jdt.internal.debug.core.model.JDIThisVariable;
+import org.eclipse.jdt.internal.debug.core.model.JDIThread;
+import org.eclipse.objectteams.otdt.debug.IOTDebugEventListener;
+import org.eclipse.objectteams.otdt.debug.OTDebugElementsContainer;
+import org.eclipse.objectteams.otdt.debug.OTDebugPlugin;
+import org.eclipse.objectteams.otdt.debug.TeamInstance;
+import org.eclipse.objectteams.otdt.debug.core.breakpoints.OOTBreakpoints;
+
+public class TeamBreakpointListener implements IJavaBreakpointListener
+{
+ private static TeamBreakpointListener _singleton;
+
+ public static TeamBreakpointListener getInstance()
+ {
+ if(_singleton == null)
+ _singleton = new TeamBreakpointListener();
+
+ return _singleton;
+ }
+
+ public int breakpointHit(IJavaThread thread, IJavaBreakpoint breakpoint)
+ {
+ OTDebugElementsContainer otDebugElementsContainer = getDebugElementsContainer(thread.getLaunch());
+ if (otDebugElementsContainer == null)
+ return DONT_CARE; // something's broken for OT, don't interfere the debugger
+
+ // without a marker it can't be a valid OOT breakpoint
+ if (!breakpoint.getMarker().exists())
+ return DONT_CARE;
+
+ try
+ {
+ if (OOTBreakpoints.isOOTConstructorBreakpoint(breakpoint))
+ {
+ // A team is being instantiated!
+ JDIThisVariable teamVariable = (JDIThisVariable) thread.findVariable(OOTBreakpoints.FIELD_THIS);
+ if (otDebugElementsContainer.getTeamInstance(teamVariable) == null) {
+ TeamInstance newTeam= otDebugElementsContainer.addTeamInstance(teamVariable);
+ notifyTeamInstantiation(otDebugElementsContainer, newTeam);
+ }
+ return IJavaBreakpointListener.DONT_SUSPEND;
+ }
+
+ if (OOTBreakpoints.isOOTFinalizeBreakpoint(breakpoint))
+ {
+ // A team is being disposed!
+ IJavaVariable teamVariable = thread.findVariable(OOTBreakpoints.FIELD_THIS);
+ int idx= otDebugElementsContainer.removeTeamInstance(teamVariable);
+ if (idx != -1)
+ notifyTeamFinalize(otDebugElementsContainer, idx);
+ return IJavaBreakpointListener.DONT_SUSPEND;
+ }
+
+ if (OOTBreakpoints.isOOTActiveMethodBreakpoint(breakpoint))
+ {
+ IJavaVariable teamVariable = thread.findVariable(OOTBreakpoints.FIELD_THIS);
+ TeamInstance teamInstance = otDebugElementsContainer.getTeamInstance(teamVariable);
+
+ IJavaVariable teamActiveThread = thread.findVariable(OOTBreakpoints.LOCAL_THREAD_ACT_DEACT);
+ IValue threadValue = teamActiveThread.getValue();
+ long threadID = ((JDIObjectValue)threadValue).getUniqueId();
+ teamInstance.setActiveForThreadID(threadID);
+
+ IJavaVariable teamGlobalThread = thread.findVariable(OOTBreakpoints.FIELD_ALL_THREADS);
+ IValue globalThreadValue = teamGlobalThread.getValue();
+ long globalThreadID = ((JDIObjectValue)globalThreadValue).getUniqueId();
+ teamInstance.setGlobalThreadID(globalThreadID);
+
+ notifyActivationState(teamInstance);
+ return IJavaBreakpointListener.DONT_SUSPEND;
+ }
+
+ if (OOTBreakpoints.isOOTDeactiveMethodBreakpoint(breakpoint))
+ {
+ IJavaVariable teamVariable = thread.findVariable(OOTBreakpoints.FIELD_THIS);
+ TeamInstance teamInstance = otDebugElementsContainer.getTeamInstance(teamVariable);
+
+ IJavaVariable teamDeactiveThread= thread.findVariable(OOTBreakpoints.LOCAL_THREAD_ACT_DEACT);
+ IValue threadValue = teamDeactiveThread.getValue();
+ long threadID = ((JDIObjectValue)threadValue).getUniqueId();
+ teamInstance.setInactiveForThreadID(new Long(threadID));
+
+ notifyActivationState(teamInstance);
+ return IJavaBreakpointListener.DONT_SUSPEND;
+ }
+
+ if (OOTBreakpoints.isOOTImplicitActiveMethodBreakpoint(breakpoint))
+ {
+ IJavaVariable teamVariable = thread.findVariable(OOTBreakpoints.FIELD_THIS);
+ TeamInstance teamInstance = otDebugElementsContainer.getTeamInstance(teamVariable);
+
+ // don't use fragile access to local variable
+ // but directly use the current thread:
+ long threadID= ((JDIThread)thread).getUnderlyingThread().uniqueID();
+ teamInstance.setImplicitActiveForThreadID(threadID);
+
+ notifyActivationState(teamInstance);
+ return IJavaBreakpointListener.DONT_SUSPEND;
+ }
+
+ if (OOTBreakpoints.isOOTImplicitDeactiveMethodBreakpoint(breakpoint))
+ {
+ IJavaVariable teamVariable = thread.findVariable(OOTBreakpoints.FIELD_THIS);
+ TeamInstance teamInstance = otDebugElementsContainer.getTeamInstance(teamVariable);
+
+ // don't use fragile access to local variable
+ // but directly use the current thread:
+ long threadID = ((JDIThread)thread).getUnderlyingThread().uniqueID();
+ teamInstance.setImplicitInactiveForThreadID(threadID);
+
+ notifyActivationState(teamInstance);
+ return IJavaBreakpointListener.DONT_SUSPEND;
+ }
+ }
+ catch (Exception ex)
+ {
+ OTDebugPlugin.getExceptionHandler().logException("Teammonitor can't read infos from debugTarget anymore. Disconnected?", ex); //$NON-NLS-1$
+ //if something fails, let the debugger go on
+ return IJavaBreakpointListener.DONT_SUSPEND;
+ }
+
+ return IJavaBreakpointListener.DONT_CARE;
+ }
+
+ protected OTDebugElementsContainer getDebugElementsContainer(ILaunch launch)
+ {
+ return (OTDebugElementsContainer) launch.getAdapter(OTDebugElementsContainer.class);
+ }
+
+ private void notifyTeamInstantiation(OTDebugElementsContainer container, TeamInstance newTeam)
+ {
+ for (IOTDebugEventListener listener : OTDebugPlugin.getDefault().getOTDebugEventListeners())
+ listener.teamInstantiated(newTeam);
+ }
+
+ private void notifyTeamFinalize(OTDebugElementsContainer container, int idx)
+ {
+ for (IOTDebugEventListener listener : OTDebugPlugin.getDefault().getOTDebugEventListeners())
+ listener.teamDisposed(idx);
+ }
+
+ private void notifyActivationState(TeamInstance teamInstance)
+ {
+ for (IOTDebugEventListener listener : OTDebugPlugin.getDefault().getOTDebugEventListeners())
+ listener.activationStateChanged(teamInstance);
+ }
+
+ public void addingBreakpoint(IJavaDebugTarget target, IJavaBreakpoint breakpoint) {}
+ public void breakpointHasCompilationErrors(IJavaLineBreakpoint breakpoint, Message[] errors) {}
+ public void breakpointHasRuntimeException(IJavaLineBreakpoint breakpoint, DebugException exception) {}
+ public void breakpointInstalled(IJavaDebugTarget target, IJavaBreakpoint breakpoint) {}
+ public void breakpointRemoved(IJavaDebugTarget target, IJavaBreakpoint breakpoint) {}
+ public int installingBreakpoint(IJavaDebugTarget target, IJavaBreakpoint breakpoint, IJavaType type)
+ {
+ return IJavaBreakpointListener.DONT_CARE;
+ }
+
+ public void dispose()
+ {
+ _singleton = null;
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/internal/TempFileManager.java b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/internal/TempFileManager.java
new file mode 100644
index 000000000..278732ca3
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/internal/TempFileManager.java
@@ -0,0 +1,83 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: TempFileManager.java 23427 2010-02-03 22:23:59Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.debug.internal;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+/**
+ * @author gis
+ */
+public class TempFileManager
+{
+ private Map _tempFiles = new HashMap();
+
+ /**
+ * If you created a temporary file yourself and want TempFileManager to manage the
+ * deletion, use this method to register the file with the given key.
+ * Call deleteTempFile with the same key to delete it.
+ */
+ public void registerTempFile(Object key, File file)
+ {
+ synchronized(_tempFiles) {
+ _tempFiles.put(key, file);
+ }
+ }
+
+ /**
+ * Creates a temporary file via java.io.File.createTempFile and registers it for later
+ * deletion via the given key. Call deleteTempFile with the same key to delete it.
+ * @throws IOException
+ */
+ public File createTempFile(Object key, String prefix, String suffix) throws IOException
+ {
+ File tempFile = File.createTempFile(prefix, suffix);
+ tempFile.deleteOnExit();
+ synchronized(_tempFiles) {
+ _tempFiles.put(key, tempFile);
+ }
+
+ return tempFile;
+ }
+
+ public void deleteTempFile(Object key)
+ {
+ synchronized(_tempFiles) {
+ File file = (File) _tempFiles.get(key);
+ if (file != null)
+ file.delete();
+ }
+ }
+
+ public void deleteAll()
+ {
+ synchronized(_tempFiles) {
+ for (Iterator iter = _tempFiles.values().iterator(); iter.hasNext();)
+ {
+ File file = (File) iter.next();
+ file.delete();
+ }
+ }
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/internal/util/TeamActivationOrderComparator.java b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/internal/util/TeamActivationOrderComparator.java
new file mode 100644
index 000000000..016f8efcd
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/internal/util/TeamActivationOrderComparator.java
@@ -0,0 +1,45 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id$
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.debug.internal.util;
+
+import java.util.Comparator;
+
+import org.eclipse.objectteams.otdt.debug.TeamInstance;
+
+public class TeamActivationOrderComparator implements Comparator
+{
+ public int compare(Object o1, Object o2)
+ {
+ TeamInstance team1 = (TeamInstance)o1;
+ TeamInstance team2 = (TeamInstance)o2;
+
+ if (team1.getActivationTime() > team2.getActivationTime())
+ return -1;
+
+ if (team1.getActivationTime() == team2.getActivationTime())
+ return 0;
+
+ if (team1.getActivationTime() < team2.getActivationTime())
+ return 1;
+
+ return 0;
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/internal/util/TeamActivationTimeComparator.java b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/internal/util/TeamActivationTimeComparator.java
new file mode 100644
index 000000000..975b1a487
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/internal/util/TeamActivationTimeComparator.java
@@ -0,0 +1,45 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id$
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.debug.internal.util;
+
+import java.util.Comparator;
+
+import org.eclipse.objectteams.otdt.debug.TeamInstance;
+
+public class TeamActivationTimeComparator implements Comparator
+{
+ public int compare(Object o1, Object o2)
+ {
+ TeamInstance team1 = (TeamInstance)o1;
+ TeamInstance team2 = (TeamInstance)o2;
+
+ if (team1.getActivationTime() < team2.getActivationTime())
+ return -1;
+
+ if (team1.getActivationTime() == team2.getActivationTime())
+ return 0;
+
+ if (team1.getActivationTime() > team2.getActivationTime())
+ return 1;
+
+ return 0;
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/internal/util/TeamInstantiantionComparator.java b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/internal/util/TeamInstantiantionComparator.java
new file mode 100644
index 000000000..0298567fd
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/internal/util/TeamInstantiantionComparator.java
@@ -0,0 +1,45 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id$
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.debug.internal.util;
+
+import java.util.Comparator;
+
+import org.eclipse.objectteams.otdt.debug.TeamInstance;
+
+public class TeamInstantiantionComparator implements Comparator
+{
+ public int compare(Object o1, Object o2)
+ {
+ TeamInstance team1 = (TeamInstance)o1;
+ TeamInstance team2 = (TeamInstance)o2;
+
+ if (team1.getCreationTime() < team2.getCreationTime())
+ return -1;
+
+ if (team1.getCreationTime() == team2.getCreationTime())
+ return 0;
+
+ if (team1.getCreationTime() > team2.getCreationTime())
+ return 1;
+
+ return 0;
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/internal/util/TeamNameComparator.java b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/internal/util/TeamNameComparator.java
new file mode 100644
index 000000000..52f509e6f
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/internal/util/TeamNameComparator.java
@@ -0,0 +1,49 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id$
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.debug.internal.util;
+
+import java.util.Comparator;
+
+import org.eclipse.debug.core.DebugException;
+import org.eclipse.objectteams.otdt.debug.TeamInstance;
+
+public class TeamNameComparator implements Comparator
+{
+ public int compare(Object o1, Object o2)
+ {
+ TeamInstance team1 = (TeamInstance)o1;
+ TeamInstance team2 = (TeamInstance)o2;
+
+ int order = 0;
+ try
+ {
+ String teamName1 = team1.getReferenceTypeName();
+ String teamName2 = team2.getReferenceTypeName();
+ order = teamName1.compareTo(teamName2);
+ }
+ catch (DebugException e)
+ {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ return order;
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.jdt.ui/.classpath b/plugins/org.eclipse.objectteams.otdt.jdt.ui/.classpath
new file mode 100644
index 000000000..987380a81
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.jdt.ui/.classpath
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <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="con" path="OTRE"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/org.eclipse.objectteams.otdt.jdt.ui/.project b/plugins/org.eclipse.objectteams.otdt.jdt.ui/.project
new file mode 100644
index 000000000..51ac30568
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.jdt.ui/.project
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.objectteams.otdt.jdt.ui</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.objectteams.otdt.builder.OTJBuilder</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.jdt.core.javanature</nature>
+ <nature>org.objectteams.otdt.OTJavaNature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/org.eclipse.objectteams.otdt.jdt.ui/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.objectteams.otdt.jdt.ui/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..ac7221061
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.jdt.ui/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,17 @@
+#Wed Feb 03 00:49:52 CET 2010
+eclipse.preferences.version=1
+org.objectteams.otdt.compiler.option.scoped_keywords=enabled
+org.objectteams.otdt.compiler.problem.abstract_potential_relevant_role=warning
+org.objectteams.otdt.compiler.problem.adapting_deprecated=error
+org.objectteams.otdt.compiler.problem.ambiguous_lowering=warning
+org.objectteams.otdt.compiler.problem.basecall=warning
+org.objectteams.otdt.compiler.problem.binding_conventions=warning
+org.objectteams.otdt.compiler.problem.decapsulation=warning
+org.objectteams.otdt.compiler.problem.deprecated_path_syntax=warning
+org.objectteams.otdt.compiler.problem.exception_in_guard=error
+org.objectteams.otdt.compiler.problem.fragile_callin=warning
+org.objectteams.otdt.compiler.problem.inferred_callout=warning
+org.objectteams.otdt.compiler.problem.override_final_role=error
+org.objectteams.otdt.compiler.problem.potential_ambiguous_playedby=warning
+org.objectteams.otdt.compiler.problem.unsafe_role_instantiation=warning
+org.objectteams.otdt.compiler.problem.weave_into_system_class=warning
diff --git a/plugins/org.eclipse.objectteams.otdt.jdt.ui/META-INF/MANIFEST.MF b/plugins/org.eclipse.objectteams.otdt.jdt.ui/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..616f7c278
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.jdt.ui/META-INF/MANIFEST.MF
@@ -0,0 +1,30 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: OT-Adaptor for the JDT-UI
+Bundle-SymbolicName: org.eclipse.objectteams.otdt.jdt.ui;singleton:=true
+Bundle-Version: 1.4.0.qualifier
+Require-Bundle: org.eclipse.objectteams.otequinox,
+ org.eclipse.jdt.ui,
+ org.eclipse.jdt.core;bundle-version="[3.5.0.v_OTDT_r131,4.0.0)",
+ org.eclipse.core.runtime,
+ org.eclipse.core.resources,
+ org.eclipse.jface.text,
+ org.eclipse.ltk.core.refactoring,
+ org.eclipse.swt,
+ org.eclipse.jface,
+ org.eclipse.ui,
+ org.eclipse.objectteams.otdt.ui,
+ org.eclipse.ui.ide,
+ org.eclipse.ui.workbench,
+ org.eclipse.ui.editors,
+ org.eclipse.ui.workbench.texteditor,
+ org.eclipse.compare,
+ org.eclipse.ui.views,
+ org.eclipse.core.filesystem
+Bundle-Vendor: TU Berlin
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ActivationPolicy: lazy
+Bundle-Localization: plugin
+Export-Package: org.eclipse.objectteams.otdt.internal.ui.assist;x-friends:="org.eclipse.objectteams.otdt.ui.tests",
+ org.eclipse.objectteams.otdt.internal.ui.packageview;x-friends:="org.eclipse.objectteams.otdt.ui.tests"
+
diff --git a/plugins/org.eclipse.objectteams.otdt.jdt.ui/build.properties b/plugins/org.eclipse.objectteams.otdt.jdt.ui/build.properties
new file mode 100644
index 000000000..bfad04584
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.jdt.ui/build.properties
@@ -0,0 +1,5 @@
+source.. = src/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ plugin.properties
diff --git a/plugins/org.eclipse.objectteams.otdt.jdt.ui/plugin.properties b/plugins/org.eclipse.objectteams.otdt.jdt.ui/plugin.properties
new file mode 100644
index 000000000..830aad253
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.jdt.ui/plugin.properties
@@ -0,0 +1,2 @@
+BoundRoleDecorator_description=Decorates bound role classes with an indicator
+OverridingRoleDecorator_description=Decorates overriding role classes with an indicator \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.jdt.ui/plugin.xml b/plugins/org.eclipse.objectteams.otdt.jdt.ui/plugin.xml
new file mode 100644
index 000000000..67e2e964d
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.jdt.ui/plugin.xml
@@ -0,0 +1,185 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+
+<!-- Object Teams code assist: -->
+ <extension
+ point="org.eclipse.jdt.ui.quickFixProcessors"
+ id="org.eclipse.objectteams.otdt.ui.text.correction.QuickFixes"
+ name="OT/J Quick Fixes">
+ <quickFixProcessor
+ name="OT/J Quick Fix Processor"
+ class="org.eclipse.objectteams.otdt.internal.ui.text.correction.QuickFixProcessor"
+ id="org.eclipse.objectteams.otdt.ui.text.correction.QuickFixProcessor">
+ </quickFixProcessor>
+ </extension>
+
+<!-- OT/Equinox aspect relationships. -->
+ <extension
+ point="org.eclipse.objectteams.otequinox.aspectBindings">
+
+ <aspectBinding icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/calloutbinding_obj.gif">
+ <basePlugin
+ icon="platform:/plugin/org.eclipse.pde.ui/icons/obj16/plugin_obj.gif"
+ id="org.eclipse.jface"/>
+ <team
+ activation="NONE"
+ class="org.eclipse.objectteams.otdt.internal.ui.viewsupport.JFaceDecapsulator"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif"/>
+ <!-- decapsulation only; only the sub-team ViewAdaptor is activated -->
+ </aspectBinding>
+ <aspectBinding icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/calloutbinding_obj.gif">
+ <basePlugin
+ icon="platform:/plugin/org.eclipse.pde.ui/icons/obj16/plugin_obj.gif"
+ id="org.eclipse.jface.text"/>
+ <team
+ activation="ALL_THREADS"
+ class="org.eclipse.objectteams.otdt.internal.ui.assist.LinkedModeAdaptor"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif" />
+ </aspectBinding>
+ <aspectBinding icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/calloutbinding_obj.gif">
+ <basePlugin
+ icon="platform:/plugin/org.eclipse.pde.ui/icons/obj16/plugin_obj.gif"
+ id="org.eclipse.jdt.ui"/>
+ <team
+ activation="ALL_THREADS"
+ class="org.eclipse.objectteams.otdt.internal.ui.assist.OTQuickFixes"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif"/>
+ <team
+ activation="ALL_THREADS"
+ class="org.eclipse.objectteams.otdt.internal.ui.assist.CompletionAdaptor"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif"/>
+ <team
+ activation="ALL_THREADS"
+ class="org.eclipse.objectteams.otdt.internal.ui.search.FindActionAdaptor"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif"/>
+ <team
+ activation="ALL_THREADS"
+ class="org.eclipse.objectteams.otdt.internal.ui.viewsupport.ViewAdaptor"
+ superclass="org.eclipse.objectteams.otdt.internal.ui.viewsupport.JFaceDecapsulator"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif"/>
+ <team
+ activation="ALL_THREADS"
+ class="org.eclipse.objectteams.otdt.internal.ui.viewsupport.JavaElementAdaptation"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif"/>
+ <team
+ activation="ALL_THREADS"
+ class="org.eclipse.objectteams.otdt.internal.corext.RoleFileAdaptor"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif"/>
+ <team
+ activation="ALL_THREADS"
+ class="org.eclipse.objectteams.otdt.internal.corext.BindingHierarchyAdaptor"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif"/>
+ <team
+ activation="ALL_THREADS"
+ class="org.eclipse.objectteams.otdt.internal.corext.DOMAdaptor"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif"/>
+ <team
+ activation="ALL_THREADS"
+ class="org.eclipse.objectteams.otdt.internal.corext.CallHierarchyAdaptor"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif"/>
+ <team
+ activation="ALL_THREADS"
+ class="org.eclipse.objectteams.otdt.internal.corext.CodeManipulationAdaptor"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif"/>
+ <!-- no activation due to https://bugs.eclipse.org/bugs/show_bug.cgi?id=142299 -->
+ <team
+ activation="NONE"
+ class="org.eclipse.objectteams.otdt.internal.ui.text.OutlineAdaptor"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif"/>
+ <team
+ activation="ALL_THREADS"
+ class="org.eclipse.objectteams.otdt.internal.ui.javaeditor.HighlightingAdaptor"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif"/>
+ <team
+ activation="ALL_THREADS"
+ class="org.eclipse.objectteams.otdt.internal.ui.javaeditor.AnnotationAdaptor"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif"/>
+ <team
+ activation="ALL_THREADS"
+ class="org.eclipse.objectteams.otdt.internal.ui.packageview.PackageExplorerAdaptor"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif"/>
+ <team
+ activation="ALL_THREADS"
+ class="org.eclipse.objectteams.otdt.ui.javaeditor.JavaOutlinePageAdaptor"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif">
+ </team>
+ <team
+ activation="ALL_THREADS"
+ class="org.eclipse.objectteams.otdt.internal.ui.assist.CorrectionAdaptor"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif">
+ </team>
+ <team
+ activation="ALL_THREADS"
+ class="org.eclipse.objectteams.otdt.internal.ui.search.SearchAdaptor"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif">
+ </team>
+ <team
+ activation="ALL_THREADS"
+ class="org.eclipse.objectteams.otdt.internal.ui.util.HierarchyUtilAdaptor"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif"/>
+ <team
+ activation="ALL_THREADS"
+ class="org.eclipse.objectteams.otdt.internal.ui.typehierarchy.TypeHierarchyViewAdaptor"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif"/>
+ <team
+ activation="ALL_THREADS"
+ class="org.eclipse.objectteams.otdt.internal.ui.javaeditor.JavaEditorAdaptor"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif">
+ </team>
+ </aspectBinding>
+ <aspectBinding icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/calloutbinding_obj.gif">
+ <basePlugin
+ icon="platform:/plugin/org.eclipse.pde.ui/icons/obj16/plugin_obj.gif"
+ id="org.eclipse.ui.workbench" />
+ <team
+ activation="ALL_THREADS"
+ class="org.eclipse.objectteams.otdt.internal.ui.viewsupport.DecoratorManagerAdaptor"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif"/>
+ </aspectBinding>
+ <aspectBinding icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/calloutbinding_obj.gif">
+ <basePlugin
+ icon="platform:/plugin/org.eclipse.pde.ui/icons/obj16/plugin_obj.gif"
+ id="org.eclipse.jdt.core"/>
+ <team
+ activation="ALL_THREADS"
+ class="org.eclipse.objectteams.otdt.internal.ui.assist.BaseImportRewriting"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif"/>
+ <team
+ activation="NONE"
+ class="org.eclipse.objectteams.otdt.internal.ui.assist.QuickFixCoreAdaptor"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif"/>
+ <team
+ activation="NONE"
+ class="org.eclipse.objectteams.otdt.internal.ui.viewsupport.PretendAllRoleFilesArePublic"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif">
+ </team>
+ </aspectBinding>
+ </extension>
+ <extension
+ point="org.eclipse.ui.decorators">
+ <decorator
+ class="org.eclipse.objectteams.otdt.internal.ui.viewsupport.DummyDecorator"
+ id="org.eclipse.objectteams.otdt.jdt.ui.overridingRoleDecorator"
+ label="OT/J Role Override Indicator"
+ lightweight="true"
+ location="BOTTOM_RIGHT"
+ state="true">
+ <description>
+ %OverridingRoleDecorator_description
+ </description>
+ </decorator>
+ <decorator
+ class="org.eclipse.objectteams.otdt.internal.ui.viewsupport.DummyDecorator"
+ id="org.eclipse.objectteams.otdt.jdt.ui.boundRoleDecorator"
+ label="OT/J Bound Role Indicator"
+ lightweight="true"
+ location="TOP_RIGHT"
+ state="true">
+ <description>
+ %BoundRoleDecorator_description
+ </description>
+ </decorator>
+ </extension>
+
+</plugin>
diff --git a/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/corext/BindingHierarchyAdaptor.java b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/corext/BindingHierarchyAdaptor.java
new file mode 100644
index 000000000..c533799f7
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/corext/BindingHierarchyAdaptor.java
@@ -0,0 +1,52 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2006, 2007 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: BindingHierarchyAdaptor.java 23438 2010-02-04 20:05:24Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.corext;
+
+import org.eclipse.jdt.core.dom.IMethodBinding;
+import org.eclipse.jdt.core.dom.ITypeBinding;
+
+import base org.eclipse.jdt.internal.corext.dom.Bindings;
+/**
+ * This team adapts the override markers in order to filter out the generated
+ * relation between a class part and its interface part.
+ *
+ * @author stephan
+ */
+@SuppressWarnings("restriction")
+public team class BindingHierarchyAdaptor
+{
+ protected class OverrideMarkerAdaptor playedBy Bindings
+ {
+ findOverriddenMethodInHierarchy <- replace findOverriddenMethodInHierarchy;
+ @SuppressWarnings("basecall")
+ static callin IMethodBinding findOverriddenMethodInHierarchy(ITypeBinding type, IMethodBinding binding)
+ {
+ ITypeBinding declaringClass = binding.getDeclaringClass();
+ if (declaringClass.isClassPartOf(type)) {
+ // if type is the interfacepart of declaringClass
+ // the real superInterfaces are in type.getInterfaces():
+ for (ITypeBinding superIfc : type.getInterfaces()) {
+ IMethodBinding method = base.findOverriddenMethodInHierarchy(superIfc, binding);
+ if (method != null)
+ return method;
+ }
+ return null;
+ }
+ return base.findOverriddenMethodInHierarchy(type, binding);
+ }
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/corext/CallHierarchyAdaptor.java b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/corext/CallHierarchyAdaptor.java
new file mode 100644
index 000000000..6d445e782
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/corext/CallHierarchyAdaptor.java
@@ -0,0 +1,355 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2006, 2007 Technical University Berlin, Germany and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: CallHierarchyAdaptor.java 23438 2010-02-04 20:05:24Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ * IBM Corporation - copies of individual methods from bound base classes.
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.corext;
+
+import static org.eclipse.jdt.internal.core.search.matching.MethodPattern.findingCallers;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.StringTokenizer;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IMember;
+import org.eclipse.jdt.core.IMethod;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.core.search.SearchMatch;
+import org.eclipse.jdt.internal.corext.callhierarchy.MethodCall;
+import org.eclipse.objectteams.otdt.core.ICallinMapping;
+import org.eclipse.objectteams.otdt.core.ICalloutMapping;
+import org.eclipse.objectteams.otdt.core.IMethodMapping;
+import org.eclipse.objectteams.otdt.core.IOTJavaElement;
+import org.eclipse.objectteams.otdt.core.IOTType;
+import org.eclipse.objectteams.otdt.core.IRoleType;
+import org.eclipse.objectteams.otdt.core.OTModelManager;
+import org.eclipse.objectteams.otdt.core.compiler.IOTConstants;
+import org.eclipse.objectteams.otdt.core.compiler.OTNameUtils;
+import org.eclipse.objectteams.otdt.internal.core.compiler.ast.CallinMappingDeclaration;
+
+import base org.eclipse.jdt.internal.corext.callhierarchy.CallSearchResultCollector;
+import base org.eclipse.jdt.internal.corext.callhierarchy.CalleeMethodWrapper;
+import base org.eclipse.jdt.internal.corext.callhierarchy.CallerMethodWrapper;
+import base org.eclipse.jdt.internal.corext.callhierarchy.MethodReferencesSearchRequestor;
+import base org.eclipse.jdt.internal.corext.callhierarchy.MethodWrapper;
+import base org.eclipse.jdt.internal.ui.callhierarchy.CallHierarchyContentProvider;
+
+/**
+ * This class allows the call hierarchy to cope with callin/callout method mappings.
+ *
+ * @author stephan
+ */
+@SuppressWarnings({"restriction", "decapsulation"})
+public team class CallHierarchyAdaptor
+{
+
+ /**
+ * Purpose: accept method mappings, too.
+ */
+ protected class MappingReferenceSearchRequestor playedBy MethodReferencesSearchRequestor
+ {
+ acceptSearchMatch <- replace acceptSearchMatch;
+ @SuppressWarnings("basecall")
+ callin void acceptSearchMatch(SearchMatch match) {
+ // COPY&PASTE from base version
+ if (getRequireExactMatch() && (match.getAccuracy() != SearchMatch.A_ACCURATE)) {
+ return;
+ }
+
+ if (match.isInsideDocComment()) {
+ return;
+ }
+
+ if (match.getElement() != null && match.getElement() instanceof IMember) {
+ IMember member= (IMember) match.getElement();
+ switch (member.getElementType()) {
+ case IJavaElement.METHOD:
+ case IJavaElement.TYPE:
+ case IJavaElement.FIELD:
+ case IJavaElement.INITIALIZER:
+//{ObjectTeams: the payload:
+ case IOTJavaElement.CALLIN_MAPPING:
+ case IOTJavaElement.CALLOUT_MAPPING:
+ case IOTJavaElement.CALLOUT_TO_FIELD_MAPPING:
+// SH}
+ getSearchResults().addMember(member, member, match.getOffset(), match.getOffset()+match.getLength());
+ break;
+ }
+ }
+ }
+
+ boolean getRequireExactMatch() -> get boolean fRequireExactMatch;
+ CallSearchResultCollector getSearchResults() -> get CallSearchResultCollector fSearchResults;
+ }
+
+ /**
+ * Count method mappings as legal children, too.
+ */
+ protected class ContentProvider playedBy CallHierarchyContentProvider
+ {
+ boolean hasChildren(MethodMappingWrapper wrapper) <- replace boolean hasChildren(Object element)
+ base when (element instanceof MethodWrapper)
+ with { wrapper <- (MethodWrapper)element }
+
+ callin boolean hasChildren(MethodMappingWrapper methodWrapper) {
+ if (base.hasChildren(methodWrapper))
+ return true;
+ switch (methodWrapper.getMember().getElementType()) {
+ case IOTJavaElement.CALLIN_MAPPING:
+ case IOTJavaElement.CALLOUT_MAPPING:
+ case IOTJavaElement.CALLOUT_TO_FIELD_MAPPING:
+ break; // continue below
+ default:
+ return false;
+ }
+ if (shouldStopTraversion(methodWrapper)) {
+ return false;
+ }
+ return true;
+ }
+ boolean shouldStopTraversion(MethodMappingWrapper methodWrapper) -> boolean shouldStopTraversion(MethodWrapper methodWrapper);
+ }
+
+ /**
+ * Implement new strategies for finding children of method mappings. General part.
+ */
+ @SuppressWarnings("abstractrelevantrole") // MethodWrapper is abstract, both sub classes are bound individually
+ abstract protected class MethodMappingWrapper playedBy MethodWrapper
+ {
+ doFindChildren <- replace doFindChildren;
+ @SuppressWarnings({ "basecall", "unchecked", "rawtypes" })
+ callin void doFindChildren(IProgressMonitor progressMonitor) {
+ IMember member = getMember();
+ IMember[] children = null;
+ if ( member.getElementType() == IOTJavaElement.CALLIN_MAPPING
+ || member.getElementType() == IOTJavaElement.CALLOUT_MAPPING)
+ {
+ Map existingResults = lookupMethod(getMethodCall());
+ if (existingResults != null && !existingResults.isEmpty()) {
+ Map newElements = new HashMap();
+ setElementMap(newElements);
+ newElements.putAll(existingResults);
+ return; // successfully done
+ } else {
+ // try direct lookup instead of searching:
+ try {
+ children = (member.getElementType() == IOTJavaElement.CALLIN_MAPPING) ?
+ getCallinMethods((ICallinMapping)member) :
+ getCalloutMethods((ICalloutMapping)member);
+ } catch (JavaModelException e) {
+ return; // search failed
+ }
+ }
+ } else if (isGuardPredicate(member)) {
+ // directly fetch affected callins without search
+ children = getCallinsAffectedByGuard(member);
+ }
+ if (children != null)
+ // if found add result:
+ addReferencedMembers(children);
+ else
+ // nothing-found scenarii, revert to normal behavior:
+ base.doFindChildren(progressMonitor);
+ }
+
+ private void addReferencedMembers(IMember[] children) {
+ initCalls(); // orig from doFindChildren()
+ Map<String, MethodCall> newElements = getFElements();
+ for (IMember method : children) {
+ MethodCall methodCall = new MethodCall(method);
+ addCallToCache(methodCall); // see performSearch()
+ newElements.put(method.getHandleIdentifier(), methodCall);
+ }
+ }
+ private boolean isGuardPredicate(IMember member) {
+ if (member.getElementType() != IJavaElement.METHOD)
+ return false;
+ String selector = member.getElementName();
+ return OTNameUtils.isPredicate(selector.toCharArray());
+ }
+
+ // hooks:
+ abstract IMethod[] getCallinMethods(ICallinMapping callinMapping) throws JavaModelException;
+ abstract IMethod[] getCalloutMethods(ICalloutMapping calloutMapping) throws JavaModelException;
+ IMember[] getCallinsAffectedByGuard(IMember member) {
+ /* default: */ return null;
+ }
+
+ // callouts:
+ @SuppressWarnings("rawtypes")
+ void setElementMap(Map map) -> set Map fElements;
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ Map<String, MethodCall> getFElements() -> get Map fElements;
+ void setMethodCall(MethodCall methodCall) -> set MethodCall fMethodCall;
+ void initCalls() -> void initCalls();
+ IMember getMember() -> IMember getMember();
+ MethodCall getMethodCall() -> MethodCall getMethodCall();
+ @SuppressWarnings("rawtypes")
+ Map lookupMethod(MethodCall methodCall) -> Map lookupMethod(MethodCall methodCall);
+ void addCallToCache(MethodCall methodCall) -> void addCallToCache(MethodCall methodCall);
+ }
+
+ /**
+ * Special case method wrapper: Callee direction. Relies on smart lifting.
+ * FIXME(SH): This class is mainly untested yet.
+ * Find out how the original visitors work and how they must be adapted.
+ */
+ protected class CalleeMethodMappingWrapper
+ extends MethodMappingWrapper
+ playedBy CalleeMethodWrapper
+ {
+ @Override
+ public IMethod[] getCallinMethods(ICallinMapping callinMapping)
+ throws JavaModelException
+ {
+ return new IMethod[] {callinMapping.getRoleMethod()};
+ }
+ @Override
+ public IMethod[] getCalloutMethods(ICalloutMapping calloutMapping)
+ throws JavaModelException
+ {
+ return new IMethod[] {calloutMapping.getBoundBaseMethod()};
+ }
+ }
+
+ /**
+ * Special case method wrapper: Caller direction. Relies on smart lifting.
+ */
+ protected class CallerMethodMappingWrapper
+ extends MethodMappingWrapper
+ playedBy CallerMethodWrapper
+ {
+ @Override
+ public IMethod[] getCallinMethods(ICallinMapping callinMapping)
+ throws JavaModelException
+ {
+ // no need for searching: our callers are explicitly listed here:
+ return callinMapping.getBoundBaseMethods();
+ }
+ @Override
+ public IMethod[] getCalloutMethods(ICalloutMapping calloutMapping)
+ throws JavaModelException
+ {
+ return null; // calloutMapping.getRoleMethod() is not useful, revert to normal searching.
+ }
+
+ /**
+ * Investigate predicate method name and collect all callins
+ * affected by this guard.
+ */
+ @Override
+ IMember[] getCallinsAffectedByGuard(IMember member) {
+ IType declaringClass = member.getDeclaringType();
+ String suffix = null; // what comes after _OT$when or _OT$base_when
+ String selector = member.getElementName();
+ if (selector.startsWith(String.valueOf(IOTConstants.PREDICATE_METHOD_NAME))) {
+ // regular guard
+ if (selector.length() == IOTConstants.PREDICATE_METHOD_NAME.length)
+ ; // no suffix
+ else
+ suffix = selector.substring(IOTConstants.PREDICATE_METHOD_NAME.length);
+ } else if (selector.equals(String.valueOf(IOTConstants.BASE_PREDICATE_PREFIX))) {
+ // base guard
+ if (selector.length() == IOTConstants.BASE_PREDICATE_PREFIX.length)
+ ; // no suffix
+ else
+ suffix = selector.substring(IOTConstants.BASE_PREDICATE_PREFIX.length);
+ }
+ if (suffix == null) {
+ // class level predicate
+ IOTType otType = OTModelManager.getOTElement(declaringClass);
+ ArrayList<IMember> result = new ArrayList<IMember> ();
+ if (otType.isTeam()) {
+ try {
+ IType[] roles = otType.getRoleTypes();
+ for (IType type : roles) {
+ IRoleType roleType = (IRoleType) OTModelManager.getOTElement(type);
+ for (IMember m : roleType.getMethodMappings(IRoleType.CALLINS))
+ result.add(m);
+ }
+ } catch (JavaModelException jme) {
+ // no success retrieving roles, proceed below
+ }
+ }
+ if (otType.isRole())
+ for (IMember m : ((IRoleType)otType).getMethodMappings(IRoleType.CALLINS))
+ result.add(m);
+ return result.toArray(new IMember[result.size()]);
+ } else {
+ StringTokenizer tokens = new StringTokenizer(suffix, "$");
+ ArrayList<IMember> mList = new ArrayList<IMember>();
+ switch (tokens.countTokens()) {
+ case 1: // role method guard
+ try {
+ selector = tokens.nextToken();
+ for (IMethod method : declaringClass.getMethods())
+ if (method.getElementName().equals(selector))
+ mList.add(method);
+ } catch (JavaModelException e) {
+ // failed to retrieve methods -> no result
+ }
+ break;
+ case 3: // binding guard (s.t. like "roleMeth$after$baseMeth")
+ String roleSelector = tokens.nextToken();
+ String modifier = tokens.nextToken();
+ String baseSelector = tokens.nextToken();
+ IRoleType roleType = (IRoleType) OTModelManager.getOTElement(declaringClass);
+ mappings:
+ for (IMethodMapping mapping : roleType.getMethodMappings(IRoleType.CALLINS)) {
+ if (mapping.getRoleMethod().getElementName().equals(roleSelector)) {
+ int callinKind = ((ICallinMapping)mapping).getCallinKind();
+ if (CallinMappingDeclaration.callinModifier(callinKind).equals(modifier))
+ {
+ try {
+ for (IMethod baseMethod : ((ICallinMapping)mapping).getBoundBaseMethods())
+ if (baseMethod.getElementName().equals(baseSelector)) {
+ mList.add(mapping);
+ continue mappings;
+ }
+ } catch (JavaModelException e) {
+ // failed to resolve base methods, proceed to next mapping
+ }
+ }
+ }
+ }
+ }
+ return mList.toArray(new IMember[mList.size()]);
+ }
+ }
+
+ // while searching for children in a caller-hierarchy, constrain all
+ // method-mapping matches to the non-declaration side.
+ callin void findChildren() {
+ findingCallers.set(new Object());
+ try {
+ base.findChildren();
+ } finally {
+ findingCallers.remove();
+ }
+ }
+ findChildren <- replace findChildren;
+
+ }
+
+ /** Handle for an invisible class. */
+ protected class CallSearchResultCollector playedBy CallSearchResultCollector
+ {
+ protected void addMember(IMember member, IMember calledMember, int start, int end) -> void addMember(IMember member, IMember calledMember, int start, int end);
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/corext/CodeManipulationAdaptor.java b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/corext/CodeManipulationAdaptor.java
new file mode 100644
index 000000000..d78a83377
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/corext/CodeManipulationAdaptor.java
@@ -0,0 +1,223 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2006, 2007 Technical University Berlin, Germany and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: CodeManipulationAdaptor.java 23438 2010-02-04 20:05:24Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ * IBM Corporation - copies of individual methods from bound base classes.
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.corext;
+
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.jdt.core.Flags;
+import org.eclipse.jdt.core.IField;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.core.dom.AST;
+import org.eclipse.jdt.core.dom.ASTNode;
+import org.eclipse.jdt.core.dom.AbstractTypeDeclaration;
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jdt.core.dom.FieldAccessSpec;
+import org.eclipse.jdt.core.dom.IBinding;
+import org.eclipse.jdt.core.dom.ITypeBinding;
+import org.eclipse.jdt.core.dom.MethodSpec;
+import org.eclipse.jdt.core.dom.Modifier;
+import org.eclipse.jdt.core.dom.SimpleName;
+import org.eclipse.jdt.core.dom.Type;
+import org.eclipse.jdt.core.dom.TypeLiteral;
+import org.eclipse.jdt.core.search.TypeNameMatch;
+import org.eclipse.jdt.internal.corext.dom.Bindings;
+import org.eclipse.objectteams.otdt.core.compiler.IOTConstants;
+
+import base org.eclipse.jdt.internal.corext.codemanipulation.GetterSetterUtil;
+import base org.eclipse.jdt.internal.corext.codemanipulation.ImportReferencesCollector;
+import base org.eclipse.jdt.internal.corext.codemanipulation.OrganizeImportsOperation;
+import base org.eclipse.jdt.internal.corext.codemanipulation.OrganizeImportsOperation.TypeReferenceProcessor;
+import base org.eclipse.jdt.internal.corext.dom.ScopeAnalyzer;
+
+
+/**
+ * @author stephan
+ */
+@SuppressWarnings({"restriction","decapsulation"})
+public team class CodeManipulationAdaptor
+{
+ protected class TypeReferenceProcessor playedBy TypeReferenceProcessor
+ {
+ ScopeAnalyzer fAnalyzer() -> get ScopeAnalyzer fAnalyzer;
+
+ needsImport <- replace needsImport;
+ @SuppressWarnings({ "basecall", "unchecked" })
+ callin boolean needsImport(ITypeBinding typeBinding, SimpleName ref)
+ {
+ // OT_COPY_PASTE:
+
+//{ObjectTeams: check if we need to apply OT-specific strategy:
+ boolean isTeam = false;
+ // cache:
+ ScopeAnalyzer analyzer = fAnalyzer();
+ List<AbstractTypeDeclaration> types = analyzer.fRoot().types();
+ for (AbstractTypeDeclaration type : types) {
+ if (Modifier.isTeam(type.getModifiers())) {
+ isTeam = true;
+ break;
+ }
+ }
+ if (!isTeam) // simply use the original version:
+ return base.needsImport(typeBinding, ref);
+// SH}
+
+ if (!typeBinding.isTopLevel() && !typeBinding.isMember()) {
+ return false; // no imports for anonymous, local, primitive types or parameters types
+ }
+// disable visibility issues for OT:
+// int modifiers= typeBinding.getModifiers();
+// if (Modifier.isPrivate(modifiers)) {
+// return false; // imports for privates are not required
+// }
+ ITypeBinding currTypeBinding= Bindings.getBindingOfParentType(ref);
+ if (currTypeBinding == null) {
+ return false; // not in a type
+ }
+// disable for OT:
+// if (!Modifier.isPublic(modifiers)) {
+// if (!currTypeBinding.getPackage().getName().equals(typeBinding.getPackage().getName())) {
+// return false; // not visible
+// }
+// }
+
+ ASTNode parent= ref.getParent();
+ while (parent instanceof Type) {
+ parent= parent.getParent();
+ }
+ if (parent instanceof AbstractTypeDeclaration && parent.getParent() instanceof CompilationUnit) {
+ return true;
+ }
+
+ if (typeBinding.isMember()) {
+//{ObjectTeams: never import a role
+ if (typeBinding.isRole())
+ return false;
+// SH}
+ // use cached instance:
+ if (analyzer.isDeclaredInScope(typeBinding, ref, analyzer.TYPES | analyzer.CHECK_VISIBILITY))
+ return false;
+ }
+ return true;
+ }
+
+ isOfKind <- replace isOfKind;
+
+ @SuppressWarnings("basecall")
+ callin boolean isOfKind(TypeNameMatch curr) {
+ // a role type is NEVER a good guess for a missing import.
+ if (Flags.isRole(curr.getModifiers()))
+ return false;
+ return base.isOfKind(curr);
+ }
+
+ }
+
+ protected class ScopeAnalyzer playedBy ScopeAnalyzer
+ {
+ // expose constants as role fields:
+ protected int TYPES;
+ protected int CHECK_VISIBILITY;
+
+ ScopeAnalyzer(ScopeAnalyzer b) {
+ TYPES = getTYPES();
+ CHECK_VISIBILITY = getCHECK_VISIBILITY();
+ }
+
+ protected
+ boolean isDeclaredInScope(IBinding declaration, SimpleName selector, int flags) -> boolean isDeclaredInScope(IBinding declaration, SimpleName selector, int flags);
+ protected
+ CompilationUnit fRoot() -> get CompilationUnit fRoot;
+ // internal:
+ int getTYPES() -> get int TYPES;
+ int getCHECK_VISIBILITY() -> get int CHECK_VISIBILITY;
+ }
+ /**
+ * Make sure that method specs never trigger static imports of their
+ * references methods/fields.
+ */
+ protected class ImportReferencesCollector playedBy ImportReferencesCollector {
+ boolean inMethodSpec= false;
+ void setMethodSpec(boolean in) {
+ this.inMethodSpec= in;
+ }
+ void setMethodSpec(boolean in) <- after boolean visit(MethodSpec spec)
+ with { in <- true }
+ void setMethodSpec(boolean in) <- before void endVisit(MethodSpec spec)
+ with { in <- false}
+ void setMethodSpec(boolean in) <- after boolean visit(FieldAccessSpec spec)
+ with { in <- true }
+ void setMethodSpec(boolean in) <- before void endVisit(FieldAccessSpec spec)
+ with { in <- false}
+
+ @SuppressWarnings("basecall")
+ callin void possibleStaticImportFound() {
+ // nop
+ }
+ possibleStaticImportFound <- replace possibleStaticImportFound
+ when (this.inMethodSpec);
+ }
+
+ /**
+ * This role advises the OrganizeImportsOperation to create base imports for role files, too.
+ */
+ protected class OrganizeImports playedBy OrganizeImportsOperation {
+
+ @SuppressWarnings("unchecked")
+ void collectRoFiBaseReferences(CompilationUnit astRoot, List<SimpleName> typeReferences)
+ <- after boolean collectReferences(CompilationUnit astRoot, List typeReferences, List staticReferences, Set oldSingleImports, Set oldDemandImports)
+ base when (result);
+
+ void collectRoFiBaseReferences(CompilationUnit astRoot, List<SimpleName> typeReferences) {
+ for (String baseName : RoleFileAdaptor.getRoFiBaseClassNames(astRoot))
+ typeReferences.add(newTypeRef(astRoot, baseName));
+ }
+
+ SimpleName newTypeRef(CompilationUnit astRoot, String baseName) {
+ AST ast = astRoot.getAST();
+ SimpleName ref = ast.newSimpleName(baseName);
+ // wrap in a type literal so that downstream will reckognize this as a type reference
+ TypeLiteral wrapper = ast.newTypeLiteral();
+ wrapper.setType(ast.newSimpleType(ref));
+ return ref;
+ }
+ }
+
+ /**
+ * This role ensures nobody tries to create getters/setters for internal fields like _OT$base.
+ * This is done by generating an unexpected name which will be filtered out
+ * e.g. by GetterSetterCompletionProposal#evaluateProposals().
+ */
+ protected class GetterSetterUtil playedBy GetterSetterUtil
+ {
+ // this name does NOT start with "get" as expected.
+ final static String NOT_A_VALID_NAME = "_OT$notValidName"; //$NON-NLS-1$
+
+ String getGetterSetterName(IField field) <- replace
+ String getGetterName(IField field, String[] excludedNames),
+ String getSetterName(IField field, String[] excludedNames);
+
+ @SuppressWarnings("basecall")
+ static callin String getGetterSetterName(IField field) throws JavaModelException {
+ if (field.getElementName().startsWith(IOTConstants.OT_DOLLAR)) {
+ return NOT_A_VALID_NAME;
+ }
+ return base.getGetterSetterName(field);
+ }
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/corext/DOMAdaptor.java b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/corext/DOMAdaptor.java
new file mode 100644
index 000000000..ff1e9aac6
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/corext/DOMAdaptor.java
@@ -0,0 +1,55 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2006, 2007 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: DOMAdaptor.java 23438 2010-02-04 20:05:24Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.corext;
+
+import org.eclipse.jdt.core.dom.ASTNode;
+import org.eclipse.jdt.core.dom.CalloutMappingDeclaration;
+import org.eclipse.jdt.core.dom.RoleTypeDeclaration;
+import org.eclipse.jdt.core.dom.rewrite.ASTRewrite;
+import org.eclipse.jdt.core.dom.rewrite.ListRewrite;
+import base org.eclipse.jdt.internal.corext.dom.ModifierRewrite;
+
+/**
+ * This team adapts classes from org.eclipse.jdt.internal.corext.dom.
+ *
+ * Issues:
+ * - hard coded switch missing OT-cases.
+ *
+ * @author stephan
+ */
+@SuppressWarnings("restriction")
+public team class DOMAdaptor
+{
+ protected class ModifierRewrite playedBy ModifierRewrite
+ {
+ @SuppressWarnings("decapsulation")
+ evaluateListRewrite <- replace evaluateListRewrite;
+
+ /** Add missing switch case. */
+ @SuppressWarnings("basecall")
+ callin ListRewrite evaluateListRewrite(ASTRewrite rewrite, ASTNode declNode)
+ {
+ switch (declNode.getNodeType()) {
+ case ASTNode.ROLE_TYPE_DECLARATION:
+ return rewrite.getListRewrite(declNode, RoleTypeDeclaration.MODIFIERS2_PROPERTY);
+ case ASTNode.CALLOUT_MAPPING_DECLARATION:
+ return rewrite.getListRewrite(declNode, CalloutMappingDeclaration.MODIFIERS2_PROPERTY);
+ }
+ return base.evaluateListRewrite(rewrite, declNode);
+ }
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/corext/RoleFileAdaptor.java b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/corext/RoleFileAdaptor.java
new file mode 100644
index 000000000..94a024b15
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/corext/RoleFileAdaptor.java
@@ -0,0 +1,128 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2006, 2007 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: RoleFileAdaptor.java 23438 2010-02-04 20:05:24Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.corext;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IPackageFragment;
+import org.eclipse.jdt.core.IPackageFragmentRoot;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.core.dom.ASTNode;
+import org.eclipse.jdt.core.dom.AbstractTypeDeclaration;
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jdt.core.dom.ITypeBinding;
+import org.eclipse.jdt.core.dom.PackageDeclaration;
+import org.eclipse.jdt.core.dom.RoleTypeDeclaration;
+import org.eclipse.objectteams.otdt.core.IOTType;
+import org.eclipse.objectteams.otdt.core.IRoleType;
+import org.eclipse.objectteams.otdt.core.OTModelManager;
+
+import base org.eclipse.jdt.internal.corext.dom.Bindings;
+
+/**
+ * This team tells the jdt.ui how to handle role files.
+ *
+ * @author stephan
+ */
+@SuppressWarnings("restriction")
+public team class RoleFileAdaptor
+{
+ /** Adapt class Bindings. */
+ protected class BindingsAdaptor playedBy Bindings
+ {
+ /** Trigger: repair lookup of enclosing type for role files. */
+ getBindingOfParentType <- replace getBindingOfParentType;
+
+ /**
+ * Original method assumes parent of a nestedType is the enclosing type.
+ * Unfortunately the dom does not give direct access from a role file
+ * to its enclosing team.
+ */
+ @SuppressWarnings({"unchecked","basecall"}) // base call not issued if replacing behaviour executes
+ static callin ITypeBinding getBindingOfParentType(ASTNode node)
+ {
+ if (node.getNodeType() == ASTNode.COMPILATION_UNIT) {
+ List types = ((CompilationUnit)node).types();
+ for (int i=0; i<types.size(); i++) {
+ ASTNode type = ((ASTNode)types.get(i));
+ if (type.getNodeType() == ASTNode.ROLE_TYPE_DECLARATION)
+ return getTeamOfRoleFile((RoleTypeDeclaration)type);
+ }
+ }
+ return base.getBindingOfParentType(node);
+ }
+ /** Retrieve the enclosing team of a role file. */
+ private static ITypeBinding getTeamOfRoleFile(RoleTypeDeclaration roleType) {
+ return roleType.resolveBinding().getDeclaringClass();
+ }
+ }
+
+ /**
+ * Fetch all names of base classes referenced from the given CU.
+ * @param astRoot start searching packages from here.
+ * @return list of simple base class names.
+ */
+ @SuppressWarnings("unchecked")
+ public static List<String> getRoFiBaseClassNames(CompilationUnit astRoot) {
+ ArrayList<String> result = new ArrayList<String>();
+ List<AbstractTypeDeclaration> types = astRoot.types();
+ for (AbstractTypeDeclaration type : types) {
+ if (type.isTeam()) {
+ ITypeBinding typeBinding = type.resolveBinding();
+ String teamName = ""; //$NON-NLS-1$
+ if (typeBinding != null) {
+ teamName = typeBinding.getQualifiedName();
+ } else {
+ PackageDeclaration currentPackage = astRoot.getPackage();
+ if (currentPackage != null)
+ teamName = currentPackage.getName().getFullyQualifiedName()+'.';
+ teamName += type.getName().getIdentifier();
+ }
+ IJavaProject prj = astRoot.getJavaElement().getJavaProject();
+ try {
+ for (IPackageFragmentRoot roots : prj.getPackageFragmentRoots()) {
+ IPackageFragment pkg = roots.getPackageFragment(teamName);
+ if (pkg.exists())
+ for (IJavaElement cu : pkg.getChildren())
+ if (cu.getElementType() == IJavaElement.COMPILATION_UNIT)
+ for(IType roleType : ((org.eclipse.jdt.internal.core.CompilationUnit)cu).getTypes())
+ {
+ IOTType ottype = OTModelManager.getOTElement(roleType);
+ if (ottype != null && ottype.isRole()) {
+ String baseClass = ((IRoleType)ottype).getBaseclassName();
+ if (baseClass != null) {
+ // always remember as simple name:
+ int lastDot = baseClass.lastIndexOf('.');
+ if (lastDot > -1)
+ baseClass = baseClass.substring(lastDot+1);
+ result.add(baseClass);
+ }
+ }
+ }
+ }
+ } catch (JavaModelException e) {
+ // couldn't read team package, skip.
+ }
+ }
+ }
+ return result;
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/Messages.java b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/Messages.java
new file mode 100644
index 000000000..80e3e4bf9
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/Messages.java
@@ -0,0 +1,50 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2007 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: Messages.java 23438 2010-02-04 20:05:24Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = Messages.class.getName();
+
+ public static String Completion_method_binding_label;
+ public static String Completion_callout_label;
+ public static String Completion_callin_label;
+
+ public static String Completion_callout_to_field_label;
+
+ public static String Completion_default_lifting_constructor_label;
+
+ public static String OTLayoutActionGroup_MenuOTPresentations;
+ public static String OTLayoutActionGroup_MenuShowCallinLabels;
+ public static String OTLayoutActionGroup_MenuDontShowCallinLabels;
+
+ public static String PackageExplorer_DisplayRoleFilesAction;
+ public static String PackageExplorer_DisplayRoleFilesDescription;
+ public static String PackageExplorer_DisplayRoleFilesTooltip;
+
+ public static String QuickOutline__and_role_files;
+
+ public static String ViewAdaptor_guard_predicate_postfix;
+
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() { /* do not instantiate */ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/Messages.properties b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/Messages.properties
new file mode 100644
index 000000000..414b81592
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/Messages.properties
@@ -0,0 +1,16 @@
+OTLayoutActionGroup_MenuOTPresentations=OT presentation
+OTLayoutActionGroup_MenuShowCallinLabels=show callin label
+OTLayoutActionGroup_MenuDontShowCallinLabels=don't show callin label
+
+PackageExplorer_DisplayRoleFilesAction=Toggle Role File Containment
+PackageExplorer_DisplayRoleFilesTooltip=Display Role Files physically / logically
+PackageExplorer_DisplayRoleFilesDescription=Toggles the displaying of Role Files as team member types or toplevel types.
+
+Completion_method_binding_label=Binding to method in ''{0}''
+Completion_callout_label=Callout to method in ''{0}''
+Completion_callin_label=Callin from method in ''{0}''
+Completion_callout_to_field_label=Callout to field in ''{0}''
+Completion_default_lifting_constructor_label=Default lifting constructor
+
+QuickOutline__and_role_files=\ and role files
+ViewAdaptor_guard_predicate_postfix=\ - (guard predicate of {0})
diff --git a/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/assist/BaseImportRewriting.java b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/assist/BaseImportRewriting.java
new file mode 100644
index 000000000..ec99b277f
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/assist/BaseImportRewriting.java
@@ -0,0 +1,283 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2006, 2007 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: BaseImportRewriting.java 23438 2010-02-04 20:05:24Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.assist;
+
+
+import java.util.HashSet;
+import java.util.List;
+
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.dom.AbstractTypeDeclaration;
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jdt.core.dom.Name;
+import org.eclipse.jdt.core.dom.QualifiedName;
+import org.eclipse.jdt.core.dom.QualifiedType;
+import org.eclipse.jdt.core.dom.RoleTypeDeclaration;
+import org.eclipse.jdt.core.dom.SimpleName;
+import org.eclipse.jdt.core.dom.SimpleType;
+import org.eclipse.jdt.core.dom.Type;
+import org.eclipse.jdt.core.dom.TypeDeclaration;
+import org.eclipse.jdt.core.dom.rewrite.ImportRewrite.ImportRewriteContext;
+import org.eclipse.jdt.internal.compiler.ast.ASTNode;
+import org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration;
+import org.eclipse.jdt.internal.compiler.lookup.Binding;
+import org.eclipse.jdt.internal.compiler.lookup.Scope;
+import org.eclipse.objectteams.otdt.internal.corext.RoleFileAdaptor;
+
+import base org.eclipse.jdt.core.dom.rewrite.ImportRewrite;
+import base org.eclipse.jdt.internal.codeassist.CompletionEngine;
+import base org.eclipse.jdt.internal.codeassist.InternalCompletionProposal;
+import base org.eclipse.jdt.internal.codeassist.complete.CompletionParser;
+import base org.eclipse.jdt.internal.compiler.ast.TypeReference;
+
+/**
+ * This team advises the completion engine et al to produce base-imports if appropriate.
+ * It implements a DataRelayChain with the following stages:
+ *
+ * (1) CompletionParser
+ * (2) CompletionOnBaseTypeReference
+ * (3) CompletionEngine
+ * (4) LazyJavaTypeCompletionProposal (in CompletionAdaptor, since type is in a different plug-in).
+ * (5) ImportRewrite
+ * Field: needsBaseImport
+ * Set: passive: Field is externally written
+ * Eval: addEntry <- replace addEntry
+ * -> regular API ("goal")
+ *
+ * Additionally the OrganizeImportsAction is advised, too. Here the initial entry is {@link ImportRewrite#create(CompilationUnit,boolean)}
+ *
+ * @author stephan
+ */
+@SuppressWarnings("restriction")
+public team class BaseImportRewriting
+{
+ private static BaseImportRewriting instance;
+ public static BaseImportRewriting instance() {
+ return instance;
+ }
+ public BaseImportRewriting() {
+ instance = this;
+ }
+
+ /**
+ * While parsing we mark a assist type reference right after <code>playedBy</code>.
+ * Marking is done by decorating with a {@link CompletionOnBaseTypeRef} role.
+ */
+ protected class CompletionParser playedBy CompletionParser
+ {
+ /** Intermediate data storage #1: */
+ boolean nextIsBaseclass = false;
+
+ /** Initial entry (input) of this DataRelayChain. */
+ callin void consumeClassHeaderPlayedBy() {
+ boolean flagSave = nextIsBaseclass;
+ nextIsBaseclass = true;
+ try {
+ base.consumeClassHeaderPlayedBy();
+ } finally {
+ nextIsBaseclass = flagSave;
+ }
+ }
+ consumeClassHeaderPlayedBy <- replace consumeClassHeaderPlayedBy;
+
+ /** Entry (output) conditionally passing data to next role. */
+ void checkRecordBaseclassReference(CompletionOnBaseTypeRef ref)
+ <- after TypeReference createSingleAssistTypeReference(char[] assistName, long position)
+ with { ref <- result }
+ void checkRecordBaseclassReference(CompletionOnBaseTypeRef ref) {
+ if (!this.nextIsBaseclass)
+ // not within required context, cancel the role:
+ BaseImportRewriting.this.unregisterRole(ref, CompletionOnBaseTypeRef.class);
+ }
+ }
+
+ /**
+ * This role is registered by lifting in {@link CompletionParser#checkRecordBaseclassReference(CompletionOnBaseTypeRef)}.
+ * Its presence marks a type reference as completion on base class.
+ */
+ protected class CompletionOnBaseTypeRef playedBy TypeReference
+ base when (BaseImportRewriting.this.hasRole(base, CompletionOnBaseTypeRef.class))
+ {
+ /** adjust pretty printing for testing and debugging. */
+ @SuppressWarnings("basecall")
+ callin StringBuffer printExpression(int indent, StringBuffer output){
+ output.append("<CompleteOnBaseclass:");//$NON-NLS-1$
+ return output.append(getToken()).append('>');
+ }
+ printExpression <- replace printExpression;
+
+ char[] getToken() -> char[] getLastToken();
+ }
+
+ @SuppressWarnings("decapsulation"/*final baseclass*/)
+ protected class CompletionEngine playedBy CompletionEngine
+ {
+ /** Intermediate data storage #2: */
+ public boolean assistNodeIsBaseclass = false;
+
+ /** Entry (input): transfer information from CompletionOnBaseTypeReference role to this role. */
+ void markAsCompletingBaseclass(ASTNode astNode) {
+ this.assistNodeIsBaseclass = true;
+ }
+ void markAsCompletingBaseclass(ASTNode astNode)
+ <- before boolean complete(ASTNode astNode, ASTNode astNodeParent, ASTNode enclosingNode, CompilationUnitDeclaration compilationUnitDeclaration, Binding qualifiedBinding, Scope scope, boolean insideTypeAnnotation)
+ when (BaseImportRewriting.this.hasRole(astNode, CompletionOnBaseTypeRef.class));
+ }
+
+ @SuppressWarnings("decapsulation")
+ protected class ImportRewriteAdaptor playedBy ImportRewrite
+ {
+ /** triggered from OrganizeImportsOperation.run() we create instances of this role: */
+ void markImportRewrite(ImportRewriteAdaptor rewrite, CompilationUnit astRoot)
+ <- after ImportRewrite create(CompilationUnit astRoot, boolean restoreExistingImports)
+ when (result != null)
+ with { rewrite <- result, astRoot <- astRoot }
+
+ /** Remember all known base classes within the given CU as needing a base import. */
+ @SuppressWarnings("unchecked")
+ static void markImportRewrite(ImportRewriteAdaptor rewrite, CompilationUnit astRoot) {
+ try {
+ List<AbstractTypeDeclaration> types = astRoot.types();
+ if (types != null)
+ for (AbstractTypeDeclaration type : types) {
+ if (type.isRole())
+ rewrite.cuIsRoFi = true;
+ if (type.isTeam() || type.isRole())
+ rememberBasesForBaseImport(rewrite, (TypeDeclaration)type);
+ }
+ } catch (Exception e) {
+ JavaCore.getJavaCore().getLog().log(new Status(Status.ERROR, JavaCore.PLUGIN_ID, Status.OK,
+ "Error idendifying base classes for import.", e)); //$NON-NLS-1$
+ }
+ }
+
+ /** Remember all base classes referenced by 'theTeam' as needing base import. */
+ static void rememberBasesForBaseImport(ImportRewriteAdaptor rewrite, TypeDeclaration type) {
+ try {
+ // descend into AST searching for in-line role types:
+ if (type instanceof RoleTypeDeclaration) {
+ Type baseClassType = ((RoleTypeDeclaration)type).getBaseClassType();
+ if (baseClassType != null) {
+ SimpleName baseName = null;
+ if (baseClassType.isSimpleType()) {
+ Name name = ((SimpleType) baseClassType).getName();
+ baseName = (name.isSimpleName())
+ ? (SimpleName)name
+ : ((QualifiedName)name).getName();
+ } else if (baseClassType.isQualifiedType()) {
+ baseName = ((QualifiedType) baseClassType).getName();
+ }
+ if (baseName != null)
+ rewrite.baseNames.add(baseName.getIdentifier());
+ }
+ }
+ for (Object decl : type.bodyDeclarations())
+ if (decl instanceof RoleTypeDeclaration)
+ rememberBasesForBaseImport(rewrite, (TypeDeclaration)decl); // recurse
+ // also fetch role files:
+ org.eclipse.jdt.core.dom.ASTNode enclosing = type.getParent();
+ if (enclosing instanceof CompilationUnit)
+ rewrite.baseNames.addAll(RoleFileAdaptor.getRoFiBaseClassNames((CompilationUnit)enclosing));
+ } catch (Exception javaModelException){
+ // nop
+ }
+ }
+
+ // === Instance level methods and method bindings:
+
+ /** Intermediate data storage #3 (passive, externally written from #checkForBaseImport()). */
+ public boolean needsBaseImport = false;
+ /** Alternative intermediate storage: the stored names should be treated as base classes. */
+ public HashSet<String> baseNames = new HashSet<String>();
+ /** Is the current CU a role file? */
+ boolean cuIsRoFi = false;
+
+ /** Final entry (output): conditionally change import entry from NORMAL to BASE. */
+ @SuppressWarnings("basecall")
+ callin void addEntry(String entry) {
+ if (entry.charAt(0) == getNormalChar()) {
+ String[] names = entry.split("\\."); //$NON-NLS-1$
+ if (needsBaseImport || baseNames.contains(names[names.length-1])) {
+ if (cuIsRoFi)
+ return; // don't propose to add a base import to a role file
+ else
+ entry = getBaseChar()+entry.substring(1);
+ }
+ }
+ base.addEntry(entry);
+ }
+ addEntry <- replace addEntry
+ base when (hasRole(base, ImportRewriteAdaptor.class));
+
+ // this callin tells the ImportRewrite not to consider local declarations as a conflict,
+ // if we already know that we need a base import
+ // => fixes completing a base class with the same name as its role.
+ callin String internalAddImport(String fullTypeName, ImportRewriteContext context)
+ {
+ if (needsBaseImport)
+ context= new ImportRewriteContext() {
+ @Override
+ public int findInContext(String qualifier, String name, int kind) {
+ return getDefaultImportRewriteContext().findInContext(qualifier, name, kind);
+ // explicitly don't look in declarations!
+ }
+ };
+ return base.internalAddImport(fullTypeName, context);
+ }
+ String internalAddImport(String fullTypeName, ImportRewriteContext context)
+ <- replace String internalAddImport(String fullTypeName, ImportRewriteContext context);
+
+ callin void markForBaseImport() {
+ try {
+ this.needsBaseImport = true;
+ base.markForBaseImport();
+ } finally {
+ BaseImportRewriting.this.unregisterRole(this, ImportRewriteAdaptor.class);
+ }
+ }
+ markForBaseImport <- replace addImportBase;
+
+ ImportRewriteContext getDefaultImportRewriteContext() -> ImportRewriteContext getDefaultImportRewriteContext();
+
+ // callout to constants:
+ char getNormalChar() -> get char NORMAL_PREFIX;
+ char getBaseChar() -> get char BASE_PREFIX;
+ }
+
+ /** Passive role: provide access to one field. */
+ protected class CompletionProposal playedBy InternalCompletionProposal {
+ @SuppressWarnings("decapsulation")
+ protected
+ CompletionEngine getEngine() -> get CompletionEngine completionEngine;
+ }
+
+ /** API for use by LazyJavaTypeCompletionProposal: propagate data from a {@link CompletionEngine} to an {@link ImportRewriteAdaptor}.
+ * @param cp completion proposal being processed
+ * @param rewrite import rewrite that may have to add the "base" modifier.
+ */
+ public void checkForBaseImport(InternalCompletionProposal as CompletionProposal cp,
+ ImportRewrite as ImportRewriteAdaptor rewrite)
+ {
+ if (cp == null)
+ return;
+ CompletionEngine engine = cp.getEngine();
+ if (engine != null && rewrite != null)
+ rewrite.needsBaseImport = engine.assistNodeIsBaseclass;
+ }
+
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/assist/CompletionAdaptor.java b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/assist/CompletionAdaptor.java
new file mode 100644
index 000000000..64e8f01b2
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/assist/CompletionAdaptor.java
@@ -0,0 +1,694 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2006, 2008 Technical University Berlin, Germany and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: CompletionAdaptor.java 23438 2010-02-04 20:05:24Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ * IBM Corporation - copies of individual methods from bound base classes.
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.assist;
+
+
+import java.util.Collection;
+import java.util.Set;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jdt.core.CompletionContext;
+import org.eclipse.jdt.core.CompletionProposal;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IMethod;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.Signature;
+import org.eclipse.jdt.core.compiler.CharOperation;
+import org.eclipse.jdt.core.dom.ASTNode;
+import org.eclipse.jdt.core.dom.AbstractTypeDeclaration;
+import org.eclipse.jdt.core.dom.AnonymousClassDeclaration;
+import org.eclipse.jdt.core.dom.ChildListPropertyDescriptor;
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jdt.core.dom.IMethodBinding;
+import org.eclipse.jdt.core.dom.ITypeBinding;
+import org.eclipse.jdt.core.dom.MethodDeclaration;
+import org.eclipse.jdt.core.dom.rewrite.ASTRewrite;
+import org.eclipse.jdt.core.dom.rewrite.ITrackedNodePosition;
+import org.eclipse.jdt.core.dom.rewrite.ImportRewrite;
+import org.eclipse.jdt.core.dom.rewrite.ListRewrite;
+import org.eclipse.jdt.core.dom.rewrite.ImportRewrite.ImportRewriteContext;
+import org.eclipse.jdt.core.formatter.IndentManipulation;
+import org.eclipse.jdt.internal.codeassist.InternalCompletionProposal;
+import org.eclipse.jdt.internal.codeassist.impl.Keywords;
+import org.eclipse.jdt.internal.compiler.parser.TerminalTokens;
+import org.eclipse.jdt.internal.corext.codemanipulation.CodeGenerationSettings;
+import org.eclipse.jdt.internal.corext.codemanipulation.ContextSensitiveImportRewriteContext;
+import org.eclipse.jdt.internal.corext.codemanipulation.StubUtility;
+import org.eclipse.jdt.internal.corext.dom.Bindings;
+import org.eclipse.jdt.core.dom.NodeFinder;
+import org.eclipse.jdt.internal.corext.template.java.SignatureUtil;
+import org.eclipse.jdt.internal.corext.util.JavaConventionsUtil;
+import org.eclipse.jdt.internal.corext.util.Messages;
+import org.eclipse.jdt.internal.ui.JavaPlugin;
+import org.eclipse.jdt.internal.ui.preferences.JavaPreferencesSettings;
+import org.eclipse.jdt.internal.ui.text.java.FieldProposalInfo;
+import org.eclipse.jdt.internal.ui.text.java.JavaCompletionProposal;
+import org.eclipse.jdt.ui.text.java.IJavaCompletionProposal;
+import org.eclipse.jdt.ui.text.java.JavaContentAssistInvocationContext;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.Document;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.TextUtilities;
+import org.eclipse.jface.viewers.StyledString;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.text.edits.MalformedTreeException;
+import org.eclipse.objectteams.otdt.core.IOTType;
+import org.eclipse.objectteams.otdt.core.IRoleType;
+import org.eclipse.objectteams.otdt.core.OTModelManager;
+import org.eclipse.objectteams.otdt.core.compiler.IOTConstants;
+import org.eclipse.objectteams.otdt.ui.ImageConstants;
+import org.eclipse.objectteams.otdt.ui.ImageManager;
+
+import base org.eclipse.jdt.internal.corext.codemanipulation.StubUtility2;
+import base org.eclipse.jdt.internal.ui.text.java.LazyJavaTypeCompletionProposal;
+import base org.eclipse.jdt.internal.ui.text.java.MethodDeclarationCompletionProposal;
+import base org.eclipse.jdt.internal.ui.text.java.MethodProposalInfo;
+import base org.eclipse.jdt.internal.ui.text.java.OverrideCompletionProposal;
+import base org.eclipse.jdt.ui.CodeGeneration;
+import base org.eclipse.jdt.ui.text.java.CompletionProposalCollector;
+import base org.eclipse.jdt.ui.text.java.CompletionProposalLabelProvider;
+import base org.eclipse.jdt.ui.text.java.JavaTextMessages;
+
+
+/**
+ * This team helps the jdt.ui to handle completion for OT-specific elements.
+ * Currently:
+ * + generate new callout (can be changed to callin in linked mode).
+ *
+ * @author stephan
+ *
+ * @role MethodMappingCompletionProposal
+ * @role CreateMethodMappingCompletionProposal
+ * @role CalloutToFieldCompletionProposal
+ * @role CallinRHSCompletionProposal
+ * @role MethodSpecCompletionProposal
+ * @role StubUtility2
+ */
+@SuppressWarnings({ "restriction", "decapsulation" })
+public team class CompletionAdaptor
+{
+
+ /** Relevance constant. */
+ public static int R_METHOD_MAPPING = 100;
+ /**
+ * This role defines the entry-hooks of this team.
+ */
+ protected class ProposalCollector playedBy CompletionProposalCollector
+ {
+ getDeclaringType <- replace getDeclaringType;
+ @SuppressWarnings("basecall")
+ callin char[] getDeclaringType(CompletionProposal proposal) {
+ switch (proposal.getKind()) {
+ case CompletionProposal.OT_CALLOUT_DECLARATION:
+ case CompletionProposal.OT_CALLOUT_OVERRIDE_DECLARATION:
+ case CompletionProposal.OT_CALLOUT_GET:
+ case CompletionProposal.OT_CALLOUT_SET:
+ case CompletionProposal.OT_CALLIN_DECLARATION:
+ case CompletionProposal.OT_FIELD_SPEC:
+ case CompletionProposal.OT_METHOD_SPEC:
+ char[] declaration= proposal.getDeclarationSignature();
+ return Signature.toCharArray(declaration);
+ default:
+ return base.getDeclaringType(proposal);
+ }
+ }
+
+ createJavaCompletionProposal <- replace createJavaCompletionProposal;
+ @SuppressWarnings("basecall")
+ callin IJavaCompletionProposal createJavaCompletionProposal(CompletionProposal proposal)
+ {
+ switch (proposal.getKind()) {
+ case CompletionProposal.OT_CALLOUT_DECLARATION:
+ case CompletionProposal.OT_CALLOUT_OVERRIDE_DECLARATION:
+ case CompletionProposal.OT_CALLOUT_GET:
+ case CompletionProposal.OT_CALLOUT_SET:
+ case CompletionProposal.OT_CALLIN_DECLARATION:
+ case CompletionProposal.OT_METHOD_SPEC:
+ return createMappingProposal(proposal, proposal.getKind());
+ case CompletionProposal.OT_FIELD_SPEC:
+ return createFieldSpecProposal(proposal);
+ case CompletionProposal.KEYWORD:
+ IJavaCompletionProposal result = base.createJavaCompletionProposal(proposal);
+ if (CharOperation.endsWith(proposal.getCompletion(), Keywords.WHEN)) {
+ // move cursor back by one (into '()') by reverse-engineering its current position:
+ JavaCompletionProposal jProposal = (JavaCompletionProposal)result;
+ Point cursor = jProposal.getSelection(null);
+ int cursorPos = cursor.x-jProposal.getReplacementOffset();
+ jProposal.setCursorPosition(cursorPos-1);
+ }
+ return result;
+ default:
+ return base.createJavaCompletionProposal(proposal);
+ }
+ }
+
+ private IJavaCompletionProposal createMappingProposal(CompletionProposal proposal, int kind)
+ {
+ if (getCompilationUnit() == null || getJavaProject() == null)
+ return null;
+
+ String signature= String.valueOf(proposal.getSignature());
+ String[] paramTypes= Signature.getParameterTypes(signature);
+ for (int index= 0; index < paramTypes.length; index++)
+ paramTypes[index]= Signature.toString(paramTypes[index]);
+ int length= getLength(proposal);
+
+ int bindingModifier = proposal.getFlags();
+ boolean isCallin= true;
+ boolean isOverride= false;
+ switch(bindingModifier) {
+ case TerminalTokens.TokenNameCALLOUT_OVERRIDE:
+ isOverride= true;
+ //$FALL-THROUGH$
+ case TerminalTokens.TokenNameBINDOUT:
+ isCallin= false;
+ break;
+ // otherwise it's a callin with details in bindingModifier
+ }
+
+ StyledString label= getLabelProvider().createMappingProposalLabel(proposal, isCallin);
+ Image image = getImage(getLabelProvider().createMappingImageDescriptor(bindingModifier));
+
+ String fieldType= Signature.getReturnType(signature);
+ boolean isSetter= false;
+ switch (kind) {
+ case CompletionProposal.OT_CALLIN_DECLARATION:
+ return new CreateMethodMappingCompletionProposal(getJavaProject(), getCompilationUnit(), proposal,
+ paramTypes, isOverride, /*isOnlyCallin*/true,
+ length, label.toString(), image);
+ case CompletionProposal.OT_METHOD_SPEC:
+ if (isCallin)
+ return new CallinRHSCompletionProposal(getJavaProject(), getCompilationUnit(), proposal,
+ paramTypes,
+ length, label.toString(), image);
+ else
+ return new MethodSpecCompletionProposal(getJavaProject(), getCompilationUnit(), proposal,
+ paramTypes,
+ length, label.toString(), image);
+ case CompletionProposal.OT_CALLOUT_OVERRIDE_DECLARATION:
+ isOverride= true;
+ //$FALL-THROUGH$
+ case CompletionProposal.OT_CALLOUT_DECLARATION:
+ return new CreateMethodMappingCompletionProposal(getJavaProject(), getCompilationUnit(), proposal,
+ paramTypes, isOverride, /*isOnlyCallin*/false,
+ length, label.toString(), image);
+ case CompletionProposal.OT_CALLOUT_SET:
+ isSetter= true;
+ fieldType= paramTypes[0];
+ //$FALL-THROUGH$
+ case CompletionProposal.OT_CALLOUT_GET:
+ String name= String.valueOf(proposal.getName());
+ String fieldName= String.valueOf(Character.toLowerCase(name.charAt(3)));
+ if (name.length()>4)
+ fieldName += name.substring(4);
+ return new CalloutToFieldCompletionProposal(getJavaProject(), getCompilationUnit(), proposal,
+ fieldName, fieldType, isSetter, isOverride,
+ length, label.toString(), image);
+ default:
+ return null;
+ }
+ }
+
+ /** modeled after {@link org.eclipse.jdt.ui.text.java.CompletionProposalCollector#createFieldProposal} */
+ IJavaCompletionProposal createFieldSpecProposal(CompletionProposal proposal) {
+ String completion= String.valueOf(proposal.getCompletion());
+ int start= proposal.getReplaceStart();
+ int length= getLength(proposal);
+ LabelProvider labelProvider= getLabelProvider();
+ //{ObjectTeams: callout-to-field:
+ StyledString label= labelProvider.createFieldDescLabel(proposal);
+ Image image= getImage(labelProvider.createMappingImageDescriptor(TerminalTokens.TokenNameBINDOUT));
+ // SH}
+ int relevance= computeRelevance(proposal);
+
+ JavaCompletionProposal javaProposal= new JavaCompletionProposal(completion, start, length, image, label, relevance, getContext().isInJavadoc(), getInvocationContext());
+ if (getJavaProject() != null)
+ javaProposal.setProposalInfo(new FieldProposalInfo(getJavaProject(), proposal));
+ //{ObjectTeams: slightly different
+ javaProposal.setTriggerCharacters(new char[]{' ', '\t', '\n'});
+ // SH}
+
+ return javaProposal;
+ }
+
+
+ // CALLOUTS:
+ ICompilationUnit getCompilationUnit() -> get ICompilationUnit fCompilationUnit;
+ IJavaProject getJavaProject() -> get IJavaProject fJavaProject;
+ LabelProvider getLabelProvider() -> get CompletionProposalLabelProvider fLabelProvider;
+ int getLength(CompletionProposal proposal) -> int getLength(CompletionProposal proposal);
+ Image getImage(ImageDescriptor imageDesc) -> Image getImage(ImageDescriptor imageDesc);
+ IJavaCompletionProposal createMethodReferenceProposal(CompletionProposal methodProposal)
+ -> IJavaCompletionProposal createMethodReferenceProposal(CompletionProposal methodProposal);
+ JavaContentAssistInvocationContext getInvocationContext()
+ -> JavaContentAssistInvocationContext getInvocationContext();
+ CompletionContext getContext() -> CompletionContext getContext();
+
+ protected
+ void unsetIgnored(int kind) -> void setIgnored(int kind, boolean ignore)
+ with { kind -> kind, false -> ignore }
+ }
+
+ /** This role adds new methods to the base-side label provider. */
+ protected class LabelProvider playedBy CompletionProposalLabelProvider
+ {
+
+ /** Get a callin/callout image (with no decorations yet). */
+ protected ImageDescriptor createMappingImageDescriptor(int callinModifier) {
+ switch (callinModifier) {
+ case 0: // unset but we know it's a callin:
+ case TerminalTokens.TokenNamebefore:
+ return ImageManager.getSharedInstance().getDescriptor(ImageConstants.CALLINBINDING_BEFORE_IMG);
+ case TerminalTokens.TokenNamereplace:
+ return ImageManager.getSharedInstance().getDescriptor(ImageConstants.CALLINBINDING_REPLACE_IMG);
+ case TerminalTokens.TokenNameafter:
+ return ImageManager.getSharedInstance().getDescriptor(ImageConstants.CALLINBINDING_AFTER_IMG);
+ case TerminalTokens.TokenNameBINDOUT:
+ case TerminalTokens.TokenNameCALLOUT_OVERRIDE:
+ return ImageManager.getSharedInstance().getDescriptor(ImageConstants.CALLOUTBINDING_IMG);
+ default:
+ return null;
+ }
+ // orig from CompletionProposalLabelProvider.createMethodImageDescriptor()
+ //final int flags= proposal.getFlags();
+ //return decorateImageDescriptor(JavaElementImageProvider.getMethodImageDescriptor(false, flags), proposal);
+ }
+
+ @SuppressWarnings("restriction")
+ protected
+ StyledString createMappingProposalLabel(CompletionProposal proposal, boolean isCallin) {
+//{ObjectTeams: OT_COPY_PASTE from CompletionProposalLabelProvider.createOverrideMethodProposalLabel()
+ StyledString nameBuffer= new StyledString();
+
+ // method name
+ nameBuffer.append(proposal.getName());
+
+ // parameters
+ nameBuffer.append('(');
+ appendUnboundedParameterList(nameBuffer, proposal);
+ nameBuffer.append(") "); //$NON-NLS-1$
+
+ // return type
+ // TODO remove SignatureUtil.fix83600 call when bugs are fixed
+ char[] returnType= createTypeDisplayName(SignatureUtil.getUpperBound(Signature.getReturnType(SignatureUtil.fix83600(proposal.getSignature()))));
+ nameBuffer.append(returnType);
+// SH}
+ // different tail:
+ nameBuffer.append(" - "); //$NON-NLS-1$
+ String message = null;
+ switch (proposal.getKind()) {
+ case CompletionProposal.OT_CALLOUT_DECLARATION:
+ case CompletionProposal.OT_CALLOUT_OVERRIDE_DECLARATION:
+ case CompletionProposal.OT_CALLIN_DECLARATION:
+ message = org.eclipse.objectteams.otdt.internal.ui.Messages.Completion_method_binding_label;
+ break;
+ case CompletionProposal.OT_METHOD_SPEC:
+ if (isCallin)
+ message = org.eclipse.objectteams.otdt.internal.ui.Messages.Completion_callin_label;
+ else
+ message = org.eclipse.objectteams.otdt.internal.ui.Messages.Completion_callout_label;
+ break;
+ case CompletionProposal.OT_CALLOUT_GET:
+ case CompletionProposal.OT_CALLOUT_SET:
+ message = org.eclipse.objectteams.otdt.internal.ui.Messages.Completion_callout_to_field_label;
+ break;
+ }
+ nameBuffer.append(Messages.format(
+ message,
+ new String(createTypeDisplayName(proposal.getDeclarationSignature()))));
+
+ return nameBuffer;
+ }
+ /* simpler version for callout-to-field RHS: */
+ protected StyledString createFieldDescLabel(CompletionProposal proposal) {
+ StyledString nameBuffer= new StyledString();
+ nameBuffer.append(createJavadocSimpleProposalLabel(proposal));
+ nameBuffer.append(" - "); //$NON-NLS-1$
+ nameBuffer.append(Messages.format(
+ org.eclipse.objectteams.otdt.internal.ui.Messages.Completion_callout_to_field_label,
+ new String(createTypeDisplayName(proposal.getDeclarationSignature()))));
+ return nameBuffer;
+ }
+
+ // display nested types including their outer class, relevant for distinguishing tsuper role.
+ createOverrideMethodProposalLabel <- replace createOverrideMethodProposalLabel;
+ @SuppressWarnings("basecall")
+ callin StyledString createOverrideMethodProposalLabel(CompletionProposal methodProposal) {
+ char[] declaringClass = methodProposal.getDeclarationSignature();
+ if (CharOperation.lastIndexOf('$', declaringClass) != -1)
+ // a nested class, do not discard enclosing type.
+ return createNestedOverrideMethodProposal(methodProposal);
+ else
+ return base.createOverrideMethodProposalLabel(methodProposal);
+ }
+
+ @SuppressWarnings("restriction")
+ StyledString createNestedOverrideMethodProposal(CompletionProposal methodProposal) {
+ // mostly copied from its base method.
+
+ StyledString nameBuffer= new StyledString();
+
+ // method name
+ nameBuffer.append(methodProposal.getName());
+
+ // parameters
+ nameBuffer.append('(');
+ appendUnboundedParameterList(nameBuffer, methodProposal);
+ nameBuffer.append(") "); //$NON-NLS-1$
+
+ // return type
+ // TODO remove SignatureUtil.fix83600 call when bugs are fixed
+ char[] returnType= createTypeDisplayName(SignatureUtil.getUpperBound(Signature.getReturnType(SignatureUtil.fix83600(methodProposal.getSignature()))));
+ nameBuffer.append(returnType);
+
+ // declaring type
+ nameBuffer.append(" - "); //$NON-NLS-1$
+
+ // SH: this is the only change: neither use FQN nor strip outer class:
+ String declaringType= new String(Signature.getSignatureSimpleName(methodProposal.getDeclarationSignature()));
+ nameBuffer.append(Messages.format(JavaTextMessages.getResultCollector_overridingmethod(), new String(declaringType)));
+
+ return nameBuffer;
+ }
+
+ // CALLOUTS:
+ StyledString appendUnboundedParameterList(StyledString buffer, CompletionProposal methodProposal)
+ -> StyledString appendUnboundedParameterList(StyledString buffer, CompletionProposal methodProposal);
+
+ char[] createTypeDisplayName(char[] typeSignature)
+ -> char[] createTypeDisplayName(char[] typeSignature);
+ StyledString createJavadocSimpleProposalLabel(CompletionProposal proposal)
+ -> StyledString createJavadocSimpleProposalLabel(CompletionProposal proposal);
+ }
+
+ // === access to other base classes, no adaptation (yet):
+ protected class JavaTextMessages playedBy JavaTextMessages {
+ String getResultCollector_overridingmethod() -> get String ResultCollector_overridingmethod;
+ }
+
+ protected class CalloutProposalInfo playedBy MethodProposalInfo {
+ CalloutProposalInfo(IJavaProject project, CompletionProposal proposal) {
+ base(project, proposal);
+ }
+ }
+
+
+ /**
+ * This role mediates between a completion proposal and its import rewrite.
+ *
+ * Data (orig): result aka fImportRewrite, fProposal { completionEngine }
+ * Trigger: checkImportRewrite <- after createImportRewrite (passing result)
+ * unconditionally
+ * Propagate: call BaseImportRewriting.checkForBaseImport()
+ * reads: API CompletionEngine.isCompletingBaseclass()
+ * writes: Field ImportRewrite.needsBaseImport
+ */
+ protected class LazyJavaTypeCompletionProposal playedBy LazyJavaTypeCompletionProposal
+ {
+ /**
+ * Check whether the rewrite should be configured to create base imports.
+ * This is the only situation where proposal and rewrite are seen together.
+ */
+ void checkImportRewrite(ImportRewrite rewrite) {
+ BaseImportRewriting.instance().checkForBaseImport((InternalCompletionProposal)getProposal(), rewrite);
+ }
+ void checkImportRewrite(ImportRewrite rewrite) <- after ImportRewrite createImportRewrite()
+ with { rewrite <- result }
+
+ // callout-to-field:
+ CompletionProposal getProposal() -> get CompletionProposal fProposal;
+ }
+
+ /**
+ * When roposing a new constructor declaration, do these two adjustments for roles:
+ * <ul>
+ * <li>Strip the <code>__OT__</code> prefix
+ * <li>Insert a base class argument if the role is bound.
+ * </ul>
+ */
+ protected class MethodDeclarationCompletionProposal implements ILowerable playedBy MethodDeclarationCompletionProposal
+ {
+ // --- callout import ---
+ boolean hasMethod(IMethod[] arg0, String arg1) -> boolean hasMethod(IMethod[] arg0, String arg1);
+ void setSortString(String arg0) -> void setSortString(String arg0);
+ void setStyledDisplayString(StyledString arg0) -> void setStyledDisplayString(StyledString arg0);
+
+ // --- static part ---
+ @SuppressWarnings("rawtypes")
+ void evaluateProposals(IType type, String prefix, int offset, int length, int relevance,
+ Set suggestedMethods, Collection resultCollection)
+ <- replace
+ void evaluateProposals(IType type, String prefix, int offset, int length, int relevance,
+ Set suggestedMethods, Collection resultCollection);
+
+ @SuppressWarnings({ "unchecked", "basecall", "rawtypes" })
+ static callin void evaluateProposals(IType type, String prefix, int offset, int length, int relevance,
+ Set suggestedMethods, Collection result)
+ throws CoreException
+ {
+ IOTType ottype = OTModelManager.getOTElement(type);
+ if (ottype == null || !ottype.isRole()) {
+ base.evaluateProposals(type, prefix, offset, length, relevance, suggestedMethods, result);
+ return;
+ }
+ IRoleType roleType = (IRoleType) ottype;
+ IMethod[] methods= type.getMethods();
+ if (!type.isInterface()) {
+ String typeName = type.getElementName();
+ String constructorName= typeName.startsWith(IOTConstants.OT_DELIM)
+ ? typeName.substring(IOTConstants.OT_DELIM_LEN) // strip __OT__
+ : typeName;
+ String baseClassName = roleType.getBaseclassName();
+ boolean hasMethod = (baseClassName != null)
+ ? hasBoundRoleCtor(methods, typeName, baseClassName) //different check for existence of lifting ctor
+ : hasMethod(methods, constructorName);
+ if (constructorName.length() > 0 && constructorName.startsWith(prefix) && !hasMethod && suggestedMethods.add(constructorName))
+ result.add(new MethodDeclarationCompletionProposal(type, constructorName, baseClassName, null, offset, length, relevance + 500)
+ .lower());
+ }
+ if (prefix.length() > 0 && !"main".equals(prefix) && !hasMethod(methods, prefix) && suggestedMethods.add(prefix)) { //$NON-NLS-1$
+ if (!JavaConventionsUtil.validateMethodName(prefix, type).matches(IStatus.ERROR))
+ result.add(new MethodDeclarationCompletionProposal(type, prefix, null, Signature.SIG_VOID, offset, length, relevance)
+ .lower());
+ }
+ }
+ private static boolean hasBoundRoleCtor(IMethod[] methods, String roleName, String baseName) {
+ baseName = baseName+';';
+ for (int i= 0; i < methods.length; i++) {
+ IMethod curr= methods[i];
+ if (curr.getElementName().equals(roleName) && curr.getParameterTypes().length == 1) { // expect one param: base.
+ String currParamType = curr.getParameterTypes()[0];
+ switch (currParamType.charAt(0)) {
+ case Signature.C_RESOLVED:
+ case Signature.C_UNRESOLVED:
+ if (currParamType.substring(1).equals(baseName))
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ // --- instance part ---
+
+ String constructorSignature = null;
+
+ protected MethodDeclarationCompletionProposal(IType type, String constructorName, String baseClassName, String returnTypeSig, int offset, int length, int i) {
+ base(type, constructorName, returnTypeSig, offset, length, i);
+ if (baseClassName != null) {
+ this.constructorSignature = makeLiftingCtorSignature(baseClassName);
+ StyledString displayName = makeLiftingCtorDisplayName(constructorName, this.constructorSignature);
+ this.setStyledDisplayString(displayName);
+ this.setSortString(displayName.toString());
+ }
+ }
+
+ StyledString makeLiftingCtorDisplayName(String constructorName, String constructorSignature) {
+ StyledString buf= new StyledString();
+ buf.append(constructorName);
+ buf.append(constructorSignature);
+ buf.append(" - ", StyledString.QUALIFIER_STYLER); //$NON-NLS-1$
+ buf.append(org.eclipse.objectteams.otdt.internal.ui.Messages.Completion_default_lifting_constructor_label, StyledString.QUALIFIER_STYLER);
+ return buf;
+ }
+ String makeLiftingCtorSignature(String baseClassName) {
+ StringBuffer buf= new StringBuffer();
+ buf.append('(');
+ buf.append(baseClassName);
+ buf.append(' ');
+ buf.append(baseClassName.toLowerCase().charAt(0));
+ if (baseClassName.length() > 1)
+ buf.append(baseClassName.substring(1));
+ buf.append(')');
+ return buf.toString();
+ }
+
+ /** replacement computation is hardwired, fixup the signature afterwards. */
+ void replaceCtorSignature(String replacementString) <- replace void setReplacementString(String replacementString)
+ when (this.constructorSignature != null);
+ callin void replaceCtorSignature(String replacementString) {
+ base.replaceCtorSignature(replacementString.replace("()", this.constructorSignature));//$NON-NLS-1$
+ }
+ }
+
+ /**
+ * This role together with {@link SuperCallAdjustor} arranges that new method declarations
+ * overriding a tsuper version get a proper tsuper-call as their default body.
+ */
+ protected class OverrideCompletionProposal playedBy OverrideCompletionProposal
+ {
+ updateReplacementString <- replace updateReplacementString;
+
+ @SuppressWarnings({"basecall", "inferredcallout"}) // copy&paste from base method, OT modifications are marked
+ callin boolean updateReplacementString(IDocument document, char trigger, int offset, ImportRewrite importRewrite)
+ throws CoreException, BadLocationException
+ {
+ // OT_COPY_PASTE:
+
+ Document recoveredDocument= new Document();
+ CompilationUnit unit= getRecoveredAST(document, offset, recoveredDocument);
+ ImportRewriteContext context;
+ if (importRewrite != null) {
+ context= new ContextSensitiveImportRewriteContext(unit, offset, importRewrite);
+ } else {
+ importRewrite= StubUtility.createImportRewrite(unit, true); // create a dummy import rewriter to have one
+ context= new ImportRewriteContext() { // forces that all imports are fully qualified
+ public int findInContext(String qualifier, String name, int kind) {
+ return RES_NAME_CONFLICT;
+ }
+ };
+ }
+
+ ITypeBinding declaringType= null;
+ ChildListPropertyDescriptor descriptor= null;
+ ASTNode node= NodeFinder.perform(unit, offset, 0);
+ if (node instanceof AnonymousClassDeclaration) {
+ declaringType= ((AnonymousClassDeclaration) node).resolveBinding();
+ descriptor= AnonymousClassDeclaration.BODY_DECLARATIONS_PROPERTY;
+ } else if (node instanceof AbstractTypeDeclaration) {
+ AbstractTypeDeclaration declaration= (AbstractTypeDeclaration) node;
+ descriptor= declaration.getBodyDeclarationsProperty();
+ declaringType= declaration.resolveBinding();
+ }
+ if (declaringType != null) {
+ ASTRewrite rewrite= ASTRewrite.create(unit.getAST());
+ IMethodBinding methodToOverride= Bindings.findMethodInHierarchy(declaringType, fMethodName, fParamTypes);
+ if (methodToOverride == null && declaringType.isInterface()) {
+ methodToOverride= Bindings.findMethodInType(node.getAST().resolveWellKnownType("java.lang.Object"), fMethodName, fParamTypes); //$NON-NLS-1$
+ }
+ if (methodToOverride != null) {
+//{ObjectTeams:
+ methodToOverride = adjustToClassPart(methodToOverride, declaringType);
+ try {
+ if (isTSuperOf(methodToOverride.getDeclaringClass(), declaringType))
+ CompletionAdaptor.enableSuperCallAdjustor.set(Boolean.TRUE);
+// orig:
+ CodeGenerationSettings settings= JavaPreferencesSettings.getCodeGenerationSettings(fJavaProject);
+ MethodDeclaration stub= org.eclipse.jdt.internal.corext.codemanipulation.StubUtility2.createImplementationStub(fCompilationUnit, rewrite, importRewrite, context, methodToOverride, declaringType.getName(), settings, declaringType.isInterface());
+ ListRewrite rewriter= rewrite.getListRewrite(node, descriptor);
+ rewriter.insertFirst(stub, null);
+
+ ITrackedNodePosition position= rewrite.track(stub);
+ try {
+ rewrite.rewriteAST(recoveredDocument, fJavaProject.getOptions(true)).apply(recoveredDocument);
+
+ String generatedCode= recoveredDocument.get(position.getStartPosition(), position.getLength());
+ int generatedIndent= IndentManipulation.measureIndentUnits(getIndentAt(recoveredDocument, position.getStartPosition(), settings), settings.tabWidth, settings.indentWidth);
+
+ String indent= getIndentAt(document, getReplacementOffset(), settings);
+ setReplacementString(IndentManipulation.changeIndent(generatedCode, generatedIndent, settings.tabWidth, settings.indentWidth, indent, TextUtilities.getDefaultLineDelimiter(document)));
+
+ } catch (MalformedTreeException exception) {
+ JavaPlugin.log(exception);
+ } catch (BadLocationException exception) {
+ JavaPlugin.log(exception);
+ }
+// :giro
+ } finally {
+ CompletionAdaptor.enableSuperCallAdjustor.set(null);
+ }
+// SH}
+ }
+ }
+ return true;
+ }
+ private IMethodBinding adjustToClassPart(IMethodBinding method, ITypeBinding declaringType) {
+ ITypeBinding methodDeclaringType = method.getDeclaringClass();
+ if (methodDeclaringType != declaringType && methodDeclaringType.isRole() && methodDeclaringType.isInterface()) {
+ ITypeBinding teamType = methodDeclaringType.getDeclaringClass();
+ if (teamType != null) {
+ String key = method.getKey();
+ int pos = key.indexOf('.');
+ String shortKey = key.substring(pos);
+ // find corresponding role class:
+ for (ITypeBinding member : teamType.getDeclaredTypes()) {
+ if (member.isClass() && member.getName().equals(declaringType.getName())){
+ // find corresponding method in role class:
+ for (IMethodBinding classMethod : member.getDeclaredMethods())
+ if (classMethod.getKey().endsWith(shortKey))
+ return classMethod;
+ break;
+ }
+ }
+ }
+
+ }
+ return method;
+ }
+ private boolean isTSuperOf(ITypeBinding potentialTSuper, ITypeBinding declaringType) {
+ if (!potentialTSuper.isRole() || !declaringType.isRole())
+ return false;
+ for (ITypeBinding tsuperType : declaringType.getSuperRoles())
+ if ( potentialTSuper == tsuperType
+ || isTSuperOf(potentialTSuper, tsuperType))
+ return true;
+ return false;
+ }
+ }
+
+ // this thread local flag passes activation from OverrideCompletionProposal to SuperCallAdjustor
+ final static ThreadLocal<Boolean> enableSuperCallAdjustor = new ThreadLocal<Boolean>();
+
+ /** Enabled by {@link OverrideCompletionProposal} this role adjusts super calls to tsuper calls. */
+ protected class SuperCallAdjustor playedBy CodeGeneration
+ base when (CompletionAdaptor.enableSuperCallAdjustor.get() != null)
+ {
+ static callin void getMethodBodyContent(boolean isConstructor, String bodyStatement) throws CoreException
+ {
+ String pattern = "super.";
+ String replacement = "tsuper.";
+ if (isConstructor) {
+ pattern = "super(";
+ replacement = "tsuper(";
+ }
+ bodyStatement = bodyStatement.replaceFirst(pattern, replacement);
+ base.getMethodBodyContent(isConstructor, bodyStatement);
+ }
+ void getMethodBodyContent(boolean isConstructor, String bodyStatement)
+ <- replace String getMethodBodyContent(ICompilationUnit cu, String declaringTypeName, String methodName, boolean isConstructor, String bodyStatement, String lineDelimiter)
+ with { isConstructor <- isConstructor, bodyStatement <- bodyStatement }
+ }
+
+ int computeRelevance(CompletionProposal proposal) {
+ return proposal.getRelevance() + R_METHOD_MAPPING;
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/assist/CompletionAdaptor/CallinRHSCompletionProposal.java b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/assist/CompletionAdaptor/CallinRHSCompletionProposal.java
new file mode 100644
index 000000000..077ef7076
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/assist/CompletionAdaptor/CallinRHSCompletionProposal.java
@@ -0,0 +1,145 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2008 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: CallinRHSCompletionProposal.java 23438 2010-02-04 20:05:24Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+team package org.eclipse.objectteams.otdt.internal.ui.assist.CompletionAdaptor;
+
+import static org.eclipse.jdt.core.dom.CallinMappingDeclaration.BASE_MAPPING_ELEMENTS_PROPERTY;
+import static org.eclipse.jdt.core.dom.MethodBindingOperator.BINDING_MODIFIER_PROPERTY;
+import static org.eclipse.objectteams.otdt.ui.ImageConstants.CALLINBINDING_AFTER_IMG;
+import static org.eclipse.objectteams.otdt.ui.ImageConstants.CALLINBINDING_BEFORE_IMG;
+import static org.eclipse.objectteams.otdt.ui.ImageConstants.CALLINBINDING_REPLACE_IMG;
+
+import java.util.List;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.dom.ASTNode;
+import org.eclipse.jdt.core.dom.AbstractMethodMappingDeclaration;
+import org.eclipse.jdt.core.dom.CallinMappingDeclaration;
+import org.eclipse.jdt.core.dom.ChildListPropertyDescriptor;
+import org.eclipse.jdt.core.dom.IMethodBinding;
+import org.eclipse.jdt.core.dom.IMethodMappingBinding;
+import org.eclipse.jdt.core.dom.ITypeBinding;
+import org.eclipse.jdt.core.dom.MethodSpec;
+import org.eclipse.jdt.core.dom.Modifier;
+import org.eclipse.jdt.core.dom.Modifier.ModifierKeyword;
+import org.eclipse.jdt.core.dom.rewrite.ASTRewrite;
+import org.eclipse.jdt.core.dom.rewrite.ITrackedNodePosition;
+import org.eclipse.jdt.core.dom.rewrite.ImportRewrite;
+import org.eclipse.jdt.core.dom.rewrite.ListRewrite;
+import org.eclipse.jdt.internal.compiler.lookup.ExtraCompilerModifiers;
+import org.eclipse.jdt.internal.corext.fix.LinkedProposalPositionGroup;
+import org.eclipse.objectteams.otdt.internal.ui.util.Images;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * Rewrite-based completion proposal for the RHS of an incomplete callin mapping.
+ * If the mapping does not yet specify a callin modifier (before,replace,after)
+ * one is inferred in accordance with the bound role method.
+ * After insertion into the editor the callin modifier can be changed using linked-mode editing.
+ *
+ * @author stephan
+ * @since 1.1.8
+ */
+@SuppressWarnings("restriction")
+protected class CallinRHSCompletionProposal extends MethodMappingCompletionProposal {
+
+ protected CallinRHSCompletionProposal(IJavaProject jProject,
+ ICompilationUnit cu,
+ CompletionProposal proposal,
+ String[] paramTypes,
+ int length,
+ String displayName,
+ Image image)
+ {
+ super(jProject, cu, proposal, paramTypes, length, displayName, image);
+ }
+
+ @SuppressWarnings("unchecked") // list of method specs from dom.
+ @Override
+ boolean setupRewrite(ICompilationUnit iCU,
+ ASTRewrite rewrite,
+ ImportRewrite importRewrite,
+ ITypeBinding roleBinding,
+ ITypeBinding baseBinding,
+ ASTNode type,
+ AbstractMethodMappingDeclaration partialMapping,
+ ChildListPropertyDescriptor bodyProperty)
+ throws CoreException
+ {
+ if (partialMapping == null || !(partialMapping instanceof CallinMappingDeclaration))
+ return false;
+ // find base method:
+ IMethodBinding method= findMethod(baseBinding, fMethodName, fParamTypes);
+ if (method == null)
+ return false;
+ CallinMappingDeclaration callinMapping= (CallinMappingDeclaration)partialMapping;
+
+ ListRewrite baseSpecsRewrite = rewrite.getListRewrite(partialMapping, BASE_MAPPING_ELEMENTS_PROPERTY);
+
+ int insertPosition= 0;
+ if (fLength > 0) {
+ // need to remove partial method spec:
+ List<MethodSpec> baseSpecs= callinMapping.getBaseMappingElements();
+ for (int i = 0; i < baseSpecs.size(); i++) {
+ MethodSpec spec= baseSpecs.get(i);
+ if ( spec.getStartPosition() == fReplaceStart
+ && spec.getLength() == fLength)
+ {
+ baseSpecsRewrite.remove(spec, null);
+ insertPosition= i+1;
+ break;
+ }
+ }
+ }
+
+ // create and insert:
+ boolean hasSignature= callinMapping.getRoleMappingElement().hasSignature();
+ MethodSpec spec= StubUtility2
+ .createMethodSpec(iCU, rewrite, importRewrite, method, hasSignature);
+ baseSpecsRewrite.insertAt(spec, insertPosition, null);
+
+ int existingMod= ((CallinMappingDeclaration)partialMapping).getCallinModifier();
+ if (existingMod == Modifier.OT_MISSING_MODIFIER)
+ {
+ // initial modifier (should match the role method):
+ ModifierKeyword defaultKeyword = ModifierKeyword.BEFORE_KEYWORD;
+ IMethodMappingBinding mappingBinding= partialMapping.resolveBinding();
+ if (mappingBinding != null) {
+ IMethodBinding roleMethod= mappingBinding.getRoleMethod();
+ if ( roleMethod != null
+ && (roleMethod.getModifiers() & ExtraCompilerModifiers.AccCallin) != 0)
+ defaultKeyword= ModifierKeyword.REPLACE_KEYWORD;
+ else
+ defaultKeyword= ModifierKeyword.BEFORE_KEYWORD;
+ }
+ Modifier afterMod= rewrite.getAST().newModifier(defaultKeyword);
+ rewrite.set(partialMapping.bindingOperator(), BINDING_MODIFIER_PROPERTY, afterMod, null);
+
+ // other modifiers:
+ final ITrackedNodePosition position = rewrite.track(afterMod);
+ this.addLinkedPosition(position, false, BINDINGKIND_KEY);
+ LinkedProposalPositionGroup group=
+ getLinkedProposalModel().getPositionGroup(BINDINGKIND_KEY, true);
+ group.addProposal("before", Images.getImage(CALLINBINDING_BEFORE_IMG), 13); //$NON-NLS-1$
+ group.addProposal("replace", Images.getImage(CALLINBINDING_REPLACE_IMG), 13); //$NON-NLS-1$
+ group.addProposal("after", Images.getImage(CALLINBINDING_AFTER_IMG), 13); //$NON-NLS-1$
+ }
+ return true;
+ }
+
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/assist/CompletionAdaptor/CalloutToFieldCompletionProposal.java b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/assist/CompletionAdaptor/CalloutToFieldCompletionProposal.java
new file mode 100644
index 000000000..4b7baa83d
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/assist/CompletionAdaptor/CalloutToFieldCompletionProposal.java
@@ -0,0 +1,104 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2008 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: CalloutToFieldCompletionProposal.java 23438 2010-02-04 20:05:24Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+team package org.eclipse.objectteams.otdt.internal.ui.assist.CompletionAdaptor;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.dom.ASTNode;
+import org.eclipse.jdt.core.dom.AbstractMethodMappingDeclaration;
+import org.eclipse.jdt.core.dom.CalloutMappingDeclaration;
+import org.eclipse.jdt.core.dom.ChildListPropertyDescriptor;
+import org.eclipse.jdt.core.dom.ITypeBinding;
+import org.eclipse.jdt.core.dom.IVariableBinding;
+import org.eclipse.jdt.core.dom.MethodBindingOperator;
+import org.eclipse.jdt.core.dom.rewrite.ASTRewrite;
+import org.eclipse.jdt.core.dom.rewrite.ImportRewrite;
+import org.eclipse.jdt.internal.corext.codemanipulation.CodeGenerationSettings;
+import org.eclipse.jdt.internal.corext.dom.Bindings;
+import org.eclipse.jdt.internal.ui.preferences.JavaPreferencesSettings;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ *
+ * @author stephan
+ * @since 1.1.7
+ */
+@SuppressWarnings("restriction")
+protected class CalloutToFieldCompletionProposal extends CreateMethodMappingCompletionProposal
+{
+ private String fFieldType;
+ private String fFieldName;
+ private boolean isSetter;
+
+ protected CalloutToFieldCompletionProposal(IJavaProject jProject,
+ ICompilationUnit cu,
+ CompletionProposal proposal,
+ String fieldName,
+ String fieldType,
+ boolean isSetter,
+ boolean isOverride,
+ int length,
+ String displayName,
+ Image image)
+ {
+ super(jProject, cu, proposal, length, displayName, image);
+ this.fFieldType= fieldType;
+ this.fFieldName= fieldName;
+ this.isSetter= isSetter;
+ this.fIsOverride= isOverride;
+ }
+
+ @Override
+ boolean setupRewrite(ICompilationUnit iCU,
+ ASTRewrite rewrite,
+ ImportRewrite importRewrite,
+ ITypeBinding roleBinding,
+ ITypeBinding baseBinding,
+ ASTNode node,
+ AbstractMethodMappingDeclaration partialMapping,
+ ChildListPropertyDescriptor bodyProperty)
+ throws CoreException
+ {
+ // find base field:
+ IVariableBinding field= findField(baseBinding, this.fFieldName, this.fFieldType);
+ if (field == null)
+ return false;
+ CodeGenerationSettings settings= JavaPreferencesSettings.getCodeGenerationSettings(this.fJavaProject);
+ // create callout:
+ CalloutMappingDeclaration stub= StubUtility2.createCalloutToField(
+ iCU, rewrite, importRewrite,
+ this.fMethodName,
+ field, this.isSetter, roleBinding.getName(),
+ settings);
+ if (stub != null) {
+ stub.bindingOperator().setBindingKind(this.fIsOverride ? MethodBindingOperator.KIND_CALLOUT_OVERRIDE : MethodBindingOperator.KIND_CALLOUT);
+ insertStub(rewrite, node, bodyProperty, stub);
+ }
+ return true;
+ }
+
+ IVariableBinding findField(ITypeBinding type, String selector, String typeName) {
+ while (type != null) {
+ IVariableBinding result= Bindings.findFieldInType(type, selector);
+ if (result != null)
+ return result;
+ type= type.getSuperclass();
+ }
+ return null;
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/assist/CompletionAdaptor/CreateMethodMappingCompletionProposal.java b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/assist/CompletionAdaptor/CreateMethodMappingCompletionProposal.java
new file mode 100644
index 000000000..4b127963d
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/assist/CompletionAdaptor/CreateMethodMappingCompletionProposal.java
@@ -0,0 +1,237 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2007, 2008 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: CreateMethodMappingCompletionProposal.java 23438 2010-02-04 20:05:24Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+team package org.eclipse.objectteams.otdt.internal.ui.assist.CompletionAdaptor;
+
+import static org.eclipse.objectteams.otdt.ui.ImageConstants.CALLINBINDING_AFTER_IMG;
+import static org.eclipse.objectteams.otdt.ui.ImageConstants.CALLINBINDING_BEFORE_IMG;
+import static org.eclipse.objectteams.otdt.ui.ImageConstants.CALLINBINDING_REPLACE_IMG;
+import static org.eclipse.objectteams.otdt.ui.ImageConstants.CALLOUTBINDING_IMG;
+
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jdt.core.CompletionProposal;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.core.dom.AST;
+import org.eclipse.jdt.core.dom.ASTNode;
+import org.eclipse.jdt.core.dom.AbstractMethodMappingDeclaration;
+import org.eclipse.jdt.core.dom.ChildListPropertyDescriptor;
+import org.eclipse.jdt.core.dom.IMethodBinding;
+import org.eclipse.jdt.core.dom.ITypeBinding;
+import org.eclipse.jdt.core.dom.MethodBindingOperator;
+import org.eclipse.jdt.core.dom.MethodSpec;
+import org.eclipse.jdt.core.dom.SingleVariableDeclaration;
+import org.eclipse.jdt.core.dom.Type;
+import org.eclipse.jdt.core.dom.Modifier.ModifierKeyword;
+import org.eclipse.jdt.core.dom.rewrite.ASTRewrite;
+import org.eclipse.jdt.core.dom.rewrite.ITrackedNodePosition;
+import org.eclipse.jdt.core.dom.rewrite.ImportRewrite;
+import org.eclipse.jdt.core.dom.rewrite.ListRewrite;
+import org.eclipse.jdt.internal.corext.codemanipulation.CodeGenerationSettings;
+import org.eclipse.jdt.internal.corext.fix.LinkedProposalPositionGroup;
+import org.eclipse.jdt.internal.ui.preferences.JavaPreferencesSettings;
+import org.eclipse.objectteams.otdt.internal.ui.util.Images;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.text.edits.DeleteEdit;
+import org.eclipse.text.edits.MultiTextEdit;
+import org.eclipse.text.edits.TextEdit;
+
+/**
+ * [unbound role: extends rather than playedBy.]
+ *
+ * Rewrite-based completion for creating full callout mappings,
+ * which afterwards use linked mode editing for choosing the method binding kind.
+ * Also the role method name is offered for editing in linked mode.
+ *
+ * @author stephan
+ * @since 1.1.2
+ */
+@SuppressWarnings("restriction")
+protected class CreateMethodMappingCompletionProposal extends MethodMappingCompletionProposal
+{
+ boolean fIsOverride = false;
+ boolean fIsOnlyCallin = false;
+
+ protected CreateMethodMappingCompletionProposal(IJavaProject jProject,
+ ICompilationUnit cu,
+ CompletionProposal proposal,
+ String[] paramTypes,
+ boolean isOverride,
+ boolean isOnlyCallin,
+ int length,
+ String displayName,
+ Image image)
+ {
+ super(jProject, cu, proposal, paramTypes, length, displayName, image);
+ this.fIsOverride= isOverride;
+ this.fIsOnlyCallin = isOnlyCallin;
+ }
+ protected CreateMethodMappingCompletionProposal(IJavaProject jProject,
+ ICompilationUnit cu,
+ CompletionProposal proposal,
+ int length,
+ String displayName,
+ Image image)
+ {
+ super(jProject, cu, proposal, length, displayName, image);
+ }
+
+ /** Create a rewrite that additionally removes typed fragment if needed.
+ * That fragment will not be represented by an AST-node, that could be removed.
+ */
+ ASTRewrite createRewrite(AST ast)
+ {
+ if (fLength == 0)
+ return ASTRewrite.create(ast);
+
+ // the typed prefix will have to be deleted:
+ final TextEdit delete= new DeleteEdit(fReplaceStart, fLength);
+
+ // return a custom rewrite that additionally deletes typed fragment
+ return new ASTRewrite(ast) {
+ @Override
+ public TextEdit rewriteAST()
+ throws JavaModelException, IllegalArgumentException
+ {
+ TextEdit edits = super.rewriteAST();
+ if (edits instanceof MultiTextEdit) {
+ MultiTextEdit multi = (MultiTextEdit) edits;
+ multi.addChild(delete);
+ }
+ return edits;
+ }
+ };
+ }
+
+ /** Overridable, see CalloutToFieldCompletionProposal.
+ * At least baseBinding must be set, roleBinding is optional.
+ */
+ boolean setupRewrite(ICompilationUnit iCU,
+ ASTRewrite rewrite,
+ ImportRewrite importRewrite,
+ ITypeBinding roleBinding,
+ ITypeBinding baseBinding,
+ ASTNode type,
+ AbstractMethodMappingDeclaration partialMapping,
+ ChildListPropertyDescriptor bodyProperty)
+ throws CoreException
+ {
+ // find base method:
+ IMethodBinding method= findMethod(baseBinding, fMethodName, fParamTypes);
+ if (method == null)
+ return false;
+
+ CodeGenerationSettings settings= JavaPreferencesSettings.getCodeGenerationSettings(fJavaProject);
+ // create callout:
+ AbstractMethodMappingDeclaration stub= this.fIsOnlyCallin
+ ? StubUtility2.createCallin(iCU, rewrite, importRewrite,
+ method, baseBinding.getName(), ModifierKeyword.BEFORE_KEYWORD, settings)
+ : StubUtility2.createCallout(iCU, rewrite, importRewrite,
+ method, baseBinding.getName(), settings);
+ if (stub != null) {
+ insertStub(rewrite, type, bodyProperty, stub);
+ addLinkedPosition(rewrite.track(stub.getRoleMappingElement().getName()), true, ROLEMETHODNAME_KEY);
+
+ if (roleBinding != null)
+ addLiftingProposals(roleBinding, method, stub, rewrite);
+
+ addLinkedPosition(rewrite.track(stub.bindingOperator()), false, BINDINGKIND_KEY);
+ LinkedProposalPositionGroup group= getLinkedProposalModel().getPositionGroup(BINDINGKIND_KEY, true);
+ if (!this.fIsOnlyCallin) {
+ String calloutToken = "->";
+ if (this.fIsOverride) {
+ calloutToken = "=>";
+ stub.bindingOperator().setBindingKind(MethodBindingOperator.KIND_CALLOUT_OVERRIDE);
+ }
+ group.addProposal(calloutToken, Images.getImage(CALLOUTBINDING_IMG), 13); //$NON-NLS-1$
+ }
+ group.addProposal("<- before", Images.getImage(CALLINBINDING_BEFORE_IMG), 13); //$NON-NLS-1$
+ group.addProposal("<- replace", Images.getImage(CALLINBINDING_REPLACE_IMG), 13); //$NON-NLS-1$
+ group.addProposal("<- after", Images.getImage(CALLINBINDING_AFTER_IMG), 13); //$NON-NLS-1$
+ }
+ return true;
+ }
+
+ /** Check if any parameters or the return type are candidates for lifting/lowering. */
+ @SuppressWarnings("rawtypes")
+ private void addLiftingProposals(ITypeBinding roleTypeBinding, IMethodBinding methodBinding,
+ AbstractMethodMappingDeclaration stub, ASTRewrite rewrite)
+ {
+ ITypeBinding[] roles= roleTypeBinding.getDeclaringClass().getDeclaredTypes();
+ MethodSpec roleSpec= (MethodSpec)stub.getRoleMappingElement();
+ List params= roleSpec.parameters();
+ ITypeBinding[] paramTypes = methodBinding.getParameterTypes();
+ for (int i= 0; i<params.size(); i++)
+ addLiftingProposalGroup(rewrite, ROLEPARAM_KEY+i, roles,
+ ((SingleVariableDeclaration)params.get(i)).getType(), paramTypes[i]);
+ addLiftingProposalGroup(rewrite, ROLEPARAM_KEY+"return", roles, //$NON-NLS-1$
+ roleSpec.getReturnType2(), methodBinding.getReturnType());
+ }
+ /**
+ * check whether a given type is played by a role from a given array and create a proposal group containing base and role type.
+ * @param rewrite
+ * @param positionGroupID
+ * @param roles available roles in the enclosing team
+ * @param type AST node to investigate
+ * @param typeBinding type binding of AST node to investigate
+ */
+ void addLiftingProposalGroup(ASTRewrite rewrite, String positionGroupID, ITypeBinding[] roles, Type type, ITypeBinding typeBinding)
+ {
+ for (ITypeBinding roleBinding : roles) {
+ if (roleBinding.isSynthRoleIfc()) continue; // synth ifcs would otherwise cause dupes
+ if (typeBinding.equals(roleBinding.getBaseClass())) {
+ ITrackedNodePosition argTypePos= rewrite.track(type);
+ addLinkedPosition(argTypePos, true, positionGroupID);
+ LinkedProposalPositionGroup group=
+ getLinkedProposalModel().getPositionGroup(positionGroupID, true);
+ group.addProposal(type.toString(), null, 13);
+ group.addProposal(roleBinding.getName(), null, 13);
+ break;
+ }
+ }
+ }
+
+ /** find insertion position, and insert: */
+ @SuppressWarnings("rawtypes") // DOM-lists
+ void insertStub(ASTRewrite rewrite,
+ ASTNode node,
+ ChildListPropertyDescriptor bodyProperty,
+ ASTNode stub)
+ {
+ ListRewrite bodyRewrite= rewrite.getListRewrite(node, bodyProperty);
+ List bodyDecls= (List)node.getStructuralProperty(bodyProperty);
+
+ ASTNode prev= null;
+ if (bodyDecls != null && !bodyDecls.isEmpty()) {
+ for (Iterator iterator = bodyDecls.iterator(); iterator.hasNext();) {
+ ASTNode cur= (ASTNode) iterator.next();
+ if (cur.getStartPosition()<fReplaceStart)
+ prev= cur;
+ else
+ break;
+ }
+ }
+ if (prev != null)
+ bodyRewrite.insertAfter(stub, prev, null);
+ else
+ bodyRewrite.insertFirst(stub, null);
+ }
+
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/assist/CompletionAdaptor/MethodMappingCompletionProposal.java b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/assist/CompletionAdaptor/MethodMappingCompletionProposal.java
new file mode 100644
index 000000000..1c0d6c146
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/assist/CompletionAdaptor/MethodMappingCompletionProposal.java
@@ -0,0 +1,171 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2008 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: MethodMappingCompletionProposal.java 23438 2010-02-04 20:05:24Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+team package org.eclipse.objectteams.otdt.internal.ui.assist.CompletionAdaptor;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.dom.AST;
+import org.eclipse.jdt.core.dom.ASTNode;
+import org.eclipse.jdt.core.dom.AbstractMethodMappingDeclaration;
+import org.eclipse.jdt.core.dom.AbstractTypeDeclaration;
+import org.eclipse.jdt.core.dom.ChildListPropertyDescriptor;
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jdt.core.dom.IMethodBinding;
+import org.eclipse.jdt.core.dom.ITypeBinding;
+import org.eclipse.jdt.core.dom.RoleTypeDeclaration;
+import org.eclipse.jdt.core.dom.rewrite.ASTRewrite;
+import org.eclipse.jdt.core.dom.rewrite.ImportRewrite;
+import org.eclipse.jdt.internal.corext.dom.Bindings;
+import org.eclipse.jdt.core.dom.NodeFinder;
+import org.eclipse.jdt.internal.ui.text.correction.ASTResolving;
+import org.eclipse.jdt.internal.ui.text.correction.proposals.LinkedCorrectionProposal;
+import org.eclipse.objectteams.otdt.ui.OTDTUIPlugin;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.text.edits.ReplaceEdit;
+import org.eclipse.text.edits.TextEdit;
+
+/**
+ * This abstract class is a convenience for its subclasses:
+ * rewrite-based completion proposals relating to method mappings.
+ *
+ * @author stephan
+ * @since 1.1.8
+ */
+@SuppressWarnings("restriction")
+protected abstract class MethodMappingCompletionProposal extends LinkedCorrectionProposal
+{
+
+ static final String ROLEMETHODNAME_KEY= "rolemethodname"; //$NON-NLS-1$
+ static final String ROLEPARAM_KEY= "roleparam"; //$NON-NLS-1$
+ static final String BINDINGKIND_KEY = "bindingkind"; //$NON-NLS-1$
+
+ String[] fParamTypes;
+ String fMethodName;
+
+ IJavaProject fJavaProject;
+
+ // info from the CompletionProposal
+ int fReplaceStart;
+ int fLength;
+ String fReplacementString;
+
+ public MethodMappingCompletionProposal(IJavaProject jProject,
+ ICompilationUnit cu,
+ CompletionProposal proposal,
+ int length,
+ String displayName,
+ Image image)
+ {
+ super(displayName, cu, null, computeRelevance(proposal), image);
+ fMethodName= String.valueOf(proposal.getName());
+ fJavaProject= jProject;
+ fReplaceStart= proposal.getReplaceStart();
+ fLength= length;
+ fReplacementString= new String(proposal.getCompletion());
+ }
+ public MethodMappingCompletionProposal(IJavaProject jProject,
+ ICompilationUnit cu,
+ CompletionProposal proposal,
+ String[] paramTypes,
+ int length,
+ String displayName,
+ Image image)
+ {
+ this(jProject, cu, proposal, length, displayName, image);
+ fParamTypes= paramTypes;
+ }
+
+ /*
+ */
+ @Override
+ protected ASTRewrite getRewrite() throws CoreException {
+ ICompilationUnit iCU= getCompilationUnit();
+ CompilationUnit unit= ASTResolving.createQuickFixAST(iCU, null);
+ ImportRewrite importRewrite= createImportRewrite(unit);
+
+ // find enclosing mapping and type:
+ AbstractMethodMappingDeclaration partialMapping=null;
+ ASTNode node= NodeFinder.perform(unit, fReplaceStart, 0);
+ while(node != null && !(node instanceof AbstractTypeDeclaration))
+ {
+ if (partialMapping == null && (node instanceof AbstractMethodMappingDeclaration))
+ partialMapping= (AbstractMethodMappingDeclaration)node;
+ node= node.getParent();
+ }
+
+ if (node != null) {
+ AbstractTypeDeclaration declaration= ((AbstractTypeDeclaration) node);
+ ChildListPropertyDescriptor bodyProperty= declaration.getBodyDeclarationsProperty();
+
+ // find role and base type bindings:
+ ITypeBinding roleBinding = declaration.resolveBinding();
+ ITypeBinding baseBinding = null;
+ if (roleBinding != null) {
+ baseBinding = roleBinding.getBaseClass();
+ } else if (declaration instanceof RoleTypeDeclaration) {
+ baseBinding = ((RoleTypeDeclaration)declaration).getBaseClassType().resolveBinding();
+ }
+ if (baseBinding == null) {
+ OTDTUIPlugin.getDefault().getLog().log(new Status(Status.ERROR, "org.eclipse.objectteams.otdt.jdt.ui", "could not resolve type bindings")); //$NON-NLS-1$ //$NON-NLS-2$
+ return null;
+ }
+
+ // create and setup the rewrite:
+ ASTRewrite rewrite= createRewrite(unit.getAST());
+ rewrite.setToOTJ();
+ if (setupRewrite(iCU, rewrite, importRewrite, roleBinding, baseBinding, node, partialMapping, bodyProperty))
+ return rewrite;
+
+ // rewriting was not successful, use the original replace string from the CompletionProposal:
+ return new ASTRewrite(unit.getAST()) {
+ @Override
+ public TextEdit rewriteAST() {
+ return new ReplaceEdit(fReplaceStart, fLength, fReplacementString);
+ }
+ };
+ }
+ return null;
+ }
+
+ /** Create a fresh rewrite, by default nothing exciting, but overridable.. */
+ ASTRewrite createRewrite(AST ast) {
+ return ASTRewrite.create(ast);
+ }
+
+ abstract boolean setupRewrite(ICompilationUnit iCU,
+ ASTRewrite rewrite,
+ ImportRewrite importRewrite,
+ ITypeBinding roleBinding,
+ ITypeBinding baseBinding,
+ ASTNode type,
+ AbstractMethodMappingDeclaration partialMapping,
+ ChildListPropertyDescriptor bodyProperty)
+ throws CoreException;
+
+ /** replace getOverridableMethods with a lookup of our own. */
+ IMethodBinding findMethod(ITypeBinding type, String selector, String[] paramTypeNames) {
+ while (type != null) {
+ IMethodBinding result= Bindings.findMethodInType(type, selector, paramTypeNames);
+ if (result != null)
+ return result;
+ type= type.getSuperclass();
+ }
+ return null;
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/assist/CompletionAdaptor/MethodSpecCompletionProposal.java b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/assist/CompletionAdaptor/MethodSpecCompletionProposal.java
new file mode 100644
index 000000000..e804eac77
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/assist/CompletionAdaptor/MethodSpecCompletionProposal.java
@@ -0,0 +1,83 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2007, 2008 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: MethodSpecCompletionProposal.java 23438 2010-02-04 20:05:24Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+team package org.eclipse.objectteams.otdt.internal.ui.assist.CompletionAdaptor;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.dom.ASTNode;
+import org.eclipse.jdt.core.dom.AbstractMethodMappingDeclaration;
+import org.eclipse.jdt.core.dom.CallinMappingDeclaration;
+import org.eclipse.jdt.core.dom.CalloutMappingDeclaration;
+import org.eclipse.jdt.core.dom.ChildListPropertyDescriptor;
+import org.eclipse.jdt.core.dom.IMethodBinding;
+import org.eclipse.jdt.core.dom.ITypeBinding;
+import org.eclipse.jdt.core.dom.MethodSpec;
+import org.eclipse.jdt.core.dom.rewrite.ASTRewrite;
+import org.eclipse.jdt.core.dom.rewrite.ImportRewrite;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * Rewrite based completion proposal for inserting a RHS method spec.
+ * Adjusts style of method spec (short/long) to the existing LHS method spec.
+ * (No linked mode in this case).
+ *
+ * @author stephan
+ * @since 1.1.6
+ */
+protected class MethodSpecCompletionProposal extends MethodMappingCompletionProposal
+{
+
+ public MethodSpecCompletionProposal(IJavaProject jProject,
+ ICompilationUnit cu,
+ CompletionProposal proposal,
+ String[] paramTypes,
+ int length,
+ String displayName,
+ Image image)
+ {
+ super(jProject, cu, proposal, paramTypes, length, displayName, image);
+ }
+
+ boolean setupRewrite(ICompilationUnit iCU,
+ ASTRewrite rewrite,
+ ImportRewrite importRewrite,
+ ITypeBinding roleBinding,
+ ITypeBinding baseBinding,
+ ASTNode type,
+ AbstractMethodMappingDeclaration partialMapping,
+ ChildListPropertyDescriptor bodyProperty)
+ throws CoreException
+ {
+ if (partialMapping == null)
+ return false;
+ // find base method:
+ IMethodBinding method= findMethod(baseBinding, fMethodName, fParamTypes);
+ if (method == null)
+ return false;
+ // create and insert:
+ MethodSpec spec= StubUtility2
+ .createMethodSpec(iCU, rewrite, importRewrite, method, partialMapping.hasSignature());
+ if (partialMapping instanceof CalloutMappingDeclaration)
+ rewrite.set(partialMapping, CalloutMappingDeclaration.BASE_MAPPING_ELEMENT_PROPERTY, spec, null);
+ else
+ rewrite.getListRewrite(partialMapping, CallinMappingDeclaration.BASE_MAPPING_ELEMENTS_PROPERTY)
+ .insertFirst(spec, null);
+ return true;
+ }
+
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/assist/CompletionAdaptor/StubUtility2.java b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/assist/CompletionAdaptor/StubUtility2.java
new file mode 100644
index 000000000..c47c9ca43
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/assist/CompletionAdaptor/StubUtility2.java
@@ -0,0 +1,382 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2007 Technical University Berlin, Germany and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: StubUtility2.java 23438 2010-02-04 20:05:24Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ * IBM Corporation - implementation of individual method bodies
+ **********************************************************************/
+team package org.eclipse.objectteams.otdt.internal.ui.assist.CompletionAdaptor;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.dom.AST;
+import org.eclipse.jdt.core.dom.ASTNode;
+import org.eclipse.jdt.core.dom.CallinMappingDeclaration;
+import org.eclipse.jdt.core.dom.CalloutMappingDeclaration;
+import org.eclipse.jdt.core.dom.FieldAccessSpec;
+import org.eclipse.jdt.core.dom.IMethodBinding;
+import org.eclipse.jdt.core.dom.IPackageBinding;
+import org.eclipse.jdt.core.dom.ITypeBinding;
+import org.eclipse.jdt.core.dom.IVariableBinding;
+import org.eclipse.jdt.core.dom.Javadoc;
+import org.eclipse.jdt.core.dom.MethodBindingOperator;
+import org.eclipse.jdt.core.dom.MethodDeclaration;
+import org.eclipse.jdt.core.dom.MethodSpec;
+import org.eclipse.jdt.core.dom.Modifier;
+import org.eclipse.jdt.core.dom.PrimitiveType;
+import org.eclipse.jdt.core.dom.SingleVariableDeclaration;
+import org.eclipse.jdt.core.dom.Modifier.ModifierKeyword;
+import org.eclipse.jdt.core.dom.rewrite.ASTRewrite;
+import org.eclipse.jdt.core.dom.rewrite.ImportRewrite;
+import org.eclipse.jdt.core.dom.rewrite.ImportRewrite.ImportRewriteContext;
+import org.eclipse.jdt.internal.corext.codemanipulation.CodeGenerationSettings;
+import org.eclipse.jdt.internal.corext.codemanipulation.StubUtility;
+import org.eclipse.jdt.ui.CodeGeneration;
+
+/**
+ * Add new functions to StubUtility2, accessing otherwise invisible helper functions.
+ * @author stephan
+ * @since 1.1.2
+ */
+@SuppressWarnings({ "unchecked", "rawtypes"/*parameter-less lists from DOM*/, "restriction", "decapsulation"/*final baseclass + callout-decapsulation*/ })
+protected class StubUtility2 playedBy StubUtility2
+{
+
+ // CALLOUT INTERFACE:
+ List createParameters(IJavaProject project, ImportRewrite imports, ImportRewriteContext context, AST ast, IMethodBinding binding, MethodDeclaration decl)
+ -> List createParameters(IJavaProject project, ImportRewrite imports, ImportRewriteContext context, AST ast, IMethodBinding binding, MethodDeclaration decl);
+
+ void findUnimplementedInterfaceMethods(ITypeBinding typeBinding, HashSet visited, ArrayList allMethods, IPackageBinding currPack, ArrayList toImplement)
+ -> void findUnimplementedInterfaceMethods(ITypeBinding typeBinding, HashSet visited, ArrayList allMethods, IPackageBinding currPack, ArrayList toImplement);
+ IMethodBinding findMethodBinding(IMethodBinding method, List allMethods)
+ -> IMethodBinding findMethodBinding(IMethodBinding method, List allMethods);
+
+ /** This method is inspired by createImplementationStub(..), but much leaner. */
+ public static CalloutMappingDeclaration createCallout(ICompilationUnit unit,
+ ASTRewrite rewrite,
+ ImportRewrite imports,
+ IMethodBinding binding,
+ String type,
+ CodeGenerationSettings settings)
+ throws CoreException
+ {
+ AST ast= rewrite.getAST();
+
+ CalloutMappingDeclaration decl= ast.newCalloutMappingDeclaration();
+ decl.setSignatureFlag(true);
+ // no modifiers
+
+ MethodSpec spec = ast.newMethodSpec();
+ spec.setSignatureFlag(true);
+ spec.setName(ast.newSimpleName(binding.getName()));
+
+ // no type parameters
+
+ spec.setReturnType2(imports.addImport(binding.getReturnType(), ast));
+
+ // this helps to reuse some code regarding methods:
+ MethodDeclaration method = ast.newMethodDeclaration();
+
+ List parameters= createParameters(unit.getJavaProject(), imports, null, ast, binding, method);
+
+ spec.parameters().addAll(ASTNode.copySubtrees(ast, parameters)); // copy to re-parent
+
+ decl.setRoleMappingElement(spec);
+ decl.setBaseMappingElement((MethodSpec)ASTNode.copySubtree(ast, spec));
+ // no thrown exceptions
+
+ String delimiter= StubUtility.getLineDelimiterUsed(unit);
+ // no body
+
+ if (settings.createComments) {
+ // TODO(SH): this reuses the template for overridden methods, should actually define our own template.
+ String string= CodeGeneration.getMethodComment(unit, type, method, binding, delimiter);
+ if (string != null) {
+ Javadoc javadoc= (Javadoc) rewrite.createStringPlaceholder(string, ASTNode.JAVADOC);
+ decl.setJavadoc(javadoc);
+ }
+ }
+
+ // no override annotation
+
+ return decl;
+
+ }
+ /** This method is inspired by createImplementationStub(..), but much leaner. */
+ public static CallinMappingDeclaration createCallin(ICompilationUnit unit,
+ ASTRewrite rewrite,
+ ImportRewrite imports,
+ IMethodBinding binding,
+ String type,
+ ModifierKeyword callinModifier,
+ CodeGenerationSettings settings)
+ throws CoreException
+ {
+ AST ast= rewrite.getAST();
+
+ CallinMappingDeclaration decl= ast.newCallinMappingDeclaration();
+ decl.setBindingOperator(ast.newMethodBindingOperator(callinModifier, MethodBindingOperator.KIND_CALLIN));
+ // no regular modifiers
+
+ MethodSpec spec = ast.newMethodSpec();
+ spec.setSignatureFlag(true);
+ spec.setName(ast.newSimpleName(binding.getName()));
+
+ // no type parameters
+
+ spec.setReturnType2(imports.addImport(binding.getReturnType(), ast));
+
+ // this helps to reuse some code regarding methods:
+ MethodDeclaration method = ast.newMethodDeclaration();
+
+ List parameters= createParameters(unit.getJavaProject(), imports, null, ast, binding, method);
+
+ spec.parameters().addAll(ASTNode.copySubtrees(ast, parameters)); // copy to re-parent
+
+ decl.setRoleMappingElement(spec);
+ decl.getBaseMappingElements().add(ASTNode.copySubtree(ast, spec));
+ // no thrown exceptions
+
+ String delimiter= StubUtility.getLineDelimiterUsed(unit);
+ // no body
+
+ if (settings.createComments) {
+ // TODO(SH): this reuses the template for overridden methods, should actually define our own template.
+ String string= CodeGeneration.getMethodComment(unit, type, method, binding, delimiter);
+ if (string != null) {
+ Javadoc javadoc= (Javadoc) rewrite.createStringPlaceholder(string, ASTNode.JAVADOC);
+ decl.setJavadoc(javadoc);
+ }
+ }
+
+ // no override annotation
+
+ return decl;
+
+ }
+ /** Stripped down version of createCallout for use after '<-' : */
+ public static MethodSpec createMethodSpec(ICompilationUnit unit,
+ ASTRewrite rewrite,
+ ImportRewrite imports,
+ IMethodBinding binding,
+ boolean hasSignature)
+ throws CoreException
+ {
+ AST ast= rewrite.getAST();
+
+ MethodSpec spec = ast.newMethodSpec();
+ spec.setSignatureFlag(hasSignature);
+ spec.setName(ast.newSimpleName(binding.getName()));
+
+ // no type parameters
+
+ spec.setReturnType2(imports.addImport(binding.getReturnType(), ast));
+
+ // this helps to reuse some code regarding methods:
+ MethodDeclaration method = ast.newMethodDeclaration();
+
+ List parameters= createParameters(unit.getJavaProject(), imports, null, ast, binding, method);
+
+ spec.parameters().addAll(ASTNode.copySubtrees(ast, parameters)); // copy to re-parent
+
+ return spec;
+ }
+
+ /** New factory method: */
+ public static CalloutMappingDeclaration createCalloutToField(ICompilationUnit unit,
+ ASTRewrite rewrite,
+ ImportRewrite imports,
+ String accessorName,
+ IVariableBinding field,
+ boolean isSetter,
+ String declaringType,
+ CodeGenerationSettings settings)
+ throws CoreException
+ {
+ AST ast= rewrite.getAST();
+
+ CalloutMappingDeclaration decl= ast.newCalloutMappingDeclaration();
+ decl.setSignatureFlag(true);
+
+ // role side:
+ MethodSpec spec = ast.newMethodSpec();
+ spec.setSignatureFlag(true);
+ spec.setName(ast.newSimpleName(accessorName));
+ if (!isSetter) {
+ spec.setReturnType2(imports.addImport(field.getType(), ast));
+ // no parameters
+ } else {
+ spec.setReturnType2(ast.newPrimitiveType(PrimitiveType.VOID));
+ createSetterParameter(unit, imports, ast, field, spec);
+ }
+ decl.setRoleMappingElement(spec);
+
+ // base side:
+ FieldAccessSpec fSpec= ast.newFieldAccessSpec();
+ fSpec.setSignatureFlag(true);
+ fSpec.setName(ast.newSimpleName(field.getName()));
+ fSpec.setFieldType(imports.addImport(field.getType(), ast));
+ decl.bindingOperator().setBindingModifier(isSetter ? Modifier.OT_SET_CALLOUT : Modifier.OT_GET_CALLOUT);
+ decl.setBaseMappingElement(fSpec);
+
+ if (settings.createComments) {
+ String delimiter= StubUtility.getLineDelimiterUsed(unit);
+ String string= CodeGeneration.getFieldComment(unit, declaringType, field.getName(), delimiter);
+ if (string != null) {
+ Javadoc javadoc= (Javadoc) rewrite.createStringPlaceholder(string, ASTNode.JAVADOC);
+ decl.setJavadoc(javadoc);
+ }
+ }
+ return decl;
+ }
+
+ /** This method is inspired by createImplementationStub(..), but much leaner. */
+ public static MethodSpec createMethodSpec(ICompilationUnit unit,
+ ASTRewrite rewrite,
+ ImportRewrite imports,
+ ImportRewriteContext context,
+ AST ast,
+ IMethodBinding binding,
+ boolean hasSignature,
+ String type,
+ CodeGenerationSettings settings)
+ throws CoreException
+ {
+ MethodSpec spec = ast.newMethodSpec();
+ spec.setSignatureFlag(hasSignature);
+ spec.setName(ast.newSimpleName(binding.getName()));
+ if (!hasSignature)
+ return spec; // nothing more to do
+
+ // no type parameters
+
+ spec.setReturnType2(imports.addImport(binding.getReturnType(), ast));
+
+ // this helps to reuse some code regarding methods:
+ MethodDeclaration method = ast.newMethodDeclaration();
+
+ List parameters= createParameters(unit.getJavaProject(), imports, context, ast, binding, method);
+
+ spec.parameters().addAll(ASTNode.copySubtrees(ast, parameters)); // copy to re-parent
+
+ return spec;
+ }
+
+ /**
+ * This callin adds treatment of implicit inheritance including phantom roles
+ * to it's base version.
+ */
+ IMethodBinding[] getUnimplementedMethods(ITypeBinding typeBinding, boolean implementAbstractsOfInput)
+ <- replace IMethodBinding[] getUnimplementedMethods(ITypeBinding typeBinding, boolean implementAbstractsOfInput);
+ @SuppressWarnings("basecall")
+ callin static IMethodBinding[] getUnimplementedMethods(ITypeBinding typeBinding, boolean implementAbstractsOfInput) {
+ // COPY&PASTE from base version:
+ ArrayList allMethods= new ArrayList();
+ ArrayList toImplement= new ArrayList();
+
+ IMethodBinding[] typeMethods= typeBinding.getDeclaredMethods();
+ for (int i= 0; i < typeMethods.length; i++) {
+ IMethodBinding curr= typeMethods[i];
+ int modifiers= curr.getModifiers();
+ if (!curr.isConstructor() && !Modifier.isStatic(modifiers) && !Modifier.isPrivate(modifiers)) {
+//{ObjectTeams: never enter copied methods (have no java element)
+ if (!curr.isCopied())
+// SH}
+ allMethods.add(curr);
+ }
+ }
+//{ObjectTeams: direct tsuper roles:
+ ITypeBinding[] tsupers= typeBinding.getSuperRoles();
+ if (tsupers != null)
+ for (ITypeBinding tsuperRole : tsupers)
+ findVisibleVirtualMethods(tsuperRole, allMethods);
+// SH}
+
+ ITypeBinding superClass= typeBinding.getSuperclass();
+ while (superClass != null) {
+//{ObjectTeams: watch for phantom roles (which don't exist):
+ if (superClass.getJavaElement().exists()) {
+ // extracted orig:
+ findVisibleVirtualMethods(superClass, allMethods);
+ } else {
+ // proceed to the existing super of a phantom role:
+ tsupers= superClass.getSuperRoles();
+ if (tsupers != null)
+ for (ITypeBinding tsuperRole : tsupers)
+ findVisibleVirtualMethods(tsuperRole, allMethods);
+ }
+// SH}
+ superClass= superClass.getSuperclass();
+ }
+
+ for (int i= 0; i < allMethods.size(); i++) {
+ IMethodBinding curr= (IMethodBinding) allMethods.get(i);
+ int modifiers= curr.getModifiers();
+ if ((Modifier.isAbstract(modifiers) || curr.getDeclaringClass().isInterface()) && (implementAbstractsOfInput || typeBinding != curr.getDeclaringClass())) {
+ // implement all abstract methods
+ toImplement.add(curr);
+ }
+ }
+
+ HashSet visited= new HashSet();
+ ITypeBinding curr= typeBinding;
+ while (curr != null) {
+ ITypeBinding[] superInterfaces= curr.getInterfaces();
+ for (int i= 0; i < superInterfaces.length; i++) {
+//{ObjectTeams: consider that a role class part finds its super interfaces in the interface part:
+ if (curr.isClassPartOf(superInterfaces[i])) {
+ // do consider transitively inherited methods:
+ ITypeBinding[] superSuperInterfaces = superInterfaces[i].getInterfaces();
+ for (int j = 0; j < superSuperInterfaces.length; j++)
+ findUnimplementedInterfaceMethods(superSuperInterfaces[j], visited, allMethods, typeBinding.getPackage(), toImplement);
+ // but don't add methods from our own ifc-part (occurs when role extends non-role).
+ continue;
+ }
+// SH}
+ findUnimplementedInterfaceMethods(superInterfaces[i], visited, allMethods, typeBinding.getPackage(), toImplement);
+ }
+ curr= curr.getSuperclass();
+ }
+
+ return (IMethodBinding[]) toImplement.toArray(new IMethodBinding[toImplement.size()]);
+ }
+ // COPY&PASTE: orig extracted as helper from base of above:
+ private static void findVisibleVirtualMethods(ITypeBinding typeBinding, ArrayList allMethods) {
+ IMethodBinding[] typeMethods= typeBinding.getDeclaredMethods();
+ for (int i= 0; i < typeMethods.length; i++) {
+ IMethodBinding curr= typeMethods[i];
+ int modifiers= curr.getModifiers();
+ if (!curr.isConstructor() && !Modifier.isStatic(modifiers) && !Modifier.isPrivate(modifiers)) {
+ if (!curr.isCopied()) // new check for OT
+ if (findMethodBinding(curr, allMethods) == null) {
+ allMethods.add(curr);
+ }
+ }
+ }
+ }
+
+ static void createSetterParameter(ICompilationUnit unit, ImportRewrite imports, AST ast, IVariableBinding field, MethodSpec decl)
+ {
+ List parameters= decl.parameters();
+ SingleVariableDeclaration var= ast.newSingleVariableDeclaration();
+ var.setType(imports.addImport(field.getType(), ast));
+ var.setName(ast.newSimpleName(field.getName()));
+ parameters.add(var);
+ }
+
+}
+
diff --git a/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/assist/CorrectionAdaptor.java b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/assist/CorrectionAdaptor.java
new file mode 100644
index 000000000..80e420bb5
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/assist/CorrectionAdaptor.java
@@ -0,0 +1,206 @@
+/*******************************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2007 Technical University Berlin, Germany and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: CorrectionAdaptor.java 23438 2010-02-04 20:05:24Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ * IBM Corporation - copies of individual methods from bound base classes.
+ *******************************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.assist;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.core.dom.ASTNode;
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jdt.core.dom.Expression;
+import org.eclipse.jdt.core.dom.IMethodBinding;
+import org.eclipse.jdt.core.dom.ITypeBinding;
+import org.eclipse.jdt.core.dom.TSuperConstructorInvocation;
+import org.eclipse.jdt.internal.corext.dom.Bindings;
+import org.eclipse.jdt.internal.corext.util.Messages;
+import org.eclipse.jdt.internal.ui.JavaPluginImages;
+import org.eclipse.jdt.internal.ui.text.correction.ASTResolving;
+import org.eclipse.jdt.internal.ui.text.correction.CorrectionMessages;
+import org.eclipse.jdt.internal.ui.text.correction.proposals.NewMethodCorrectionProposal;
+import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels;
+import org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider;
+import org.eclipse.jdt.ui.JavaElementImageDescriptor;
+import org.eclipse.jdt.ui.text.java.IInvocationContext;
+import org.eclipse.jdt.ui.text.java.IProblemLocation;
+import org.eclipse.swt.graphics.Image;
+
+import base org.eclipse.jdt.internal.ui.text.correction.UnresolvedElementsSubProcessor;
+
+/**
+ * Individual method bodies are copied from their base version.
+ *
+ * @author stephan
+ * @since 1.1.2
+ */
+@SuppressWarnings("restriction")
+public team class CorrectionAdaptor {
+ protected class UnresolvedElementsSubProcessor playedBy UnresolvedElementsSubProcessor
+ {
+ /** This callin adjusts the compilation unit, when a new method should be inserted
+ * into the outer type: which for a role file is NOT within the current CU.
+ */
+ @SuppressWarnings({ "decapsulation", "rawtypes" })
+ void addNewMethodProposals(ICompilationUnit cu, CompilationUnit astRoot, Expression sender, List arguments, boolean isSuperInvocation, ASTNode invocationNode, String methodName, Collection proposals)
+ <- replace void addNewMethodProposals(ICompilationUnit cu, CompilationUnit astRoot, Expression sender, List arguments, boolean isSuperInvocation, ASTNode invocationNode, String methodName, Collection proposals);
+
+ @SuppressWarnings({ "basecall", "rawtypes", "unchecked" })
+ callin static void addNewMethodProposals(ICompilationUnit cu, CompilationUnit astRoot, Expression sender, List arguments, boolean isSuperInvocation, ASTNode invocationNode, String methodName, Collection proposals)
+ throws JavaModelException
+ {
+ // OT_COPY_PASTE:
+ ITypeBinding nodeParentType= Bindings.getBindingOfParentType(invocationNode);
+ ITypeBinding binding= null;
+ if (sender != null) {
+ binding= sender.resolveTypeBinding();
+ } else {
+ binding= nodeParentType;
+ if (isSuperInvocation && binding != null) {
+ binding= binding.getSuperclass();
+ }
+ }
+ if (binding != null && binding.isFromSource()) {
+ ITypeBinding senderDeclBinding= binding.getTypeDeclaration();
+
+ ICompilationUnit targetCU= ASTResolving.findCompilationUnitForBinding(cu, astRoot, senderDeclBinding);
+ if (targetCU != null) {
+ String label;
+ Image image;
+ ITypeBinding[] parameterTypes= getParameterTypes(arguments);
+ if (parameterTypes != null) {
+ String sig= ASTResolving.getMethodSignature(methodName, parameterTypes, false);
+
+ if (ASTResolving.isUseableTypeInContext(parameterTypes, senderDeclBinding, false)) {
+ if (nodeParentType == senderDeclBinding) {
+ label= Messages.format(CorrectionMessages.UnresolvedElementsSubProcessor_createmethod_description, sig);
+ image= JavaPluginImages.get(JavaPluginImages.IMG_MISC_PRIVATE);
+ } else {
+ label= Messages.format(CorrectionMessages.UnresolvedElementsSubProcessor_createmethod_other_description, new Object[] { sig, BasicElementLabels.getJavaElementName(senderDeclBinding.getName()) } );
+ image= JavaPluginImages.get(JavaPluginImages.IMG_MISC_PUBLIC);
+ }
+ proposals.add(new NewMethodCorrectionProposal(label, targetCU, invocationNode, arguments, senderDeclBinding, 5, image));
+ }
+ if (senderDeclBinding.isNested() && cu.equals(targetCU) && sender == null && Bindings.findMethodInHierarchy(senderDeclBinding, methodName, (ITypeBinding[]) null) == null) { // no covering method
+ ASTNode anonymDecl= astRoot.findDeclaringNode(senderDeclBinding);
+ if (anonymDecl != null) {
+ senderDeclBinding= Bindings.getBindingOfParentType(anonymDecl.getParent());
+ if (!senderDeclBinding.isAnonymous() && ASTResolving.isUseableTypeInContext(parameterTypes, senderDeclBinding, false)) {
+ String[] args= new String[] { sig, ASTResolving.getTypeSignature(senderDeclBinding) };
+ label= Messages.format(CorrectionMessages.UnresolvedElementsSubProcessor_createmethod_other_description, args);
+ image= JavaPluginImages.get(JavaPluginImages.IMG_MISC_PROTECTED);
+//{ObjectTeams: the pay-load: when traveling out of a role file, search for the new targetCU:
+ if (binding.isRole() && astRoot.findDeclaringNode(senderDeclBinding) == null)
+ targetCU= ASTResolving.findCompilationUnitForBinding(cu, astRoot, senderDeclBinding);
+// SH}
+ proposals.add(new NewMethodCorrectionProposal(label, targetCU, invocationNode, arguments, senderDeclBinding, 5, image));
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ @SuppressWarnings("rawtypes")
+ void getConstructorProposals(IInvocationContext context, IProblemLocation problem, Collection proposals)
+ <- after void getConstructorProposals(IInvocationContext context, IProblemLocation problem, Collection proposals);
+
+ /* Copied from base method and adapted for tsuper ctor calls. */
+ @SuppressWarnings({"rawtypes","unchecked"})
+ static void getConstructorProposals(IInvocationContext context, IProblemLocation problem, Collection proposals)
+ throws CoreException
+ {
+ ICompilationUnit cu= context.getCompilationUnit();
+
+ CompilationUnit astRoot= context.getASTRoot();
+ ASTNode selectedNode= problem.getCoveringNode(astRoot);
+ if (selectedNode == null) {
+ return;
+ }
+
+ ITypeBinding targetBinding= null;
+ List arguments= null;
+/*{ObjectTeams: not used: orig:
+ IMethodBinding recursiveConstructor= null;
+ SH} */
+
+ int type= selectedNode.getNodeType();
+ if (type == ASTNode.TSUPER_CONSTRUCTOR_INVOCATION) {
+ ITypeBinding typeBinding= Bindings.getBindingOfParentType(selectedNode);
+ if (typeBinding != null && !typeBinding.isAnonymous()) {
+//{ObjectTeams: different super class computation:
+/* orig:
+ targetBinding= typeBinding.getSuperclass();
+ :giro */
+ targetBinding= getTSuperClass(typeBinding);
+// SH}
+ arguments= ((TSuperConstructorInvocation) selectedNode).getArguments();
+ }
+// other cases already handled in the base method
+ }
+ if (targetBinding == null) {
+ return;
+ }
+ IMethodBinding[] methods= targetBinding.getDeclaredMethods();
+ ArrayList similarElements= new ArrayList();
+ for (int i= 0; i < methods.length; i++) {
+ IMethodBinding curr= methods[i];
+//{ObjectTeams: not using recursiveConstructor:
+/* orig:
+ if (curr.isConstructor() && recursiveConstructor != curr) {
+ :giro */
+ if (curr.isConstructor()) {
+// SH}
+ similarElements.add(curr); // similar elements can contain a implicit default constructor
+ }
+ }
+
+ addParameterMissmatchProposals(context, problem, similarElements, selectedNode, arguments, proposals);
+
+ if (targetBinding.isFromSource()) {
+ ITypeBinding targetDecl= targetBinding.getTypeDeclaration();
+
+ ICompilationUnit targetCU= ASTResolving.findCompilationUnitForBinding(cu, astRoot, targetDecl);
+ if (targetCU != null) {
+ String[] args= new String[] { ASTResolving.getMethodSignature( ASTResolving.getTypeSignature(targetDecl), getParameterTypes(arguments), false) };
+ String label= Messages.format(CorrectionMessages.UnresolvedElementsSubProcessor_createconstructor_description, args);
+ Image image= JavaElementImageProvider.getDecoratedImage(JavaPluginImages.DESC_MISC_PUBLIC, JavaElementImageDescriptor.CONSTRUCTOR, JavaElementImageProvider.SMALL_SIZE);
+ proposals.add(new NewMethodCorrectionProposal(label, targetCU, selectedNode, arguments, targetDecl, 5, image));
+ }
+ }
+ }
+
+ static ITypeBinding getTSuperClass(ITypeBinding type) { // FIXME(SH): currently only first-level tsuper is used
+ ITypeBinding[] superRoles = type.getSuperRoles();
+ if (superRoles != null && superRoles.length > 0)
+ return superRoles[0];
+ return null;
+ }
+
+
+ @SuppressWarnings({ "rawtypes", "decapsulation" })
+ ITypeBinding[] getParameterTypes(List args) -> ITypeBinding[] getParameterTypes(List args);
+
+ @SuppressWarnings({ "rawtypes", "decapsulation" })
+ void addParameterMissmatchProposals(IInvocationContext arg0, IProblemLocation arg1, List arg2, ASTNode arg3, List arg4, Collection arg5)
+ -> void addParameterMissmatchProposals(IInvocationContext arg0, IProblemLocation arg1, List arg2, ASTNode arg3, List arg4, Collection arg5);
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/assist/LinkedModeAdaptor.java b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/assist/LinkedModeAdaptor.java
new file mode 100644
index 000000000..6aa7c3dfa
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/assist/LinkedModeAdaptor.java
@@ -0,0 +1,74 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2007 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: LinkedModeAdaptor.java 23438 2010-02-04 20:05:24Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.assist;
+
+import org.eclipse.jface.text.link.ILinkedModeListener;
+import base org.eclipse.jface.text.link.LinkedModeUI;
+
+/**
+ * This team observes the LinkeModeUI, which is responsible for editing
+ * linked correction proposals.
+ * The purpose of this observation is to leave linked mode before applying
+ * the swap-precedences rewrite, which would break existing linkage.
+ *
+ * @author stephan
+ */
+public team class LinkedModeAdaptor {
+
+ public static LinkedModeAdaptor instance;
+
+ private LinkedModeUI ui;
+
+ public LinkedModeAdaptor() {
+ instance = this;
+ }
+
+ /** This role provides access to the active instance of LinkedModeUI. */
+ protected class LinkedModeUI playedBy LinkedModeUI
+ {
+ /** After an enter call has been issued and before leave is called,
+ * make this instance available.
+ */
+ void register () {
+ LinkedModeAdaptor.this.ui = this;
+ }
+ register <- after enter;
+
+ /** Remove instance, no longer in linked mode. */
+ void reset() {
+ LinkedModeAdaptor.this.ui = null;
+ }
+ reset <- after leave;
+
+ @SuppressWarnings("decapsulation")
+ protected
+ void leave(int flags) -> void leave(int flags);
+ }
+
+ /**
+ * Request to leave the linked mode.
+ * Checks availability of a LinkedModeUI instance.
+ *
+ * @return true if successful
+ */
+ public boolean leaveLinkedMode() {
+ if (this.ui == null)
+ return false;
+ this.ui.leave(ILinkedModeListener.EXIT_ALL);
+ return true;
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/assist/OTQuickFixes.java b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/assist/OTQuickFixes.java
new file mode 100644
index 000000000..276058d78
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/assist/OTQuickFixes.java
@@ -0,0 +1,500 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2006, 2007 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: OTQuickFixes.java 23438 2010-02-04 20:05:24Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.assist;
+
+import java.util.Collection;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.core.dom.AST;
+import org.eclipse.jdt.core.dom.ASTNode;
+import org.eclipse.jdt.core.dom.CallinMappingDeclaration;
+import org.eclipse.jdt.core.dom.CalloutMappingDeclaration;
+import org.eclipse.jdt.core.dom.ChildListPropertyDescriptor;
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jdt.core.dom.Expression;
+import org.eclipse.jdt.core.dom.IBinding;
+import org.eclipse.jdt.core.dom.IMethodBinding;
+import org.eclipse.jdt.core.dom.ITypeBinding;
+import org.eclipse.jdt.core.dom.IVariableBinding;
+import org.eclipse.jdt.core.dom.MethodInvocation;
+import org.eclipse.jdt.core.dom.MethodMappingElement;
+import org.eclipse.jdt.core.dom.MethodDeclaration;
+import org.eclipse.jdt.core.dom.MethodSpec;
+import org.eclipse.jdt.core.dom.Modifier;
+import org.eclipse.jdt.core.dom.Name;
+import org.eclipse.jdt.core.dom.RoleTypeDeclaration;
+import org.eclipse.jdt.core.dom.SimpleName;
+import org.eclipse.jdt.core.dom.SingleVariableDeclaration;
+import org.eclipse.jdt.core.dom.StructuralPropertyDescriptor;
+import org.eclipse.jdt.core.dom.Type;
+import org.eclipse.jdt.core.dom.rewrite.ASTRewrite;
+import org.eclipse.jdt.core.dom.rewrite.ImportRewrite;
+import org.eclipse.jdt.internal.corext.dom.Bindings;
+import org.eclipse.jdt.internal.corext.fix.CleanUpConstants;
+import org.eclipse.jdt.internal.corext.fix.FixMessages;
+import org.eclipse.jdt.internal.corext.fix.IProposableFix;
+import org.eclipse.jdt.internal.corext.util.Messages;
+import org.eclipse.jdt.internal.ui.JavaPluginImages;
+import org.eclipse.jdt.internal.ui.fix.Java50CleanUp;
+import org.eclipse.jdt.internal.ui.text.correction.proposals.ASTRewriteCorrectionProposal;
+import org.eclipse.jdt.internal.ui.text.correction.proposals.AddImportCorrectionProposal;
+import org.eclipse.jdt.internal.ui.text.correction.proposals.CUCorrectionProposal;
+import org.eclipse.jdt.internal.ui.text.correction.proposals.FixCorrectionProposal;
+import org.eclipse.jdt.internal.ui.text.correction.CorrectionMessages;
+import org.eclipse.jdt.ui.cleanup.CleanUpOptions;
+import org.eclipse.jdt.ui.text.java.IInvocationContext;
+import org.eclipse.jdt.ui.text.java.IProblemLocation;
+import org.eclipse.jface.viewers.IDecoration;
+import org.eclipse.swt.graphics.Image;
+
+import static org.eclipse.objectteams.otdt.ui.ImageConstants.CALLINMETHOD_IMG;
+
+import org.eclipse.objectteams.otdt.core.IOTType;
+import org.eclipse.objectteams.otdt.core.IRoleType;
+import org.eclipse.objectteams.otdt.core.OTModelManager;
+import org.eclipse.objectteams.otdt.core.compiler.ConfigHelper;
+import org.eclipse.objectteams.otdt.internal.ui.text.correction.MappingProposalSubProcessor;
+import org.eclipse.objectteams.otdt.internal.ui.text.correction.TypeProposalSubProcessor;
+import org.eclipse.objectteams.otdt.internal.ui.util.Images;
+
+import base org.eclipse.jdt.internal.corext.fix.Java50Fix;
+import base org.eclipse.jdt.internal.corext.util.JdtFlags;
+import base org.eclipse.jdt.internal.ui.text.correction.proposals.AbstractMethodCorrectionProposal;
+import base org.eclipse.jdt.internal.ui.text.correction.JavaCorrectionProcessor;
+import base org.eclipse.jdt.internal.ui.text.correction.proposals.NewMethodCorrectionProposal;
+import base org.eclipse.jdt.internal.ui.text.correction.ModifierCorrectionSubProcessor;
+import base org.eclipse.jdt.internal.ui.text.correction.QuickFixProcessor;
+import base org.eclipse.jdt.internal.ui.text.correction.SuppressWarningsSubProcessor;
+import base org.eclipse.jdt.internal.ui.text.correction.UnresolvedElementsSubProcessor;
+import base org.eclipse.jdt.internal.ui.text.correction.SuppressWarningsSubProcessor.SuppressWarningsProposal;
+
+/**
+ * This team class extends the quickfix functionality of the jdt.ui for OT/J elements.
+ * Currently supported:
+ * <ul>
+ * <li>inserting @SuppressWarnings for callin & callout bindings
+ * ({@link OTQuickFixes.SuppressWarningsAdaptor},{@link OTQuickFixes.SuppressWarningsProposal}).</li>
+ * <li>Proposing imports for role types is intercepted to propose an anchored type instead
+ * {@link OTQuickFixes.UnresolvedElementsSubProcessor}).</li>
+ * <li>Adapt JavaCorrectionProcessor to cope with entries into the compiler without
+ * a Config configured ({@link OTQuickFixes.JavaCorrectionProcessor}).</li>
+ * <li>Create new methods from an unresolved method spec ({@link OTQuickFixes.NewMethodCompletionProposal}).</li>
+ * <li>Modifier corrections for role methods and ctors ({@link OTQuickFixes.ModifierCorrectionSubProcessor}).</li>
+ * </ul>
+ *
+ * @author stephan
+ */
+@SuppressWarnings("restriction")
+public team class OTQuickFixes {
+
+ private static OTQuickFixes instance;
+
+ public OTQuickFixes() {
+ instance= this;
+ }
+ public static OTQuickFixes instance() {
+ return instance;
+ }
+
+ /**
+ * Filter null proposals (we might have suppressed some proposals by nullification)
+ */
+ protected class QuickFixProcessor playedBy QuickFixProcessor
+ {
+ @SuppressWarnings("unchecked")
+ void filterNulls(Collection proposals)
+ <- after void process(IInvocationContext context, IProblemLocation problem, Collection proposals)
+ with { proposals <- proposals }
+
+ @SuppressWarnings("unchecked")
+ void filterNulls(Collection proposals) {
+ if ((proposals instanceof List)) {
+ List list = (List)proposals;
+ for (int i=list.size()-1; i>=0; i--)
+ if (list.get(i) == null)
+ list.remove(i);
+ }
+ }
+ }
+
+ /**
+ * This role adapts the processor responsible for generating SuppressWarnings-proposals.
+ */
+ protected class SuppressWarningsAdaptor playedBy SuppressWarningsSubProcessor
+ {
+ @SuppressWarnings("basecall")
+ static callin void addSuppressWarningsProposal(ICompilationUnit cu,
+ ASTNode node,
+ String warningToken,
+ int relevance,
+ Collection<ASTRewriteCorrectionProposal> proposals)
+ {
+ // adding one case block to the front of the original method:
+ ChildListPropertyDescriptor property= null;
+ String name;
+ Object baseElement;
+ switch (node.getNodeType()) {
+ case ASTNode.CALLIN_MAPPING_DECLARATION:
+ property= CallinMappingDeclaration.MODIFIERS2_PROPERTY;
+ baseElement = ((CallinMappingDeclaration) node).getBaseMappingElements().get(0);
+ name = ((CallinMappingDeclaration) node).getRoleMappingElement().getName().getIdentifier();
+ name += "<-"; //$NON-NLS-1$
+ name += ((MethodSpec)baseElement).getName().getIdentifier();
+ break;
+ case ASTNode.CALLOUT_MAPPING_DECLARATION:
+ property= CalloutMappingDeclaration.MODIFIERS2_PROPERTY;
+ baseElement = ((CalloutMappingDeclaration) node).getBaseMappingElement();
+ name = ((CalloutMappingDeclaration) node).getRoleMappingElement().getName().getIdentifier();
+ name += "->"; //$NON-NLS-1$
+ name += ((MethodMappingElement)baseElement).getName().getIdentifier();
+ break;
+ case ASTNode.ROLE_TYPE_DECLARATION:
+ property= RoleTypeDeclaration.MODIFIERS2_PROPERTY;
+ name= ((RoleTypeDeclaration) node).getName().getIdentifier();
+ break;
+ default:
+ // other cases are already handled by the original method.
+ base.addSuppressWarningsProposal(cu, node, warningToken, relevance, proposals);
+ return;
+ }
+ String label= Messages.format(
+ CorrectionMessages.SuppressWarningsSubProcessor_suppress_warnings_label,
+ new String[] { warningToken, name });
+
+ // instantiate a role wrapping an invisible class
+ // and immediately lower the object using a public base type:
+ ASTRewriteCorrectionProposal proposal= OTQuickFixes.this.
+ new SuppressWarningsProposal(warningToken, label, cu, node, property, relevance);
+
+ proposals.add(proposal);
+ }
+
+ @SuppressWarnings({ "unchecked", "decapsulation" }) // base-side arg "proposals" is not generic
+ addSuppressWarningsProposal <- replace addSuppressWarningsProposal;
+ }
+
+ /**
+ * The sole purpose of this role class is providing access to an invisible base class.
+ */
+ @SuppressWarnings("decapsulation") // base class and its constructor
+ protected class SuppressWarningsProposal playedBy SuppressWarningsProposal
+ {
+ public SuppressWarningsProposal(String warningToken, String label, ICompilationUnit cu, ASTNode node, ChildListPropertyDescriptor property, int relevance)
+ {
+ base(warningToken, label, cu, node, property, relevance);
+ }
+ }
+
+ /**
+ * Prevent proposing an import for a role type (which would be illegal!),
+ * but instead delegate to TypeProposalSubProcessor.changeTypeToAnchored().
+ *
+ * Prevent proposing a cast for the faked $fakethis$ name.
+ */
+ protected class UnresolvedElementsSubProcessor playedBy UnresolvedElementsSubProcessor
+ {
+ static callin CUCorrectionProposal createTypeRefChangeProposal(ICompilationUnit cu, String fullName, Name node, int relevance, int maxProposals)
+ {
+ CUCorrectionProposal proposal = base.createTypeRefChangeProposal(cu, fullName, node, relevance, maxProposals);
+ if (proposal instanceof AddImportCorrectionProposal)
+ {
+ // if importRewrite suppressed a base import in a role file, don't propose empty changes, but redirect to the team:
+ ImportRewrite importRewrite = ((AddImportCorrectionProposal) proposal).getImportRewrite();
+ if (importRewrite != null && !importRewrite.myHasRecordedChanges())
+ proposal = TypeProposalSubProcessor.createImportInRoFisTeamProposal(cu, fullName, node, relevance, maxProposals);
+
+ // we cannot import roles, check if it is a role:
+ try {
+ IType type = cu.getJavaProject().findType(fullName);
+ if (type != null) {
+ IOTType otType = OTModelManager.getOTElement(type);
+ if (otType != null && otType.isRole()) {
+ // but an anchored role type needs no import: propose to add an anchor:
+ return TypeProposalSubProcessor.changeTypeToAnchored(cu, fullName, node, ((IRoleType)otType).getTeam().getFullyQualifiedName());
+ }
+ }
+ } catch (JavaModelException jme) {
+ // ignore
+ }
+ }
+ return proposal;
+ }
+ @SuppressWarnings("decapsulation")
+ createTypeRefChangeProposal <- replace createTypeRefChangeProposal;
+
+ @SuppressWarnings({ "rawtypes", "decapsulation" }) // Collection
+ void addMissingCastParentsProposal(ICompilationUnit cu, MethodInvocation invocationNode)
+ <- replace void addMissingCastParentsProposal(ICompilationUnit cu, MethodInvocation invocationNode, Collection proposals);
+
+ @SuppressWarnings("basecall")
+ static callin void addMissingCastParentsProposal(ICompilationUnit cu, MethodInvocation invocationNode) {
+ Expression sender = invocationNode.getExpression();
+ if (sender != null && sender.getNodeType() == ASTNode.SIMPLE_NAME)
+ if (((SimpleName)sender).getIdentifier().equals(MappingProposalSubProcessor.FAKETHIS))
+ return;
+ base.addMissingCastParentsProposal(cu, invocationNode);
+ }
+
+ }
+
+
+ /**
+ * When collecting proposals prepare Config to have at least a stub config.
+ */
+ protected class JavaCorrectionProcessor playedBy JavaCorrectionProcessor {
+ callin static IStatus guardDependencies() {
+ boolean hasConfig = ConfigHelper.checkCreateStubConfig(OTQuickFixes.this);
+ try {
+ return base.guardDependencies();
+ } finally {
+ if (hasConfig)
+ ConfigHelper.removeConfig(OTQuickFixes.this);
+ }
+ }
+ guardDependencies <- replace collectProposals;
+ }
+
+ /** Declare a callin binding to a private method. Real stuff happens in sub-role. */
+ @SuppressWarnings("abstractrelevantrole")
+ protected abstract class AbstractMethodCompletionProposal playedBy AbstractMethodCorrectionProposal
+ {
+ void updateRewrite(ASTRewrite rewrite) <- before MethodDeclaration getStub(ASTRewrite rewrite, ASTNode t)
+ base when (OTQuickFixes.this.hasRole(base, AbstractMethodCompletionProposal.class));
+ abstract void updateRewrite(ASTRewrite rewrite);
+ }
+
+ /**
+ * This role helps the MappingProposalSubProcessor for unresolved method specs.
+ * Its behavior is initiated by calling {@link OTQuickFixes#registerNewMethodCorrectionProposal}.
+ */
+ protected class NewMethodCompletionProposal
+ extends AbstractMethodCompletionProposal
+ playedBy NewMethodCorrectionProposal
+ base when (OTQuickFixes.this.hasRole(base, NewMethodCompletionProposal.class)) // on invitation only
+ {
+ /** Actual types etc. from the method spec. */
+ protected Type[] parameterTypes;
+ protected Type returnType;
+ protected boolean needCallinModifier;
+ protected boolean needStaticModifier;
+
+ @SuppressWarnings("basecall")
+ callin Type substituteParameterType(AST ast, Expression elem, String key)
+ {
+ final String prefix = "arg_type_"; //$NON-NLS-1$
+ if (this.parameterTypes != null && key.startsWith(prefix)) {
+ int idx= Integer.parseInt(key.substring(prefix.length()));
+ if (idx < this.parameterTypes.length)
+ return (Type) ASTNode.copySubtree(ast, this.parameterTypes[idx]);
+ }
+ return base.substituteParameterType(ast, elem, key);
+ }
+ @SuppressWarnings("decapsulation")
+ substituteParameterType <- replace evaluateParameterType;
+
+ @SuppressWarnings("basecall")
+ callin Type getMethodReturnType (ASTRewrite rewrite) throws CoreException {
+ if (this.returnType != null)
+ return (Type) ASTNode.copySubtree(rewrite.getAST(), this.returnType);
+ return base.getMethodReturnType(rewrite);
+ }
+ getMethodReturnType <- replace getNewMethodType;
+
+ callin int evaluateModifiers(ASTNode targetTypeDecl) {
+ int result= base.evaluateModifiers(targetTypeDecl);
+ if (this.needCallinModifier) {
+ result &= ~(Modifier.PRIVATE|Modifier.PROTECTED|Modifier.PUBLIC);
+ result |= Modifier.OT_CALLIN;
+ }
+ if (this.needStaticModifier)
+ result |= Modifier.STATIC;
+ return result;
+ }
+ @SuppressWarnings("decapsulation")
+ int evaluateModifiers(ASTNode targetTypeDecl)
+ <- replace int evaluateModifiers(ASTNode targetTypeDecl);
+
+ @Override
+ void updateRewrite(ASTRewrite rewrite) {
+ if (this.needCallinModifier)
+ rewrite.setToOTJ();
+ }
+
+ protected void adjustModifiers(CallinMappingDeclaration callinMapping) {
+ if (callinMapping.getCallinModifier()==Modifier.OT_REPLACE_CALLIN) {
+ this.needCallinModifier= true;
+ Image baseImage = JavaPluginImages.get(JavaPluginImages.IMG_MISC_DEFAULT);
+ setImage(Images.decorateImage(baseImage, CALLINMETHOD_IMG, IDecoration.TOP_RIGHT));
+ }
+ if (callinMapping.isStatic())
+ this.needStaticModifier= true;
+ }
+
+ void setImage(Image img) -> void setImage(Image img);
+ }
+
+ /** Register a new method completion proposal with a method spec,
+ * in order to use the method specs signature for constructing the new method's signature.
+ * @param spec the unresolved method spec
+ * @param proposal a new completion proposal to be adapted
+ */
+ @SuppressWarnings("unchecked")
+ public void registerNewMethodCorrectionProposal(MethodSpec spec,
+ NewMethodCorrectionProposal as NewMethodCompletionProposal proposal)
+ {
+ List parameters= spec.parameters();
+ proposal.parameterTypes= new Type[parameters.size()];
+ for (int i=0; i<parameters.size(); i++) {
+ SingleVariableDeclaration arg= (SingleVariableDeclaration)parameters.get(i);
+ proposal.parameterTypes[i]= arg.getType();
+ }
+ proposal.returnType= spec.getReturnType2();
+ ASTNode mapping= spec.getParent();
+ if (mapping instanceof CallinMappingDeclaration)
+ proposal.adjustModifiers((CallinMappingDeclaration)mapping);
+ }
+
+ /**
+ * This flag lets clients control whether modifiers should unconditionally be set to <code>public</code>.
+ * Note that this static variable is not thread-safe.
+ */
+ public static boolean publicRequested= false;
+ /**
+ * Adapt proposals for non-accessible references using a {@link QuickFixCoreAdaptor}.
+ * Here: adjust the needed visibility for role members.
+ */
+ protected class ModifierCorrectionSubProcessor playedBy ModifierCorrectionSubProcessor {
+
+ cflow <- replace addNonAccessibleReferenceProposal;
+
+ static callin void cflow() throws CoreException {
+ within (new QuickFixCoreAdaptor())
+ base.cflow();
+ }
+
+ @SuppressWarnings("decapsulation")
+ int getNeededVisibility(ASTNode currNode, ITypeBinding targetType)
+ <- replace int getNeededVisibility(ASTNode currNode, ITypeBinding targetType);
+
+ @SuppressWarnings("basecall")
+ callin static int getNeededVisibility(ASTNode currNode, ITypeBinding targetType) {
+ if (publicRequested) return Modifier.PUBLIC;
+ int vis = base.getNeededVisibility(currNode, targetType);
+ if (vis == 0 && targetType.isRole()) {
+ // is targetType in scope from currNode? TODO(SH): this search is not exact.
+ ITypeBinding currentEnclosing= Bindings.getBindingOfParentType(currNode);
+ while (currentEnclosing != null) {
+ ITypeBinding targetEnclosing = targetType.getDeclaringClass();
+ while (targetEnclosing != null) {
+ if (targetEnclosing.equals(currentEnclosing))
+ return Modifier.PROTECTED;
+ targetEnclosing = targetEnclosing.getDeclaringClass();
+ }
+ currentEnclosing = currentEnclosing.getDeclaringClass();
+ }
+ // accessing from the outside, requires public:
+ return Modifier.PUBLIC;
+ }
+ return vis;
+ }
+ }
+
+ /** Interpret some flags with knowledge of OT/J: */
+ protected class FlagAdaptation playedBy JdtFlags {
+
+ @SuppressWarnings("decapsulation")
+ boolean isInterfaceOrAnnotationMember(IBinding binding)
+ <- replace boolean isInterfaceOrAnnotationMember(IBinding binding);
+
+ static callin boolean isInterfaceOrAnnotationMember(IBinding binding) {
+ boolean result = base.isInterfaceOrAnnotationMember(binding);
+ if (result) { // double check for member of synth ifc:
+ ITypeBinding declaringType= null;
+ if (binding instanceof IVariableBinding) {
+ declaringType= ((IVariableBinding) binding).getDeclaringClass();
+ } else if (binding instanceof IMethodBinding) {
+ declaringType= ((IMethodBinding) binding).getDeclaringClass();
+ } else if (binding instanceof ITypeBinding) {
+ declaringType= ((ITypeBinding) binding).getDeclaringClass();
+ }
+ if (declaringType != null && declaringType.isSynthRoleIfc())
+ return false; // result was false alarm ;-)
+ }
+ return result;
+ }
+
+ }
+
+ /**
+ * Quickfixes for things that are new in Java 5, here: annotations.
+ * <ul>
+ * <li>Support @Override annotation for role classes, too.</li>
+ * </ul>
+ * @since 1.2.8
+ */
+ protected class Java50Fix playedBy Java50Fix {
+
+ @SuppressWarnings("decapsulation")
+ protected Java50Fix createFix(CompilationUnit compilationUnit, IProblemLocation problem, String annotation, String label)
+ -> Java50Fix createFix(CompilationUnit compilationUnit, IProblemLocation problem, String annotation, String label);
+
+ @SuppressWarnings("decapsulation")
+ ASTNode getDeclaringNode(ASTNode selectedNode) <- replace ASTNode getDeclaringNode(ASTNode selectedNode);
+
+ /** Also expect RoleTypeDeclaration. */
+ static callin ASTNode getDeclaringNode(ASTNode selectedNode) {
+ ASTNode result = base.getDeclaringNode(selectedNode);
+ if (result != null)
+ return result;
+ // similar to fragment in base method:
+ if (selectedNode instanceof SimpleName) {
+ StructuralPropertyDescriptor locationInParent= selectedNode.getLocationInParent();
+ if (locationInParent == RoleTypeDeclaration.NAME_PROPERTY)
+ return selectedNode.getParent();
+ }
+ return null;
+ }
+ }
+
+ /**
+ * Offer proposal from ModifierCorrectionSubProcessor in a version adapted for role classes instead of methods.
+ * @param context completion context to pass through
+ * @param problem the problem that triggered this assist
+ * @param proposals list of proposals to which the new proposal should be added.
+ */
+ @SuppressWarnings("unchecked")
+ public void addOverrideAnnotationProposal(IInvocationContext context, IProblemLocation problem, Collection proposals) {
+ // avoid calling Java50Fix.createAddOverrideAnnotationFix, which expects a specific problemID
+ IProposableFix fix= Java50Fix.createFix(context.getASTRoot(), problem, "Override", FixMessages.Java50Fix_AddOverride_description); //$NON-NLS-1$
+ // original from ModifierCorrectionSubProcessor:
+ if (fix != null) {
+ Image image= JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE);
+ Map options= new Hashtable();
+ options.put(CleanUpConstants.ADD_MISSING_ANNOTATIONS, CleanUpOptions.TRUE);
+ options.put(CleanUpConstants.ADD_MISSING_ANNOTATIONS_OVERRIDE, CleanUpOptions.TRUE);
+ FixCorrectionProposal proposal= new FixCorrectionProposal(fix, new Java50CleanUp(options), 5, image, context);
+ proposals.add(proposal);
+ }
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/assist/QuickFixCoreAdaptor.java b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/assist/QuickFixCoreAdaptor.java
new file mode 100644
index 000000000..d1c0451a2
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/assist/QuickFixCoreAdaptor.java
@@ -0,0 +1,123 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2008 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: QuickFixCoreAdaptor.java 23438 2010-02-04 20:05:24Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.assist;
+
+import org.eclipse.jdt.core.compiler.CharOperation;
+import org.eclipse.jdt.core.dom.IMethodBinding;
+import org.eclipse.jdt.core.dom.ITypeBinding;
+import org.eclipse.jdt.internal.corext.dom.Bindings;
+import org.eclipse.objectteams.otdt.core.compiler.IOTConstants;
+
+import base org.eclipse.jdt.core.dom.MethodBinding;
+
+/**
+ * This team adapts dom elements for use by quickfixes.
+ * It is activated only temporarily from {@link OTQuickFixes}.
+ *
+ * @author stephan
+ * @since 1.2.1
+ */
+@SuppressWarnings("restriction")
+public team class QuickFixCoreAdaptor {
+
+
+
+ /**
+ * Adapt role creator methods to behave like regular constructors.
+ */
+ @SuppressWarnings("decapsulation")
+ protected class MethodBinding playedBy MethodBinding
+ {
+ ITypeBinding rawgetDeclaringClass() -> ITypeBinding getDeclaringClass();
+ String rawgetName() -> String getName();
+ ITypeBinding getReturnType() -> ITypeBinding getReturnType();
+ ITypeBinding[] getParameterTypes() -> ITypeBinding[] getParameterTypes();
+
+ boolean isCreator() -> get org.eclipse.jdt.internal.compiler.lookup.MethodBinding binding // avoiding triggering callin on getName()
+ with { result <- CharOperation.prefixEquals(IOTConstants.CREATOR_PREFIX_NAME,binding.selector) }
+
+
+ IMethodBinding getMethodDeclaration() <- replace IMethodBinding getMethodDeclaration();
+
+ /*
+ * Lookup the method binding from the actual role constructor.
+ */
+ @SuppressWarnings({ "basecall", "restriction" })
+ callin IMethodBinding getMethodDeclaration()
+ {
+ ITypeBinding declaringClass = null;
+ String methodName = null;
+ if (isCreator()) {
+ declaringClass = getRealClass(rawgetDeclaringClass(), getReturnType());
+ methodName = getReturnType().getName(); // ctor named as the class
+ } else {
+ ITypeBinding current = rawgetDeclaringClass();
+ if (current.isRole() && current.isInterface()) {
+ declaringClass = getRealClass(current.getDeclaringClass(), current);
+ methodName = rawgetName();
+ }
+ }
+ if (declaringClass != null) {
+ IMethodBinding method = Bindings.findMethodInType(declaringClass, methodName, getParameterTypes());
+ if (method != null)
+ return method;
+ }
+ deactivate(); // nothing ot-specific - stop intercepting;
+ return base.getMethodDeclaration();
+ }
+
+ String getName() <- replace String getName()
+ base when (!isExecutingCallin()); // avoid re-entrance
+
+ /*
+ * Trim the creator's name to look like a ctor.
+ */
+ callin String getName() {
+ String baseName = base.getName();
+ String CREATOR_PREFIX = new String(IOTConstants.CREATOR_PREFIX_NAME);
+ if (baseName.startsWith(CREATOR_PREFIX))
+ return baseName.substring(CREATOR_PREFIX.length());
+ return baseName;
+ }
+
+
+ ITypeBinding getDeclaringClass() <- replace ITypeBinding getDeclaringClass()
+ base when (!isExecutingCallin());
+
+ /*
+ * Replace the team (declaring class of the creator method) with the role class.
+ */
+ @SuppressWarnings("basecall")
+ callin ITypeBinding getDeclaringClass() {
+ if (isCreator())
+ return getRealClass(rawgetDeclaringClass(), getReturnType());
+ return base.getDeclaringClass();
+ }
+
+ /*
+ * While normally role ifcs are preferred, for ast rewriting we need the real role class.
+ */
+ ITypeBinding getRealClass(ITypeBinding enclosingTeam, ITypeBinding roleIfc) {
+ String name = roleIfc.getName();
+ for (ITypeBinding member: enclosingTeam.getDeclaredTypes())
+ if (member.getName().equals(name) && member.isClass())
+ return member;
+ return null;
+ }
+ }
+
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/javaeditor/AnnotationAdaptor.java b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/javaeditor/AnnotationAdaptor.java
new file mode 100644
index 000000000..5977e036b
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/javaeditor/AnnotationAdaptor.java
@@ -0,0 +1,87 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2009 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: AnnotationAdaptor.java 23438 2010-02-04 20:05:24Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.javaeditor;
+
+import org.eclipse.jface.text.source.Annotation;
+import org.eclipse.jface.text.source.VerticalRulerEvent;
+import org.eclipse.objectteams.otdt.internal.ui.javaeditor.RoleOverrideIndicatorManager;
+import org.eclipse.swt.widgets.Event;
+
+import base org.eclipse.jdt.internal.ui.javaeditor.JavaSelectAnnotationRulerAction;
+import base org.eclipse.jdt.internal.ui.javaeditor.JavaSelectMarkerRulerAction2;
+
+/**
+ * Adapt handling of annotations in the (OT)JavaEditor.
+ *
+ *
+ * @author stephan
+ * @since 1.2.8
+ */
+@SuppressWarnings("restriction")
+public team class AnnotationAdaptor {
+
+ /**
+ * This role hooks the RoleOverrideIndicator annotation into the ruler menu managed by
+ * this role's base class.
+ *
+ * @see RoleOverrideIndicatorManager
+ *
+ * @author stephan
+ * @since 1.2.8
+ */
+ protected class OpenTSuperRole playedBy JavaSelectAnnotationRulerAction {
+
+ void update() <- after void update();
+
+ @SuppressWarnings({ "inferredcallout", "decapsulation" })
+ void update() {
+ if (fAnnotation instanceof RoleOverrideIndicatorManager.OverrideIndicator) {
+ initialize(fBundle, "JavaSelectAnnotationRulerAction.OpenSuperImplementation."); //$NON-NLS-1$
+ setEnabled(true);
+ return;
+ }
+ }
+
+ void runWithEvent(Event event) <- after void runWithEvent(Event event);
+
+ @SuppressWarnings("inferredcallout")
+ void runWithEvent(Event event) {
+ if (fAnnotation instanceof RoleOverrideIndicatorManager.OverrideIndicator) {
+ ((RoleOverrideIndicatorManager.OverrideIndicator)fAnnotation).open();
+ return;
+ }
+ }
+ }
+ /**
+ * If role-over hovers are enabled, we need to hook into one more
+ * action in order to execute our annotation action.
+ */
+ protected class RulerAction playedBy JavaSelectMarkerRulerAction2 {
+
+ void annotationDefaultSelected(VerticalRulerEvent event)
+ <- replace void annotationDefaultSelected(VerticalRulerEvent event);
+
+ @SuppressWarnings("basecall")
+ callin void annotationDefaultSelected(VerticalRulerEvent event) {
+ Annotation annotation = event.getSelectedAnnotation();
+ if (annotation instanceof RoleOverrideIndicatorManager.OverrideIndicator)
+ ((RoleOverrideIndicatorManager.OverrideIndicator) annotation).open();
+ else
+ base.annotationDefaultSelected(event);
+ }
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/javaeditor/HighlightingAdaptor.java b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/javaeditor/HighlightingAdaptor.java
new file mode 100644
index 000000000..0c19a6844
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/javaeditor/HighlightingAdaptor.java
@@ -0,0 +1,74 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2006, 2007 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: HighlightingAdaptor.java 23438 2010-02-04 20:05:24Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.javaeditor;
+
+import org.eclipse.jdt.core.dom.ASTNode;
+import org.eclipse.jdt.core.dom.IBinding;
+import org.eclipse.jdt.core.dom.IVariableBinding;
+import org.eclipse.jdt.core.dom.MethodSpec;
+import org.eclipse.jdt.internal.ui.javaeditor.JavaEditor;
+import org.eclipse.jdt.internal.ui.javaeditor.JavaSourceViewer;
+import org.eclipse.jdt.internal.ui.javaeditor.SemanticToken;
+import org.eclipse.jdt.ui.text.IColorManager;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.objectteams.otdt.internal.ui.text.OutlineAdaptor;
+
+import base org.eclipse.jdt.internal.ui.javaeditor.SemanticHighlightingManager;
+import base org.eclipse.jdt.internal.ui.javaeditor.SemanticHighlightings.ParameterVariableHighlighting;
+
+/**
+ * This aspect fixes syntax highlighting for OT/J code
+ *
+ * @author stephan
+ * @since 0.9.18
+ */
+@SuppressWarnings("restriction")
+public team class HighlightingAdaptor {
+
+ protected class SemanticHighlightingManager playedBy SemanticHighlightingManager
+ {
+ void myInstall()
+ {
+ //{Hack as workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=142299
+ OutlineAdaptor.doActivate();
+ // SH}
+
+ }
+ void myInstall()
+ <- after void install(JavaEditor je, JavaSourceViewer sv, IColorManager cm, IPreferenceStore ps);
+ }
+
+ /**
+ * This role brings syntax highlighting to arguments of method specs.
+ */
+ @SuppressWarnings("decapsulation")
+ protected class ParameterHighLighting playedBy ParameterVariableHighlighting {
+
+ boolean consumes(SemanticToken token) <- replace boolean consumes(SemanticToken token);
+
+ callin boolean consumes(SemanticToken token) {
+ if (base.consumes(token))
+ return true;
+ IBinding binding= token.getBinding();
+ if (binding != null && binding.getKind() == IBinding.VARIABLE && !((IVariableBinding) binding).isField()) {
+ ASTNode decl= token.getRoot().findDeclaringNode(binding);
+ return decl != null && decl.getLocationInParent() == MethodSpec.PARAMETERS_PROPERTY;
+ }
+ return false;
+ }
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/javaeditor/JavaEditorAdaptor.java b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/javaeditor/JavaEditorAdaptor.java
new file mode 100644
index 000000000..529f73b0a
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/javaeditor/JavaEditorAdaptor.java
@@ -0,0 +1,148 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2009 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: JavaEditorAdaptor.java 23438 2010-02-04 20:05:24Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.javaeditor;
+
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.ITypeRoot;
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jdt.ui.JavaUI;
+import org.eclipse.jdt.ui.SharedASTProvider;
+import org.eclipse.jface.text.rules.IToken;
+import org.eclipse.jface.text.source.IAnnotationModel;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.texteditor.ITextEditor;
+import org.eclipse.objectteams.otdt.core.OTModelManager;
+import org.eclipse.objectteams.otdt.internal.ui.javaeditor.RoleOverrideIndicatorManager;
+
+import base org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor;
+import base org.eclipse.jdt.internal.ui.javaeditor.JavaEditor;
+import base org.eclipse.jdt.ui.text.JavaSourceViewerConfiguration;
+import base org.eclipse.jdt.internal.ui.text.CombinedWordRule.WordMatcher;
+
+
+/**
+ * This team adapts the JDT Java Editor for OT/J.
+ * It replaces the former OTJavaEditor, OTJavaTextTools and OTJavaSourceViewerConfiguration classes.
+ *
+ * @author mosconi
+ * @since 1.3.0
+ */
+@SuppressWarnings({"restriction", "inferredcallout", "decapsulation"})
+public team class JavaEditorAdaptor {
+
+ /**
+ * For source and class file editors: figure out whether the input is OT source of plain Java.
+ */
+ protected class JavaEditor playedBy JavaEditor
+ {
+ /**
+ * True if we can positively tell that the editor's input contains
+ * a valid non-OT java type (we default to the OT-behavior).
+ */
+ protected boolean isSourcePlainJava = false;
+
+ /** We need the editor input to figure out OT vs. Java source. */
+ protected void analyzeInput(IEditorInput input) {
+ ITypeRoot typeRoot = JavaUI.getEditorInputTypeRoot(input);
+ if (typeRoot != null) {
+ IType primaryType = typeRoot.findPrimaryType();
+ if (primaryType != null)
+ isSourcePlainJava = !OTModelManager.hasOTElementFor(primaryType);
+ }
+ }
+ void analyzeInput(IEditorInput input) <- before void doSetInput(IEditorInput input);
+ }
+ protected class CompilationUnitEditor extends JavaEditor playedBy CompilationUnitEditor {
+ // this instance manages the override indicator for role classes:
+ RoleOverrideIndicatorManager fRoleOverrideIndicatorManager;
+
+ uninstallOverrideIndicator <- after uninstallOverrideIndicator;
+ protected void uninstallOverrideIndicator() {
+ if (fRoleOverrideIndicatorManager != null) {
+ fRoleOverrideIndicatorManager.removeAnnotations();
+ fRoleOverrideIndicatorManager = null;
+ }
+ }
+
+ installOverrideIndicator <- after installOverrideIndicator
+ when (!isSourcePlainJava);
+ protected void installOverrideIndicator(boolean provideAST) {
+ // verbatim repeat:
+ IAnnotationModel model = getDocumentProvider().getAnnotationModel(getEditorInput());
+ final ITypeRoot inputElement = getInputJavaElement();
+ if (model == null || inputElement == null)
+ return;
+ //own:
+ fRoleOverrideIndicatorManager = new RoleOverrideIndicatorManager(model, inputElement, null);
+
+ if (provideAST) {
+ CompilationUnit ast = SharedASTProvider.getAST(inputElement, SharedASTProvider.WAIT_ACTIVE_ONLY, getProgressMonitor());
+ fRoleOverrideIndicatorManager.reconciled(ast, true, getProgressMonitor());
+ }
+ addReconcileListener(fRoleOverrideIndicatorManager);
+ }
+ }
+
+ final static String LAST_JAVA_KEYWORD = "while"; //$NON-NLS-1$
+ final static String WITHIN_KEYWORD = "within"; //$NON-NLS-1$
+ @SuppressWarnings("nls")
+ final static String[] OTJ_KEYWORDS = {
+ WITHIN_KEYWORD, "base", "tsuper", "callin", "playedBy", "with", "team", "as",
+ "result", "replace", "after", "before", "when", "get", "set", "precedence"
+ };
+
+ protected team class JavaSourceViewerConfiguration playedBy JavaSourceViewerConfiguration
+ {
+ callin void initializeScanners() {
+ within (this)
+ base.initializeScanners();
+ }
+ initializeScanners <- replace initializeScanners;
+
+ /** Fetch the editor role, but only if base side type is compatible. */
+ JavaEditor getEditor() -> ITextEditor getEditor()
+ with { result <- (JavaEditor)(result instanceof JavaEditor ? result : null) }
+
+ /** Is the editor configured for plain Java source? */
+ protected boolean isSourcePlainJava() {
+ JavaEditor editor = getEditor();
+ return editor != null && editor.isSourcePlainJava;
+ }
+
+ /** Add the OT/J keywords to the matcher. This role is only active during initializeScanners(). */
+ protected class WordMatcher playedBy WordMatcher {
+
+ void addWord(String word, IToken token) <- replace void addWord(String word, IToken token);
+
+ @SuppressWarnings("basecall") // multiple
+ callin void addWord(String word, IToken token) {
+ base.addWord(word, token);
+ if (LAST_JAVA_KEYWORD.equals(word)) {
+ if (JavaSourceViewerConfiguration.this.isSourcePlainJava())
+ base.addWord(WITHIN_KEYWORD, token); // in plain java mode "within" is our only keyword
+ else
+ for (int i=0; i<OTJ_KEYWORDS.length; i++)
+ base.addWord(OTJ_KEYWORDS[i], token);
+ }
+ }
+ }
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/javaeditor/JavaOutlinePageAdaptor.java b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/javaeditor/JavaOutlinePageAdaptor.java
new file mode 100644
index 000000000..a4667e0da
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/javaeditor/JavaOutlinePageAdaptor.java
@@ -0,0 +1,53 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2006, 2007 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: JavaOutlinePageAdaptor.java 23438 2010-02-04 20:05:24Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.javaeditor;
+
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.swt.widgets.Item;
+import org.eclipse.objectteams.otdt.core.IOTType;
+import org.eclipse.objectteams.otdt.ui.Util;
+
+import base org.eclipse.jdt.internal.ui.javaeditor.JavaOutlinePage.JavaOutlineViewer;
+import base org.eclipse.jdt.internal.ui.javaeditor.JavaOutlinePage.ChildrenProvider;
+
+/**
+ * The only purpose: filter generated elements from the outline page.
+ *
+ * @author stephan
+ */
+@SuppressWarnings({ "restriction", "decapsulation" })
+public team class JavaOutlinePageAdaptor
+{
+ protected class ContentProviderAdaptor playedBy ChildrenProvider
+ {
+ matches <- replace matches;
+ callin boolean matches(IJavaElement element) {
+ if (base.matches(element))
+ return true;
+ return Util.isGenerated(element);
+ }
+ }
+ protected class Viewer playedBy JavaOutlineViewer
+ {
+ void unwrapOTType(Object element) <- replace void associate(Object element, Item item)
+ base when (element instanceof IOTType);
+
+ callin void unwrapOTType(Object element) {
+ base.unwrapOTType(((IOTType)element).getCorrespondingJavaElement());
+ }
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/packageview/OTLayoutActionGroup.java b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/packageview/OTLayoutActionGroup.java
new file mode 100644
index 000000000..955a29f1a
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/packageview/OTLayoutActionGroup.java
@@ -0,0 +1,100 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2006, 2007 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: OTLayoutActionGroup.java 23438 2010-02-04 20:05:24Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.packageview;
+
+import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
+import org.eclipse.jdt.internal.ui.actions.MultiActionGroup;
+import org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.objectteams.otdt.internal.ui.Messages;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.PlatformUI;
+
+@SuppressWarnings("restriction")
+public class OTLayoutActionGroup extends MultiActionGroup
+{
+ OTLayoutActionGroup(final PackageExplorerAdaptor adaptor, PartAdaptor<@adaptor> packageExplorer) {
+ super(createActions(adaptor, packageExplorer), getSelectedState(packageExplorer));
+ }
+
+ /* (non-Javadoc)
+ * @see ActionGroup#fillActionBars(IActionBars)
+ */
+ public void fillActionBars(IActionBars actionBars) {
+ super.fillActionBars(actionBars);
+ contributeToViewMenu(actionBars.getMenuManager());
+ }
+
+ private void contributeToViewMenu(IMenuManager viewMenu) {
+ viewMenu.add(new Separator());
+
+ // Create layout sub menu
+
+ IMenuManager layoutSubMenu= new MenuManager(Messages.OTLayoutActionGroup_MenuOTPresentations);
+ final String layoutGroupName= "layout"; //$NON-NLS-1$
+ viewMenu.appendToGroup(layoutGroupName, layoutSubMenu);
+// viewMenu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS+"-end"));//$NON-NLS-1$
+ addActions(layoutSubMenu);
+ }
+
+ static int getSelectedState(PackageExplorerPart packageExplorer) {
+ if (packageExplorer.isFlatLayout())
+ return 0;
+ else
+ return 1;
+ }
+
+ static IAction[] createActions(final PackageExplorerAdaptor adaptor, PartAdaptor<@adaptor> packageExplorer)
+ {
+ IAction[] actions = new IAction[2];
+ actions[0]= new CallinFormattingAction(adaptor, packageExplorer, true);
+ actions[0].setText(Messages.OTLayoutActionGroup_MenuShowCallinLabels);
+ actions[1]= new CallinFormattingAction(adaptor, packageExplorer, false);
+ actions[1].setText(Messages.OTLayoutActionGroup_MenuDontShowCallinLabels);
+
+ actions[0].setChecked(true);
+ return actions;
+ }
+}
+@SuppressWarnings("restriction")
+class CallinFormattingAction extends Action implements IAction
+{
+ final PackageExplorerAdaptor adaptor;
+ PartAdaptor<@adaptor> packageExplorer;
+ final boolean showLabel;
+
+ CallinFormattingAction(final PackageExplorerAdaptor adaptor, PartAdaptor<@adaptor> packageExplorer, boolean showLabel)
+ {
+ super("", AS_RADIO_BUTTON); //$NON-NLS-1$
+ this.adaptor = adaptor;
+ this.packageExplorer = packageExplorer;
+ this.showLabel = showLabel;
+ // FIXME(SH):
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IJavaHelpContextIds.LAYOUT_FLAT_ACTION);
+ }
+
+ /*
+ * @see org.eclipse.jface.action.IAction#run()
+ */
+ public void run() {
+ packageExplorer.setCallinFormatting(this.showLabel);
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/packageview/PackageExplorerAdaptor.java b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/packageview/PackageExplorerAdaptor.java
new file mode 100644
index 000000000..1e7f2a9f1
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/packageview/PackageExplorerAdaptor.java
@@ -0,0 +1,389 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2006, 2009 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: PackageExplorerAdaptor.java 23438 2010-02-04 20:05:24Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.packageview;
+
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IPackageFragment;
+import org.eclipse.jdt.core.IPackageFragmentRoot;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaModelException;
+
+import org.eclipse.jdt.internal.ui.viewsupport.AppearanceAwareLabelProvider;
+import org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider;
+import org.eclipse.jdt.ui.JavaElementLabels;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.GroupMarker;
+import org.eclipse.jface.action.IContributionItem;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.viewers.IContentProvider;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.swt.widgets.Composite;
+
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IViewSite;
+import org.eclipse.ui.actions.ActionGroup;
+
+import org.eclipse.objectteams.otdt.core.ICallinMapping;
+import org.eclipse.objectteams.otdt.core.IMethodMapping;
+import org.eclipse.objectteams.otdt.core.IOTType;
+import org.eclipse.objectteams.otdt.core.IRoleFileType;
+import org.eclipse.objectteams.otdt.core.OTModelManager;
+import org.eclipse.objectteams.otdt.internal.ui.Messages;
+import org.eclipse.objectteams.otdt.ui.ImageConstants;
+import org.eclipse.objectteams.otdt.ui.ImageManager;
+
+import base org.eclipse.jdt.internal.ui.packageview.ClassPathContainer;
+import base org.eclipse.jdt.internal.ui.packageview.PackageExplorerActionGroup;
+import base org.eclipse.jdt.internal.ui.packageview.PackageExplorerContentProvider;
+import base org.eclipse.jdt.internal.ui.packageview.PackageExplorerLabelProvider;
+import base org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart;
+import base org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart.PackageExplorerProblemTreeViewer;
+
+/**
+ * @author stephan
+ *
+ * @role ContentProvider
+ */
+@SuppressWarnings("restriction")
+public team class PackageExplorerAdaptor {
+
+ @SuppressWarnings("decapsulation")
+ public class PartAdaptor playedBy PackageExplorerPart
+ {
+ private boolean fIsShowingCallinLabel = true;
+
+ void createPartControl(Composite parent) {
+ HideExternalRolePackagesAction hideRolesAction = new HideExternalRolePackagesAction(this);
+ //TODO: this should be saved and restored somewhere!
+ ContentProvider contentProvider = getContentProvider();
+ if (contentProvider != null) // is null when base is MockPluginView
+ hideRolesAction.setChecked(contentProvider.isHideRolePackages());
+
+ updateToolBar(hideRolesAction);
+ }
+ createPartControl <- after createPartControl;
+
+ @SuppressWarnings("basecall")
+ callin LabelProvider createLabelProvider() {
+ long textFlags = AppearanceAwareLabelProvider.DEFAULT_TEXTFLAGS | JavaElementLabels.P_COMPRESSED;
+ int imageFlags = AppearanceAwareLabelProvider.DEFAULT_IMAGEFLAGS | JavaElementImageProvider.SMALL_ICONS;
+ int otTextFlags = LabelProvider.CALLIN_DEFAULT;
+ return new LabelProvider(textFlags, imageFlags, otTextFlags, getContentProvider());
+ }
+ createLabelProvider <- replace createLabelProvider;
+
+ /**
+ * Add button for toggling view of external defined roles
+ */
+ protected void updateToolBar(HideExternalRolePackagesAction hideRolesAction)
+ {
+ IActionBars actionBar = getViewSite().getActionBars();
+ IToolBarManager tbManager = actionBar.getToolBarManager();
+
+ // save original toolbar items and insert in new order
+ IContributionItem[] items = tbManager.getItems();
+ tbManager.removeAll();
+
+ for (int idx = 0; idx < items.length; idx++)
+ {
+ tbManager.add(items[idx]);
+ // insert new action after group marker
+ if (items[idx] instanceof GroupMarker)
+ if (((GroupMarker)items[idx]).getId().equals(PackageExplorerActionGroup.getFRAME_ACTION_GROUP_ID()))
+ tbManager.add(hideRolesAction);
+
+ }
+ }
+ public void setCallinFormatting(boolean showLabel) {
+ if (showLabel == fIsShowingCallinLabel)
+ return;
+ fIsShowingCallinLabel = showLabel;
+ getLabelProvider().setCallinFormatting(fIsShowingCallinLabel);
+
+ TreeViewer viewer = getTreeViewer();
+ viewer.getControl().setRedraw(false);
+ viewer.refresh();
+ viewer.getControl().setRedraw(true);
+ }
+
+ boolean adjustInput(Object input) <- replace boolean showInput(Object input);
+ callin boolean adjustInput(Object input) {
+ if (getContentProvider().isHideRolePackages()) {
+ if (input instanceof ICompilationUnit) {
+ try {
+ IType[] types = ((ICompilationUnit)input).getTypes();
+ for(int typeIdx = 0; typeIdx < types.length; typeIdx++)
+ {
+ IOTType otType = OTModelManager.getOTElement(types[typeIdx]);
+ if (otType != null) {
+ input = otType;
+ break;
+ }
+ }
+ } catch (JavaModelException e) {
+ // fall through to base behavior
+ }
+ }
+ }
+ return base.adjustInput(input);
+ }
+
+
+
+ protected
+ ContentProvider getContentProvider() -> get PackageExplorerContentProvider fContentProvider;
+ LabelProvider getLabelProvider() -> get PackageExplorerLabelProvider fLabelProvider;
+ TreeViewer getTreeViewer() -> TreeViewer getTreeViewer();
+ IViewSite getViewSite() -> IViewSite getViewSite();
+
+ }
+
+ protected class HideExternalRolePackagesAction extends Action {
+
+ private PartAdaptor _part;
+
+ public HideExternalRolePackagesAction(PartAdaptor part) {
+ super(Messages.PackageExplorer_DisplayRoleFilesAction);
+
+ _part = part;
+
+ ImageManager.getSharedInstance().setActionImageDescriptors(
+ this, ImageConstants.HIDE_TEAMPACKAGE);
+
+ setDescription(Messages.PackageExplorer_DisplayRoleFilesDescription);
+ setToolTipText(Messages.PackageExplorer_DisplayRoleFilesTooltip);
+
+ setChecked(this._part.getContentProvider().isHideRolePackages());
+ }
+
+ /**
+ * Toggle visibility of packages containing external roles and
+ * refresh Package Explorer TreeViewer
+ */
+ public void run() {
+ ContentProvider provider = _part.getContentProvider();
+ provider.setHideRolePackages(!provider.isHideRolePackages()); // toggle
+
+ TreeViewer viewer = _part.getTreeViewer();
+
+ viewer.getControl().setRedraw(false);
+ viewer.refresh();
+ viewer.getControl().setRedraw(true);
+ }
+ }
+
+ @SuppressWarnings("decapsulation")
+ protected class PackageTreeViewer playedBy PackageExplorerProblemTreeViewer {
+
+ ContentProvider getContentProvider() -> IContentProvider getContentProvider()
+ with { result <- (PackageExplorerContentProvider)result }
+
+ void add(Object parent, Object child) <- replace void add(Object parentElementOrTreePath, Object childElement);
+
+ @SuppressWarnings("basecall") // suppressing base call if child should in fact be hidden
+ callin void add(Object parent, Object child) {
+ try {
+ if ( child instanceof IPackageFragment
+ && getContentProvider().isHideRolePackages())
+ {
+ if (containsExternalRoles((IPackageFragment) child))
+ return; // don't add!
+ }
+ } catch (Exception e) { // also catch potential CCE in callout getContentProvider()
+ // ignore
+ }
+ base.add(parent, child);
+ }
+
+ }
+
+ protected class LabelProvider playedBy PackageExplorerLabelProvider {
+ // Technical note: class org.eclipse.objectteams.otdt.internal.ui.WorkbenchAdapter already provides
+ // default labels for all OT-elements including method mappings.
+ // However, the implicit singleton WorkbenchAdapter is not aware of who is calling,
+ // so it cannot be configured to select between different possible representations.
+ /**
+ * Whether the name of a callin (aka 'callin label' shall be included in the text label)
+ */
+ public static final int CALLIN_NAME = 1;
+ /**
+ * Whether the callin declaration shall be included in the text label)
+ */
+ public static final int CALLIN_DECL = 2;
+ /**
+ * The user-configured representation of callins.
+ */
+ public static final int CALLIN_DEFAULT = 4;
+
+ protected int _otTextFlags = CALLIN_NAME | CALLIN_DECL;
+
+ /**
+ * Create an OT-aware label provider wrapping a PackageExplorerLabelProvider.
+ *
+ * @param otTextFlags how should callins be printed (see constants above)?
+ */
+ protected LabelProvider(long textFlags, int imageFlags, int otTextFlags, ContentProvider contentProvider) {
+ base(contentProvider);
+ _otTextFlags = checkOTTextFlags(otTextFlags);
+ }
+
+ protected void setCallinFormatting(boolean isShowingCallinLabel) {
+ if (isShowingCallinLabel)
+ _otTextFlags |= CALLIN_NAME;
+ else
+ _otTextFlags &= ~CALLIN_NAME;
+ }
+
+ @SuppressWarnings("basecall")
+ callin String getText(Object element) {
+ if (element instanceof IMethodMapping)
+ return getMethodMappingText((IMethodMapping)element);
+ return base.getText(element);
+ }
+ getText <- replace getText;
+
+ protected int checkOTTextFlags(int newFlags)
+ {
+ if ((newFlags & CALLIN_DEFAULT) != 0)
+ return getDefaultCallinFlags();
+
+ if ((newFlags & (CALLIN_DECL | CALLIN_NAME)) == 0)
+ throw new IllegalArgumentException("Must set at least CALLIN_DECL or CALLIN_NAME"); //$NON-NLS-1$
+
+ return newFlags;
+ }
+
+ protected int getDefaultCallinFlags()
+ {
+ // FIXME: ask preference store
+ return CALLIN_DECL | CALLIN_NAME;
+ }
+
+ public String getMethodMappingText(IMethodMapping mapping)
+ {
+ if (mapping instanceof ICallinMapping)
+ {
+ ICallinMapping callinMapping = (ICallinMapping) mapping;
+ StringBuffer buf = new StringBuffer();
+
+ if ((_otTextFlags & CALLIN_NAME) != 0)
+ {
+ if (callinMapping.hasName())
+ {
+ buf.append(callinMapping.getName());
+ if ((_otTextFlags & CALLIN_DECL) != 0)
+ buf.append(": "); //$NON-NLS-1$
+ }
+ }
+
+ if ((_otTextFlags & CALLIN_DECL) != 0)
+ buf.append(callinMapping.getElementName());
+
+ return buf.toString();
+ }
+
+ return mapping.getElementName();
+ }
+ }
+ /** gateway only. */
+ protected class ClassPathContainer playedBy ClassPathContainer
+ {
+ protected ClassPathContainer(IJavaProject project, IClasspathEntry entry) {
+ base(project, entry);
+ }
+ @SuppressWarnings("decapsulation")
+ protected
+ boolean contains(IJavaProject project, IClasspathEntry entry, IPackageFragmentRoot root)
+ -> boolean contains(IJavaProject project, IClasspathEntry entry, IPackageFragmentRoot root);
+ }
+
+ @SuppressWarnings("decapsulation")
+ protected class PackageExplorerActionGroup playedBy PackageExplorerActionGroup {
+ callin void setGroups(ActionGroup[] groups) {
+ int len = groups.length;
+ System.arraycopy(groups, 0, groups=new ActionGroup[len+1], 0, len);
+ groups[len] = new OTLayoutActionGroup(PackageExplorerAdaptor.this, this.getPart());
+ base.setGroups(groups);
+ }
+ setGroups <- replace setGroups;
+
+ PartAdaptor getPart() -> get PackageExplorerPart fPart;
+
+ protected
+ String getFRAME_ACTION_GROUP_ID() -> get String FRAME_ACTION_GROUP_ID;
+ }
+
+ // === Common lookup functions: ===
+ /** Is the element a package fragment representing a team package? */
+ boolean isExternalRolePackage(Object element)
+ throws JavaModelException
+ {
+ //TODO (haebor) what about caching already found results
+ if((element instanceof IPackageFragment)
+ && (containsExternalRoles((IPackageFragment)element)))
+ {
+ return true;
+ }
+ return false;
+ }
+ /** Does the package fragment represent a team package (=contain role files)? */
+ boolean containsExternalRoles(IPackageFragment packageFragment)
+ throws JavaModelException
+ {
+ IJavaElement[] children = packageFragment.getChildren();
+ for(int idx = 0; idx < children.length; idx++)
+ {
+ IJavaElement current = children[idx];
+ if((current instanceof ICompilationUnit))
+ {
+ IType[] types = ((ICompilationUnit)current).getTypes();
+ for(int typeIdx = 0; typeIdx < types.length; typeIdx++)
+ {
+ IType currentType = types[typeIdx];
+ IOTType otType =
+ OTModelManager.getOTElement(currentType);
+ if (otType != null && otType instanceof IRoleFileType)
+ {
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ // === Test Infrastructure ===
+ private static PackageExplorerAdaptor instance;
+
+ public PackageExplorerAdaptor() {
+ instance = this;
+ }
+ public static PackageExplorerAdaptor getInstance() {
+ return instance;
+ }
+ public void setShowTeamPackages(boolean show, PackageExplorerContentProvider as ContentProvider contentProvider) {
+ contentProvider.setHideRolePackages(!show);
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/packageview/PackageExplorerAdaptor/ContentProvider.java b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/packageview/PackageExplorerAdaptor/ContentProvider.java
new file mode 100644
index 000000000..f6b386e38
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/packageview/PackageExplorerAdaptor/ContentProvider.java
@@ -0,0 +1,275 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2006, 2007 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: ContentProvider.java 23438 2010-02-04 20:05:24Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+team package org.eclipse.objectteams.otdt.internal.ui.packageview.PackageExplorerAdaptor;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.jdt.core.Flags;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IMethod;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.core.Signature;
+import org.eclipse.jdt.internal.core.CompilationUnit;
+import org.eclipse.ui.model.IWorkbenchAdapter;
+import org.eclipse.objectteams.otdt.core.IOTJavaElement;
+import org.eclipse.objectteams.otdt.core.IOTType;
+import org.eclipse.objectteams.otdt.core.IRoleFileType;
+import org.eclipse.objectteams.otdt.core.IRoleType;
+import org.eclipse.objectteams.otdt.core.OTModelManager;
+import org.eclipse.objectteams.otdt.ui.OTDTUIPlugin;
+import org.eclipse.objectteams.otdt.ui.Util;
+
+/**
+ * @author stephan
+ *
+ */
+@SuppressWarnings("restriction")
+protected class ContentProvider playedBy PackageExplorerContentProvider
+{
+ static final String ERROR_MESSAGE =
+ "View 'OT Package Explorer' failed to access JavaModel!"; //$NON-NLS-1$
+
+ static final String PREFERENCE_KEY = "PackageExplorerHideRolePackages.isChecked"; //$NON-NLS-1$
+
+ private boolean _hideRolePackages = false;
+
+ protected ContentProvider(PackageExplorerContentProvider myBase) {
+ this._hideRolePackages = OTDTUIPlugin.getDefault().getPreferenceStore().getBoolean(PREFERENCE_KEY);
+ }
+
+ public void setHideRolePackages(boolean enable)
+ {
+ this._hideRolePackages = enable;
+ OTDTUIPlugin.getDefault().getPreferenceStore().setValue(PREFERENCE_KEY, enable);
+ }
+
+ public boolean isHideRolePackages()
+ {
+ return this._hideRolePackages;
+ }
+
+ @SuppressWarnings("basecall")
+ callin Object[] getChildren(Object parentElement)
+ {
+ List<Object> children = null;
+ if (parentElement instanceof IOTType)
+ {
+ IJavaElement javaParentElement = ((IOTJavaElement)parentElement).getCorrespondingJavaElement();
+ children = new ArrayList<Object>(Arrays.asList(getChildrenAdapted(javaParentElement)));
+ if (isHideRolePackages())
+ {
+ IType[] roleFiles = null;
+ try
+ {
+ roleFiles = ((IOTType)parentElement).getRoleTypes(IOTType.ROLEFILE);
+ Util.replaceOTTypes(roleFiles);
+ }
+ catch (JavaModelException ex)
+ {
+ OTDTUIPlugin.getExceptionHandler().logCoreException(ERROR_MESSAGE, ex);
+ }
+ children.addAll(Arrays.asList(roleFiles));
+ }
+ children = filterOTGenerated(children);
+ return children.toArray();
+ }
+
+ // no OT element -> delegate to original content provider
+ children = new ArrayList<Object>(Arrays.asList(base.getChildren(parentElement)));
+
+ //role packages invisible?
+ if (isHideRolePackages())
+ {
+ try
+ {
+ filterExternalRolePackage(parentElement, children);
+ }
+ catch (JavaModelException ex)
+ {
+ OTDTUIPlugin.getExceptionHandler().logCoreException(ERROR_MESSAGE, ex);
+ }
+ }
+ return Util.replaceOTTypes(children.toArray());
+ }
+ getChildren <- replace getChildren;
+
+ @SuppressWarnings("basecall")
+ callin Object getParent(Object element)
+ {
+ if (this._hideRolePackages && element instanceof IType) {
+ // short cut for role file who's parent in this mode is the team
+ IOTType ottype = OTModelManager.getOTElement((IType)element);
+ if (ottype instanceof IRoleType)
+ return ((IRoleType) ottype).getTeam();
+ }
+ return base.getParent(element);
+ }
+ getParent <- replace getParent;
+
+ Object[] getChildrenAdapted(Object element) {
+ IWorkbenchAdapter adapter = getAdapter(element);
+ if (adapter != null) {
+ Object[] result = adapter.getChildren(element);
+ return Util.replaceOTTypes(result, true/*lazyCopy*/);
+ }
+ return new Object[0];
+ }
+
+ protected List<Object> filterOTGenerated(List<Object> children) {
+ ArrayList<Object> result = new ArrayList<Object>(children.size());
+ for (Iterator<Object> iter = children.iterator(); iter.hasNext();) {
+ Object elem = iter.next();
+ if (elem instanceof IJavaElement)
+ {
+ IJavaElement javaElem = (IJavaElement)elem;
+ if (!isGenerated(javaElem))
+ {
+ result.add(javaElem);
+ }
+ } else
+ {
+ result.add(elem);
+// if (elem instanceof IJavaElement)
+// System.out.println("added: "+((IJavaElement)elem).getElementName()+":"+((IJavaElement)elem).getElementType());
+ }
+ }
+ return result;
+ }
+
+ @SuppressWarnings("nls")
+ public static boolean isGenerated(IJavaElement elem) {
+ // TODO (SH): check whether ViewerFilters can do the job better.
+
+ // all kinds of generated features determined by name:
+ String name = elem.getElementName();
+ final String[] patterns = new String[] {
+ "_OT$", "TSuper__OT__", // general OT-prefix
+ "class$", "access$", "val$", "this$" // std. java synthetics.
+ };
+ for (int i = 0; i < patterns.length; i++) {
+ if (name.indexOf(patterns[i]) >= 0)
+ return true;
+ }
+
+ switch (elem.getElementType()) {
+ case IJavaElement.TYPE:
+ case IOTJavaElement.ROLE:
+ // Predifined role types (non-overridable)?
+ final String[] fullPatterns = new String[] {
+ "IConfined", "Confined", "__OT__Confined", "ILowerable", // special OT types
+ };
+ for (int i = 0; i < fullPatterns.length; i++) {
+ if (name.equals(fullPatterns[i]))
+ return true;
+ }
+ break;
+ case IJavaElement.METHOD:
+ // tsuper-method?
+ IMethod method = (IMethod)elem;
+ String[] paramTypes = method.getParameterTypes();
+ if (paramTypes.length > 0) {
+ String lastType = Signature.getSimpleName(Signature.toString(paramTypes[paramTypes.length-1]));
+ if (lastType.startsWith("TSuper__OT__"))
+ return true;
+ }
+ break;
+ }
+
+ // Synthetic role interface?
+ if (elem.getElementType() == IOTJavaElement.ROLE) {
+ IType type = (IType)elem;
+ try {
+ if (Flags.isSynthetic(type.getFlags()))
+ return true;
+ } catch (JavaModelException ex) {
+ // nop
+ }
+ }
+ return false;
+ }
+ /**
+ * Remove packages containing external roles from given list
+ */
+ private void filterExternalRolePackage(Object parentElement, List<Object> children)
+ throws JavaModelException
+ {
+ ArrayList<Object> removalList = new ArrayList<Object>(children.size());
+ Iterator<Object> iterator = children.iterator();
+ Object element;
+ while (iterator.hasNext())
+ {
+ element = iterator.next();
+ if(isExternalRolePackage(element))
+ {
+ removalList.add(element);
+ }
+ }
+ Iterator<Object> removalIterator = removalList.iterator();
+ while(removalIterator.hasNext())
+ {
+ children.remove(removalIterator.next());
+ }
+//TODO (haebor) : consider layoutmode
+ }
+
+ // copied from BaseWorkbenchContentProvider
+ IWorkbenchAdapter getAdapter(Object element) {
+ if (!(element instanceof IAdaptable)) {
+ return null;
+ }
+ return (IWorkbenchAdapter) ((IAdaptable) element)
+ .getAdapter(IWorkbenchAdapter.class);
+ }
+
+ @SuppressWarnings({ "decapsulation", "unchecked"/*Collection*/ })
+ void findTeamCU(Object root)
+ <- replace
+ void postRefresh(Object root, int relation, Object affectedElement, Collection runnables)
+ when (_hideRolePackages);
+
+ callin void findTeamCU(Object element) {
+ if (element instanceof CompilationUnit) {
+ // when refreshing in logical view, rofi-CUs are not visible, replace element by the enclosing Team CU
+ CompilationUnit cu = (CompilationUnit) element;
+ try {
+ IType[] types = cu.getTypes();
+ if (types != null && types.length > 0) {
+ IOTType ottype = OTModelManager.getOTElement(types[0]);
+ if (ottype instanceof IRoleFileType) {
+ // search outermost team:
+ while(ottype.isRole())
+ ottype = ((IRoleType)ottype).getTeam();
+ element = ottype.getCompilationUnit();
+ }
+ }
+ } catch (JavaModelException jme) {
+ // nop, just keep element unchanged
+ }
+ }
+ base.findTeamCU(element);
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/search/FindActionAdaptor.java b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/search/FindActionAdaptor.java
new file mode 100644
index 000000000..5b3671bd5
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/search/FindActionAdaptor.java
@@ -0,0 +1,68 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2006, 2007 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: FindActionAdaptor.java 23438 2010-02-04 20:05:24Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.search;
+
+import org.eclipse.objectteams.otdt.core.IMethodMapping;
+import org.eclipse.objectteams.otdt.internal.core.AbstractCalloutMapping;
+
+import base org.eclipse.jdt.ui.actions.FindAction;
+import base org.eclipse.jdt.ui.actions.FindDeclarationsAction;
+import base org.eclipse.jdt.ui.actions.FindImplementorsAction;
+import base org.eclipse.jdt.ui.actions.FindReferencesAction;
+
+/**
+ * Find actions have hard-coded lists of classes for which they are applicable.
+ * Insert method bindings as appropriate to these lists.
+ *
+ * @author stephan
+ */
+@SuppressWarnings({"restriction", "unchecked"}) // using raw type 'Class'
+public team class FindActionAdaptor
+{
+ protected class FindAction playedBy FindAction
+ {
+ Class[] addClass(Class[] result, Class class1) {
+ int len = result.length;
+ System.arraycopy(result, 0, result = new Class[len+1], 0, len);
+ result[len] = class1;
+ return result;
+ }
+ }
+
+ protected class FindDeclarationsAction extends FindAction playedBy FindDeclarationsAction {
+ callin Class[] getValidTypes () {
+ return addClass(base.getValidTypes(), AbstractCalloutMapping.class);
+ }
+ // TODO(SH): pulling-up this binding to FindAction fails due to bcel-Repository
+ @SuppressWarnings("decapsulation")
+ getValidTypes <- replace getValidTypes;
+ }
+ protected class FindImplementorsAction extends FindAction playedBy FindImplementorsAction {
+ callin Class[] getValidTypes () {
+ return addClass(base.getValidTypes(), AbstractCalloutMapping.class);
+ }
+ @SuppressWarnings("decapsulation")
+ getValidTypes <- replace getValidTypes;
+ }
+ protected class FindReferencesAction extends FindAction playedBy FindReferencesAction {
+ callin Class[] getValidTypes () {
+ return addClass(base.getValidTypes(), IMethodMapping.class);
+ }
+ @SuppressWarnings("decapsulation")
+ getValidTypes <- replace getValidTypes;
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/search/SearchAdaptor.java b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/search/SearchAdaptor.java
new file mode 100644
index 000000000..21adbcd67
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/search/SearchAdaptor.java
@@ -0,0 +1,46 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2008 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: SearchAdaptor.java 23438 2010-02-04 20:05:24Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.search;
+
+import org.eclipse.objectteams.otdt.core.IOTType;
+
+import base org.eclipse.jdt.internal.ui.search.LevelTreeContentProvider.FastJavaElementProvider;
+
+/**
+ * This adaptor ensures that OT-Types are not displayed duplicately in the search result page,
+ * which happened due to the duality of, e.g., SourceType and RoleType.
+ * See http://trac.objectteams.org/ot/ticket/44
+ * @author stephan
+ */
+@SuppressWarnings({ "restriction", "decapsulation" })
+public team class SearchAdaptor {
+ protected class ContentProviderAdaptor playedBy FastJavaElementProvider
+ {
+
+ Object getParent(Object element) <- replace Object getParent(Object element);
+
+ /** Normalize IOTTypes by using the corresponding java element. */
+ callin Object getParent(Object element)
+ {
+ Object result= base.getParent(element);
+ if (result instanceof IOTType)
+ result= ((IOTType)result).getCorrespondingJavaElement();
+ return result;
+ }
+
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/text/OutlineAdaptor.java b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/text/OutlineAdaptor.java
new file mode 100644
index 000000000..173b193d8
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/text/OutlineAdaptor.java
@@ -0,0 +1,139 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2006, 2007 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: OutlineAdaptor.java 23438 2010-02-04 20:05:24Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.text;
+
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.internal.core.CompilationUnit;
+import org.eclipse.objectteams.otdt.core.IOTType;
+import org.eclipse.objectteams.otdt.core.OTModelManager;
+import org.eclipse.objectteams.otdt.internal.ui.Messages;
+import org.eclipse.objectteams.otdt.ui.Util;
+
+import base org.eclipse.jdt.internal.ui.text.JavaOutlineInformationControl;
+import base org.eclipse.jdt.internal.ui.text.JavaOutlineInformationControl.OutlineContentProvider;
+/**
+ * This team adapts the quick outline (Ctrl-O and Ctrl-O+Ctrl-O)
+ * - add method mappings
+ * - add role files (only when also showing inherited members)
+ * - hide generated methods/fields.
+ *
+ * @author stephan
+ * @since 0.9.18
+ */
+@SuppressWarnings({"restriction","decapsulation"})
+public team class OutlineAdaptor
+{
+ private static boolean activated = false;
+ public static void doActivate() {
+ if (!activated)
+ new OutlineAdaptor().activate(ALL_THREADS);
+ activated = true;
+ }
+
+ protected class OutlineContentProvider playedBy OutlineContentProvider
+ {
+ callin Object[] getChildren(Object element)
+ {
+ boolean processingTeam = false;
+ IOTType otElement = null;
+
+ // start with result from base call:
+ Object[] children = base.getChildren(element);
+
+ // inspect element
+ if (element instanceof IType) {
+ IType type = (IType)element;
+ processingTeam = OTModelManager.isTeam(type);
+ otElement = OTModelManager.getOTElement(type);
+ // note: base.getChildren(otElement) can not answer inherited members!
+ }
+
+ if (otElement == null)
+ return children;
+
+ // filter out generated members:
+ children = Util.filterOTGenerated(children);
+
+ if (processingTeam && showRoleFiles()) {
+ // add role files:
+ try {
+ IType[] roleFiles = otElement.getRoleTypes(IOTType.ROLEFILE);
+ if (roleFiles != null)
+ return concatArrays(roleFiles, children);
+ } catch (JavaModelException e) {
+ // nop, did not improve
+ }
+ }
+ return children;
+ }
+ getChildren <- replace getChildren;
+
+ boolean showRoleFiles() -> boolean isShowingInheritedMembers();
+
+ private Object[] concatArrays(Object[] array1, Object[] array2) {
+ int length1 = array1.length;
+ int length2 = array2.length;
+ if (length1 == 0)
+ return array2;
+ if (length2 == 0)
+ return array1;
+ Object[] result = new Object[length1+length2];
+ System.arraycopy(array1, 0, result, 0, length1);
+ System.arraycopy(array2, 0, result, length1, length2);
+ return result;
+ }
+ }
+
+ /** Adapt the control as to display an adapted help text if needed. */
+ protected class JavaOutlineInformationControl playedBy JavaOutlineInformationControl
+ {
+ /** Compute the info text possibly appending a note on role files. */
+ callin String getStatusFieldText() {
+ String msg = base.getStatusFieldText();
+ IJavaElement element = getInput();
+ if (element != null) {
+ if (element.getElementType() == IJavaElement.COMPILATION_UNIT) {
+ // find main type:
+ try {
+ IType[] types = ((CompilationUnit)element).getTypes();
+ if (types != null && types.length > 0)
+ element = types[0];
+ } catch (JavaModelException e) {
+ return msg;// simply won't update text upon exception
+ }
+ }
+ // update the info text only for teams:
+ if (element.getElementType() == IJavaElement.TYPE && OTModelManager.isTeam((IType)element))
+ msg += Messages.QuickOutline__and_role_files;
+ }
+ return msg;
+ }
+ getStatusFieldText <- replace getStatusFieldText;
+
+ /** Trigger re-computing the info text once the input element is set. */
+ void updateInfoText() {
+ updateStatusFieldText();
+ }
+ updateInfoText <- after setInput;
+
+ // Callouts:
+ IJavaElement getInput() -> get IJavaElement fInput;
+ void updateStatusFieldText() -> void updateStatusFieldText();
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/text/correction/ChangeModifierProposalSubProcessor.java b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/text/correction/ChangeModifierProposalSubProcessor.java
new file mode 100644
index 000000000..cc9baf59c
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/text/correction/ChangeModifierProposalSubProcessor.java
@@ -0,0 +1,265 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2006, 2007 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: ChangeModifierProposalSubProcessor.java 23438 2010-02-04 20:05:24Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.text.correction;
+
+import java.util.List;
+
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.dom.AST;
+import org.eclipse.jdt.core.dom.ASTNode;
+import org.eclipse.jdt.core.dom.CallinMappingDeclaration;
+import org.eclipse.jdt.core.dom.CalloutMappingDeclaration;
+import org.eclipse.jdt.core.dom.ChildListPropertyDescriptor;
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jdt.core.dom.IBinding;
+import org.eclipse.jdt.core.dom.IMethodBinding;
+import org.eclipse.jdt.core.dom.IVariableBinding;
+import org.eclipse.jdt.core.dom.MethodBindingOperator;
+import org.eclipse.jdt.core.dom.MethodDeclaration;
+import org.eclipse.jdt.core.dom.MethodSpec;
+import org.eclipse.jdt.core.dom.Modifier;
+import org.eclipse.jdt.core.dom.RoleTypeDeclaration;
+import org.eclipse.jdt.core.dom.SimpleName;
+import org.eclipse.jdt.core.dom.TypeDeclaration;
+import org.eclipse.jdt.core.dom.VariableDeclarationFragment;
+import org.eclipse.jdt.core.dom.Modifier.ModifierKeyword;
+import org.eclipse.jdt.core.dom.rewrite.ASTRewrite;
+import org.eclipse.jdt.core.dom.rewrite.ListRewrite;
+import org.eclipse.jdt.internal.corext.util.Messages;
+import org.eclipse.jdt.internal.ui.JavaPluginImages;
+import org.eclipse.jdt.internal.ui.text.correction.proposals.ASTRewriteCorrectionProposal;
+import org.eclipse.jdt.internal.ui.text.correction.proposals.LinkedCorrectionProposal;
+import org.eclipse.jdt.internal.ui.text.correction.proposals.ModifierChangeCorrectionProposal;
+import org.eclipse.jdt.ui.text.java.IInvocationContext;
+import org.eclipse.jdt.ui.text.java.IJavaCompletionProposal;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.objectteams.otdt.core.exceptions.InternalCompilerError;
+import org.eclipse.objectteams.otdt.ui.ImageConstants;
+import org.eclipse.objectteams.otdt.ui.ImageManager;
+
+/**
+ * Compute OT-specific proposals for changing various modifiers.
+ *
+ * @author stephan
+ */
+@SuppressWarnings("restriction")
+public class ChangeModifierProposalSubProcessor
+{
+ static final int VISIBILITY_MASK = (Modifier.PRIVATE | Modifier.PROTECTED | Modifier.PUBLIC);
+
+ /**
+ * handle IProblem.MissingTeamForRoleWithMembers
+ */
+ static ASTRewriteCorrectionProposal getMakeTypeTeamProposal(ICompilationUnit cu, RoleTypeDeclaration typeDeclaration, int relevance) {
+ AST ast= typeDeclaration.getAST();
+ ASTRewrite rewrite= ASTRewrite.create(ast);
+ rewrite.set(typeDeclaration, RoleTypeDeclaration.TEAM_PROPERTY, true, null);
+
+ String label= Messages.format(CorrectionMessages.OTQuickfix_addteam_description, typeDeclaration.getName().getIdentifier());
+ Image image= JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE);
+ return new ASTRewriteCorrectionProposal(label, cu, rewrite, 5, image);
+ }
+
+ // taken from ModifierCorrectionSubProcessor, but also considering RoleTypeDeclarationn.
+ static ASTRewriteCorrectionProposal getMakeTypeAbstractProposal(ICompilationUnit cu, TypeDeclaration typeDeclaration, int relevance) {
+ AST ast= typeDeclaration.getAST();
+ ASTRewrite rewrite= ASTRewrite.create(ast);
+ Modifier newModifier= ast.newModifier(Modifier.ModifierKeyword.ABSTRACT_KEYWORD);
+ ChildListPropertyDescriptor modifiersProperty = typeDeclaration instanceof RoleTypeDeclaration ?
+ RoleTypeDeclaration.MODIFIERS2_PROPERTY :
+ TypeDeclaration.MODIFIERS2_PROPERTY;
+ ListRewrite listRewrite = rewrite.getListRewrite(typeDeclaration, modifiersProperty);
+ if (typeDeclaration.isTeam())
+ listRewrite.insertAt(newModifier, findTeamModifierIndex(typeDeclaration), null);
+ else
+ listRewrite.insertLast(newModifier, null);
+
+ String label= Messages.format(CorrectionMessages.OTQuickfix_addabstract_description, typeDeclaration.getName().getIdentifier());
+ Image image= JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE);
+ LinkedCorrectionProposal proposal= new LinkedCorrectionProposal(label, cu, rewrite, relevance, image);
+ proposal.addLinkedPosition(rewrite.track(newModifier), true, "modifier"); //$NON-NLS-1$
+ return proposal;
+ }
+
+ /* Helper */
+ @SuppressWarnings("unchecked") // AST does not declare type parameters
+ private static int findTeamModifierIndex(TypeDeclaration typeDeclaration) {
+ List modifiers = typeDeclaration.modifiers();
+ if (modifiers == null)
+ throw new IllegalArgumentException("team without team modifier?"); //$NON-NLS-1$
+ for (int i=0; i < modifiers.size(); i++) {
+ if (((Modifier)modifiers.get(i)).getKeyword() == ModifierKeyword.TEAM_KEYWORD)
+ return i;
+ }
+ throw new IllegalArgumentException("team without team modifier?"); //$NON-NLS-1$
+ }
+
+ static IJavaCompletionProposal getChangeRoleVisibilityProposal(
+ ICompilationUnit cu, RoleTypeDeclaration roleType, int modifier)
+ {
+ return new ModifierChangeCorrectionProposal(
+ Messages.format(
+ CorrectionMessages.OTQuickfix_changerolevisibility_description,
+ new String[] { roleType.getName().getIdentifier(),
+ Modifier.isPublic(modifier)?"public":"protected" }), //$NON-NLS-1$ //$NON-NLS-2$
+ cu,
+ roleType.resolveBinding(),
+ roleType,
+ modifier,
+ VISIBILITY_MASK,
+ 8,
+ JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE));
+ }
+
+ static IJavaCompletionProposal getChangeMethodModifierProposal(IInvocationContext context,
+ MethodDeclaration methodDecl,
+ IMethodBinding method,
+ int modifier,
+ boolean isAdding)
+ {
+ if (methodDecl == null)
+ methodDecl = (MethodDeclaration)context.getASTRoot().findDeclaringNode(method);
+ else if (method == null)
+ method = methodDecl.resolveBinding();
+ if (methodDecl==null || method == null)
+ throw new InternalCompilerError("incomplete quickfix implementation"); //$NON-NLS-1$
+ String label = null;
+ String[] values = null;
+ if (modifier == Modifier.OT_CALLIN) {
+ label = isAdding? CorrectionMessages.OTQuickfix_addcallinmodifier_description:
+ CorrectionMessages.OTQuickfix_removecallinmodifier_description;
+ values = new String[] { method.getName() };
+ } else {
+ label = isAdding? CorrectionMessages.OTQuickfix_addmethodmodifier_description:
+ CorrectionMessages.OTQuickfix_removemethodmodifier_description;
+ values = new String[] { getModifierString(modifier), method.getName() };
+ }
+
+ return new ModifierChangeCorrectionProposal(
+ Messages.format(label, values),
+ context.getCompilationUnit(),
+ method,
+ methodDecl,
+ isAdding ? modifier : 0,
+ modifier,
+ 8,
+ JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE));
+ }
+
+ final static String KEY_CALLIN_MODIFIER = "callin_modifier"; //$NON-NLS-1$
+
+ public static IJavaCompletionProposal getAddOrChangeCallinModifierProposal(
+ ICompilationUnit cu,
+ CallinMappingDeclaration callinMapping)
+ {
+ AST ast = callinMapping.getAST();
+ ASTRewrite rewrite = ASTRewrite.create(ast);
+ IMethodBinding roleMethod = ((MethodSpec)callinMapping.getRoleMappingElement()).resolveBinding();
+ boolean replaceRequired = roleMethod != null && Modifier.isCallin(roleMethod.getModifiers());
+
+ ModifierKeyword keyword = ModifierKeyword.REPLACE_KEYWORD;
+ if (!replaceRequired) {
+ if (roleMethod != null)
+ keyword = ModifierKeyword.AFTER_KEYWORD;
+ }
+ Modifier modifier = ast.newModifier(keyword);
+ rewrite.set(callinMapping.bindingOperator(), MethodBindingOperator.BINDING_MODIFIER_PROPERTY, modifier, null);
+ LinkedCorrectionProposal proposal = new LinkedCorrectionProposal(
+ callinMapping.getCallinModifier() == Modifier.OT_MISSING_MODIFIER ?
+ CorrectionMessages.OTQuickfix_AddCallinModifier :
+ CorrectionMessages.OTQuickfix_ChangeCallinModifier ,
+ cu,
+ rewrite,
+ 10,
+ ImageManager.getSharedInstance().get(ImageConstants.CALLINBINDING_REPLACE_IMG));
+ if (!replaceRequired) {
+ // setup two alternatives
+ proposal.addLinkedPosition(rewrite.track(modifier), false, KEY_CALLIN_MODIFIER);
+ proposal.addLinkedPositionProposal(KEY_CALLIN_MODIFIER, "after", null); //$NON-NLS-1$
+ proposal.addLinkedPositionProposal(KEY_CALLIN_MODIFIER, "before", null); //$NON-NLS-1$
+ if (roleMethod == null)
+ proposal.addLinkedPositionProposal(KEY_CALLIN_MODIFIER, "replace", null); //$NON-NLS-1$
+ }
+ return proposal;
+ }
+
+ public static IJavaCompletionProposal getChangeCalloutKindProposal(ICompilationUnit cu, CalloutMappingDeclaration calloutMapping, boolean toOverride)
+ {
+ AST ast = calloutMapping.getAST();
+ ASTRewrite rewrite = ASTRewrite.create(ast);
+
+ rewrite.set(calloutMapping.bindingOperator(),
+ MethodBindingOperator.BINDING_KIND_PROPERTY,
+ toOverride ? MethodBindingOperator.KIND_CALLOUT_OVERRIDE : MethodBindingOperator.KIND_CALLOUT,
+ null);
+ return new ASTRewriteCorrectionProposal(
+ toOverride ? CorrectionMessages.OTQuickfix_ChangeCalloutToOverride
+ : CorrectionMessages.OTQuickfix_ChangeCalloutToRegular,
+ cu, rewrite, 10, ImageManager.getSharedInstance().get(
+ ImageConstants.CALLOUTBINDING_IMG));
+ }
+
+ private static String getModifierString(int modifier) {
+ switch (modifier) {
+ case Modifier.PUBLIC: return "public"; //$NON-NLS-1$
+ case Modifier.PROTECTED: return "protected"; //$NON-NLS-1$
+ case Modifier.PRIVATE: return "private"; //$NON-NLS-1$
+ case Modifier.STATIC: return "static"; //$NON-NLS-1$
+ }
+ return "<unexpected modifier>"; //$NON-NLS-1$
+ }
+
+ /**
+ * Add a missing "final" modifier to an assumed type anchor.
+ * @param cu where things happen
+ * @param anchor anchor expression that lacks the final modifier.
+ * @return a proposal or null if not applicable.
+ */
+ public static ModifierChangeCorrectionProposal changeAnchorToFinalProposal(ICompilationUnit cu, ASTNode anchor)
+ {
+ VariableDeclarationFragment var = null;
+ String anchorName = null;
+ if (anchor instanceof SimpleName) {
+ anchorName = ((SimpleName)anchor).getIdentifier();
+ IBinding variable = ((SimpleName)anchor).resolveBinding();
+ if (variable instanceof IVariableBinding) {
+ ASTNode outer = anchor;
+ while (!(outer instanceof CompilationUnit)) {
+ outer = outer.getParent();
+ if (outer == null)
+ return null;
+ }
+ ASTNode declaringNode = ((CompilationUnit)outer).findDeclaringNode(variable);
+ if (declaringNode instanceof VariableDeclarationFragment)
+ var = (VariableDeclarationFragment)declaringNode;
+ }
+ }
+ if (var != null)
+ return new ModifierChangeCorrectionProposal(Messages.format(
+ CorrectionMessages.OTQuickfix_makeanchorfinal_description,
+ new String[]{anchorName}),
+ cu,
+ var.resolveBinding(),
+ var,
+ Modifier.FINAL,
+ 0,
+ 13, // TODO(SH)
+ JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE));
+ return null;
+ }
+
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/text/correction/CorrectionMessages.java b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/text/correction/CorrectionMessages.java
new file mode 100644
index 000000000..f7a762f95
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/text/correction/CorrectionMessages.java
@@ -0,0 +1,76 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2006, 2007 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: CorrectionMessages.java 23438 2010-02-04 20:05:24Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.text.correction;
+
+import org.eclipse.osgi.util.NLS;
+
+public class CorrectionMessages extends NLS {
+ private static final String BUNDLE_NAME= CorrectionMessages.class.getName();
+
+ private CorrectionMessages() {
+ // Do not instantiate
+ }
+
+
+
+
+ public static String OTQuickfix_addteam_description;
+ public static String OTQuickfix_changerolevisibility_description;
+ public static String OTQuickfix_addabstract_description;
+ public static String OTQuickfix_addcallinmodifier_description;
+
+ public static String OTQuickfix_removecallinmodifier_description;
+ public static String OTQuickfix_addmethodmodifier_description;
+ public static String OTQuickfix_removemethodmodifier_description;
+ public static String OTQuickfix_AddCallinModifier;
+ public static String OTQuickfix_ChangeCallinModifier;
+
+ public static String OTQuickfix_ChangeCalloutToOverride;
+ public static String OTQuickfix_ChangeCalloutToRegular;
+
+ public static String OTQuickfix_addbindingprecedence_description;
+ public static String OTQuickfix_addroleprecedence_description;
+ public static String OTQuickfix_swapordermenu_label;
+ public static String OTQuickfix_swapordermenu_description;
+ public static String OTQuickfix_swapprecedenceorder_label;
+ public static String OTQuickfix_swapprecedenceorder_description;
+
+ public static String OTQuickfix_addtypeparametertocallin_label;
+
+ public static String OTQuickfix_migrateroletypesyntax_description;
+
+ public static String OTQuickFix_Type_add_base_import_to_enclosing_team;
+ public static String OTQuickFix_Type_change_type_to_anchored;
+ public static String OTQuickFix_Type_convertimporttobase_description;
+ public static String OTQuickFix_Type_convert_fqn_to_importtobase_description;
+
+ public static String OTQuickfix_makeanchorfinal_description;
+
+ public static String OTQuickfix_materialize_inferred_callout;
+ public static String OTQuickfix_materialize_inferred_callout_to_field;
+ public static String OTQuickfix_materialize_inferred_callouts;
+
+ public static String OTQuickfix_change_assignment_to_settercall;
+
+ public static String OTQuickfix_change_fieldaccess_to_gettercall;
+
+ public static String OTQuickfix_add_missing_role_tag;
+
+ static {
+ NLS.initializeMessages(BUNDLE_NAME, CorrectionMessages.class);
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/text/correction/CorrectionMessages.properties b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/text/correction/CorrectionMessages.properties
new file mode 100644
index 000000000..49752c1aa
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/text/correction/CorrectionMessages.properties
@@ -0,0 +1,44 @@
+# Modifiers:
+OTQuickfix_addteam_description=Add modifier ''team'' to type ''{0}''.
+OTQuickfix_changerolevisibility_description=Change modifier of role ''{0}'' to ''{1}''.
+OTQuickfix_addabstract_description=Mark enclosing team ''{0}'' as abstract.
+OTQuickfix_addcallinmodifier_description=Mark method ''{0}'' as ''callin''.
+OTQuickfix_removecallinmodifier_description=Remove modifier ''callin'' from method ''{0}''.
+OTQuickfix_addmethodmodifier_description=Add modifier ''{0}'' to method ''{1}''.
+OTQuickfix_removemethodmodifier_description=Remove modifier ''{0}'' from method ''{1}''.
+OTQuickfix_AddCallinModifier=add callin binding modifier
+OTQuickfix_ChangeCallinModifier=change callin binding modifier
+# callout token:
+OTQuickfix_ChangeCalloutToOverride=change callout binding to overriding
+OTQuickfix_ChangeCalloutToRegular=change callout binding to regular
+
+# Precedence:
+OTQuickfix_addbindingprecedence_description=Declare binding precedence in type ''{0}''.
+OTQuickfix_addroleprecedence_description=Declare class-based precedence in type ''{0}''.
+OTQuickfix_swapprecedenceorder_label=> Swap Order
+OTQuickfix_swapprecedenceorder_description=Select "Swap Order" as your <b>last action</b> of this quick-fix, if the <b>order</b> within the precedence declaration <b>should be swapped</b>.
+OTQuickfix_swapordermenu_label=precedence
+OTQuickfix_swapordermenu_description=Select "Swap Order" (below) as your <b>last action</b> of this quick-fix, if the <b>order</b> within the precedence declaration <b>should be swapped</b>.
+
+# Import base:
+OTQuickFix_Type_add_base_import_to_enclosing_team=Import {0} in enclosing team (from {1})
+OTQuickFix_Type_convertimporttobase_description="Change import to ''import base {0};''"
+OTQuickFix_Type_convert_fqn_to_importtobase_description="Change qualified reference to using ''import base {0};''"
+
+# Externalized roles:
+OTQuickFix_Type_change_type_to_anchored=Add team anchor to role type.
+OTQuickfix_migrateroletypesyntax_description=Migrate syntax for externalized role.
+OTQuickfix_makeanchorfinal_description=Add modifier ''final'' to team anchor ''{0}'' .
+
+# other re callin:
+OTQuickfix_addtypeparametertocallin_label=Add type parameter to callin binding
+
+# Inferred callouts:
+OTQuickfix_materialize_inferred_callout=Materialize inferred callout resolving this method call.
+OTQuickfix_materialize_inferred_callout_to_field=Materialize inferred callout resolving this field access.
+OTQuickfix_materialize_inferred_callouts=Materialize callouts inferred from abstract methods.
+OTQuickfix_change_assignment_to_settercall=Change assignment to setter call
+OTQuickfix_change_fieldaccess_to_gettercall=Change field access to getter call
+
+# javadoc
+OTQuickfix_add_missing_role_tag=Add missing @role tag for role file ''{0}''.
diff --git a/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/text/correction/JavadocProposalSubProcessor.java b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/text/correction/JavadocProposalSubProcessor.java
new file mode 100644
index 000000000..1c1a4f315
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/text/correction/JavadocProposalSubProcessor.java
@@ -0,0 +1,73 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2008 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: JavadocProposalSubProcessor.java 23438 2010-02-04 20:05:24Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.text.correction;
+
+import java.util.List;
+
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.dom.AST;
+import org.eclipse.jdt.core.dom.Javadoc;
+import org.eclipse.jdt.core.dom.TagElement;
+import org.eclipse.jdt.core.dom.TypeDeclaration;
+import org.eclipse.jdt.core.dom.rewrite.ASTRewrite;
+import org.eclipse.jdt.core.dom.rewrite.ListRewrite;
+import org.eclipse.jdt.internal.corext.util.Messages;
+import org.eclipse.jdt.internal.ui.JavaPluginImages;
+import org.eclipse.jdt.internal.ui.text.correction.proposals.ASTRewriteCorrectionProposal;
+import org.eclipse.jdt.internal.ui.text.correction.proposals.CUCorrectionProposal;
+
+/**
+ * Compute quick fix proposals for OT-specific Javadoc.
+ *
+ * @author stephan
+ * @since 1.2.5
+ */
+@SuppressWarnings("restriction")
+public class JavadocProposalSubProcessor
+{
+ private static final String TAG_ROLE = "@role"; //$NON-NLS-1$
+
+ @SuppressWarnings("unchecked")
+ public static CUCorrectionProposal addRoleTag(ICompilationUnit cu,
+ String[] problemArguments,
+ TypeDeclaration teamType)
+ {
+ if (problemArguments == null || problemArguments.length != 1)
+ return null;
+ AST ast = teamType.getAST();
+ ASTRewrite rewrite = ASTRewrite.create(ast);
+
+ // create the tag
+ TagElement newTag= ast.newTagElement();
+ newTag.setTagName(TAG_ROLE);
+
+ // add the role name
+ List fragments= newTag.fragments();
+ String name= problemArguments[0];
+ fragments.add(ast.newSimpleName(name));
+
+ // add the tag to the javadoc
+ Javadoc javadoc = teamType.getJavadoc();
+ ListRewrite tagsRewriter= rewrite.getListRewrite(javadoc, Javadoc.TAGS_PROPERTY);
+ tagsRewriter.insertLast(newTag, null);
+
+ String label= Messages.format(CorrectionMessages.OTQuickfix_add_missing_role_tag, name);
+ int relevance = 1;
+ return new ASTRewriteCorrectionProposal(label, cu, rewrite, relevance, JavaPluginImages.get(JavaPluginImages.IMG_OBJS_JAVADOCTAG));
+ }
+
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/text/correction/MappingProposalSubProcessor.java b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/text/correction/MappingProposalSubProcessor.java
new file mode 100644
index 000000000..ea3561dba
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/text/correction/MappingProposalSubProcessor.java
@@ -0,0 +1,602 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2007 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: MappingProposalSubProcessor.java 23438 2010-02-04 20:05:24Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.text.correction;
+
+import static org.eclipse.jdt.core.dom.TypeDeclaration.BODY_DECLARATIONS_PROPERTY;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.core.compiler.IProblem;
+import org.eclipse.jdt.core.dom.AST;
+import org.eclipse.jdt.core.dom.ASTNode;
+import org.eclipse.jdt.core.dom.Assignment;
+import org.eclipse.jdt.core.dom.CallinMappingDeclaration;
+import org.eclipse.jdt.core.dom.CalloutMappingDeclaration;
+import org.eclipse.jdt.core.dom.ChildListPropertyDescriptor;
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jdt.core.dom.FieldAccess;
+import org.eclipse.jdt.core.dom.FieldAccessSpec;
+import org.eclipse.jdt.core.dom.IMethodBinding;
+import org.eclipse.jdt.core.dom.IMethodMappingBinding;
+import org.eclipse.jdt.core.dom.ITypeBinding;
+import org.eclipse.jdt.core.dom.MethodDeclaration;
+import org.eclipse.jdt.core.dom.MethodInvocation;
+import org.eclipse.jdt.core.dom.MethodSpec;
+import org.eclipse.jdt.core.dom.Modifier;
+import org.eclipse.jdt.core.dom.Name;
+import org.eclipse.jdt.core.dom.RoleTypeDeclaration;
+import org.eclipse.jdt.core.dom.SimpleName;
+import org.eclipse.jdt.core.dom.SimpleType;
+import org.eclipse.jdt.core.dom.SingleVariableDeclaration;
+import org.eclipse.jdt.core.dom.StructuralPropertyDescriptor;
+import org.eclipse.jdt.core.dom.Type;
+import org.eclipse.jdt.core.dom.TypeDeclaration;
+import org.eclipse.jdt.core.dom.TypeParameter;
+import org.eclipse.jdt.core.dom.rewrite.ASTNodeCreator;
+import org.eclipse.jdt.core.dom.rewrite.ASTRewrite;
+import org.eclipse.jdt.core.dom.rewrite.ImportRewrite;
+import org.eclipse.jdt.core.dom.rewrite.ListRewrite;
+import org.eclipse.jdt.internal.corext.codemanipulation.StubUtility;
+import org.eclipse.jdt.internal.corext.dom.ASTNodes;
+import org.eclipse.jdt.internal.corext.dom.Bindings;
+import org.eclipse.jdt.internal.ui.JavaPluginImages;
+import org.eclipse.jdt.internal.ui.text.correction.UnresolvedElementsSubProcessor;
+import org.eclipse.jdt.internal.ui.text.correction.proposals.ASTRewriteCorrectionProposal;
+import org.eclipse.jdt.internal.ui.text.correction.proposals.NewMethodCorrectionProposal;
+import org.eclipse.jdt.ui.text.java.IInvocationContext;
+import org.eclipse.jdt.ui.text.java.IJavaCompletionProposal;
+import org.eclipse.jdt.ui.text.java.IProblemLocation;
+import org.eclipse.text.edits.TextEditGroup;
+import org.eclipse.objectteams.otdt.core.compiler.IOTConstants;
+import org.eclipse.objectteams.otdt.core.compiler.InferenceKind;
+import org.eclipse.objectteams.otdt.core.compiler.OTNameUtils;
+import org.eclipse.objectteams.otdt.core.compiler.Pair;
+import org.eclipse.objectteams.otdt.internal.ui.assist.OTQuickFixes;
+
+/**
+ * Quick-fix proposals for method mappings.
+ *
+ * @author stephan
+ * @since 1.1.2
+ */
+@SuppressWarnings("restriction")
+public class MappingProposalSubProcessor {
+
+ public static final String FAKETHIS = "$fakethis$"; //$NON-NLS-1$
+
+ @SuppressWarnings("unchecked") // arguments.add()
+ static IJavaCompletionProposal getChangeAssignmentToCalloutCallProposal(
+ ICompilationUnit cu,
+ TypeDeclaration enclosingType,
+ ASTNode selectedNode)
+ {
+ // find (fieldName x useThis)
+ Pair<SimpleName,Boolean> answer = findFieldName(selectedNode);
+ if (answer == null) return null;
+ char[] accessorName = OTNameUtils.accessorName(/*isSetter*/true,
+ answer.first.getIdentifier().toCharArray());
+
+ // find parent-assignment
+ ASTNode parent = selectedNode.getParent();
+ if (parent.getNodeType() != ASTNode.ASSIGNMENT)
+ return null;
+ Assignment assignment = (Assignment)parent;
+
+ // start rewriting
+ AST ast = selectedNode.getAST();
+ ASTRewrite rewrite = ASTRewrite.create(ast);
+
+ // create the call:
+ MethodInvocation send = ast.newMethodInvocation();
+ if (answer.second)
+ send.setExpression(ast.newThisExpression());
+ send.setName(ast.newSimpleName(String.valueOf(accessorName)));
+ send.arguments().add(ASTNode.copySubtree(ast, assignment.getRightHandSide()));
+
+ makeReplacement(rewrite, assignment, send);
+
+ // try to also materialize the inferred callout (using the same rewrite as to combine modifications):
+ IJavaCompletionProposal proposal = getMaterializeInferredCalloutToFieldProposal(cu, rewrite, selectedNode, enclosingType, InferenceKind.FIELDSET);
+ if (proposal != null)
+ return proposal;
+
+ // not materializing, propose the replacement, only:
+ return new ASTRewriteCorrectionProposal(
+ CorrectionMessages.OTQuickfix_change_assignment_to_settercall,
+ cu,
+ rewrite,
+ 10000, // TODO(SH)
+ JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE));
+ }
+
+ static IJavaCompletionProposal getChangeFieldReadToCalloutCallProposal(
+ ICompilationUnit cu,
+ TypeDeclaration enclosingType,
+ ASTNode selectedNode)
+ {
+ // find (fieldName x useThis)
+ Pair<SimpleName,Boolean> answer = findFieldName(selectedNode);
+ if (answer == null) return null;
+ char[] accessorName = OTNameUtils.accessorName(/*isSetter*/false,
+ answer.first.getIdentifier().toCharArray());
+
+ // start rewriting
+ AST ast = selectedNode.getAST();
+ ASTRewrite rewrite = ASTRewrite.create(ast);
+
+ // create the call:
+ MethodInvocation send = ast.newMethodInvocation();
+ if (answer.second)
+ send.setExpression(ast.newThisExpression());
+ send.setName(ast.newSimpleName(String.valueOf(accessorName)));
+
+ makeReplacement(rewrite, selectedNode, send);
+
+ // try to also materialize the inferred callout (using the same rewrite as to combine modifications):
+ IJavaCompletionProposal proposal = getMaterializeInferredCalloutToFieldProposal(cu, rewrite, selectedNode, enclosingType, InferenceKind.FIELDGET);
+ if (proposal != null)
+ return proposal;
+
+ // not materializing, propose the replacement, only:
+ return new ASTRewriteCorrectionProposal(
+ CorrectionMessages.OTQuickfix_change_fieldaccess_to_gettercall,
+ cu,
+ rewrite,
+ 10000, // TODO(SH)
+ JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE));
+ }
+
+ // answer: fieldName x useThis
+ private static Pair<SimpleName,Boolean> findFieldName(ASTNode selectedNode) {
+ switch (selectedNode.getNodeType()) {
+ case ASTNode.SIMPLE_NAME:
+ return new Pair<SimpleName,Boolean>((SimpleName)selectedNode, false);
+ case ASTNode.FIELD_ACCESS:
+ FieldAccess access = (FieldAccess) selectedNode;
+ if (access.getExpression().getNodeType() != ASTNode.THIS_EXPRESSION)
+ return null;
+ return new Pair<SimpleName,Boolean>(access.getName(), true);
+ default:
+ return null;
+ }
+ }
+ // add a replacement oldNode -> newNode to rewrite
+ private static void makeReplacement(ASTRewrite rewrite, ASTNode oldNode, ASTNode newNode)
+ {
+ ASTNode parent= oldNode.getParent();
+ StructuralPropertyDescriptor desc= oldNode.getLocationInParent();
+ if (desc.isChildListProperty()) {
+ ListRewrite listRewrite= rewrite.getListRewrite(parent, (ChildListPropertyDescriptor) desc);
+ listRewrite.replace(oldNode, newNode, null);
+ } else {
+ rewrite.set(parent, desc, newNode, null);
+ }
+ }
+
+ /** Abstract over different ways for identifying a role method. */
+ interface IMethodMemento {
+ boolean isEqualTo(IMethodBinding other);
+ }
+
+ // callout inferred from self-call
+ static ASTRewriteCorrectionProposal getMaterializeInferredCalloutSelfCallProposal(
+ ICompilationUnit cu,
+ TypeDeclaration enclosingType,
+ MethodInvocation selectedNode)
+ throws JavaModelException
+ {
+ final IMethodBinding resolvedMethod = selectedNode.resolveMethodBinding();
+ if (resolvedMethod == null) return null;
+ IMethodMemento memento = new IMethodMemento() {
+ public boolean isEqualTo(IMethodBinding other) {
+ return resolvedMethod.equals(other);
+ }
+ };
+ return getMaterializeInferredCalloutProposal(cu, null, enclosingType, memento, InferenceKind.SELFCALL);
+ }
+ // callout inferred from field access (get or set)
+ static ASTRewriteCorrectionProposal getMaterializeInferredCalloutToFieldProposal(
+ ICompilationUnit cu,
+ ASTRewrite rewrite,
+ ASTNode selectedNode,
+ TypeDeclaration enclosingType,
+ final InferenceKind kind)
+ {
+ // find (fieldName x useThis)
+ Pair<SimpleName,Boolean> answer = findFieldName(selectedNode);
+ if (answer == null) return null;
+ final String accessorName = String.valueOf(OTNameUtils.accessorName(kind == InferenceKind.FIELDSET, answer.first.getIdentifier().toCharArray()));
+ final ITypeBinding fieldType = answer.first.resolveTypeBinding();
+ IMethodMemento memento = new IMethodMemento() {
+ public boolean isEqualTo(IMethodBinding other) {
+ if (!accessorName.equals(other.getName()))
+ return false;
+ ITypeBinding returnType = other.getReturnType();
+ ITypeBinding[] params = other.getParameterTypes();
+ if (kind == InferenceKind.FIELDSET) {
+ // no return:
+ if (!Bindings.isVoidType(returnType)) return false;
+ // matching param type:
+ if (params.length != 1) return false;
+ return fieldType == null || params[0].equals(fieldType);
+ } else {
+ // matching return:
+ if (Bindings.isVoidType(returnType)) return false;
+ if (fieldType != null && !fieldType.equals(returnType)) return false;
+ // no params:
+ return params.length == 0;
+ }
+ }
+ };
+ return getMaterializeInferredCalloutProposal(cu, rewrite, enclosingType, memento, kind);
+ }
+ // callout inferred from self-call or field access - search for resolved callout binding.
+ static ASTRewriteCorrectionProposal getMaterializeInferredCalloutProposal(
+ ICompilationUnit cu,
+ ASTRewrite rewrite,
+ TypeDeclaration enclosingType,
+ IMethodMemento roleMethodMemento,
+ InferenceKind kind)
+ {
+ ITypeBinding declaringClass = enclosingType.resolveBinding(); //method.getDeclaringClass();
+ for (IMethodMappingBinding mapping : declaringClass.getResolvedMethodMappings())
+ if ( mapping != null // null if problem exists
+ && mapping.getInferenceKind() == kind
+ && roleMethodMemento.isEqualTo(mapping.getRoleMethod()))
+ return createMaterializeInferredCalloutProposal(
+ cu, rewrite, enclosingType, mapping, kind);
+
+ return null;
+ }
+
+ // callout inferred from self-call or field access:
+ static ASTRewriteCorrectionProposal createMaterializeInferredCalloutProposal(
+ ICompilationUnit cu,
+ ASTRewrite rewrite,
+ TypeDeclaration enclosingType,
+ IMethodMappingBinding mapping,
+ InferenceKind kind)
+ {
+ AST ast = enclosingType.getAST();
+ ImportRewrite imports;
+ try {
+ imports = StubUtility.createImportRewrite(cu, true);
+ } catch (JavaModelException jme) {
+ return null;
+ }
+ CalloutMappingDeclaration callout = createCalloutFromInferred(mapping, ast, imports, kind);
+
+ if (rewrite == null) // only provided by some clients
+ rewrite = ASTRewrite.create(ast);
+ rewrite.getListRewrite(enclosingType, BODY_DECLARATIONS_PROPERTY)
+ .insertFirst(callout, null);
+ String label = (kind == InferenceKind.SELFCALL)
+ ? CorrectionMessages.OTQuickfix_materialize_inferred_callout
+ : CorrectionMessages.OTQuickfix_materialize_inferred_callout_to_field;
+ ASTRewriteCorrectionProposal proposal = new ASTRewriteCorrectionProposal(
+ label,
+ cu,
+ rewrite,
+ 10000, // TODO(SH)
+ JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE));
+ proposal.setImportRewrite(imports);
+ return proposal;
+ }
+
+ // callouts inferred from inherited abstract methods:
+ static ASTRewriteCorrectionProposal getMaterializeInferredCalloutsInheritedProposal(
+ ICompilationUnit cu, TypeDeclaration enclosingType, ASTNode selectedNode)
+ throws JavaModelException
+ {
+ AST ast = enclosingType.getAST();
+ ASTRewrite rewrite = ASTRewrite.create(ast);
+ ListRewrite listRewrite= rewrite.getListRewrite(enclosingType, BODY_DECLARATIONS_PROPERTY);
+ ImportRewrite imports = StubUtility.createImportRewrite(cu, true);
+ boolean generated= false;
+
+ ITypeBinding type= (ITypeBinding)((SimpleName)selectedNode).resolveBinding();
+ for(IMethodMappingBinding mapping : type.getResolvedMethodMappings()) {
+ if (!mapping.isCallin()) {
+ if (mapping.getInferenceKind() == InferenceKind.INTERFACE) {
+ CalloutMappingDeclaration callout;
+ callout= createCalloutFromInferred(mapping, ast, imports, InferenceKind.INTERFACE);
+ listRewrite.insertFirst(callout, null);
+ generated= true;
+ }
+ }
+ }
+ if (generated) {
+ ASTRewriteCorrectionProposal proposal;
+ proposal= new ASTRewriteCorrectionProposal(CorrectionMessages.OTQuickfix_materialize_inferred_callouts,
+ cu,
+ rewrite,
+ 10000, // TODO(SH)
+ JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE));
+ proposal.setImportRewrite(imports);
+ return proposal;
+ }
+ return null;
+ }
+
+ // generate a callout declaration from a given binding:
+ static CalloutMappingDeclaration createCalloutFromInferred(
+ IMethodMappingBinding mapping, AST ast, ImportRewrite imports, InferenceKind kind)
+ {
+ CalloutMappingDeclaration callout = ast.newCalloutMappingDeclaration();
+ String[] argNames = mapping.getBaseArgumentNames(); // possibly adjusted for fieldset
+ IMethodBinding baseMethod = mapping.getBaseMethods()[0];
+ switch (kind) {
+ case INTERFACE:
+ case SELFCALL:
+ callout.setBaseMappingElement(
+ createMethodSpec(ast, imports, baseMethod, argNames));
+ break;
+ case FIELDSET:
+ {
+ String baseMethodName = baseMethod.getName();
+ int pos= baseMethodName.lastIndexOf('$');
+ String fieldName= baseMethodName.substring(pos+1);
+ ITypeBinding fieldType= baseMethod.getParameterTypes()[1];
+ callout.setBaseMappingElement(createFieldSpec(ast, imports, fieldName, fieldType));
+ callout.bindingOperator().setBindingModifier(Modifier.OT_SET_CALLOUT);
+ argNames= new String[] { fieldName };
+ break;
+ }
+ case FIELDGET:
+ {
+ String baseMethodName = baseMethod.getName();
+ int pos= baseMethodName.lastIndexOf('$');
+ String fieldName= baseMethodName.substring(pos+1);
+ ITypeBinding fieldType= baseMethod.getReturnType();
+ callout.setBaseMappingElement(createFieldSpec(ast, imports, fieldName, fieldType));
+ callout.bindingOperator().setBindingModifier(Modifier.OT_GET_CALLOUT);
+ break;
+ }
+ }
+
+ callout.setRoleMappingElement(
+ createMethodSpec(ast, imports, mapping.getRoleMethod(), argNames));
+
+ callout.setSignatureFlag(true);
+ return callout;
+ }
+
+ static MethodSpec createMethodSpec(AST ast, ImportRewrite imports, IMethodBinding methodBinding, String[] argNames)
+ {
+ List<SingleVariableDeclaration> args = new ArrayList<SingleVariableDeclaration>();
+ for (int i = 0; i < methodBinding.getParameterTypes().length; i++) {
+ ITypeBinding paramType = methodBinding.getParameterTypes()[i];
+ args.add(
+ ASTNodeCreator.createArgument(ast, 0/*modifiers*/,
+ imports.addImport(paramType, ast),
+ argNames[i],
+ 0 /*extraDimensions*/,
+ null));
+ }
+ ITypeBinding providedReturnType = methodBinding.getReturnType();
+ Type returnType = imports.addImport(providedReturnType, ast);
+ return ASTNodeCreator.createMethodSpec(ast,
+ methodBinding.getName(),
+ returnType,
+ args, true);
+ }
+
+ static FieldAccessSpec createFieldSpec(AST ast, ImportRewrite imports, String fieldName, ITypeBinding fieldType)
+ {
+ return ASTNodeCreator.createFieldAccSpec(ast,
+ fieldName,
+ imports.addImport(fieldType, ast));
+ }
+
+ @SuppressWarnings("unchecked") // handling AST-Lists
+ public static IJavaCompletionProposal addTypeParameterToCallin(ICompilationUnit cu,
+ ASTNode selectedNode,
+ TypeDeclaration enclosingType)
+ {
+ final String TYPE_VAR_NAME = "E"; //$NON-NLS-1$
+
+ if (selectedNode instanceof Name) {
+ MethodSpec roleSpec= (MethodSpec)ASTNodes.getParent(selectedNode, ASTNode.METHOD_SPEC);
+ ASTNode oldType = selectedNode.getParent();
+
+ // find the role method to perform the same change on it, too.
+ IMethodBinding roleMethod= roleSpec.resolveBinding();
+ MethodDeclaration roleMethodDecl= null;
+ for (MethodDeclaration method : enclosingType.getMethods()) {
+ if (method.resolveBinding() == roleMethod) {
+ Type returnType = method.getReturnType2();
+ if (returnType == null)
+ break;
+ if (returnType.isSimpleType()) {
+ Name typeName = ((SimpleType)returnType).getName();
+ if ("void".equals(typeName.getFullyQualifiedName())) //$NON-NLS-1$
+ break;
+ }
+ roleMethodDecl= method;
+ break;
+ }
+ }
+
+ AST ast = enclosingType.getAST();
+ ASTRewrite rewrite = ASTRewrite.create(ast);
+ TextEditGroup group= new TextEditGroup("adding parameter"); //$NON-NLS-1$
+ // create type parameter <E extends OriginalType>
+ TypeParameter typeParameter= ast.newTypeParameter();
+ typeParameter.setName(ast.newSimpleName(TYPE_VAR_NAME));
+ typeParameter.typeBounds().add(ASTNode.copySubtree(ast, oldType));
+ // add type parameter to role method spec
+ rewrite.getListRewrite(roleSpec, MethodSpec.TYPE_PARAMETERS_PROPERTY)
+ .insertFirst(typeParameter, group);
+ // change return type to type variable
+ rewrite.set(roleSpec, MethodSpec.RETURN_TYPE2_PROPERTY,
+ ast.newSimpleType(ast.newSimpleName(TYPE_VAR_NAME)),
+ group);
+
+ // the same changes also against the method declaration:
+ if (roleMethodDecl != null) {
+ rewrite.getListRewrite(roleMethodDecl, MethodDeclaration.TYPE_PARAMETERS_PROPERTY)
+ .insertFirst(ASTNode.copySubtree(ast, typeParameter), group);
+ rewrite.set(roleMethodDecl, MethodDeclaration.RETURN_TYPE2_PROPERTY,
+ ast.newSimpleType(ast.newSimpleName(TYPE_VAR_NAME)),
+ group);
+ }
+
+ return new ASTRewriteCorrectionProposal(CorrectionMessages.OTQuickfix_addtypeparametertocallin_label,
+ cu,
+ rewrite,
+ 10000, // TODO(SH)
+ JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE));
+ }
+ return null;
+ }
+
+ private static final String FAKED_METHOD = "$$faked$$"; //$NON-NLS-1$
+
+ /**
+ * Add proposals to create method for unresolved method spec.
+ * @param selectedNode the unresolved method spec
+ * @param enclosingType the enclosing role
+ * @param context invocation context as needed to find covering nodes
+ * @param problem the problem that triggered the assist
+ * @param proposals list of proposals to which to add the new proposal
+ * @throws CoreException if some compilation unit could not be found
+ */
+ @SuppressWarnings("unchecked")
+ public static void addUnresolvedMethodSpecProposals(ASTNode selectedNode,
+ TypeDeclaration enclosingType,
+ IInvocationContext context,
+ final IProblemLocation problem,
+ Collection proposals)
+ throws CoreException
+ {
+ // Note: this completion proposal needs to modify the ast in order to
+ // provide a MethodInvocation serving as a template for the proposal.
+ AST ast= selectedNode.getAST();
+
+ // left-over from previous attempt?
+ if (selectedNode instanceof MethodDeclaration) {
+ MethodDeclaration method= (MethodDeclaration)selectedNode;
+ if (method.getName().getIdentifier().equals(FAKED_METHOD)) {
+ // yes, remove it:
+ int flags= enclosingType.getFlags();
+ if ((flags & ASTNode.PROTECT) != 0)
+ enclosingType.setFlags(flags & ~ASTNode.PROTECT);
+ enclosingType.bodyDeclarations().remove(method);
+ selectedNode= problem.getCoveringNode(context.getASTRoot());
+ }
+ }
+ while (selectedNode.getNodeType() != ASTNode.METHOD_SPEC) {
+ selectedNode = selectedNode.getParent();
+ if (selectedNode == null)
+ return;
+ }
+
+ MethodSpec methodSpec= (MethodSpec)selectedNode;
+ // construct a faked problem location:
+ // a new method:
+ MethodDeclaration fakeMethod= ast.newMethodDeclaration();
+ fakeMethod.setName(ast.newSimpleName(FAKED_METHOD));
+ {
+ ASTNode mapping= methodSpec.getParent();
+ fakeMethod.setSourceRange(mapping.getStartPosition(), mapping.getLength());
+ }
+ // a new method invocation:
+ MethodInvocation invoc= ast.newMethodInvocation();
+ invoc.setSourceRange(methodSpec.getStartPosition(), methodSpec.getLength());
+ // receiver:
+ StructuralPropertyDescriptor locationInParent = methodSpec.getLocationInParent();
+ if ( locationInParent == CalloutMappingDeclaration.BASE_MAPPING_ELEMENT_PROPERTY
+ || locationInParent == CallinMappingDeclaration.BASE_MAPPING_ELEMENTS_PROPERTY)
+ {
+ if (enclosingType.getNodeType() == ASTNode.ROLE_TYPE_DECLARATION) {
+ // create a receiver of the baseclass type:
+ Type baseType = ((RoleTypeDeclaration)enclosingType).getBaseClassType();
+ invoc.setExpression(ast.newResolvedVariableName(new String(IOTConstants._OT_BASE_ARG), baseType));
+ }
+ } else {
+ // using an explicit this-typed receiver avoids proposal to define method in the enclosing team:
+ invoc.setExpression(ast.newResolvedVariableName(FAKETHIS, enclosingType));
+ }
+ // final for the IProblemLocation-adaptor below:
+ final SimpleName selector = (SimpleName)ASTNode.copySubtree(ast, methodSpec.getName());
+ selector.setSourceRange(methodSpec.getName().getStartPosition(), methodSpec.getName().getLength());
+ invoc.setName(selector);
+ // set args/parameters for both:
+ for (Object elem : methodSpec.parameters()) {
+ SingleVariableDeclaration param= (SingleVariableDeclaration)elem;
+ fakeMethod.parameters().add(ASTNode.copySubtree(ast, param));
+ invoc.arguments().add(ast.newSimpleName(param.getName().getIdentifier()));
+ }
+ // assemble and add to type:
+ fakeMethod.setBody(ast.newBlock());
+ fakeMethod.getBody().statements().add(ast.newExpressionStatement(invoc));
+ int flags= enclosingType.getFlags();
+ if ((flags & ASTNode.PROTECT) != 0)
+ enclosingType.setFlags(flags & ~ASTNode.PROTECT);
+ enclosingType.bodyDeclarations().add(fakeMethod);
+ enclosingType.setFlags(flags);
+
+ // wrap the problem:
+ IProblemLocation newProblem= new IProblemLocation() {
+ public ASTNode getCoveredNode(CompilationUnit astRoot) { return selector; }
+ public ASTNode getCoveringNode(CompilationUnit astRoot) { return selector; }
+ public int getLength() { return selector.getLength(); }
+ public String getMarkerType() { return problem.getMarkerType(); }
+ public int getOffset() { return selector.getStartPosition(); }
+ public String[] getProblemArguments() { return problem.getProblemArguments(); }
+ public int getProblemId() { return problem.getProblemId(); }
+ public boolean isError() { return true;}
+ };
+
+ UnresolvedElementsSubProcessor.getMethodProposals(context,
+ newProblem,
+ problem.getProblemId() == IProblem.DifferentParamInCallinMethodSpec,
+ proposals);
+
+ // parameters may have been set to Object, because types could not be resolved.
+ // adjust these from the original method spec now:
+ for (Object proposal : proposals) {
+ if (proposal instanceof NewMethodCorrectionProposal) {
+ NewMethodCorrectionProposal methodProposal = (NewMethodCorrectionProposal)proposal;
+ OTQuickFixes.instance().registerNewMethodCorrectionProposal(methodSpec, methodProposal);
+ methodProposal.setDisplayName(updateDisplayName(methodSpec, methodProposal.getDisplayString()));
+ }
+ }
+ }
+ /** Replace the parameter part in a display name with types from the MethodSpec */
+ @SuppressWarnings("unchecked") // methodSpec.parameters is raw type
+ private static String updateDisplayName(MethodSpec methodSpec, String displayString) {
+ String head= displayString.substring(0, displayString.indexOf('(')+1);
+ String tail= displayString.substring(displayString.indexOf(')'));
+ StringBuffer buf= new StringBuffer(head);
+ List parameters= methodSpec.parameters();
+ String sep=""; //$NON-NLS-1$
+ for (int i=0; i<parameters.size(); i++) {
+ buf.append(sep);
+ SingleVariableDeclaration arg= (SingleVariableDeclaration)parameters.get(i);
+ buf.append(arg.getType().toString());
+ sep= ", "; //$NON-NLS-1$
+ }
+ buf.append(tail);
+ return buf.toString();
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/text/correction/PrecedenceProposalSubProcessor.java b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/text/correction/PrecedenceProposalSubProcessor.java
new file mode 100644
index 000000000..6d07e92e6
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/text/correction/PrecedenceProposalSubProcessor.java
@@ -0,0 +1,359 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2006, 2007 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: PrecedenceProposalSubProcessor.java 23438 2010-02-04 20:05:24Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.text.correction;
+
+import java.util.List;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.Signature;
+import org.eclipse.jdt.core.dom.AST;
+import org.eclipse.jdt.core.dom.ASTNode;
+import org.eclipse.jdt.core.dom.ASTParser;
+import org.eclipse.jdt.core.dom.CallinMappingDeclaration;
+import org.eclipse.jdt.core.dom.ChildListPropertyDescriptor;
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jdt.core.dom.IMethodMappingBinding;
+import org.eclipse.jdt.core.dom.Name;
+import org.eclipse.jdt.core.dom.PrecedenceDeclaration;
+import org.eclipse.jdt.core.dom.RoleTypeDeclaration;
+import org.eclipse.jdt.core.dom.SimpleName;
+import org.eclipse.jdt.core.dom.TypeDeclaration;
+import org.eclipse.jdt.core.dom.rewrite.ASTRewrite;
+import org.eclipse.jdt.core.dom.rewrite.ITrackedNodePosition;
+import org.eclipse.jdt.core.dom.rewrite.ListRewrite;
+import org.eclipse.jdt.core.dom.NodeFinder;
+import org.eclipse.jdt.internal.corext.fix.LinkedProposalModel;
+import org.eclipse.jdt.internal.corext.fix.LinkedProposalPositionGroup;
+import org.eclipse.jdt.internal.corext.util.Messages;
+import org.eclipse.jdt.internal.ui.text.correction.proposals.LinkedCorrectionProposal;
+import org.eclipse.jdt.ui.text.java.IJavaCompletionProposal;
+import org.eclipse.jface.text.link.LinkedModeModel;
+import org.eclipse.jface.text.link.LinkedPosition;
+import org.eclipse.objectteams.otdt.internal.ui.assist.LinkedModeAdaptor;
+import org.eclipse.objectteams.otdt.ui.ImageConstants;
+import org.eclipse.objectteams.otdt.ui.ImageManager;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.text.edits.TextEdit;
+
+@SuppressWarnings("restriction")
+public class PrecedenceProposalSubProcessor {
+
+ /** This linked proposal mimics a menu: support swapping of the elements of a precedence decl.
+ */
+ class SwapPrecedencesProposal extends LinkedProposalPositionGroup.Proposal {
+
+ public SwapPrecedencesProposal() {
+ super(Messages.format(CorrectionMessages.OTQuickfix_swapprecedenceorder_label, null),
+ null, 0);
+ }
+
+ @Override
+ public String getAdditionalProposalInfo() {
+ return Messages.format(CorrectionMessages.OTQuickfix_swapprecedenceorder_description, null);
+ }
+
+ @Override
+ public TextEdit computeEdits(int offset,
+ LinkedPosition position,
+ char trigger,
+ int stateMask,
+ LinkedModeModel model)
+ throws CoreException
+ {
+ // leave linked mode, since this rewrite would require re-wiring which is not possible.
+ try {
+ if (!LinkedModeAdaptor.instance.leaveLinkedMode())
+ return null; // broken assumption, continuing would probably mess up positions.
+ } catch (NullPointerException npe) {
+ return null; // no adaptor installed
+ }
+
+ // get a fresh AST:
+ ASTParser p = ASTParser.newParser(AST.JLS3);
+ p.setSource(cu);
+ p.setResolveBindings(false);
+ p.setFocalPosition(offset);
+ CompilationUnit astCU = (CompilationUnit) p.createAST(null);
+ ast = astCU.getAST();
+
+ // find precedence declaration at 'offset'
+ ASTNode node = NodeFinder.perform(astCU, offset, 1);
+ PrecedenceDeclaration prec = (PrecedenceDeclaration)node;
+
+ try
+ {
+ // rewrite:
+ rewrite = ASTRewrite.create(ast);
+ ListRewrite listRewrite = rewrite.getListRewrite(prec, PrecedenceDeclaration.ELEMENTS_PROPERTY);
+ SimpleName n1 = (SimpleName)prec.elements().get(0);
+ listRewrite.remove(n1, null);
+ listRewrite.insertLast(ast.newSimpleName(n1.getIdentifier()), null);
+ return rewrite.rewriteAST();
+ } catch (Throwable e) {
+ // cannot log or: e.printStackTrace();
+ }
+ return null;
+ }
+ }
+
+ // Make one more method visible:
+ class MyLinkedCorrectionProposal extends LinkedCorrectionProposal {
+ public MyLinkedCorrectionProposal(String name, ICompilationUnit cu,
+ ASTRewrite rewrite, int relevance, Image image) {
+ super(name, cu, rewrite, relevance, image);
+ }
+
+ @Override
+ public LinkedProposalModel getLinkedProposalModel() {
+ return super.getLinkedProposalModel();
+ }
+ }
+
+ final static String KEY_PRECEDENCE = "precedence"; //$NON-NLS-1$
+ final static String KEY_LABEL1 = "label1"; //$NON-NLS-1$
+ final static String KEY_LABEL2 = "label2"; //$NON-NLS-1$
+
+ ICompilationUnit cu;
+ ASTNode focusNode;
+ AST ast;
+ ASTRewrite rewrite;
+ public PrecedenceProposalSubProcessor(ICompilationUnit cu, ASTNode focusNode) {
+ this.cu = cu;
+ this.focusNode = focusNode;
+ }
+
+ /**
+ * Add a proposal in add callin labels as needed and a binding based precedence declaration
+ * to the enclosing role.
+ *
+ * @param roleType the enclosing role
+ * @param problemArguments elements 0 and 2 contain the names of two roles,
+ * elements 1 and 3 contain names of callin bindings.
+ * @return
+ */
+ IJavaCompletionProposal getAddBindingPrecedenceProposal(TypeDeclaration roleType,
+ String[] problemArguments)
+ {
+ this.ast = focusNode.getAST();
+ this.rewrite = ASTRewrite.create(ast);
+
+ Name name1 = null;
+ Name name2 = null;
+ String callin1 = problemArguments[1];
+ String callin2 = problemArguments[3];
+ CallinMappingDeclaration mapping1 = findCallinMapping(roleType, callin1);
+ CallinMappingDeclaration mapping2 = findCallinMapping(roleType, callin2);
+
+ if (callin1.charAt(0) == '<') {
+ if (mapping1 != null) { // TODO(SH):lookup across CUs?
+ callin1 = "callin1"; //$NON-NLS-1$
+ name1 = this.ast.newSimpleName(callin1);
+ }
+ }
+ if (callin2.charAt(0) == '<') {
+ if (mapping2 != null) { // TODO(SH):lookup across CUs?
+ callin2 = "callin2"; //$NON-NLS-1$
+ name2 = this.ast.newSimpleName(callin2);
+ }
+ }
+ if (callin1.charAt(0) == '<' || callin2.charAt(0) == '<')
+ return null; // inserting names doesn't succeed
+
+ if (!problemArguments[0].equals(problemArguments[2]))
+ return null; // different roles, need to insert precedence into the team.
+
+ LinkedCorrectionProposal proposal = getPrecedenceProposal(roleType,
+ Messages.format(CorrectionMessages.OTQuickfix_addbindingprecedence_description,
+ new String[]{roleType.getName().getIdentifier()}),
+ callin1, callin2,
+ name1 != null, name2 != null);
+
+ // create new, editable labels (linked to their mentioning within the precedence declaration):
+ if (name2 != null) { // add to front:
+ this.rewrite.set(mapping2, CallinMappingDeclaration.NAME_PROPERTY, name2, null);
+ proposal.addLinkedPosition(this.rewrite.track(name2), true, KEY_LABEL2);
+ }
+ if (name1 != null) { // even more to front:
+ this.rewrite.set(mapping1, CallinMappingDeclaration.NAME_PROPERTY, name1, null);
+ proposal.addLinkedPosition(this.rewrite.track(name1), true, KEY_LABEL1);
+ }
+
+ return proposal;
+ }
+
+ /**
+ * Create a proposal to add a binding-based precedence declaration to the enclosing team.
+ *
+ * @param teamType the enclosing team.
+ * @param problemArguments elements 0 and 2 contain the names of two roles,
+ * elements 1 and 3 contain names of callin bindings.
+ * @return
+ */
+ IJavaCompletionProposal getAddBindingPrecedenceToTeamProposal(TypeDeclaration teamType,
+ String[] problemArguments)
+ {
+
+ String callin1 = problemArguments[1];
+ String callin2 = problemArguments[3];
+ if (callin1.charAt(0) == '<' || callin2.charAt(0) == '<')
+ return null; // unnamed callin -- would need to insert names first.
+
+ this.ast = focusNode.getAST();
+ this.rewrite = ASTRewrite.create(ast);
+
+ return getPrecedenceProposal(teamType,
+ Messages.format(CorrectionMessages.OTQuickfix_addbindingprecedence_description,
+ new String[]{teamType.getName().getIdentifier()}),
+ Signature.getSimpleName(problemArguments[0])+"."+callin1, //$NON-NLS-1$
+ Signature.getSimpleName(problemArguments[2])+"."+callin2, //$NON-NLS-1$
+ false, false /* don't link labels */);
+ }
+
+ /**
+ * Create a proposal to add a class-based precedence declaration to the enclosing team.
+ *
+ * @param teamType the enclosing team
+ * @param problemArguments elements 0 and 2 contain the names of two roles
+ * @return the new proposal
+ */
+ IJavaCompletionProposal getAddRolePrecedenceToTeamProposal(TypeDeclaration teamType,
+ String[] problemArguments)
+ {
+ if (problemArguments[0].equals(problemArguments[2]))
+ return null; // same role, can't use role to discriminate
+
+ this.ast = focusNode.getAST();
+ this.rewrite = ASTRewrite.create(ast);
+
+ return getPrecedenceProposal(teamType,
+ Messages.format(CorrectionMessages.OTQuickfix_addroleprecedence_description,
+ new String[]{teamType.getName().getIdentifier()}),
+ Signature.getSimpleName(problemArguments[0]),
+ Signature.getSimpleName(problemArguments[2]),
+ false, false /* don't link labels */);
+ }
+
+ /**
+ * Create the edits for a new precedence declaration.
+ * Also add the option to swap the order.
+ * If 'useFullStringAlternatives' is true, the two alternatives
+ * are provided as two strings comprising a full precedence declaration each.
+ * Otherwise the keyword 'precedence' is used as an anchor for a "menu"
+ * showing one option: "> Swap Order".
+ *
+ * @param targetType
+ * @param label display label for this proposal.
+ * @param callin1 name of one callin binding
+ * @param callin2 name of the other callin binding
+ * @param useFullStringAlternatives who to support setting the precedence order.
+ * @return the proposal
+ */
+ @SuppressWarnings("unchecked")
+ private LinkedCorrectionProposal getPrecedenceProposal(TypeDeclaration targetType,
+ String label,
+ String callin1,
+ String callin2,
+ boolean linkLabel1,
+ boolean linkLabel2)
+ {
+ ChildListPropertyDescriptor precedenceProperty;
+ if (targetType instanceof RoleTypeDeclaration)
+ precedenceProperty = RoleTypeDeclaration.PRECEDENCE_PROPERTY;
+ else
+ precedenceProperty = TypeDeclaration.PRECEDENCE_PROPERTY;
+ ListRewrite listRewrite = this.rewrite.getListRewrite(targetType, precedenceProperty);
+ PrecedenceDeclaration newPrecedence = ast.newPrecedenceDeclaration();
+ Name element1 = ast.newName(callin1);
+ Name element2 = ast.newName(callin2);
+ newPrecedence.elements().add(element1);
+ newPrecedence.elements().add(element2);
+ listRewrite.insertLast(newPrecedence, null);
+ MyLinkedCorrectionProposal proposal = new MyLinkedCorrectionProposal(
+ label,
+ this.cu,
+ this.rewrite,
+ 10,
+ ImageManager.getSharedInstance().get(ImageConstants.CALLINBINDING_REPLACE_IMG));
+
+ if (callin1 != null && callin2 != null)
+ {
+ if (!linkLabel1 && !linkLabel2)
+ {
+ // setup two alternatives (different order):
+ proposal.addLinkedPosition(this.rewrite.track(newPrecedence), false, KEY_PRECEDENCE);
+ proposal.addLinkedPositionProposal(KEY_PRECEDENCE,
+ "precedence "+callin1+", "+callin2+";",//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ null);
+ proposal.addLinkedPositionProposal(KEY_PRECEDENCE,
+ "precedence "+callin2+", "+callin1+";", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ null);
+ }
+ else
+ {
+ // setup a "menu":
+ final ITrackedNodePosition precedencePosition = this.rewrite.track(newPrecedence);
+ ITrackedNodePosition swapPosition = new ITrackedNodePosition() {
+ public int getLength() {
+ return "precedence".length(); //$NON-NLS-1$
+ }
+ public int getStartPosition() {
+ return precedencePosition.getStartPosition();
+ }
+ };
+ proposal.addLinkedPosition(swapPosition, false, KEY_PRECEDENCE);
+ LinkedProposalPositionGroup positionGroup= proposal.getLinkedProposalModel().getPositionGroup(KEY_PRECEDENCE, true);
+ positionGroup.addProposal(new StringLinkedModeProposal(
+ CorrectionMessages.OTQuickfix_swapordermenu_label,
+ CorrectionMessages.OTQuickfix_swapordermenu_description));
+ positionGroup.addProposal(new SwapPrecedencesProposal());
+
+ // prepare elements of this precedence to be linked with the (editable) callin labels.
+ if (linkLabel1)
+ proposal.addLinkedPosition(this.rewrite.track(element1), false, KEY_LABEL1);
+ if (linkLabel2)
+ proposal.addLinkedPosition(this.rewrite.track(element2), false, KEY_LABEL2);
+ }
+ }
+ return proposal;
+ }
+
+
+ @SuppressWarnings("unchecked") // uses parameterless list of DOM AST.
+ private static CallinMappingDeclaration findCallinMapping(TypeDeclaration roleType, String callinName)
+ {
+ boolean isAnonymous = callinName.charAt(0) == '<';
+ List members = roleType.bodyDeclarations();
+ if (members != null) {
+ for (Object object : members) {
+ if (object instanceof CallinMappingDeclaration) {
+ CallinMappingDeclaration mapping = (CallinMappingDeclaration)object;
+ if (mapping.getName() != null) {
+ if (mapping.getName().getIdentifier().equals(callinName))
+ return mapping;
+ } else if (isAnonymous) {
+ IMethodMappingBinding binding = mapping.resolveBinding();
+ String currentName = binding.getName();
+ if (currentName.startsWith(callinName)) // binding name comprises the full declaration
+ return mapping;
+ }
+ }
+ }
+ }
+ return null;
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/text/correction/QuickFixProcessor.java b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/text/correction/QuickFixProcessor.java
new file mode 100644
index 000000000..1c4af62fd
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/text/correction/QuickFixProcessor.java
@@ -0,0 +1,506 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2006, 2007 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: QuickFixProcessor.java 23438 2010-02-04 20:05:24Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.text.correction;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.compiler.IProblem;
+import org.eclipse.jdt.core.dom.AST;
+import org.eclipse.jdt.core.dom.ASTNode;
+import org.eclipse.jdt.core.dom.AbstractMethodMappingDeclaration;
+import org.eclipse.jdt.core.dom.ArrayType;
+import org.eclipse.jdt.core.dom.CallinMappingDeclaration;
+import org.eclipse.jdt.core.dom.CalloutMappingDeclaration;
+import org.eclipse.jdt.core.dom.IMethodBinding;
+import org.eclipse.jdt.core.dom.ITypeBinding;
+import org.eclipse.jdt.core.dom.MethodDeclaration;
+import org.eclipse.jdt.core.dom.MethodInvocation;
+import org.eclipse.jdt.core.dom.MethodSpec;
+import org.eclipse.jdt.core.dom.Modifier;
+import org.eclipse.jdt.core.dom.Name;
+import org.eclipse.jdt.core.dom.ParameterizedType;
+import org.eclipse.jdt.core.dom.QualifiedName;
+import org.eclipse.jdt.core.dom.QualifiedType;
+import org.eclipse.jdt.core.dom.RoleTypeDeclaration;
+import org.eclipse.jdt.core.dom.SimpleName;
+import org.eclipse.jdt.core.dom.SimpleType;
+import org.eclipse.jdt.core.dom.SingleVariableDeclaration;
+import org.eclipse.jdt.core.dom.Type;
+import org.eclipse.jdt.core.dom.TypeDeclaration;
+import org.eclipse.jdt.core.dom.VariableDeclarationStatement;
+import org.eclipse.jdt.core.dom.rewrite.ASTRewrite;
+import org.eclipse.jdt.internal.corext.util.Messages;
+import org.eclipse.jdt.internal.ui.JavaPluginImages;
+import org.eclipse.jdt.internal.ui.text.correction.ASTResolving;
+import org.eclipse.jdt.internal.ui.text.correction.ModifierCorrectionSubProcessor;
+import org.eclipse.jdt.internal.ui.text.correction.proposals.ASTRewriteCorrectionProposal;
+import org.eclipse.jdt.ui.text.java.IInvocationContext;
+import org.eclipse.jdt.ui.text.java.IJavaCompletionProposal;
+import org.eclipse.jdt.ui.text.java.IProblemLocation;
+import org.eclipse.jdt.ui.text.java.IQuickFixProcessor;
+import org.eclipse.objectteams.otdt.internal.ui.assist.OTQuickFixes;
+
+/**
+ * Processor for OT/J-specific quickfixes, which mostly delegates to specific sub-processors:
+ * - ChangeModifierProposalSubProcessor
+ * - PrecedenceProposalSubProcessor
+ *
+ * Some structures borrow ideas from org.eclipse.jdt.internal.ui.text.corrections.QuickFixProcessor
+ *
+ * @author stephan
+ */
+@SuppressWarnings("restriction")
+public class QuickFixProcessor implements IQuickFixProcessor {
+
+
+
+ public boolean hasCorrections(ICompilationUnit unit, int problemId) {
+ switch (problemId) {
+// import:
+ case IProblem.RegularlyImportedBaseclass:
+ case IProblem.QualifiedReferenceToBaseclass:
+// roles:
+ case IProblem.MissingTeamForRoleWithMembers:
+ case IProblem.IllegalModifierForRole:
+ case IProblem.ReducingRoleVisibility:
+ case IProblem.AbstractRelevantRole:
+ case IProblem.AbstractPotentiallyRelevantRole:
+ case IProblem.MissingAnchorForRoleType:
+ case IProblem.MissingOverrideAnnotationForRole:
+// general method mappings:
+ case IProblem.DifferentParamInCallinMethodSpec:
+ case IProblem.UnresolvedCallinMethodSpec:
+ case IProblem.UnresolvedCalloutMethodSpec:
+// callout:
+ case IProblem.RegularCalloutOverrides:
+ case IProblem.AbstractMethodBoundAsOverride:
+// callins:
+ case IProblem.ReplaceMappingToNonCallin:
+ case IProblem.CallinMethodBoundNonReplace:
+ case IProblem.RegularOverridesCallin:
+ case IProblem.CallinOverridesRegular:
+ case IProblem.CallinIncompatibleStatic:
+ case IProblem.ReplaceCallinIncompatibleStatic:
+ case IProblem.CallinReplaceKeyWordNotOptional:
+ case IProblem.UnknownPrecedence:
+ case IProblem.CovariantReturnRequiresTypeParameter:
+// externalized roles and visibility:
+ case IProblem.DeprecatedPathSyntax:
+ case IProblem.AnchorNotFinal:
+ case IProblem.AnchorPathNotFinal:
+ case IProblem.ExternalizedCallToNonPublicConstructor:
+ case IProblem.ExternalizedCallToNonPublicMethod:
+ case IProblem.NotVisibleRoleMethod:
+ case IProblem.TSubMethodReducesVisibility:
+// inferred callouts:
+ case IProblem.UsingCalloutToFieldForFieldRead:
+ case IProblem.UsingCalloutToFieldForAssignment:
+ case IProblem.UsingInferredCalloutForMessageSend:
+ case IProblem.AddingInferredCalloutForInherited:
+ return true;
+// javadoc:
+ case IProblem.JavadocMissingRoleTag:
+ return true;
+ }
+ return false;
+ }
+
+ public IJavaCompletionProposal[] getCorrections(IInvocationContext context,
+ IProblemLocation[] locations)
+ throws CoreException
+ {
+ if (locations == null || locations.length == 0) {
+ return null;
+ }
+
+ HashSet<Integer> handledProblems= new HashSet<Integer>(locations.length);
+ ArrayList<IJavaCompletionProposal> resultingCollections= new ArrayList<IJavaCompletionProposal>();
+ for (int i= 0; i < locations.length; i++) {
+ IProblemLocation curr= locations[i];
+ Integer id= new Integer(curr.getProblemId());
+ if (handledProblems.add(id)) {
+ process(context, curr, resultingCollections);
+ }
+ }
+ return resultingCollections.toArray(new IJavaCompletionProposal[resultingCollections.size()]);
+
+ }
+
+ private void process(IInvocationContext context, IProblemLocation problem, Collection<IJavaCompletionProposal> proposals) throws CoreException {
+ int id= problem.getProblemId();
+ if (id == 0) { // no proposals for none-problem locations
+ return;
+ }
+ ICompilationUnit cu= context.getCompilationUnit();
+ ASTNode selectedNode= problem.getCoveringNode(context.getASTRoot());
+ if (selectedNode == null)
+ return;
+
+ ASTNode enclosingType= ASTResolving.findParentType(selectedNode);
+ TypeDeclaration parentType= null;
+ try {
+ if (enclosingType != null)
+ parentType = (TypeDeclaration)ASTResolving.findParentType(enclosingType.getParent());
+ } catch (ClassCastException cce) { /* just no success */ }
+ CallinMappingDeclaration callinMapping;
+ CalloutMappingDeclaration calloutMapping;
+ IJavaCompletionProposal javaProposal= null;
+ try {
+ switch (id) {
+// imports:
+ case IProblem.RegularlyImportedBaseclass:
+
+ javaProposal = TypeProposalSubProcessor.getMakeImportBase(selectedNode, cu);
+ break;
+ case IProblem.QualifiedReferenceToBaseclass:
+ javaProposal = TypeProposalSubProcessor.getImportBaseclass(selectedNode, cu);
+ break;
+// team modifiers:
+ case IProblem.MissingTeamForRoleWithMembers:
+ if (parentType != null && parentType instanceof RoleTypeDeclaration)
+ proposals.add(ChangeModifierProposalSubProcessor
+ .getMakeTypeTeamProposal(cu, (RoleTypeDeclaration) parentType, 5));
+ break;
+ case IProblem.AbstractRelevantRole:
+ case IProblem.AbstractPotentiallyRelevantRole:
+ if (parentType != null)
+ proposals.add(ChangeModifierProposalSubProcessor
+ .getMakeTypeAbstractProposal(cu, parentType, 8));
+ break;
+// role modifiers:
+ case IProblem.IllegalModifierForRole:
+ if (enclosingType instanceof RoleTypeDeclaration) {
+ RoleTypeDeclaration roleTypeDecl = (RoleTypeDeclaration)enclosingType;
+ proposals.add(ChangeModifierProposalSubProcessor
+ .getChangeRoleVisibilityProposal(cu, roleTypeDecl, Modifier.PROTECTED));
+ proposals.add(ChangeModifierProposalSubProcessor
+ .getChangeRoleVisibilityProposal(cu, roleTypeDecl, Modifier.PUBLIC));
+ }
+ break;
+ case IProblem.ReducingRoleVisibility:
+ if (enclosingType instanceof RoleTypeDeclaration) {
+ RoleTypeDeclaration roleTypeDecl = (RoleTypeDeclaration)enclosingType;
+ ITypeBinding[] tsupers = roleTypeDecl.resolveBinding().getSuperRoles();
+ if (tsupers == null || tsupers.length == 0)
+ break;
+ int inheritedModifiers = tsupers[0].getModifiers() & ChangeModifierProposalSubProcessor.VISIBILITY_MASK;
+ proposals.add(ChangeModifierProposalSubProcessor
+ .getChangeRoleVisibilityProposal(cu, roleTypeDecl, inheritedModifiers));
+ }
+ break;
+ case IProblem.MissingOverrideAnnotationForRole:
+ // use original from ModifierCorrectionSubProcessor with adaptations:
+ OTQuickFixes.instance().addOverrideAnnotationProposal(context, problem, proposals);
+ break;
+// general method mappings:
+ case IProblem.DifferentParamInCallinMethodSpec:
+ case IProblem.UnresolvedCallinMethodSpec:
+ case IProblem.UnresolvedCalloutMethodSpec:
+ MappingProposalSubProcessor.addUnresolvedMethodSpecProposals(selectedNode,
+ (TypeDeclaration)enclosingType,
+ context,
+ problem,
+ proposals);
+ break;
+// callout related:
+ case IProblem.RegularCalloutOverrides:
+ calloutMapping = (CalloutMappingDeclaration)getEnclosingMethodMapping(selectedNode);
+ if (calloutMapping != null)
+ proposals.add(ChangeModifierProposalSubProcessor.getChangeCalloutKindProposal(cu, calloutMapping, true/*toOverride*/));
+ break;
+ case IProblem.AbstractMethodBoundAsOverride:
+ calloutMapping = (CalloutMappingDeclaration)getEnclosingMethodMapping(selectedNode);
+ if (calloutMapping != null)
+ proposals.add(ChangeModifierProposalSubProcessor.getChangeCalloutKindProposal(cu, calloutMapping, false/*toOverride*/));
+ break;
+// callin related:
+ case IProblem.ReplaceMappingToNonCallin:
+ callinMapping = (CallinMappingDeclaration)getEnclosingMethodMapping(selectedNode);
+ if (callinMapping != null) {
+ IMethodBinding roleMethod = ((MethodSpec)callinMapping.getRoleMappingElement()).resolveBinding();
+ proposals.add(ChangeModifierProposalSubProcessor
+ .getChangeMethodModifierProposal(context, null, roleMethod,
+ Modifier.OT_CALLIN, true));
+ proposals.add(ChangeModifierProposalSubProcessor
+ .getAddOrChangeCallinModifierProposal(cu, callinMapping));
+ }
+ break;
+ case IProblem.CallinMethodBoundNonReplace:
+ callinMapping = (CallinMappingDeclaration)getEnclosingMethodMapping(selectedNode);
+ if (callinMapping != null) {
+ IMethodBinding roleMethod = ((MethodSpec)callinMapping.getRoleMappingElement()).resolveBinding();
+ proposals.add(ChangeModifierProposalSubProcessor
+ .getChangeMethodModifierProposal(context, null, roleMethod,
+ Modifier.OT_CALLIN, false));
+ proposals.add(ChangeModifierProposalSubProcessor
+ .getAddOrChangeCallinModifierProposal(cu, callinMapping));
+ }
+ break;
+ case IProblem.RegularOverridesCallin:
+ if (selectedNode instanceof MethodDeclaration)
+ proposals.add(ChangeModifierProposalSubProcessor
+ .getChangeMethodModifierProposal(context, (MethodDeclaration)selectedNode, null,
+ Modifier.OT_CALLIN, true));
+ break;
+ case IProblem.CallinOverridesRegular:
+ if (selectedNode instanceof MethodDeclaration)
+ proposals.add(ChangeModifierProposalSubProcessor
+ .getChangeMethodModifierProposal(context, (MethodDeclaration)selectedNode, null,
+ Modifier.OT_CALLIN, false));
+ break;
+ case IProblem.CallinIncompatibleStatic:
+ callinMapping = (CallinMappingDeclaration)getEnclosingMethodMapping(selectedNode);
+ if (callinMapping != null) {
+ MethodSpec roleMSpec = (MethodSpec)callinMapping.getRoleMappingElement();
+ proposals.add(ChangeModifierProposalSubProcessor
+ .getChangeMethodModifierProposal(context, null, roleMSpec.resolveBinding(),
+ Modifier.STATIC, true));
+ }
+ break;
+ case IProblem.ReplaceCallinIncompatibleStatic:
+ callinMapping = (CallinMappingDeclaration)getEnclosingMethodMapping(selectedNode);
+ if (callinMapping != null) {
+ MethodSpec roleMSpec = (MethodSpec)callinMapping.getRoleMappingElement();
+ proposals.add(ChangeModifierProposalSubProcessor
+ .getChangeMethodModifierProposal(context, null, roleMSpec.resolveBinding(),
+ Modifier.STATIC, false));
+ }
+ break;
+ case IProblem.CallinReplaceKeyWordNotOptional:
+ callinMapping = (CallinMappingDeclaration)getEnclosingMethodMapping(selectedNode);
+ if (callinMapping != null) {
+ proposals.add(ChangeModifierProposalSubProcessor
+ .getAddOrChangeCallinModifierProposal(cu, callinMapping));
+ }
+ break;
+ case IProblem.UnknownPrecedence:
+ if (enclosingType != null) {
+ IJavaCompletionProposal proposal;
+ PrecedenceProposalSubProcessor processor = new PrecedenceProposalSubProcessor(cu, enclosingType);
+ proposal = processor.getAddBindingPrecedenceProposal((TypeDeclaration)enclosingType, problem.getProblemArguments());
+ if (proposal != null)
+ proposals.add(proposal);
+ if (parentType != null) {
+ proposal = processor.getAddBindingPrecedenceToTeamProposal(parentType, problem.getProblemArguments());
+ if (proposal != null)
+ proposals.add(proposal);
+ proposal = processor.getAddRolePrecedenceToTeamProposal(parentType, problem.getProblemArguments());
+ if (proposal != null)
+ proposals.add(proposal);
+ }
+ }
+ break;
+ case IProblem.CovariantReturnRequiresTypeParameter:
+ javaProposal= MappingProposalSubProcessor.addTypeParameterToCallin(cu, selectedNode, (TypeDeclaration)enclosingType);
+ break;
+// externalized roles:
+ case IProblem.DeprecatedPathSyntax:
+ javaProposal= getMigratePathSyntaxProposal(cu, selectedNode);
+ break;
+ case IProblem.AnchorNotFinal:
+ case IProblem.AnchorPathNotFinal:
+ javaProposal= ChangeModifierProposalSubProcessor.changeAnchorToFinalProposal(cu, selectedNode);
+ break;
+ case IProblem.ExternalizedCallToNonPublicConstructor:
+ case IProblem.ExternalizedCallToNonPublicMethod:
+ // this processor is orig jdt, but it is adapted by OTQuickFixes/QuickFixCoreAdaptor:
+ try {
+ OTQuickFixes.publicRequested = true;
+ ModifierCorrectionSubProcessor.addNonAccessibleReferenceProposal(context, problem, proposals, ModifierCorrectionSubProcessor.TO_VISIBLE, 10);
+ } finally {
+ OTQuickFixes.publicRequested = false;
+ }
+ break;
+ case IProblem.NotVisibleRoleMethod:
+ // this processor is orig jdt, but it is adapted by OTQuickFixes/QuickFixCoreAdaptor:
+ ModifierCorrectionSubProcessor.addNonAccessibleReferenceProposal(context, problem, proposals, ModifierCorrectionSubProcessor.TO_VISIBLE, 10);
+ break;
+ case IProblem.TSubMethodReducesVisibility:
+ // this processor is orig jdt, adaptations needed?
+ ModifierCorrectionSubProcessor.addChangeOverriddenModfierProposal(context, problem, proposals, ModifierCorrectionSubProcessor.TO_VISIBLE);
+ break;
+ case IProblem.MissingAnchorForRoleType:
+ if (selectedNode instanceof VariableDeclarationStatement) {
+ VariableDeclarationStatement variable = (VariableDeclarationStatement) selectedNode;
+ selectedNode= variable.getType();
+ if (selectedNode instanceof SimpleType) {
+ SimpleType typeNode = (SimpleType) selectedNode;
+ selectedNode= typeNode.getName();
+ }
+ }
+ if (selectedNode instanceof Name) {
+ Name typeName= (Name) selectedNode;
+ ITypeBinding roleType= typeName.resolveTypeBinding();
+ if (roleType == null) break;
+ ITypeBinding teamType= roleType.getDeclaringClass();
+ if (teamType == null) break;
+ proposals.add(TypeProposalSubProcessor.changeTypeToAnchored(cu,
+ roleType.getQualifiedName(),
+ typeName,
+ teamType.getQualifiedName()));
+ }
+ break;
+// inferred callout:
+ case IProblem.UsingCalloutToFieldForAssignment:
+ javaProposal = MappingProposalSubProcessor.getChangeAssignmentToCalloutCallProposal(
+ cu, (TypeDeclaration) enclosingType, selectedNode);
+ // add to proposals below
+ break;
+ case IProblem.UsingCalloutToFieldForFieldRead:
+ javaProposal = MappingProposalSubProcessor.getChangeFieldReadToCalloutCallProposal(
+ cu, (TypeDeclaration) enclosingType, selectedNode);
+ // add to proposals below
+ break;
+ case IProblem.UsingInferredCalloutForMessageSend:
+ javaProposal= MappingProposalSubProcessor.getMaterializeInferredCalloutSelfCallProposal(
+ cu, (TypeDeclaration)enclosingType, (MethodInvocation) selectedNode);
+ // add to proposals below
+ break;
+ case IProblem.AddingInferredCalloutForInherited:
+ javaProposal= MappingProposalSubProcessor.getMaterializeInferredCalloutsInheritedProposal(
+ cu, (TypeDeclaration)enclosingType, selectedNode);
+ // add to proposals below
+ break;
+ // javadoc:
+ case IProblem.JavadocMissingRoleTag:
+ javaProposal= JavadocProposalSubProcessor.addRoleTag(cu, problem.getProblemArguments(), (TypeDeclaration)enclosingType);
+ break;
+ }
+ } catch (ClassCastException cce) { /* could not find an expected node */ }
+ if (javaProposal != null)
+ proposals.add(javaProposal);
+ }
+
+ static AbstractMethodMappingDeclaration getEnclosingMethodMapping(ASTNode current) {
+ while (current != null) {
+ switch (current.getNodeType()) {
+ case ASTNode.CALLIN_MAPPING_DECLARATION:
+ case ASTNode.CALLOUT_MAPPING_DECLARATION:
+ return (AbstractMethodMappingDeclaration)current;
+ case ASTNode.ROLE_TYPE_DECLARATION:
+ case ASTNode.TYPE_DECLARATION:
+ case ASTNode.COMPILATION_UNIT:
+ return null;
+ }
+ current = current.getParent();
+ }
+ return null;
+ }
+
+ @SuppressWarnings("unchecked")
+ private ASTRewriteCorrectionProposal getMigratePathSyntaxProposal(ICompilationUnit cu,
+ ASTNode selectedNode)
+ {
+ if (selectedNode instanceof SingleVariableDeclaration)
+ selectedNode = ((SingleVariableDeclaration)selectedNode).getType();
+ ASTNode oldType = selectedNode; // saved for replacing be rewriter
+ AST ast = oldType.getAST();
+ // elements for the new type:
+ String prefixPath = null;
+ SimpleName typeName = null;
+ int dimensions = 0;
+
+ // strip off dims:
+ if (selectedNode.getNodeType() == ASTNode.ARRAY_TYPE) {
+ ArrayType type = (ArrayType)selectedNode;
+ dimensions = type.getDimensions();
+ oldType = type.getElementType();
+ }
+ // strip off simple type possibly wrapping qualified name:
+ if (oldType.getNodeType() == ASTNode.SIMPLE_TYPE) {
+ SimpleType type = (SimpleType)oldType;
+ oldType = type.getName();
+ }
+ // what remains should be a qualified something:
+ if (oldType.getNodeType() == ASTNode.QUALIFIED_NAME) {
+ QualifiedName name = (QualifiedName)oldType;
+ prefixPath = name.getQualifier().toString();
+ typeName = name.getName();
+ } else if (oldType.getNodeType() == ASTNode.QUALIFIED_TYPE) {
+ QualifiedType type = (QualifiedType)oldType;
+ prefixPath = type.getQualifier().toString();
+ typeName = type.getName();
+ }
+ if (prefixPath != null) {// assemble:
+ if (prefixPath.equals("base")) //$NON-NLS-1$
+ prefixPath = baseQualifier(selectedNode, typeName)+prefixPath;
+
+ // T
+ Type simpleType = ast.newSimpleType((Name)ASTNode.copySubtree(ast, typeName));
+ // T<>
+ ParameterizedType paramType = ast.newParameterizedType(simpleType);
+ // T<@prefix.path>
+ paramType.typeArguments().add(ast.newTypeAnchor(ast.newName(prefixPath)));
+ // T<@prefix.path>[]..
+ Type newType = (dimensions == 0) ?
+ paramType :
+ ast.newArrayType(paramType, dimensions);
+ ASTRewrite rewrite = ASTRewrite.create(ast);
+ rewrite.replace(selectedNode, newType, null);
+ return new ASTRewriteCorrectionProposal(
+ Messages.format(CorrectionMessages.OTQuickfix_migrateroletypesyntax_description, null),
+ cu,
+ rewrite,
+ 17, // TODO(SH): ;-)
+ JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE));
+ }
+ return null;
+ }
+
+ private String baseQualifier(ASTNode selectedNode,
+ SimpleName typeName)
+ {
+ // find enclosing role type:
+ RoleTypeDeclaration enclType = null;
+ ASTNode current = selectedNode;
+ while (enclType == null && current != null) {
+ current = current.getParent();
+ if (current instanceof RoleTypeDeclaration)
+ enclType = (RoleTypeDeclaration)current;
+ }
+
+ // find base class containing 'typeName':
+ RoleTypeDeclaration currentType = enclType;
+ int depth = 0;
+ while(currentType != null) {
+ // find 'typeName' in baseclass:
+ ITypeBinding baseclass = currentType.getBaseClassType().resolveBinding();
+ while (baseclass != null) {
+ for (ITypeBinding member : baseclass.getDeclaredTypes()) {
+ if (member.getName().equals(typeName.getIdentifier())) {
+ if (depth > 0)
+ return currentType.getName()+"."; //$NON-NLS-1$
+ break; // success, but no need for a qualifier
+ }
+ }
+ // loop up:
+ baseclass = baseclass.getSuperclass();
+ }
+ if (currentType.getParent() instanceof RoleTypeDeclaration)
+ // loop out:
+ currentType = (RoleTypeDeclaration)currentType.getParent();
+ else
+ break; // no success, try anyway
+ depth++;
+ }
+ return ""; //$NON-NLS-1$
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/text/correction/StringLinkedModeProposal.java b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/text/correction/StringLinkedModeProposal.java
new file mode 100644
index 000000000..262356b00
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/text/correction/StringLinkedModeProposal.java
@@ -0,0 +1,110 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2006, 2007 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: StringLinkedModeProposal.java 23438 2010-02-04 20:05:24Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.text.correction;
+
+import org.eclipse.jdt.internal.corext.fix.LinkedProposalPositionGroup;
+import org.eclipse.jdt.internal.ui.JavaPlugin;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.DocumentEvent;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.Position;
+import org.eclipse.jface.text.contentassist.IContextInformation;
+import org.eclipse.jface.text.link.LinkedPosition;
+import org.eclipse.jface.text.link.LinkedPositionGroup;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+
+/**
+ * Simple string-based alternative for an element of a group of linked positions.
+ *
+ * @author stephan
+ *
+ */
+@SuppressWarnings("restriction")
+class StringLinkedModeProposal extends LinkedProposalPositionGroup.Proposal
+{
+
+ private LinkedPositionGroup fLinkedPositionGroup;
+ private final String val;
+ private final String description;
+
+ public StringLinkedModeProposal(String val) {
+ this(val, null);
+ }
+
+ public StringLinkedModeProposal(String val, String description) {
+ super(val, null, 0);
+ this.val = val;
+ this.description = description;
+ }
+
+ public void setLinkedPositionGroup(LinkedPositionGroup group) {
+ fLinkedPositionGroup= group;
+ }
+
+ public String getAdditionalProposalInfo() {
+ return description == null ? getDisplayString() : description;
+ }
+
+ public String getDisplayString() {
+ return val;
+ }
+
+ public Image getImage() {
+ return null;
+ }
+
+ private Position getCurrentPosition(int offset) {
+ if (fLinkedPositionGroup != null) {
+ LinkedPosition[] positions= fLinkedPositionGroup.getPositions();
+ for (int i= 0; i < positions.length; i++) {
+ Position position= positions[i];
+ if (position.overlapsWith(offset, 0)) {
+ return position;
+ }
+ }
+ }
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension2#apply(org.eclipse.jface.text.ITextViewer, char, int, int)
+ */
+ public void apply(ITextViewer viewer, char trigger, int stateMask, int offset) {
+ Position currentPosition= getCurrentPosition(offset);
+ if (currentPosition == null)
+ return;
+ try {
+ IDocument document= viewer.getDocument();
+
+ // first replace range then insert space (insert space can destroy empty position)
+ document.replace(currentPosition.offset, currentPosition.length, this.val);
+
+ } catch (BadLocationException e) {
+ JavaPlugin.log(e);
+ }
+ }
+
+ public int getRelevance() { return 0; }
+ public IContextInformation getContextInformation() { return null; }
+ public void apply(IDocument document) { /* not called */ }
+ public Point getSelection(IDocument document) { return null; }
+ public void selected(ITextViewer viewer, boolean smartToggle) { /* nop */ }
+ public void unselected(ITextViewer viewer) { /* nop */ }
+ public boolean validate(IDocument document, int offset, DocumentEvent event) { return false; }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/text/correction/TypeProposalSubProcessor.java b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/text/correction/TypeProposalSubProcessor.java
new file mode 100644
index 000000000..949fcd593
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/text/correction/TypeProposalSubProcessor.java
@@ -0,0 +1,405 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2007 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: TypeProposalSubProcessor.java 23438 2010-02-04 20:05:24Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.text.correction;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.core.Signature;
+import org.eclipse.jdt.core.dom.AST;
+import org.eclipse.jdt.core.dom.ASTNode;
+import org.eclipse.jdt.core.dom.ASTParser;
+import org.eclipse.jdt.core.dom.Block;
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jdt.core.dom.FieldDeclaration;
+import org.eclipse.jdt.core.dom.ITypeBinding;
+import org.eclipse.jdt.core.dom.ImportDeclaration;
+import org.eclipse.jdt.core.dom.MethodDeclaration;
+import org.eclipse.jdt.core.dom.Name;
+import org.eclipse.jdt.core.dom.ParameterizedType;
+import org.eclipse.jdt.core.dom.QualifiedName;
+import org.eclipse.jdt.core.dom.SimpleName;
+import org.eclipse.jdt.core.dom.SimpleType;
+import org.eclipse.jdt.core.dom.SingleVariableDeclaration;
+import org.eclipse.jdt.core.dom.Type;
+import org.eclipse.jdt.core.dom.TypeAnchor;
+import org.eclipse.jdt.core.dom.TypeDeclaration;
+import org.eclipse.jdt.core.dom.VariableDeclarationFragment;
+import org.eclipse.jdt.core.dom.VariableDeclarationStatement;
+import org.eclipse.jdt.core.dom.rewrite.ASTRewrite;
+import org.eclipse.jdt.core.dom.rewrite.ImportRewrite;
+import org.eclipse.jdt.internal.corext.codemanipulation.StubUtility;
+import org.eclipse.jdt.internal.corext.util.Messages;
+import org.eclipse.jdt.internal.corext.util.QualifiedTypeNameHistory;
+import org.eclipse.jdt.internal.ui.JavaPluginImages;
+import org.eclipse.jdt.internal.ui.text.correction.proposals.ASTRewriteCorrectionProposal;
+import org.eclipse.jdt.internal.ui.text.correction.proposals.AddImportCorrectionProposal;
+import org.eclipse.jdt.internal.ui.text.correction.proposals.CUCorrectionProposal;
+import org.eclipse.jdt.internal.ui.text.correction.proposals.LinkedCorrectionProposal;
+import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels;
+import org.eclipse.jdt.ui.text.java.IJavaCompletionProposal;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.objectteams.otdt.core.IOTType;
+import org.eclipse.objectteams.otdt.core.IRoleType;
+import org.eclipse.objectteams.otdt.core.OTModelManager;
+
+/**
+ * Process quick fixes related to types.
+ *
+ * @author stephan
+ */
+@SuppressWarnings("restriction")
+public class TypeProposalSubProcessor {
+
+ private static final String ANCHOR_GROUP_ID = "AnchorNameID"; //$NON-NLS-1$
+
+ /**
+ * Change a simple type role reference to a an anchored type reference.
+ * Infer possible anchors from the context.
+ *
+ * @param cu where everything happens
+ * @param fullName the qualified name of a role type
+ * @param type the node specifying the role type (to be replaced)
+ * @param enclosingTeamName the team containing the role type to change.
+ *
+ * all parameters: non-null!
+ * @return the proposal (always)
+ */
+ @SuppressWarnings("unchecked")
+ public static LinkedCorrectionProposal changeTypeToAnchored(ICompilationUnit cu,
+ String fullName,
+ Name type,
+ String enclosingTeamName)
+ {
+ AST ast = type.getAST();
+ ASTRewrite rewrite= ASTRewrite.create(ast);
+
+ // search candidates for an anchor:
+ String[] variables = matchingVariables(type, enclosingTeamName);
+ String firstAnchor = (variables.length>0) ? variables[0] : "aTeam"; //$NON-NLS-1$
+
+ // construct and replace 'Type<@anchor>'
+ SimpleName anchorName = (SimpleName)rewrite.createStringPlaceholder(firstAnchor, ASTNode.SIMPLE_NAME);
+ TypeAnchor anchor = ast.newTypeAnchor(anchorName);
+ Name newTypeName= type;
+ if (type.isQualifiedName())
+ newTypeName= ((QualifiedName)type).getName();
+ newTypeName= (Name)ASTNode.copySubtree(ast, newTypeName);
+ ParameterizedType newType = ast.newParameterizedType(ast.newSimpleType(newTypeName));
+ newType.typeArguments().add(anchor);
+ rewrite.replace(type, newType, null);
+
+ // assemble a proposal:
+ Image image= JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE);
+ int relevance = 13; // FIXME
+ String label = CorrectionMessages.OTQuickFix_Type_change_type_to_anchored;
+ LinkedCorrectionProposal proposal = new LinkedCorrectionProposal(label, cu, rewrite, relevance, image);
+
+ // setup linked mode:
+ proposal.addLinkedPosition(rewrite.track(anchorName), true, ANCHOR_GROUP_ID);
+ if (variables.length > 1) // should we present choices?
+ for (int i=0; i<variables.length; i++)
+ proposal.addLinkedPositionProposal(ANCHOR_GROUP_ID, variables[i], null);
+ return proposal;
+ }
+
+ /** Find the names of all variables in scope that match typeToMatch. */
+ static private String[] matchingVariables (ASTNode node, String enclosingTeamName) {
+ ArrayList<String> list = new ArrayList<String>();
+ ASTNode previous = null;
+ while (node != null && node.getNodeType() != ASTNode.COMPILATION_UNIT) {
+ switch (node.getNodeType()) {
+ case ASTNode.BLOCK:
+ list.addAll(getMatchingLocalsPriorTo((Block)node, enclosingTeamName, previous));
+ break;
+ case ASTNode.METHOD_DECLARATION:
+ for (Object fieldObj : ((MethodDeclaration)node).parameters()) {
+ SingleVariableDeclaration param= (SingleVariableDeclaration)fieldObj;
+ addSingleVarIfMatch(param.getType(), enclosingTeamName, param, list);
+ }
+ break;
+ case ASTNode.ROLE_TYPE_DECLARATION:
+ case ASTNode.TYPE_DECLARATION:
+ for (FieldDeclaration field : ((TypeDeclaration)node).getFields())
+ addFragmentsIfMatch(field.getType(), enclosingTeamName, field.fragments(), list);
+ break;
+ }
+ previous = node;
+ node = node.getParent();
+ }
+ return list.toArray(new String[list.size()]);
+ }
+
+ /**
+ * Find all local variables within block prior to current that match typeToMatch.
+ * Return the variables' names.
+ */
+ @SuppressWarnings("unchecked") // block.statements() is raw type
+ private static ArrayList<String> getMatchingLocalsPriorTo(Block block,
+ String enclosingTeamName,
+ ASTNode current)
+ {
+ ArrayList<String> result = new ArrayList<String>();
+ if (current != null) {
+ List statements = block.statements();
+ for (int i=0; i<statements.size(); i++) {
+ Object statement = statements.get(i);
+ if (statement instanceof VariableDeclarationStatement) {
+ VariableDeclarationStatement var = (VariableDeclarationStatement)statement;
+ addFragmentsIfMatch(var.getType(), enclosingTeamName, var.fragments(), result);
+ }
+ if (statement == current)
+ break;
+ }
+ }
+ return result;
+ }
+
+ /** If typeNode matches typeToMatch add the names of all fragments to result. */
+ @SuppressWarnings("unchecked")
+ private static void addFragmentsIfMatch(Type typeNode, String enclosingTeamName, List fragments, List<String> result)
+ {
+ if ( typeNode.isSimpleType()
+ && nameEquals(((SimpleType)typeNode).getName(), enclosingTeamName))
+ {
+ for (int i=0; i<fragments.size(); i++)
+ result.add(((VariableDeclarationFragment)fragments.get(i)).getName().getIdentifier());
+ }
+ }
+ private static void addSingleVarIfMatch(Type typeNode, String enclosingTeamName, SingleVariableDeclaration var, List<String> result)
+ {
+ if ( typeNode.isSimpleType()
+ && nameEquals(((SimpleType)typeNode).getName(), enclosingTeamName))
+ {
+ result.add(var.getName().getIdentifier());
+ }
+ }
+
+ /** Does name match the type to match, either by simple or by qualified name? */
+ private static boolean nameEquals(Name name, String enclosingTeamName) {
+ String nameString = name.getFullyQualifiedName();
+ return enclosingTeamName.equals(nameString)
+ || enclosingTeamName.endsWith("."+nameString); //$NON-NLS-1$
+ }
+
+ /**
+ * Proposal for adding an "import base" statement to the current role file's enclosing team.
+ * @param cu where everything happens
+ * @param fullName name of type to import
+ * @param node node requiring the import
+ * @param relevance relevance
+ * @param maxProposals how many proposals should be accepted?
+ * @return the proposal or null
+ */
+ public static CUCorrectionProposal createImportInRoFisTeamProposal(ICompilationUnit cu, String fullName, Name node, int relevance, int maxProposals)
+ {
+ // get the new CU:
+ try {
+ IType[] types = cu.getTypes();
+ IOTType otType = OTModelManager.getOTElement(types[0]);
+ if (otType == null || !otType.isRole())
+ return null; // cu is not a rofi
+ IType teamType = ((IRoleType)otType).getTeamJavaType();
+ cu = teamType.getCompilationUnit();
+ if (cu == null)
+ return null;
+
+ } catch (JavaModelException e) {
+ return null;
+ }
+
+ // get a fresh AST:
+ ASTParser p = ASTParser.newParser(AST.JLS3);
+ p.setSource(cu);
+ p.setResolveBindings(false);
+ CompilationUnit astCU = (CompilationUnit) p.createAST(null);
+
+ for (Object anImport : astCU.imports())
+ if (((ImportDeclaration)anImport).getName().getFullyQualifiedName().equals(fullName))
+ return null; // no change needed
+
+ // create the proposal -- starting from here code is inspired by
+ // org.eclipse.jdt.internal.ui.text.correction.UnresolvedElementsSubProcessor.createTypeRefChangeProposal(ICompilationUnit, String, Name, int, int)
+ ImportRewrite importRewrite= null;
+ String simpleName= fullName;
+ String packName= Signature.getQualifier(fullName);
+ if (packName.length() > 0) { // no imports for primitive types, type variables
+
+ importRewrite= StubUtility.createImportRewrite(astCU, true); // OT-modified(SH)
+ simpleName= importRewrite.addImport(fullName);
+ }
+
+ if (!isLikelyTypeName(simpleName)) {
+ relevance -= 2;
+ }
+
+ ASTRewriteCorrectionProposal proposal = null;
+ SimpleName simpleNameNode =
+ node.isQualifiedName()
+ ? ((QualifiedName)node).getName()
+ : (SimpleName)node;
+ if (importRewrite != null && simpleName.equals(simpleNameNode.getIdentifier())) { // import only
+ // import only
+ String[] arg= { BasicElementLabels.getJavaElementName(simpleName), BasicElementLabels.getJavaElementName(packName) };
+ String label= Messages.format(CorrectionMessages.OTQuickFix_Type_add_base_import_to_enclosing_team, arg);
+ Image image= JavaPluginImages.get(JavaPluginImages.IMG_OBJS_IMPDECL);
+ int boost= QualifiedTypeNameHistory.getBoost(fullName, 0, maxProposals);
+ proposal= new AddImportCorrectionProposal(label, cu, relevance + 100 + boost, image, packName, simpleName, simpleNameNode);
+ proposal.setCommandId(ADD_IMPORT_ID);
+ proposal.setImportRewrite(importRewrite);
+ }
+ // "else" dropped for OT
+ return proposal;
+ }
+ private static final String ADD_IMPORT_ID= "org.eclipse.jdt.ui.correction.addImport"; //$NON-NLS-1$
+ private static boolean isLikelyTypeName(String name) {
+ return name.length() > 0 && Character.isUpperCase(name.charAt(0));
+ }
+
+ /**
+ * handle IProblem.RegularlyImportedBaseclass:
+ * "change import to "import base ...";
+ * OR (if cu is a role file):
+ * add a new "import base" to the enclosing team.
+ *
+ * @param selectedNode reference to the type being imported
+ * @param cu where everything happens
+ * @return the proposal or null
+ * @throws JavaModelException exception in one of the various model operations
+ */
+ public static IJavaCompletionProposal getMakeImportBase(ASTNode selectedNode, ICompilationUnit cu)
+ throws JavaModelException
+ {
+
+ if (selectedNode.getNodeType() != ASTNode.SIMPLE_NAME)
+ return null;
+
+ SimpleName name = (SimpleName)selectedNode;
+
+ ITypeBinding type = name.resolveTypeBinding();
+ if (type == null)
+ return null;
+
+ int relevance = 1000; // TODO(SH): compute
+
+ IType[] types = cu.getTypes();
+ for (IType toplevelType : types) {
+ IOTType ottype = OTModelManager.getOTElement(toplevelType);
+ if (ottype != null && ottype.isRole())
+ // no import base in role file, create a new one in the team instead:
+ return createImportInRoFisTeamProposal(cu, type.getQualifiedName(), name, relevance, 1);
+ }
+
+ ImportRewrite importRewrite = StubUtility.createImportRewrite(cu, true);
+ if (!importRewrite.setImportBase(type))
+ return null; // failure
+
+ String simpleName = type.getName();
+ String pack1 = type.getPackage().getNameComponents()[0];
+ String displayName = pack1+"..."+simpleName; //$NON-NLS-1$
+
+ ASTRewriteCorrectionProposal rewriteProposal =
+ new ASTRewriteCorrectionProposal(
+ Messages.format(CorrectionMessages.OTQuickFix_Type_convertimporttobase_description,
+ new String[] {displayName}),
+ cu,
+ ASTRewrite.create(selectedNode.getAST()),
+ relevance,
+ JavaPluginImages.get(JavaPluginImages.IMG_OBJS_IMPDECL));
+ rewriteProposal.setImportRewrite(importRewrite);
+ return rewriteProposal;
+ }
+
+ /**
+ * Import a base class so that a qualified reference can be replaced by a simple one.
+ *
+ * @param selectedNode the qualified reference
+ * @param cu where everything happens
+ * @return the proposal or null
+ * @throws JavaModelException exception in one of the various model operations
+ */
+ public static IJavaCompletionProposal getImportBaseclass(ASTNode selectedNode, ICompilationUnit cu) throws JavaModelException
+ {
+ if (selectedNode.getNodeType() != ASTNode.QUALIFIED_NAME)
+ return null;
+
+ QualifiedName typeRef = (QualifiedName)selectedNode;
+
+ ITypeBinding type = typeRef.resolveTypeBinding();
+ if (type == null)
+ return null;
+
+ int relevance = 1000; // TODO(SH): compute
+
+ IType[] types = cu.getTypes();
+ boolean isRoleFile = false;
+ for (IType toplevelType : types) {
+ IOTType ottype = OTModelManager.getOTElement(toplevelType);
+ if (ottype != null && ottype.isRole()) {
+ isRoleFile = true;
+ break;
+ }
+ }
+ // no import base in role file, create a new one in the team instead?
+ final IJavaCompletionProposal importProposal = isRoleFile
+ ? createImportInRoFisTeamProposal(cu, type.getQualifiedName(), typeRef, relevance, 1)
+ : null;
+
+ // create the base import
+ ImportRewrite importRewrite = StubUtility.createImportRewrite(cu, true);
+ if (!isRoleFile) {
+ importRewrite.addImport(type);
+ if (!importRewrite.setImportBase(type))
+ return null; // failure
+ }
+
+ AST ast = selectedNode.getAST();
+ ASTRewrite rewrite = ASTRewrite.create(ast);
+
+ // replace the type reference with a simple name:
+ Name simpleTypeRef = ast.newName(typeRef.getName().getIdentifier());
+ rewrite.replace(selectedNode, simpleTypeRef, null);
+
+ // assemble the proposal:
+ String simpleName = type.getName();
+ String pack1 = type.getPackage().getNameComponents()[0];
+ String displayName = pack1+"..."+simpleName; //$NON-NLS-1$
+ ASTRewriteCorrectionProposal rewriteProposal =
+ new ASTRewriteCorrectionProposal(
+ Messages.format(CorrectionMessages.OTQuickFix_Type_convert_fqn_to_importtobase_description,
+ new String[] {displayName}),
+ cu,
+ rewrite,
+ relevance,
+ JavaPluginImages.get(JavaPluginImages.IMG_OBJS_IMPDECL))
+ {
+ @Override
+ public void apply(IDocument document) {
+ super.apply(document);
+ // propagate to the import proposal which refers to a different CU (that's why be build two separate proposals):
+ if (importProposal != null)
+ importProposal.apply(document);
+ }
+ };
+ rewriteProposal.setImportRewrite(importRewrite);
+ return rewriteProposal;
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/typehierarchy/TypeHierarchyViewAdaptor.java b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/typehierarchy/TypeHierarchyViewAdaptor.java
new file mode 100644
index 000000000..27e5bed82
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/typehierarchy/TypeHierarchyViewAdaptor.java
@@ -0,0 +1,347 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2006, 2007 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: TypeHierarchyViewAdaptor.java 23438 2010-02-04 20:05:24Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.typehierarchy;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IMember;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.ITypeHierarchy;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.internal.ui.actions.CompositeActionGroup;
+import org.eclipse.jdt.internal.ui.typehierarchy.MethodsViewer;
+import org.eclipse.jdt.internal.ui.typehierarchy.ToggleViewAction;
+import org.eclipse.jdt.ui.ITypeHierarchyViewPart;
+import org.eclipse.jdt.ui.JavaElementLabels;
+import org.eclipse.objectteams.otdt.core.IMethodMapping;
+import org.eclipse.objectteams.otdt.core.IOTJavaElement;
+import org.eclipse.objectteams.otdt.core.IOTType;
+import org.eclipse.objectteams.otdt.core.IRoleType;
+import org.eclipse.objectteams.otdt.core.OTModelManager;
+import org.eclipse.objectteams.otdt.core.TypeHelper;
+import org.eclipse.objectteams.otdt.core.compiler.IOTConstants;
+import org.eclipse.objectteams.otdt.ui.Util;
+
+import base org.eclipse.jdt.internal.ui.typehierarchy.HierarchyLabelProvider;
+import base org.eclipse.jdt.internal.ui.typehierarchy.MethodsContentProvider;
+import base org.eclipse.jdt.internal.ui.typehierarchy.MethodsLabelProvider;
+import base org.eclipse.jdt.internal.ui.typehierarchy.TypeHierarchyLifeCycle;
+import base org.eclipse.jdt.internal.ui.typehierarchy.TypeHierarchyViewPart;
+import base org.eclipse.jdt.internal.ui.typehierarchy.SubTypeHierarchyViewer.SubTypeHierarchyContentProvider;
+
+/**
+ * This team adapts the type hierarchy to handle role inheritance correctly.
+ *
+ * @author stephan
+ */
+@SuppressWarnings("restriction")
+public team class TypeHierarchyViewAdaptor
+{
+ /** Manipulate set of available actions. */
+ @SuppressWarnings("decapsulation")
+ protected class ViewPart playedBy TypeHierarchyViewPart
+ {
+ void changeViewActions()
+ {
+ // remove first action (VIEW_ID_TYPE not applicable in the OT hierarchy)
+ ToggleViewAction[] actions = getViewActions();
+ setViewActions(new ToggleViewAction[] { actions[1], actions[2] });
+ }
+ changeViewActions <- before createPartControl;
+
+ ToggleViewAction[] getViewActions() -> get ToggleViewAction[] fViewActions;
+ void setViewActions(ToggleViewAction[] actions) -> set ToggleViewAction[] fViewActions;
+
+ CompositeActionGroup getActionGroups() -> get CompositeActionGroup fActionGroups;
+ void setActionGroups(CompositeActionGroup groups) -> set CompositeActionGroup fActionGroups;
+
+ // ensure the old default value CLASSIC never comes through:
+ callin void setHierarchyMode(int viewerIndex) {
+ if (viewerIndex == ITypeHierarchyViewPart.HIERARCHY_MODE_CLASSIC)
+ viewerIndex = ITypeHierarchyViewPart.HIERARCHY_MODE_SUPERTYPES;
+ base.setHierarchyMode(viewerIndex);
+ }
+ void setHierarchyMode(int viewerIndex) <- replace void setHierarchyMode(int viewerIndex);
+ }
+
+ /** If element is a role type, ensure an OTTypeHierarchy is created. */
+ protected class LifeCycle playedBy TypeHierarchyLifeCycle
+ {
+ @SuppressWarnings("basecall")
+ callin ITypeHierarchy createTypeHierarchy(IJavaElement element, IProgressMonitor pm) throws JavaModelException {
+ if (element.getElementType() == IJavaElement.TYPE) {
+ // compute a hierarchy that can handle teams and roles
+ IOTType otType = OTModelManager.getOTElement((IType) element);
+ if (otType != null) {
+ if (getIsSuperTypesOnly())
+ return otType.newSuperOTTypeHierarchy(pm);
+ else
+ return otType.newOTTypeHierarchy(pm);
+ }
+ }
+ return base.createTypeHierarchy(element, pm);
+ }
+ @SuppressWarnings("decapsulation")
+ createTypeHierarchy <- replace createTypeHierarchy;
+
+ @SuppressWarnings("decapsulation")
+ boolean getIsSuperTypesOnly() -> get boolean fIsSuperTypesOnly;
+
+ protected
+ ITypeHierarchy getHierarchy() -> ITypeHierarchy getHierarchy();
+ }
+
+
+ /** Refuse to answer _the_ super class for a role type.
+ * Return null rather throwing an exception as OTTypeHierarchy would do. */
+ protected class SubTypeHierarchyContentProvider playedBy SubTypeHierarchyContentProvider
+ {
+ @SuppressWarnings("basecall")
+ callin Object getParent(Object element) {
+ if(element instanceof IType) {
+ IOTType otType = OTModelManager.getOTElement((IType)element);
+ if (otType != null && otType.isRole())
+ return null; // not a single parent
+ }
+ return base.getParent(element);
+ }
+ getParent <- replace getParent;
+ }
+
+ /**
+ * Ensure role names are always prefixed upto and including the enclosing team type.
+ */
+ public class HierarchyLabelProvider playedBy HierarchyLabelProvider
+ {
+ @SuppressWarnings("basecall")
+ callin String getText(Object element) {
+ IOTType otType = null;
+ if(element instanceof IType)
+ {
+ IType type = (IType)element;
+ if(OTModelManager.hasOTElementFor(type)) {
+ otType = OTModelManager.getOTElement((IType)element);
+ } else {
+ IType encType = type.getDeclaringType();
+ IType classPart =
+ encType == null ? null : encType.getType(IOTConstants.OT_DELIM + type.getElementName());
+ if (classPart != null && OTModelManager.hasOTElementFor(classPart))
+ otType = OTModelManager.getOTElement(classPart);
+ }
+ }
+ if(otType != null) {
+ //team or role
+ StringBuffer text = new StringBuffer();
+ computeNames(text, otType);
+ return text.toString();
+ } else {
+ //ordinary type
+ return base.getText(element);
+ }
+
+ }
+ getText <- replace getText;
+ }
+
+ /**
+ * Different presentation for role methods, if defining type should be displayed.
+ * Also support method mappings.
+ */
+ protected class MethodsLabelProvider playedBy MethodsLabelProvider {
+
+ callin String getText(Object element) {
+ String text;
+ boolean isRole = false;
+ if (element instanceof IMember) {
+ IType declaringType = ((IMember)element).getDeclaringType();
+ IOTType otType = OTModelManager.getOTElement(declaringType);
+ if(otType != null && otType instanceof IRoleType)
+ isRole = true;
+ }
+ if(isRole && isShowDefiningType()) {
+ // get the text without defining type, because we need to
+ // compute the defining type for roles ourselves:
+ setShowDefiningType(false);
+ text= base.getText(element);
+ setShowDefiningType(true);
+
+ try {
+ // compute and assemble the defining type name:
+ IType type = otGetDefiningType(element);
+ if(type != null) {
+ StringBuffer extText = new StringBuffer();
+ IOTType otEquiv = isRole ?
+ OTModelManager.getOTElement(type) :
+ null;
+ if(otEquiv != null && otEquiv instanceof IRoleType) {
+ // prepend qualified role name:
+ computeNames(extText, otEquiv);
+ } else {
+ extText.append(type.getElementName());
+ }
+ extText.append(JavaElementLabels.CONCAT_STRING);
+ extText.append(text);
+ return extText.toString();
+ }
+ }
+ catch (JavaModelException exc) { /* Just use the text we already have. */ }
+ } else {
+ text= base.getText(element);
+ }
+
+ if (element instanceof IMethodMapping && getShowInherited() && !isShowDefiningType()) {
+ // this case is not handled above:
+ // method mappings needing to show their declaring type.
+ StringBuffer extText = new StringBuffer();
+ extText.append(text);
+ extText.append(JavaElementLabels.CONCAT_STRING);
+ extText.append(((IMethodMapping)element).getDeclaringType().getFullyQualifiedName('.'));
+ return extText.toString();
+ }
+
+ return text;
+ }
+ getText <- replace getText;
+
+
+ private IType otGetDefiningType(Object element) throws JavaModelException
+ {
+ if (element instanceof IOTJavaElement) {
+ switch (((IOTJavaElement)element).getElementType()) {
+ case IOTJavaElement.CALLIN_MAPPING:
+ case IOTJavaElement.CALLOUT_MAPPING:
+ case IOTJavaElement.CALLOUT_TO_FIELD_MAPPING:
+ // FIXME(SH): inconsistency: should search the initial defining type instead:
+ return ((IMethodMapping)element).getDeclaringType();
+ }
+ }
+ return getDefiningType(element);
+ }
+
+ abstract IType getDefiningType(Object element) throws JavaModelException;
+
+ @SuppressWarnings("decapsulation")
+ IType getDefiningType(Object element) -> IType getDefiningType(Object element);
+ void setShowDefiningType(boolean showDefiningType) -> void setShowDefiningType(boolean showDefiningType);
+ boolean isShowDefiningType() -> boolean isShowDefiningType();
+
+ @SuppressWarnings("decapsulation")
+ boolean getShowInherited() -> get MethodsViewer fMethodsViewer
+ with { result <- fMethodsViewer.isShowInheritedMethods() }
+ }
+
+ private static final Object[] NO_ELEMENTS = new Object[0];
+
+ /** Filter generated elements and also provide method mappings. */
+ protected class MethodsContentProvider playedBy MethodsContentProvider {
+
+ @SuppressWarnings("basecall")
+ callin Object[] getElements(Object element) {
+ if(!(element instanceof IType))
+ return NO_ELEMENTS;
+
+ Object[] result = null;
+ Object[] superResult = base.getElements(element);
+
+ IType type = (IType)element;
+ IRoleType roleType = null;
+
+ try {
+ // for any OT type: filter generated:
+ int flags = type.getFlags();
+ if (TypeHelper.isTeam(flags) || TypeHelper.isRole(flags)) {
+ superResult = Util.filterOTGenerated(superResult);
+ if (TypeHelper.isRole(flags))
+ roleType = (IRoleType)OTModelManager.getOTElement(type);
+ }
+ } catch (ClassCastException jme) {
+ // nop (OTModelManager provided a non-role?)
+ } catch (JavaModelException jme) {
+ // nop
+ }
+ ITypeHierarchy hierarchy = getHierarchyLifeCycle().getHierarchy();
+ List<Object> methodMappings = new ArrayList<Object>();
+
+ if( roleType != null
+ && getShowInheritedMethods()
+ && hierarchy != null)
+ {
+ // add inherited method mappings:
+ IType[] allSupertypes = hierarchy.getAllSupertypes(type);
+ // sort in from last to first: elements with same name
+ // will show up in hierarchy order
+ for (int idx = allSupertypes.length - 1; idx >= 0; idx--)
+ {
+ IType superType = allSupertypes[idx];
+ IOTType otEquiv = OTModelManager.getOTElement(superType);
+ if (superType.exists() && otEquiv != null && otEquiv.isRole())
+ {
+ IRoleType role = (IRoleType)otEquiv;
+ addAll(role.getMethodMappings(), methodMappings);
+ }
+ }
+ }
+ if(roleType != null && type.exists())
+ // show own method mappings:
+ addAll(roleType.getMethodMappings(), methodMappings);
+
+ result = new Object[superResult.length + methodMappings.size()];
+ System.arraycopy(superResult, 0, result, 0, superResult.length);
+ System.arraycopy(methodMappings.toArray(), 0, result, superResult.length, methodMappings.size());
+ return result;
+ }
+ getElements <- replace getElements;
+
+ private void addAll(Object[] array, List<Object> result) {
+ if (array != null)
+ for (int idx = 0; idx < array.length; idx++)
+ result.add(array[idx]);
+ }
+
+ @SuppressWarnings("decapsulation")
+ LifeCycle getHierarchyLifeCycle() -> get TypeHierarchyLifeCycle fHierarchyLifeCycle;
+
+ boolean getShowInheritedMethods() -> boolean isShowInheritedMethods();
+ }
+
+
+ /**
+ * Helper for two roles: create a role name prefixed with its team
+ * (and all intermediate roles, if nested).
+ */
+ private static StringBuffer computeNames(StringBuffer buffer, IOTType type)
+ {
+ IOTType curType = type;
+ while(curType.isRole())
+ {
+ buffer.insert(0, curType.getElementName());
+ buffer.insert(0, '.');
+ curType = ((IRoleType)curType).getTeam();
+ if (curType == null)
+ return buffer; // avoid NPE, leave incomplete name if needed
+ }
+ return buffer.insert(0, curType.getElementName());
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/util/HierarchyUtilAdaptor.java b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/util/HierarchyUtilAdaptor.java
new file mode 100644
index 000000000..9fae948e6
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/util/HierarchyUtilAdaptor.java
@@ -0,0 +1,124 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2007 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: HierarchyUtilAdaptor.java 23438 2010-02-04 20:05:24Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.util;
+
+import org.eclipse.jdt.core.Flags;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IMethod;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.ITypeHierarchy;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.objectteams.otdt.core.IOTJavaElement;
+import org.eclipse.objectteams.otdt.core.IOTType;
+import org.eclipse.objectteams.otdt.core.OTModelManager;
+import org.eclipse.objectteams.otdt.internal.core.OTTypeHierarchy;
+
+import base org.eclipse.jdt.internal.corext.util.JavaModelUtil;
+import base org.eclipse.jdt.internal.corext.util.MethodOverrideTester;
+import base org.eclipse.jdt.internal.ui.util.OpenTypeHierarchyUtil;
+
+/**
+ * This team adapts different utility classes relating to hierarchies.
+ *
+ * @author stephan
+ */
+@SuppressWarnings("restriction")
+public team class HierarchyUtilAdaptor
+{
+ /** Also consider method mappings as candidates for a hierarchy. */
+ protected class OpenTypeHierarchy playedBy OpenTypeHierarchyUtil
+ {
+ @SuppressWarnings("basecall")
+ static callin IJavaElement[] getCandidates(Object input) {
+ if (input instanceof IJavaElement) {
+ IJavaElement elem= (IJavaElement) input;
+ switch (elem.getElementType()) {
+ case IOTJavaElement.CALLIN_MAPPING:
+ case IOTJavaElement.CALLOUT_MAPPING:
+ case IOTJavaElement.CALLOUT_TO_FIELD_MAPPING:
+ return new IJavaElement[] { elem };
+ }
+ }
+ return base.getCandidates(input);
+ }
+ getCandidates <- replace getCandidates;
+ }
+
+ /** Consider multiple super classes for roles. */
+ @SuppressWarnings("decapsulation"/*final baseclass*/)
+ protected class JavaModelUtil playedBy JavaModelUtil
+ {
+ @SuppressWarnings("basecall")
+ static callin boolean isSuperType(ITypeHierarchy hierarchy, IType possibleSuperType, IType type)
+ {
+ if (hierarchy instanceof OTTypeHierarchy) {
+ IOTType otType = OTModelManager.getOTElement(type);
+ if (otType != null && otType.isRole())
+ {
+ IType[] supertypes = ((OTTypeHierarchy)hierarchy).getAllSupertypes(type);
+ for (IType supertype : supertypes)
+ if (supertype.equals(possibleSuperType))
+ return true;
+ return false;
+ }
+ }
+ return base.isSuperType(hierarchy, possibleSuperType, type);
+ }
+ isSuperType <- replace isSuperType;
+ }
+
+ /** Find overridden methods in all kinds of super types. */
+ protected class MethodOverrideTester playedBy MethodOverrideTester
+ {
+ @SuppressWarnings("basecall")
+ callin IMethod findOverriddenMethod(IMethod overriding, boolean testVisibility)
+ throws JavaModelException
+ {
+ ITypeHierarchy hierarchy = getHierarchy();
+ if (hierarchy instanceof OTTypeHierarchy)
+ {
+ IType declaringType = overriding.getDeclaringType();
+ IOTType declaringOTType = OTModelManager.getOTElement(declaringType);
+ if (declaringOTType != null && declaringOTType.isRole())
+ {
+ int flags= overriding.getFlags();
+ if (Flags.isPrivate(flags) || Flags.isStatic(flags) || overriding.isConstructor()) {
+ return null;
+ }
+
+ IType[] supertypes = ((OTTypeHierarchy)hierarchy).getAllSupertypes(declaringType);
+ for (IType type : supertypes) {
+ IMethod method = findOverriddenMethodInType(type, overriding);
+ if (method != null)
+ return method;
+ }
+ return null;
+ }
+ }
+ return base.findOverriddenMethod(overriding, testVisibility);
+ }
+ findOverriddenMethod <- replace findOverriddenMethod;
+
+ abstract IMethod findOverriddenMethodInType(IType overriddenType, IMethod overriding)
+ throws JavaModelException;
+
+ findOverriddenMethodInType -> findOverriddenMethodInType;
+
+ @SuppressWarnings("decapsulation")
+ ITypeHierarchy getHierarchy() -> get ITypeHierarchy fHierarchy;
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/util/Images.java b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/util/Images.java
new file mode 100644
index 000000000..38850f9ed
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/util/Images.java
@@ -0,0 +1,39 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2008 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: Images.java 23438 2010-02-04 20:05:24Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.util;
+
+import org.eclipse.jdt.internal.ui.JavaPlugin;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.DecorationOverlayIcon;
+import org.eclipse.objectteams.otdt.ui.ImageManager;
+import org.eclipse.swt.graphics.Image;
+
+@SuppressWarnings("restriction")
+public class Images {
+
+ public static Image getImage(String imgKey) {
+ return JavaPlugin.getImageDescriptorRegistry().get(
+ ImageManager.getSharedInstance().getDescriptor(imgKey));
+ }
+
+ public static Image decorateImage(Image baseImage, String overlayKey, int position) {
+ ImageDescriptor[] descs = new ImageDescriptor[5];
+ descs[position] = ImageManager.getSharedInstance().getDescriptor(overlayKey);
+ DecorationOverlayIcon icon = new DecorationOverlayIcon(baseImage, descs);
+ return JavaPlugin.getImageDescriptorRegistry().get(icon);
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/viewsupport/DecoratorManagerAdaptor.java b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/viewsupport/DecoratorManagerAdaptor.java
new file mode 100644
index 000000000..e464c0578
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/viewsupport/DecoratorManagerAdaptor.java
@@ -0,0 +1,79 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2006, 2007 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: DecoratorManagerAdaptor.java 23438 2010-02-04 20:05:24Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.viewsupport;
+
+import java.util.HashSet;
+
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IPackageFragment;
+import org.eclipse.jdt.core.JavaModelException;
+
+import base org.eclipse.ui.internal.decorators.LightweightDecoratorManager;
+import base org.eclipse.ui.internal.decorators.LightweightDecoratorDefinition;
+
+/**
+ * This class tweaks the decorator manager in order to apply CUD-decorators
+ * also for package fragements.
+ * This is needed to place a team icon onto a team package.
+ *
+ * @author stephan
+ */
+@SuppressWarnings({"restriction", "decapsulation" })
+public team class DecoratorManagerAdaptor
+{
+ /**
+ * Adapt a decoration manager to allow decorating team packages as types.
+ */
+ protected class DecorationManager playedBy LightweightDecoratorManager
+ {
+ getDecoratorsFor <- replace getDecoratorsFor;
+ @SuppressWarnings("basecall")
+ callin LightweightDecoratorDefinition[] getDecoratorsFor(Object element)
+ {
+ LightweightDecoratorDefinition[] result = base.getDecoratorsFor(element);
+
+ if (!(element instanceof IPackageFragment))
+ return result;
+
+ try {
+ ICompilationUnit teamUnit = TeamPackageUtil.getTeamUnit((IPackageFragment)element);
+ if (teamUnit == null)
+ return result;
+
+ LightweightDecoratorDefinition[] additional = base.getDecoratorsFor(teamUnit);
+
+ if (additional.length > 0) {
+ if (result.length == 0)
+ return additional;
+ // merge results (applying virtual identity between roles and bases):
+ HashSet<LightweightDecoratorDefinition> merged = new HashSet<LightweightDecoratorDefinition>();
+ for (LightweightDecoratorDefinition elem : result)
+ merged.add(elem);
+ for (LightweightDecoratorDefinition elem : additional)
+ merged.add(elem);
+ return merged.toArray(new LightweightDecoratorDefinition[merged.size()]);
+ }
+ } catch (JavaModelException e) {
+ return result;
+ }
+ return result;
+ }
+ }
+
+ /** This role serves only as a handle to an otherwise invisible type. */
+ protected class LightweightDecoratorDefinition playedBy LightweightDecoratorDefinition { /* no body */ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/viewsupport/DummyDecorator.java b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/viewsupport/DummyDecorator.java
new file mode 100644
index 000000000..8bcdaad63
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/viewsupport/DummyDecorator.java
@@ -0,0 +1,53 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2009 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: DummyDecorator.java 23438 2010-02-04 20:05:24Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.viewsupport;
+
+import org.eclipse.jface.viewers.IDecoration;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.jface.viewers.ILightweightLabelDecorator;
+
+/**
+ * This class provides a dummy implementation for a lightweight label decorator.
+ * It is only provided so we can install a decorator extension that is configurable via the preferences.
+ * The actual work is done by the {@link ViewAdaptor}.
+ *
+ * @author stephan
+ * @since 1.2.8
+ */
+public class DummyDecorator implements ILightweightLabelDecorator {
+
+ /** ID of the decorator extension regarding overriding roles. */
+ final static String OVERRIDING_ROLE_DECORATOR_ID = "org.eclipse.objectteams.otdt.jdt.ui.overridingRoleDecorator"; //$NON-NLS-1$
+ /** ID of the decorator extension regarding bound roles. */
+ final static String BOUND_ROLE_DECORATOR_ID = "org.eclipse.objectteams.otdt.jdt.ui.boundRoleDecorator"; //$NON-NLS-1$
+
+
+ public void decorate(Object element, IDecoration decoration) {
+ // nop, work is done by the ViewAdaptor.
+ }
+
+ public void addListener(ILabelProviderListener listener) {}
+
+ public void dispose() { }
+
+ public boolean isLabelProperty(Object element, String property) {
+ return false;
+ }
+
+ public void removeListener(ILabelProviderListener listener) { }
+
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/viewsupport/JFaceDecapsulator.java b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/viewsupport/JFaceDecapsulator.java
new file mode 100644
index 000000000..d92e607f6
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/viewsupport/JFaceDecapsulator.java
@@ -0,0 +1,42 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2006, 2007 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: JFaceDecapsulator.java 23438 2010-02-04 20:05:24Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.viewsupport;
+
+import org.eclipse.swt.graphics.ImageData;
+
+import base org.eclipse.jface.resource.CompositeImageDescriptor;
+
+/**
+ * The sole purpose of this aspect is to decapsulate one method
+ * (drawImage) of plug-in org.eclpise.jface.
+ * This method is needed by sub-team ViewAdaptor,
+ * which adapts plug-in org.eclipse.jdt.ui.
+ *
+ * Note, that this team is never activated (yet it has to be declared
+ * in plugin.xml to announce our plug-in dependencies).
+ *
+ * @author stephan
+ */
+public team class JFaceDecapsulator
+{
+ protected class CompositeImageDescriptor playedBy CompositeImageDescriptor
+ {
+ // must be in this team (adapting the jface plug-in) to ensure decapsulation is woven in.
+ @SuppressWarnings("decapsulation")
+ void drawImage (ImageData data, int x, int y) -> void drawImage (ImageData data, int x, int y);
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/viewsupport/JavaElementAdaptation.java b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/viewsupport/JavaElementAdaptation.java
new file mode 100644
index 000000000..6b8c23248
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/viewsupport/JavaElementAdaptation.java
@@ -0,0 +1,50 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2006, 2007 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: JavaElementAdaptation.java 23438 2010-02-04 20:05:24Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.viewsupport;
+
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.objectteams.otdt.core.IOTJavaElement;
+
+import base org.eclipse.jdt.internal.ui.JavaElementAdapterFactory;
+
+/**
+ * This team takes care of associating IOTJavaElements to their resources.
+ * This is relevant, e.g., for label decorations (text) for OT elements.
+ *
+ * @author stephan
+ */
+@SuppressWarnings("restriction")
+public team class JavaElementAdaptation
+{
+ /**
+ * This role makes its baseclass capable of handling IOTJavaElements
+ * via their corresponding IJavaElement.
+ * Note, that JavaElementAdapterFactory cannot handle IOTJavaElements,
+ * but for resource-lookup the corresponding IJavaElement should be fine.
+ */
+ protected class FactoryAdaptor playedBy JavaElementAdapterFactory
+ {
+ /** Map any IOTJavaElement to its corresponding IJavaElement. */
+ callin IJavaElement getJavaElement(Object element) {
+ if (element instanceof IOTJavaElement)
+ element = ((IOTJavaElement)element).getCorrespondingJavaElement();
+ return base.getJavaElement(element);
+ }
+ @SuppressWarnings("decapsulation")
+ getJavaElement <- replace getJavaElement;
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/viewsupport/PretendAllRoleFilesArePublic.java b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/viewsupport/PretendAllRoleFilesArePublic.java
new file mode 100644
index 000000000..8684eaf9c
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/viewsupport/PretendAllRoleFilesArePublic.java
@@ -0,0 +1,59 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2008 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: PretendAllRoleFilesArePublic.java 23438 2010-02-04 20:05:24Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.viewsupport;
+
+import static org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants.AccProtected;
+import static org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants.AccPublic;
+import static org.eclipse.jdt.internal.compiler.lookup.ExtraCompilerModifiers.AccVisibilityMASK;
+import static org.eclipse.jdt.internal.compiler.lookup.ExtraCompilerModifiers.AccRole;
+
+
+import base org.eclipse.jdt.internal.core.search.matching.QualifiedTypeDeclarationPattern;
+
+/**
+ * This team helps ViewAdaptor.OTClassLabelDecorator to handle all role files,
+ * despite that fact that {@link org.eclipse.jdt.internal.ui.InterfaceIndicatorLabelDecorator#getOverlayWithSearchEngine}
+ * only considers public types.
+ *
+ * @author stephan
+ * @since 1.2.2
+ */
+@SuppressWarnings("restriction")
+public team class PretendAllRoleFilesArePublic
+{
+ final static int AccProtectedRole = AccRole | AccProtected;
+
+ /**
+ * When decoding a type declaration pattern (as used by InterfaceIndicatorLabelDecorator),
+ * tweak protected roles to public.
+ */
+ protected class PatternAdaptor playedBy QualifiedTypeDeclarationPattern {
+
+ void setModifiers(int modifiers) -> set int modifiers;
+ int getModifiers() -> get int modifiers;
+
+ adjustModifiersForRole <- after decodeIndexKey
+ base when ((base.modifiers & AccProtectedRole) == AccProtectedRole);
+
+ private void adjustModifiersForRole() {
+ int modifiers = getModifiers();
+ modifiers &= ~AccVisibilityMASK;
+ modifiers |= AccPublic;
+ setModifiers(modifiers);
+ }
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/viewsupport/TeamPackageUtil.java b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/viewsupport/TeamPackageUtil.java
new file mode 100644
index 000000000..3a9e79c55
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/viewsupport/TeamPackageUtil.java
@@ -0,0 +1,72 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2006, 2007 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: TeamPackageUtil.java 23438 2010-02-04 20:05:24Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.viewsupport;
+
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IPackageFragment;
+import org.eclipse.jdt.core.IPackageFragmentRoot;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.internal.corext.refactoring.util.JavaElementUtil;
+import org.eclipse.objectteams.otdt.core.IOTType;
+import org.eclipse.objectteams.otdt.core.OTModelManager;
+
+/**
+ * Helper class to deal with team packages and role files.
+ * @author stephan
+ */
+@SuppressWarnings("restriction")
+public class TeamPackageUtil
+{
+ /**
+ * If aPackage is a team package answer the corresponding team compilation unit
+ *
+ * @param aPackage
+ * @return a team unit or null.
+ * @throws JavaModelException
+ */
+ public static ICompilationUnit getTeamUnit(IPackageFragment aPackage)
+ throws JavaModelException
+ {
+ ICompilationUnit[] units = aPackage.getCompilationUnits();
+ if (units != null && units.length > 0) {
+ IType firstType = JavaElementUtil.getMainType(units[0]);
+ IOTType otType = OTModelManager.getOTElement(firstType);
+ if (otType != null && otType.isRole())
+ {
+ String unitName = aPackage.getPath().lastSegment()+".java"; //$NON-NLS-1$
+ IPackageFragment enclosingPackage = JavaElementUtil.getParentSubpackage(aPackage);
+ if (enclosingPackage != null) {
+ return enclosingPackage.getCompilationUnit(unitName);
+ } else {
+ // if parent is already the root, then we have a team in the default package, yacks.
+ // need to travel one up, two down:
+ IPackageFragmentRoot root = (IPackageFragmentRoot)aPackage.getParent();
+ for (IJavaElement fragment : root.getChildren()) {
+ if (fragment.getElementName() == IPackageFragment.DEFAULT_PACKAGE_NAME)
+ for (IJavaElement element : ((IPackageFragment)fragment).getChildren())
+ if (element.getElementType() == IJavaElement.COMPILATION_UNIT)
+ if (element.getElementName().equals(unitName))
+ return (ICompilationUnit)element;
+ }
+ }
+ }
+ }
+ return null;
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/viewsupport/ViewAdaptor.java b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/viewsupport/ViewAdaptor.java
new file mode 100644
index 000000000..750f91a87
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/viewsupport/ViewAdaptor.java
@@ -0,0 +1,550 @@
+/*******************************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2006, 2009 Technical University Berlin, Germany and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: ViewAdaptor.java 23438 2010-02-04 20:05:24Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ * IBM Corporation - copies of individual methods from bound base classes.
+ *******************************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.viewsupport;
+
+import java.text.MessageFormat;
+import java.util.StringTokenizer;
+
+import org.eclipse.jdt.core.Flags;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IMember;
+import org.eclipse.jdt.core.IMethod;
+import org.eclipse.jdt.core.IPackageFragment;
+import org.eclipse.jdt.core.IPackageFragmentRoot;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jface.preference.PreferenceConverter;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.StyledString;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.graphics.TextStyle;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IDecoratorManager;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.objectteams.otdt.core.IMethodMapping;
+import org.eclipse.objectteams.otdt.core.IOTJavaElement;
+import org.eclipse.objectteams.otdt.core.IOTType;
+import org.eclipse.objectteams.otdt.core.IRoleType;
+import org.eclipse.objectteams.otdt.core.OTModelManager;
+import org.eclipse.objectteams.otdt.core.compiler.IOTConstants;
+import org.eclipse.objectteams.otdt.internal.core.MethodMapping;
+import org.eclipse.objectteams.otdt.internal.core.OTJavaElement;
+import org.eclipse.objectteams.otdt.internal.core.OTType;
+import org.eclipse.objectteams.otdt.internal.ui.Messages;
+import org.eclipse.objectteams.otdt.ui.ImageManager;
+
+
+
+import static org.eclipse.jdt.ui.JavaElementLabels.PREPEND_ROOT_PATH;
+import static org.eclipse.jdt.ui.JavaElementLabels.ROOT_QUALIFIED;
+import static org.eclipse.jdt.ui.JavaElementLabels.COLORIZE;
+import static org.eclipse.jdt.ui.JavaElementLabels.CONCAT_STRING;
+import static org.eclipse.jdt.ui.JavaElementLabels.M_POST_QUALIFIED;
+import static org.eclipse.jdt.ui.JavaElementLabels.T_FULLY_QUALIFIED;
+import static org.eclipse.objectteams.otdt.internal.ui.viewsupport.DummyDecorator.*;
+import static org.eclipse.objectteams.otdt.ui.ImageConstants.*;
+
+import org.eclipse.jdt.internal.compiler.lookup.ExtraCompilerModifiers;
+import org.eclipse.jdt.internal.corext.refactoring.util.JavaElementUtil;
+import org.eclipse.jdt.internal.corext.util.JavaModelUtil;
+import org.eclipse.jdt.internal.ui.JavaPlugin;
+import org.eclipse.jdt.ui.text.IJavaColorConstants;
+
+import base org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider;
+import base org.eclipse.jdt.internal.ui.InterfaceIndicatorLabelDecorator;
+import base org.eclipse.jdt.ui.JavaElementImageDescriptor;
+import base org.eclipse.jdt.ui.JavaElementLabels;
+import base org.eclipse.jdt.ui.ProblemsLabelDecorator;
+
+/**
+ * Adapt icon presentation in the jdt ui to reflect also teams and roles.
+ * Also callin methods and method mappings are decorated appropriately.
+ *
+ * One method contains code copied from its base method.
+ *
+ * @author stephan
+ */
+@SuppressWarnings({"restriction","decapsulation","basecall"})
+public team class ViewAdaptor extends JFaceDecapsulator
+{
+ /** new, OT-specific adornment flag for methods. */
+ final static int CALLIN = 0x2000;
+ /** new, OT-specific adornment flag for types. */
+ final static int BOUND_ROLE = 0x4000; // must not clash with other bits in JavaElementImageDescriptor
+
+ // use this instance for lookup which decorations are enabled:
+ IDecoratorManager decoratorMgr = null;
+
+ /**
+ * This role extends the existing label provider with capabilities to show
+ * specific icons for OT elements.
+ *
+ * Technical note: in general the WorkbenchAdapter should take care of providing
+ * labels and images. This role handles only exceptional cases:
+ * - invocations bypassing getBaseImageDescriptor().
+ * - adornment computation does not use an adapter
+ */
+ protected class ImageProviderAdaptor playedBy JavaElementImageProvider
+ {
+ public ImageProviderAdaptor(JavaElementImageProvider javaElementImageProvider) {
+ // lazy init of team field:
+ if (decoratorMgr == null)
+ decoratorMgr= PlatformUI.getWorkbench().getDecoratorManager();
+ }
+
+ /**
+ * Role and Team images for a few more views (based on flags not element).
+ *
+ * Technical note: getTypeImageDescriptor et al. are called by
+ * numerous clients which do not use the IWorkbenchAdapter for rendering,
+ * so we indeed have to adapt this method despite the use if IWorkbenchAdapter in
+ * getBaseImageDescriptor.
+ */
+ static callin ImageDescriptor getClassImageDescriptor(int flags) {
+ String img = null;
+ if (Flags.isRole(flags)) {
+ if (Flags.isTeam(flags)) {
+ if (Flags.isProtected(flags))
+ img = TEAM_ROLE_PROTECTED_IMG;
+ else
+ img = TEAM_ROLE_IMG;
+ } else {
+ if (Flags.isProtected(flags))
+ img = ROLECLASS_PROTECTED_IMG;
+ else
+ img = ROLECLASS_IMG;
+ }
+ } else if (Flags.isTeam(flags)) {
+ img = TEAM_IMG;
+ }
+ if (img != null)
+ return ImageManager.getSharedInstance().getDescriptor(img);
+ return base.getClassImageDescriptor(flags);
+ }
+ /** Overriding. */
+ getClassImageDescriptor <- replace getClassImageDescriptor;
+ /** Overriding with parameter mapping. */
+ ImageDescriptor getClassImageDescriptor(int flags)
+ <- replace ImageDescriptor getInnerClassImageDescriptor(boolean a1, int flags)
+ with { flags <- flags }
+ ImageDescriptor getClassImageDescriptor(int flags)
+ <- replace ImageDescriptor getTypeImageDescriptor(boolean isInner, boolean isInInterfaceOrAnnotation, int flags, boolean useLightIcons)
+ with { flags <- flags }
+
+ callin ImageDescriptor getBaseImageDescriptor(IJavaElement element) {
+ String name = element.getElementName();
+ if (name.startsWith(String.valueOf(IOTConstants.BASE_PREDICATE_PREFIX))) {
+ return ImageManager.getSharedInstance().getDescriptor(BASEGUARD_IMG);
+ } else if (name.startsWith(String.valueOf(IOTConstants.PREDICATE_METHOD_NAME))) {
+ return ImageManager.getSharedInstance().getDescriptor(GUARD_IMG);
+ }
+ return base.getBaseImageDescriptor(element);
+ }
+
+ ImageDescriptor getBaseImageDescriptor(IJavaElement element)
+ <- replace ImageDescriptor getJavaImageDescriptor(IJavaElement element, int renderFlags)
+ base when (element.getElementType() == IJavaElement.METHOD);
+
+ /**
+ * Add OT-specific adornment flags: CALLIN and BOUND_ROLE
+ */
+ callin int computeJavaAdornmentFlags(IJavaElement element, int renderFlags)
+ {
+ int flags = base.computeJavaAdornmentFlags(element, renderFlags);
+ if (showOverlayIcons(renderFlags) && element instanceof IMember) {
+ try {
+ if (element instanceof IMethod) {
+ if ((((IMethod)element).getFlags() & Flags.AccCallin) != 0)
+ flags |= CALLIN;
+ } else if (element instanceof IType) {
+ IOTType otType = OTModelManager.getOTElement((IType)element);
+ if (otType != null && otType.isRole()) {
+ IRoleType roleType = (IRoleType)otType;
+ if (isBoundRole(roleType))
+ flags |= BOUND_ROLE;
+ if (isOverriding(roleType))
+ flags |= org.eclipse.jdt.ui.JavaElementImageDescriptor.OVERRIDES;
+ }
+ }
+ } catch (JavaModelException ex) {
+ // do nothing. Can't compute runnable adornment or get flags
+ }
+ }
+ return flags;
+ }
+ /** Overriding. */
+ computeJavaAdornmentFlags <- replace computeJavaAdornmentFlags;
+
+ boolean isBoundRole(IRoleType roleType) throws JavaModelException {
+ if (!decoratorMgr.getEnabled(BOUND_ROLE_DECORATOR_ID))
+ return false;
+ return roleType.getBaseClass() != null; // getBaseClass() also finds superBaseclass
+ }
+
+ boolean isOverriding(IRoleType roleType) throws JavaModelException {
+ if (!decoratorMgr.getEnabled(OVERRIDING_ROLE_DECORATOR_ID))
+ return false; // disabled
+ if ((roleType.getFlags() & ExtraCompilerModifiers.AccOverriding) != 0)
+ return true; // stored flag
+ return roleType.getTSuperRoles().length > 0; // need to compute
+ }
+
+ /**
+ * Refine strategy to determine if an abstract marker should be added.
+ * OT_COPY_PASTE from this role's base class.
+ */
+ static callin boolean confirmAbstract(IMember element) throws JavaModelException
+ {
+ // never show the abstract symbol on interfaces or members in interfaces
+ int elementType = element.getElementType();
+ if (elementType == IJavaElement.TYPE
+// {OTDTUI :
+ || elementType == OTJavaElement.TEAM
+ || elementType == OTJavaElement.ROLE) {
+// haebor}
+ return ! JavaModelUtil.isInterfaceOrAnnotation((IType) element);
+ }
+
+ return ! JavaModelUtil.isInterfaceOrAnnotation(element.getDeclaringType())
+// {OTDTUI:
+ || OTModelManager.belongsToRole(element);
+// carp}
+ }
+ /** Overriding. */
+ confirmAbstract <- replace confirmAbstract;
+
+ // ===== callout: =====
+ boolean showOverlayIcons(int flags) -> boolean showOverlayIcons(int flags);
+ }
+
+ protected class JavaElementLabels playedBy JavaElementLabels
+ {
+ // copies from JavaElementLabelComposer:
+ // - constant:
+ final static long QUALIFIER_FLAGS= org.eclipse.jdt.ui.JavaElementLabels.P_COMPRESSED | org.eclipse.jdt.ui.JavaElementLabels.USE_RESOLVED;
+ // - helper function:
+ static final boolean getFlag(long flags, long flag) {
+ return (flags & flag) != 0;
+ }
+
+ // callouts:
+ void getTypeLabel(IType type, long flags, StringBuffer result)
+ -> void getTypeLabel(IType type, long flags, StringBuffer result);
+ void getTypeLabel(IType type, long flags, StyledString result)
+ -> void getTypeLabel(IType type, long flags, StyledString result);
+ void getPackageFragmentRootLabel(IPackageFragmentRoot pack, long flags, StyledString result)
+ -> void getPackageFragmentRootLabel(IPackageFragmentRoot pack, long flags, StyledString result);
+
+
+ /** If buf holds a name containing __OT__ remove that part. */
+ static void beautifyOTLabel(StringBuffer buf) {
+ String value = buf.toString();
+ int start = value.lastIndexOf('.');
+ if (start < 0)
+ start = 0;
+ else
+ start = start + 1;
+ if (value.startsWith(IOTConstants.OT_DELIM, start))
+ buf.delete(start, start+IOTConstants.OT_DELIM_LEN);
+ }
+ void beautifyOTLabel(StringBuffer buf) <- after void getTypeLabel(IType type, long flags, StringBuffer buf)
+ with { buf <- buf }
+ void beautifyOTLabel(StringBuffer buf) <- after void getMethodLabel(IMethod method, long flags, StringBuffer buf)
+ with { buf <- buf }
+
+ /** handle guard predicate names. */
+ static callin void beautifyGuardLabel(IMethod method, long flags, StyledString builder) {
+ String name = method.getElementName();
+ String displayName = null;
+ String guardedElement = null;
+ if (name.startsWith(String.valueOf(IOTConstants.BASE_PREDICATE_PREFIX))) {
+ displayName = "base when"; //$NON-NLS-1$
+ guardedElement = getGuardString(name.substring(IOTConstants.BASE_PREDICATE_PREFIX.length), method);
+ } else if (name.startsWith(String.valueOf(IOTConstants.PREDICATE_METHOD_NAME))) {
+ displayName = "when"; //$NON-NLS-1$
+ guardedElement = getGuardString(name.substring(IOTConstants.PREDICATE_METHOD_NAME.length), method);
+ }
+ if (displayName != null) {
+ // displayName as keyword:
+ final Color keywordColor = ViewAdaptor.this.getKeywordColor();
+ builder.append(displayName, new StyledString.Styler() {
+ @Override public void applyStyles(TextStyle textStyle) {
+ textStyle.foreground = keywordColor;
+ }
+ });
+ // append explanation:
+ builder.append(MessageFormat.format(Messages.ViewAdaptor_guard_predicate_postfix,
+ new Object[]{guardedElement}),
+ StyledString.QUALIFIER_STYLER);
+ } else {
+ base.beautifyGuardLabel(method, flags, builder);
+ }
+ }
+ private static String getGuardString(String suffix, IMethod method) {
+ if (suffix.length() == 0)
+ return method.getDeclaringType().getElementName();
+ StringTokenizer tokens = new StringTokenizer(suffix, "$"); //$NON-NLS-1$
+ String roleSelector = tokens.nextToken();
+ tokens.nextToken(); // modifier, unused
+ String baseSelector = tokens.nextToken();
+ return roleSelector+"<-"+baseSelector; //$NON-NLS-1$
+ }
+ void beautifyGuardLabel(IMethod method, long flags, StyledString builder)
+ <- replace void getMethodLabel(IMethod method, long flags, StyledString builder);
+
+ void getElementLabel(IJavaElement element, long flags, StringBuffer buf)
+ <- replace void getElementLabel(IJavaElement element, long flags, StringBuffer buf);
+ static callin void getElementLabel(IJavaElement element, long flags, StringBuffer buf)
+ {
+ base.getElementLabel(element, flags, buf);
+
+ if (element instanceof IMethodMapping) {
+ // to this point only elementName() is used, may need to append qualification:
+ if (getFlag(flags, M_POST_QUALIFIED)) {
+ buf.append(CONCAT_STRING);
+ getTypeLabel(((IMethodMapping)element).getDeclaringType(), T_FULLY_QUALIFIED | (flags & QUALIFIER_FLAGS), buf);
+ }
+ }
+ }
+
+
+ void getElementLabel(IJavaElement element, long flags, StyledString res)
+ <- replace void getElementLabel(IJavaElement element, long flags, StyledString res);
+
+ static callin void getElementLabel(IJavaElement element, long flags, StyledString result) {
+ int type= element.getElementType();
+ switch (type) {
+ case IOTJavaElement.CALLIN_MAPPING:
+ case IOTJavaElement.CALLOUT_MAPPING:
+ case IOTJavaElement.CALLOUT_TO_FIELD_MAPPING:
+ break; // implementation is below
+ default:
+ base.getElementLabel(element, flags, result);
+ return;
+ }
+
+ IPackageFragmentRoot root= null;
+
+ if (type != IJavaElement.JAVA_MODEL && type != IJavaElement.JAVA_PROJECT && type != IJavaElement.PACKAGE_FRAGMENT_ROOT)
+ root= JavaModelUtil.getPackageFragmentRoot(element);
+ if (root != null && getFlag(flags, PREPEND_ROOT_PATH)) {
+ getPackageFragmentRootLabel(root, ROOT_QUALIFIED, result);
+ result.append(CONCAT_STRING);
+ }
+ getMethodMappingLabel((IMethodMapping)element, flags, result);
+ }
+
+
+ private static void getMethodMappingLabel(IMethodMapping element, long flags, StyledString result) {
+
+ result.append(element.getElementName());
+
+ // post qualification
+ if (getFlag(flags, M_POST_QUALIFIED)) {
+ int offset= result.length();
+ result.append(CONCAT_STRING);
+ getTypeLabel(element.getDeclaringType(), T_FULLY_QUALIFIED | (flags & QUALIFIER_FLAGS), result);
+ if (getFlag(flags, COLORIZE)) {
+ result.setStyle(offset, result.length() - offset, StyledString.QUALIFIER_STYLER);
+ }
+ }
+ }
+
+ }
+
+ /** Helper for {@link JavaElementLabels#beautifyGuardLabel()} retrieve and cache keyword color. */
+ Color keywordColor = null;
+ Color getKeywordColor() {
+ if (keywordColor == null) {
+ RGB rgb= PreferenceConverter.getColor(JavaPlugin.getDefault().getPreferenceStore(), IJavaColorConstants.JAVA_KEYWORD);
+ keywordColor = new Color(Display.getCurrent(), rgb);
+ }
+ return keywordColor;
+ }
+
+ /**
+ * This role extends "Java Type Indicators" (icons overlayed on CUD-icons)
+ * to also support teams and roles.
+ */
+ protected class OTClassLabelDecorator playedBy InterfaceIndicatorLabelDecorator
+ {
+ PretendAllRoleFilesArePublic pretendAllRoleFilesArePublic = new PretendAllRoleFilesArePublic();
+
+ /** Overriding. */
+ getOverlay <- replace getOverlay;
+ callin ImageDescriptor getOverlay(Object element) throws JavaModelException
+ {
+ IType type = getMainType(element);
+ if (type == null)
+ // base uses index search, needs a little help from us ;-)
+ within (pretendAllRoleFilesArePublic)
+ return base.getOverlay(element);
+ IOTType otType = OTModelManager.getOTElement(type);
+ if (otType != null) {
+ String img = null;
+ if (otType.isRole()) {
+ if (otType.isTeam())
+ img = TEAM_ROLE_OVR;
+ else
+ img = ROLE_OVR;
+ } else if (otType.isTeam()) {
+ img = TEAM_OVR;
+ }
+ if (img != null)
+ return ImageManager.getSharedInstance().getDescriptor(img);
+ }
+ return base.getOverlay(type);
+ }
+
+ /* Overriding */
+ getOverlayFromFlags <- replace getOverlayFromFlags;
+ callin ImageDescriptor getOverlayFromFlags(int flags) {
+ // FIXME(SH): this might be incomplete: do flags always contain role/team??
+ String img = null;
+ if (Flags.isRole(flags)) {
+ if (Flags.isTeam(flags))
+ img = TEAM_ROLE_OVR;
+ else
+ img = ROLE_OVR;
+ } else if (Flags.isTeam(flags)) {
+ img = TEAM_OVR;
+ }
+ if (img != null)
+ return ImageManager.getSharedInstance().getDescriptor(img);
+ return base.getOverlayFromFlags(flags);
+ }
+
+ /** By use of the DecoratorManagerAdaptor we may indeed receive package fragments,
+ * which the base plugin doesn't expect here (argument `element').
+ * So we have to adapt the query for the element's main type:
+ */
+ IType getMainType(Object element) throws JavaModelException
+ {
+ // if element is a team package it's main type is the team type.
+ if (element instanceof IPackageFragment) {
+ ICompilationUnit teamUnit = TeamPackageUtil.getTeamUnit((IPackageFragment)element);
+ IType teamType = JavaElementUtil.getMainType(teamUnit);
+ if (teamType != null)
+ return teamType;
+ }
+ return null;
+ }
+ }
+
+ /**
+ * This role draws the CALLIN adornment if requested.
+ */
+ protected class ElementImageDescriptor extends CompositeImageDescriptor playedBy JavaElementImageDescriptor
+ {
+ private int deltaX = 0; // adjustment to pass into the JDT/UI
+
+ /** Add two more adornments while drawing: callin (for methods) and bound (for roles). */
+ drawTopRight <- replace drawTopRight
+ base when ((base.getAdronments() & (BOUND_ROLE|CALLIN)) != 0);
+ callin void drawTopRight() {
+ int currentX = getSize().x;
+ int flags = getAdornments();
+ // when drawing right-to-left start with our adornments:
+ if ((flags & BOUND_ROLE) != 0)
+ currentX -= drawRightToLeft(BOUNDROLE_IMG, currentX);
+ if ((flags & CALLIN) != 0)
+ currentX -= drawRightToLeft(CALLINMETHOD_IMG, currentX);
+ base.drawTopRight(); // during this call adjustX<-addTopRightImage is still active.
+ }
+ /**
+ * Draw an image from right to left.
+ * @param imageKey identification of the image to draw
+ * @param x x position for right-alignment
+ * @return width drawn
+ */
+ private int drawRightToLeft(String imageKey, int x) {
+ ImageData data= getImageData(ImageManager.getSharedInstance().getDescriptor(imageKey));
+ drawImage(data, x-data.width, 0);
+ deltaX += data.width;
+ return data.width;
+ }
+
+ void adjustX(ImageDescriptor desc, Point pos) <- before void addTopRightImage(ImageDescriptor desc, Point pos)
+ base when (ViewAdaptor.this.isExecutingCallin()); // only during drawTopRight callin
+ private void adjustX(ImageDescriptor desc, Point pos) {
+ if (deltaX != 0) {
+ pos.x -= deltaX; // don't overwrite the image we have drawn in drawTopRight()
+ deltaX = 0;
+ }
+ }
+
+ // ===== callout interface: =====
+ int getAdornments() -> int getAdronments(); // note: typo in jdt.ui
+ org.eclipse.swt.graphics.Point getSize() -> org.eclipse.swt.graphics.Point getSize();
+ ImageData getImageData(ImageDescriptor descriptor) -> ImageData getImageData(ImageDescriptor descriptor);
+ }
+
+ /** Add error/warning decorations to OT elements: */
+ protected class ProblemsLabelDecorator playedBy ProblemsLabelDecorator
+ {
+ callin int computeAdornmentFlags(Object obj)
+ {
+ class FakedMethodMapping extends MethodMapping {
+ FakedMethodMapping (MethodMapping orig) {
+ super(orig.getDeclarationSourceStart(), orig.getSourceStart(),
+ orig.getSourceEnd(), orig.getDeclarationSourceEnd(),
+ IJavaElement.METHOD, // <-- pretend to be a method
+ (IMethod)orig.getCorrespondingJavaElement(),
+ (IType)orig.getParent(),
+ orig.getRoleMethodHandle(),
+ orig.hasSignature(), /*addAsChild*/false);
+ }
+ public int getMappingKind() { return 0; /* don't care.*/ }
+ public OTJavaElement resolved(char[] uniqueKey) { return null; /* don't care*/ }
+ protected void getBaseMethodsForHandle(StringBuffer buff) { /* don't care */}
+ protected char getMappingKindChar() { return 'o'; }
+ }
+
+ class FakedType extends OTType {
+ FakedType(OTType orig) {
+ super(IJavaElement.TYPE, // <-- pretend to be a regular type
+ (IType)orig.getCorrespondingJavaElement(),
+ orig.getParent(), orig.getFlags(),
+ false); // don't add to the parent, element should not be persistent!
+ }
+ }
+
+ if (obj instanceof IJavaElement) {
+ IJavaElement element= (IJavaElement) obj;
+ int type= element.getElementType();
+ switch (type) {
+ case IOTJavaElement.CALLOUT_MAPPING:
+ case IOTJavaElement.CALLOUT_TO_FIELD_MAPPING:
+ case IOTJavaElement.CALLIN_MAPPING:
+ obj = new FakedMethodMapping((MethodMapping)obj);
+ break;
+ case IOTJavaElement.TEAM:
+ case IOTJavaElement.ROLE:
+ obj = new FakedType((OTType)obj);
+ break;
+ }
+ }
+ return base.computeAdornmentFlags(obj);
+ }
+ computeAdornmentFlags <- replace computeAdornmentFlags;
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.pde.ui/.classpath b/plugins/org.eclipse.objectteams.otdt.pde.ui/.classpath
new file mode 100644
index 000000000..987380a81
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.pde.ui/.classpath
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <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="con" path="OTRE"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/org.eclipse.objectteams.otdt.pde.ui/.project b/plugins/org.eclipse.objectteams.otdt.pde.ui/.project
new file mode 100644
index 000000000..e948e686b
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.pde.ui/.project
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.objectteams.otdt.pde.ui</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.objectteams.otdt.builder.OTJBuilder</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>org.objectteams.otdt.OTJavaNature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/org.eclipse.objectteams.otdt.pde.ui/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.objectteams.otdt.pde.ui/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..14f0b6f67
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.pde.ui/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,21 @@
+#Tue Sep 18 18:30:43 CEST 2007
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
+org.objectteams.otdt.compiler.option.joinpoint_queries=disabled
+org.objectteams.otdt.compiler.option.scoped_keywords=enabled
+org.objectteams.otdt.compiler.problem.abstract_potential_relevant_role=warning
+org.objectteams.otdt.compiler.problem.basecall=warning
+org.objectteams.otdt.compiler.problem.binding_conventions=error
+org.objectteams.otdt.compiler.problem.decapsulation=warning
+org.objectteams.otdt.compiler.problem.deprecated_path_syntax=warning
+org.objectteams.otdt.compiler.problem.effectless_fieldaccess=warning
+org.objectteams.otdt.compiler.problem.fragile_callin=warning
+org.objectteams.otdt.compiler.problem.incomplete_build=error
+org.objectteams.otdt.compiler.problem.inferred_callout=error
+org.objectteams.otdt.compiler.problem.potential_ambiguous_playedby=warning
+org.objectteams.otdt.compiler.problem.unsafe_liftctor=warning
+org.objectteams.otdt.compiler.problem.unused_parammap=warning
diff --git a/plugins/org.eclipse.objectteams.otdt.pde.ui/META-INF/MANIFEST.MF b/plugins/org.eclipse.objectteams.otdt.pde.ui/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..51c2222d5
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.pde.ui/META-INF/MANIFEST.MF
@@ -0,0 +1,27 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: OTPDEUI Plug-in
+Bundle-SymbolicName: org.eclipse.objectteams.otdt.pde.ui;singleton:=true
+Bundle-Version: 1.4.0.qualifier
+Bundle-Activator: org.eclipse.objectteams.otdt.internal.pde.ui.OTPDEUIPlugin
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.core.resources,
+ org.eclipse.pde.ui,
+ org.eclipse.ui.ide,
+ org.eclipse.debug.core,
+ org.eclipse.debug.ui,
+ org.eclipse.jdt.core,
+ org.eclipse.objectteams.otdt,
+ org.eclipse.objectteams.otdt.debug,
+ org.eclipse.objectteams.otequinox,
+ org.eclipse.objectteams.otdt.ui,
+ org.eclipse.ui.forms,
+ org.eclipse.jdt.ui,
+ org.eclipse.search,
+ org.eclipse.pde.api.tools.ui;bundle-version="1.0.200"
+Bundle-ActivationPolicy: lazy
+Bundle-Localization: plugin
+Bundle-Vendor: The TOPPrax consortium
+Export-Package: org.eclipse.objectteams.otdt.internal.pde.ui
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/plugins/org.eclipse.objectteams.otdt.pde.ui/build.properties b/plugins/org.eclipse.objectteams.otdt.pde.ui/build.properties
new file mode 100644
index 000000000..cff4459f5
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.pde.ui/build.properties
@@ -0,0 +1,11 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ plugin.xml,\
+ icons/,\
+ .,\
+ plugin.properties
+src.includes = .classpath,\
+ .project,\
+ build.properties,\
+ plugin.properties
diff --git a/plugins/org.eclipse.objectteams.otdt.pde.ui/icons/ot/newotpprj_obj.gif b/plugins/org.eclipse.objectteams.otdt.pde.ui/icons/ot/newotpprj_obj.gif
new file mode 100644
index 000000000..98fb8a0ed
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.pde.ui/icons/ot/newotpprj_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.pde.ui/icons/ot/plugin_forcedExports.png b/plugins/org.eclipse.objectteams.otdt.pde.ui/icons/ot/plugin_forcedExports.png
new file mode 100644
index 000000000..677e9b4f7
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.pde.ui/icons/ot/plugin_forcedExports.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.pde.ui/icons/ot/wizard/newotpprj_wiz.png b/plugins/org.eclipse.objectteams.otdt.pde.ui/icons/ot/wizard/newotpprj_wiz.png
new file mode 100644
index 000000000..a4cdb8194
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.pde.ui/icons/ot/wizard/newotpprj_wiz.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.pde.ui/plugin.properties b/plugins/org.eclipse.objectteams.otdt.pde.ui/plugin.properties
new file mode 100644
index 000000000..b3162b8c8
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.pde.ui/plugin.properties
@@ -0,0 +1,5 @@
+# wizard:
+new.OTPluginProject.description=Create an Object Teams Plug-in Project
+
+# context menu:
+menu.addOTSupport.label=Add Object Teams support \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.pde.ui/plugin.xml b/plugins/org.eclipse.objectteams.otdt.pde.ui/plugin.xml
new file mode 100644
index 000000000..cc0b0d52a
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.pde.ui/plugin.xml
@@ -0,0 +1,122 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+
+ <!-- === Wizard: === -->
+ <extension
+ point="org.eclipse.ui.newWizards">
+ <wizard
+ category="org.eclipse.objectteams.otdt.ui.wizards"
+ class="org.eclipse.objectteams.otdt.internal.pde.ui.OTNewPluginProjectWizard"
+ finalPerspective="org.eclipse.objectteams.otdt.ui.OTJavaPerspective"
+ icon="icons/ot/newotpprj_obj.gif"
+ id="org.eclipse.objectteams.otdt.pde.ui.wizards.OTNewPluginProjectWizard"
+ name="Object Teams Plug-in Project "
+ preferredPerspectives="org.eclipse.objectteams.otdt.ui.OTJavaPerspective"
+ project="true">
+ <description>
+ %new.OTPluginProject.description
+ </description>
+ </wizard>
+ </extension>
+
+ <!-- === Aspects: === -->
+ <extension
+ point="org.eclipse.objectteams.otequinox.aspectBindings">
+ <aspectBinding
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/calloutbinding_obj.gif">
+ <basePlugin id="org.eclipse.pde.ui"
+ icon="platform:/plugin/org.eclipse.pde.ui/icons/obj16/plugin_obj.gif"/>
+ <team
+ activation="NONE"
+ class="org.eclipse.objectteams.otdt.internal.pde.ui.OTPluginDependenciesAdapter"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif"/>
+ <team
+ activation="ALL_THREADS"
+ class="org.eclipse.objectteams.otdt.internal.pde.ui.ExtensionEditorAdaptor"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif">
+ </team>
+ <team
+ activation="ALL_THREADS"
+ class="org.eclipse.objectteams.otdt.internal.pde.validation.BundleValidation"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif">
+ </team>
+ </aspectBinding>
+ <aspectBinding
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/calloutbinding_obj.gif">
+ <basePlugin
+ icon="platform:/plugin/org.eclipse.pde.ui/icons/obj16/plugin_obj.gif"
+ id="org.eclipse.pde.core">
+ </basePlugin>
+ <team
+ activation="ALL_THREADS"
+ class="org.eclipse.objectteams.otdt.internal.pde.ui.ClasspathComputerAdapter"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif">
+ </team>
+ <team
+ activation="ALL_THREADS"
+ class="org.eclipse.objectteams.otdt.internal.pde.validation.BundleValidation"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif">
+ </team>
+ <team
+ activation="ALL_THREADS"
+ class="org.eclipse.objectteams.otdt.internal.pde.ui.PackageExplorerAdaptor"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif">
+ </team>
+ </aspectBinding>
+ <aspectBinding
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/calloutbinding_obj.gif">
+ <basePlugin
+ icon="platform:/plugin/org.eclipse.pde.ui/icons/obj16/plugin_obj.gif"
+ id="org.eclipse.jdt.ui">
+ </basePlugin>
+ <team
+ activation="ALL_THREADS"
+ class="org.eclipse.objectteams.otdt.internal.pde.ui.PackageExplorerAdaptor"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif">
+ </team>
+ </aspectBinding>
+ <aspectBinding
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/calloutbinding_obj.gif">
+ <basePlugin
+ icon="platform:/plugin/org.eclipse.pde.ui/icons/obj16/plugin_obj.gif"
+ id="org.eclipse.pde.api.tools.ui">
+ </basePlugin>
+ <team
+ activation="ALL_THREADS"
+ class="org.eclipse.objectteams.otdt.internal.pde.ui.ApiToolsAdapter"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif">
+ </team>
+ </aspectBinding>
+ </extension>
+ <extension
+ point="org.eclipse.ui.popupMenus">
+ <objectContribution
+ adaptable="true"
+ id="org.eclipse.objectteams.otdt.pde.ui.objectContribution1"
+ nameFilter="*"
+ objectClass="org.eclipse.core.resources.IProject">
+ <action
+ class="org.eclipse.objectteams.otdt.internal.pde.ui.ToggleOTSupportAction"
+ enablesFor="+"
+ id="org.eclipse.objectteams.otdt.pde.ui.toggleOTSupportAction"
+ label="%menu.addOTSupport.label"
+ menubarPath="org.eclipse.ui.projectConfigure/additions">
+ </action>
+ <visibility>
+ <and>
+ <objectState
+ name="projectNature"
+ value="org.eclipse.jdt.core.javanature">
+ </objectState>
+ <not>
+ <objectState
+ name="projectNature"
+ value="org.eclipse.objectteams.otdt.OTJavaNature">
+ </objectState>
+ </not>
+ </and>
+ </visibility>
+ </objectContribution>
+ </extension>
+</plugin>
diff --git a/plugins/org.eclipse.objectteams.otdt.pde.ui/src/org/eclipse/objectteams/otdt/internal/pde/ui/ApiToolsAdapter.java b/plugins/org.eclipse.objectteams.otdt.pde.ui/src/org/eclipse/objectteams/otdt/internal/pde/ui/ApiToolsAdapter.java
new file mode 100644
index 000000000..a24b78c4a
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.pde.ui/src/org/eclipse/objectteams/otdt/internal/pde/ui/ApiToolsAdapter.java
@@ -0,0 +1,38 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2009 Stephan Herrmann.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id$
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Stephan Herrmann - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.pde.ui;
+
+import org.eclipse.objectteams.otdt.core.IOTJavaElement;
+
+import base org.eclipse.pde.api.tools.ui.internal.JavaElementActionFilter;
+
+@SuppressWarnings("restriction")
+public team class ApiToolsAdapter {
+
+ /** Protect one more hard coded switch-case against unexpected OT elements. */
+ protected class FilterAdaptor playedBy JavaElementActionFilter {
+
+ testAttribute <- replace testAttribute;
+
+ callin boolean testAttribute(Object target) {
+ if (target instanceof IOTJavaElement)
+ // treat OT elements via their java correspondence:
+ target = ((IOTJavaElement)target).getCorrespondingJavaElement();
+ return base.testAttribute(target);
+ }
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.pde.ui/src/org/eclipse/objectteams/otdt/internal/pde/ui/AspectBindingsTreeNode.java b/plugins/org.eclipse.objectteams.otdt.pde.ui/src/org/eclipse/objectteams/otdt/internal/pde/ui/AspectBindingsTreeNode.java
new file mode 100644
index 000000000..a4fdb54ce
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.pde.ui/src/org/eclipse/objectteams/otdt/internal/pde/ui/AspectBindingsTreeNode.java
@@ -0,0 +1,128 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2009 Stephan Herrmann.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: AspectBindingsTreeNode.java 23470 2010-02-05 19:13:24Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Stephan Herrmann - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.pde.ui;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.objectteams.otequinox.Constants;
+import org.eclipse.pde.core.plugin.IPluginModelBase;
+import org.eclipse.pde.core.plugin.IPluginObject;
+import org.eclipse.pde.internal.core.plugin.PluginElement;
+
+/**
+ * Nodes for representing aspect bindings in the package explorer.
+ * @author stephan
+ * @since 1.3.2
+ */
+@SuppressWarnings("restriction")
+public abstract class AspectBindingsTreeNode {
+ IJavaProject javaProject;
+}
+
+// ========== follows: concrete subclasses ==========
+
+ class AspectBindingsRootNode extends AspectBindingsTreeNode
+ {
+ static final String ASPECT_BINDINGS_NAME = "OT/Equinox Aspect Bindings";
+ protected IPluginModelBase pluginModel;
+ public AspectBindingsRootNode(IJavaProject javaProject, IPluginModelBase pluginModel) {
+ this.javaProject = javaProject;
+ this.pluginModel = pluginModel;
+ }
+ @Override
+ public String toString() {
+ return "~"+ASPECT_BINDINGS_NAME; // prepend "~" to make sorting a bit more deterministic, should we encounter CUDs at toplevel
+ }
+ }
+
+ /** Represents the aspect bindings for one base plugin. */
+ @SuppressWarnings("restriction")
+ class BasePluginNode extends AspectBindingsTreeNode
+ {
+ protected String basePlugin;
+ boolean hasForcedExports = false;
+ PluginElement element;
+ Object[] teams = null;
+
+ public BasePluginNode(IJavaProject javaProject, PluginElement element) {
+ this.javaProject = javaProject;
+ this.element = element;
+ for (IPluginObject child : element.getChildren()) {
+ if (child instanceof PluginElement) {
+ if (Constants.BASE_PLUGIN.equals(child.getName())) {
+ this.basePlugin = ((PluginElement)child).getAttribute("id").getValue();
+ for (IPluginObject subChild : ((PluginElement)child).getChildren())
+ if (Constants.FORCED_EXPORTS_ELEMENT.equals(((PluginElement)subChild).getName()))
+ this.hasForcedExports = true;
+ break;
+ }
+ }
+ }
+ }
+ /** Add the teams of other to this node. */
+ protected void merge(BasePluginNode other) {
+ Object[] myTeams = getTeams();
+ Object[] otherTeams = other.getTeams();
+ int l1=myTeams.length, l2=otherTeams.length;
+ teams = new Object[l1+l2];
+ System.arraycopy(myTeams, 0, this.teams, 0, l1);
+ System.arraycopy(otherTeams, 0, this.teams, l1, l2);
+ }
+ /** Get all teams adapting the base plugin represented by this node. */
+ protected Object[] getTeams() {
+ if (this.teams != null)
+ return this.teams;
+ List<Object> teams = new ArrayList<Object>();
+ for (IPluginObject child : element.getChildren())
+ if (child instanceof PluginElement)
+ if (Constants.TEAM.equals(child.getName()))
+ teams.add(new TeamNode(this.javaProject,
+ ((PluginElement)child).getAttribute("class").getValue()));
+ return this.teams = teams.toArray();
+ }
+ protected Object getPluginXml() {
+ return this.javaProject.getProject().findMember("plugin.xml");
+ }
+ }
+ /**
+ * Handle to a team referenced in an aspect binding,
+ * supports on demand resolving to an IType.
+ */
+ class TeamNode extends AspectBindingsTreeNode
+ {
+ protected String teamName;
+
+ protected TeamNode(IJavaProject javaProject, String teamName) {
+ this.javaProject = javaProject;
+ this.teamName = teamName;
+ }
+
+ protected IType getTeamType() {
+ try {
+ return this.javaProject.findType(this.teamName);
+ } catch (JavaModelException e) {
+ OTPDEUIPlugin.getDefault().getLog().log(
+ OTPDEUIPlugin.createErrorStatus("OpenAction: Cannot resolve team type '"+this.teamName+"'", e));
+ return null;
+ }
+ }
+ }
+
diff --git a/plugins/org.eclipse.objectteams.otdt.pde.ui/src/org/eclipse/objectteams/otdt/internal/pde/ui/ClasspathComputerAdapter.java b/plugins/org.eclipse.objectteams.otdt.pde.ui/src/org/eclipse/objectteams/otdt/internal/pde/ui/ClasspathComputerAdapter.java
new file mode 100644
index 000000000..ca63f704b
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.pde.ui/src/org/eclipse/objectteams/otdt/internal/pde/ui/ClasspathComputerAdapter.java
@@ -0,0 +1,89 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2008 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id$
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.pde.ui;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.objectteams.otdt.core.ext.OTJavaNature;
+import org.eclipse.objectteams.otdt.core.ext.OTREContainer;
+import org.eclipse.pde.core.plugin.IPluginModelBase;
+import org.eclipse.pde.internal.core.PDECore;
+
+import base org.eclipse.pde.internal.core.ClasspathComputer;
+
+/**
+ * This team handles classpath updating issues
+ * @author mosconi
+ * @since 1.2.4
+ */
+@SuppressWarnings("restriction")
+public team class ClasspathComputerAdapter {
+ protected class ClasspathComputer playedBy ClasspathComputer {
+
+ // re-add OTRE container for OT plug-in projects:
+ static void updateOTClasspath(IProject project) throws CoreException {
+ OTREContainer.initializeOTJProject(project);
+ sortClasspathEntries(project);
+ }
+ void updateOTClasspath(IProject project) <- after void setClasspath(IProject project, IPluginModelBase model)
+ when (OTJavaNature.hasOTJavaNature(project));
+ }
+
+ /**
+ * Make sure OTRE comes before requiredPlugins on the project's classpath.
+ * This is needed to ensure that org.objectteams.Team is accessible.
+ * When a project finds a dependent plugin which depends on otequinox,
+ * Team will be found via that project leading to an error because Team is
+ * not re-exported from an OT plugin project.
+ * @throws CoreException
+ */
+ public static void sortClasspathEntries(IProject project) throws CoreException {
+ IJavaProject javaProject= (IJavaProject) project.getNature(JavaCore.NATURE_ID);
+ IClasspathEntry[] entries= javaProject.getRawClasspath();
+ IClasspathEntry[] newEntries= new IClasspathEntry[entries.length];
+ IClasspathEntry requiredPlugins= null;
+ int newOTREPos= -1;
+ int j=0; // index into newEntries
+ for (int i = 0; i < entries.length; i++) {
+ if (entries[i].getEntryKind() == IClasspathEntry.CPE_CONTAINER) {
+ IPath containerPath= entries[i].getPath();
+ if (containerPath.equals(PDECore.REQUIRED_PLUGINS_CONTAINER_PATH)) {
+ requiredPlugins= entries[i];// store intermediate
+ newOTREPos= j++; // leave empty slot in newEntries
+ continue;
+ } else if (containerPath.segment(0).equals(OTREContainer.OTRE_CONTAINER_NAME)) {
+ if (newOTREPos>-1)
+ newEntries[newOTREPos]= entries[i];
+ else
+ return; // requiredPlugins was not found before OTRE
+ continue;
+ }
+ }
+ newEntries[j++]= entries[i];
+ }
+ if (newOTREPos > -1 && requiredPlugins != null && j<newEntries.length) {
+ newEntries[j]= requiredPlugins;
+ javaProject.setRawClasspath(newEntries, new NullProgressMonitor());
+ }
+ }
+
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.pde.ui/src/org/eclipse/objectteams/otdt/internal/pde/ui/ExtensionEditorAdaptor.java b/plugins/org.eclipse.objectteams.otdt.pde.ui/src/org/eclipse/objectteams/otdt/internal/pde/ui/ExtensionEditorAdaptor.java
new file mode 100644
index 000000000..dd9896e75
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.pde.ui/src/org/eclipse/objectteams/otdt/internal/pde/ui/ExtensionEditorAdaptor.java
@@ -0,0 +1,354 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2007, 2009 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: ExtensionEditorAdaptor.java 23470 2010-02-05 19:13:24Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.pde.ui;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IPackageFragmentRoot;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaConventions;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.core.search.IJavaSearchScope;
+import org.eclipse.jdt.core.search.SearchEngine;
+import org.eclipse.jdt.internal.core.DefaultWorkingCopyOwner;
+import org.eclipse.jdt.internal.core.search.HierarchyScope;
+import org.eclipse.jdt.ui.IJavaElementSearchConstants;
+import org.eclipse.jdt.ui.JavaUI;
+import org.eclipse.jdt.ui.wizards.NewTypeWizardPage;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.window.Window;
+import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.pde.core.plugin.IPluginAttribute;
+import org.eclipse.pde.core.plugin.IPluginBase;
+import org.eclipse.pde.core.plugin.IPluginElement;
+import org.eclipse.pde.core.plugin.IPluginExtension;
+import org.eclipse.pde.internal.core.ischema.IMetaAttribute;
+import org.eclipse.pde.internal.core.ischema.ISchema;
+import org.eclipse.pde.internal.core.ischema.ISchemaAttribute;
+import org.eclipse.pde.internal.core.ischema.ISchemaElement;
+import org.eclipse.pde.internal.core.plugin.PluginAttribute;
+import org.eclipse.pde.internal.core.schema.SchemaRegistry;
+import org.eclipse.pde.internal.core.util.IdUtil;
+import org.eclipse.pde.internal.core.util.PDEJavaHelper;
+import org.eclipse.pde.internal.ui.PDEPlugin;
+import org.eclipse.pde.internal.ui.PDEUIMessages;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.dialogs.SelectionDialog;
+import org.eclipse.objectteams.otdt.core.compiler.IOTConstants;
+import org.eclipse.objectteams.otdt.internal.ui.wizards.NewTeamWizardPage;
+import org.eclipse.objectteams.otdt.internal.ui.wizards.OTNewWizardMessages;
+import org.eclipse.objectteams.otdt.ui.ImageManager;
+import org.eclipse.objectteams.otdt.ui.OTDTUIPlugin;
+import org.eclipse.objectteams.otequinox.Constants;
+
+import base org.eclipse.pde.internal.ui.editor.plugin.ExtensionsSection;
+import base org.eclipse.pde.internal.ui.editor.plugin.JavaAttributeWizard;
+import base org.eclipse.pde.internal.ui.editor.plugin.rows.ClassAttributeRow;
+import base org.eclipse.pde.internal.ui.editor.text.XMLUtil;
+
+/**
+ * This team anticipates some fixes regarding the extension editor.
+ *
+ * @author stephan
+ */
+@SuppressWarnings({"restriction","decapsulation"})
+public team class ExtensionEditorAdaptor
+{
+ // role for XMLInsertionComputer obsoleted by patch in https://bugs.eclipse.org/bugs/show_bug.cgi?id=195763
+
+ /* avoid to use the icon attribute for the label, too. */
+ protected class ExtensionsSection playedBy ExtensionsSection
+ {
+ String resolveObjectName(SchemaRegistry schemaRegistry, Object obj) <- replace String resolveObjectName(SchemaRegistry schemaRegistry, Object obj);
+ @SuppressWarnings("basecall")
+ callin static String resolveObjectName(SchemaRegistry schemaRegistry, Object obj) {
+ boolean fullNames = PDEPlugin.isFullNameModeEnabled();
+ if (obj instanceof IPluginExtension) {
+ IPluginExtension extension = (IPluginExtension) obj;
+ if (!fullNames) {
+ return extension.getPoint();
+ }
+ if (extension.getName() != null)
+ return extension.getTranslatedName();
+ ISchema schema = schemaRegistry.getSchema(extension.getPoint());
+ // try extension point schema definition
+ if (schema != null) {
+ // exists
+ return schema.getName();
+ }
+ return extension.getPoint();
+ } else if (obj instanceof IPluginElement) {
+ IPluginElement element = (IPluginElement) obj;
+ String baseName = element.getName();
+ String fullName = null;
+ ISchemaElement elementInfo = getSchemaElement(element);
+ IPluginAttribute labelAtt = null;
+ if (elementInfo != null && elementInfo.getLabelProperty() != null) {
+ labelAtt = element.getAttribute(elementInfo.getLabelProperty());
+ }
+ if (labelAtt == null) {
+ // try some hard-coded attributes that
+ // are used frequently
+ for (int i = 0; i < getCOMMON_LABEL_PROPERTIES().length; i++) {
+ labelAtt = element.getAttribute(getCOMMON_LABEL_PROPERTIES()[i]);
+ if (labelAtt != null)
+ break;
+ }
+ if (labelAtt == null) {
+ // Last try - if there is only one attribute,
+ // use that
+ if (element.getAttributeCount() == 1)
+ labelAtt = element.getAttributes()[0];
+//{ObjectTeams: not if it the icon property:
+ if (isIconAttribute(labelAtt))
+ labelAtt = null;
+// SH}
+ }
+ }
+ if (labelAtt != null && labelAtt.getValue() != null)
+ fullName = stripShortcuts(labelAtt.getValue());
+ fullName = element.getResourceString(fullName);
+ if (fullNames)
+ return fullName != null ? fullName : baseName;
+ return fullName != null
+ ? (fullName + " (" + baseName + ")") //$NON-NLS-1$ //$NON-NLS-2$
+ : baseName;
+ }
+ return obj.toString();
+ }
+ private static boolean isIconAttribute(IPluginAttribute labelAtt) {
+ if (labelAtt == null || labelAtt.getName() == null)
+ return false;
+ if (!labelAtt.getName().equals("icon")) //$NON-NLS-1$
+ return false;
+ if (labelAtt instanceof PluginAttribute) {
+ PluginAttribute attribute = (PluginAttribute) labelAtt;
+ ISchemaAttribute info = attribute.getAttributeInfo();
+ if (info != null)
+ return info.getKind() == IMetaAttribute.RESOURCE;
+ }
+ return true;
+ }
+ String[] getCOMMON_LABEL_PROPERTIES() -> get String[] COMMON_LABEL_PROPERTIES;
+ ISchemaElement getSchemaElement(IPluginElement element) -> ISchemaElement getSchemaElement(IPluginElement element);
+ String stripShortcuts(String input) -> String stripShortcuts(String input);
+ }
+ /**
+ * This role anticipates a fix to https://bugs.eclipse.org/bugs/show_bug.cgi?id=61185
+ * Restricting type selection dialogs for extension details to the 'basedOn' type, if given.
+ * Although bug 61185 is partly fixed, this role also covers bug 215139.
+ */
+ protected class ClassAttributeRow playedBy ClassAttributeRow
+ {
+ IPluginBase getPluginBase() -> IPluginBase getPluginBase();
+ Text getText() -> get Text text;
+
+ doOpenSelectionDialog <- replace doOpenSelectionDialog;
+ @SuppressWarnings("basecall")
+ callin void doOpenSelectionDialog() {
+ String superType= null;
+ try {
+ ISchemaAttribute att= getAttribute();
+ superType= att.getBasedOn();
+ } catch (Throwable t) {
+ // e.g., a CCE in getAttribute()?
+ }
+ if (superType != null && superType.startsWith(":")) //$NON-NLS-1$
+ superType= superType.substring(1);
+ if (superType == null || "java.lang.Object".equals(superType)) { //$NON-NLS-1$
+ // if no useful super type was found do the normal thing:
+ base.doOpenSelectionDialog();
+ return;
+ }
+ IResource resource = getPluginBase().getModel().getUnderlyingResource();
+ String type = selectType(
+ resource,
+ IJavaElementSearchConstants.CONSIDER_CLASSES_AND_INTERFACES,
+ getText().getText(),
+ superType);
+ if (type != null)
+ getText().setText(type);
+ }
+ ISchemaAttribute getAttribute() -> get Object att
+ with { result <- (ISchemaAttribute)att }
+
+ // from PDEJavaHelperUI, added param supertype
+ static String selectType(IResource resource, int scope, String filter, String superTypeName)
+ {
+ if (resource == null) return null;
+ IProject project = resource.getProject();
+ try {
+ // create new scope (hierarchy):
+ IJavaSearchScope searchScope = null;
+ if (superTypeName != null && !superTypeName.equals("java.lang.Object")) { //$NON-NLS-1$
+ IJavaProject javaProject = JavaCore.create(project);
+ IType superType = javaProject.findType(superTypeName);
+ if (superType != null)
+ searchScope= SearchEngine.createHierarchyScope(javaProject, superType, true, true, DefaultWorkingCopyOwner.PRIMARY);
+ /* Eclipse version:
+ searchScope = SearchEngine.createHierarchyScope(superType);
+ */
+ }
+ if (searchScope == null)
+ searchScope = PDEJavaHelper.getSearchScope(project);
+
+ SelectionDialog dialog = JavaUI.createTypeDialog(
+ PDEPlugin.getActiveWorkbenchShell(),
+ PlatformUI.getWorkbench().getProgressService(),
+ searchScope,
+ //orig: PDEJavaHelper.getSearchScope(project),
+ scope,
+ false, "**"/*filter*/); //$NON-NLS-1$
+ dialog.setTitle(PDEUIMessages.ClassAttributeRow_dialogTitle);
+ if (dialog.open() == Window.OK) {
+ IType type = (IType) dialog.getResult()[0];
+ return type.getFullyQualifiedName('$');
+ }
+ } catch (JavaModelException e) {
+ }
+ return null;
+ }
+ }
+
+ /**
+ * This role adapts the PDE/UI's version of a NewTypeWizard as to use our
+ * NewTeamWizardPage when appropriate.
+ *
+ * @since 1.2.4
+ */
+ protected class JavaAttributeWizard playedBy JavaAttributeWizard
+ base when (base.fAttInfo != null && isBasedOnOOTeam(base.fAttInfo))
+ {
+ static boolean isBasedOnOOTeam(ISchemaAttribute attInfo) {
+ String basedOn = attInfo.getBasedOn();
+ if (basedOn == null)
+ return false;
+ return basedOn.equals(String.valueOf(IOTConstants.STR_ORG_OBJECTTEAMS_TEAM));
+ }
+
+ String getFClassName() -> get String fClassName;
+ IProject getFProject() -> get IProject fProject;
+ void setFMainPage(NewTypeWizardPage fMainPage) -> set NewTypeWizardPage fMainPage;
+ void addPage(IWizardPage arg0) -> void addPage(IWizardPage arg0);
+
+ void addNewTeamWizardPage() <- replace void addPages();
+
+ @SuppressWarnings("basecall")
+ callin void addNewTeamWizardPage() {
+ // use a new team wizard:
+ NewTeamWizardPage mainPage = new NewTeamWizardPage();
+
+ // init similar to base method:
+ setFMainPage(mainPage);
+ addPage(mainPage);
+ mainPage.init(null);
+
+ // since our wizard doesn't handle attribute info these inits are different:
+ initFields(mainPage, getFClassName(), getFProject());
+ }
+
+ void initFields(NewTeamWizardPage mainPage, String className, IProject project)
+ {
+ // set package and class names:
+ int loc = className.lastIndexOf('.');
+ if (loc != -1) {
+ mainPage.setPackageFragmentName(className.substring(0, loc));
+ mainPage.setTypeName(className.substring(loc+1));
+ } else {
+ mainPage.setTypeName(className);
+ }
+
+ // set source folder (in the vein of org.eclipse.pde.internal.ui.editor.plugin.JavaAttributeWizardPage):
+ IPackageFragmentRoot srcEntryDft = null;
+ IJavaProject javaProject = JavaCore.create(project);
+ IPackageFragmentRoot[] roots;
+ try {
+ roots = javaProject.getPackageFragmentRoots();
+ for (int i = 0; i < roots.length; i++) {
+ if (roots[i].getKind() == IPackageFragmentRoot.K_SOURCE) {
+ srcEntryDft = roots[i];
+ break;
+ }
+ }
+ } catch (JavaModelException e) {
+ // can't find source folder
+ }
+ if (srcEntryDft != null)
+ mainPage.setPackageFragmentRoot(srcEntryDft, true);
+ else
+ mainPage.setPackageFragmentRoot(javaProject.getPackageFragmentRoot(javaProject.getResource()), true);
+ }
+
+ // window title
+ void setWindowTitle(String newTitle) <- replace void setWindowTitle(String newTitle);
+
+ callin void setWindowTitle(String newTitle) {
+ base.setWindowTitle(OTNewWizardMessages.NewTeamCreationWizard_title);
+ }
+
+ // header image
+ void setDefaultPageImageDescriptor(ImageDescriptor imageDescriptor)
+ <- replace void setDefaultPageImageDescriptor(ImageDescriptor imageDescriptor);
+ callin void setDefaultPageImageDescriptor(ImageDescriptor imageDescriptor)
+ {
+ base.setDefaultPageImageDescriptor(OTDTUIPlugin.getDefault().getImageRegistry().getDescriptor(ImageManager.NEW_TEAM));
+ }
+ }
+
+ /** This role makes sure that the PDE UI does not invent names that are illegal in their respective context. */
+ protected class XMLUtil playedBy XMLUtil {
+
+ /**
+ * If the project name makes an illegal package name,
+ * and if the lower-cased class name is not legal either,
+ * try appending 's' until it is legal.
+ * (this occurred when the project name contained '-' and
+ * the class name was "Team" -> "team" is an illegal package name.
+ */
+ String createDefaultPackageName(IProject project) <- replace String createDefaultPackageName(IProject project, String className);
+
+ static callin String createDefaultPackageName(IProject project) {
+ String result = base.createDefaultPackageName(project);
+ IJavaProject javaProject = JavaCore.create(project);
+ String optionSrc = javaProject.getOption(JavaCore.COMPILER_SOURCE,true);
+ String optionCompliance = javaProject.getOption(JavaCore.COMPILER_COMPLIANCE, true);
+ IStatus valid;
+ while (true) {
+ valid = JavaConventions.validatePackageName(result, optionSrc, optionCompliance);
+ if (valid.isOK())
+ return result;
+ result += 's';
+ }
+ }
+
+ /**
+ * When generating a value for "basePlugin":
+ * if the project name contains illegal characters like '-' convert it to a valid bundle ID.
+ */
+ String createDefaultName() <- replace String createDefaultName(IProject project, ISchemaAttribute attInfo, int counter)
+ base when (Constants.BASE_PLUGIN.equals(attInfo.getParent().getName()));
+
+ static callin String createDefaultName() {
+ return IdUtil.getValidId(base.createDefaultName());
+ }
+
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.pde.ui/src/org/eclipse/objectteams/otdt/internal/pde/ui/ImageManager.java b/plugins/org.eclipse.objectteams.otdt.pde.ui/src/org/eclipse/objectteams/otdt/internal/pde/ui/ImageManager.java
new file mode 100644
index 000000000..333c74b18
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.pde.ui/src/org/eclipse/objectteams/otdt/internal/pde/ui/ImageManager.java
@@ -0,0 +1,59 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2007 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: DebugUIDialogAdaptor2.java 18886 2008-08-17 14:37:14Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.pde.ui;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+
+
+/**
+ * Provide cached access to images of this plugin.
+ *
+ * @author stephan
+ * @since 1.0.0
+ */
+public class ImageManager extends org.eclipse.objectteams.otdt.ui.ImageManager {
+
+ private static ImageManager _singleton;
+
+ /**
+ * Avoid multiple instances
+ */
+ protected ImageManager() {}
+
+ /**
+ * The only way to access plugin images
+ * @return PluginImages instance
+ */
+ public static ImageManager getSharedInstance() {
+ if (_singleton == null)
+ _singleton = new ImageManager();
+
+ return _singleton;
+ }
+
+ // overriding causes paths to be resolved relative to this plug-in.
+ @Override
+ protected AbstractUIPlugin getPlugin() {
+ return OTPDEUIPlugin.getDefault();
+ }
+
+ // specify which icons to register:
+ @Override
+ protected String[] pluginIcons() {
+ return new String[]{ OTNewPluginProjectWizard.NEW_OTPDE_PROJECT, PackageExplorerAdaptor.PLUGIN_FORCED_EXPORTS };
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.pde.ui/src/org/eclipse/objectteams/otdt/internal/pde/ui/OTEquinoxCommonLaunching.java b/plugins/org.eclipse.objectteams.otdt.pde.ui/src/org/eclipse/objectteams/otdt/internal/pde/ui/OTEquinoxCommonLaunching.java
new file mode 100644
index 000000000..742981b51
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.pde.ui/src/org/eclipse/objectteams/otdt/internal/pde/ui/OTEquinoxCommonLaunching.java
@@ -0,0 +1,83 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: OTEquinoxCommonLaunching.java 23470 2010-02-05 19:13:24Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.pde.ui;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.objectteams.otdt.debug.OTDebugPlugin;
+import org.eclipse.objectteams.otdt.debug.TeamBreakpointInstaller;
+
+/**
+ * Shared implementation of OTEclipseApplicationLaunchConfiguration and OTEquinoxLaunchConfiguration
+ *
+ * @author stephan
+ * @since OTDT 1.1.3
+ */
+public class OTEquinoxCommonLaunching
+{
+ static final String HOOK_CONFIGURATOR = "-Dosgi.hook.configurators.include=org.eclipse.objectteams.otequinox.hook.HookConfigurator";//$NON-NLS-1$
+ static final String CLASSLOADER_LOCKING = "-Dosgi.classloader.lock=classname"; //$NON-NLS-1$
+ static final String REPOSITORY_WORKAROUND = "-Dot.equinox"; //$NON-NLS-1$ // this causes the WORKAROUND_REPOSITORY flag being set to true in OTRE.
+ static final String OT_DEBUG_VMARG = "-Dot.debug"; //$NON-NLS-1$
+ static final String[] OT_VM_ARGS = { HOOK_CONFIGURATOR, CLASSLOADER_LOCKING, REPOSITORY_WORKAROUND };
+ static final String[] OT_VM_DEBUG_ARGS = { HOOK_CONFIGURATOR, CLASSLOADER_LOCKING, REPOSITORY_WORKAROUND, OT_DEBUG_VMARG };
+
+ static String[] extendVMArguments(String[] args, String mode) {
+ String[] otArgs = OT_VM_ARGS;
+ if (mode != null && mode.equals(ILaunchManager.DEBUG_MODE))
+ otArgs = OT_VM_DEBUG_ARGS;
+
+ if (args == null || args.length == 0)
+ return otArgs;
+
+ String[] combinedArgs = new String[args.length + otArgs.length];
+ System.arraycopy(args, 0, combinedArgs, 0, args.length);
+ System.arraycopy(otArgs, 0, combinedArgs, args.length, otArgs.length);
+ return combinedArgs;
+ }
+
+ static void installOOTBreakpoints(IProject[] projects)
+ throws CoreException
+ {
+ IJavaProject jp = null;
+ if (projects != null) {
+ for (IProject project : projects) {
+ // find org.objectteams.Team in any OT/J Project:
+ if (project.getNature(JavaCore.OTJ_NATURE_ID) != null) {
+ jp = JavaCore.create(project);
+ TeamBreakpointInstaller.installTeamBreakpoints(jp);
+ break;
+ }
+ }
+ }
+ if (jp == null)
+ OTDebugPlugin.getDefault().getLog().log(
+ new Status(Status.WARNING,
+ OTPDEUIPlugin.PLUGIN_ID,
+ 0,
+ OTPDEUIMessages.NoOTJPluginProject,
+ null));
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.pde.ui/src/org/eclipse/objectteams/otdt/internal/pde/ui/OTNewPluginProjectWizard.java b/plugins/org.eclipse.objectteams.otdt.pde.ui/src/org/eclipse/objectteams/otdt/internal/pde/ui/OTNewPluginProjectWizard.java
new file mode 100644
index 000000000..b4470b83b
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.pde.ui/src/org/eclipse/objectteams/otdt/internal/pde/ui/OTNewPluginProjectWizard.java
@@ -0,0 +1,88 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2009 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id$
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.pde.ui;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jface.dialogs.ErrorDialog;
+import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.pde.internal.ui.wizards.plugin.NewPluginProjectWizard;
+import org.eclipse.pde.internal.ui.wizards.plugin.NewProjectCreationPage;
+
+/**
+ * Wizard to create a plug-in project with OT/Equinox enabled (classpath, plugin dependency).
+ * @author resix
+ */
+@SuppressWarnings("restriction")
+public class OTNewPluginProjectWizard extends NewPluginProjectWizard {
+
+ static final String NEW_OTPDE_PROJECT = "wizard/newotpprj_wiz.png"; //$NON-NLS-1$
+
+ public OTNewPluginProjectWizard() {
+ super();
+ setDefaultPageImageDescriptor(OTPDEUIPlugin.getDefault().getImageRegistry().getDescriptor(NEW_OTPDE_PROJECT));
+ setWindowTitle(OTPDEUIMessages.NewOTPProjectWizard_title);
+ }
+
+ @Override
+ public void addPages() {
+ super.addPages();
+ IWizardPage mainPage= getPage("main"); //$NON-NLS-1$
+ if (mainPage != null)
+ mainPage.setTitle(OTPDEUIMessages.NewOTPProjectWizard_MainPage_title);
+ }
+
+ public boolean performFinish()
+ {
+ within (new OTPluginDependenciesAdapter()) {
+ if (!super.performFinish()) {
+ return false;
+ }
+ }
+
+ IWizardPage fMainPage = getPage("main"); //$NON-NLS-1$
+ if (fMainPage instanceof NewProjectCreationPage)
+ {
+ IProject project = ((NewProjectCreationPage)fMainPage).getProjectHandle();
+
+ try
+ {
+ OTPluginProject.makeOTPlugin(project);
+ ClasspathComputerAdapter.sortClasspathEntries(project);
+ return true;
+ }
+ catch (CoreException ex)
+ {
+ ErrorDialog.openError(getShell(),
+ OTPDEUIMessages.OTNewPluginProjectWizard_ProjectCreationError,
+ OTPDEUIMessages.OTNewPluginProjectWizard_CantAddOTSpecifics,
+ ex.getStatus());
+ OTPDEUIPlugin.getDefault().getLog().log(OTPDEUIPlugin.createErrorStatus("Project creation error", ex));
+ }
+ }
+ else
+ assert(false); // something changed in superclass, we must adapt to
+
+
+ return false;
+ }
+
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.pde.ui/src/org/eclipse/objectteams/otdt/internal/pde/ui/OTPDEUIMessages.java b/plugins/org.eclipse.objectteams.otdt.pde.ui/src/org/eclipse/objectteams/otdt/internal/pde/ui/OTPDEUIMessages.java
new file mode 100644
index 000000000..ae451e155
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.pde.ui/src/org/eclipse/objectteams/otdt/internal/pde/ui/OTPDEUIMessages.java
@@ -0,0 +1,40 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2007, 2009 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: OTPDEUIMessages.java 23470 2010-02-05 19:13:24Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.pde.ui;
+
+import org.eclipse.osgi.util.NLS;
+
+public class OTPDEUIMessages extends NLS
+{
+ private static final String BUNDLE_NAME = OTPDEUIMessages.class.getName();
+
+
+ public static String NewOTPProjectWizard_title;
+ public static String NewOTPProjectWizard_MainPage_title;
+
+ public static String NoOTJPluginProject;
+
+ public static String OTNewPluginProjectWizard_CantAddOTSpecifics;
+ public static String OTNewPluginProjectWizard_ProjectCreationError;
+
+ public static String Validation_MissingActivationPolicy_error;
+ public static String Resolution_AddBundleActivationPolicy_label;
+
+ static {
+ NLS.initializeMessages(BUNDLE_NAME, OTPDEUIMessages.class);
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.pde.ui/src/org/eclipse/objectteams/otdt/internal/pde/ui/OTPDEUIMessages.properties b/plugins/org.eclipse.objectteams.otdt.pde.ui/src/org/eclipse/objectteams/otdt/internal/pde/ui/OTPDEUIMessages.properties
new file mode 100644
index 000000000..a6d72dc96
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.pde.ui/src/org/eclipse/objectteams/otdt/internal/pde/ui/OTPDEUIMessages.properties
@@ -0,0 +1,10 @@
+NewOTPProjectWizard_title= New OT-Plugin Project Wizard
+NewOTPProjectWizard_MainPage_title= New Object Teams Plug-in Project
+
+NoOTJPluginProject=No OT/J plug-in project found, debug functionality not fully available.
+
+OTNewPluginProjectWizard_ProjectCreationError=Project creation errror
+OTNewPluginProjectWizard_CantAddOTSpecifics=Error adding Object Teams specifics to new project
+
+Validation_MissingActivationPolicy_error=Aspect bindings may only be effective if Bundle-ActivationPolicy is set
+Resolution_AddBundleActivationPolicy_label=Set header "Bundle-ActivationPolicy" to "lazy".
diff --git a/plugins/org.eclipse.objectteams.otdt.pde.ui/src/org/eclipse/objectteams/otdt/internal/pde/ui/OTPDEUIPlugin.java b/plugins/org.eclipse.objectteams.otdt.pde.ui/src/org/eclipse/objectteams/otdt/internal/pde/ui/OTPDEUIPlugin.java
new file mode 100644
index 000000000..7b67b6c1d
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.pde.ui/src/org/eclipse/objectteams/otdt/internal/pde/ui/OTPDEUIPlugin.java
@@ -0,0 +1,88 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id$
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.pde.ui;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class OTPDEUIPlugin extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.objectteams.otdt.internal.pde.ui"; //$NON-NLS-1$
+
+ // The shared instance
+ private static OTPDEUIPlugin plugin;
+
+ /**
+ * The constructor
+ */
+ public OTPDEUIPlugin() {
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static OTPDEUIPlugin getDefault() {
+ return plugin;
+ }
+
+ public static IStatus createErrorStatus(String message, Throwable ex)
+ {
+ return new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, message, ex);
+ }
+
+
+ /**
+ * Add Object Teams flavoured images to the image registry.
+ */
+ protected void initializeImageRegistry(ImageRegistry reg)
+ {
+ ImageManager.getSharedInstance().registerPluginImages(reg);
+ }
+
+
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.pde.ui/src/org/eclipse/objectteams/otdt/internal/pde/ui/OTPluginDependenciesAdapter.java b/plugins/org.eclipse.objectteams.otdt.pde.ui/src/org/eclipse/objectteams/otdt/internal/pde/ui/OTPluginDependenciesAdapter.java
new file mode 100644
index 000000000..e1f87db53
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.pde.ui/src/org/eclipse/objectteams/otdt/internal/pde/ui/OTPluginDependenciesAdapter.java
@@ -0,0 +1,69 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: OTPluginDependenciesAdapter.java 23470 2010-02-05 19:13:24Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.pde.ui;
+
+import org.eclipse.objectteams.otequinox.Constants;
+import org.eclipse.pde.core.plugin.IPluginReference;
+import org.eclipse.pde.ui.templates.PluginReference;
+
+import base org.eclipse.pde.internal.ui.wizards.plugin.PluginClassCodeGenerator;
+
+/**
+ * Note that this team must be mentioned in plugin.xml (aspectBinding),
+ * although it is not instantiated/activated globally, but only
+ * temporarily during OTNewPluginProjectWizard.performFinish().
+ *
+ * @author gis
+ */
+@SuppressWarnings("restriction")
+public team class OTPluginDependenciesAdapter
+{
+ public class PluginClassCodeGeneratorAdapter playedBy PluginClassCodeGenerator
+ {
+ private final IPluginReference TRANSFORMER = new PluginReference(Constants.TRANSFORMER_PLUGIN_ID, null, 0);
+
+ /**
+ * Returns Object Teams specific plugin dependencies additionally to the default
+ * plugin dependencies.
+ */
+ callin IPluginReference[] getDependencies()
+ {
+ IPluginReference[] deps = base.getDependencies();
+ for (IPluginReference dependency : deps) {
+ if (dependency.equals(TRANSFORMER))
+ return deps; // already included
+ }
+ IPluginReference[] extraDeps = new IPluginReference[] { TRANSFORMER };
+ return mergeArrays(deps, extraDeps);
+ }
+
+ IPluginReference[] mergeArrays(IPluginReference[] deps, IPluginReference[] extraDeps)
+ {
+ IPluginReference[] newDeps = new IPluginReference[deps.length + extraDeps.length];
+ System.arraycopy(deps, 0, newDeps, 0, deps.length);
+ System.arraycopy(extraDeps, 0, newDeps, deps.length, extraDeps.length);
+
+ return newDeps;
+ }
+
+ IPluginReference[] getDependencies() <- replace IPluginReference[] getDependencies();
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.pde.ui/src/org/eclipse/objectteams/otdt/internal/pde/ui/OTPluginProject.java b/plugins/org.eclipse.objectteams.otdt.pde.ui/src/org/eclipse/objectteams/otdt/internal/pde/ui/OTPluginProject.java
new file mode 100644
index 000000000..0e53a16af
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.pde.ui/src/org/eclipse/objectteams/otdt/internal/pde/ui/OTPluginProject.java
@@ -0,0 +1,70 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: OTPluginProject.java 23470 2010-02-05 19:13:24Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.pde.ui;
+
+import org.eclipse.core.resources.ICommand;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.objectteams.otdt.core.ext.OTDTPlugin;
+import org.eclipse.objectteams.otdt.core.ext.OTREContainer;
+
+public class OTPluginProject
+{
+ public static void makeOTPlugin(IProject project) throws CoreException
+ {
+ addOTNatureAndBuilder(project);
+ OTREContainer.initializeOTJProject(project);
+ // require base-imports for base classes per default:
+ IJavaProject javaProject = JavaCore.create(project);
+ String value = javaProject.getOption(OTDTPlugin.OT_COMPILER_BINDING_CONVENTIONS, true);
+ if (!value.equals(JavaCore.ERROR))
+ javaProject.setOption(OTDTPlugin.OT_COMPILER_BINDING_CONVENTIONS, JavaCore.ERROR);
+ }
+
+ public static void addOTNatureAndBuilder(IProject project) throws CoreException
+ {
+ IProjectDescription prjDesc = project.getDescription();
+ prjDesc.setNatureIds(OTDTPlugin.createProjectNatures(prjDesc));
+ ICommand[] buildSpecs = prjDesc.getBuildSpec();
+ prjDesc.setBuildSpec(replaceOrAddOTBuilder(prjDesc, buildSpecs));
+ project.setDescription(prjDesc, null);
+ }
+
+ private static ICommand[] replaceOrAddOTBuilder(IProjectDescription prjDesc, ICommand[] buildSpecs)
+ {
+ ICommand otBuildCmd = OTDTPlugin.createProjectBuildCommand(prjDesc);
+ // replace existing Java builder?
+ for(int i=0; i<buildSpecs.length; i++) {
+ if (buildSpecs[i].getBuilderName().equals(JavaCore.BUILDER_ID)) {
+ buildSpecs[i] = otBuildCmd;
+ return buildSpecs;
+ }
+ }
+ // not found, add to front:
+ int len = buildSpecs.length;
+ System.arraycopy(buildSpecs, 0, buildSpecs = new ICommand[len+1], 1, len);
+ buildSpecs[0] = otBuildCmd;
+ return buildSpecs;
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.pde.ui/src/org/eclipse/objectteams/otdt/internal/pde/ui/PackageExplorerAdaptor.java b/plugins/org.eclipse.objectteams.otdt.pde.ui/src/org/eclipse/objectteams/otdt/internal/pde/ui/PackageExplorerAdaptor.java
new file mode 100644
index 000000000..6d4faaf41
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.pde.ui/src/org/eclipse/objectteams/otdt/internal/pde/ui/PackageExplorerAdaptor.java
@@ -0,0 +1,399 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2009 Stephan Herrmann.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: PackageExplorerAdaptor.java 23470 2010-02-05 19:13:24Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Stephan Herrmann - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.pde.ui;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.resources.IResourceChangeEvent;
+import org.eclipse.core.resources.IResourceChangeListener;
+import org.eclipse.core.resources.IResourceDelta;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.StyledString;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.objectteams.otequinox.Constants;
+import org.eclipse.pde.core.plugin.IExtensions;
+import org.eclipse.pde.core.plugin.IPluginExtension;
+import org.eclipse.pde.core.plugin.IPluginModelBase;
+import org.eclipse.pde.core.plugin.IPluginObject;
+import org.eclipse.pde.core.plugin.ISharedExtensionsModel;
+import org.eclipse.pde.core.plugin.ISharedPluginModel;
+import org.eclipse.pde.internal.core.PDECore;
+import org.eclipse.pde.internal.core.PluginModelManager;
+import org.eclipse.pde.internal.core.ibundle.IBundlePluginModelBase;
+import org.eclipse.pde.internal.core.plugin.PluginElement;
+import org.eclipse.pde.internal.core.text.IDocumentAttributeNode;
+import org.eclipse.pde.internal.ui.PDELabelProvider;
+import org.eclipse.pde.internal.ui.PDEPlugin;
+import org.eclipse.pde.internal.ui.PDEPluginImages;
+import org.eclipse.pde.internal.ui.editor.plugin.ExtensionsPage;
+import org.eclipse.pde.internal.ui.editor.plugin.ManifestEditor;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IPartListener;
+import org.eclipse.ui.IPartService;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+
+import base org.eclipse.jdt.internal.ui.packageview.PackageExplorerContentProvider;
+import base org.eclipse.jdt.internal.ui.packageview.PackageExplorerLabelProvider;
+import base org.eclipse.jdt.ui.JavaElementComparator;
+import base org.eclipse.jdt.ui.actions.OpenAction;
+import base org.eclipse.pde.internal.core.text.plugin.PluginElementNode;
+
+/**
+ * This team adds rendering for an "Aspect Bindings" subtree for each OT/Equinox project.
+ * @author stephan
+ * @since 1.3.2
+ */
+@SuppressWarnings("restriction")
+public team class PackageExplorerAdaptor
+{
+
+ /** Icon for base plugin with forced exports. */
+ static final String PLUGIN_FORCED_EXPORTS = "plugin_forcedExports.png"; //$NON-NLS-1$
+
+ protected class ContentProvider playedBy PackageExplorerContentProvider {
+
+ @SuppressWarnings("decapsulation")
+ TreeViewer getViewer() -> get TreeViewer fViewer;
+
+ Object[] getChildren(Object parentElement) <- replace Object[] getChildren(Object parentElement);
+
+ callin Object[] getChildren(Object parentElement) {
+ Object[] result = base.getChildren(parentElement);
+ if (parentElement instanceof IJavaProject) {
+ // may want to add an "OT/Equinox Aspect Bindings" node to the project:
+ PluginModelManager modelManager = PDECore.getDefault().getModelManager();
+ IJavaProject javaProject = (IJavaProject)parentElement;
+ IPluginModelBase pluginModel = modelManager.findModel(javaProject.getProject());
+ if (pluginModel != null) {
+ if (hasAspectBindings(pluginModel)) {
+ List<Object> combined = new ArrayList<Object>(Arrays.asList(result));
+ combined.add(createAspectBindingsNode(javaProject, pluginModel));
+ return combined.toArray();
+ }
+ }
+ // no plugin.xml or no aspect bindings, wait for changes re plugin.xml
+ ResourcesPlugin.getWorkspace().addResourceChangeListener(new AspectBindingsRefresher(javaProject, null, getViewer()));
+ }
+ if (parentElement instanceof AspectBindingsRootNode) {
+ // this is the "OT/Equinox Aspect Bindings" node, fill it with BasePluginNodes
+ AspectBindingsRootNode aspectBindingsNode = (AspectBindingsRootNode)parentElement;
+ IExtensions extensions = aspectBindingsNode.pluginModel.getExtensions();
+ if (extensions != null) {
+ List<Object> bases = new ArrayList<Object>();
+ Map<String, BasePluginNode> perBaseBindings = new HashMap<String, BasePluginNode>();
+ for (IPluginExtension extension : extensions.getExtensions())
+ if(extension.getPoint().equals(Constants.ASPECT_BINDING_FQEXTPOINT_ID))
+ for (IPluginObject element : extension.getChildren())
+ if (element instanceof PluginElement) {
+ PluginElement pluginElement = (PluginElement) element;
+ BasePluginNode node = new BasePluginNode(aspectBindingsNode.javaProject, pluginElement);
+ // collate multiple bindings for the same base plugin:
+ if (perBaseBindings.containsKey(node.basePlugin)) {
+ perBaseBindings.get(node.basePlugin).merge(node);
+ } else {
+ bases.add(node);
+ perBaseBindings.put(node.basePlugin, node);
+ }
+ }
+
+ return bases.toArray();
+ }
+ }
+ if (parentElement instanceof BasePluginNode) {
+ // fill the BasePluginNode with its adapting teams
+ return ((BasePluginNode)parentElement).getTeams();
+ }
+ return result;
+ }
+
+ AspectBindingsRootNode createAspectBindingsNode (final IJavaProject javaProject, IPluginModelBase pluginModel) {
+ final AspectBindingsRootNode aspectBindings = new AspectBindingsRootNode(javaProject, pluginModel);
+ ResourcesPlugin.getWorkspace().addResourceChangeListener(new AspectBindingsRefresher(javaProject, aspectBindings, getViewer()));
+ return aspectBindings;
+ }
+ }
+
+ /** Does the given plugin have an aspectBindings extension? */
+ boolean hasAspectBindings (IPluginModelBase pluginModel) {
+ IExtensions extensions = pluginModel.getExtensions();
+ for (IPluginExtension extension : extensions.getExtensions())
+ if(extension.getPoint().equals(Constants.ASPECT_BINDING_FQEXTPOINT_ID))
+ return true;
+ return false;
+ }
+
+ /** This class is responsible for any updates on aspectBindings in a project's plugin.xml. */
+ protected class AspectBindingsRefresher implements IResourceChangeListener {
+ IJavaProject javaProject;
+ AspectBindingsRootNode aspectBindings;
+ TreeViewer viewer;
+
+ protected AspectBindingsRefresher(IJavaProject javaProject, AspectBindingsRootNode aspectBindings, TreeViewer viewer) {
+ this.javaProject = javaProject;
+ this.aspectBindings = aspectBindings;
+ this.viewer = viewer;
+ }
+ public void resourceChanged(IResourceChangeEvent event) {
+ if (aspectBindings != null)
+ refreshAspectBindings(event);
+ else
+ detectPluginXmlChanges(event.getDelta());
+ }
+ /* Aspect bindings are present, may need to be refreshed or removed. */
+ void refreshAspectBindings(IResourceChangeEvent event) {
+ IResourceDelta delta = event.getDelta();
+ if (delta != null)
+ delta = delta.findMember(this.javaProject.getPath().append("plugin.xml"));
+ if (delta != null) {
+ if (this.viewer == null || this.viewer.getControl().isDisposed() || !this.javaProject.isOpen()) {
+ ResourcesPlugin.getWorkspace().removeResourceChangeListener(this);
+ return;
+ }
+ final Object elementToRefresh;
+ if ((delta.getKind() & IResourceDelta.REMOVED) != 0) {
+ elementToRefresh = this.javaProject;
+ } else {
+ PluginModelManager modelManager = PDECore.getDefault().getModelManager();
+ if (hasAspectBindings(modelManager.findModel(javaProject.getProject())))
+ elementToRefresh = this.aspectBindings;
+ else
+ elementToRefresh = this.javaProject;
+ }
+ Display.getDefault().asyncExec(new Runnable() { public void run() {
+ AspectBindingsRefresher.this.viewer.refresh(elementToRefresh);
+ }});
+ // during project refresh, getChildren will create a new listener
+ if (elementToRefresh == this.javaProject)
+ ResourcesPlugin.getWorkspace().removeResourceChangeListener(this);
+ } else if (event.getType() == IResourceChangeEvent.PRE_CLOSE) {
+ if (event.getResource().equals(javaProject.getProject()))
+ ResourcesPlugin.getWorkspace().removeResourceChangeListener(this);
+ }
+ }
+ /* Aspect bindings are not yet present, wait for an event that could signal addition of aspect bindings. */
+ void detectPluginXmlChanges(IResourceDelta delta) {
+ if (delta != null)
+ delta = delta.findMember(this.javaProject.getPath().append("plugin.xml"));
+ if (delta != null) {
+ // this listener is done:
+ ResourcesPlugin.getWorkspace().removeResourceChangeListener(this);
+
+ if (this.viewer == null || this.viewer.getControl().isDisposed() || !javaProject.isOpen())
+ return;
+
+ Display.getDefault().asyncExec(new Runnable() { public void run() {
+ AspectBindingsRefresher.this.viewer.refresh(AspectBindingsRefresher.this.javaProject);
+ }});
+ }
+ }
+ }
+
+ /**
+ * This role renders the elements of an "Aspect Bindings" subtree.
+ */
+ protected class LabelProvider playedBy PackageExplorerLabelProvider {
+
+ PDELabelProvider pdeLabelProvider;
+
+ // ---------- Lifecycle: ----------
+
+ // constructor:
+ @SuppressWarnings("ambiguouslowering")
+ LabelProvider(PackageExplorerLabelProvider baseLabelProvider) {
+ this.pdeLabelProvider = PDEPlugin.getDefault().getLabelProvider();
+ pdeLabelProvider.connect(this);
+ }
+
+ // finalizer:
+ @Override
+ @SuppressWarnings("ambiguouslowering")
+ protected void finalize() {
+ if (this.pdeLabelProvider != null) {
+ this.pdeLabelProvider.disconnect(this);
+ this.pdeLabelProvider = null;
+ }
+ }
+ // second trigger for finalizer:
+ finalize <- after dispose;
+
+ // ---------- Domain behavior: ----------
+
+ StyledString getStyledText(Object element)
+ <- replace StyledString getStyledText(Object element);
+
+ @SuppressWarnings("basecall")
+ callin StyledString getStyledText(Object element)
+ {
+ if (element instanceof AspectBindingsRootNode)
+ return new StyledString(AspectBindingsRootNode.ASPECT_BINDINGS_NAME);
+
+ if (element instanceof BasePluginNode)
+ return new StyledString("Base Plugin "+((BasePluginNode)element).basePlugin);
+
+ if (element instanceof TeamNode)
+ return new StyledString(((TeamNode)element).teamName);
+
+ return base.getStyledText(element);
+ }
+
+ Image getImage(Object element) <- replace Image getImage(Object element);
+
+
+ @SuppressWarnings("basecall")
+ callin Image getImage(Object element)
+ {
+ if (element instanceof AspectBindingsRootNode)
+ return org.eclipse.objectteams.otdt.ui.ImageManager.getSharedInstance().get(ImageManager.CALLOUTBINDING_IMG);
+
+ if (element instanceof BasePluginNode) {
+ if (((BasePluginNode)element).hasForcedExports)
+ return ImageManager.getSharedInstance().get(PLUGIN_FORCED_EXPORTS);
+ return pdeLabelProvider.get(PDEPluginImages.DESC_PLUGIN_OBJ);
+ }
+
+ if (element instanceof TeamNode)
+ return org.eclipse.objectteams.otdt.ui.ImageManager.getSharedInstance().get(ImageManager.TEAM_IMG);
+
+ return base.getImage(element);
+ }
+ }
+
+ /**
+ * sort the "Aspect Bindings" node below the list of package fragment roots,
+ * by pretending it were a compilation unit
+ */
+ protected class Comparator playedBy JavaElementComparator {
+
+ @SuppressWarnings("decapsulation")
+ int getCOMPILATIONUNITS() -> get int COMPILATIONUNITS;
+
+ final int COMPILATIONUNITS;
+ Comparator(JavaElementComparator b) {
+ COMPILATIONUNITS = getCOMPILATIONUNITS();
+ }
+
+ int category(Object element) <- replace int category(Object element)
+ base when (element instanceof AspectBindingsRootNode);
+
+ @SuppressWarnings("basecall")
+ callin int category(Object element) {
+ return COMPILATIONUNITS;
+ }
+
+ }
+
+ protected class Open playedBy OpenAction {
+
+ @SuppressWarnings("decapsulation")
+ boolean checkEnabled(IStructuredSelection selection) <- replace boolean checkEnabled(IStructuredSelection selection);
+
+ @SuppressWarnings("unchecked") // selection.iterator() is raw type
+ callin boolean checkEnabled(IStructuredSelection selection) {
+ if (base.checkEnabled(selection))
+ return true;
+ // similar to base method:
+ if (selection.isEmpty())
+ return false;
+ for (Iterator iter= selection.iterator(); iter.hasNext();) {
+ Object element= iter.next();
+ if (element instanceof BasePluginNode)
+ continue;
+ if (element instanceof TeamNode)
+ continue;
+ return false;
+ }
+ return true;
+ }
+
+ Object getNodeToOpen(Object object) <- replace Object getElementToOpen(Object object)
+ base when (object instanceof AspectBindingsTreeNode);
+
+ @SuppressWarnings("basecall")
+ callin Object getNodeToOpen(Object object) {
+ if (object instanceof BasePluginNode) {
+ registerListener(((BasePluginNode)object));
+ return ((BasePluginNode)object).getPluginXml();
+ }
+ if (object instanceof TeamNode)
+ return ((TeamNode)object).getTeamType();
+ return object;
+ }
+ /** register a listener for deferred selection of the current base plugin element within the extension editor. */
+ void registerListener (final BasePluginNode node) {
+ IWorkbenchWindow[] windows= PlatformUI.getWorkbench().getWorkbenchWindows();
+ for (int i= 0, length= windows.length; i < length; i++) {
+ final IPartService partService = windows[i].getPartService();
+ partService.addPartListener(new IPartListener() {
+ public void partOpened(IWorkbenchPart part) { /* nop */ }
+ public void partDeactivated(IWorkbenchPart part) { /* nop */ }
+ public void partClosed(IWorkbenchPart part) { /* nop */ }
+ public void partBroughtToTop(IWorkbenchPart part) { /* nop */ }
+
+ public void partActivated(IWorkbenchPart part) {
+ selectBaseNode(node, part);
+ partService.removePartListener(this); // immediately remove: this is a one-shot listener
+ }
+ });
+ }
+ }
+ void selectBaseNode(BasePluginNode node, IWorkbenchPart part) {
+ if (part instanceof ManifestEditor) {
+ ManifestEditor editor = (ManifestEditor) part;
+ ExtensionsPage page = (ExtensionsPage) editor.setActivePage(ExtensionsPage.PAGE_ID);
+ ISharedExtensionsModel extensions = ((IBundlePluginModelBase)page.getModel()).getExtensionsModel();
+ for (BasePluginNodeInterceptor viewNode : getAllRoles(BasePluginNodeInterceptor.class))
+ if ( extensions == viewNode.getModel() // only nodes of this editor's model
+ && node.basePlugin.equals(viewNode.basePluginName))
+ page.selectReveal(viewNode.lower());
+ }
+ }
+ }
+ /** This role intercepts reading of PluginElementNodes that represent a basePlugin element of an aspect binding. */
+ protected class BasePluginNodeInterceptor implements ILowerable playedBy PluginElementNode
+ {
+ ISharedPluginModel getModel() -> ISharedPluginModel getModel();
+
+ protected String basePluginName;
+
+ // this callin filters applicable base objects
+ void register(String tag) <- after void setXMLTagName(String tag)
+ base when ("basePlugin".equals(tag));
+
+ private void register(String tag) {
+ // nop, just registered this role
+ }
+
+ // this callin collects further information from registered base objects:
+ void setXMLAttribute(IDocumentAttributeNode attribute) <- after void setXMLAttribute(IDocumentAttributeNode attribute)
+ base when (hasRole(base, BasePluginNodeInterceptor.class));
+
+ void setXMLAttribute(IDocumentAttributeNode attribute) {
+ if ("id".equals(attribute.getAttributeName()))
+ this.basePluginName = attribute.getAttributeValue();
+ }
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.pde.ui/src/org/eclipse/objectteams/otdt/internal/pde/ui/ToggleOTSupportAction.java b/plugins/org.eclipse.objectteams.otdt.pde.ui/src/org/eclipse/objectteams/otdt/internal/pde/ui/ToggleOTSupportAction.java
new file mode 100644
index 000000000..ac5191b82
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.pde.ui/src/org/eclipse/objectteams/otdt/internal/pde/ui/ToggleOTSupportAction.java
@@ -0,0 +1,136 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2009 Technical University Berlin.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id$
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Marco Mosconi - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.pde.ui;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.ErrorDialog;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.objectteams.otdt.core.ext.OTREContainer;
+import org.eclipse.pde.core.plugin.IPluginBase;
+import org.eclipse.pde.core.plugin.IPluginImport;
+import org.eclipse.pde.core.plugin.IPluginReference;
+import org.eclipse.pde.internal.core.ICoreConstants;
+import org.eclipse.pde.internal.core.bundle.WorkspaceBundlePluginModel;
+import org.eclipse.pde.internal.core.natures.PDE;
+import org.eclipse.pde.internal.core.plugin.WorkspacePluginModelBase;
+import org.eclipse.pde.ui.templates.PluginReference;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IWorkbenchPart;
+
+/**
+ * Action to add (TBD: or remove) OT support on projects.
+ * To be invoked via the "Configure" context-menu in Package Explorer.
+ * @author mosconi
+ * @since 1.3.2
+ */
+@SuppressWarnings("restriction")
+public class ToggleOTSupportAction implements IObjectActionDelegate {
+
+ private Shell shell;
+ private ISelection selection;
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction, org.eclipse.ui.IWorkbenchPart)
+ */
+ public void setActivePart(IAction action, IWorkbenchPart targetPart) {
+ shell = targetPart.getSite().getShell();
+ }
+
+ /* (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) {
+ this.selection = selection;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
+ */
+ public void run(IAction action) {
+ if (!(selection instanceof IStructuredSelection))
+ return;
+ for (Object element : ((IStructuredSelection) selection).toArray()) {
+ IProject project = null;
+ if (element instanceof IProject) {
+ project = (IProject) element;
+ }
+ else if (element instanceof IAdaptable) {
+ project = (IProject) ((IAdaptable) element).getAdapter(IProject.class);
+ }
+ if (project != null) {
+ toggleOTSupport(project);
+ }
+ }
+ }
+
+ private void toggleOTSupport(IProject project) {
+ try {
+ IProjectDescription description = project.getDescription();
+ if (description.hasNature(JavaCore.OTJ_NATURE_ID)) {
+ removeOTSupport(project);
+ }
+ else {
+ addOTSupport(project);
+ }
+ }
+ catch (CoreException e) {
+ ErrorDialog.openError(shell, "Project Configuration Error", "Error Configuring Project " + project.getName() + ".", e.getStatus());
+ OTPDEUIPlugin.getDefault().getLog().log(OTPDEUIPlugin.createErrorStatus("Project configuration error", e));
+ }
+ }
+
+ /**
+ * Adds OT/J nature, builder, and dependencies to the given project
+ */
+ private void addOTSupport(IProject project) throws CoreException {
+ OTPluginProject.addOTNatureAndBuilder(project);
+ if (PDE.hasPluginNature(project)) {
+ // add plug-in dependency to org.eclipse.objectteams.otequinox:
+ WorkspacePluginModelBase fModel = new WorkspaceBundlePluginModel(
+ project.getFile(ICoreConstants.BUNDLE_FILENAME_DESCRIPTOR),
+ project.getFile(ICoreConstants.PLUGIN_FILENAME_DESCRIPTOR));
+ IPluginBase pluginBase = fModel.getPluginBase();
+ IPluginReference ref = new PluginReference(
+ "org.eclipse.objectteams.otequinox", null, 0);
+ IPluginImport iimport = fModel.getPluginFactory().createImport();
+ iimport.setId(ref.getId());
+ iimport.setVersion(ref.getVersion());
+ iimport.setMatch(ref.getMatch());
+ pluginBase.add(iimport);
+ fModel.save();
+ }
+ OTREContainer.initializeOTJProject(project);
+ if (PDE.hasPluginNature(project)) {
+ ClasspathComputerAdapter.sortClasspathEntries(project);
+ }
+ }
+
+ /**
+ * Removes OT/J nature, builder, and dependencies from the given project
+ */
+ private void removeOTSupport(IProject project) throws CoreException {
+ //TODO: yet to be implemented (also needs additional hooking in plugin.xml)
+ }
+
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.pde.ui/src/org/eclipse/objectteams/otdt/internal/pde/validation/BundleValidation.java b/plugins/org.eclipse.objectteams.otdt.pde.ui/src/org/eclipse/objectteams/otdt/internal/pde/validation/BundleValidation.java
new file mode 100644
index 000000000..9eea64410
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.pde.ui/src/org/eclipse/objectteams/otdt/internal/pde/validation/BundleValidation.java
@@ -0,0 +1,202 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2009 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: BundleValidation.java 23470 2010-02-05 19:13:24Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.pde.validation;
+
+import static org.eclipse.objectteams.otequinox.Constants.*;
+
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.objectteams.otdt.internal.pde.ui.OTPDEUIMessages;
+import org.eclipse.objectteams.otequinox.ActivationKind;
+import org.eclipse.pde.internal.core.builders.CompilerFlags;
+import org.eclipse.pde.internal.core.builders.IHeader;
+import org.eclipse.pde.internal.core.builders.PDEMarkerFactory;
+import org.eclipse.pde.internal.core.ibundle.IManifestHeader;
+import org.eclipse.pde.internal.core.text.bundle.BundleActivationPolicyHeader;
+import org.eclipse.pde.internal.core.text.bundle.BundleModel;
+import org.eclipse.pde.internal.ui.correction.AbstractManifestMarkerResolution;
+import org.eclipse.pde.internal.ui.correction.AbstractPDEMarkerResolution;
+import org.eclipse.ui.IMarkerResolution;
+import org.osgi.framework.Constants;
+
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+import base org.eclipse.pde.internal.core.builders.BundleErrorReporter;
+import base org.eclipse.pde.internal.core.builders.ExtensionsErrorReporter;
+import base org.eclipse.pde.internal.core.builders.ManifestConsistencyChecker;
+import base org.eclipse.pde.internal.ui.correction.ResolutionGenerator;
+
+/**
+ * Enhanced validation of bundle manifests.
+ * <ul>
+ * <li>Check whether all bundles with aspectBindings have a proper activation policy set,<br>
+ * Provide suitable quick assist if activation policy is wrong/missing.</li>
+ * </ul>
+ *
+ * @author stephan
+ * @since 1.2.7
+ */
+@SuppressWarnings("restriction")
+public team class BundleValidation
+{
+ /** Constant for a problem that can be resolved by adding an activation policy to the manifest. */
+ static final int ADD_ACTIVATION_POLICY = 0x1801; // must not overlap with any constant in org.eclipse.pde.internal.core.builders.PDEMarkerFactory.
+
+ ThreadLocal<BundleCheckingContext> bundleContext = new ThreadLocal<BundleCheckingContext>();
+
+ /**
+ * Defines the context of validating one bundle.
+ * One instance of this role exists per control flow (= per thread)
+ * for retrieval in downstream callin bindings.
+ */
+ protected class BundleCheckingContext playedBy ManifestConsistencyChecker
+ {
+ // flags set during validation of one bundle:
+ protected boolean isAspectBundle = false;
+ protected boolean hasTeamActivation = false;
+
+ @SuppressWarnings("decapsulation")
+ spanContext <- replace validateFiles;
+
+ callin void spanContext() {
+ BundleValidation.this.bundleContext.set(this);
+ try {
+ base.spanContext();
+ } finally {
+ // withdraw role, is for one-time use only:
+ BundleValidation.this.bundleContext.set(null);
+ BundleValidation.this.unregisterRole(this, BundleCheckingContext.class);
+ }
+ }
+ }
+
+ /**
+ * Detects aspectBindings declared in plugin.xml and records information in the current {@link BundleCheckingContext}.
+ */
+ protected class ExtensionAnalyzer playedBy ExtensionsErrorReporter
+ base when (BundleValidation.this.bundleContext.get() != null)
+ {
+ void checkAspectBinding(Element element) <- after void validateExtension(Element element);
+
+ protected void checkAspectBinding(Element element)
+ {
+ Object pointID = element.getAttribute("point"); //$NON-NLS-1$
+ if (ASPECT_BINDING_FQEXTPOINT_ID.equals(pointID))
+ {
+ BundleCheckingContext context = BundleValidation.this.bundleContext.get();
+ // it's an aspect bundle
+ context.isAspectBundle = true;
+
+ // does it have elements with relevant activation?
+ NodeList baseNodes = element.getElementsByTagName(BASE_PLUGIN);
+ if (baseNodes.getLength() > 0) {
+ String baseId = ((Element)baseNodes.item(0)).getAttribute(ID);
+ if (baseId != null && baseId.toUpperCase().equals(SELF))
+ return; // missing bundle activation is not fatal in this case
+ }
+
+ // check the teams for activation ALL_THREADS or THREAD:
+ NodeList teamNodes = element.getElementsByTagName(TEAM);
+ for (int t=0; t<teamNodes.getLength(); t++) {
+ Object activation = ((Element)teamNodes.item(t)).getAttribute(ACTIVATION);
+ if (ActivationKind.ALL_THREADS.toString().equals(activation)) {
+ context.hasTeamActivation = true;
+ break;
+ } else if (ActivationKind.THREAD.toString().equals(activation)) {
+ context.hasTeamActivation = true;
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Validates whether activation policy is set if needed.
+ * This role is only active for bundles with one or more aspect bindings.
+ */
+ protected class BundleErrorReporter playedBy BundleErrorReporter
+ base when (BundleValidation.this.bundleContext.get().isAspectBundle)
+ {
+ @SuppressWarnings("decapsulation")
+ IHeader getHeader(String key) -> IHeader getHeader(String key);
+ void report(String message, int line, int severity, int resolution, String category)
+ -> IMarker report(String message, int line, int severity, int resolution, String category);
+
+ void validateBundleActivatorPolicy() <- after void validateBundleActivatorPolicy();
+
+ void validateBundleActivatorPolicy()
+ {
+ IHeader header = getHeader(Constants.BUNDLE_ACTIVATIONPOLICY);
+ int lineNo = 1;
+ if (header != null) {
+ if (Constants.ACTIVATION_LAZY.equals(header.getValue()))
+ return; // OK!
+ lineNo = header.getLineNumber()+1;
+ }
+ boolean hasTeamActivation = BundleValidation.this.bundleContext.get().hasTeamActivation;
+ report(OTPDEUIMessages.Validation_MissingActivationPolicy_error,
+ lineNo,
+ hasTeamActivation ? CompilerFlags.ERROR : CompilerFlags.WARNING, // only severe if relevant team activation is requested.
+ ADD_ACTIVATION_POLICY,
+ PDEMarkerFactory.CAT_FATAL);
+ }
+ }
+
+ /** Unbound role: simple rewriting of the manifest to add or correct an activation policy header. */
+ protected class SetActivationPolicyResolution extends AbstractManifestMarkerResolution
+ {
+ public SetActivationPolicyResolution(int type) {
+ super(type);
+ }
+
+ protected void createChange(BundleModel model) {
+
+ IManifestHeader header = model.getBundle().getManifestHeader(Constants.BUNDLE_ACTIVATIONPOLICY);
+
+ if (header != null && header instanceof BundleActivationPolicyHeader)
+ ((BundleActivationPolicyHeader) header).setLazyStart(true);
+ else
+ model.getBundle().setHeader(Constants.BUNDLE_ACTIVATIONPOLICY, Constants.ACTIVATION_LAZY);
+ }
+
+ public String getLabel() {
+ return OTPDEUIMessages.Resolution_AddBundleActivationPolicy_label;
+ }
+ }
+
+ /**
+ * Advise the base class for handling missing/incorrect activation policy
+ * (code {@link BundleValidation#ADD_ACTIVATION_POLICY}).
+ */
+ protected class ResolutionGenerator playedBy ResolutionGenerator {
+
+ IMarkerResolution[] getResolutions(IMarker marker) <- replace IMarkerResolution[] getResolutions(IMarker marker);
+
+ callin IMarkerResolution[] getResolutions(IMarker marker) {
+ IMarkerResolution[] result = base.getResolutions(marker);
+ if (result.length == 0) {
+ int problemID = marker.getAttribute("id", PDEMarkerFactory.NO_RESOLUTION); //$NON-NLS-1$
+ switch (problemID) {
+ case BundleValidation.ADD_ACTIVATION_POLICY :
+ return new IMarkerResolution[] {new SetActivationPolicyResolution(AbstractPDEMarkerResolution.CREATE_TYPE)};
+ }
+ }
+ return result;
+ }
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.refactoring/.classpath b/plugins/org.eclipse.objectteams.otdt.refactoring/.classpath
new file mode 100644
index 000000000..987380a81
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.refactoring/.classpath
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <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="con" path="OTRE"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/org.eclipse.objectteams.otdt.refactoring/.project b/plugins/org.eclipse.objectteams.otdt.refactoring/.project
new file mode 100644
index 000000000..ae5e613f8
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.refactoring/.project
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.objectteams.otdt.refactoring</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.objectteams.otdt.builder.OTJBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.objectteams.otdt.OTJavaNature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/org.eclipse.objectteams.otdt.refactoring/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.objectteams.otdt.refactoring/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..649ce8bb3
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.refactoring/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,16 @@
+#Sun Aug 26 11:13:53 CEST 2007
+eclipse.preferences.version=1
+org.objectteams.otdt.compiler.option.joinpoint_queries=disabled
+org.objectteams.otdt.compiler.option.scoped_keywords=enabled
+org.objectteams.otdt.compiler.problem.abstract_potential_relevant_role=warning
+org.objectteams.otdt.compiler.problem.basecall=warning
+org.objectteams.otdt.compiler.problem.binding_conventions=error
+org.objectteams.otdt.compiler.problem.decapsulation=warning
+org.objectteams.otdt.compiler.problem.deprecated_path_syntax=warning
+org.objectteams.otdt.compiler.problem.effectless_fieldaccess=warning
+org.objectteams.otdt.compiler.problem.fragile_callin=warning
+org.objectteams.otdt.compiler.problem.incomplete_build=error
+org.objectteams.otdt.compiler.problem.inferred_callout=error
+org.objectteams.otdt.compiler.problem.potential_ambiguous_playedby=warning
+org.objectteams.otdt.compiler.problem.unsafe_liftctor=warning
+org.objectteams.otdt.compiler.problem.unused_parammap=warning
diff --git a/plugins/org.eclipse.objectteams.otdt.refactoring/META-INF/MANIFEST.MF b/plugins/org.eclipse.objectteams.otdt.refactoring/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..6f871954d
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.refactoring/META-INF/MANIFEST.MF
@@ -0,0 +1,27 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: OT/J Refactoring Adaptor Plug-in
+Bundle-SymbolicName: org.eclipse.objectteams.otdt.refactoring;singleton:=true
+Bundle-Version: 1.4.0.qualifier
+Bundle-Vendor: The TOPPrax consortium
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.jdt.ui,
+ org.eclipse.jdt.core,
+ org.eclipse.core.runtime,
+ org.eclipse.core.resources,
+ org.eclipse.jface.text,
+ org.eclipse.ltk.core.refactoring,
+ org.eclipse.objectteams.otequinox,
+ org.eclipse.ui,
+ org.eclipse.jdt.core.manipulation;bundle-version="[1.2.0,2.0.0)",
+ org.eclipse.ltk.ui.refactoring;bundle-version="[3.4.1,4.0.0)",
+ org.eclipse.ui.editors
+Export-Package: org.eclipse.objectteams.otdt.internal.refactoring.corext.base,
+ org.eclipse.objectteams.otdt.internal.refactoring.adaptor.extractmethod,
+ org.eclipse.objectteams.otdt.internal.refactoring.corext,
+ org.eclipse.objectteams.otdt.internal.refactoring.otrefactorings.extractcallin,
+ org.eclipse.objectteams.otdt.internal.refactoring.otrefactorings.inlinecallin,
+ org.eclipse.objectteams.otdt.internal.refactoring.util
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ActivationPolicy: lazy
+Bundle-Activator: org.eclipse.objectteams.otdt.internal.refactoring.OTRefactoringPlugin
diff --git a/plugins/org.eclipse.objectteams.otdt.refactoring/build.properties b/plugins/org.eclipse.objectteams.otdt.refactoring/build.properties
new file mode 100644
index 000000000..0dc34f783
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.refactoring/build.properties
@@ -0,0 +1,6 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ plugin.properties
diff --git a/plugins/org.eclipse.objectteams.otdt.refactoring/plugin.properties b/plugins/org.eclipse.objectteams.otdt.refactoring/plugin.properties
new file mode 100644
index 000000000..28e30bf8c
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.refactoring/plugin.properties
@@ -0,0 +1,13 @@
+Refactoring.menu.label=Refac&tor
+
+Inline.callin.label=Inline Callin...
+Inline.callin.tooltip=Inline a callin-bound method
+
+ActionDefinition.inline.callin.name= InlineCallin
+ActionDefinition.inline.callin.description= Inline a callin-bound role method
+
+Extract.callin.label=Extract Callin...
+Extract.callin.tooltip=Extract a method call to a callin-bound role method
+
+ActionDefinition.extract.callin.name= ExtractCallin
+ActionDefinition.extract.callin.description= Extract a callin-bound role method
diff --git a/plugins/org.eclipse.objectteams.otdt.refactoring/plugin.xml b/plugins/org.eclipse.objectteams.otdt.refactoring/plugin.xml
new file mode 100644
index 000000000..3a5c92d32
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.refactoring/plugin.xml
@@ -0,0 +1,150 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+ <extension
+ point="org.eclipse.objectteams.otequinox.aspectBindings">
+ <aspectBinding icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/calloutbinding_obj.gif">
+ <basePlugin
+ id="org.eclipse.jdt.ui"
+ icon="platform:/plugin/org.eclipse.pde.ui/icons/obj16/plugin_obj.gif">
+ </basePlugin>
+ <team
+ activation="ALL_THREADS"
+ class="org.eclipse.objectteams.otdt.internal.refactoring.adaptor.RenameAdaptor"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif">
+ </team>
+ <team
+ activation="ALL_THREADS"
+ class="org.eclipse.objectteams.otdt.internal.refactoring.adaptor.ReorgAdaptor"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif">
+ </team>
+ <team
+ activation="ALL_THREADS"
+ class="org.eclipse.objectteams.otdt.internal.refactoring.adaptor.CorextAdaptor"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif">
+ </team>
+ <team
+ activation="ALL_THREADS"
+ class="org.eclipse.objectteams.otdt.internal.refactoring.adaptor.MoveAdaptor"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif">
+ </team>
+ <team
+ activation="ALL_THREADS"
+ class="org.eclipse.objectteams.otdt.internal.refactoring.corext.rename.RolePartsUnifier"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif">
+ </team>
+ <team
+ activation="ALL_THREADS"
+ class="org.eclipse.objectteams.otdt.internal.refactoring.adaptor.pullup.PullUpAdaptor"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif">
+ </team>
+ <team
+ activation="ALL_THREADS"
+ class="org.eclipse.objectteams.otdt.internal.refactoring.adaptor.RenameTypeAdaptor"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif">
+ </team>
+ <team
+ activation="ALL_THREADS"
+ class="org.eclipse.objectteams.otdt.internal.refactoring.adaptor.MoveInstanceMethodAdaptor"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif">
+ </team>
+ <team
+ activation="ALL_THREADS"
+ class="org.eclipse.objectteams.otdt.internal.refactoring.adaptor.pushdown.PushDownAdaptor"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif">
+ </team>
+ <team
+ activation="ALL_THREADS"
+ class="org.eclipse.objectteams.otdt.internal.refactoring.adaptor.ActionGroupAdaptor"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif">
+ </team>
+ </aspectBinding>
+ <aspectBinding
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/calloutbinding_obj.gif">
+ <basePlugin
+ icon="platform:/plugin/org.eclipse.pde.ui/icons/obj16/plugin_obj.gif"
+ id="org.eclipse.jdt.core">
+ </basePlugin>
+ <team
+ activation="NONE"
+ class="org.eclipse.objectteams.otdt.internal.refactoring.adaptor.pullup.OTTypeHierarchyAdaptor"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif">
+ </team>
+ <team
+ activation="NONE"
+ class="org.eclipse.objectteams.otdt.internal.refactoring.adaptor.PhantomTypeAdaptor"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif">
+ </team>
+ </aspectBinding>
+ </extension>
+ <extension
+ point="org.eclipse.ui.actionSets">
+ <actionSet
+ description="Action set containing OT/J refactoring actions"
+ id="org.eclipse.objectteams.otdt.internal.refactoring.actionSet"
+ label="OT/J Refactor">
+<!-- Copy&Paste from JDT.UI as per https://bugs.eclipse.org/bugs/show_bug.cgi?id=15670 -->
+ <menu
+ label="%Refactoring.menu.label"
+ path="edit"
+ id="org.eclipse.jdt.ui.refactoring.menu">
+ <separator name="undoRedoGroup"/>
+ <separator name="reorgGroup"/>
+ <separator name="codingGroup"/>
+ <separator name="reorgGroup2"/>
+ <separator name="typeGroup"/>
+ <separator name="typeGroup2"/>
+ <separator name="codingGroup2"/>
+ <separator name="typeGroup3"/>
+ <separator name="scriptGroup"/>
+ </menu>
+<!-- -->
+ <action
+ class="org.eclipse.objectteams.otdt.internal.refactoring.otrefactorings.extractcallin.ExtractCallinAction"
+ definitionId="org.eclipse.objectteams.otdt.refactoring.extract.callin"
+ id="org.eclipse.objectteams.otdt.internal.refactoring.adaptor.action2"
+ label="%Extract.callin.label"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/callinbinding_obj.gif"
+ menubarPath="org.eclipse.jdt.ui.refactoring.menu/codingGroup"
+ style="push"
+ tooltip="%Extract.callin.tooltip">
+ </action>
+ <action
+ class="org.eclipse.objectteams.otdt.internal.refactoring.otrefactorings.inlinecallin.InlineCallinAction"
+ definitionId="org.eclipse.objectteams.otdt.refactoring.inline.callin"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/callinbinding_obj.gif"
+ id="org.eclipse.objectteams.otdt.internal.refactoring.InlineCallin"
+ label="%Inline.callin.label"
+ menubarPath="org.eclipse.jdt.ui.refactoring.menu/codingGroup"
+ style="push">
+ </action>
+ </actionSet>
+ </extension>
+ <extension
+ point="org.eclipse.ui.commands">
+ <command
+ name="%ActionDefinition.inline.callin.name"
+ description="%ActionDefinition.inline.callin.description"
+ categoryId="org.eclipse.jdt.ui.category.refactoring"
+ id="org.eclipse.objectteams.otdt.refactoring.inline.callin">
+ </command>
+ </extension>
+ <extension
+ point="org.eclipse.ui.commands">
+ <command
+ name="%ActionDefinition.extract.callin.name"
+ description="%ActionDefinition.extract.callin.description"
+ categoryId="org.eclipse.jdt.ui.category.refactoring"
+ id="org.eclipse.objectteams.otdt.refactoring.extract.callin">
+ </command>
+ </extension>
+ <extension
+ point="org.eclipse.ui.perspectiveExtensions">
+ <perspectiveExtension
+ targetID="org.eclipse.objectteams.otdt.ui.OTJavaPerspective">
+ <actionSet
+ id="org.eclipse.objectteams.otdt.internal.refactoring.actionSet">
+ </actionSet>
+ </perspectiveExtension>
+ </extension>
+</plugin>
diff --git a/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/OTRefactoringPlugin.java b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/OTRefactoringPlugin.java
new file mode 100644
index 000000000..29ea5967e
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/OTRefactoringPlugin.java
@@ -0,0 +1,33 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2009 Stephan Herrmann
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: OTRefactoringPlugin.java 23473 2010-02-05 19:46:08Z stephan $
+ *
+ * Please visit http://www.objectteams.org for updates and contact.
+ *
+ * Contributors:
+ * Stephan Herrmann - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.refactoring;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+
+public class OTRefactoringPlugin extends AbstractUIPlugin {
+
+ public static final String PLUGIN_ID = "org.eclipse.objectteams.otdt.refactoring"; //$NON-NLS-1$
+ private static AbstractUIPlugin instance;
+
+ public OTRefactoringPlugin() {
+ instance = this;
+ }
+
+ public static AbstractUIPlugin getInstance() {
+ return instance;
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/adaptor/ActionGroupAdaptor.java b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/adaptor/ActionGroupAdaptor.java
new file mode 100644
index 000000000..cdf81539a
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/adaptor/ActionGroupAdaptor.java
@@ -0,0 +1,144 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2009 Stephan Herrmann.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id$
+ *
+ * Please visit http://www.objectteams.org for updates and contact.
+ *
+ * Contributors:
+ * Stephan Herrmann - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.refactoring.adaptor;
+
+import org.eclipse.jdt.internal.ui.javaeditor.JavaEditor;
+import org.eclipse.jdt.ui.actions.InlineAction;
+import org.eclipse.jdt.ui.actions.SelectionDispatchAction;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.objectteams.otdt.internal.refactoring.otrefactorings.extractcallin.ExtractCallinAction;
+import org.eclipse.objectteams.otdt.internal.refactoring.otrefactorings.inlinecallin.InlineCallinAction;
+import org.eclipse.ui.IWorkbenchSite;
+
+import base org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor;
+import base org.eclipse.jdt.ui.actions.RefactorActionGroup;
+
+/**
+ * @author stephan
+ *
+ */
+@SuppressWarnings("restriction")
+public team class ActionGroupAdaptor
+{
+ public static final String INLINE_CALLIN = "org.eclipse.objectteams.otdt.refactoring.inline.callin"; //$NON-NLS-1$
+ public static final String EXTRACT_CALLIN = "org.eclipse.objectteams.otdt.refactoring.extract.callin"; //$NON-NLS-1$
+
+ protected team class CUEditorAdaptor playedBy CompilationUnitEditor
+ {
+ createActions <- replace createActions;
+ callin void createActions() {
+ within (this)
+ base.createActions();
+ }
+
+ // workaround for broken in-place lowering
+ JavaEditor getJavaEditor() { return this; }
+
+ /** Only active during createActions() - nested in order to pass down the editor instance. */
+ protected class ActionGroupEditorTrigger playedBy RefactorActionGroup
+ {
+ void initOTActions(SelectionDispatchAction action, ISelection selection)
+ <- after void initAction(SelectionDispatchAction action, ISelection selection, String actionDefinitionId)
+ base when (action instanceof InlineAction);
+
+ private void initOTActions(SelectionDispatchAction action, ISelection selection) {
+ new ActionGroup(this, getJavaEditor(), selection);
+ }
+ }
+ }
+
+ /** This trigger is globally active to register OT refactoring actions to the global refactoring menu. */
+ protected class ActionGroupGlobalTrigger playedBy RefactorActionGroup
+ {
+ void initOTActions(SelectionDispatchAction action, ISelectionProvider provider, ISelectionProvider specialProvider, ISelection selection, String actionDefinitionId)
+ <- after void initUpdatingAction(SelectionDispatchAction action, ISelectionProvider provider, ISelectionProvider specialProvider, ISelection selection, String actionDefinitionId)
+ base when (action instanceof InlineAction);
+
+ private void initOTActions(SelectionDispatchAction action, ISelectionProvider provider, ISelectionProvider specialProvider, ISelection selection, String actionDefinitionId) {
+ new ActionGroup(this, provider, specialProvider, selection);
+ }
+ }
+
+ /** This role finally adapts all registered refactoring action groups. */
+ protected class ActionGroup playedBy RefactorActionGroup
+ base when (ActionGroupAdaptor.this.hasRole(base, ActionGroup.class))
+ {
+ @SuppressWarnings("decapsulation")
+ boolean getFBinary() -> get boolean fBinary;
+
+ @SuppressWarnings("decapsulation")
+ IWorkbenchSite getFSite() -> get IWorkbenchSite fSite;
+
+ @SuppressWarnings("decapsulation")
+ void initUpdatingAction(SelectionDispatchAction action, ISelectionProvider provider, ISelectionProvider specialProvider, ISelection selection, String actionDefinitionId)
+ -> void initUpdatingAction(SelectionDispatchAction action, ISelectionProvider provider, ISelectionProvider specialProvider, ISelection selection, String actionDefinitionId);
+
+ SelectionDispatchAction inlineCallinAction;
+ SelectionDispatchAction extractCallinAction;
+
+ protected ActionGroup(RefactorActionGroup group, JavaEditor editor, ISelection selection) {
+ this(group);
+
+ this.inlineCallinAction = new InlineCallinAction().new SelectionDispatchAction(editor);
+ initUpdatingAction(this.inlineCallinAction, null, null, selection, INLINE_CALLIN);
+ editor.setAction("InlineCallin", this.inlineCallinAction); //$NON-NLS-1$
+
+ this.extractCallinAction = new ExtractCallinAction().new SelectionDispatchAction(editor);
+ initUpdatingAction(this.extractCallinAction, null, null, selection, EXTRACT_CALLIN);
+ editor.setAction("ExtractCallin", this.extractCallinAction); //$NON-NLS-1$
+ }
+
+ protected ActionGroup(RefactorActionGroup group, ISelectionProvider provider, ISelectionProvider specialProvider,ISelection selection)
+ {
+ this(group);
+
+ this.inlineCallinAction = new InlineCallinAction().new SelectionDispatchAction(getFSite());
+ initUpdatingAction(this.inlineCallinAction, provider, specialProvider, selection, INLINE_CALLIN);
+
+ this.extractCallinAction = new ExtractCallinAction().new SelectionDispatchAction(getFSite());
+ initUpdatingAction(this.extractCallinAction, provider, specialProvider, selection, EXTRACT_CALLIN);
+ }
+
+ void addAction(IMenuManager menu, IAction action)
+ <- after int addAction(IMenuManager menu, IAction action)
+ base when (action instanceof InlineAction);
+
+
+ private void addAction(IMenuManager menu, IAction action) {
+ if (this.inlineCallinAction != null)
+ menu.add(this.inlineCallinAction);
+ if (this.extractCallinAction != null)
+ menu.add(this.extractCallinAction);
+ }
+
+ void disposeAction(ISelectionChangedListener action, ISelectionProvider provider)
+ <- after void disposeAction(ISelectionChangedListener action, ISelectionProvider provider)
+ base when (action instanceof InlineAction);
+
+
+ private void disposeAction(ISelectionChangedListener action, ISelectionProvider provider) {
+ if (this.inlineCallinAction != null)
+ provider.removeSelectionChangedListener(this.inlineCallinAction);
+ if (this.extractCallinAction != null)
+ provider.removeSelectionChangedListener(this.extractCallinAction);
+ }
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/adaptor/CorextAdaptor.java b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/adaptor/CorextAdaptor.java
new file mode 100644
index 000000000..927b11f41
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/adaptor/CorextAdaptor.java
@@ -0,0 +1,228 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2005, 2006 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute and Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: CorextAdaptor.java 23473 2010-02-05 19:46:08Z stephan $
+ *
+ * Please visit http://www.objectteams.org for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.refactoring.adaptor;
+
+
+import java.util.HashSet;
+import java.util.Iterator;
+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.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IMember;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.core.dom.ASTNode;
+import org.eclipse.jdt.core.dom.BaseCallMessageSend;
+import org.eclipse.jdt.core.dom.CallinMappingDeclaration;
+import org.eclipse.jdt.core.dom.IMethodBinding;
+import org.eclipse.jdt.core.dom.MethodDeclaration;
+import org.eclipse.jdt.core.dom.MethodSpec;
+import org.eclipse.jdt.core.dom.RoleTypeDeclaration;
+import org.eclipse.jdt.core.search.IJavaSearchScope;
+import org.eclipse.jdt.internal.core.JavaProject;
+import org.eclipse.jdt.internal.core.search.JavaSearchScope;
+import org.eclipse.jdt.internal.corext.refactoring.ParameterInfo;
+import org.eclipse.jdt.internal.corext.util.JdtFlags;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.eclipse.objectteams.otdt.core.IOTJavaElement;
+import org.eclipse.objectteams.otdt.internal.refactoring.adaptor.extractmethod.ExtractMethodAmbuguityMsgCreator;
+import org.eclipse.objectteams.otdt.internal.refactoring.adaptor.extractmethod.ExtractMethodOverloadingMsgCreator;
+import org.eclipse.objectteams.otdt.internal.refactoring.corext.OTRefactoringCoreMessages;
+import org.eclipse.objectteams.otdt.internal.refactoring.util.RefactoringUtil;
+
+import base org.eclipse.jdt.internal.corext.refactoring.RefactoringScopeFactory;
+import base org.eclipse.jdt.internal.corext.refactoring.TypedSource;
+import base org.eclipse.jdt.internal.corext.refactoring.code.ExtractMethodRefactoring;
+import base org.eclipse.jdt.internal.corext.refactoring.surround.ExceptionAnalyzer;
+
+/**
+ * @author stephan
+ *
+ */
+@SuppressWarnings("restriction")
+public team class CorextAdaptor
+{
+ protected class TypedSource playedBy TypedSource
+ {
+ static callin boolean canCreateForType(int type){
+ return base.canCreateForType(type)
+ // consider OT-specific elements
+ || type == IOTJavaElement.TEAM
+ || type == IOTJavaElement.ROLE
+ || type == IOTJavaElement.CALLIN_MAPPING
+ || type == IOTJavaElement.CALLOUT_MAPPING
+ || type == IOTJavaElement.CALLOUT_TO_FIELD_MAPPING;
+ }
+ @SuppressWarnings("decapsulation")
+ canCreateForType <- replace canCreateForType;
+ }
+
+ protected class ExtractMethodRefactoring playedBy ExtractMethodRefactoring
+ {
+ // previous version patched inline (better integration with progress monitor?
+// public RefactoringStatus checkFinalConditions(IProgressMonitor pm) throws CoreException {
+// pm.beginTask(RefactoringCoreMessages.ExtractMethodRefactoring_checking_new_name, 2);
+// pm.subTask(EMPTY);
+//
+// RefactoringStatus result= checkMethodName();
+// result.merge(checkParameterNames());
+// result.merge(checkVarargOrder());
+// pm.worked(1);
+// if (pm.isCanceled())
+// throw new OperationCanceledException();
+//
+// BodyDeclaration node= fAnalyzer.getEnclosingBodyDeclaration();
+// if (node != null) {
+// fAnalyzer.checkInput(result, fMethodName, fAST);
+// pm.worked(1);
+// }
+//// {ObjectTeams: also check for overloading and ambiguity in OT-subclassed elements
+// pm.subTask("OTExtractMethodRefactoring.checking_overloading");
+// result.merge(checkOverloadingAndAmbiguity(pm));
+// //sko}
+// pm.done();
+// return result;
+// }
+
+
+ // let's just append this behavior:
+ void checkFinalConditions(IProgressMonitor pm, RefactoringStatus result)
+ throws CoreException
+ {
+ pm.beginTask(OTRefactoringCoreMessages.getString("OTExtractMethodRefactoring.checking_overloading"), 1); //$NON-NLS-1$
+ pm.subTask(""); //$NON-NLS-1$
+ result.merge(checkOverloadingAndAmbiguity(pm));
+ pm.worked(1);
+ pm.done();
+ }
+ void checkFinalConditions(IProgressMonitor pm, RefactoringStatus status)
+ <- after RefactoringStatus checkFinalConditions(IProgressMonitor pm)
+ with {
+ pm <- pm, status <- result
+ }
+
+ // also check for overloading and ambiguity in OT-subclassed elements
+ private RefactoringStatus checkOverloadingAndAmbiguity(IProgressMonitor pm)
+ throws JavaModelException
+ {
+ return RefactoringUtil.checkOverloadingAndAmbiguity(getCompilationUnit(),
+ getDestination(), getMethodName(), getParamTypes(),
+ new ExtractMethodAmbuguityMsgCreator(),
+ new ExtractMethodOverloadingMsgCreator(), pm);
+ }
+
+ private String[] getParamTypes() {
+ List<ParameterInfo> infos = getParameterInfos();
+ if (infos.size() == 0)
+ return new String[0];
+ String[] result = new String[infos.size()];
+ Iterator<ParameterInfo> iterator = infos.iterator();
+ for (int i=0; iterator.hasNext();i++)
+ result[i] = iterator.next().getNewTypeName();
+
+ return result;
+ }
+
+ ICompilationUnit getCompilationUnit() -> ICompilationUnit getCompilationUnit();
+ @SuppressWarnings("decapsulation")
+ ASTNode getDestination() -> get ASTNode fDestination;
+ String getMethodName() -> String getMethodName();
+
+ @SuppressWarnings("unchecked")
+ List<ParameterInfo> getParameterInfos() -> List getParameterInfos();
+ }
+
+ protected class RefactoringScopeFactory playedBy RefactoringScopeFactory {
+ static void create(IJavaElement javaElement, boolean considerVisibility, IJavaSearchScope scope)
+ throws JavaModelException
+ {
+ if (considerVisibility & javaElement instanceof IMember) {
+ IMember member= (IMember) javaElement;
+ if (JdtFlags.isPrivate(member)) {
+ int includeMask = IJavaSearchScope.REFERENCED_PROJECTS | IJavaSearchScope.SOURCES | IJavaSearchScope.APPLICATION_LIBRARIES;
+ ((JavaSearchScope)scope).add((JavaProject)javaElement.getJavaProject(), includeMask, new HashSet<IProject>());
+ }
+ }
+ }
+ void create(IJavaElement javaElement, boolean considerVisibility, IJavaSearchScope scope)
+ <- after IJavaSearchScope create(IJavaElement javaElement, boolean considerVisibility, boolean sourceReferencesOnly)
+ with {
+ javaElement <- javaElement,
+ considerVisibility <- considerVisibility,
+ scope <- result
+ }
+
+ }
+
+ /** Need to analyze one more node type: BaseCallMessageSend. */
+ protected class ExceptionAnalyzer playedBy ExceptionAnalyzer
+ {
+ @SuppressWarnings("decapsulation")
+ boolean handleExceptions(IMethodBinding binding) -> boolean handleExceptions(IMethodBinding binding);
+ @SuppressWarnings("decapsulation")
+ boolean isSelected(ASTNode node) -> boolean isSelected(ASTNode node);
+
+ boolean visit(BaseCallMessageSend node) <- replace boolean visit(BaseCallMessageSend node);
+ @SuppressWarnings({ "basecall", "unchecked" }) // unchecked: List getBaseMappingElements()
+ callin boolean visit(BaseCallMessageSend node)
+ {
+ if (!isSelected(node))
+ return false;
+
+ // find enclosing method
+ ASTNode parent= node.getParent();
+ while (parent != null && parent.getNodeType() != ASTNode.METHOD_DECLARATION)
+ parent= parent.getParent();
+ if (parent == null)
+ return false;
+ IMethodBinding method= ((MethodDeclaration)parent).resolveBinding();
+ if (method == null)
+ return false;
+
+ // find enclosing role type
+ while (parent != null && parent.getNodeType() != ASTNode.ROLE_TYPE_DECLARATION)
+ parent= parent.getParent();
+ if (parent == null)
+ return false;
+ RoleTypeDeclaration role= (RoleTypeDeclaration)parent;
+
+ // find all bound base methods and collect the exceptions they declare
+ boolean result= false;
+ for (CallinMappingDeclaration callinDecl: role.getCallIns()) {
+ MethodSpec roleMethod = (MethodSpec)callinDecl.getRoleMappingElement();
+ if (roleMethod.resolveBinding() == method) {
+ List<ASTNode> baseMethods= callinDecl.getBaseMappingElements(); // raw conversion
+ for (ASTNode elem : baseMethods) {
+ if (elem.getNodeType() == ASTNode.METHOD_SPEC) {
+ MethodSpec baseMethod= (MethodSpec)elem;
+ if (handleExceptions(baseMethod.resolveBinding()))
+ result= true;
+ }
+ }
+ }
+ }
+ return result;
+ }
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/adaptor/MoveAdaptor.java b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/adaptor/MoveAdaptor.java
new file mode 100644
index 000000000..a58e37d94
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/adaptor/MoveAdaptor.java
@@ -0,0 +1,76 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2008 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: MoveAdaptor.java 23473 2010-02-05 19:46:08Z stephan $
+ *
+ * Please visit http://www.objectteams.org for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.refactoring.adaptor;
+
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.internal.corext.refactoring.RefactoringCoreMessages;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.eclipse.ltk.core.refactoring.RefactoringStatusEntry;
+import org.eclipse.objectteams.otdt.core.IOTType;
+import org.eclipse.objectteams.otdt.core.OTModelManager;
+
+import base org.eclipse.jdt.internal.corext.refactoring.structure.MoveStaticMembersProcessor;
+
+/**
+ * Adjust rules for move static member with respect to OT/J.
+ *
+ * @author stephan
+ * @since 1.1.7
+ */
+@SuppressWarnings("restriction")
+public team class MoveAdaptor
+{
+ @SuppressWarnings("decapsulation")
+ protected class MoveStaticMembersProcessor playedBy MoveStaticMembersProcessor {
+
+ IType getFDestinationType() -> get IType fDestinationType;
+
+ RefactoringStatus checkDestinationType() <- replace RefactoringStatus checkDestinationType();
+ callin RefactoringStatus checkDestinationType()
+ throws JavaModelException
+ {
+ RefactoringStatus result= base.checkDestinationType();
+ if (result.isOK())
+ return result;
+ // check for error that is actually tolerable for roles:
+ IOTType otType= OTModelManager.getOTElement(getFDestinationType());
+ if (otType != null) {
+ if (otType.isRole())
+ {
+ boolean filtered= false;
+ RefactoringStatus newStatus= new RefactoringStatus();
+
+ for (RefactoringStatusEntry entry : result.getEntries())
+ if (isTolerableError(entry))
+ filtered= true;// filter out: roles may indeed hold static members (in contrast to nested types in Java)
+ else
+ newStatus.addEntry(entry);
+
+ if (filtered)
+ return newStatus;
+ }
+ }
+ return result;
+ }
+ boolean isTolerableError(RefactoringStatusEntry entry) {
+ if (entry.isError())
+ return entry.getMessage().equals(RefactoringCoreMessages.MoveMembersRefactoring_static_declaration);
+ return false;
+ }
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/adaptor/MoveInstanceMethodAdaptor.java b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/adaptor/MoveInstanceMethodAdaptor.java
new file mode 100644
index 000000000..97a85de45
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/adaptor/MoveInstanceMethodAdaptor.java
@@ -0,0 +1,69 @@
+package org.eclipse.objectteams.otdt.internal.refactoring.adaptor;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jdt.core.IMethod;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
+import org.eclipse.objectteams.otdt.internal.refactoring.util.IAmbuguityMessageCreator;
+import org.eclipse.objectteams.otdt.internal.refactoring.util.IOverloadingMessageCreator;
+import org.eclipse.objectteams.otdt.internal.refactoring.util.RefactoringUtil;
+
+import base org.eclipse.jdt.internal.corext.refactoring.structure.MoveInstanceMethodProcessor;
+
+/**
+ * @author Johannes Gebauer
+ *
+ */
+@SuppressWarnings("restriction")
+public team class MoveInstanceMethodAdaptor {
+
+
+ @SuppressWarnings("decapsulation")
+ protected class MoveInstanceMethodProcessor playedBy MoveInstanceMethodProcessor {
+
+ // callouts
+ IMethod getFMethod() -> get IMethod fMethod;
+ IMethod getMethod() -> IMethod getMethod();
+ String getMethodName() -> String getMethodName();
+ IType getTargetType() -> IType getTargetType();
+
+ void checkFinalConditions(IProgressMonitor pm, RefactoringStatus result) throws CoreException {
+ if(!result.hasFatalError())
+ result.merge(RefactoringUtil.checkForExistingRoles("Move Instance Method", getFMethod().getJavaProject(), pm));
+ pm.beginTask("Checking Overloading", 1);
+ pm.subTask(""); //$NON-NLS-1$
+ result.merge(checkOverloadingAndAmbiguity(pm));
+ pm.worked(1);
+ pm.done();
+ }
+
+ void checkFinalConditions(IProgressMonitor pm, RefactoringStatus status) <- after RefactoringStatus checkFinalConditions(IProgressMonitor pm,
+ CheckConditionsContext context) with {
+ pm <- pm,
+ status <- result
+ }
+
+ private RefactoringStatus checkOverloadingAndAmbiguity(IProgressMonitor pm) throws JavaModelException {
+
+ String[] paramTypes = getMethod().getParameterTypes();
+
+ return RefactoringUtil.checkOverloadingAndAmbiguity(getTargetType(), null /* targetTypeHierarchy */, getMethodName(), paramTypes,
+ new IAmbuguityMessageCreator() {
+
+ public String createAmbiguousMethodSpecifierMsg() {
+ return "Refactoring cannot be performed! There would be an ambiguous method specifier in a method binding after moving!";
+ }
+
+ }, new IOverloadingMessageCreator() {
+
+ public String createOverloadingMessage() {
+ return "Moved method will be overloaded after refactoring!";
+ }
+
+ }, pm);
+ }
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/adaptor/NotSuppoertedRefactoringAdaptor.java b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/adaptor/NotSuppoertedRefactoringAdaptor.java
new file mode 100644
index 000000000..9de232e5b
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/adaptor/NotSuppoertedRefactoringAdaptor.java
@@ -0,0 +1,125 @@
+/**
+ *
+ */
+package org.eclipse.objectteams.otdt.internal.refactoring.adaptor;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
+import org.eclipse.objectteams.otdt.internal.refactoring.util.RefactoringUtil;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IField;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IMethod;
+import org.eclipse.jdt.core.ITypeRoot;
+import org.eclipse.jdt.core.refactoring.descriptors.ExtractClassDescriptor;
+
+import base org.eclipse.jdt.internal.corext.refactoring.code.InlineConstantRefactoring;
+import base org.eclipse.jdt.internal.corext.refactoring.code.InlineMethodRefactoring;
+import base org.eclipse.jdt.internal.corext.refactoring.code.IntroduceIndirectionRefactoring;
+import base org.eclipse.jdt.internal.corext.refactoring.structure.ChangeSignatureProcessor;
+import base org.eclipse.jdt.internal.corext.refactoring.structure.ChangeTypeRefactoring;
+import base org.eclipse.jdt.internal.corext.refactoring.structure.ExtractClassRefactoring;
+import base org.eclipse.jdt.internal.corext.refactoring.structure.IntroduceParameterObjectProcessor;
+
+/**
+ * This team holds roles for refactorings that are not yet fully ot-aware. It adds an refactoring info status if any roles exist within the target project.
+ *
+ * @author Johannes Gebauer
+ *
+ */
+@SuppressWarnings("restriction")
+public team class NotSuppoertedRefactoringAdaptor {
+
+ protected class IntroduceIndirectionRefactoring playedBy IntroduceIndirectionRefactoring {
+
+ IJavaProject getProject() -> IJavaProject getProject();
+
+ private void checkFinalConditions(IProgressMonitor pm, RefactoringStatus status) when(!status.hasFatalError()) {
+ status.merge(RefactoringUtil.checkForExistingRoles("Introduce Indirection", getProject(),pm));
+ }
+
+ void checkFinalConditions(IProgressMonitor pm, RefactoringStatus status) <- after RefactoringStatus checkFinalConditions(
+ IProgressMonitor pm) with {
+ pm <- pm,
+ status <- result
+ }
+ }
+
+ protected class InlineMethodRefactoring playedBy InlineMethodRefactoring {
+ @SuppressWarnings("decapsulation")
+ ITypeRoot getFInitialTypeRoot() -> get ITypeRoot fInitialTypeRoot;
+
+ private void checkFinalConditions(IProgressMonitor pm, RefactoringStatus status) when(!status.hasFatalError()) {
+ status.merge(RefactoringUtil.checkForExistingRoles("Inline Method", getFInitialTypeRoot().getJavaProject(), pm));
+ }
+
+ void checkFinalConditions(IProgressMonitor pm, RefactoringStatus status) <- after RefactoringStatus checkFinalConditions(IProgressMonitor pm) with {
+ pm <- pm,
+ status <- result
+ }
+ }
+
+ protected class InlineConstantRefactoring playedBy InlineConstantRefactoring {
+ @SuppressWarnings("decapsulation")
+ IField getFField() -> get IField fField;
+
+ private void checkFinalConditions(IProgressMonitor pm, RefactoringStatus status) when(!status.hasFatalError()) {
+ status.merge(RefactoringUtil.checkForExistingRoles("Inline Constant", getFField().getJavaProject(), pm));
+ }
+
+ void checkFinalConditions(IProgressMonitor pm, RefactoringStatus status) <- after RefactoringStatus checkFinalConditions(IProgressMonitor pm) with {
+ pm <- pm,
+ status <- result
+ }
+ }
+
+ protected class ExtractClassRefactoring playedBy ExtractClassRefactoring {
+ @SuppressWarnings("decapsulation")
+ ExtractClassDescriptor getFDescriptor() -> get ExtractClassDescriptor fDescriptor;
+
+ private void checkFinalConditions(IProgressMonitor pm, RefactoringStatus status) when(!status.hasFatalError()) {
+ status.merge(RefactoringUtil.checkForExistingRoles("Extract Class", getFDescriptor().getType().getJavaProject(), pm));
+ }
+
+ void checkFinalConditions(IProgressMonitor pm, RefactoringStatus status) <- after RefactoringStatus checkFinalConditions(IProgressMonitor pm) with {
+ pm <- pm,
+ status <- result
+ }
+ }
+
+ protected class ChangeSignatureProcessor playedBy ChangeSignatureProcessor {
+ @SuppressWarnings("decapsulation")
+ IMethod getFMethod() -> get IMethod fMethod;
+
+ protected void checkFinalConditions(IProgressMonitor pm, RefactoringStatus status) when(!status.hasFatalError()) {
+ status.merge(RefactoringUtil.checkForExistingRoles("Change Signature", getFMethod().getJavaProject(), pm));
+ }
+
+ void checkFinalConditions(IProgressMonitor pm, RefactoringStatus status) <- after RefactoringStatus checkFinalConditions(IProgressMonitor pm,
+ CheckConditionsContext context) with {
+ pm <- pm,
+ status <- result
+ }
+ }
+
+ protected class IntroduceParameterObjectProcessor extends ChangeSignatureProcessor playedBy IntroduceParameterObjectProcessor {
+ protected void checkFinalConditions(IProgressMonitor pm, RefactoringStatus status) when(!status.hasFatalError()) {
+ status.merge(RefactoringUtil.checkForExistingRoles("Introduce Parameter Object", getFMethod().getJavaProject(), pm));
+ }
+ }
+
+ protected class ChangeTypeRefactoring playedBy ChangeTypeRefactoring {
+ @SuppressWarnings("decapsulation")
+ ICompilationUnit getFCu() -> get ICompilationUnit fCu;
+
+ private void checkFinalConditions(IProgressMonitor pm, RefactoringStatus status) when(!status.hasFatalError()) {
+ status.merge(RefactoringUtil.checkForExistingRoles("Change Type", getFCu().getJavaProject(), pm));
+ }
+
+ void checkFinalConditions(IProgressMonitor pm, RefactoringStatus status) <- after RefactoringStatus checkFinalConditions(IProgressMonitor pm) with {
+ pm <- pm,
+ status <- result
+ }
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/adaptor/PhantomTypeAdaptor.java b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/adaptor/PhantomTypeAdaptor.java
new file mode 100644
index 000000000..fe06b3161
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/adaptor/PhantomTypeAdaptor.java
@@ -0,0 +1,41 @@
+/**
+ *
+ */
+package org.eclipse.objectteams.otdt.internal.refactoring.adaptor;
+
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.ITypeParameter;
+import org.eclipse.jdt.core.JavaModelException;
+
+import base org.eclipse.objectteams.otdt.core.PhantomType;
+
+/**
+ *
+ * This team provides the implementation for some unimplemented methods in
+ * {@link PhantomType}, that would otherwise throw an
+ * <code>UnsupportedOperationException</code>. The methods are used in
+ * {@link RenameTypeAdaptor} to search for <code>PhantomType</code> references
+ * with the java search. This team should be removed if the necessary methods
+ * are implemented in the original {@link PhantomType}.
+ *
+ * @author Johannes Gebauer
+ */
+public team class PhantomTypeAdaptor{
+ protected class PhantomType playedBy PhantomType {
+
+ IType getRealType() -> IType getRealType();
+
+ @SuppressWarnings("basecall")
+ callin ITypeParameter[] getTypeParameters() throws JavaModelException {
+ return getRealType().getTypeParameters();
+ }
+ getTypeParameters <- replace getTypeParameters;
+
+ @SuppressWarnings("basecall")
+ callin boolean isResolved() {
+ return false;
+ }
+ isResolved <- replace isResolved;
+
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/adaptor/RenameAdaptor.java b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/adaptor/RenameAdaptor.java
new file mode 100644
index 000000000..59addc02e
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/adaptor/RenameAdaptor.java
@@ -0,0 +1,339 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2005, 2006 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute and Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: RenameAdaptor.java 23473 2010-02-05 19:46:08Z stephan $
+ *
+ * Please visit http://www.objectteams.org for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.refactoring.adaptor;
+
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jdt.core.Flags;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IMethod;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.ITypeHierarchy;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.core.WorkingCopyOwner;
+import org.eclipse.jdt.core.dom.BaseCallMessageSend;
+import org.eclipse.jdt.core.dom.MethodDeclaration;
+import org.eclipse.jdt.internal.corext.refactoring.base.ReferencesInBinaryContext;
+import org.eclipse.jdt.internal.corext.refactoring.changes.TextChangeCompatibility;
+import org.eclipse.jdt.internal.corext.refactoring.util.TextChangeManager;
+import org.eclipse.jdt.internal.ui.JavaPlugin;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.eclipse.ltk.core.refactoring.TextChange;
+import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
+import org.eclipse.text.edits.ReplaceEdit;
+import org.eclipse.objectteams.otdt.internal.core.OTTypeHierarchy;
+import org.eclipse.objectteams.otdt.internal.refactoring.adaptor.rename.RenameMethodAmbuguityMsgCreator;
+import org.eclipse.objectteams.otdt.internal.refactoring.adaptor.rename.RenameMethodOverloadingMsgCreator;
+import org.eclipse.objectteams.otdt.internal.refactoring.corext.OTRefactoringCoreMessages;
+import org.eclipse.objectteams.otdt.internal.refactoring.corext.rename.BaseCallFinder;
+import org.eclipse.objectteams.otdt.internal.refactoring.util.RefactoringUtil;
+
+import base org.eclipse.jdt.internal.corext.refactoring.rename.MethodChecks;
+import base org.eclipse.jdt.internal.corext.refactoring.rename.RenameVirtualMethodProcessor;
+import base org.eclipse.jdt.internal.corext.refactoring.rename.RippleMethodFinder2;
+
+/**
+ * @author stephan
+ *
+ */
+@SuppressWarnings("restriction")
+public team class RenameAdaptor
+{
+ @SuppressWarnings("basecall")
+ protected class MethodChecks playedBy MethodChecks
+ {
+ // dispatching some methods. Might consider collecting the dispatch and the implementation..
+
+ static callin IMethod getTopmostMethod(IMethod method, ITypeHierarchy typeHierarchy, IProgressMonitor monitor)
+ throws JavaModelException
+ {
+ return RefactoringUtil.getTopmostMethod(method, typeHierarchy, monitor);
+ }
+ getTopmostMethod <- replace getTopmostMethod;
+
+ static callin boolean isVirtual(IMethod method)
+ throws JavaModelException
+ {
+ return RefactoringUtil.isVirtual(method);
+ }
+ boolean isVirtual(IMethod method) <- replace boolean isVirtual(IMethod method);
+ }
+
+ @SuppressWarnings("decapsulation") // multiple
+ protected class RippleMethodFinder2 playedBy RippleMethodFinder2
+ {
+ @SuppressWarnings("basecall")
+ callin void createHierarchyOfDeclarations(IProgressMonitor pm, WorkingCopyOwner owner)
+ throws JavaModelException
+ {
+// UNUSED orig:
+// IRegion region= JavaCore.newRegion();
+// for (Iterator<IMethod> iter= getFDeclarations().iterator(); iter.hasNext();) {
+// IType declaringType= iter.next().getDeclaringType();
+// region.add(declaringType);
+// }
+// fHierarchy= JavaCore.newTypeHierarchy(region, owner, pm);
+ //{ObjectTeams: use OTTypeHierarchy
+ IType declaringType= getFMethod().getDeclaringType();
+ // FIXME(SH): OTTypeHierarchy cannot be computed for regions!
+ OTTypeHierarchy hier = new OTTypeHierarchy(declaringType, true);
+ hier.refresh(pm);
+ setFHierarchy(hier);
+ //jsv}
+ }
+
+ static callin IMethod[] getRelatedMethods(IMethod method, IProgressMonitor monitor)
+ throws CoreException
+ {
+ // for combining two result arrays:
+ HashSet<IMethod> methods = new HashSet<IMethod>();
+
+ // OT-Strategy (knows about implicit inheritance):
+ // TODO(SH): passing null-TypeHierarchy probably causes a performance penalty.
+ IMethod topMethod= RefactoringUtil.getTopmostMethod(method, null, monitor);
+ if (topMethod != null)
+ method= topMethod;
+ IMethod[] methodArray = RefactoringUtil.getOverriddenMethods(method, monitor);
+ if (methodArray != null)
+ for (IMethod m : methodArray)
+ methods.add(m);
+
+ // Java-Strategy:
+ methodArray = base.getRelatedMethods(method, monitor);
+ if (methodArray != null)
+ for (IMethod m : methodArray)
+ methods.add(m);
+
+ // merge results:
+ methodArray = new IMethod[methods.size()];
+ return methods.toArray(methodArray);
+ }
+ IMethod[] getRelatedMethods(IMethod method, IProgressMonitor pm)
+ <- replace IMethod[] getRelatedMethods(IMethod method, ReferencesInBinaryContext binaryRefs,
+ IProgressMonitor pm, WorkingCopyOwner owner)
+ with { method <- method, pm <- pm, result -> result }
+
+
+ createHierarchyOfDeclarations <- replace createHierarchyOfDeclarations;
+ void setFHierarchy(ITypeHierarchy fHierarchy) -> set ITypeHierarchy fHierarchy;
+ IMethod getFMethod() -> get IMethod fMethod;
+ }
+ /**
+ * This class implements the adaptation of the rename virtual method
+ * refactoring for OT/J
+ * (both from otdt..RenameVirtualMethodProcessor and OTRenameVirtualMethodProcessor).
+ *
+ * <p>The adaptation is implemented as follows:</p>
+ * <p>
+ * Preconditions:
+ * <ol>
+ * <li><code>checkFinalConditions(IProgressMonitor, CheckConditionsContext)
+ * </code>:</li>
+ * <ul>
+ * <li>An additional check has been added for cases, where a role class
+ * implements an interface. See the comment of this method for a more
+ * detailed description of the added check.</li>
+ * <li>For collecting all references to the target method, the <code>
+ * RefactoringSearchEngine</code> is used <code>(RenameMethodProcessor.
+ * getOccurrences(IProgressMonitor, RefactoringStatus))</code>. In
+ * particular, the classes <code>MatchLocatorParser</code>, <code>
+ * MatchLocator</code>, <code>PatternLocator</code>, <code>OrLocator
+ * </code>, and <code>MethodLocator</code> have been modified, in order
+ * to find references in callin and callout method bindings.</li>
+ * </ul>
+ * </ol>
+ * </p>
+ *
+ * @author brcan
+ */
+ @SuppressWarnings("decapsulation") // multiple!
+ protected class RenameVirtualMethodProcessor
+// extends JavaRenameProcessor
+ playedBy RenameVirtualMethodProcessor
+ {
+ // copied from base method
+ @SuppressWarnings("basecall")
+ callin ITypeHierarchy getCachedHierarchy(IType declaring, IProgressMonitor monitor)
+ throws JavaModelException
+ {
+ ITypeHierarchy cachedHierarchy = getFCachedHierarchy();
+ if (cachedHierarchy != null && declaring.equals(cachedHierarchy.getType()))
+ return cachedHierarchy;
+ //{ObjectTeams: use OTTypeHierarchy
+ //orig: fCachedHierarchy= declaring.newTypeHierarchy(new SubProgressMonitor(monitor, 1));
+ cachedHierarchy = new OTTypeHierarchy(declaring, true);
+ cachedHierarchy.refresh(monitor);
+ setFCachedHierarchy(cachedHierarchy);
+ //jsv}
+ return cachedHierarchy;
+ }
+ getCachedHierarchy <- replace getCachedHierarchy;
+
+ ITypeHierarchy getFCachedHierarchy() -> get ITypeHierarchy fCachedHierarchy;
+ void setFCachedHierarchy(ITypeHierarchy fCachedHierarchy) -> set ITypeHierarchy fCachedHierarchy;
+
+ // communication vars for enclosing doCheckFinalConditions():
+ IProgressMonitor tmpMonitor = null;
+ String tmpErrorMsg = null;
+ /*
+ * TODO(SH): isSpecialCase() is only invoked for interface methods. Is this the correct hook?
+ */
+ void isOTSpecialCase () throws CoreException
+ {
+ if (RefactoringUtil.isOTSpecialCase(getMethod(),
+ getNewElementName(),
+ true,
+ tmpMonitor))
+ {
+ tmpErrorMsg = OTRefactoringCoreMessages.getString("RenameVirtualMethodRefactoring.special_team_method"); //$NON-NLS-1$
+ }
+ }
+ isOTSpecialCase <- after isSpecialCase;
+ /**
+ * Provides OT-specific final condition checking and performs the
+ * final condition checking provided by the standard Eclipse
+ * implementation.
+ * <p>
+ * What:
+ * <ol>
+ * <li>OT-specific final condition checking:</li>
+ * <ul>
+ * <li>The following additional checks/changes have been added:
+ * (1) check for overloading and ambiguous method specs.
+ * (2) Update base calls when renaming callin methods.
+ * </li>
+ * </ul>
+ * </ol>
+ * </p>
+ */
+ callin RefactoringStatus doCheckFinalConditions(IProgressMonitor pm, CheckConditionsContext checkContext)
+ throws CoreException
+ {
+ tmpMonitor = pm;
+ tmpErrorMsg = null;
+ RefactoringStatus result = null;
+ try {
+ result = base.doCheckFinalConditions(pm, checkContext);
+ result.merge(checkOverloadingAndAmbiguity(pm));
+ } finally {
+ if (tmpErrorMsg != null && result != null)
+ result.addError(tmpErrorMsg);
+ tmpErrorMsg = null;
+ }
+ return result;
+ }
+ doCheckFinalConditions <- replace doCheckFinalConditions;
+
+ // also check for overloading and ambiguity in OT-subclassed elements
+ @SuppressWarnings("nls")
+ private RefactoringStatus checkOverloadingAndAmbiguity(IProgressMonitor pm)
+ throws JavaModelException
+ {
+ IMethod newMethod = getOriginalMethod();
+ IType focusType = getOriginalMethod().getDeclaringType();
+ if (focusType.isAnnotation() || focusType.isEnum())
+ return new RefactoringStatus();
+ ICompilationUnit cu = focusType.getCompilationUnit();
+ String newMethodName = getNewElementName();
+
+ try
+ {
+ return RefactoringUtil.checkOverloadingAndAmbiguity(cu,
+ focusType,
+ newMethodName,
+ getOriginalMethod().getElementName(),
+ newMethod.getParameterTypes(),
+ new RenameMethodAmbuguityMsgCreator(),
+ new RenameMethodOverloadingMsgCreator(), pm);
+ }
+ catch (JavaModelException e)
+ {
+ //TODO(jsv): Use meaningful message and store it in the message file
+ RefactoringStatus result = new RefactoringStatus();
+ result.addError("Error while checking overloading and ambiguity");
+ return result;
+ }
+ }
+
+ void addOccurrences(TextChangeManager manager, IProgressMonitor pm, RefactoringStatus status)
+ throws CoreException
+ {
+ createChangeForPotentialBaseCalls(manager);
+ }
+ addOccurrences <- after addOccurrences;
+
+ /**
+ * Creates changes for base call in a callin method.
+ * Appearance of warning or error is not possible, this method does not
+ * return a refactoring status.
+ */
+ private void createChangeForPotentialBaseCalls(TextChangeManager changeManager)
+ {
+ Set<IMethod> methodsToRename = getMethodsToRename();
+
+ for (Iterator<IMethod> methods = methodsToRename.iterator(); methods.hasNext();)
+ {
+ IMethod currentMethod = methods.next();
+ MethodDeclaration methodDeclaration = null;
+ try
+ {
+ if (!Flags.isCallin(currentMethod.getFlags()))
+ {
+ continue;
+ }
+ methodDeclaration = RefactoringUtil.getMethodDeclaration(currentMethod);
+ }
+ catch (JavaModelException ex)
+ {
+ JavaPlugin.logErrorMessage("Problems while searching DOM AST representation of a method"); //$NON-NLS-1$
+ continue;
+ }
+
+ BaseCallFinder baseCallFinder = new BaseCallFinder();
+ methodDeclaration.accept(baseCallFinder);
+ BaseCallMessageSend[] baseCalls = baseCallFinder.getResult();
+
+ for (int idx = 0;idx < baseCalls.length; idx++)
+ {
+ ICompilationUnit cu = currentMethod.getCompilationUnit();
+ TextChange textChange = changeManager.get(cu);
+
+ String editName = OTRefactoringCoreMessages.getString(
+ "OTRenameVirtualMethodProcessor.update_base_call_occurrence"); //$NON-NLS-1$
+ TextChangeCompatibility.addTextEdit(textChange, editName,
+ new ReplaceEdit(baseCalls[idx].getName().getStartPosition(),
+ baseCalls[idx].getName().getLength(),
+ getNewElementName()));
+ }
+ }
+ }
+
+ IMethod getOriginalMethod() -> IMethod getOriginalMethod();
+ String getNewElementName() -> String getNewElementName();
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ Set<IMethod> getMethodsToRename() -> Set getMethodsToRename();
+ IMethod getMethod() -> IMethod getMethod();
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/adaptor/RenameTypeAdaptor.java b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/adaptor/RenameTypeAdaptor.java
new file mode 100644
index 000000000..ce068e5c1
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/adaptor/RenameTypeAdaptor.java
@@ -0,0 +1,730 @@
+/**
+ *
+ */
+package org.eclipse.objectteams.otdt.internal.refactoring.adaptor;
+
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.jdt.core.Flags;
+import org.eclipse.jdt.core.IClassFile;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IPackageFragment;
+import org.eclipse.jdt.core.IPackageFragmentRoot;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.internal.corext.refactoring.Checks;
+import org.eclipse.jdt.internal.corext.refactoring.RefactoringCoreMessages;
+import org.eclipse.jdt.internal.corext.refactoring.SearchResultGroup;
+import org.eclipse.jdt.internal.corext.refactoring.base.JavaStatusContext;
+import org.eclipse.jdt.internal.corext.refactoring.changes.DynamicValidationRefactoringChange;
+import org.eclipse.jdt.internal.corext.refactoring.changes.RenameCompilationUnitChange;
+import org.eclipse.jdt.internal.corext.refactoring.changes.RenamePackageChange;
+import org.eclipse.jdt.internal.corext.refactoring.changes.TextChangeCompatibility;
+import org.eclipse.jdt.internal.corext.refactoring.util.TextChangeManager;
+import org.eclipse.jdt.internal.corext.util.JavaModelUtil;
+import org.eclipse.jdt.internal.corext.util.Messages;
+import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.eclipse.ltk.core.refactoring.TextChange;
+import org.eclipse.ltk.core.refactoring.TextFileChange;
+import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
+import org.eclipse.text.edits.ReplaceEdit;
+import org.eclipse.objectteams.otdt.core.IOTType;
+import org.eclipse.objectteams.otdt.core.IRoleType;
+import org.eclipse.objectteams.otdt.core.OTModelManager;
+import org.eclipse.objectteams.otdt.core.PhantomType;
+import org.eclipse.objectteams.otdt.core.TypeHelper;
+import org.eclipse.objectteams.otdt.internal.core.OTTypeHierarchy;
+
+import base org.eclipse.jdt.internal.corext.refactoring.rename.RenameTypeProcessor;
+
+
+
+/**
+ * @author Johannes Gebauer
+ *
+ */
+@SuppressWarnings({"restriction","rawtypes","decapsulation"})
+public team class RenameTypeAdaptor {
+
+ protected class RenameTypeProcessor playedBy RenameTypeProcessor {
+
+ private static final String ICONFINED = "IConfined"; //$NON-NLS-1$
+ private static final String CONFINED = "Confined"; //$NON-NLS-1$
+ private static final String ILOWERABLE = "ILowerable"; //$NON-NLS-1$
+
+ private IPackageFragment fRoleDirectory;
+ private IType[] fImplicitRelatedTypes;
+ private IType[] fImplicitRelatedPhantomTypes;
+ private OTTypeHierarchy fOTTypeHierarchy;
+ private boolean fTypeToRenameIsRole;
+ private String fCachedNewElementName;
+ private JavaModelException fCachedException;
+
+ // ======= callouts =======
+ LinkedHashMap getFPreloadedElementToName() -> get LinkedHashMap fPreloadedElementToName;
+ void setFPreloadedElementToName(LinkedHashMap preloadedElementToName) -> set LinkedHashMap fPreloadedElementToName;
+ IType getFType() -> get IType fType;
+ void setFType(IType type) -> set IType fType;
+ String getNewElementLabel() -> String getNewElementLabel();
+ TextChangeManager getFChangeManager() -> get TextChangeManager fChangeManager;
+ SearchResultGroup[] getFReferences() -> get SearchResultGroup[] fReferences;
+ void setFReferences(SearchResultGroup[] fReferences) -> set SearchResultGroup[] fReferences;
+ String getNewElementName() -> String getNewElementName();
+ boolean getUpdateSimilarDeclarations() -> boolean getUpdateSimilarDeclarations();
+ int getFRenamingStrategy() -> get int fRenamingStrategy;
+ int getFCachedRenamingStrategy() -> get int fCachedRenamingStrategy;
+ boolean getFCachedRenameSimilarElements() -> get boolean fCachedRenameSimilarElements;
+ RefactoringStatus getFCachedRefactoringStatus() -> get RefactoringStatus fCachedRefactoringStatus;
+ String getFCachedNewName() -> get String fCachedNewName;
+ void setFPreloadedElementToNameDefault(LinkedHashMap fPreloadedElementToNameDefault) -> set LinkedHashMap fPreloadedElementToNameDefault;
+ LinkedHashMap getFPreloadedElementToNameDefault() -> get LinkedHashMap fPreloadedElementToNameDefault;
+ void setFPreloadedElementToSelection(Map fPreloadedElementToSelection) -> set Map fPreloadedElementToSelection;
+ Map getFPreloadedElementToSelection() -> get Map fPreloadedElementToSelection;
+ void setFFinalSimilarElementToName(Map fFinalSimilarElementToName) -> set Map fFinalSimilarElementToName;
+ Map getFFinalSimilarElementToName() -> get Map fFinalSimilarElementToName;
+
+
+ callin RefactoringStatus doCheckFinalConditions(IProgressMonitor pm, CheckConditionsContext context) throws CoreException{
+ initializeOTInformations(pm);
+
+ // Java conditions:
+ RefactoringStatus jdtStatus = base.doCheckFinalConditions(pm, context);
+ if(jdtStatus.hasFatalError()){
+ return jdtStatus;
+ }
+
+ // throw a cached exception that could not be thrown earlier
+ if(fCachedException != null){
+ throw fCachedException;
+ }
+
+ // OT conditions:
+ if(Flags.isTeam(getFType().getFlags())){
+ if(fRoleDirectory != null){
+ jdtStatus.merge(checkForConflictingRoleDirectoryName(fRoleDirectory));
+ }
+ }
+
+ // Special Conditions for Roles
+ if(fTypeToRenameIsRole){
+ jdtStatus.merge(checkForRoleOverriding(pm));
+ jdtStatus.merge(checkRenameForImplicitRelatedTypes(getFType(), fOTTypeHierarchy, pm));
+ }
+
+ pm.done();
+ return jdtStatus;
+
+ }
+
+ doCheckFinalConditions <- replace doCheckFinalConditions;
+
+ private void initializeOTInformations(IProgressMonitor pm) throws JavaModelException {
+ // Do not initialize again if the preconditions have not changed.
+ // OT informations depend on the type and the new element name.
+ if(fOTTypeHierarchy != null && fOTTypeHierarchy.getFocusType() == getFType()
+ && getNewElementName().equals(fCachedNewElementName)){
+ return;
+ }
+
+ fCachedNewElementName = getNewElementName();
+ fOTTypeHierarchy = new OTTypeHierarchy(getFType(), getFType().getJavaProject(), true);
+ fOTTypeHierarchy.refresh(pm);
+ findImplicitRelatedTypes(getFType(), fOTTypeHierarchy, null);
+ fTypeToRenameIsRole = TypeHelper.isRole(getFType().getFlags());
+ if(Flags.isTeam(getFType().getFlags())){
+ fRoleDirectory = getRoleDirectoryForTeam(getFType());
+ }
+ fCachedException = null;
+ }
+
+ /**
+ * Adds implicit related Types references to the jdt references, that contain only the focus type references.
+ *
+ */
+ @SuppressWarnings({ "basecall", "unchecked", "rawtypes" })
+ callin RefactoringStatus initializeReferences(IProgressMonitor monitor) throws JavaModelException, OperationCanceledException{
+
+ // Do not search again if the preconditions have not changed.
+ // This check is a copy of RenameTypeProcessor.initializeReferences(),
+ // to prevent multiple processing of the implicit related types.
+ if (getFReferences() != null && (getNewElementName().equals(getFCachedNewName())) && (getFCachedRenameSimilarElements() == getUpdateSimilarDeclarations())
+ && (getFCachedRenamingStrategy() == getFRenamingStrategy()))
+ return getFCachedRefactoringStatus();
+
+ // The ot informations may have not been initialized if the wizard computes the references for a preview.
+ initializeOTInformations(monitor);
+
+ //jdt strategy
+ RefactoringStatus jdtStatus = base.initializeReferences(monitor);
+
+ // cache the original focus type and found jdt references
+ IType originalFocusType = getFType();
+ SearchResultGroup[] jdtReferences = getFReferences();
+
+ // cache the resources for the renaming of similar named elements
+ LinkedHashMap originalPreloadedElementToName = getFPreloadedElementToName();
+ Map originalPreloadedElementToSelection = getFPreloadedElementToSelection();
+ LinkedHashMap originalPreloadedElementToNameDefault = getFPreloadedElementToNameDefault();
+
+ // initialize data structures for the ot references and similar named elements
+ ArrayList<SearchResultGroup> otReferences = new ArrayList<SearchResultGroup>();
+ LinkedHashMap otPreloadedElementToName = new LinkedHashMap();
+ Map otPreloadedElementToSelection = new HashMap();
+ LinkedHashMap otPreloadedElementToNameDefault = new LinkedHashMap();
+
+ try{
+ // find references for implicit related types
+ for (int i = 0; i < fImplicitRelatedTypes.length; i++) {
+ setFType(fImplicitRelatedTypes[i]);
+ setFReferences(null);
+
+ jdtStatus.merge(base.initializeReferences(monitor));
+
+ // add all references of the implicit related type
+ otReferences.addAll(Arrays.asList(getFReferences()));
+
+ // add all similar name references of the implicit related type to the maps
+ otPreloadedElementToName.putAll(getFPreloadedElementToName());
+ otPreloadedElementToSelection.putAll(getFPreloadedElementToSelection());
+ otPreloadedElementToNameDefault.putAll(getFPreloadedElementToNameDefault());
+ }
+
+ //TODO: UnsupportedOperationException in PhantomType(the PhantomTypeAdaptor provides a quick fix)
+ within(new PhantomTypeAdaptor()){
+ // find references for implicit related phantom types
+ for (int i = 0; i < fImplicitRelatedPhantomTypes.length; i++) {
+ setFType(fImplicitRelatedPhantomTypes[i]);
+ setFReferences(null);
+
+ jdtStatus.merge(base.initializeReferences(monitor));
+
+ // add all references of the implicit related type
+ otReferences.addAll(Arrays.asList(getFReferences()));
+
+ // add all similar name references of the implicit related type to the maps
+ otPreloadedElementToName.putAll(getFPreloadedElementToName());
+ otPreloadedElementToSelection.putAll(getFPreloadedElementToSelection());
+ otPreloadedElementToNameDefault.putAll(getFPreloadedElementToNameDefault());
+ }
+ }
+ }finally{
+ // ensure that the original focus type is reset after processing the implicit type references
+ setFType(originalFocusType);
+
+ // combine the ot references with the jdt references
+ otReferences.addAll(Arrays.asList(jdtReferences));
+ setFReferences(otReferences.toArray(new SearchResultGroup[otReferences.size()]));
+
+ // combine and set the maps for the similar named elements
+ originalPreloadedElementToName.putAll(otPreloadedElementToName);
+ setFPreloadedElementToName(originalPreloadedElementToName);
+ originalPreloadedElementToSelection.putAll(otPreloadedElementToSelection);
+ setFPreloadedElementToSelection(originalPreloadedElementToSelection);
+ originalPreloadedElementToNameDefault.putAll(otPreloadedElementToNameDefault);
+ setFPreloadedElementToNameDefault(originalPreloadedElementToNameDefault);
+
+ }
+ return jdtStatus;
+ }
+ initializeReferences <- replace initializeReferences;
+
+ private RefactoringStatus checkRenameForImplicitRelatedTypes(IType type, OTTypeHierarchy otTypeHierarchy, IProgressMonitor pm) throws CoreException {
+ RefactoringStatus status = new RefactoringStatus();
+ for (int i = 0; i < fImplicitRelatedTypes.length; i++) {
+ status.merge(checkShadowingInEnclosingTeams(fImplicitRelatedTypes[i]));
+ }
+ for (int i = 0; i < fImplicitRelatedPhantomTypes.length; i++) {
+ status.merge(checkShadowingInEnclosingTeams(fImplicitRelatedPhantomTypes[i]));
+ }
+ return status;
+ }
+
+ private void findImplicitRelatedTypes(IType type, OTTypeHierarchy otTypeHierarchy, IProgressMonitor pm) throws JavaModelException {
+ IType topmostType = findTopMostType(type, otTypeHierarchy);
+ OTTypeHierarchy topmostTypeHierarchy = new OTTypeHierarchy(topmostType, topmostType.getJavaProject(), true);
+ topmostTypeHierarchy.refresh(pm);
+
+ ArrayList<IType> relatedTypes = new ArrayList<IType>();
+ relatedTypes.addAll(Arrays.asList(topmostTypeHierarchy.getAllTSubtypes(topmostType)));
+
+ // exchange the topmost type with the given type
+ if(!topmostType.equals(type)){
+ relatedTypes.remove(type);
+ relatedTypes.add(topmostType);
+ }
+
+ fImplicitRelatedTypes = relatedTypes.toArray(new IType[relatedTypes.size()]);
+
+ // search the implicit related phantom types
+ topmostTypeHierarchy.setPhantomMode(true);
+ ArrayList<IType> relatedPhantomTypes = new ArrayList<IType>();
+ relatedPhantomTypes.addAll(Arrays.asList(topmostTypeHierarchy.getAllTSubtypes(topmostType)));
+ relatedPhantomTypes.removeAll(relatedTypes);
+ relatedPhantomTypes.remove(type);
+ fImplicitRelatedPhantomTypes = relatedPhantomTypes.toArray(new IType[relatedPhantomTypes.size()]);
+
+ }
+
+ /**
+ * Finds the topmost declaration of a Role Type in the implicit type hierarchy.
+ * Returns the type itself, if it does not have any implicit super types.
+ *
+ * @param type the role type to start the search
+ * @param otTypeHierarchy for the type
+ * @return the topmost Role Type for the given type
+ */
+ private IType findTopMostType(IType type, OTTypeHierarchy otTypeHierarchy) {
+ IType[] superTypes = otTypeHierarchy.getAllTSuperTypes(type);
+ for (int i = 0; i < superTypes.length; i++) {
+ if(otTypeHierarchy.getAllTSuperTypes(superTypes[i]).length == 0){
+ return superTypes[i];
+ }
+ }
+ return type;
+ }
+
+ private void addTypeDeclarationUpdate(TextChangeManager manager, IType type) throws CoreException {
+ String name = RefactoringCoreMessages.RenameTypeRefactoring_update;
+ int typeNameLength = type.getElementName().length();
+ ICompilationUnit cu = type.getCompilationUnit();
+ TextChangeCompatibility.addTextEdit(manager.get(cu), name, new ReplaceEdit(type.getNameRange().getOffset(), typeNameLength, getNewElementName()));
+
+
+ }
+
+ private void createChanges(IProgressMonitor pm) throws JavaModelException, CoreException{
+ pm.beginTask("Create changes for implicit type declarations", fImplicitRelatedTypes.length);
+ pm.subTask(""); //$NON-NLS-1$
+ if(fTypeToRenameIsRole){
+ for (int i = 0; i < fImplicitRelatedTypes.length; i++) {
+ addTypeDeclarationUpdate(getFChangeManager(), fImplicitRelatedTypes[i]);
+ pm.worked(1);
+ }
+ }
+ pm.done();
+ }
+ createChanges <- after createChanges;
+
+ callin Change createChange(IProgressMonitor monitor) throws CoreException{
+
+ IType typeToRename = getFType();
+
+ // save the compilation units of the implicit related type declarations
+ if(fTypeToRenameIsRole){
+ for (int i = 0; i < fImplicitRelatedTypes.length; i++) {
+ IType type = fImplicitRelatedTypes[i];
+ if (getFChangeManager().containsChangesIn(type.getCompilationUnit())) {
+ TextChange textChange = getFChangeManager().get(type.getCompilationUnit());
+ if (textChange instanceof TextFileChange) {
+ ((TextFileChange) textChange).setSaveMode(TextFileChange.FORCE_SAVE);
+ }
+ }
+ }
+ }
+
+ // create the jdt change
+ Change jdtChange = base.createChange(monitor);
+
+
+ if(Flags.isTeam(typeToRename.getFlags())){
+ // a role directory exists
+ if(fRoleDirectory != null){
+ // rename the directory to the new team name
+ RenamePackageChange renameRoleFolderChange= new RenamePackageChange( fRoleDirectory, typeToRename.getPackageFragment().getElementName() + "." + getNewElementName(), false);
+ ((DynamicValidationRefactoringChange)jdtChange).add(renameRoleFolderChange);
+ }
+ }
+
+
+ if(fTypeToRenameIsRole){
+
+ // Update the compilation unit name if the role is declared in a role file
+ for (int i = 0; i < fImplicitRelatedTypes.length; i++) {
+ IType type = fImplicitRelatedTypes[i];
+
+ if(isRoleFile(type)){
+ String renamedCUName = JavaModelUtil.getRenamedCUName(type.getCompilationUnit(), getNewElementName());
+ ((DynamicValidationRefactoringChange)jdtChange).add(new RenameCompilationUnitChange(type.getCompilationUnit(), renamedCUName));
+ }
+ }
+ }
+ return jdtChange;
+ }
+ createChange <- replace createChange;
+
+
+ callin RefactoringStatus checkNewElementName(String newName){
+ RefactoringStatus jdtStatus = base.checkNewElementName(newName);
+ if(fTypeToRenameIsRole){
+ jdtStatus.merge(checkNewRoleName(newName));
+ }
+ return jdtStatus;
+ }
+
+ checkNewElementName <- replace checkNewElementName;
+
+ /**
+ * If a regular type is renamed it must be checked if any existing roles would shadow the renamed type.
+ * Role types are separately handled in <code>checkShadowingInEnclosingTeams()</code>.
+ */
+ callin RefactoringStatus checkRoleTypesInPackage() throws CoreException{
+ RefactoringStatus jdtStatus = base.checkRoleTypesInPackage();
+
+ if(jdtStatus == null){
+ jdtStatus = new RefactoringStatus();
+ }
+
+ IType[] types = getAllTypesInPackage(getFType().getPackageFragment());
+ for(int i = 0; i < types.length; i++){
+ IType type = types[i];
+ if(TypeHelper.isTeam(type.getFlags())){
+ IType[] roles = getAllRoles(type);
+ for (int j = 0; j < roles.length; j++) {
+ IType role = roles[j];
+ if(role.getElementName().equals(getNewElementName())){
+ String msg = Messages.format("A role type named ''{0}'' exists in ''{1}'' and would shadow the renamed type (OTLD �1.4(a)).", new String[] { getNewElementName(),
+ type.getFullyQualifiedName('.') });
+ jdtStatus.addError(msg, JavaStatusContext.create(role));
+ }
+ }
+ }
+ }
+
+ return jdtStatus;
+ }
+
+ checkRoleTypesInPackage <- replace checkTypesInPackage when(!fTypeToRenameIsRole);
+
+
+ /**
+ * Roles need a more detailed analysis for name conflicts, that includes all roles of the enclosing team.
+ *
+ */
+ @SuppressWarnings("basecall")
+ callin RefactoringStatus checkTypesInCompilationUnit(){
+ RefactoringStatus status = new RefactoringStatus();
+ try {
+ status.merge(checkForExistingRoles(getFType()));
+ status.merge(checkShadowingInEnclosingTeams(getFType()));
+ return status;
+ } catch (JavaModelException e) {
+ // cache the exception to throw it later
+ fCachedException = e;
+ return status;
+ }
+ }
+
+ checkTypesInCompilationUnit <- replace checkTypesInCompilationUnit when(fTypeToRenameIsRole);
+
+ // helper
+
+ /**
+ * Checks if the given role name is invalid because it is already used for OT specific interfaces.
+ *
+ * @param newRoleName the new role name
+ * @return a <Code>RefactoringStatus</Code> that may signal an invalid role name
+ */
+ private RefactoringStatus checkNewRoleName(String newRoleName) {
+ RefactoringStatus status = new RefactoringStatus();
+ // prevent invalid role names that are used for OT specific interfaces
+ if(newRoleName.equals(CONFINED)
+ || newRoleName.equals(ICONFINED)
+ || newRoleName.equals(ILOWERABLE))
+ {
+ status.addFatalError(RefactoringCoreMessages.RenameTypeRefactoring_choose_another_name);
+ }
+ return status;
+ }
+
+ /**
+ * Checks if the new role name causes implicit overriding in super and sub teams.
+ *
+ * @return the <code>RefactoringStatus</code> indicating implicit overriding
+ * @throws JavaModelException if the creation of a type hierarchy for the enclosing team failed
+ */
+ private RefactoringStatus checkForRoleOverriding(IProgressMonitor pm) throws JavaModelException {
+ Assert.isTrue(fTypeToRenameIsRole);
+
+ IOTType otElement = OTModelManager.getOTElement(getFType());
+ IOTType enclosingTeam = ((IRoleType)otElement).getTeam();
+
+ pm.beginTask("Check Overriding", 1);
+ pm.subTask(""); //$NON-NLS-1$
+ RefactoringStatus status = new RefactoringStatus();
+ try{
+ // search for implicit overriding of inherited roles
+ IType[] roles = TypeHelper.getInheritedRoleTypes(enclosingTeam);
+ for (int i = 0; i < roles.length; i++) {
+ IType currRole = roles[i];
+ if(currRole.getElementName().equals(getNewElementName())){
+ String msg = Messages.format("The renamed role type would override the inherited role type ''{0}''.",
+ new String[] { currRole.getFullyQualifiedName('.') });
+ status.addError(msg, JavaStatusContext.create(currRole));
+ return status;
+ }
+ }
+
+
+ // search for implicit overriding in the subtypes of the enclosing team
+ OTTypeHierarchy teamHierarchy = new OTTypeHierarchy(enclosingTeam, enclosingTeam.getJavaProject(), true);
+ teamHierarchy.refresh(pm);
+ IType[] subtypes = teamHierarchy.getAllSubtypes(enclosingTeam);
+ for (int i = 0; i < subtypes.length; i++) {
+ IType[] declaredRoles = getDeclaredRoles(subtypes[i]);
+
+ for (int j = 0; j < declaredRoles.length; j++) {
+ IType currRole = declaredRoles[j];
+ if(currRole.getElementName().equals(getNewElementName())){
+ String msg = Messages.format("The renamed role type would be overridden by role type ''{0}''.",
+ new String[] { currRole.getFullyQualifiedName('.') });
+ status.addError(msg, JavaStatusContext.create(currRole));
+ return status;
+ }
+ }
+ }
+ return status;
+ }finally{
+ pm.worked(1);
+ pm.done();
+ }
+ }
+
+ /**
+ * Checks if a package with the new team name already exists.
+ *
+ * @param roleDirectory
+ * @return
+ * @throws JavaModelException
+ */
+ private RefactoringStatus checkForConflictingRoleDirectoryName(IPackageFragment roleDirectory) throws JavaModelException {
+ IJavaElement[] packages= ((IPackageFragmentRoot)roleDirectory.getParent()).getChildren();
+ for (int i = 0; i < packages.length; i++) {
+ if(packages[i].getElementName().equals(getFType().getPackageFragment().getElementName() + "." + getNewElementName())){
+ String msg = MessageFormat.format("The new team name ''{0}'' collides with the package ''{1}'', therefore a renaming of the role directory ''{2}'' is impossible.", new Object[]{getFType().getElementName(), packages[i].getElementName(), roleDirectory.getElementName()});
+ return RefactoringStatus.createErrorStatus(msg);
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Checks for name conflicts within the enclosing team of the given role. Returns an <code>
+ * ERROR</code> <code>RefactoringStatus</code> if a role with the new name would shadow or would be shadowed by the new name.
+ *
+ * @param roleType the role to be checked
+ * @return the <code>RefactoringStatus</code> indicating shadowing issues with other roles
+ * @throws JavaModelException
+ */
+ private RefactoringStatus checkShadowingInEnclosingTeams(IType roleType) throws JavaModelException {
+ RefactoringStatus status = new RefactoringStatus();
+ if(!TypeHelper.isRole(roleType.getFlags())){
+ return status;
+ }
+
+ IType outerTeam = getTeam(roleType);
+ IType directEnclosingTeam = outerTeam;
+
+ // Search for nested roles in the direct enclosing team that would shadow the renamed role type
+ IType[] allRoles = TypeHelper.getAllRoleTypes(directEnclosingTeam);
+ for (int i = 0; i < allRoles.length; i++) {
+ if(allRoles[i].equals(OTModelManager.getOTElement(roleType))){
+ // skip the renamed role type because it is already checked in the base's method checkEnclosedTypes()
+ continue;
+ }
+ IType[] nestedRoles = getAllRoles(allRoles[i]);
+ for (int j = 0; j < nestedRoles.length; j++) {
+ IType role = nestedRoles[j];
+ if(role.getElementName().equals(getNewElementName())){
+ String msg = Messages.format("The role type ''{0}'' would shadow the renamed type (OTLD �1.4(a))."
+ , new String[] { BasicElementLabels.getJavaElementName(role.getFullyQualifiedName('.')) });
+ status.addError(msg, JavaStatusContext.create(role));
+ }
+ }
+ }
+
+ // If the enclosing team is a role itself recursively search role names that could be shadowed by the renamed role type
+ while(TypeHelper.isRole(outerTeam.getFlags())){
+ outerTeam = getTeam(outerTeam);
+ IRoleType[] outerRoles = TypeHelper.getAllRoleTypes(outerTeam);
+ for (int i = 0; i < outerRoles.length; i++) {
+ if(outerRoles[i].equals(OTModelManager.getOTElement(directEnclosingTeam))){
+ // skip the direct enclosing team, because this is checked in the base's method checkEnclosingTypes()
+ continue;
+ }
+ IType role = outerRoles[i];
+ if(role.getElementName().equals(getNewElementName())){
+ String msg = Messages.format("The renamed role type would shadow the visible type ''{0}'' (OTLD �1.4(a))."
+ , new String[] { BasicElementLabels.getJavaElementName(role.getFullyQualifiedName('.')) });
+ status.addError(msg, JavaStatusContext.create(role));
+ }
+ }
+ }
+
+ return status;
+ }
+
+ private RefactoringStatus checkForExistingRoles(IType roleType) throws JavaModelException{
+ RefactoringStatus status = new RefactoringStatus();
+ if(!TypeHelper.isRole(roleType.getFlags())){
+ return status;
+ }
+
+ // For the direct enclosing team all declared roles have to be checked
+ IType enclosingTeam = getTeam(roleType);
+ IType[] declaredRoles = getDeclaredRoles(enclosingTeam);
+ for (int i = 0; i < declaredRoles.length; i++) {
+ IOTType otElement = OTModelManager.getOTElement(declaredRoles[i]);
+ if(otElement instanceof IRoleType){
+ IRoleType role = (IRoleType) otElement;
+ if(role.getElementName().equals(getNewElementName())){
+ String msg = Messages.format(RefactoringCoreMessages.RenameTypeRefactoring_member_type_exists, new String[] { getNewElementLabel(),
+ BasicElementLabels.getJavaElementName(role.getTeam().getFullyQualifiedName('.')) });
+ status.addError(msg, JavaStatusContext.create(role));
+ }
+ }
+ }
+ return status;
+ }
+
+ private IType getTeam(IType roleType) {
+ IType enclosingTeam;
+ IOTType otElement;
+ if(roleType instanceof PhantomType){
+ enclosingTeam = (IType) ((PhantomType)roleType).getParent();
+ }else{
+ otElement = OTModelManager.getOTElement(roleType);
+ enclosingTeam = ((IRoleType)otElement).getTeam();
+ }
+
+ return enclosingTeam;
+ }
+
+ /**
+ * Checks if the given type is implemented in its own file as a top level type.
+ * @param roleType to be checked
+ * @return <code>true</code> if the role is implemented in its own file.
+ */
+ private boolean isRoleFile(IType roleType) {
+ String name = JavaCore.removeJavaLikeExtension(roleType.getCompilationUnit().getElementName());
+ if (!(Checks.isTopLevel(roleType) && name.equals(roleType.getElementName())))
+ return false;
+ return true;
+ }
+
+ private IPackageFragment getRoleDirectoryForTeam(IType enclosingTeam) throws JavaModelException{
+ // role directories can only be present for teams that are top level elements
+ if(!Checks.isTopLevel(enclosingTeam)){
+ return null;
+ }
+
+ // search for role directory
+ IPackageFragment fragment = enclosingTeam.getPackageFragment();
+ if(fragment.hasSubpackages()){
+ IJavaElement[] packages= ((IPackageFragmentRoot)fragment.getParent()).getChildren();
+ for (int i = 0; i < packages.length; i++) {
+ String name = packages[i].getElementName();
+ String fragmentName = fragment.getElementName();
+ // role directory found
+ if(name.equals(fragmentName + "." + enclosingTeam.getElementName())){
+ return (IPackageFragment)packages[i];
+ }
+ }
+ }
+ // no role directory found
+ return null;
+ }
+
+ /**
+ * Searches all types within the given package, including binary and source declarations.
+ *
+ * @param pack the package fragment to search in
+ * @return the found types
+ */
+ private IType[] getAllTypesInPackage(IPackageFragment pack) throws JavaModelException{
+ IJavaElement[] children = pack.getChildren();
+
+ ArrayList<IType> types = new ArrayList<IType>();
+ for(int i = 0; i < children.length; i++){
+ IJavaElement child = children[i];
+
+ if(child instanceof IClassFile){
+ types.add(((IClassFile)child).getType());
+ }
+
+ if(child instanceof ICompilationUnit){
+ types.addAll(Arrays.asList(((ICompilationUnit)child).getTypes()));
+ }
+ }
+ return types.toArray(new IType[types.size()]);
+ }
+
+ /**
+ * Searches recursively all roles in a team.
+ */
+ private IType[] getAllRoles(IType enclosingTeam) throws JavaModelException{
+ if(Flags.isTeam(enclosingTeam.getFlags())){
+ ArrayList<IType> result = new ArrayList<IType>();
+ ArrayList<IType> roles = new ArrayList<IType>();
+ roles.addAll(Arrays.asList(TypeHelper.getAllRoleTypes(enclosingTeam)));
+ for (Iterator<IType> iterator = roles.iterator(); iterator.hasNext();) {
+ IType roleType = (IType) iterator.next();
+ result.addAll(Arrays.asList(getAllRoles(roleType)));
+ }
+ result.addAll(roles);
+ return result.toArray(new IType[result.size()]);
+ }else{
+ return new IType[0];
+ }
+ }
+
+ /**
+ * Finds all declared roles for the given team, including inline and external role file declarations.
+ *
+ * @param teamType the team to search in
+ * @return the found roles
+ */
+ private IType[] getDeclaredRoles(IType teamType) throws JavaModelException{
+ if(!TypeHelper.isTeam(teamType.getFlags())){
+ return new IType[0];
+ }
+
+ ArrayList<IType> allRoles = new ArrayList<IType>();
+ IOTType otElement = OTModelManager.getOTElement(teamType);
+ // add inline declared roles
+ allRoles.addAll(Arrays.asList(otElement.getInnerTypes()));
+ // add the found role files
+ allRoles.addAll(Arrays.asList(getRoleFilesForTeam(teamType)));
+
+ return allRoles.toArray(new IType[allRoles.size()]);
+ }
+
+ /**
+ * Finds all role file types for the given teamType.
+ *
+ * @param teamType the team
+ * @return all found role file types
+ */
+ private IType[] getRoleFilesForTeam(IType teamType) throws JavaModelException{
+ IPackageFragment roleDirectory = getRoleDirectoryForTeam(teamType);
+ IType[] roleFileTypes = new IType[0];
+ if(roleDirectory != null){
+ roleFileTypes = getAllTypesInPackage(roleDirectory);
+ }
+ return roleFileTypes;
+ }
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/adaptor/ReorgAdaptor.java b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/adaptor/ReorgAdaptor.java
new file mode 100644
index 000000000..9bb230a5c
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/adaptor/ReorgAdaptor.java
@@ -0,0 +1,199 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2007 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute and Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: CallinMappingDeclaration.java 16313 2007-09-22 19:32:10Z stephan $
+ *
+ * Please visit http://www.objectteams.org for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.refactoring.adaptor;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IMember;
+import org.eclipse.jdt.core.ISourceReference;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.core.dom.ASTNode;
+import org.eclipse.jdt.core.dom.AbstractMethodMappingDeclaration;
+import org.eclipse.jdt.core.dom.BodyDeclaration;
+import org.eclipse.jdt.core.dom.CallinMappingDeclaration;
+import org.eclipse.jdt.core.dom.CalloutMappingDeclaration;
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jdt.internal.corext.refactoring.structure.CompilationUnitRewrite;
+import org.eclipse.objectteams.otdt.core.ICallinMapping;
+import org.eclipse.objectteams.otdt.core.ICalloutMapping;
+import org.eclipse.objectteams.otdt.core.ICalloutToFieldMapping;
+import org.eclipse.objectteams.otdt.core.IOTJavaElement;
+import org.eclipse.objectteams.otdt.core.IOTType;
+import org.eclipse.objectteams.otdt.internal.refactoring.corext.OTRefactoringCoreMessages;
+
+import base org.eclipse.jdt.internal.corext.refactoring.reorg.ReorgPolicyFactory.SubCuElementReorgPolicy;
+import base org.eclipse.jdt.internal.corext.refactoring.reorg.ReadOnlyResourceFinder;
+import base org.eclipse.jdt.internal.corext.refactoring.reorg.ReorgUtils;
+import base org.eclipse.jdt.internal.corext.refactoring.structure.ASTNodeSearchUtil;
+
+/**
+ * The team adapts classes from corext.refactoring.{reorg,structure}.
+ * See also the role file OTASTNodeSearchUtil, which belongs to this team
+ * in order to facilitate access to state role methods.
+ *
+ * @author stephan
+ *
+ */
+@SuppressWarnings({ "restriction", "decapsulation" })
+public team class ReorgAdaptor
+{
+ protected class SubCuElementReorgPolicy playedBy SubCuElementReorgPolicy
+ {
+
+ // ========= Callouts: =========
+ abstract void copyMemberToDestination(IMember member, CompilationUnitRewrite targetRewriter, CompilationUnit sourceCuNode, CompilationUnit targetCuNode, BodyDeclaration newMember)
+ throws JavaModelException;
+ copyMemberToDestination -> copyMemberToDestination;
+
+ abstract static String getUnindentedSource(ISourceReference sourceReference)
+ throws JavaModelException;
+ getUnindentedSource -> getUnindentedSource;
+
+ IJavaElement getJavaElementDestination() -> IJavaElement getJavaElementDestination();
+
+ // ======== Overrides =========
+
+ // this callin dispatches on the element being moved:
+ copyToDestination <- replace copyToDestination;
+ @SuppressWarnings("basecall")
+ callin void copyToDestination(IJavaElement element, CompilationUnitRewrite targetRewriter, CompilationUnit sourceCuNode, CompilationUnit targetCuNode)
+ throws CoreException
+ {
+ AbstractMethodMappingDeclaration newMapping= null;
+ IMember mapping= null;
+ switch(element.getElementType()){
+ // treat OT java model elements
+ case IOTJavaElement.CALLIN_MAPPING:
+ mapping= (IMember)element;
+ newMapping= (CallinMappingDeclaration)targetRewriter.getASTRewrite().createStringPlaceholder(getUnindentedSource(mapping), ASTNode.CALLIN_MAPPING_DECLARATION);
+ break;
+ case IOTJavaElement.CALLOUT_MAPPING:
+ mapping= (IMember)element;
+ newMapping= (CalloutMappingDeclaration)targetRewriter.getASTRewrite().createStringPlaceholder(getUnindentedSource(mapping), ASTNode.CALLOUT_MAPPING_DECLARATION);
+ break;
+ case IOTJavaElement.CALLOUT_TO_FIELD_MAPPING:
+ mapping= (IMember)element;
+ newMapping= (CalloutMappingDeclaration)targetRewriter.getASTRewrite().createStringPlaceholder(getUnindentedSource(mapping), ASTNode.CALLOUT_MAPPING_DECLARATION);
+ break;
+ case IOTJavaElement.TEAM:
+ case IOTJavaElement.ROLE:
+ element= ((IOTType)element).getCorrespondingJavaElement();
+ // fall through with real java element
+ default:
+ base.copyToDestination(element, targetRewriter, sourceCuNode, targetCuNode);
+ return;
+ }
+ // callout which is again callin-intercepted:
+ copyMemberToDestination(mapping, targetRewriter, sourceCuNode, targetCuNode, newMapping);
+ }
+
+ // this callin dispatches on the DnD-target:
+ getDestinationNode <- replace getDestinationNode;
+ @SuppressWarnings("basecall")
+ callin ASTNode getDestinationNode(IJavaElement destination, CompilationUnit target)
+ throws JavaModelException
+ {
+ switch (destination.getElementType()) {
+ case IOTJavaElement.CALLIN_MAPPING:
+ return OTASTNodeSearchUtil.getCallinMappingDeclarationNode((ICallinMapping)destination, target);
+ case IOTJavaElement.CALLOUT_MAPPING:
+ return OTASTNodeSearchUtil.getCalloutMappingDeclarationNode((ICalloutMapping)destination, target);
+ case IOTJavaElement.CALLOUT_TO_FIELD_MAPPING:
+ return OTASTNodeSearchUtil.getCalloutToFieldMappingDeclarationNode((ICalloutToFieldMapping)destination, target);
+ case IOTJavaElement.TEAM:
+ case IOTJavaElement.ROLE:
+ destination = (((IOTType)destination).getCorrespondingJavaElement());
+ // fall through with real java element
+ default:
+ return base.getDestinationNode(destination, target);
+ }
+ }
+ }
+
+ protected class ReadOnlyResourceFinder playedBy ReadOnlyResourceFinder
+ {
+ @SuppressWarnings("basecall")
+ static callin boolean hasReadOnlyResourcesAndSubResources(IJavaElement javaElement)
+ throws CoreException
+ {
+ switch(javaElement.getElementType()){
+ // consider OT-specific elements
+ case IOTJavaElement.TEAM:
+ case IOTJavaElement.ROLE:
+ case IOTJavaElement.CALLIN_MAPPING:
+ case IOTJavaElement.CALLOUT_MAPPING:
+ case IOTJavaElement.CALLOUT_TO_FIELD_MAPPING:
+ return false;
+ default:
+ return base.hasReadOnlyResourcesAndSubResources(javaElement);
+ }
+ }
+ boolean hasReadOnlyResourcesAndSubResources(IJavaElement javaElement)
+ <- replace boolean hasReadOnlyResourcesAndSubResources(IJavaElement javaElement);
+ }
+
+ final static int[] OT_MEMBERS = new int[]{IOTJavaElement.CALLIN_MAPPING, IOTJavaElement.CALLOUT_MAPPING, IOTJavaElement.CALLOUT_TO_FIELD_MAPPING};
+
+ /** Patch a few hard coded switch statements in ReorgUtils. */
+ protected class ReorgUtils playedBy ReorgUtils {
+
+ boolean hasOnlyExpectedOrOTTypes(int[] types) <- replace boolean hasOnlyElementsOfType(IJavaElement[] javaElements, int[] types)
+ with { types <- types }
+ static callin boolean hasOnlyExpectedOrOTTypes(int[] types) {
+ // pseudo switch: base uses set comparison.
+ if (types[0] == IJavaElement.FIELD) {
+ // when expecting fields also accept ot members:
+ int l= types.length;
+ int[] newTypes = new int[l+OT_MEMBERS.length];
+ System.arraycopy(types, 0, newTypes, 0, l);
+ System.arraycopy(OT_MEMBERS, 0, newTypes, l, OT_MEMBERS.length);
+ return base.hasOnlyExpectedOrOTTypes(newTypes);
+ }
+ return base.hasOnlyExpectedOrOTTypes(types);
+ }
+
+
+ String createNamePattern(IJavaElement element)
+ <- replace String createNamePattern(IJavaElement element);
+ @SuppressWarnings("basecall")
+ static callin String createNamePattern(IJavaElement element)
+ throws JavaModelException
+ {
+ switch (element.getElementType()) {
+ case IOTJavaElement.TEAM:
+ return OTRefactoringCoreMessages.getString("ReorgUtils.21"); //$NON-NLS-1$
+ case IOTJavaElement.ROLE:
+ return OTRefactoringCoreMessages.getString("ReorgUtils.23"); //$NON-NLS-1$
+ case IOTJavaElement.CALLOUT_MAPPING:
+ return OTRefactoringCoreMessages.getString("ReorgUtils.24"); //$NON-NLS-1$
+ case IOTJavaElement.CALLOUT_TO_FIELD_MAPPING:
+ return OTRefactoringCoreMessages.getString("ReorgUtils.25"); //$NON-NLS-1$
+ case IOTJavaElement.CALLIN_MAPPING:
+ return OTRefactoringCoreMessages.getString("ReorgUtils.26"); //$NON-NLS-1$
+ default:
+ return base.createNamePattern(element);
+ }
+ }
+
+ // createNameArguments now uses JavaElementLabels.getElementLabel()
+ // nothing to adapt in ReorgUtils.
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/adaptor/ReorgAdaptor/OTASTNodeSearchUtil.java b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/adaptor/ReorgAdaptor/OTASTNodeSearchUtil.java
new file mode 100644
index 000000000..cdef08630
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/adaptor/ReorgAdaptor/OTASTNodeSearchUtil.java
@@ -0,0 +1,113 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2005, 2006 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute and Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: OTASTNodeSearchUtil.java 23473 2010-02-05 19:46:08Z stephan $
+ *
+ * Please visit http://www.objectteams.org for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+team package org.eclipse.objectteams.otdt.internal.refactoring.adaptor.ReorgAdaptor;
+
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IMember;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.core.dom.ASTNode;
+import org.eclipse.jdt.core.dom.CallinMappingDeclaration;
+import org.eclipse.jdt.core.dom.CalloutMappingDeclaration;
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jdt.core.dom.RoleTypeDeclaration;
+import org.eclipse.jdt.core.dom.TypeDeclaration;
+import org.eclipse.jdt.internal.corext.dom.ASTNodes;
+import org.eclipse.objectteams.otdt.core.ICallinMapping;
+import org.eclipse.objectteams.otdt.core.ICalloutMapping;
+import org.eclipse.objectteams.otdt.core.ICalloutToFieldMapping;
+import org.eclipse.objectteams.otdt.core.IOTJavaElement;
+import org.eclipse.objectteams.otdt.core.TypeHelper;
+
+/**
+ * @author stephan
+ *
+ */
+@SuppressWarnings("restriction")
+public class OTASTNodeSearchUtil playedBy ASTNodeSearchUtil
+{
+ @SuppressWarnings("basecall")
+ static callin ASTNode[] getDeclarationNodes(IJavaElement element, CompilationUnit cuNode)
+ throws JavaModelException
+ {
+ switch(element.getElementType()){
+ // consider OT-specific elements
+ case IOTJavaElement.TEAM:
+ return new ASTNode[] { getTypeDeclarationNode((IType)element, cuNode) };
+ case IOTJavaElement.ROLE:
+ IType roleType = (IType)element;
+ if (TypeHelper.isTeam(roleType.getFlags()))
+ return new ASTNode[] { getTypeDeclarationNode((IType)element, cuNode) };
+ return new ASTNode[] { getRoleTypeDeclarationNode((IType)element, cuNode) };
+ case IOTJavaElement.CALLOUT_MAPPING:
+ return new ASTNode[] { getCalloutMappingDeclarationNode((ICalloutMapping)element, cuNode) };
+ case IOTJavaElement.CALLOUT_TO_FIELD_MAPPING:
+ return new ASTNode[] { getCalloutToFieldMappingDeclarationNode((ICalloutToFieldMapping)element, cuNode) };
+ case IOTJavaElement.CALLIN_MAPPING:
+ return new ASTNode[] { getCallinMappingDeclarationNode((ICallinMapping)element, cuNode) };
+ default:
+ return base.getDeclarationNodes(element, cuNode);
+ }
+ }
+ getDeclarationNodes <- replace getDeclarationNodes;
+
+ // === get OT-specific node types
+ static ASTNode getRoleTypeDeclarationNode(
+ IType type,
+ CompilationUnit cuNode) throws JavaModelException
+ {
+ return ASTNodes.getParent(getNameNode(type, cuNode), RoleTypeDeclaration.class);
+ }
+ protected static ASTNode getCalloutMappingDeclarationNode(
+ ICalloutMapping calloutMapping,
+ CompilationUnit cuNode) throws JavaModelException
+ {
+ ASTNode nameNode = getNameNode(calloutMapping, cuNode);
+ if (nameNode.getNodeType() == ASTNode.CALLOUT_MAPPING_DECLARATION)
+ return nameNode; // short mapping: nameRange is the whole mapping
+ return ASTNodes.getParent(nameNode, CalloutMappingDeclaration.class);
+ }
+ protected static ASTNode getCalloutToFieldMappingDeclarationNode(
+ ICalloutToFieldMapping calloutToFieldMapping,
+ CompilationUnit cuNode) throws JavaModelException
+ {
+ ASTNode nameNode = getNameNode(calloutToFieldMapping, cuNode);
+ if (nameNode.getNodeType() == ASTNode.CALLOUT_MAPPING_DECLARATION)
+ return nameNode; // short mapping: nameRange is the whole mapping
+ return ASTNodes.getParent(nameNode, CalloutMappingDeclaration.class);
+ }
+ protected static ASTNode getCallinMappingDeclarationNode(
+ ICallinMapping callinMapping,
+ CompilationUnit cuNode) throws JavaModelException
+ {
+ ASTNode nameNode = getNameNode(callinMapping, cuNode);
+ if (nameNode.getNodeType() == ASTNode.CALLIN_MAPPING_DECLARATION)
+ return nameNode; // short mapping: nameRange is the whole mapping
+ return ASTNodes.getParent(nameNode, CallinMappingDeclaration.class);
+ }
+
+ abstract static ASTNode getNameNode(IMember iMember, CompilationUnit cuNode) throws JavaModelException;
+ @SuppressWarnings("decapsulation")
+ getNameNode -> getNameNode;
+
+ abstract static TypeDeclaration getTypeDeclarationNode(IType iType, CompilationUnit cuNode) throws JavaModelException;
+ getTypeDeclarationNode -> getTypeDeclarationNode;
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/adaptor/extractmethod/ExtractMethodAmbuguityMsgCreator.java b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/adaptor/extractmethod/ExtractMethodAmbuguityMsgCreator.java
new file mode 100644
index 000000000..44b6c718b
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/adaptor/extractmethod/ExtractMethodAmbuguityMsgCreator.java
@@ -0,0 +1,17 @@
+package org.eclipse.objectteams.otdt.internal.refactoring.adaptor.extractmethod;
+
+import org.eclipse.objectteams.otdt.internal.refactoring.corext.OTRefactoringCoreMessages;
+import org.eclipse.objectteams.otdt.internal.refactoring.util.IAmbuguityMessageCreator;
+
+public class ExtractMethodAmbuguityMsgCreator implements IAmbuguityMessageCreator {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.objectteams.otdt.internal.refactoring.util.IAmbuguityMessageCreator#createAmbiguousMethodSpecifierMsg()
+ */
+ public String createAmbiguousMethodSpecifierMsg() {
+ return OTRefactoringCoreMessages.getString("OTExtractMethodRefactoring.ambiguous_method_specifier"); //$NON-NLS-1$
+ }
+
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/adaptor/extractmethod/ExtractMethodOverloadingMsgCreator.java b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/adaptor/extractmethod/ExtractMethodOverloadingMsgCreator.java
new file mode 100644
index 000000000..8b2941372
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/adaptor/extractmethod/ExtractMethodOverloadingMsgCreator.java
@@ -0,0 +1,17 @@
+package org.eclipse.objectteams.otdt.internal.refactoring.adaptor.extractmethod;
+
+import org.eclipse.objectteams.otdt.internal.refactoring.corext.OTRefactoringCoreMessages;
+import org.eclipse.objectteams.otdt.internal.refactoring.util.IOverloadingMessageCreator;
+
+public class ExtractMethodOverloadingMsgCreator implements IOverloadingMessageCreator {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.objectteams.otdt.refactoring.util.IOverloadingMessageCreator#createOverloadingMessage()
+ */
+ public String createOverloadingMessage() {
+ return OTRefactoringCoreMessages.getString("OTExtractMethodRefactoring.overloading"); //$NON-NLS-1$
+ }
+
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/adaptor/pullup/OTTypeHierarchyAdaptor.java b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/adaptor/pullup/OTTypeHierarchyAdaptor.java
new file mode 100644
index 000000000..08637a796
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/adaptor/pullup/OTTypeHierarchyAdaptor.java
@@ -0,0 +1,35 @@
+package org.eclipse.objectteams.otdt.internal.refactoring.adaptor.pullup;
+
+import org.eclipse.jdt.core.IType;
+
+import base org.eclipse.objectteams.otdt.internal.core.OTTypeHierarchy;
+
+/**
+ * @author Johannes Gebauer
+ *
+ * This team is by default deactivated. It can be activated to suppress
+ * the <code>UnsupportedOperationException</code> on
+ * {@link OTTypeHierarchy#getSuperclass(IType)}. The adaptor is useful
+ * to reuse jdt functionality that is not aware of multiple
+ * superclasses.
+ */
+@SuppressWarnings("restriction")
+public team class OTTypeHierarchyAdaptor {
+
+ /**
+ * Prevents {@link OTTypeHierarchy#getSuperclass(IType)} calls on
+ * OTTypeHierarchies to avoid an <code>UnsupportedOperationException</code>.
+ */
+ public class OTTypeHierarchyRole playedBy OTTypeHierarchy {
+ IType getExplicitSuperclass(IType type) -> IType getExplicitSuperclass(IType type);
+
+ @SuppressWarnings("basecall")
+ callin IType getSuperclass(IType type) {
+ return this.getExplicitSuperclass(type);
+ }
+
+ getSuperclass <- replace getSuperclass;
+
+ }
+
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/adaptor/pullup/PullUpAdaptor.java b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/adaptor/pullup/PullUpAdaptor.java
new file mode 100644
index 000000000..dc25779aa
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/adaptor/pullup/PullUpAdaptor.java
@@ -0,0 +1,548 @@
+package org.eclipse.objectteams.otdt.internal.refactoring.adaptor.pullup;
+
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.jdt.core.Flags;
+import org.eclipse.jdt.core.IField;
+import org.eclipse.jdt.core.IMember;
+import org.eclipse.jdt.core.IMethod;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.ITypeHierarchy;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.core.dom.IMethodBinding;
+import org.eclipse.jdt.core.dom.MethodDeclaration;
+import org.eclipse.jdt.core.dom.rewrite.ASTRewrite;
+import org.eclipse.jdt.core.search.IJavaSearchConstants;
+import org.eclipse.jdt.core.search.IJavaSearchScope;
+import org.eclipse.jdt.core.search.MethodDeclarationMatch;
+import org.eclipse.jdt.core.search.SearchEngine;
+import org.eclipse.jdt.core.search.SearchMatch;
+import org.eclipse.jdt.core.search.SearchParticipant;
+import org.eclipse.jdt.core.search.SearchPattern;
+import org.eclipse.jdt.core.search.SearchRequestor;
+import org.eclipse.jdt.internal.corext.refactoring.RefactoringCoreMessages;
+import org.eclipse.jdt.internal.corext.refactoring.base.JavaStatusContext;
+import org.eclipse.jdt.internal.corext.refactoring.structure.CompilationUnitRewrite;
+import org.eclipse.jdt.internal.corext.refactoring.structure.TypeVariableMaplet;
+import org.eclipse.jdt.internal.corext.util.Messages;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.eclipse.ltk.core.refactoring.RefactoringStatusEntry;
+import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
+import org.eclipse.objectteams.otdt.core.ICallinMapping;
+import org.eclipse.objectteams.otdt.core.ICalloutMapping;
+import org.eclipse.objectteams.otdt.core.ICalloutToFieldMapping;
+import org.eclipse.objectteams.otdt.core.IMethodMapping;
+import org.eclipse.objectteams.otdt.core.IOTType;
+import org.eclipse.objectteams.otdt.core.IOTTypeHierarchy;
+import org.eclipse.objectteams.otdt.core.OTModelManager;
+import org.eclipse.objectteams.otdt.core.TypeHelper;
+import org.eclipse.objectteams.otdt.internal.core.OTTypeHierarchy;
+import org.eclipse.objectteams.otdt.internal.core.RoleType;
+import org.eclipse.objectteams.otdt.internal.refactoring.util.IAmbuguityMessageCreator;
+import org.eclipse.objectteams.otdt.internal.refactoring.util.IOverloadingMessageCreator;
+import org.eclipse.objectteams.otdt.internal.refactoring.util.RefactoringUtil;
+
+import base org.eclipse.jdt.internal.corext.refactoring.structure.PullUpRefactoringProcessor;
+import base org.eclipse.jdt.internal.corext.refactoring.structure.PullUpRefactoringProcessor.PullUpAstNodeMapper;
+import base org.eclipse.jdt.internal.ui.refactoring.PullUpMethodPage;
+import base org.eclipse.jdt.internal.ui.refactoring.PullUpMethodPage.PullUpHierarchyContentProvider;
+
+/**
+ * @author Johannes Gebauer
+ *
+ */
+@SuppressWarnings({ "restriction", "decapsulation" }) // private base classes
+public team class PullUpAdaptor {
+
+ public team class PullUpRefactoringProcessorRole playedBy PullUpRefactoringProcessor {
+
+ @SuppressWarnings("rawtypes")
+ void setFCachedSkippedSuperTypes(Set fCachedSkippedSuperTypes) -> set Set fCachedSkippedSuperTypes;
+ @SuppressWarnings("rawtypes")
+ Set getFCachedSkippedSuperTypes() -> get Set fCachedSkippedSuperTypes;
+ IMember[] getMembersToDelete(IProgressMonitor monitor) -> IMember[] getMembersToDelete(IProgressMonitor monitor);
+ IMethod[] getFDeletedMethods() -> get IMethod[] fDeletedMethods;
+ IMember[] getFMembersToMove() -> get IMember[] fMembersToMove;
+
+ /**
+ * Pure Gateway.
+ */
+ public class PullUpAstNodeMapper playedBy PullUpAstNodeMapper{
+ @SuppressWarnings("decapsulation")
+ protected PullUpAstNodeMapper(final CompilationUnitRewrite sourceRewriter, final CompilationUnitRewrite targetRewriter, final ASTRewrite rewrite, final IType type, final TypeVariableMaplet[] mapping, final IMethodBinding enclosing) {
+ base(sourceRewriter, targetRewriter,
+ rewrite, type, mapping,
+ enclosing);
+ }
+ }
+
+ private ITypeHierarchy _destinationOTTypeHierachy;
+
+ // callouts
+ IType getDestinationType() -> IType getDestinationType();
+ IMember[] getMembersToMove() -> IMember[] getMembersToMove();
+ IType getDeclaringType() -> IType getDeclaringType();
+ ITypeHierarchy getDestinationTypeHierarchy(IProgressMonitor pm) -> ITypeHierarchy getDestinationTypeHierarchy(IProgressMonitor pm);
+
+ private void checkFinalConditions(IProgressMonitor pm, CheckConditionsContext context, RefactoringStatus status) throws CoreException {
+
+ status.merge(checkForAspectBindings(pm));
+ status.merge(checkOverloadingAndAmbiguity(pm));
+ status.merge(checkOverriding(pm));
+ if(TypeHelper.isRole(getDeclaringType().getFlags())){
+ status.merge(checkDestinationForOTElements());
+ status.merge(checkShadowingFieldInImplicitHierarchy(pm));
+ }
+ }
+
+ void checkFinalConditions(IProgressMonitor pm, CheckConditionsContext context, RefactoringStatus status) <- after RefactoringStatus checkFinalConditions(IProgressMonitor pm,
+ CheckConditionsContext context) with {
+ pm <- pm,
+ context <- context,
+ status <- result
+ }
+
+ private RefactoringStatus checkShadowingFieldInImplicitHierarchy(IProgressMonitor pm) throws JavaModelException {
+ RefactoringStatus status = new RefactoringStatus();
+ if(!TypeHelper.isRole(getDestinationType().getFlags())){
+ return status;
+ }
+
+ OTTypeHierarchy hier = (OTTypeHierarchy)getDestinationTypeHierarchy(pm);
+ ArrayList<IType> implicitSubRoles = new ArrayList<IType>();
+ implicitSubRoles.addAll(Arrays.asList(hier.getAllTSubtypes(getDestinationType())));
+
+ // remove the subtypes of the declaring type
+ implicitSubRoles.removeAll(Arrays.asList(hier.getAllTSubtypes(getDeclaringType())));
+
+ pm.beginTask("Checking Shadowing", implicitSubRoles.size());
+ pm.subTask(""); //$NON-NLS-1$
+
+ for (int i = 0; i < getFMembersToMove().length; i++) {
+ IMember element = getFMembersToMove()[i];
+ if(element instanceof IField){
+ IField field = (IField) element;
+ for (IType type : implicitSubRoles) {
+ IField shadowingField = RefactoringUtil.fieldIsShadowedInType(field.getElementName(), field.getTypeSignature(), type);
+ if(shadowingField != null){
+
+ ArrayList<IMember> membersToDelete = new ArrayList<IMember>();
+ membersToDelete.addAll(Arrays.asList(getMembersToDelete(pm)));
+ // do not indicate shadowing by deleted fields as an error
+ if(!membersToDelete.contains(shadowingField)) {
+ String msg = Messages.format("The pulled up field ''{0}'' would be shadowed in ''{1}''.", new String[] { field.getElementName(),
+ type.getFullyQualifiedName('.') });
+ status.addFatalError(msg, JavaStatusContext.create(shadowingField));
+ }
+
+ }
+ pm.worked(1);
+ // do not repeat errors in hierarchy
+ if(status.hasFatalError()){
+ pm.done();
+ return status;
+ }
+ }
+ }
+ }
+ pm.done();
+ return status;
+
+ }
+
+ private RefactoringStatus checkDestinationForOTElements() throws JavaModelException {
+ RefactoringStatus status = new RefactoringStatus();
+ for (int i = 0; i < getFMembersToMove().length; i++) {
+ IMember element = getFMembersToMove()[i];
+ if (element instanceof IMethod){
+ IMethod method = (IMethod)element;
+ // callin methods can only be moved to roles
+ if(Flags.isCallin(method.getFlags()) && !TypeHelper.isRole(getDestinationType().getFlags())){
+ String msg = Messages.format("The callin method ''{0}'' can only be moved to a role (OTJLD �4.2.(d)).", new String[] { method.getElementName() });
+ status.addFatalError(msg, JavaStatusContext.create(method));
+ }
+ }
+ }
+ return status;
+ }
+
+ private RefactoringStatus checkOverloadingAndAmbiguityInType(IProgressMonitor pm, IType type) throws JavaModelException {
+ RefactoringStatus status = new RefactoringStatus();
+ ITypeHierarchy hier = getDestinationTypeHierarchy(pm);
+ for (int i = 0; i < getFMembersToMove().length; i++) {
+ IMember element = getFMembersToMove()[i];
+ if (element instanceof IMethod){
+ final IMethod method = (IMethod)element;
+ String[] paramTypes = method.getParameterTypes();
+ status.merge(RefactoringUtil.checkOverloadingAndAmbiguity(type, hier, method.getElementName(), paramTypes,
+ new IAmbuguityMessageCreator() {
+
+ public String createAmbiguousMethodSpecifierMsg() {
+ return "Refactoring cannot be performed! There would be an ambiguous method specifier in a method binding after moving!";
+ }
+
+ }, new IOverloadingMessageCreator() {
+
+ public String createOverloadingMessage() {
+ String msg = Messages.format("The pulled up method ''{0}'' would be overloaded after refactoring.", new String[] { method.getElementName()});
+ return msg;
+ }
+
+ }, pm));
+ }
+ }
+ return status;
+ }
+
+ private RefactoringStatus checkOverloadingAndAmbiguity(IProgressMonitor pm) throws JavaModelException {
+
+ ITypeHierarchy destinationTypeHierarchy = getDestinationTypeHierarchy(pm);
+ IType[] subtypes = destinationTypeHierarchy.getAllSubtypes(getDestinationType());
+
+ pm.beginTask("Checking Overloading", subtypes.length + 1);
+ pm.subTask(""); //$NON-NLS-1$
+
+ RefactoringStatus status = new RefactoringStatus();
+
+ // check overloading in destination type
+ status.merge(checkOverloadingAndAmbiguityInType(pm, getDestinationType()));
+
+ pm.worked(1);
+
+ // do not repeat errors in hierarchy
+ if(status.hasFatalError()){
+ pm.done();
+ return status;
+ }
+
+ // check overloading in subtypes of the destination type
+ for (int i = 0; i < subtypes.length; i++) {
+ status.merge(checkOverloadingAndAmbiguityInType(pm, subtypes[i]));
+
+ pm.worked(1);
+
+ // do not repeat errors in hierarchy
+ if(status.hasFatalError()){
+ pm.done();
+ return status;
+ }
+ }
+ pm.done();
+ return status;
+ }
+
+ private RefactoringStatus checkOverriding(IProgressMonitor pm) throws JavaModelException{
+ RefactoringStatus status = new RefactoringStatus();
+
+ ITypeHierarchy hier = getDestinationTypeHierarchy(pm);
+ ArrayList<IType> allSubTypes = new ArrayList<IType>();
+ allSubTypes.addAll(Arrays.asList(hier.getAllSubtypes(getDestinationType())));
+
+ // remove the subtypes of the declaring type
+ allSubTypes.removeAll(Arrays.asList(hier.getAllSubtypes(getDeclaringType())));
+
+ pm.beginTask("Checking Overriding", allSubTypes.size());
+ pm.subTask(""); //$NON-NLS-1$
+
+ for (int i = 0; i < getFMembersToMove().length; i++) {
+ IMember element = getFMembersToMove()[i];
+ if(element instanceof IMethod){
+ IMethod method = (IMethod) element;
+ for (IType type : allSubTypes) {
+ IMethod overridingMethod = methodIsOverriddenInType(method.getElementName(), method.getParameterTypes(), type);
+ if(overridingMethod != null){
+
+ ArrayList<IMember> membersToMove = new ArrayList<IMember>();
+ membersToMove.addAll(Arrays.asList(getMembersToMove()));
+ ArrayList<IMember> membersToDelete = new ArrayList<IMember>();
+ membersToDelete.addAll(Arrays.asList(getMembersToDelete(pm)));
+ // do not indicate overriding for deleted/moved methods as an error
+ if(!membersToMove.contains(overridingMethod) && !membersToDelete.contains(overridingMethod)) {
+ String msg = Messages.format("The pulled up method ''{0}'' would be overridden in ''{1}''.", new String[] { method.getElementName(),
+ type.getFullyQualifiedName('.') });
+ status.addError(msg, JavaStatusContext.create(overridingMethod));
+ }
+
+ }
+ pm.worked(1);
+ // do not repeat errors in hierarchy
+ if(status.hasError()){
+ pm.done();
+ return status;
+ }
+ }
+ }
+ }
+ pm.done();
+ return status;
+ }
+
+ private IMethod methodIsOverriddenInType(String methodName, String[] paramTypes, IType type){
+ IMethod method = type.getMethod(methodName, paramTypes);
+ if(method.exists()){
+ return method;
+ }
+ return null;
+ }
+
+
+ /**
+ * Searches for aspect bindings that reference members to be moved.
+ * @return The refactoring status contains warnings if any referencing aspect bindings exist.
+ */
+ private RefactoringStatus checkForAspectBindings(IProgressMonitor monitor) throws CoreException {
+ // search all references for the members to be moved
+ IMember[] membersToMove = getMembersToMove();
+ final HashMap<IMember,Set<SearchMatch>> references= new HashMap<IMember,Set<SearchMatch>>();
+ IJavaSearchScope scope= SearchEngine.createWorkspaceScope();
+ for (int i = 0; i < membersToMove.length; i++) {
+ final IMember member = membersToMove[i];
+ // may not be able to access return type, but IGNORE_RETURN_TYPE is only effective with ALL_OCCURRENCES:
+ int limitTo = IJavaSearchConstants.ALL_OCCURRENCES|IJavaSearchConstants.IGNORE_RETURN_TYPE;
+ SearchPattern pattern= SearchPattern.createPattern(member, limitTo, SearchPattern.R_EXACT_MATCH);
+ SearchEngine engine= new SearchEngine();
+ engine.search(pattern, new SearchParticipant[] { SearchEngine.getDefaultSearchParticipant()}, scope, new SearchRequestor() {
+ public void acceptSearchMatch(SearchMatch match) throws CoreException {
+ if ( match.getAccuracy() == SearchMatch.A_ACCURATE
+ && !match.isInsideDocComment()
+ && !(match instanceof MethodDeclarationMatch)) // limit to references despite ALL_OCCURRENCES above:
+ {
+ if(references.get(member) == null){
+ Set<SearchMatch> refSet = new HashSet<SearchMatch>();
+ refSet.add(match);
+ references.put(member, refSet);
+ }else{
+ references.get(member).add(match);
+ }
+ }
+ }
+ }, monitor);
+ }
+
+ // search the matches for aspect bindings
+ RefactoringStatus status = new RefactoringStatus();
+ for (int i = 0; i < membersToMove.length; i++) {
+ IMember member = membersToMove[i];
+ Set<SearchMatch> refSet = references.get(member);
+ if(refSet == null){
+ continue;
+ }
+ for (SearchMatch match : refSet) {
+ Object element= match.getElement();
+ if (element instanceof ICalloutMapping) {
+ ICalloutMapping mapping = (ICalloutMapping) element;
+ if(mapping.getBoundBaseMethod().equals(member)){
+ addAspectBindingWarning(member, status, mapping);
+ }
+ }
+ if (element instanceof ICalloutToFieldMapping) {
+ ICalloutToFieldMapping mapping = (ICalloutToFieldMapping) element;
+ if(mapping.getBoundBaseField().equals(member)){
+ addAspectBindingWarning(member, status, mapping);
+ }
+ }
+ if (element instanceof ICallinMapping) {
+ ICallinMapping mapping = (ICallinMapping) element;
+ for (int j = 0; j < mapping.getBoundBaseMethods().length; j++) {
+ if(mapping.getBoundBaseMethods()[i].equals(member)){
+ addAspectBindingWarning(member, status, mapping);
+ break;
+ }
+ }
+ }
+ }
+ }
+ return status;
+ }
+
+ /**
+ * Adds a warning to the given refactoring status that notifies the user about existing aspect bingings.
+ *
+ * @param member the member to be pulled up.
+ * @param status the refactoring status, where the warning should be added.
+ * @param mapping the method mapping that causes the warning.
+ */
+ private void addAspectBindingWarning(IMember member, RefactoringStatus status,IMethodMapping mapping){
+ status.addEntry(new RefactoringStatusEntry(RefactoringStatus.WARNING,
+ MessageFormat.format("Pulled up member ''{0}'' is referenced in an aspect binding by ''{1}''",
+ new Object[]{member.getElementName(), mapping.getDeclaringType().getFullyQualifiedName()})));
+
+ }
+
+ /**
+ * Adds implicit role super types for roles. Candidate types are the possible super types,
+ * that are available as the destination type.
+ */
+ callin IType[] getCandidateTypes(final RefactoringStatus status, final IProgressMonitor monitor) throws JavaModelException{
+ RefactoringStatus jdtStatus = new RefactoringStatus();
+ IType[] jdtCandidates = base.getCandidateTypes(jdtStatus, monitor);
+ final IType declaring= getDeclaringType();
+ // try to get the corresponding OTType that is represented in the declaring type
+ IOTType otType = OTModelManager.getOTElement(declaring);
+ if(otType != null && otType instanceof RoleType){
+ RoleType role = (RoleType) otType;
+ IType[] otSuperTypes = role.newOTTypeHierarchy(monitor).getAllSupertypes(declaring);
+ List<IType> list = new ArrayList<IType>();
+ int binary = 0;
+ for (int i = 0; i < otSuperTypes.length; i++) {
+ IType type = otSuperTypes[i];
+ if(OTModelManager.hasOTElementFor(otSuperTypes[i])){
+ IOTType otSuperType = OTModelManager.getOTElement(type);
+ if(otSuperType instanceof RoleType && type != null && type.exists() && !type.isReadOnly() && !type.isBinary()){
+ list.add(type);
+ }else if(type.isBinary()){
+ binary += 1;
+ }
+ }
+ }
+ if(!list.isEmpty()){
+ if(jdtStatus.hasFatalError()){
+ if (otSuperTypes.length == binary)
+ status.addFatalError(RefactoringCoreMessages.PullUPRefactoring_no_all_binary);
+ }else{
+ status.merge(jdtStatus);
+ }
+ Collections.reverse(list);
+ list.addAll(0,Arrays.asList(jdtCandidates));
+ return list.toArray(new IType[list.size()]);
+ }
+ }
+ status.merge(jdtStatus);
+ return jdtCandidates;
+ }
+
+ getCandidateTypes <- replace getCandidateTypes;
+
+
+
+ /**
+ * Prevents callin methods from visibility adjustments.
+ */
+ callin boolean needsVisibilityAdjustment(final IMember member, final boolean references, final IProgressMonitor monitor, final RefactoringStatus status) throws JavaModelException {
+ boolean result = base.needsVisibilityAdjustment(member, references, monitor, status);
+ if(Flags.isCallin(member.getFlags())){
+ return false;
+ }else{
+ return result;
+ }
+ }
+
+ needsVisibilityAdjustment <- replace needsVisibilityAdjustment;
+
+ /**
+ * Replaces the jdt hierarchy with the ot hierarchy.
+ */
+ @SuppressWarnings("basecall")
+ callin ITypeHierarchy getDestinationOTTypeHierarchy() throws JavaModelException {
+ if(_destinationOTTypeHierachy != null && _destinationOTTypeHierachy.getType().equals(getDestinationType())){
+ return _destinationOTTypeHierachy;
+ }else{
+ if(OTModelManager.hasOTElementFor(getDestinationType())){
+ _destinationOTTypeHierachy = OTModelManager.getOTElement(getDestinationType()).newOTTypeHierarchy(new NullProgressMonitor());
+ }else{
+ _destinationOTTypeHierachy = base.getDestinationOTTypeHierarchy();
+ }
+ return _destinationOTTypeHierachy;
+ }
+ }
+
+ getDestinationOTTypeHierarchy <- replace getDestinationTypeHierarchy;
+
+ /**
+ * Prevents {@link OTTypeHierarchy#getSuperclass(IType)} calls on OTTypeHierarchies to avoid an
+ * <code>UnsupportedOperationException</code>.
+ */
+ callin void copyBodyOfPulledUpMethod(
+ final CompilationUnitRewrite sourceRewrite,
+ final CompilationUnitRewrite targetRewrite, final IMethod method,
+ final MethodDeclaration oldMethod,
+ final MethodDeclaration newMethod,
+ final TypeVariableMaplet[] mapping, final IProgressMonitor monitor)
+ throws JavaModelException {
+ within(new OTTypeHierarchyAdaptor()){
+ base.copyBodyOfPulledUpMethod(sourceRewrite, targetRewrite, method, oldMethod, newMethod, mapping, monitor);
+ }
+ }
+ copyBodyOfPulledUpMethod <- replace copyBodyOfPulledUpMethod;
+
+ /**
+ * Prevents {@link OTTypeHierarchy#getSuperclass(IType)} calls on OTTypeHierarchies to avoid an
+ * <code>UnsupportedOperationException</code>.
+ */
+ @SuppressWarnings({"unchecked", "rawtypes" })
+ callin Set getSkippedSuperTypes(final IProgressMonitor monitor) throws JavaModelException {
+ if(Flags.isRole(getDestinationType().getFlags())){
+ // do not add implicit skipped super types twice
+ if (getFCachedSkippedSuperTypes() != null && getDestinationTypeHierarchy(new SubProgressMonitor(monitor, 1)).getType().equals(getDestinationType()))
+ return base.getSkippedSuperTypes(monitor);
+
+ // calculate implicit skipped super types
+ final IOTTypeHierarchy otHierarchy = (IOTTypeHierarchy) getDestinationTypeHierarchy(new SubProgressMonitor(monitor, 1));
+ List<IType> subtypes = Arrays.asList(otHierarchy.getAllTSubtypes(getDestinationType()));
+ List<IType> superTypes = Arrays.asList(otHierarchy.getAllTSuperTypes(getDeclaringType()));
+ Set<IType> skippedImplicitTypes = new HashSet();
+
+ // intersect super types and sub types
+ for (IType type : superTypes) {
+ if(subtypes.contains(type)){
+ skippedImplicitTypes.add(type);
+ }
+ }
+
+ within(new OTTypeHierarchyAdaptor()){
+ // calculate explicit skipped supoer types
+ base.getSkippedSuperTypes(monitor);
+ // add implicit skipped super types
+ getFCachedSkippedSuperTypes().addAll(skippedImplicitTypes);
+ return getFCachedSkippedSuperTypes();
+ }
+ }else{
+ within(new OTTypeHierarchyAdaptor()){
+ return base.getSkippedSuperTypes(monitor);
+ }
+ }
+ }
+ getSkippedSuperTypes <- replace getSkippedSuperTypes;
+ }
+
+ public class PullUpHierarchyContentProvider playedBy PullUpHierarchyContentProvider{
+ /**
+ * Prevents {@link OTTypeHierarchy#getSuperclass(IType)} calls on OTTypeHierarchies to avoid an
+ * <code>UnsupportedOperationException</code>.
+ */
+ callin Object getParent(final Object element) {
+ within(new OTTypeHierarchyAdaptor()){
+ return base.getParent(element);
+ }
+ }
+ getParent <- replace getParent;
+
+ }
+
+ public class PullUpMethodPage playedBy PullUpMethodPage{
+ /**
+ * Prevents {@link OTTypeHierarchy#getSuperclass(IType)} calls on OTTypeHierarchies to avoid an
+ * <code>UnsupportedOperationException</code>.
+ */
+ callin void checkAllParents(final IType parent) {
+ within(new OTTypeHierarchyAdaptor()){
+ base.checkAllParents(parent);
+ }
+ }
+ checkAllParents <- replace checkAllParents;
+
+ }
+}
+
+
diff --git a/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/adaptor/pushdown/PushDownAdaptor.java b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/adaptor/pushdown/PushDownAdaptor.java
new file mode 100644
index 000000000..2f2bad2a3
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/adaptor/pushdown/PushDownAdaptor.java
@@ -0,0 +1,408 @@
+/**
+ *
+ */
+package org.eclipse.objectteams.otdt.internal.refactoring.adaptor.pushdown;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jdt.core.Flags;
+import org.eclipse.jdt.core.IField;
+import org.eclipse.jdt.core.IMember;
+import org.eclipse.jdt.core.IMethod;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.ITypeHierarchy;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.core.search.IJavaSearchConstants;
+import org.eclipse.jdt.core.search.IJavaSearchScope;
+import org.eclipse.jdt.core.search.SearchEngine;
+import org.eclipse.jdt.core.search.SearchMatch;
+import org.eclipse.jdt.core.search.SearchParticipant;
+import org.eclipse.jdt.core.search.SearchPattern;
+import org.eclipse.jdt.core.search.SearchRequestor;
+import org.eclipse.jdt.internal.core.ResolvedSourceMethod;
+import org.eclipse.jdt.internal.corext.refactoring.base.JavaStatusContext;
+import org.eclipse.jdt.internal.corext.refactoring.structure.PushDownRefactoringProcessor.MemberActionInfo;
+import org.eclipse.jdt.internal.corext.util.Messages;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
+import org.eclipse.objectteams.otdt.core.ICallinMapping;
+import org.eclipse.objectteams.otdt.core.ICalloutMapping;
+import org.eclipse.objectteams.otdt.core.ICalloutToFieldMapping;
+import org.eclipse.objectteams.otdt.core.OTModelManager;
+import org.eclipse.objectteams.otdt.core.PhantomType;
+import org.eclipse.objectteams.otdt.core.TypeHelper;
+import org.eclipse.objectteams.otdt.internal.core.OTTypeHierarchy;
+import org.eclipse.objectteams.otdt.internal.refactoring.util.IAmbuguityMessageCreator;
+import org.eclipse.objectteams.otdt.internal.refactoring.util.IOverloadingMessageCreator;
+import org.eclipse.objectteams.otdt.internal.refactoring.util.RefactoringUtil;
+
+import base org.eclipse.jdt.internal.corext.refactoring.structure.PushDownRefactoringProcessor;
+
+/**
+ * @author Johannes Gebauer
+ *
+ */
+@SuppressWarnings("restriction")
+public team class PushDownAdaptor {
+
+ @SuppressWarnings("decapsulation") // base class is final
+ protected class PushDownRefactoringProcessor playedBy PushDownRefactoringProcessor {
+
+ MemberActionInfo[] getAbstractDeclarationInfos() -> MemberActionInfo[] getAbstractDeclarationInfos();
+ // callouts
+ IType[] getAbstractDestinations(IProgressMonitor arg0) -> IType[] getAbstractDestinations(IProgressMonitor arg0);
+ IMember[] getMembersToMove() -> IMember[] getMembersToMove();
+ IType getDeclaringType() -> IType getDeclaringType();
+ ITypeHierarchy getHierarchyOfDeclaringClass(IProgressMonitor pm) -> ITypeHierarchy getHierarchyOfDeclaringClass(IProgressMonitor pm);
+
+ private ITypeHierarchy fDeclaringTypeHierachy;
+
+ private void checkFinalConditions(IProgressMonitor pm, CheckConditionsContext context, RefactoringStatus status) throws CoreException {
+
+ status.merge(checkForDirectPhantomSubRoles(pm));
+ status.merge(checkForAspectBindings(pm));
+ status.merge(checkShadowingFieldInImplicitHierarchy(pm));
+ IType[] subclasses = getAbstractDestinations(pm);
+ for (int i = 0; i < subclasses.length; i++) {
+ status.merge(checkOverriding(subclasses[i],pm));
+ }
+ status.merge(checkOverloadingAndAmbiguity(pm));
+ }
+
+
+ void checkFinalConditions(IProgressMonitor pm, CheckConditionsContext context, RefactoringStatus status) <- after RefactoringStatus checkFinalConditions(IProgressMonitor pm,
+ CheckConditionsContext context) with {
+ pm <- pm,
+ context <- context,
+ status <- result
+ }
+
+ private RefactoringStatus checkShadowingFieldInImplicitHierarchy(IProgressMonitor pm) throws JavaModelException {
+ RefactoringStatus status = new RefactoringStatus();
+
+ ITypeHierarchy hier = getHierarchyOfDeclaringClass(pm);
+ ArrayList<IType> subTypes = new ArrayList<IType>();
+ subTypes.addAll(Arrays.asList(hier.getSubtypes(getDeclaringType())));
+
+ pm.beginTask("Checking Shadowing", subTypes.size());
+ pm.subTask(""); //$NON-NLS-1$
+
+ for (int i = 0; i < getMembersToMove().length; i++) {
+ IMember element = getMembersToMove()[i];
+ if(element instanceof IField){
+ IField field = (IField) element;
+ for (IType type : subTypes) {
+
+ // shadowing fields is just forbidden in implicit hierarchies
+ if(TypeHelper.isRole(type.getFlags())){
+ OTTypeHierarchy implicitHierarchy = new OTTypeHierarchy(type, type.getJavaProject(), false);
+ implicitHierarchy.refresh(pm);
+ IType[] implicitSuperTypes = implicitHierarchy.getAllTSuperTypes(type);
+
+ for (int j = 0; j < implicitSuperTypes.length; j++) {
+ IType implicitSuperType = implicitSuperTypes[i];
+ IField shadowingField = RefactoringUtil.fieldIsShadowedInType(field.getElementName(), field.getTypeSignature(), implicitSuperType);
+ if(shadowingField != null){
+
+ String msg = Messages.format("The pushed down field ''{0}'' would be shadowed in ''{1}''.", new String[] { field.getElementName(),
+ implicitSuperType.getFullyQualifiedName('.') });
+ status.addError(msg, JavaStatusContext.create(shadowingField));
+
+ }
+ }
+ }
+ pm.worked(1);
+ // do not repeat errors in hierarchy
+ if(status.hasError()){
+ pm.done();
+ return status;
+ }
+ }
+ }
+ }
+ pm.done();
+ return status;
+
+ }
+
+ /**
+ * Searches for aspect bindings that reference members to be moved.
+ * @return The refactoring status contains errors if the pushed down members are not visible in existing bidnings after refactoring.
+ */
+ @SuppressWarnings("restriction")
+ private RefactoringStatus checkForAspectBindings(IProgressMonitor monitor) throws CoreException {
+ // search all references for the members to be moved
+ IMember[] membersToMove = getMembersToMove();
+ final HashMap<IMember,Set<SearchMatch>> references= new HashMap<IMember,Set<SearchMatch>>();
+ IJavaSearchScope scope= SearchEngine.createWorkspaceScope();
+ for (int i = 0; i < membersToMove.length; i++) {
+ final IMember member = membersToMove[i];
+ SearchPattern pattern= SearchPattern.createPattern(member, IJavaSearchConstants.REFERENCES, SearchPattern.R_EXACT_MATCH);
+ SearchEngine engine= new SearchEngine();
+ engine.search(pattern, new SearchParticipant[] { SearchEngine.getDefaultSearchParticipant()}, scope, new SearchRequestor() {
+ public void acceptSearchMatch(SearchMatch match) throws CoreException {
+ if (match.getAccuracy() == SearchMatch.A_ACCURATE && !match.isInsideDocComment()){
+ if(references.get(member) == null){
+ Set<SearchMatch> refSet = new HashSet<SearchMatch>();
+ refSet.add(match);
+ references.put(member, refSet);
+ }else{
+ references.get(member).add(match);
+ }
+ }
+ }
+ }, monitor);
+ }
+
+ // search the matches for aspect bindings
+ RefactoringStatus status = new RefactoringStatus();
+ for (int i = 0; i < membersToMove.length; i++) {
+ IMember member = membersToMove[i];
+
+ // do not search for aspect bindings if an abstract declaration remains
+ if(leavesAbstractMethod(member)){
+ continue;
+ }
+
+ Set<SearchMatch> refSet = references.get(member);
+ if(refSet == null){
+ continue;
+ }
+ for (SearchMatch match : refSet) {
+ Object element= match.getElement();
+ if (element instanceof ICalloutMapping) {
+ ICalloutMapping mapping = (ICalloutMapping) element;
+ if(mapping.getBoundBaseMethod().equals(member)){
+ String msg = Messages.format("The pushed down method ''{0}'' is referenced in a callout method binding in ''{1}'' and will not be visible after refactoring.",
+ new String[] { member.getElementName(), mapping.getDeclaringType().getFullyQualifiedName('.') });
+ status.addError(msg, JavaStatusContext.create(mapping));
+ } else if(mapping.getRoleMethod() != null && mapping.getRoleMethod().equals(member)){
+ String msg = Messages.format("The pushed down method ''{0}'' is bound in a callout method binding in ''{1}''.",
+ new String[] { member.getElementName(), mapping.getDeclaringType().getFullyQualifiedName('.') });
+ status.addError(msg, JavaStatusContext.create(mapping));
+ }else{
+ // TODO find a better way to analyze references in parameter mappings
+ String msg = Messages.format("The pushed down member ''{0}'' is referenced in a callout parameter mapping in ''{1}'' and will not be visible after refactoring.",
+ new String[] { member.getElementName(), mapping.getDeclaringType().getFullyQualifiedName('.') });
+ status.addError(msg, JavaStatusContext.create(mapping));
+ }
+ }
+ if (element instanceof ICalloutToFieldMapping) {
+ ICalloutToFieldMapping mapping = (ICalloutToFieldMapping) element;
+ if(mapping.getBoundBaseField().equals(member)){
+ String msg = Messages.format("The pushed down field ''{0}'' is referenced in a callout to field binding in ''{1}'' and will not be visible after refactoring.",
+ new String[] { member.getElementName(), mapping.getDeclaringType().getFullyQualifiedName('.') });
+ status.addError(msg, JavaStatusContext.create(mapping));
+ } else if(mapping.getRoleMethod() != null && mapping.getRoleMethod().equals(member)){
+ String msg = Messages.format("The pushed down method ''{0}'' is bound in a callout to field binding in ''{1}''.",
+ new String[] { member.getElementName(), mapping.getDeclaringType().getFullyQualifiedName('.') });
+ status.addError(msg, JavaStatusContext.create(mapping));
+ }else{
+ // TODO find a better way to analyze references in parameter mappings
+ String msg = Messages.format("The pushed down member ''{0}'' is referenced in a callout to field value mapping in ''{1}'' and will not be visible after refactoring.",
+ new String[] { member.getElementName(), mapping.getDeclaringType().getFullyQualifiedName('.') });
+ status.addError(msg, JavaStatusContext.create(mapping));
+ }
+ }
+ if (element instanceof ICallinMapping) {
+ ICallinMapping mapping = (ICallinMapping) element;
+ boolean baseMethodFound = false;
+ for (int j = 0; j < mapping.getBoundBaseMethods().length; j++) {
+ if(mapping.getBoundBaseMethods()[i].equals(member)){
+ String msg = Messages.format("The pushed down method ''{0}'' is referenced in a callin method binding in ''{1}'' and will not be visible after refactoring.",
+ new String[] { member.getElementName(), mapping.getDeclaringType().getFullyQualifiedName('.') });
+ status.addError(msg, JavaStatusContext.create(mapping));
+ baseMethodFound = true;
+ break;
+ }
+ }
+
+ if(baseMethodFound){
+ continue;
+ }
+
+ if(mapping.getRoleMethod().equals(member)){
+ String msg = Messages.format("The pushed down method ''{0}'' is bound in a callin method binding in ''{1}'' and will not be visible after refactoring.",
+ new String[] { member.getElementName(), mapping.getDeclaringType().getFullyQualifiedName('.') });
+ status.addError(msg, JavaStatusContext.create(mapping));
+ } else {
+ // TODO find a better way to analyze references in parameter mappings
+ String msg = Messages.format("The pushed down member ''{0}'' is referenced in a callin parameter mapping in ''{1}'' and will not be visible after refactoring.",
+ new String[] { member.getElementName(), mapping.getDeclaringType().getFullyQualifiedName('.') });
+ status.addError(msg, JavaStatusContext.create(mapping));
+ }
+ }
+
+ if (element instanceof ResolvedSourceMethod) {
+ ResolvedSourceMethod method = (ResolvedSourceMethod) element;
+ // References in the declaring type are checked by the base
+ if(!method.getDeclaringType().equals(getDeclaringType())){
+ String msg = Messages.format("Pushed down member ''{0}'' is referenced by ''{1}''.",
+ new String[] { member.getElementName(), method.getDeclaringType().getFullyQualifiedName('.') });
+ status.addError(msg, JavaStatusContext.create(method));
+ }
+ }
+ }
+ }
+ return status;
+ }
+
+ @SuppressWarnings("restriction")
+ private boolean leavesAbstractMethod(IMember member) throws JavaModelException {
+ MemberActionInfo[] methodsToBeDeclaredAbstract = getAbstractDeclarationInfos();
+ for (int j = 0; j < methodsToBeDeclaredAbstract.length; j++) {
+ if(methodsToBeDeclaredAbstract[j].getMember() == member){
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private RefactoringStatus checkForDirectPhantomSubRoles(IProgressMonitor pm) throws JavaModelException {
+ RefactoringStatus status = new RefactoringStatus();
+ ITypeHierarchy hier = getHierarchyOfDeclaringClass(pm);
+
+ if(hier instanceof OTTypeHierarchy){
+ OTTypeHierarchy otHier = (OTTypeHierarchy)hier;
+ otHier.setPhantomMode(true);
+ IType[] subTypes = otHier.getSubtypes(getDeclaringType());
+ for (int i = 0; i < subTypes.length; i++) {
+ IType subType = subTypes[i];
+ if(subType instanceof PhantomType){
+ String msg = Messages.format("An implicit sub role of ''{0}'' is a phantom role, therefore the pushed down members cannot be moved to ''{1}''.", new String[] { getDeclaringType().getFullyQualifiedName('.'), subType.getFullyQualifiedName('.') });
+ status.addError(msg, JavaStatusContext.create(subType));
+ }
+ }
+ otHier.setPhantomMode(false);
+ }
+ return status;
+ }
+
+ /**
+ * Checks if the pushed down method overrides an implicitly inherited method.
+ *
+ * @param type the type to check overriding in
+ * @param pm the progress monitor
+ * @return the <code>RefactoringStatus</code> indicating overriding
+ * @throws JavaModelException
+ */
+ private RefactoringStatus checkOverriding(IType type ,IProgressMonitor pm) throws JavaModelException{
+ RefactoringStatus status = new RefactoringStatus();
+
+ // only roles inherit implicitly
+ if(TypeHelper.isRole(type.getFlags())){
+
+ IMember[] membersToPushDown = getMembersToMove();
+
+ // create the ot hierarchy to check implicit super types
+ OTTypeHierarchy hierarchy = new OTTypeHierarchy(type, type.getJavaProject(), false);
+ hierarchy.refresh(pm);
+ IType[] superRoles = hierarchy.getTSuperTypes(type);
+
+ pm.beginTask("Checking Overriding", superRoles.length);
+ pm.subTask(""); //$NON-NLS-1$
+
+ for (int i = 0; i < superRoles.length; i++) {
+ IType superRole = superRoles[i];
+ // do not search in the declaring type to avoid finding the pushed down method itself
+ if(!superRole.equals(getDeclaringType())){
+ for (int j = 0; j < membersToPushDown.length; j++) {
+ // check only the pushed down methods
+ if(membersToPushDown[j] instanceof IMethod){
+ IMethod pushedDownMethod = (IMethod) membersToPushDown[j];
+ IMethod overriddenMethod = superRole.getMethod(pushedDownMethod.getElementName(), pushedDownMethod.getParameterTypes());
+ if(overriddenMethod.exists()){
+ String msg = Messages.format("The pushed down method ''{0}'' would override the implicitly inherited method ''{1}''.", new String[] { pushedDownMethod.getElementName(), overriddenMethod.getDeclaringType().getFullyQualifiedName('.') + "." + overriddenMethod.getElementName()});
+ status.addError(msg, JavaStatusContext.create(overriddenMethod));
+ }
+ }
+ }
+ }
+ pm.worked(1);
+ }
+ }
+ pm.done();
+ return status;
+ }
+
+ private RefactoringStatus checkOverloadingAndAmbiguityInType(IProgressMonitor pm, IType type) throws JavaModelException {
+ RefactoringStatus status = new RefactoringStatus();
+ ITypeHierarchy hier = getHierarchyOfDeclaringClass(pm);
+ for (int i = 0; i < getMembersToMove().length; i++) {
+ IMember element = getMembersToMove()[i];
+
+ // overloading can only be caused by private methods
+ if (Flags.isPrivate(element.getFlags()) && element instanceof IMethod){
+ final IMethod method = (IMethod)element;
+ String[] paramTypes = method.getParameterTypes();
+ status.merge(RefactoringUtil.checkOverloadingAndAmbiguity(type, hier, method.getElementName(), paramTypes,
+ new IAmbuguityMessageCreator() {
+
+ public String createAmbiguousMethodSpecifierMsg() {
+ return "Refactoring cannot be performed! There would be an ambiguous method specifier in a method binding after moving!";
+ }
+
+ }, new IOverloadingMessageCreator() {
+
+ public String createOverloadingMessage() {
+ String msg = Messages.format("The pushed down method ''{0}'' would be overloaded after refactoring.", new String[] { method.getElementName()});
+ return msg;
+ }
+
+ }, pm));
+ }
+ }
+ return status;
+ }
+
+ private RefactoringStatus checkOverloadingAndAmbiguity(IProgressMonitor pm) throws JavaModelException {
+
+ IType[] subtypes = getAbstractDestinations(pm);
+
+ pm.beginTask("Checking Overloading", subtypes.length);
+ pm.subTask(""); //$NON-NLS-1$
+
+ RefactoringStatus status = new RefactoringStatus();
+
+ // check overloading in subtypes of the destination type
+ for (int i = 0; i < subtypes.length; i++) {
+ status.merge(checkOverloadingAndAmbiguityInType(pm, subtypes[i]));
+ pm.worked(1);
+
+ }
+ pm.done();
+ return status;
+ }
+
+
+ /**
+ * Replaces the jdt hierarchy with the ot hierarchy.
+ * @throws JavaModelException
+ */
+ @SuppressWarnings("basecall")
+ callin ITypeHierarchy getOTHierarchyOfDeclaringClass(IProgressMonitor monitor) throws JavaModelException {
+ try {
+ if (fDeclaringTypeHierachy != null)
+ return fDeclaringTypeHierachy;
+ if(OTModelManager.hasOTElementFor(getDeclaringType())){
+ fDeclaringTypeHierachy = OTModelManager.getOTElement(getDeclaringType()).newOTTypeHierarchy(monitor);
+ }else{
+ fDeclaringTypeHierachy = base.getOTHierarchyOfDeclaringClass(monitor);
+ }
+ return fDeclaringTypeHierachy;
+ } finally {
+ monitor.done();
+ }
+ }
+
+ getOTHierarchyOfDeclaringClass <- replace getHierarchyOfDeclaringClass;
+
+ }
+
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/adaptor/rename/RenameMethodAmbuguityMsgCreator.java b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/adaptor/rename/RenameMethodAmbuguityMsgCreator.java
new file mode 100644
index 000000000..717879799
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/adaptor/rename/RenameMethodAmbuguityMsgCreator.java
@@ -0,0 +1,16 @@
+package org.eclipse.objectteams.otdt.internal.refactoring.adaptor.rename;
+
+import org.eclipse.objectteams.otdt.internal.refactoring.util.IAmbuguityMessageCreator;
+
+public class RenameMethodAmbuguityMsgCreator implements IAmbuguityMessageCreator {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.objectteams.otdt.refactoring.util.IAmbuguityMessageCreator#createAmbiguousMethodSpecifierMsg()
+ */
+ public String createAmbiguousMethodSpecifierMsg() {
+ return "Refactoring cannot be performed! There would be an ambiguous method specifier in a method binding after renaming!";
+ }
+
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/adaptor/rename/RenameMethodOverloadingMsgCreator.java b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/adaptor/rename/RenameMethodOverloadingMsgCreator.java
new file mode 100644
index 000000000..181450b7b
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/adaptor/rename/RenameMethodOverloadingMsgCreator.java
@@ -0,0 +1,16 @@
+package org.eclipse.objectteams.otdt.internal.refactoring.adaptor.rename;
+
+import org.eclipse.objectteams.otdt.internal.refactoring.util.IOverloadingMessageCreator;
+
+public class RenameMethodOverloadingMsgCreator implements IOverloadingMessageCreator {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.objectteams.otdt.refactoring.util.IOverloadingMessageCreator#createOverloadingMessage()
+ */
+ public String createOverloadingMessage() {
+ return "Renamed method will be overloaded after refactoring!";
+ }
+
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/corext/OTRefactoringCoreMessages.java b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/corext/OTRefactoringCoreMessages.java
new file mode 100644
index 000000000..e48b59a61
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/corext/OTRefactoringCoreMessages.java
@@ -0,0 +1,80 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2005, 2006 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute and Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: OTRefactoringCoreMessages.java 23473 2010-02-05 19:46:08Z stephan $
+ *
+ * Please visit http://www.objectteams.org for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.refactoring.corext;
+
+import java.text.MessageFormat;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+/**
+ * This utility class is a part of the OT/J refactoring adaptation.
+ * It contains some helper methods in order to retrieve message
+ * strings from a resource bundle.
+ *
+ * @author brcan
+ */
+public class OTRefactoringCoreMessages
+{
+ private static final String RESOURCE_BUNDLE = OTRefactoringCoreMessages.class.getName();
+
+ private static ResourceBundle _resourceBundle = ResourceBundle.getBundle(RESOURCE_BUNDLE);
+
+ private OTRefactoringCoreMessages()
+ {
+ //no instance
+ }
+
+ public static String getString(String key)
+ {
+ try
+ {
+ return _resourceBundle.getString(key);
+ }
+ catch (MissingResourceException e)
+ {
+ return key;
+ }
+ }
+
+ public static String getFormattedString(String key, Object arg)
+ {
+ try
+ {
+ return MessageFormat.format(_resourceBundle.getString(key), new Object[] { arg });
+ }
+ catch (MissingResourceException e)
+ {
+ return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$
+ }
+ }
+
+ public static String getFormattedString(String key, Object[] args)
+ {
+ try
+ {
+ return MessageFormat.format(_resourceBundle.getString(key), args);
+ }
+ catch (MissingResourceException e)
+ {
+ return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$
+ }
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/corext/base/OTRefactoringStatusCodes.java b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/corext/base/OTRefactoringStatusCodes.java
new file mode 100644
index 000000000..03dc529b7
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/corext/base/OTRefactoringStatusCodes.java
@@ -0,0 +1,48 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2005, 2006 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute and Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: OTRefactoringStatusCodes.java 23473 2010-02-05 19:46:08Z stephan $
+ *
+ * Please visit http://www.objectteams.org for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+// renamed to "basis" due to incompatibilities with OT/J keyword "base"
+package org.eclipse.objectteams.otdt.internal.refactoring.corext.base;
+
+/**
+ * This utility class is a part of the OT/J refactoring adaptation.
+ * It contains OT refactoring related status/error codes.
+ *
+ * @author brcan
+ */
+public class OTRefactoringStatusCodes
+{
+ private OTRefactoringStatusCodes()
+ {
+ //no instance
+ }
+
+ public static final int PRIVATE_FIELD_ACCESS = 1; // FIXME(SH): unused
+ public static final int PROTECTED_FIELD_ACCESS = 2; // FIXME(SH): unused
+ public static final int PACKAGE_VISIBLE_FIELD_ACCESS = 3; // FIXME(SH): unused
+ public static final int AMBIGUOUS_METHOD_SPECIFIER = 4;
+ public static final int ROLE_METHOD_OVERRIDES_MOVED_METHOD = 5; // FIXME(SH): unused
+ public static final int BASE_METHOD_OVERRIDES_MOVED_METHOD = 6; // FIXME(SH): unused
+ public static final int MOVED_METHOD_IS_OVERRIDDEN_IN_REGULAR_SUBCLASS = 7; // FIXME(SH): unused
+ public static final int DUPLICATE_METHOD_IN_NEW_RECEIVER = 8;
+ public static final int CANNOT_MOVE_PRIVATE = 9;
+ public static final int OVERLOADING = 10;
+
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/corext/refactoring.properties b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/corext/refactoring.properties
new file mode 100644
index 000000000..8822c00c2
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/corext/refactoring.properties
@@ -0,0 +1,79 @@
+###############################################################################
+# This file is part of "Object Teams Development Tooling"-Software
+#
+# Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
+# for its Fraunhofer Institute for Computer Architecture and Software
+# Technology (FIRST), Berlin, Germany and Technical University Berlin,
+# Germany.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Please visit http://www.eclipse.org/objectteams for updates and contact.
+#
+# Contributors:
+# Fraunhofer FIRST - Initial API and implementation
+# Technical University Berlin - Initial API and implementation
+###############################################################################
+
+# OT refactor menu
+OTRefactorMenu.label = Refac&tor (OT/J)
+
+# OT refactorings
+# ExtractMethodRefactoring
+OTExtractMethodRefactoring.name = Extract Method {0} in {1}
+OTExtractMethodRefactoring.not_a_base_class = Refactoring cannot be performed! Selected statements are not part of a regular OO-class!
+OTExtractMethodRefactoring.checking_overloading = Checking overloading
+OTExtractMethodRefactoring.overloading = Extracted method will be overloaded after refactoring!
+OTExtractMethodRefactoring.ambiguous_method_specifier = Refactoring cannot be performed! There would be an ambiguous method specifier in a method binding after extracting!
+
+# RenameTypeRefactoring
+OTRenameTypeRefactoring.role_type = Role type declared inside ''{0}'' is named {1}!
+OTRenameTypeRefactoring.nested_team_type = Nested team type declared inside ''{0}'' is named {1}!
+
+# RenameMethodRefactoring
+OTRenameVirtualMethodProcessor.not_a_base_class = Refactoring cannot be performed! Selected method is not a member of a regular OO-class!
+OTRenameNonVirtualMethodProcessor.not_a_base_class = Refactoring cannot be performed! Selected method is not a member of a regular OO-class!
+OTRenameVirtualMethodProcessor.update_base_call_occurrence = Update base call occurrence
+
+RenameVirtualMethodRefactoring.special_team_method=A Team implements this interface. You cannot use a special team method name
+
+# RenameFieldRefactoring
+OTRenameFieldProcessor.not_a_base_class = Refactoring cannot be performed! Selected field is not a member of a regular OO-class!
+
+# MoveStaticMembersRefactoring
+OTMoveStaticMembersProcessor.not_a_base_class = Refactoring cannot be performed! Selected method is not a member of a regular OO-class!
+
+# MoveInstanceMethodRefactoring
+OTMoveInstanceMethodRefactoring.not_a_base_class = Refactoring cannot be performed! Selected method is not a member of a regular OO-class!
+
+# visibility checks
+OTInstanceMethodMover.no_private_methods = Refactoring cannot be performed! Selected method is declared private!
+# field access/assignment checks
+OTInstanceMethodMover.method_accesses_private_field = Target method accesses a private field of the enclosing type and shall be moved to outside of this enclosing type (the new receiver is not the type of the field)!
+OTInstanceMethodMover.method_accesses_protected_field = Target method accesses a protected field of the enclosing type and shall be moved to a class in a different package (the new receiver is not the type of the field)!
+OTInstanceMethodMover.method_accesses_package_visible_field = Target method accesses a package-visible field of the enclosing type and shall be moved to a class in a different package (the new receiver is not the type of the field)!
+# overriding checks
+OTInstanceMethodMover.role_method_overrides_moved_method = Moved method would be overridden by a role method after moving!
+OTInstanceMethodMover.base_method_overrides_moved_method = Moved method would be overridden by a base method after moving!
+OTInstanceMethodMover.moved_method_is_overridden_in_regular_subclass = Moved method would be overridden in a regular subclass of the new receiver after moving!
+# ambiguity checks
+OTInstanceMethodMover.ambiguous_role_method_specifier_in_callin = There would be an ambiguous role method specifier in a callin method binding after moving!
+OTInstanceMethodMover.ambiguous_base_method_specifier_in_callin = There would be an ambiguous base method specifier in a callin method binding after moving!
+OTInstanceMethodMover.ambiguous_role_method_specifier_in_callout = There would be an ambiguous role method specifier in a callout method binding after moving!
+OTInstanceMethodMover.ambiguous_base_method_specifier_in_callout = There would be an ambiguous base method specifier in a callout method binding after moving!
+# duplicate checks
+OTInstanceMethodMover.duplicate_method_in_new_receiver = There already exists a method with the same name and the same parameters in the new receiver!
+
+# Reorg (cut, copy&paste, delete)
+ReorgUtils.21 = team ''{0}''
+ReorgUtils.22 = nested team ''{0}''
+ReorgUtils.23 = role ''{0}''
+ReorgUtils.24 = callout binding ''{0}''
+ReorgUtils.25 = callout to field binding ''{0}''
+ReorgUtils.26 = callin binding ''{0}''
+
+#Organize imports
+OrganizeImportsAction.label = Or&ganize Imports (OT/J)
diff --git a/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/corext/rename/BaseCallFinder.java b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/corext/rename/BaseCallFinder.java
new file mode 100644
index 000000000..c1e74312a
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/corext/rename/BaseCallFinder.java
@@ -0,0 +1,50 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2005, 2006 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute and Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: BaseCallFinder.java 23473 2010-02-05 19:46:08Z stephan $
+ *
+ * Please visit http://www.objectteams.org for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.refactoring.corext.rename;
+
+import java.util.ArrayList;
+
+import org.eclipse.jdt.core.dom.ASTVisitor;
+import org.eclipse.jdt.core.dom.BaseCallMessageSend;
+
+/**
+ * @author svacina
+ * @version $Id: BaseCallFinder.java 23473 2010-02-05 19:46:08Z stephan $
+ * DOM AST Visitor for searching base calls in AST nodes
+ */
+public class BaseCallFinder extends ASTVisitor
+{
+ private ArrayList<BaseCallMessageSend> _result = null;
+ public BaseCallFinder()
+ {
+ _result = new ArrayList<BaseCallMessageSend>();
+ }
+ public boolean visit(BaseCallMessageSend node)
+ {
+ _result.add(node);
+ return false;
+ }
+
+ public BaseCallMessageSend[] getResult()
+ {
+ return _result.toArray(new BaseCallMessageSend[_result.size()]);
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/corext/rename/RippleMethodFinder.java b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/corext/rename/RippleMethodFinder.java
new file mode 100644
index 000000000..5fdac859a
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/corext/rename/RippleMethodFinder.java
@@ -0,0 +1,242 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 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
+ * $Id: RippleMethodFinder.java 23473 2010-02-05 19:46:08Z stephan $
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * Fraunhofer FIRST - extended API and implementation
+ * Technical University Berlin - extended API and implementation
+ *******************************************************************************/
+package org.eclipse.objectteams.otdt.internal.refactoring.corext.rename;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.jdt.core.IMethod;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.ITypeHierarchy;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.core.WorkingCopyOwner;
+import org.eclipse.jdt.internal.corext.refactoring.Checks;
+import org.eclipse.jdt.internal.corext.refactoring.rename.MethodChecks;
+import org.eclipse.jdt.internal.corext.util.JdtFlags;
+import org.eclipse.objectteams.otdt.core.TypeHelper;
+import org.eclipse.objectteams.otdt.internal.core.OTTypeHierarchy;
+
+//FIXME(SH): can we avoid this copy??
+//{OT_COPY_PASTE: Copy of class org.eclipse.jdt.internal.corext.refactoring.rename.RippleMethodFinder
+//Reason: necessary OT-specific adaptations made
+/**
+ * This class is used to find methods along the 'ripple'. When you rename a
+ * method that is declared in an interface, you must also rename its
+ * implementations. But because of multiple interface inheritance you have to go
+ * up and down the hierarchy to collect all the methods.
+ */
+@SuppressWarnings({"unchecked", "rawtypes", "restriction"})
+public class RippleMethodFinder {
+
+ private RippleMethodFinder(){
+ //no instances
+ }
+
+ /**
+ * Finds all methods along the 'ripple'.
+ *
+ * @param method an {@link IMethod} which must be "most abstract",
+ * i.e. it must not override or implement another method
+ * @param pm a {@link IProgressMonitor}
+ * @param owner a {@link WorkingCopyOwner}, or <code>null</code>
+ * @return the ripple methods
+ * @throws JavaModelException if something is wrong with <code>method</code> or its ripple.
+ */
+ public static IMethod[] getRelatedMethods(IMethod method, IProgressMonitor pm, WorkingCopyOwner owner) throws JavaModelException {
+ try{
+ if (! MethodChecks.isVirtual(method) && ! method.getDeclaringType().isInterface())
+ return new IMethod[]{method};
+ return getAllRippleMethods(method, pm, owner);
+ } finally{
+ pm.done();
+ }
+ }
+
+ /*
+ * We use the following algorithm to find methods to rename:
+ * Input: type T, method m
+ Assumption: No supertype of T declares m
+ Output: variable result contains the list of types that declared the method to be renamed
+
+ result:= empty set // set of types that declare methods to rename
+ visited:= empty set //set of already visited types
+ q:= empty queue //queue of types to visit
+ q.insert(T)
+
+ while (!q.isEmpty()){
+ t:= q.remove();
+ //assert(t is an interface or declares m as virtual)
+ //assert(!visited.contains(t))
+ visited.add(t);
+ result.add(t);
+ forall: i in: t.subTypes do:
+ if ((! visited.contains(i)) && (i declares m)) result.add(i);
+ forall: i in: t.subTypes do:
+ q.insert(x)
+ where x is any type satisfying the followowing:
+ a. x is a supertype of i
+ b. x is an interface and declares m or
+ x declares m as a virtual method
+ c. no supertype of x is an interface that declares m and
+ no supertype of x is a class that declares m as a virtual method
+ d. ! visited.contains(x)
+ e. ! q.contains(x)
+ }
+ */
+ private static IMethod[] getAllRippleMethods(IMethod method, IProgressMonitor pm, WorkingCopyOwner owner) throws JavaModelException {
+ pm.beginTask("", 4); //$NON-NLS-1$
+ Set result= new HashSet();
+ Set visitedTypes= new HashSet();
+ List methodQueue= new ArrayList();
+ Set hierarchies= new HashSet();
+ methodQueue.add(method);
+ while (! methodQueue.isEmpty()){
+ IMethod m= (IMethod)methodQueue.remove(0);
+
+ /* must check for binary - otherwise will go all the way on all types
+ * happens on toString() for example */
+ if (m.isBinary())
+ continue;
+ IType type= m.getDeclaringType();
+ Assert.isTrue(! visitedTypes.contains(type), "! visitedTypes.contains(type)"); //$NON-NLS-1$
+ Assert.isTrue(type.isInterface() || declaresAsVirtual(type, method), "second condition"); //$NON-NLS-1$
+
+ visitedTypes.add(type);
+ result.add(m);
+
+ IType[] subTypes= getAllSubtypes(pm, owner, type, hierarchies);
+ for (int i= 0; i < subTypes.length; i++){
+ if (!visitedTypes.contains(subTypes[i])){
+ IMethod subTypeMethod= Checks.findSimilarMethod(m, subTypes[i]);
+ if (subTypeMethod != null)
+ result.add(subTypeMethod);
+ }
+ }
+
+ for (int i= 0; i < subTypes.length; i++){
+ IMethod toAdd= findAppropriateMethod(owner, visitedTypes, methodQueue, subTypes[i], method, new NullProgressMonitor());
+ if (toAdd != null)
+ methodQueue.add(toAdd);
+ }
+ if (pm.isCanceled())
+ throw new OperationCanceledException();
+ }
+ return (IMethod[]) result.toArray(new IMethod[result.size()]);
+ }
+
+ private static IType[] getAllSubtypes(IProgressMonitor pm, WorkingCopyOwner owner, IType type, Set cachedHierarchies) throws JavaModelException {
+ //first, try in the cached hierarchies
+ for (Iterator iter= cachedHierarchies.iterator(); iter.hasNext();) {
+ ITypeHierarchy hierarchy= (ITypeHierarchy) iter.next();
+ if (hierarchy.contains(type))
+ return hierarchy.getAllSubtypes(type);
+ }
+ SubProgressMonitor subPm= new SubProgressMonitor(pm, 1);
+ ITypeHierarchy hierarchy= newTypeHierarchy(type, owner, subPm);
+ cachedHierarchies.add(hierarchy);
+ return hierarchy.getAllSubtypes(type);
+ }
+
+ private static IMethod findAppropriateMethod(WorkingCopyOwner owner, Set visitedTypes, List methodQueue, IType type, IMethod method, IProgressMonitor pm) throws JavaModelException{
+ pm.beginTask("analyzing hierarchy", 1); // Note(SH): jdt.ui's externalized string has been removed
+ IType[] superTypes= newSupertypeHierarchy(type, owner, new SubProgressMonitor(pm, 1)).getAllSupertypes(type);
+ for (int i= 0; i< superTypes.length; i++){
+ IType t= superTypes[i];
+ if (visitedTypes.contains(t))
+ continue;
+ IMethod found= Checks.findSimilarMethod(method, t);
+ if (found == null)
+ continue;
+ if (! declaresAsVirtual(t, method))
+ continue;
+ if (methodQueue.contains(found))
+ continue;
+ return getTopMostMethod(owner, visitedTypes, methodQueue, method, t, new NullProgressMonitor());
+ }
+ return null;
+ }
+
+ private static IMethod getTopMostMethod(WorkingCopyOwner owner, Set visitedTypes, List methodQueue, IMethod method, IType type, IProgressMonitor pm)throws JavaModelException{
+ pm.beginTask("", 1); //$NON-NLS-1$
+ IMethod methodInThisType= Checks.findSimilarMethod(method, type);
+ Assert.isTrue(methodInThisType != null);
+ IType[] superTypes= newSupertypeHierarchy(type, owner, new SubProgressMonitor(pm, 1)).getAllSupertypes(type);
+ for (int i= 0; i < superTypes.length; i++){
+ IType t= superTypes[i];
+ if (visitedTypes.contains(t))
+ continue;
+ IMethod found= Checks.findSimilarMethod(method, t);
+ if (found == null)
+ continue;
+ if (! declaresAsVirtual(t, method))
+ continue;
+ if (methodQueue.contains(found))
+ continue;
+ return getTopMostMethod(owner, visitedTypes, methodQueue, method, t, new NullProgressMonitor());
+ }
+ return methodInThisType;
+ }
+
+ private static boolean declaresAsVirtual(IType type, IMethod m) throws JavaModelException{
+ IMethod found= Checks.findSimilarMethod(m, type);
+ if (found == null)
+ return false;
+ if (JdtFlags.isStatic(found))
+ return false;
+ if (JdtFlags.isPrivate(found)
+//{ObjectTeams: ObjectTeams: private rolemethod is also virtual
+ && !TypeHelper.isRole(type.getFlags())
+//jsv)
+ )
+ return false;
+ return true;
+ }
+
+ //---
+
+ private static ITypeHierarchy newTypeHierarchy(IType type, WorkingCopyOwner owner, IProgressMonitor pm) throws JavaModelException {
+//{ObjectTeams: create OTTypeHierarchy
+ OTTypeHierarchy hier = new OTTypeHierarchy(type, type.getJavaProject(),true);
+ hier.refresh(pm);
+ return hier;
+ //orig
+ //if (owner == null)
+ // return type.newTypeHierarchy(pm);
+ //else
+ // return type.newTypeHierarchy(owner, pm);
+//jsv}
+ }
+
+ private static ITypeHierarchy newSupertypeHierarchy(IType type, WorkingCopyOwner owner, IProgressMonitor pm) throws JavaModelException {
+//{ObjectTeams: create OTTypeHierarchy
+ OTTypeHierarchy hier = new OTTypeHierarchy(type, type.getJavaProject(),false);
+ hier.refresh(pm);
+ return hier;
+ //orig:
+ //if (owner == null)
+ // return type.newSupertypeHierarchy(pm);
+ //else
+ // return type.newSupertypeHierarchy(owner, pm);
+//jsv}
+ }
+}
+//jsv} \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/corext/rename/RolePartsUnifier.java b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/corext/rename/RolePartsUnifier.java
new file mode 100644
index 000000000..5d31651e7
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/corext/rename/RolePartsUnifier.java
@@ -0,0 +1,50 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2009 Stephan Herrmann.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: RolePartsUnifier.java 23473 2010-02-05 19:46:08Z stephan $
+ *
+ * Please visit http://www.objectteams.org for updates and contact.
+ *
+ * Contributors:
+ * Stephan Herrmann
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.refactoring.corext.rename;
+
+import org.eclipse.jdt.core.dom.IBinding;
+import org.eclipse.jdt.core.dom.ITypeBinding;
+
+import base org.eclipse.jdt.internal.corext.dom.LinkedNodeFinder.BindingFinder;
+
+/**
+ * Help the refactoring implementation to compare role bindings by
+ * uniformly using the interface part.
+ *
+ * @author stephan
+ * @since 1.3.1
+ */
+@SuppressWarnings({ "restriction", "decapsulation" }) // base class BindingFinder
+public team class RolePartsUnifier {
+ protected class BindingFinder playedBy BindingFinder {
+
+ IBinding getDeclaration(IBinding binding) <- replace IBinding getDeclaration(IBinding binding);
+
+ static callin IBinding getDeclaration(IBinding binding) {
+ IBinding decl = base.getDeclaration(binding);
+ if (decl instanceof ITypeBinding) {
+ ITypeBinding typeBinding = (ITypeBinding)decl;
+ if (typeBinding.isClass() && typeBinding.isRole()) {
+ ITypeBinding ifcPart = typeBinding.getIfcPart();
+ if (ifcPart != null)
+ return ifcPart;
+ }
+ }
+ return decl;
+ }
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/otrefactorings/AbstractCallinRefactoringAction.java b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/otrefactorings/AbstractCallinRefactoringAction.java
new file mode 100644
index 000000000..72d6596b0
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/otrefactorings/AbstractCallinRefactoringAction.java
@@ -0,0 +1,166 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2009 Stephan Herrmann.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: InlineCallinAction.java 23045 2009-11-15 21:17:24Z stephan $
+ *
+ * Please visit http://www.objectteams.org for updates and contact.
+ *
+ * Contributors:
+ * Stephan Herrmann - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.refactoring.otrefactorings;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jdt.core.IMethod;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.internal.ui.javaeditor.JavaEditor;
+import org.eclipse.jdt.internal.ui.javaeditor.JavaTextSelection;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.text.ITextSelection;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.IWorkbenchSite;
+import org.eclipse.ui.IWorkbenchWindow;
+
+/**
+ * Common part of refactoring actions affecting calling bindings.
+ *
+ * @author stephan
+ * @since 1.4.0
+ */
+@SuppressWarnings("restriction")
+public abstract class AbstractCallinRefactoringAction extends Action {
+
+ /**
+ * This class defines the common stateful part of {@link AbstractCallinRefactoringAction} and
+ * {@link AbstractCallinRefactoringAction.SelectionDispatchAction}.
+ */
+ protected abstract class CallinRefactoringActionCommon extends SelectionActionCommon
+ {
+ public CallinRefactoringActionCommon(JavaEditor editor) {
+ super(editor);
+ }
+
+ public CallinRefactoringActionCommon(IWorkbenchWindow window) {
+ super(window);
+ }
+
+ public boolean isRefactoringAvailable() throws JavaModelException {
+ if ( fJavaElement != null
+ && fJavaElement.exists()
+ && fJavaElement.isStructureKnown()
+ && fJavaElement instanceof IMethod)
+ {
+ IMethod method = (IMethod)fJavaElement;
+ return !method.isConstructor()
+ && !method.getDeclaringType().isAnnotation();
+ }
+ return false;
+ }
+ }
+
+ /** Provide the respective refactoring action to view context menus (editor, package explorer, outline ...) */
+ public class SelectionDispatchAction extends org.eclipse.jdt.ui.actions.SelectionDispatchAction
+ {
+ CallinRefactoringActionCommon common;
+
+ public SelectionDispatchAction(IWorkbenchSite site) {
+ super(site);
+ common = createRefactoringActionCommon(site.getWorkbenchWindow());
+ init();
+ }
+
+ public SelectionDispatchAction(JavaEditor editor) {
+ super(editor.getEditorSite());
+ common = createRefactoringActionCommon(editor);
+ init();
+ }
+
+ void init() {
+ setText(commandName);
+ setToolTipText(commandTooltip);
+ setEnabled(true); // further checking in run().
+ }
+
+ @Override
+ public void selectionChanged(JavaTextSelection javaTextSelection) {
+ try {
+ common.selectionChanged(javaTextSelection);
+ setEnabled(common.isRefactoringAvailable());
+ } catch (CoreException ce) {
+ setEnabled(false);
+ }
+ }
+
+ @Override
+ public void selectionChanged(IStructuredSelection selection) {
+ try {
+ common.selectionChanged(selection);
+ setEnabled(common.isRefactoringAvailable());
+ } catch (JavaModelException e) {
+ setEnabled(false);
+ }
+ }
+
+ @Override
+ public void selectionChanged(ITextSelection selection) {
+ // ignore useless selection, let above methods prevail; further checks in run().
+ }
+
+ @Override
+ public void run() {
+ common.run();
+ }
+ }
+
+ // =========== Start AbstractCallinRefactoringAction ===========
+
+ CallinRefactoringActionCommon common;
+
+ final protected String commandTooltip;
+ final protected String commandName;
+
+ protected AbstractCallinRefactoringAction(String commandName, String commandTooltip) {
+ this.commandName = commandName;
+ this.commandTooltip = commandTooltip;
+ }
+
+ public void init(IWorkbenchWindow window) {
+ common = createRefactoringActionCommon(window);
+ }
+
+ abstract protected CallinRefactoringActionCommon createRefactoringActionCommon(IWorkbenchWindow window);
+ abstract protected CallinRefactoringActionCommon createRefactoringActionCommon(JavaEditor editor);
+
+ public void dispose() {
+ // Do nothing
+ }
+
+ public void selectionChanged(IAction action, ISelection selection) {
+ try {
+ if (selection instanceof IStructuredSelection) {
+ common.selectionChanged((IStructuredSelection)selection);
+ action.setEnabled(common.isRefactoringAvailable());
+ } else if (selection instanceof JavaTextSelection) {
+ common.selectionChanged((JavaTextSelection) selection);
+ action.setEnabled(common.isRefactoringAvailable());
+ } else {
+ common.clearJavaElement();
+ action.setEnabled(true); // further checks in run().
+ }
+ } catch (JavaModelException exception) {
+ action.setEnabled(false);
+ }
+ }
+
+ public void run(IAction action) {
+ common.run();
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/otrefactorings/SelectionActionCommon.java b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/otrefactorings/SelectionActionCommon.java
new file mode 100644
index 000000000..82f325b15
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/otrefactorings/SelectionActionCommon.java
@@ -0,0 +1,102 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2009 Stephan Herrmann.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id$
+ *
+ * Please visit http://www.objectteams.org for updates and contact.
+ *
+ * Contributors:
+ * Stephan Herrmann - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.refactoring.otrefactorings;
+
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.internal.ui.actions.SelectionConverter;
+import org.eclipse.jdt.internal.ui.javaeditor.JavaEditor;
+import org.eclipse.jdt.internal.ui.javaeditor.JavaTextSelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.IWorkbenchWindow;
+
+/**
+ * Common super class for actions that depend on the selection and need to be provided by several mechanisms.
+ * @author stephan
+ */
+@SuppressWarnings("restriction")
+public abstract class SelectionActionCommon {
+
+ protected IJavaElement fJavaElement;
+ protected JavaEditor fEditor;
+ protected IWorkbenchWindow fWindow;
+
+ public SelectionActionCommon(JavaEditor editor) {
+ this.fEditor = editor;
+ }
+
+ public SelectionActionCommon(IWorkbenchWindow window) {
+ this.fWindow = window;
+ }
+
+ public void selectionChanged(IStructuredSelection selection) {
+ Object[] elements = selection.toArray();
+ filterElements(elements);
+ }
+
+ public void selectionChanged(JavaTextSelection javaTextSelection) throws JavaModelException {
+ IJavaElement[] elements= javaTextSelection.resolveElementAtOffset();
+ filterElements(elements);
+ }
+
+ /**
+ * Given some selected elements figure out whether this is a valid selection for the current action,
+ * and store the java element that {@link #run()} should operate on in the field {@link #fJavaElement}.
+ *
+ * @param elements the elements of either a structured selection, a java text selection or
+ * the result of {@link SelectionConverter#codeResolve(JavaEditor)}.
+ */
+ protected abstract void filterElements(Object[] elements);
+
+ public void clearJavaElement() {
+ this.fJavaElement = null;
+ }
+
+ /** Finish initialization and trigger running the action. */
+ public void run() {
+ prepareRun();
+ doRun();
+ }
+
+ /** This method performs those operations that are to costly to do during selectionChange. */
+ protected void prepareRun() {
+ // try to fill in missing info:
+ if (this.fJavaElement == null) {
+ // fetch the method from the editor:
+ JavaEditor javaEditor = this.fEditor;
+ if (javaEditor == null)
+ try {
+ javaEditor = (JavaEditor)this.fWindow.getActivePage().getActiveEditor();
+ } catch (ClassCastException cce) { /* nop */ }
+ if (javaEditor != null)
+ try {
+ IJavaElement[] elements = SelectionConverter.codeResolve(javaEditor);
+ filterElements(elements);
+ } catch (JavaModelException e) {
+ this.fJavaElement = null;
+ }
+ }
+ if (this.fWindow == null && this.fEditor != null)
+ // fetch the window from the editor:
+ this.fWindow = this.fEditor.getSite().getWorkbenchWindow();
+ }
+
+ /**
+ * Implementation for running the refactoring action.
+ */
+ protected abstract void doRun();
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/otrefactorings/extractcallin/ExtractCallinAction.java b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/otrefactorings/extractcallin/ExtractCallinAction.java
new file mode 100644
index 000000000..78cd2ee21
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/otrefactorings/extractcallin/ExtractCallinAction.java
@@ -0,0 +1,74 @@
+package org.eclipse.objectteams.otdt.internal.refactoring.otrefactorings.extractcallin;
+
+import org.eclipse.jdt.core.IMethod;
+import org.eclipse.jdt.internal.ui.javaeditor.JavaEditor;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation;
+import org.eclipse.objectteams.otdt.internal.refactoring.otrefactorings.AbstractCallinRefactoringAction;
+import org.eclipse.objectteams.otdt.internal.refactoring.otrefactorings.AbstractCallinRefactoringAction.SelectionDispatchAction;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkbenchWindowActionDelegate;
+
+/**
+ * Action classes for the extract callin refactoring:
+ * <ul>
+ * <li>The toplevel class provides the action to the main menu bar (registered via plugin.xml).</li>
+ * <li>Inherited nested class {@link SelectionDispatchAction} provides the action to context menus of all views.</li>
+ * <li>Nested class {@link ExtractCallinActionCommon} implements the shared stateful part of both actions.</li>
+ * </ul>
+ */
+@SuppressWarnings("restriction")
+public class ExtractCallinAction extends AbstractCallinRefactoringAction implements IWorkbenchWindowActionDelegate
+{
+ /**
+ * Fill inherited class {@link CallinRefactoringActionCommon} with details.
+ */
+ class ExtractCallinActionCommon extends CallinRefactoringActionCommon
+ {
+ ExtractCallinActionCommon(JavaEditor editor) {
+ super(editor);
+ }
+
+ ExtractCallinActionCommon(IWorkbenchWindow window) {
+ super(window);
+ }
+
+ protected void filterElements(Object[] elements) {
+ this.fJavaElement = null;
+ if (elements == null || elements.length != 1)
+ return;
+ else if (elements[0] instanceof IMethod)
+ this.fJavaElement = (IMethod) elements[0];
+ }
+
+ protected void doRun() {
+ if (fJavaElement != null && fWindow != null) {
+ try {
+ new RefactoringWizardOpenOperation(
+ new ExtractCallinWizard(
+ new ExtractCallinRefactoring((IMethod)fJavaElement),
+ "Extract Callin"
+ )
+ ).run(fWindow.getShell(), "Extract Callin");
+ } catch (InterruptedException exception) {
+ // Do nothing
+ }
+ } else {
+ MessageDialog.openInformation(null, "Extract Callin", "Operation unavailable on the current selection. Select a callin-bound role method or a callin method binding");
+ }
+ }
+ }
+
+ // =========== Start ExtractCallinAction ===========
+ public ExtractCallinAction() {
+ super("Extract Callin ...", "Extract a callin binding and method.");
+ }
+
+ protected CallinRefactoringActionCommon createRefactoringActionCommon(IWorkbenchWindow window) {
+ return new ExtractCallinActionCommon(window);
+ }
+
+ protected CallinRefactoringActionCommon createRefactoringActionCommon(JavaEditor editor) {
+ return new ExtractCallinActionCommon(editor);
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/otrefactorings/extractcallin/ExtractCallinInputPage.java b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/otrefactorings/extractcallin/ExtractCallinInputPage.java
new file mode 100644
index 000000000..2d28b5a64
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/otrefactorings/extractcallin/ExtractCallinInputPage.java
@@ -0,0 +1,247 @@
+package org.eclipse.objectteams.otdt.internal.refactoring.otrefactorings.extractcallin;
+
+import java.util.List;
+
+import org.eclipse.jdt.core.IType;
+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.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.objectteams.otdt.core.ICallinMapping;
+import org.eclipse.objectteams.otdt.core.IRoleType;
+
+public class ExtractCallinInputPage extends UserInputWizardPage {
+
+
+ private Text fNameField;
+
+ private Combo fTypeCombo;
+
+ private Button fReferenceButton;
+
+ private List<IRoleType> fCandidateRoles;
+
+ private ExtractCallinRefactoring fRefactoring;
+
+ private Group fExtractMode;
+
+ private Button fReplaceRadio;
+
+ private Button fBeforeRadio;
+
+ private Button fAfterRadio;
+
+ private Button fRemove;
+
+
+ public ExtractCallinInputPage(String name) {
+ super(name);
+ }
+
+ public void createControl(Composite parent) {
+ initializeDialogUnits(parent);
+ fRefactoring = (ExtractCallinRefactoring) getRefactoring();
+ Composite result = new Composite(parent, SWT.NONE);
+
+ setControl(result);
+
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 2;
+ result.setLayout(layout);
+
+ Label label = new Label(result, SWT.NONE);
+ label.setText("&Role method name:");
+
+ fNameField = createNameField(result);
+
+ // Role Selection
+ label = new Label(result, SWT.NONE);
+ label.setText("&Target role:");
+
+ Composite composite = new Composite(result, SWT.NONE);
+
+ fCandidateRoles = fRefactoring.getCandidateRoles();
+
+ layout = new GridLayout();
+ layout.marginHeight = 0;
+ layout.marginWidth = 0;
+ layout.numColumns = 1;
+ composite.setLayout(layout);
+ composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+ fTypeCombo = createTypeCombo(composite);
+ fTypeCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+ for (IRoleType role : fCandidateRoles) {
+ final String comboLabel = role.getFullyQualifiedName('.');
+ fTypeCombo.add(comboLabel);
+ }
+ fTypeCombo.select(fCandidateRoles.size() - 1);
+
+
+ createRadioButtonGroup(result);
+
+ fReferenceButton = new Button(result, SWT.CHECK);
+ fReferenceButton.setEnabled(true);
+ fReferenceButton.setText("&Delete extracted base method");
+ fReferenceButton.addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent event) {
+ fRefactoring.setDeleteBaseMethod(fReferenceButton.getSelection());
+ }
+ });
+
+
+ GridData data = new GridData(GridData.FILL_HORIZONTAL);
+ data.horizontalSpan = 2;
+ data.verticalIndent = 2;
+ fReferenceButton.setLayoutData(data);
+
+ fNameField.setText(fRefactoring.getBaseMethod().getElementName());
+ fTypeCombo.setText(fRefactoring.getBaseMethod().getDeclaringType().getFullyQualifiedName());
+
+ fNameField.addModifyListener(new ModifyListener() {
+
+ public void modifyText(ModifyEvent event) {
+ handleInputChanged();
+ }
+ });
+
+ fReferenceButton.addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent event) {
+ fRefactoring.setDeleteBaseMethod(fReferenceButton.getSelection());
+ }
+ });
+
+ fTypeCombo.addModifyListener(new ModifyListener() {
+
+ public void modifyText(ModifyEvent event) {
+ handleInputChanged();
+ }
+ });
+
+ fNameField.setFocus();
+ fNameField.selectAll();
+ fBeforeRadio.setEnabled(fRefactoring.isExtractBeforeAvailable());
+ fAfterRadio.setEnabled(fRefactoring.isExtractAfterAvailable());
+ handleInputChanged();
+ fReferenceButton.setSelection(fRefactoring.isDeleteBaseMethod());
+ }
+
+ private void createRadioButtonGroup(Composite result) {
+ fExtractMode = new Group(result, SWT.NONE);
+ GridData data = new GridData(GridData.FILL_HORIZONTAL);
+ data.horizontalSpan = 2;
+ data.verticalIndent = 2;
+ fExtractMode.setLayoutData(data);
+ fExtractMode.setLayout(new GridLayout());
+ fExtractMode.setText("Extract Mode");
+
+ fReplaceRadio = new Button(fExtractMode, SWT.RADIO);
+ fReplaceRadio.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ fReplaceRadio.setText("R&eplace");
+ fReplaceRadio.setSelection(true);
+ fRefactoring.setMappingKind(ICallinMapping.KIND_REPLACE);
+ fReplaceRadio.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent event) {
+ if (((Button) event.widget).getSelection()) {
+ fRefactoring.setMappingKind(ICallinMapping.KIND_REPLACE);
+ fRemove.setEnabled(true);
+ handleInputChanged();
+ }
+ }
+ });
+ fRemove = new Button(fExtractMode, SWT.CHECK);
+ data = new GridData(GridData.FILL_HORIZONTAL);
+ data.horizontalIndent = convertWidthInCharsToPixels(3);
+ fRemove.setLayoutData(data);
+ fRemove.setText("&Copy base method code");
+ fRemove.setSelection(fRefactoring.isCopyBaseMethod());
+ fRemove.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ fRefactoring.setCopyBaseMethod(((Button) e.widget).getSelection());
+ handleInputChanged();
+ }
+ });
+
+ fBeforeRadio = new Button(fExtractMode, SWT.RADIO);
+ fBeforeRadio.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ fBeforeRadio.setText("&Before");
+ fBeforeRadio.setSelection(false);
+ fBeforeRadio.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent event) {
+ fRemove.setEnabled(false);
+ if (((Button) event.widget).getSelection()){
+ fRefactoring.setMappingKind(ICallinMapping.KIND_BEFORE);
+ handleInputChanged();
+ }
+ }
+ });
+
+ fAfterRadio = new Button(fExtractMode, SWT.RADIO);
+ fAfterRadio.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ fAfterRadio.setText("&After");
+ fAfterRadio.setSelection(false);
+ fAfterRadio.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent event) {
+ fRemove.setEnabled(false);
+ if (((Button) event.widget).getSelection()){
+ fRefactoring.setMappingKind(ICallinMapping.KIND_AFTER);
+ handleInputChanged();
+ }
+ }
+ });
+ }
+
+ private Text createNameField(Composite result) {
+ Text field = new Text(result, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
+ field.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ return field;
+ }
+
+ private Combo createTypeCombo(Composite composite) {
+ Combo combo = new Combo(composite, SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY);
+ combo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ combo.setVisibleItemCount(4);
+ return combo;
+ }
+
+ void handleInputChanged() {
+ fReferenceButton.setEnabled(fRefactoring.getMappingKind() != ICallinMapping.KIND_REPLACE);
+ fRefactoring.setRoleType(getSelectedRole());
+
+ RefactoringStatus status = new RefactoringStatus();
+ fRefactoring.setRoleMethodName(fNameField.getText());
+ status.merge(fRefactoring.checkRoleMethodName());
+
+ setPageComplete(!status.hasError());
+ int severity = status.getSeverity();
+ String message = status.getMessageMatchingSeverity(severity);
+ if (severity >= RefactoringStatus.INFO) {
+ setMessage(message, severity);
+ } else {
+ setMessage("", NONE); //$NON-NLS-1$
+ }
+ }
+
+ public IType getSelectedRole() {
+ final int index = fTypeCombo.getSelectionIndex();
+ if (index >= 0)
+ return fCandidateRoles.get(index);
+ return null;
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/otrefactorings/extractcallin/ExtractCallinRefactoring.java b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/otrefactorings/extractcallin/ExtractCallinRefactoring.java
new file mode 100644
index 000000000..1a18d7ecc
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/otrefactorings/extractcallin/ExtractCallinRefactoring.java
@@ -0,0 +1,774 @@
+package org.eclipse.objectteams.otdt.internal.refactoring.otrefactorings.extractcallin;
+
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.Assert;
+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.SubProgressMonitor;
+import org.eclipse.jdt.core.Flags;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IMethod;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaConventions;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.core.dom.AST;
+import org.eclipse.jdt.core.dom.ASTNode;
+import org.eclipse.jdt.core.dom.AbstractTypeDeclaration;
+import org.eclipse.jdt.core.dom.AnonymousClassDeclaration;
+import org.eclipse.jdt.core.dom.BaseCallMessageSend;
+import org.eclipse.jdt.core.dom.Block;
+import org.eclipse.jdt.core.dom.CallinMappingDeclaration;
+import org.eclipse.jdt.core.dom.ChildListPropertyDescriptor;
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jdt.core.dom.Expression;
+import org.eclipse.jdt.core.dom.ExpressionStatement;
+import org.eclipse.jdt.core.dom.IBinding;
+import org.eclipse.jdt.core.dom.IExtendedModifier;
+import org.eclipse.jdt.core.dom.IMethodBinding;
+import org.eclipse.jdt.core.dom.ITypeBinding;
+import org.eclipse.jdt.core.dom.MethodDeclaration;
+import org.eclipse.jdt.core.dom.MethodInvocation;
+import org.eclipse.jdt.core.dom.MethodSpec;
+import org.eclipse.jdt.core.dom.Modifier;
+import org.eclipse.jdt.core.dom.Name;
+import org.eclipse.jdt.core.dom.NodeFinder;
+import org.eclipse.jdt.core.dom.ParameterMapping;
+import org.eclipse.jdt.core.dom.SimpleName;
+import org.eclipse.jdt.core.dom.SingleVariableDeclaration;
+import org.eclipse.jdt.core.dom.Statement;
+import org.eclipse.jdt.core.dom.ThisExpression;
+import org.eclipse.jdt.core.dom.Type;
+import org.eclipse.jdt.core.dom.Modifier.ModifierKeyword;
+import org.eclipse.jdt.core.dom.rewrite.ASTNodeCreator;
+import org.eclipse.jdt.core.dom.rewrite.ASTRewrite;
+import org.eclipse.jdt.core.dom.rewrite.ImportRewrite;
+import org.eclipse.jdt.internal.corext.codemanipulation.StubUtility;
+import org.eclipse.jdt.internal.corext.refactoring.structure.ImportRewriteUtil;
+import org.eclipse.jdt.internal.corext.refactoring.util.RefactoringASTParser;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.eclipse.ltk.core.refactoring.CompositeChange;
+import org.eclipse.ltk.core.refactoring.Refactoring;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.eclipse.ltk.core.refactoring.TextFileChange;
+import org.eclipse.text.edits.MultiTextEdit;
+import org.eclipse.text.edits.TextEdit;
+import org.eclipse.text.edits.TextEditGroup;
+import org.eclipse.objectteams.otdt.core.ICallinMapping;
+import org.eclipse.objectteams.otdt.core.IRoleType;
+import org.eclipse.objectteams.otdt.internal.core.AbstractCalloutMapping;
+import org.eclipse.objectteams.otdt.internal.core.CalloutMapping;
+import org.eclipse.objectteams.otdt.internal.refactoring.util.RefactoringUtil;
+
+@SuppressWarnings("restriction")
+public class ExtractCallinRefactoring extends Refactoring {
+
+ private Map<ICompilationUnit, TextFileChange> fChanges = null;
+
+ private boolean fDeleteBaseMethod;
+
+ private CompilationUnit fRootBase;
+
+ private AST fBaseAST;
+
+ private ICompilationUnit fBaseCUnit;
+
+ private ICompilationUnit fRoleCUnit;
+
+ private CompilationUnit fRootRole;
+
+ private AST fRoleAST;
+
+ private IType fRoleType;
+
+ private TextFileChange fBaseTextFileChange;
+
+ private TextFileChange fRoleTextFileChange;
+
+ private List<ICallinMapping> fBoundCallinMappings;
+
+ private String fRoleMethodName;
+
+ private IType fBaseType;
+
+ private ASTRewrite fBaseRewrite;
+
+ private int fMappingKind;
+
+ private boolean fCopyBaseMethod;
+
+ private IMethod fBaseMethod;
+
+ private List<IRoleType> fBoundRoles;
+
+ private IMethod fExtractedBaseMethod;
+
+ private MethodDeclaration fBaseMethodDeclaration;
+
+ private ASTRewrite fRoleRewrite;
+
+ private ImportRewrite fRoleImportRewriter;
+
+ private MethodInvocation fExtractedMethodInvocation;
+
+ private ImportRewrite fBaseImportRewriter;
+
+ public ExtractCallinRefactoring() {
+ fCopyBaseMethod = true;
+ }
+
+ public ExtractCallinRefactoring(IMethod baseMethod) {
+ this();
+ fBaseMethod = baseMethod;
+ }
+
+ public ExtractCallinRefactoring(IMethod baseMethod, IType role, int mappingKind) {
+ this(baseMethod);
+ fRoleType = role;
+ fMappingKind = mappingKind;
+ }
+
+ public List<IRoleType> getCandidateRoles() {
+ return fBoundRoles;
+ }
+
+ public void setRoleType(IType role) {
+ fRoleType = role;
+ }
+
+ public void setCopyBaseMethod(boolean copyBaseMethod) {
+ fCopyBaseMethod = copyBaseMethod;
+ }
+
+ public void setMappingKind(int mappingKind) {
+ fMappingKind = mappingKind;
+ }
+
+ public int getMappingKind() {
+ return fMappingKind;
+ }
+
+ public void setChanges(Map<ICompilationUnit, TextFileChange> fChanges) {
+ this.fChanges = fChanges;
+ }
+
+ public Map<ICompilationUnit, TextFileChange> getChanges() {
+ return fChanges;
+ }
+
+ public IMethod getBaseMethod() {
+ return fBaseMethod;
+ }
+
+ public boolean isCopyBaseMethod() {
+ return fCopyBaseMethod;
+ }
+
+ public boolean isDeleteBaseMethod() {
+ return fDeleteBaseMethod;
+ }
+
+ public void setDeleteBaseMethod(boolean deleteRoleMethod) {
+ fDeleteBaseMethod = deleteRoleMethod;
+ }
+
+ public RefactoringStatus checkInitialConditions(IProgressMonitor monitor) throws CoreException, OperationCanceledException {
+ RefactoringStatus status= new RefactoringStatus();
+ try {
+ monitor.beginTask("Checking preconditions...", 1);
+ if (fBaseMethod == null) {
+ status.merge(RefactoringStatus.createFatalErrorStatus("Method has not been specified."));
+ } else if (!fBaseMethod.exists()) {
+ status.merge(RefactoringStatus.createFatalErrorStatus(MessageFormat.format("Method ''{0}'' does not exist.", new Object[] { fBaseMethod
+ .getElementName() })));
+ }else if (fBaseMethod.isBinary()){
+ status.merge(RefactoringStatus.createFatalErrorStatus(MessageFormat.format("Method ''{0}'' is declared in a binary class file.", new Object[] { fBaseMethod
+ .getElementName() })));
+ }else if (fBaseMethod.isReadOnly()){
+ status.merge(RefactoringStatus.createFatalErrorStatus(MessageFormat.format("Method ''{0}'' is declared in a read-only class file.", new Object[] { fBaseMethod
+ .getElementName() })));
+ } else if (!fBaseMethod.getCompilationUnit().isStructureKnown()) {
+ status.merge(RefactoringStatus.createFatalErrorStatus(MessageFormat.format("Compilation unit ''{0}'' contains compile errors.",
+ new Object[] { fBaseMethod.getCompilationUnit().getElementName() })));
+ } else if (Flags.isAbstract(fBaseMethod.getFlags())){
+ status.merge(RefactoringStatus.createFatalErrorStatus(MessageFormat.format("Method ''{0}'' is abstract, cannot extract.", new Object[] { fBaseMethod
+ .getElementName() })));
+ } else if (fBaseMethod instanceof AbstractCalloutMapping){
+ status.merge(RefactoringStatus.createFatalErrorStatus(MessageFormat.format("Method ''{0}'' is an callout method and cannot be extracted.", new Object[] { fBaseMethod
+ .getElementName() })));
+ }else{
+ status.merge(initialize(monitor));
+ }
+ } finally {
+ monitor.done();
+ }
+ return status;
+ }
+
+ private RefactoringStatus initialize(IProgressMonitor monitor) {
+ RefactoringStatus status = new RefactoringStatus();
+ try {
+ fRoleMethodName = fBaseMethod.getElementName();
+ fBaseType = fBaseMethod.getDeclaringType();
+ fBaseCUnit = fBaseType.getCompilationUnit();
+
+ if (fRootBase == null) {
+ fRootBase = RefactoringASTParser.parseWithASTProvider(fBaseCUnit, true, new SubProgressMonitor(monitor, 99));
+ }
+ fBaseImportRewriter = StubUtility.createImportRewrite(fRootBase, true);
+ fBaseMethodDeclaration = RefactoringUtil.methodToDeclaration(fBaseMethod, fRootBase);
+
+ fBaseAST = fRootBase.getAST();
+
+ fBoundRoles = findCandidateRoles();
+ if (fBoundRoles.size() == 0) {
+ status.merge(RefactoringStatus.createFatalErrorStatus(MessageFormat.format("The declaring type ''{0}'' is not bound by a role.",
+ new Object[] { fBaseType.getElementName() })));
+ }
+
+
+
+ } catch (CoreException e) {
+ status.merge(createCouldNotParseStatus());
+ }
+ if (status.hasFatalError()) {
+ return status;
+ }
+ return status;
+ }
+
+ public RefactoringStatus checkFinalConditions(IProgressMonitor pm) throws CoreException, OperationCanceledException {
+
+ RefactoringStatus status = new RefactoringStatus();
+
+ if (fRoleType == null) {
+ status.merge(RefactoringStatus.createFatalErrorStatus("No target role selected."));
+ }else if (!fRoleType.exists()) {
+ status.merge(RefactoringStatus.createFatalErrorStatus(MessageFormat.format("Type ''{0}'' does not exist.", new Object[] { fRoleType
+ .getElementName() })));
+ }else if (fRoleType.isBinary()){
+ status.merge(RefactoringStatus.createFatalErrorStatus(MessageFormat.format("Type ''{0}'' is declared in a binary class file.", new Object[] { fRoleType
+ .getElementName() })));
+ }else if (fRoleType.isReadOnly()){
+ status.merge(RefactoringStatus.createFatalErrorStatus(MessageFormat.format("Type ''{0}'' is declared in a read-only file.", new Object[] { fRoleType
+ .getElementName() })));
+ }
+
+ fRoleCUnit = fRoleType.getCompilationUnit();
+ if (fRootRole == null) {
+ fRootRole = RefactoringASTParser.parseWithASTProvider(fRoleCUnit, true, new SubProgressMonitor(pm, 99));
+ }
+ fRoleImportRewriter = StubUtility.createImportRewrite(fRootRole, true);
+ fRoleAST = fRootRole.getAST();
+
+ if(fDeleteBaseMethod && fMappingKind != ICallinMapping.KIND_REPLACE){
+ //TODO check if base method can be deleted (no references expect the extracted method invocation)
+ }
+
+ status.merge(checkRoleMethodName());
+
+ status.merge(checkCallinKind());
+
+ return status;
+ }
+
+ private RefactoringStatus checkCallinKind() throws JavaModelException {
+ if (fMappingKind == 0) {
+ return RefactoringStatus.createFatalErrorStatus("Callin kind has not been specified.");
+ }
+ if (fMappingKind == ICallinMapping.KIND_BEFORE && !isExtractBeforeAvailable()) {
+ return RefactoringStatus.createFatalErrorStatus("The first statement in the base method must be a method invocation to extract a before callin.");
+ }
+ if (fMappingKind == ICallinMapping.KIND_AFTER && !isExtractAfterAvailable()) {
+ return RefactoringStatus.createFatalErrorStatus("The last statement in the base method must be a method invocation to extract an after callin.");
+ }
+ if (fMappingKind != ICallinMapping.KIND_REPLACE && fMappingKind != ICallinMapping.KIND_BEFORE && fMappingKind != ICallinMapping.KIND_AFTER) {
+ return RefactoringStatus.createFatalErrorStatus("Invalid callin kind.");
+ }
+ return new RefactoringStatus();
+ }
+
+ @Override
+ public Change createChange(IProgressMonitor pm) throws CoreException, OperationCanceledException {
+ extractCallin();
+ CompositeChange change = new CompositeChange(getName(), new TextFileChange[] { fBaseTextFileChange, fRoleTextFileChange });
+ return change;
+ }
+
+ @Override
+ public String getName() {
+ return "Extract Callin";
+ }
+
+ @SuppressWarnings("unchecked")
+ private void extractCallin() throws CoreException {
+ fBaseRewrite = ASTRewrite.create(fBaseAST);
+ fRoleRewrite = ASTRewrite.create(fRoleAST);
+
+ MethodDeclaration baseMethodDeclaration = RefactoringUtil.methodToDeclaration(fBaseMethod, fRootBase);
+
+ List<Statement> statements = baseMethodDeclaration.getBody().statements();
+
+ fExtractedBaseMethod = null;
+
+ // change the strategy for the different mapping kinds
+ switch (fMappingKind) {
+ case ICallinMapping.KIND_BEFORE:
+ fExtractedMethodInvocation = (MethodInvocation) ((ExpressionStatement) statements.get(0)).getExpression();
+ IMethodBinding methodBinding = fExtractedMethodInvocation.resolveMethodBinding();
+ fExtractedBaseMethod = (IMethod) methodBinding.getJavaElement();
+
+ fBaseRewrite.getListRewrite(baseMethodDeclaration.getBody(), Block.STATEMENTS_PROPERTY).remove(statements.get(0), null);
+ // TODO check for unused imports
+ break;
+ case ICallinMapping.KIND_AFTER:
+ fExtractedMethodInvocation = (MethodInvocation) ((ExpressionStatement) statements.get(statements.size() - 1)).getExpression();
+ methodBinding = fExtractedMethodInvocation.resolveMethodBinding();
+ fExtractedBaseMethod = (IMethod) methodBinding.getJavaElement();
+
+ fBaseRewrite.getListRewrite(baseMethodDeclaration.getBody(), Block.STATEMENTS_PROPERTY).remove(statements.get(statements.size() - 1), null);
+ // TODO check for unused imports
+ break;
+ case ICallinMapping.KIND_REPLACE:
+ fExtractedBaseMethod = fBaseMethod;
+ break;
+ default:
+ break;
+ }
+
+ MethodDeclaration extractedCallin = extractCallinMethod();
+
+ insertMethodIntoRole(extractedCallin);
+
+ CallinMappingDeclaration callinMapping = createMethodMapping();
+
+ appendMethodMappingToRole(callinMapping);
+
+ if(fDeleteBaseMethod && fMappingKind != ICallinMapping.KIND_REPLACE){
+ MethodDeclaration extractedBaseMethodDecl = RefactoringUtil.methodToDeclaration(fExtractedBaseMethod, fRootBase);
+ AbstractTypeDeclaration declaration = (AbstractTypeDeclaration) typeToDeclaration(fBaseType, fRootBase);
+ ChildListPropertyDescriptor descriptor = typeToBodyDeclarationProperty(fBaseType, fRootBase);
+ fBaseRewrite.getListRewrite(declaration, descriptor).remove(extractedBaseMethodDecl, null);
+ }
+
+ // collect imports
+ Set<IBinding> staticImports = new HashSet<IBinding>();
+ Set<ITypeBinding> imports = new HashSet<ITypeBinding>();
+ MethodDeclaration extractedCallinMethodDeclaration = RefactoringUtil.methodToDeclaration(fExtractedBaseMethod, fRootBase);
+ ImportRewriteUtil.collectImports(fRoleType.getJavaProject(), extractedCallinMethodDeclaration, imports, staticImports, false);
+ if(fMappingKind != ICallinMapping.KIND_REPLACE)
+ ImportRewriteUtil.collectImports(fRoleType.getJavaProject(), fExtractedMethodInvocation, imports, staticImports, false);
+ for (ITypeBinding typeBinding : imports) {
+ fRoleImportRewriter.addImport(typeBinding);
+ }
+ for (IBinding binding : staticImports) {
+ fRoleImportRewriter.addStaticImport(binding);
+ }
+
+ // create the text change for the base
+ MultiTextEdit baseMultiEdit = new MultiTextEdit();
+ baseMultiEdit.addChild(fBaseRewrite.rewriteAST());
+ fBaseTextFileChange = new TextFileChange(fBaseCUnit.getElementName(), (IFile) fBaseCUnit.getResource());
+ fBaseTextFileChange.setTextType("java");
+ fBaseTextFileChange.setEdit(baseMultiEdit);
+
+ // create the text change for the role
+ MultiTextEdit roleMultiEdit = new MultiTextEdit();
+ roleMultiEdit.addChild(fRoleRewrite.rewriteAST());
+ fRoleTextFileChange = new TextFileChange(fRoleCUnit.getElementName(), (IFile) fRoleCUnit.getResource());
+ fRoleTextFileChange.setTextType("java");
+ fRoleTextFileChange.setEdit(roleMultiEdit);
+
+ // Update imports
+ if (fRoleImportRewriter.hasRecordedChanges()) {
+ TextEdit edit = fRoleImportRewriter.rewriteImports(null);
+ roleMultiEdit.addChild(edit);
+ fRoleTextFileChange.addTextEditGroup(new TextEditGroup("Update Imports", new TextEdit[] { edit }));
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ private MethodDeclaration extractCallinMethod() throws JavaModelException {
+ // copy the extracted callin to the role
+ MethodDeclaration extractedCallinMethodDeclaration = RefactoringUtil.methodToDeclaration(fExtractedBaseMethod, fRootBase);
+ MethodDeclaration copyOfExtractedCallin = (MethodDeclaration) ASTNode.copySubtree(fRoleAST, extractedCallinMethodDeclaration);
+ copyOfExtractedCallin.getName().setIdentifier(fRoleMethodName);
+
+ if (fMappingKind == ICallinMapping.KIND_REPLACE) {
+ addCallinModifier(fRoleRewrite, copyOfExtractedCallin);
+ // copyOfExtractedCallin.
+ if(!fCopyBaseMethod){
+ // remove all statments and add a base call
+ Block body = fRoleAST.newBlock();
+ BaseCallMessageSend baseCall = createBaseMethodInvocation(fRoleMethodName, fExtractedBaseMethod, fBaseMethod);
+ body.statements().add(fRoleAST.newExpressionStatement(baseCall));
+ copyOfExtractedCallin.setBody(body);
+ }
+ } else if (!Flags.isPrivate(fExtractedBaseMethod.getFlags())) {
+ changeToPrivateVisibility(fRoleRewrite, copyOfExtractedCallin);
+ }
+ return copyOfExtractedCallin;
+ }
+
+ private BaseCallMessageSend createBaseMethodInvocation(String roleMethodName, IMethod roleMethod, IMethod baseMethod) throws JavaModelException {
+ BaseCallMessageSend baseCall = fRoleAST.newBaseCallMessageSend();
+ baseCall.setName(fRoleAST.newSimpleName(roleMethodName));
+ copyInvocationParameters(baseCall, roleMethod);
+
+ // if the role method doesn't declare the same number of parameters as
+ // the base method, the parameters have to be appended
+ int roleMethodParameterLength = roleMethod.getParameterNames().length;
+ int baseMethodParameterLength = baseMethod.getParameterNames().length;
+ if (roleMethodParameterLength < baseMethodParameterLength) {
+ appendInvocationParameters(baseCall, baseMethod, baseMethodParameterLength - roleMethodParameterLength);
+ }
+
+ return baseCall;
+ }
+
+ static MethodSpec createMethodSpec(AST ast, ImportRewrite imports, IMethodBinding methodBinding, String[] argNames) {
+ List<SingleVariableDeclaration> args = new ArrayList<SingleVariableDeclaration>();
+ for (int i = 0; i < methodBinding.getParameterTypes().length; i++) {
+ ITypeBinding paramType = methodBinding.getParameterTypes()[i];
+ args.add(ASTNodeCreator.createArgument(ast, 0/* modifiers */, imports.addImport(paramType, ast), argNames[i], 0 /* extraDimensions */, null));
+ }
+ ITypeBinding providedReturnType = methodBinding.getReturnType();
+ Type returnType = imports.addImport(providedReturnType, ast);
+ return ASTNodeCreator.createMethodSpec(ast, methodBinding.getName(), returnType, args, true);
+ }
+
+ private void appendMethodMappingToRole(CallinMappingDeclaration callinMapping) throws JavaModelException {
+ AbstractTypeDeclaration declaration = (AbstractTypeDeclaration) typeToDeclaration(fRoleType, fRootRole);
+ ChildListPropertyDescriptor descriptor = typeToBodyDeclarationProperty(fRoleType, fRootRole);
+ fRoleRewrite.getListRewrite(declaration, descriptor).insertLast(callinMapping, null);
+ }
+
+ @SuppressWarnings("unchecked")
+ private CallinMappingDeclaration createMethodMapping() throws JavaModelException {
+ CallinMappingDeclaration mapping = fRoleAST.newCallinMappingDeclaration();
+
+ Modifier callinModifier = createCallinModifier();
+
+ mapping.setCallinModifier(callinModifier);
+
+ IMethodBinding roleMethodBinding = RefactoringUtil.methodToDeclaration(fExtractedBaseMethod, fRootBase).resolveBinding();
+ MethodSpec roleMethodSpec = createMethodSpec(fRoleAST, fRoleImportRewriter, roleMethodBinding, fExtractedBaseMethod.getParameterNames());
+ roleMethodSpec.setName(fRoleAST.newSimpleName(fRoleMethodName));
+ mapping.setRoleMappingElement(roleMethodSpec);
+
+ IMethodBinding baseMethodBinding = RefactoringUtil.methodToDeclaration(fBaseMethod, fRootBase).resolveBinding();
+ MethodSpec baseMethodSpec = createMethodSpec(fRoleAST, fRoleImportRewriter, baseMethodBinding, fBaseMethod.getParameterNames());
+ mapping.getBaseMappingElements().add(baseMethodSpec);
+
+ if (needsParameterMapping()) {
+ // parameterMapping.
+ List<SingleVariableDeclaration> parameters = roleMethodSpec.parameters();
+ for (int i = 0; i < parameters.size(); i++) {
+ SingleVariableDeclaration varDecl = parameters.get(i);
+ ParameterMapping parameterMapping = fRoleAST.newParameterMapping();
+ Expression expr = (Expression) ASTNode.copySubtree(fRoleAST, (Expression) fExtractedMethodInvocation.arguments().get(i));
+
+ parameterMapping.setIdentifier(fRoleAST.newSimpleName(varDecl.getName().getIdentifier()));
+ parameterMapping.setExpression(expr);
+ parameterMapping.setDirection("<-");
+ mapping.getParameterMappings().add(parameterMapping);
+ }
+ }
+ return mapping;
+ }
+
+ private boolean needsParameterMapping() throws JavaModelException {
+ if (fMappingKind == ICallinMapping.KIND_REPLACE) {
+ return false;
+ }
+ if (fExtractedBaseMethod.getParameterNames().length == 0) {
+ return false;
+ }
+ if (fExtractedMethodInvocation.arguments().size() > fBaseMethod.getParameterNames().length) {
+ return true;
+ }
+ for (int i = 0; i < fExtractedMethodInvocation.arguments().size(); i++) {
+ Expression expression = (Expression) fExtractedMethodInvocation.arguments().get(i);
+ if (expression instanceof SimpleName) {
+ if (!((SimpleName) expression).getIdentifier().equals(fBaseMethod.getParameterNames()[i])) {
+ return true;
+ }
+ } else {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private Modifier createCallinModifier() {
+ switch (fMappingKind) {
+ case ICallinMapping.KIND_BEFORE:
+ return fRoleAST.newModifier(ModifierKeyword.BEFORE_KEYWORD);
+ case ICallinMapping.KIND_AFTER:
+ return fRoleAST.newModifier(ModifierKeyword.AFTER_KEYWORD);
+ case ICallinMapping.KIND_REPLACE:
+ return fRoleAST.newModifier(ModifierKeyword.REPLACE_KEYWORD);
+ default:
+ return null;
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ private void addCallinModifier(ASTRewrite astRewrite, MethodDeclaration methodDeclaration) {
+ Modifier callinModifier = fRoleAST.newModifier(ModifierKeyword.CALLIN_KEYWORD);
+
+ // add the callin modifier
+ astRewrite.getListRewrite(methodDeclaration, MethodDeclaration.MODIFIERS2_PROPERTY).insertLast(callinModifier, null);
+
+ // visibility modifiers should be removed because callin methods don't
+ // declare a visibility (OTJLD 4.2(d))
+ List<IExtendedModifier> modifiers = methodDeclaration.modifiers();
+ for (IExtendedModifier extendedModifier : modifiers) {
+ if (extendedModifier instanceof Modifier) {
+ Modifier modifier = (Modifier) extendedModifier;
+ if (Modifier.isPublic(modifier.getKeyword().toFlagValue()) || Modifier.isProtected(modifier.getKeyword().toFlagValue())
+ || Modifier.isPrivate(modifier.getKeyword().toFlagValue())) {
+ astRewrite.getListRewrite(methodDeclaration, MethodDeclaration.MODIFIERS2_PROPERTY).remove(modifier, null);
+ break;
+ }
+ }
+ }
+ }
+
+ private void insertMethodIntoRole(MethodDeclaration methodDeclaration) throws JavaModelException {
+ AbstractTypeDeclaration declaration = (AbstractTypeDeclaration) typeToDeclaration(fRoleType, fRootRole);
+ ChildListPropertyDescriptor descriptor = typeToBodyDeclarationProperty(fRoleType, fRootRole);
+ fRoleRewrite.getListRewrite(declaration, descriptor).insertLast(methodDeclaration, null);
+ }
+
+ /**
+ * Replaces <code>public</code> and <code>protected</code> by a
+ * <code>private</code> modifier. If the method has default visibility
+ * <code>private</code> modifier will be prepended to the modifier list.
+ *
+ * @param rewrite
+ * the rewrite that notes the changes
+ * @param methodDeclaration
+ * the method declaration to be changed
+ */
+ @SuppressWarnings("unchecked")
+ private void changeToPrivateVisibility(ASTRewrite astRewrite, MethodDeclaration methodDeclaration) {
+ Modifier privateVisibility = methodDeclaration.getAST().newModifier(ModifierKeyword.PRIVATE_KEYWORD);
+
+ List<IExtendedModifier> modifiers = methodDeclaration.modifiers();
+ for (IExtendedModifier extendedModifier : modifiers) {
+ if (extendedModifier instanceof Modifier) {
+ Modifier modifier = (Modifier) extendedModifier;
+ if (Modifier.isPublic(modifier.getKeyword().toFlagValue())) {
+ astRewrite.replace(modifier, privateVisibility, null);
+ return;
+ }
+ if (Modifier.isProtected(modifier.getKeyword().toFlagValue())) {
+ astRewrite.replace(modifier, privateVisibility, null);
+ return;
+ }
+ if (Modifier.isPrivate(modifier.getKeyword().toFlagValue())) {
+ // don't replace private modifiers or create a 2nd private
+ // modifier
+ return;
+ }
+ }
+ }
+ // no visibility modifier was found => default visibility will be
+ // reduced to private
+ astRewrite.getListRewrite(methodDeclaration, MethodDeclaration.MODIFIERS2_PROPERTY).insertFirst(privateVisibility, null);
+ }
+
+ @SuppressWarnings("unchecked")
+ private void copyInvocationParameters(BaseCallMessageSend baseCall, IMethod method) throws JavaModelException {
+ String[] names = method.getParameterNames();
+ for (String element : names)
+ baseCall.getArguments().add(fRoleAST.newSimpleName(element));
+ }
+
+ /**
+ * Appends invocation parameter names from the given method from the given
+ * offset. This method is used to extend base method calls if the role
+ * method declares fewer parameters than the base method.
+ *
+ * @param baseCall
+ * the base call invocation to receive the parameters
+ * @param method
+ * the method that declares the parameters
+ * @param offset
+ * the offset to begin to copy
+ * @throws JavaModelException
+ */
+ @SuppressWarnings("unchecked")
+ private void appendInvocationParameters(BaseCallMessageSend baseCall, IMethod method, int offset) throws JavaModelException {
+ String[] names = method.getParameterNames();
+
+ for (int i = offset; i < names.length; i++) {
+ String name = names[i];
+ baseCall.getArguments().add(fBaseAST.newSimpleName(name));
+ }
+
+ }
+
+ @SuppressWarnings("rawtypes")
+ private ASTNode getParent(ASTNode node, Class parentClass) {
+ do {
+ node = node.getParent();
+ } while (node != null && !parentClass.isInstance(node));
+ return node;
+ }
+
+ private ASTNode typeToDeclaration(IType type, CompilationUnit node) throws JavaModelException {
+ Name result = (Name) NodeFinder.perform(node, type.getNameRange());
+ if (type.isAnonymous())
+ return getParent(result, AnonymousClassDeclaration.class);
+ return getParent(result, AbstractTypeDeclaration.class);
+ }
+
+ private ChildListPropertyDescriptor typeToBodyDeclarationProperty(IType type, CompilationUnit node) throws JavaModelException {
+ ASTNode result = typeToDeclaration(type, node);
+ if (result instanceof AbstractTypeDeclaration)
+ return ((AbstractTypeDeclaration) result).getBodyDeclarationsProperty();
+ else if (result instanceof AnonymousClassDeclaration)
+ return AnonymousClassDeclaration.BODY_DECLARATIONS_PROPERTY;
+
+ Assert.isTrue(false);
+ return null;
+ }
+
+ private ArrayList<IRoleType> findCandidateRoles() throws CoreException {
+ ArrayList<IRoleType> boundRoles = RefactoringUtil.getAllRolesForBase(fBaseType);
+ List<IRoleType> rolesToRemove = new ArrayList<IRoleType>();
+ for (IRoleType boundRole : boundRoles) {
+ if(!boundRole.exists() || boundRole.isReadOnly() || boundRole.isBinary()){
+ rolesToRemove.add(boundRole);
+ }
+ }
+ boundRoles.removeAll(rolesToRemove);
+ return boundRoles;
+ }
+
+ public IMethod[] getBoundBaseMethods() throws JavaModelException {
+ List<IMethod> boundBaseMethods = new ArrayList<IMethod>();
+ for (ICallinMapping mapping : fBoundCallinMappings) {
+ boundBaseMethods.addAll(Arrays.asList(mapping.getBoundBaseMethods()));
+ }
+ return boundBaseMethods.toArray(new IMethod[boundBaseMethods.size()]);
+ }
+
+ public List<ICallinMapping> getBoundCallinMappings() {
+ return fBoundCallinMappings;
+ }
+
+ public void setRoleMethodName(String name) {
+ fRoleMethodName = name;
+ }
+
+ private RefactoringStatus checkIfMethodExists() {
+ try {
+ if (methodWithNameExists(fRoleType, fRoleMethodName)) {
+ return RefactoringStatus.createErrorStatus(MessageFormat.format("A method with the same name already exists.", fRoleMethodName));
+ }
+ } catch (JavaModelException exception) {
+ return RefactoringStatus.createFatalErrorStatus("Could not perform the search for binding role types.");
+ }
+ return new RefactoringStatus();
+ }
+
+ private RefactoringStatus createCouldNotParseStatus() {
+ return RefactoringStatus.createFatalErrorStatus("Could not parse the declaring type.");
+ }
+
+ private boolean methodWithNameExists(IType type, String methodName) throws JavaModelException {
+ IMethod[] methods = type.getMethods();
+ for (IMethod method : methods) {
+ if (method.getElementName().equals(methodName))
+ return true;
+ }
+ return false;
+ }
+
+ @SuppressWarnings("unchecked")
+ public boolean isExtractBeforeAvailable() {
+ List<Statement> statements = fBaseMethodDeclaration.getBody().statements();
+ if (statements.isEmpty()) {
+ return false;
+ }
+ if(statements.get(0) instanceof ExpressionStatement
+ && ((ExpressionStatement) statements.get(0)).getExpression() instanceof MethodInvocation) {
+ MethodInvocation invocation = (MethodInvocation) ((ExpressionStatement) statements.get(0)).getExpression();
+ Expression receiver = invocation.getExpression();
+ boolean isSelfcall = false;
+ if (receiver == null) {
+ isSelfcall = true;
+ } else if (receiver instanceof ThisExpression) {
+ isSelfcall = ((ThisExpression)receiver).getQualifier() == null;
+ }
+ if (isSelfcall)
+ return !((IMethod)invocation.resolveMethodBinding().getJavaElement()).getDeclaringType().isBinary();
+ }
+ return false;
+ }
+
+ @SuppressWarnings("unchecked")
+ public boolean isExtractAfterAvailable() {
+ List<Statement> statements = fBaseMethodDeclaration.getBody().statements();
+ if (statements.isEmpty()) {
+ return false;
+ }
+ if (statements.get(statements.size() - 1) instanceof ExpressionStatement
+ && ((ExpressionStatement) statements.get(statements.size() - 1)).getExpression() instanceof MethodInvocation) {
+ MethodInvocation invocation = (MethodInvocation) ((ExpressionStatement) statements.get(statements.size() - 1)).getExpression();
+ if (((IMethod) invocation.resolveMethodBinding().getJavaElement()).getDeclaringType().equals(fBaseType)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ RefactoringStatus checkRoleMethodName() {
+ RefactoringStatus status = new RefactoringStatus();
+ status.merge(checkIfMethodExists());
+ status.merge(checkMethodName(fRoleMethodName));
+ return status;
+ }
+
+ private RefactoringStatus checkMethodName(String name) {
+ RefactoringStatus result = new RefactoringStatus();
+
+ if (name == null)
+ return RefactoringStatus.createFatalErrorStatus("No new role method name specified.");
+
+ if ("".equals(name)) //$NON-NLS-1$
+ return RefactoringStatus.createFatalErrorStatus("New role method name cannot be empty.");
+
+ IJavaProject javaProject = this.fRoleType.getJavaProject();
+ String sourceLevel= javaProject.getOption(JavaCore.COMPILER_SOURCE, true);
+ String complianceLevel= javaProject.getOption(JavaCore.COMPILER_COMPLIANCE, true);
+ IStatus status = JavaConventions.validateMethodName(name, sourceLevel, complianceLevel);
+ if (status.isOK())
+ return result;
+
+ switch (status.getSeverity()) {
+ case IStatus.ERROR:
+ return RefactoringStatus.createFatalErrorStatus(status.getMessage());
+ case IStatus.WARNING:
+ return RefactoringStatus.createWarningStatus(status.getMessage());
+ case IStatus.INFO:
+ return RefactoringStatus.createInfoStatus(status.getMessage());
+ default: // no nothing
+ return new RefactoringStatus();
+ }
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/otrefactorings/extractcallin/ExtractCallinWizard.java b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/otrefactorings/extractcallin/ExtractCallinWizard.java
new file mode 100644
index 000000000..3b1868654
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/otrefactorings/extractcallin/ExtractCallinWizard.java
@@ -0,0 +1,16 @@
+package org.eclipse.objectteams.otdt.internal.refactoring.otrefactorings.extractcallin;
+
+import org.eclipse.ltk.ui.refactoring.RefactoringWizard;
+
+public class ExtractCallinWizard extends RefactoringWizard {
+
+ public ExtractCallinWizard(ExtractCallinRefactoring refactoring, String pageTitle) {
+ super(refactoring, DIALOG_BASED_USER_INTERFACE | PREVIEW_EXPAND_FIRST_NODE);
+ setDefaultPageTitle(pageTitle);
+ }
+
+ @Override
+ protected void addUserInputPages() {
+ addPage(new ExtractCallinInputPage("ExtractCallinInputPage"));
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/otrefactorings/inlinecallin/CallinBaseMethodInfo.java b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/otrefactorings/inlinecallin/CallinBaseMethodInfo.java
new file mode 100644
index 000000000..86229135f
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/otrefactorings/inlinecallin/CallinBaseMethodInfo.java
@@ -0,0 +1,38 @@
+package org.eclipse.objectteams.otdt.internal.refactoring.otrefactorings.inlinecallin;
+
+import org.eclipse.jdt.core.IMethod;
+import org.eclipse.objectteams.otdt.core.ICallinMapping;
+
+/**
+ * @author Johannes Gebauer
+ *
+ */
+public class CallinBaseMethodInfo {
+
+ private IMethod _method;
+ private ICallinMapping _callinMapping;
+ private String _newMethodName;
+
+ public CallinBaseMethodInfo(IMethod _method, ICallinMapping mapping) {
+ super();
+ this._method = _method;
+ this._callinMapping = mapping;
+ }
+
+ public IMethod getMethod() {
+ return _method;
+ }
+
+ public ICallinMapping getCallinMapping() {
+ return _callinMapping;
+ }
+
+ public void setNewMethodName(String _newMethodName) {
+ this._newMethodName = _newMethodName;
+ }
+
+ public String getNewMethodName() {
+ return _newMethodName;
+ }
+
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/otrefactorings/inlinecallin/InlineCallinAction.java b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/otrefactorings/inlinecallin/InlineCallinAction.java
new file mode 100644
index 000000000..5730bb919
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/otrefactorings/inlinecallin/InlineCallinAction.java
@@ -0,0 +1,95 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2009 Johannes Gebauer and Stephan Herrmann.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: InlineCallinAction.java 23473 2010-02-05 19:46:08Z stephan $
+ *
+ * Please visit http://www.objectteams.org for updates and contact.
+ *
+ * Contributors:
+ * Johannes Gebauer - Initial API and implementation
+ * Stephan Herrmann - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.refactoring.otrefactorings.inlinecallin;
+
+import org.eclipse.jdt.core.IMethod;
+import org.eclipse.jdt.internal.ui.javaeditor.JavaEditor;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkbenchWindowActionDelegate;
+import org.eclipse.objectteams.otdt.core.ICallinMapping;
+import org.eclipse.objectteams.otdt.internal.refactoring.otrefactorings.AbstractCallinRefactoringAction;
+
+/**
+ * Action classes for the inline callin refactoring:
+ * <ul>
+ * <li>The toplevel class provides the action to the main menu bar (registered via plugin.xml).</li>
+ * <li>Inherited nested class {@link SelectionDispatchAction} provides the action to context menus of all views.</li>
+ * <li>Nested class {@link InlineCallinActionCommon} implements the shared stateful part of both actions.</li>
+ * </ul>
+ */
+@SuppressWarnings("restriction")
+public class InlineCallinAction extends AbstractCallinRefactoringAction implements IWorkbenchWindowActionDelegate
+{
+ /**
+ * Fill inherited class {@link CallinRefactoringActionCommon} with details.
+ */
+ class InlineCallinActionCommon extends CallinRefactoringActionCommon
+ {
+ InlineCallinActionCommon(JavaEditor editor) {
+ super(editor);
+ }
+
+ InlineCallinActionCommon(IWorkbenchWindow window) {
+ super(window);
+ }
+
+ protected void filterElements(Object[] elements) {
+ this.fJavaElement = null;
+ if (elements == null || elements.length != 1)
+ return;
+ else if (elements[0] instanceof IMethod)
+ this.fJavaElement = (IMethod) elements[0];
+ else if (elements[0] instanceof ICallinMapping)
+ this.fJavaElement = ((ICallinMapping)elements[0]).getRoleMethod();
+ }
+
+ protected void doRun() {
+ if (fJavaElement != null && fWindow != null) {
+ try {
+ new RefactoringWizardOpenOperation(
+ new InlineCallinWizard(
+ new InlineCallinRefactoring((IMethod)fJavaElement),
+ "Inline Callin"
+ )
+ ).run(fWindow.getShell(), "Inline Callin");
+ } catch (InterruptedException exception) {
+ // Do nothing
+ }
+ } else {
+ MessageDialog.openInformation(null, "Inline Callin", "Operation unavailable on the current selection. Select a callin-bound role method or a callin method binding");
+ }
+ }
+ }
+
+
+ // =========== Start InlineCallinAction ===========
+
+ public InlineCallinAction () {
+ super("Inline Callin ...", "Inline a callin-bound role meth.");
+ }
+
+ protected CallinRefactoringActionCommon createRefactoringActionCommon(IWorkbenchWindow window) {
+ return new InlineCallinActionCommon(window);
+ }
+
+ protected CallinRefactoringActionCommon createRefactoringActionCommon(JavaEditor editor) {
+ return new InlineCallinActionCommon(editor);
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/otrefactorings/inlinecallin/InlineCallinInputPage.java b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/otrefactorings/inlinecallin/InlineCallinInputPage.java
new file mode 100644
index 000000000..d533d0cfd
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/otrefactorings/inlinecallin/InlineCallinInputPage.java
@@ -0,0 +1,294 @@
+package org.eclipse.objectteams.otdt.internal.refactoring.otrefactorings.inlinecallin;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jdt.internal.ui.util.SWTUtil;
+import org.eclipse.jdt.internal.ui.util.TableLayoutComposite;
+import org.eclipse.jdt.ui.JavaElementLabelProvider;
+import org.eclipse.jface.viewers.ArrayContentProvider;
+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.ILabelProvider;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.TableLayout;
+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.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Image;
+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.Label;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.objectteams.otdt.core.ICallinMapping;
+
+@SuppressWarnings("restriction")
+public class InlineCallinInputPage extends UserInputWizardPage {
+
+
+ Text fNameField;
+
+ private CheckboxTableViewer fTableViewer;
+
+ private Label fLabel;
+
+ private Button fReferenceButton;
+
+ public InlineCallinInputPage(String name) {
+ super(name);
+ }
+
+ public void createControl(Composite parent) {
+ Composite result = new Composite(parent, SWT.NONE);
+
+ setControl(result);
+
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 2;
+ result.setLayout(layout);
+
+ Label label = new Label(result, SWT.NONE);
+ label.setText("&Inlined method name:");
+
+ fNameField = createNameField(result);
+
+ createMemberTableLabel(result);
+ createMemberTableComposite(result);
+
+ fReferenceButton = new Button(result, SWT.CHECK);
+ fReferenceButton.setEnabled(false);
+ fReferenceButton.setText("&Delete role method");
+ GridData data = new GridData(GridData.FILL_HORIZONTAL);
+ data.horizontalSpan = 2;
+ data.verticalIndent = 2;
+ fReferenceButton.setLayoutData(data);
+
+
+ final InlineCallinRefactoring refactoring = getInlineCallinRefactoring();
+ fNameField.setText(refactoring.getRoleMethod().getElementName());
+
+ fNameField.addModifyListener(new ModifyListener() {
+
+ public void modifyText(ModifyEvent event) {
+ handleInputChanged();
+ }
+ });
+
+ fReferenceButton.addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent event) {
+ refactoring.setDeleteRoleMethod(fReferenceButton.getSelection());
+ }
+ });
+
+ fNameField.setFocus();
+ fNameField.selectAll();
+ handleInputChanged();
+ fReferenceButton.setSelection(false);
+ }
+
+ private Text createNameField(Composite result) {
+ Text field = new Text(result, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
+ field.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ return field;
+ }
+
+ private InlineCallinRefactoring getInlineCallinRefactoring() {
+ return (InlineCallinRefactoring) getRefactoring();
+ }
+
+ void handleInputChanged() {
+ fReferenceButton.setEnabled(allBaseMethodSelected());
+
+ RefactoringStatus status = new RefactoringStatus();
+ InlineCallinRefactoring refactoring = getInlineCallinRefactoring();
+ refactoring.setRoleMethodName(fNameField.getText());
+ status.merge(refactoring.checkRoleMethodName());
+
+ setSelectedBaseMethods(refactoring);
+ status.merge(refactoring.checkBaseMethods());
+
+ setPageComplete(!status.hasError());
+ int severity = status.getSeverity();
+ String message = status.getMessageMatchingSeverity(severity);
+ if (severity >= RefactoringStatus.INFO) {
+ setMessage(message, severity);
+ } else {
+ setMessage("", NONE); //$NON-NLS-1$
+ }
+ }
+
+ private void setSelectedBaseMethods(InlineCallinRefactoring refactoring) {
+ CallinBaseMethodInfo[] baseMethodInfos = getTableInput();
+ List<CallinBaseMethodInfo> baseMethods = new ArrayList<CallinBaseMethodInfo>();
+ for (int i = 0; i < baseMethodInfos.length; i++) {
+ if (fTableViewer.getChecked(baseMethodInfos[i]))
+ baseMethods.add(baseMethodInfos[i]);
+ }
+ refactoring.setBaseMethods(baseMethods.toArray(new CallinBaseMethodInfo[baseMethods.size()]));
+ }
+
+ private CallinBaseMethodInfo[] getTableInput() {
+ return (CallinBaseMethodInfo[]) fTableViewer.getInput();
+ }
+
+ private boolean allBaseMethodSelected() {
+ boolean selected = true;
+ Object[] baseMethods = (Object[]) fTableViewer.getInput();
+ for (int i = 0; i < baseMethods.length; i++) {
+ selected = selected && fTableViewer.getChecked(baseMethods[i]);
+ }
+ return selected;
+ }
+
+ protected void createMemberTableLabel(final Composite parent) {
+ fLabel = new Label(parent, SWT.NONE);
+ fLabel.setText("&Select the bound base methods:");
+ final GridData data = new GridData();
+ data.horizontalSpan = 2;
+ fLabel.setLayoutData(data);
+ }
+
+ protected void createMemberTableComposite(final Composite parent) {
+ final Composite composite = new Composite(parent, SWT.NONE);
+ final GridData data = new GridData(GridData.FILL_BOTH);
+ data.horizontalSpan = 2;
+ composite.setLayoutData(data);
+ final GridLayout layout = new GridLayout();
+ layout.numColumns = 1;
+ layout.marginWidth = 0;
+ layout.marginHeight = 0;
+ composite.setLayout(layout);
+
+ createBaseMethodsTable(composite);
+ }
+
+ private void createBaseMethodsTable(final Composite parent) {
+ final TableLayoutComposite layouter = new TableLayoutComposite(parent, SWT.NONE);
+ layouter.addColumnData(new ColumnWeightData(60, true));
+ layouter.addColumnData(new ColumnWeightData(40, true));
+
+ final Table table = new Table(layouter, SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI | SWT.BORDER | SWT.FULL_SELECTION | SWT.CHECK);
+ table.setHeaderVisible(true);
+ table.setLinesVisible(true);
+
+ final GridData gd = new GridData(GridData.FILL_BOTH);
+ gd.heightHint = SWTUtil.getTableHeightHint(table, 10);
+ gd.widthHint = convertWidthInCharsToPixels(30);
+ layouter.setLayoutData(gd);
+
+ final TableLayout tableLayout = new TableLayout();
+ table.setLayout(tableLayout);
+
+ final TableColumn column0 = new TableColumn(table, SWT.NONE);
+ column0.setText("Base Method");
+
+ final TableColumn column1 = new TableColumn(table, SWT.NONE);
+ column1.setText("Callin Kind");
+
+ fTableViewer = new CheckboxTableViewer(table);
+ fTableViewer.setUseHashlookup(true);
+ fTableViewer.setContentProvider(new ArrayContentProvider());
+ fTableViewer.setLabelProvider(new BaseMethodInfoLabelProvider());
+ fTableViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+
+ public void selectionChanged(final SelectionChangedEvent event) {
+ handleInputChanged();
+ }
+ });
+ fTableViewer.addCheckStateListener(new ICheckStateListener() {
+
+ public void checkStateChanged(final CheckStateChangedEvent event) {
+ updateWizardPage(null, true);
+ }
+ });
+
+ setTableInput();
+ }
+
+ private static class BaseMethodInfoLabelProvider extends LabelProvider implements ITableLabelProvider {
+
+ private static final String BEFORE_LABEL = "Before";
+ private static final String AFTER_LABEL = "After";
+ private static final String REPLACE_LABEL = "Replace";
+
+ private static final int CALLIN_KIND_COLUMN = 1;
+ private static final int METHOD_COLUMN = 0;
+
+ private final ILabelProvider fLabelProvider = new JavaElementLabelProvider(JavaElementLabelProvider.SHOW_DEFAULT
+ | JavaElementLabelProvider.SHOW_SMALL_ICONS);
+
+ public void dispose() {
+ super.dispose();
+ fLabelProvider.dispose();
+ }
+
+ public Image getColumnImage(final Object element, final int columnIndex) {
+ final CallinBaseMethodInfo info = (CallinBaseMethodInfo) element;
+ switch (columnIndex) {
+ case METHOD_COLUMN:
+ return fLabelProvider.getImage(info.getMethod());
+ case CALLIN_KIND_COLUMN:
+ return null;
+ default:
+ return null;
+ }
+ }
+
+ public String getColumnText(final Object element, final int columnIndex) {
+ final CallinBaseMethodInfo info = (CallinBaseMethodInfo) element;
+ switch (columnIndex) {
+ case METHOD_COLUMN:
+ return fLabelProvider.getText(info.getMethod());
+ case CALLIN_KIND_COLUMN:
+ return createCallinLabel(info.getCallinMapping().getCallinKind());
+ default:
+ return null;
+ }
+ }
+
+ public String createCallinLabel(int callinKind) {
+ switch (callinKind) {
+ case ICallinMapping.KIND_BEFORE:
+ return BEFORE_LABEL;
+ case ICallinMapping.KIND_AFTER:
+ return AFTER_LABEL;
+ case ICallinMapping.KIND_REPLACE:
+ return REPLACE_LABEL;
+ default:
+ return null;
+ }
+ }
+ }
+
+ private CallinBaseMethodInfo[] getBaseMethodInfos() {
+ return getInlineCallinRefactoring().getBaseMethodInfos();
+ }
+
+ private void setTableInput() {
+ fTableViewer.setInput(getBaseMethodInfos());
+ }
+
+ private void updateWizardPage(final ISelection selection, final boolean displayErrors) {
+ fTableViewer.refresh();
+ if (selection != null) {
+ fTableViewer.getControl().setFocus();
+ fTableViewer.setSelection(selection);
+ }
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/otrefactorings/inlinecallin/InlineCallinRefactoring.java b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/otrefactorings/inlinecallin/InlineCallinRefactoring.java
new file mode 100644
index 000000000..8bbed68e5
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/otrefactorings/inlinecallin/InlineCallinRefactoring.java
@@ -0,0 +1,1550 @@
+package org.eclipse.objectteams.otdt.internal.refactoring.otrefactorings.inlinecallin;
+
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.Assert;
+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.SubProgressMonitor;
+import org.eclipse.jdt.core.Flags;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IField;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IMember;
+import org.eclipse.jdt.core.IMethod;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaConventions;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.core.Signature;
+import org.eclipse.jdt.core.dom.AST;
+import org.eclipse.jdt.core.dom.ASTNode;
+import org.eclipse.jdt.core.dom.ASTVisitor;
+import org.eclipse.jdt.core.dom.AbstractMethodMappingDeclaration;
+import org.eclipse.jdt.core.dom.AbstractTypeDeclaration;
+import org.eclipse.jdt.core.dom.AnonymousClassDeclaration;
+import org.eclipse.jdt.core.dom.Assignment;
+import org.eclipse.jdt.core.dom.BaseCallMessageSend;
+import org.eclipse.jdt.core.dom.Block;
+import org.eclipse.jdt.core.dom.CallinMappingDeclaration;
+import org.eclipse.jdt.core.dom.CalloutMappingDeclaration;
+import org.eclipse.jdt.core.dom.ChildListPropertyDescriptor;
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jdt.core.dom.Expression;
+import org.eclipse.jdt.core.dom.IBinding;
+import org.eclipse.jdt.core.dom.IExtendedModifier;
+import org.eclipse.jdt.core.dom.IMethodBinding;
+import org.eclipse.jdt.core.dom.ITypeBinding;
+import org.eclipse.jdt.core.dom.MethodDeclaration;
+import org.eclipse.jdt.core.dom.MethodInvocation;
+import org.eclipse.jdt.core.dom.MethodSpec;
+import org.eclipse.jdt.core.dom.Modifier;
+import org.eclipse.jdt.core.dom.ParameterMapping;
+import org.eclipse.jdt.core.dom.PrimitiveType;
+import org.eclipse.jdt.core.dom.ReturnStatement;
+import org.eclipse.jdt.core.dom.SimpleName;
+import org.eclipse.jdt.core.dom.SingleVariableDeclaration;
+import org.eclipse.jdt.core.dom.Statement;
+import org.eclipse.jdt.core.dom.Type;
+import org.eclipse.jdt.core.dom.VariableDeclarationFragment;
+import org.eclipse.jdt.core.dom.VariableDeclarationStatement;
+import org.eclipse.jdt.core.dom.Modifier.ModifierKeyword;
+import org.eclipse.jdt.core.dom.rewrite.ASTRewrite;
+import org.eclipse.jdt.core.dom.rewrite.ImportRewrite;
+import org.eclipse.jdt.core.dom.rewrite.ListRewrite;
+import org.eclipse.jdt.core.search.IJavaSearchConstants;
+import org.eclipse.jdt.core.search.IJavaSearchScope;
+import org.eclipse.jdt.core.search.SearchEngine;
+import org.eclipse.jdt.core.search.SearchMatch;
+import org.eclipse.jdt.core.search.SearchParticipant;
+import org.eclipse.jdt.core.search.SearchPattern;
+import org.eclipse.jdt.core.search.SearchRequestor;
+import org.eclipse.jdt.internal.corext.codemanipulation.StubUtility;
+import org.eclipse.jdt.internal.corext.refactoring.base.JavaStatusContext;
+import org.eclipse.jdt.internal.corext.refactoring.structure.ImportRewriteUtil;
+import org.eclipse.jdt.internal.corext.refactoring.structure.ReferenceFinderUtil;
+import org.eclipse.jdt.internal.corext.refactoring.util.RefactoringASTParser;
+import org.eclipse.jdt.internal.corext.util.Messages;
+import org.eclipse.jdt.ui.JavaElementLabels;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.eclipse.ltk.core.refactoring.CompositeChange;
+import org.eclipse.ltk.core.refactoring.Refactoring;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.eclipse.ltk.core.refactoring.TextFileChange;
+import org.eclipse.text.edits.MultiTextEdit;
+import org.eclipse.text.edits.TextEdit;
+import org.eclipse.text.edits.TextEditGroup;
+import org.eclipse.objectteams.otdt.core.ICallinMapping;
+import org.eclipse.objectteams.otdt.core.ICalloutMapping;
+import org.eclipse.objectteams.otdt.core.ICalloutToFieldMapping;
+import org.eclipse.objectteams.otdt.core.IMethodMapping;
+import org.eclipse.objectteams.otdt.core.IOTJavaElement;
+import org.eclipse.objectteams.otdt.core.IRoleType;
+import org.eclipse.objectteams.otdt.core.OTModelManager;
+import org.eclipse.objectteams.otdt.internal.refactoring.corext.rename.BaseCallFinder;
+import org.eclipse.objectteams.otdt.internal.refactoring.util.RefactoringUtil;
+
+@SuppressWarnings("restriction")
+public class InlineCallinRefactoring extends Refactoring {
+
+ private IMethod fRoleMethod;
+
+ private String fRoleMethodName;
+
+ private CallinBaseMethodInfo[] fCallinBaseMethodInfos;
+
+ private boolean fDeleteRoleMethod;
+
+ private CompilationUnit fRootBase;
+
+ private AST fBaseAST;
+
+ private ImportRewrite fBaseImportRewriter;
+
+ private ICompilationUnit fBaseCUnit;
+
+ private CallinBaseMethodInfo[] fTargetBaseMethods;
+
+ private ICompilationUnit fRoleCUnit;
+
+ private CompilationUnit fRootRole;
+
+ private AST fRoleAST;
+
+ private IType fRoleType;
+
+ private TextFileChange fBaseTextFileChange;
+
+ private TextFileChange fRoleTextFileChange;
+
+ private List<ICallinMapping> fBoundCallinMappings;
+
+ private IType fBaseType;
+
+ private ASTRewrite fBaseRewrite;
+
+ private ASTRewrite fRoleRewrite;
+
+ private Object fCachedBaseMethodInfo = null;
+
+ private Set<String> fCachedTunneledParameters = null;
+
+ public InlineCallinRefactoring() {
+ }
+
+ public InlineCallinRefactoring(IMethod roleMethod) {
+ fRoleMethod = roleMethod;
+ }
+
+ public InlineCallinRefactoring(IMethod roleMethod, ICallinMapping[] callinMapping, IMethod[] baseMethods) {
+ fBaseType = baseMethods[0].getDeclaringType();
+
+ List<CallinBaseMethodInfo> methodInfos = new ArrayList<CallinBaseMethodInfo>();
+ for (int i = 0; i < baseMethods.length; i++) {
+ methodInfos.add(new CallinBaseMethodInfo(baseMethods[i], callinMapping[i]));
+ }
+ setBaseMethods(methodInfos.toArray(new CallinBaseMethodInfo[methodInfos.size()]));
+
+ fRoleMethod = roleMethod;
+ }
+
+ public IMethod getRoleMethod() {
+ return fRoleMethod;
+ }
+
+ public IMethod[] getBoundBaseMethods() throws JavaModelException {
+ List<IMethod> boundBaseMethods = new ArrayList<IMethod>();
+ for (ICallinMapping mapping : fBoundCallinMappings) {
+ boundBaseMethods.addAll(Arrays.asList(mapping.getBoundBaseMethods()));
+ }
+ return boundBaseMethods.toArray(new IMethod[boundBaseMethods.size()]);
+ }
+
+ public List<ICallinMapping> getBoundCallinMappings() {
+ return fBoundCallinMappings;
+ }
+
+ @Override
+ public String getName() {
+ return "Inline Callin";
+ }
+
+ public void setRoleMethodName(String name) {
+ fRoleMethodName = name;
+ }
+
+ public CallinBaseMethodInfo[] getBaseMethodInfos() {
+ return fCallinBaseMethodInfos;
+ }
+
+ public void setBaseMethods(CallinBaseMethodInfo[] baseMethods) {
+ fTargetBaseMethods = baseMethods;
+ }
+
+ public void setDeleteRoleMethod(boolean deleteRoleMethod) {
+ fDeleteRoleMethod = deleteRoleMethod;
+ }
+
+ @Override
+ public RefactoringStatus checkInitialConditions(IProgressMonitor monitor) throws CoreException, OperationCanceledException {
+ RefactoringStatus status= new RefactoringStatus();
+
+ try {
+ monitor.beginTask("Checking preconditions...", 1);
+ if (fRoleMethod == null){
+ status.merge(RefactoringStatus.createFatalErrorStatus("Method has not been specified."));
+ }else if (!fRoleMethod.exists()){
+ status.merge(RefactoringStatus.createFatalErrorStatus(MessageFormat.format("Method ''{0}'' does not exist.", new Object[] { fRoleMethod
+ .getElementName() })));
+ }else if (fRoleMethod.isBinary()){
+ status.merge(RefactoringStatus.createFatalErrorStatus(MessageFormat.format("Method ''{0}'' is declared in a binary class file.", new Object[] { fRoleMethod
+ .getElementName() })));
+ }else if (fRoleMethod.isReadOnly()){
+ status.merge(RefactoringStatus.createFatalErrorStatus(MessageFormat.format("Method ''{0}'' is declared in a read-only class file.", new Object[] { fRoleMethod
+ .getElementName() })));
+ }else if (!fRoleMethod.getCompilationUnit().isStructureKnown()){
+ status.merge(RefactoringStatus.createFatalErrorStatus(MessageFormat.format("Compilation unit ''{0}'' contains compile errors.",
+ new Object[] { fRoleMethod.getCompilationUnit().getElementName() })));
+ } else if (!RefactoringUtil.isRoleMethod(fRoleMethod)) {
+ status.merge(RefactoringStatus.createFatalErrorStatus(MessageFormat.format("The selected method ''{0}'' is not declared in a role.",
+ new Object[] { fRoleMethod.getElementName() })));
+ }else{
+ status.merge(initialize(monitor));
+ }
+ } finally {
+ monitor.done();
+ }
+ return status;
+ }
+
+ private RefactoringStatus initialize(IProgressMonitor monitor) {
+ RefactoringStatus status = new RefactoringStatus();
+ fRoleMethodName = fRoleMethod.getElementName();
+ fRoleType = fRoleMethod.getDeclaringType();
+ fRoleCUnit = fRoleMethod.getCompilationUnit();
+
+ if (fRootRole == null) {
+ fRootRole = RefactoringASTParser.parseWithASTProvider(fRoleCUnit, true, new SubProgressMonitor(monitor, 99));
+ }
+
+ fRoleAST = fRootRole.getAST();
+
+ try {
+ IType baseType = ((IRoleType) OTModelManager.getOTElement(fRoleMethod.getDeclaringType())).getBaseClass();
+ if (baseType.isBinary()) {
+ status.merge(RefactoringStatus.createFatalErrorStatus("Base class "+baseType.getElementName()+" is a binary type, cannot modify."));
+ return status;
+ }
+ if(baseType.isReadOnly()){
+ status.merge(RefactoringStatus.createFatalErrorStatus("Base class "+baseType.getElementName()+" is read-only, cannot modify."));
+ return status;
+ }
+ if (baseType != null) {
+ fBaseType = baseType;
+ fBaseCUnit = baseType.getCompilationUnit();
+
+ if (fRootBase == null) {
+ fRootBase = RefactoringASTParser.parseWithASTProvider(fBaseCUnit, true, new SubProgressMonitor(monitor, 99));
+ }
+
+ fBaseImportRewriter = StubUtility.createImportRewrite(fRootBase, true);
+ fBaseAST = fRootBase.getAST();
+ } else {
+ status.merge(RefactoringStatus.createFatalErrorStatus("The declaring role class is not bound to a base class."));
+ }
+ } catch (JavaModelException e) {
+ status.merge(createCouldNotParseStatus());
+ }
+ if (status.hasFatalError()) {
+ return status;
+ }
+
+ IMethodMapping[] callinMappings = ((IRoleType) OTModelManager.getOTElement(fRoleType)).getMethodMappings(IRoleType.CALLINS);
+
+ fBoundCallinMappings = new ArrayList<ICallinMapping>();
+
+ for (int i = 0; i < callinMappings.length; i++) {
+ if (callinMappings[i].getRoleMethod().equals(fRoleMethod)) {
+ fBoundCallinMappings.add((ICallinMapping) callinMappings[i]);
+ }
+ }
+
+ if (fBoundCallinMappings.size() == 0) {
+ status.merge(RefactoringStatus.createFatalErrorStatus(MessageFormat.format(
+ "The selected method ''{0}'' is not bound on the left hand side of a callin method binding.", new Object[] { fRoleMethod
+ .getElementName() })));
+ }
+
+ List<CallinBaseMethodInfo> infos = new ArrayList<CallinBaseMethodInfo>();
+
+ for (ICallinMapping mapping : fBoundCallinMappings) {
+ try {
+ for (IMethod method : mapping.getBoundBaseMethods()) {
+ infos.add(new CallinBaseMethodInfo(method, mapping));
+ }
+ fCallinBaseMethodInfos = infos.toArray(new CallinBaseMethodInfo[infos.size()]);
+ } catch (JavaModelException e) {
+ status.merge(RefactoringStatus.createFatalErrorStatus("Could not parse the method mappings."));
+ }
+ }
+ return status;
+ }
+
+ @Override
+ public RefactoringStatus checkFinalConditions(IProgressMonitor pm) throws CoreException, OperationCanceledException {
+ RefactoringStatus status = new RefactoringStatus();
+
+ status.merge(checkBaseMethods());
+
+ if (status.hasFatalError()) {
+ return status;
+ }
+
+ status.merge(generateNewBaseMethodNames());
+
+ status.merge(checkRoleMethodName());
+
+ status.merge(checkDependenciesToRole(pm));
+
+ status.merge(checkRoleMethodReferences(pm));
+
+ return status;
+ }
+
+ private RefactoringStatus checkRoleMethodReferences(IProgressMonitor pm) throws CoreException {
+ // search all references for the role method
+ final Set<SearchMatch> references = new HashSet<SearchMatch>();
+ IJavaSearchScope scope = SearchEngine.createWorkspaceScope();
+ SearchPattern pattern = SearchPattern.createPattern(fRoleMethod, IJavaSearchConstants.REFERENCES, SearchPattern.R_EXACT_MATCH);
+ SearchEngine engine = new SearchEngine();
+ engine.search(pattern, new SearchParticipant[] { SearchEngine.getDefaultSearchParticipant() }, scope, new SearchRequestor() {
+ @Override
+ public void acceptSearchMatch(SearchMatch match) throws CoreException {
+ if (match.getAccuracy() == SearchMatch.A_ACCURATE && !match.isInsideDocComment()) {
+ references.add(match);
+ }
+ }
+ }, pm);
+
+ RefactoringStatus status = new RefactoringStatus();
+
+ List<ICallinMapping> inlinedCallins = new ArrayList<ICallinMapping>();
+ for (int i = 0; i < fCallinBaseMethodInfos.length; i++) {
+ inlinedCallins.add(fCallinBaseMethodInfos[i].getCallinMapping());
+ }
+
+ for (SearchMatch match : references) {
+ Object element= match.getElement();
+ if (element instanceof ICallinMapping) {
+ ICallinMapping mapping = (ICallinMapping) element;
+ if(mapping.getRoleMethod().equals(fRoleMethod)){
+ if(inlinedCallins.contains(mapping)){
+ continue;
+ }
+ } else {
+ status.addError(Messages.format("The Role Method ''{0}'' is bound in a callin binding and cannot be inlined.", new String[] { fRoleMethod
+ .getElementName() }));
+ continue;
+ }
+ }
+
+ if (element instanceof ICalloutMapping) {
+ status.addError(Messages.format("The Role Method ''{0}'' is bound in a callout binding and cannot be inlined.", new String[] { fRoleMethod
+ .getElementName() }));
+ continue;
+ }
+
+ if (fDeleteRoleMethod) {
+ if (element instanceof IMember) {
+ // try to create context informations for the search result
+ IMember referencingMember = (IMember) element;
+ String msg = Messages.format("The Role Method ''{0}'' is referenced by ''{1}'' and cannot be deleted.", new String[] {
+ fRoleMethod.getElementName(), JavaElementLabels.getTextLabel(referencingMember, JavaElementLabels.ALL_FULLY_QUALIFIED) });
+ status.addError(msg, JavaStatusContext.create(referencingMember));
+ } else {
+ status.addError(Messages.format("The Role Method ''{0}'' is referenced and cannot be deleted.",
+ new String[] { fRoleMethod.getElementName() }));
+ }
+ }
+ }
+ return status;
+ }
+
+ private RefactoringStatus checkMethodName(String name) {
+ RefactoringStatus result = new RefactoringStatus();
+
+ if (name == null)
+ return RefactoringStatus.createFatalErrorStatus("No new role method name specified.");
+
+ if ("".equals(name)) //$NON-NLS-1$
+ return RefactoringStatus.createFatalErrorStatus("New role method name cannot be empty.");
+
+ IJavaProject javaProject = this.fRoleType.getJavaProject();
+ String sourceLevel= javaProject.getOption(JavaCore.COMPILER_SOURCE, true);
+ String complianceLevel= javaProject.getOption(JavaCore.COMPILER_COMPLIANCE, true);
+ IStatus status = JavaConventions.validateMethodName(name, sourceLevel, complianceLevel);
+ if (status.isOK())
+ return result;
+
+ switch (status.getSeverity()) {
+ case IStatus.ERROR:
+ return RefactoringStatus.createFatalErrorStatus(status.getMessage());
+ case IStatus.WARNING:
+ return RefactoringStatus.createWarningStatus(status.getMessage());
+ case IStatus.INFO:
+ return RefactoringStatus.createInfoStatus(status.getMessage());
+ default: // no nothing
+ return new RefactoringStatus();
+ }
+ }
+
+ private RefactoringStatus checkIfMethodExists() {
+ try {
+ if (methodWithNameExists(fBaseType, fRoleMethodName)){
+ return RefactoringStatus.createErrorStatus(MessageFormat.format("A method with the same name already exists.", fRoleMethodName));
+ }
+ } catch (JavaModelException exception) {
+ return createCouldNotParseStatus();
+ }
+ return new RefactoringStatus();
+ }
+
+ private RefactoringStatus checkDependenciesToRole(IProgressMonitor pm) throws JavaModelException {
+ RefactoringStatus status = new RefactoringStatus();
+
+ IMethod[] referencedMethods = ReferenceFinderUtil.getMethodsReferencedIn(new IJavaElement[] { fRoleMethod }, null /* owner */, new SubProgressMonitor(pm,
+ 1));
+ for (int i = 0; i < referencedMethods.length; i++) {
+ IMethod referencedMethod = referencedMethods[i];
+ if (referencedMethod.getDeclaringType().equals(fRoleType)) {
+ status.merge(RefactoringStatus.createErrorStatus(MessageFormat.format("The method to inline ''{0}'' references the role method ''{1}''.",
+ fRoleMethodName, referencedMethod)));
+ }
+ }
+
+ IField[] referencedFileds = ReferenceFinderUtil.getFieldsReferencedIn(new IJavaElement[] { fRoleMethod }, null /* owner */, new SubProgressMonitor(pm,
+ 1));
+ for (int i = 0; i < referencedFileds.length; i++) {
+ IField referencedFiled = referencedFileds[i];
+ if (referencedFiled.getDeclaringType().equals(fRoleType)) {
+ status.merge(RefactoringStatus.createErrorStatus(MessageFormat.format("The method to inline ''{0}'' references the role field ''{1}''.",
+ fRoleMethodName, referencedFiled)));
+ }
+ }
+ return status;
+ }
+
+ RefactoringStatus checkRoleMethodName() {
+ RefactoringStatus status = new RefactoringStatus();
+ status.merge(checkIfMethodExists());
+ status.merge(checkMethodName(fRoleMethodName));
+ return status;
+ }
+
+ RefactoringStatus checkBaseMethods() {
+ RefactoringStatus status = new RefactoringStatus();
+ if (fTargetBaseMethods == null || fTargetBaseMethods.length == 0) {
+ status.merge(RefactoringStatus.createFatalErrorStatus("No base method selected."));
+ }
+ return status;
+ }
+
+ private boolean methodWithNameExists(IType type, String methodName) throws JavaModelException {
+ IMethod[] methods = type.getMethods();
+ for (IMethod method : methods) {
+ if (method.getElementName().equals(methodName))
+ return true;
+ }
+ return false;
+ }
+
+ private RefactoringStatus createCouldNotParseStatus() {
+ return RefactoringStatus.createFatalErrorStatus("Could not parse the declaring type.");
+ }
+
+ @Override
+ public Change createChange(IProgressMonitor pm) throws CoreException, OperationCanceledException {
+ pm.beginTask("Creating Change", fCallinBaseMethodInfos.length + 2);
+ inlineCallin(pm);
+ Change change = new CompositeChange(getName(), new TextFileChange[] { fBaseTextFileChange, fRoleTextFileChange });
+ pm.done();
+ return change;
+ }
+
+ @SuppressWarnings("unchecked")
+ private void inlineCallin(IProgressMonitor pm) throws CoreException {
+ fBaseRewrite = ASTRewrite.create(fBaseAST);
+ fRoleRewrite = ASTRewrite.create(fRoleAST);
+
+ for (int i = 0; i < fTargetBaseMethods.length; i++) {
+
+ IMethod baseMethod = fTargetBaseMethods[i].getMethod();
+ CallinBaseMethodInfo methodInfo = fTargetBaseMethods[i];
+ renameBaseMethod(methodInfo);
+ MethodDeclaration wrapperMethodDeclaration = createWrapperMethod(methodInfo);
+ Statement roleMethodInvocation = createRoleMethodInvocation(methodInfo);
+ List<Statement> statements = wrapperMethodDeclaration.getBody().statements();
+
+ // change the strategy for the different mapping kinds
+ switch (methodInfo.getCallinMapping().getCallinKind()) {
+ case ICallinMapping.KIND_BEFORE:
+ statements.add(0, roleMethodInvocation);
+ break;
+ case ICallinMapping.KIND_AFTER:
+ // TODO check for result parameter mappings
+ if (!baseMethod.getReturnType().equals(Character.toString(Signature.C_VOID))) {
+ // remove the base method invocation
+ statements.clear();
+
+ // insert local variable statement to save the return value
+ // of
+ // the base method invocation
+ MethodDeclaration baseMethodDeclaration = RefactoringUtil.methodToDeclaration(baseMethod, fRootBase);
+ String varName = generateResultVarName(methodInfo);
+ VariableDeclarationFragment fragment = fBaseAST.newVariableDeclarationFragment();
+ fragment.setName(fBaseAST.newSimpleName(varName));
+ fragment.setInitializer(createBaseMethodInvocation(methodInfo));
+ VariableDeclarationStatement variableDeclarationStatement = fBaseAST.newVariableDeclarationStatement(fragment);
+ variableDeclarationStatement.setType((Type) ASTNode.copySubtree(fBaseAST, baseMethodDeclaration.getReturnType2()));
+ statements.add(variableDeclarationStatement);
+
+ // invoke the role method
+ statements.add(roleMethodInvocation);
+
+ // return the stored return value
+ ReturnStatement returnStatement = fBaseAST.newReturnStatement();
+ returnStatement.setExpression(fBaseAST.newSimpleName(varName));
+ statements.add(returnStatement);
+ } else {
+ statements.add(roleMethodInvocation);
+ }
+ break;
+ case ICallinMapping.KIND_REPLACE:
+ statements.clear();
+ statements.add(roleMethodInvocation);
+ break;
+ default:
+ break;
+ }
+
+ insertMethodIntoBase(wrapperMethodDeclaration, baseMethod);
+ pm.worked(1);
+ }
+
+ adjustMethodMappings();
+ pm.worked(1);
+
+ copyRoleMethodToBase(fTargetBaseMethods[0]);
+ pm.worked(1);
+
+ if (fDeleteRoleMethod) {
+ deleteRoleMethod();
+ }
+
+ // create the text change for the base
+ MultiTextEdit baseMultiEdit = new MultiTextEdit();
+ baseMultiEdit.addChild(fBaseRewrite.rewriteAST());
+ fBaseTextFileChange = new TextFileChange(fBaseCUnit.getElementName(), (IFile) fBaseCUnit.getResource());
+ fBaseTextFileChange.setTextType("java");
+ fBaseTextFileChange.setEdit(baseMultiEdit);
+
+ if (fBaseImportRewriter.hasRecordedChanges()) {
+ TextEdit edit = fBaseImportRewriter.rewriteImports(null);
+ baseMultiEdit.addChild(edit);
+ fBaseTextFileChange.addTextEditGroup(new TextEditGroup("Organize Imports", new TextEdit[] { edit }));
+ }
+
+ // create the text change for the role
+ MultiTextEdit roleMultiEdit = new MultiTextEdit();
+ roleMultiEdit.addChild(fRoleRewrite.rewriteAST());
+ fRoleTextFileChange = new TextFileChange(fRoleCUnit.getElementName(), (IFile) fRoleCUnit.getResource());
+ fRoleTextFileChange.setTextType("java");
+ fRoleTextFileChange.setEdit(roleMultiEdit);
+ }
+
+
+ /**
+ * Renames the given base method to the name given in the info object.
+ *
+ * @param baseMethodInfo
+ * the info object containing the base method and the new base
+ * method name
+ * @throws JavaModelException
+ */
+ private void renameBaseMethod(CallinBaseMethodInfo baseMethodInfo) throws JavaModelException {
+ ASTNode baseMethodDeclaration = RefactoringUtil.methodToDeclaration(baseMethodInfo.getMethod(), fRootBase);
+ fBaseRewrite.set(baseMethodDeclaration, MethodDeclaration.NAME_PROPERTY, fBaseAST.newSimpleName(baseMethodInfo.getNewMethodName()), null);
+ }
+
+ /**
+ * Creates the method declaration for the wrapper method with the old base
+ * method name.
+ *
+ * @param baseMethodInfo
+ * the info object containing the base method and the new base
+ * method name
+ * @return the generated wrapper method declaration
+ * @throws CoreException
+ */
+ private MethodDeclaration createWrapperMethod(CallinBaseMethodInfo baseMethodInfo) throws CoreException {
+ MethodDeclaration baseMethodDeclaration = RefactoringUtil.methodToDeclaration(baseMethodInfo.getMethod(), fRootBase);
+ MethodDeclaration methodDeclaration = (MethodDeclaration) ASTNode.copySubtree(fBaseAST, baseMethodDeclaration);
+ methodDeclaration.setBody(createMethodBody(baseMethodInfo));
+ return methodDeclaration;
+ }
+
+ /**
+ * Creates the method body for the wrapper method that maps the inlined
+ * method binding.
+ *
+ * @param baseMethodInfo
+ * the info object containing the base method and the new base
+ * method name
+ * @return the method body
+ * @throws JavaModelException
+ */
+ @SuppressWarnings("unchecked")
+ private Block createMethodBody(CallinBaseMethodInfo baseMethodInfo) throws JavaModelException {
+ Block block = fBaseAST.newBlock();
+ List<Statement> statements = block.statements();
+ MethodInvocation invocation = createBaseMethodInvocation(baseMethodInfo);
+
+ // create a return statement for the base method invocation if necessary
+ MethodDeclaration declaration = RefactoringUtil.methodToDeclaration(baseMethodInfo.getMethod(), fRootBase);
+ final Type type = declaration.getReturnType2();
+ if (type == null || (type instanceof PrimitiveType && PrimitiveType.VOID.equals(((PrimitiveType) type).getPrimitiveTypeCode()))) {
+ statements.add(invocation.getAST().newExpressionStatement(invocation));
+ } else {
+ ReturnStatement statement = invocation.getAST().newReturnStatement();
+ statement.setExpression(invocation);
+ statements.add(statement);
+ }
+ return block;
+ }
+
+ /**
+ * Removes the base methods from the inlined method mappings. If all bound
+ * base methods of a binding are removed, the whole mapping will be deleted.
+ * The change is performed on the given <code>ASTRewrite</code>.
+ *
+ * @param rewrite
+ * the rewrite that notes the changes
+ * @throws JavaModelException
+ */
+ @SuppressWarnings("unchecked")
+ private void adjustMethodMappings() throws JavaModelException {
+
+ // create a map that gathers multiple methods for the same callin mapping
+ Map<IMethod, ICallinMapping> methodToMapping = new HashMap<IMethod, ICallinMapping>();
+ for (int i = 0; i < fTargetBaseMethods.length; i++) {
+ methodToMapping.put(fTargetBaseMethods[i].getMethod(), fTargetBaseMethods[i].getCallinMapping());
+ }
+
+ for (ICallinMapping callinMapping : methodToMapping.values()) {
+ Collection<IMethod> baseMethodsToRemove = methodToMapping.keySet();
+
+ // search the current callin mapping in the ast
+ CallinMappingDeclaration methodMappingDecl = (CallinMappingDeclaration) RefactoringUtil.methodMappingToDeclaration(callinMapping, fRootRole);
+
+ if (baseMethodsToRemove.containsAll(Arrays.asList(callinMapping.getBoundBaseMethods()))) {
+ // if all bound base methods should be removed the remove the
+ // method mapping
+ fRoleRewrite.remove(methodMappingDecl, null);
+
+ } else {
+ // otherwise remove the references to the base methods from the
+ // mapping
+ CallinMappingDeclaration mappingDeclaration = methodMappingDecl;
+ List<MethodSpec> baseMethods = mappingDeclaration.getBaseMappingElements();
+ for (MethodSpec methodSpec : baseMethods) {
+ for (IMethod method : baseMethodsToRemove) {
+ IMethodBinding methodBinding = methodSpec.resolveBinding();
+ IMethod boundMethod = (IMethod) methodBinding.getJavaElement();
+ if (method.equals(boundMethod)) {
+ // TODO remove unused imports
+ fRoleRewrite.remove(methodSpec, null);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ private void deleteRoleMethod() throws JavaModelException {
+ // TODO remove unused imports
+ AbstractTypeDeclaration declaration = (AbstractTypeDeclaration) RefactoringUtil.typeToDeclaration(fRoleType, fRootRole);
+ ChildListPropertyDescriptor descriptor = typeToBodyDeclarationProperty(fBaseType, fRootBase);
+ MethodDeclaration roleMethodDecl = RefactoringUtil.methodToDeclaration(fRoleMethod, fRootRole);
+ fRoleRewrite.getListRewrite(declaration, descriptor).remove(roleMethodDecl, null);
+ }
+
+ private boolean hasResultTunneling(CallinBaseMethodInfo baseMethodInfo) throws JavaModelException {
+ // only replace callins can have result tunneling
+ if (baseMethodInfo.getCallinMapping().getCallinKind() != ICallinMapping.KIND_REPLACE) {
+ return false;
+ }
+
+ // only base methods with return types can produce result tunneling
+ if (isVoidMethod(baseMethodInfo.getMethod())) {
+ return false;
+ }
+
+ // only role methods without a return type can produce result tunneling
+ if (!isVoidMethod(fRoleMethod)) {
+ return false;
+ }
+
+ if (hasResultParameterMapping(baseMethodInfo.getCallinMapping())) {
+ return false;
+ }
+
+ return true;
+ }
+
+
+ @SuppressWarnings("unchecked")
+ private boolean hasResultParameterMapping(ICallinMapping callinMapping) throws JavaModelException {
+ if (!hasParameterMapping(callinMapping)) {
+ return false;
+ }
+ AbstractMethodMappingDeclaration mappingDecl = RefactoringUtil.methodMappingToDeclaration(callinMapping, fRootRole);
+ List<ParameterMapping> parameterMappings = mappingDecl.getParameterMappings();
+ for (ParameterMapping parameterMapping : parameterMappings) {
+ if (parameterMapping.hasResultFlag()) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private Statement createRoleMethodInvocation(CallinBaseMethodInfo baseMethodInfo) throws JavaModelException {
+ MethodInvocation invocation = fBaseAST.newMethodInvocation();
+ ICallinMapping callinMapping = baseMethodInfo.getCallinMapping();
+
+ invocation.setName(fBaseAST.newSimpleName(fRoleMethodName));
+
+ CallinMappingDeclaration callinMappingDecl = (CallinMappingDeclaration) RefactoringUtil.methodMappingToDeclaration(callinMapping, fRootRole);
+ if (hasParameterMapping(callinMapping)) {
+ copyRoleParameterMappingsToInvocation(invocation, callinMappingDecl, baseMethodInfo);
+ } else {
+ copyInvocationParameters(invocation, baseMethodInfo.getMethod());
+ }
+ if (needsReturnStatement(baseMethodInfo)) {
+ ReturnStatement statement = invocation.getAST().newReturnStatement();
+ statement.setExpression(invocation);
+ return statement;
+ } else {
+ return invocation.getAST().newExpressionStatement(invocation);
+ }
+ }
+
+ private boolean needsReturnStatement(CallinBaseMethodInfo baseMethodInfo) throws JavaModelException {
+ if (isReplace(baseMethodInfo)) {
+ return !isVoidMethod(baseMethodInfo.getMethod());
+ } else {
+ return !(isVoidMethod(fRoleMethod) || isVoidMethod(baseMethodInfo.getMethod()));
+ }
+ }
+
+ private boolean isVoidMethod(IMethod method) throws JavaModelException {
+ return method.getReturnType().equals(Character.toString(Signature.C_VOID));
+ }
+
+ @SuppressWarnings("unchecked")
+ private void copyRoleParameterMappingsToInvocation(MethodInvocation invocation, CallinMappingDeclaration callinMappingDecl,
+ CallinBaseMethodInfo baseMethodInfo)
+ throws JavaModelException {
+ MethodSpec baseMethodSpec = findBaseMethodSpec(callinMappingDecl, baseMethodInfo.getMethod());
+
+ List<SingleVariableDeclaration> baseMappingParams = baseMethodSpec.parameters();
+
+ // create a map that maps the original param names of the base method to
+ // the param names used in the mapping
+ Map<String, String> callinParamNamesToBaseMethodParamNames = new HashMap<String, String>();
+ String[] names = baseMethodInfo.getMethod().getParameterNames();
+ for (int i = 0; i < names.length; i++) {
+ callinParamNamesToBaseMethodParamNames.put(baseMappingParams.get(i).getName().getIdentifier(), names[i]);
+ }
+
+ List<ParameterMapping> paramMappings = callinMappingDecl.getParameterMappings();
+ MethodSpec roleMethodSpec = (MethodSpec) callinMappingDecl.getRoleMappingElement();
+ List<SingleVariableDeclaration> roleMappingParams = roleMethodSpec.parameters();
+
+
+ for (SingleVariableDeclaration singleVariableDeclaration : roleMappingParams) {
+ String paramName = singleVariableDeclaration.getName().getIdentifier();
+ for (ParameterMapping mapping : paramMappings) {
+ if (mapping.hasResultFlag())
+ continue;
+ if (mapping.getIdentifier().getIdentifier().equals(paramName)) {
+ Expression expr = (Expression) ASTNode.copySubtree(fBaseAST, mapping.getExpression());
+ substituteBaseParams(expr, callinParamNamesToBaseMethodParamNames, baseMethodInfo);
+ invocation.arguments().add(expr);
+ }
+ }
+ }
+
+
+ if (isReplace(baseMethodInfo)) {
+ Set<String> tunneledParams = findTunneledParameters(baseMethodInfo);
+ // replace tunneled parameters in base method invocations
+ for (String paramName : tunneledParams) {
+ String tunneledName = generateTunneledParamName(paramName);
+ invocation.arguments().add(fBaseAST.newSimpleName(tunneledName));
+ }
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ private void copyBaseParameterMappingsToInvocation(MethodInvocation invocation, CallinMappingDeclaration callinMappingDecl,
+ CallinBaseMethodInfo baseMethodInfo) throws JavaModelException {
+ MethodSpec roleMethodSpec = (MethodSpec) callinMappingDecl.getRoleMappingElement();
+ List<SingleVariableDeclaration> roleMappingParams = roleMethodSpec.parameters();
+
+ // create a map that maps the original param names of the role method to
+ // the param names used in the mapping
+ Map<String, String> callinParamNamesToRoleMethodParamNames = new HashMap<String, String>();
+ String[] roleParamNames = fRoleMethod.getParameterNames();
+ for (int i = 0; i < roleParamNames.length; i++) {
+ callinParamNamesToRoleMethodParamNames.put(roleMappingParams.get(i).getName().getIdentifier(), roleParamNames[i]);
+ }
+
+ List<ParameterMapping> paramMappings = callinMappingDecl.getParameterMappings();
+ MethodSpec baseMethodSpec = findBaseMethodSpec(callinMappingDecl, baseMethodInfo.getMethod());
+ List<SingleVariableDeclaration> baseMappingParams = baseMethodSpec.parameters();
+
+ // create a map that maps the original param names of the base method to
+ // the param names used in the mapping
+ Map<String, String> callinParamNamesToBaseMethodParamNames = new HashMap<String, String>();
+ String[] baseParamNames = baseMethodInfo.getMethod().getParameterNames();
+ for (int i = 0; i < baseParamNames.length; i++) {
+ callinParamNamesToBaseMethodParamNames.put(baseMappingParams.get(i).getName().getIdentifier(), baseParamNames[i]);
+ }
+
+ Map<String, Expression> baseParamToExpression = new HashMap<String, Expression>();
+
+
+ for (SingleVariableDeclaration singleVariableDeclaration : baseMappingParams) {
+ String paramName = singleVariableDeclaration.getName().getIdentifier();
+ for (ParameterMapping mapping : paramMappings) {
+ if (mapping.hasResultFlag())
+ continue;
+ if (mapping.getExpression() instanceof SimpleName) {
+ SimpleName mappedName = (SimpleName) mapping.getExpression();
+ if (mappedName.getIdentifier().equals(paramName)) {
+ // resolve the original param names because param names
+ // in the mapping can be different
+ String roleMethodIdentifier = callinParamNamesToRoleMethodParamNames.get(mapping.getIdentifier().getIdentifier());
+ String baseMethodIdentifier = callinParamNamesToBaseMethodParamNames.get(paramName);
+ baseParamToExpression.put(baseMethodIdentifier, fBaseAST.newSimpleName(roleMethodIdentifier));
+ // base parameters can only be mapped once �4.4.(b)
+ continue;
+ }
+ }
+ }
+ }
+
+ // pass the right statement for each base param
+ for (String name : baseParamNames) {
+ if(baseParamToExpression.get(name) == null){
+ String tunneledName = generateTunneledParamName(name);
+ invocation.arguments().add(fBaseAST.newSimpleName(tunneledName));
+ }else{
+ // pass the simple name of the mapped role method parameter
+ invocation.arguments().add(baseParamToExpression.get(name));
+ }
+ }
+
+ if (isReplace(baseMethodInfo)) {
+
+ // parameter mappings are handled differently because they depend on
+ // the mapping
+ if (!hasParameterMapping(baseMethodInfo.getCallinMapping())) {
+ // if the role method doesn't declare the same number of
+ // parameters
+ // as the base method, the parameters have to be appended
+ int roleMethodParameterLength = baseMethodInfo.getCallinMapping().getRoleMethod().getParameterNames().length;
+ int baseMethodParameterLength = baseMethodInfo.getMethod().getParameterNames().length;
+ if (roleMethodParameterLength < baseMethodParameterLength) {
+ appendInvocationParameters(invocation, baseMethodInfo.getMethod(), roleMethodParameterLength);
+ }
+ }
+ }
+ }
+
+ private void substituteBaseParams(Expression expr, Map<String, String> callinParamNamesToBaseMethodParamNames, CallinBaseMethodInfo baseMethodInfo)
+ throws JavaModelException {
+ ArrayList<String> callinParamNames = new ArrayList<String>();
+ for (String name : callinParamNamesToBaseMethodParamNames.keySet()) {
+ callinParamNames.add(name);
+ }
+ SimpleNameFinder simpleNameFinder = new SimpleNameFinder(callinParamNames);
+ expr.accept(simpleNameFinder);
+ List<SimpleName> simpleNames = simpleNameFinder.getResult();
+ for (SimpleName simpleName : simpleNames) {
+ String baseMethodParamName = callinParamNamesToBaseMethodParamNames.get(simpleName.getIdentifier());
+ simpleName.setIdentifier(baseMethodParamName);
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ private Set<String> findTunneledParameters(CallinBaseMethodInfo baseMethodInfo)
+ throws JavaModelException {
+ // try to reuse cached result
+ if (fCachedBaseMethodInfo == baseMethodInfo) {
+ return fCachedTunneledParameters;
+ }
+ fCachedBaseMethodInfo = baseMethodInfo;
+ Set<String> tunneledParams = new HashSet<String>();
+ CallinMappingDeclaration callinMappingDecl = (CallinMappingDeclaration) RefactoringUtil.methodMappingToDeclaration(baseMethodInfo.getCallinMapping(),
+ fRootRole);
+ MethodSpec baseMethodSpec = findBaseMethodSpec(callinMappingDecl, baseMethodInfo.getMethod());
+
+ List<SingleVariableDeclaration> baseMappingParams = baseMethodSpec.parameters();
+
+ // create a map that maps the original param names of the base method to
+ // the param names used in the mapping
+ Map<String, String> baseMethodParamNameToBaseMappingParamName = new HashMap<String, String>();
+ String[] names = baseMethodInfo.getMethod().getParameterNames();
+ for (int i = 0; i < names.length; i++) {
+ baseMethodParamNameToBaseMappingParamName.put(names[i], baseMappingParams.get(i).getName().getIdentifier());
+ }
+
+ List<ParameterMapping> paramMappings = callinMappingDecl.getParameterMappings();
+ tunneledParams.addAll(Arrays.asList(baseMethodInfo.getMethod().getParameterNames()));
+ for (int i = 0; i < names.length; i++) {
+ for (ParameterMapping mapping : paramMappings) {
+ if (mapping.hasResultFlag())
+ continue;
+ Expression expr = (Expression) mapping.getExpression();
+ if (expr instanceof SimpleName) {
+ SimpleName simpleName = (SimpleName) expr;
+ if (simpleName.getIdentifier().equals(baseMethodParamNameToBaseMappingParamName.get(names[i]))) {
+ tunneledParams.remove(names[i]);
+ }
+ }
+ }
+ }
+ fCachedTunneledParameters = tunneledParams;
+ return fCachedTunneledParameters;
+ }
+
+ /**
+ * Copies the invocation parameter of the given base method to the given
+ * method invocation.
+ *
+ * @param invocation
+ * the method invocation to receive the parameters
+ * @param method
+ * the method that declares the parameters
+ * @throws JavaModelException
+ */
+ @SuppressWarnings("unchecked")
+ private void copyInvocationParameters(MethodInvocation invocation, IMethod method) throws JavaModelException {
+ String[] names = method.getParameterNames();
+ for (String element : names)
+ invocation.arguments().add(fBaseAST.newSimpleName(element));
+ }
+
+ /**
+ * Copies the role method to the base class and creates store variables for
+ * implicit result tunneling. If the role method was a callin method, base
+ * methods are replaced by method invocations to the new method name,
+ * specified in <code>baseMethodInfo</code>.
+ *
+ * @param rewrite
+ * the rewrite that notes the changes
+ * @param baseMethodInfo
+ * the info object containing the base method, callin mapping,
+ * and the new base method name
+ * @throws JavaModelException
+ */
+ private void copyRoleMethodToBase(CallinBaseMethodInfo baseMethodInfo) throws JavaModelException {
+ ASTNode roleMethodDeclaration = RefactoringUtil.methodToDeclaration(fRoleMethod, fRootRole);
+ MethodDeclaration copyOfRoleMethodDeclaration = (MethodDeclaration) ASTNode.copySubtree(fBaseAST, roleMethodDeclaration);
+ copyOfRoleMethodDeclaration.setName(fBaseAST.newSimpleName(fRoleMethodName));
+
+ // change the visibility of the copy to private to avoid overriding and
+ // hide the role method
+ if (!Flags.isPrivate(fRoleMethod.getFlags()) && !Flags.isCallin(fRoleMethod.getFlags()))
+ changeToPrivateVisibility(fBaseRewrite, copyOfRoleMethodDeclaration);
+
+ // special treatment for replace mappings/callin methods
+ if (Flags.isCallin(fRoleMethod.getFlags())) {
+ handleCallinMethod(fBaseRewrite, baseMethodInfo, copyOfRoleMethodDeclaration);
+ }
+
+ if ((isReplace(baseMethodInfo))) {
+ if (hasParameterMapping(baseMethodInfo.getCallinMapping())) {
+ // append parameters that are tunneled because of a missing
+ // parameter mapping �4.4.(b)
+ appendTunneledParameterDeclarations(baseMethodInfo, copyOfRoleMethodDeclaration);
+ } else {
+ // if a callin method doesn't declare the same number of
+ // parameters
+ // as the base method, the parameters have to be appended
+ int roleMethodParameterLength = baseMethodInfo.getCallinMapping().getRoleMethod().getParameterNames().length;
+ int baseMethodParameterLength = baseMethodInfo.getMethod().getParameterNames().length;
+ if (roleMethodParameterLength < baseMethodParameterLength) {
+ appendParameterDeclarations(copyOfRoleMethodDeclaration, baseMethodInfo.getMethod(), roleMethodParameterLength);
+ }
+ }
+ }
+
+ findAndReplaceCallouts(fBaseRewrite, copyOfRoleMethodDeclaration);
+
+ insertMethodIntoBase(copyOfRoleMethodDeclaration, baseMethodInfo.getMethod());
+
+ // oragnize imports
+ Set<IBinding> staticImports = new HashSet<IBinding>();
+ Set<ITypeBinding> imports = new HashSet<ITypeBinding>();
+ ImportRewriteUtil.collectImports(fRoleMethod.getJavaProject(), roleMethodDeclaration, imports, staticImports, false);
+ for (ITypeBinding typeBinding : imports) {
+ fBaseImportRewriter.addImport(typeBinding);
+ }
+ for (IBinding binding : staticImports) {
+ fBaseImportRewriter.addStaticImport(binding);
+ }
+ }
+
+ /**
+ * Replaces <code>public</code> and <code>protected</code> by a
+ * <code>private</code> modifier. If the method has default visibility
+ * <code>private</code> modifier will be prepended to the modifier list.
+ *
+ * @param rewrite
+ * the rewrite that notes the changes
+ * @param methodDeclaration
+ * the method declaration to be changed
+ */
+ @SuppressWarnings("unchecked")
+ private void changeToPrivateVisibility(ASTRewrite astRewrite, MethodDeclaration methodDeclaration) {
+ Modifier privateVisibility = methodDeclaration.getAST().newModifier(ModifierKeyword.PRIVATE_KEYWORD);
+
+ List<IExtendedModifier> modifiers = methodDeclaration.modifiers();
+ for (IExtendedModifier extendedModifier : modifiers) {
+ if (extendedModifier instanceof Modifier) {
+ Modifier modifier = (Modifier) extendedModifier;
+ if (Modifier.isPublic(modifier.getKeyword().toFlagValue())) {
+ astRewrite.replace(modifier, privateVisibility, null);
+ return;
+ }
+ if (Modifier.isProtected(modifier.getKeyword().toFlagValue())) {
+ astRewrite.replace(modifier, privateVisibility, null);
+ return;
+ }
+ if (Modifier.isPrivate(modifier.getKeyword().toFlagValue())) {
+ // don't replace private modifiers or create a 2nd private
+ // modifier
+ return;
+ }
+ }
+ }
+ // no visibility modifier was found => default visibility will be
+ // reduced to private
+ astRewrite.getListRewrite(methodDeclaration, MethodDeclaration.MODIFIERS2_PROPERTY).insertFirst(privateVisibility, null);
+ }
+
+ /**
+ * Handles special cases for callin methods like result tunneling and base
+ * call replacement.
+ *
+ * @param rewrite
+ * the rewrite that notes the changes
+ * @param baseMethodInfo
+ * the info object containing the base method, callin mapping,
+ * and the new base method name
+ * @param methodDeclaration
+ * the method declaration node of the role method
+ * @throws JavaModelException
+ */
+ @SuppressWarnings("unchecked")
+ private void handleCallinMethod(ASTRewrite astRewrite, CallinBaseMethodInfo baseMethodInfo, MethodDeclaration methodDeclaration)
+ throws JavaModelException {
+ List<Statement> statements = methodDeclaration.getBody().statements();
+ removeCallinFlag(methodDeclaration);
+
+ if (fRoleMethod.getReturnType().equals(Character.toString(Signature.C_VOID))) {
+ ReturnFinder returnFinder = new ReturnFinder();
+ methodDeclaration.accept(returnFinder);
+ List<ReturnStatement> returns = returnFinder.getResult();
+ for (ReturnStatement returnStatement : returns) {
+ astRewrite.replace(returnStatement, fBaseAST.newReturnStatement(), null);
+ }
+ }
+
+ if (hasResultTunneling(baseMethodInfo)) {
+ String varName = generateResultVarName(baseMethodInfo);
+ VariableDeclarationFragment fragment = fBaseAST.newVariableDeclarationFragment();
+ fragment.setName(fBaseAST.newSimpleName(varName));
+ VariableDeclarationStatement variableDeclarationStatement = fBaseAST.newVariableDeclarationStatement(fragment);
+ MethodDeclaration baseMethodDeclaration = RefactoringUtil.methodToDeclaration(baseMethodInfo.getMethod(), fRootBase);
+ variableDeclarationStatement.setType((Type) ASTNode.copySubtree(fBaseAST, baseMethodDeclaration.getReturnType2()));
+ statements.add(0, variableDeclarationStatement);
+
+
+ // return the stored return value
+ ReturnStatement returnStatement = fBaseAST.newReturnStatement();
+ returnStatement.setExpression(fBaseAST.newSimpleName(varName));
+ statements.add(returnStatement);
+
+ substituteBaseCalls(methodDeclaration, astRewrite, varName, baseMethodInfo);
+
+ } else if(hasResultParameterMapping(baseMethodInfo.getCallinMapping())
+ && isVoidMethod(fRoleMethod)) {
+ // replace callins may define a result mapping if they don't have a
+ // return value
+ AbstractMethodMappingDeclaration mappingDecl = RefactoringUtil.methodMappingToDeclaration(baseMethodInfo.getCallinMapping(), fRootRole);
+ List<ParameterMapping> parameterMappings = mappingDecl.getParameterMappings();
+ Expression resultMappingExpression = null;
+ for (ParameterMapping parameterMapping : parameterMappings) {
+ if (parameterMapping.hasResultFlag()) {
+ resultMappingExpression = (Expression) parameterMapping.getExpression();
+ }
+ }
+
+ // return the mapped return value
+ ReturnStatement returnStatement = fBaseAST.newReturnStatement();
+ returnStatement.setExpression((Expression) ASTNode.copySubtree(fBaseAST, resultMappingExpression));
+ statements.add(returnStatement);
+ substituteBaseCalls(methodDeclaration, astRewrite, null /* localStoreVarIdentifier */, baseMethodInfo);
+ } else {
+ substituteBaseCalls(methodDeclaration, astRewrite, null /* localStoreVarIdentifier */, baseMethodInfo);
+ }
+
+ Modifier privateVisibility = fBaseAST.newModifier(ModifierKeyword.PRIVATE_KEYWORD);
+ methodDeclaration.modifiers().add(privateVisibility);
+
+ // callin methods need the same return type as the base method
+ // after inlining
+ MethodDeclaration declaration = RefactoringUtil.methodToDeclaration(baseMethodInfo.getMethod(), fRootBase);
+ methodDeclaration.setReturnType2((Type) ASTNode.copySubtree(fBaseAST, declaration.getReturnType2()));
+ }
+
+ /**
+ * Removes a callin modifier from the given <code>MethodDeclaration</code>.
+ *
+ * @param methodDeclaration
+ * the method declaration to remove the callin modifier from
+ * @return true if a callin modifier was removed - otherwise false
+ */
+ @SuppressWarnings("unchecked")
+ private boolean removeCallinFlag(MethodDeclaration methodDeclaration) {
+ List<IExtendedModifier> modifiers = methodDeclaration.modifiers();
+
+ for (IExtendedModifier extendedModifier : modifiers) {
+ if (extendedModifier instanceof Modifier) {
+ Modifier modifier = (Modifier) extendedModifier;
+ if (Modifier.isCallin(modifier.getKeyword().toFlagValue())) {
+ modifier.delete();
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Substitutes base calls in the body of a callin method by method
+ * invocations to the method specified in baseMethodInfo. If a identifier
+ * for a local variable is given, the method invocations will be assigned to
+ * it.
+ *
+ * @param methodDeclaration
+ * the method declaration containing the base calls
+ * @param rewrite
+ * the rewrite that notes the changes
+ * @param localStoreVarIdentifier
+ * the name of a return store variable - <code>null</code> if no
+ * return value must be stored
+ * @param baseMethodInfo
+ * the info object containing the base method and the new base
+ * method name
+ * @throws JavaModelException
+ */
+ private void substituteBaseCalls(MethodDeclaration methodDeclaration, ASTRewrite astRewrite, String localStoreVarIdentifier,
+ CallinBaseMethodInfo baseMethodInfo)
+ throws JavaModelException {
+ BaseCallFinder baseCallFinder = new BaseCallFinder();
+ methodDeclaration.accept(baseCallFinder);
+ BaseCallMessageSend[] baseCalls = baseCallFinder.getResult();
+
+ if (localStoreVarIdentifier != null) {
+ // create assignment statements if a store identifier exist
+ for (int i = 0; i < baseCalls.length; i++) {
+ BaseCallMessageSend basecall = baseCalls[i];
+
+ Assignment assignment = fBaseAST.newAssignment();
+ assignment.setLeftHandSide(fBaseAST.newSimpleName(localStoreVarIdentifier));
+ assignment.setRightHandSide(createBaseMethodInvocation(baseMethodInfo));
+
+ astRewrite.replace(basecall, assignment, null);
+ }
+ } else {
+ // substitute the base calls with a simple base call
+ for (int i = 0; i < baseCalls.length; i++) {
+ BaseCallMessageSend basecall = baseCalls[i];
+ astRewrite.replace(basecall, createBaseMethodInvocation(baseMethodInfo), null);
+ }
+ }
+ }
+
+ private void findAndReplaceCallouts(ASTRewrite astRewrite, MethodDeclaration copyOfRoleMethodDeclaration) throws JavaModelException {
+ MethodInvocationFinder methodInvocationFinder = new MethodInvocationFinder();
+ copyOfRoleMethodDeclaration.accept(methodInvocationFinder);
+ List<MethodInvocation> methodInvocations = methodInvocationFinder.getResult();
+ IMethodMapping[] calloutMappings = ((IRoleType) OTModelManager.getOTElement(fRoleType)).getMethodMappings(IRoleType.CALLOUTS);
+
+ Map<String, IMethodMapping> calloutNameToMapping = new HashMap<String, IMethodMapping>();
+ for (IMethodMapping methodMapping : calloutMappings) {
+ if(methodMapping instanceof ICalloutMapping){
+ ICalloutMapping calloutMapping = (ICalloutMapping)methodMapping;
+ calloutNameToMapping.put(calloutMapping.getRoleMethodHandle().getSelector(), calloutMapping);
+
+ }
+ if(methodMapping instanceof ICalloutToFieldMapping){
+ ICalloutToFieldMapping calloutToFieldMapping = (ICalloutToFieldMapping)methodMapping;
+ calloutNameToMapping.put(calloutToFieldMapping.getRoleMethodHandle().getSelector(), calloutToFieldMapping);
+ }
+ }
+
+ for (MethodInvocation invocation : methodInvocations) {
+ IMethodMapping mapping = calloutNameToMapping.get(invocation.getName().getIdentifier());
+ if(mapping == null){
+ continue;
+ }
+ // TODO Parameter mappings
+ switch (mapping.getMappingKind()) {
+ case IOTJavaElement.CALLOUT_MAPPING:
+ ICalloutMapping calloutMapping = (ICalloutMapping)mapping;
+ invocation.setName(fBaseAST.newSimpleName(calloutMapping.getBoundBaseMethod().getElementName()));
+ break;
+ case IOTJavaElement.CALLOUT_TO_FIELD_MAPPING:
+ ICalloutToFieldMapping calloutToFieldMapping = (ICalloutToFieldMapping)mapping;
+ CalloutMappingDeclaration calloutDecl = (CalloutMappingDeclaration) RefactoringUtil.methodMappingToDeclaration(calloutToFieldMapping, fRootRole);
+ String fieldName = calloutToFieldMapping.getBoundBaseField().getElementName();
+ if (Modifier.isSet(calloutDecl.bindingOperator().getBindingModifier())) {
+ // set
+ Assignment setAssignment = fBaseAST.newAssignment();
+ setAssignment.setLeftHandSide(fBaseAST.newSimpleName(fieldName));
+ Expression setExpression = (Expression) ASTNode.copySubtree(fBaseAST, (Expression) invocation.arguments().get(0));
+ setAssignment.setRightHandSide(setExpression);
+ astRewrite.replace(invocation, setAssignment, null);
+ } else {
+ // get
+ astRewrite.replace(invocation, fBaseAST.newSimpleName(fieldName), null);
+ }
+
+
+ break;
+ default:
+ break;
+ }
+ }
+ }
+
+ private MethodInvocation createBaseMethodInvocation(CallinBaseMethodInfo baseMethodInfo) throws JavaModelException {
+ MethodInvocation invocation = fBaseAST.newMethodInvocation();
+ invocation.setName(fBaseAST.newSimpleName(baseMethodInfo.getNewMethodName()));
+
+
+ if (isReplace(baseMethodInfo)) {
+ // parameter mappings are handled differently because they depend on
+ // the mapping
+ if (!hasParameterMapping(baseMethodInfo.getCallinMapping())) {
+ // replace callins call the method within the role method body
+ copyInvocationParameters(invocation, baseMethodInfo.getCallinMapping().getRoleMethod());
+ // if the role method doesn't declare the same number of
+ // parameters as the base method, the parameters have to be
+ // appended
+ int roleMethodParameterLength = baseMethodInfo.getCallinMapping().getRoleMethod().getParameterNames().length;
+ int baseMethodParameterLength = baseMethodInfo.getMethod().getParameterNames().length;
+ if (roleMethodParameterLength < baseMethodParameterLength) {
+ appendInvocationParameters(invocation, baseMethodInfo.getMethod(), roleMethodParameterLength);
+ }
+ } else {
+ CallinMappingDeclaration callinMappingDecl = (CallinMappingDeclaration) RefactoringUtil.methodMappingToDeclaration(baseMethodInfo
+ .getCallinMapping(), fRootRole);
+ copyBaseParameterMappingsToInvocation(invocation, callinMappingDecl, baseMethodInfo);
+ }
+ } else {
+ // replace and after callins call the base method within the wrapper
+ // method of the role
+ copyInvocationParameters(invocation, baseMethodInfo.getMethod());
+ }
+
+
+ return invocation;
+ }
+
+ private boolean isReplace(CallinBaseMethodInfo baseMethodInfo) {
+ return baseMethodInfo.getCallinMapping().getCallinKind() == ICallinMapping.KIND_REPLACE;
+ }
+
+ private boolean hasParameterMapping(IMethodMapping mapping) throws JavaModelException {
+ AbstractMethodMappingDeclaration decl = RefactoringUtil.methodMappingToDeclaration(mapping, fRootRole);
+ return decl.hasParameterMapping();
+ }
+
+ private void insertMethodIntoBase(MethodDeclaration methodDeclaration, IMethod baseMethod) throws JavaModelException {
+ AbstractTypeDeclaration declaration = (AbstractTypeDeclaration) RefactoringUtil.typeToDeclaration(fBaseType, fRootBase);
+ ChildListPropertyDescriptor descriptor = typeToBodyDeclarationProperty(fBaseType, fRootBase);
+ MethodDeclaration baseMethodDeclaration = RefactoringUtil.methodToDeclaration(baseMethod, fRootBase);
+ fBaseRewrite.getListRewrite(declaration, descriptor).insertBefore(methodDeclaration, baseMethodDeclaration, null);
+ }
+
+
+
+ /**
+ * Appends the parameter declarations from the given <code>baseMethod</code>
+ * to the end of the parameter list of the given
+ * <code>roleMethodDeclaration</code>, starting at the given
+ * <code>offset</code>. This method is used if the role method declares
+ * fewer parameters than the base method.
+ *
+ * @param roleMethodDeclaration
+ * the method declaration of the copied role method
+ * @param baseMethod
+ * the base method to copy the parameter declarations from
+ * @param offset
+ * the offset to start
+ * @throws JavaModelException
+ */
+ @SuppressWarnings("unchecked")
+ private void appendParameterDeclarations(MethodDeclaration roleMethodDeclaration, IMethod baseMethod, int offset) throws JavaModelException {
+ MethodDeclaration baseMethodDecl = RefactoringUtil.methodToDeclaration(baseMethod, fRootBase);
+ List<SingleVariableDeclaration> baseParamDeclarations = baseMethodDecl.parameters();
+ for (int i = offset; i < baseParamDeclarations.size(); i++) {
+ SingleVariableDeclaration paramDecl = (SingleVariableDeclaration) ASTNode.copySubtree(fBaseAST, baseParamDeclarations.get(i));
+
+ // generate a parameter name that does not produce a name clash
+ List<String> localVarNames = new ArrayList<String>();
+ localVarNames.addAll(localVarNamesInRoleMethod());
+ localVarNames.addAll(Arrays.asList(fRoleMethod.getParameterNames()));
+ String validParameterName = generateVarName(paramDecl.getName().getIdentifier(), localVarNames);
+ paramDecl.setName(fBaseAST.newSimpleName(validParameterName));
+ fBaseRewrite.getListRewrite(roleMethodDeclaration, MethodDeclaration.PARAMETERS_PROPERTY).insertLast(paramDecl, null);
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ private void appendTunneledParameterDeclarations(CallinBaseMethodInfo baseMethodInfo, MethodDeclaration copyOfRoleMethodDeclaration)
+ throws JavaModelException {
+ // append tunneled parameters to roleMethodSignature
+ Set<String> tunneledParams = findTunneledParameters(baseMethodInfo);
+ // replace tunneled parameters in base method invocations
+ MethodDeclaration baseMethodDecl = RefactoringUtil.methodToDeclaration(baseMethodInfo.getMethod(), fRootBase);
+ List<SingleVariableDeclaration> baseParamDeclarations = baseMethodDecl.parameters();
+ ListRewrite listRewrite = fBaseRewrite.getListRewrite(copyOfRoleMethodDeclaration, MethodDeclaration.PARAMETERS_PROPERTY);
+ for (SingleVariableDeclaration varDecl : baseParamDeclarations) {
+ String paramName = varDecl.getName().getIdentifier();
+ if (tunneledParams.contains(paramName)) {
+ String tunneledName = generateTunneledParamName(paramName);
+ SingleVariableDeclaration paramDecl = (SingleVariableDeclaration) ASTNode.copySubtree(fBaseAST, varDecl);
+ paramDecl.setName(fBaseAST.newSimpleName(tunneledName));
+ listRewrite.insertLast(paramDecl, null);
+ }
+ }
+ }
+
+ /**
+ * Appends invocation parameter names from the given method from the given
+ * offset. This method is used to extend base method calls if the role
+ * method declares fewer parameters than the base method.
+ *
+ * @param invocation
+ * the method invocation to receive the parameters
+ * @param method
+ * the method that declares the parameters
+ * @param offset
+ * the offset to begin to copy
+ * @throws JavaModelException
+ */
+ @SuppressWarnings("unchecked")
+ private void appendInvocationParameters(MethodInvocation invocation, IMethod method, int offset) throws JavaModelException {
+ String[] names = method.getParameterNames();
+
+ for (int i = offset; i < names.length; i++) {
+ String name = names[i];
+
+ // generate a valid parameter name to prevent name clashes
+ List<String> localVarNames = new ArrayList<String>();
+ localVarNames.addAll(localVarNamesInRoleMethod());
+ localVarNames.addAll(Arrays.asList(fRoleMethod.getParameterNames()));
+ String validParameterName = generateVarName(name, localVarNames);
+ invocation.arguments().add(fBaseAST.newSimpleName(validParameterName));
+ }
+ }
+
+ private RefactoringStatus generateNewBaseMethodNames() {
+ try {
+ generateBaseMethodNames(fTargetBaseMethods);
+ } catch (JavaModelException e) {
+ return createCouldNotParseStatus();
+ }
+ return new RefactoringStatus();
+ }
+
+ private String generateResultVarName(CallinBaseMethodInfo baseMethodInfo) throws JavaModelException {
+ String name = "baseResult";
+ List<String> paramNames = Arrays.asList(baseMethodInfo.getMethod().getParameterNames());
+ return generateVarName(name, paramNames);
+ }
+
+ /**
+ * Generates a name for a parameter or local variable that does not produce
+ * name clashes with a base field, a parameter name or a local variable
+ * name. If there are no name clashes, the method returns the desired name,
+ * otherwise it returns the desired name with an appended number.
+ *
+ * @param desiredName
+ * the name to be checked
+ * @param localVarNames
+ * list of local variable names
+ * @return a name that does not produce a name clash
+ */
+ private String generateVarName(String desiredName, List<String> localVarNames) {
+ String varName = desiredName;
+
+ int i = 2;
+ while (fBaseType.getField(varName).exists() || localVarNames.contains(varName)) {
+ varName = desiredName + i;
+ i++;
+ }
+ return varName;
+ }
+
+ private void generateBaseMethodNames(CallinBaseMethodInfo[] baseMethodInfos) throws JavaModelException {
+ for (int i = 0; i < baseMethodInfos.length; i++) {
+ String newBaseName = "base_" + fTargetBaseMethods[i].getMethod().getElementName();
+ int j = 2;
+ while (methodWithNameExists(fBaseType, newBaseName)) {
+ newBaseName = "base_" + fTargetBaseMethods[i].getMethod().getElementName() + j;
+ j++;
+ }
+ baseMethodInfos[i].setNewMethodName(newBaseName);
+ }
+ }
+
+ private String generateTunneledParamName(String identifier) throws JavaModelException {
+ String upperCasedName = identifier.substring(0, 1).toUpperCase() + identifier.substring(1);
+ List<String> localVarNames = new ArrayList<String>();
+ localVarNames.addAll(localVarNamesInRoleMethod());
+ localVarNames.addAll(Arrays.asList(fRoleMethod.getParameterNames()));
+ String tunneledName = generateVarName("tunneled" + upperCasedName, localVarNames);
+ return tunneledName;
+ }
+
+ private List<String> localVarNamesInRoleMethod() throws JavaModelException {
+ List<String> localVars = new ArrayList<String>();
+ MethodDeclaration declaration = RefactoringUtil.methodToDeclaration(fRoleMethod, fRootRole);
+ LocalVariableFinder localVariableFinder = new LocalVariableFinder();
+ declaration.accept(localVariableFinder);
+ localVars = localVariableFinder.getResult();
+ return localVars;
+ }
+
+ @SuppressWarnings("unchecked")
+ private MethodSpec findBaseMethodSpec(CallinMappingDeclaration callinMappingDecl, IMethod baseMethod) {
+ MethodSpec baseMethodSpec = null;
+ List<MethodSpec> methodSpecs = callinMappingDecl.getBaseMappingElements();
+ for (MethodSpec methodSpec : methodSpecs) {
+ IMethodBinding methodBinding = methodSpec.resolveBinding();
+ IMethod method = (IMethod) methodBinding.getJavaElement();
+ if (method.equals(baseMethod)) {
+ baseMethodSpec = methodSpec;
+ }
+ }
+ return baseMethodSpec;
+ }
+
+ private ChildListPropertyDescriptor typeToBodyDeclarationProperty(IType type, CompilationUnit node) throws JavaModelException {
+ ASTNode result = RefactoringUtil.typeToDeclaration(type, node);
+ if (result instanceof AbstractTypeDeclaration)
+ return ((AbstractTypeDeclaration) result).getBodyDeclarationsProperty();
+ else if (result instanceof AnonymousClassDeclaration)
+ return AnonymousClassDeclaration.BODY_DECLARATIONS_PROPERTY;
+
+ Assert.isTrue(false);
+ return null;
+ }
+
+ private class LocalVariableFinder extends ASTVisitor {
+
+ private List<String> _locals = new ArrayList<String>();
+
+ @Override
+ public boolean visit(VariableDeclarationFragment node) {
+ _locals.add(node.getName().getIdentifier());
+ return false;
+ }
+
+ public List<String> getResult() {
+ return _locals;
+ }
+ }
+
+ private class SimpleNameFinder extends ASTVisitor {
+
+ private List<SimpleName> _simpleNames = new ArrayList<SimpleName>();
+ private List<String> _identifier;
+
+ public SimpleNameFinder(List<String> identifier) {
+ _identifier = identifier;
+ }
+
+ @Override
+ public boolean visit(SimpleName node) {
+ if (_identifier.contains(node.getIdentifier())) {
+ _simpleNames.add(node);
+ }
+ return false;
+ }
+
+ public List<SimpleName> getResult() {
+ return _simpleNames;
+ }
+ }
+
+ private class MethodInvocationFinder extends ASTVisitor {
+
+ private List<MethodInvocation> _methodInvocations = new ArrayList<MethodInvocation>();
+
+ @Override
+ public boolean visit(MethodInvocation node) {
+ _methodInvocations.add(node);
+ return false;
+ }
+
+ public List<MethodInvocation> getResult() {
+ return _methodInvocations;
+ }
+ }
+
+ private class ReturnFinder extends ASTVisitor {
+
+ private List<ReturnStatement> _returns = new ArrayList<ReturnStatement>();
+
+ @Override
+ public boolean visit(ReturnStatement node) {
+ _returns.add(node);
+ return false;
+ }
+
+ public List<ReturnStatement> getResult() {
+ return _returns;
+ }
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/otrefactorings/inlinecallin/InlineCallinWizard.java b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/otrefactorings/inlinecallin/InlineCallinWizard.java
new file mode 100644
index 000000000..2b603f2fc
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/otrefactorings/inlinecallin/InlineCallinWizard.java
@@ -0,0 +1,16 @@
+package org.eclipse.objectteams.otdt.internal.refactoring.otrefactorings.inlinecallin;
+
+import org.eclipse.ltk.ui.refactoring.RefactoringWizard;
+
+public class InlineCallinWizard extends RefactoringWizard {
+
+ public InlineCallinWizard(InlineCallinRefactoring refactoring, String pageTitle) {
+ super(refactoring, DIALOG_BASED_USER_INTERFACE | PREVIEW_EXPAND_FIRST_NODE);
+ setDefaultPageTitle(pageTitle);
+ }
+
+ @Override
+ protected void addUserInputPages() {
+ addPage(new InlineCallinInputPage("InlineCallinInputPage"));
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/util/IAmbuguityMessageCreator.java b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/util/IAmbuguityMessageCreator.java
new file mode 100644
index 000000000..76e979066
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/util/IAmbuguityMessageCreator.java
@@ -0,0 +1,19 @@
+package org.eclipse.objectteams.otdt.internal.refactoring.util;
+
+/**
+ *
+ * This Interface is used for call back objects to provide refactoring specific
+ * error messages concerning ambiguity.
+ *
+ * @author Johannes Gebauer
+ */
+public interface IAmbuguityMessageCreator {
+
+ /**
+ * Creates an ambiguous method specifier error message.
+ *
+ * @return a refactoring specific message for an abmigious method specifier.
+ */
+ public String createAmbiguousMethodSpecifierMsg();
+
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/util/IOverloadingMessageCreator.java b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/util/IOverloadingMessageCreator.java
new file mode 100644
index 000000000..e881fab88
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/util/IOverloadingMessageCreator.java
@@ -0,0 +1,19 @@
+package org.eclipse.objectteams.otdt.internal.refactoring.util;
+
+/**
+ *
+ * This Interface is used for call back objects to provide refactoring specific
+ * error messages concerning overloading.
+ *
+ * @author Johannes Gebauer
+ */
+public interface IOverloadingMessageCreator {
+
+ /**
+ * Creates a refactoring specific message for overloading warnings.
+ *
+ * @return a refactoring specific message for overloading.
+ */
+ public String createOverloadingMessage();
+
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/util/ITeamConstants.java b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/util/ITeamConstants.java
new file mode 100644
index 000000000..a491b2c5e
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/util/ITeamConstants.java
@@ -0,0 +1,66 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2007, 2009 Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: ITeamConstants.java 23473 2010-02-05 19:46:08Z stephan $
+ *
+ * Please visit http://www.objectteams.org for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.refactoring.util;
+
+import org.eclipse.jdt.core.Signature;
+
+/**
+ * @author svacina
+ *
+ * Constants for class org.objectteams.Team
+ */
+@SuppressWarnings("nls")
+public interface ITeamConstants
+{
+ /**
+ * constants for class team:
+ * - virtualTeamMethodNames: Names of virtual team methods (_OT$ methods excluded)
+ * - virtualTeamMethodParamTypes: parameter types of virtual team methods
+ * - virtualTeamMethodReturnTypes: return types pf virtual team methods
+ */
+ String[] noParams= new String[0];
+ String[] virtualTeamMethodNames = new String[]{"getActivationRepr", "getActivationRepr",
+ "isActive","activate", "deactivate",
+ "hasRole", "hasRole",
+ "hasRole", "hasRole",
+ "getRole", "getRole",
+ "getRole", "getRole",
+ "isExecutingCallin",
+ "unregisterRole", "unregisterRole",
+ "unregisterRole", "unregisterRole"};
+
+ String[][] virtualTeamMethodParamTypes = new String[][]{noParams, noParams,
+ noParams, noParams, noParams,
+ {"QObject;"}, {"Qjava.lang.Object;"},
+ {"QObject;", "QClass;"},{"Qjava.lang.Object;", "Qjava.lang.Class;"},
+ {"QObject;"}, {"Qjava.lang.Object;"},
+ {"QObject;", "QClass;"},{"Qjava.lang.Object;", "Qjava.lang.Class;"},
+ noParams,
+ {"QObject;"}, {"Qjava.lang.Object;"},
+ {"QObject;", "QClass;"},{"Qjava.lang.Object;", "Qjava.lang.Class;"}};
+
+ String[] virtualTeamMethodReturnTypes = new String[]{"QString;", "Qjava.lang.String;",
+ Signature.SIG_BOOLEAN, Signature.SIG_VOID, Signature.SIG_VOID,
+ Signature.SIG_BOOLEAN, Signature.SIG_BOOLEAN,
+ Signature.SIG_BOOLEAN, Signature.SIG_BOOLEAN,
+ "QObject;", "Qjava.lang.Object;",
+ "QObject;", "Qjava.lang.Object;",
+ Signature.SIG_BOOLEAN,
+ Signature.SIG_VOID, Signature.SIG_VOID,
+ Signature.SIG_VOID, Signature.SIG_VOID};
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/util/RefactoringUtil.java b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/util/RefactoringUtil.java
new file mode 100644
index 000000000..e80a86935
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.refactoring/src/org/eclipse/objectteams/otdt/internal/refactoring/util/RefactoringUtil.java
@@ -0,0 +1,1392 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2009 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute and Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: RefactoringUtil.java 23473 2010-02-05 19:46:08Z stephan $
+ *
+ * Please visit http://www.objectteams.org for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ * Johannes Gebauer - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.refactoring.util;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.jdt.core.Flags;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IField;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IMember;
+import org.eclipse.jdt.core.IMethod;
+import org.eclipse.jdt.core.IPackageFragment;
+import org.eclipse.jdt.core.IPackageFragmentRoot;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.ITypeHierarchy;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.core.Signature;
+import org.eclipse.jdt.core.dom.AST;
+import org.eclipse.jdt.core.dom.ASTNode;
+import org.eclipse.jdt.core.dom.ASTParser;
+import org.eclipse.jdt.core.dom.AbstractMethodMappingDeclaration;
+import org.eclipse.jdt.core.dom.AbstractTypeDeclaration;
+import org.eclipse.jdt.core.dom.AnonymousClassDeclaration;
+import org.eclipse.jdt.core.dom.CallinMappingDeclaration;
+import org.eclipse.jdt.core.dom.CalloutMappingDeclaration;
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jdt.core.dom.ITypeBinding;
+import org.eclipse.jdt.core.dom.MethodDeclaration;
+import org.eclipse.jdt.core.dom.MethodMappingElement;
+import org.eclipse.jdt.core.dom.MethodSpec;
+import org.eclipse.jdt.core.dom.Modifier;
+import org.eclipse.jdt.core.dom.Name;
+import org.eclipse.jdt.core.dom.RoleTypeDeclaration;
+import org.eclipse.jdt.core.search.IJavaSearchConstants;
+import org.eclipse.jdt.core.search.IJavaSearchScope;
+import org.eclipse.jdt.core.search.SearchEngine;
+import org.eclipse.jdt.core.search.SearchMatch;
+import org.eclipse.jdt.core.search.SearchPattern;
+import org.eclipse.jdt.core.search.SearchRequestor;
+import org.eclipse.jdt.internal.core.JavaModelManager;
+import org.eclipse.jdt.internal.corext.Corext;
+import org.eclipse.jdt.internal.corext.dom.ASTNodes;
+import org.eclipse.jdt.core.dom.NodeFinder;
+import org.eclipse.jdt.internal.corext.refactoring.Checks;
+import org.eclipse.jdt.internal.corext.refactoring.base.JavaStatusContext;
+import org.eclipse.jdt.internal.corext.refactoring.rename.RippleMethodFinder2;
+import org.eclipse.jdt.internal.corext.refactoring.util.RefactoringASTParser;
+import org.eclipse.jdt.internal.corext.util.JdtFlags;
+import org.eclipse.jdt.internal.corext.util.Messages;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.eclipse.ltk.core.refactoring.RefactoringStatusContext;
+import org.eclipse.ltk.core.refactoring.RefactoringStatusEntry;
+import org.eclipse.objectteams.otdt.core.IMethodMapping;
+import org.eclipse.objectteams.otdt.core.IOTType;
+import org.eclipse.objectteams.otdt.core.IRoleType;
+import org.eclipse.objectteams.otdt.core.OTModelManager;
+import org.eclipse.objectteams.otdt.core.TypeHelper;
+import org.eclipse.objectteams.otdt.core.compiler.IOTConstants;
+import org.eclipse.objectteams.otdt.core.search.OTSearchEngine;
+import org.eclipse.objectteams.otdt.core.search.OTSearchRequestor;
+import org.eclipse.objectteams.otdt.internal.core.InheritedMethodsRequestor;
+import org.eclipse.objectteams.otdt.internal.core.OTTypeHierarchy;
+import org.eclipse.objectteams.otdt.internal.core.OTTypeHierarchyTraverser;
+import org.eclipse.objectteams.otdt.internal.refactoring.OTRefactoringPlugin;
+import org.eclipse.objectteams.otdt.internal.refactoring.corext.OTRefactoringCoreMessages;
+import org.eclipse.objectteams.otdt.internal.refactoring.corext.base.OTRefactoringStatusCodes;
+
+/**
+ * This utility class is a part of the OT/J refactoring adaptation. It contains
+ * some OT refactoring related helper methods.
+ *
+ * @author brcan
+ */
+@SuppressWarnings("restriction")
+public class RefactoringUtil implements ITeamConstants {
+ /**
+ * Checks whether the top-level type of the given compilation unit is a
+ * regular class or a team class.
+ *
+ * @param compUnit
+ * the given compilation unit
+ * @param str
+ * the string describing the error
+ * @return the refactoring status
+ * @throws JavaModelException
+ */
+ public static RefactoringStatus checkOOClass(ICompilationUnit compUnit, String str) throws JavaModelException {
+ RefactoringStatus status = new RefactoringStatus();
+ IType type = robustFindPrimaryType(compUnit);
+
+ if (Flags.isTeam(type.getFlags())) {
+ status.addFatalError(OTRefactoringCoreMessages.getString(str));
+ }
+ return status;
+ }
+
+ /*
+ * Make a best guess to find the primary type of a CU even if names do not
+ * match.
+ */
+ private static IType robustFindPrimaryType(ICompilationUnit compUnit) {
+ IType type = compUnit.findPrimaryType();
+ if (type != null)
+ return type;
+ IType[] types;
+ try {
+ types = compUnit.getTypes();
+ if (types != null) {
+ for (IType type2 : types) {
+ if (Flags.isPublic(type2.getFlags()))
+ return type2;
+ }
+ if (types.length > 0)
+ return types[0];
+ }
+ } catch (JavaModelException e) {
+ // nothing useful found, return null below
+ }
+ return null;
+ }
+
+ /**
+ * Returns all role types contained in the given project.
+ *
+ * @param thisProject
+ * the given project
+ * @return an array containing all role types of the given project
+ * @throws JavaModelException
+ *
+ * @deprecated use getAllRoleClasses(IJavaProject, IProgressMonitor) instead
+ */
+ public static IType[] getAllRoleTypes(IJavaProject thisProject) throws JavaModelException {
+ List<IType> roles = new ArrayList<IType>();
+ IPackageFragment[] packages = thisProject.getPackageFragments();
+
+ for (int idx = 0; idx < packages.length; idx++) {
+ if (packages[idx].getKind() != IPackageFragmentRoot.K_BINARY) {
+ // get all compilation units in this package
+ ICompilationUnit[] compUnits = packages[idx].getCompilationUnits();
+ if (compUnits != null && compUnits.length != 0) {
+ for (int idy = 0; idy < compUnits.length; idy++) {
+ // get all top-level types declared
+ // in this compilation unit
+ IType[] types = compUnits[idy].getTypes();
+ if (types != null && types.length != 0) {
+ for (int idz = 0; idz < types.length; idz++) {
+ // add role files
+ if (TypeHelper.isRole(types[idz].getFlags())) {
+ roles.add(types[idz]);
+ }
+ if (Modifier.isTeam(types[idz].getFlags())) {
+ // get all roles of this team
+ IType[] rolesOfTeam = types[idz].getTypes();
+ for (int roleNr = 0; roleNr < rolesOfTeam.length; roleNr++) {
+ roles.add(rolesOfTeam[roleNr]);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ return roles.toArray(new IType[roles.size()]);
+ }
+
+ /**
+ * Returns all role types contained in the given project and related
+ * projects.
+ *
+ * @param project
+ * the given project
+ * @param monitor
+ * the progress monitor
+ * @return an array of role types
+ */
+ public static IOTType[] getAllRoleClasses(IJavaProject project, IProgressMonitor monitor) throws JavaModelException {
+ OTSearchRequestor requestor = new OTSearchRequestor();
+ try {
+ SearchPattern rolePattern = OTSearchEngine.createRoleTypePattern(IJavaSearchConstants.TYPE, SearchPattern.R_EXACT_MATCH);
+ IJavaElement[] relevantProjects = getRelevantProjects(project);
+ IJavaSearchScope scope = OTSearchEngine.createOTSearchScope(relevantProjects, true);
+ OTSearchEngine engine = new OTSearchEngine();
+ engine.search(rolePattern, scope, requestor, monitor);
+ } catch (CoreException ex) {
+ throw new JavaModelException(ex);
+ }
+
+ return requestor.getOTTypes();
+ }
+
+ public static ArrayList<IRoleType> getAllRolesForBase(IType baseType) throws CoreException {
+ OTSearchEngine engine = new OTSearchEngine();
+ IJavaSearchScope searchScope = SearchEngine.createWorkspaceScope();
+ SearchPattern pattern = SearchPattern.createPattern(baseType, IJavaSearchConstants.PLAYEDBY_REFERENCES);
+ final ArrayList<IRoleType> roles = new ArrayList<IRoleType>();
+ if (pattern == null)
+ OTRefactoringPlugin.getInstance().getLog().log(new Status(Status.ERROR, OTRefactoringPlugin.PLUGIN_ID, "Error creating pattern")); //$NON-NLS-1$
+ else
+ engine.search(
+ pattern,
+ searchScope,
+ new SearchRequestor() {
+ public void acceptSearchMatch(SearchMatch match) throws CoreException
+ {
+ Object element = match.getElement();
+ if (element instanceof IType)
+ roles.add((IRoleType) OTModelManager.getOTElement((IType) element));
+ }
+ },
+ null);
+ return roles;
+ }
+
+ private static IJavaElement[] getRelevantProjects(IJavaProject srcProject) throws JavaModelException {
+ List<IJavaProject> relevantProjects = new ArrayList<IJavaProject>();
+ relevantProjects.add(srcProject); // this one is relevant for sure
+
+ IJavaProject[] allJavaProjects = JavaModelManager.getJavaModelManager().getJavaModel().getJavaProjects();
+ for (int idx = 0; idx < allJavaProjects.length; idx++) {
+ IJavaProject prj = allJavaProjects[idx];
+ if (prj.isOnClasspath(srcProject)) {
+ relevantProjects.add(prj);
+ }
+ }
+ return relevantProjects.toArray(new IJavaElement[relevantProjects.size()]);
+ }
+
+ /**
+ * Returns all bound base types of the given role types, that are declared
+ * by playedBy.
+ *
+ * @param roleTypes
+ * an array of IRoleTypes
+ * @return a list of bound base types
+ * @throws JavaModelException
+ */
+ public static ArrayList<IType> getAllDeclaredBaseTypes(IOTType[] roleTypes) throws JavaModelException {
+ ArrayList<IType> baseTypes = new ArrayList<IType>();
+ for (int idx = 0; idx < roleTypes.length; idx++) {
+ // IRoleType roleType =
+ // (IRoleType)OTModelManager.getOTElement(roleTypes[idx]);
+ IRoleType roleType = (IRoleType) roleTypes[idx];
+ if (roleType.getBaseclassName() == null) {
+ continue;
+ }
+ IType baseType = roleType.getBaseClass();
+ if (baseType != null && !baseTypes.contains(baseType)) {
+ baseTypes.add(baseType);
+ }
+ }
+ return baseTypes;
+ }
+
+ public static IMethod[] hierarchyDeclaresMethodName(IProgressMonitor pm, IMethod method, String newName) throws CoreException {
+ Set<IMethod> result = new HashSet<IMethod>();
+ IType type = method.getDeclaringType();
+ ITypeHierarchy hier = type.newTypeHierarchy(pm);
+ IMethod foundMethod = Checks.findMethod(newName, method.getParameterTypes().length, false, type);
+ if (foundMethod != null) {
+ result.add(foundMethod);
+ }
+ IMethod[] foundInHierarchyClasses = classesDeclareMethodName(hier, Arrays.asList(hier.getAllClasses()), method, newName);
+ if (foundInHierarchyClasses != null) {
+ result.addAll(Arrays.asList(foundInHierarchyClasses));
+ }
+ IType[] implementingClasses = hier.getImplementingClasses(type);
+ IMethod[] foundInImplementingClasses = classesDeclareMethodName(hier, Arrays.asList(implementingClasses), method, newName);
+ if (foundInImplementingClasses != null) {
+ result.addAll(Arrays.asList(foundInImplementingClasses));
+ }
+ return result.toArray(new IMethod[result.size()]);
+ }
+
+ private static IMethod[] classesDeclareMethodName(ITypeHierarchy hier, List<IType> classes, IMethod method, String newName) throws CoreException {
+ Set<IMethod> result = new HashSet<IMethod>();
+ IType type = method.getDeclaringType();
+ List<IType> subtypes = Arrays.asList(hier.getAllSubtypes(type));
+
+ int parameterCount = method.getParameterTypes().length;
+ boolean isMethodPrivate = JdtFlags.isPrivate(method);
+
+ for (Iterator<IType> iter = classes.iterator(); iter.hasNext();) {
+ IType clazz = iter.next();
+ IMethod[] methods = clazz.getMethods();
+ boolean isSubclass = subtypes.contains(clazz);
+ for (int j = 0; j < methods.length; j++) {
+ IMethod foundMethod = Checks.findMethod(newName, parameterCount, false, new IMethod[] { methods[j] });
+ if (foundMethod == null) {
+ continue;
+ }
+ if (isSubclass || type.equals(clazz)) {
+ result.add(foundMethod);
+ } else if ((!isMethodPrivate) && (!JdtFlags.isPrivate(methods[j]))) {
+ result.add(foundMethod);
+ }
+ }
+ }
+ return result.toArray(new IMethod[result.size()]);
+ }
+
+ /**
+ * Checks if the given method is declared in an interface. If the method's
+ * declaring type is an interface the method returns <code>false</code> if
+ * it is only declared in that interface.
+ */
+ public static IMethod isDeclaredInInterface(IMethod method, OTTypeHierarchy hierarchy, IProgressMonitor pm) throws JavaModelException {
+ assert isVirtual(method);
+ try {
+ IType[] classes = hierarchy.getAllClasses();
+ IProgressMonitor subPm = new SubProgressMonitor(pm, 3);
+ subPm.beginTask("", classes.length); //$NON-NLS-1$
+ for (int idxAllHierarchyClasses = 0; idxAllHierarchyClasses < classes.length; idxAllHierarchyClasses++) {
+ ITypeHierarchy superTypes = hierarchy.getOTSuperTypeHierarchy(classes[idxAllHierarchyClasses]);
+ IType[] superinterfaces = superTypes.getAllSuperInterfaces(classes[idxAllHierarchyClasses]);
+
+ for (int idxSuperInterfaces = 0; idxSuperInterfaces < superinterfaces.length; idxSuperInterfaces++) {
+ IMethod found = Checks.findSimilarMethod(method, superinterfaces[idxSuperInterfaces]);
+ if (found != null && !found.equals(method))
+ return found;
+ }
+ subPm.worked(1);
+ }
+ return null;
+ } finally {
+ pm.done();
+ }
+ }
+
+ public static boolean isVirtual(IMethod method) throws JavaModelException {
+ IType declaringType = method.getDeclaringType();
+
+ if (TypeHelper.isRole(declaringType.getFlags())) {
+ if (method.isConstructor())
+ return false;
+ // note: private role method is virtual
+ // if (JdtFlags.isPrivate(method))
+ // return false;
+ if (JdtFlags.isStatic(method))
+ return false;
+ } else {
+ if (method.isConstructor())
+ return false;
+ if (JdtFlags.isPrivate(method))
+ return false;
+ if (JdtFlags.isStatic(method))
+ return false;
+ }
+ return true;
+ }
+
+ public static IMethod overridesAnotherMethod(IMethod method, OTTypeHierarchy hier, IProgressMonitor pm) throws JavaModelException {
+ IType declaringType = method.getDeclaringType();
+ InheritedMethodsRequestor requestor = new InheritedMethodsRequestor(declaringType, true, true);
+ OTTypeHierarchyTraverser traverser = new OTTypeHierarchyTraverser(requestor, OTTypeHierarchyTraverser.SUPER_HIERARCHY,
+ OTTypeHierarchyTraverser.TRAVERSE_EXPLICIT_FIRST, false, false, pm);
+
+ traverser.traverse();
+ IMethod[] collectedMethods = requestor.getResult();
+
+ for (int idx = collectedMethods.length - 1; idx >= 0; idx--) {
+ if (method.isSimilar(collectedMethods[idx])) {
+ return collectedMethods[idx];
+ }
+ }
+ return null;
+ }
+
+ public static boolean isRoleMethod(IMethod method) throws JavaModelException {
+ IType type = method.getDeclaringType();
+ IOTType otType = OTModelManager.getOTElement(type);
+
+ if (otType == null) {
+ return false;
+ } else if (otType.isRole()) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ public static String stripOffJavaSuffix(String compUnit) {
+ int dot = compUnit.lastIndexOf('.');
+ return compUnit.substring(0, dot);
+ }
+
+ /**
+ * Returns the corresponding DOM-AST node for the given role type.
+ *
+ * @param role
+ * the given role type
+ * @return node of type RoleTypeDeclaration
+ * @throws JavaModelException
+ */
+ public static RoleTypeDeclaration getRoleClassDeclaration(IMember role) throws JavaModelException {
+ ASTNode result = getASTNode(role, RoleTypeDeclaration.class);
+ return (RoleTypeDeclaration) result;
+ }
+
+ /**
+ * Returns the corresponding DOM-AST node for the given method.
+ *
+ * @param method
+ * the given method
+ * @return node of type MethodDeclaration
+ * @throws JavaModelException
+ */
+ public static MethodDeclaration getMethodDeclaration(IMember method) throws JavaModelException {
+ ASTNode result = getASTNode(method, MethodDeclaration.class);
+ return (MethodDeclaration) result;
+ }
+
+ /**
+ * Determines the focus type, i.e. the destination type of the refactored
+ * element (e.g. the destination type for an extracted or moved method).
+ *
+ * @param topLevelType
+ * the top-level type of the destination compilation unit
+ * @param destinationType
+ * the destination type node
+ * @return the focus type, i.e. either a regular class (including team) or a
+ * role class
+ */
+ public static IType determineFocusType(IType topLevelType, ASTNode destinationType) {
+ // if the destination of the extracted/moved code fragment/element is a
+ // role type,
+ // this role is the focus type...
+ if (destinationType instanceof RoleTypeDeclaration) {
+ RoleTypeDeclaration roleTypeDecl = (RoleTypeDeclaration) destinationType;
+ ITypeBinding roleTypeBinding = ASTNodes.getTypeBinding(roleTypeDecl.getName());
+ // if role is declared in the top-level type, get it...
+ if (roleTypeBinding != null) {
+ // Note: use String-based comparison for ITypeBinding <-> IType:
+ String topLevelName = topLevelType.getFullyQualifiedName();
+ String roleName = roleTypeBinding.getQualifiedName();
+ if (roleName.equals(topLevelName))
+ return topLevelType; // top level = focus (RoFi)
+ if (roleTypeBinding.getDeclaringClass().getQualifiedName().equals(topLevelName)) {
+ String simpleRoleName = roleTypeBinding.getName();
+ // role name very likely starts with __OT__, strip it off:
+ if (simpleRoleName.startsWith(IOTConstants.OT_DELIM))
+ simpleRoleName = simpleRoleName.substring(IOTConstants.OT_DELIM_LEN);
+ return TypeHelper.findRoleType(topLevelType, simpleRoleName);
+ }
+ // ...else find the nested role
+ else {
+ String relativeRoleName = getRelativeName(topLevelName, roleName);
+ return TypeHelper.findNestedRoleType(topLevelType, relativeRoleName);
+ }
+ }
+ return null;
+ }
+ // ...else the focus type is a team or regular class
+ else {
+ return topLevelType;
+ }
+ }
+
+ /**
+ * Make the given qualified name relative, so that the simple name or
+ * rootType is the first part of the resulting name.
+ *
+ * @param rootType
+ * @param fullyQualifiedName
+ * @return
+ */
+ private static String getRelativeName(String rootType, String fullyQualifiedName) {
+ assert fullyQualifiedName.startsWith(rootType) : "role type must start like enclosing team"; //$NON-NLS-1$
+ int pos = rootType.lastIndexOf('.');
+ if (pos == -1)
+ pos = rootType.length();
+ return fullyQualifiedName.substring(pos + 1);
+ }
+
+ public static RefactoringStatus checkOverloading(IMethod[] inheritedMethods, String newName, String[] newParameterTypes, IOverloadingMessageCreator msgCreator) {
+ RefactoringStatus result = new RefactoringStatus();
+
+ for (int idx = 0; idx < inheritedMethods.length; idx++) {
+ // check if an inherited method or a local method has the
+ // same name as the method to be refactored
+ IMethod actualMethod = inheritedMethods[idx];
+ if (actualMethod.getElementName().equals(newName)) {
+ // get number of parameters of actual method
+ int actualMethodParamCount = actualMethod.getParameterTypes().length;
+ // get parameter types of actual method
+ String[] actualMethodParamTypes = getParameterTypesOfActualMethod(actualMethod);
+ // get number of parameters of method to be refactored
+ int refactoredMethodParamCount = newParameterTypes == null ? 0 : newParameterTypes.length;
+
+ // check if this method has a different number of parameters
+ // than
+ // the method to be refactored or...
+ if (actualMethodParamCount != refactoredMethodParamCount) {
+ // if overloading is present, issue a warning
+ result.merge(addOverloadingWarning(msgCreator));
+ }
+ // ...if it has the same number of parameters but different
+ // parameter types
+ else if (newParameterTypes != null) {
+ for (int idz = 0; idz < actualMethodParamTypes.length; idz++) {
+ if (!actualMethodParamTypes[idz].equals(newParameterTypes[idz])) {
+ // if overloading is present, issue a warning
+ result.merge(addOverloadingWarning(msgCreator));
+ }
+ }
+ }
+ }
+ }
+ return result;
+ }
+
+ private static String[] getParameterTypesOfActualMethod(IMethod actualMethod) {
+ String[] actualMethodParamTypes = actualMethod.getParameterTypes();
+ String[] readableActualMethodParamTypes = new String[actualMethodParamTypes.length];
+ for (int idy = 0; idy < actualMethodParamTypes.length; idy++) {
+ // convert parameter types into readable names
+ readableActualMethodParamTypes[idy] = Signature.toString(actualMethodParamTypes[idy]);
+ }
+ return readableActualMethodParamTypes;
+ }
+
+ @SuppressWarnings("unchecked")
+ // List getBaseMappingElements()
+ public static RefactoringStatus checkForAmbiguousBaseMethodSpecs(ArrayList<IRoleType> boundRoleTypes, String newMethodName, String oldMethodName, IAmbuguityMessageCreator msgCreator)
+ throws JavaModelException {
+ RefactoringStatus result = new RefactoringStatus();
+
+ for (Iterator<IRoleType> iter = boundRoleTypes.iterator(); iter.hasNext();) {
+ IRoleType boundRoleType = iter.next();
+ // get all method mappings of bound role type
+ AbstractMethodMappingDeclaration[] mappings = RefactoringUtil.getAllMethodMappings(boundRoleType);
+
+ if (mappings != null && mappings.length != 0) {
+ for (int idx = 0; idx < mappings.length; idx++) {
+ AbstractMethodMappingDeclaration mapping = mappings[idx];
+ if (mapping instanceof CallinMappingDeclaration) {
+ CallinMappingDeclaration callinDecl = (CallinMappingDeclaration) mapping;
+ List<MethodMappingElement> baseMethodSpecs = callinDecl.getBaseMappingElements();
+ for (Iterator<MethodMappingElement> iterator = baseMethodSpecs.iterator(); iterator.hasNext();) {
+ MethodMappingElement baseMethodSpec = iterator.next();
+ String baseMethodName = baseMethodSpec.getName().getIdentifier();
+ // check if base method specifier in callin mapping
+ // has
+ // no signature and if it has the same name as the
+ // extracted
+ // method
+ if (!baseMethodSpec.hasSignature() && (baseMethodName.equals(newMethodName) || baseMethodName.equals(oldMethodName))) {
+ // create the context
+ RefactoringStatusContext context = createContext(boundRoleType, baseMethodSpec);
+ // if it has the same name, issue an error
+ result.merge(addAmbiguityFatalError(context, msgCreator));
+ }
+ }
+ } else if (mapping instanceof CalloutMappingDeclaration) {
+ CalloutMappingDeclaration calloutDecl = (CalloutMappingDeclaration) mapping;
+ MethodMappingElement baseElement = calloutDecl.getBaseMappingElement();
+ // check if base element is a method spec and not a
+ // field access spec
+ if (baseElement instanceof MethodSpec) {
+ MethodSpec baseMethodSpec = (MethodSpec) baseElement;
+ String baseMethodName = baseMethodSpec.getName().getIdentifier();
+ // check if base method specifier in callout mapping
+ // has
+ // no signature and if it has the same name as the
+ // extracted
+ // method
+ if (!baseMethodSpec.hasSignature() && (baseMethodName.equals(newMethodName) || baseMethodName.equals(oldMethodName))) {
+ // create the context
+ RefactoringStatusContext context = createContext(boundRoleType, baseMethodSpec);
+ // if it has the same name, issue an error
+ result.merge(addAmbiguityFatalError(context, msgCreator));
+ }
+ }
+ }
+ }
+ }
+ }
+ return result;
+ }
+
+ public static RefactoringStatus checkForAmbiguousRoleMethodSpecs(IRoleType roleType, String newMethodName, IAmbuguityMessageCreator msgCreator) throws JavaModelException {
+ RefactoringStatus result = new RefactoringStatus();
+ // get all method mappings of role type
+ AbstractMethodMappingDeclaration[] mappings = RefactoringUtil.getAllMethodMappings(roleType);
+
+ if (mappings != null && mappings.length != 0) {
+ for (int idx = 0; idx < mappings.length; idx++) {
+ AbstractMethodMappingDeclaration mapping = mappings[idx];
+ if (mapping instanceof CallinMappingDeclaration) {
+ CallinMappingDeclaration callinDecl = (CallinMappingDeclaration) mapping;
+ MethodSpec roleMethodSpec = (MethodSpec) callinDecl.getRoleMappingElement();
+ String roleMethodName = roleMethodSpec.getName().getIdentifier();
+ // check if role method specifier in callin mapping has
+ // no signature and if it has the same name as the extracted
+ // method
+ if (!roleMethodSpec.hasSignature() && roleMethodName.equals(newMethodName)) {
+ // create the context
+ RefactoringStatusContext context = createContext(roleType, roleMethodSpec);
+ // if it has the same name, issue an error
+ result.merge(addAmbiguityFatalError(context, msgCreator));
+ }
+ } else if (mapping instanceof CalloutMappingDeclaration) {
+ CalloutMappingDeclaration calloutDecl = (CalloutMappingDeclaration) mapping;
+ MethodSpec roleMethodSpec = (MethodSpec) calloutDecl.getRoleMappingElement();
+ String roleMethodName = roleMethodSpec.getName().getIdentifier();
+ // check if role method specifier in callout mapping has
+ // no signature and if it has the same name as the extracted
+ // method
+ if (!roleMethodSpec.hasSignature() && roleMethodName.equals(newMethodName)) {
+ // create the context
+ RefactoringStatusContext context = createContext(roleType, roleMethodSpec);
+ // if it has the same name, issue an error
+ result.merge(addAmbiguityFatalError(context, msgCreator));
+ }
+ }
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Returns all method mappings of the given role type.
+ *
+ * @param roleType
+ * the given role type
+ * @return an array of method mapping declarations
+ * @throws JavaModelException
+ */
+ public static AbstractMethodMappingDeclaration[] getAllMethodMappings(IRoleType roleType) throws JavaModelException {
+ RoleTypeDeclaration roleClassDecl = getRoleClassDeclaration(roleType);
+ // get all callin and callout mappings of given role type
+ AbstractMethodMappingDeclaration[] callinMappings = roleClassDecl.getCallIns();
+ AbstractMethodMappingDeclaration[] calloutMappings = roleClassDecl.getCallOuts();
+
+ AbstractMethodMappingDeclaration[] mappings = new AbstractMethodMappingDeclaration[callinMappings.length + calloutMappings.length];
+ if (callinMappings.length != 0) {
+ System.arraycopy(callinMappings, 0, mappings, 0, callinMappings.length);
+ System.arraycopy(calloutMappings, 0, mappings, callinMappings.length, calloutMappings.length);
+ } else {
+ System.arraycopy(calloutMappings, 0, mappings, 0, calloutMappings.length);
+ }
+ return mappings;
+ }
+
+ public static RefactoringStatus addOverloadingWarning(IOverloadingMessageCreator msgCreator) {
+ RefactoringStatus result = RefactoringUtil.createWarningStatus(msgCreator.createOverloadingMessage(),
+ null, OTRefactoringStatusCodes.OVERLOADING);
+ return result;
+ }
+
+ public static RefactoringStatus addAmbiguityFatalError(RefactoringStatusContext context, IAmbuguityMessageCreator msgCreator) {
+ RefactoringStatus result = RefactoringUtil.createFatalErrorStatus(msgCreator.createAmbiguousMethodSpecifierMsg(),
+ context, OTRefactoringStatusCodes.AMBIGUOUS_METHOD_SPECIFIER);
+ return result;
+ }
+
+
+ /**
+ * Performs overloading checks for a team class or a regular class.
+ *
+ * @param result
+ * the actual refactoring status
+ * @param newMethodName
+ * the name of the refactored method
+ * @param focusType
+ * the destination type of the refactored method
+ * @param msgCreator a message creator object to provide refactoring specific error messages
+ * @param pm
+ * the progress monitor
+ * @param newMethod
+ * the refactored method
+ * @return the refactoring status containing a warning entry in case of
+ * overloading; ok otherwise.
+ * @throws JavaModelException
+ */
+ public static RefactoringStatus checkOverloadingForTeamOrRegularClass(RefactoringStatus result, String newMethodName, String[] newParamTypes,
+ IType focusType, IOverloadingMessageCreator msgCreator, IProgressMonitor pm) throws JavaModelException {
+ RefactoringStatus status = new RefactoringStatus();
+
+ RefactoringStatusEntry overloading = result.getEntryMatchingCode(Corext.getPluginId(), OTRefactoringStatusCodes.OVERLOADING);
+
+ if (overloading == null) {
+ IMethod[] methods = TypeHelper.getInheritedMethods(focusType, true, true, true, pm);
+ status.merge(checkOverloading(methods, newMethodName, newParamTypes, msgCreator));
+ }
+ return status;
+ }
+
+ /**
+ * Performs overloading and ambiguity checks for a role type.
+ *
+ * @param result
+ * the actual refactoring status
+ * @param newMethodName
+ * the name of the refactored method
+ * @param roleType
+ * the focus role
+ * @param ambiguitymsgCreator a message creator object to provide refactoring specific error messages
+ * @param overloadingmsgCreator a message creator object to provide refactoring specific error messages
+ * @param pm
+ * the progress monitor
+ * @param newMethod
+ * the refactored method
+ * @return the refactoring status containing a warning entry in case of
+ * overloading, or a warning and fatal error entry in case of
+ * overloading and ambiguous method specs; ok otherwise.
+ * @throws JavaModelException
+ */
+ public static RefactoringStatus checkOverloadingAndAmbiguityForRole(RefactoringStatus result, String newMethodName, String[] newParamTypes,
+ IRoleType roleType, IAmbuguityMessageCreator ambiguityMsgCreator, IOverloadingMessageCreator overloadingMsgCreator, IProgressMonitor pm) throws JavaModelException {
+ RefactoringStatus status = new RefactoringStatus();
+
+ RefactoringStatusEntry overloading = result.getEntryMatchingCode(Corext.getPluginId(), OTRefactoringStatusCodes.OVERLOADING);
+
+ if (overloading == null) {
+ // NOTE(gbr): result array of getInheritedMethods(..) also includes
+ // private methods. The reason is that method bindings may refer
+ // to hidden base methods (see OTJLD �3.4 and �4.6). This fact
+ // must be considered in the overloading and ambiguity checks.
+ IMethod[] methods = TypeHelper.getInheritedMethods(roleType, true, true, false, pm);
+ status.merge(checkOverloading(methods, newMethodName, newParamTypes, overloadingMsgCreator));
+ }
+ if (status.hasWarning() || result.hasWarning()) {
+ status.merge(checkForAmbiguousRoleMethodSpecs(roleType, newMethodName, ambiguityMsgCreator));
+ }
+ return status;
+ }
+
+ /**
+ * Performs overloading and ambiguity checks for a bound base type.
+ *
+ * @param result
+ * the actual refactoring status
+ * @param newMethodName
+ * the name of the refactored method
+ * @param oldMethodName
+ * the old name of the refactored method
+ * @param focusType
+ * the regarded type
+ * @param roleTypes
+ * the role types contained in the project
+ * @param ambiguitymsgCreator a message creator object to provide refactoring specific error messages
+ * @param overloadingmsgCreator a message creator object to provide refactoring specific error messages
+ * @param pm
+ * the progress monitor
+ * @param newMethod
+ * the refactored method
+ * @return the refactoring status containing a warning entry in case of
+ * overloading, or a warning and fatal error entry in case of
+ * overloading and ambiguous method specs; ok otherwise.
+ * @throws JavaModelException
+ */
+ public static RefactoringStatus checkOverloadingAndAmbiguityForBase(RefactoringStatus result, String newMethodName, String oldMethodName,
+ String[] newParamTypes, IType focusType, IOTType[] roleTypes, IAmbuguityMessageCreator ambiguityMsgCreator, IOverloadingMessageCreator overloadingMsgCreator, IProgressMonitor pm) throws JavaModelException {
+ RefactoringStatus status = new RefactoringStatus();
+
+ ArrayList<IRoleType> boundRoleTypes = new ArrayList<IRoleType>();
+ for (int idx = 0; idx < roleTypes.length; idx++) {
+ IRoleType roleType = (IRoleType) roleTypes[idx];
+ IType baseClass = roleType.getBaseClass();
+ if (baseClass != null && baseClass.equals(focusType)) {
+ RefactoringStatusEntry overloadingThis = status.getEntryMatchingCode(Corext.getPluginId(), OTRefactoringStatusCodes.OVERLOADING);
+ RefactoringStatusEntry overloadingOther = result.getEntryMatchingCode(Corext.getPluginId(), OTRefactoringStatusCodes.OVERLOADING);
+
+ // check overloading only once for all role types bound to the
+ // same baseclass
+ if (overloadingThis == null && overloadingOther == null) {
+ // NOTE(gbr): result array of getInheritedMethods(..) also
+ // includes
+ // private methods. The reason is that method bindings may
+ // refer
+ // to hidden base methods (see OTJLD �3.4 and �4.6).
+ // This fact
+ // must be considered in the overloading and ambiguity
+ // checks.
+ IMethod[] baseMethods = TypeHelper.getInheritedMethods(baseClass, true, true, false, pm);
+ status.merge(checkOverloading(baseMethods, newMethodName, newParamTypes, overloadingMsgCreator));
+ }
+ // add role that is bound to the base class to the list
+ boundRoleTypes.add(roleType);
+ }
+ }
+ if (status.hasWarning() || result.hasWarning()) {
+ status.merge(checkForAmbiguousBaseMethodSpecs(boundRoleTypes, newMethodName, oldMethodName, ambiguityMsgCreator));
+ }
+ return status;
+ }
+
+ /**
+ * Performs overloading and ambiguity checks for a bound base type present
+ * in the super hierarchy of the focus (destination) type.
+ *
+ * @param newMethodName
+ * the name of the refactored method
+ * @param oldMethodName
+ * the old name of the refactored method
+ * @param superTypes
+ * the super types of the focus type
+ * @param msgCreator a message creator object to provide refactoring specific error messages
+ * @param roleType
+ * the role type bound to the base type
+ * @return the refactoring status containing a fatal error entry in case of
+ * ambiguous method specs; ok otherwise.
+ * @throws JavaModelException
+ */
+ public static RefactoringStatus checkAmbiguityForBasePresentInFocusTypeSuperhierarchy(String newMethodName, String oldMethodName, IType[] superTypes,
+ IAmbuguityMessageCreator msgCreator, IRoleType roleType) throws JavaModelException {
+ RefactoringStatus status = new RefactoringStatus();
+ ArrayList<IRoleType> roleList = new ArrayList<IRoleType>();
+
+ IType baseClass = roleType.getBaseClass();
+ if (baseClass != null) {
+ for (int idx = 0; idx < superTypes.length; idx++) {
+ if (baseClass.equals(superTypes[idx])) {
+ roleList.add(roleType);
+ status.merge(checkForAmbiguousBaseMethodSpecs(roleList, newMethodName, oldMethodName, msgCreator));
+ }
+ }
+ }
+ return status;
+ }
+
+ /**
+ * Checks overloading and ambiguity for the given method name and method
+ * declaration.
+ *
+ * @param compUnit
+ * the target compilation unit
+ * @param destination
+ * the ast node representing the destination type
+ * @param newMethodName
+ * the name of the new method
+ * @param ambiguitymsgCreator a message creator object to provide refactoring specific error messages
+ * @param overloadingmsgCreator a message creator object to provide refactoring specific error messages
+ * @param pm
+ * the progress monitor
+ * @param newMethod
+ * the method declaration of the new method
+ * @return the refactoring status
+ * @throws JavaModelException
+ */
+ public static RefactoringStatus checkOverloadingAndAmbiguity(ICompilationUnit compUnit, ASTNode destination, String newMethodName, String[] newParamTypes,
+ IAmbuguityMessageCreator ambiguityMsgCreator, IOverloadingMessageCreator overloadingMsgCreator, IProgressMonitor pm) throws JavaModelException {
+ // get top level type declared in compilation unit
+ IType topLevelType = robustFindPrimaryType(compUnit);
+ // determine focus type: can be either a regular class (including team)
+ // or a role
+ IType focusType = RefactoringUtil.determineFocusType(topLevelType, destination);
+
+ return checkOverloadingAndAmbiguity(focusType, null, newMethodName, newParamTypes, ambiguityMsgCreator, overloadingMsgCreator, pm);
+
+ }
+
+ /**
+ * Checks overloading and ambiguity for the given method name and method
+ * declaration.
+ *
+ * @param focusType
+ * the focus type to check for ambiguity
+ * @param focusTypeHierarchy
+ * the type hierarchy for the focus type - will be computed if
+ * <code>null</code>
+ * @param newMethodName
+ * the name of the new method
+ * @param newParamTypes
+ * the parameters of the new method
+ * @param ambigutiymsgCreator a message creator object to provide refactoring specific error messages
+ * @param overloadingmsgCreator a message creator object to provide refactoring specific error messages
+ * @param pm
+ * the progress monitor
+ * @return the refactoring status
+ * @throws JavaModelException
+ */
+ public static RefactoringStatus checkOverloadingAndAmbiguity(IType focusType, ITypeHierarchy focusTypeHierarchy, String newMethodName,
+ String[] newParamTypes, IAmbuguityMessageCreator ambigutiyMsgCreator, IOverloadingMessageCreator overloadingMsgCreator, IProgressMonitor pm) throws JavaModelException {
+ ICompilationUnit compUnit = focusType.getCompilationUnit();
+ // create OT typehierarchy
+ if (focusTypeHierarchy == null) {
+ focusTypeHierarchy = new OTTypeHierarchy(focusType, compUnit.getJavaProject(), true);
+ focusTypeHierarchy.refresh(pm);
+ }
+ // get all supertypes of focus type
+ IType[] superTypes = focusTypeHierarchy.getAllSupertypes(focusType);
+ // get all subtypes of focus type
+ IType[] subTypes = focusTypeHierarchy.getAllSubtypes(focusType);
+ // get all role types in this project
+ IOTType[] roleTypes = RefactoringUtil.getAllRoleClasses(compUnit.getJavaProject(), pm);
+ // get all base types
+ ArrayList<IType> baseTypes = RefactoringUtil.getAllDeclaredBaseTypes(roleTypes);
+
+ RefactoringStatus result = new RefactoringStatus();
+ // if the focus type is a team,
+ // check for overloading methods in team and its supertypes
+ if (TypeHelper.isTeam(focusType.getFlags())) {
+ result.merge(RefactoringUtil.checkOverloadingForTeamOrRegularClass(result, newMethodName, newParamTypes, focusType, overloadingMsgCreator, pm));
+ if (result.getSeverity() == RefactoringStatus.WARNING) {
+ return result;
+ }
+ }
+ // if the focus type is a role,
+ // check for overloading methods in role and its supertypes,
+ // and for ambiguity in its method bindings
+ if (TypeHelper.isRole(focusType.getFlags())) {
+ IRoleType roleType = (IRoleType) OTModelManager.getOTElement(focusType);
+ result.merge(RefactoringUtil.checkOverloadingAndAmbiguityForRole(result, newMethodName, newParamTypes, roleType, ambigutiyMsgCreator, overloadingMsgCreator,
+ pm));
+ result.merge(RefactoringUtil.checkAmbiguityForBasePresentInFocusTypeSuperhierarchy(newMethodName, "", superTypes, ambigutiyMsgCreator, roleType));
+ }
+ // if the focus type is an unbound regular class,
+ // check for overloading methods in this class and its supertypes
+ else if (!baseTypes.contains(focusType)) {
+ RefactoringUtil.checkOverloadingForTeamOrRegularClass(result, newMethodName, newParamTypes, focusType, overloadingMsgCreator, pm);
+ if (result.getSeverity() == RefactoringStatus.WARNING) {
+ return result;
+ }
+ }
+ // if the focus type is a bound base class,
+ // check for overloading methods in this base class and its supertypes,
+ // and for ambiguity in method bindings of bound role classes
+ else if (baseTypes.contains(focusType)) {
+ result.merge(RefactoringUtil.checkOverloadingAndAmbiguityForBase(result, newMethodName, "", newParamTypes, focusType, roleTypes,
+ ambigutiyMsgCreator, overloadingMsgCreator, pm));
+ }
+ // if the focus type has subtypes,
+ // check overloading in the super hierarchy of each type
+ if (subTypes.length != 0) {
+ for (int idx = 0; idx < subTypes.length; idx++) {
+ IType subType = subTypes[idx];
+
+ // if the actual subtype of the focus type is a role,
+ // check for overloading methods in this role and its
+ // supertypes and for ambiguity in method bindings
+ if (TypeHelper.isRole(subType.getFlags())) {
+ IRoleType roleType = (IRoleType) OTModelManager.getOTElement(subType);
+ result.merge(RefactoringUtil.checkOverloadingAndAmbiguityForRole(result, newMethodName, newParamTypes, roleType, ambigutiyMsgCreator,
+ overloadingMsgCreator, pm));
+ if (result.hasWarning()) {
+ IType baseClass = roleType.getBaseClass();
+ ArrayList<IRoleType> roleList = new ArrayList<IRoleType>();
+ // if base class of role type is the focus type,
+ // check also ambiguous base method specs
+ if (baseClass != null && baseClass.equals(focusType)) {
+ roleList.add(roleType);
+ result.merge(RefactoringUtil.checkForAmbiguousBaseMethodSpecs(roleList, newMethodName, "", ambigutiyMsgCreator));
+ }
+ // else if base class of role type is a direct or
+ // indirect
+ // superclass of focus type, check also ambiguous base
+ // method specs
+ else {
+ result.merge(RefactoringUtil.checkAmbiguityForBasePresentInFocusTypeSuperhierarchy(newMethodName, "", superTypes, ambigutiyMsgCreator,
+ roleType));
+ }
+ }
+ }
+ // if the actual subtyp of the focus type is an unbound regular
+ // class,
+ // check for overloading methods in this class and its
+ // supertypes
+ else if (!baseTypes.contains(subType)) {
+ result.merge(RefactoringUtil
+ .checkOverloadingForTeamOrRegularClass(result, newMethodName, newParamTypes, subType, overloadingMsgCreator, pm));
+ }
+ // if the actual subtype of the focus type is a bound base
+ // class,
+ // check for overloading methods in this base class and its
+ // supertypes
+ // and for ambiguity in method bindings of bound role classes
+ else if (baseTypes.contains(subType)) {
+ result.merge(RefactoringUtil.checkOverloadingAndAmbiguityForBase(result, newMethodName, "", newParamTypes, subType, roleTypes, ambigutiyMsgCreator,
+ overloadingMsgCreator, pm));
+ }
+ }
+ }
+ return result;
+ }
+
+ // TODO(jsv): copy of checkOverloadingAndAmbiguity with ASTNode as
+ // destination -> remove redundant code
+ /**
+ * Checks overloading and ambiguity for the given method name and method
+ * declaration.
+ *
+ * @param compUnit
+ * the target compilation unit
+ * @param focusType
+ * the type of the renamed method
+ * @param newMethodName
+ * the name of the new method
+ * @param oldMethodName
+ * the old name of the method
+ * @param ambiguitymsgCreator a message creator object to provide refactoring specific error messages
+ * @param overloadingmsgCreator a message creator object to provide refactoring specific error messages.
+ * @param pm
+ * the progress monitor
+ * @param newMethod
+ * the IMethod of the new method
+ * @return the refactoring status
+ * @throws JavaModelException
+ */
+ public static RefactoringStatus checkOverloadingAndAmbiguity(ICompilationUnit compUnit, IType focusType, String newMethodName, String oldMethodName,
+ String[] newParamTypes, IAmbuguityMessageCreator ambiguityMsgCreator, IOverloadingMessageCreator overloadingMsgCreator, IProgressMonitor pm) throws JavaModelException {
+ // FIXME(SH): what is this unused code good for?
+ // get top level type declared in compilation unit
+ // IType topLevelType = compUnit.findPrimaryType();
+ // determine focus type: can be either a regular class (including team)
+ // or a role
+ // IType focusType = RefactoringUtil.determineFocusType(topLevelType,
+ // destination);
+
+ // create OT typehierarchy
+ OTTypeHierarchy completeHierarchy = new OTTypeHierarchy(focusType, compUnit.getJavaProject(), true);
+ completeHierarchy.refresh(pm);
+ // get all supertypes of focus type
+ IType[] superTypes = completeHierarchy.getAllSupertypes(focusType);
+ // get all subtypes of focus type
+ IType[] subTypes = completeHierarchy.getAllSubtypes(focusType);
+ // get all role types in this project
+ IOTType[] roleTypes = RefactoringUtil.getAllRoleClasses(compUnit.getJavaProject(), pm);
+ // get all base types
+ ArrayList<IType> baseTypes = RefactoringUtil.getAllDeclaredBaseTypes(roleTypes);
+
+ RefactoringStatus result = new RefactoringStatus();
+ // if the focus type is a team,
+ // check for overloading methods in team and its supertypes
+ if (TypeHelper.isTeam(focusType.getFlags())) {
+ result.merge(RefactoringUtil.checkOverloadingForTeamOrRegularClass(result, newMethodName, newParamTypes, focusType, overloadingMsgCreator, pm));
+ if (result.getSeverity() == RefactoringStatus.WARNING) {
+ return result;
+ }
+ }
+ // if the focus type is a role,
+ // check for overloading methods in role and its supertypes,
+ // and for ambiguity in its method bindings
+ if (TypeHelper.isRole(focusType.getFlags())) {
+ IRoleType roleType = (IRoleType) OTModelManager.getOTElement(focusType);
+ result.merge(RefactoringUtil.checkOverloadingAndAmbiguityForRole(result, newMethodName, newParamTypes, roleType, ambiguityMsgCreator, overloadingMsgCreator,
+ pm));
+ result.merge(RefactoringUtil.checkAmbiguityForBasePresentInFocusTypeSuperhierarchy(newMethodName, oldMethodName, superTypes, ambiguityMsgCreator, roleType));
+ }
+ // if the focus type is an unbound regular class,
+ // check for overloading methods in this class and its supertypes
+ else if (!baseTypes.contains(focusType)) {
+ RefactoringUtil.checkOverloadingForTeamOrRegularClass(result, newMethodName, newParamTypes, focusType, overloadingMsgCreator, pm);
+ if (result.getSeverity() == RefactoringStatus.WARNING) {
+ return result;
+ }
+ }
+ // if the focus type is a bound base class,
+ // check for overloading methods in this base class and its supertypes,
+ // and for ambiguity in method bindings of bound role classes
+ else if (baseTypes.contains(focusType)) {
+ result.merge(RefactoringUtil.checkOverloadingAndAmbiguityForBase(result, newMethodName, oldMethodName, newParamTypes, focusType, roleTypes,
+ ambiguityMsgCreator, overloadingMsgCreator, pm));
+ }
+ // if the focus type has subtypes,
+ // check overloading in the super hierarchy of each type
+ if (subTypes.length != 0) {
+ for (int idx = 0; idx < subTypes.length; idx++) {
+ IType subType = subTypes[idx];
+
+ // if the actual subtype of the focus type is a role,
+ // check for overloading methods in this role and its
+ // supertypes and for ambiguity in method bindings
+ if (TypeHelper.isRole(subType.getFlags())) {
+ IRoleType roleType = (IRoleType) OTModelManager.getOTElement(subType);
+ result.merge(RefactoringUtil.checkOverloadingAndAmbiguityForRole(result, newMethodName, newParamTypes, roleType, ambiguityMsgCreator,
+ overloadingMsgCreator, pm));
+ if (result.hasWarning()) {
+ IType baseClass = roleType.getBaseClass();
+ ArrayList<IRoleType> roleList = new ArrayList<IRoleType>();
+ // if base class of role type is the focus type,
+ // check also ambiguous base method specs
+ if (baseClass != null && baseClass.equals(focusType)) {
+ roleList.add(roleType);
+ result.merge(RefactoringUtil.checkForAmbiguousBaseMethodSpecs(roleList, newMethodName, oldMethodName, ambiguityMsgCreator));
+ }
+ // else if base class of role type is a direct or
+ // indirect
+ // superclass of focus type, check also ambiguous base
+ // method specs
+ else {
+ result.merge(RefactoringUtil.checkAmbiguityForBasePresentInFocusTypeSuperhierarchy(newMethodName, oldMethodName, superTypes,
+ ambiguityMsgCreator, roleType));
+ }
+ }
+ }
+ // if the actual subtyp of the focus type is an unbound regular
+ // class,
+ // check for overloading methods in this class and its
+ // supertypes
+ else if (!baseTypes.contains(subType)) {
+ result.merge(RefactoringUtil
+ .checkOverloadingForTeamOrRegularClass(result, newMethodName, newParamTypes, subType, overloadingMsgCreator, pm));
+ }
+ // if the actual subtype of the focus type is a bound base
+ // class,
+ // check for overloading methods in this base class and its
+ // supertypes
+ // and for ambiguity in method bindings of bound role classes
+ else if (baseTypes.contains(subType)) {
+ result.merge(RefactoringUtil.checkOverloadingAndAmbiguityForBase(result, newMethodName, oldMethodName, newParamTypes, subType, roleTypes,
+ ambiguityMsgCreator, overloadingMsgCreator, pm));
+ }
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Creates a refactoring status context for the given role type and method
+ * spec.
+ *
+ * @param roleType
+ * the role containing the error
+ * @param methodSpec
+ * the method spec that has caused the error
+ * @return the refactoring status context or null if the context cannot be
+ * created
+ */
+ public static RefactoringStatusContext createContext(IRoleType roleType, MethodMappingElement methodSpec) {
+ RefactoringStatusContext context = JavaStatusContext.create(roleType.getCompilationUnit(), methodSpec);
+ return context;
+ }
+
+ /**
+ * Creates a warning refactoring status.
+ *
+ * @param msg
+ * the message of the warning entry
+ * @param context
+ * the context of the warning entry
+ * @param code
+ * the problem code (@see <code>OTRefactoringStatusCodes</code>)
+ * @return the refactoring status
+ */
+ public static RefactoringStatus createWarningStatus(String msg, RefactoringStatusContext context, int code) {
+ return RefactoringStatus.createStatus(RefactoringStatus.WARNING, msg, context, Corext.getPluginId(), code, null);
+ }
+
+ /**
+ * Creates an error refactoring status.
+ *
+ * @param msg
+ * the message of the error entry
+ * @param context
+ * the context of the error entry
+ * @param code
+ * the problem code (@see <code>OTRefactoringStatusCodes</code>)
+ * @return the refactoring status
+ */
+ public static RefactoringStatus createErrorStatus(String msg, RefactoringStatusContext context, int code) {
+ return RefactoringStatus.createStatus(RefactoringStatus.ERROR, msg, context, Corext.getPluginId(), code, null);
+ }
+
+ /**
+ * Creates a fatal error refactoring status.
+ *
+ * @param msg
+ * the message of the fatal error entry
+ * @param context
+ * the context of the fatal error entry
+ * @param code
+ * the problem code (@see <code>OTRefactoringStatusCodes</code>)
+ * @return the refactoring status
+ */
+ public static RefactoringStatus createFatalErrorStatus(String msg, RefactoringStatusContext context, int code) {
+ return RefactoringStatus.createStatus(RefactoringStatus.FATAL, msg, context, Corext.getPluginId(), code, null);
+ }
+
+ /**
+ * Checks, if method has a special OT name. Does not use the
+ * OTTypeHIerarchy, because of performance optimization (team constants are
+ * using)
+ *
+ * @param current
+ * method to check
+ * @param new method name, should be <code>null</code> or an empty String if
+ * you wants to check the current method and not the new method with
+ * the same arguments like the current method
+ * @return the refactoring status
+ */
+ public static boolean isOTSpecialCase(IMethod origMethod, String newMethodName, boolean checkImplementingClasses, IProgressMonitor pm) throws CoreException {
+ // TODO(jsv) what to do in case of interface is only used by base
+ // class(es) ? to check the impolementing classes is a performance
+ // overhead
+ IType declaringType = origMethod.getDeclaringType();
+
+ if (!Flags.isTeam(declaringType.getFlags())) {
+ // heavyweight check for interfaces
+ if (Flags.isInterface(declaringType.getFlags()) && checkImplementingClasses) {
+ OTTypeHierarchy hier = new OTTypeHierarchy(declaringType, declaringType.getJavaProject(), true);
+ hier.refresh(pm);
+ IType[] impementingClasses = hier.getImplementingClasses(declaringType);
+ boolean teamImplementsInterface = false;
+ for (int idx = 0; idx < impementingClasses.length; idx++) {
+ if (Flags.isTeam(impementingClasses[idx].getFlags())) {
+ teamImplementsInterface = true;
+ break;
+ }
+ }
+
+ if (!teamImplementsInterface) {
+ return false;
+ }
+ } else {
+ return false;
+ }
+ }
+
+ if (newMethodName == null || newMethodName.length() == 0)
+ newMethodName = origMethod.getElementName();
+
+ assert (virtualTeamMethodNames.length == virtualTeamMethodParamTypes.length)
+ && (virtualTeamMethodParamTypes.length == virtualTeamMethodReturnTypes.length);
+ for (int i = 0; i < virtualTeamMethodNames.length; i++) {
+ if (virtualTeamMethodNames[i].equals(newMethodName) && Checks.compareParamTypes(origMethod.getParameterTypes(), virtualTeamMethodParamTypes[i])
+ && virtualTeamMethodReturnTypes[i].equals(origMethod.getReturnType())) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public static ASTNode getASTNode(IMember member, Class<? extends ASTNode> nodeClass) {
+ if (member == null || member.getCompilationUnit() == null) {
+ return null;
+ }
+
+ ICompilationUnit source = member.getCompilationUnit();
+
+ ASTParser parser = ASTParser.newParser(AST.JLS3);
+ parser.setSource(source);
+ parser.setResolveBindings(true);
+ CompilationUnit astRoot = (CompilationUnit) parser.createAST(null);
+ // NOTE(SH): cannot use member.getSourceRange() together with the AST:
+ // member uses declarationSourceEnd (incl. comment) whereas
+ // the ASTConverter uses bodyEnd instead (excluding comment/trailing
+ // '}')
+ // However, getNameRange() should be safe.
+ try {
+ ASTNode name = NodeFinder.perform(astRoot, member.getNameRange());
+ return getParent(name, nodeClass);
+ } catch (JavaModelException e) {
+ return null;
+ }
+ }
+
+ /**
+ * Finds all overridden methods of a certain method.
+ *
+ */
+ public static IMethod[] getOverriddenMethods(IMethod method, IProgressMonitor monitor) throws CoreException {
+
+ assert method != null;
+ return RippleMethodFinder2.getRelatedMethods(method, monitor, null);
+ }
+
+ /**
+ * Locates the topmost method of an override ripple and returns it. If none
+ * is found, null is returned.
+ *
+ * @param method
+ * the IMethod which may be part of a ripple
+ * @param typeHierarchy
+ * a ITypeHierarchy of the declaring type of the method. May be
+ * null
+ * @param monitor
+ * an IProgressMonitor
+ * @return the topmost method of the ripple, or null if none
+ * @throws JavaModelException
+ */
+ public static IMethod getTopmostMethod(IMethod method, ITypeHierarchy typeHierarchy, IProgressMonitor monitor) throws JavaModelException {
+
+ assert method != null;
+
+ ITypeHierarchy hierarchy = typeHierarchy;
+ IMethod topmostMethod = null;
+ final IType declaringType = method.getDeclaringType();
+ if (!declaringType.isInterface()) {
+ if ((hierarchy == null) || !declaringType.equals(hierarchy.getType())) {
+ hierarchy = new OTTypeHierarchy(declaringType, declaringType.getJavaProject(), false);
+ hierarchy.refresh(monitor);
+ }
+ if (hierarchy instanceof OTTypeHierarchy) {
+ IMethod inInterface = isDeclaredInInterface(method, (OTTypeHierarchy) hierarchy, monitor);
+ if (inInterface != null && !inInterface.equals(method))
+ topmostMethod = inInterface;
+ }
+ }
+ if (topmostMethod == null) {
+ if (hierarchy == null) {
+ hierarchy = new OTTypeHierarchy(declaringType, declaringType.getJavaProject(), false);
+ hierarchy.refresh(monitor);
+ }
+ if (hierarchy instanceof OTTypeHierarchy) {
+ IMethod overrides = overridesAnotherMethod(method, (OTTypeHierarchy) hierarchy, monitor);
+ if (overrides != null && !overrides.equals(method))
+ topmostMethod = overrides;
+ }
+ }
+ return topmostMethod;
+ }
+
+ public static IField fieldIsShadowedInType(String elementName, String typeSignature, IType type) throws JavaModelException {
+ IField field = type.getField(elementName);
+ if (field.exists() && !field.getTypeSignature().equals(typeSignature)) {
+ return field;
+ }
+ return null;
+ }
+
+ public static MethodDeclaration methodToDeclaration(IMethod method, CompilationUnit node) throws JavaModelException {
+ ICompilationUnit methodCU = (ICompilationUnit) method.getAncestor(IJavaElement.COMPILATION_UNIT);
+ if (!methodCU.equals(node.getJavaElement())) {
+ node = RefactoringASTParser.parseWithASTProvider(methodCU, true, null);
+ }
+ Name result = (Name) NodeFinder.perform(node, method.getNameRange());
+ return (MethodDeclaration) getParent(result, MethodDeclaration.class);
+ }
+
+ public static AbstractMethodMappingDeclaration methodMappingToDeclaration(IMethodMapping methodMapping, CompilationUnit node) throws JavaModelException {
+ Name result = (Name) NodeFinder.perform(node, methodMapping.getNameRange());
+ return (AbstractMethodMappingDeclaration) getParent(result, AbstractMethodMappingDeclaration.class);
+ }
+
+ public static RefactoringStatus createNotYetFullyOTAwareMsg(String refactoringName) {
+ return RefactoringStatus.createInfoStatus(Messages.format("The ''{0}'' Refactoring is not yet fully OT-aware!", new Object[] { refactoringName }));
+ }
+
+ @SuppressWarnings("rawtypes")
+ private static ASTNode getParent(ASTNode node, Class parentClass) {
+ do {
+ node = node.getParent();
+ } while (node != null && !parentClass.isInstance(node));
+ return node;
+ }
+
+ public static ASTNode typeToDeclaration(IType type, CompilationUnit node) throws JavaModelException {
+ Name result = (Name) NodeFinder.perform(node, type.getNameRange());
+ if (type.isAnonymous())
+ return getParent(result, AnonymousClassDeclaration.class);
+ return getParent(result, AbstractTypeDeclaration.class);
+ }
+
+ public static RefactoringStatus checkForExistingRoles(String refactoringName,
+ IJavaProject project, IProgressMonitor pm) {
+ try {
+ if(project == null){
+ return createNotYetFullyOTAwareMsg(refactoringName);
+
+ }
+ if(getAllRoleClasses(project, pm).length > 0){
+ return createNotYetFullyOTAwareMsg(refactoringName);
+ }
+ } catch (JavaModelException e) {
+ return createNotYetFullyOTAwareMsg(refactoringName);
+ }
+ return new RefactoringStatus();
+ }
+
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/.classpath b/plugins/org.eclipse.objectteams.otdt.samples/.classpath
new file mode 100644
index 000000000..987380a81
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/.classpath
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <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="con" path="OTRE"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/.project b/plugins/org.eclipse.objectteams.otdt.samples/.project
new file mode 100644
index 000000000..24bb10780
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/.project
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.objectteams.otdt.samples</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.objectteams.otdt.builder.OTJBuilder</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.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.objectteams.otdt.OTJavaNature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/META-INF/MANIFEST.MF b/plugins/org.eclipse.objectteams.otdt.samples/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..0770ae52c
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/META-INF/MANIFEST.MF
@@ -0,0 +1,27 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: OTSamples2 Plug-in
+Bundle-SymbolicName: org.eclipse.objectteams.otdt.samples;singleton:=true
+Bundle-Version: 1.4.0.qualifier
+Bundle-Activator: org.eclipse.objectteams.otdt.internal.samples.OTSamplesPlugin
+Bundle-Vendor: The TOPPrax consortium
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.ui.intro,
+ org.eclipse.pde.ui,
+ org.eclipse.objectteams.otdt.ui,
+ org.eclipse.core.resources,
+ org.eclipse.ui.ide,
+ org.eclipse.ui.forms,
+ org.eclipse.objectteams.otequinox,
+ org.eclipse.ui.intro.universal,
+ org.eclipse.objectteams.otdt,
+ org.eclipse.debug.ui,
+ org.eclipse.debug.core,
+ org.eclipse.jdt.core,
+ org.eclipse.objectteams.otdt.ui.help,
+ org.eclipse.jdt.debug.ui
+Export-Package: org.eclipse.objectteams.otdt.internal.samples
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ActivationPolicy: lazy
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/build.properties b/plugins/org.eclipse.objectteams.otdt.samples/build.properties
new file mode 100644
index 000000000..6fb1c7385
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/build.properties
@@ -0,0 +1,14 @@
+source.. = src/
+output.. = bin/
+bin.includes = plugin.xml,\
+ .,\
+ samples/,\
+ css/,\
+ intro/,\
+ META-INF/,\
+ plugin.properties,\
+ graphics/,\
+ bin/
+src.includes = .classpath,\
+ .project,\
+ build.properties
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/css/samples.css b/plugins/org.eclipse.objectteams.otdt.samples/css/samples.css
new file mode 100644
index 000000000..5a4871ba3
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/css/samples.css
@@ -0,0 +1,17 @@
+#swt .content-link img {
+ background-image : url(graphics/obj_48/samplered_obj.gif);
+}
+
+#swt .content-link:hover img {
+ background-image : url(graphics/obj_48/sampleredhov_obj.gif);
+}
+
+#workbench .content-link img {
+ background-image : url(graphics/obj_48/samplepurp_obj.gif);
+}
+
+#workbench .content-link:hover img {
+ background-image : url(graphics/obj_48/samplepurphov_obj.gif);
+}
+
+
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/css/swt.properties b/plugins/org.eclipse.objectteams.otdt.samples/css/swt.properties
new file mode 100644
index 000000000..2ca918980
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/css/swt.properties
@@ -0,0 +1,27 @@
+###############################################################################
+# Copyright (c) 2000, 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
+# $Id$
+#
+# Please visit http://www.eclipse.org/objectteams for updates and contact.
+#
+# Contributors:
+# IBM Corporation - initial API and implementation
+# Fraunhofer FIRST - Initial API and implementation
+# Technical University Berlin - Initial API and implementation
+###############################################################################
+overview.page-content.overview-links.java.link-icon = css/graphics/obj_48/javadev_obj.gif
+
+tutorials.page-content.java.layout.ncolumns = 2
+tutorials.page-content.java.hello-world.link-icon = css/graphics/obj_48/javaapp_obj.gif
+tutorials.page-content.java.applet.link-icon = css/graphics/obj_48/javaapplet_obj.gif
+tutorials.page-content.java.swt.link-icon = css/graphics/obj_48/swtapp_obj.gif
+tutorials.page-content.java.ant.link-icon = css/graphics/obj_48/script_obj.gif
+
+
+
+
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/ctool/overview48.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/ctool/overview48.gif
new file mode 100644
index 000000000..7da24bd9a
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/ctool/overview48.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/ctool/overview48sel.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/ctool/overview48sel.gif
new file mode 100644
index 000000000..3d1c45bf7
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/ctool/overview48sel.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/ctool/overview72.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/ctool/overview72.gif
new file mode 100644
index 000000000..d34b4b3d1
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/ctool/overview72.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/ctool/samples48.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/ctool/samples48.gif
new file mode 100644
index 000000000..3213de674
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/ctool/samples48.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/ctool/samples48sel.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/ctool/samples48sel.gif
new file mode 100644
index 000000000..f9c0469ab
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/ctool/samples48sel.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/ctool/samples72.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/ctool/samples72.gif
new file mode 100644
index 000000000..4c63a9a2a
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/ctool/samples72.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/ctool/tutorials48.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/ctool/tutorials48.gif
new file mode 100644
index 000000000..1a3f06a91
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/ctool/tutorials48.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/ctool/tutorials48sel.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/ctool/tutorials48sel.gif
new file mode 100644
index 000000000..3d687bd56
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/ctool/tutorials48sel.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/ctool/tutorials72.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/ctool/tutorials72.gif
new file mode 100644
index 000000000..a2aa343af
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/ctool/tutorials72.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/ctool/wb48.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/ctool/wb48.gif
new file mode 100644
index 000000000..c2fd06a61
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/ctool/wb48.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/ctool/whatsnew48.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/ctool/whatsnew48.gif
new file mode 100644
index 000000000..2bfb9be62
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/ctool/whatsnew48.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/ctool/whatsnew48sel.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/ctool/whatsnew48sel.gif
new file mode 100644
index 000000000..0da843fe3
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/ctool/whatsnew48sel.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/ctool/whatsnew72.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/ctool/whatsnew72.gif
new file mode 100644
index 000000000..74bf6ff39
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/ctool/whatsnew72.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/dtool/back.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/dtool/back.gif
new file mode 100644
index 000000000..f0d0929b6
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/dtool/back.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/dtool/forward.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/dtool/forward.gif
new file mode 100644
index 000000000..dbe58b200
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/dtool/forward.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/etool/back.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/etool/back.gif
new file mode 100644
index 000000000..1c81cb69f
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/etool/back.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/etool/forward.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/etool/forward.gif
new file mode 100644
index 000000000..3e4a4f40b
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/etool/forward.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/etool/overview48.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/etool/overview48.gif
new file mode 100644
index 000000000..8e2f8c16d
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/etool/overview48.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/etool/overview48sel.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/etool/overview48sel.gif
new file mode 100644
index 000000000..1275a4a90
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/etool/overview48sel.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/etool/overview72.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/etool/overview72.gif
new file mode 100644
index 000000000..e3f764808
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/etool/overview72.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/etool/samples48.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/etool/samples48.gif
new file mode 100644
index 000000000..63d405bf3
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/etool/samples48.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/etool/samples48sel.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/etool/samples48sel.gif
new file mode 100644
index 000000000..4c3135d0a
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/etool/samples48sel.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/etool/samples72.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/etool/samples72.gif
new file mode 100644
index 000000000..921642619
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/etool/samples72.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/etool/tutorials48.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/etool/tutorials48.gif
new file mode 100644
index 000000000..718ca6c61
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/etool/tutorials48.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/etool/tutorials48sel.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/etool/tutorials48sel.gif
new file mode 100644
index 000000000..10680e5cc
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/etool/tutorials48sel.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/etool/tutorials72.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/etool/tutorials72.gif
new file mode 100644
index 000000000..bab3498f8
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/etool/tutorials72.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/etool/wb48.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/etool/wb48.gif
new file mode 100644
index 000000000..50ca2871a
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/etool/wb48.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/etool/whatsnew48.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/etool/whatsnew48.gif
new file mode 100644
index 000000000..6e00d7a2a
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/etool/whatsnew48.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/etool/whatsnew48sel.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/etool/whatsnew48sel.gif
new file mode 100644
index 000000000..be9fa0c3d
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/etool/whatsnew48sel.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/etool/whatsnew72.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/etool/whatsnew72.gif
new file mode 100644
index 000000000..410093bdf
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/etool/whatsnew72.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/newprj_wiz.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/newprj_wiz.gif
new file mode 100644
index 000000000..858f4c988
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/newprj_wiz.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/community_obj.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/community_obj.gif
new file mode 100644
index 000000000..5d132a85f
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/community_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/communityhov_obj.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/communityhov_obj.gif
new file mode 100644
index 000000000..acb2a5878
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/communityhov_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/features_obj.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/features_obj.gif
new file mode 100644
index 000000000..364fd4840
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/features_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/featureshov_obj.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/featureshov_obj.gif
new file mode 100644
index 000000000..fbfdf0308
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/featureshov_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/javaapp_obj.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/javaapp_obj.gif
new file mode 100644
index 000000000..ce00d505f
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/javaapp_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/javaapphov_obj.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/javaapphov_obj.gif
new file mode 100644
index 000000000..35e9f5824
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/javaapphov_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/javaapplet_obj.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/javaapplet_obj.gif
new file mode 100644
index 000000000..b19a95256
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/javaapplet_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/javaapplethov_obj.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/javaapplethov_obj.gif
new file mode 100644
index 000000000..5da3db97c
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/javaapplethov_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/javadev_obj.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/javadev_obj.gif
new file mode 100644
index 000000000..f6526a2de
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/javadev_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/javadevhov_obj.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/javadevhov_obj.gif
new file mode 100644
index 000000000..36b47d3b5
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/javadevhov_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/migrate_obj.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/migrate_obj.gif
new file mode 100644
index 000000000..0c2fe8896
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/migrate_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/migratehov_obj.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/migratehov_obj.gif
new file mode 100644
index 000000000..ee34e2ab7
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/migratehov_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/new_obj.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/new_obj.gif
new file mode 100644
index 000000000..f46b81bdd
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/new_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/newhov_obj.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/newhov_obj.gif
new file mode 100644
index 000000000..593e63bc6
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/newhov_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/plugin_obj.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/plugin_obj.gif
new file mode 100644
index 000000000..d92d2c5b3
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/plugin_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/pluginhov_obj.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/pluginhov_obj.gif
new file mode 100644
index 000000000..1de8ccc12
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/pluginhov_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/rcpapp_obj.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/rcpapp_obj.gif
new file mode 100644
index 000000000..830ab563d
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/rcpapp_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/rcpapphov_obj.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/rcpapphov_obj.gif
new file mode 100644
index 000000000..5bd80a93a
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/rcpapphov_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/samplepurp_obj.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/samplepurp_obj.gif
new file mode 100644
index 000000000..c4e56fc39
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/samplepurp_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/samplepurphov_obj.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/samplepurphov_obj.gif
new file mode 100644
index 000000000..60481e275
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/samplepurphov_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/samplered_obj.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/samplered_obj.gif
new file mode 100644
index 000000000..f6d104eef
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/samplered_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/sampleredhov_obj.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/sampleredhov_obj.gif
new file mode 100644
index 000000000..687d6b24f
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/sampleredhov_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/script_obj.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/script_obj.gif
new file mode 100644
index 000000000..b48b7cd42
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/script_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/scripthov_obj.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/scripthov_obj.gif
new file mode 100644
index 000000000..d67203e89
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/scripthov_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/swtapp_obj.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/swtapp_obj.gif
new file mode 100644
index 000000000..9ba9a3302
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/swtapp_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/swtapphov_obj.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/swtapphov_obj.gif
new file mode 100644
index 000000000..c4fbb5d5f
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/swtapphov_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/teamsup_obj.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/teamsup_obj.gif
new file mode 100644
index 000000000..4b9def9fb
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/teamsup_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/teamsuphov_obj.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/teamsuphov_obj.gif
new file mode 100644
index 000000000..4bdf8193d
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/teamsuphov_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/updates_obj.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/updates_obj.gif
new file mode 100644
index 000000000..1608b30a9
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/updates_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/updateshov_obj.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/updateshov_obj.gif
new file mode 100644
index 000000000..22a0acedd
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/updateshov_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/wbbasics_obj.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/wbbasics_obj.gif
new file mode 100644
index 000000000..8b82563e0
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/wbbasics_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/wbbasicshov_obj.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/wbbasicshov_obj.gif
new file mode 100644
index 000000000..230be9cff
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/icons/obj48/wbbasicshov_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/community_obj.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/community_obj.gif
new file mode 100644
index 000000000..5d132a85f
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/community_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/communityhov_obj.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/communityhov_obj.gif
new file mode 100644
index 000000000..acb2a5878
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/communityhov_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/features_obj.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/features_obj.gif
new file mode 100644
index 000000000..364fd4840
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/features_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/featureshov_obj.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/featureshov_obj.gif
new file mode 100644
index 000000000..fbfdf0308
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/featureshov_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/javaapp_obj.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/javaapp_obj.gif
new file mode 100644
index 000000000..ce00d505f
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/javaapp_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/javaapphov_obj.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/javaapphov_obj.gif
new file mode 100644
index 000000000..35e9f5824
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/javaapphov_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/javaapplet_obj.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/javaapplet_obj.gif
new file mode 100644
index 000000000..b19a95256
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/javaapplet_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/javaapplethov_obj.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/javaapplethov_obj.gif
new file mode 100644
index 000000000..5da3db97c
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/javaapplethov_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/javadev_obj.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/javadev_obj.gif
new file mode 100644
index 000000000..f6526a2de
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/javadev_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/javadevhov_obj.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/javadevhov_obj.gif
new file mode 100644
index 000000000..36b47d3b5
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/javadevhov_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/migrate_obj.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/migrate_obj.gif
new file mode 100644
index 000000000..0c2fe8896
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/migrate_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/migratehov_obj.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/migratehov_obj.gif
new file mode 100644
index 000000000..ee34e2ab7
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/migratehov_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/new_obj.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/new_obj.gif
new file mode 100644
index 000000000..f46b81bdd
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/new_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/newhov_obj.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/newhov_obj.gif
new file mode 100644
index 000000000..593e63bc6
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/newhov_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/plugin_obj.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/plugin_obj.gif
new file mode 100644
index 000000000..d92d2c5b3
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/plugin_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/pluginhov_obj.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/pluginhov_obj.gif
new file mode 100644
index 000000000..1de8ccc12
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/pluginhov_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/rcpapp_obj.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/rcpapp_obj.gif
new file mode 100644
index 000000000..830ab563d
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/rcpapp_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/rcpapphov_obj.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/rcpapphov_obj.gif
new file mode 100644
index 000000000..5bd80a93a
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/rcpapphov_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/samplepurp_obj.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/samplepurp_obj.gif
new file mode 100644
index 000000000..c4e56fc39
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/samplepurp_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/samplepurphov_obj.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/samplepurphov_obj.gif
new file mode 100644
index 000000000..60481e275
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/samplepurphov_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/samplered_obj.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/samplered_obj.gif
new file mode 100644
index 000000000..f6d104eef
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/samplered_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/sampleredhov_obj.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/sampleredhov_obj.gif
new file mode 100644
index 000000000..687d6b24f
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/sampleredhov_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/script_obj.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/script_obj.gif
new file mode 100644
index 000000000..b48b7cd42
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/script_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/scripthov_obj.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/scripthov_obj.gif
new file mode 100644
index 000000000..d67203e89
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/scripthov_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/swtapp_obj.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/swtapp_obj.gif
new file mode 100644
index 000000000..9ba9a3302
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/swtapp_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/swtapphov_obj.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/swtapphov_obj.gif
new file mode 100644
index 000000000..c4fbb5d5f
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/swtapphov_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/teamsup_obj.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/teamsup_obj.gif
new file mode 100644
index 000000000..4b9def9fb
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/teamsup_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/teamsuphov_obj.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/teamsuphov_obj.gif
new file mode 100644
index 000000000..4bdf8193d
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/teamsuphov_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/updates_obj.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/updates_obj.gif
new file mode 100644
index 000000000..1608b30a9
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/updates_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/updateshov_obj.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/updateshov_obj.gif
new file mode 100644
index 000000000..22a0acedd
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/updateshov_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/wbbasics_obj.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/wbbasics_obj.gif
new file mode 100644
index 000000000..8b82563e0
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/wbbasics_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/wbbasicshov_obj.gif b/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/wbbasicshov_obj.gif
new file mode 100644
index 000000000..230be9cff
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/graphics/obj_48/wbbasicshov_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/intro/css/graphics/otapp_obj.gif b/plugins/org.eclipse.objectteams.otdt.samples/intro/css/graphics/otapp_obj.gif
new file mode 100644
index 000000000..d501aef4f
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/intro/css/graphics/otapp_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/intro/css/graphics/otapphov_obj.png b/plugins/org.eclipse.objectteams.otdt.samples/intro/css/graphics/otapphov_obj.png
new file mode 100644
index 000000000..3724dd340
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/intro/css/graphics/otapphov_obj.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/intro/css/graphics/sample.gif b/plugins/org.eclipse.objectteams.otdt.samples/intro/css/graphics/sample.gif
new file mode 100644
index 000000000..5ff1ffc67
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/intro/css/graphics/sample.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/intro/css/graphics/sample_hov.gif b/plugins/org.eclipse.objectteams.otdt.samples/intro/css/graphics/sample_hov.gif
new file mode 100644
index 000000000..6874164f5
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/intro/css/graphics/sample_hov.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/intro/css/samples.css b/plugins/org.eclipse.objectteams.otdt.samples/intro/css/samples.css
new file mode 100644
index 000000000..729fa8c21
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/intro/css/samples.css
@@ -0,0 +1,16 @@
+
+a#stopwatchsample img { background-image : url('graphics/otapp_obj.gif'); }
+a#stopwatchsample:hover img { background-image : url('graphics/otapphov_obj.png'); }
+
+a#observersample img { background-image : url('graphics/otapp_obj.gif'); }
+a#observersample:hover img { background-image : url('graphics/otapphov_obj.png'); }
+
+a#flightbonussample img { background-image : url('graphics/otapp_obj.gif'); }
+a#flightbonussample:hover img { background-image : url('graphics/otapphov_obj.png'); }
+
+a#ordersystemsample img { background-image : url('graphics/otapp_obj.gif'); }
+a#ordersystemsample:hover img { background-image : url('graphics/otapphov_obj.png'); }
+
+a#atmsample img { background-image : url('graphics/otapp_obj.gif'); }
+a#atmsample:hover img { background-image : url('graphics/otapphov_obj.png'); }
+
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/intro/css/swt-intro.properties b/plugins/org.eclipse.objectteams.otdt.samples/intro/css/swt-intro.properties
new file mode 100644
index 000000000..bcea8ecba
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/intro/css/swt-intro.properties
@@ -0,0 +1,21 @@
+###############################################################################
+# Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
+# for its Fraunhofer Institute and Computer Architecture and Software
+# Technology (FIRST), Berlin, Germany and Technical University Berlin,
+# Germany.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+# $Id$
+#
+# Please visit http://www.eclipse.org/objectteams for updates and contact.
+#
+# Contributors:
+# Fraunhofer FIRST - Initial API and implementation
+# Technical University Berlin - Initial API and implementation
+###############################################################################
+
+samples.stopwatchsample.link-icon = intro/css/graphics/otapp_obj.gif
+samples.stopwatchsample.hover-icon = intro/css/graphics/otapphov_obj.png
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/intro/samplesExtension.xml b/plugins/org.eclipse.objectteams.otdt.samples/intro/samplesExtension.xml
new file mode 100644
index 000000000..c6a70f0e9
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/intro/samplesExtension.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<introContent>
+ <!-- Extension to the SDK Samples Page. -->
+ <extensionContent id="org.eclipse.objectteams.otdt.samples.samplesExtension"
+ name="Object Teams Samples"
+ alt-style="/css/swt.properties"
+ style="/css/samples.css"
+ path="samples/@">
+
+ <anchor id="otSampleAnchor"/>
+ <group label="Object Teams Samples" id="swt" style-id="samples-group">
+ <text style-id="group-description">Explore Object Teams development through code samples.</text>
+ <link label="Object Teams samples" url="http://org.eclipse.ui.intro/showPage?id=otsamples" id="otsamples" style-id="sample-link">
+ <text>A small collection of Object Teams samples
+ </text>
+ </link>
+ </group>
+
+ </extensionContent>
+
+ <page style="css/samples.css" alt-style="css/swt.properties" id="otsamples" style-id="page">
+ <title style-id="intro-header">Welcome to Eclipse 3.0</title>
+ <group id="background-image" filteredFrom="swt"/>
+ <group id="curve-image" filteredFrom="swt"/>
+ <include path="overview/navigation-links"/>
+
+ <group id="page-content" >
+ <group id="content-header" label="Object Teams/Java Samples" filteredFrom="html"></group>
+ <text style-id="page-title" id="page-title" filteredFrom="swt">Object Teams/Java Samples</text>
+ <text style-id="page-description" id="page-description">Explore Object Teams by installing some prefabricated samples.</text>
+ <group id="workbench" style-id="samples-group">
+ <link label="OTSample-StopWatch" url="http://org.eclipse.ui.intro/runAction?pluginId=org.eclipse.objectteams.otdt.samples&amp;id=org.eclipse.objectteams.otdt.samples.stopwatch" id="stopwatchsample" style-id="sample-link">
+ <text>This implementation of a simple stop watch demonstrates how the Model-View-Controller pattern can be applied in Object Teams.
+
+ The example gives a basic overview over these concepts:
+ (1) team and role classes,
+ (2) method bindings, and
+ (3) lifting a base object to its role.</text></link>
+ <link label="OTSample-Observer" url="http://org.eclipse.ui.intro/runAction?pluginId=org.eclipse.objectteams.otdt.samples&amp;id=org.eclipse.objectteams.otdt.samples.observer" id="observersample" style-id="sample-link">
+ <text>A reusable implementation of the standard Observer pattern with two applications.
+
+ A fine point in this example is the temporary deactivation of a team to avoid the "jumping aspects" problem.</text></link>
+ <link label="OTSample-Flightbonus" url="http://org.eclipse.ui.intro/runAction?pluginId=org.eclipse.objectteams.otdt.samples&amp;id=org.eclipse.objectteams.otdt.samples.flightbooking" id="flightbonussample" style-id="sample-link">
+ <text>This examples demonstrates, how a reusable collaboration for collecting bonus points
+ can be integrated into an existing application for flight booking.
+
+ It shows a typical decomposition into three parts:
+ (1) a core application,
+ (2) an abstract collaboration, and
+ (3) a connector which combines the other two modules.</text></link>
+ <link label="OTSample-Ordersystem" url="http://org.eclipse.ui.intro/runAction?pluginId=org.eclipse.objectteams.otdt.samples&amp;id=org.eclipse.objectteams.otdt.samples.ordersystem" id="ordersystemsample" style-id="sample-link">
+ <text>A comprehensive example showing different patterns of applying Object Teams.
+ It implements three components: a storage, reservation of items, and orders.</text></link>
+ <link label="OTSample-ATM" url="http://org.eclipse.ui.intro/runAction?pluginId=org.eclipse.objectteams.otdt.samples&amp;id=org.eclipse.objectteams.otdt.samples.atm" id="atmsample" style-id="sample-link">
+ <text>An example showing the use of guard predicates in Object Teams.
+
+ It implements a simple ATM that adds specific behaviour to specific groups of accounts:
+ (1) Foreign accounts are charged additional fees,
+ (2) The balance of foreign cannot be queried,
+ (3) Subscribed accounts receive a gratification for each crediting operation performed at the ATM.</text></link>
+ </group>
+ </group>
+ </page>
+</introContent>
+
+ \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/intro/samplesExtensionContentOT.xml b/plugins/org.eclipse.objectteams.otdt.samples/intro/samplesExtensionContentOT.xml
new file mode 100644
index 000000000..2d7eb84d1
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/intro/samplesExtensionContentOT.xml
@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<introContent>
+ <!-- Extension to the SDK Samples Page. -->
+
+ <extensionContent id="org.eclipse.objectteams.otdt.samples.samplesExtension"
+ name="Object Teams Samples"
+ alt-style="css/swt-intro.properties"
+ style="css/samples.css"
+ path="samples/@">
+ <group label="Object Teams Samples" id="content-group" style-id="content-group">
+ <text style-id="group-description">Explore Object Teams development through code samples.</text>
+<!--
+ <link label="Object Teams samples"
+ url="http://org.eclipse.ui.intro/showPage?id=otsamples"
+ id="otsamples"
+ style-id="content-link">
+ <text>A small collection of Object Teams samples
+ </text>
+ </link>
+-->
+ <link label="OTSample-StopWatch"
+ url="http://org.eclipse.ui.intro/runAction?pluginId=org.eclipse.objectteams.otdt.samples&amp;class=org.eclipse.pde.internal.ui.samples.ShowSampleAction&amp;id=org.eclipse.objectteams.otdt.samples.stopwatch"
+ id="stopwatchsample"
+ style-id="content-link">
+ <text>This implementation of a simple stop watch demonstrates how the Model-View-Controller pattern can be applied in Object Teams.
+
+ The example gives a basic overview over these concepts:
+ (1) team and role classes,
+ (2) method bindings, and
+ (3) lifting a base object to its role.
+ </text>
+ </link>
+ <link label="OTSample-Observer" url="http://org.eclipse.ui.intro/runAction?pluginId=org.eclipse.objectteams.otdt.samples&amp;class=org.eclipse.pde.internal.ui.samples.ShowSampleAction&amp;id=org.eclipse.objectteams.otdt.samples.observer" id="observersample" style-id="content-link">
+ <text>A reusable implementation of the standard Observer pattern with two applications.
+
+ A fine point in this example is the temporary deactivation of a team to avoid the "jumping aspects" problem.</text></link>
+ <link label="OTSample-Flightbonus" url="http://org.eclipse.ui.intro/runAction?pluginId=org.eclipse.objectteams.otdt.samples&amp;class=org.eclipse.pde.internal.ui.samples.ShowSampleAction&amp;id=org.eclipse.objectteams.otdt.samples.flightbooking" id="flightbonussample" style-id="content-link">
+ <text>This examples demonstrates, how a reusable collaboration for collecting bonus points
+ can be integrated into an existing application for flight booking.
+
+ It shows a typical decomposition into three parts:
+ (1) a core application,
+ (2) an abstract collaboration, and
+ (3) a connector which combines the other two modules.</text></link>
+ <link label="OTSample-Ordersystem" url="http://org.eclipse.ui.intro/runAction?pluginId=org.eclipse.objectteams.otdt.samples&amp;class=org.eclipse.pde.internal.ui.samples.ShowSampleAction&amp;id=org.eclipse.objectteams.otdt.samples.ordersystem" id="ordersystemsample" style-id="content-link">
+ <text>A comprehensive example showing different patterns of applying Object Teams.
+ It implements three components: a storage, reservation of items, and orders.
+ Also a GUI is provided which is cleanly separated into Model/View/Controller</text></link>
+ <link label="OTSample-ATM" url="http://org.eclipse.ui.intro/runAction?pluginId=org.eclipse.objectteams.otdt.samples&amp;class=org.eclipse.pde.internal.ui.samples.ShowSampleAction&amp;id=org.eclipse.objectteams.otdt.samples.atm" id="atmsample" style-id="content-link">
+ <text>An example showing the use of guard predicates in Object Teams.
+
+ It implements a simple ATM that adds specific behaviour to specific groups of accounts:
+ (1) Foreign accounts are charged additional fees,
+ (2) The balance of foreign cannot be queried,
+ (3) Subscribed accounts receive a gratification for each crediting operation performed at the ATM.</text></link>
+
+ <anchor id="otSampleAnchor"/>
+ </group>
+ </extensionContent>
+<!--
+ <page style="css/samples.css" alt-style="css/swt.properties" id="otsamples" style-id="page">
+ <title style-id="intro-header">Welcome to Eclipse 3.0</title>
+ <group id="background-image" filteredFrom="swt"/>
+ <group id="curve-image" filteredFrom="swt"/>
+ <include path="overview/navigation-links"/>
+
+ <group id="page-content" >
+ <group id="content-header" label="Object Teams/Java Samples" filteredFrom="html"></group>
+ <text style-id="page-title" id="page-title" filteredFrom="swt">Object Teams/Java Samples</text>
+ <text style-id="page-description" id="page-description">Explore Object Teams by installing some prefabricated samples.</text>
+ <group id="workbench" style-id="samples-group">
+ <link label="OTSample-StopWatch" url="http://org.eclipse.ui.intro/runAction?pluginId=org.eclipse.objectteams.otdt.samples&amp;id=org.eclipse.objectteams.otdt.samples.stopwatch" id="stopwatchsample" style-id="sample-link">
+ <text>This implementation of a simple stop watch demonstrates how the Model-View-Controller pattern can be applied in Object Teams.
+
+ The example gives a basic overview over these concepts:
+ (1) team and role classes,
+ (2) method bindings, and
+ (3) lifting a base object to its role.</text></link>
+ <link label="OTSample-Observer" url="http://org.eclipse.ui.intro/runAction?pluginId=org.eclipse.objectteams.otdt.samples&amp;id=org.eclipse.objectteams.otdt.samples.observer" id="observersample" style-id="sample-link">
+ <text>A reusable implementation of the standard Observer pattern with two applications.
+
+ A fine point in this example is the temporary deactivation of a team to avoid the "jumping aspects" problem.</text></link>
+ <link label="OTSample-Flightbonus" url="http://org.eclipse.ui.intro/runAction?pluginId=org.eclipse.objectteams.otdt.samples&amp;id=org.eclipse.objectteams.otdt.samples.flightbooking" id="flightbonussample" style-id="sample-link">
+ <text>This examples demonstrates, how a reusable collaboration for collecting bonus points
+ can be integrated into an existing application for flight booking.
+
+ It shows a typical decomposition into three parts:
+ (1) a core application,
+ (2) an abstract collaboration, and
+ (3) a connector which combines the other two modules.</text></link>
+ <link label="OTSample-Ordersystem" url="http://org.eclipse.ui.intro/runAction?pluginId=org.eclipse.objectteams.otdt.samples&amp;id=org.eclipse.objectteams.otdt.samples.ordersystem" id="ordersystemsample" style-id="sample-link">
+ <text>A comprehensive example showing different patterns of applying Object Teams.
+ It implements three components: a storage, reservation of items, and orders.</text></link>
+ <link label="OTSample-ATM" url="http://org.eclipse.ui.intro/runAction?pluginId=org.eclipse.objectteams.otdt.samples&amp;id=org.eclipse.objectteams.otdt.samples.atm" id="atmsample" style-id="sample-link">
+ <text>An example showing the use of guard predicates in Object Teams.
+
+ It implements a simple ATM that adds specific behaviour to specific groups of accounts:
+ (1) Foreign accounts are charged additional fees,
+ (2) The balance of foreign cannot be queried,
+ (3) Subscribed accounts receive a gratification for each crediting operation performed at the ATM.</text></link>
+ </group>
+ </group>
+ </page>
+-->
+</introContent>
+
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/plugin.properties b/plugins/org.eclipse.objectteams.otdt.samples/plugin.properties
new file mode 100644
index 000000000..c99bb8877
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/plugin.properties
@@ -0,0 +1,12 @@
+category.objectteams = Object Teams
+
+sample.stopwatch.name = Stop Watch Example
+sample.stopwatch.desc = A simple stop watch application demonstrating how the Model-View-Controller pattern can be applied in Object Teams.
+sample.observer.name = Observer Pattern Example
+sample.observer.desc = Implementation and application of the standard Observer pattern with Object Teams.
+sample.flightbooking.name = Flight Bonus Example
+sample.flightbooking.desc = This example demonstrates, how a reusable collaboration for collecting bonus points can be integrated into an existing application for flight booking.
+sample.ordersystem.name = Order System Example
+sample.ordersystem.desc = A comprehensive example showing different patterns of applying Object Teams. It implements three components: a storage, reservations of items, and orders plus a MVC GUI.
+sample.atm.name = ATM Example
+sample.atm.desc = An example showing the use of guard predicates in Object Teams. It implements a simple ATM that adds specific behaviour to specific groups of accounts.
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/plugin.xml b/plugins/org.eclipse.objectteams.otdt.samples/plugin.xml
new file mode 100644
index 000000000..2cc0518f8
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/plugin.xml
@@ -0,0 +1,168 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+<plugin>
+
+ <extension point="org.eclipse.pde.ui.samples">
+ <!-- the launchTarget attribute is not specified in the XML schema extension point description, however it is used in the code :-/ -->
+ <sample
+ launchTarget="org.eclipse.objectteams.stopwatch.Main"
+ name="%sample.stopwatch.name"
+ perspectiveId="org.eclipse.objectteams.otdt.ui.OTJavaPerspective"
+ targetViewId="org.eclipse.jdt.ui.PackageExplorer"
+ launcher="org.eclipse.jdt.debug.ui.launchConfigurations.JavaApplicationLaunchShortcut"
+ id="org.eclipse.objectteams.otdt.samples.stopwatch">
+ <description>%sample.stopwatch.desc
+ </description>
+ <project
+ name="OTSample-StopWatch"
+ archive="samples/stopwatch.zip"
+ selectReveal="Main.java">
+ </project>
+ <activity id="org.eclipse.javaDevelopment"/>
+ <activity id="org.eclipse.debugging"/>
+ </sample>
+ <sample
+ name="%sample.observer.name"
+ perspectiveId="org.eclipse.objectteams.otdt.ui.OTJavaPerspective"
+ targetViewId="org.eclipse.jdt.ui.PackageExplorer"
+ launcher="org.eclipse.jdt.debug.ui.launchConfigurations.JavaApplicationLaunchShortcut"
+ id="org.eclipse.objectteams.otdt.samples.observer">
+ <description>%sample.observer.desc
+ </description>
+ <activity id="org.eclipse.javaDevelopment"/>
+ <activity id="org.eclipse.debugging"/>
+ <project
+ name="OTSample-Observer"
+ archive="samples/observer.zip"
+ selectReveal="pattern/ObserverPattern.java">
+ </project>
+ </sample>
+ <!-- the launchTarget attribute is not specified in the XML schema extension point description, however it is used in the code :-/ -->
+ <sample
+ launchTarget="org.eclipse.objectteams.flightbooking.Main"
+ name="%sample.flightbooking.name"
+ perspectiveId="org.eclipse.objectteams.otdt.ui.OTJavaPerspective"
+ targetViewId="org.eclipse.jdt.ui.PackageExplorer"
+ launcher="org.eclipse.jdt.debug.ui.launchConfigurations.JavaApplicationLaunchShortcut"
+ id="org.eclipse.objectteams.otdt.samples.flightbooking">
+ <description>%sample.flightbooking.desc
+ </description>
+ <activity id="org.eclipse.javaDevelopment"/>
+ <activity id="org.eclipse.debugging"/>
+ <project
+ name="OTSample-Flightbonus"
+ archive="samples/flightbonus.zip"
+ selectReveal="Intro0.html"> <!-- will be converted to Intro.html -->
+ </project>
+ </sample>
+ <sample
+ name="%sample.ordersystem.name"
+ perspectiveId="org.eclipse.objectteams.otdt.ui.OTJavaPerspective"
+ targetViewId="org.eclipse.jdt.ui.PackageExplorer"
+ launcher="org.eclipse.jdt.debug.ui.launchConfigurations.JavaApplicationLaunchShortcut"
+ id="org.eclipse.objectteams.otdt.samples.ordersystem">
+ <description>%sample.ordersystem.desc
+ </description>
+ <activity id="org.eclipse.javaDevelopment"/>
+ <activity id="org.eclipse.debugging"/>
+ <project
+ name="OTSample-Ordersystem"
+ archive="samples/ordersystem.zip"
+ selectReveal="Intro0.html"> <!-- will be converted to Intro.html -->
+ </project>
+ </sample>
+ <sample
+ name="%sample.atm.name"
+ perspectiveId="org.eclipse.objectteams.otdt.ui.OTJavaPerspective"
+ targetViewId="org.eclipse.jdt.ui.PackageExplorer"
+ launcher="org.eclipse.jdt.debug.ui.launchConfigurations.JavaApplicationLaunchShortcut"
+ id="org.eclipse.objectteams.otdt.samples.atm">
+ <description>%sample.atm.desc
+ </description>
+ <activity id="org.eclipse.javaDevelopment"/>
+ <activity id="org.eclipse.debugging"/>
+ <project
+ name="OTSample-ATM"
+ archive="samples/atm.zip"
+ selectReveal="src/Main.java">
+ </project>
+ </sample>
+
+ </extension>
+
+ <extension
+ point="org.eclipse.ui.newWizards">
+ <category
+ name="%category.objectteams"
+ parentCategory="org.eclipse.ui.Examples"
+ id="org.eclipse.objectteams.otdt.samples">
+ </category>
+ <wizard
+ category="org.eclipse.ui.Examples/org.eclipse.objectteams.otdt.samples"
+ class="org.eclipse.pde.internal.ui.samples.SampleWizard:org.eclipse.objectteams.otdt.samples.flightbooking"
+ icon="graphics/icons/newprj_wiz.gif"
+ id="org.eclipse.objectteams.otdt.samples.samples.flightbooking"
+ name="%sample.flightbooking.name"
+ project="true">
+ <description>%sample.flightbooking.desc
+ </description>
+ </wizard>
+ <wizard
+ category="org.eclipse.ui.Examples/org.eclipse.objectteams.otdt.samples"
+ class="org.eclipse.pde.internal.ui.samples.SampleWizard:org.eclipse.objectteams.otdt.samples.observer"
+ icon="graphics/icons/newprj_wiz.gif"
+ id="org.eclipse.objectteams.otdt.samples.samples.observer"
+ name="%sample.observer.name"
+ project="true">
+ <description>%sample.observer.desc
+ </description>
+ </wizard>
+ <wizard
+ category="org.eclipse.ui.Examples/org.eclipse.objectteams.otdt.samples"
+ class="org.eclipse.pde.internal.ui.samples.SampleWizard:org.eclipse.objectteams.otdt.samples.stopwatch"
+ icon="graphics/icons/newprj_wiz.gif"
+ id="org.eclipse.objectteams.otdt.samples.samples.stopwatch"
+ name="%sample.stopwatch.name"
+ project="true">
+ <description>%sample.stopwatch.desc
+ </description>
+ </wizard>
+ <wizard
+ category="org.eclipse.ui.Examples/org.eclipse.objectteams.otdt.samples"
+ class="org.eclipse.pde.internal.ui.samples.SampleWizard:org.eclipse.objectteams.otdt.samples.ordersystem"
+ icon="graphics/icons/newprj_wiz.gif"
+ id="org.eclipse.objectteams.otdt.samples.samples.ordersystem"
+ name="%sample.ordersystem.name"
+ project="true">
+ <description>%sample.ordersystem.desc
+ </description>
+ </wizard>
+ <wizard
+ category="org.eclipse.ui.Examples/org.eclipse.objectteams.otdt.samples"
+ class="org.eclipse.pde.internal.ui.samples.SampleWizard:org.eclipse.objectteams.otdt.samples.atm"
+ icon="graphics/icons/newprj_wiz.gif"
+ id="org.eclipse.objectteams.otdt.samples.samples.atm"
+ name="%sample.atm.name"
+ project="true">
+ <description>%sample.atm.desc
+ </description>
+ </wizard>
+ </extension>
+
+ <extension
+ point="org.eclipse.ui.intro.configExtension">
+ <configExtension
+ configId="org.eclipse.ui.intro.universalConfig"
+ content="intro/samplesExtensionContentOT.xml"/>
+ </extension>
+
+<!-- -->
+ <extension
+ point="org.eclipse.objectteams.otequinox.aspectBindings">
+ <aspectBinding>
+ <team class="org.eclipse.objectteams.otdt.internal.samples.SamplesAdapter" activation="ALL_THREADS"/>
+ <basePlugin id="org.eclipse.pde.ui"/>
+ </aspectBinding>
+ </extension>
+<!-- -->
+</plugin>
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/src/org/eclipse/objectteams/otdt/internal/samples/OTSamplesPlugin.java b/plugins/org.eclipse.objectteams.otdt.samples/src/org/eclipse/objectteams/otdt/internal/samples/OTSamplesPlugin.java
new file mode 100644
index 000000000..56399f0a7
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/src/org/eclipse/objectteams/otdt/internal/samples/OTSamplesPlugin.java
@@ -0,0 +1,50 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: OTSamplesPlugin.java 23482 2010-02-05 20:16:19Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.samples;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+
+/**
+ * @author gis
+ */
+public class OTSamplesPlugin extends AbstractUIPlugin
+{
+ public static final String PLUGIN_ID = "org.eclipse.objectteams.otdt.samples"; //$NON-NLS-1$
+ private static OTSamplesPlugin instance;
+
+ public OTSamplesPlugin()
+ {
+ super();
+ instance = this;
+ }
+
+ public static OTSamplesPlugin getDefault()
+ {
+ return instance;
+ }
+
+ public static Status createErrorStatus(String message, Throwable ex)
+ {
+ return new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, message, ex);
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/src/org/eclipse/objectteams/otdt/internal/samples/SampleMessages.java b/plugins/org.eclipse.objectteams.otdt.samples/src/org/eclipse/objectteams/otdt/internal/samples/SampleMessages.java
new file mode 100644
index 000000000..7f2d82805
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/src/org/eclipse/objectteams/otdt/internal/samples/SampleMessages.java
@@ -0,0 +1,38 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: SampleMessages.java 23482 2010-02-05 20:16:19Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.samples;
+
+import org.eclipse.osgi.util.NLS;
+
+public class SampleMessages extends NLS {
+ private static final String BUNDLE_NAME = SampleMessages.class.getName();
+
+ public static String SamplesAdapter_cannot_run_selected;
+
+ public static String SamplesAdapter_unable_to_run;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, SampleMessages.class);
+ }
+
+ private SampleMessages() {
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/src/org/eclipse/objectteams/otdt/internal/samples/SampleMessages.properties b/plugins/org.eclipse.objectteams.otdt.samples/src/org/eclipse/objectteams/otdt/internal/samples/SampleMessages.properties
new file mode 100644
index 000000000..5bdf3e911
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/src/org/eclipse/objectteams/otdt/internal/samples/SampleMessages.properties
@@ -0,0 +1,2 @@
+SamplesAdapter_unable_to_run=Unable to run sample
+SamplesAdapter_cannot_run_selected=Cannot run the selected sample.
diff --git a/plugins/org.eclipse.objectteams.otdt.samples/src/org/eclipse/objectteams/otdt/internal/samples/SamplesAdapter.java b/plugins/org.eclipse.objectteams.otdt.samples/src/org/eclipse/objectteams/otdt/internal/samples/SamplesAdapter.java
new file mode 100644
index 000000000..a43cf70e0
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.samples/src/org/eclipse/objectteams/otdt/internal/samples/SamplesAdapter.java
@@ -0,0 +1,461 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: SamplesAdapter.java 23482 2010-02-05 20:16:19Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ * IBM Corporation - copies of individual methods from bound base classes.
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.samples;
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.debug.ui.ILaunchShortcut;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IPackageFragmentRoot;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jface.dialogs.ErrorDialog;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.objectteams.otdt.ui.help.OTHelpPlugin;
+import org.eclipse.pde.internal.ui.PDEPlugin;
+import org.eclipse.swt.custom.BusyIndicator;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.ide.IDE;
+import org.eclipse.ui.part.ISetSelectionTarget;
+import org.osgi.framework.Bundle;
+
+import base org.eclipse.pde.internal.ui.samples.ProjectNamesPage;
+import base org.eclipse.pde.internal.ui.samples.SampleEditor;
+import base org.eclipse.pde.internal.ui.samples.SampleOperation;
+import base org.eclipse.pde.internal.ui.samples.SampleStandbyContent;
+import base org.eclipse.pde.internal.ui.samples.SampleWizard;
+import base org.eclipse.pde.internal.ui.samples.ShowSampleAction;
+
+/**
+ * @author gis
+ */
+@SuppressWarnings("restriction")
+public team class SamplesAdapter
+{
+ private Map<IConfigurationElement,SampleWizardAdapter> _wizards = new HashMap<IConfigurationElement, SampleWizardAdapter>();
+
+ boolean _needsAdaptation = false;
+
+ public boolean isOTSample(String sampleId)
+ {
+ return sampleId != null && sampleId.startsWith("org.eclipse.objectteams.otdt.samples."); //$NON-NLS-1$
+ }
+
+ public class ShowSampleActionAdapter playedBy ShowSampleAction
+ {
+
+ @SuppressWarnings("basecall")
+ callin boolean ensureSamplesPresent()
+ {
+ String id = getSampleId();
+ if (id != null) {
+ if (SamplesAdapter.this.isOTSample(id))
+ return true; //OT-samples are definitely present
+ }
+
+ return base.ensureSamplesPresent();
+ }
+ @SuppressWarnings("decapsulation")
+ String getSampleId() -> get String sampleId;
+ @SuppressWarnings("decapsulation")
+ boolean ensureSamplesPresent() <- replace boolean ensureSampleFeaturePresent();
+ }
+
+ public class ProjectNamesPageAdapter playedBy ProjectNamesPage
+// base when (SamplesAdapter.this.needsAdaptation())
+ {
+ private boolean _isInitialized;
+
+ // bugfix: avoid executing updateEntries more than once!
+ @SuppressWarnings("basecall")
+ callin void updateEntries() {
+ if (_isInitialized)
+ return;
+
+ _isInitialized = (getWizard().getSelection() != null);
+
+ base.updateEntries();
+ }
+
+ @SuppressWarnings("decapsulation")
+ SampleWizardAdapter getWizard() -> get SampleWizard wizard;
+ @SuppressWarnings("decapsulation")
+ void updateEntries() <- replace void updateEntries();
+ }
+
+ public class SampleWizardAdapter playedBy SampleWizard
+ when (needsAdaptation())
+ {
+ IProject[] _createdProjects;
+
+ void initializationHook()
+ {
+ // override default behavior
+ setSampleEditorNeeded(false);
+ }
+
+ protected void setCreatedProjects(IProject[] projects)
+ {
+ _createdProjects = projects;
+ }
+
+ callin boolean performFinish()
+ {
+ SamplesAdapter.this._wizards.put(getSelection(), this);
+ boolean result = base.performFinish();
+ SamplesAdapter.this._wizards.remove(getSelection());
+
+ return result;
+ }
+
+
+ @SuppressWarnings("basecall")
+ callin void selectReveal(Shell shell)
+ {
+ shell.getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ SampleWizardAdapter.this.doSelectReveal();
+ }
+ });
+ }
+
+ // provide commented out method of SampleWizard
+ void doSelectReveal() {
+//{ObjectTeams: added local variables for fields in base class
+ IConfigurationElement selection = getSelection();
+ IProject[] createdProjects = _createdProjects;
+//carp}
+
+ if (selection == null || createdProjects==null)
+ return;
+ String viewId = selection.getAttribute("targetViewId"); //$NON-NLS-1$
+ if (viewId == null)
+ return;
+ IWorkbenchWindow window = PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow();
+ if (window == null)
+ return;
+ IWorkbenchPage page = window.getActivePage();
+ if (page == null)
+ return;
+ IViewPart view = page.findView(viewId);
+ if (view == null || !(view instanceof ISetSelectionTarget))
+ return;
+ ISetSelectionTarget target = (ISetSelectionTarget) view;
+ IConfigurationElement[] projects = selection.getChildren("project"); //$NON-NLS-1$
+
+ ArrayList<IResource> items = new ArrayList<IResource>();
+ for (int i = 0; i < projects.length; i++) {
+ String path = projects[i].getAttribute("selectReveal"); //$NON-NLS-1$
+ if (path == null)
+ continue;
+ IResource resource = createdProjects[i].findMember(path);
+ if (resource != null && resource.exists()) {
+ if (resource.getName().equals("Intro0.html")) { //$NON-NLS-1$
+ resource = setBaseTag(createdProjects[i], resource);
+ }
+ items.add(resource);
+ }
+ }
+ if (items.size() > 0)
+ target.selectReveal(new StructuredSelection(items));
+
+//{ObjectTeams: reveal in editor as well
+ revealInEditor(items, page);
+//carp}
+ }
+
+ /** Insert a HTML base-tag to enable relative navigation to resources in OTHelp. */
+ private IResource setBaseTag(IProject project, IResource resource) {
+ if (resource instanceof IFile) {
+ IFile file = (IFile)resource;
+ try {
+ NullProgressMonitor npm = new NullProgressMonitor();
+
+ // fetch path to help plugin hosting images/ and guide/otjld/def/:
+ Bundle helpBundle = OTHelpPlugin.getDefault().getBundle();
+ String absPath = FileLocator.resolve(helpBundle.getEntry("/")).toString(); //$NON-NLS-1$
+ String baseTag = "<base href=\""+absPath+"\">\n"; //$NON-NLS-1$ //$NON-NLS-2$
+
+ // assemble new new file with new content:
+ IFile newFile = project.getFile("Intro.html"); //$NON-NLS-1$
+ ByteArrayInputStream stream = new ByteArrayInputStream(baseTag.getBytes("UTF8")); //$NON-NLS-1$
+ newFile.create(stream, false, npm);
+ newFile.appendContents(file.getContents(), 0, npm);
+ stream.close();
+ resource.delete(false, npm);
+ return newFile;
+ } catch (Exception e) {
+ OTSamplesPlugin.getDefault().getLog().log(
+ OTSamplesPlugin.createErrorStatus("Failed to convert Intro.html", e)); //$NON-NLS-1$
+ }
+ }
+ return resource;
+ }
+
+ void revealInEditor(List<IResource> items, IWorkbenchPage page)
+ {
+ if (items.size() > 0)
+ {
+ for (Iterator<IResource> iter = items.iterator(); iter.hasNext();)
+ {
+ IResource resource = iter.next();
+ if (resource instanceof IFile)
+ {
+ try {
+ IDE.openEditor(page, (IFile)resource);
+ }
+ catch (PartInitException ex)
+ {} // ignore, user will try to open it manually, then
+ }
+ }
+ }
+ }
+
+ boolean needsAdaptation()
+ {
+ IConfigurationElement selection = getSelection();
+ if (selection == null) return false; // no sample selected
+ String id = selection.getAttribute("id"); //$NON-NLS-1$
+ return SamplesAdapter.this.isOTSample(id);
+ }
+
+ void initializationHook() <- before void addPages();
+ boolean performFinish() <- replace boolean performFinish();
+ void selectReveal(Shell shell) <- replace void selectReveal(Shell shell);
+
+ void setSampleEditorNeeded(boolean sampleEditorNeeded)
+ -> void setSampleEditorNeeded(boolean sampleEditorNeeded);
+ IConfigurationElement getSelection() -> IConfigurationElement getSelection();
+
+ }
+
+ public class SampleOperationAdaptor playedBy SampleOperation
+ {
+ void fetchCreatedProjects()
+ {
+ IProject[] projects = getCreatedProjects();
+ SampleWizardAdapter wizardAdapter = SamplesAdapter.this._wizards.get(getSample());
+ if (wizardAdapter != null && projects != null)
+ wizardAdapter.setCreatedProjects(projects);
+ }
+
+ // Original implementation doesn't copy the "launchTarget" attribute from configuration element to manifest file
+ void fixCreatedSampleManifestContent(String projectName, Properties properties)
+ {
+ final String attr = "launchTarget"; //$NON-NLS-1$
+ writeProperty(properties, attr, getSample().getAttribute(attr));
+ }
+
+ void fetchCreatedProjects() <- after void run(IProgressMonitor monitor);
+
+ void fixCreatedSampleManifestContent(String projectName, Properties properties)
+ <- after void createSampleManifestContent(String projectName, Properties properties);
+
+
+ @SuppressWarnings("decapsulation")
+ void writeProperty(Properties properties, String name, String value)
+ -> void writeProperty(Properties properties, String name, String value);
+
+ IProject[] getCreatedProjects() -> IProject[] getCreatedProjects();
+ @SuppressWarnings("decapsulation")
+ IConfigurationElement getSample() -> get IConfigurationElement sample;
+ }
+
+ /** This role generalizes over unrelated base classes SampleStandbyContent and SampleEditor. */
+ public abstract class SampleRunner
+ {
+ private ILaunchShortcut launchShortcut;
+
+ @SuppressWarnings("basecall")
+ callin void doRun(String launcher, String target, final boolean debug)
+ {
+ if (target != null && target.startsWith("org.eclipse.objectteams.")) //$NON-NLS-1$
+ {
+ final ISelection selection;
+ try
+ {
+ Object launchSelection = getLaunchSelection(target);
+ if (launchSelection != null) {
+ selection = new StructuredSelection(launchSelection);
+ } else
+ selection = new StructuredSelection();
+
+ final ILaunchShortcut fshortcut = getLaunchShortcut(launcher);
+
+ BusyIndicator.showWhile(Display.getDefault(), new Runnable() {
+ public void run() {
+ fshortcut.launch(selection, debug
+ ? ILaunchManager.DEBUG_MODE
+ : ILaunchManager.RUN_MODE);
+ }
+ });
+ }
+ catch (CoreException ex)
+ {
+ ErrorDialog.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+ SampleMessages.SamplesAdapter_unable_to_run, SampleMessages.SamplesAdapter_cannot_run_selected,
+ ex.getStatus());
+ OTSamplesPlugin.getDefault().getLog().log(ex.getStatus());
+ }
+ }
+ else
+ {
+ base.doRun(launcher, target, debug);
+ }
+ }
+
+ // NEW: target is the "launchTarget" property from the launchTarget attribute in the sample.properties
+ // file or the <sample> configuration element.
+ // Note: target may be null.
+ // falls back to search a main-class in the first src-folder available.
+ private Object getLaunchSelection(String target) throws JavaModelException
+ {
+ IProject project = getProject();
+ if (project != null)
+ {
+ IJavaProject javaProject = JavaCore.create(project);
+ if (javaProject.exists())
+ {
+ if (target != null)
+ {
+ IType targetType = javaProject.findType(target);
+ if (targetType != null)
+ return targetType;
+ }
+
+ IPackageFragmentRoot[] packageFragmentRoots = javaProject.getPackageFragmentRoots();
+ for (int i = 0; i < packageFragmentRoots.length; i++)
+ {
+ IPackageFragmentRoot root = packageFragmentRoots[i];
+ if (root.getKind() == IPackageFragmentRoot.K_SOURCE)
+ return root;
+ }
+ }
+ }
+
+ return null;
+ }
+
+ private ILaunchShortcut getLaunchShortcut(String launcher) throws CoreException
+ {
+ if (launchShortcut != null && launchShortcut.getClass().getName().equals(launcher))
+ return launchShortcut;
+
+ try {
+ Class<?> launcherClass = Class.forName(launcher);
+ launchShortcut = (ILaunchShortcut) launcherClass.newInstance();
+ return launchShortcut;
+ }
+ catch (Exception ex)
+ {
+ IStatus status = OTSamplesPlugin.createErrorStatus("Unable to create launcher", ex); //$NON-NLS-1$
+ throw new CoreException(status);
+ }
+ }
+
+ // OT_COPY_PASTE: STATE: 3.2: most parts copy&paste from SampleStandbyContent.doBrowse()
+ private IProject getProject()
+ {
+ IWorkspaceRoot root = PDEPlugin.getWorkspace().getRoot();
+ IProject[] projects = root.getProjects();
+ String sid = getSampleID();
+ if (sid == null)
+ return null;
+ for (int i = 0; i < projects.length; i++) {
+ IProject project = projects[i];
+ if (!project.exists() || !project.isOpen())
+ continue;
+ IFile pfile = project.getFile("sample.properties"); //$NON-NLS-1$
+ if (pfile.exists()) {
+ try {
+ InputStream is = pfile.getContents();
+ Properties prop = new Properties();
+ prop.load(is);
+ is.close();
+ String id = prop.getProperty("id"); //$NON-NLS-1$
+ if (id != null && id.equals(sid)) {
+ return project;
+ }
+ } catch (IOException e) {
+ PDEPlugin.logException(e);
+ } catch (CoreException e) {
+ PDEPlugin.logException(e);
+ }
+ }
+ }
+
+ return null;
+ }
+
+ protected abstract String getSampleID();
+ }
+
+ // stupid, stupid...
+ public class SampleStandbyContentAdaptor extends SampleRunner playedBy SampleStandbyContent
+ {
+ @SuppressWarnings("decapsulation")
+ void doRun(String launcher, String target, final boolean debug) <- replace void doRun(String launcher, String target, final boolean debug);
+
+ @SuppressWarnings("decapsulation")
+ String getSampleID() -> get IConfigurationElement sample with {
+ result <- sample.getAttribute("id") //$NON-NLS-1$
+ }
+ }
+
+ public class SampleEditorAdaptor extends SampleRunner playedBy SampleEditor
+ {
+ @SuppressWarnings("decapsulation")
+ void doRun(String launcher, String target, final boolean debug) <- replace void doRun(String launcher, String target, final boolean debug);
+
+ @SuppressWarnings("decapsulation")
+ String getSampleID() -> Properties loadContent() with {
+ result <- result.getProperty("id") //$NON-NLS-1$
+ }
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/.classpath b/plugins/org.eclipse.objectteams.otdt.ui.help/.classpath
new file mode 100644
index 000000000..304e86186
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <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.objectteams.otdt.ui.help/.cvsignore b/plugins/org.eclipse.objectteams.otdt.ui.help/.cvsignore
new file mode 100644
index 000000000..ba077a403
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/.cvsignore
@@ -0,0 +1 @@
+bin
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/.project b/plugins/org.eclipse.objectteams.otdt.ui.help/.project
new file mode 100644
index 000000000..9baee34d4
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.objectteams.otdt.ui.help</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.objectteams.otdt.ui.help/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.objectteams.otdt.ui.help/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..f8f1ac082
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+#Tue Sep 18 18:21:22 CEST 2007
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/META-INF/MANIFEST.MF b/plugins/org.eclipse.objectteams.otdt.ui.help/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..0a5c23dcc
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/META-INF/MANIFEST.MF
@@ -0,0 +1,24 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: OTHelp Plug-in
+Bundle-SymbolicName: org.eclipse.objectteams.otdt.ui.help;singleton:=true
+Bundle-Version: 1.4.0.qualifier
+Bundle-Activator: org.eclipse.objectteams.otdt.ui.help.OTHelpPlugin
+Bundle-Vendor: The TOPPrax consortium
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.objectteams.otdt.ui,
+ org.eclipse.ui.intro,
+ org.eclipse.ui.cheatsheets,
+ org.eclipse.help,
+ org.eclipse.core.resources,
+ org.eclipse.jdt.core,
+ org.eclipse.ui.ide,
+ org.eclipse.ui.browser
+Bundle-ActivationPolicy: lazy
+Bundle-Classpath: otdtuihelp.jar
+Export-Package: org.eclipse.objectteams.otdt.ui.help,
+ org.eclipse.objectteams.otdt.ui.help.actions,
+ org.eclipse.objectteams.otdt.ui.help.views
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/book.css b/plugins/org.eclipse.objectteams.otdt.ui.help/book.css
new file mode 100644
index 000000000..59c346d5a
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/book.css
@@ -0,0 +1 @@
+P.Code { display: block; text-align: left; text-indent: 0.00pt; margin-top: 0.000000pt; margin-bottom: 0.000000pt; margin-right: 0.000000pt; margin-left: 15pt; font-size: 10.000000pt; font-weight: medium; font-style: Regular; color: #4444CC; text-decoration: none; vertical-align: baseline; text-transform: none; font-family: "Courier New"; } H6.CaptionFigColumn { display: block; text-align: left; text-indent: 0.000000pt; margin-top: 3.000000pt; margin-bottom: 11.000000pt; margin-right: 0.000000pt; margin-left: 0.000000pt; font-size: 9.000000pt; font-weight: medium; font-style: Italic; color: #000000; text-decoration: none; vertical-align: baseline; text-transform: none; font-family: "Arial"; } P.Note { display: block; text-align: left; text-indent: 0pt; margin-top: 19.500000pt; margin-bottom: 19.500000pt; margin-right: 0.000000pt; margin-left: 30pt; font-size: 11.000000pt; font-weight: medium; font-style: Italic; color: #000000; text-decoration: none; vertical-align: baseline; text-transform: none; font-family: "Arial"; } EM.UILabel { font-weight: Bold; font-style: Regular; text-decoration: none; vertical-align: baseline; text-transform: none; } EM.CodeName { font-weight: Bold; font-style: Regular; text-decoration: none; vertical-align: baseline; text-transform: none; font-family:"Courier New"; } /* following font face declarations need to be removed for DBCS */ body, h1, h2, h3, h4, h5, h6, p, table, td, caption, th, ul, ol, dl, li, dd, dt {font-family: Arial, Helvetica, sans-serif; color: #000000} pre { font-family: Courier, monospace} /* end font face declarations */ /* following font size declarations should be OK for DBCS */ body, h1, h2, h3, h4, h5, h6, p, table, td, caption, th, ul, ol, dl, li, dd, dt {font-size: 10pt; } pre { font-size: 10pt} /* end font size declarations */ body { background: #FFFFFF} h1 { font-size: 18pt; margin-top: 5; margin-bottom: 1 } h2 { font-size: 14pt; margin-top: 25; margin-bottom: 3 } h3 { font-size: 11pt; margin-top: 20; margin-bottom: 3 } h4 { font-size: 10pt; margin-top: 20; margin-bottom: 3; font-style: italic } p { margin-top: 10px; margin-bottom: 10px } pre { margin-left: 6; font-size: 9pt } a:link { color: #0000FF } a:hover { color: #000080 } a:visited { text-decoration: underline } ul { margin-top: 0; margin-bottom: 10 } li { margin-top: 0; margin-bottom: 0 } li p { margin-top: 0; margin-bottom: 0 } ol { margin-top: 0; margin-bottom: 10 } dl { margin-top: 0; margin-bottom: 10 } dt { margin-top: 0; margin-bottom: 0; font-weight: bold } dd { margin-top: 0; margin-bottom: 0 } strong { font-weight: bold} em { font-style: italic} var { font-style: italic} div.revision { border-left-style: solid; border-left-width: thin; border-left-color: #7B68EE; padding-left:5 } th { font-weight: bold } img { border:0px; vertical-align:middle; } \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/build.properties b/plugins/org.eclipse.objectteams.otdt.ui.help/build.properties
new file mode 100644
index 000000000..0bfc345d9
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/build.properties
@@ -0,0 +1,44 @@
+########################################################################
+# This file is part of "Object Teams Development Tooling"-Software
+#
+# Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
+# for its Fraunhofer Institute and Computer Architecture and Software
+# Technology (FIRST), Berlin, Germany and Technical University Berlin,
+# Germany.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+# $Id: build.properties 23366 2010-01-28 00:23:03Z stephan $
+#
+# Please visit http://www.objectteams.org for updates and contact.
+#
+# Contributors:
+# Fraunhofer FIRST - Initial API and implementation
+# Technical University Berlin - Initial API and implementation
+########################################################################
+customBuildCallbacks=customBuildCallbacks.xml
+source.. = src/
+output.. = bin/
+bin.includes = plugin.xml,\
+ META-INF/,\
+ .,\
+ cheatsheets/,\
+ css/,\
+ guide/,\
+ icons/,\
+ images/,\
+ intro/,\
+ plugin.properties,\
+ ot.html,\
+ otdtuihelp.jar,\
+ reference/,\
+ book.css,\
+ schema.css
+src.includes = .classpath,\
+ .project,\
+ build.properties
+jars.compile.order = otdtuihelp.jar
+source.otdtuihelp.jar = src/
+output.otdtuihelp.jar = bin/
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/buildDoc.xml b/plugins/org.eclipse.objectteams.otdt.ui.help/buildDoc.xml
new file mode 100644
index 000000000..40958aea0
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/buildDoc.xml
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="OTDT Doc Isv Build" default="all" basedir="." >
+
+ <target name="init">
+ <available file="${basedir}/index" property="index.present"/>
+ </target>
+
+ <target name="all" depends="init" unless="index.present">
+ <antcall target="convertSchemaToHtml" />
+ <!--antcall target="generateJavadoc" /-->
+ <!--antcall target="build.index" /-->
+ <!--antcall target="createDocZip" /-->
+ </target>
+
+
+ <target name="build.index" description="Builds search index for the plug-in: org.eclipse.objectteams.otdt.ui.help" if="eclipse.running">
+ <help.buildHelpIndex manifest="${basedir}/plugin.xml" destination="${basedir}"/>
+ </target>
+
+ <target name="convertSchemaToHtml" if="eclipse.running">
+ <property name="dest" value="reference/extension-points" />
+ <record name="${basedir}/otdtconvert.txt" action="start"/>
+ <echo message="recording schema conversion ... in ${basedir}/otdtconvert.txt"/>
+
+ <pde.convertSchemaToHTML
+ manifest="../org.eclipse.objectteams.otequinox/plugin.xml"
+ destination="${dest}"/>
+ <!--cssURL="file:../../css/schema.css" broken see https://bugs.eclipse.org/300826 -->
+
+ <echo message="done recording schema conversion in ${basedir}/otdtconvert.txt"/>
+
+ <record name="${basedir}/otdtconvert.txt" action="stop"/>
+ </target>
+
+ <target name="getJavadocPath">
+ <available file="${java.home}/../bin/javadoc.exe" property="javadoc" value="${java.home}/../bin/javadoc.exe"/>
+ <available file="${java.home}/../bin/javadoc" property="javadoc" value="${java.home}/../bin/javadoc" />
+ </target>
+
+
+ <target name="generateJavadoc" depends="getJavadocPath" if="javadoc">
+
+ <!--HACK to ensure the platform doc is built before JDT - call to this script should be moved to build.jars target-->
+ <available file="../org.eclipse.platform.doc.isv/index" property="platform.index.present"/>
+ <antcall target="buildPlatformDoc" />
+
+ <property name="optionsFile" value="jdtOptions.tmp.txt" />
+ <copy file="jdtOptions.txt" tofile="${optionsFile}" overwrite="true" />
+
+ <condition property="argsListDelimiter" value=":">
+ <os family="unix" />
+ </condition>
+ <condition property="argsListDelimiter" value=";">
+ <os family="windows" />
+ </condition>
+
+ <replaceregexp file="${basedir}/${optionsFile}" flags="g" match="(\r\n?|\n);" replace="${argsListDelimiter}" />
+ <replace file="${basedir}/${optionsFile}" token="@rt@" value="${bootclasspath}" />
+ <replace file="${basedir}/${optionsFile}" token="@baseLocation@" value="${baseLocation}" />
+
+
+ <!--scrub isv plugin directories of any preexisting api doc content-->
+ <delete dir="reference/api"/>
+ <mkdir dir="reference/api"/>
+
+ <exec dir="." executable="${javadoc}" output="doc.bin.log">
+ <arg line="@${basedir}/${optionsFile} -J-Xmx500M" />
+ </exec>
+ <antcall target="generateJdtAptJavadoc" />
+ </target>
+
+ <target name="generateJdtAptJavadoc">
+ <property name="javadoc15" value="${javadoc}" />
+
+ <property name="jdtaptoptionsFile" value="jdtaptOptions.tmp.txt" />
+ <copy file="jdtaptOptions.txt" tofile="${jdtaptoptionsFile}" overwrite="true" />
+
+ <condition property="argsListDelimiter" value=":">
+ <os family="unix" />
+ </condition>
+ <condition property="argsListDelimiter" value=";">
+ <os family="windows" />
+ </condition>
+
+ <replaceregexp file="${basedir}/${jdtaptoptionsFile}" flags="g" match="(\r\n?|\n);" replace="${argsListDelimiter}" />
+ <replace file="${basedir}/${jdtaptoptionsFile}" token="@rt@" value="${bootclasspath}" />
+
+ <!--scrub isv plugin directories of any preexisting api doc content-->
+ <delete dir="reference/apt" />
+ <mkdir dir="reference/apt" />
+
+ <exec dir="." executable="${javadoc15}" output="jdtapt.doc.bin.log">
+ <arg line="@${basedir}/${jdtaptoptionsFile} -J-Xmx500M" />
+ </exec>
+ </target>
+
+ <target name="buildPlatformDoc" unless="platform.index.present">
+ <ant antfile="buildDoc.xml" dir="../org.eclipse.platform.doc.isv" />
+ </target>
+
+ <target name="createDocZip">
+ <zip zipfile="${basedir}/doc.zip"
+ basedir="${basedir}"
+ includes="book.css, cpy.png, notices.html, about.html, no_help_exists.htm, concepts/**, gettingStarted/**, images/**, reference/**, tasks/**,samples/**,guide/**,questions/**"
+ />
+ </target>
+
+</project> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/cheatsheets/SimpleOTApplication.xml b/plugins/org.eclipse.objectteams.otdt.ui.help/cheatsheets/SimpleOTApplication.xml
new file mode 100644
index 000000000..45c6b130e
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/cheatsheets/SimpleOTApplication.xml
@@ -0,0 +1,172 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<cheatsheet title="Simple Object Teams Program">
+
+ <intro
+ href="/org.eclipse.platform.doc.user/reference/ref-cheatsheets.htm">
+ <description>
+ Welcome to the Object Teams tutorial.
+ It will help you build a small Object Teams program.
+ You will create an <b>Object Teams project</b>, a <b>Base class</b>,
+ a <b>Team class</b> and a <b>Role class</b> which contains two
+ kinds of bindings: a <b>callout binding</b> and a <b>callin binding</b>.
+ Let's get started!
+ </description>
+ </intro>
+
+ <item
+ href="/org.eclipse.platform.doc.user/concepts/concepts-4.htm"
+ title="Open the Object Teams Perspective">
+ <action
+ pluginId="org.eclipse.ui.cheatsheets"
+ class="org.eclipse.ui.internal.cheatsheets.actions.OpenPerspective"
+ param1="org.eclipse.objectteams.otdt.ui.OTJavaPerspective"/>
+ <description>
+ Select <b>Window-&gt;Open Perspective-&gt;Object Teams</b> in the menubar at
+ the top of the workbench. This step changes the perspective to
+ set up the Eclipse workbench for Object Teams development. You can
+ click the "Click to Perform" button to have the "Object Teams"
+ perspective opened automatically.
+ </description>
+ </item>
+
+ <item
+ title="Create an Object Teams Project"
+ skip="true">
+ <action
+ pluginId="org.eclipse.objectteams.otdt.ui"
+ class="org.eclipse.objectteams.otdt.internal.ui.wizards.OpenOTProjectWizardAction"/>
+ <description>
+ The first thing you will need is an Object Teams project. If you
+ already have an Object Teams project in your workspace that you
+ would like to use, you may skip this step by clicking the
+ "Click to Skip" button. If not, select <b>File-&gt;New-&gt;Project...</b>
+ and choose <b>Object Teams Project</b> in the list. Complete the subsequent
+ pages as required. The "New Object Teams Project" wizard will be automatically
+ displayed when you click the "Click to Perform" button.
+ After creating the project, it will appear in the <b>OT Package Explorer</b>
+ view. Select the project by clicking it with the mouse, so that the next actions
+ will know that they apply to this project.
+ </description>
+ </item>
+
+ <item
+ href="/org.eclipse.jdt.doc.user/gettingStarted/qs-9.htm"
+ title="Create a Base class"
+ skip="true">
+ <action
+ pluginId="org.eclipse.jdt.ui"
+ class="org.eclipse.jdt.ui.actions.OpenNewClassWizardAction"/>
+ <description>
+ You should now have an Object Teams project in your workspace. The
+ next step in building your Object Teams application is to first
+ create a normal (Base) class. You may do this by either clicking
+ the "Click to Perform" button below to launch the "New Java Class"
+ wizard, or you may use the Eclipse tools to do it, by using the
+ <b>File-&gt;New-&gt;Class</b> action. Name your class for example
+ "<b>MyBase</b>". If you do not use the "Click to Perform" button below,
+ click the "Click to Skip" button to advance to the next step in
+ building your Object Teams application.
+ </description>
+ </item>
+
+ <item
+ title="Add two methods to your Base class">
+ <description>
+ Now that you have your MyBase class, add, e.g., the following two
+ methods:
+ <br/><b>public void hello() { System.out.println("Hello"); }</b><br/>
+ and
+ <br/><b>public String getWorld() { return "World"; }</b><br/>
+ and save your changes. The first method will be used in a callin binding,
+ the other in a callout binding. These bindings will be members of a
+ Role class which you are going to create in a minute. Click the
+ "Click to Complete" button below when finished.
+ </description>
+ </item>
+
+ <item
+ title="Create a Team class"
+ skip="true">
+ <action
+ pluginId="org.eclipse.objectteams.otdt.ui"
+ class="org.eclipse.objectteams.otdt.internal.ui.wizards.OpenTeamWizardAction"/>
+ <description>
+ The next step in building your Object Teams application is to create a
+ Team class, which is going to be the enclosing context for the Role class.
+ You may do this by either clicking the "Click to Perform" button
+ below to launch the "New Team Class wizard", or you may use the Eclipse
+ tools to do it, by using the <b>File-&gt;New-&gt;Team</b> action.
+ Name your class, e.g. "<b>MyTeam</b>". If you do not use the "Click to Perform"
+ button below, click the "Click to Skip" button to advance to the next
+ step in building your Object Teams application.
+ </description>
+ </item>
+
+ <item
+ title="Create a Role class"
+ skip="true">
+ <action
+ pluginId="org.eclipse.objectteams.otdt.ui"
+ class="org.eclipse.objectteams.otdt.internal.ui.wizards.OpenRoleWizardAction"/>
+ <description>
+ The next step in building your Object Teams application is to create a
+ Role class for the previously created Team class.
+ You may do this by either clicking the "Click to Perform" button
+ below to launch the New Role Class wizard, or you may use the Eclipse
+ tools to do it, by using the <b>File-&gt;New-&gt;Role</b> action.
+ Name your class, e.g. "<b>MyRole</b>". Enter the name of the enclosing Team
+ you have created before, in this case "MyTeam". Now bind the Role class to
+ your previously created Base class, either by typing in its name ("MyBase")
+ into the designated input field, or by choosing the Base class after clicking
+ the "Browse..." button next to the input field. If you do not use the "Click
+ to Perform" button below, click the "Click to Skip" button to advance to the
+ next step.
+ </description>
+ </item>
+
+ <item
+ title="Add two methods and two different bindings to your Role class">
+ <description>
+ Now that you have your "MyRole" class, add, e.g., the following two
+ methods:
+ <br/><b>public abstract String getAddressee();</b><br/>
+ and
+ <br/><b>public void greet() { System.out.println(getAddressee()); }</b><br/>
+ These are the Role methods that will be bound in a callout and callin
+ binding respectively. Let's add a callout binding:
+ <br/><b>getAddressee -&gt; getWorld;</b><br/>
+ and a callin binding:
+ <br/><b>greet &lt;- after hello;</b><br/>
+ and save your changes. Click the "Click to Complete" button below when finished.
+ </description>
+ </item>
+
+ <item
+ title="Add a main method.">
+ <description>
+ In order to complete your application, add a main method to your Team class:
+ <br/><b>public static void main(String[] args) {</b>
+ <br/><b>MyTeam myTeam = new MyTeam();</b>
+ <br/><b>myTeam.activate();</b>
+ <br/><b>new MyBase().hello();</b>
+ <br/><b>}</b><br/>
+ Click the "Click to Complete" button below when finished.
+ </description>
+ </item>
+
+ <item
+ href="/org.eclipse.jdt.doc.user/gettingStarted/qs-12.htm"
+ title="Tutorial finished!">
+ <description>
+ Congratulations! You have built your first Object Teams program. Now let's run it!
+ Open the <b>Run-Configuration</b> by choosing in the menubar <b>Run->Run...</b>.
+ Select <b>New Object Teams Application</b>
+ and click the "New" button at the bottom. Your project's name and main-class should
+ already be in place, otherwise please add them manually. All other settings can keep
+ their defaults, so simply press the <b>Run</b> button and watch the <b>Console</b>
+ view appear, showing the application's output!
+ That's it, you are now ready for Object Teams development!
+ </description>
+ </item>
+
+</cheatsheet> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/css/book.css b/plugins/org.eclipse.objectteams.otdt.ui.help/css/book.css
new file mode 100644
index 000000000..59c346d5a
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/css/book.css
@@ -0,0 +1 @@
+P.Code { display: block; text-align: left; text-indent: 0.00pt; margin-top: 0.000000pt; margin-bottom: 0.000000pt; margin-right: 0.000000pt; margin-left: 15pt; font-size: 10.000000pt; font-weight: medium; font-style: Regular; color: #4444CC; text-decoration: none; vertical-align: baseline; text-transform: none; font-family: "Courier New"; } H6.CaptionFigColumn { display: block; text-align: left; text-indent: 0.000000pt; margin-top: 3.000000pt; margin-bottom: 11.000000pt; margin-right: 0.000000pt; margin-left: 0.000000pt; font-size: 9.000000pt; font-weight: medium; font-style: Italic; color: #000000; text-decoration: none; vertical-align: baseline; text-transform: none; font-family: "Arial"; } P.Note { display: block; text-align: left; text-indent: 0pt; margin-top: 19.500000pt; margin-bottom: 19.500000pt; margin-right: 0.000000pt; margin-left: 30pt; font-size: 11.000000pt; font-weight: medium; font-style: Italic; color: #000000; text-decoration: none; vertical-align: baseline; text-transform: none; font-family: "Arial"; } EM.UILabel { font-weight: Bold; font-style: Regular; text-decoration: none; vertical-align: baseline; text-transform: none; } EM.CodeName { font-weight: Bold; font-style: Regular; text-decoration: none; vertical-align: baseline; text-transform: none; font-family:"Courier New"; } /* following font face declarations need to be removed for DBCS */ body, h1, h2, h3, h4, h5, h6, p, table, td, caption, th, ul, ol, dl, li, dd, dt {font-family: Arial, Helvetica, sans-serif; color: #000000} pre { font-family: Courier, monospace} /* end font face declarations */ /* following font size declarations should be OK for DBCS */ body, h1, h2, h3, h4, h5, h6, p, table, td, caption, th, ul, ol, dl, li, dd, dt {font-size: 10pt; } pre { font-size: 10pt} /* end font size declarations */ body { background: #FFFFFF} h1 { font-size: 18pt; margin-top: 5; margin-bottom: 1 } h2 { font-size: 14pt; margin-top: 25; margin-bottom: 3 } h3 { font-size: 11pt; margin-top: 20; margin-bottom: 3 } h4 { font-size: 10pt; margin-top: 20; margin-bottom: 3; font-style: italic } p { margin-top: 10px; margin-bottom: 10px } pre { margin-left: 6; font-size: 9pt } a:link { color: #0000FF } a:hover { color: #000080 } a:visited { text-decoration: underline } ul { margin-top: 0; margin-bottom: 10 } li { margin-top: 0; margin-bottom: 0 } li p { margin-top: 0; margin-bottom: 0 } ol { margin-top: 0; margin-bottom: 10 } dl { margin-top: 0; margin-bottom: 10 } dt { margin-top: 0; margin-bottom: 0; font-weight: bold } dd { margin-top: 0; margin-bottom: 0 } strong { font-weight: bold} em { font-style: italic} var { font-style: italic} div.revision { border-left-style: solid; border-left-width: thin; border-left-color: #7B68EE; padding-left:5 } th { font-weight: bold } img { border:0px; vertical-align:middle; } \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/css/graphics/obj_48/ot_obj.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/css/graphics/obj_48/ot_obj.gif
new file mode 100644
index 000000000..b6f6134a3
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/css/graphics/obj_48/ot_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/css/graphics/obj_48/othov_obj.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/css/graphics/obj_48/othov_obj.gif
new file mode 100644
index 000000000..28296c1fa
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/css/graphics/obj_48/othov_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/css/graphics/obj_48/otjdev_obj.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/css/graphics/obj_48/otjdev_obj.gif
new file mode 100644
index 000000000..f6526a2de
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/css/graphics/obj_48/otjdev_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/css/graphics/obj_48/otjdevhov_obj.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/css/graphics/obj_48/otjdevhov_obj.gif
new file mode 100644
index 000000000..36b47d3b5
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/css/graphics/obj_48/otjdevhov_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/css/ot-overview.properties b/plugins/org.eclipse.objectteams.otdt.ui.help/css/ot-overview.properties
new file mode 100644
index 000000000..a8ed06dfe
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/css/ot-overview.properties
@@ -0,0 +1,37 @@
+###############################################################################
+# Copyright (c) 2000, 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
+# $Id$
+#
+# Please visit http://www.eclipse.org/objectteams for updates and contact.
+#
+# Contributors:
+# IBM Corporation - initial API and implementation
+# Fraunhofer FIRST - Initial API and implementation
+# Technical University Berlin - Initial API and implementation
+###############################################################################
+
+overview.page-content.overview-links.java.link-icon = css/graphics/obj_48/javadev_obj.gif
+
+tutorials.page-content.java.layout.ncolumns = 2
+tutorials.page-content.java.hello-world.link-icon = css/graphics/obj_48/javaapp_obj.gif
+tutorials.page-content.java.applet.link-icon = css/graphics/obj_48/javaapplet_obj.gif
+tutorials.page-content.java.swt.link-icon = css/graphics/obj_48/swtapp_obj.gif
+tutorials.page-content.java.ant.link-icon = css/graphics/obj_48/script_obj.gif
+
+
+otdt-root.page-content.layout.vspacing = 5
+
+otdt-root.page-content.ot-motivation.layout.vspacing = 5
+otdt-root.page-content.ot-motivation.layout.ncolumns = 1
+otdt-root.page-content.ot-motivation.moti.layout.vspacing = 5
+otdt-root.page-content.ot-motivation.moti.layout.ncolumns = 1
+
+otdt-root.page-content.ot-keyfeatures.layout.vspacing = 5
+otdt-root.page-content.ot-keyfeatures.layout.ncolumns = 1
+otdt-root.page-content.ot-keyfeatures.features.layout.vspacing = 5
+otdt-root.page-content.ot-keyfeatures.features.layout.ncolumns = 1
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/css/overview.css b/plugins/org.eclipse.objectteams.otdt.ui.help/css/overview.css
new file mode 100644
index 000000000..238d3a639
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/css/overview.css
@@ -0,0 +1,75 @@
+body {
+ background-image : url(../graphics/contentpage/overview_wtr.jpg);
+}
+
+.page { min-height : 700px; }
+
+/* show the "selected" image for this page */
+#navigation-links a#overview img, #navigation-links a#overview:hover img { background-image : url(../graphics/icons/ctool/overview48sel.gif); }
+
+/*
+ * Set up the Overview links to be displayed in two columns
+ * that are centered in the middle of the page.
+ */
+
+#overview-links {
+ text-align : left;
+ width : 760px;
+ /* To center in Moz (have to use text-align for IE) */
+ margin : 0px auto;
+}
+
+#overview-links a {
+ width : 370px;
+ text-align : left;
+ margin-left : 5px;
+ margin-right : 5px;
+ margin-top : 5px;
+ margin-bottom : -20px;
+ vertical-align : top;
+}
+
+#overview-links > a { vertical-align : middle; }
+
+#overview-links a img {
+ height : 57px;
+ width : 57px;
+ vertical-align : middle;
+}
+
+#overview-links a .link-label {
+ display : block;
+ width : 300px;
+ position : relative;
+ top : -50px;
+ left : 60px;
+}
+
+#overview-links a p .text {
+ display : block;
+ width : 300px;
+ position : relative;
+ top : -45px;
+ left : 53px;
+}
+
+/* Special case for Mozilla, because the links are displayed
+ in 1 vertical column instead of 2 centered columns */
+#overview-links > a { width : 700px; }
+#overview-links a > .link-label { width : 700px; }
+#overview-links a p > .text { width : 700px; }
+
+#overview-links a:hover { border-right : 5px; }
+
+a#basics img { background-image : url(../graphics/icons/obj48/wbbasics_obj.gif); }
+a#basics:hover img { background-image : url(../graphics/icons/obj48/wbbasicshov_obj.gif); }
+
+a#team img { background-image : url(../graphics/icons/obj48/teamsup_obj.gif); }
+a#team:hover img { background-image : url(../graphics/icons/obj48/teamsuphov_obj.gif); }
+
+
+
+/* Object Teams stuff */
+#h1 {color:#000000; font-weight:bold; font-size:18px;}
+#h2 {color:#000000; font-weight:bold; font-size:14px;}
+#h3 {color:#000000; font-weight:bold; font-size:12px;} \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/css/root.css b/plugins/org.eclipse.objectteams.otdt.ui.help/css/root.css
new file mode 100644
index 000000000..637c071e2
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/css/root.css
@@ -0,0 +1,200 @@
+/*
+ * Set up general font colours, sizes, etc. Some of these will override
+ * settings from the shared CSS
+ */
+.intro-header H1 {
+ font-size : 18pt;
+}
+
+#page-links a .link-label, #action-links a .link-label {
+ font-size : 13pt;
+ font-weight : 600;
+ color : #E5E5E5;
+}
+
+#page-links a p .text, #action-links a p .text {
+ font-size : 13pt;
+ font-weight : 500;
+ color : #E5E5E5;
+}
+
+/*
+ * Set up the content for the otdt-root page.
+ */
+body {
+padding:1em;
+ min-width : 770px;
+ /* since IE doesn't support min-width, use expression */
+ width:expression(document.body.clientWidth < 770? "770px": "auto" );
+ background-image : url(graphics/otdt-rootpage/background.jpg);
+ background-repeat : no-repeat;
+ background-position : top left;
+ background-color : #FFFFFF;
+
+}
+
+#otdt-root {
+ background-image : url(graphics/otdt-rootpage/brandmark.gif);
+ background-repeat : no-repeat;
+ background-position : bottom left;
+ min-height : 450px;
+ height : 100%;
+ height : expression(document.body.clientHeight < 450? "450px": "100%" );
+}
+/*
+ * Set up the navigation bar. It should be centered in the middle
+ * of the page
+ */
+
+#links-background {
+ background-image : url(graphics/otdt-rootpage/dots.gif);
+ background-repeat : repeat-x;
+ width : 100%;
+ height : 177px;
+ margin-top : 18%;
+ margin-bottom : auto;
+ text-align : center;
+}
+
+/* specify a width for Moz so we can center.
+ * **Important** If additional links are added, we will have to increase this width
+ * to accomodate them, otherwise they will wrap to a new line
+ */
+#links-background > #page-links {
+ width : 33em;
+ margin : 0 auto;
+}
+
+#page-links { position : relative; top : 50px; }
+
+#page-links a {
+ position : relative;
+ width : 7em;
+ margin-left : 0.5em;
+ margin-right : 0.5em;
+ text-align : center;
+ vertical-align : top;
+}
+
+/* float left for Moz so the items all appear inline */
+#page-links > a { float : left; position : relative; }
+
+#page-links a img {
+ height : 82px;
+ width : 82px;
+ vertical-align : middle;
+}
+
+/* remove the hover image from the flow of the document,
+ so it doesn't take up space and change the position
+ of the link label and descriptions */
+#page-links a .background-image { position : absolute; }
+
+/* protect against very long labels in IE */
+#page-links a .link-label { word-wrap : break-word; }
+
+#page-links a span {
+ display : block;
+ margin : 0px;
+ padding : 0px;
+}
+
+/* properly align the link text based on class (left vs. right) */
+#page-links a.left p { text-align : left;}
+#page-links a.left span { text-align : left; margin-left : 15px; }
+
+#page-links a.right p { text-align : right;}
+#page-links a.right .link-label { text-align : right; margin-right : 15px; }
+#page-links a.right p .text { position : relative; right : 15px;}
+
+/* hide the link label until users hover over the link */
+#page-links a .link-label { padding-top : 20px; visibility : hidden; }
+#page-links a:hover .link-label,
+#page-links a:focus .link-label,
+#page-links a:active .link-label { visibility : visible; }
+
+/* hide the description until users hover over the link */
+#page-links a p .text { display : none; }
+#page-links a:hover p .text {
+ display : block;
+ width : 15em;
+ position : absolute;
+}
+
+#page-links a:hover,
+#page-links a:focus { border : 0px; }
+
+#page-links a:hover p,
+#page-links a:focus p,
+#page-links a:active p { margin : 0px; padding : 0px; }
+
+/* properties for each of the page-links */
+a#overview .background-image { background-image : url(graphics/icons/ctool/overview72.gif); visibility : hidden; }
+a#tutorials .background-image { background-image : url(graphics/icons/ctool/tutorials72.gif); visibility : hidden; }
+a#samples .background-image { background-image : url(graphics/icons/ctool/samples72.gif); visibility : hidden; }
+a#news .background-image { background-image : url(graphics/icons/ctool/whatsnew72.gif); visibility : hidden; }
+
+/* show the hover image on hover, focus, and active */
+#page-links a:hover .background-image,
+#page-links a:focus .background-image,
+#page-links a:active .background-image { visibility : visible; }
+
+/*
+ * Set up the action links
+ */
+#action-links {
+ width : 98%;
+ position : absolute;
+ left : 0px;
+ top : 20px;
+}
+
+#action-links a#workbench {
+ position : absolute;
+ top : -16px;
+ right : -8px;
+ text-align : right;
+}
+
+#action-links a .background-image,
+#action-links a #workbench_img {
+ height : 53px;
+ width : 53px;
+ text-align : center;
+ vertical-align : top;
+}
+/* special case for mozilla */
+#action-links a > .background-image,
+#action-links a > #workbench_img { vertical-align : middle; }
+
+/* remove the hover image from the flow of the document,
+ so it doesn't take up space and change the position
+ of the main image */
+#action-links a .background-image {
+ position : absolute;
+}
+#action-links a#workbench .background-image {
+ background-image : url(graphics/icons/ctool/wb48.gif);
+ visibility : hidden;
+}
+
+#action-links a#workbench:hover .background-image,
+#action-links a#workbench:focus .background-image,
+#action-links a#workbench:active .background-image {
+ visibility : visible;
+}
+
+/* hide the link and description until users hover over the link */
+#action-links a p .text, #action-links a .link-label { display : none; }
+
+#action-links a:hover .link-label,
+#action-links a:focus .link-label,
+#action-links a:active .link-label { display : block; width : 16em; }
+
+#action-links a:hover p .text,
+#action-links a:focus p .text,
+#action-links a:active p .text { display : block; width : 16em; }
+
+#action-links a:hover,
+#action-links a:focus,
+#action-links a:active { border-right : 0px; }
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/css/root_swt.properties b/plugins/org.eclipse.objectteams.otdt.ui.help/css/root_swt.properties
new file mode 100644
index 000000000..d086308ea
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/css/root_swt.properties
@@ -0,0 +1,29 @@
+
+otdt-root.links-background.page-links.overview.link-icon = css/graphics/icons/etool/overview72.gif
+otdt-root.links-background.page-links.tutorials.link-icon = css/graphics/icons/etool/tutorials72.gif
+otdt-root.links-background.page-links.samples.link-icon= css/graphics/icons/etool/samples72.gif
+otdt-root.links-background.page-links.news.link-icon = css/graphics/icons/etool/whatsnew72.gif
+otdt-root.action-links.workbench.link-icon = css/graphics/icons/etool/wb48.gif
+
+otdt-root.links-background.page-links.overview.hover-icon = css/graphics/icons/ctool/overview72.gif
+otdt-root.links-background.page-links.tutorials.hover-icon = css/graphics/icons/ctool/tutorials72.gif
+otdt-root.links-background.page-links.samples.hover-icon = css/graphics/icons/ctool/samples72.gif
+otdt-root.links-background.page-links.news.hover-icon = css/graphics/icons/ctool/whatsnew72.gif
+otdt-root.action-links.workbench.hover-icon = css/graphics/icons/ctool/wb48.gif
+
+
+otdt-root.links-background.page-links.overview.small-link-icon = css/graphics/icons/etool/overview48.gif
+otdt-root.links-background.page-links.tutorials.small-link-icon = css/graphics/icons/etool/tutorials48.gif
+otdt-root.links-background.page-links.samples.small-link-icon = css/graphics/icons/etool/samples48.gif
+otdt-root.links-background.page-links.news.small-link-icon = css/graphics/icons/etool/whatsnew48.gif
+otdt-root.action-links.workbench.small-link-icon = css/graphics/icons/etool/wb48.gif
+
+otdt-root.links-background.page-links.overview.small-hover-icon = css/graphics/icons/ctool/overview48.gif
+otdt-root.links-background.page-links.tutorials.small-hover-icon = css/graphics/icons/ctool/tutorials48.gif
+otdt-root.links-background.page-links.samples.small-hover-icon = css/graphics/icons/ctool/samples48.gif
+otdt-root.links-background.page-links.news.small-hover-icon = css/graphics/icons/ctool/whatsnew48.gif
+otdt-root.action-links.workbench.small-hover-icon = css/graphics/icons/ctool/wb48.gif
+
+otdt-root.layout.ncolumns = 1
+otdt-root.links-background.page-links.layout.hspacing = 10
+otdt-root.layout.vspacing = 10
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/css/shared.css b/plugins/org.eclipse.objectteams.otdt.ui.help/css/shared.css
new file mode 100644
index 000000000..00de42096
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/css/shared.css
@@ -0,0 +1,217 @@
+/*
+ * Set up general fonts, sizes and colors
+ */
+body { font-family : Arial, sans-serif; }
+
+H1, H2, H3, H4, p, a { color : #4D4D4D; }
+
+.intro-header H1 {
+ font-size : 16pt;
+ font-weight : normal;
+ color : #E5E5E5;
+}
+
+h2 {
+ font-size : 13pt;
+ font-weight : normal;
+ color : #7B8694;
+}
+/* For regular div labels */
+H4 .div-label {
+ font-size : 10pt;
+ font-weight : bold;
+}
+
+/* For the main page content's title */
+#content-header H4 .div-label {
+ font-size : 14pt;
+ font-weight : normal;
+ color : #8C96A2;
+ float : none;
+ clear : both;
+}
+
+.page-description {
+ font-size : 10pt;
+ float : none;
+ clear : both;
+}
+
+a {
+ font-weight : bold;
+ text-decoration : none;
+ color : #4D4D4D;
+}
+
+a .link-label {
+ font-size : 10pt;
+ font-weight : normal;
+}
+
+#navigation-links a .link-label {
+ font-size : 9pt;
+ font-weight : normal;
+ color : #E5E5E5;
+}
+
+a .text {
+ font-size : 8pt;
+ font-weight : normal;
+}
+
+p .group-description {
+ font-size : 10pt;
+ font-weight : normal;
+}
+
+
+/*
+ * Set up other general properties like padding/margins
+ */
+html, body { width : 100%; height : 100%; }
+
+html, body, div, h1, h4, p, a { margin : 0px; padding : 0px; }
+
+.intro-header H1 { padding-top : 10px; margin-left : 10px; }
+
+/* For regular div labels */
+#page-content div H4 {
+ padding : 10px;
+ padding-bottom : 0px;
+}
+
+/* For the main page content's div label */
+#page-content #content-header H4 {
+ padding-bottom : 10px;
+ padding-top : 0px;
+}
+
+/* special case for Mozilla's main content-header label.
+ Mozilla 1.4 needs more room at the top */
+#page-content > #content-header H4 { padding-top : 10px; }
+
+/* Needed in IE to get shift+tab to show the active image properly */
+a:active {
+ border : solid 0px;
+}
+
+a img {
+ border-width : 0;
+ background-repeat : no-repeat;
+}
+
+/*
+ * to get scrollbars working in both IE and Mozilla
+ */
+html,body { overflow: auto; }
+html>body { overflow: visible; }
+
+/*
+ * Set up the body, decorative background, and navigation for the content
+ * pages.
+ * Note: the root page handles its own background and navigation; these
+ * settings primarily apply to the content pages
+ */
+body {
+ background-color : #FFFFFF;
+ background-repeat : no-repeat;
+ background-position : bottom right;
+}
+
+
+
+.intro-header { background-color : transparent; z-index : 100;}
+
+body, .page{
+ min-width : 770px;
+ /* since IE doesn't support min-width, try expression */
+ width:expression(document.body.clientWidth < 770? "770px": "auto" );
+ min-height : 425px;
+ height : 100%;
+ height : expression(document.body.clientHeight < 425? "425px": "100%" );
+}
+
+.page {
+ background-image : url(graphics/contentpage/wordmark.gif);
+ background-repeat : no-repeat;
+ background-position : bottom left;
+ min-height : 475px;
+}
+
+#page-content {
+ background-repeat : no-repeat;
+ background-position : bottom right;
+ height : 70%;
+}
+
+/*
+ * Lay out the navigation links
+ * (Root page does something similar for its navigation)
+ */
+#navigation-links {
+ position : relative;
+ left : 10px;
+ top : 5px;
+ height : 60;
+ width : 98%;
+}
+
+#navigation-links a {
+ padding-left : 5px;
+ padding-right : 5px;
+ float : left;
+ text-align : center;
+}
+
+#navigation-links a img {
+ height : 52px;
+ width : 52px;
+ vertical-align : middle;
+}
+
+#navigation-links a .link-label { display : block; margin-top : 5px;}
+
+#navigation-links a .text { display : none; }
+
+#navigation-links a:hover,
+#navigation-links a:focus
+#navigation-links a:active { border-right : 0px;}
+
+
+#navigation-links a#workbench { position : absolute; right : 0px; top : -35px; text-align : right;}
+#navigation-links a#workbench .text { display : none; }
+#navigation-links a#workbench img { background-image : url(graphics/icons/etool/wb48.gif); width : 53px; height : 53px;}
+#navigation-links a#workbench:hover img,
+#navigation-links a#workbench:focus img,
+#navigation-links a#workbench:active img { background-image : url(graphics/icons/ctool/wb48.gif); }
+
+/*
+ * Lay out the page title and description
+ */
+h1, p { margin-left : 10px; } /* required in mozilla so the page description is properly indented */
+
+/* position the page content so that the page title overlays the bottom
+ * of the background image, but make sure the content is always on top
+ * (using z-index) */
+#page-content {
+ float : none;
+ clear : both;
+ text-align : center;
+ margin-top : 35px;
+}
+
+.page > #page-content { margin-top : 50px; }
+
+#page-content p {
+ padding-bottom : 15px;
+ text-align : left;
+ float : none;
+ clear : both;
+}
+
+#page-content #content-header H4, .page-description {
+ text-align : left;
+ margin-right : 10px;
+ float : none;
+ clear : both;
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/css/swt.properties b/plugins/org.eclipse.objectteams.otdt.ui.help/css/swt.properties
new file mode 100644
index 000000000..b367cd840
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/css/swt.properties
@@ -0,0 +1,24 @@
+###############################################################################
+# Copyright (c) 2000, 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
+# $Id$
+#
+# Please visit http://www.eclipse.org/objectteams for updates and contact.
+#
+# Contributors:
+# IBM Corporation - initial API and implementation
+# Fraunhofer FIRST - Initial API and implementation
+# Technical University Berlin - Initial API and implementation
+###############################################################################
+tutorials.page-content.java.layout.ncolumns = 2
+
+overview.page-content.overview-links.otdt-root.link-icon = css/graphics/obj_48/otjdev_obj.gif
+tutorials.page-content.ot.ot-Tutorial.link-icon = css/graphics/obj_48/otjdev_obj.gif
+
+tutorials.ot-Tutorial.link-icon = intro/css/graphics/obj_48/otjdev_obj.gif
+tutorials.ot-Tutorial.hover-icon = intro/css/graphics/obj_48/otjdev_obj.gif
+ \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/css/tutorials.css b/plugins/org.eclipse.objectteams.otdt.ui.help/css/tutorials.css
new file mode 100644
index 000000000..c10889a33
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/css/tutorials.css
@@ -0,0 +1,3 @@
+
+a#ot-tutorial img { background-image : url(/graphics/obj_48/otjdev_obj.gif); }
+a#ot-tutorial:hover img { background-image : url(/graphics/obj_48/otjdevhov_obj.gif); }
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/customBuildCallbacks.xml b/plugins/org.eclipse.objectteams.otdt.ui.help/customBuildCallbacks.xml
new file mode 100644
index 000000000..4974688de
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/customBuildCallbacks.xml
@@ -0,0 +1,151 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- ===================================================================== -->
+<!-- Custom targets called from a project's generated build.xml -->
+<!-- Set customBuildCallbacks=<path/to/this/file> in your build.properties.-->
+<!-- ===================================================================== -->
+<project name="Build specific targets and properties" default="noDefault">
+
+ <!-- ===================================================================== -->
+ <!-- Default target -->
+ <!-- ===================================================================== -->
+ <target name="noDefault">
+ <echo message="This file must be called with explicit targets" />
+ </target>
+
+ <!-- ===================================================================== -->
+ <!-- Steps to do before the target build.jars -->
+ <!-- Available parameters : -->
+ <!-- build.result.folder - folder to contain the build results -->
+ <!-- ===================================================================== -->
+ <target name="pre.build.jars">
+ </target>
+
+ <!-- ===================================================================== -->
+ <!-- Steps to do after the target build.jars -->
+ <!-- Available parameters : -->
+ <!-- build.result.folder - folder to contain the build results -->
+ <!-- ===================================================================== -->
+ <target name="post.build.jars">
+ <ant antfile="buildDoc.xml" />
+ </target>
+
+ <!-- ===================================================================== -->
+ <!-- Steps to do before the target build.sources -->
+ <!-- Available parameters : -->
+ <!-- build.result.folder - folder to contain the build results -->
+ <!-- ===================================================================== -->
+ <target name="pre.build.sources">
+ </target>
+
+ <!-- ===================================================================== -->
+ <!-- Steps to do after the target build.sources -->
+ <!-- Available parameters : -->
+ <!-- build.result.folder - folder to contain the build results -->
+ <!-- ===================================================================== -->
+ <target name="post.build.sources">
+ </target>
+
+ <!-- ===================================================================== -->
+ <!-- Steps to do before the compilation target <name> -->
+ <!-- Substitute "name" with the name of the compilation target, eg @dot -->
+ <!-- Available parameters : -->
+ <!-- source.foldern : n = 1 ... N, the source folders -->
+ <!-- target.folder : where the results of the compilation go -->
+ <!-- <name>.classpath : name = name of the compilation target. A -->
+ <!-- reference to the classpath structure. -->
+ <!-- ===================================================================== -->
+ <target name="pre.activeHelpSample.jar">
+ </target>
+
+ <!-- ===================================================================== -->
+ <!-- Steps to do after compilation but before jaring -->
+ <!-- Substitute "name" with the name of the compilation target, eg @dot -->
+ <!-- Available parameters : -->
+ <!-- source.foldern : n = 1 ... N, the source folders -->
+ <!-- target.folder : where the results of the compilation go -->
+ <!-- <name>.classpath : name = name of the compilation target. A -->
+ <!-- reference to the classpath structure. -->
+ <!-- ===================================================================== -->
+ <target name="post.compile.activeHelpSample.jar">
+ </target>
+
+ <!-- ===================================================================== -->
+ <!-- Steps to do after the compilation target <name> -->
+ <!-- Substitute "name" with the name of the compilation target, eg @dot -->
+ <!-- Available parameters : -->
+ <!-- jar.location - the location of the compilation results -->
+ <!-- <name>.classpath : name = name of the compilation target. A -->
+ <!-- reference to the classpath structure. -->
+ <!-- ===================================================================== -->
+ <target name="post.activeHelpSample.jar">
+ </target>
+
+ <!-- ===================================================================== -->
+ <!-- Steps to do before the target gather.bin.parts -->
+ <!-- Available parameters : -->
+ <!-- destination.temp.folder - the directory plugins will be collected to -->
+ <!-- feature.directory - the directory containing the resulting feature -->
+ <!-- ===================================================================== -->
+ <target name="pre.gather.bin.parts">
+ </target>
+
+ <!-- ===================================================================== -->
+ <!-- Steps to do after the target gather.bin.parts -->
+ <!-- Available parameters : -->
+ <!-- base.dir - root of the project -->
+ <!-- build.result.folder - folder containing the build results -->
+ <!-- target.folder - destination folder -->
+ <!-- ===================================================================== -->
+ <target name="post.gather.bin.parts">
+ </target>
+
+ <!-- ===================================================================== -->
+ <!-- Steps to do before the target gather.sources -->
+ <!-- Available parameters : -->
+ <!-- destination.temp.folder - destination folder -->
+ <!-- ===================================================================== -->
+ <target name="pre.gather.sources">
+ </target>
+
+ <!-- ===================================================================== -->
+ <!-- Steps to do after the target gather.sources -->
+ <!-- Available parameters : -->
+ <!-- destination.temp.folder - destination folder -->
+ <!-- ===================================================================== -->
+ <target name="post.gather.sources">
+ </target>
+
+ <!-- ===================================================================== -->
+ <!-- Steps to do before the target gather.logs -->
+ <!-- Available parameters : -->
+ <!-- destination.temp.folder - destination folder -->
+ <!-- ===================================================================== -->
+ <target name="pre.gather.logs">
+ </target>
+
+ <!-- ===================================================================== -->
+ <!-- Steps to do after the target gather.logs -->
+ <!-- Available parameters : -->
+ <!-- destination.temp.folder - destination folder -->
+ <!-- ===================================================================== -->
+ <target name="post.gather.logs">
+ </target>
+
+ <!-- ===================================================================== -->
+ <!-- Steps to do before the target clean -->
+ <!-- Available parameters : -->
+ <!-- destination.temp.folder - destination folder -->
+ <!-- ===================================================================== -->
+ <target name="pre.clean">
+ </target>
+
+ <!-- ===================================================================== -->
+ <!-- Steps to do after the target clean -->
+ <!-- Available parameters : -->
+ <!-- plugin.destination - final destination of the build -->
+ <!-- build.result.folder - results of the compilation -->
+ <!-- temp.folder - temporary folder -->
+ <!-- ===================================================================== -->
+ <target name="post.clean">
+ </target>
+</project>
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/builder.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/builder.html
new file mode 100644
index 000000000..15a1a8461
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/builder.html
@@ -0,0 +1,29 @@
+<html>
+ <head>
+ <meta name="copyright" content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel=stylesheet type="text/css" href="../css/book.css">
+ <link rel=stylesheet type="text/css" href="otguide.css">
+ <title>Java builder extended for Object Teams</title>
+ <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+ </head>
+ <body>
+ <h1>Java builder extended for Object Teams</h1>
+ <p>The <b>OT/J builder</b> is a seamless extension of the Java builder for Object Teams.
+ It manages the incremental compilation of individual source files within a project,
+ which aims at performing minimal work only, as to speed up compilation for large
+ projects if only small changes have been performed.
+ </p><p>
+ By the introduction of role files
+ (<a href="otjld/def/s1.html#s1.2.5"><img src="../icons/ot_paragraph.gif"> 1.2.5</a>)
+ even inner classes (here: roles) can be compiled individually.
+ Incremental compilation is guided by an analysis of the various dependencies among classes.
+ </p><p>
+ If for some reason incremental compilation fails were it should not, a full build can
+ be triggered by <span class="ui">Project-&gt;Clean...</code>.
+ </p>
+ <p>Note that the produced class files contain standard Java byte code. However, for execution
+ the Object Teams Runtime Environment (OTRE) is needed in order to weave aspect code into
+ base classes. Additional options in the launching dialog will take care of this detail for you
+ (see <a href="running.html">Running Object Teams programs</a>).
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/callhierarchy.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/callhierarchy.html
new file mode 100644
index 000000000..273fc99fe
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/callhierarchy.html
@@ -0,0 +1,37 @@
+<html>
+ <head>
+ <meta name="copyright" content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel=stylesheet type="text/css" href="../css/book.css">
+ <link rel=stylesheet type="text/css" href="otjld/css/ot.css">
+ <style type="text/css">
+ body { margin:10px; }
+ .high { background-color:#a5b7bd;color:white; }
+ .low { background-color:#fff0c8; padding:2px; }
+ .caption { text-decoration:underline; vertical-align:top;position:relative;top:20px; margin-top:10px;}
+ </style>
+ <title>Call hierarchy extended for OT/J</title>
+ <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+ </head>
+ <body>
+ <h1 align="center">Call hierarchy extended for OT/J<a name="callhierarchy"></a></h1>
+ <p>
+ The purpose of the Java call hierarchy view is to statically display all potential
+ control flows originating from or leading to a specific program element.
+ Since callout and callin method bindings in OT/J introduce new kinds of control flows,
+ it is only appropriate to also visualize the control flows induced by such method bindings.
+ </p>
+ <p>
+ Whenever a given method can be invoked via a <b>callout method binding</b>,
+ the call hierarchy shows a <img src="../images/calloutbinding_obj.gif"> callout node.
+ Here all calls to the corresponding role method will be forwarded to the base method.
+ </p>
+ <p>
+ Whenever a <b>callin method binding</b> may intercept a given control flow,
+ a <img src="../images/callinbindingreplace_obj.gif"> callin node is shown.
+ Note, that a callin control flow is only taken at runtime,
+ if the enclosing team is active and no guard predicate evaluates to false.
+ </p>
+ <img src="images/screenshots/CallHierarchy.png"
+ alt="Call hierarchy showing Object Teams method bindings">
+ </body>
+</html>
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/callinmarker.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/callinmarker.html
new file mode 100644
index 000000000..9e96af43a
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/callinmarker.html
@@ -0,0 +1,65 @@
+<html>
+ <head>
+ <meta name="copyright" content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel=stylesheet type="text/css" href="../css/book.css">
+ <link rel=stylesheet type="text/css" href="otjld/css/ot.css">
+ <link rel=stylesheet type="text/css" href="otguide.css">
+ <style type="text/css">
+ body { margin:10px; }
+ .high { background-color:#a5b7bd;color:white; }
+ .low { background-color:#fff0c8; padding:2px; }
+ .caption { text-decoration:underline; vertical-align:top;position:relative;top:20px; margin-top:10px;}
+ </style>
+ <title>Binding markers</title>
+ <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+ </head>
+ <body>
+ <h1>Binding markers</h1>
+ <p><b>Binding</b> <a href="/help/topic/org.eclipse.platform.doc.user/concepts/concepts-11.htm">
+ markers</a> are OT/J specific annotations on the vertical ruler (marker bar) left of the
+ extended <a href="editor.html">Java Editor</a>. These markers come in three flavors:
+ <ul>
+ <li>A <b>playedBy marker</b> <img src="../images/playedBy_obj.gif"> signals that one or more roles is bound
+ to the current class using <code class="keyword">playedBy</code> (<a href="otjld/def/s2.html#s2.1"><img src="../icons/ot_paragraph.gif"> 2.1</a>).</li>
+ <li>A <b>callin marker</b> <img src="../images/callinbinding_obj.gif"> signals that one or more callin bindings
+ (<a href="otjld/def/s4.html#s4"><img src="../icons/ot_paragraph.gif"> 4</a>) affect the given base method.
+ <li>A <b>callout marker</b> <img src="../images/callout_marker.gif"> signals that one or more callout bindings (<a href="otjld/def/s3.html#s3"><img src="../icons/ot_paragraph.gif"> 3</a>)
+ affect the given base method <b>and</b> that these callout bindings apply decapsulation
+ (<a href="otjld/def/s3.html#s3.4"><img src="../icons/ot_paragraph.gif"> 3.4</a>)
+ &mdash;&nbsp;(callout bindings <em>without</em> decapsulation are ranked like regular method calls
+ and thus not considered relevant for marking in the ruler).
+ </ul>
+ <table>
+ <tr><td class="caption">PlayedBy and callin markers</td>
+ <td><img src="images/screenshots/callinmarkers.png"
+ alt="Callin marker annotation in vertical ruler (marker bar)">
+ </tr>
+ <tr><td class="caption">Callout decapsulation marker</td>
+ <td><img src="images/screenshots/calloutmarker.png"
+ alt="Callout decapsulation marker annotation in vertical ruler (marker bar)">
+ </tr>
+ </table>
+ <p>
+ Aside from raising awareness of these bindings, the markers can also be used to directly
+ navigate to the corresponding role or callin/callout binding.
+ When right clicking on a binding marker a pop-up menu will open which contains
+ a corresponding submenu <span class="ui">OT/J bound roles</span>, or <span class="ui">OT/J callin bindings</span>, or <span class="ui">OT/J callout decapsulation</span>.
+ This submenu in turn holds all bindings relevant at the current position,
+ sorted by teams.
+ </p>
+ <table>
+ <tr><td class="caption">PlayedBy marker menu
+ <td><img src="images/screenshots/callinmarker-menu.png"
+ alt="PlayedBy marker menu">
+ </tr>
+ <tr><td class="caption">Callin marker menu
+ <td><img src="images/screenshots/callinmarker-menu3.png"
+ alt="Callin marker menu">
+ </tr>
+ </table>
+ <p>
+ Binding markers are enabled/disabled globally on the <span class="ui">Object Teams</span> preference page.<br>
+ Detailed configuration is possible via <span class="ui">Window->Preferences->General->Editors->Text Editors->Annotations</span>
+ </p>
+ </body>
+</html>
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/compilation.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/compilation.html
new file mode 100644
index 000000000..87bc13110
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/compilation.html
@@ -0,0 +1,47 @@
+<html>
+ <head>
+ <meta name="copyright" content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel=stylesheet type="text/css" href="../css/book.css">
+ <link rel=stylesheet type="text/css" href="otguide.css">
+ <title>Compiling Object Teams programs</title>
+ <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+ </head>
+ <body>
+ <h1>Compiling Object Teams programs</h1>
+ <p>
+ Object Teams programs are compiled <u>automatically</u> and <u>incrementally</u> using
+ an <b><a href="builder.html">extended Java builder</a></b>.
+ </p>
+ <p>The language accepted by the compiler is defined in the <a href="otjld/def/index.html">OTJLD</a>
+ (OT/J Language Definition), which is bundled with the OTDT.
+ <p>Problems detected by the compiler are classified as either <b><i>warnings</i></b> or
+ <b><i>errors</i></b>.<br />
+ The existence of a warning does not prohibit the execution of the program;
+ some warnings only signal a programming style that is not recommended,
+ others may report situations that are potentially unsafe such that an undeclared
+ exception might occur at runtime.<br />
+ Compile-time errors (as specified by the OT/J Language Specification) imply
+ that byte code generation was incomplete (it may be possible to run even programs with
+ compile errors, but the program will terminate as soon as it tries to execute an
+ erroneous method).
+ <p>
+ <h3>Configuring Diagnostics</h3>
+ For a number of problems you can specify if you want the OT/J compiler
+ to report them as warnings, errors or to ignore them.
+ To change the default settings, use the <span class="ui">Window > Preferences > Java >
+ Compiler (OT/J)</span> preference page (or change the project properties to specify
+ project specific settings).<br />
+ For easy reference, on the preference page each group of diagnostics
+ mentions the paragraph in the language definition that defines the issue at hand.</p>
+ Also note that many of these diagnostics can be fixed using a <a href="quickfix.html">quick fix</a>.
+
+ <h3>Consulting the language definition on problems</h3>
+ <p>When viewing OT/J-specific error/warning messages in the Problems view, the context menu
+ offers a &nbsp;<img src="../icons/ot_paragraph.gif"> <span class="ui">Go To Language Definition</span> &nbsp;link,
+ taking you directly to the paragraph
+ that defines the rule which is being violated by the compiled source code. For presenting the
+ language definition the internal HTML-browser is used to allow easy navigation within the
+ language definition.</p>
+ <img title="Language Definition Integrated in the OTDT" src="images/screenshots/langdef.png"/>
+ </body>
+</html>
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/completion.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/completion.html
new file mode 100644
index 000000000..2310011fe
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/completion.html
@@ -0,0 +1,99 @@
+<html>
+ <head>
+ <meta name="copyright" content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel=stylesheet type="text/css" href="../css/book.css">
+ <link rel=stylesheet type="text/css" href="otjld/css/ot.css">
+ <style type="text/css">
+ body { margin:10px; }
+ .high { background-color:#a5b7bd;color:white; }
+ .low { background-color:#fff0c8; padding:2px; }
+ .caption { text-decoration:underline; vertical-align:top;position:relative;top:20px; margin-top:10px;}
+ </style>
+ <title>OT/J content/code assist</title>
+ <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+ </head>
+ <body>
+ <h1 align="center">OT/J code completion<a name="completion"></a></h1>
+ <u>On this page:</u>
+ <br /><a href="#completeBase">1. Completing a role's base class</a>
+ <br /><a href="#completeMapping">2. Creating callout/callin method bindings</a>
+ <br /><a href="#completeCall">3. Completing special method calls</a>
+ <br /><a href="#completeTemplate">4. Completion templates</a>
+
+ <h2><a name="completeBase">1. Completing a role's base class</a></h2>
+ When expanding the base type after the keyword <code class="keyword">playedBy</code>,
+ completion will also generate an "<code class="keyword">import <strong>base</strong> ...</code>" declaration
+ (<a href="otjld/def/s2.html#s2.1.2.d"><img src="../icons/ot_paragraph.gif"> 2.1.2(d)</a>), if needed.
+
+
+ <h2><a name="completeMapping">2. Creating callout/callin method bindings</a></h2>
+
+ Specific support for code completion exists to facilitate the creation of <b>callout</b> (<a href="otjld/def/s3.html"><img src="../icons/ot_paragraph.gif"> 3.</a>) and <b>callin</b> (<a href="otjld/def/s4.html"><img src="../icons/ot_paragraph.gif"> 4.</a>) method bindings.<br />
+ Completion can be used for
+ <ul>
+ <li><a href="#full">Creating full method bindings (callout/callin)</a>
+ <li><a href="#partial">Completing partial callout/callin bindings</a>
+ <li><a href="#correct">Corrections after callin creation.</a>
+ </ul>
+
+ <h3><a name="full">2.1 Creating full method bindings (callout/callin)</a></h3>
+ Just activating the completion anywhere in the body of a role class allows you to create a full callout or callin binding to an existing base method (or field &mdash; "callout to field", see <a href="otjld/def/s3.html#s3.5"><img src="../icons/ot_paragraph.gif"> 3.5</a>).<br />
+ <table>
+ <tr><td colspan=2>
+ After pressing <code>Ctrl-space</code>, selection of the desired binding happens in three steps:
+ <tr><td class="caption">a) Select a base method</td>
+ <td><img src="images/screenshots/complete_binding_1.png">
+ <tr><td class="caption">b) Change the role method name if desired.</td>
+ <td><img src="images/screenshots/complete_binding_2.png">
+ <tr><td class="caption">c) Select the binding kind.</td>
+ <td><img src="images/screenshots/complete_binding_3.png">
+ </table>
+ <h4>2.1.1 Creating callout to field</h4>
+ <p>
+ Two additional kinds of callouts can be generated, by typing "<code>get</code>" or "<code>set</code>" before invoking completion:
+ <table class="border" cellpadding=3>
+ <tr class="z2"><td>after typing <code class="keyword">get</code>
+ <td>Create a callout to field <i>getter</i>.</tr>
+ <tr class="z3">
+ <td>after typing <code class="keyword">set</code>
+ <td>Create a callout to field <i>setter</i>.
+ </table>
+ </p>
+ <h4>2.1.2 Mapping signatures using lifting/lowering</h4>
+ <p>
+ When binding to a base method/field, whose signature contains other base types for which a bound role exists in the current team,
+ completion lets you select whether the role side of the binding should use base or role types.
+ If role types are selected, they will be conform to the corresponding base type by implicitly using lifting (<a href="otjld/def/s2.html#s2.3"><img src="../icons/ot_paragraph.gif"> 2.3</a>) or lowering (<a href="otjld/def/s2.html#s2.2"><img src="../icons/ot_paragraph.gif"> 2.2</a>).
+ </p>
+
+ <h3><a name="partial">2.2 Completing partial callin/callout bindings</a></h3>
+ <p>
+ If a callin or callout binding has been typed up-to and including the "<code class="keyword">&lt;-</code>" or "<code class="keyword">-&gt;</code>" token, completion can be used to expand the right hand side specifying the base method or field. For callin bindings you may optionally first type the callin modifier (<code class="keyword">before, replace</code> or <code class="keyword">after</code>). Otherwise you will be prompted for the desired callin modifier.
+ In this case the proposed modifier is inferred to match the bound base method:<br />
+ <table class="border">
+ <tr class="z2"><td>regular method<td>Default is <code class="keyword">before</code> (also <code class="keyword">after</code> is legal).
+ <tr class="z3"><td><code class="keyword">callin</code> method<td>Default is <code class="keyword">replace</code>
+ </table>
+ </p><p>
+ Normally, after "<code class="keyword">-&gt;</code>" (as well as for "<code class="keyword">&lt;-</code>") completion will try to expand a base <i>method</i>, if for a callout one of the modifiers <code>get</code> or <code>set</code> has been typed, a <i>field</i> is searched instead.
+
+ <h3><a name="correct">2.3 Corrections after callin creation</a></h3>
+ After generating a callin binding using completion, the following two corrections might be especially helpful:
+ <ul>
+ <li>Adjusting the role method's <code class="keyword">callin</code> modifier, to match the binding's callin modifier.
+ <li>Creating a missing role method.
+ </ul>
+ Both corrections can easily be performed by a <a href="quickfix.html">quickfix</a> offered on the erroneous role method spec.
+
+ <h2><a name="completeCall">3. Completing special method calls</a></h2>
+ <ul>
+ <li>After <code class="keyword">base.</code> (<a href="otjld/def/s4.html#s4.3"><img src="../icons/ot_paragraph.gif"> 4.3</a>) and <code class="keyword">tsuper.</code> (<a href="otjld/def/s1.html#s1.3.1.f"><img src="../icons/ot_paragraph.gif"> 1.3.1(f)</a>) completion offers only those methods that are actually legal in this context,
+ which in bose cases implies the same name and signature as the surrounding role (callin) method.</li>
+ <li>Completion also offers calls to members of the bound base class which are implicitly available using <b>inferred callout</b> (<a href="otjld/def/s3.html#s3.1.j"><img src="../icons/ot_paragraph.gif"> 3.1(j)</a>, <a href="otjld/def/s3.html#s3.5.h"><img src="../icons/ot_paragraph.gif"> 3.5(h)</a>)
+ </ul>
+ <h2><a name="completeTemplate">4. Completion templates</a></h2>
+ Content assist in the
+ form of <a href="/help/topic/org.eclipse.jdt.doc.user/concepts/ctemplates.htm">
+ templates</a> exists for a few specific OT/J language constructs like <span class="low"><code class="keyword">within</code> (<i>Expression</i>)</span>.
+ </p>
+ \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/contentassist.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/contentassist.html
new file mode 100644
index 000000000..c9dc06da7
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/contentassist.html
@@ -0,0 +1,26 @@
+<html>
+ <head>
+ <meta name="copyright" content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel=stylesheet type="text/css" href="../css/book.css">
+ <link rel=stylesheet type="text/css" href="otjld/css/ot.css">
+ <title>OT/J content/code assist</title>
+ <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+ </head>
+ <body style="margin:10px">
+ <h1 align="center">OT/J content/code assist</h1>
+ <p>The <a href="/help/topic/org.eclipse.jdt.doc.user/reference/ref-143.htm">content/code
+ assist (code completions)</a> inherent in the
+ <a href="/help/topic/org.eclipse.jdt.doc.user/concepts/concepts-7.htm">Java editor</a>
+ has been extended in order to provide for Object Teams specific keywords and modifiers (e.g.
+ <code class="keyword">team, playedBy, callin, before, after, replace</code> etc.) as well.
+ Code completion and quick fixes provide more specific assistance depending on the current context of editing.
+ <p>
+ <u>OT/J specific content assist comprises:</u>
+ <ul>
+ <li><a href="completion.html">Completion</a> (<a href="completion.html#completeMapping">callout, callin</a>, <a href="completion.html#completeBase">base class</a>).
+ <li><a href="quickfix.html">Quick fixes</a>
+ </ul>
+ </p>
+
+ </body>
+</html>
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/debugging.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/debugging.html
new file mode 100644
index 000000000..42b715ce6
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/debugging.html
@@ -0,0 +1,40 @@
+<html>
+ <head>
+ <meta name="copyright" content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel=stylesheet type="text/css" href="../css/book.css">
+ <link rel=stylesheet type="text/css" href="otguide.css">
+ <title>Debugging Object Teams programs</title>
+ <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+ </head>
+ <body>
+ <h1>Debugging Object Teams programs</h1>
+ <p>Debugging support has been extended in order to help debugging OT/J programs.
+ Debugging OT/J may give rise to a new kind of questions: is a declared
+ callin binding actually firing at run-time? In order to analyze this question
+ a developer may need to investigate:
+ <ol>
+ <li>Has a team instance be created and activated?</li>
+ <li>Is the callin blocked by either a guard predicate or a <code>org.objectteams.LiftingVetoException</code>?</li>
+ </ol>
+ Investigating question 1 is supported by the new <b>team monitor view</b>,
+ support for question 2 is provided by enhancements of the debug view and its stepping actions.
+ </p>
+ <h2><a name="teammonitor" href="teammonitor.html">Team Monitor View</a></h2>
+ A special view exists for monitoring which team instances have been created and whether each
+ of them is currently active or not. When debugging callin bindings which do not trigger while
+ they are intended to do so, the team monitor should provide first help to find out whether
+ there is any active instance of the team being considered. If no active instance exists,
+ callins can not trigger. <a href="teammonitor.html">Read more...</a>
+ <h2><a name="stepping" href="stepping.html">Stepping through OT/J code</a></h2>
+ The byte code into which OT/J programs are translated has some significant differences
+ to the original source code. In order to hide some generated code and to provided
+ convenient stepping even through declarative method bindings, the debug view has
+ been enhanced for OT/J. <a href="stepping.html">Read more...</a>
+ <h2><a name="variables">Variables View</a></h2>
+ By default the variables view hides some internal fields that are generated by the compiler.
+ However, in some situations these variables might come handy for inspecting the linkage between
+ role/base/team instances. For that reason, filtering of these variables
+ can be toggled from the variable view's menu: <span class="ui">Java &gt; Show OT/J Internal Variables</span>.
+ The same holds for the detail drill down of the team monitor.
+ </body>
+</html>
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/develop.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/develop.html
new file mode 100644
index 000000000..4e2bedd6f
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/develop.html
@@ -0,0 +1,61 @@
+<html>
+ <head>
+ <meta name="copyright" content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel=stylesheet type="text/css" href="../css/book.css">
+ <title>Key features of the Object Teams Development Tooling</title>
+ <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+ </head>
+ <body>
+ <h1>Object Teams Development Tooling</h1>
+ <p>
+ The OTDT is a development environment for the
+ <a href="http://trac.objectteams.org/ot/wiki/OTJ">OT/J</a> programming language.
+ </p>
+ <p>
+ Based on the Eclipse Java development tools (JDT), it includes the following key features, which
+ are explained in the next chapters.<br/>
+
+ </p>
+
+ <h2>Key features of the OTDT</h2>
+ More details can be found on the comprehensive <a href="features.html"><strong>feature list</strong></a>.
+ <ul>
+ <li><b><a href="project.html">Creating</a> an Object Teams project</b> using a wizard</li>
+ <li><b><a href="wizards.html">Creating</a> team and role classes</b> using a wizard</li>
+ <li><a href="editor.html"><b>Editing</b></a> OT/J:
+ <ul style="margin-bottom:0px">
+ <li>Syntax highlighting, <a href="editor.html#navigation">navigation</a>, <a href="contentassist.html">content/code assist</a>, <a href="callinmarker.html">base code annotations</a></li>
+ <li>A table based <b>Binding Editor</b> specifically supports the creation of <i>connectors</i></li>
+ <li><a href="methodcompare.html">Comparing bound methods</a></li>
+ </ul></li>
+ <li>Object Teams <b>structural/navigational views</b> (<a href="packageexplorer.html">package explorer</a>, type hierarchy, outline)</li>
+ <li><a href="compilation.html"><b>Compiling</b></a> Object Teams programs</li>
+ <li><a href="running.html"><b>Running</b></a> Object Teams programs</li>
+ <li><a href="debugging.html"><b>Debugging</b></a> Object Teams programs</li>
+ </ul>
+
+ The following feature -- although available in the JDT -- is only partially adapted for the OTDT:
+ <ul>
+ <li><a href="refactoring.html"><b>Refactoring</b></a> Object Teams programs</li>
+ </ul>
+
+ <h2>Prerequisites</h2>
+ If you have never used the eclipse Java IDE before, please consider getting familiar with the
+ <a href="/help/topic/org.eclipse.jdt.doc.user/concepts/concepts-1.htm">Java Development Tooling</a>, as
+ the OTDT is built on top of and extends the JDT.
+
+ <h2>Feedback</h2>
+ <p>
+ If you have questions regarding the <a href="otjld/def/index.html">OT/J</a>
+ language or if you experience problems or bugs with the OTDT, do not hesitate to send a mail to the
+ <a href="mailto:otj-users@objectteams.org">otj-users@objectteams.org</a> mailing list.
+ </p>
+
+ <p>
+ <br>
+ Happy hacking,<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;the OTDT Team.
+ </p>
+
+ </body>
+</html>
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/editor.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/editor.html
new file mode 100644
index 000000000..9d09bf87a
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/editor.html
@@ -0,0 +1,62 @@
+<html>
+ <head>
+ <meta name="copyright" content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel=stylesheet type="text/css" href="../css/book.css">
+ <link rel=stylesheet type="text/css" href="otjld/css/ot.css">
+ <link rel=stylesheet type="text/css" href="otguide.css">
+ <title>Java editor with Object Teams capability</title>
+ <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+ </head>
+ <body>
+ <h1>Java editor with Object Teams capability</h1>
+ The extended Java editor provides specialized features for editing
+ OT/J code. The original <a href="/help/topic/org.eclipse.jdt.doc.user/concepts/concepts-7.htm">Java editor</a>
+ has been extended for the following features:
+ <ul>
+ <li><b>Navigation</b> support for Object Teams elements (F3 = <span class="ui">Open Declaration</span>, see below)</li>
+ <li><b>Syntax highlighting</b> for OT/J keywords and modifiers.<br />
+ OT/J keywords are enabled based on the contents of the file being edited.
+ This way the same editor still handles plain Java sources <i>without</i> interpreting OT/J keywords.<br/>
+ However, within an OT/J file syntax highlighting is determined in a context-free manner,
+ which means that scoped keywords
+ (<a href="otjld/def/sA.html#sA.0.1"><img src="../icons/ot_paragraph.gif"> A.0.1</a>)
+ like <code class="keyword">after, base, before, get, result, set</code> are highlighted,
+ even in situations where they have no special meaning.
+ </li>
+ <li><a href="contentassist.html"><b>Content/code assist</b> (code completions)</a> for Object Teams program elements.
+ </li>
+ <li><b>Templates (source patterns)</b> for Object Teams specific language constructs
+ using content assist (<b>Ctrl+Space</b>),
+ e.g. <code class="keyword">within</code> (<i>Expression</i>) <i>Statement</i>
+ </li>
+ <li>New <a href="callinmarker.html"><b>binding marker</b></a> annotations in the vertical ruler (for base classes/methods bound using playedBy/callin/callout)
+ allowing navigation to the affecting role.
+ </li>
+ </ul>
+ <h2><a name="navigation">Navigation</a></h2>
+ Obvious enhancements for the normal F3 navigation regard the following:
+ <ul>
+ <li>Go to a role's base class using the <code class="keyword">playedBy</code> clause.</li>
+ <li>Go to a bound base method or a bound field using a callout or callin binding<br />
+ (the opposite direction is supported by <a href="callinmarker.html">binding markers</a>).</li>
+ </ul>
+ Navigating <strong>role files</strong>
+ (<a href="otjld/def/s1.html#s1.2.5"><img src="../icons/ot_paragraph.gif"> 1.2.5</a>):
+ <ul>
+ <li>Hitting F3 on the <code class="keyword">team package</code> declarations jumps to the enclosing team.</li>
+ <li>In order to navigate from a team to its role file use the quick outline
+ by hitting <code>Ctrl-O</code> twice:<br />
+ role files will be offered for selection along inline members.</li>
+ <li>If javadoc <code>@role</code> tags are used as recommended for listing all role files of the current team
+ (<a href="otjld/def/s1.html#s1.2.5.d"><img src="../icons/ot_paragraph.gif"> 1.2.5(d)</a>),
+ the role names in these tags support F3-navigation to the corresponding roles, too.</li>
+ </ul>
+ Navigating the <strong>implicit role hierarchy</strong> (<a href="otjld/def/s1.html#s1.3.1"><img src="../icons/ot_paragraph.gif"> 1.3.1</a>):
+ <ul>
+ <li>A role class that overrides a corresponding role from the super team is decorated with an override marker (<img src="images/over_co.gif">) in the vertical ruler,
+ which supports the <span class="ui">Open Super Implementation</span> action.</li>
+ <li>A role method overriding a corresponding method from any explicit or implicit super role
+ are also decorated with an override marker (<img src="images/over_co.gif">) supporting navigation to the overridden method.</li>
+ </ul>
+ </body>
+</html>
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/features.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/features.html
new file mode 100644
index 000000000..03f1aebe2
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/features.html
@@ -0,0 +1,417 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../../dtd/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
+ <head>
+ <meta name="copyright" content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" href="otjld/css/ot.css" type="text/css" />
+ <link rel="stylesheet" href="otjld/css/otjld.css" type="text/css" />
+ <title>OTDT Feature List</title>
+ <!-- special padding for the table of tests. -->
+ <style type="text/css">
+ td,th { padding-left:15px; padding-right:15px; padding-top:2px; padding-bottom:2px; }
+ </style>
+ </head>
+ <body>
+ <div id="head">
+ <h1>Features of the OTDT (version 1.4.x)</h1>
+ </div>
+ <div style="margin:10px;">
+
+ <h2 style="text-align:center;margin-top:0px;"><img style="vertical-align:middle;" alt="Built on Eclipse" src="../images/built-on-eclipse.gif"/> Version 3.5.0</h2>
+
+ The release 1.4.0 M1 is based on Eclipse 3.6.0 M3. It contains a modified version of the JDT core
+ and several added plugins.
+
+ <br/><br/>
+
+ The following components are available:
+
+ <ul>
+ <li><a href="#compiler">Compiler</a></li>
+ <li><a href="#wizards">Wizards</a></li>
+ <li><a href="#editor">Editor</a></li>
+ <li><a href="#bindingEditor">Binding Editor</a></li>
+ <li><a href="#refactoring">Refactoring</a></li>
+ <li><a href="#structureViewers">Structure Viewers</a></li>
+ <li><a href="#search">Search</a></li>
+ <li><a href="#execution">Execution Environment</a></li>
+ <li><a href="#otequinox">OT/Equinox</a></li>
+ <li><a href="#debugging">Debugging</a></li>
+ <li><a href="#help">Help and additional Information</a></li>
+ </ul>
+
+
+ <p></p>
+
+ <div id="compiler" class="headl"><div class="headr">
+ <h1>Compiler</h1>
+ </div></div>
+
+ The Object Teams Compiler is an incremental compiler, based on the Eclipse Compiler for Java.
+ <dl>
+ <dt><strong>Language Definition</strong></dt>
+ <dd>The compiler implements the language as defined in the OT/J
+ <a href="otjld/def/index.html">language definition</a> version 1.1 (OTJLD).
+ The language definition has continuously been revised to precisely specify the language
+ including various corner cases and combinations of features.
+ </dd>
+ <dt><strong>Language Implementation</strong></dt>
+ <dd>
+ The compiler supports all features of OT/J according to the
+ <a href="otjld/def/index.html"><img alt="otjld" src="../images/ot_paragraph.png"/> OTJLD v1.1</a>
+ &sect;&sect;1-7.
+ Support for the join point sub-language (<a href="http://www.objectteams.org/def/0.9/joinpoints.html"><img alt="otjld" src="../images/ot_paragraph.png"/> OTJLD &#167; 8</a>) is not included in the stable release 1.3.x.
+ <p></p>
+ The compiler can be <strong>configured</strong> using global <code>Preferences</code> or project
+ specific <code>Properties</code>.
+ <ul>
+ <li>Configure OT/J-specific compiler diagnostics as "ignore", "warning" or "error".<br/>
+ Any warnings configured on this property sheet can also be suppressed in the
+ source code using the <code>@SuppressWarnings</code> annotation.</li>
+ <li>Scoped keywords <a href="otjld/def/sA.html#sA.0.1"><img alt="otjld" src="../images/ot_paragraph.png"/> OTJLD &#167; A.0.1</a> can be disabled (default is enabled).
+ </li>
+ <!--
+ <li>Compiler support for the join point language (<a href="../def/1.0/joinpoints.html"><img border="0" src="../images/ot_paragraph.png"/> OTJLD &#167 8</a>) is not included in this release. Note, that the runtime environment does not yet support the join point language, thus this feature could mainly be used for learning the join point language.
+ -->
+ </ul>
+ </dd>
+ <dt><strong>Status of the Compiler</strong></dt>
+ <dd>
+ The OTDT is continuously tested using two growing test suites:
+ <table class="default">
+ <tr><th>Name</th><th>Software under Test</th><th>Kind</th><th>Number of tests</th></tr>
+ <tr class="z1"><td><b>Jacks</b></td><td>compiler and runtime environment</td><td>black box</td><td> &gt;2000 (test programs)</td></tr>
+ <tr class="z2"><td><b>JUnit</b></td><td>all of the OTDT</td> <td>white box</td><td> &gt;40000 tests.</td> </tr>
+ </table>
+
+ Feel free to have a look at the <a href="http://www.objectteams.org/distrib/otdt.html#testresults">test status</a> and remaining <a href="http://trac.objectteams.org/ot/wiki/JUnitFailures">known problems</a>.
+ </dd>
+ </dl>
+
+ <div id="wizards" class="headl"><div class="headr">
+ <h1>Wizards</h1>
+ </div></div>
+ <ul>
+
+ <li>The first step to developing with Object Teams in Eclipse is creating an <img class="inline" alt="" src="../images/newprj_wiz.gif"/><code>&nbsp;Object&nbsp;Teams&nbsp;Project</code>. A wizard will guide you through that process. It will also add the Object Teams class library (<tt>otre.jar</tt>) to your project's classpath.
+ </li>
+
+ <li>
+
+ Having done that, you can start adding classes &mdash; be it regular classes, or <img class="inline" alt="" src="../images/team_obj.gif"/> team or <img class="inline" alt="" src="../images/role_obj.png"/> role classes &mdash; wizards will assist you in creating the classes properly.
+ </li>
+ </ul>
+
+
+ <div id="editor" class="headl"><div class="headr">
+ <h1>Editor</h1>
+ </div></div>
+ <ul>
+
+ <li>Editing Object Teams source code is supported by an outline view, showing the structure of the edited source file. This includes the Object Teams specific constructs,
+ <em>teams</em> (<img class="inline" alt="" src="../images/team_obj.gif"/>),
+ <em>roles</em> (<img class="inline" alt="" src="../images/role_obj.png"/>),
+ and <em>method bindings</em> (<img class="inline" alt="" src="../images/callinbindingbefore_obj.gif"/>,
+ <img class="inline" alt="" src="../images/callinbindingreplace_obj.gif"/>,
+ <img class="inline" alt="" src="../images/callinbindingafter_obj.gif"/>,
+ <img class="inline" alt="" src="../images/calloutbinding_obj.gif"/>).</li>
+
+ <li>The editor highlights the Object Teams keywords like "<code class="keyword">team</code>" the same way standard Java keywords are highlighted.</li>
+ <li>All constructs referencing other code elements are navigable. E.g. you can navigate <tt>super()</tt>, <tt>tsuper()</tt>, <tt>base()</tt> calls, as well as <em>callin</em> and <em>callout bindings</em>.
+ The name in a <code class="keyword">team package</code> declaration lets you navigate from a role file
+ (<a href="otjld/def/s1.html#s1.2.5"><img alt="otjld" src="../images/ot_paragraph.png"/> OTJLD &#167; 1.2.5</a>) to its enclosing team.</li>
+
+ <li>Classes to which one or more roles are bound using <code class="keyword">playedBy</code> are
+ annotated with a marker (<img class="inline" alt="" src="../images/playedBy_obj.gif"/>),
+ that allows navigating to the role declaration(s).
+ Similarly, methods in a base class that are bound with a <em>callin binding</em> are
+ annotated with a marker (<img class="inline" alt="" src="../images/callinbinding_obj.gif"/>),
+ that allows navigating to the method binding declaration(s).
+
+ <br/>
+ Because this feature may be resource-consuming in a large workspace the global Object Teams preferences page allows to completely disable the generation of callin markers.</li>
+
+ <li>Semantic highlighting (checkbox "mark occurrences") is fully supported.</li>
+ <li>Code completion (Ctrl-space) is widely supported. It is, e.g., possible to use completion in order to create a callout binding.</li>
+ <li>Content assist provides quick-fixes (Ctrl-1) for a number of OT/J specific errors and warnings.
+ Also a few templates for specific OT/J language constructs &mdash;
+ namely <code>with{}</code> and <code>within (<em>Expression</em>){}</code> &mdash; are available.</li>
+ </ul>
+
+ <div id="bindingEditor" class="headl"><div class="headr">
+ <h1>Binding Editor</h1>
+ </div></div>
+ <ul>
+ <li>Supports easy creation of connector definitions using a table based graphical user interface. In this context, a <b>connector</b> is meant to be a team that inherits structure
+ (roles) and functionality (methods) from its super-team, and its main purpose is to bind
+ the inherited structure and functionality using <code class="keyword">playedBy</code>
+ declarations and callin/callout method bindings.</li>
+ <li>Type bindings (<code class="keyword">playedBy</code>) can be defined by choosing a provided role type and the desired base type with a type selection dialog.</li>
+ <li>Method bindings (either callin or callout) can be established by choosing a role method and a base method from the provided role and base method list respectively.
+ <ul>
+ <li>Only appropriate binding kinds are selectable in the corresponding context (callin or callout).</li>
+ <li>Besides the provided role methods, a new role method can be implemented by selecting a provided base method, thus creating a callout binding.</li>
+ </ul>
+ </li>
+ <li>Parameter and result mappings are definable by typing in an expression in the corresponding text field of the parameter mapping configuration tab.</li>
+ </ul>
+ The binding editor can be opened either from the new team wizard or using the package explore's context menu (<code><img class="inline" alt="" src="../images/calloutbinding_obj.gif"/>&nbsp;Open&nbsp;Binding&nbsp;Editor</code>).
+ <p></p>
+ <div id="refactoring" class="headl"><div class="headr">
+ <h1>Refactoring</h1>
+ </div></div>
+ <p></p>
+ <div style="margin:15pt"><i><span style="text-decoration:underline;">Note:</span> The extended refactoring support has been developed based on Eclipse 3.0. Some of this functionality has not yet been ported to Eclipse 3.5 and thus is not yet available in OTDT 1.3.x.</i></div>
+ Significant work has been put into supporting the automated refactoring of OT/J code.
+ The following refactorings take into account the Object Teams-specific
+ relationships (implicit role inheritance, team nesting, role-base bindings and method
+ bindings).
+ <ul>
+ <li style="color:gray;">Extract Method <i>(extended support currently unavailable)</i></li>
+ <li style="color:gray;">Move Method <i>(extended support currently unavailable)</i></li>
+ <li>Rename Method</li>
+ <li>Rename Project</li>
+ <li>Rename Source folder</li>
+ <li>Rename Field</li>
+ </ul>
+ The Rename Package refactoring is also available, with the only limitation
+ that you cannot rename team-packages. The Rename Type refactoring does not
+ yet support role files (<a href="otjld/def/s1.html#s1.2.5"><img alt="otjld" src="../images/ot_paragraph.png"/> OTJLD &sect; 1.2.5</a>).
+ <p></p>
+
+ <div id="structureViewers" class="headl"><div class="headr">
+ <h1>Structure Viewers</h1>
+ </div></div>
+ <dl>
+ <dt><strong>The Package Explorer</strong></dt>
+ <dd>
+ <ul>
+ <li>
+ provides access to all project artifacts and their structure, i.e. source files, used libraries (<em>jar</em>-files), and other documents. Note that team and role classes are annotated with distinct icons (<img class="inline" alt="" src="../images/team_obj.gif"/> for teams and <img class="inline" alt="" src="../images/role_obj.png"/> for roles). (The same icons are used throughout the IDE, whenever a team or role is visible.)
+ </li>
+ <li>
+ If "Java Type Indicators" is enabled under general preferences/label decorations, OT-specific decorations will also be applied to compilation units (files) and team packages.
+ </li>
+ <li>
+ By opening the tree-branches, you can peek at the structure of e.g. classes.
+ </li>
+ <li>For team classes, there is special support for <b>role files</b> (<a href="otjld/def/s1.html#s1.2.5"><img alt="" src="../images/ot_paragraph.png"/> OTJLD &sect; 1.2.5</a>):<br/>
+ Role files are separate files and can be shown either
+ <em>physically</em> (<img class="inline" alt="" src="../images/team_package.gif"/>) as (separate) files in the team package or
+ <em>logically</em> (<img class="inline" alt="" src="../images/external_roles.gif"/>) as member types of the enclosing team.
+ </li>
+ <li>
+ Furthermore, the Package Explorer provides the current context for other operations. The Team- and Role-Wizards, for example, have a pre-set source folder, package and enclosing class when a team is selected in the Package Explorer.
+ </li>
+ </ul></dd>
+ <dt><strong>The Hierarchy View</strong></dt>
+ <dd><ul>
+ <li>Object Teams intruduce a new type hierarchy. Besides the normal ("<code>extends</code>") inheritance, there is an additional "<em>implicit</em>" role inheritance, established by role name equality in a team hierarchy. In conjunction with team nesting roles support a controlled form of multiple inheritance.
+ </li>
+ <li>
+ The new implicit inheritance has been integrated completely into the standard JDT
+ <em>Hierarchy View</em>.
+ The revised Hierarchy View supercedes the incomplete support which was provided by
+ a specific "Implicit Hierarchy View" in previous releases of the OTDT.
+ </li>
+ </ul></dd>
+ </dl>
+
+
+ <div id="search" class="headl"><div class="headr">
+ <h1>Search</h1>
+ </div></div>
+ <p></p>
+ <dl>
+ <dt><strong>Search references</strong></dt>
+ <dd><ul><li>The Java Search functionality has been extended to include search results of
+ Object Teams code, that is, callin and callout bindings, and
+ playedBy-relationships.</li></ul></dd>
+ <dt><strong>Call hierarchy</strong></dt>
+ <dd><ul><li>Also the call hierarchy has been extended for browsing control flows passing
+ through method bindings (callin and callout).</li>
+ <li>The OTDT introduced support for call hierarchies regarding field accesses (read, write, any) and class instantiations. As of version 3.4 this functionality has been adopted by Eclipse.</li>
+ </ul>
+ </dd>
+ </dl>
+ <p></p>
+
+ <div id="execution" class="headl"><div class="headr">
+ <h1>Execution Environment</h1>
+ </div></div>
+ <dl>
+ <dt><strong>Aspect weaving</strong></dt><dd>
+ <ul><li>
+ All aspect oriented languages have some kind of <em>weaving process</em>, where the aspect code is combined with the other (<em>base</em>) code.
+ </li>
+ <li>
+ Object Teams programs perform the weaving at application <em>startup time</em>, i.e. at the moment, the program is launched. In order to do this, there is the so-called <em>Object Teams Runtime Environment (OTRE)</em>, that wraps around the standard launching procedure.
+ </li>
+ <li>
+ All this is handled transparently using the standard Eclipse "Run" feature.
+ Running any main class of an Object Teams project automatically includes
+ the OTRE (This feature has been <a href="new_in_1.3.html#launch">changed in the OTDT 1.2.2</a>).
+ </li>
+ </ul></dd>
+ <dt><strong>Aspect deployment/activation</strong></dt>
+ <dd><ul>
+ <li>A new "Team Activation" tab in the "Run-Configuration" allows to instantiate and activate teams without modifying the program's source code.
+ </li>
+ <li>
+ Teams that cause aspect code to be woven into an application can be added to a program
+ <ul>
+ <li> by explicit reference within the program source code or</li>
+ <li> by a configuration file which is mentioned as a parameter to the VM or</li>
+ <li> by adding them via the aforementioned "Team Activation" tab.</li>
+ </ul>
+ No such configuration is needed for compilation.
+ </li>
+ </ul>
+ </dd>
+ <dt><strong>Technology used</strong></dt>
+ <dd><ul>
+ <li id="JPLIS">Alternative support for a Java 5 based weaver.
+ The original OT/J-weaver uses the <a href="http://roots.iai.uni-bonn.de/research/jmangler/">JMangler</a> framework for
+ intercepting classes during class loading.
+ The new version uses the Java-agent concept of Java 5
+ (<a href="http://java.sun.com/developer/technicalArticles/releases/j2se15/index.html">JPLIS</a>) instead,
+ which means we are independent of JMangler. In the future this version will support
+ aspect weaving not only at load time but also while an application is running.<br/>
+ The launch configuration for OT/J applications contains a new checkbox for selecting
+ the weaver ("Java 5 JPLIS Launching").
+ </li>
+ </ul></dd>
+ </dl>
+ <p></p>
+
+ <div id="otequinox" class="headl"><div class="headr">
+ <h1>OT/Equinox</h1>
+ <!--<td width="77%"></td>-->
+ <!--<td align="right" style="margin-top:0px; margin-bottom:0px;">-->
+ <!--
+ <img style="margin-top:0px; margin-bottom:-10px; margin-right:5px; height:60px; align=middle;" src="../images/ot_eclipse_120.gif"/>
+ -->
+ <!--</td>-->
+ </div></div>
+ <p></p>
+ Starting with the OTDT version 0.9.9 it is possible to develop Eclipse plugins using
+ OT/J as the implementation language.
+ <ul>
+ <li>Using the plugin <code>org.eclipse.objectteams.otequinox</code>, a plugin ("aspect plugin")
+ may declare that it adapts classes from a specified other plugin ("base plugin").</li>
+ <li>By an integration of the Object Teams Runtime Environment with new hooks in the
+ Equinox implementation a <code class="keyword">team</code> class from an <em>aspect plugin</em>
+ can trigger byte-code aspect weaving into its <em>base plugin</em> at load-time.
+ As a result an aspect plugin can indeed adapt the behaviour of another plugin.
+ These bindings are declared using the extension point <code>aspectBindings</code> from
+ the mentioned plugin <code>org.eclipse.objectteams.otequinox</code>.</li>
+ <li>The initial client of the OT/Equinox technology is a tiny plugin which extends Eclipse's
+ "about plugins" dialog by additionally displaying which plugins are being adapted by
+ which aspect plugins. This information is found in the version column of the mentioned dialog.
+ This way a user of the OTDT can always check whether a given plugin performs as shipped,
+ or whether it has been adapted by another plugin.</li>
+ <li>The OTDT uses the capabilities of OT/Equinox for some parts of its own implementation.
+ The technology is mainly used for making the JDT-UI aware of Object Teams without having
+ to copy source code or modifying source code of the JDT-UI in place.</li>
+ <li>A new project nature <img class="inline" alt="" src="../images/newpprj_wiz.gif"/>
+ <code>Object Teams Plugin Project</code> is provided, supporting the
+ development of plugins written in OT/J.</li>
+ <li>Support for OT/Equinox is added to the run/debug dialogs for all Equinox related launches.</li>
+ <li>If desired the load-time weaver can be disabled by commenting out or removing the following
+ line from the file <code>configuration/config.ini</code>:
+ <div class="ttindent" style="font-size:small;">
+ osgi.hook.configurators.include=org.eclipse.objectteams.eclipse.transformer.hook.HookConfigurator</div>
+ Ideally, disabling OT/Equinox will be handled by temporarily uninstalling this feature,
+ but the required support by the p2 provisioning system is not yet stable enough to do this.</li>
+ </ul>
+ <p></p>
+
+ <div id="debugging" class="headl"><div class="headr">
+ <h1>Debugging</h1>
+ </div></div>
+ <p></p>
+ The debugger has been enhanced to support debugging of OT/J programs at the
+ source code level. It is possible to set breakpoints and step through Object Teams code.
+
+ <dl>
+ <dt><b>Stepping through Code</b></dt>
+ <dd>The following language features produce byte codes for which a standard Java debugger
+ is not able to display appropriate source locations:
+ <ul>
+ <li>Role files (<a href="otjld/def/s1.html#s1.2.5"><img alt="" src="../images/ot_paragraph.png"/> OTJLD &sect; 1.2.5</a>)</li>
+ <li>Implicit inheritance (<a href="otjld/def/s1.html#s1.3.1"><img alt="" src="../images/ot_paragraph.png"/> OTJLD &sect; 1.3.1</a>)</li>
+ <li>Callout bindings (<a href="otjld/def/s3.html"><img alt="" src="../images/ot_paragraph.png"/> OTJLD &sect; 3</a>)
+ (including callout override (<a href="otjld/def/s3.html#s3.1.e"><img alt="" src="../images/ot_paragraph.png"/> OTJLD &sect; 3.1(e)</a>))</li>
+ <li>Callin bindings (<a href="otjld/def/s4.html"><img alt="" src="../images/ot_paragraph.png"/> OTJLD &sect; 4</a>)</li>
+ </ul>
+ The OTDT-Debugger re-maps the byte codes produced by all this constructs to the
+ appropriate source locations.
+ As a result stepping through these sections of a program completely hides
+ the internal translations from the user.<p></p>
+ The following features are not yet fully supported by the debugger:
+ <ul>
+ <li>Role constructors (see <a href="otjld/def/s2.html#s2.4"><img alt="" src="../images/ot_paragraph.png"/> OTJLD &sect; 2.4</a>)</li>
+ <li>Parameters with declared lifting (<a href="otjld/def/s2.html#s2.3.2"><img alt="" src="../images/ot_paragraph.png"/>
+ OTJLD &sect; 2.3.2</a> &mdash; code for lifting is not filtered out yet)</li>
+ </ul></dd>
+ <dt><b>Setting Breakpoints</b></dt>
+ <dd>Use double click on ruler or context menu <code>Toggle Breakpoint</code> to set
+ breakpoints in OT/J-Code. Setting breakpoint in role files is supported, too.</dd>
+ <dt id="team_monitor"><b>New View: "Team Monitor"</b></dt>
+ <dd>The team monitor (<img src="../images/tm.gif" alt="" class="inline"/>)
+ view helps to debug issues related to team activation
+ (<a href="otjld/def/s5.html#s5"><img alt="" src="../images/ot_paragraph.png"/> OTJLD &sect; 5</a>).
+ For this purpose it displays all known team instances and shows their activation status as one of
+ <ul>
+ <li>inactive <img src="../images/team_inact.gif" alt="" class="inline"/>,</li>
+ <li>active <img src="../images/team_act.gif" alt="" class="inline"/>
+ (either globally or for the thread selected in the debug view), or</li>
+ <li>implicitly active
+ <img src="../images/team_act_implicit.gif" alt="" class="inline"/>
+ (temporarily active because the team or one of its roles is currently executing code).
+ </li></ul>
+ Also, a selected team can be (de)activated interactively via the context menu.</dd>
+ <dt id="variables_filter"><b>Filtering variables</b></dt>
+ <dd>The OT/J compiler and the loadtime weaver both add some internal variables to the code.
+ By default such internal variables are hidden within the Team Monitor as well
+ as in the standard variables view. Both views can be configured to also show these internal
+ variables if so desired.</dd>
+ <dt><b>Known Issues and Limitations</b></dt>
+ <dd><ul>
+ <li>Dynamic code evaluation is not supported yet,
+ make sure to clear the Expression view.</li>
+ <li>Hot code replacement of woven code is not supported.</li>
+ </ul></dd>
+ </dl>
+
+ <div id="help" class="headl"><div class="headr">
+ <h1>Help and additional Information</h1>
+ </div></div>
+ <p></p>
+ The following sources for help and for further information are bundled with the release:
+ <ul>
+ <li>A Tutorial (available via the welcome page) guiding through the first steps of using the OTDT.</li>
+ <li>Example programs demonstrating key features of Object Teams (also via the welcome page).</li>
+ <li>A detailed <a href="guide/webindex.html">guide</a> on using the OTDT via the Help Index, including a link to the
+ language definition (which is also bundled).</li>
+ <li>Problems that are listed in the problem view are linked (when possible) to a corresponding explanatory entry in the language definition.
+ (Context menu -&gt; <img alt="" src="../images/ot_paragraph.png"/><code>&nbsp;Go&nbsp;to&nbsp;Language&nbsp;Definition</code>).</li>
+ </ul>
+ <p>
+ <!--
+ <table width="100%" class="h2"><tr>
+ <td class="h2">Movies demonstrating the OTDT</td></tr>
+ </table>
+
+ <p>
+ As an introduction to the OTDT you may watch the following movies (requires a plugin for Shockwave Flash Media):
+ <ul>
+ <li><a href="javascript:popup_window( 'otdt/IntroductionToOTDT_viewlet_swf.html', 'IntroductionToOTDT', 1048, 816 );">Introduction to the Object Teams Development Tooling</a>
+ <li><a href="javascript:popup_window( 'otdt/OTDTbyExample_viewlet_swf.html', 'OTDTbyExample', 1048, 816 );">Introducing the Object Teams Development Tooling by Example</a>
+
+ <li>... more movies will follow.
+ </ul><p></p>
+ -->
+ </p>
+ </div><!-- content -->
+ </body>
+</html>
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/brkp_obj.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/brkp_obj.gif
new file mode 100644
index 000000000..a831fe727
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/brkp_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/bundle_obj.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/bundle_obj.gif
new file mode 100644
index 000000000..b6096e27c
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/bundle_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/debugt_obj.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/debugt_obj.gif
new file mode 100644
index 000000000..c1e4ee3a5
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/debugt_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/disconnect_co.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/disconnect_co.gif
new file mode 100644
index 000000000..d8fdd8a08
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/disconnect_co.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/eclipse_launcher.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/eclipse_launcher.gif
new file mode 100644
index 000000000..eb7b90c76
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/eclipse_launcher.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/java_app.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/java_app.gif
new file mode 100644
index 000000000..a42a7c83c
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/java_app.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/java_attach.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/java_attach.gif
new file mode 100644
index 000000000..3c42f634c
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/java_attach.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/julaunch.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/julaunch.gif
new file mode 100644
index 000000000..ec4885d77
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/julaunch.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/julaunchpgn.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/julaunchpgn.gif
new file mode 100644
index 000000000..6e4ff2cfb
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/julaunchpgn.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/junit.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/junit.gif
new file mode 100644
index 000000000..229e93f47
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/junit.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/library_obj.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/library_obj.gif
new file mode 100644
index 000000000..cb55e33b5
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/library_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/over_co.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/over_co.gif
new file mode 100644
index 000000000..938767b20
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/over_co.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/AspectBindingsInPackageExplorer.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/AspectBindingsInPackageExplorer.png
new file mode 100644
index 000000000..377d0c589
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/AspectBindingsInPackageExplorer.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/CallHierarchy.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/CallHierarchy.png
new file mode 100644
index 000000000..139b69e7b
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/CallHierarchy.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/CompareMenu.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/CompareMenu.png
new file mode 100644
index 000000000..2745c2d40
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/CompareMenu.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/CompareWithBaseMethod.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/CompareWithBaseMethod.png
new file mode 100644
index 000000000..5922bd27d
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/CompareWithBaseMethod.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/ForcedExports.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/ForcedExports.png
new file mode 100644
index 000000000..1cdfaeed0
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/ForcedExports.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/JRETab.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/JRETab.png
new file mode 100644
index 000000000..0eab727be
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/JRETab.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/OSGiLaunchSettings.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/OSGiLaunchSettings.png
new file mode 100644
index 000000000..b42806c22
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/OSGiLaunchSettings.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/RemoteDebugging.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/RemoteDebugging.png
new file mode 100644
index 000000000..a9ab7a9d9
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/RemoteDebugging.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/RuntimeWorkbenchMainTab.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/RuntimeWorkbenchMainTab.png
new file mode 100644
index 000000000..70fc20b3e
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/RuntimeWorkbenchMainTab.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/addOTNature.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/addOTNature.png
new file mode 100644
index 000000000..7223ce471
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/addOTNature.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/callinMarker.jpg b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/callinMarker.jpg
new file mode 100644
index 000000000..ba523f397
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/callinMarker.jpg
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/callinmarker-menu.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/callinmarker-menu.png
new file mode 100644
index 000000000..82c2ed663
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/callinmarker-menu.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/callinmarker-menu3.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/callinmarker-menu3.png
new file mode 100644
index 000000000..9898d942f
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/callinmarker-menu3.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/callinmarkers.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/callinmarkers.png
new file mode 100644
index 000000000..ca31ef030
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/callinmarkers.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/calloutmarker.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/calloutmarker.png
new file mode 100644
index 000000000..df2792f6d
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/calloutmarker.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/complete_binding_1.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/complete_binding_1.png
new file mode 100644
index 000000000..06c014c90
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/complete_binding_1.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/complete_binding_2.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/complete_binding_2.png
new file mode 100644
index 000000000..47bd64d28
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/complete_binding_2.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/complete_binding_3.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/complete_binding_3.png
new file mode 100644
index 000000000..c469fc545
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/complete_binding_3.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/completion1.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/completion1.png
new file mode 100644
index 000000000..03e1c9801
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/completion1.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/debug_prefs_callin_stepping.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/debug_prefs_callin_stepping.png
new file mode 100644
index 000000000..9aacadd85
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/debug_prefs_callin_stepping.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/debug_prefs_filtering.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/debug_prefs_filtering.png
new file mode 100644
index 000000000..2415cad2b
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/debug_prefs_filtering.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/implicitRoleHierarchy.jpg b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/implicitRoleHierarchy.jpg
new file mode 100644
index 000000000..9fb553c6e
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/implicitRoleHierarchy.jpg
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/langdef.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/langdef.png
new file mode 100644
index 000000000..ceb99ad1c
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/langdef.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/launchConfig.jpg b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/launchConfig.jpg
new file mode 100644
index 000000000..2e3e404ba
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/launchConfig.jpg
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/launchConfig.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/launchConfig.png
new file mode 100644
index 000000000..9a7f728bb
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/launchConfig.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/outline.jpg b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/outline.jpg
new file mode 100644
index 000000000..30d0be8bc
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/outline.jpg
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/packageExplorer.jpg b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/packageExplorer.jpg
new file mode 100644
index 000000000..ec54eb2b5
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/packageExplorer.jpg
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/packageExplorer.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/packageExplorer.png
new file mode 100644
index 000000000..ee7a1c215
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/packageExplorer.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/packageExplorer_logical.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/packageExplorer_logical.png
new file mode 100644
index 000000000..317090b6a
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/packageExplorer_logical.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/perspective.jpg b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/perspective.jpg
new file mode 100644
index 000000000..46d514525
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/perspective.jpg
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/perspective.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/perspective.png
new file mode 100644
index 000000000..8f82b027f
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/perspective.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/projectWizard.jpg b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/projectWizard.jpg
new file mode 100644
index 000000000..3f421b554
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/projectWizard.jpg
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/roleWizard.jpg b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/roleWizard.jpg
new file mode 100644
index 000000000..dafeb96a5
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/roleWizard.jpg
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/stack_entered_callin.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/stack_entered_callin.png
new file mode 100644
index 000000000..dc0158e23
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/stack_entered_callin.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/stack_entered_earnCredit.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/stack_entered_earnCredit.png
new file mode 100644
index 000000000..9c38c6427
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/stack_entered_earnCredit.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/stack_hit_callin.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/stack_hit_callin.png
new file mode 100644
index 000000000..ad6bfb8ed
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/stack_hit_callin.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/stack_lifting.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/stack_lifting.png
new file mode 100644
index 000000000..28d86cca4
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/stack_lifting.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/teamWizard.jpg b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/teamWizard.jpg
new file mode 100644
index 000000000..44cc2f9ab
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/teamWizard.jpg
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/team_monitor_marked.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/team_monitor_marked.png
new file mode 100644
index 000000000..9e35920f6
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/team_monitor_marked.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/typeHierarchy.jpg b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/typeHierarchy.jpg
new file mode 100644
index 000000000..e90444ddc
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/screenshots/typeHierarchy.jpg
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/stepinto_co.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/stepinto_co.gif
new file mode 100644
index 000000000..75d165bcd
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/stepinto_co.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/stepover_co.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/stepover_co.gif
new file mode 100644
index 000000000..1ec36ae2f
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/stepover_co.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/stepreturn_co.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/stepreturn_co.gif
new file mode 100644
index 000000000..4c2f21935
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/stepreturn_co.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/team_act.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/team_act.gif
new file mode 100644
index 000000000..58a8638cc
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/team_act.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/team_act_implicit.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/team_act_implicit.gif
new file mode 100644
index 000000000..41dc6c2aa
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/team_act_implicit.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/team_inact.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/team_inact.gif
new file mode 100644
index 000000000..2b5ea0d1e
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/images/team_inact.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/methodcompare.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/methodcompare.html
new file mode 100644
index 000000000..756ac8338
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/methodcompare.html
@@ -0,0 +1,42 @@
+<html>
+<head>
+ <meta name="copyright" content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel=stylesheet type="text/css" href="../css/book.css">
+ <link rel=stylesheet type="text/css" href="otguide.css">
+ <title>Comparing Bound Methods</title>
+ <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+</head>
+<body>
+<h1>Comparing Bound Methods</h1>
+
+
+
+<table><tr><td width="320" valign="top">
+ <p>
+ <strong>The OTDT provides a special action for comparing a role method with the base method to which it is bound.</strong>
+ </p>
+ <p>
+ To invoke this action the <strong>context menu</strong> of a callin method binding (in package explorer or outline)
+ is used: <span class="ui"><nobr>Compare With > <img src="../images/callinbindingreplace_obj.gif"> Bound Base Method</nobr></span>.
+ Alternatively, the context menu can also be used on a <code class="keyword">callin</code> method.
+ </p>
+ <p>
+ When invoked this action opens a <strong>compare editor</strong>, the left hand side showing the role method
+ and the right hand side showing the bound base method.
+ The role method is editable whereas the base method is shown read-only.
+ </p>
+ <p>
+ The action is most useful for <code class="keyword">callin</code> methods that are created
+ by copying the base method in order to apply fine grained modifications.
+ In this situation the compare editor can be used to inspect and update the modifications
+ as well as adopt any changes that might have occurred to the base method during evolution.
+ </p>
+ </td>
+ <td>
+ <img alt="Compare menu" src="images/screenshots/CompareMenu.png">
+ </td></tr></table>
+ <p>
+ <img alt="Compare editor for bound methods" src="images/screenshots/CompareWithBaseMethod.png">
+ </p>
+</body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otguide.css b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otguide.css
new file mode 100644
index 000000000..77c7bba04
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otguide.css
@@ -0,0 +1,2 @@
+.ui { background-color:#e0e0e0; padding:2px; }
+body { margin:10px; } \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/css/ot.css b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/css/ot.css
new file mode 100644
index 000000000..1418b3dae
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/css/ot.css
@@ -0,0 +1,468 @@
+/**
+ * @author mosconi
+ */
+
+/**
+ * color table
+ * light-yellow: #fffce4
+ * light-gray: #e0e0f0
+ * violet: #606080
+ * light-violet: #9090b0
+ */
+
+/* page initialization */
+html, body {
+ overflow: auto;
+ padding: 0;
+ margin: 0;
+ margin-bottom: 4px;
+ border: 0;
+ font-family: helvetica,avalon,sans-serif;
+/* font-size: 12pt; */
+}
+
+img {
+ border-style: none;
+}
+
+h4 {
+ color: #000060;
+}
+
+dt {
+ margin-top: 10px;
+}
+dd {
+ margin-bottom: 10px;
+}
+
+/* hyperlinks */
+a:link { color: #3010ff; text-decoration: none; }
+a:visited { color: #5060f7; text-decoration: none; }
+a:focus { }
+a:hover { color: black; background-color: #e8e8fc; text-decoration: none; }
+a:active { }
+
+a img, a.img {
+ border-style: none;
+ background-color: transparent;
+}
+
+/* top page area (horizontal) */
+#head {
+ position: absolute; /* switched to 'fixed' by javascript dynamically */
+ top: 0;
+ left: 0;
+ height: 80px; /* defines header height */
+ width: 100%;
+ margin: 0;
+ padding: 0;
+ border: 0;
+ border-bottom: solid 2px #e0e0f0; /* light-gray */
+ background-color: #fffce4; /* light-yellow */
+ background-image: url(../images/WebHeadBar.png);
+ background-position: top;
+ background-repeat: repeat-x;
+ z-index: 5;
+}
+
+/* page heading (title) */
+#head h1 {
+ margin: 0;
+ margin-left: 240px; /* width of #left + #logo */
+ margin-right: 49px; /* width of #logo, to center above content */
+ margin-top: 40px; /* vertically centered in head */
+ padding: 0;
+ text-align: center;
+ font-size: 18pt;
+ white-space: nowrap;
+}
+
+/* left page area (vertical) - contains logo */
+#left {
+ position: fixed;
+ top: 0;
+ left: 0;
+ width: 191px; /* image size */
+ height: 100%;
+ overflow: auto;
+ border: 0;
+ border-right: solid 2px #e0e0f0; /* light-gray */
+ background-color: #fffce4; /* light-yellow */
+ background-image: url(../images/WebHead1.png);
+ background-position: left top;
+ background-repeat: no-repeat;
+ background-attachment: scroll;
+ z-index: 6;
+}
+
+/* right part of the logo */
+#logo {
+ position: absolute; /* switched to 'fixed' by javascript dynamically */
+ top: 0;
+ left: 191px; /* width of #left */
+ width: 49px; /* image size */
+ height: 80px; /* height of #head */
+ border: 0;
+ background-color: #fffce4; /* light-yellow */
+ background-image: url(../images/WebHead2.png);
+ background-position: left top;
+ background-repeat: no-repeat;
+ z-index: 7;
+}
+
+/* rounded top left corner of content area */
+#corner {
+ position: absolute; /* switched to 'fixed' by javascript dynamically */
+ top: 80px; /* height of #head */
+ left: 191px; /* width of #left */
+ width: 30px; /* image size */
+ height: 30px; /* image size */
+ border: 0;
+ background-image: url(../images/bend-trans.png);
+ background-repeat: no-repeat;
+ z-index: 9;
+}
+
+#head.fixed, #logo.fixed, #corner.fixed { /* class applied by javascript dynamically */
+ position: fixed;
+}
+
+/* content page area */
+#content, #footer {
+ position: static;
+ padding-left: 15px;
+ padding-right: 15px;
+ padding-bottom: 0;
+ padding-top: 97px; /* height of #head (+ border) + 15 padding */ /* more compatible than margin-top */
+ margin-left: 193px; /* width of #left (+ border) */
+ border: 0;
+ z-index: 1;
+}
+
+/* page footer: */
+#footer {
+ padding-top: 0;
+ padding-bottom: 10px;
+ margin-bottom: 10px;
+ font-size: 10pt;
+ color: gray;
+}
+.w3c {
+ float: right;
+}
+
+/* navigation box - specializes div.box */
+#nav-box {
+ top: 120px;
+}
+#nav-box li {
+ background: url(../images/arrow-right-trans.png) no-repeat left 50%;
+ padding-left: 23px;
+}
+#nav-box li:hover {
+ background: #e8e8fc url(../images/arrow-right2-trans.png) no-repeat left 50%;
+}
+#nav-box li.active {
+ background: #e8e8fc url(../images/arrow-right2-trans.png) no-repeat left 50%;
+ /* border-right: solid 4px #606080; */
+ margin-right: -4px;
+}
+
+/* news box - specializes div.box */
+#news-box {
+ top: 180px;
+ font-size: 9pt;
+}
+#news-box ul a {
+ margin-bottom: 5px;
+ padding-bottom: 5px;
+ border-bottom: solid 1px #e0e0f0; /* light-gray */
+ color: #000000;
+}
+#news-box .date {
+ font-style: italic;
+ text-decoration: underline;
+}
+#news-box ul a:link .date {
+ color: #3010ff; /* a:link-blue */
+}
+#news-box ul a:visited .date {
+ color: #5060f7; /* a:visited-blue */
+}
+
+/* boxes for #left area */
+div.box {
+ position: relative;
+ left: 10px;
+ width: 165px;
+ margin: 0;
+ padding: 0;
+ border: solid 2px #606080; /* violet */
+ background-color: #ffffff;
+ z-index: 7;
+ font-size: 10pt;
+}
+.box-content {
+ margin-top: 0;
+ margin-bottom: 0;
+ margin-left: 12px;
+ margin-right: 12px;
+}
+div.box ul {
+ list-style: none;
+ padding-left: 0;
+}
+div.box ul a {
+ width: 100%;
+ display: block;
+ margin: 0;
+ padding: 0;
+}
+div.box ul a:hover {
+ border-right: solid 4px #606080;
+}
+
+/* boxes for #left area - top rounded heading */
+div.boxheadl {
+ position: relative; top: -15px; left: -2px;
+ height: 30px;
+ width: 169px; /* width of div.box + 4px border */
+ background: url(../images/heading-left-small.png) no-repeat left;
+ margin: 0;
+ padding: 0;
+}
+div.boxheadr {
+ height: 30px;
+ background: url(../images/heading-right-small.png) no-repeat top right;
+ margin: 0;
+ padding: 0;
+}
+div.boxheadr h1 {
+ height: 26px;
+ border-top: 2px solid #606080; /* violet */
+ border-bottom: 2px solid #606080; /* violet */
+ background-color: #9090b0; /* light-violet */
+ color: #fffce4; /* light-yellow */
+ font-size: 14pt;
+ font-style: normal;
+ font-weight: normal;
+ text-align: center;
+ line-height: 26px;
+ vertical-align: middle;
+ white-space: nowrap;
+ margin: 0;
+ margin-left: 15px;
+ margin-right: 15px;
+ padding: 0;
+}
+
+/* boxes for #left area - bottom rounded corners */
+div.boxbottoml {
+ position: relative; top: 15px; left: -2px;
+ height: 15px;
+ width: 169px; /* width of div.box + 4px border */
+ background: url(../images/bottom-left-small.png) no-repeat left;
+ margin: 0;
+ margin-top: -15px;
+ padding: 0;
+}
+div.boxbottomr {
+ height: 15px;
+ background: url(../images/bottom-right-small.png) no-repeat right bottom;
+ margin: 0;
+ padding: 0;
+}
+div.boxbottomm{
+ height: 13px;
+ background-color: #ffffff;
+ border-bottom: 2px solid #606080; /* violet */
+ margin: 0;
+ margin-left: 15px;
+ margin-right: 15px;
+}
+
+/* Section heading rounded bar (with icon) */
+div.headl {
+ height: 40px;
+ width: 100%;
+ background: url(../images/heading-left.png) no-repeat left;
+ margin-bottom: 10px;
+ margin-top: 30px;
+ padding: 0;
+}
+div.headr {
+ height: 40px;
+ background: url(../images/heading-right.png) no-repeat right;
+ margin: 0;
+ padding: 0;
+}
+div.headr h1 {
+ height: 36px;
+ border-top: 2px solid #606080; /* violet */
+ border-bottom: 2px solid #606080; /* violet */
+ background: #9090b0 url(../images/ot32.png) no-repeat left 50%;
+ color: #fffce4; /* light-yellow */
+ font-size: 18pt;
+ line-height: 36px;
+ vertical-align: middle;
+ white-space: nowrap;
+ overflow: hidden;
+ margin: 0;
+ margin-left: 20px;
+ margin-right: 20px;
+ padding: 0;
+ padding-left: 50px;
+}
+
+/* horizontal line */
+div.line, span.line, dt.line {
+ display: block;
+ clear: both;
+ width: 100%;
+ height: 4px;
+ background: url(../images/line.gif) no-repeat left;
+}
+
+/* publications: separator line mentioning the year: */
+span.yearline {
+ display: block;
+ clear: both;
+ width: 100%;
+ height: 4px;
+ background: url(../images/line.gif) no-repeat left;
+ margin:0;
+ padding-left:616px;
+ color:gray;
+ font-weight:bold;
+}
+
+/* Intro: */
+div.intro {
+ width: 90%;
+ max-width: 820px;
+ margin: 10px;
+ margin-left: 40px;
+ margin-right: auto;
+}
+
+div.term {
+ float: left;
+ width: 25%;
+ min-width: 130px;
+ max-width: 190px;
+ padding: 2px;
+ color: #000060;
+}
+
+div.termdesc {
+ float: left;
+ width: 70%;
+ min-width: 300px;
+ max-width: 600px;
+ padding: 2px;
+}
+
+
+/* tables: */
+table, td, th { /* from otjld.css - should be refactored */
+ border-style: none;
+ border-width: 0;
+ border-spacing: 0px;
+ border-collapse: collapse;
+ padding: 2px 6px;
+}
+
+.border td {
+ border: 1px solid #e0e0f0;
+}
+
+.noborder td {
+ border: none;
+}
+
+table.default, table.default td {
+ border-style: solid;
+ border-color: #e0e0f0;
+ border-width: 2px;
+ border-spacing: 0px;
+ border-collapse: collapse;
+ padding: 2px 6px;
+ margin: 10px;
+}
+table.default th {
+ background-color:#e0e0f0;
+}
+
+table.default-mm th {
+ color: #fffce4; /* light-yellow */
+ background-color: #9090b0; /* light-violet */
+}
+table.default td {
+ background-color: #fffce4; /* light-yellow */
+}
+
+span.hint-box {
+ display: inline-block;
+ width: auto;
+ background-color: #fffce4; /* light-yellow */
+ border: 2px solid #e0e0f0;
+ padding: 2px 10px;
+}
+
+a.helplink {
+ background: url(../images/linkto_help.gif) no-repeat left;
+ padding-left: 20px;
+ font-size: 10pt;
+}
+
+/* misc layout options */
+.center {
+ text-align: center;
+}
+.indent5 {
+ padding-left: 5mm;
+}
+div.indent {
+ margin-left:20pt;
+}
+div.ttindent {
+ font-family:courier,monospace;
+ margin-left:20pt;
+}
+/* special highlighting: */
+.black {
+ color: black;
+ font-weight: bold;
+}
+.darkblue {
+ color: #000060;
+}
+.error {
+ color: red;
+}
+.blue {
+ color: blue;
+}
+.green {
+ color: green;
+}
+.underline {
+ text-decoration: underline;
+}
+code.keyword {
+ color:#7F0055;
+ font-weight:bold;
+}
+/* zebra stripes ;-) */
+.z1 { background-color:#fff0c8; }
+.z2 { background-color:#fff8e0; }
+.z3 { background-color:#fffce4; }
+
+
+/* to clear floats: */
+div.clearer {
+ clear: both;
+ line-height: 0pt;
+ font-size: 1px;
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/css/ot.fix-ie6.css b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/css/ot.fix-ie6.css
new file mode 100644
index 000000000..2f2055b26
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/css/ot.fix-ie6.css
@@ -0,0 +1,45 @@
+/**
+ * contains fixes for IE version < 7
+ * @author mosconi
+ */
+html {
+ height: 100%;
+ max-height: 100%;
+}
+
+#left {
+ position: absolute; /* switched to 'fixed' by javascript dynamically */
+ height: 1000px;
+}
+#left.fixed { /* class applied by javascript dynamically */
+ position: fixed;
+}
+
+/* display content over rounded corner background */
+#content {
+ z-index: 99; /* overwritten by javascript to 1 */
+}
+
+div.boxheadr {
+ margin-right: -4px;
+ overflow: visible;
+}
+div.boxbottomr {
+ margin-right: -4px;
+ overflow: visible;
+}
+div.boxbottomm{
+ height: 13px;
+ overflow: hidden;
+ margin-top: 0;
+ margin-bottom: 0;
+ margin-left: 15px;
+ margin-right: 15px;
+}
+
+#nav-box li {
+ background: none;
+ list-style: url(../images/arrow-right-trans.png);
+ padding-left: 5px;
+ margin-left: 15px;
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/css/otjld.css b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/css/otjld.css
new file mode 100644
index 000000000..eed8a8b98
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/css/otjld.css
@@ -0,0 +1,291 @@
+/* override margins from ot.css: */
+body.otdt {
+ margin: 4px;
+ padding: 4px;
+}
+
+body.otdt #content {
+ margin: 0;
+ padding: 0;
+}
+
+body.otdt #footer {
+ margin-top: 10px;
+ margin-left: 4px;
+}
+
+/* Syntax links: */
+a.syntax {
+ border: 1px solid red;
+ margin: 2px;
+ padding: 2px;
+}
+
+/* ToC page: */
+div.toc {
+ font-weight: bold;
+ padding-left: 20px;
+}
+
+div.toc.depth1 {
+ font-size: 1.2em;
+}
+
+div.toc.depth2 {
+ padding-left: 50px;
+}
+div.toc.depth2 a {
+ color: black;
+}
+
+div.toc.depth3 {
+ padding-left: 80px;
+}
+div.toc.depth3 a {
+ color: black;
+}
+
+/* Chapter headings (with icon): */
+div.chapter {
+ margin: 0px;
+ padding: 0px;
+}
+
+/* Mini-ToC-Box: */
+div#toc-box {
+ position: fixed;
+ top: 100px;
+ right: 5px;
+ width: 22pt;
+ z-index: 9;
+ background-color: #fff8e0;
+ border: 2px solid #e0e0f0;
+ border-right: none;
+ font-size: 10pt;
+ white-space: nowrap;
+ opacity: 0.5;
+ -moz-opacity: 0.5;
+ filter: alpha(opacity=50);
+}
+
+div#toc-box.web {
+ top: 200px;
+}
+
+div#toc-box:hover {
+ right: 5px;
+ width: auto;
+ border: 2px solid #e0e0f0;
+ opacity: 0.9;
+ -moz-opacity: 0.9;
+ filter: alpha(opacity=90);
+}
+
+ul.toc-box {
+ list-style-type: none;
+ margin: 5px;
+ padding: 0px;
+}
+
+/* (Sub)sections: */
+div.sect, div.aux {
+ padding-left: 5px;
+ margin-right: 25pt;
+}
+
+h2.sect {
+ position: relative;
+ background-color: #e0e0f0;
+ padding: 2px;
+ padding-left: 10px;
+}
+
+h3.sect, h4.aux {
+ position: relative;
+ background-color: #e0e0f0;
+ padding: 2px;
+ padding-left: 5px;
+}
+
+div.subsect {
+ width: 90%;
+ margin-left: 20px;
+ margin-right: 20px;
+ margin-top: 10px;
+ margin-bottom: 10px;
+}
+
+h4.subsect {
+ font-weight: normal;
+ margin-left: -20px;
+ margin-bottom: 4px;
+}
+h4.subsect + p {
+ margin-top: 2px;
+}
+
+h4.subsect .title {
+ text-decoration: underline;
+}
+
+span.toplink {
+ position: absolute; right: 10px;
+ font-size: 10pt;
+ font-weight: normal;
+}
+
+/* Listings: */
+div.listing {
+ float: none;
+ width: 90%;
+ overflow: auto;
+ font-family: Courier;
+ font-size: 10pt;
+ padding: 0;
+ margin: 2px;
+}
+
+div.listing.frame {
+ border: 4px solid #9090B0;
+}
+
+table.listing {
+ width: 100%;
+ border: none;
+ border-spacing: 0;
+ border-collapse: collapse;
+}
+
+tr.line.odd {
+ background-color: #fff0c8;
+}
+
+tr.line.even {
+ background-color: #fff8e0;
+}
+
+div.listing pre {
+ margin: 0px;
+ padding: 2px;
+}
+
+td.ln {
+ color: #5060f7;
+ width: 20px;
+ text-align: right;
+ vertical-align: middle;
+ font-size: 12pt;
+ padding-left: 5px;
+ padding-right: 10px;
+}
+
+pre em {
+ font-style: normal;
+ color: blue;
+}
+pre .comment {
+ color: green;
+}
+
+h5.listing {
+ margin-bottom: 0px;
+}
+
+/* other OTJLD elements: */
+div.note {
+ font-style: italic;
+ margin-left: 10px;
+}
+
+div.codecomment {
+ width: 90%;
+ background-color: #fff8e0;
+ font-size: 0.8em;
+ margin-top: 5px;
+ padding: 2px;
+}
+div.codecomment>h5, div.note>h5 {
+ margin: 2px;
+}
+div.codecomment>h5+p, div.note>h5+p {
+ margin-top: 2px;
+}
+
+table.syntaxrule {
+ width: 80%;
+ border: 2px solid #e0e0f0;
+ border-spacing: 0px;
+ border-collapse: collapse;
+ margin: 4px;
+ padding: 0;
+}
+table.syntaxrule td.sect {
+ width: 80px;
+ border: 2px solid #e0e0f0;
+ padding: 5px;
+ vertical-align: top;
+ font-weight: bold;
+}
+table.syntaxrule td.rule {
+ padding-left: 20px;
+ background-color: #fff8e0;
+}
+table.syntaxrule .title {
+ margin-left: -10px;
+ font-weight: bold;
+ font-style: italic;
+ color: blue;
+}
+
+ol.constraints {
+ list-style-type: lower-alpha;
+}
+ol.constraints .title {
+ text-decoration: underline;
+}
+h5.constraints {
+ margin-bottom: 2px;
+}
+
+/* page navigation: */
+table.nav {
+ border: 2px solid #e0e0f0;
+ border-collapse: collapse;
+ width: 95%;
+ white-space: nowrap;
+ margin-left: auto;
+ margin-right: auto;
+ margin-top: 5px;
+ margin-bottom: 5px;
+ background-color: #fff8e0;
+ font-size: 10pt;
+}
+
+td.back {
+ width: 35%;
+ padding-left: 4px;
+ text-align: left;
+ white-space: nowrap;
+}
+td.top {
+ border: 2px solid #e0e0f0;
+ text-align: center;
+ white-space: nowrap;
+}
+td.next {
+ width: 35%;
+ padding-right: 4px;
+ text-align: right;
+ white-space: nowrap;
+}
+
+div.breadcrumb {
+ width: 95%;
+ margin-left: auto;
+ margin-right: auto;
+ white-space: nowrap;
+}
+
+a.nav {
+ font-size: 10pt;
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/css/heading_left.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/css/heading_left.png
new file mode 100644
index 000000000..bc2bff7d4
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/css/heading_left.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/css/heading_right.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/css/heading_right.png
new file mode 100644
index 000000000..3c4af599d
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/css/heading_right.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/css/line.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/css/line.gif
new file mode 100644
index 000000000..212443d52
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/css/line.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/css/otjld.css b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/css/otjld.css
new file mode 100644
index 000000000..3766d4875
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/css/otjld.css
@@ -0,0 +1,474 @@
+body {
+ background-color: #ffffff;
+ font-family: helvetica,avalon,sans-serif;
+ margin: 4px;
+ padding: 4px;
+}
+
+/* Web-Design: (copied from ot2.css) */
+
+body.web-design {
+ z-index:0;
+ background-image:url(gray.png);
+ background-repeat:repeat-y;
+ background-position: left;
+}
+
+#logo {
+ position: fixed; top: 0px; left: 0px;
+ white-space: nowrap;
+ width: 100%;
+ z-index: 16;
+}
+
+img#topbar {
+ vertical-align: top;
+}
+
+a#back {
+ background-color: inherit;
+}
+
+a.showmenu { color:#fffce4; background-color:inherit; }
+a:hover.showmenu { color:#FFA500; background-color:inherit; cursor:pointer;} /* color: orange1 */
+div#showmenu {
+ position:fixed;top:10px;left:2px;
+ font-size:6pt;
+ z-index:17;
+}
+
+#chead {
+ position:fixed;top:-7px;left:0px;
+ background-color:#fffce4;
+ background-image:url(gray.png);
+ background-repeat:repeat-x;
+ background-position: bottom;
+
+ padding-top:13px;
+ padding-left:0px;
+ padding-right:0px;
+ width:100%;
+ height:38px;
+ z-index:10;
+ margin-left:22px;
+ margin-top:35px;
+ font-size:18pt;
+ font-weight:bold;
+ text-align:center;
+ text-shadow: #e4e0d6 2px 3px 1px;
+}
+
+#bend{
+ position:fixed;top:60px;left: 0px;
+ background-image:url(bend-trans.png);
+ background-repeat:no-repeat;
+ width:30px;
+ height:50px;
+ margin-left:0px;
+ margin-top:0px;
+ z-index:11;
+}
+
+#spacer {
+ height: 80px;
+}
+
+
+/* Links: */
+a:visited { color: #5060f7; text-decoration: none; }
+a:link { color: #3010ff; text-decoration: none; }
+a:hover { color: black; background-color: #e8e8fc; }
+
+a.syntax {
+ border: 1px solid red;
+ margin: 2px;
+ padding: 2px;
+}
+
+a img {
+ border-style: none;
+}
+
+/* ToC page: */
+div.toc {
+ font-weight: bold;
+ padding-left: 20px;
+}
+
+div.toc.depth1 {
+ font-size: 1.2em;
+}
+
+div.toc.depth2 {
+ padding-left: 50px;
+}
+div.toc.depth2 a {
+ color: black;
+}
+
+div.toc.depth3 {
+ padding-left: 80px;
+}
+div.toc.depth3 a {
+ color: black;
+}
+
+/* Chapter headings (with icon): */
+div.chapter {
+ margin: 0px;
+ padding: 0px;
+}
+
+div.headl {
+ height: 40px;
+ width: 100%;
+ background: url(heading_left.png) no-repeat left;
+ margin-bottom: 10px;
+ margin-top: 0px;
+ padding: 0px;
+}
+
+div.headr {
+ height: 40px;
+ background: url(heading_right.png) no-repeat top right;
+ margin: 0px;
+ padding: 0px;
+}
+
+div.headr h1 {
+ height: 34px;
+ border-top: 2px solid #626280;
+ border-bottom: 2px solid #626280;
+ background-color: #9090B0;
+ color:#ffffe0;
+ font-size: 20pt;
+ margin-left: 50px;
+ margin-right: 22px;
+ padding-left: 10px;
+ padding-top: 2px;
+ margin-top: 0px;
+ margin-bottom: 0px;
+ padding-bottom: 0px;
+}
+
+/* Mini-ToC-Box: */
+div.toc-box, div#toc-box { /* transitionally support both class and id [SH] */
+ position: fixed;
+ top: 100px;
+ right: 5px;
+ width: 22pt;
+ z-index: 9;
+ background-color: #fff8e0;
+ border: 2px solid #e0e0f0;
+ border-right: none;
+ font-size: 10pt;
+ white-space: nowrap;
+ opacity: 0.5;
+ -moz-opacity: 0.5;
+ filter: alpha(opacity=50);
+}
+
+div#toc-box.web-design {
+ top: 180px;
+}
+
+div#toc-box:hover {
+ right: 5px;
+ width: auto;
+ border: 2px solid #e0e0f0;
+ opacity: 0.9;
+ -moz-opacity: 0.9;
+ filter: alpha(opacity=90);
+}
+
+ul.toc-box {
+ list-style-type: none;
+ margin: 5px;
+ padding: 0px;
+}
+
+/* Intro: */
+div.intro {
+ width: 90%;
+ max-width: 820px;
+ margin: 10px;
+ margin-left: 40px;
+ margin-right: auto;
+}
+
+div.line {
+ clear: both;
+ height: 5px;
+ background: url(line.gif) no-repeat left;
+}
+
+div.term {
+ float: left;
+ width: 25%;
+ min-width: 130px;
+ max-width: 190px;
+ padding: 2px;
+ color: #000060;
+}
+
+div.termdesc {
+ float: left;
+ width: 70%;
+ min-width: 300px;
+ max-width: 600px;
+ padding: 2px;
+}
+
+/* (Sub)sections: */
+div.sect, div.aux {
+ padding-left: 5px;
+ margin-right: 25pt;
+}
+
+h2.sect {
+ position: relative;
+ background-color: #e0e0f0;
+ padding: 2px;
+ padding-left: 10px;
+}
+
+h3.sect, h4.aux {
+ position: relative;
+ background-color: #e0e0f0;
+ padding: 2px;
+ padding-left: 5px;
+}
+
+div.subsect {
+ width: 90%;
+ margin-left: 20px;
+ margin-right: 20px;
+ margin-top: 10px;
+ margin-bottom: 10px;
+}
+
+h4.subsect {
+ font-weight: normal;
+ margin-left: -20px;
+ margin-bottom: 4px;
+}
+h4.subsect + p {
+ margin-top: 2px;
+}
+
+h4.subsect .title {
+ text-decoration: underline;
+}
+
+span.toplink {
+ position: absolute; right: 10px;
+ font-size: 10pt;
+ font-weight: normal;
+}
+
+/* Listings: */
+div.listing {
+ float: none;
+ width: 90%;
+ overflow: auto;
+ font-family: Courier;
+ font-size: 10pt;
+ padding: 0;
+ margin: 2px;
+}
+
+div.listing.frame {
+ border: 4px solid #9090B0;
+}
+
+table.listing {
+ width: 100%;
+ border: none;
+ border-spacing: 0;
+ border-collapse: collapse;
+}
+
+tr.line.odd {
+ background-color: #fff0c8;
+}
+
+tr.line.even {
+ background-color: #fff8e0;
+}
+
+div.listing pre {
+ margin: 0px;
+ padding: 2px;
+}
+
+td.ln {
+ color: #5060f7;
+ width: 20px;
+ text-align: right;
+ vertical-align: middle;
+ font-size: 12pt;
+ padding-left: 5px;
+ padding-right: 10px;
+}
+
+pre em {
+ font-style: normal;
+ color: blue;
+}
+pre .comment {
+ color: green;
+}
+
+h5.listing {
+ margin-bottom: 0px;
+}
+
+/* other OTJLD elements: */
+div.note {
+ font-style: italic;
+ margin-left: 10px;
+}
+
+div.codecomment {
+ width: 90%;
+ background-color: #fff8e0;
+ font-size: 0.8em;
+ margin-top: 5px;
+ padding: 2px;
+}
+div.codecomment>h5, div.note>h5 {
+ margin: 2px;
+}
+div.codecomment>h5+p, div.note>h5+p {
+ margin-top: 2px;
+}
+
+table.syntaxrule {
+ width: 80%;
+ border: 2px solid #e0e0f0;
+ border-spacing: 0px;
+ border-collapse: collapse;
+ margin: 4px;
+ padding: 0;
+}
+table.syntaxrule td.sect {
+ width: 80px;
+ border: 2px solid #e0e0f0;
+ padding: 5px;
+ vertical-align: top;
+ font-weight: bold;
+}
+table.syntaxrule td.rule {
+ padding-left: 20px;
+ background-color: #fff8e0;
+}
+table.syntaxrule .title {
+ margin-left: -10px;
+ font-weight: bold;
+ font-style: italic;
+ color: blue;
+}
+
+ol.constraints {
+ list-style-type: lower-alpha;
+}
+ol.constraints .title {
+ text-decoration: underline;
+}
+h5.constraints {
+ margin-bottom: 2px;
+}
+
+/* page navigation: */
+table.nav {
+ border: 2px solid #e0e0f0;
+ border-collapse: collapse;
+ width: 95%;
+ white-space: nowrap;
+ margin-left: auto;
+ margin-right: auto;
+ margin-top: 5px;
+ margin-bottom: 5px;
+ background-color: #fff8e0;
+ font-size: 10pt;
+}
+
+td.back {
+ width: 35%;
+ padding-left: 4px;
+ text-align: left;
+ white-space: nowrap;
+}
+td.top {
+ border: 2px solid #e0e0f0;
+ text-align: center;
+ white-space: nowrap;
+}
+td.next {
+ width: 35%;
+ padding-right: 4px;
+ text-align: right;
+ white-space: nowrap;
+}
+
+div.nav {
+ width: 95%;
+ margin-left: auto;
+ margin-right: auto;
+ white-space: nowrap;
+}
+
+a.nav {
+ font-size: 10pt;
+}
+
+/* page footer: */
+div.footer {
+ margin-top: 10px;
+ font-size: 10pt;
+ color: gray;
+}
+
+#w3c {
+ float: right;
+}
+
+/* to clear floats: */
+div.clearer {
+ clear: both;
+ line-height: 0pt;
+ font-size: 1px;
+}
+
+/* tables: */
+table {
+ border-style: solid;
+ border-color: #e0e0f0;
+ border-spacing: 0px;
+ border-collapse: collapse;
+}
+
+/* special highlighting: */
+.error {
+ color: red;
+}
+
+.blue {
+ color: blue;
+}
+.green {
+ color: green;
+}
+
+.underline {
+ text-decoration: underline;
+}
+
+/* zebra stripes ;-) */
+.z1 { background-color:#fff0c8; }
+
+.z2 { background-color:#fff8e0; }
+
+span.indent5 {
+ padding-left: 5mm;
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/css/valid-xhtml11-blue.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/css/valid-xhtml11-blue.png
new file mode 100644
index 000000000..88fefcbf1
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/css/valid-xhtml11-blue.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/images/Layering.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/images/Layering.png
new file mode 100644
index 000000000..0f54738a2
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/images/Layering.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/images/foo.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/images/foo.png
new file mode 100644
index 000000000..aefdfd651
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/images/foo.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/images/guards.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/images/guards.png
new file mode 100644
index 000000000..741696cc2
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/images/guards.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/images/implicitly_overriding_playedby.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/images/implicitly_overriding_playedby.png
new file mode 100644
index 000000000..b76a2cb9b
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/images/implicitly_overriding_playedby.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/images/implicitly_overriding_playedby_base.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/images/implicitly_overriding_playedby_base.png
new file mode 100644
index 000000000..b7c24e49c
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/images/implicitly_overriding_playedby_base.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/images/smart_lifting_small.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/images/smart_lifting_small.png
new file mode 100644
index 000000000..362ff65e3
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/images/smart_lifting_small.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/images/team_nesting_hor.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/images/team_nesting_hor.png
new file mode 100644
index 000000000..aa2457589
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/images/team_nesting_hor.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/index.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/index.html
new file mode 100644
index 000000000..2be937a1e
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/index.html
@@ -0,0 +1,127 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <div class="headl">
+ <div class="headr">
+ <h1>Table of Contents</h1>
+ </div>
+ </div>
+ <div class="toc depth1"><a href="s0.html" rel="section">&sect;0&nbsp;About this Document</a></div>
+ <div class="toc depth2"><a href="s0.html#s0.1" rel="section">&sect;0.1&nbsp;Purpose(s) of this document</a></div>
+ <div class="toc depth2"><a href="s0.html#s0.2" rel="section">&sect;0.2&nbsp;Text structure</a></div>
+ <div class="toc depth2"><a href="s0.html#s0.3" rel="section">&sect;0.3&nbsp;Compiler messages</a></div>
+ <div class="toc depth2"><a href="s0.html#s0.4" rel="section">&sect;0.4&nbsp;Versions</a></div>
+ <div class="toc depth2"><a href="s0.html#s0.5" rel="section">&sect;0.5&nbsp;Publishing</a></div>
+ <div class="toc depth1"><a href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a></div>
+ <div class="toc depth2"><a href="s1.html#s1.1" rel="section">&sect;1.1&nbsp;Team classes</a></div>
+ <div class="toc depth2"><a href="s1.html#s1.2" rel="section">&sect;1.2&nbsp;Role classes and objects</a></div>
+ <div class="toc depth3"><a href="s1.html#s1.2.1" rel="section">&sect;1.2.1&nbsp;Modifiers for roles</a></div>
+ <div class="toc depth3"><a href="s1.html#s1.2.2" rel="section">&sect;1.2.2&nbsp;Externalized roles</a></div>
+ <div class="toc depth3"><a href="s1.html#s1.2.3" rel="section">&sect;1.2.3&nbsp;Protected roles</a></div>
+ <div class="toc depth3"><a href="s1.html#s1.2.4" rel="section">&sect;1.2.4&nbsp;Type tests and casts</a></div>
+ <div class="toc depth3"><a href="s1.html#s1.2.5" rel="section">&sect;1.2.5&nbsp;File structure</a></div>
+ <div class="toc depth2"><a href="s1.html#s1.3" rel="section">&sect;1.3&nbsp;Acquisition and implicit inheritance of role classes</a></div>
+ <div class="toc depth3"><a href="s1.html#s1.3.1" rel="section">&sect;1.3.1&nbsp;Acquisition and implicit inheritance of role classes</a></div>
+ <div class="toc depth3"><a href="s1.html#s1.3.2" rel="section">&sect;1.3.2&nbsp;Regular role inheritance</a></div>
+ <div class="toc depth2"><a href="s1.html#s1.4" rel="section">&sect;1.4&nbsp;Name clashes</a></div>
+ <div class="toc depth2"><a href="s1.html#s1.5" rel="section">&sect;1.5&nbsp;Team and role nesting</a></div>
+ <div class="toc depth1"><a href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a></div>
+ <div class="toc depth2"><a href="s2.html#s2.1" rel="section">&sect;2.1&nbsp;playedBy relation</a></div>
+ <div class="toc depth3"><a href="s2.html#s2.1.1" rel="section">&sect;2.1.1&nbsp;Binding interfaces</a></div>
+ <div class="toc depth3"><a href="s2.html#s2.1.2" rel="section">&sect;2.1.2&nbsp;Legal base classes</a></div>
+ <div class="toc depth2"><a href="s2.html#s2.2" rel="section">&sect;2.2&nbsp;Lowering</a></div>
+ <div class="toc depth2"><a href="s2.html#s2.3" rel="section">&sect;2.3&nbsp;Lifting</a></div>
+ <div class="toc depth3"><a href="s2.html#s2.3.1" rel="section">&sect;2.3.1&nbsp;Implicit role creation</a></div>
+ <div class="toc depth3"><a href="s2.html#s2.3.2" rel="section">&sect;2.3.2&nbsp;Declared lifting</a></div>
+ <div class="toc depth3"><a href="s2.html#s2.3.3" rel="section">&sect;2.3.3&nbsp;Smart lifting</a></div>
+ <div class="toc depth3"><a href="s2.html#s2.3.4" rel="section">&sect;2.3.4&nbsp;Binding ambiguities</a></div>
+ <div class="toc depth2"><a href="s2.html#s2.4" rel="section">&sect;2.4&nbsp;Explicit role creation</a></div>
+ <div class="toc depth3"><a href="s2.html#s2.4.1" rel="section">&sect;2.4.1&nbsp;Role creation via a lifting constructor</a></div>
+ <div class="toc depth3"><a href="s2.html#s2.4.2" rel="section">&sect;2.4.2&nbsp;Role creation via a regular constructor</a></div>
+ <div class="toc depth3"><a href="s2.html#s2.4.3" rel="section">&sect;2.4.3&nbsp;Role creation in the presence of smart lifting</a></div>
+ <div class="toc depth2"><a href="s2.html#s2.5" rel="section">&sect;2.5&nbsp;Abstract Roles</a></div>
+ <div class="toc depth2"><a href="s2.html#s2.6" rel="section">&sect;2.6&nbsp;Explicit base references</a></div>
+ <div class="toc depth2"><a href="s2.html#s2.7" rel="section">&sect;2.7&nbsp;Advanced structures</a></div>
+ <div class="toc depth1"><a href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a></div>
+ <div class="toc depth2"><a href="s3.html#s3.1" rel="section">&sect;3.1&nbsp;Callout method binding</a></div>
+ <div class="toc depth2"><a href="s3.html#s3.2" rel="section">&sect;3.2&nbsp;Callout parameter mapping</a></div>
+ <div class="toc depth2"><a href="s3.html#s3.3" rel="section">&sect;3.3&nbsp;Lifting and lowering</a></div>
+ <div class="toc depth2"><a href="s3.html#s3.4" rel="section">&sect;3.4&nbsp;Overriding access restrictions</a></div>
+ <div class="toc depth2"><a href="s3.html#s3.5" rel="section">&sect;3.5&nbsp;Callout to field</a></div>
+ <div class="toc depth1"><a href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a></div>
+ <div class="toc depth2"><a href="s4.html#s4.1" rel="section">&sect;4.1&nbsp;Callin method binding</a></div>
+ <div class="toc depth2"><a href="s4.html#s4.2" rel="section">&sect;4.2&nbsp;Callin modifiers (before, after, replace)</a></div>
+ <div class="toc depth2"><a href="s4.html#s4.3" rel="section">&sect;4.3&nbsp;Base calls</a></div>
+ <div class="toc depth2"><a href="s4.html#s4.4" rel="section">&sect;4.4&nbsp;Callin parameter mapping</a></div>
+ <div class="toc depth2"><a href="s4.html#s4.5" rel="section">&sect;4.5&nbsp;Lifting and lowering</a></div>
+ <div class="toc depth2"><a href="s4.html#s4.6" rel="section">&sect;4.6&nbsp;Overriding access restrictions</a></div>
+ <div class="toc depth2"><a href="s4.html#s4.7" rel="section">&sect;4.7&nbsp;Callin binding with static methods</a></div>
+ <div class="toc depth2"><a href="s4.html#s4.8" rel="section">&sect;4.8&nbsp;Callin precedence</a></div>
+ <div class="toc depth2"><a href="s4.html#s4.9" rel="section">&sect;4.9&nbsp;Callin inheritance</a></div>
+ <div class="toc depth3"><a href="s4.html#s4.9.1" rel="section">&sect;4.9.1&nbsp;Base side inheritance</a></div>
+ <div class="toc depth3"><a href="s4.html#s4.9.2" rel="section">&sect;4.9.2&nbsp;Role side inheritance</a></div>
+ <div class="toc depth3"><a href="s4.html#s4.9.3" rel="section">&sect;4.9.3&nbsp;Covariant return types</a></div>
+ <div class="toc depth2"><a href="s4.html#s4.10" rel="section">&sect;4.10&nbsp;Generic callin bindings</a></div>
+ <div class="toc depth1"><a href="s5.html" rel="section">&sect;5&nbsp;Team Activation</a></div>
+ <div class="toc depth2"><a href="s5.html#s5.1" rel="section">&sect;5.1&nbsp;Effect of team activation</a></div>
+ <div class="toc depth3"><a href="s5.html#s5.1.1" rel="section">&sect;5.1.1&nbsp;Global vs. thread local team activation</a></div>
+ <div class="toc depth3"><a href="s5.html#s5.1.2" rel="section">&sect;5.1.2&nbsp;Effect on garbage collection</a></div>
+ <div class="toc depth2"><a href="s5.html#s5.2" rel="section">&sect;5.2&nbsp;Explicit team activation</a></div>
+ <div class="toc depth2"><a href="s5.html#s5.3" rel="section">&sect;5.3&nbsp;Implicit team activation</a></div>
+ <div class="toc depth2"><a href="s5.html#s5.4" rel="section">&sect;5.4&nbsp;Guard predicates</a></div>
+ <div class="toc depth3"><a href="s5.html#s5.4.1" rel="section">&sect;5.4.1&nbsp;Regular guards</a></div>
+ <div class="toc depth3"><a href="s5.html#s5.4.2" rel="section">&sect;5.4.2&nbsp;Base guards</a></div>
+ <div class="toc depth3"><a href="s5.html#s5.4.3" rel="section">&sect;5.4.3&nbsp;Multiple guards</a></div>
+ <div class="toc depth2"><a href="s5.html#s5.5" rel="section">&sect;5.5&nbsp;Unanticipated team activation</a></div>
+ <div class="toc depth1"><a href="s6.html" rel="section">&sect;6&nbsp;Object Teams API</a></div>
+ <div class="toc depth2"><a href="s6.html#s6.1" rel="section">&sect;6.1&nbsp;Reflection</a></div>
+ <div class="toc depth2"><a href="s6.html#s6.2" rel="section">&sect;6.2&nbsp;Other API Elements</a></div>
+ <div class="toc depth1"><a href="s7.html" rel="section">&sect;7&nbsp;Role Encapsulation</a></div>
+ <div class="toc depth2"><a href="s7.html#s7.1" rel="section">&sect;7.1&nbsp;Opaque roles</a></div>
+ <div class="toc depth2"><a href="s7.html#s7.2" rel="section">&sect;7.2&nbsp;Confined roles</a></div>
+ <div class="toc depth1"><a href="s8.html" rel="section">&sect;8&nbsp;Join Point Queries</a></div>
+ <div class="toc depth2"><a href="s8.html#s8.1" rel="section">&sect;8.1&nbsp;Join point queries</a></div>
+ <div class="toc depth2"><a href="s8.html#s8.2" rel="section">&sect;8.2&nbsp;Query expressions</a></div>
+ <div class="toc depth2"><a href="s8.html#s8.3" rel="section">&sect;8.3&nbsp;OT/J meta model</a></div>
+ <div class="toc depth1"><a href="s9.html" rel="section">&sect;9&nbsp;Value Dependent Classes</a></div>
+ <div class="toc depth2"><a href="s9.html#s9.1" rel="section">&sect;9.1&nbsp;Defining classes with value parameters</a></div>
+ <div class="toc depth2"><a href="s9.html#s9.2" rel="section">&sect;9.2&nbsp;Using classes with value parameters</a></div>
+ <div class="toc depth3"><a href="s9.html#s9.2.1" rel="section">&sect;9.2.1&nbsp;Parameter substitution</a></div>
+ <div class="toc depth3"><a href="s9.html#s9.2.2" rel="section">&sect;9.2.2&nbsp;Type conformance</a></div>
+ <div class="toc depth2"><a href="s9.html#s9.3" rel="section">&sect;9.3&nbsp;Restrictions and limitations</a></div>
+ <div class="toc depth1"><a href="sA.html" rel="section">&sect;A&nbsp;OT/J Syntax</a></div>
+ <div class="toc depth2"><a href="sA.html#sA.0" rel="section">&sect;A.0&nbsp;Keywords</a></div>
+ <div class="toc depth3"><a href="sA.html#sA.0.1" rel="section">&sect;A.0.1&nbsp;Scoped keywords</a></div>
+ <div class="toc depth3"><a href="sA.html#sA.0.2" rel="section">&sect;A.0.2&nbsp;Inheriting scoped keywords</a></div>
+ <div class="toc depth3"><a href="sA.html#sA.0.3" rel="section">&sect;A.0.3&nbsp;Internal names</a></div>
+ <div class="toc depth2"><a href="sA.html#sA.1" rel="section">&sect;A.1&nbsp;Class definitions</a></div>
+ <div class="toc depth2"><a href="sA.html#sA.2" rel="section">&sect;A.2&nbsp;Modifiers</a></div>
+ <div class="toc depth2"><a href="sA.html#sA.3" rel="section">&sect;A.3&nbsp;Method bindings</a></div>
+ <div class="toc depth2"><a href="sA.html#sA.4" rel="section">&sect;A.4&nbsp;Parameter mappings</a></div>
+ <div class="toc depth2"><a href="sA.html#sA.5" rel="section">&sect;A.5&nbsp;Statements</a></div>
+ <div class="toc depth2"><a href="sA.html#sA.6" rel="section">&sect;A.6&nbsp;Types</a></div>
+ <div class="toc depth2"><a href="sA.html#sA.7" rel="section">&sect;A.7&nbsp;Guard predicates</a></div>
+ <div class="toc depth2"><a href="sA.html#sA.8" rel="section">&sect;A.8&nbsp;Precedence declaration</a></div>
+ <div class="toc depth2"><a href="sA.html#sA.9" rel="section">&sect;A.9&nbsp;Value dependent types</a></div>
+ <div class="toc depth2"><a href="sA.html#sA.10" rel="section">&sect;A.10&nbsp;Packages and imports</a></div>
+ <div class="toc depth1"><a href="sB.html" rel="section">&sect;B&nbsp;Changes between versions</a></div>
+ <div class="toc depth2"><a href="sB.html#sB.1" rel="section">&sect;B.1&nbsp;Paragraphs changed between versions</a></div>
+ <div class="toc depth2"><a href="sB.html#sB.2" rel="section">&sect;B.2&nbsp;Additions between versions</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/s0.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/s0.html
new file mode 100644
index 000000000..7e5e083c1
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/s0.html
@@ -0,0 +1,179 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.html" rel="next">&sect;1&nbsp;Teams and Roles&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="chapter" id="s0">
+ <div class="headl">
+ <div class="headr">
+ <h1>&sect;0&nbsp;About this Document</h1>
+ </div>
+ </div>
+ <div id="toc-box">
+ <ul class="toc-box">
+ <li><a href="s0.html">&sect;0&nbsp;About this Document</a></li>
+ <li><a href="#s0.1">&sect;0.1&nbsp;Purpose(s) of this document</a></li>
+ <li><a href="#s0.2">&sect;0.2&nbsp;Text structure</a></li>
+ <li><a href="#s0.3">&sect;0.3&nbsp;Compiler messages</a></li>
+ <li><a href="#s0.4">&sect;0.4&nbsp;Versions</a></li>
+ <li><a href="#s0.5">&sect;0.5&nbsp;Publishing</a></li>
+ </ul>
+ </div>
+ <div class="intro">
+ <h3>Levels of this document</h3>
+ <div class="line"></div>
+ <div class="term">Terms, concepts</div>
+ <div class="termdesc">Each chapter of this document starts with a short synopsis of
+ concepts covered by the chapter (like this).
+ </div>
+ <div class="line"></div>
+ <div class="term">Definition</div>
+ <div class="termdesc">The actual definition is given in small numbered paragraphs.</div>
+ <div class="line"></div>
+ <div class="term">Examples</div>
+ <div class="termdesc">Examples and accompanying explanations will be interspersed
+ into the definition.
+ </div>
+ <div class="line"></div>
+ </div>
+ <div class="sect depth2" id="s0.1">
+ <h2 class="sect">&sect;0.1&nbsp;Purpose(s) of this document<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;0</a></span></h2>
+ <p>This document defines the OT/J programming language.
+ The main goals were to create a precise and complete reference for this language.
+ Didactical considerations had lower priorities, which means that this document is not designed
+ as an introductory tutorial.
+ Still, we advise programmers learning the OT/J language, to consult this document whenever
+ a compiler error message is not perfectly clear to them (see <a href="#s0.3" title="&sect;0.3&nbsp;Compiler messages" class="sect">&sect;0.3</a>).
+
+ </p>
+ </div>
+ <div class="sect depth2" id="s0.2">
+ <h2 class="sect">&sect;0.2&nbsp;Text structure<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;0</a></span></h2>
+ <p>Each chapter of this document starts with a short synopsis of
+ concepts covered by the chapter (see above).
+
+ </p>
+ <div class="syntaxlink"><a href="sA.html" title="&sect;A&nbsp;OT/J Syntax" class="syntax">&rarr;&nbsp;Syntax&nbsp;&sect;A</a></div>
+ <div class="subsect depth3" id="s0.2.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Paragraphs</span></h4>
+ <p>The actual definition is structured into small paragraphs for easy referral.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s0.2.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Syntax Links</span></h4>
+ <p>Links to the syntax precede definitions whenever new syntax is introduced.
+
+ </p>
+ </div>
+ <p>Interspersed you will find some example program listings.
+ Examples are typeset in a box:
+
+ </p>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> MyTeamA {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> ...</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <p>Explanations for examples look like the following:
+
+ </p>
+ <div class="codecomment">
+ <h5>Effects:</h5>
+ <ul>
+ <li>Lines 1-3 show a minimal OT/J program, which should not cause any headache.</li>
+ </ul>
+ </div>
+ <p>Examples are given for illustration only.
+
+ </p>
+ <p>Additional paragraphs like "Language implementation", or
+ "open issues" provide some background information which is
+ not necessary for understanding the definition, which might
+ however, help to understand why things are the way they are
+ and what other things might be added to the language in the future.
+
+ </p>
+ </div>
+ <div class="sect depth2" id="s0.3">
+ <h2 class="sect">&sect;0.3&nbsp;Compiler messages<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;0</a></span></h2>
+ <p>Error messages given by the Object Teams compiler refer to this
+ definition whenever appropriate. This way it should be easy to find
+ out, why the compiler rejected your program. Please make sure
+ you are using a language definition whose version matches the
+ version of your compiler.
+
+ </p>
+ </div>
+ <div class="sect depth2" id="s0.4">
+ <h2 class="sect">&sect;0.4&nbsp;Versions<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;0</a></span></h2>
+ <p>The structure of this document has changed between versions
+ 0.6.1 and 0.7 of this document. This change reflects the
+ transition from our first compiler for OT/J (called <code>otc</code>)
+ and the <code>OTDT</code> (Object Teams Development Tooling)
+ plugin for Eclipse.
+
+ </p>
+ <p>Starting with the OTDT v0.7.x, the major and minor number of the tool
+ correspond to the major and minor version number of the OTJLD (this document),
+ ie., the OTDT v1.0.x implements the language as defined in the OTJLD v1.0.
+
+ </p>
+ <p><strong>Changes</strong> between the current and previous versions are listed in appendix <a href="sB.html" title="&sect;B&nbsp;Changes between versions" class="sect">&sect;B</a>.
+
+ </p>
+ </div>
+ <div class="sect depth2" id="s0.5">
+ <h2 class="sect">&sect;0.5&nbsp;Publishing<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;0</a></span></h2>
+ <p>The sources of this language definition are maintained in a target-independent XML format. Three different versions are generated
+ from these sources, using XSLT:
+ </p>
+ <ul>
+ <li><a href="http://www.objectteams.org/def/" class="ext">Online version</a> (XHTML)
+ </li>
+ <li>Tooling version (XHTML &ndash; directly accessible from inside the OTDT)</li>
+ <li>Print version (LaTeX/PDF)</li>
+ </ul>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.html" rel="next">&sect;1&nbsp;Teams and Roles&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/s1.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/s1.html
new file mode 100644
index 000000000..81d6a3f53
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/s1.html
@@ -0,0 +1,1711 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s0.html" rel="prev">&lt;&lt;&nbsp;&sect;0&nbsp;About this Document</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.html" rel="next">&sect;2&nbsp;Role Binding&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="chapter" id="s1">
+ <div class="headl">
+ <div class="headr">
+ <h1>&sect;1&nbsp;Teams and Roles</h1>
+ </div>
+ </div>
+ <div id="toc-box">
+ <ul class="toc-box">
+ <li><a href="s1.html">&sect;1&nbsp;Teams and Roles</a></li>
+ <li><a href="#s1.1">&sect;1.1&nbsp;Team classes</a></li>
+ <li><a href="#s1.2">&sect;1.2&nbsp;Role classes and objects</a></li>
+ <li><a href="#s1.3">&sect;1.3&nbsp;Acquisition and implicit inheritance of role classes</a></li>
+ <li><a href="#s1.4">&sect;1.4&nbsp;Name clashes</a></li>
+ <li><a href="#s1.5">&sect;1.5&nbsp;Team and role nesting</a></li>
+ </ul>
+ </div>
+ <div class="intro">
+ <h3>Fundamental concepts of Teams</h3>
+ <div class="line"></div>
+ <div class="term">Teams and Roles</div>
+ <div class="termdesc">Classes that are defined with the modifier <code>team</code>
+ are called team classes, or <strong>teams</strong> for short.<br />
+ Direct inner classes of a team are called role classes, or <strong>roles</strong>
+ for short.
+ </div>
+ <div class="line"></div>
+ <div class="term">Role inheritance</div>
+ <div class="termdesc">Inheritance between teams introduces a special inheritance relationship
+ between their contained roles. The rules of this <strong>implicit inheritance</strong> are given below (<a href="#s1.3.1"
+ title="&sect;1.3.1&nbsp;Acquisition and implicit inheritance of role classes"
+ class="sect">&sect;1.3.1</a>).
+ </div>
+ <div class="line"></div>
+ <div class="term">Externalized role</div>
+ <div class="termdesc">Roles are generally confined to the context of their
+ enclosing team instance. Subject to specific restrictions,
+ a role <em>may</em> be passed outside
+ its team using the concept of externalized roles (<a href="#s1.2.2" title="&sect;1.2.2&nbsp;Externalized roles" class="sect">&sect;1.2.2</a>).
+ </div>
+ <div class="line"></div>
+ </div>
+ <div class="sect depth2" id="s1.1">
+ <h2 class="sect">&sect;1.1&nbsp;Team classes<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;1</a></span></h2>
+ <div class="syntaxlink"><a href="sA.html#sA.1.1" title="&sect;A.1.1&nbsp;ClassDeclaration"
+ class="syntax">&rarr;&nbsp;Syntax&nbsp;&sect;A.1.1</a></div>
+ <p>A class declared with the modifier <code>team</code> is a <em>team class</em> (or team for short).
+
+ </p>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <em><b>team</b> <b>class</b> MyTeamA</em> {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> ...</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <p>Teams are meant as containers for <em>roles</em>, which are defined in the following
+ paragraphs.
+
+ </p>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> MyTeamA {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>public</b> <em><b>class</b> MyRole</em></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> ...</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <p>Teams introduce a new variant of inheritance for contained role classes
+ (see <a href="#s1.3.1"
+ title="&sect;1.3.1&nbsp;Acquisition and implicit inheritance of role classes"
+ class="sect">&sect;1.3.1</a> below).
+ Other properties of teams, which are defined in later sections, are:
+
+ </p>
+ <ul>
+ <li>Team activation (<a href="s5.html" title="&sect;5&nbsp;Team Activation" class="sect">&sect;5</a>)
+ </li>
+ <li>Abstractness and instantiation (<a href="s2.html#s2.5" title="&sect;2.5&nbsp;Abstract Roles" class="sect">&sect;2.5</a>)
+ </li>
+ <li>Declared lifting in team methods (<a href="s2.html#s2.3.2" title="&sect;2.3.2&nbsp;Declared lifting"
+ class="sect">&sect;2.3.2</a>)
+ </li>
+ <li>Reflective functions defined in <code>org.objectteams.ITeam</code> (<a href="s6.html#s6.1" title="&sect;6.1&nbsp;Reflection" class="sect">&sect;6.1</a>)
+ </li>
+ </ul>
+ <p>Apart from these differences, team classes are regular Java classes with
+ methods and fields, whose instances are regular Java objects.
+
+ </p>
+ </div>
+ <div class="sect depth2" id="s1.2">
+ <h2 class="sect">&sect;1.2&nbsp;Role classes and objects<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;1</a></span></h2>
+ <p>Each direct inner class of a team is a role class.
+ Just like inner classes, each instance of a role class has an implicit reference
+ to its enclosing team instance. This reference is immutable.
+ Within the implementation of a role it can be accessed by qualifying the identifier
+ <code>this</code> with the name of the team class, as in:
+
+ </p>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> MyTeamA {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>public</b> <em><b>class</b> MyRole</em> {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>public</b> <b>void</b> print() { System.out.println("Team: "+ <em>MyTeamA.this</em>); }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <p>Creation of role instances is further restricted as defined in
+ <a href="s2.html#s2.4" title="&sect;2.4&nbsp;Explicit role creation"
+ class="sect">&sect;2.4</a>.
+ Teams can also define role interfaces just like role classes.
+ With respect to role specific properties a role interface is treated like a fully
+ abstract class.
+
+ </p>
+ <div class="sect depth3" id="s1.2.1">
+ <h3 class="sect">&sect;1.2.1&nbsp;Modifiers for roles<span class="toplink"><a href="#s1.2">&uarr;&nbsp;&sect;1.2</a></span></h3>
+ <p>Member classes of a team cannot be <code>static</code>.
+ Also the use of access modifiers for roles is restricted and modifiers have different (stronger) semantics than for
+ regular classes (see below). With respect to accessibility a team acts mainly like a package regarding its roles.
+
+ </p>
+ <div class="subsect depth4" id="s1.2.1.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Role class protection</span></h4>
+ <p>A role class must have exactly one of the access modifiers <code>public</code>
+ or <code>protected</code>.<br />
+ This rule does not affect the class modifiers <code>abstract</code>, <code>final</code> and <code>strictfp</code>.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.1.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">protected role classes</span></h4>
+ <p>A <code>protected</code> role can only be accessed from within the enclosing
+ team or any of its sub-teams. The actual border of encapsulation is the
+ enclosing team <em>instance</em>. The rules for protected roles are given
+ in <a href="#s1.2.3" title="&sect;1.2.3&nbsp;Protected roles" class="sect">&sect;1.2.3</a> below.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.1.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">public role classes</span></h4>
+ <p>Only <code>public</code> roles can ever be accessed outside their enclosing team.
+ Accessing a role outside the enclosing team instance is governed by the rules
+ of <strong>externalized roles</strong>, to be defined next (<a href="#s1.2.2" title="&sect;1.2.2&nbsp;Externalized roles" class="sect">&sect;1.2.2</a>).
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.1.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">abstract role classes</span></h4>
+ <p>A role class has to be marked <strong>abstract</strong> if any of its methods
+ is not effective.<br />
+ The <em>methods of a role class</em> comprise direct methods and
+ methods acquired by inheritance.
+ In addition to regular inheritance a role class may acquire methods
+ also via implicit inheritance (<a href="#s1.3.1"
+ title="&sect;1.3.1&nbsp;Acquisition and implicit inheritance of role classes"
+ class="sect">&sect;1.3.1</a>).<br />
+ A method may become <em>effective</em> by either:
+
+ </p>
+ <ul>
+ <li>implementation (i.e., a regular method body), or</li>
+ <li>a callout binding (see <a href="s3.html" title="&sect;3&nbsp;Callout Binding" class="sect">&sect;3</a>).
+ </li>
+ </ul>
+ <p><a href="s2.html#s2.5" title="&sect;2.5&nbsp;Abstract Roles" class="sect">&sect;2.5</a> discusses under which
+ circumstances abstract roles force the enclosing team to be abstract, too.
+
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.1.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Role features</span></h4>
+ <p>Access modifiers for members of roles have some special interpretation:
+
+ </p>
+ <ol>
+ <li>A private member is also visible in any implicit sub role
+ (see implicit inheritance <a href="#s1.3.1.c"
+ title="&sect;1.3.1.(c)&nbsp;Overriding and implicit inheritance"
+ class="sect">&sect;1.3.1.(c)</a>).<br />
+ In contrast to inner classes in Java, private members of a role are not
+ visible to the enclosing team.
+ </li>
+ <li>The default visibility of role members restricts access to the
+ current class and its sub-classes (explicit and implicit).
+ </li>
+ <li><code>protected</code> role members can only be accessed from the enclosing
+ team or via <a href="s4.html" title="&sect;4&nbsp;Callin Binding" class="sect">callin (&sect;4)</a>.
+ </li>
+ <li><code>public</code> role members grant unrestricted access.
+ </li>
+ </ol>
+ <p>Additionally, a role always has access to all the features that its enclosing team has access to.</p>
+ <p>Only <code>public</code> members can ever be accessed via an <a href="#s1.2.2" title="&sect;1.2.2&nbsp;Externalized roles" class="sect">externalized role (&sect;1.2.2)</a>.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.1.f">
+ <h4 class="subsect">(f)&nbsp;<span class="title">Static role methods</span></h4>
+ <p>In contrast to inner classes in pure Java, a role class may indeed define static methods. A static role method requires no
+ role
+ instance <em>but</em> it still requires a team instance in scope. Static role methods can be called:
+
+ </p>
+ <ul>
+ <li>from the enclosing team,</li>
+ <li>via callin (see <a href="s4.html#s4.7"
+ title="&sect;4.7&nbsp;Callin binding with static methods"
+ class="sect">&sect;4.7</a>).
+ </li>
+ </ul>
+ <p>Within a static role method the syntax <code>MyTeam.this</code> is available for accessing the enclosing team instance.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.1.g">
+ <h4 class="subsect">(g)&nbsp;<span class="title">No static initializers</span></h4>
+ <p>A static field of a role class must not have a non-constant initialization expression.
+ Static initialization blocks are already prohibited for inner classes by Java (see <a href="http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#262890"
+ class="ext">JLS &sect;8.1.2</a>).
+
+ </p>
+ <div class="note">
+ <h5>Note:</h5>
+ Static initialization generally provides a means for performing initialization code prior to instantiation, i.e., at
+ class-loading time.
+ Before any role can be created already two levels of initialization are performed: (1) The (outer most) enclosing team
+ class performs static initializations when it is loaded. (2) Any enclosing team executes
+ its constructor when it is instantiated. It should be possible to allocate any early initialization to either of these
+ two phases instead of using static role initializers.
+
+ </div>
+ </div>
+ </div>
+ <div class="sect depth3" id="s1.2.2">
+ <h3 class="sect">&sect;1.2.2&nbsp;Externalized roles<span class="toplink"><a href="#s1.2">&uarr;&nbsp;&sect;1.2</a></span></h3>
+ <div class="syntaxlink"><a href="sA.html#sA.9.2" title="&sect;A.9.2&nbsp;ActualTypeArgument"
+ class="syntax">&rarr;&nbsp;Syntax&nbsp;&sect;A.9.2</a></div>
+ <p>Normally, a team encapsulates its role against unwanted access from the outside.
+ If roles are visible outside their enclosing team instance we speak of
+ <strong>externalized roles</strong>.
+
+ </p>
+ <p>Externalized roles are subject to specific typing rules in order to ensure,
+ that role instances from different team instances cannot be mixed in
+ inconsistent ways. In the presence of implicit inheritance
+ (<a href="#s1.3.1"
+ title="&sect;1.3.1&nbsp;Acquisition and implicit inheritance of role classes"
+ class="sect">&sect;1.3.1</a>) inconsistencies could otherwise occur, which lead
+ to typing errors that could only be detected at run-time.
+ Externalized roles use the theory of
+ "virtual classes" <a href="#fn1-virtual-classes" class="int">[1]</a>,
+ or more specifically
+ "family polymorphism" <a href="#fn2-family-polymorphism" class="int">[2]</a>,
+ in order to achieve the desired type safety.
+ These theories use special forms of <em>dependent types</em>.
+ Externalized roles have <em>types that depend on a team instance</em>.
+
+ </p>
+ <p><a href="#s1.2.3" title="&sect;1.2.3&nbsp;Protected roles" class="sect">&sect;1.2.3</a> deduces even stronger forms of encapsulation
+ from the rules about externalized roles.
+
+ </p>
+ <div class="subsect depth4" id="s1.2.2.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Visibility</span></h4>
+ <p>Only instances of a <code>public</code> role class can ever be externalized.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.2.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Declaration with anchored type</span></h4>
+ <p>Outside a team role types are legal only if denoted relative
+ to an existing team instance (further on called "anchored types").
+ The syntax is:
+ </p>
+ <div class="listing plain"><pre><em>final</em> MyTeam myTeam = <i>expression</i>;
+<em>RoleClass&lt;@myTeam&gt;</em> role = <i>expression</i>;</pre></div>
+ <p>The syntax <code>Type&lt;@anchor&gt;</code> is a special case of a parameterized type, more specifically a <a href="s9.html" title="&sect;9&nbsp;Value Dependent Classes" class="sect">value dependent type (&sect;9)</a>.
+ The type argument (i.e., the expression after the at-sign) can be a simple name or a path. It must refer to an instance
+ of a team class.
+ The role type is said to be <em>anchored</em> to this team instance.<br />
+ The type-part of this syntax (in front of the angle brackets) must be the simple name of a role type directly contained
+ in the given team (including roles that are acquired by implicit inheritance).<br /></p>
+ <div class="note">
+ <h5>Note:</h5>
+ Previous versions of the OTJLD used a different syntax for anchored types, where the role type was prefixed with the anchor
+ expression, separated by a dot (<code>anchor.Type</code>,
+ see <a href="sA.html#sA.6.3" title="&sect;A.6.3&nbsp;AnchoredType" class="sect">&sect;A.6.3</a>). A compiler may still support that path syntax but it should be flagged as being deprecated.
+
+ </div>
+ </div>
+ <div class="subsect depth4" id="s1.2.2.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Immutable anchor</span></h4>
+ <p>Anchoring the type of an externalized role to a team instance
+ requires the team to be referenced by a variable which
+ is marked <code>final</code> (i.e., immutable).
+ The type anchor can be a path <code>v.f1.f2...</code> where
+ <code>v</code> is any final variable and <code>f1</code> ...
+ are final fields.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.2.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Implicit type anchors</span></h4>
+ <p>The current team instance can be used as a default anchor
+ for role types:
+
+ </p>
+ <ol>
+ <li>In non-static team level methods role types are by default interpreted as anchored to <code>this</code> (referring to the team instance). I.e., the following two declarations express the same:
+
+ <div class="listing plain"><pre><b>public</b> RoleX getRoleX (RoleY r) { <i> stmts </i> }
+<b>public</b> RoleX&lt;@<em>this</em>&gt; getRoleX (RoleY&lt;@<em>this</em>&gt; r) { <i> stmts </i> }</pre></div>
+ </li>
+ <li>
+ In analogy, <em>role methods</em> use the enclosing team instance as the
+ default anchor for any role types.
+ </li>
+ </ol>
+ <p>Note, that <code>this</code> and <code><em>Outer</em>.this</code> are always
+ <code>final</code>.<br />
+ The compiler uses the pseudo identifier <strong><code>tthis</code></strong> to denote
+ such implicit type anchors in error messages.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.2.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Conformance</span></h4>
+ <p>Conformance between
+ two types <code>RoleX&lt;@teamA&gt;</code> and <code>RoleY&lt;@teamB&gt;</code>
+ not only requires the role types to be compatible, but also
+ the team instances to be provably <em>the same object</em>.
+ The compiler must be able to statically analyze anchor identity.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.2.f">
+ <h4 class="subsect">(f)&nbsp;<span class="title">Substitutions for type anchors</span></h4>
+ <p>Only two substitutions are considered for determining
+ team identity:
+
+ </p>
+ <ol>
+ <li>
+ For type checking the application of team methods,
+ <code>this</code> is <strong>substituted</strong> by the actual call target.
+ For role methods a reference of the form <code><em>Outer</em>.this</code>
+ is substituted by the enclosing instance of the call target.
+
+ </li>
+ <li>Assignments from a <code>final</code> identifier
+ to another <code>final</code> identifier are transitively
+ followed, i.e., if <code>t1, t2</code> are final,
+ after an assignment <code>t1=t2</code>
+ the types <code>R&lt;@t1&gt;</code> and <code>R&lt;@t2&gt;</code> are considered
+ identical. Otherwise <code>R&lt;@t1&gt;</code> and <code>R&lt;@t2&gt;</code>
+ are incommensurable.<br />
+ Attaching an actual parameter to a formal parameter in a
+ method call is also considered as an assignment with respect to
+ this rule.
+
+ </li>
+ </ol>
+ </div>
+ <div class="subsect depth4" id="s1.2.2.g">
+ <h4 class="subsect">(g)&nbsp;<span class="title">Legal contexts</span></h4>
+ <p>Anchored types for externalized roles may be used in the
+ following contexts:
+
+ </p>
+ <ol>
+ <li>Declaration of an attribute</li>
+ <li>Declaration of a local variable</li>
+ <li>Declaration of a parameter or result type
+ of a method or constructor
+ </li>
+ <li>In the <code>playedBy</code> clause of a role class
+ (see <a href="s2.html#s2.1" title="&sect;2.1&nbsp;playedBy relation" class="sect">&sect;2.1</a>).
+ </li>
+ </ol>
+ <p>It is not legal to inherit from an anchored type, since
+ this would require membership of the referenced team instance,
+ which can only be achieved by class nesting.
+
+ </p>
+ <div class="note">
+ <h5>Note:</h5>
+ Item 4.
+ &mdash; within the given restriction &mdash; admits the case where
+ the same class is a role of one team and the base class for
+ the role of another team. Another form of nesting is
+ defined in <a href="#s1.5" title="&sect;1.5&nbsp;Team and role nesting" class="sect">&sect;1.5</a>.
+
+ </div>
+ </div>
+ <div class="subsect depth4" id="s1.2.2.h">
+ <h4 class="subsect">(h)&nbsp;<span class="title">Externalized creation</span></h4>
+ <p>A role can be created as externalized using either of these equivalent forms:</p>
+ <div class="listing plain"><pre>outer.<b>new</b> Role()
+<b>new</b> Role&lt;@outer&gt;()</pre></div>
+ <p>This requires the enclosing instance <code>outer</code> to be
+ declared <code>final</code>. The expression has the
+ type <code>Role&lt;@outer&gt;</code> following the rules of
+ externalized roles.<br />
+ The type <code>Role</code> in this expression must be a simple
+ (unqualified) name.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.2.i">
+ <h4 class="subsect">(i)&nbsp;<span class="title">No import</span></h4>
+ <p>It is neither useful nor legal to import a role type.<br /></p>
+ <div class="note">
+ <h5>Rationale:</h5>
+ Importing a type allows to use the unqualified name in situations that would otherwise require to use the fully qualified
+ name,
+ i.e., the type prefixed with its containing package and enclosing class. Roles, however are contained in a team <i>instance</i>.
+ Outside their team, role types can only be accessed using an anchored type which uses a team instance to qualify the
+ role type.
+ Relative to this team anchor, roles are <i>always</i> denoted using their simple name, which makes importing roles useless.
+
+ </div>
+ <p>A static import for a constant declared in a role is, however, legal.
+
+ </p>
+ </div>
+ <h5 class="listing">Example code (Externalized Roles):</h5>
+ <div class="listing example frame" id="l1.2.2-1">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>team</b> <b>class</b> FlightBonus <b>extends</b> Bonus {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>public</b> <b>class</b> Subscriber {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>void</b> clearCredits() { ... }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> <b>void</b> unsubscribe(Subscriber subscr) { ... }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="listing example frame" id="l1.2.2-2">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre><b>class</b> ClearAction <b>extends</b> Action {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre> <em>final</em> FlightBonus context;</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre> <em>Subscriber&lt;@context&gt;</em> subscriber;</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">10</td>
+ <td><pre> ClearAction (<em>final</em> FlightBonus bonus, <em>Subscriber&lt;@bonus&gt;</em> subscr) {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">11</td>
+ <td><pre> context = bonus; <span class="comment">// unique assignment to 'context'</span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">12</td>
+ <td><pre> subscriber = subscr;</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">13</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">14</td>
+ <td><pre> <b>void</b> actionPerformed () {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">15</td>
+ <td><pre> subscriber.clearCredits();</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">16</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">17</td>
+ <td><pre> <b>protected</b> <b>void</b> finalize () {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">18</td>
+ <td><pre> context.unsubscribe(subscriber);</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">19</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">20</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="codecomment">
+ <h5>Effects:</h5>
+ <ul>
+ <li>Lines 1-6 show a terse extract of a published example
+ <a href="http://www.objectteams.org/publications/index.html#NODe02" class="ext">[NODe02]</a>. Here passengers can be subscribers in a flight bonus program.
+ </li>
+ <li>Lines 7-20 show a sub-class of <code>Action</code> which is
+ used to associate the action of resetting a subscriber's credits
+ to a button or similar element in an application's GUI.
+ </li>
+ <li>Attribute <code>context</code> (line 8) and parameter
+ <code>bonus</code> (line 10) serve as anchor for the type of
+ externalized roles.
+ </li>
+ <li>Attribute <code>subscriber</code> (line 9) and parameter
+ <code>subscr</code> (line 10) store a Subscriber role outside the
+ FlightBonus team.
+ </li>
+ <li>In order to type-check the assignment in line 12, the compiler
+ has to ensure that the types of LHS and RHS are anchored to
+ the same team instance. This can be verified by checking that
+ both anchors are indeed <code>final</code> and prior to the
+ role assignment a team assignment has taken place (line 11).<br /><span class="underline">Note,</span> that the Java rules for <strong>definite assignments</strong> to
+ final variables ensure that exactly one assignment to a variable occurs
+ prior to its use as type anchor. No further checks are needed.
+
+ </li>
+ <li>It is now legal to store this role reference and use it at
+ some later point in time, e.g., for invoking method
+ <code>clearCredits</code> (line 15).
+ This method call is also an example for implicit team activation
+ (<a href="s5.html#s5.3.b"
+ title="&sect;5.3.(b)&nbsp;Methods of externalized roles"
+ class="sect">&sect;5.3.(b)</a>).
+
+ </li>
+ <li>Line 18 demonstrates how an externalized role can be
+ passed to a team level method. The signature of <code>unsubscribe</code>
+ is for this call expanded to
+ <div class="indent">
+ void unsubscribe(Subscriber&lt;@context&gt; subscr)
+
+ </div>
+ (by substituting the call target <code>context</code> for
+ <code>this</code>). This proves identical types for actual and
+ formal parameters.
+ </li>
+ </ul>
+ </div>
+ </div>
+ <div class="sect depth3" id="s1.2.3">
+ <h3 class="sect">&sect;1.2.3&nbsp;Protected roles<span class="toplink"><a href="#s1.2">&uarr;&nbsp;&sect;1.2</a></span></h3>
+ <p>Roles can only be <code>public</code> or <code>protected</code>.
+ A <code>protected</code> role is encapsulated
+ by its enclosing team instance. This is enforced by these rules:
+
+ </p>
+ <div class="subsect depth4" id="s1.2.3.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Importing role classes</span></h4>
+ <p><i>This rule is superseded by <a href="#s1.2.2.i" title="&sect;1.2.2.(i)&nbsp;No import" class="sect">&sect;1.2.2.(i)</a></i></p>
+ </div>
+ <div class="subsect depth4" id="s1.2.3.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Qualified role types</span></h4>
+ <p>The name of a <code>protected</code> role class may never be used qualified, neither
+ prefixed by its <em>enclosing type</em> nor parameterized by a <em>variable as type anchor</em> (cf. <a href="#s1.2.2.a" title="&sect;1.2.2.(a)&nbsp;Visibility" class="sect">&sect;1.2.2.(a)</a>).
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.3.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Mixing qualified and unqualified types</span></h4>
+ <p>An externalized role type is never compatible to an unqualified role type,
+ except for the substitutions in <a href="#s1.2.2.f"
+ title="&sect;1.2.2.(f)&nbsp;Substitutions for type anchors"
+ class="sect">&sect;1.2.2.(f)</a>, where
+ an explicit anchor can be matched with the implicit anchor <code>this</code>.
+
+ </p>
+ </div>
+ <p>Rules (a) and (b) ensure that the name of a protected role class cannot be used
+ outside the lexical scope of its enclosing team. Rule (c) ensures that team methods
+ containing unqualified role types in their signature cannot be invoked on a team other
+ than the current team. Accordingly, for role methods the team context must be the
+ enclosing team instance.
+
+ </p>
+ <div class="subsect depth4" id="s1.2.3.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Levels of encapsulation</span></h4>
+ <p>Since protected role types can not be used for externalization, instances of these types are already quite effectively encapsulated
+ by their enclosing team.
+ Based on this concept, encapsulation for protected roles can be made even stricter by the rules of <em>role confinement</em>.
+ On the contrary, even protected roles can be externalized as <em>opaque roles</em> which still expose (almost) no information.
+ Confinement and opaque roles are subject of <a href="s7.html" title="&sect;7&nbsp;Role Encapsulation" class="sect">&sect;7</a>.
+
+ </p>
+ </div>
+ </div>
+ <div class="sect depth3" id="s1.2.4">
+ <h3 class="sect">&sect;1.2.4&nbsp;Type tests and casts<span class="toplink"><a href="#s1.2">&uarr;&nbsp;&sect;1.2</a></span></h3>
+ <p>In accordance with <a href="#s1.2.2.e" title="&sect;1.2.2.(e)&nbsp;Conformance" class="sect">&sect;1.2.2.(e)</a>, in OT/J
+ the <code>instanceof</code> operator and type casts have extended semantics for roles.
+
+ </p>
+ <div class="subsect depth4" id="s1.2.4.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">instanceof</span></h4>
+ <p>For role types the <code>instanceof</code> operator yields true only if
+ both components of the type match: the dynamic role type must be compatible
+ to the given static type, and also type anchors must be the same instance.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.4.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Casting</span></h4>
+ <p>Casts may also fail if the casted expression is anchored to a different
+ team instance than the cast type. Such failure is signaled by a
+ <code>org.objectteams.RoleCastException</code>.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.4.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Class literal</span></h4>
+ <p>A class literal of form <code>R.class</code> is dynamically bound to the class <code>R</code>
+ visible in the current instance context. Using a class literal for a role outside its
+ enclosing team instance (see <a href="#s1.2.2" title="&sect;1.2.2&nbsp;Externalized roles" class="sect">&sect;1.2.2</a>) requires the following syntax:
+
+ </p>
+ <div class="listing plain"><pre>RoleClass<em>&lt;@teamAnchor&gt;</em><strong>.class</strong></pre></div>
+ </div>
+ </div>
+ <div class="sect depth3" id="s1.2.5">
+ <h3 class="sect">&sect;1.2.5&nbsp;File structure<span class="toplink"><a href="#s1.2">&uarr;&nbsp;&sect;1.2</a></span></h3>
+ <p>Just like regular inner classes, role classes may be inlined in the
+ source code of the enclosing team. As an alternative style it is possible
+ to store role classes in separate <strong>role files</strong> according to the following rules:
+
+ </p>
+ <div class="subsect depth4" id="s1.2.5.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Role directory</span></h4>
+ <p>In the directory of the team class a new directory is created
+ which has the same name as the team without the <tt>.java</tt> suffix.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.5.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Role files</span></h4>
+ <p>Role classes are stored in this directory (a). The file names are
+ derived from the role class name extended by <tt>.java</tt>.<br />
+ A role file must contain exactly one top-level type.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.5.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">package statement</span></h4>
+ <p>A role class in a role file declares as its package the fully qualified
+ name of the enclosing team class. The package statement of a role file
+ must use the <code>team</code> modifier as its first token.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.5.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Reference to role file</span></h4>
+ <p>A team should mention in its javadoc comment each role class which
+ is stored externally using a <tt>@role</tt> tag.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.5.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Legal types in role files</span></h4>
+ <p>The type in a role file must not be an <code>enum</code>.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.5.f">
+ <h4 class="subsect">(f)&nbsp;<span class="title">Imports in role files</span></h4>
+ <p>A role file may have imports of its own.
+ Within the role definition these imports are visible <em>in addition</em> to all imports of the enclosing team.
+ Only <code>base</code> imports (see <a href="s2.html#s2.1.2.d" title="&sect;2.1.2.(d)&nbsp;Base imports"
+ class="sect">&sect;2.1.2.(d)</a>)
+ <em>must</em> be defined in the team.
+ </p>
+ </div>
+ <p>Semantically, there is no difference between inlined role classes and those
+ stored in separate role files.
+
+ </p>
+ <div class="note">
+ <h5>Note:</h5>
+ Current Java compilers disallow a type to have the same fully qualified
+ name as a package. However, the JLS does not seem to make a statement in this respect.
+ In OT/J, a package and a type are interpreted as being the same team, if both have the
+ same fully qualified name and both have the <code>team</code> modifier.
+
+ </div>
+ <h5 class="listing">Role file example:</h5>
+ <div class="listing example frame" id="l1.2.5-1">
+ <table class="listing">
+ <tr class="lhead">
+ <td colspan="2">in file <code>org/objectteams/examples/MyTeamA.java</code> :
+ </td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>package</b> org.objectteams.examples;</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre><span class="comment">/**</span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <span class="comment">* @author Stephan Herrmann</span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <span class="comment">* @date 20.02.2007</span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> <span class="comment">* @file MyTeamA.java</span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> <span class="comment">* <em>@role MyRole</em></span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> <span class="comment">*/</span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> MyTeamA {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre> ...</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">10</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="listing example frame" id="l1.2.5-2">
+ <table class="listing">
+ <tr class="lhead">
+ <td colspan="2">in file <code>org/objectteams/examples<strong class="blue">/MyTeamA/MyRole.java</strong></code>:
+ </td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><em><b>team</b> <b>package</b> org.objectteams.examples.MyTeamA;</em></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre><b>public</b> <b>class</b> MyRole {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> ...</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ </div>
+ <div class="sect depth2" id="s1.3">
+ <h2 class="sect">&sect;1.3&nbsp;Acquisition and implicit inheritance of role classes<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;1</a></span></h2>
+ <p> Every team class implicitly implements the predefined interface <code>org.objectteams.ITeam</code>.
+ If a team class has no explicit <code>extends</code> clause it implicitly extends <code>org.objectteams.Team</code>,
+ thus providing implementations for the methods in <code>org.objectteams.ITeam</code>.
+ If a team class extends a non-team class, the compiler implicitly adds implementations for all methods declared
+ in <code>org.objectteams.ITeam</code> to the team class.
+ Any subclass of a team (including <code>org.objectteams.Team</code>) must again be a team.
+ Interface implementation is not affected by this rule.
+
+ </p>
+ <p>Infrastructure provided via interface <code>org.objectteams.ITeam</code> is presented in <a href="s6.html" title="&sect;6&nbsp;Object Teams API" class="sect">&sect;6</a>.
+
+ </p>
+ <div class="sect depth3" id="s1.3.1">
+ <h3 class="sect">&sect;1.3.1&nbsp;Acquisition and implicit inheritance of role classes<span class="toplink"><a href="#s1.3">&uarr;&nbsp;&sect;1.3</a></span></h3>
+ <p>A team acquires all roles from its super-team. This relation is
+ similar to inheritance of inner classes, but with a few decisive
+ differences as defined next. Two implementation options are mentioned <a href="#aux1.1" class="int">below</a>,
+ which can be used to realize the special semantics of role
+ acquisition (virtual classes and copy inheritance).
+
+ </p>
+ <h5 class="listing">Implicit role inheritance</h5>
+ <div class="listing example frame" id="l1.3.1-1">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> S {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>protected</b> <b>class</b> R0 {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>protected</b> <b>class</b> R1 <em><b>extends</b> R0</em> {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <b>boolean</b> ok;</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> R2 m() {...}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> <b>void</b> n(<em>R2</em> r) {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre> <b>protected</b> <b>class</b> R2 {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="listing example frame" id="l1.3.1-2">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">10</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> T <em><b>extends</b> S</em> {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">11</td>
+ <td><pre> @Override <b>protected</b> <em><b>class</b> R1</em> {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">12</td>
+ <td><pre> <strong>R2</strong> m() {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">13</td>
+ <td><pre> if(<em>ok</em>) { <b>return</b> <em>tsuper</em>.m(); }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">14</td>
+ <td><pre> <b>else</b> { <b>return</b> null; }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">15</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">16</td>
+ <td><pre> <b>void</b> doIt() {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">17</td>
+ <td><pre> n(m());</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">18</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">19</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">20</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="subsect depth4" id="s1.3.1.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Role class acquisition</span></h4>
+ <p>A team <code>T</code> which extends a super-team <code>S</code>
+ has one role class <code>T.R</code> corresponding to each role <code>S.R</code>
+ of the super-team.
+ The new type <code>T.R</code>&nbsp;<strong>overrides</strong>&nbsp;<code>R</code> for the
+ context of <code>T</code> and its roles.
+ Acquisition of role classes can either be direct (see (b) below), or
+ it may involve overriding and implicit inheritance ((c) below).
+
+ </p>
+ <div class="codecomment">In the above example (<a href="#l1.3.1-1" class="listing">Listing 1.3.1-1</a>) the team <code>S</code> operates
+ on types <code>S.R0</code>, <code>S.R1</code> and <code>S.R2</code>,
+ while <code>T</code> operates on types <code>T.R0</code>, <code>T.R1</code>
+ and <code>T.R2</code>.<br /><em>(Type references like "<code>S.R0</code>" are actually illegal in source code
+ (<a href="#s1.2.3.b" title="&sect;1.2.3.(b)&nbsp;Qualified role types"
+ class="sect">&sect;1.2.3.(b)</a>). Here they are used for explanatory purposes only)</em></div>
+ </div>
+ <div class="subsect depth4" id="s1.3.1.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Direct role acquisition</span></h4>
+ <p>Within a sub-team <code>T</code> each role <code>S.R</code> of its
+ super-team <code>S</code> is available by the simple name <code>R</code>
+ without further declaration.
+
+ </p>
+ <div class="codecomment">The role <code>R2</code> in <a href="#l1.3.1-1" class="listing">Listing 1.3.1-1</a> can be used in the sub-team
+ <code>T</code> (line 12), because this role type is defined in the super class of the enclosing team.
+
+ </div>
+ </div>
+ <div class="subsect depth4" id="s1.3.1.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Overriding and implicit inheritance</span></h4>
+ <p>If a team contains a role class definition by the same name as
+ a role defined in its super-team,
+ the new role class overrides the corresponding role from the super-team
+ and <strong>implicitly inherits</strong> all of its features.
+ Such relation is established only by name correspondence.
+
+ </p>
+ <p>A role that overrides an inherited role should be marked with an <code>@Override</code> annotation.
+ A compiler should optionally flag a missing <code>@Override</code> annotation with a warning.
+ Conversely, it is an error if a role is marked with an <code>@Override</code> annotation but does not actually
+ override an inherited role.
+
+ </p>
+ <p>It is an error to override a role class with an interface or vice versa. A final role cannot be overridden.<br />
+ Unlike regular inheritance, <strong>constructors</strong> are also inherited
+ along implicit inheritance, and can be overridden just like normal methods.
+
+ </p>
+ <div class="codecomment">
+ In <a href="#l1.3.1-1" class="listing">Listing 1.3.1-1</a><code> R1</code> in <code>T</code> implicitly inherits all features of
+ <code>R1</code> in <code>S</code>. This is, because its enclosing team
+ <code>T</code> extends the team <code>S</code> (line 10) and the role
+ definition uses the same name <code>R1</code> (line 11).
+ Hence the attribute <code><strong>ok</strong></code> is available in the method
+ <code>m()</code> in <code>T.R1</code> (line 13). <code>T.R1</code> also overrides <code>S.R1</code>
+ which is marked by the <code>@Override</code> annotation in line 11.
+
+ </div>
+ </div>
+ <div class="subsect depth4" id="s1.3.1.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Lack of subtyping</span></h4>
+ <p>Direct acquisition of roles from a super-team and implicit inheritance
+ do not establish a <strong>subtype</strong> relation.
+ A role of a given team is never conform (i.e., substitutable)
+ to any role of any <em>other</em> team.
+ <code>S.R</code> and <code>T.R</code> are always incommensurable.<br /><span class="underline">Note,</span> that this rule is a direct consequence of <a href="#s1.2.2.e" title="&sect;1.2.2.(e)&nbsp;Conformance" class="sect">&sect;1.2.2.(e)</a>.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.3.1.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Dynamic binding of types</span></h4>
+ <p>Overriding an acquired role by a new role class has the following
+ implication: If an expression or declaration, which is evaluated on behalf of
+ an instance of team <code>T</code> or one of its contained roles,
+ refers to a role <code>R</code>, <code>R</code> will always
+ resolve to <code>T.R</code> even if <code>R</code> was introduced in
+ a super-team of <code>T</code> and even if the specific line of code
+ was inherited from a super-team or one of its roles.
+ Only the dynamic type of the enclosing team-instance is used to determine
+ the correct role class (see below for an example).
+
+ </p>
+ <p>A special case of dynamically binding role types relates to so-called class literals
+ (see <a href="http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#251530"
+ class="ext">JLS &sect;15.8.2</a>).
+ Role class literals are covered in <a href="s6.html#s6.1.c" title="&sect;6.1.(c)&nbsp;Class literals for roles"
+ class="sect">&sect;6.1.(c)</a>.
+
+ </p>
+ <p>The above is strictly needed only for cases involving implicit inheritance.
+ It may, however, help intuition, to also consider the directly acquired
+ role <code>T.R</code> in (b) to override the given role <code>S.R</code>.
+
+ </p>
+ <div class="codecomment">
+ In line 17 of <a href="#l1.3.1-1" class="listing">Listing 1.3.1-1</a> the implicitly inherited method <code>n</code> is called
+ with the result of an invocation of <code>m</code>. Although
+ <code>n</code> was defined in <code>S</code> (thus with argument type
+ <code>S.R2, see line 6</code>) in the context of <code>T</code> it
+ expects an argument of <code>T.R2</code>. This is correctly provided by
+ the invocation of <code>m</code> in the context of <code>T</code>.
+
+ </div>
+ </div>
+ <div class="subsect depth4" id="s1.3.1.f">
+ <h4 class="subsect">(f)&nbsp;<span class="title">tsuper</span></h4>
+ <div class="syntaxlink"><a href="sA.html#sA.5.4" title="&sect;A.5.4&nbsp;TSuperCall" class="syntax">&rarr;&nbsp;Syntax&nbsp;&sect;A.5.4</a></div>
+ <p>Super calls along implicit inheritance use the new keyword
+ <strong>tsuper</strong>. While <code>super</code> is still available
+ along regular inheritance, a call <code>tsuper.m()</code>
+ selects the version of <code>m</code> of the corresponding role
+ acquired from the super-team.
+
+ </p>
+ <p>See <a href="s2.html#s2.4.2"
+ title="&sect;2.4.2&nbsp;Role creation via a regular constructor"
+ class="sect">&sect;2.4.2</a> for <code>tsuper</code>
+ in the context of role constructors.
+
+ </p>
+ <p><code>tsuper</code> can only be used to invoke a corresponding
+ version of the enclosing method or constructor, i.e., an expression
+ <code>tsuper.m()</code> may only occur within the method <code>m</code>
+ with both methods having the same signature
+ (see <a href="s2.html#s2.3.2.b"
+ title="&sect;2.3.2.(b)&nbsp;Super in the context of declared lifting"
+ class="sect">&sect;2.3.2.(b)</a> for an exception, where both methods have slightly different signatures).
+
+ </p>
+ <div class="codecomment">
+ In <a href="#l1.3.1-1" class="listing">Listing 1.3.1-1</a> the role <code>R1</code> in team <code>T</code>
+ overrides the implicitly inherited method <code>m()</code> from <code>S</code>. <code><strong>tsuper</strong>.m()</code> calls the overridden method <code>m()</code>
+ from <code>S.R1</code> (line 13).
+
+ </div>
+ </div>
+ <div class="subsect depth4" id="s1.3.1.g">
+ <h4 class="subsect">(g)&nbsp;<span class="title">Implicitly inheriting super-types</span></h4>
+ <p>If a role class has an explicit super class (using <code>extends</code>)
+ this relation is inherited along implicit inheritance.
+
+ </p>
+ <div class="codecomment">
+ In <a href="#l1.3.1-1" class="listing">Listing 1.3.1-1</a> the role <code>R1</code> in <code>T</code> has <code>T.R0</code>
+ as its implicitly inherited super class, because the corresponding role in the super-team
+ <code><strong>extends R0</strong></code> (line 3).
+
+ </div>
+ <p>Overriding an implicitly inherited super class is governed by
+ <a href="#s1.3.2.b"
+ title="&sect;1.3.2.(b)&nbsp;Inheriting and overriding the extends clause"
+ class="sect">&sect;1.3.2.(b)</a>, below.<br />
+ The list of implemented interfaces is merged along implicit
+ inheritance.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.3.1.h">
+ <h4 class="subsect">(h)&nbsp;<span class="title">Preserving visibility</span></h4>
+ <p>A role class must provide at least as much access as the implicit super role,
+ or a compile-time error occurs (this is in analogy to <a href="http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#227965"
+ class="ext">JLS &sect;8.4.6.3</a>).
+ Access rights of methods overridden by implicit inheritance follow
+ the same rules as for normal overriding.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.3.1.i">
+ <h4 class="subsect">(i)&nbsp;<span class="title">Dynamic binding of constructors</span></h4>
+ <p>When creating a role instance using <code>new</code> not only the
+ type to instantiate is bound dynamically (cf. <a href="#s1.3.1.e" title="&sect;1.3.1.(e)&nbsp;Dynamic binding of types"
+ class="sect">&sect;1.3.1.(e)</a>), but also the constructor to
+ invoke is dynamically bound in accordance to the concrete
+ type.<br />
+ Within role constructors all <code>this(..)</code> and
+ <code>super(..)</code> calls are bound statically with respect to explicit inheritance
+ and dynamically with respect to implicit inheritance. This means the target role name is
+ determined statically, but using that name the suitable role type is determined
+ using dynamic binding.
+ <br />
+ See also <a href="s2.html#s2.5.a"
+ title="&sect;2.5.(a)&nbsp;Using abstract classes for creation"
+ class="sect">&sect;2.5.(a)</a> on using constructors of abstract role classes.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.3.1.j">
+ <h4 class="subsect">(j)&nbsp;<span class="title">Overriding and compatibility</span></h4>
+ <p>The rules of <a href="http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#228745"
+ class="ext">JLS &sect;8.4.6</a>
+ also apply to methods <em>and constructors</em> inherited via implicit inheritance.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.3.1.k">
+ <h4 class="subsect">(k)&nbsp;<span class="title">Covariant return types</span></h4>
+ <p>Given a team <code>T1</code> with two roles <code>R1</code> and <code>R2</code> where <code>R2</code> explicitly inherits from <code>R1</code>, both roles defining
+ a method <code>m</code> returning some type <code>A</code>.
+ Given also a sub-team of <code>T1</code>, <code>T2</code>, where <code>T2.R1</code> overrides <code>m</code> with a covariant return type <code>B</code>
+ (sub-type of <code>A</code>):
+
+ </p>
+ <div class="listing plain"><pre> <b>public</b> <b>team</b> <b>class</b> T1 {
+ <b>protected</b> <b>abstract</b> <b>class</b> R1 {
+ <b>abstract</b> A m();
+ }
+ <b>protected</b> <b>class</b> R2 <b>extends</b> R1 {
+ A m() { <b>return</b> <b>new</b> A(); }
+ }
+ }
+ <b>public</b> <b>team</b> <b>class</b> T2 <b>extends</b> T1 {
+ <b>protected</b> <b>class</b> R1 {
+ @Override B m() { <b>return</b> <b>new</b> B(); } <span class="error">// this declaration renders <b>class</b> T2.R2 illegal</span>
+ }
+ }</pre></div>
+ <p>
+ In this situation role <code>T2.R2</code> will be illegal unless also overriding <code>m</code> with a return type that is at least <code>B</code>.
+ Note, that the actual error occurs at the implicitly inherited method <code>T2.R2.m</code> which is not visible in the source code,
+ even <code>T2.R2</code> need not be mentioned explicitly in the source code.
+ A compiler should flag this as an imcompatibility at the team level, because a team must specialize inherited roles
+ in a consistent way.
+
+ </p>
+ </div>
+ <h5 class="listing">Example code (Teams and Roles):</h5>
+ <div class="listing example frame" id="l1.3.1-3">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> MyTeamA {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>protected</b> <b>class</b> MyRole {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> String name;</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <b>public</b> MyRole (String n) { name = n; }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> <b>public</b> <b>void</b> print() { System.out.println("id="+name); }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> <b>protected</b> MyRole getRole() { <b>return</b> <b>new</b> MyRole("Joe"); }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="listing example frame" id="l1.3.1-4">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">10</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> MySubTeam <b>extends</b> MyTeamA {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">11</td>
+ <td><pre> <b>protected</b> <b>class</b> MyRole {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">12</td>
+ <td><pre> <b>int</b> age;</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">13</td>
+ <td><pre> <b>public</b> <b>void</b> setAge(<b>int</b> a) { age = a; }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">14</td>
+ <td><pre> <b>public</b> <b>void</b> print() {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">15</td>
+ <td><pre> tsuper.print();</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">16</td>
+ <td><pre> System.out.println("age="+age);</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">17</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">18</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">19</td>
+ <td><pre> <b>public</b> <b>void</b> doit() {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">20</td>
+ <td><pre> MyRole r = getRole();</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">21</td>
+ <td><pre> r.setAge(27);</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">22</td>
+ <td><pre> r.print();</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">23</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">24</td>
+ <td><pre>}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">25</td>
+ <td><pre>...</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">26</td>
+ <td><pre>MySubTeam myTeam = <b>new</b> MySubTeam();</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">27</td>
+ <td><pre>myTeam.doit();</pre></td>
+ </tr>
+ </table>
+ </div>
+ <h5 class="listing">Program output</h5>
+ <div class="listing example frame"><pre>id=Joe
+age=27</pre></div>
+ <div class="codecomment">
+ <h5>Effects:</h5>
+ <ul>
+ <li>According to <a href="#s1.3"
+ title="&sect;1.3&nbsp;Acquisition and implicit inheritance of role classes"
+ class="sect">&sect;1.3</a>, <code>MyTeamA</code> implements
+ <code>ITeam</code> (line 1).
+ </li>
+ <li>An implicit role inheritance is created for
+ <code>MySubTeam.MyRole</code> (<a href="#s1.3.1.c"
+ title="&sect;1.3.1.(c)&nbsp;Overriding and implicit inheritance"
+ class="sect">&sect;1.3.1.(c)</a>; line&nbsp;11).<br />
+ If we visualize this special inheritance using a fictitious keyword
+ <code>overrides</code> the compiler would see a declaration:
+
+ <div class="listing plain"><pre><b>protected</b> <b>class</b> MyRole <em>overrides MyTeamA.MyRole</em> { ... }</pre></div>
+ </li>
+ <li>Invoking <code>getRole()</code> on <code>myTeam</code> (line&nbsp;27, 20)
+ creates an instance of <code>MySubTeam.MyRole</code> because the
+ acquired role <code>MyTeamA.MyRole</code> is overridden by
+ <code>MySubTeam.MyRole</code>
+ following the rules of implicit inheritance (cf. <a href="#s1.3.1.e" title="&sect;1.3.1.(e)&nbsp;Dynamic binding of types"
+ class="sect">&sect;1.3.1.(e)</a>).
+
+ </li>
+ <li>Overriding of role methods and access to inherited features works as usual.
+
+ </li>
+ <li>As an example for <a href="#s1.3.1.f" title="&sect;1.3.1.(f)&nbsp;tsuper" class="sect">&sect;1.3.1.(f)</a> see the call <code>tsuper.print()</code>
+ (line&nbsp;15), which selects the implementation of <code>MyTeamA.MyRole.print</code>.
+
+ </li>
+ </ul>
+ </div>
+ </div>
+ <div class="sect depth3" id="s1.3.2">
+ <h3 class="sect">&sect;1.3.2&nbsp;Regular role inheritance<span class="toplink"><a href="#s1.3">&uarr;&nbsp;&sect;1.3</a></span></h3>
+ <p>In addition to implicit inheritance, roles may also inherit using
+ the standard Java keyword <code>extends</code>. These restrictions apply:
+
+ </p>
+ <div class="subsect depth4" id="s1.3.2.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Super-class restrictions</span></h4>
+ <p>If the super-class of a role is again a role it must be a direct role of
+ an enclosing team
+ This rule is simply enforced by disallowing type anchors in the
+ <code>extends</code> clause
+ (see <a href="#s1.2.2.g" title="&sect;1.2.2.(g)&nbsp;Legal contexts" class="sect">&sect;1.2.2.(g)</a>).
+ As an effect, the super-class may never be more deeply nested than the sub-class.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.3.2.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Inheriting and overriding the extends clause</span></h4>
+ <p>If a role overrides another role by implicit inheritance, it may
+ change the inherited <code>extends</code> clause
+ (see <a href="#s1.3.1.g"
+ title="&sect;1.3.1.(g)&nbsp;Implicitly inheriting super-types"
+ class="sect">&sect;1.3.1.(g)</a> above) only if the new super-class
+ is a sub-class of the class in the overridden extends clause.
+ I.e., an implicit sub-role may <em>specialize</em> the extends clause of its
+ implicit super-role.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.3.2.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Constructors and overridden 'extends' </span></h4>
+ <p>Each constructor of a role class that overrides the extends clause of its
+ implicit super-role must invoke a constructor of this newly introduced
+ explicit super-class. Thus it may not use a <code>tsuper</code> constructor
+ (see <a href="s2.html#s2.4.2"
+ title="&sect;2.4.2&nbsp;Role creation via a regular constructor"
+ class="sect">&sect;2.4.2</a>).
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.3.2.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Adding implemented interfaces</span></h4>
+ <p><code>implements</code> declarations are additive, i.e., an implicit
+ sub-role may add more interfaces but has to implement all interfaces of
+ its implicit super-role, too.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.3.2.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Visibility of inherited methods</span></h4>
+ <p>
+ When a role inherits non-public methods from a regular class (as its super class),
+ these methods are considered as private for the role, i.e., they can only be
+ accessed in an unqualified method call <code>m()</code> using the implicit receiver <code>this</code>.
+
+ </p>
+ </div>
+ </div>
+ </div>
+ <div class="sect depth2" id="s1.4">
+ <h2 class="sect">&sect;1.4&nbsp;Name clashes<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;1</a></span></h2>
+ <p>OT/J restricts Java with respect to handling of conflicting names.
+
+ </p>
+ <div class="subsect depth3" id="s1.4.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Names of role classes</span></h4>
+ <p>A role class may not have the same name as a method or field of
+ its enclosing team. A role class may not shadow another class that is visible in the scope of the enclosing team.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s1.4.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Names of role methods and fields</span></h4>
+ <p>Along implicit inheritance, the names of methods or fields may
+ not hide, shadow or obscure any previously visible name.<br />
+ (see JLS <a href="http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#40898"
+ class="ext">&sect;8.3</a>,
+ <a href="http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#227928"
+ class="ext">&sect;8.4.6.2</a>,
+ <a href="http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#246026"
+ class="ext">&sect;8.5</a>,
+ <a href="http://java.sun.com/docs/books/jls/second_edition/html/interfaces.doc.html#78642"
+ class="ext">&sect;9.3</a>,
+ <a href="http://java.sun.com/docs/books/jls/second_edition/html/interfaces.doc.html#252566"
+ class="ext">&sect;9.5</a> (hiding),
+ <a href="http://java.sun.com/docs/books/jls/second_edition/html/names.doc.html#34133"
+ class="ext">&sect;6.3.1</a> (shadowing),
+ <a href="http://java.sun.com/docs/books/jls/second_edition/html/names.doc.html#104058"
+ class="ext">&sect;6.3.2</a> (obscuring).
+
+ </p>
+ </div>
+ </div>
+ <div class="sect depth2" id="s1.5">
+ <h2 class="sect">&sect;1.5&nbsp;Team and role nesting<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;1</a></span></h2>
+ <p>Multi-level nesting of classes is restricted only by the following rules.
+
+ </p>
+ <h5 class="listing">Example code (Nesting):</h5>
+ <div class="listing example frame" id="l1.5">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> SuperOuter {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>public</b> <em><b>team</b> <b>class</b> RoleAndTeam</em> {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>protected</b> <b>class</b> InnerRole {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> Runnable foo() { <b>return</b> null; }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> <b>public</b> <em><b>team</b> <b>class</b> RoleAndTeamSub</em> <b>extends</b> <strong>RoleAndTeam</strong> {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre> <b>protected</b> <b>class</b> InnerRole {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre> Runnable foo() { throw <b>new</b> RuntimeException(); }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">10</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">11</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">12</td>
+ <td><pre>}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">13</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> OuterTeam <b>extends</b> SuperOuter {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">14</td>
+ <td><pre> <b>public</b> <em><b>team</b> <b>class</b> RoleAndTeam</em> {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">15</td>
+ <td><pre> <b>protected</b> <b>class</b> InnerRole {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">16</td>
+ <td><pre> Runnable foo() {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">17</td>
+ <td><pre> <b>class</b> Local {};</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">18</td>
+ <td><pre> <b>return</b> <b>new</b> Runnable() { <span class="comment">// anonymous class definition</span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">19</td>
+ <td><pre> <b>public</b> <b>void</b> run() {}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">20</td>
+ <td><pre> };</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">21</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">22</td>
+ <td><pre> <span class="comment">// <span class="error">class IllegalMember {}</span></span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">23</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">24</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">25</td>
+ <td><pre> <b>public</b> <em><b>team</b> <b>class</b> RoleAndTeamSub</em> {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">26</td>
+ <td><pre> <b>protected</b> <b>class</b> InnerRole {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">27</td>
+ <td><pre> Runnable foo() {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">28</td>
+ <td><pre> <em>RoleAndTeamSub.tsuper</em>.foo();</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">29</td>
+ <td><pre> <b>return</b> <em>OuterTeam.tsuper</em>.foo();</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">30</td>
+ <td><pre> };</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">31</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">32</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">33</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="subsect depth3" id="s1.5.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Nested teams</span></h4>
+ <p>If a role class is also marked using the <code>team</code> modifier,
+ it may contain roles at the next level of nesting.
+
+ </p>
+ <div class="codecomment">
+ <ul>
+ <li>In the above example (<a href="#l1.5" class="listing">Listing 1.5</a>) class <code>RoleAndTeam</code> starting in line 14
+ is a role of <code>OuterTeam</code> and at the same time a
+ team containing a further role <code>InnerRole</code></li>
+ </ul>
+ </div>
+ <p>Such a hybrid role-and-team has all properties of both kinds of classes.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s1.5.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Nested classes of roles</span></h4>
+ <p>A regular role class (ie., not marked as <code>team</code>, see above)
+ may contain local types (see <a href="http://java.sun.com/docs/books/jls/second_edition/html/statements.doc.html#247766"
+ class="ext">JLS &sect;14.3</a>
+ - in the example: class <code>Local</code>), anonymous types
+ (<a href="http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#252986"
+ class="ext">JLS &sect;15.9.5</a>
+ - in the example: class defined in lines 18-20)
+ but no member types (<a href="http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#246026"
+ class="ext">JLS &sect;8.5</a>
+ - in the example: illegal class
+ <code>IllegalMember</code>).
+ <br />
+ The effect is, that nested types of a regular role cannot be
+ used outside the scope of their enclosing role.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s1.5.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Prohibition of cycles</span></h4>
+ <p>A nested team may not extend its own enclosing team.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s1.5.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Prohibition of name clashes</span></h4>
+ <p>A nested team may inherit roles from multiple sources: its explicit super team
+ and any of its implicit super classes (roles) from different levels of nesting.
+ If from different sources a team inherits two or more roles of the same name
+ that are not related by implicit inheritance, this is an illegal name clash.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s1.5.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Precedence among different supers</span></h4>
+ <p>If a role inherits the same feature from several super roles (super and tsuper),
+ an implicitly inherited version always overrides any explicitly inherited feature. <br />
+ Also implicit inheritance alone may produce several candidate methods inherited by a role class.
+ This is a result of team-nesting where each level of nesting may add one more tsuper role.
+ In that case inner team inheritance has precedence over outer team inheritance.
+
+ </p>
+ <div class="codecomment">
+ <table>
+ <colgroup span="1">
+ <col align="left" span="1" />
+ <col align="center" span="1" />
+ </colgroup>
+ <tr>
+ <td valign="top" rowspan="1" colspan="1">
+ <p>In the above example (<a href="#l1.5" class="listing">Listing 1.5</a>) role <code class="small">OuterTeam.RoleAndTeamSub.InnerRole</code> has two direct tsuper roles: <code class="small">OuterTeam.RoleAndTeam.InnerRole</code>&nbsp;and <code class="small">SuperOuter.RoleAndTeamSub.InnerRole</code>. Without the method <code>foo</code> defined in lines 27-30, the enclosing class <code class="small">OuterTeam.RoleAndTeamSub.InnerRole</code> would inherit the method <code>foo</code> defined in line 16, because the inner inheritance between <code>RoleAndTeamSub</code> and <code>RoleAndTeam</code> binds stronger than the outer inheritance between <code>OuterTeam</code> and <code>SuperOuter</code>.
+ </p>
+ </td>
+ <td rowspan="1" colspan="1"><img src="../images/team_nesting_hor.png" alt="Example diagram team nesting" /></td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ <div class="subsect depth3" id="s1.5.f">
+ <h4 class="subsect">(f)&nbsp;<span class="title">Qualified tsuper</span></h4>
+ <p>A role in a nested team may qualify the keyword <code>tsuper</code> (see <a href="#s1.3.1.f" title="&sect;1.3.1.(f)&nbsp;tsuper" class="sect">&sect;1.3.1.(f)</a> above) by a type name
+ in order to select among different method version inherited from different implicit super classes. A term <code>OuterTeam.tsuper</code> evaluates
+ to the super-class, say <code>SuperOuter</code>, of an enclosing team "<code>OuterTeam</code>". A method call <code>OuterTeam.tsuper.m()</code>
+ evaluates to the method version within <code>SuperOuter</code> that best corresponds to the current method containing the tsuper-call.
+
+ </p>
+ <div class="codecomment">
+ <ul>
+ <li>In the above example (<a href="#l1.5" class="listing">Listing 1.5</a>) line 28 is identical to an unqualified tsuper-call
+ </li>
+ <li>Line 29 selects a corresponding method from the context of <code>SuperOuter</code> resolving to <code>SuperOuter.RoleAndTeamSub.InnerRole.foo()</code></li>
+ </ul>
+ </div>
+ </div>
+ </div>
+ <div class="aux" id="aux1.1">
+ <h4 class="aux">Language implementation:<span class="toplink"><a href="#s1">&uarr;&nbsp;&sect;1</a></span></h4>
+ <p>Role acquisition and implicit inheritance can be implemented in at least two ways.
+
+ </p>
+ <p><strong>Virtual classes:</strong> Each role class is an overridable feature of
+ its enclosing team. Role classes are resolved by dynamic binding
+ with respect to the enclosing team instance. This implementation
+ requires multiple-inheritance in order to also allow regular
+ inheritance between roles of the same team. <code>super</code>
+ and <code>tsuper</code> select parent versions of a method along
+ the two dimensions of inheritance.
+
+ </p>
+ <p><strong>Copy inheritance:</strong> Role acquisition from a super-team has the effect
+ of copying a role definition <code>T.R</code> yielding a new
+ role <code>Tsub.R</code>. All role applications <code>Rx</code>
+ in the role copy refer to <code>Tsub.Rx</code>. Implicit role
+ inheritance extends a role copy in-place. Only the <code>tsuper</code>
+ construct allows to access the previous version of a method
+ (i.e. before in-place overriding).
+
+ </p>
+ </div>
+ <div class="aux" id="aux1.2">
+ <h4 class="aux">References:<span class="toplink"><a href="#s1">&uarr;&nbsp;&sect;1</a></span></h4>
+ <p id="fn1-virtual-classes">[1] Ole Lehrmann Madsen and Birger M&oslash;ller-Pedersen. <em>Virtual classes: A powerful mechanism in object-oriented programming</em>. In Proceedings OOPSLA 89, ACM SIGPLAN Notices, volume 24, 10, pages 397-406, October 1989.
+
+ </p>
+ <p id="fn2-family-polymorphism">[2] Erik Ernst. <em>Family Polymorphism.</em> In Proceedings ECOOP 2001, LNCS 2072, pages 303-326, Springer, 2001.
+
+ </p>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s0.html" rel="prev">&lt;&lt;&nbsp;&sect;0&nbsp;About this Document</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.html" rel="next">&sect;2&nbsp;Role Binding&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/s2.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/s2.html
new file mode 100644
index 000000000..a521433e8
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/s2.html
@@ -0,0 +1,1868 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s1.html" rel="prev">&lt;&lt;&nbsp;&sect;1&nbsp;Teams and Roles</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s3.html" rel="next">&sect;3&nbsp;Callout Binding&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="chapter" id="s2">
+ <div class="headl">
+ <div class="headr">
+ <h1>&sect;2&nbsp;Role Binding</h1>
+ </div>
+ </div>
+ <div id="toc-box">
+ <ul class="toc-box">
+ <li><a href="s2.html">&sect;2&nbsp;Role Binding</a></li>
+ <li><a href="#s2.1">&sect;2.1&nbsp;playedBy relation</a></li>
+ <li><a href="#s2.2">&sect;2.2&nbsp;Lowering</a></li>
+ <li><a href="#s2.3">&sect;2.3&nbsp;Lifting</a></li>
+ <li><a href="#s2.4">&sect;2.4&nbsp;Explicit role creation</a></li>
+ <li><a href="#s2.5">&sect;2.5&nbsp;Abstract Roles</a></li>
+ <li><a href="#s2.6">&sect;2.6&nbsp;Explicit base references</a></li>
+ <li><a href="#s2.7">&sect;2.7&nbsp;Advanced structures</a></li>
+ </ul>
+ </div>
+ <div class="intro">
+ <h3>Roles and base classes</h3>
+ <div class="line"></div>
+ <div class="term">playedBy relation</div>
+ <div class="termdesc">A role can be bound to a class outside the team by a <code>playedBy</code>
+ relation, which declares that each role instances is associated to a
+ base instances.
+ </div>
+ <div class="line"></div>
+ <div class="term">Base class</div>
+ <div class="termdesc">The class to which a role is bound (using <code>playedBy</code>) is called
+ its <strong>base class</strong>. Role instances may inherit and override
+ features from their base instance, which is declared using <strong>callout</strong>
+ (<a href="s3.html" title="&sect;3&nbsp;Callout Binding" class="sect">&sect;3</a>)
+ and <strong>callin</strong> (<a href="s4.html" title="&sect;4&nbsp;Callin Binding" class="sect">&sect;4</a>) method bindings.
+ </div>
+ <div class="line"></div>
+ <div class="term">Bound role</div>
+ <div class="termdesc">Each role class that declares a <code>playedBy</code> relation
+ is called a <strong>bound role</strong>. The term bound role may also be
+ used for the instances of such a class.
+ </div>
+ <div class="line"></div>
+ <div class="term">Lifting / lowering</div>
+ <div class="termdesc">Translations between a role and its base are called
+ <strong>lifting</strong> (base to role) (<a href="#s2.3" title="&sect;2.3&nbsp;Lifting" class="sect">&sect;2.3</a>)
+ and <strong>lowering</strong> (role to base) (<a href="#s2.2" title="&sect;2.2&nbsp;Lowering" class="sect">&sect;2.2</a>).
+ </div>
+ <div class="line"></div>
+ <div class="term">Translation polymorphism</div>
+ <div class="termdesc">Conformance between a role and a base is governed by <strong>translation polymorphism</strong>,
+ which refers to a substitutability that is achieved using either lifting or lowering.
+ </div>
+ <div class="line"></div>
+ <div class="term">Declared lifting</div>
+ <div class="termdesc">Generally, lifting happens implicitly at data flows between
+ a role object and its base. Team level methods provide additional
+ data flows, where lifting may be declared explicitly.
+ </div>
+ <div class="line"></div>
+ </div>
+ <div class="sect depth2" id="s2.1">
+ <h2 class="sect">&sect;2.1&nbsp;playedBy relation<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;2</a></span></h2>
+ <div class="syntaxlink"><a href="sA.html#sA.1.1" title="&sect;A.1.1&nbsp;ClassDeclaration"
+ class="syntax">&rarr;&nbsp;Syntax&nbsp;&sect;A.1.1</a></div>
+ <div class="subsect depth3" id="s2.1.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Role-base binding</span></h4>
+ <p>Roles are bound to a base class by the <code>playedBy</code> keyword.
+
+ </p>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> MyTeamA {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>public</b> <b>class</b> MyRole <em><b>playedBy</b> MyBase</em> {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> ...</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ <div class="subsect depth3" id="s2.1.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Inheritance</span></h4>
+ <p>The <code>playedBy</code> relation is inherited along
+ explicit and implicit (<a href="s1.html#s1.3.1.c"
+ title="&sect;1.3.1.(c)&nbsp;Overriding and implicit inheritance"
+ class="sect">&sect;1.3.1.(c)</a>)
+ role inheritance.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s2.1.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Covariant refinement</span></h4>
+ <p>An <em>explicit</em> sub-role (sub-class using <code>extends</code>)
+ can refine the <code>playedBy</code> relation to a more
+ specific base class (this is the basis for
+ <a href="#s2.3.3" title="&sect;2.3.3&nbsp;Smart lifting" class="sect">smart lifting (&sect;2.3.3)</a>).<br />
+ If a role class inherits several <code>playedBy</code> relations from
+ its super-class and its super-interfaces, there must be a most specific
+ base-class among these relations, which is conform to all other base-classes.
+ This most specific base-class is the base-class of the current role.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s2.1.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">No-variance</span></h4>
+ <p>An <em>implicit</em> sub-role (according to <a href="s1.html#s1.3.1.c"
+ title="&sect;1.3.1.(c)&nbsp;Overriding and implicit inheritance"
+ class="sect">&sect;1.3.1.(c)</a>)
+ may only add a <code>playedBy</code> relation but never change an existing one.<br />
+ Note however, that implicit inheritance may implicitly specialize an existing <code>playedBy</code>
+ relation (this advanced situation is illustrated in <a href="#s2.7.d" title="&sect;2.7.(d)&nbsp;Implicit playedBy specialization"
+ class="sect">&sect;2.7.(d)</a>).
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s2.1.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Use of playedBy bindings</span></h4>
+ <p>The <code>playedBy</code> relation by itself has no effect
+ on the behavior of role and base objects.
+ It is, however, the precondition for translation polymorphism
+ (lowering: <a href="#s2.2" title="&sect;2.2&nbsp;Lowering" class="sect">&sect;2.2</a> and lifting: <a href="#s2.3" title="&sect;2.3&nbsp;Lifting" class="sect">&sect;2.3</a>)
+ and for method bindings (callout: <a href="s3.html" title="&sect;3&nbsp;Callout Binding" class="sect">&sect;3</a> and callin: <a href="s4.html" title="&sect;4&nbsp;Callin Binding" class="sect">&sect;4</a>).
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s2.1.f">
+ <h4 class="subsect">(f)&nbsp;<span class="title">Effect on garbage collection</span></h4>
+ <p>A role and its base object form one conceptual entity. The garbage collector will see a role
+ and its base object as linked in a bidirectional manner. As a result, a role cannot be
+ garbage collected if its base is still reachable and vice versa.
+ <br />
+ Internally a team manages its roles and corresponding bases using weak references.
+ When using one of the <code>getAllRoles(..)</code>
+ methods (see <a href="s6.html#s6.1.a"
+ title="&sect;6.1.(a)&nbsp;Interface to the role registry"
+ class="sect">&sect;6.1.(a)</a>),
+ the result may be non-deterministic because these internal structures
+ may hold weak references to objects that will be collected by the next run of the
+ garbage collector. We advise clients of <code>getAllRoles(..)</code> to call
+ <code>System.gc()</code> prior to calling <code>getAllRoles(..)</code> in order
+ to ensure deterministic results.
+
+ </p>
+ </div>
+ <div class="sect depth3" id="s2.1.1">
+ <h3 class="sect">&sect;2.1.1&nbsp;Binding interfaces<span class="toplink"><a href="#s2.1">&uarr;&nbsp;&sect;2.1</a></span></h3>
+ <p>Role base bindings may involve classes and/or interfaces.
+ An interface defined as a member of a team is a role interface and may therefore
+ have a <code>playedBy</code> clause. Also the type mentioned after the
+ <code>playedBy</code> keyword may be an interface.
+
+ </p>
+ <div class="note">
+ <h5>Implementation limitation:</h5>
+ The language implementation as of OTDT version 1.0.<i>X</i> cannot yet bind
+ a role class to a base interface, but this restriction will go in the future.
+
+ </div>
+ </div>
+ <div class="sect depth3" id="s2.1.2">
+ <h3 class="sect">&sect;2.1.2&nbsp;Legal base classes<span class="toplink"><a href="#s2.1">&uarr;&nbsp;&sect;2.1</a></span></h3>
+ <p>Generally, the base class mentioned after <code>playedBy</code> must be
+ visible in the enclosing scope (see <a href="#s2.1.2.c" title="&sect;2.1.2.(c)&nbsp;Base class decapsulation"
+ class="sect">below (&sect;2.1.2.(c))</a> for an exception).
+ Normally, this scope is defined just by the imports of the enclosing team.
+ For role files (<a href="s1.html#s1.2.5.b" title="&sect;1.2.5.(b)&nbsp;Role files"
+ class="sect">&sect;1.2.5.(b)</a>)
+ also additional imports in the role file are considered.
+ <br /><a href="#s2.1.2.d" title="&sect;2.1.2.(d)&nbsp;Base imports" class="sect">&sect;2.1.2.(d)</a> below defines how imports can be constrained so that certain types
+ can be used as base types, only.
+
+ </p>
+ <div class="subsect depth4" id="s2.1.2.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">No role of the same team</span></h4>
+ <p>The base class of any role class must not be a role of the same team.
+ <br />
+ It is also not allowed to declare a role class of the same name
+ as a base class bound to this or another role of the enclosing team,
+ if that base class is given with its simple name and resolved using a regular import.
+ Put differently, a base class mentioned after <code>playedBy</code>
+ may not be <em>shadowed</em> by any role class of the enclosing team.
+ <br /><em>Base imports</em> as defined below (<a href="#s2.1.2.d" title="&sect;2.1.2.(d)&nbsp;Base imports" class="sect">&sect;2.1.2.(d)</a>) relax this rule by
+ allowing to import a class as a base class only. In that case no shadowing occurs since the scopes for
+ base classes and roles are disjoint.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s2.1.2.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">No cycles</span></h4>
+ <p>The base class mentioned after <code>playedBy</code> may not be
+ an enclosing type (at any depth) of the role class being defined.
+ <br />
+ This rule prohibits the creation of cycles where the base instance of
+ a given role <code>R</code> contains roles of the same type <code>R</code>.
+ <br />
+ More generally any sequence of classes <code>C<sub>1</sub>, C<sub>2</sub>, .. C<sub>n</sub></code>
+ were each <code>C<sub>i+1</sub></code> is either a member or the base class of
+ <code>C<sub>i</sub></code> and <code>C<sub>n</sub> = C<sub>1</sub></code> is forbidden.
+ <br />
+ Conversely, it is also prohibited to bind a role class to its own inner class.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s2.1.2.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Base class decapsulation</span></h4>
+ <p>If a base class referenced after <code>playedBy</code> exists but is not visible under normal visibility rules of Java,
+ this restriction may be overridden. This concept is called <strong>decapsulation</strong>, i.e., the opposite of encapsulation
+ (see also <a href="s3.html#s3.4" title="&sect;3.4&nbsp;Overriding access restrictions"
+ class="sect">&sect;3.4</a>). A compiler should signal any occurrence of base class decapsulation. If a compiler supports to
+ configure warnings this may be used to let the user choose to (a) ignore base class decapsulation, (b) treat it as a warning
+ or even
+ (c) treat it as an error.
+
+ </p>
+ <p>
+ Binding to a <code>final</code> base class is also considered as decapsulation, since a <code>playedBy</code> relationship has
+ powers similar to an <code>extends</code> relationship, which is prohibited by marking a class as <code>final</code>.
+
+ </p>
+ <p>
+ Decapsulation is not allowed if the base class is a confined role (see <a href="s7.html#s7.2" title="&sect;7.2&nbsp;Confined roles" class="sect">&sect;7.2</a>).
+
+ </p>
+ <p>
+ Within the current role a decapsulated base class can be mentioned in the right-hand-side of any method binding
+ (<a href="s3.html" title="&sect;3&nbsp;Callout Binding" class="sect">callout (&sect;3)</a> or <a href="s4.html" title="&sect;4&nbsp;Callin Binding" class="sect">callin (&sect;4)</a>). Also arguments in these positions are allowed to mention the decapsulated base class:
+
+ </p>
+ <ul>
+ <li>the first argument of one of the role's constructors (see <a href="#s2.4.1"
+ title="&sect;2.4.1&nbsp;Role creation via a lifting constructor"
+ class="sect">lifting constructor (&sect;2.4.1)</a>).
+ </li>
+ <li>the base side of an argument with declared lifting (see <a href="#s2.3.2" title="&sect;2.3.2&nbsp;Declared lifting" class="sect">declared lifting (&sect;2.3.2)</a>).
+ </li>
+ </ul>
+ </div>
+ <div class="subsect depth4" id="s2.1.2.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Base imports</span></h4>
+ <p>If the main type in a file denotes a team, the modifier <code>base</code> can be applied to an import in order to specify that this type
+ should be imported for application as a base type only. Example:
+
+ </p>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><em><b>import</b> base</em> some.pack.MyBase;</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> MyTeam {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <span class="comment">// simple name resolves to imported class:</span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <b>protected</b> <b>class</b> MyRole <em><b>playedBy</b> MyBase</em> { } </pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> <span class="error"><em>MyBase</em> illegalDeclaration;</span> <span class="comment">// base import does not apply for this position</span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <p>Types imported by a base import can only be used in the same positions where also base class decapsulation (<a href="#s2.1.2.c" title="&sect;2.1.2.(c)&nbsp;Base class decapsulation"
+ class="sect">&sect;2.1.2.(c)</a>)
+ is applicable.<br />
+ It is recommended that a type mentioned after the keyword <code>playedBy</code> is always imported with the <code>base</code> modifier, otherwise the compiler
+ will give a warning.<br />
+ Base imports create a scope that is disjoint from the normal scope. Thus, names that are imported as base will never clash
+ with normally visible names
+ (in contrast to <a href="s1.html#s1.4" title="&sect;1.4&nbsp;Name clashes" class="sect">&sect;1.4</a>). More specifically, it is not a problem to use a base class's name also for its role if a base import is used.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s2.1.2.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">No free type parameters</span></h4>
+ <p>
+ Neither the role class nor the base class in a playedBy binding must have any <em>free type parameters</em>.
+ If both classes are specified with a type parameter of the same name, both parameters are identified
+ and are not considered as <em>free</em>.
+
+ </p>
+ <p>
+ From this follows that a role class cannot have more type parameters than its base.
+ Conversely, only one situation exists where a base class can have more type parameters than a role class
+ bound to it: if the role class has no type parameters a generic base class can be bound using
+ the base class's raw type, i.e., without specifying type arguments.
+
+ </p>
+ <div class="note">
+ <h5>Note:</h5>
+ The information from the <code>playedBy</code> declaration is used at run-time
+ to associate role instances to base instances.
+ Specifying a base class with free type parameters would imply that only such base instances
+ are decorated by a role whose type is conform to the specified parameterized class.
+ However, type arguments are not available at run-time, thus the run-time environment
+ is not able to decide which base instances should have a role and which should not.
+ This is due to the design of generics in Java which are realized by erasure.
+
+ </div>
+ <p>The following example shows how generics can be used in various positions. Note, that some of the concepts used in the example
+ will be explained in later sections.
+ </p>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>class</b> ValueTrafo<em>&lt;T&gt;</em> {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>public</b> <em>T</em> transform(<em>T</em> val) throws Exception { /* ... */ }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre>}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> TransformTeam {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> <b>protected</b> <b>class</b> SafeTrafo<em>&lt;U&gt;</em> <b>playedBy</b> ValueTrafo<em>&lt;U&gt;</em> {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> <em>U</em> transform(<em>U</em> v) <b>-&gt;</b> <em>U</em> transform(<em>U</em> val); </pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> <b>protected</b> <em>U</em> safeTransform(<em>U</em> v) {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre> <b>try</b> {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre> <b>return</b> transform(v);</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">10</td>
+ <td><pre> } <b>catch</b> (Exception e) {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">11</td>
+ <td><pre> <b>return</b> v;</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">12</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">13</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">14</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">15</td>
+ <td><pre> <em>&lt;V&gt; V</em> perform(ValueTrafo<em>&lt;V&gt;</em> <b>as</b> SafeTrafo<em>&lt;V&gt;</em> trafo, <em>V</em> value) {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">16</td>
+ <td><pre> <b>return</b> trafo.safeTransform(value);</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">17</td>
+ <td><pre> } </pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">18</td>
+ <td><pre>}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">19</td>
+ <td><pre>...</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">20</td>
+ <td><pre>ValueTrafo<em>&lt;String&gt;</em> trafo = <b>new</b> ValueTrafo<em>&lt;String&gt;</em>();</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">21</td>
+ <td><pre>TransformTeam safeTrafo = <b>new</b> TransformTeam();</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">22</td>
+ <td><pre>String s = safeTrafo.perform(trafo, "Testing");</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">23</td>
+ <td><pre></pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="codecomment">
+ <h5>Explanation</h5>
+ <ul>
+ <li>Line 5 shows a role with type parameter <code>U</code> where the type parameter is identified with the
+ corresponding type parameter of the role's base class (which is originally declared as <code>T</code> in line 1.
+ </li>
+ <li>Line 6 shows a callout binding (<a href="s3.html" title="&sect;3&nbsp;Callout Binding" class="sect">&sect;3</a>) which mappes a base method to a corresponding role method
+ while maintaining the flexible typing.
+ </li>
+ <li>The regular method in lines 7-13 just passes values of type <code>U</code> around.
+ </li>
+ <li>The generic method in line 15 ff. uses declared lifting (<a href="#s2.3.2" title="&sect;2.3.2&nbsp;Declared lifting" class="sect">&sect;2.3.2</a>) to obtain a role for a given base object.
+ The method has no knowledge about the concrete type arguments of either role nor base, but works under the guarantee
+ that both type arguments will be the same for any single invocation.
+ </li>
+ <li>Lines 20 ff. finally create instances of base and team and invoke the behavior thereby instantiating type parameters to <code>String</code>.
+ </li>
+ </ul>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="sect depth2" id="s2.2">
+ <h2 class="sect">&sect;2.2&nbsp;Lowering<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;2</a></span></h2>
+ <p>Each instance of a bound role class internally stores a reference to its
+ base object. The reference is guaranteed to exist for each bound role
+ instance, and cannot be changed during its lifetime.
+
+ </p>
+ <div class="subsect depth3" id="s2.2.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Definition of lowering</span></h4>
+ <p>Retrieving the base object from a role object is called <strong>lowering</strong>.
+ No other means exists for accessing the base reference.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s2.2.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Places of lowering</span></h4>
+ <p>The lowering translation is not meant to be invoked
+ by client code, but <strong>implicit translations</strong> are inserted by
+ the compiler at all places where a role type is provided while the
+ corresponding base type (or a super type) was expected.<br />
+ In other words: lowering translations are inserted by the compiler at
+ all places in a program which would otherwise not be type correct
+ and which using lowering are statically type correct.
+ This may concern:
+
+ </p>
+ <ul>
+ <li>the right hand side of an assignment wrt. the static type of the left hand side,</li>
+ <li>the argument values of a method or constructor call wrt. the static type of the corresponding formal parameter,</li>
+ <li>the return value of a method compared to the declared return type of the method.</li>
+ <li>a role parameter in a callout binding (<a href="s3.html#s3.3.d" title="&sect;3.3.(d)&nbsp;Typing rules" class="sect">&sect;3.3.(d)</a>)
+ </li>
+ <li>or the return value in a callin binding (<a href="s4.html#s4.5.d" title="&sect;4.5.(d)&nbsp;Typing rules" class="sect">&sect;4.5.(d)</a>)
+ </li>
+ </ul>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> MyTeamA {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>public</b> <b>class</b> <em>MyRole <b>playedBy</b> MyBase</em> { ... }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>void</b> useMyBase(<em>MyBase</em> myb) {...}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <em>MyRole</em> returnMyRole() {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> <b>public</b> <b>void</b> doSomething() {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> <em>MyRole r</em> = <b>new</b> MyRole(<b>new</b> MyBase());</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> <em>MyBase b</em> = <em>r</em>;</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre> useMyBase(<em>r</em>);</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre> <em>MyBase b2</em> = returnMyRole();</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">10</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">11</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="codecomment">
+ <h5>Effects:</h5>
+ <p>An instance of type <code>MyRole</code> is lowered to type <code>MyBase</code> when
+ </p>
+ <ul>
+ <li>assigning it to <code>b</code> (line 7)
+ </li>
+ <li>passing it as argument to a method with formal parameter of type <code>MyBase</code> (line 8)
+ </li>
+ <li>assigning the return value to a variable of type <code>MyBase</code> (line 9)
+ </li>
+ </ul>
+ <p><em>Note</em>: The constructor call in line 6 uses the <em>lifting constructor</em> as defined in <a href="#s2.4.1"
+ title="&sect;2.4.1&nbsp;Role creation via a lifting constructor"
+ class="sect">&sect;2.4.1</a></p>
+ </div>
+ <p>Lowering translations are <span class="underline">not</span> inserted for
+
+ </p>
+ <ul>
+ <li>reference comparison (using <code>==</code> or <code>!=</code>)
+ </li>
+ <li><code>instanceof</code> checks
+ </li>
+ <li>cast expressions</li>
+ <li>return values in callout bindings <a href="s3.html#s3.3.d" title="&sect;3.3.(d)&nbsp;Typing rules" class="sect">&sect;3.3.(d)</a>)
+ </li>
+ <li>parameters in callin bindings (<a href="s4.html#s4.5.d" title="&sect;4.5.(d)&nbsp;Typing rules" class="sect">&sect;4.5.(d)</a>)
+ </li>
+ </ul>
+ <p>For cases where lowering shall be <em>forced</em> see <a href="#s2.2.d" title="&sect;2.2.(d)&nbsp;Explicit lowering" class="sect">&sect;2.2.(d)</a> below.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s2.2.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Typing</span></h4>
+ <p>The static type of an implicit lowering translation is the base class
+ declared using <code>playedBy</code> in the respective role class.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s2.2.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Explicit lowering</span></h4>
+ <p>If a base type is also the super type of its role,
+ which frequently happens, if a base reference is known only by
+ the type <code>Object</code>, lowering cannot be deduced automatically,
+ since a type could be interpreted both as a role type and a base type.
+ These cases may need <strong>explicit lowering</strong>.
+ For this purpose the role class must declare to implement the interface
+ <strong><code>ILowerable</code></strong> (from <code>org.objectteams.ITeam</code>).
+ This will cause the compiler to generate a method
+ </p>
+ <div class="listing plain"><pre><b>public</b> Object lower()</pre></div>
+ <p>for the given role class. Client code may use this method to
+ explicitly request the base object of a given role object.
+ </p>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> MyTeamA {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>public</b> <b>class</b> MyRole <em><b>implements</b> ILowerable</em> <b>playedBy</b> MyBase { ... }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>public</b> <b>void</b> doSomething() {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> MyRole r = <b>new</b> MyRole(<b>new</b> MyBase());</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> Object oMyRole = r;</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> Object oMyBase = r.<em>lower()</em>;</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ <div class="subsect depth3" id="s2.2.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Lowering of arrays</span></h4>
+ <p>Lowering also works for arrays of role objects.
+ In order to lower an array of role objects,
+ a new array is created and filled with base objects, one for each
+ role object in the original array. The array may have any number
+ of dimensions at any shape. The lowered array will have exactly the
+ same shape.<br />
+ Note, that each lowering translation will create a new array.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s2.2.f">
+ <h4 class="subsect">(f)&nbsp;<span class="title">Ambiguous lowering</span></h4>
+ <p>When assigning a value of a bound role type to a variable or argument of type <code>java.lang.Object</code>
+ this situation is considered as ambiguous lowering because the assignment could apply either (a) a direct upcast to <code>Object</code>
+ or (b) lowering and then upcasting.
+ In such situations the compiler will <em>not</em> insert a lowering translation, but a configurable warning will be issued.
+
+ </p>
+ </div>
+ </div>
+ <div class="sect depth2" id="s2.3">
+ <h2 class="sect">&sect;2.3&nbsp;Lifting<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;2</a></span></h2>
+ <p>Lifting is the reverse translation of lowering. However, lifting is
+ a bit more demanding, since a given base object may have zero to
+ many role objects bound to it. Therefor, the lifting translation
+ requires more context information and may require to create role
+ objects on demand.
+
+ </p>
+ <div class="subsect depth3" id="s2.3.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Definition of lifting</span></h4>
+ <p>Retrieving a role for a given base object is called <strong>lifting</strong>.
+ Lifting is guaranteed to yield the same role object for subsequent
+ calls regarding the same base object, the same team instance and
+ the same role class (see <a href="#s2.3.4" title="&sect;2.3.4&nbsp;Binding ambiguities" class="sect">&sect;2.3.4</a>
+ for cases of ambiguity that are signaled by compiler warnings
+ and possibly runtime exceptions).
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s2.3.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Places of lifting</span></h4>
+ <p>The lifting translation is not meant to be invoked
+ by client code, but translations are inserted by the compiler
+ at the following locations:
+
+ </p>
+ <ul>
+ <li><a href="s3.html#s3.3.c" title="&sect;3.3.(c)&nbsp;Result translation"
+ class="sect">Callout bindings (&sect;3.3.(c))</a> (result)
+ </li>
+ <li><a href="s4.html#s4.5.a" title="&sect;4.5.(a)&nbsp;Call target translation"
+ class="sect">Callin bindings (&sect;4.5.(a))</a> (call target and parameters)
+ </li>
+ <li><a href="#s2.3.2" title="&sect;2.3.2&nbsp;Declared lifting" class="sect">Declared lifting (&sect;2.3.2)</a></li>
+ </ul>
+ </div>
+ <div class="subsect depth3" id="s2.3.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Typing</span></h4>
+ <p>A lifting translation statically expects a specific role class.
+ This expected role class must have a <code>playedBy</code> clause
+ (either directly, or inherited (explicitly or implicitly)
+ from a super role), to which the given base type is conform.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s2.3.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Lifting of arrays</span></h4>
+ <p>Lifting also works for arrays of role objects.
+ For lifting an array of base objects
+ a new array is created and filled with role objects, one for each
+ base object in the original array. In contrast to the role objects
+ themselves, lifted arrays are never reused for subsequent lifting
+ invocations.
+
+ </p>
+ </div>
+ <p id="s2.3.transpol">The term <strong>translation polymorphism</strong>
+ describes the fact that at certain points values can be passed which are not
+ conform to the respective declared type considering only regular
+ inheritance (<code>extends</code>). With translation polymorphism
+ it suffices that a value can be translated using lifting or lowering.
+
+ </p>
+ <div class="sect depth3" id="s2.3.1">
+ <h3 class="sect">&sect;2.3.1&nbsp;Implicit role creation<span class="toplink"><a href="#s2.3">&uarr;&nbsp;&sect;2.3</a></span></h3>
+ <p>Lifting tries to reuse existing role objects so that role state persists across
+ lifting and lowering. If no suitable role instance is found during lifting,
+ a new role is created.
+
+ </p>
+ <div class="subsect depth4" id="s2.3.1.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Reuse of existing role objects</span></h4>
+ <p>A role object is considered suitable for reuse during lifting, if
+ these three items are identical:
+
+ </p>
+ <ol>
+ <li>the given base object</li>
+ <li>the given team object</li>
+ <li>the statically required role type</li>
+ </ol>
+ <p>For the relation between the statically required role type and
+ the actual type of the role object see <a href="#s2.3.3" title="&sect;2.3.3&nbsp;Smart lifting" class="sect">"smart lifting" (&sect;2.3.3)</a>.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s2.3.1.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Default lifting constructor</span></h4>
+ <p>Lifting uses a default constructor which takes exactly one argument of the type
+ of the declared base class (after <code>playedBy</code>).
+ By default the compiler generates such a constructor for each bound role.
+ On the other hand, default constructors that take no arguments
+ (as in <a href="http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#16823"
+ class="ext">JLS &sect;8.8.7</a>) are never generated for bound roles.
+ <br />
+ The super-constructor to be invoked by a default lifting constructor
+ depends on whether the role's super class is a bound role or not.
+
+ </p>
+ <ul>
+ <li>If the super-class is a bound role, the default lifting constructor will invoke the default lifting constructor of the super-class.</li>
+ <li>If the super-class is not a bound role, the default lifting constructor will invoke the normal argumentless default constructor
+ of the super-class.
+ </li>
+ </ul>
+ </div>
+ <div class="subsect depth4" id="s2.3.1.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Custom lifting constructor</span></h4>
+ <p>If a role class declares a custom constructor with the same signature
+ as the default lifting constructor, this constructor is used during lifting.
+ This custom constructor may pre-assume that the role has been setup
+ properly regarding its base-link and registered in the team's internal map of roles.
+ <br />
+ If a bound role has an unbound super-class without an argumentless
+ constructor, providing a custom lifting constructor is obligatory,
+ because no legal default lifting constructor can be generated.
+
+ </p>
+ </div>
+ </div>
+ <div class="sect depth3" id="s2.3.2">
+ <h3 class="sect">&sect;2.3.2&nbsp;Declared lifting<span class="toplink"><a href="#s2.3">&uarr;&nbsp;&sect;2.3</a></span></h3>
+ <div class="syntaxlink"><a href="sA.html#sA.6.2" title="&sect;A.6.2&nbsp;LiftingType" class="syntax">&rarr;&nbsp;Syntax&nbsp;&sect;A.6.2</a></div>
+ <div class="subsect depth4" id="s2.3.2.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Parameters with declared lifting</span></h4>
+ <p>A non-static team-level method or constructor may declare a parameter with two types
+ in order to explicitly denote a place of <strong>lifting</strong>. Using the syntax
+
+ </p>
+ <div class="listing plain"><pre><b>public</b> <b>void</b> m (BaseClass <em>as</em> RoleClass param) { <i>stmts</i> }</pre></div>
+ <p>a liftable parameter can be declared, provided the second type
+ (<code>RoleClass</code>) is a role of (<code>playedBy</code>) the first type (<code>BaseClass</code>).
+ Furthermore, the role type must be a role of the enclosing team class defining the given method.
+ The role type must be given by its simple (i.e., unqualified) name.
+ <br />
+ Such a signature requires the caller to provide a base object (here <code>BaseClass</code>), but
+ the callee receives a role object (here <code>RoleClass</code>).
+ In fact, the client sees a signature in which the "<code>as RoleClass</code>" part is omitted.
+ <br />
+ Compatibility between caller and callee sides is achieved by an implicitly inserted lifting translation.
+ A signature using declared lifting is only valid, if the requested lifting is possible
+ (see <a href="#s2.3.3" title="&sect;2.3.3&nbsp;Smart lifting" class="sect">&sect;2.3.3</a> and <a href="#s2.3.4" title="&sect;2.3.4&nbsp;Binding ambiguities" class="sect">&sect;2.3.4</a> for details).
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s2.3.2.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Super in the context of declared lifting</span></h4>
+ <p>Calling <code>super</code> or <code>tsuper</code> in a method or constructor which
+ declares lifting for one or more parameters refers to a method or constructor with role type parameters,
+ i.e., lifting takes place <em>before</em> super invocation. Nevertheless, the super method may also
+ have a declared lifting signature. It will then see the same role instance(s) as the current method.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s2.3.2.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Declared lifting of arrays</span></h4>
+ <p>If a parameter involving explicit lifting should be of an <strong>array</strong> type, the syntax is
+
+ </p>
+ <div class="listing plain"><pre><b>public</b> <b>void</b> m (BaseClass <b>as</b> RoleClass param[]) ...</pre></div>
+ <p>Here the brackets denoting the array apply to both types, <code>BaseClass</code>
+ and <code>RoleClass</code>.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s2.3.2.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Declared lifting for catch blocks</span></h4>
+ <p>Also the argument of a catch block may apply declared lifting like in:
+
+ </p>
+ <div class="listing plain"><pre><b>catch</b> (BaseException <b>as</b> RoleClass param) { <i>stmts</i> }</pre></div>
+ <p>This syntax is only valid in a non-static scope of a team (directly or nested).
+ In the given example, <code>RoleClass</code> must be played by <code>BaseException</code>.
+ Note, that <code>RoleClass</code> itself need not be a throwable.
+ As the effect of this declaration the catch block will catch any exception of type <code>BaseException</code>
+ and provides it wrapped with a <code>RoleClass</code> instance to the subsequent block.
+ <br />
+ Also note, that re-throwing the given instance <code>param</code> has the semantics of implicitly lowering
+ the role to its base exception before throwing, because the role conforms to the required type
+ <code>Throwable</code> only via lowering.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s2.3.2.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Generic declared lifting</span></h4>
+ <p>A method with declared lifting may introduce a type parameter that is bounded relative to a given role type.
+ Such bound is declared as:
+
+ </p>
+ <div class="listing plain"><pre>&lt;AnyBase <b>base</b> SuperRole&gt;
+<b>void</b> teamMethod(AnyBase <b>as</b> SuperRole arg) {
+ <span class="comment">// body using arg as of type SuperRole</span>
+}</pre></div>
+ <p>This means that <code>AnyBase</code> is a type parameter whose instantiations must all be liftable to role <code>SuperRole</code>.
+
+ </p>
+ <p>
+ The given type bound requires the call site to supply an argument that is compatible to any base class
+ for which the current team contains a bound role that is a sub class of <code>SuperRole</code>, including <code>SuperRole</code> itself.
+ However, <code>SuperRole</code> itself need not be bound to any base class.
+ On the other hand, different valid substitutions for <code>AnyBase</code> need not be related by inheritance.
+
+ </p>
+ <div class="note">
+ <h5>Note:</h5>
+ This feature supports generalized treatment of otherwise unrelated base classes.
+ This is done by defining one bound role for each base under consideration and by
+ having all these roles extend a common unbound role.
+
+ </div>
+ </div>
+ <h5 class="listing">Example code (Declared Lifting):</h5>
+ <div class="listing example frame" id="l2.3.2">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>team</b> <b>class</b> Super {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>public</b> <b>class</b> MyRole <b>playedBy</b> MyBase { ... }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>void</b> m (MyRole o) { ... };</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre>}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre><b>team</b> <b>class</b> Sub <b>extends</b> Super {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> <b>void</b> m (<em>MyBase <b>as</b> MyRole o</em>) {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> <span class="comment">// inside this method o is of type MyRole</span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre> super.m(o);</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">10</td>
+ <td><pre>}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">11</td>
+ <td><pre>Sub s_<b>team</b> = <b>new</b> Sub();</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">12</td>
+ <td><pre>MyBase b = <b>new</b> MyBase();</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">13</td>
+ <td><pre>s_team.m(b); <span class="comment">// clients see a parameter "MyBase o"</span></pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="codecomment">
+ <h5>Effects:</h5>
+ <ul>
+ <li>Clients use method <code>m</code> with a base instance (type <code>MyBase</code>) as its argument (line 13).
+ </li>
+ <li>Before executing the body of <code>m</code>, the argument is lifted such that the method body receives
+ the argument as of type <code>MyRole</code> (line 8).
+ </li>
+ </ul>
+ </div>
+ </div>
+ <div class="sect depth3" id="s2.3.3">
+ <h3 class="sect">&sect;2.3.3&nbsp;Smart lifting<span class="toplink"><a href="#s2.3">&uarr;&nbsp;&sect;2.3</a></span></h3>
+ <p>In situations where role and base classes are part of some inheritance
+ hierarchies (<code>extends</code>), choosing the appropriate role class during
+ lifting involves the following rules:
+
+ </p>
+ <div class="subsect depth4" id="s2.3.3.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Static adjustment</span></h4>
+ <p>If a base class <code>B</code> shall be lifted to a role class
+ <code>R</code> that is not bound to (<code>playedBy</code>)
+ <code>B</code>, but if a subclass of <code>R</code>
+ &mdash; say <code>R2</code> &mdash;
+ is bound to <code>B</code>, lifting is statically setup to use
+ <code>R2</code>, the most general subclass of <code>R</code> that
+ is bound to <code>B</code> or one of its super-types.
+
+ </p>
+ <div class="note">
+ <h5>Restriction:</h5>
+ This step is not applicable for parameter mappings of <code>replace</code>
+ callin bindings (<a href="s4.html#s4.5.d" title="&sect;4.5.(d)&nbsp;Typing rules" class="sect">&sect;4.5.(d)</a>).
+
+ </div>
+ </div>
+ <div class="subsect depth4" id="s2.3.3.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Dynamic selection of a role class</span></h4>
+ <p>At runtime also the dynamic type of a base object is considered:
+ Lifting always tries to use a role class that is bound to the
+ exact class of the base object. Lifting considers all role&ndash;base
+ pairs bound by <code>playedBy</code> such that the role class is a
+ sub-class of the required (statically declared) role type
+ and the base class is a super-class of the
+ dynamic type of the base object.
+ <br />
+ From those possible pairs the most specific base class is chosen.
+ If multiple role classes are bound to this base class the most
+ specific of these classes is chosen.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s2.3.3.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Team as closed world</span></h4>
+ <p>In the above analysis gathering all role-base pairs is performed at
+ compile-time. From this follows, that a team class can only be
+ compiled when all its contained role classes are known and a role class
+ can never be compiled without its team.
+ <br />
+ The analysis includes all roles and their bindings that are inherited
+ from the super-team.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s2.3.3.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Selection regardless of abstractness</span></h4>
+ <p>Smart lifting is not affected by abstractness of role classes.
+ For the effect of abstract role classes see <a href="#s2.5" title="&sect;2.5&nbsp;Abstract Roles" class="sect">&sect;2.5</a>.
+
+ </p>
+ </div>
+ <h5>Complex Example:</h5>
+ <p><img src="../images/smart_lifting_small.png" alt="smart lifting example" /></p>
+ <table border="2" width="80%">
+ <colgroup span="1">
+ <col align="left" span="1" />
+ <col align="left" span="1" />
+ </colgroup>
+ <tr>
+ <th rowspan="1" colspan="1">role class</th>
+ <th rowspan="1" colspan="1">base class</th>
+ </tr>
+ <tr>
+ <td rowspan="1" colspan="1">class R1</td>
+ <td rowspan="1" colspan="1">&nbsp;</td>
+ </tr>
+ <tr>
+ <td rowspan="1" colspan="1">class R2 extends R1 playedBy B2</td>
+ <td rowspan="1" colspan="1">class B2</td>
+ </tr>
+ <tr>
+ <td rowspan="1" colspan="1">class R3 extends R2 <em>/* inherited: playedBy B2 */ </em></td>
+ <td rowspan="1" colspan="1">class B3 extends B2</td>
+ </tr>
+ <tr>
+ <td rowspan="1" colspan="1">class R4 extends R3 playedBy B4</td>
+ <td rowspan="1" colspan="1">class B4 extends B3</td>
+ </tr>
+ <tr>
+ <td rowspan="1" colspan="1">class R5 extends R4 <em>/* inherited: playedBy B4 */</em></td>
+ <td rowspan="1" colspan="1">&nbsp;</td>
+ </tr>
+ <tr>
+ <td rowspan="1" colspan="1">&nbsp;</td>
+ <td rowspan="1" colspan="1">class B6 extends B4</td>
+ </tr>
+ <tr>
+ <td rowspan="1" colspan="1">class R7 extends R5 playedBy B7</td>
+ <td rowspan="1" colspan="1">class B7 extends B6</td>
+ </tr>
+ </table>
+ <div class="codecomment">
+ <ul>
+ <li>If declarations require lifting <code>B3</code> to <code>R1</code>
+ this is statically refined to use <code>R2</code> instead, because this
+ is the most general class declaring a binding to a super&ndash;class
+ of <code>B3</code>.
+
+ </li>
+ <li>If the dynamic base type in the same situation is <code>B6</code>,
+ three steps select the appropriate role:
+
+ <ol>
+ <li>By searching all <code>playedBy</code> clauses (including those
+ that are inherited) the following role&ndash;base pairs are
+ candidates:<br /><code>(R2,B2), (R3,B2), (R4,B4)</code> and <code>(R5,B4)</code>.
+ </li>
+ <li>From these pairs the two containing the most specific base class
+ <code>B4</code> are chosen.
+ </li>
+ <li>This makes <code>R4</code> and <code>R5</code> role candidates,
+ from which the most specific <code>R5</code> is finally chosen.
+ </li>
+ </ol>
+ </li>
+ </ul>
+ </div>
+ <p>If the inheritance hierarchies of the involved base and role classes are given (like in the figure above)
+ the smart lifting algorithm can be rephrased to the following "graphical" rule:<br /></p>
+ <div class="note">
+ Starting with the dynamic base type (<code>B6</code> in the example) move upwards the the inheritance
+ relation until you reach a base class bound to a role class indicated by a &laquo;playedBy&raquo;
+ arrow pointing to the base class (<code>B4</code>). This role class must be conform to the requested role type.
+ Switch to the role side along this arrow (<code>R4</code>). Now move downwards the role inheritance hierarchy
+ as long as the subrole does not refine the playedBy relationship (indicated by another &laquo;playedBy&raquo; arrow).
+ The bottom role you reach this way (<code>R5</code>) is the role type selected by smart lifting.
+
+ </div>
+ </div>
+ <div class="sect depth3" id="s2.3.4">
+ <h3 class="sect">&sect;2.3.4&nbsp;Binding ambiguities<span class="toplink"><a href="#s2.3">&uarr;&nbsp;&sect;2.3</a></span></h3>
+ <p>While all examples so far have only shown 1-to-1 class bindings,
+ several cases of multiple bindings are allowable. Ambiguities may be
+ detected at compile time and/or at runtime.
+
+ </p>
+ <div class="subsect depth4" id="s2.3.4.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Potential ambiguity</span></h4>
+ <p>A <strong>potential ambiguity</strong> is given,
+ if two role classes <code>R1</code> and <code>R2</code>
+ exist such that
+
+ </p>
+ <ul>
+ <li><code>R1</code> and <code>R2</code> are played by the
+ same base class <code>B</code>, and
+ </li>
+ <li><code>R1</code> and <code>R2</code> have a common
+ super role <code>R0</code>,
+ which is also bound to a base class <code>B0</code>, and
+ </li>
+ <li>neither role class <code>R1</code> nor
+ <code>R2</code> is a (indirect) sub-class of the other.
+ </li>
+ </ul>
+ <div class="note">
+ <h5>Note:</h5>
+ According to <a href="#s2.1.c" title="&sect;2.1.(c)&nbsp;Covariant refinement" class="sect">&sect;2.1.(c)</a>, if <code>B</code> is distinct from <code>B0</code>
+ it has to be a sub-class of <code>B0</code>.
+
+ </div>
+ <div class="note">
+ <h5>Effect:</h5>
+ In this case the compiler issues a warning, stating that the <code>B</code><em> may not be liftable,</em> because both role classes <code>R1</code>
+ and <code>R2</code> are candidates and there is no reason to prefer one over the other.
+ <br /><strong>If no potential ambiguity is detected, lifting will always be unambiguous.</strong></div>
+ <p>In the above situation, trying to lift an instance of type <code>B</code> to the role type
+ <code>R0</code> is an <strong>illegal lifting request</strong>. If <code>R0</code> is bound
+ to the same base class <code>B</code> as its sub-roles <code>R1</code> and <code>R2</code> are,
+ role <code>R0</code> is <strong>unliftable</strong>, meaning that no instance of <code>R0</code>
+ can ever by obtained by lifting.
+
+ </p>
+ <h5 class="listing">Example code (Potential Ambiguity):</h5>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>team</b> <b>class</b> MyTeam {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>public</b> <b>class</b> SuperRole <b>playedBy</b> MyBase {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>public</b> <b>class</b> SubRoleA <b>extends</b> SuperRole {...}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <b>public</b> <b>class</b> SubRoleB <b>extends</b> SuperRole {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ <div class="subsect depth4" id="s2.3.4.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Definite ambiguity</span></h4>
+ <p>A <strong>definite ambiguity</strong> is given if
+
+ </p>
+ <ul>
+ <li>the situation of potential ambiguity according to (a)
+ above is given and
+ </li>
+ <li>lifting is requested (either by method binding or explicitly
+ (<a href="#s2.3.2" title="&sect;2.3.2&nbsp;Declared lifting" class="sect">&sect;2.3.2</a>)) from the shared base class <code>B</code> to any role
+ class <code>R0</code> that is a common super role for <code>R1</code> and <code>R2</code>.
+ </li>
+ </ul>
+ <div class="note">
+ <h5>Effect:</h5>
+ Definite ambiguity is a compile time error.
+
+ </div>
+ <h5 class="listing">Example code (Definite Ambiguity):</h5>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>team</b> <b>class</b> MyTeam {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>public</b> <b>class</b> SuperRole <b>playedBy</b> MyBase {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>public</b> <b>class</b> SubRoleA <b>extends</b> SuperRole <b>playedBy</b> SubBase {...}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <b>public</b> <b>class</b> SubRoleB <b>extends</b> SuperRole <b>playedBy</b> SubBase {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> <b>public</b> <b>void</b> useSuperRole(SubBase <b>as</b> SuperRole r) {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ <div class="subsect depth4" id="s2.3.4.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Actual ambiguity</span></h4>
+ <p>At runtime <strong>actual ambiguity</strong> may occur if for the
+ <em>dynamic type</em> of a base to be lifted the conditions of (b)
+ above hold accordingly. Actual ambiguity is only possible in cases
+ reported by the compiler as potential ambiguity.
+
+ </p>
+ <div class="note">
+ <h5>Effect:</h5>
+ An actual ambiguity is reported at runtime by throwing a
+ <code>org.objectteams.LiftingFailedException</code>.
+
+ </div>
+ <h5 class="listing">Example code (Actual Ambiguity):</h5>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>team</b> <b>class</b> MyTeam {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>public</b> <b>class</b> SuperRole <b>playedBy</b> MyBase {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>public</b> <b>class</b> SubRoleA <b>extends</b> SuperRole <b>playedBy</b> SubBase {...}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <b>public</b> <b>class</b> SubRoleB <b>extends</b> SuperRole <b>playedBy</b> SubBase {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> </pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> <b>public</b> <b>void</b> useSuperRole(MyBase <b>as</b> SuperRole r) {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre>}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre><span class="comment">// plus these calls:</span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre>MyTeam mt = <b>new</b> MyTeam();</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">10</td>
+ <td><pre>mt.useSuperRole(<b>new</b> SubBase());</pre></td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ <div class="subsect depth4" id="s2.3.4.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Mismatching role</span></h4>
+ <p>In cases of potential ambiguity another runtime error may occur:
+ a <strong>mismatching role</strong> is encountered when a role is found
+ in the cache, which is not conform to the required type.
+ This happens, if the base object has previously been lifted
+ to a type that is incompatible with the currently requested type.
+
+ </p>
+ <div class="note">
+ <h5>Effect:</h5>
+ This is reported by throwing a <code>org.objectteams.WrongRoleException</code>.
+
+ </div>
+ <h5 class="listing">Example code (Mismatching Role):</h5>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>team</b> <b>class</b> MyTeam {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>public</b> <b>class</b> SuperRole <b>playedBy</b> MyBase {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>public</b> <b>class</b> SubRoleA <b>extends</b> SuperRole {...}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <b>public</b> <b>class</b> SubRoleB <b>extends</b> SuperRole {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> </pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> <b>public</b> <b>void</b> useRoleA(MyBase <b>as</b> SubRoleA r) {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> <b>public</b> <b>void</b> useRoleB(MyBase <b>as</b> SubRoleB r) {...}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre>}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre><span class="comment">// plus these calls:</span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">10</td>
+ <td><pre>MyTeam mt = <b>new</b> MyTeam();</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">11</td>
+ <td><pre>MyBase b = <b>new</b> MyBase();</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">12</td>
+ <td><pre>mt.useRoleA(b); <span class="comment">// creates a SubRoleA for b</span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">13</td>
+ <td><pre>mt.useRoleB(b); <span class="comment">// finds the SubRoleA which is not compatible</span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">14</td>
+ <td><pre> <span class="comment">// to the expected type SubRoleB.</span></pre></td>
+ </tr>
+ </table>
+ </div>
+ <p>From the second item of <a href="#s2.3.4.a" title="&sect;2.3.4.(a)&nbsp;Potential ambiguity"
+ class="sect">&sect;2.3.4.(a)</a> follows, that for binding ambiguities different
+ role hierarchies are analyzed in isolation.
+ For this analysis only those role classes are considered that are bound to a
+ base class (directly using <code>playedBy</code> or by inheriting this relation
+ from another role class).
+ I.e., two role classes that have no common bound super role will never cause
+ any ambiguity.
+
+ </p>
+ </div>
+ </div>
+ </div>
+ <div class="sect depth2" id="s2.4">
+ <h2 class="sect">&sect;2.4&nbsp;Explicit role creation<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;2</a></span></h2>
+ <p>Lifting is the normal technique by which role objects are created implicitly.
+ This section defines under which conditions a role can also be created explicitly.
+
+ </p>
+ <div class="sect depth3" id="s2.4.1">
+ <h3 class="sect">&sect;2.4.1&nbsp;Role creation via a lifting constructor<span class="toplink"><a href="#s2.4">&uarr;&nbsp;&sect;2.4</a></span></h3>
+ <p>Lifting uses the default constructor for roles (see <a href="#s2.3.1" title="&sect;2.3.1&nbsp;Implicit role creation" class="sect">&sect;2.3.1</a>).
+ This constructor can be invoked from client code, if the following rules are respected.
+
+ </p>
+ <div class="subsect depth4" id="s2.4.1.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Team context</span></h4>
+ <p>The lifting constructor can be used only within the enclosing team of
+ the role to be instantiated. Thus, qualified allocation expressions
+ (<code>someTeam.new SomeRole(..)</code>) may never use the lifting constructor.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s2.4.1.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Fresh base object</span></h4>
+ <p>If the argument to a lifting constructor invocation is a <code>new</code>
+ expression, creating a fresh base object, the use of the lifting constructor
+ is safe. Otherwise the rules of (c) below apply.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s2.4.1.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Duplicate role runtime check</span></h4>
+ <p>If it cannot be syntactically derived, that the argument to a lifting
+ constructor is a freshly created base object (b), a compile time warning will
+ signal that an additional runtime check is needed: It must be prevented that
+ a new role is created for a base object, which already has a role of the
+ required type in the given team. It is not possible to replace an existing
+ role by use of the lifting constructor. At runtime, any attempt to do so
+ will cause a <code>org.objectteams.DuplicateRoleException</code> to be thrown.
+ This exception can only occur in situations where the mentioned compile
+ time warning had been issued.
+ <br /><a href="s6.html#s6.1" title="&sect;6.1&nbsp;Reflection" class="sect">&sect;6.1</a> will introduce reflective functions
+ which can be used to manually prevent errors like a duplicate role.
+
+ </p>
+ </div>
+ </div>
+ <div class="sect depth3" id="s2.4.2">
+ <h3 class="sect">&sect;2.4.2&nbsp;Role creation via a regular constructor<span class="toplink"><a href="#s2.4">&uarr;&nbsp;&sect;2.4</a></span></h3>
+ <p>Roles may also be created explicitly using a custom constructor with arbitrary signature
+ other than the signature of the lifting constructor.<br />
+ Within role constructors, four kinds of self-calls are possible:
+
+ </p>
+ <dl>
+ <dt><code>base(..)</code></dt>
+ <dd>A constructor of the corresponding base class (<a href="sA.html#sA.5.3" title="&sect;A.5.3&nbsp;BaseCall" class="sect">&sect;A.5.3</a>(c)).
+ </dd>
+ <dt><code>this(..)</code></dt>
+ <dd>Another constructor of the same class.</dd>
+ <dt><code>super(..)</code></dt>
+ <dd>A constructor of the super-class (normal <code>extends</code>), <span class="underline">unless</span> the super-class is bound to a different base class, in which case calling <code>super(..)</code> is not legal.
+ </dd>
+ <dt><code>tsuper(..)</code></dt>
+ <dd>A constructor of the corresponding role of the super-team (<a href="sA.html#sA.5.4" title="&sect;A.5.4&nbsp;TSuperCall" class="sect">&sect;A.5.4</a>(e)). Also see the constraint in <a href="s1.html#s1.3.2.c"
+ title="&sect;1.3.2.(c)&nbsp;Constructors and overridden 'extends' "
+ class="sect">&sect;1.3.2.(c)</a>.
+ </dd>
+ </dl>
+ <div class="subsect depth4" id="s2.4.2.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Unbound roles</span></h4>
+ <p>Each constructor of a role that is <strong>not bound</strong> to a base class must use
+ one of <code>this(..)</code>, <code>super(..)</code> or <code>tsuper(..)</code>.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s2.4.2.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Bound roles</span></h4>
+ <p>Each constructor of a <strong>bound role</strong> must directly or indirectly invoke either
+ a <code>base(..)</code> constructor or a lifting constructor (see <a href="#s2.3.1" title="&sect;2.3.1&nbsp;Implicit role creation" class="sect">&sect;2.3.1</a>).
+ Indirect calls to the base constructor or lifting constructor may use any of <code>this(..)</code>, <code>super(..)</code>
+ or <code>tsuper(..)</code>, which simply delegates the obligation to the called constructor.
+ <br />
+ If a constructor referenced by <code>base(..)</code> is not visible according to the
+ regular rules of Java, it may still be called using <b>decapsulation</b> (see
+ also <a href="s3.html#s3.4" title="&sect;3.4&nbsp;Overriding access restrictions"
+ class="sect">&sect;3.4</a>, <a href="#s2.1.2.c" title="&sect;2.1.2.(c)&nbsp;Base class decapsulation"
+ class="sect">&sect;2.1.2.(c)</a>).
+ <br />
+ Note, that if the super or tsuper role is not bound, delegating the obligation to that unbound role will not work.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s2.4.2.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Super-call for bound roles</span></h4>
+ <p>Instead of or prior to calling <code>base(..)</code> a constructor of a bound role explicitly or implicitly calls a super constructor.
+ Which constructor is applicable depends on the super role and its <code>playedBy</code> clause.
+
+ </p>
+ <ul>
+ <li>If the super role is bound to the same base class as the current role is,
+
+ <ul>
+ <li>not writing a super-call causes the lifting constructor of the super role to be invoked.</li>
+ <li>explicitly calling a super constructor requires the super constructor to <i>either</i><ol>
+ <li>create a role instance using a base constructor call (directly or indirectly), <i>or</i></li>
+ <li>be a lifting constructor receiving a base instance, which the current role must provide as the argument.</li>
+ </ol>
+ </li>
+ </ul>
+ </li>
+ <li>If the super role is bound but the current role refines the <code>playedBy</code>
+ relationship (cf. <a href="#s2.1.c" title="&sect;2.1.(c)&nbsp;Covariant refinement" class="sect">&sect;2.1.(c)</a>),
+
+ <ul>
+ <li>a lifting constructor must be called explicitly passing a base object as the argument.</li>
+ </ul>
+ </li>
+ <li>If the role has an explicit or implicit super role which is unbound the constructor may optionally
+ call a super constructor (using <code>super(..)</code> or <code>tsuper(..)</code>) prior to calling
+ <code>base(..)</code>. Otherwise the default constructor is implicitly invoked.
+
+ </li>
+ </ul>
+ <p>When invoking a lifting constructor of a super role the base object can optionally be obtained by using a base constructor
+ call as an expression:
+
+ </p>
+ <div class="listing plain"><pre>super(base(<i>&lt;args&gt;</i>));</pre></div>
+ </div>
+ <p>The language system evaluates the base constructor by creating an
+ instance of the appropriate base class using a constructor with matching
+ signature. Also the internal links are setup that are needed for accessing the
+ base object from the role and for lifting the base object to the new role
+ in the future.
+
+ </p>
+ <p>The syntax for base constructors follows the rule that role implementations
+ never directly refer to any names of base classes or their features.
+
+ </p>
+ </div>
+ <div class="sect depth3" id="s2.4.3">
+ <h3 class="sect">&sect;2.4.3&nbsp;Role creation in the presence of smart lifting<span class="toplink"><a href="#s2.4">&uarr;&nbsp;&sect;2.4</a></span></h3>
+ <p>Explicitly instantiating a role <code>R1</code> bound to a base <code>B</code> where smart lifting of <code>B</code> to <code>R1</code> would actually
+ provide a subrole <code>R2</code> is dangerous: Instantiation enters the <code>R1</code> into the team's internal cache. If at any time later lifting
+ this <code>B</code> to <code>R2</code> is requested, which is a legal request, the runtime system will answer by throwing a <code>org.objectteams.WrongRoleException</code>
+ because it finds the <code>R1</code> instead of the required <code>R2</code>.
+ For this reason, in this specific situation the explicit instantiation <code>new R1(..)</code> will be flagged by a warning.
+ The problem can be avoided by using <code>R2</code> in the instantiation expression.
+
+ </p>
+ <h5 class="listing">Example code (WrongRoleException):</h5>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>class</b> B { <b>void</b> bm() {} }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> T {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>protected</b> <b>class</b> R1 <b>playedBy</b> B {...}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <b>protected</b> <b>class</b> R2 <b>extends</b> R1 { <span class="comment">// inherits the binding to B</span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> <b>void</b> rm() { <span class="comment">/* body omitted */</span> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> <b>public</b> B getDecoratedB() {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre> <b>return</b> <em><b>new</b> R1</em>(<b>new</b> B()); <span class="comment">// <span class="error">compile-time warning!</span></span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">10</td>
+ <td><pre> <b>public</b> <b>void</b> requestLifting(B <b>as</b> R2 r) {}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">11</td>
+ <td><pre>}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">12</td>
+ <td><pre><span class="comment">// plus these calls:</span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">13</td>
+ <td><pre>T t = <b>new</b> T();</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">14</td>
+ <td><pre>B b = t.getDecoratedB(); <span class="comment">// creates an R1 for b</span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">15</td>
+ <td><pre>t.requestLifting(b); <span class="comment">// =&gt; <span class="error"><code>org.objectteams.WrongRoleException!</code></span></span></pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="codecomment">
+ <ul>
+ <li>A note on line 8: this line passes a fresh instance of <code>B</code> to the lifting constructor of <code>R1</code>
+ (see <a href="#s2.4.1.b" title="&sect;2.4.1.(b)&nbsp;Fresh base object"
+ class="sect">&sect;2.4.1.(b)</a>). In order to return this <code>B</code> instance lowering is implicitly used for the return statement.
+ </li>
+ <li>When line 15 is executed, a lifting of <code>b</code> to <code>R2</code> is requested but due to line 8 an <code>R1</code> is found in the internal cache.
+ </li>
+ </ul>
+ </div>
+ </div>
+ </div>
+ <div class="sect depth2" id="s2.5">
+ <h2 class="sect">&sect;2.5&nbsp;Abstract Roles<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;2</a></span></h2>
+ <p>Overriding of role classes and dynamic binding of role types (<a href="s1.html#s1.3.1.e"
+ title="&sect;1.3.1.(e)&nbsp;Dynamic binding of types"
+ class="sect">&sect;1.3.1.(e)</a>)
+ adds new cases to <strong>creation</strong> with respect to abstract classes.
+
+ </p>
+ <div class="subsect depth3" id="s2.5.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Using abstract classes for creation</span></h4>
+ <p>Abstract role classes can indeed be used for object creation.
+ The effect of such a statement is that the team must be
+ marked <code>abstract</code>. Only those sub-teams are concrete
+ that provide concrete versions for all role classes used in
+ creation expressions.<br />
+ This includes the case, where a
+ super-team has a concrete role class and creates
+ instances of this role class and only the sub-team changes
+ the status of this role class to abstract. Also here
+ the sub-team must be marked abstract, because it contains
+ an abstract role class that is used in creation expressions.
+
+ </p>
+ <div class="note">
+ <h5>Interpretation:</h5>
+ Since the type in a role creation expression is late-bound relative to the enclosing team instance, abstract role classes
+ can be seen
+ as the hook in a <strong>template&amp;hook pattern</strong> that is raised from the method level to the class level:
+ A super-team may already refer to the constructor of an abstract role class,
+ only the sub-team will provide the concrete role class to fill the hook with the necessary implementation.
+
+ </div>
+ </div>
+ <div class="subsect depth3" id="s2.5.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Relevant roles</span></h4>
+ <p>A team must be marked <code>abstract</code> if one of its <strong>relevant roles</strong> is abstract.
+ <br />
+ A role is relevant in this sense if
+
+ </p>
+ <ul>
+ <li>the role class is public <em>or if</em></li>
+ <li>an explicit <code>new</code> expression
+ would require to create instances of the role class, <em>or if</em></li>
+ <li>any of the lifting methods of the enclosing team
+ would require to create instances of the role class.<br />
+ A role is irrelevant with respect to lifting
+ if either of the following holds:
+
+ <ul>
+ <li>It is not bound to a base class, neither directly nor
+ by an inherited <code>playedBy</code> clause.
+ </li>
+ <li>It has a sub-role without a <code>playedBy</code> clause.
+ </li>
+ <li>It is bound to an abstract base class, and for all concrete
+ sub-classes of the base class, a binding to a more specific role class exists.
+ </li>
+ </ul>
+ </li>
+ </ul>
+ <p>If neither property, relevance nor irrelevance, can be shown for an abstract role,
+ a warning is given in case the enclosing team is not abstract.
+
+ </p>
+ </div>
+ </div>
+ <div class="sect depth2" id="s2.6">
+ <h2 class="sect">&sect;2.6&nbsp;Explicit base references<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;2</a></span></h2>
+ <p>The role-base link is not meant to be accessed explicitly from programs,
+ but it is fully under the control of compiler and runtime environment.
+ Accessing features of a role's base object is done by
+ <a href="s3.html" title="&sect;3&nbsp;Callout Binding" class="sect">callout bindings (&sect;3)</a>.
+ Yet, a keyword <code>base</code> exists, which can be used in the following
+ contexts:
+
+ </p>
+ <div class="subsect depth3" id="s2.6.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Externalized roles of a base team</span></h4>
+ <p>If the base class of a role <code>T1.R1</code> is again a team
+ <code>T2</code>, roles of that team <code>T2</code> can be
+ externalized (see <a href="s1.html#s1.2.2" title="&sect;1.2.2&nbsp;Externalized roles"
+ class="sect">&sect;1.2.2</a>)
+ using <code>base</code> as their type anchor. Given that
+ <code>R2</code> is a role of <code>T2</code>, one could write:
+
+ </p>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> T1 {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>protected</b> <b>class</b> R1 <em><b>playedBy</b> T2</em> {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>protected</b> <em>R2&lt;@base&gt;</em> aRoleOfMyBase;</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <p>This syntax is only legal within the body of the role <code>T1.R1</code> which is bound
+ to the team <code>T2</code> containing role <code>R2</code>.
+ A static type prefix can be used to disambiguate a base anchor, so the explicit variant
+ of the above type would be <code>R2&lt;@<strong>R1</strong>.base&gt;</code>.
+ <br />
+ It is not legal to use a type anchor containing <code>base</code> as an element in a path
+ of references like <code>&lt;@base.<span class="error">field</span>&gt;</code>
+ or <code>&lt;@<span class="error">field</span>.base&gt;</code>.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s2.6.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Explicit base object creation</span></h4>
+ <p>Within a role constructor (which is not the lifting constructor)
+ the syntax <code>base(<em>arguments</em>)</code> causes an instance
+ of the bound base class to be created and linked (see <a href="#s2.4.2"
+ title="&sect;2.4.2&nbsp;Role creation via a regular constructor"
+ class="sect">&sect;2.4.2</a>).
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s2.6.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Base call in callin method</span></h4>
+ <p>Within a <a href="s4.html#s4.2.d" title="&sect;4.2.(d)&nbsp;Callin methods"
+ class="sect">callin method (&sect;4.2.(d))</a>
+ an expression <code>base.m(<em>args</em>)</code> is used to invoke the
+ originally called method (see <a href="s4.html#s4.3" title="&sect;4.3&nbsp;Base calls" class="sect">&sect;4.3</a>).
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s2.6.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Base guard predicates</span></h4>
+ <p><a href="s5.html#s5.4" title="&sect;5.4&nbsp;Guard predicates" class="sect">Guard predicates (&sect;5.4)</a> can
+ be specified to act on the base side using the <code><strong>base when</strong></code> keywords.
+ Within such a base guard predicate <code>base</code> is interpreted as a special identifier
+ holding a reference to the base object that is about to be lifted
+ for the sake of a callin method interception (see <a href="s5.html#s5.4.2.a" title="&sect;5.4.2.(a)&nbsp;Base object reference"
+ class="sect">&sect;5.4.2.(a)</a>).
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s2.6.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Parameter mappings</span></h4>
+ <p>An expression at the right-hand side of a parameter mapping
+ (parameter in a callin binding (<a href="s4.html#s4.4" title="&sect;4.4&nbsp;Callin parameter mapping"
+ class="sect">&sect;4.4</a>) or
+ result in a callout binding (<a href="s3.html#s3.2.c" title="&sect;3.2.(c)&nbsp;Result mapping"
+ class="sect">&sect;3.2.(c)</a>) ) may use the keyword <code>base</code>
+ to refer to the bound base instance. Such usage requires the role method bound in this method binding to be non-static.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s2.6.f">
+ <h4 class="subsect">(f)&nbsp;<span class="title">Inhibition of modification</span></h4>
+ <p>In all cases, the <code>base</code> reference is immutable,
+ i.e., <code>base</code> can never appear as the left-hand-side of an assignment.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s2.6.g">
+ <h4 class="subsect">(g)&nbsp;<span class="title">Decapsulation via base reference</span></h4>
+ <p>In cases <a href="#s2.6.d" title="&sect;2.6.(d)&nbsp;Base guard predicates"
+ class="sect">&sect;2.6.(d)</a> and <a href="#s2.6.e" title="&sect;2.6.(e)&nbsp;Parameter mappings" class="sect">&sect;2.6.(e)</a> above, members of the base
+ object may be accessed that would not be visible under Java's visibility rules.
+ Such references are treated as decapsulation in accordance with <a href="s3.html#s3.4.a"
+ title="&sect;3.4.(a)&nbsp;Callout to inaccessible base method"
+ class="sect">&sect;3.4.(a)</a> and <a href="s3.html#s3.5.e" title="&sect;3.5.(e)&nbsp;Access control"
+ class="sect">&sect;3.5.(e)</a>.<br />
+ Note that accessing a base field via <code>base</code> only gives reading access to this field.
+
+ </p>
+ </div>
+ <div class="newpage"></div>
+ </div>
+ <div class="sect depth2" id="s2.7">
+ <h2 class="sect">&sect;2.7&nbsp;Advanced structures<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;2</a></span></h2>
+ <p>This section discusses how role containment and the playedBy relationship can be combined.
+ It does not define new rules, but illustrates rules defined above. The central idea is that any class
+ can have more than one of the three flavors <em>team, role, </em>and<em> base</em>.
+
+ </p>
+ <div class="subsect depth3" id="s2.7.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Nesting</span></h4>
+ <p>If a role (contained in a team) is also a team (marked with the <code>team</code> modifier)
+ it is a <strong>nested team</strong>. The depth of nesting is not restricted.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s2.7.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Stacking</span></h4>
+ <p>If the base class to which a role is bound using <code>playedBy</code> is a team,
+ the role is said to be <strong>stacked</strong> on the base team.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s2.7.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Layering</span></h4>
+ <p>If roles of a team <code>Secondary</code> are played by roles of another team <code>Primary</code>
+ (i.e., base classes are roles), the team <code>Secondary</code> defines a <strong>layer</strong> over the team <code>Primary</code>.
+ Such layering requires a final reference <code>anchor</code> from <code>Secondary</code> to an instance of <code>Primary</code>.
+ All playedBy declarations within <code>Secondary</code> specify their base classes anchored to that final link <code>anchor</code>.
+
+ </p><img src="../images/Layering.png" alt="Team layering example" /><p>Due to the anchored base types, layered teams implicitly support the following guarantee:
+ all base objects of roles of <code>Secondary</code> are contained within the team instance specified by the link <code>anchor</code>.
+ If roles of <code>Secondary</code> contain any callin bindings to non-static base methods, these will be triggered only
+ when a base method is invoked on a base instance contained in the team specified by <code>anchor</code>.
+ <br />
+ In accordance with <a href="#s2.6.a" title="&sect;2.6.(a)&nbsp;Externalized roles of a base team"
+ class="sect">&sect;2.6.(a)</a> the anchor in such anchored playedBy declarations
+ could also be the pseudo identifier <code>base</code>, provided that <code>Secondary</code> is a nested team,
+ which has a playedBy binding to <code>Primary</code> as its base class.
+ This situation is part of the second example <a href="#s2.7.d" title="&sect;2.7.(d)&nbsp;Implicit playedBy specialization"
+ class="sect">below (&sect;2.7.(d))</a> (see <code>T1 playedBy TB1</code>).
+
+ </p>
+ </div>
+ <div class="newpage"></div>
+ <div class="subsect depth3" id="s2.7.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Implicit playedBy specialization</span></h4>
+ <p>According to <a href="#s2.1.d" title="&sect;2.1.(d)&nbsp;No-variance" class="sect">&sect;2.1.(d)</a> an implicit sub-role may <em>implicitly</em> specialize an existing <code>playedBy</code> relation.
+ This requires the base class to be specified relative to some implicit (<code>OuterTeam.this</code>) or explicit (<code>OuterTeam.base</code>) team anchor.
+ Specializing that team anchor automatically specializes the playedBy declaration, too.
+ This rule never requires any action from a programmer but only explains the interpretation of a playedBy declaration in
+ complex situations.
+
+ </p>
+ <h5>Two advanced examples demonstrating the above are:</h5>
+ <table border="0">
+ <colgroup span="1">
+ <col align="left" span="1" />
+ <col align="left" span="1" />
+ </colgroup>
+ <tr>
+ <td rowspan="1" colspan="1">
+ <ul>
+ <li>If a role <code>TOuter1.T.R</code> of a <strong>nested team </strong><code>TOuter1.T</code> is played by
+ another role of the outer enclosing team <code>TOuter1.B</code>, subclassing the outer team <code>TOuter1</code> to <code>TOuter2</code>
+ will produce a new role <code>TOuter2.T.R</code> which is automatically played by <code>TOuter2.B</code>,
+ an implicit sub class of the original base class <code>TOuter1.B</code>.
+ </li>
+ </ul>
+ </td>
+ <td rowspan="1" colspan="1"><img src="../images/implicitly_overriding_playedby.png"
+ alt="Implicitly overriding playedBy" /></td>
+ </tr>
+ <tr>
+ <td rowspan="1" colspan="1">
+ <ul>
+ <li>Consider the case where a <strong>nested </strong><code>T1</code> as a role of <code>TOuter</code> is <strong>stacked</strong>
+ on a base team <code>TB1</code>. Also, <code>T1</code> is a <strong>layered team</strong> over <code>TB1</code>
+ because its role <code>R</code> adapts role <code>TB1.B</code>.
+ <br />
+ In this situation the playedBy relation of role <code>TOuter.T1.R</code> is given by a base-anchored type <code>B&lt;@T1.base&gt;</code>.
+ If furthermore <code>TOuter.T1</code> is subclassed to <code>TOuter.T2</code> which covariantly refines the inherited
+ playedBy declaration to <code>TB2</code>, then <code>TOuter.T2.R</code> will automatically refine the inherited playedBy relation
+ to <code>TB2.B</code> to follow the new interpretation of the <code>base</code> anchor.
+ </li>
+ </ul>
+ </td>
+ <td rowspan="1" colspan="1"><img src="../images/implicitly_overriding_playedby_base.png"
+ alt="Implicitly overriding playedBy base" /></td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s1.html" rel="prev">&lt;&lt;&nbsp;&sect;1&nbsp;Teams and Roles</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s3.html" rel="next">&sect;3&nbsp;Callout Binding&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/s3.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/s3.html
new file mode 100644
index 000000000..6b857c4a6
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/s3.html
@@ -0,0 +1,973 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s2.html" rel="prev">&lt;&lt;&nbsp;&sect;2&nbsp;Role Binding</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.html" rel="next">&sect;4&nbsp;Callin Binding&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="chapter" id="s3">
+ <div class="headl">
+ <div class="headr">
+ <h1>&sect;3&nbsp;Callout Binding</h1>
+ </div>
+ </div>
+ <div id="toc-box">
+ <ul class="toc-box">
+ <li><a href="s3.html">&sect;3&nbsp;Callout Binding</a></li>
+ <li><a href="#s3.1">&sect;3.1&nbsp;Callout method binding</a></li>
+ <li><a href="#s3.2">&sect;3.2&nbsp;Callout parameter mapping</a></li>
+ <li><a href="#s3.3">&sect;3.3&nbsp;Lifting and lowering</a></li>
+ <li><a href="#s3.4">&sect;3.4&nbsp;Overriding access restrictions</a></li>
+ <li><a href="#s3.5">&sect;3.5&nbsp;Callout to field</a></li>
+ </ul>
+ </div>
+ <div class="intro">
+ <h3>Notion of callout binding</h3>
+ <div class="line"></div>
+ <div class="term">callout binding</div>
+ <div class="termdesc">A callout binding declares that a method call to a role
+ object may be <strong>forwarded</strong> to a base method of the associated
+ base object <em>(the role object "calls out" to the base)</em>.
+ </div>
+ <div class="line"></div>
+ <div class="term">declarative completeness</div>
+ <div class="termdesc"> Even if a role class does not implement all needed methods,
+ but forwards some to its base, also these methods must be declared
+ within the role.
+ Secondly, no forwarding occurs, unless explicitly declared by a callout binding.
+ </div>
+ <div class="line"></div>
+ <div class="term">expected/provided</div>
+ <div class="termdesc"> A callout binding binds an <strong>expected</strong> method of the role
+ class (needed but not implemented here) to a <strong>provided</strong>
+ method of the base class.
+ </div>
+ <div class="line"></div>
+ </div>
+ <div class="sect depth2" id="s3.1">
+ <h2 class="sect">&sect;3.1&nbsp;Callout method binding<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;3</a></span></h2>
+ <div class="syntaxlink"><a href="sA.html#sA.3.2" title="&sect;A.3.2&nbsp;CalloutBinding"
+ class="syntax">&rarr;&nbsp;Syntax&nbsp;&sect;A.3.2</a></div>
+ <p>A role class may acquire the implementation for any of its
+ (expected) methods by declaring a <strong>callout</strong> binding.
+
+ </p>
+ <div class="subsect depth3" id="s3.1.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Prerequisite: Class binding</span></h4>
+ <p>A callout binding requires the enclosing class to be a role class
+ bound to a base class according to <a href="s2.html#s2.1" title="&sect;2.1&nbsp;playedBy relation" class="sect">&sect;2.1</a>.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.1.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Definition</span></h4>
+ <p>A callout binding maps an abstract role method ("expected method")
+ to a concrete base method ("provided method").
+ It may appear within the role class at any place where feature
+ declarations are allowed. It is denoted by
+
+ </p>
+ <div class="listing plain"><pre><i>expected_method_designator</i> <b>-&gt;</b> <i>provided_method_designator;</i></pre></div>
+ <p>The effect is that any call to the role method will be forwarded to the
+ associated base object using the provided base method.
+
+ </p>
+ <h5 class="listing">Example code (Callout):</h5>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>team</b> <b>class</b> Company {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>public</b> <b>class</b> Employee <b>playedBy</b> Person {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>abstract</b> String getIdentification();</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <span class="comment">// callout binding see below...</span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ <div class="subsect depth3" id="s3.1.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Kinds of method designators</span></h4>
+ <p>A method designator may either be a method name
+
+ </p>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">4</td>
+ <td><pre>getIdentification <em>-&gt;</em> getName;</pre></td>
+ </tr>
+ </table>
+ </div>
+ <p><strong>or</strong>
+ a complete method signature including parameter declarations and
+ return type declaration, but excluding any modifiers and declared exceptions.
+
+ </p>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">4</td>
+ <td><pre>String getIdentification() <em>-&gt;</em> String getName();</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="codecomment">
+ <h5>Effects:</h5>
+ <ul>
+ <li> Line 4 declares a callout binding for the role method <code>getIdentification()</code>,
+ providing an implementation for the abstract method defined in line 3.
+ </li>
+ <li> In combination with the role binding in line 2 this has the following effect:</li>
+ <li> Any call to <code>Employee.getIdentification</code>
+ is forwarded to the method <code>Person.getName</code>.
+ </li>
+ </ul>
+ </div>
+ <p>Both sides of a callout binding must use the same kind of
+ designators, i.e., designators with and without signature may not be mixed.
+ <br />
+ Each method designator must uniquely select one method.
+ If a method designator contains a signature this signature must match exactly with the signature
+ of an existing method, i.e., no implicit conversions are applied for this matching.
+ If overloading is involved, signatures <em>must</em> be used to disambiguate.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.1.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Inheritance of role method declarations</span></h4>
+ <p>The role method being bound by a callout may be declared in the same
+ class as the binding or it may be inherited from a super class or
+ super interface.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.1.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Callout override</span></h4>
+ <p>If an inherited role method is concrete, callout binding regarding this
+ method must use the token "<code>=&gt;</code>" instead of "<code>-&gt;</code>"
+ in order to declare that this binding overrides an existing implementation.
+ <br />
+
+ Using the "<code>=&gt;</code>" operator for an abstract method is an error.
+ <br />
+ It is also an error (and not useful anyway) to callout-bind a method that is
+ implemented in the same class as the binding.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.1.f">
+ <h4 class="subsect">(f)&nbsp;<span class="title">Inheritance of callout bindings</span></h4>
+ <p> Callout bindings are inherited along explicit and implicit inheritance.
+ Inherited callout bindings can be overridden using "<code>=&gt;</code>".
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.1.g">
+ <h4 class="subsect">(g)&nbsp;<span class="title">Duplicate bindings</span></h4>
+ <p>It is an error if a role class has multiple callout bindings for the
+ same role method.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.1.h">
+ <h4 class="subsect">(h)&nbsp;<span class="title">Declared exceptions</span></h4>
+ <p>It is an error if a base method to be bound by <strong>callout</strong>
+ declares in its <code>throws</code> clause any exceptions that
+ are not declared by the corresponding role method.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.1.i">
+ <h4 class="subsect">(i)&nbsp;<span class="title">Shorthand definition</span></h4>
+ <p> A callout binding whose method designators specify
+ full method signatures does not require an existing role method.
+ If no role method is found matching the expected method of
+ such a callout binding, a new method is implicitly generated.
+ The new method is static iff the bound base method is static,
+ and it declares the same exceptions as the bound base method.
+
+ </p>
+ <p>
+ A shorthand callout may optionally declare a <strong>visibility modifier</strong>,
+ otherwise the generated method inherits the visibility modifier of the bound base method.
+ No further modifiers are set.
+ If a callout overrides an inherited method or callout,
+ it must not reduce the visibility of the inherited method/callout.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.1.j">
+ <h4 class="subsect">(j)&nbsp;<span class="title">Inferred callout</span></h4>
+ <p> If a non-abstract role class inherits an abstract method the compiler
+ tries to infer a callout binding for implementing the abstract method.
+ Similarly, if a self-call in a role class cannot be resolved, the compiler
+ tries to infer a callout to resolve the self-call.<br />
+ Inference searches for a method in the bound base class such that
+
+ </p>
+ <ol>
+ <li>both methods have the same name</li>
+ <li>both methods have the same number of arguments</li>
+ <li>each argument of the abstract role method is compatible to the
+ corresponding argument of the base method directly, or using
+ boxing/unboxing or lowering.
+ </li>
+ </ol>
+ <p>
+ Callouts inferred from an interface have <code>public</code> visibility,
+ callouts inferred from a self-call have <code>private</code> visibility.
+
+ </p>
+ <p>
+ Per default inferred callout bindings are disabled, i.e., a compiler
+ must report these as an error. However, a compiler should allow to
+ configure reporting to produce a warning only (which can be suppressed
+ using a <code>@SuppressWarnings("inferredcallout")</code> annotation),
+ or to completely ignore the diagnostic.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.1.k">
+ <h4 class="subsect">(k)&nbsp;<span class="title">Callout to generic method</span></h4>
+ <p>When referring to a generic base method</p>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre>&lt;T&gt; T bm(T a)</pre></td>
+ </tr>
+ </table>
+ </div>
+ <p>a callout binding may either propagate the method's genericity as in</p>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">2</td>
+ <td><pre>&lt;T&gt; T rm(T a) <b>-&gt;</b> T bm(T a);</pre></td>
+ </tr>
+ </table>
+ </div>
+ <p>or it may supply a valid substitution for the type parameter as in</p>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">2</td>
+ <td><pre>String rm(String a) <b>-&gt;</b> String bm(String a);</pre></td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ <p>A callout binding either attaches an implementation to a previously declared method
+ or adds (<a href="#s3.1.i" title="&sect;3.1.(i)&nbsp;Shorthand definition" class="sect">&sect;3.1.(i)</a> above) a forwarding method to a role class.
+ Apart from this implementation, callout-bound methods do not differ from regular methods.
+
+ </p>
+ <p>When we say, a callout binding defines <strong>forwarding</strong> this means that
+ control is passed to the base object. In contrast, by a <strong>delegation</strong>
+ semantics control <em>would</em> remain at the role object, such that self-calls
+ would again be dispatched starting at the role. Callout bindings on
+ their own do not support delegation. However, in conjunction with method
+ overriding by means of callin bindings (see <a href="s4.html" title="&sect;4&nbsp;Callin Binding" class="sect">&sect;4</a>)
+ the effect of delegation can easily be achieved.
+
+ </p>
+ </div>
+ <div class="sect depth2" id="s3.2">
+ <h2 class="sect">&sect;3.2&nbsp;Callout parameter mapping<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;3</a></span></h2>
+ <div class="syntaxlink"><a href="sA.html#sA.4.1" title="&sect;A.4.1&nbsp;CalloutParameterMappings"
+ class="syntax">&rarr;&nbsp;Syntax&nbsp;&sect;A.4.1</a></div>
+ <div class="subsect depth3" id="s3.2.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">with clause</span></h4>
+ <p> If the method designators in a callout binding are signatures
+ (not just method names), parameters and return value may
+ be mapped by a <code>with{...}</code> sub-clause. Parameter mappings may only occur if the enclosing role is a class, not an interface.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.2.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Mapping one parameter</span></h4>
+ <p> For each parameter of the provided base method, exactly one parameter
+ mapping defines, which value will actually be passed to
+ the base method. Callout parameter mappings have this form:
+
+ </p>
+ <div class="listing plain"><pre><i>expression</i> <b>-&gt;</b> <i>base_method_parameter_name</i></pre></div>
+ </div>
+ <div class="subsect depth3" id="s3.2.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Result mapping</span></h4>
+ <p>The return value of a callout method may be provided by a result mapping:
+
+ </p>
+ <div class="listing plain"><pre>result <b>&lt;-</b> <i>expression</i></pre></div>
+ <p>The right hand side expression of a result mapping may use the special identifier
+ <code>result</code> to refer to the value returned by the base method.
+ <br />
+ In a method binding with parameter mappings, it is an error to use
+ <code>result</code> as the name of a regular method argument.
+
+ </p>
+ <h5 class="listing">Example code (Callout Parameter Mapping):</h5>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre>Integer absoluteValue(Integer integer) <b>-&gt;</b> <b>int</b> abs(<b>int</b> i) <em><b>with</b> {</em></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> integer.intValue() <b>-&gt;</b> i,</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <em>result</em> <b>&lt;-</b> <b>new</b> Integer(<em>result</em>)</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre><em>}</em></pre></td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ <div class="subsect depth3" id="s3.2.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Visible names</span></h4>
+ <p>Each identifier that appears within the expressions of a parameter
+ mapping must be either:
+
+ </p>
+ <ul>
+ <li>a feature visible in the scope of the role instance.</li>
+ <li>a parameter of the role method (for parameter mappings).</li>
+ <li>the special name <code>result</code> (for result mappings).
+ </li>
+ <li>in a result mapping also the special name <code>base</code> can be used
+ in order to refer to the bound base instance (provided the method being
+ bound is not static).
+ </li>
+ </ul>
+ <p>The names of base method arguments (i.e., names after mapping) are only
+ legal in the position given in <a href="#s3.2.b" title="&sect;3.2.(b)&nbsp;Mapping one parameter"
+ class="sect">&sect;3.2.(b)</a>.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.2.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Implicit parameter mappings</span></h4>
+ <p>If parameter mappings should be omitted the following conditions must hold:
+
+ </p>
+ <ol>
+ <li>each method parameter of the role method must conform to the
+ corresponding parameter of the base method, <em>and</em></li>
+ <li>the result type of the base method must conform to the result type
+ of the role method.
+ </li>
+ </ol>
+ <p>Here conformance includes translation polymorphism (cf. <a href="#s3.3.d" title="&sect;3.3.(d)&nbsp;Typing rules" class="sect">&sect;3.3.(d)</a>).
+ <br />
+ Parameter correspondence without parameter mapping is determined by declaration order not by names.
+ <br />
+ Two adjustments can, however, be performed implicitly:
+
+ </p>
+ <ul>
+ <li>If the role method has more parameters than the base method,
+ unused trailing parameters may be silently ignored.
+ </li>
+ <li>If the role method returns <code>void</code>, any result from
+ the base method may be silently ignored.
+ </li>
+ </ul>
+ </div>
+ <h5 class="listing">Example code (Callout with Parameter Mapping):</h5>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> MyTeamA {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>public</b> <b>abstract</b> <b>class</b> Role1 {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>abstract</b> <b>void</b> payEuro(float euro);</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <b>abstract</b> float earnEuro();</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> <b>void</b> idle(<b>int</b> seconds) { <span class="comment">/* do nothing */</span> };</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> Role1 boss, worker = <span class="comment">// initialization omitted</span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre> <b>public</b> <b>void</b> transaction () {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre> boss.payEuro(worker.earnEuro());</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">10</td>
+ <td><pre> boss.idle(123);</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">11</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">12</td>
+ <td><pre>}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">13</td>
+ <td><pre><b>public</b> <b>class</b> Staff { <span class="comment">// a base class </span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">14</td>
+ <td><pre> <b>public</b> <b>void</b> payDM (float dm) { … };</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">15</td>
+ <td><pre> <b>public</b> float earnDM () { … };</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">16</td>
+ <td><pre> <b>public</b> <b>int</b> doze() { … };</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">17</td>
+ <td><pre> <span class="comment">// other methods omitted</span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">18</td>
+ <td><pre>}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">19</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> MySubTeam <b>extends</b> MyTeamA {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">20</td>
+ <td><pre> <b>public</b> <b>class</b> Role1 <b>playedBy</b> Staff {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">21</td>
+ <td><pre> <b>void</b> payEuro(float euro) <b>-&gt;</b> <b>void</b> payDM(float dm) <b>with</b> {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">22</td>
+ <td><pre> euro * 1.95583f <b>-&gt;</b> dm</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">23</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">24</td>
+ <td><pre> float earnEuro() <b>-&gt;</b> float earnDM () <b>with</b> {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">25</td>
+ <td><pre> result <b>&lt;-</b> result / 1.95583f</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">26</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">27</td>
+ <td><pre> idle <b>=&gt;</b> doze; <span class="comment">// override existing implementation of idle()</span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">28</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">29</td>
+ <td><pre> <b>void</b> doit() {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">30</td>
+ <td><pre> transaction();</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">31</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">32</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="codecomment">
+ <h5>Effects:</h5>
+ <ul>
+ <li>Class <code>MyTeamA</code> is declaratively complete and can be
+ type checked because it only uses methods that are visible or declared within this
+ context. <code>MyTeamA.Role1</code> can, however, not be instantiated, because it is
+ abstract.
+ </li>
+ <li>Line 30 has the normal effect of invoking <code>transaction</code>.
+ </li>
+ <li>When executing <code>transaction</code>, the call of <code>worker.earnEuro()</code>
+ is forwarded to the corresponding base object using method <code>earnDM()</code>
+ (binding declaration in line 24).
+ The result is converted by "<code>result / 1.95583f</code>" (line 25).
+ </li>
+ <li>Within the same execution of <code>transaction</code>, the call of
+ <code>boss.payEuro()</code>
+ is forwarded to the corresponding base object using method <code>payDM()</code>
+ (binding declaration in line 21).
+ The parameter <code>euro</code> is converted by "<code>euro * 1.95583f</code>"
+ (line 22).
+ </li>
+ <li>Method <code>idle</code> is forwarded to <code>doze</code> without any
+ parameter mapping. This requires <code>doze</code> to have a signature
+ that is conformable to the signature of <code>idle</code>.
+ In this case a role parameter and a base result are ignored.<br />
+ Using the <code>=&gt;</code> operator, this binding overrides the existing
+ implementation of <code>idle</code>.
+ </li>
+ </ul>
+ </div>
+ </div>
+ <div class="sect depth2" id="s3.3">
+ <h2 class="sect">&sect;3.3&nbsp;Lifting and lowering<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;3</a></span></h2>
+ <p> (For basic definitions see <a href="s2.html#s2.2" title="&sect;2.2&nbsp;Lowering" class="sect">&sect;2.2</a> and <a href="s2.html#s2.3" title="&sect;2.3&nbsp;Lifting" class="sect">&sect;2.3</a>)
+
+ </p>
+ <div class="subsect depth3" id="s3.3.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Call target translation</span></h4>
+ <p>Invoking a base method due to a callout binding first
+ <strong>lowers</strong> the role object in order to obtain the effective call target.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.3.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Parameter translation</span></h4>
+ <p>Passing a role object as parameter to a callout method implicitly <strong>lowers</strong>
+ this parameter, if the base method declares a corresponding base type parameter.
+ <br />
+ Lifting of callout parameters is not possible.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.3.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Result translation</span></h4>
+ <p> When returning a base object from a callout method where the role
+ method declares the result to be of a role class,
+ this object is implicitly <strong>lifted</strong> to the appropriate role.
+ <br />
+ Lowering the result of a callout binding is not possible.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.3.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Typing rules</span></h4>
+ <p>A parameter mapping (implicit by parameter position or explicit
+ by a <code>with</code> clause) is <strong>well typed</strong> if
+ the left hand side conforms to the right hand side, either by
+
+ </p>
+ <ul>
+ <li>type equality</li>
+ <li>implicit primitive type conversion</li>
+ <li>subtype polymorphism</li>
+ <li>translation polymorphism, here: <em>lowering</em>,
+ </li>
+ <li><em>or</em> by a combination of the above.
+ </li>
+ </ul>
+ <p>A result mapping (implicit or explicit by a <code>with</code> clause)
+ is well typed, if the value at the right hand side conforms to the
+ left hand side according to the rules given above, except that
+ translation polymorphism here applies <em>lifting</em> instead of
+ lowering.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.3.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Role arrays</span></h4>
+ <p>For arrays of roles as parameters <a href="s2.html#s2.2.e" title="&sect;2.2.(e)&nbsp;Lowering of arrays"
+ class="sect">&sect;2.2.(e)</a> applies accordingly.
+ For arrays as a return value <a href="s2.html#s2.3.d" title="&sect;2.3.(d)&nbsp;Lifting of arrays"
+ class="sect">&sect;2.3.(d)</a> applies.
+
+ </p>
+ </div>
+ </div>
+ <div class="sect depth2" id="s3.4">
+ <h2 class="sect">&sect;3.4&nbsp;Overriding access restrictions<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;3</a></span></h2>
+ <p>In contrast to normal access restrictions, method bindings
+ may refer to hidden base methods.
+ This concept is the inverse of encapsulation, hence it is called
+ <strong>decapsulation</strong>.
+ <br />
+ Decapsulation may occur in these positions:
+
+ </p>
+ <ul>
+ <li><code>playedBy</code> declaration (see <a href="s2.html#s2.1.2.c"
+ title="&sect;2.1.2.(c)&nbsp;Base class decapsulation"
+ class="sect">&sect;2.1.2.(c)</a>)
+ </li>
+ <li>base constructor call (see <a href="s2.html#s2.4.2.b" title="&sect;2.4.2.(b)&nbsp;Bound roles"
+ class="sect">&sect;2.4.2.(b)</a>).
+ </li>
+ <li>callout bindings (see next)</li>
+ <li>callout to field (see <a href="#s3.5.e" title="&sect;3.5.(e)&nbsp;Access control" class="sect">&sect;3.5.(e)</a>)
+ </li>
+ <li>base call within a callin method (see <a href="s4.html#s4.6" title="&sect;4.6&nbsp;Overriding access restrictions"
+ class="sect">&sect;4.6</a>)
+ </li>
+ </ul>
+ <div class="subsect depth3" id="s3.4.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Callout to inaccessible base method</span></h4>
+ <p>By means of <strong>callout</strong> bindings it is possible to access
+ methods of a base class regardless of their access modifiers.
+ Method bindings are the only place in a program which may mention otherwise
+ inaccessible methods.
+ Access to the callout method at the role side is controlled by regular mechanisms,
+ based on the declaration of the role method.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.4.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Sealing against decapsulation</span></h4>
+ <p>A base package may be "sealed" which re-establishes the standard Java visibility rules.
+ <br />
+ Sealing is achieved by the corresponding capability of Jar files.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.4.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Warning levels</span></h4>
+ <p>A compiler should signal any occurrence of decapsulation.
+ If a compiler supports to configure warnings this may be used to let the user choose to
+ (a) ignore base class decapsulation, (b) treat it as a warning or even
+ (c) treat it as an error (cf. <a href="s2.html#s2.1.2.c"
+ title="&sect;2.1.2.(c)&nbsp;Base class decapsulation"
+ class="sect">&sect;2.1.2.(c)</a>).
+ <br />
+ Optionally, a batch compiler may support three levels of verbosity with respect to decapsulation:
+
+ </p>
+ <table border="1">
+ <tr>
+ <td rowspan="1" colspan="1"><tt>-nodecapsulation</tt></td>
+ <td rowspan="1" colspan="1">No warnings.</td>
+ </tr>
+ <tr>
+ <td rowspan="1" colspan="1"><em>default</em></td>
+ <td rowspan="1" colspan="1">Warn only if/that access restrictions are overridden.</td>
+ </tr>
+ <tr>
+ <td rowspan="1" colspan="1"><tt>-decapsulation</tt></td>
+ <td rowspan="1" colspan="1">Detailed messages containing the binding and the hidden base method.</td>
+ </tr>
+ </table>
+ </div>
+ <div class="subsect depth3" id="s3.4.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Private methods from super classes</span></h4>
+ <p>If a callout binding shall bind to a private base method, that method
+ must be defined in the exact base class to which the current role
+ class is bound using <code>playedBy</code>. I.e., for private methods
+ <a href="#s3.1.d"
+ title="&sect;3.1.(d)&nbsp;Inheritance of role method declarations"
+ class="sect">&sect;3.1.(d)</a> does not hold.
+ <br />
+ The same holds for private base fields (see below).
+ <br />
+ If a private base feature must indeed be callout-bound, a role class
+ must be defined that is played by the exact base class defining the
+ private feature. Another role bound to a sub-base-class can then
+ be defined as a sub class of the first role. It will inherit the
+ callout binding and through this it can access the desired feature.
+
+ </p>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>class</b> SuperBase {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <em><b>private</b> <b>int</b> secret;</em></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre>}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre><b>public</b> <b>class</b> SubBase <b>extends</b> SuperBase { <span class="comment">/* details omitted */</span> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> MyTeam {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> <b>protected</b> <b>class</b> SuperRole <b>playedBy</b> SuperBase {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> <b>int</b> steal() <b>-&gt;</b> <b>get</b> <b>int</b> <em>secret</em>; <span class="comment">// <span class="green"><strong>OK</strong></span></span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre> <b>protected</b> <b>class</b> SubRole <b>extends</b> SuperRole <b>playedBy</b> SubBase {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">10</td>
+ <td><pre> <b>int</b> steal() <b>-&gt;</b> <b>get</b> <b>int</b> <em>secret</em>; <span class="comment">// <span class="error"><strong>illegal!</strong></span></span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">11</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">12</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ </div>
+ <div class="sect depth2" id="s3.5">
+ <h2 class="sect">&sect;3.5&nbsp;Callout to field<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;3</a></span></h2>
+ <p>Also fields of a base class can be made accessible using a callout binding.
+
+ </p>
+ <div class="subsect depth3" id="s3.5.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Syntax</span></h4>
+ <p>Using one of the callout modifiers <code>get</code> or <code>set</code> a role method
+ can be bound to a field of the role's base class:
+
+ </p>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre>getValue <b>-&gt;</b> <em>get</em> value;</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre>setValue <b>-&gt;</b> <em>set</em> value;</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre><b>int</b> getValue() <b>-&gt;</b> <em>get</em> <b>int</b> value;</pre></td>
+ </tr>
+ </table>
+ </div>
+ <p>where <code>getValue</code>, <code>setValue</code> are abstract role methods of
+ appropriate signatures and <code>value</code> is a field of the bound base class.
+ <br />
+ A longer syntax is available, too (see line 3 above), which uses complete signatures.
+ For the left hand side <a href="#s3.1.c" title="&sect;3.1.(c)&nbsp;Kinds of method designators"
+ class="sect">&sect;3.1.(c)</a> applies, for the
+ right hand side, this longer version prepends the field type to the field name.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.5.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Compatibility</span></h4>
+ <p>A role method bound with the modifier <code>get</code>
+ should have no arguments
+ (it <em>may</em> have arbitrary arguments, which are silently ignored)
+ and should have a return type to which the base field is compatible.
+ A role method returning void will ignore the given value and thus has
+ no effect at all, which will be signaled by a compiler warning.
+ <br />
+ A role method bound with the modifier <code>set</code> must have a first argument
+ that is compatible to the base field's type (additional arguments - if present -
+ are silently ignored) and must not declare a return type.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.5.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Value mapping</span></h4>
+ <p>Values can be mapped similar to parameter mappings in pure method bindings
+ (<a href="#s3.2" title="&sect;3.2&nbsp;Callout parameter mapping" class="sect">&sect;3.2</a>). Such mappings can be used to establish compatibility as required above.
+ <br />
+ In both <code>get</code> and <code>set</code> bindings, the base side value is denoted
+ by the field's name (lines 2 and 4 below).
+
+ </p>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre>Integer getValue() -&gt; <em>get</em> <b>int</b> val</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <em>with</em> { result &lt;- <b>new</b> Integer(val) }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre><b>void</b> setValue(Integer i) -&gt; <em>set</em> <b>int</b> val</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <em>with</em> { i.intValue() -&gt; val }</pre></td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ <div class="subsect depth3" id="s3.5.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Effect</span></h4>
+ <p>Callout-binding a role method to a base field generates an implementation for
+ this role method, by which it acts as a getter or setter for the given
+ field of the associated base object.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.5.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Access control</span></h4>
+ <p>For accessing an otherwise invisible field, the rules for
+ <a href="#s3.4" title="&sect;3.4&nbsp;Overriding access restrictions"
+ class="sect">decapsulation (&sect;3.4)</a> apply accordingly.
+ <br />
+ Recall, that according to
+ <a href="http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#40898"
+ class="ext">JLS &sect;8.3</a>
+ fields may be hidden in sub-classes of a given base class. Therefore, it is relevant to know that a callout to
+ a field will always access the field that is visible in the exact base
+ class of the role class defining the callout. This is especially relevant
+ for accessing private fields.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.5.f">
+ <h4 class="subsect">(f)&nbsp;<span class="title">Shorthand definition</span></h4>
+ <p>Just as in <a href="#s3.1.i" title="&sect;3.1.(i)&nbsp;Shorthand definition" class="sect">&sect;3.1.(i)</a> a shorthand definition allows to introduce
+ a callout field access method without prior abstract declaration.
+ This requires the callout field binding to specify types as in line 3 of <a href="#s3.5.a" title="&sect;3.5.(a)&nbsp;Syntax" class="sect">&sect;3.5.(a)</a> above.
+ The generated access method is static iff the bound base field is static.
+
+ </p>
+ <p>
+ A shorthand callout to field may optionally declare a <strong>visibility modifier</strong>,
+ otherwise the generated method inherits the visibility modifier of the bound base field.
+ No further modifiers are set.
+ If a callout to field overrides an inherited method or callout,
+ it must not reduce the visibility of the inherited method/callout.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.5.g">
+ <h4 class="subsect">(g)&nbsp;<span class="title">Callout override</span></h4>
+ <p>Similar to method callouts a callout to field may override an existing role
+ method if and only if the token <code>=&gt;</code> is used instead of <code>-&gt;</code>
+ (see <a href="#s3.1.e" title="&sect;3.1.(e)&nbsp;Callout override" class="sect">&sect;3.1.(e)</a> and <a href="#s3.1.f" title="&sect;3.1.(f)&nbsp;Inheritance of callout bindings"
+ class="sect">&sect;3.1.(f)</a>).
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.5.h">
+ <h4 class="subsect">(h)&nbsp;<span class="title">Inferred callout</span></h4>
+ <p> If a statement or expression within the body of a bound role class
+ uses a simple name or a name qualified by <code>this</code>
+ which can not be resolved using normal rules,
+ the compiler may infer to use a callout to field instead,
+ given that a field of the required name can be found in the role's declared baseclass.
+
+ </p>
+ <p> If a callout to field has explicitly been declared it is used for the otherwise
+ unresolved name, if and only if:
+
+ </p>
+ <ul>
+ <li>the callout declares a role method name the is constructed from the token "set" for
+ a setter or "get" for a getter plus the field name with capital first letter,
+ </li>
+ <li>the base field referenced by the callout has exactly the required name, and</li>
+ <li>the callout kind (set/get) matches the application of the unresolved name as either
+ the left-hand side of an assignment (set) or as an expression (get).
+ </li>
+ </ul>
+ <p>
+ If a matching callout to field is not found, the compiler generates one automatically,
+ which has <code>private</code> visibility.
+
+ </p>
+ <p>
+ If a callout to field has been inferred it is an error to directly invoke the
+ implicitly generated callout accessor that is formed according to the above rules.
+
+ </p>
+ <p>
+ Per default inferred callout bindings are disabled, i.e., a compiler
+ must report these as an error. However, a compiler should allow to
+ configure reporting to produce a warning only (which can be suppressed
+ using a <code>@SuppressWarnings("inferredcallout")</code> annotation),
+ or to completely ignore the diagnostic. See also <a href="#s3.1.j" title="&sect;3.1.(j)&nbsp;Inferred callout" class="sect">&sect;3.1.(j)</a>.
+
+ </p>
+ </div>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s2.html" rel="prev">&lt;&lt;&nbsp;&sect;2&nbsp;Role Binding</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.html" rel="next">&sect;4&nbsp;Callin Binding&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/s4.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/s4.html
new file mode 100644
index 000000000..ce1406a80
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/s4.html
@@ -0,0 +1,1385 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s3.html" rel="prev">&lt;&lt;&nbsp;&sect;3&nbsp;Callout Binding</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s5.html" rel="next">&sect;5&nbsp;Team Activation&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="chapter" id="s4">
+ <div class="headl">
+ <div class="headr">
+ <h1>&sect;4&nbsp;Callin Binding</h1>
+ </div>
+ </div>
+ <div id="toc-box">
+ <ul class="toc-box">
+ <li><a href="s4.html">&sect;4&nbsp;Callin Binding</a></li>
+ <li><a href="#s4.1">&sect;4.1&nbsp;Callin method binding</a></li>
+ <li><a href="#s4.2">&sect;4.2&nbsp;Callin modifiers (before, after, replace)</a></li>
+ <li><a href="#s4.3">&sect;4.3&nbsp;Base calls</a></li>
+ <li><a href="#s4.4">&sect;4.4&nbsp;Callin parameter mapping</a></li>
+ <li><a href="#s4.5">&sect;4.5&nbsp;Lifting and lowering</a></li>
+ <li><a href="#s4.6">&sect;4.6&nbsp;Overriding access restrictions</a></li>
+ <li><a href="#s4.7">&sect;4.7&nbsp;Callin binding with static methods</a></li>
+ <li><a href="#s4.8">&sect;4.8&nbsp;Callin precedence</a></li>
+ <li><a href="#s4.9">&sect;4.9&nbsp;Callin inheritance</a></li>
+ <li><a href="#s4.10">&sect;4.10&nbsp;Generic callin bindings</a></li>
+ </ul>
+ </div>
+ <div class="intro">
+ <h3>Notion of callin binding</h3>
+ <p>
+ Callin bindings realize a forwarding in the direction opposite to callout bindings
+ (see <a href="s3.html" title="&sect;3&nbsp;Callout Binding" class="sect">&sect;3</a>).
+ Both terms are chosen from the perspective of a role, which controls its communication with
+ an associated base object.
+ Technically, callin bindings are equivalent to weaving additional code (triggers)
+ into existing base methods.
+
+ </p>
+ <div class="line"></div>
+ <div class="term">Callin</div>
+ <div class="termdesc">Methods of a base class may be <strong>intercepted</strong> by a callin binding
+ (<em>the base method "calls into" the role</em>).
+ </div>
+ <div class="line"></div>
+ <div class="term">Before/after/replace</div>
+ <div class="termdesc">The modifiers <strong>before, after, replace</strong> control the composition
+ of original method and callin method.
+ </div>
+ <div class="line"></div>
+ <div class="term">Activation</div>
+ <div class="termdesc">Callin bindings may be active or inactive according to
+ <a href="s5.html" title="&sect;5&nbsp;Team Activation" class="sect">&sect;5</a>.
+ </div>
+ <div class="line"></div>
+ </div>
+ <div class="sect depth2" id="s4.1">
+ <h2 class="sect">&sect;4.1&nbsp;Callin method binding<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;4</a></span></h2>
+ <div class="syntaxlink"><a href="sA.html#sA.3.3" title="&sect;A.3.3&nbsp;Callin binding"
+ class="syntax">&rarr;&nbsp;Syntax&nbsp;&sect;A.3.3</a></div>
+ <div class="subsect depth3" id="s4.1.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Method call interception</span></h4>
+ <p>A role method may intercept calls to a base method by
+ a callin binding.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.1.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Prerequisite: Class binding</span></h4>
+ <p>A callin binding requires the enclosing class to be a role class
+ bound to a base class according to <a href="s2.html#s2.1" title="&sect;2.1&nbsp;playedBy relation" class="sect">&sect;2.1</a>.
+ An <em>unliftable</em> role (see <a href="s2.html#s2.3.4.a" title="&sect;2.3.4.(a)&nbsp;Potential ambiguity"
+ class="sect">&sect;2.3.4.(a)</a>) cannot define
+ callin bindings. In that case callin bindings can only be introduced in sub-roles
+ which (by an appropriately refined <code>playedBy</code> clause) disambiguate the lifting translation.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.1.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Callin declaration</span></h4>
+ <p>A callin binding composes an existing role method with a
+ given base method.
+ It may appear within the role class at any place where feature
+ declarations are allowed. It is denoted by
+
+ </p>
+ <div class="listing plain"><pre><i>role_method_designator</i> <b>&lt;-</b> <i>callin_modifier </i><i>base_method_designator;</i></pre></div>
+ <p>Just like with callout bindings, method designators may
+ or may not contain parameters lists and return type but no modifiers;
+ also, each method designator must exactly and uniquely select one method
+ (cf. <a href="s3.html#s3.1.c"
+ title="&sect;3.1.(c)&nbsp;Kinds of method designators"
+ class="sect">&sect;3.1.(c)</a>).
+ <br />
+ For <em>callin modifiers</em> see <a href="#s4.2"
+ title="&sect;4.2&nbsp;Callin modifiers (before, after, replace)"
+ class="sect">below (&sect;4.2)</a>.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.1.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Multiple base methods</span></h4>
+ <p>Base method designators may furthermore enumerate a
+ list of methods. If multiple base methods are bound in one
+ callin declaration generally all signatures in this binding must be conform.
+ <br />
+ However, <em>extraneous parameters</em> from base methods may be ignored
+ at the role.
+ <br />
+ For <em>result types</em> different rules exist, depending on the
+ applied callin modifier (see next).
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.1.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Named callin bindin</span></h4>
+ <p>Any callin binding may be labeled with a name. The name of a callin binding is used
+ for declaring <em>precedence</em> (<a href="#s4.8" title="&sect;4.8&nbsp;Callin precedence" class="sect">&sect;4.8</a>).
+ A named callin binding <em>overrides</em> any inherited callin binding
+ (explicit and implicit (<a href="s1.html#s1.3.1"
+ title="&sect;1.3.1&nbsp;Acquisition and implicit inheritance of role classes"
+ class="sect">&sect;1.3.1</a>)) with the same name.
+ <br />
+ It is an error to use the same callin name more than once within the same role class.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.1.f">
+ <h4 class="subsect">(f)&nbsp;<span class="title">Callin to final</span></h4>
+ <p>When binding to a final base method, the enclosing role must be played by the exact base class
+ declaring the final method. I.e., callin binding to a final method inherited from the
+ base class's super-class is not allowed. This is motivated by the fact that no sub-class may have
+ a version of a final method with different semantics.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.1.g">
+ <h4 class="subsect">(g)&nbsp;<span class="title">Declared exceptions</span></h4>
+ <p>It is an error if a role method to be bound by callin declares in its <tt>throws</tt> clause
+ any exceptions that are not declared by the corresponding base method(s).
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.1.h">
+ <h4 class="subsect">(h)&nbsp;<span class="title">Method of enclosing class</span></h4>
+ <p>In a <code>before</code> or <code>after</code> callin binding the left hand side may alternatively
+ resolve to a method of an enclosing class rather than the current role.
+
+ </p>
+ </div>
+ </div>
+ <div class="sect depth2" id="s4.2">
+ <h2 class="sect">&sect;4.2&nbsp;Callin modifiers (before, after, replace)<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;4</a></span></h2>
+ <div class="subsect depth3" id="s4.2.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Method composition</span></h4>
+ <p>The kind of method composition is controlled by adding one
+ of the modifiers <strong>before, after</strong> or <strong>replace</strong> after the
+ "<code>&lt;-</code>" token of the binding declaration.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.2.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Additive composition</span></h4>
+ <p>The <code>before</code> and <code>after</code> modifiers have the
+ effect of adding a call to the role method at the beginning or end
+ of the base method, resp.<br />
+ In this case no data are transferred from the role to the base,
+ so if the role method has a result, this will always be ignored.
+
+ </p>
+ <h5 class="listing">Example code (Callin):</h5>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>team</b> <b>class</b> Company {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>protected</b> <b>class</b> Employee <b>playedBy</b> Person {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>public</b> <b>void</b> recalculateIncome() { ... }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> recalculateIncome <em><b>&lt;-</b> after</em> haveBirthday; <span class="comment">// callin binding</span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="codecomment">
+ <p>Line 4 declares a callin binding for the role method <code>recalculateIncome()</code>
+ defined in line 3. In combination with the role binding in line 2 this has the following effect:
+
+ </p>
+ <ul>
+ <li><strong>After</strong> every call of the method <code>Person.haveBirthday</code>
+ the method <code>Company.recalculateIncome</code> is called.
+ </li>
+ </ul>
+ </div>
+ </div>
+ <div class="subsect depth3" id="s4.2.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Replacing composition</span></h4>
+ <p>The <code>replace</code> modifier causes <em>only</em> the role method to be
+ invoked, replacing the base method.
+ <br />
+ In this case, if the base method declares a result, this should be provided by the role method.
+ Special cases of return values in callin bindings are discussed in <a href="#s4.3.e" title="&sect;4.3.(e)&nbsp;Fragile callin binding"
+ class="sect">&sect;4.3.(e)</a></p>
+ </div>
+ <div class="subsect depth3" id="s4.2.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Callin methods</span></h4>
+ <p>Role methods to be bound by a callin replacement binding must have
+ the modifier <code>callin</code>. This modifier is only allowed for methods
+ of a role class.<br />
+ A method with the <code>callin</code> modifier can only be called
+
+ </p>
+ <ul>
+ <li>via a callin replace binding</li>
+ <li>by a <code>super</code> or <code>tsuper</code> call from an overriding callin method.
+ </li>
+ </ul>
+ <p>It is illegal for a <code>callin</code> method
+ </p>
+ <ul>
+ <li>to be called directly,</li>
+ <li>to be bound using a callout binding, and</li>
+ <li>to be bound to a base method using a <code>before</code> or <code>after</code> callin binding.
+ </li>
+ </ul>
+ <p>Despite these rules a second level role &mdash; which is played by the current role &mdash;
+ can intercept the execution of a callin method using any form of callin binding.</p>
+ <p>A callin method cannot override a regular method and vice versa, however,
+ overriding one callin method with another callin method is legal and
+ dynamic binding applies to callin method just like regular methods.
+ <br />
+ A callin method must not declare its visibility using any of the modifiers <code>public</code>,
+ <code>protected</code> or <code>private</code>. Since callin methods can only be invoked via callin bindings
+ such visibility control would not be useful.
+
+ </p>
+ </div>
+ </div>
+ <div class="sect depth2" id="s4.3">
+ <h2 class="sect">&sect;4.3&nbsp;Base calls<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;4</a></span></h2>
+ <div class="syntaxlink"><a href="sA.html#sA.5.3" title="&sect;A.5.3&nbsp;BaseCall" class="syntax">&rarr;&nbsp;Syntax&nbsp;&sect;A.5.3</a></div>
+ <p>Role methods with a <code>callin</code> modifier should contain
+ a <em>base call</em> which uses the special name <code>base</code>
+ in order to invoke the original base method (original means: before replacement).
+
+ </p>
+ <div class="subsect depth3" id="s4.3.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Syntax</span></h4>
+ <p>The syntax for base calls is <code>base.m()</code>,
+ which is in analogy to super calls.
+ A <code>base.m()</code> call must use the same name and signature
+ as the enclosing method. This again follows the rule, that roles
+ should never explicitly use base names, except in binding declarations.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.3.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Missing base call</span></h4>
+ <p>For each callin method, the compiler uses some flow analysis to check whether
+ a base call will be invoked on each path of execution (analysis is very similar
+ to the analysis for definite assignment regarding final variables -
+ <a href="http://java.sun.com/docs/books/jls/third_edition/html/defAssign.html"
+ class="ext">JLS &sect;16</a>).
+ The compiler will issue a warning if a base call is missing either
+ on each path (definitely missing) or on some paths (potentially missing).
+ Instead of directly invoking a base call, a callin method may also call
+ its explicit or implicit super version using <code>super.m()</code> or <code>tsuper.m()</code> (see <a href="s1.html#s1.3.1.f" title="&sect;1.3.1.(f)&nbsp;tsuper" class="sect">&sect;1.3.1.(f)</a>).
+ In this case the flow analysis will transitively include the called super/tsuper version.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.3.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Duplicate base call</span></h4>
+ <p>If a callin method contains several base calls, the compiler gives
+ a warning if this will result in duplicate base call invocations on all
+ paths (definitely duplicate) or on some paths (potentially duplicate).
+ Again super/tsuper calls are included in the flow analysis (see 4.3(b)).
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.3.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Parameter tunneling</span></h4>
+ <p>If a base method has more parameters
+ than a callin method to which it is composed, additional
+ parameters are implicitly passed unchanged from the original
+ call to the base call (original means: before interception).
+ I.e., a call <code>base.m()</code> may invisibly pass additional
+ parameters that were provided by the caller, but are hidden from the
+ role method.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.3.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Fragile callin binding</span></h4>
+ <p>If a role method returns void, but the bound base method declares a
+ non-void result, this is reported as a <em>fragile callin binding</em>:
+ The result can still be provided by the base call, but omitting the
+ base call may cause problems depending on the return type:
+
+ </p>
+ <ul>
+ <li>For reference return types <code>null</code> will be returned
+ in this case.
+ </li>
+ <li>In the case of primitive return types this will cause a
+ <code>ResultNotProvidedException</code> at run-time.
+ </li>
+ </ul>
+ <p>It is an error if a callin method involved in a fragile callin binding
+ has definitely no base call.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.3.f">
+ <h4 class="subsect">(f)&nbsp;<span class="title">Base super calls</span></h4>
+ <p>If a callin method <code>rm</code> is bound to a base method <code>B1.m</code>
+ that in turn overrides an inherited method <code>B0.m</code>
+ (<code>B0</code> is a super class of <code>B1</code>),
+ the callin method may use a special form of a base call denoted as
+
+ </p>
+ <div class="listing plain"><pre><strong>base.super</strong>.rm();</pre></div>
+ <p>Such base super call invokes the super method of the bound base method,
+ here <code>B0.m</code>. This invocation is not affected by any further callin binding.
+
+ </p>
+ <p>A base super call bypasses both the original method <code>B1.m</code> and
+ also other callin bindings that would be triggered by a regular base call.
+ For this reason any application of this construct is flagged by a decapsulation warning
+ (see <a href="s3.html#s3.4" title="&sect;3.4&nbsp;Overriding access restrictions"
+ class="sect">&sect;3.4</a>).
+
+ </p>
+ </div>
+ <div class="note">
+ <h5>Comment:</h5>
+ Base calls can occur in callin methods that are not
+ yet bound. These methods have no idea of the names of base methods that
+ a sub-role will bind to them. Also multiple base methods may be bound
+ to the same callin method.
+ Hence the use of the role method's own name and signature.
+ The language implementation translates the method name and signature
+ back to the base method that has originally been invoked.
+
+ </div>
+ <h5 class="listing">Example code (Base Call):</h5>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>class</b> ValidatorRole <b>playedBy</b> Po<b>int</b> {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <em>callin</em> <b>void</b> checkCoordinate(<b>int</b> value) {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>if</b> (value &lt; 0)</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <em>base</em>.checkCoordinate(-value);</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> else</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> <em>base</em>.checkCoordinate(value);</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre> checkCoordinate <b>&lt;-</b> <b>replace</b> setX, setY;</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="codecomment">
+ <h5>Effects:</h5>
+ <ul>
+ <li>Line 2 defines a callin method which is bound to two methods
+ of the base class <code>Point</code> (see line 8).
+ </li>
+ <li>The value passed to either setX or setY is checked if it is
+ positive (line 3).
+ </li>
+ <li>Lines 4 and 6 show calls of the original method (base calls).
+ While line 6 passes the original value, in the negative case (line 4)
+ the passed value is made positive.
+ </li>
+ </ul>
+ </div>
+ </div>
+ <div class="sect depth2" id="s4.4">
+ <h2 class="sect">&sect;4.4&nbsp;Callin parameter mapping<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;4</a></span></h2>
+ <div class="subsect depth3" id="s4.4.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">General case parameter mapping</span></h4>
+ <p>The rules for mapping callin parameters and result type
+ are mainly the same as for callout bindings (<a href="s3.html#s3.2" title="&sect;3.2&nbsp;Callout parameter mapping"
+ class="sect">&sect;3.2</a>)
+ except for reversing the <code>-&gt;</code> and <code>&lt;-</code> tokens and
+ swapping left hand side and right hand side.
+ <br />
+ Callin bindings using <code>before</code> have no result mapping.
+ For <code>result</code> in <code>after</code> callin bindings
+ see <a href="#s4.4.c"
+ title="&sect;4.4.(c)&nbsp;Mapping the result of a base method"
+ class="sect">&sect;4.4.(c)</a> below.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.4.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Restrictions for callin replace bindings</span></h4>
+ <p>The right-hand side of a parameter mapping may either be
+ the simple name of a base method argument without further computation,
+ or an arbitrary expression <em>not</em> containing any base method argument.
+ <br />
+ Each base method argument must either appear as a simple name in exactly one parameter mapping
+ or not be mapped at all. In the latter case, the original argument is "tunneled" to
+ the base call, meaning, the callin method does not see the argument, but it is passed
+ to the base method as expected.
+ <br />
+ If the base method declares a result, then
+
+ </p>
+ <ul>
+ <li>if the role method also declares a result, <code>result</code> must be mapped to itself:
+ <br /><code>result -&gt; result</code></li>
+ <li>if the role method does not declare a result, an arbitrary expression may be mapped to result:
+ <br /><code><em>expression</em> -&gt; result</code><br />
+ If in this situation no result mapping exists, the result of the base call
+ is "tunneled" and passed to the original caller (see <a href="#s4.3.e" title="&sect;4.3.(e)&nbsp;Fragile callin binding"
+ class="sect">
+ fragile callin binding (&sect;4.3.(e))</a> above).
+
+ </li>
+ </ul>
+ <p>These rules ensure that these bindings are reversible
+ for the sake of base calls (<a href="#s4.3" title="&sect;4.3&nbsp;Base calls" class="sect">&sect;4.3</a>).
+
+ </p>
+ <p>As stated above a fragile callin binding (<a href="#s4.3.e" title="&sect;4.3.(e)&nbsp;Fragile callin binding"
+ class="sect">&sect;4.3.(e)</a>)
+ is not allowed with a callin method that definitely has no base call
+ (<a href="#s4.3.b" title="&sect;4.3.(b)&nbsp;Missing base call" class="sect">&sect;4.3.(b)</a>). A callin replace binding is not fragile if it provides
+ the base result using a result mapping.
+
+ </p>
+ <p>A callin method bound with replace to a base method returning
+ void must not declare a non-void result.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.4.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Mapping the result of a base method</span></h4>
+ <p>In an <code>after</code> callin binding, the right-hand side
+ of a parameter mapping may use the identifier <code>result</code>
+ to refer to the result of the base method.
+
+ </p>
+ <p>
+ An <code>after</code> callin binding
+ can, however, not <em>influence</em> the result of the base method,
+ thus mappings with the <code>-&gt;</code> token are not allowed for after callin bindings.
+ For <code>before</code> mappings using the <code>-&gt;</code> token is already ruled out by <a href="#s4.4.a" title="&sect;4.4.(a)&nbsp;General case parameter mapping"
+ class="sect">&sect;4.4.(a)</a></p>
+ </div>
+ <div class="subsect depth3" id="s4.4.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Multiple base methods</span></h4>
+ <p>A callin binding listing more than one base method may use parameter
+ mappings with only the following restriction: if any base parameter should be mapped this parameter
+ must have the same name and type in all listed base method designators.
+ However, different parameter mappings for different base methods bound to the same role method
+ can be defined if separate callin bindings are used.
+
+ </p>
+ </div>
+ </div>
+ <div class="sect depth2" id="s4.5">
+ <h2 class="sect">&sect;4.5&nbsp;Lifting and lowering<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;4</a></span></h2>
+ <p>For basic definition see <a href="s2.html#s2.2" title="&sect;2.2&nbsp;Lowering" class="sect">&sect;2.2</a>
+ and <a href="s2.html#s2.3" title="&sect;2.3&nbsp;Lifting" class="sect">&sect;2.3</a>.
+ <br />
+ (The following rules are reverse forms of those from <a href="s3.html#s3.3" title="&sect;3.3&nbsp;Lifting and lowering"
+ class="sect">&sect;3.3</a>)
+
+ </p>
+ <div class="subsect depth3" id="s4.5.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Call target translation</span></h4>
+ <p>Invoking a role method due to a callin binding first
+ <strong>lifts</strong> the base object to the role class of the
+ callin binding, in order to obtain the effective call target.
+ This is why callin bindings cannot be defined in roles that are <em>unliftable</em>
+ due to <em>potential binding ambiguity</em> (see <a href="#s4.1.b" title="&sect;4.1.(b)&nbsp;Prerequisite: Class binding"
+ class="sect">&sect;4.1.(b)</a>
+ above and <a href="s2.html#s2.3.4.a" title="&sect;2.3.4.(a)&nbsp;Potential ambiguity"
+ class="sect">&sect;2.3.4.(a)</a>).
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.5.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Parameter translation</span></h4>
+ <p>During callin execution, each parameter for which the role method expects a role
+ object is implicitly <strong>lifted</strong> to the declared role class.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.5.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Result translation</span></h4>
+ <p>Returning a role object from a callin method implicitly
+ <strong>lowers</strong> this object.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.5.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Typing rules</span></h4>
+ <p>A parameter mapping (implicit by parameter position or explicit
+ by a <code>with</code> clause) is <strong>well typed</strong> if
+ the right hand side conforms to the left hand side, either by
+
+ </p>
+ <ul>
+ <li>type equality</li>
+ <li>implicit primitive type conversion</li>
+ <li>subtype polymorphism</li>
+ <li>translation polymorphism, here: <em>lifting</em>;<br />
+ however, within <code>replace</code> bindings step 1 of the smart lifting
+ algorithm (<a href="s2.html#s2.3.3.a" title="&sect;2.3.3.(a)&nbsp;Static adjustment"
+ class="sect">&sect;2.3.3.(a)</a>) is not applicable
+ </li>
+ <li><em>or</em> by a combination of the above.
+ </li>
+ </ul>
+ <p>A result mapping (implicit or explicit by a <code>with</code> clause)
+ is well typed, if the value at the left hand conforms to the
+ right hand side according to the rules given above, except that
+ translation polymorphism here applies <em>lowering</em> instead of
+ lifting.
+ </p>
+ <p>
+ These rules define <strong>translation polymorphism</strong> as introduced in
+ <a href="s2.html#s2.3" title="&sect;2.3&nbsp;Lifting" class="sect">&sect;2.3</a>.
+
+ </p>
+ <p>Additionally, in a <code>replace</code> callin binding compatibility of parameters and return
+ types must hold in both directions.
+ Thus, from the above list of conversions a replace binding cannot apply subtype polymorphism
+ nor primitive type conversion.
+ If more flexibility is desired, type parameters can be used as defined in <a href="#s4.10" title="&sect;4.10&nbsp;Generic callin bindings" class="sect">&sect;4.10</a>.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.5.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Role arrays</span></h4>
+ <p>For arrays of roles as parameters <a href="s2.html#s2.3.d" title="&sect;2.3.(d)&nbsp;Lifting of arrays"
+ class="sect">&sect;2.3.(d)</a> applies
+ accordingly. For arrays as return value <a href="s2.html#s2.2.e" title="&sect;2.2.(e)&nbsp;Lowering of arrays"
+ class="sect">&sect;2.2.(e)</a> applies.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.5.f">
+ <h4 class="subsect">(f)&nbsp;<span class="title">Base calls</span></h4>
+ <p>For base calls these rules are reversed again, i.e., a
+ base call behaves like a callout binding.
+
+ </p>
+ </div>
+ </div>
+ <div class="sect depth2" id="s4.6">
+ <h2 class="sect">&sect;4.6&nbsp;Overriding access restrictions<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;4</a></span></h2>
+ <p>Callin bindings may also mention inaccessible methods
+ (cf. decapsulation <a href="s3.html#s3.4" title="&sect;3.4&nbsp;Overriding access restrictions"
+ class="sect">&sect;3.4</a>).
+ Due to the reverse call direction this is relevant only for base calls within
+ <code>callin</code> methods.
+ Base calls have unrestricted access to protected base methods.
+ Accessing a base method with private or default visibility is
+ also allowed, but signaled by a compiler warning.
+
+ </p>
+ <div class="note">
+ <h5>Comment:</h5>
+ A base call to an inaccessible base method is considered harmless,
+ since this is the originally intended method execution.
+
+ </div>
+ <div class="subsect depth3" id="s4.6.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Private methods from super classes</span></h4>
+ <p><em>(Cf. <a href="s3.html#s3.4.d"
+ title="&sect;3.4.(d)&nbsp;Private methods from super classes"
+ class="sect">&sect;3.4.(d)</a>)</em>
+ If a callin binding shall bind to a private base method, that method
+ must be defined in the exact base class to which the current role
+ class is bound using <code>playedBy</code>.
+ <br />
+ If a private base feature must indeed be callin-bound, a role class
+ must be defined that is played by the exact base class defining the
+ private feature. Another role bound to a sub-base-class can then
+ be defined as a sub class of the first role. It will inherit the
+ callin binding and through this it can access the desired feature.
+
+ </p>
+ </div>
+ </div>
+ <div class="sect depth2" id="s4.7">
+ <h2 class="sect">&sect;4.7&nbsp;Callin binding with static methods<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;4</a></span></h2>
+ <p>The normal case of callin bindings refers to non-static methods on both
+ sides (base and role). Furthermore, in Java inner classes can not define
+ static methods. Both restrictions are relaxed by the following rules:
+
+ </p>
+ <div class="subsect depth3" id="s4.7.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Static role methods</span></h4>
+ <p>A role class may define static methods (see also <a href="s1.html#s1.2.1.f" title="&sect;1.2.1.(f)&nbsp;Static role methods"
+ class="sect">&sect;1.2.1.(f)</a>).
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.7.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Binding static to static</span></h4>
+ <p>A callin binding may bind a static role method to one or more
+ static base methods. It is, however, an error to bind a static base method to a non-static role method,
+ because such binding would require to lift a base object that is not provided.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.7.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">before/after</span></h4>
+ <p>In addition to the above, <code>before</code> and <code>after</code>
+ callin bindings may also bind a static role method to non-static base methods.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.7.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">replace</span></h4>
+ <p>In contrast to <a href="#s4.7.c" title="&sect;4.7.(c)&nbsp;before/after" class="sect">&sect;4.7.(c)</a> above, a <code>replace</code> callin binding
+ cannot bind a static role method to a non-static base method.
+
+ </p>
+ </div>
+ <p>The following table summarizes the combinations defined above:
+
+ </p>
+ <table border="2" class="sep" cellpadding="5" width="80%">
+ <tr class="z1">
+ <td colspan="2" rowspan="2" align="right"><strong>&lt;-</strong>&nbsp;&nbsp;
+ </td>
+ <td colspan="2" align="center" rowspan="1"><strong>base method</strong></td>
+ </tr>
+ <tr class="z1">
+ <td align="center" rowspan="1" colspan="1">static</td>
+ <td align="center" rowspan="1" colspan="1">non-static</td>
+ </tr>
+ <tr class="z2">
+ <td rowspan="2" align="center" class="z1" colspan="1"><strong>role<br />method</strong></td>
+ <td align="center" class="z1" rowspan="1" colspan="1">static</td>
+ <td rowspan="1" colspan="1"><span class="green">OK</span></td>
+ <td rowspan="1" colspan="1"><code>before/after</code>: <span class="green">OK</span><br /><code>replace</code>: <span class="error">illegal</span></td>
+ </tr>
+ <tr class="z2">
+ <td align="center" class="z1" rowspan="1" colspan="1">non-static</td>
+ <td rowspan="1" colspan="1"><span class="error">illegal</span></td>
+ <td rowspan="1" colspan="1"><span class="green">OK</span></td>
+ </tr>
+ </table>
+ <div class="subsect depth3" id="s4.7.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">No overriding</span></h4>
+ <p>Since static methods are not dynamically bound, <i>overriding</i> does not
+ apply in the normal semantics. Regarding callin bindings this has the
+ following consequences (assuming a role <code>RMid</code> played by
+ <code>BMid</code> plus its super-class <code>BSuper</code> and its sub-class
+ <code>BSub</code>.
+
+ </p>
+ <ol>
+ <li>If a static base method <code>BMid.m</code> is bound by a callin binding
+ this has no effect on any method <code>m</code> in <code>BSub</code>.
+ </li>
+ <li>If a callin binding mentions a method <code>m</code> which is not present
+ in <code>BMid</code> but resolves to a static method in <code>BSuper</code>
+ the binding only affects invocations as <code>BMid.m()</code> but not
+ <code>BSuper.m()</code>. If the latter call should be affected, too,
+ the callin binding must appear in a role class bound to <code>BSuper</code>,
+ not <code>BMid</code>.
+ </li>
+ <li>In order to bind two static base methods with equal signatures, one being
+ defined in a sub-class of the other one, two roles have to be defined
+ where one role refines the <code>playedBy</code> clause of the other role
+ (say: <code>public class RSub extends RMid playedBy BSub</code>).
+ Now each role may bind to the static base method accessible in its direct
+ base-class.
+ </li>
+ </ol>
+ </div>
+ </div>
+ <div class="sect depth2" id="s4.8">
+ <h2 class="sect">&sect;4.8&nbsp;Callin precedence<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;4</a></span></h2>
+ <div class="syntaxlink"><a href="sA.html#sA.8" title="&sect;A.8&nbsp;Precedence declaration"
+ class="syntax">&rarr;&nbsp;Syntax&nbsp;&sect;A.8</a></div>
+ <p>If multiple callins from the same team refer to the same base method and also have the same
+ callin modifier (<code>before</code>, <code>after</code> or <code>replace</code>), the order in which
+ the callin bindings shall be triggered has to be declared using a precedence declaration.
+
+ </p>
+ <div class="subsect depth3" id="s4.8.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Precedence declaration</span></h4>
+ <p>A precedence declaration consists of the keyword <code>precedence</code> followed by
+ a list of names referring to callin bindings (see <a href="#s4.1.e" title="&sect;4.1.(e)&nbsp;Named callin bindin" class="sect">&sect;4.1.(e)</a> for named callin bindings).
+ <br />
+ A precedence declaration is only legal within a role or team class.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.8.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Qualified and unqualified names</span></h4>
+ <p>Within a role class a callin binding may be referenced by its unqualified name.
+ A precedence declaration in a team class must qualify the callin name with the name of the declaring
+ role class. A team with nested teams may concat role class names.
+ Elements of a qualified callin name are separated by ".".
+ <br />
+ The callin binding must be found in the role specified by the qualifying prefix or
+ in the enclosing role for unqualified names, or any super class of this role
+ (including implicit super classes <a href="s1.html#s1.3.1"
+ title="&sect;1.3.1&nbsp;Acquisition and implicit inheritance of role classes"
+ class="sect">&sect;1.3.1</a>).
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.8.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Class based precedence</span></h4>
+ <p>At the team level a precedence declaration may contain role class names without
+ explicitly mentioning callin bindings in order to refer to all callin bindings of the role.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.8.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Multiple precedence statements</span></h4>
+ <p>All precedence statements are collected at the outer-most team. At that level all
+ precedence declarations involving the same base method are merged using the
+ C3 algorithm <a href="#fn3-c3-algorithm" class="int">[3]</a>. It is an error to declare
+ incompatible precedence lists that cannot be merged by the C3 algorithm.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.8.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Binding overriding</span></h4>
+ <p>Precedence declarations may conflict with overriding of callin bindings
+ (see <a href="#s4.1.e" title="&sect;4.1.(e)&nbsp;Named callin bindin" class="sect">&sect;4.1.(e)</a>): For each pair of callin bindings of which one
+ callin binding overrides the other one, precedence declarations are not applicable,
+ since dynamic binding will already select exactly one callin binding.
+ <br />
+ It is an error to <i>explicitly mention</i> such a pair of overriding callin bindings in a precedence declaration.
+ <br />
+ When a class-based precedence declaration <i>implicitly refers to</i> a callin binding that is overridden by,
+ or overrides any other callin binding within the same precedence declaration, this does not affect the fact,
+ that the most specific callin binding overrides less specific ones.
+
+ </p>
+ </div>
+ <h5 class="listing">Callin binding example</h5>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>class</b> LogLog<b>in</b> <b>playedBy</b> Data<b>base</b> {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>callin</b> <b>void</b> log (String what) {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> System.out.println("enter " + what);</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> base.log(what.toLowerCase());</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> System.out.println("leave " + what);</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> <b>void</b> log(String what) <b>&lt;-</b> <b>replace</b> <b>void</b> login(String uid, String passwd) </pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre> <b>with</b> { what <b>&lt;-</b> uid }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre>}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">10</td>
+ <td><pre>(<b>new</b> Database()).login("Admin", "Passwd");</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="codecomment">
+ <h5>Effects:</h5>
+ <p>Provided the callin bindings are active (cf. <a href="s5.html" title="&sect;5&nbsp;Team Activation" class="sect">&sect;5</a>) then:
+
+ </p>
+ <ul>
+ <li>the call in line 10 is intercepted by method <code>log</code>
+ of role <code>LogLogin</code>.
+ </li>
+ <li>the call target of <code>log</code> is a role of type
+ <code>LogLogin</code> which is created by lifting the
+ original call target (of type <code>Database</code>) to
+ <code>LogLogin</code>.
+ </li>
+ <li>only parameter <code>uid</code> is passed to <code>log</code>
+ (bound to formal parameter <code>what</code>).
+ </li>
+ <li>within method <code>log</code> the base call (line 4) invokes
+ the original method passing a modified uid (converted to lower case, cf. line 4)
+ and the unmodified password, which is hidden from the callin method due to the
+ parameter mapping in line 8.
+ </li>
+ </ul>
+ </div>
+ </div>
+ <div class="sect depth2" id="s4.9">
+ <h2 class="sect">&sect;4.9&nbsp;Callin inheritance<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;4</a></span></h2>
+ <p>
+ This section defines how callin bindings and callin methods relate to inheritance.
+
+ </p>
+ <div class="sect depth3" id="s4.9.1">
+ <h3 class="sect">&sect;4.9.1&nbsp;Base side inheritance<span class="toplink"><a href="#s4.9">&uarr;&nbsp;&sect;4.9</a></span></h3>
+ <p>
+ Generally, a callin binding affects all sub-types of its bound base.
+ Specifically, if a role type <code>R</code> bound to a base type <code>B</code>
+ defines a callin binding <code>rm &lt;- <i>callin_modifier</i> bm</code>,
+ the following rules apply:
+
+ </p>
+ <div class="subsect depth4" id="s4.9.1.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Effect on sub-classes</span></h4>
+ <p>The callin binding also effects instances of any type <code>BSub</code>
+ that is a sub-type of <code>B</code>.
+ If <code>BSub</code> overrides the bound base method <code>bm</code>,
+ the overridden version is generally affected, too.
+ However, if <code>bm</code> covariantly redefines the return type from its
+ super version, the callin binding has to explicitly specify if the covariant
+ sub-class version should be affected, too (see <a href="#s4.9.3.b"
+ title="&sect;4.9.3.(b)&nbsp;Capturing covariant base methods"
+ class="sect">&sect;4.9.3.(b)</a>).
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s4.9.1.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">No effect on super-classes</span></h4>
+ <p>The binding never affects an instance of any super-type of <code>B</code>
+ even if the method <code>bm</code> is inherited from a super-class
+ or overrides an inherited method.
+ This ensures that dispatching to a role method due to a callin binding
+ always provides a base instance that has at least the type declared in the role's
+ <code>playedBy</code> clause.
+
+ </p>
+ </div>
+ <p>
+ For corresponding definitions regarding static methods see <a href="#s4.7.e" title="&sect;4.7.(e)&nbsp;No overriding" class="sect">&sect;4.7.(e)</a>.
+
+ </p>
+ </div>
+ <div class="sect depth3" id="s4.9.2">
+ <h3 class="sect">&sect;4.9.2&nbsp;Role side inheritance<span class="toplink"><a href="#s4.9">&uarr;&nbsp;&sect;4.9</a></span></h3>
+ <p>
+ Any sub-type of <code>R</code> inherits the given callin binding
+ (for overriding of bindings see <a href="#s4.8.e" title="&sect;4.8.(e)&nbsp;Binding overriding" class="sect">&sect;4.8.(e)</a>).
+ If the sub-role overrides the role method <code>rm</code> this will be considered
+ for dynamic dispatch when the callin binding is triggered.
+
+ </p>
+ </div>
+ <div class="sect depth3" id="s4.9.3">
+ <h3 class="sect">&sect;4.9.3&nbsp;Covariant return types<span class="toplink"><a href="#s4.9">&uarr;&nbsp;&sect;4.9</a></span></h3>
+ <p>
+ Since version 5, Java supports the covariant redefinition of a method's return type
+ (see <a href="http://java.sun.com/docs/books/jls/third_edition/html/classes.html#8.4.5"
+ class="ext">JLS 8.4.5</a>).
+ This is <em>not</em> supported for <code>callin</code> methods (<a href="#s4.9.3.a" title="&sect;4.9.3.(a)&nbsp;No covariant callin methods"
+ class="sect">&sect;4.9.3.(a)</a>).
+ If base methods with covariant redefinition of the return type are to be bound by a callin binding
+ the subsequent rules ensure that type safety is preserved.
+ Two <em>constraints</em> have to be considered:
+
+ </p>
+ <ol>
+ <li>
+ When a callin method issues a base-call or calls its tsuper version,
+ this call must produce a value whose type is compatible to the
+ enclosing method's declared return type.
+
+ </li>
+ <li>
+ If a replace-bound role method returns a value that is not the result of a base-call,
+ it must be ensured that the return value actually satisfies the declared signature of
+ the bound base method.
+
+ </li>
+ </ol>
+ <div class="subsect depth4" id="s4.9.3.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">No covariant callin methods</span></h4>
+ <p>
+ A method declared with the <code>callin</code> modifier that overrides an inherited method
+ must not redefine the return type with respect to the inherited method.
+ This reflects that fact that an inherited callin binding should remain type-safe
+ while binding to the new, overriding role method.
+ Binding a covariant role method to the original base method would break constraint (1) above.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s4.9.3.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Capturing covariant base methods</span></h4>
+ <p>
+ If a callin binding should indeed affect not only the specified base method
+ but also overriding versions which covariantly redefine the return type,
+ the binding must specify the base method's return type with a "+" appended
+ to the type name as in
+ </p>
+ <div class="listing plain"><pre><b>void</b> rm() <b>&lt;-</b> <b>before</b> <em>RT+</em> bm();</pre></div>
+ <p>Without the "+" sign the binding would only capture base methods whose
+ return type is exactly <code>RT</code>;
+ by appending "+" also sub-types of <code>RT</code>
+ are accepted as the declared return type.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s4.9.3.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Covariant replace binding</span></h4>
+ <p>
+ When using the syntax of <a href="#s4.9.3.b"
+ title="&sect;4.9.3.(b)&nbsp;Capturing covariant base methods"
+ class="sect">&sect;4.9.3.(b)</a> to capture base methods with
+ covariant return types in a callin binding with the <code>replace</code> modifier,
+ the role method must be specified using a free type parameter as follows:
+ </p>
+ <div class="listing plain"><pre><em>&lt;E <b>extends</b> RT&gt; E</em> rm() <b>&lt;-</b> <b>replace</b> RT+ bm();</pre></div>
+ <p>The role method <code>rm</code> referenced by this callin binding must use the same style
+ of return type using a type parameter.
+ The only possible non-null value of type <code>E</code>
+ to be returned from such method is the value provided by a base-call or a tsuper-call.<br />
+ This rule enforces the constraint (2) above.<br />
+ Note that this rule is further generalized in <a href="#s4.10" title="&sect;4.10&nbsp;Generic callin bindings" class="sect">&sect;4.10</a>.
+
+ </p>
+ <h5 class="listing">Binding a parametric role method</h5>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>class</b> SuperBase {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> SuperBase foo() { <b>return</b> this; }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>void</b> check() { System.out.print("OK"); }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre>}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre><b>public</b> <b>class</b> SubBase <b>extends</b> SuperBase {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> @Override</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> SubBase foo() { <b>return</b> this; }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre> <b>void</b> print() { System.out.print("SubBase"); }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre> String test() { </pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">10</td>
+ <td><pre> this.foo().print(); <span class="comment">// print() requires a SubBase</span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">11</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">12</td>
+ <td><pre>}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">13</td>
+ <td><pre></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">14</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> MyTeam {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">15</td>
+ <td><pre> <b>protected</b> <b>class</b> R <b>playedBy</b> SuperBase {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">16</td>
+ <td><pre> <b>callin</b> &lt;E <b>extends</b> SuperBase&gt; E ci() {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">17</td>
+ <td><pre> E result= base.ci();</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">18</td>
+ <td><pre> result.check(); <span class="comment">// check() is available on E via type bound SuperBase</span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">19</td>
+ <td><pre> <b>return</b> result;</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">20</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">21</td>
+ <td><pre> &lt;E <b>extends</b> SuperBase&gt; E ci() <b>&lt;-</b> <b>replace</b> SuperBase+ foo();</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">22</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">23</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="codecomment">
+ <h5>Explanation:</h5>
+ <ul>
+ <li>
+ Method <code>SubBase.foo</code> in line 7 redefines the return type
+ from <code>SuperBase</code> (inherited version) to <code>SubBase</code>,
+ thus clients like the method call in line 10 must be safe to assume
+ that the return value will always conform to <code>SubBase</code>.
+
+ </li>
+ <li>
+ The callin binding in line 21 explicitly captures both versions of <code>foo</code>
+ by specifying <code>SuperBase+</code> as the expected return type.
+ Thus, if an instance of <code>MyTeam</code> is active at the method call
+ in line 10, this call to <code>foo</code> will indeed be intercepted
+ even though this call is statically known to return a value of type <code>SubBase</code>.
+
+ </li>
+ <li>
+ The callin method in lines 16-20 has a return type which is not known statically,
+ but the return type is represented by the type variable <code>E</code>.
+ Since the base call is known to have the exact same signature as its enclosing
+ method, the value provided by the base call is of the same type <code>E</code>
+ and thus can be safely returned from <code>ci</code>.
+ <em>Note,</em> that no other non-null value is known to have the type <code>E</code>.
+
+ </li>
+ <li>
+ By specifying <code>SuperBase</code> as an upper bound for the type <code>E</code>
+ the callin method <code>ci</code> may invoke
+ any method declared in type <code>SuperBase</code>
+ on any value of type <code>E</code>. For an example see the call to <code>check</code>
+ in line 18.
+
+ </li>
+ </ul>
+ <p><em>
+ As an aside note that the above example uses type <code>SuperBase</code>
+ in an undisciplined way: within role <code>R</code> this type is bound
+ using <code>playedBy</code><strong> and</strong> the same type is also
+ used directly (as the upper bound for <code>E</code>).
+ This is considered bad style and it is prohibited if <code>SuperBase</code>
+ is imported using an base import (<a href="s2.html#s2.1.2.d" title="&sect;2.1.2.(d)&nbsp;Base imports"
+ class="sect">&sect;2.1.2.(d)</a>).
+ Here this rule is neglegted just for the purpose of keeping the example small.
+ </em></p>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="sect depth2" id="s4.10">
+ <h2 class="sect">&sect;4.10&nbsp;Generic callin bindings<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;4</a></span></h2>
+ <p>
+ As mentioned in <a href="#s4.5.d" title="&sect;4.5.(d)&nbsp;Typing rules" class="sect">&sect;4.5.(d)</a> replace bindings do not support subtype polymorphism
+ in either direction.
+ On the other hand, binding several base methods to the same <code>callin</code> method
+ may require some more flexibility if these base methods have different signatures.
+ This is where type parameter come to the rescue to allow for generic <code>callin</code> methods
+ and their binding to base methods with different signatures.<br />
+ Note that this rule is a generalization of rule <a href="#s4.9.3.c" title="&sect;4.9.3.(c)&nbsp;Covariant replace binding"
+ class="sect">&sect;4.9.3.(c)</a>.
+
+ </p>
+ <p>
+ Additionally, any callin binding (before,replace,after) may declare one or more type parameters
+ for propagating type parameters of the bound base method(s) (<a href="#s4.10.e" title="&sect;4.10.(e)&nbsp;Propagating type parameters"
+ class="sect">&sect;4.10.(e)</a>).
+
+ </p>
+ <div class="subsect depth3" id="s4.10.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Fresh type parameter</span></h4>
+ <p>
+ If a callin method declares a type parameter <code>&lt;T&gt;</code> for
+ capturing a covariant return type
+ this type <code>T</code>
+ can be used for specifying the type of exactly one parameter or the return type.
+ If a type parameter is used in more than one position of a <code>callin</code> method
+ it is not considered a <em>fresh type parameter</em>
+ and can thus not be bound to a covariant return type (see <a href="#s4.10.d" title="&sect;4.10.(d)&nbsp;Binding to a type parameter"
+ class="sect">&sect;4.10.(d)</a>).
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.10.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Type bounds</span></h4>
+ <p>
+ The type parameter of a callin binding may be bounded by an upper bound as in <code>&lt;T extends C&gt;</code>.
+ In this case <code>T</code> can only be instantiated by types conforming to the upper bound <code>C</code>.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.10.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Generic replace binding</span></h4>
+ <p>
+ A generic <code>callin</code> method according to the above rules is bound using a replace
+ binding that declares the same number of type parameters,
+ where type parameters of the binding and its callin method are identified.
+ If the <code>callin</code> method declares bounds for its type parameters
+ so should the replace binding.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.10.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Binding to a type parameter</span></h4>
+ <p>
+ A fresh type parameter can be used to capture arbitrary types in the base methods to be bound.
+ The type parameter may be instantiated differently for each bound base method.
+ By such type parameter instantiation the types in role and base signatures are actually identical,
+ thus satisfying the requirement of two-way substitutability.
+
+ </p>
+ </div>
+ <p>
+ Within the body of a generic <code>callin</code> method no further rules have to be followed,
+ because the fresh type variable actually guarantees, that the role method cannot replace the
+ original value (initial argument or base-call result) with a different object,
+ because no type exists that is guaranteed to conform to the type parameters.
+ Yet, the type bound allows the role method to invoke methods of the provided object.
+
+ </p>
+ <h5 class="listing">Generic replace binding</h5>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> MyTeam {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>protected</b> <b>class</b> R <b>playedBy</b> Figures {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>callin</b> &lt;E <b>extends</b> Shape, F <b>extends</b> Shape&gt; E ci(F arg) {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> E result= base.ci(arg);</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> <span class="error">result= arg; // illegal, types E and F are incommensurable</span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> <span class="error">arg= result; // illegal, types E and F are incommensurable</span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> <b>int</b> size= arg.getSize(); <span class="comment">// getSize() is availabel on F via type bound Shape</span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre> result.resize(size); <span class="comment"> // resize() is available on E via type bound Shape</span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre> <b>return</b> result; <span class="comment">// only two legal values exist: <code>result</code> and <code>null</code></span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">10</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">11</td>
+ <td><pre> &lt;E <b>extends</b> Shape, F <b>extends</b> Shape&gt; </pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">12</td>
+ <td><pre> E ci(F arg) <b>&lt;-</b> <b>replace</b> Rectangle getBoundingBox(Shape original), </pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">13</td>
+ <td><pre> Rectangle stretch(Square original);</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">14</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">15</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="codecomment">
+ <h5>Explanation:</h5>
+ These declaration generate two version of the <code>callin</code> method <code>ci</code>:
+
+ <ol>
+ <li><code>Rectangle ci (Shape arg)</code></li>
+ <li><code>Rectangle ci (Square arg)</code></li>
+ </ol>
+ Within the <code>callin</code> method the following observations hold:
+
+ <ul>
+ <li>Line 5 is illegal for the first signature as <code>Shape</code> is not conform to <code>Rectangle</code></li>
+ <li>Line 6 is illegal for the second signature as <code>Rectangle</code> is not conform to <code>Square</code></li>
+ <li>Everything else is type-safe.</li>
+ </ul>
+ </div>
+ <div class="subsect depth3" id="s4.10.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Propagating type parameters</span></h4>
+ <p>
+ If a callin binding binds to a generic base method,
+ any type parameter(s) of the base method must be propagated into the role method
+ by declaring the callin binding with type parameters, too.
+ By matching a type parameter of a base method with a type variable
+ of the callin binding, this genericity is propagated through the callin binding.
+
+ </p>
+ <div class="listing frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>class</b> MyBase {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> &lt;T&gt; T getIt(T it) { <b>return</b> it; }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre>}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre><b>team</b> <b>class</b> MyTeam {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> <b>protected</b> <b>class</b> MyRole <b>playedBy</b> MyBase {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> <b>callin</b> &lt;U&gt; U rm(U a) { <b>return</b> base.rm(a); }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> &lt;U&gt; U rm(U a) <b>&lt;-</b> <b>replace</b> U getIt(U it);</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="codecomment">
+ <h5>Explanation:</h5>
+ The callin binding declares a type parameter <code>&lt;U&gt;</code>
+ which is used to match all occurrences of <code>T</code> in the signature of <code>getIt</code>.
+ Thus the implementation of <code>rm</code> uses the type <code>U</code>
+ in exactly the same generic way as <code>getIt</code> uses <code>T</code>.
+
+ </div>
+ </div>
+ </div>
+ <div class="aux" id="aux4.2">
+ <h4 class="aux">Open issues:<span class="toplink"><a href="#s4">&uarr;&nbsp;&sect;4</a></span></h4>
+ <p>The query language for specifying sets of base methods (<a href="#s4.1.d" title="&sect;4.1.(d)&nbsp;Multiple base methods"
+ class="sect">&sect;4.1.(d)</a>)
+ has not been finalized yet. In this version of the OTJLD <a href="s8.html" title="&sect;8&nbsp;Join Point Queries" class="sect">&sect;8</a>
+ acts as a placeholder for the section that will define a join point query language in the future.
+ </p>
+ </div>
+ <div class="aux" id="aux4.1">
+ <h4 class="aux">References:<span class="toplink"><a href="#s4">&uarr;&nbsp;&sect;4</a></span></h4>
+ <p id="fn3-c3-algorithm">
+ [3] Kim Barrett, Bob Cassels, Paul Haahr, David A. Moon, Keith Playford, P. Tucker Withington. <em>A monotonic superclass linearization for Dylan</em>. OOPSLA '96: Proceedings of the 11th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications,
+ pages 69-82, 1996.
+
+ </p>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s3.html" rel="prev">&lt;&lt;&nbsp;&sect;3&nbsp;Callout Binding</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s5.html" rel="next">&sect;5&nbsp;Team Activation&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/s5.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/s5.html
new file mode 100644
index 000000000..a177d1285
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/s5.html
@@ -0,0 +1,669 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s4.html" rel="prev">&lt;&lt;&nbsp;&sect;4&nbsp;Callin Binding</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s6.html" rel="next">&sect;6&nbsp;Object Teams API&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="chapter" id="s5">
+ <div class="headl">
+ <div class="headr">
+ <h1>&sect;5&nbsp;Team Activation</h1>
+ </div>
+ </div>
+ <div id="toc-box">
+ <ul class="toc-box">
+ <li><a href="s5.html">&sect;5&nbsp;Team Activation</a></li>
+ <li><a href="#s5.1">&sect;5.1&nbsp;Effect of team activation</a></li>
+ <li><a href="#s5.2">&sect;5.2&nbsp;Explicit team activation</a></li>
+ <li><a href="#s5.3">&sect;5.3&nbsp;Implicit team activation</a></li>
+ <li><a href="#s5.4">&sect;5.4&nbsp;Guard predicates</a></li>
+ <li><a href="#s5.5">&sect;5.5&nbsp;Unanticipated team activation</a></li>
+ </ul>
+ </div>
+ <div class="intro">
+ <h3>The concept of Activation</h3>
+ <div class="line"></div>
+ <div class="term">Binding activation</div>
+ <div class="termdesc">All <strong>callin</strong> bindings of a team only have effect if
+ the team is <strong>active</strong>. Activation may be caused by explicit
+ statements and also happens implicitly at certain points
+ during program execution.
+ </div>
+ <div class="line"></div>
+ <div class="term">Guard predicates</div>
+ <div class="termdesc">Callin bindings can further be controlled using guard predicates,
+ which can be attached to roles and teams at different levels. If a guard
+ predicate evaluates to <code>false</code>, all affected callin bindings
+ are disabled.
+ </div>
+ <div class="line"></div>
+ </div>
+ <div class="sect depth2" id="s5.1">
+ <h2 class="sect">&sect;5.1&nbsp;Effect of team activation<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;5</a></span></h2>
+ <p>Activating a team instance has the effect of enabling all its callin bindings.
+ All effects defined in <a href="s4.html" title="&sect;4&nbsp;Callin Binding" class="sect">&sect;4</a> apply only if a corresponding
+ team instance is active.<br />
+ The <strong>order</strong> of team activation controls the order of callin executions.
+ If more than one team intercepts calls to the same base method, the most recently activated
+ team has highest priority in that its before or replace callins are executed first while its after
+ callins are executed last.
+
+ </p>
+ <div class="sect depth3" id="s5.1.1">
+ <h3 class="sect">&sect;5.1.1&nbsp;Global vs. thread local team activation<span class="toplink"><a href="#s5.1">&uarr;&nbsp;&sect;5.1</a></span></h3>
+ <p>While <strong>thread local</strong> activation only enables the callin bindings of
+ a team instance for a certain thread, <strong>global</strong> activation activates the
+ team instance for all threads of the application.
+
+ </p>
+ </div>
+ <div class="sect depth3" id="s5.1.2">
+ <h3 class="sect">&sect;5.1.2&nbsp;Effect on garbage collection<span class="toplink"><a href="#s5.1">&uarr;&nbsp;&sect;5.1</a></span></h3>
+ <p>Any active team is referenced by internal infrastructure.
+ Thus, a team cannot be reclaimed by the garbage collector while it is active.
+
+ </p>
+ </div>
+ </div>
+ <div class="sect depth2" id="s5.2">
+ <h2 class="sect">&sect;5.2&nbsp;Explicit team activation<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;5</a></span></h2>
+ <div class="subsect depth3" id="s5.2.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Activation block</span></h4>
+ <p>A team can be activated thread local by the block construct</p>
+ <div class="listing plain"><pre><b>within</b> (myTeam) { <i>stmts</i> }</pre></div>
+ <p>If <em>stmts</em> has only one statement this can be abbreviated to
+ </p>
+ <div class="listing plain"><pre><b>within</b> (myTeam) <i>stmt</i></pre></div>
+ <p>In these statements, <code>myTeam</code> must denote a team instance.
+ For the time of executing this block, this team instance is activated for the current thread,
+ which has entered the within block.
+
+ </p>
+ <p>The <code>within</code> block statement guarantees that it leaves
+ the team in exactly the same activation state as it was in when
+ entering this block. This includes the cases of exceptions, meaning
+ that deactivation will also occur if the execution of the block
+ terminates abnormally.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s5.2.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Imperative activation</span></h4>
+ <p>Each team class implicitly provides methods from the predefined interface
+ <code>org.objectteams.ITeam</code> (super interface of all team classes) to control team
+ activation disregarding the block structure of the program. The methods <code>activate()</code>
+ and <code>deactivate()</code> are used to activate and deactivate a team instance for
+ the current thread.<br />
+ If a team should be de-/activated for another thread this can be done by the methods
+ <code>activate(Thread aThread)</code> and <code>deactivate(Thread aThread)</code>.
+ In order to achieve global activation for all threads the predefined constant
+ <code>org.objectteams.Team.ALL_THREADS</code> is passed to these methods (e.g.
+ <code>activate(Team.ALL_THREADS)</code>).<br />
+ Note, that this methods make no guarantees with respect to exceptions.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s5.2.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Multiple and mixed activations</span></h4>
+ <ul>
+ <li>If <code>activate()</code> is invoked on a team instance
+ that has been explicitly activated before, this statement has
+ no effect at all (note the difference in <a href="#s5.3.a" title="&sect;5.3.(a)&nbsp;Team level methods" class="sect">&sect;5.3.(a)</a> below).
+ <br />
+ The same applies to deactivating an inactive team.
+ </li>
+ <li>If a team was already active when entering a <code>within</code>
+ block, it will remain active after leaving the block.
+ </li>
+ <li>If the team was active on entry of a <code>within</code> block
+ and if <code>deactivate()</code> is invoked on the same team
+ instance from within the <code>within</code> block,
+ leaving the block will re-activate the team.
+ </li>
+ </ul>
+ </div>
+ </div>
+ <div class="sect depth2" id="s5.3">
+ <h2 class="sect">&sect;5.3&nbsp;Implicit team activation<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;5</a></span></h2>
+ <p>Implicit team activation is intended to ensure that
+ whenever the control flow is passed to a team or one of its roles,
+ the team is implicitly activated for the current thread.
+ Implicit activation can be configured at different levels (see <a href="#s5.3.d" title="&sect;5.3.(d)&nbsp;Configuring implicit activation"
+ class="sect">&sect;5.3.(d)</a>).
+
+ </p>
+ <p>When implicit activation is enabled a programmer may assume,
+ that whenever a role forwards calls to its base object via callout,
+ the callin bindings of the same role will be active at that time.
+ Exceptions to this rule have to be programmed explicitly.
+
+ </p>
+ <div class="subsect depth3" id="s5.3.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Team level methods</span></h4>
+ <p>While executing a <strong>team level method</strong>, the target team
+ is always active. Activation is reset to the previous state
+ when leaving the team method, unless the team has been explicitly activated during
+ execution of the team method by a call to <code>activate()</code>.
+ Explicit activation is stronger than implicit activation and thus persists after the
+ team level method terminates. Ie., leaving a team level method will never reset
+ an explicit activation.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s5.3.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Methods of externalized roles</span></h4>
+ <p>Invoking a method on an <strong>externalized role</strong>
+ (see <a href="s1.html#s1.2.2" title="&sect;1.2.2&nbsp;Externalized roles"
+ class="sect">&sect;1.2.2</a>) also has the
+ effect of temporary activation of the team containing the role for the current thread.
+ Regarding deactivation the rule of <a href="#s5.3.a" title="&sect;5.3.(a)&nbsp;Team level methods" class="sect">&sect;5.3.(a)</a> above applies accordingly.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s5.3.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Nested teams</span></h4>
+ <p>Implicit activation has additional consequences for nested teams
+ (see <a href="s1.html#s1.5" title="&sect;1.5&nbsp;Team and role nesting"
+ class="sect">&sect;1.5</a>):
+
+ </p>
+ <ul>
+ <li>Implicit activation of a team causes the activation of its outer teams.</li>
+ <li>Implicit deactivation of a team causes the deactivation of its inner teams.</li>
+ </ul>
+ </div>
+ <div class="subsect depth3" id="s5.3.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Configuring implicit activation</span></h4>
+ <p>Implicit activation is disabled by default and can be enabled by adding the annotation
+ <code>@org.objectteams.ImplicitTeamActivation</code>, which can be applied to a type or a method.
+ When applied to a method it is ensured that invoking this method will trigger implicit activation.
+ When the annotation is applied to a type this has the same effect as applying it to all externally
+ visible methods of the type. Member types are not affected and have to be annotated separately.
+ </p>
+ <p>The runtime environment can be configured globally by defining the system property
+ <code>ot.implicit.team.activation</code> to one of these values:
+ </p>
+ <dl>
+ <dt>NEVER</dt>
+ <dd>Implicit activation is completely disabled.</dd>
+ <dt>ANNOTATED</dt>
+ <dd>This is the default: implicit activation applies only where declared by <code>@ImplicitTeamActivation</code>.
+ </dd>
+ <dt>ALWAYS</dt>
+ <dd>Implicit activation applies to all externally visible methods (this was the default in OTJLD versions &le;1.2)</dd>
+ </dl>
+ </div>
+ <p>Note that among the different mechanisms for activation, <code>within</code> is strongest,
+ followed by <code>(de)activate()</code>, weakest is implicit activation. In this sense,
+ explicit imperative (de)activation may override the block structure of implicit activation
+ (by explicit activation within a team level method), but not that of a <code>within</code>
+ block (by deactivation from a within block).
+
+ </p>
+ </div>
+ <div class="sect depth2" id="s5.4">
+ <h2 class="sect">&sect;5.4&nbsp;Guard predicates<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;5</a></span></h2>
+ <div class="syntaxlink"><a href="sA.html#sA.7" title="&sect;A.7&nbsp;Guard predicates" class="syntax">&rarr;&nbsp;Syntax&nbsp;&sect;A.7</a></div>
+ <p>The effect of callins can further be controlled using so called guard predicates.
+ Guards appear at four different levels:
+
+ </p>
+ <ul>
+ <li>callin method binding</li>
+ <li>role method</li>
+ <li>role class</li>
+ <li>team class</li>
+ </ul>
+ <p>Guards can be specified as <em>regular</em> guards or <code>base</code> guards,
+ which affects the exact point in the control flow, where the guard will be evaluated.
+
+ </p>
+ <div class="subsect depth3" id="s5.4.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">General syntax for guards</span></h4>
+ <p>A guard is declared using the keyword <code>when</code> followed by a
+ boolean expression in parentheses:
+
+ </p>
+ <div class="listing plain"><pre><em><b>when</b> (</em><i>predicateExpression</i><em>)</em></pre></div>
+ <p>Depending on the kind of guard different objects are in scope using
+ special identifiers like <code>this</code>, <code>base</code>.<br />
+ Any predicate expression that evaluates to <code>true</code> enables
+ the callin binding(s) to which it applies.
+ Evaluation to <code>false</code> disables the callin binding(s).
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s5.4.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">No side effects</span></h4>
+ <p>A guard predicate should have no side effects.
+ A compiler should optionally check this condition, but inter-procedural analysis
+ actually depends on the availability of appropriate means to mark any method as side-effect free.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s5.4.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Exceptions</span></h4>
+ <p>A guard predicate should not throw any exceptions.
+ Yet, any exception thrown within a guard predicate cause the guard to evaluate to <code>false</code>
+ rather than propagating the exception, meaning that the evaluation of a guard predicate will never
+ interrupt the current base behaviour.<br />
+ A compiler should flag any checked exception that is thrown within a guard.
+ Such diagnosis should by default be treated as an error, with the option of configuring
+ its severity to warning or ignore.
+
+ </p>
+ </div>
+ <div class="sect depth3" id="s5.4.1">
+ <h3 class="sect">&sect;5.4.1&nbsp;Regular guards<span class="toplink"><a href="#s5.4">&uarr;&nbsp;&sect;5.4</a></span></h3>
+ <p>This group of guards evaluates within the context of a given role.
+ These guards are evaluated <em>after</em> a callin target is lifted and
+ <em>before</em> a callin bound role method is invoked.
+
+ </p>
+ <div class="subsect depth4" id="s5.4.1.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Method binding guards</span></h4>
+ <p>A guard may be attached to a callin method binding as in:
+
+ </p>
+ <div class="listing plain"><pre><b>void</b> roleMethod(<b>int</b> ir) <b>&lt;-</b> <b>after</b> <b>void</b> baseMethod(<b>int</b> ib)
+ <b>when</b> (ir &gt; MyTeam.this.threshold);</pre></div>
+ <p>Such a guard only affects the callin binding to which it is attached,
+ i.e., this specific callin binding is only effective,
+ if the predicate evaluates to <code>true</code>.
+ <br />
+ The following values are within the scope of the predicate expression,
+ and thus can be used to express the condition:
+
+ </p>
+ <ul>
+ <li>The role instance denoted by <code>this</code>.<br />
+ Features of the role instance can also be accessed relative to
+ <code>this</code> with or without explicit qualifying <code>this</code>.
+
+ </li>
+ <li>The team instance denoted by a qualified this reference as in
+ <code>MyTeam.this</code>.
+
+ </li>
+ <li>If the callin binding includes signatures (as in the example above):
+ Parameters of the role method.<br />
+ If parameter mappings are involved, they will be evaluated before evaluating the guard.
+
+ </li>
+ </ul>
+ </div>
+ <div class="subsect depth4" id="s5.4.1.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Method guards</span></h4>
+ <p>A method guard is similar to a method binding guard, but it applies
+ to all callin method bindings of this method.<br />
+ A method guard is declared between the method signature and the method body:
+
+ </p>
+ <div class="listing plain"><pre><b>void</b> roleMethod(<b>int</b> ir)
+ <b>when</b> (ir &gt; MyTeam.this.threshold) { <i>body statements</i> }</pre></div>
+ </div>
+ <div class="subsect depth4" id="s5.4.1.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Role level guards</span></h4>
+ <p>When a guard is specified at the role level, i.e., directly before the
+ class body of a role class, it applies to all callin method bindings of
+ the role class:
+
+ </p>
+ <div class="listing plain"><pre><b>protected</b> <b>class</b> MyRole
+ <b>when</b> (value &gt; MyTeam.this.threshold)
+{
+ <b>int</b> value;
+ <i>other <b>class</b> body declarations</i>
+}</pre></div>
+ <p>The following values are within the scope of the predicate expression:
+
+ </p>
+ <ul>
+ <li>The role instance denoted by <code>this</code> (explicit or implicit, see above).
+ Thus, in the example <code>value</code> will be interpreted as a field of the enclosing role.
+
+ </li>
+ <li>The team instance denoted by a qualified this reference as in <code>MyTeam.this</code></li>
+ </ul>
+ </div>
+ <div class="subsect depth4" id="s5.4.1.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Team level guards</span></h4>
+ <p>A guard specified in the header of a team class may disable the callin
+ bindings of all contained role classes. The syntax corresponds to the syntax
+ of role level guards.<br />
+ The only value directly available within team level guard is the
+ team instance (denoted by <code>this</code>) and its features.
+
+ </p>
+ </div>
+ <p>Of course all guards can also access any visible static feature of a visible class.
+
+ </p>
+ <p>Even if a guard has no direct effect, because, e.g., a role class has no callin
+ bindings (maybe not even a role-base binding), predicates at such abstract
+ levels are useful, because all predicates are inherited by all sub classes
+ (explicit and implicit).
+
+ </p>
+ </div>
+ <div class="sect depth3" id="s5.4.2">
+ <h3 class="sect">&sect;5.4.2&nbsp;Base guards<span class="toplink"><a href="#s5.4">&uarr;&nbsp;&sect;5.4</a></span></h3>
+ <p>The intention behind base guards is to prevent lifting of a callin-target
+ if a guard evaluates to <code>false</code> and thus refuses to invoke the
+ callin bound role method. Using base guards it is easier to prevent any
+ side-effects caused by a callin binding, because lifting could cause side-effects
+ at two levels:
+
+ </p>
+ <ul>
+ <li>Creating a role on-demand already is a side-effect (observable e.g.
+ by the reflective function <code><a href="s6.html#s6.1" title="&sect;6.1&nbsp;Reflection" class="sect">hasRole (&sect;6.1)</a></code>)
+
+ </li>
+ <li>Role creation triggers execution of a role constructor
+ (see <a href="s2.html#s2.3.1.c"
+ title="&sect;2.3.1.(c)&nbsp;Custom lifting constructor"
+ class="sect">custom lifting constructor (&sect;2.3.1.(c))</a>)
+ which could produce arbitrary side-effects.
+
+ </li>
+ </ul>
+ <p>Both kinds of side-effects can be avoided using a base guard which prevents
+ unnecessary lifting.
+
+ </p>
+ <p>Any guard (5.4.1 (b)-(e)) can be turned into a base guard by adding
+ the modifier <code>base</code> as in:
+
+ </p>
+ <div class="listing plain"><pre><b>protected</b> <b>class</b> MyRole <b>playedBy</b> MyBase
+ <em><b>base</b> when</em> (base.value &gt; MyTeam.this.threshold)
+{
+ <i><b>class</b> body declarations</i>
+}</pre></div>
+ <p>However, different scoping rules apply for the identifiers
+ that can be used in a base guard:
+
+ </p>
+ <div class="subsect depth4" id="s5.4.2.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Base object reference</span></h4>
+ <p>In all base guard predicates the special identifier <code>base</code>
+ can be used to denote the base object that is about to be lifted.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s5.4.2.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Method binding guards</span></h4>
+ <p>A base method binding guard may access parameters as passed to the
+ base method. Parameter mappings are not considered.<br />
+ Additionally, for <code>after</code> callin bindings, the identifier <code>result</code>
+ may be used to refer to the result of the base method (if any).
+
+ </p>
+ <div class="note">
+ <h5>Note:</h5>
+ <p>In order to achieve the same effect of accessing
+ the base method's result, a regular binding guard (not a base guard)
+ must use a suitable parameter mapping (see <a href="s4.html#s4.4.c"
+ title="&sect;4.4.(c)&nbsp;Mapping the result of a base method"
+ class="sect">&sect;4.4.(c)</a>).
+
+ </p>
+ </div>
+ </div>
+ <div class="subsect depth4" id="s5.4.2.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Method guards</span></h4>
+ <p>In contrast to regular method guards, a <em>base</em> guard attached to a role method
+ cannot access any method parameters. See the next item (d) for values that are actually in scope.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s5.4.2.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Role level guards</span></h4>
+ <p>Role level base guards may use these values:
+
+ </p>
+ <ul>
+ <li>The base instance using the special identifier <code>base</code>.
+ </li>
+ <li>The team instance using a qualified this references (<code>MyTeam.this</code>).
+ </li>
+ </ul>
+ </div>
+ <div class="subsect depth4" id="s5.4.2.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Team level guards</span></h4>
+ <p>Team level base guards have the same scope as role level base guards (d).
+ However, the type of the role instance is not known here, i.e., here <code>base</code>
+ has the static type <code>java.lang.Object</code>.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s5.4.2.f">
+ <h4 class="subsect">(f)&nbsp;<span class="title">Unbound roles</span></h4>
+ <p>In contrast to regular guards, base guards cannot be attached to
+ unbound role classes nor to their methods.<br />
+ Only team level base guards are independent of role binding.
+
+ </p>
+ </div><img src="../images/guards.png" alt="Overview: Guard predicates" /></div>
+ <div class="sect depth3" id="s5.4.3">
+ <h3 class="sect">&sect;5.4.3&nbsp;Multiple guards<span class="toplink"><a href="#s5.4">&uarr;&nbsp;&sect;5.4</a></span></h3>
+ <p>Due to the different ranges of applicability different guards may affect the same method binding.
+ In that case all applicable guards are conjoined using a logical <code>and</code>.<br />
+ Any guard is interpreted as the conjunction of these predicates (if present):
+
+ </p>
+ <ul>
+ <li>The direct predicate expression of the guard.</li>
+ <li>The next outer guard along the chain
+ <em>method binding -&gt; method -&gt; role level -&gt; team level</em></li>
+ <li>The guard at the same level that is inherited from the <em>implicit</em> super role.
+ </li>
+ <li>The guard at the same level that is inherited from the <em>explicit</em> super role.
+ </li>
+ </ul>
+ <h5 class="listing">Example code (Guard Predicates):</h5>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> ATM {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>private</b> Bank myBank;</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>public</b> <b>class</b> ForeignAccount <b>playedBy</b> Account</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <em><b>base</b> when</em> (!ATM.this.myBank.equals(<em>base</em>.getBank()))</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> <b>callin</b> <b>void</b> debitWithFee(<b>int</b> amount) {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> base.debitWithFee(fee+amount);</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre> <b>void</b> debitWithFee(<b>int</b> i) <b>&lt;-</b> <b>replace</b> <b>void</b> debit(<b>int</b> amount)</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">10</td>
+ <td><pre> <em><b>base</b> when</em> (amount &lt; 1000);</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">11</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">12</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="codecomment">
+ <h5>Effects:</h5>
+ The team in this example causes that an additional fee has to be payed while debiting
+ less than 1000 Euros from a "foreign" account.
+
+ <ul>
+ <li>The base guard in line 4 ensures that <code>Account</code> objects only get
+ <code>ForeignAccount</code> roles, if they belong to a different bank than the
+ surrounding <code>ATM</code> team.<br />
+ It accesses the bank of the base via the <code>base</code> identifier.
+
+ </li>
+ <li>The method binding guard in line 10 restricts the callin to
+ <code>debitWithFee</code> to calls where the base method argument
+ <code>amount</code> is lower than 1000.
+
+ </li>
+ <li>A call to <code>Account.debit</code> causes a replace callin to
+ <code>debitWithFee</code><em> only</em> if <em>both</em> predicates evaluate to true.
+
+ </li>
+ </ul>
+ </div>
+ </div>
+ </div>
+ <div class="sect depth2" id="s5.5">
+ <h2 class="sect">&sect;5.5&nbsp;Unanticipated team activation<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;5</a></span></h2>
+ <p>If an application should be adapted unanticipatedly by one or more teams,
+ this can be achieved without explicitly changing the program code of this application.
+
+ </p>
+ <p><span class="underline">General activation via config file:</span><br />
+ Instead of adding the team initialization
+ and activation code to the main program, it is possible to add the respective teams via a config file.
+ Every line of this text file contains the fully qualified name of a compiled team, which has to be available
+ on the classpath.
+ For the instantiation of these teams the default constructor is used, which means adding a team to
+ an application this way requires the team to provide a default constructor.
+ The activation order (see <a href="#s5.1" title="&sect;5.1&nbsp;Effect of team activation" class="sect">&sect;5.1</a>) for these teams corresponds to the order
+ in which they are listed in the config file.<br />
+ Lines starting with a '#' denote comment lines.
+
+ </p>
+ <h5 class="listing">Example config file:</h5>
+ <div class="listing config frame"><pre><span class="comment"># Config file for an ObjectTeams application:</span>
+<em>mypackage1.MyTeam1</em>
+<span class="comment"># ...</span>
+<em>mypackageM.MyTeamN</em></pre></div>
+ <p>To get this config file recognized by the application the VM argument<br /><strong>'-Dot.teamconfig=&lt;<em>config_file_name</em>&gt;'</strong><br />
+ has to be used when starting the application.
+
+ </p>
+ <div class="note">
+ <h5>Note:</h5>
+ In the ObjectTeams Development Tooling (OTDT) teams are activated unanticipatedly
+ via a special tab in the "Run-Configuration" (see <a href="http://www.objectteams.org/distrib/features.html#execution" class="ext">OTDT features</a>), instead.
+
+ </div>
+ <p><span class="underline">Activation adjustment example:</span><br />
+ Teams added via the config file mechanism are activated by default. Because no reference to them is
+ stored anywhere, it is not possible to deactivate them later.
+ If deactivation of unanticipated added teams is required, this can be achieved by adding a manager team
+ via config file and encapsulate the actual functionality in another team managed by the manager team.
+ This way a functional team can be activated and deactivated as needed.
+
+ </p>
+ <h5 class="listing">Example code (Activation Adjustment):</h5>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> MyManagerTeam {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>private</b> FunctionalTeam myFunctionalTeam = <b>new</b> FunctionalTeam();</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>protected</b> <b>class</b> MyRole <b>playedBy</b> MyApplication {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <b>void</b> startAdaption() { myFunctionalTeam.activate(); }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> startAdaption <b>&lt;-</b> <b>before</b> startMethod;</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> <b>void</b> stopAdaption() { myFunctionalTeam.deactivate(); }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> stopAdaption <b>&lt;-</b> <b>after</b> stopMethod;</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="listing config frame"><pre><span class="comment"># Config file for the manager team example:</span>
+<em>MyManagerTeam</em></pre></div>
+ <div class="codecomment">
+ <h5>Effects:</h5>
+ <ul>
+ <li><code>startMethod</code> and <code>stopMethod</code> are methods which demand
+ the activation and deactivation respectively.
+
+ </li>
+ <li>If the activation/deactivation depends on other conditions these can be checked in addition.
+
+ </li>
+ </ul>
+ </div>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s4.html" rel="prev">&lt;&lt;&nbsp;&sect;4&nbsp;Callin Binding</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s6.html" rel="next">&sect;6&nbsp;Object Teams API&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/s6.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/s6.html
new file mode 100644
index 000000000..c0db8c402
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/s6.html
@@ -0,0 +1,405 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s5.html" rel="prev">&lt;&lt;&nbsp;&sect;5&nbsp;Team Activation</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s7.html" rel="next">&sect;7&nbsp;Role Encapsulation&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="chapter" id="s6">
+ <div class="headl">
+ <div class="headr">
+ <h1>&sect;6&nbsp;Object Teams API</h1>
+ </div>
+ </div>
+ <div id="toc-box">
+ <ul class="toc-box">
+ <li><a href="s6.html">&sect;6&nbsp;Object Teams API</a></li>
+ <li><a href="#s6.1">&sect;6.1&nbsp;Reflection</a></li>
+ <li><a href="#s6.2">&sect;6.2&nbsp;Other API Elements</a></li>
+ </ul>
+ </div>
+ <div class="intro">
+ <h3>The role of predefined types and methods</h3>
+ <div class="line"></div>
+ <div class="term">Application Programming Interface (API)</div>
+ <div class="termdesc">Some features of OT/J are supported without introducing new syntax but by predefined types and methods.</div>
+ <div class="line"></div>
+ </div>
+ <div class="sect depth2" id="s6.1">
+ <h2 class="sect">&sect;6.1&nbsp;Reflection<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;6</a></span></h2>
+ <p>Object Teams supports reflection with respect to teams, roles, and role-base relationships.
+
+ </p>
+ <div class="subsect depth3" id="s6.1.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Interface to the role registry</span></h4>
+ <p>Each team instance internally has a registry of known role objects indexed by their base object.
+ Programmers may make use of this registry using the following reflective methods defined in
+ <code>org.objectteams.ITeam</code>:
+
+ </p>
+ <dl>
+ <dt><code>boolean hasRole ( Object aBase ) ;</code></dt>
+ <dd>This method checks whether a role for the passed base object already exists in the target team.
+
+ </dd>
+ <dt><code>boolean hasRole ( Object aBase, Class expectedRole ) ;</code></dt>
+ <dd>This method checks whether a instance of type <code>expectedRole</code> as a role for the passed base object
+ <code>aBase</code> already exists in the target team.
+ The role may also be of any subtype of the specified role type.
+
+ </dd>
+ <dt><code>Object getRole ( Object aBase ) ;</code></dt>
+ <dd>If the passed base object <code>aBase</code> already has a role in the target team, this role is returned.
+ Otherwise <code>null</code> is returned.
+
+ </dd>
+ <dt><code>&lt;T&gt; T getRole ( Object aBase, Class&lt;T&gt; expectedRole ) ;</code></dt>
+ <dd>If the passed base object <code>aBase</code> already has a role in the target team that is assignable to the type represented by <code>expectedRole</code>,
+ this role is returned. Otherwise <code>null</code> is returned.
+
+ </dd>
+ <dt><code>Object[] getAllRoles () ;</code></dt>
+ <dd>Retrieves all existing (registered) <a href="s2.html#s2.1.a" title="&sect;2.1.(a)&nbsp;Role-base binding"
+ class="sect">bound roles (&sect;2.1.(a))</a> in the target team.
+ <br />
+ This method uses internal structures of weak references. For that reason it may return role instances which were about
+ to be reclaimed by the garbage collector. If performance permits, it is thus advisable to always call <code>System.gc()</code>
+ prior to calling <code>getAllRoles()</code> in order to achieve deterministic results (see also <a href="s2.html#s2.1.f"
+ title="&sect;2.1.(f)&nbsp;Effect on garbage collection"
+ class="sect">&sect;2.1.(f)</a>).
+
+ </dd>
+ <dt><code>&lt;T&gt; T[] getAllRoles ( Class&lt;T&gt; expectedRole ) ;</code></dt>
+ <dd>Retrieves all existing (registered) <a href="s2.html#s2.1.a" title="&sect;2.1.(a)&nbsp;Role-base binding"
+ class="sect">bound roles (&sect;2.1.(a))</a> in the target team that are assignable to the type represented by <code>expectedRole</code>.
+ Class <code>expectedRole</code> must be a bound role otherwise an <code>IllegalArgumentException</code> is thrown.
+ <br />
+ See the note about garbage collection above.
+
+ </dd>
+ <dt><code>void unregisterRole ( Object aRole ) ;</code></dt>
+ <dd>This method unregisters the passed role object from the target team. Thus the corresponding base looses this role.
+ After calling this method the role should no longer be used.
+
+ </dd>
+ <dt><code>void unregisterRole ( Object aRole, Class roleClass ) ;</code></dt>
+ <dd>This method unregisters the passed role object from the target team. Thus the corresponding base looses this role.
+ After calling this method the role should no longer be used.
+ The only difference to the previous method is improved speed because no search for the corresponding registry
+ has to be performed.
+
+ </dd>
+ </dl>
+ <p>It is desirable and possible to use these methods within guards (see <a href="s5.html#s5.4" title="&sect;5.4&nbsp;Guard predicates" class="sect">&sect;5.4</a>).
+ These methods allow to write the specification of guards in a more concise and more expressive way. Determined by the signature,
+
+ the first four methods can only be used in a base-level guard (<a href="s5.html#s5.4.2" title="&sect;5.4.2&nbsp;Base guards" class="sect">&sect;5.4.2</a>) because they require a reference to a base object.
+
+ </p>
+ <h5 class="listing">Example code (Guards and Reflection):</h5>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> SpecialConditions {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>public</b> <b>void</b> participate(Account <b>as</b> BonusAccount ba) {}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>public</b> <b>class</b> BonusAccount <b>playedBy</b> Account</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <b>base</b> when(SpecialConditions.this.<em>hasRole</em>(base, BonusAccount.class))</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> <b>callin</b> <b>void</b> creditBonus(<b>int</b> amount) {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> base.creditBonus(amount + bonus);</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre> <b>void</b> creditBonus(<b>int</b> amount) <b>&lt;-</b> <b>replace</b> <b>void</b> credit(<b>int</b> i)</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">10</td>
+ <td><pre> <b>base</b> <b>when</b> (i &gt; 1000);</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">11</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">12</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="codecomment">
+ <h5>Effects:</h5>
+ This teams provides a bonus system for registered <code>Account</code>s. Every time an amount of more than 1000 is
+ deposited to a registered account, additional 1% of the amount is credited.
+
+ <ul>
+ <li>The team level method <code>participate</code> in line 2 uses declared lifting (see <a href="s2.html#s2.3.2" title="&sect;2.3.2&nbsp;Declared lifting"
+ class="sect">&sect;2.3.2</a>)
+ to allow the passed <code>Account</code> object to participate the bonus system provided by the
+ <code>SpecialConditions</code> team.
+
+ </li>
+ <li>The base guard in line 4 uses the reflective method <code>hasRole</code> to check whether the base object already has a role
+ of type <code>BonusAccount</code> in the surrounding team. The expression <code>BonusAccount.class</code> returns
+ the <code>java.lang.Class</code> object representing the role <code>BonusAccount</code>
+ (see <a href="http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#251530"
+ class="ext">JLS &sect;15.8.2</a>).
+ This guard ensures, that only accounts explicitly registered via <code>participate</code> are ever decorated with a role of type <code>BonusAccount</code>.
+
+ </li>
+ <li>The method binding guard in line 10 restricts the callin to <code>creditBonus</code> to calls where
+ the base method argument <code>amount</code> is greater than 1000.
+
+ </li>
+ </ul>
+ </div>
+ </div>
+ <div class="subsect depth3" id="s6.1.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Behavioral reflection</span></h4>
+ <p>The following reflective methods defined in org.objectteams.ITeam can be used to
+ inspect the dynamic behavior of a team:
+
+ </p>
+ <dl>
+ <dt><code>boolean isExecutingCallin () ;</code></dt>
+ <dd>This method is used to inspect whether a control flow has already been intercepted by at least one callin binding of the current
+ team.
+ It can be used to avoid undesirable re-entrance to a team.
+
+ </dd>
+ <dt><code>boolean isActive () ;</code></dt>
+ <dd>This method checks whether the team instance is active for the current thread.
+
+ </dd>
+ <dt><code>boolean isActive ( Thread aThread ) ;</code></dt>
+ <dd>This method checks whether the team instance is active for the thread <code>aThread</code>.
+
+ </dd>
+ </dl>
+ </div>
+ <div class="subsect depth3" id="s6.1.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Class literals for roles</span></h4>
+ <p>The Java syntax for so-called class literals, <code>MyClass<strong>.class</strong></code>
+ (see <a href="http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#251530"
+ class="ext">JLS &sect;15.8.2</a>)
+ can be used for role types with slightly changed semantics: Role types are virtual types (<a href="s1.html#s1.3.1"
+ title="&sect;1.3.1&nbsp;Acquisition and implicit inheritance of role classes"
+ class="sect">&sect;1.3.1</a>)
+ that are bound dynamically (<a href="s1.html#s1.3.1.e"
+ title="&sect;1.3.1.(e)&nbsp;Dynamic binding of types"
+ class="sect">&sect;1.3.1.(e)</a>). This applies to role class literals, too.
+ From this follows the constraint that a role class literal can only be used within the non-static context of a team,
+ ie., for evaluating a role class literal an enclosing team instance must be in scope.
+ <br />
+ Unlike regular type checking for role types, the class literal itself does not have a dependent type.
+ Thus type checking of calls to methods like <code>hasRole(Object, Class)</code> cannot detect, whether the <code>Class</code> instance
+ has actually been obtained from the correct team instance. Any attempt to pass a class that is not known
+ as a bound role within the given team results in an <code>IllegalArgumentException</code> at run-time.
+
+ </p>
+ </div>
+ </div>
+ <div class="sect depth2" id="s6.2">
+ <h2 class="sect">&sect;6.2&nbsp;Other API Elements<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;6</a></span></h2>
+ <div class="subsect depth3" id="s6.2.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Interfaces for role encapsulation</span></h4>
+ <p>A set of pre-defined types exist that do <span class="underline">not</span> extend <code>java.lang.Object</code>
+ and have <span class="underline">no</span> features except the operators <code>==</code> and <code>!=</code>.
+
+ </p>
+ <div class="note">
+ <h5>Note:</h5>
+ The JLS defines that each interface declares all methods defined in <code>java.lang.Object</code>
+ (<a href="http://java.sun.com/docs/books/jls/second_edition/html/interfaces.doc.html#32392"
+ class="ext">JLS &sect;9.2</a>)
+ and also each object referenced by an interface type can be widened to <code>java.lang.Object</code>.
+ Compilers commonly implement this by declaring <code>java.lang.Object</code> the super-type of all interfaces.
+ Such implementation has no visible difference with respect to the more complex definition in the JLS.
+
+ </div>
+ <p>These predefined types are
+
+ </p>
+ <dl>
+ <dt><code>org.objectteams.IConfined</code></dt>
+ <dd>regular interface</dd>
+ <dt><code>org.objectteams.ITeam.IConfined</code></dt>
+ <dd>role interface</dd>
+ <dt><code>org.objectteams.Team.Confined</code></dt>
+ <dd>role class</dd>
+ </dl>
+ <p>These types provide no new functionality but inheriting from these types influences the semantics with respect to encapsulation.
+
+ The purpose and usage of these types is described in <a href="s7.html" title="&sect;7&nbsp;Role Encapsulation" class="sect">&sect;7</a>.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s6.2.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Interface for explicit lowering</span></h4>
+ <p>The following role interface exists for the purpose of allowing explicit lowering:
+
+ </p>
+ <dl>
+ <dt><code>org.objectteams.ITeam.ILowerable</code></dt>
+ <dd>role interface</dd>
+ </dl>
+ <p>This interface was introduced in detail in <a href="s2.html#s2.2.d" title="&sect;2.2.(d)&nbsp;Explicit lowering"
+ class="sect">&sect;2.2.(d)</a>.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s6.2.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Team activation methods</span></h4>
+ <p>Every team can be activated and deactivated by predefined methods of the interface <code>org.objectteams.ITeam</code>.
+
+ </p>
+ <dl>
+ <dt><code>activate()</code> and <code>activate(Thread th)</code></dt>
+ <dd>Methods for activation of a team</dd>
+ <dt><code>deactivate()</code> and <code>deactivate(Thread th)</code></dt>
+ <dd>Methods for deactivation of a team</dd>
+ </dl>
+ <p>The usage of these Methods is described in <a href="s5.html#s5.2.b" title="&sect;5.2.(b)&nbsp;Imperative activation"
+ class="sect">&sect;5.2.(b)</a>.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s6.2.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Exceptions</span></h4>
+ <p>The following <code>Exceptions</code> can be thrown during the execution of an ObjectTeam/Java program:
+
+ </p>
+ <dl>
+ <dt><code>ResultNotProvidedException</code></dt>
+ <dd>Thrown if a replace callin without a base call does not provide the necessary (primitive type) base result
+ (see <a href="s4.html#s4.3.e" title="&sect;4.3.(e)&nbsp;Fragile callin binding"
+ class="sect">&sect;4.3.(e)</a>).
+ </dd>
+ <dt><code>LiftingFailedException</code></dt>
+ <dd>Thrown if an actual ambiguity occurs during lifting (see <a href="s2.html#s2.3.4.c" title="&sect;2.3.4.(c)&nbsp;Actual ambiguity"
+ class="sect">&sect;2.3.4.(c)</a>).
+ </dd>
+ <dt><code>WrongRoleException</code></dt>
+ <dd>Thrown during lifting if the base object has, with respect to the same team instance, previously been lifted
+ to a role type that is not conform to the currently requested type
+ (see <a href="s2.html#s2.3.4.d" title="&sect;2.3.4.(d)&nbsp;Mismatching role"
+ class="sect">&sect;2.3.4.(d)</a> and <a href="s2.html#s2.4.3"
+ title="&sect;2.4.3&nbsp;Role creation in the presence of smart lifting"
+ class="sect">&sect;2.4.3</a>).
+ </dd>
+ <dt><code>DuplicateRoleException</code></dt>
+ <dd>Thrown during explicit role creation, if a new role is created for a base object, which already has a role
+ of the required type in the given team (see <a href="s2.html#s2.4.1.c"
+ title="&sect;2.4.1.(c)&nbsp;Duplicate role runtime check"
+ class="sect">&sect;2.4.1.(c)</a>).
+ </dd>
+ <dt><code>RoleCastException</code></dt>
+ <dd>Thrown during cast of an externalized role, if the casted expression is anchored to a different team instance
+ than the cast type (see <a href="s1.html#s1.2.4.b" title="&sect;1.2.4.(b)&nbsp;Casting" class="sect">&sect;1.2.4.(b)</a>).
+ </dd>
+ <dt><code>LiftingVetoException</code></dt>
+ <dd>This exception is used internally to abort the process of lifting when a relevant guard predicate (<a href="s5.html#s5.4" title="&sect;5.4&nbsp;Guard predicates" class="sect">&sect;5.4</a>) evaluated to false.
+ Such exceptions thrown from generated code will never appear in client code, so there is usually no need to catch a <code>LiftingVetoException</code>.
+ However, in some situations it is useful to explicitly <em>throw</em> a <code>LiftingVetoException</code> from a lifting constructor (<a href="s2.html#s2.3.1.b"
+ title="&sect;2.3.1.(b)&nbsp;Default lifting constructor"
+ class="sect">&sect;2.3.1.(b)</a>) of a role.
+ This style allows to abort lifting even after the lifting constructor has started to work and also for method parameters
+ requiring lifting.
+ If lifting was triggered due to a callin method binding, this binding will simply not trigger if a <code>LiftingVetoException</code> is thrown
+ while preparing the call to the role method.
+ </dd>
+ </dl>
+ </div>
+ <div class="subsect depth3" id="s6.2.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Role migration</span></h4>
+ <p>The following interfaces can be used to enable role migration:</p>
+ <dl>
+ <dt><code>IBaseMigratable</code></dt>
+ <dd>This interface declares a method
+ <div class="listing plain"><pre>
+ <code>&lt;B&gt; <b>void</b> migrateToBase(B otherBase)</code> </pre></div>
+ and instructs the compiler to generate an implementation of this method
+ for any bound role declaring <code>IBaseMigratable</code> as its super-interface.<br />
+ The effect of calling <code>migrateToBase</code> on a role instance is to re-bind this role to a new base instance.
+ The base instance must be compatible to the role's base class (in order to avoid problems during lifting the
+ compiler may require the base to be of the exact type of the role's base class).
+ Passing <code>null</code> to this method causes an <code>NullPointerException</code> to be thrown.
+ </dd>
+ <dt><code>ITeamMigratable</code></dt>
+ <dd>This interface declares a method
+ <div class="listing plain"><pre>
+ <code>&lt;R&gt; R&lt;@otherTeam&gt; migrateToTeam(<b>final</b> ITeam otherTeam)</code></pre></div>
+ and instructs the compiler to
+ generate an implementation of this method for any role declaring <code>ITeamMigratable</code> as its super-interface.<br />
+ The effect of calling <code>migrateToTeam</code> on a role instance is to re-bind this role to become a contained part of a new team instance.
+ The team instance must be of the exact type of the role's enclosing team.
+ Passing <code>null</code> to this method causes a <code>NullPointerException</code> to be thrown.<br /><div class="note">
+ <h5>Caveat:</h5>
+ This method intentionally breaks the rules of family polymorphism: any reference <code>R&lt;@previousTeam&gt; r</code>
+ which was established before migration will incorrectly imply that the role's enclosing team still is <code>previousTeam</code>,
+ which is no longer true after migration.
+ While this does not effect any method lookup (which is still safe), further assumptions based on a role's dependent type
+ are invalidated by team migration. The same holds for references from the migrating role to any sibling role instances.<br />
+ If the rules of family polymorphism should be maintained one should just refrain from declaring <code>ITeamMigratable</code>
+ as a role's super-interface.
+ </div>
+ </dd>
+ </dl>
+ <p>For both methods the signature declared in the interface is over-generalized, yet the compiler performs the necessary checks
+ to
+ ensure that role, base and team instances are indeed compatible and additionally the return type of <code>migrateToTeam</code>
+ is checked as a self-type, i.e., it reflects the exact type of the call target.
+ </p>
+ </div>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s5.html" rel="prev">&lt;&lt;&nbsp;&sect;5&nbsp;Team Activation</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s7.html" rel="next">&sect;7&nbsp;Role Encapsulation&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/s7.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/s7.html
new file mode 100644
index 000000000..18f529ed4
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/s7.html
@@ -0,0 +1,253 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s6.html" rel="prev">&lt;&lt;&nbsp;&sect;6&nbsp;Object Teams API</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s8.html" rel="next">&sect;8&nbsp;Join Point Queries&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="chapter" id="s7">
+ <div class="headl">
+ <div class="headr">
+ <h1>&sect;7&nbsp;Role Encapsulation</h1>
+ </div>
+ </div>
+ <div id="toc-box">
+ <ul class="toc-box">
+ <li><a href="s7.html">&sect;7&nbsp;Role Encapsulation</a></li>
+ <li><a href="#s7.1">&sect;7.1&nbsp;Opaque roles</a></li>
+ <li><a href="#s7.2">&sect;7.2&nbsp;Confined roles</a></li>
+ </ul>
+ </div>
+ <div class="intro">
+ <h3>Concepts of encapsulation</h3>
+ <div class="line"></div>
+ <div class="term">Protected roles</div>
+ <div class="termdesc">A role with visibility <code>protected</code> cannot be externalized, which means its type
+ cannot be used outside the declaring team (<a href="s1.html#s1.2.3" title="&sect;1.2.3&nbsp;Protected roles" class="sect">&sect;1.2.3</a>).
+ </div>
+ <div class="line"></div>
+ <div class="term">Confined roles</div>
+ <div class="termdesc">Confined roles are encapsulated even stricter than protected roles: the compiler will ensure that
+ by no means any object outside the enclosing team will ever have a reference to a confined role.
+ </div>
+ <div class="line"></div>
+ <div class="term">Opaque roles</div>
+ <div class="termdesc">Opaque roles build on the guarantees of confined roles but allow to be shared in a limited way such that
+ no information is exposed.
+ </div>
+ <div class="line"></div>
+ </div>
+ <div class="sect depth2" id="s7.1">
+ <h2 class="sect">&sect;7.1&nbsp;Opaque roles<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;7</a></span></h2>
+ <p>The purpose of the two <code>IConfined</code> interfaces (see <a href="s6.html#s6.2.a"
+ title="&sect;6.2.(a)&nbsp;Interfaces for role encapsulation"
+ class="sect">&sect;6.2.(a)</a>) is to define
+ <strong>opaque roles</strong>: Any role implementing <code>IConfined</code>
+ can be externalized using this type, such that external clients
+ cannot access any features of the role. The type <code>IConfined</code>
+ exposes no features and references of this type cannot be widened
+ to any type not even to <code>java.lang.Object</code>.
+ <br />
+ If the actual role type is furthermore invisible outside the team
+ (by not declaring it <code>public</code>), it is perfectly safe to externalize
+ such roles using type <code>IConfined</code> (which is a public interface)
+ and pass them back to the owning team. The encapsulation
+ of the team is in no way breached by externalizing opaque roles,
+ which can only be used as a handle into internal state of the team.
+
+ </p>
+ <p>The difference between the two mentioned interfaces is that
+ <code>ITeam.IConfined</code> requires to use this type or any subtype
+ as externalized role. Such a reference contains the information of
+ the enclosing team. Even stricter control can be imposed using the
+ regular interface <code>IConfined</code>. Here not even team membership
+ is visible to clients using a reference of this type.
+
+ </p>
+ </div>
+ <div class="sect depth2" id="s7.2">
+ <h2 class="sect">&sect;7.2&nbsp;Confined roles<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;7</a></span></h2>
+ <p>
+ Subclassing <code>Team.Confined</code> with a protected class
+ yields a role class to which no object outside the team will
+ ever have a reference.
+ The point here is that instances of a role class with a regular super class
+ can be widened to this super class.
+ Widening can occur either in an assignment or when invoking a method which the role
+ inherits from the regular super class, where the <code>this</code> reference is widened.
+ In both cases the widened reference is no longer protected by the team and can leak out.
+ This would break encapsulation of a role object that should only be accessible within the enclosing team.<br />
+ Subclasses of <code>Team.Confined</code> are not compatible to any class outside their enclosing team (including <code>java.lang.Object</code>) and do not inherit any methods
+ that have the danger of leaking <code>this</code>.
+
+ </p>
+ <div class="subsect depth3" id="s7.2.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Inhibition of overriding</span></h4>
+ <p>The types <code>ITeam.IConfined</code> and <code>Team.Confined</code>
+ cannot be overridden (cf. <a href="s1.html#s1.3.1.c"
+ title="&sect;1.3.1.(c)&nbsp;Overriding and implicit inheritance"
+ class="sect">&sect;1.3.1.(c)</a>).
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s7.2.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Arrays of Confined</span></h4>
+ <p>For any confined type <code>C</code>, i.e., a type which is not compatible to <code>Object</code>, an array of <code>C</code> is not compatible to an array of <code>Object</code> nor to <code>Object</code> itself. This rule ensures that confinement cannot be bypassed by a sequence of compatible assignments and casts.
+
+ </p>
+ <div class="note">
+ <h5>Upcoming:</h5>
+ Only by widening to a non-role super-type, a role instance can
+ be accessed from outside the team. In the future this can be inhibited by
+ restricted inheritance.
+
+ </div>
+ </div>
+ <h5 class="listing">Example code (Role Encapsulation):</h5>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> Company {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>private</b> HashMap&lt;String,Employee&gt; employees;</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> ...</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <b>protected</b> <b>class</b> Employee <em><b>implements</b> IConfined</em> {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> <b>void</b> pay(<b>int</b> amount) { ... }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> ...</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre> <b>public</b> <em>IConfined</em> getEmployee(String ID) {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre> <b>return</b> employees.get(ID); <span class="comment">// implicit widening to IConfined</span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">10</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">11</td>
+ <td><pre> <b>public</b> <b>void</b> payBonus(<em>IConfined</em> emp, <b>int</b> amount) {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">12</td>
+ <td><pre> ((Employee)emp).pay(amount); <span class="comment">// explicit narrowing</span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">13</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">14</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">15</td>
+ <td><pre><b>public</b> <b>class</b> Ma<b>in</b> {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">16</td>
+ <td><pre> <b>public</b> <b>static</b> <b>void</b> main(String[] args) {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">17</td>
+ <td><pre> <b>final</b> Company comp = <b>new</b> Company();</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">18</td>
+ <td><pre> <em>IConfined</em>&lt;@comp&gt; emp = comp.getEmployee("emp1");</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">19</td>
+ <td><pre> <span class="comment">// System.out.println(emp); &lt;– <span class="error"><strong>forbidden!</strong></span></span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">20</td>
+ <td><pre> comp.payBonus(emp, 100);</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">21</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">22</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="codecomment">
+ <h5>Effects:</h5>
+ <ul>
+ <li>The <code>protected</code> role <code>Employee</code> implements
+ the above described interface <code>IConfined</code> and therefore
+ becomes <strong>opaque</strong> (line 4).
+ </li>
+ <li>Methods sharing such an opaque role with the outside of the enclosing team
+ have to use the type <code>IConfined</code> (line 8, line 11).
+ </li>
+ <li>It is possible to obtain an instance of such a role by using the type <code>IConfined</code> (line 18).
+ </li>
+ <li>Trying to access any feature of this instance, for example <code>toString()</code>,
+ will cause a compilation error (line 19).
+ </li>
+ <li>Passing the opaque role reference back into the team works well (line 20).</li>
+ <li>Inside the team some conversions between the types <code>IConfined</code>
+ and the intrinsic role type <code>Employee</code> may be necessary (line 9 and 12).
+ </li>
+ </ul>
+ </div>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s6.html" rel="prev">&lt;&lt;&nbsp;&sect;6&nbsp;Object Teams API</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s8.html" rel="next">&sect;8&nbsp;Join Point Queries&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/s8.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/s8.html
new file mode 100644
index 000000000..a0afac20e
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/s8.html
@@ -0,0 +1,86 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s7.html" rel="prev">&lt;&lt;&nbsp;&sect;7&nbsp;Role Encapsulation</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s9.html" rel="next">&sect;9&nbsp;Value Dependent Classes&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="chapter" id="s8">
+ <div class="headl">
+ <div class="headr">
+ <h1>&sect;8&nbsp;Join Point Queries</h1>
+ </div>
+ </div>
+ <div id="toc-box">
+ <ul class="toc-box">
+ <li><a href="s8.html">&sect;8&nbsp;Join Point Queries</a></li>
+ <li><a href="#s8.1">&sect;8.1&nbsp;Join point queries</a></li>
+ <li><a href="#s8.2">&sect;8.2&nbsp;Query expressions</a></li>
+ <li><a href="#s8.3">&sect;8.3&nbsp;OT/J meta model</a></li>
+ </ul>
+ </div>
+ <div class="intro">
+ <h3>Defining sets of join points for interception</h3>
+ <div class="line"></div>
+ <div class="term">join point</div>
+ <div class="termdesc">In OT/J a join point is considered to be an element
+ of the program. A meta model exists which defines the <strong>kinds</strong>
+ of join points that can be identified.
+ </div>
+ <div class="line"></div>
+ <div class="term">join point interception</div>
+ <div class="termdesc">The purpose of identifying join points is to intercept program execution at these points
+ by means of <em>callin</em> bindings.
+ </div>
+ <div class="line"></div>
+ <div class="term">join point query</div>
+ <div class="termdesc">Sets of join points are defined using functional queries of the program's reflective representation.</div>
+ <div class="line"></div>
+ <div class="term"><i>pointcuts</i></div>
+ <div class="termdesc">Dynamic "pointcuts" comparable to AspectJ's <code>cflow</code> or even the Trace-Matches approach
+ are not subject to the join point language of OT/J. These features will be added at a different level
+ of abstraction. Note, that guard predicates (<a href="s5.html#s5.4" title="&sect;5.4&nbsp;Guard predicates" class="sect">&sect;5.4</a>) subsume the dynamic
+ capabilities of the pointcuts <code>if, target, this, args</code>.
+ </div>
+ <div class="line"></div>
+ </div>
+ <div class="sect depth2" id="s8.1">
+ <h2 class="sect">&sect;8.1&nbsp;Join point queries<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;8</a></span></h2>
+ <p><strong><em>This section will describe the query language used to define sets
+ of join points. As of version 1.4.0 of the OTDT this query language is not yet supported.</em></strong></p>
+ </div>
+ <div class="sect depth2" id="s8.2">
+ <h2 class="sect">&sect;8.2&nbsp;Query expressions<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;8</a></span></h2>
+ </div>
+ <div class="sect depth2" id="s8.3">
+ <h2 class="sect">&sect;8.3&nbsp;OT/J meta model<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;8</a></span></h2>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s7.html" rel="prev">&lt;&lt;&nbsp;&sect;7&nbsp;Role Encapsulation</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s9.html" rel="next">&sect;9&nbsp;Value Dependent Classes&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/s9.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/s9.html
new file mode 100644
index 000000000..1f1f77b5a
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/s9.html
@@ -0,0 +1,216 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s8.html" rel="prev">&lt;&lt;&nbsp;&sect;8&nbsp;Join Point Queries</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="sA.html" rel="next">&sect;A&nbsp;OT/J Syntax&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="chapter" id="s9">
+ <div class="headl">
+ <div class="headr">
+ <h1>&sect;9&nbsp;Value Dependent Classes</h1>
+ </div>
+ </div>
+ <div id="toc-box">
+ <ul class="toc-box">
+ <li><a href="s9.html">&sect;9&nbsp;Value Dependent Classes</a></li>
+ <li><a href="#s9.1">&sect;9.1&nbsp;Defining classes with value parameters</a></li>
+ <li><a href="#s9.2">&sect;9.2&nbsp;Using classes with value parameters</a></li>
+ <li><a href="#s9.3">&sect;9.3&nbsp;Restrictions and limitations</a></li>
+ </ul>
+ </div>
+ <div class="intro">
+ <h3>Generalizing externalized roles</h3>
+ <div class="line"></div>
+ <div class="term">Type Value Parameter</div>
+ <div class="termdesc">In addition to regular generics, a class may declare parameters that represent an object value.
+ Such a value parameter is called the <strong>type anchor</strong> for this class,
+ the class's type is said to be <strong>anchored</strong> to this parameter.
+ </div>
+ <div class="line"></div>
+ <div class="term">Value Dependent Classes</div>
+ <div class="termdesc">A class that declares one or more value parameters depends on the
+ runtime instance(s) denoted by its anchor(s).
+ </div>
+ <div class="line"></div>
+ <div class="term">Externalized Roles</div>
+ <div class="termdesc">The concept of externalized roles (<a href="s1.html#s1.2.2" title="&sect;1.2.2&nbsp;Externalized roles"
+ class="sect">&sect;1.2.2</a>)
+ is a special case of the concepts presented here.
+ </div>
+ <div class="line"></div>
+ </div>
+ <div class="sect depth2" id="s9.1">
+ <h2 class="sect">&sect;9.1&nbsp;Defining classes with value parameters<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;9</a></span></h2>
+ <div class="syntaxlink"><a href="sA.html#sA.9.1" title="&sect;A.9.1&nbsp;TypeParameter" class="syntax">&rarr;&nbsp;Syntax&nbsp;&sect;A.9.1</a></div>
+ <div class="subsect depth3" id="s9.1.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Value parameter declaration</span></h4>
+ <p>Within the angle brackets that mark the parameters of a generic class also value parameters
+ can be declared. In contrast to a type parameter, a value parameter is denoted as a pair
+ of two identifiers: a type and a free name, e.g.,
+
+ </p>
+ <div class="listing plain"><pre><b>class</b> MyClass<em>&lt;YourType aName&gt;</em> { ...</pre></div>
+ <p>Note that value parameters are valid for classes only, not for interfaces.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s9.1.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Value parameter application</span></h4>
+ <p>Within the given class (<code>MyClass</code>) the parameter name (<code>aName</code>) can be used
+ like a final field of the given type (<code>YourType</code>). In contrast to regular final fields
+ the assignment to this name occurs even before the constructor is executed.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s9.1.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Role types as dependent types</span></h4>
+ <p>Any role type can be interpreted as a value dependent type, however, in the declaration
+ of a role type the value parameter remains implicit: it is identical to the enclosing team instance.
+
+ </p>
+ </div>
+ </div>
+ <div class="sect depth2" id="s9.2">
+ <h2 class="sect">&sect;9.2&nbsp;Using classes with value parameters<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;9</a></span></h2>
+ <div class="syntaxlink"><a href="sA.html#sA.9.2" title="&sect;A.9.2&nbsp;ActualTypeArgument"
+ class="syntax">&rarr;&nbsp;Syntax&nbsp;&sect;A.9.2</a></div>
+ <p>When using a class which declares one or more value parameters (type anchors)
+ a corresponding <strong>anchor value</strong> has to be provided.
+
+ </p>
+ <div class="sect depth3" id="s9.2.1">
+ <h3 class="sect">&sect;9.2.1&nbsp;Parameter substitution<span class="toplink"><a href="#s9.2">&uarr;&nbsp;&sect;9.2</a></span></h3>
+ <p>Substitution of a type anchor of a class <code>MyClass&lt;YourType p&gt;</code> is denoted as
+ <code>MyClass&lt;@v&gt;</code>.
+ In this term <code>v</code> must be a value which is conform to the declaration of the value
+ parameter "<code>YourType p</code>", ie., <code>v</code> must have the static type <code>YourType</code>.
+ <br />
+ The value passed for substituting a type anchor must be a path of variables declared as <code>final</code>.
+ Obviously, only the first element in such a path can be a local variable or a method argument,
+ all other elements have to be fields. The reason for requiring final variables is
+ in type checking as discussed next.
+
+ </p>
+ <div class="note">
+ <h5>Note:</h5>
+ Externalized roles as defined in <a href="s1.html#s1.2.2.b"
+ title="&sect;1.2.2.(b)&nbsp;Declaration with anchored type"
+ class="sect">&sect;1.2.2.(b)</a> are
+ a special case of types with a value parameter, where the value
+ is an instance of the enclosing team.
+
+ </div>
+ <div class="subsect depth4" id="s9.2.1.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Instance constrained type parameters</span></h4>
+ <p>In addition to normal usage, a value parameter can be applied nested to a regular type parameter:
+
+ </p>
+ <div class="listing plain"><pre><b>class</b> MyClass&lt;YourType aName, DependentParam&lt;<em>@aName&gt;</em>&gt; { ...</pre></div>
+ <p>
+ Here the type parameter <code>DependentParam</code> is constrained to be anchored to <code>aName</code>.
+
+ </p>
+ <p>If a value parameter is used as a constraint for a regular type parameter
+ any substitution for the type parameter must also supply a value matching the value parameter.
+ The class from above could be applied like this:
+
+ </p>
+ <div class="listing plain"><pre><b>final</b> YourType anchor = <b>new</b> YourType();
+MyClass <em>&lt;anchor, YourDependent&lt;<strong>anchor</strong>&gt;&gt;</em></pre></div>
+ <p>Within the declaring element (class or method)
+ applications of the type variable representing the instance constrained type parameter
+ must repeat the anchor verbatim, i.e., no substitutions are performed here.
+
+ </p>
+ </div>
+ </div>
+ <div class="sect depth3" id="s9.2.2">
+ <h3 class="sect">&sect;9.2.2&nbsp;Type conformance<span class="toplink"><a href="#s9.2">&uarr;&nbsp;&sect;9.2</a></span></h3>
+ <p>Two value dependent types (anchored types) are considered conform only if the anchors
+ of both types refer to <i>the same object(s)</i>. The compiler must be able to statically
+ analyze this anchor identity.
+
+ </p>
+ <div class="subsect depth4" id="s9.2.2.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Substitutions for type anchors</span></h4>
+ <p>Only two substitutions are considered for determining anchor identity:
+
+ </p>
+ <ol>
+ <li>If a method signature uses <code>this</code> as the anchor of any of its types,
+ type checking an application of this method performs the following substitutions:
+ <br />
+ A simple <code>this</code> expression is substituted by the actual call target
+ of the method application.
+ <br />
+ A qualified <code>Outer.this</code> expression is substituted by the corresponding
+ enclosing instance of the call target.
+ </li>
+ <li>Assignments from a <code>final</code> identifier to another <code>final</code>
+ identifier are transitively followed, i.e., if <code>t1, t2</code> are final,
+ after an assignment <code>t1=t2</code> the types <code>C&lt;@t1&gt;</code> and
+ <code>C&lt;@t2&gt;</code> are considered identical. Otherwise <code>C&lt;@t1&gt;</code>
+ and <code>C&lt;@t2&gt;</code> are incommensurable.
+ <br />
+ Attaching an actual parameter to a formal parameter in a method call is also considered
+ as an assignment with respect to this rule.
+ </li>
+ </ol>
+ </div>
+ <div class="subsect depth4" id="s9.2.2.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Conformance of raw types</span></h4>
+ <p>After anchors have been proven identical, the raw types are checked for compatibility
+ using the standard Java rules.
+
+ </p>
+ </div>
+ </div>
+ </div>
+ <div class="sect depth2" id="s9.3">
+ <h2 class="sect">&sect;9.3&nbsp;Restrictions and limitations<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;9</a></span></h2>
+ <div class="subsect depth3" id="s9.3.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">No overriding</span></h4>
+ <p>Types with value parameters that are declared outside a team cannot be overridden,
+ as roles can be. Therefor, implicit inheritance does not apply for these types.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s9.3.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Only first parameter</span></h4>
+ <div class="note">
+ <p>Currently only the first parameter of a class may be a value parameter.
+ This restriction may be removed in the future.
+ </p>
+ </div>
+ </div>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s8.html" rel="prev">&lt;&lt;&nbsp;&sect;8&nbsp;Join Point Queries</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="sA.html" rel="next">&sect;A&nbsp;OT/J Syntax&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/sA.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/sA.html
new file mode 100644
index 000000000..14a76ab04
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/sA.html
@@ -0,0 +1,507 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s9.html" rel="prev">&lt;&lt;&nbsp;&sect;9&nbsp;Value Dependent Classes</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="sB.html" rel="next">&sect;B&nbsp;Changes between versions&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="chapter" id="sA">
+ <div class="headl">
+ <div class="headr">
+ <h1>&sect;A&nbsp;OT/J Syntax</h1>
+ </div>
+ </div>
+ <div id="toc-box">
+ <ul class="toc-box">
+ <li><a href="sA.html">&sect;A&nbsp;OT/J Syntax</a></li>
+ <li><a href="#sA.0">&sect;A.0&nbsp;Keywords</a></li>
+ <li><a href="#sA.1">&sect;A.1&nbsp;Class definitions</a></li>
+ <li><a href="#sA.2">&sect;A.2&nbsp;Modifiers</a></li>
+ <li><a href="#sA.3">&sect;A.3&nbsp;Method bindings</a></li>
+ <li><a href="#sA.4">&sect;A.4&nbsp;Parameter mappings</a></li>
+ <li><a href="#sA.5">&sect;A.5&nbsp;Statements</a></li>
+ <li><a href="#sA.6">&sect;A.6&nbsp;Types</a></li>
+ <li><a href="#sA.7">&sect;A.7&nbsp;Guard predicates</a></li>
+ <li><a href="#sA.8">&sect;A.8&nbsp;Precedence declaration</a></li>
+ <li><a href="#sA.9">&sect;A.9&nbsp;Value dependent types</a></li>
+ <li><a href="#sA.10">&sect;A.10&nbsp;Packages and imports</a></li>
+ </ul>
+ </div>
+ <div class="intro">
+ <h3>Notation</h3>
+ <p>The following grammar rules extend the Java grammar given in the
+ <a href="http://java.sun.com/docs/books/jls/second_edition/html/syntax.doc.html"
+ class="ext">Java Language Specification</a>.
+ We adopt the conventions of printing non-terminal symbols in italic font
+ (e.g., <tt><em>ClassDeclaration</em></tt>),
+ and terminal symbols in roman font (e.g., <tt>class</tt>).
+ Names printed in black refer to definitions from the original Java grammar.
+ Object Teams additions are printed in <strong class="blue">blue boldface</strong>.
+ For those rules that simply add a new option to an existing rule,
+ the original options are indicated by an ellipse (<code>...</code>).
+
+ </p>
+ </div>
+ <div class="sect depth2" id="sA.0">
+ <h2 class="sect">&sect;A.0&nbsp;Keywords<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;A</a></span></h2>
+ <p>The keywords introduced by OT/J have different scopes, which means outside their
+ given scope these keywords can be used for regular identifiers. Only these names
+ are keywords unconditionally:
+
+ </p>
+ <div class="listing plain"><pre>readonly, team, within</pre></div>
+ <div class="sect depth3" id="sA.0.1">
+ <h3 class="sect">&sect;A.0.1&nbsp;Scoped keywords<span class="toplink"><a href="#sA.0">&uarr;&nbsp;&sect;A.0</a></span></h3>
+ <p>The following names are keywords in OT/J only if they appear within a team or role class,
+ ie., after the keyword <strong class="blue">team</strong> has been recognized:
+
+ </p>
+ <div class="listing plain"><pre>as, base, callin, playedBy, precedence, tsuper, with, when</pre></div>
+ <p>These names are keywords only in the context of a callin or callout binding
+ respectively (<a href="#sA.3" title="&sect;A.3&nbsp;Method bindings" class="sect">&sect;A.3</a>):
+
+ </p>
+ <div class="listing plain"><pre>after, before, replace, get, set</pre></div>
+ </div>
+ <div class="sect depth3" id="sA.0.2">
+ <h3 class="sect">&sect;A.0.2&nbsp;Inheriting scoped keywords<span class="toplink"><a href="#sA.0">&uarr;&nbsp;&sect;A.0</a></span></h3>
+ <p>While regular Java classes may use the scoped keywords
+ (<a href="#sA.0.1" title="&sect;A.0.1&nbsp;Scoped keywords" class="sect">&sect;A.0.1</a>) of OT/J freely, it is an error if a role class
+ inherits a feature whose name is a scoped keyword.
+
+ </p>
+ </div>
+ <div class="sect depth3" id="sA.0.3">
+ <h3 class="sect">&sect;A.0.3&nbsp;Internal names<span class="toplink"><a href="#sA.0">&uarr;&nbsp;&sect;A.0</a></span></h3>
+ <p>Compiler and runtime environment generate internal methods and fields which start with
+ the prefix <code>_OT$</code>. It is illegal to use any of these methods and fields within client code.
+
+ </p>
+ </div>
+ </div>
+ <div class="sect depth2" id="sA.1">
+ <h2 class="sect">&sect;A.1&nbsp;Class definitions<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;A</a></span></h2>
+ <p>Class definitions add two new keywords <code>team</code> and
+ <code>playedBy</code>. Classes which use these keywords are called
+ <strong>teams</strong> and <strong>bound roles</strong>, respectively.
+ Any class that inherits from a bound role class (either by an
+ <code>extends</code> clause or by implicit inheritance, cf.
+ <a href="s1.html#s1.3.1.c"
+ title="&sect;1.3.1.(c)&nbsp;Overriding and implicit inheritance"
+ class="sect">&sect;1.3.1.(c)</a>) is again a bound role class.
+
+ </p>
+ <table class="syntaxrule" id="sA.1.1">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.1.1</td>
+ <td class="rule"><span class="title">ClassDeclaration</span><br /><em>[Modifiers] </em><strong class="blue"><em>[</em>team<em>]</em></strong> class <em>Identifier [</em>extends <em>Type] [</em>implements <em>TypeList]</em><br /><span class="indent5"></span><strong class="blue"><em>[</em>playedBy <em>Type] [Guard]</em></strong><em> ClassBody</em></td>
+ </tr>
+ </table>
+ <div class="constraints">
+ <h5 class="constraints">Contextual constraints:</h5>
+ <ol class="constraints">
+ <li>A class which has a <code>playedBy</code> clause (a <strong>bound
+ role</strong> class) may not be declared static and
+ must be directly contained in a class that has the
+ <code>team</code> modifier (a <strong>team</strong> class).
+ </li>
+ <li>A class which inherits from a team class must have the
+ <code>team</code> modifier, too.
+ </li>
+ <li>A class which has a guard (see <a href="s5.html#s5.4" title="&sect;5.4&nbsp;Guard predicates" class="sect">&sect;5.4</a>)
+ must be a team or a role.
+ </li>
+ </ol>
+ </div>
+ </div>
+ <div class="sect depth2" id="sA.2">
+ <h2 class="sect">&sect;A.2&nbsp;Modifiers<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;A</a></span></h2>
+ <p>The rule for method modifiers adds one keyword: <code>callin</code>:
+
+ </p>
+ <table class="syntaxrule" id="sA.2.1">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.2.1</td>
+ <td class="rule"><span class="title">Modifier</span><br />... <br /><strong class="blue">callin</strong></td>
+ </tr>
+ </table>
+ <div class="constraints">
+ <h5 class="constraints">Contextual constraints:</h5>
+ <ol class="constraints">
+ <li>The class of a method which has the <code>callin</code> modifier
+ may not be declared static and must be directly contained in a team class.
+ </li>
+ <li>A method that has the <code>callin</code> modifier may not
+ appear in an explicit method call (rule Apply in JLS).
+ </li>
+ </ol>
+ </div>
+ </div>
+ <div class="sect depth2" id="sA.3">
+ <h2 class="sect">&sect;A.3&nbsp;Method bindings<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;A</a></span></h2>
+ <p>The rule of items declarable in a class body is augmented by method
+ bindings:
+
+ </p>
+ <table class="syntaxrule" id="sA.3.1">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.3.1</td>
+ <td class="rule"><span class="title">ClassBodyDeclaration</span><br />... <br /><strong class="blue"><em>CalloutBinding</em></strong><br /><strong class="blue"><em>CallinBinding</em></strong></td>
+ </tr>
+ </table>
+ <table class="syntaxrule" id="sA.3.2">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.3.2</td>
+ <td class="rule"><span class="title">CalloutBinding</span><br /><em>[Modifier] [TypeArguments] <strong class="blue">MethodSpec CalloutKind MethodSpec CalloutParameterMappings</strong></em><br /><em>[Modifier] [TypeArguments] <strong class="blue">MethodSpec CalloutKind CalloutModifier FieldSpec</strong></em></td>
+ </tr>
+ </table>
+ <table class="syntaxrule" id="sA.3.3">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.3.3</td>
+ <td class="rule"><span class="title">Callin binding</span><br /><em>[ Identifier </em>:<em> ] [TypeArguments]</em><strong class="blue"><em> MethodSpec</em> &lt;- <em>CallinModifier MethodSpecs </em><br /><span class="indent5"></span>
+ [<em>Guard</em>]<em> CallinParameterMappings</em></strong></td>
+ </tr>
+ </table>
+ <table class="syntaxrule" id="sA.3.4">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.3.4</td>
+ <td class="rule"><span class="title">MethodSpec</span><br /><em>Identifier</em><br /><em>ResultType MethodDeclarator</em></td>
+ </tr>
+ </table>
+ <div class="note">
+ Note, that <em>ResultType</em> and <em>MethodDeclarator</em> are not explicit in the
+ overall syntax of the Java language specification. For convenience we refer to the definition in
+ section <a href="http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#40420"
+ class="ext">8.4. Method Declarations</a>
+ of the Java language specification.
+
+ </div>
+ <table class="syntaxrule" id="sA.3.5">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.3.5</td>
+ <td class="rule"><span class="title">MethodSpecs</span><br /><strong class="blue"><em>MethodSpec [</em>, <em>MethodSpecs]</em></strong></td>
+ </tr>
+ </table>
+ <table class="syntaxrule" id="sA.3.6">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.3.6</td>
+ <td class="rule"><span class="title">CalloutKind</span><br /><strong class="blue">-&gt;<br />=&gt;</strong></td>
+ </tr>
+ </table>
+ <table class="syntaxrule" id="sA.3.7">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.3.7</td>
+ <td class="rule"><span class="title">CallinModifier</span><br /><strong class="blue">before</strong><br /><strong class="blue">after</strong><br /><strong class="blue">replace</strong></td>
+ </tr>
+ </table>
+ <table class="syntaxrule" id="sA.3.8">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.3.8</td>
+ <td class="rule"><span class="title">CalloutModifier</span><br /><strong class="blue">get</strong><br /><strong class="blue">set</strong></td>
+ </tr>
+ </table>
+ <table class="syntaxrule" id="sA.3.9">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.3.9</td>
+ <td class="rule"><span class="title">FieldSpec</span><br /><em>[Type] Identifier</em></td>
+ </tr>
+ </table>
+ <div class="constraints">
+ <h5 class="constraints">Contextual constraints:</h5>
+ <ol class="constraints">
+ <li><code>CalloutBinding</code>s and <code>CallinBinding</code>s
+ may occur only in bound role classes.
+ </li>
+ <li>A <code>CalloutBinding</code> or <code>CallinBinding</code>
+ may not mix identifiers and full signatures (<code>MethodDeclarationHead</code>)
+ for its method specifiers (<code>MethodSpec</code>).
+ <br />
+ Binding a full method signature to a field requires the <code>FieldSpec</code>
+ to include the <code>Type</code>.
+ </li>
+ <li>The method specifier at the left hand side of a
+ <code>CallinBinding</code> which has the <code>replace</code> modifier
+ must refer to a method that has the <code>callin</code> modifier.
+ </li>
+ <li>The <code>Modifier</code> of a callout binding can only be one of the visility
+ modifiers <code>public</code>, <code>protected</code> or <code>private</code>.
+ A short callout binding (i.e., without signatures) must not specify
+ a visibility modifier.
+ </li>
+ </ol>
+ </div>
+ </div>
+ <div class="sect depth2" id="sA.4">
+ <h2 class="sect">&sect;A.4&nbsp;Parameter mappings<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;A</a></span></h2>
+ <table class="syntaxrule" id="sA.4.1">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.4.1</td>
+ <td class="rule"><span class="title">CalloutParameterMappings</span><br /><strong class="blue">with { <em>CalloutParameterMappingList [,]</em> }</strong><br /><strong class="blue">;</strong></td>
+ </tr>
+ </table>
+ <table class="syntaxrule" id="sA.4.2">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.4.2</td>
+ <td class="rule"><span class="title">CallinParameterMappings</span><br /><strong class="blue">with { <em>CallinParameterMappingList [,]</em> }</strong><br /><strong class="blue">;</strong></td>
+ </tr>
+ </table>
+ <table class="syntaxrule" id="sA.4.3">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.4.3</td>
+ <td class="rule"><span class="title">CalloutParameterMappingList</span><br /><strong class="blue"><em>CalloutParameterMapping [</em>,<em> CalloutParameterMappingList]</em></strong></td>
+ </tr>
+ </table>
+ <table class="syntaxrule" id="sA.4.4">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.4.4</td>
+ <td class="rule"><span class="title">CallinParameterMappingList</span><br /><strong class="blue"><em>CallinParameterMapping [</em>,<em> CallinParameterMappingList]</em></strong></td>
+ </tr>
+ </table>
+ <table class="syntaxrule" id="sA.4.5">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.4.5</td>
+ <td class="rule"><span class="title">CalloutParameterMapping</span><br /><em>Expression</em><strong class="blue"> -&gt; </strong><em>Identifier</em><br /><strong class="blue">result &lt;- </strong><em>Expression</em></td>
+ </tr>
+ </table>
+ <table class="syntaxrule" id="sA.4.6">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.4.6</td>
+ <td class="rule"><span class="title">CallinParameterMapping</span><br /><em>Identifier</em><strong class="blue"> &lt;- </strong><em>Expression</em><br /><em>Expression</em><strong class="blue"> -&gt; </strong><strong class="blue">result</strong></td>
+ </tr>
+ </table>
+ <div class="note">
+ <h5>Note:</h5>
+ By defining ";" as an option for parameter mappings, the grammar enforces that
+ method bindings without a parameter mapping are terminated by a ";".
+ Also method bindings with parameter mappings may optionally be terminated by a ";",
+ which in that case is interpreted as an empty member declaration, following the
+ same pattern how non-abstract methods in Java may optionally have a trailing ";".
+
+ </div>
+ </div>
+ <div class="sect depth2" id="sA.5">
+ <h2 class="sect">&sect;A.5&nbsp;Statements<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;A</a></span></h2>
+ <table class="syntaxrule" id="sA.5.1">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.5.1</td>
+ <td class="rule"><span class="title">Statement</span><br />... <br /><em><strong class="blue">Within</strong><br /><strong class="blue">BaseCall</strong><br /><strong class="blue">TSuperCall</strong></em></td>
+ </tr>
+ </table>
+ <table class="syntaxrule" id="sA.5.2">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.5.2</td>
+ <td class="rule"><span class="title">Within</span><br /><strong class="blue">within</strong> ( <em>Expression</em> ) <em>Statement</em></td>
+ </tr>
+ </table>
+ <table class="syntaxrule" id="sA.5.3">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.5.3</td>
+ <td class="rule"><span class="title">BaseCall</span><br /><strong class="blue">base</strong> . <em>Identifier</em> ( <em>Arguments<sub>opt</sub></em> )
+ <br /><strong class="blue">base</strong> ( <em>Arguments<sub>opt</sub></em> )
+
+ </td>
+ </tr>
+ </table>
+ <table class="syntaxrule" id="sA.5.4">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.5.4</td>
+ <td class="rule"><span class="title">TSuperCall</span><br /><strong class="blue">tsuper</strong> . <em>Identifier</em> ( <em>Arguments<sub>opt</sub></em> )
+ <br /><strong class="blue">tsuper</strong> ( <em>Arguments<sub>opt</sub></em> )
+
+ </td>
+ </tr>
+ </table>
+ <div class="constraints">
+ <h5 class="constraints">Contextual constraints:</h5>
+ <ol class="constraints">
+ <li>The expression of a <code>Within</code> must evaluate
+ to an instance of a team class.
+ </li>
+ <li>The first form of a <code>BaseCall</code> may occur only
+ in the body of a method that has the <code>callin</code> modifier.
+ The identifier must be the name of the enclosing method.
+ </li>
+ <li>The second form of a <code>BaseCall</code> may occur only in a constructor of a
+ bound role class.
+ </li>
+ <li>The first form of a <code>TSuperCall</code> may occur only in a method of
+ a role class.
+ </li>
+ <li>The second form of a <code>TSuperCall</code> may occur only in a constructor of a
+ role class.
+ </li>
+ </ol>
+ </div>
+ </div>
+ <div class="sect depth2" id="sA.6">
+ <h2 class="sect">&sect;A.6&nbsp;Types<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;A</a></span></h2>
+ <table class="syntaxrule" id="sA.6.1">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.6.1</td>
+ <td class="rule"><span class="title">Type</span><br />... <br /><strong class="blue"><em>LiftingType</em></strong><br /><strong class="blue"><em>AnchoredType</em></strong></td>
+ </tr>
+ </table>
+ <table class="syntaxrule" id="sA.6.2">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.6.2</td>
+ <td class="rule"><span class="title">LiftingType</span><br /><em>Type</em><strong class="blue"> as </strong><em>Type</em></td>
+ </tr>
+ </table>
+ <table class="syntaxrule" id="sA.6.3">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.6.3</td>
+ <td class="rule"><span class="title">AnchoredType</span><br /><strong class="blue"><em>Path</em></strong>.<em>Type</em></td>
+ </tr>
+ </table>
+ <table class="syntaxrule" id="sA.6.4">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.6.4</td>
+ <td class="rule"><span class="title">Path</span><br /><em>Identifier</em><br /><strong class="blue"><em>Path</em></strong>.<em>Identifier</em></td>
+ </tr>
+ </table>
+ <div class="constraints">
+ <h5 class="constraints">Contextual constraints:</h5>
+ <ol class="constraints">
+ <li id="sA.6.a"><span class="title">Location</span><br />
+ A <code>LiftingType</code> may only occur in the parameter list
+ of a method of a team class.
+
+ </li>
+ <li id="sA.6.b"><span class="title">Role in scope</span><br />
+ The right hand side type in a <code>LiftingType</code>
+ must be a class directly contained in the enclosing team class
+ (the class may be acquired by <a href="s1.html#s1.3.1.c"
+ title="&sect;1.3.1.(c)&nbsp;Overriding and implicit inheritance"
+ class="sect">implicit inheritance (&sect;1.3.1.(c))</a>).
+
+ </li>
+ <li id="sA.6.c"><span class="title">Team path</span><br /><em>Note, that the syntax of &sect;A.6.3/4 is deprecated in favor of <a href="#sA.9" title="&sect;A.9&nbsp;Value dependent types" class="sect">&sect;A.9</a></em>.
+ <br />
+ The path in an <code>AnchoredType</code> must refer to an instance of a team class.
+ Each identifier in the path must be declared with the <code>final</code> modifier.
+
+ </li>
+ </ol>
+ </div>
+ </div>
+ <div class="sect depth2" id="sA.7">
+ <h2 class="sect">&sect;A.7&nbsp;Guard predicates<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;A</a></span></h2>
+ <table class="syntaxrule" id="sA.7.1">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.7.1</td>
+ <td class="rule"><span class="title">Guard</span><br /><strong class="blue"><em>[</em>base<em>]</em> when</strong> ( <em>Expression</em> )
+
+ </td>
+ </tr>
+ </table>
+ <table class="syntaxrule" id="sA.7.2">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.7.2</td>
+ <td class="rule"><span class="title">MethodDeclaration</span><br />...<br /><em>MethodHeader <strong class="blue">[Guard]</strong> MethodBody</em></td>
+ </tr>
+ </table>
+ <p>Other rules referring to <em><code>Guard</code></em>:
+ <a href="#sA.1.1" title="&sect;A.1.1&nbsp;ClassDeclaration" class="sect">ClassDeclaration (&sect;A.1.1)</a>,
+ <a href="#sA.3.3" title="&sect;A.3.3&nbsp;Callin binding" class="sect">CallinBinding (&sect;A.3.3)</a></p>
+ <div class="constraints">
+ <h5 class="constraints">Contextual constraints:</h5>
+ <ol class="constraints">
+ <li>The <code>Expression</code> in a guard must have type <code>boolean</code>.
+ </li>
+ </ol>
+ </div>
+ </div>
+ <div class="sect depth2" id="sA.8">
+ <h2 class="sect">&sect;A.8&nbsp;Precedence declaration<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;A</a></span></h2>
+ <table class="syntaxrule" id="sA.8.1">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.8.1</td>
+ <td class="rule"><span class="title">PrecedenceDeclaration</span><br /><strong class="blue">precedence</strong><em> CallinNameList</em> ;
+
+ </td>
+ </tr>
+ </table>
+ <table class="syntaxrule" id="sA.8.2">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.8.2</td>
+ <td class="rule"><span class="title">CallinNameList</span><br /><em>Name [, CallinNameList]</em></td>
+ </tr>
+ </table>
+ </div>
+ <div class="sect depth2" id="sA.9">
+ <h2 class="sect">&sect;A.9&nbsp;Value dependent types<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;A</a></span></h2>
+ <table class="syntaxrule" id="sA.9.1">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.9.1</td>
+ <td class="rule"><span class="title">TypeParameter</span><br /><em>TypeVariable [TypeBound]</em><br /><strong class="blue"><em>ReferenceType Name</em></strong></td>
+ </tr>
+ </table>
+ <p>See <a href="http://java.sun.com/docs/books/jls/third_edition/html/typesValues.html#108850"
+ class="ext">JLS 3 &sect;4.4</a></p>
+ <table class="syntaxrule" id="sA.9.2">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.9.2</td>
+ <td class="rule"><span class="title">ActualTypeArgument</span><br /><em>ReferenceType</em><br /><em>Wildcard</em><br /><strong class="blue"><em>@Name</em></strong></td>
+ </tr>
+ </table>
+ <p>See <a href="http://java.sun.com/docs/books/jls/third_edition/html/typesValues.html#107353"
+ class="ext">JLS 3 &sect;4.5.1</a></p>
+ <div class="constraints">
+ <h5 class="constraints">Contextual constraints:</h5>
+ <ol class="constraints">
+ <li id="sA.9.a"><span class="title">ActualTypeParameter</span><br />
+ An <code>ActualTypeArgument</code> of the form <code>@Name</code> may only occur
+ as a parameter of a simple name type reference.
+
+ </li>
+ </ol>
+ </div>
+ </div>
+ <div class="sect depth2" id="sA.10">
+ <h2 class="sect">&sect;A.10&nbsp;Packages and imports<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;A</a></span></h2>
+ <table class="syntaxrule" id="sA.10.1">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.10.1</td>
+ <td class="rule"><span class="title">PackageDeclaration</span><br />...<br /><strong class="blue">team </strong><em>QualifiedName</em> ;
+
+ </td>
+ </tr>
+ </table>
+ <table class="syntaxrule" id="sA.10.2">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.10.2</td>
+ <td class="rule"><span class="title">Import</span><br />...<br /><strong>import </strong><strong class="blue">base </strong><em>QualifiedName</em> ;
+
+ </td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s9.html" rel="prev">&lt;&lt;&nbsp;&sect;9&nbsp;Value Dependent Classes</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="sB.html" rel="next">&sect;B&nbsp;Changes between versions&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/sB.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/sB.html
new file mode 100644
index 000000000..ee285eac4
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/sB.html
@@ -0,0 +1,401 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="sA.html" rel="prev">&lt;&lt;&nbsp;&sect;A&nbsp;OT/J Syntax</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="chapter" id="sB">
+ <div class="headl">
+ <div class="headr">
+ <h1>&sect;B&nbsp;Changes between versions</h1>
+ </div>
+ </div>
+ <div id="toc-box">
+ <ul class="toc-box">
+ <li><a href="sB.html">&sect;B&nbsp;Changes between versions</a></li>
+ <li><a href="#sB.1">&sect;B.1&nbsp;Paragraphs changed between versions</a></li>
+ <li><a href="#sB.2">&sect;B.2&nbsp;Additions between versions</a></li>
+ </ul>
+ </div>
+ <div class="sect depth2" id="sB.1">
+ <h2 class="sect">&sect;B.1&nbsp;Paragraphs changed between versions<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;B</a></span></h2>
+ <div class="subsect depth3" id="sB.1.1">
+ <h4 class="subsect">(1)&nbsp;<span class="title">Between OTJLD 1.0 and OTJLD 1.1</span></h4>
+ <ul>
+ <li><a href="s3.html#s3.2.a" title="&sect;3.2.(a)&nbsp;with clause" class="sect">&sect;3.2.(a)</a> :
+ <strong>Parameter mappings</strong><p>
+ Disallow parameter mappings in a role interface.
+
+ </p>
+ </li>
+ <li><a href="s4.html#s4.5.d" title="&sect;4.5.(d)&nbsp;Typing rules" class="sect">&sect;4.5.(d)</a> :
+ <strong>Replace bindings</strong><p>
+ Disallow unsafe use of polymorphism and primitive type conversions.
+
+ </p>
+ </li>
+ <li><a href="s6.html#s6.1.a"
+ title="&sect;6.1.(a)&nbsp;Interface to the role registry"
+ class="sect">&sect;6.1.(a)</a> :
+ <strong>Signatures of reflective methods</strong><p>
+ Made two methods generic so that return values can be used without the need of casting.
+
+ </p>
+ </li>
+ <li><a href="s7.html#s7.2" title="&sect;7.2&nbsp;Confined roles" class="sect">&sect;7.2</a> :
+ <strong>Confined roles</strong><p>
+ Improved explanation.
+
+ </p>
+ </li>
+ </ul>
+ </div>
+ <div class="subsect depth3" id="sB.1.2">
+ <h4 class="subsect">(2)&nbsp;<span class="title">Between OTJLD 1.1 and OTJLD 1.2</span></h4>
+ <ul>
+ <li><a href="s1.html#s1.2.1.e" title="&sect;1.2.1.(e)&nbsp;Role features"
+ class="sect">&sect;1.2.1.(e)</a>:
+ <strong>Visibility of role features</strong><p>
+ Clarification has been added that a role can always access all the
+ features that its enclosing team has access to.
+
+ </p>
+ </li>
+ <li><a href="s2.html#s2.1.2.e"
+ title="&sect;2.1.2.(e)&nbsp;No free type parameters"
+ class="sect">&sect;2.1.2.(e)</a>:
+ <strong>Generic roles/bases</strong><p>
+ Relaxed the rules about generic bound roles. This change also subsumes what previously was a specific restriction in
+ <a href="s4.html#s4.1.b"
+ title="&sect;4.1.(b)&nbsp;Prerequisite: Class binding"
+ class="sect">&sect;4.1.(b)</a>.
+
+ </p>
+ </li>
+ <li><a href="s3.html#s3.1.i" title="&sect;3.1.(i)&nbsp;Shorthand definition"
+ class="sect">&sect;3.1.(i)</a> and <a href="s3.html#s3.5.f" title="&sect;3.5.(f)&nbsp;Shorthand definition"
+ class="sect">&sect;3.5.(f)</a>:
+ <strong>Visibility of shorthand callout</strong><p>
+ A role method defined by a shorthand callout binding can now specify a visibility modifier
+ (see also <a href="sA.html#sA.3.2" title="&sect;A.3.2&nbsp;CalloutBinding" class="sect">&sect;A.3.2</a>),
+ otherwise it inherits the visibility modifier of it's bound base method/field.
+
+ </p>
+ </li>
+ <li><a href="s3.html#s3.1.j" title="&sect;3.1.(j)&nbsp;Inferred callout"
+ class="sect">&sect;3.1.(j)</a> and <a href="s3.html#s3.5.h" title="&sect;3.5.(h)&nbsp;Inferred callout"
+ class="sect">&sect;3.5.(h)</a>:
+ <strong>Visibility of inferred callout</strong><p>
+ Role methods inferred as a callout binding are either <code>public</code>
+ (inferred via interface) or <code>private</code> inferred from
+ self call / field access.
+
+ </p>
+ </li>
+ <li><a href="s3.html#s3.5.h" title="&sect;3.5.(h)&nbsp;Inferred callout"
+ class="sect">&sect;3.5.(h)</a>:
+ <strong>No explicit use of inferred callout to field</strong><p>
+ Clarification has been added that an accessor method generated for an inferred callout to field
+ can not be explicitly invoked.
+
+ </p>
+ </li>
+ <li><a href="s4.html#s4.1.b"
+ title="&sect;4.1.(b)&nbsp;Prerequisite: Class binding"
+ class="sect">&sect;4.1.(b)</a>:
+ <strong>No callin in generic role</strong><p>
+ A restriction has been made explicit that a generic role cannot define callin bindings.
+
+ </p>
+ </li>
+ <li><a href="s4.html#s4.2.d" title="&sect;4.2.(d)&nbsp;Callin methods"
+ class="sect">&sect;4.2.(d)</a> :
+ <strong>Callin methods</strong><p>Slightly rephrased and extended the rule to make explicit that a callin method can
+ indeed be intercepted using a second level callin binding.
+
+ </p>
+ </li>
+ <li><a href="s6.html#s6.1.a"
+ title="&sect;6.1.(a)&nbsp;Interface to the role registry"
+ class="sect">&sect;6.1.(a)</a> :
+ <strong>Reflective methods <code>getAllRoles</code></strong><p>
+ More precision: answer only <em>bound</em> roles.
+
+ </p>
+ </li>
+ </ul>
+ </div>
+ <div class="subsect depth3" id="sB.1.3">
+ <h4 class="subsect">(3)&nbsp;<span class="title">Between OTJLD 1.2 and OTJLD 1.3</span></h4>
+ <ul>
+ <li><a href="s1.html#s1.2.4.c" title="&sect;1.2.4.(c)&nbsp;Class literal"
+ class="sect">&sect;1.2.4.(c)</a> :
+ <strong>Syntax for role class literals</strong><p>Previously, the syntax <code>R&lt;@t&gt;.class</code> was not supported.
+ This restriction has been removed.
+
+ </p>
+ </li>
+ <li><a href="s1.html#s1.3"
+ title="&sect;1.3&nbsp;Acquisition and implicit inheritance of role classes"
+ class="sect">&sect;1.3</a> :
+ <strong>Teams extending non-team classes</strong><p>Previously, <code>org.objectteams.Team</code> was the super class of all team classes.
+ As a consequence a team could not extend a non-team class.
+ This restriction has been removed by introducing a new super-type of all teams,
+ the interface <code>org.objectteams.ITeam</code>.
+ This change also affects some paragraphs in <a href="s6.html" title="&sect;6&nbsp;Object Teams API" class="sect">&sect;6</a> as members
+ have been moved to the new interface.
+
+ </p>
+ </li>
+ <li><a href="s4.html#s4.4.c"
+ title="&sect;4.4.(c)&nbsp;Mapping the result of a base method"
+ class="sect">&sect;4.4.(c)</a> :
+ <strong>Further restrict result mapping in after callin bindings</strong><p>Clarify that <code>after</code> callin bindings cannot use the <code>-&gt;</code>
+ token to map a result value.
+
+ </p>
+ </li>
+ <li><a href="s4.html#s4.10" title="&sect;4.10&nbsp;Generic callin bindings"
+ class="sect">&sect;4.10</a>, <a href="s4.html#s4.10.a" title="&sect;4.10.(a)&nbsp;Fresh type parameter"
+ class="sect">&sect;4.10.(a)</a> :
+ <strong>Generic callin bindings</strong><p>Minor changes to give room for new paragraph <a href="s4.html#s4.10.e"
+ title="&sect;4.10.(e)&nbsp;Propagating type parameters"
+ class="sect">&sect;4.10.(e)</a>.
+ </p>
+ </li>
+ <li><a href="s5.html#s5.4.1.a" title="&sect;5.4.1.(a)&nbsp;Method binding guards"
+ class="sect">&sect;5.4.1.(a)</a> :
+ <strong>Scope of regular binding guard</strong><p>Removed an erroneous sentence about the special identifier <code>result</code> in a regular method binding guard.
+ Since parameter mappings are applied before evaluating the guard, the result value can be accessed through
+ a result mapping (<a href="s4.html#s4.4.c"
+ title="&sect;4.4.(c)&nbsp;Mapping the result of a base method"
+ class="sect">&sect;4.4.(c)</a>). Furthermore, the sentence actually confused
+ base and role sides.
+
+ </p>
+ </li>
+ <li><a href="sA.html#sA.3.2" title="&sect;A.3.2&nbsp;CalloutBinding" class="sect">&sect;A.3.2</a>, <a href="sA.html#sA.3.3" title="&sect;A.3.3&nbsp;Callin binding" class="sect">&sect;A.3.3</a> :
+ <strong>Syntax: generic method bindings</strong><p>The location of possible type parameters in a method binding has been made explicit.</p>
+ </li>
+ </ul>
+ </div>
+ </div>
+ <div class="sect depth2" id="sB.2">
+ <h2 class="sect">&sect;B.2&nbsp;Additions between versions<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;B</a></span></h2>
+ <div class="subsect depth3" id="sB.2.1">
+ <h4 class="subsect">(1)&nbsp;<span class="title">Between OTJLD 1.0 and OTJLD 1.1</span></h4>
+ <ul>
+ <li><a href="s1.html#s1.2.4.c" title="&sect;1.2.4.(c)&nbsp;Class literal"
+ class="sect">&sect;1.2.4.(c)</a>:
+ <strong>Role class literal</strong><p>
+ Made existing feature explicit and introduce new qualified class literal for externalized roles.
+
+ </p>
+ </li>
+ <li><a href="s3.html#s3.1.j" title="&sect;3.1.(j)&nbsp;Inferred callout"
+ class="sect">&sect;3.1.(j)</a> and <a href="s3.html#s3.5.h" title="&sect;3.5.(h)&nbsp;Inferred callout"
+ class="sect">&sect;3.5.(h)</a> :
+ <strong>Inferred callout</strong><p>
+ New feature.
+
+ </p>
+ </li>
+ <li><a href="s4.html#s4.6.a"
+ title="&sect;4.6.(a)&nbsp;Private methods from super classes"
+ class="sect">&sect;4.6.(a)</a> :
+ <strong>Callin-binding private methods from super classes</strong><p>
+ Added a necessary restriction.
+
+ </p>
+ </li>
+ <li><a href="s4.html#s4.9" title="&sect;4.9&nbsp;Callin inheritance" class="sect">&sect;4.9</a> :
+ <strong>Callin inheritance</strong><p>
+ Clarified issues that where under-specified or insufficiently explained, specifically:
+
+ </p>
+ <ul>
+ <li>Effect of callin bindings on inherited or overridden base methods
+ (<a href="s4.html#s4.9.1" title="&sect;4.9.1&nbsp;Base side inheritance"
+ class="sect">&sect;4.9.1</a>).
+ </li>
+ <li>Interplay of callin bindings and base methods with covariant return types
+ (<a href="s4.html#s4.9.3" title="&sect;4.9.3&nbsp;Covariant return types"
+ class="sect">&sect;4.9.3</a>)
+ </li>
+ </ul>
+ </li>
+ <li><a href="s4.html#s4.10" title="&sect;4.10&nbsp;Generic callin bindings"
+ class="sect">&sect;4.10</a>:
+ <strong>Generic replace bindings</strong><p>
+ Reconcile type safety of replace bindings as introduced in <a href="s4.html#s4.5.d" title="&sect;4.5.(d)&nbsp;Typing rules" class="sect">&sect;4.5.(d)</a>
+ with desirable flexibility by using type parameters.
+
+ </p>
+ </li>
+ <li><a href="s7.html#s7.2.b" title="&sect;7.2.(b)&nbsp;Arrays of Confined"
+ class="sect">&sect;7.2.(b)</a> :
+ <strong>Arrays of Confined</strong><p>
+ Added a necessary restriction.
+
+ </p>
+ </li>
+ </ul>
+ </div>
+ <div class="subsect depth3" id="sB.2.2">
+ <h4 class="subsect">(2)&nbsp;<span class="title">Between OTJLD 1.1 and OTJLD 1.2</span></h4>
+ <ul>
+ <li><a href="s1.html#s1.2.2.h" title="&sect;1.2.2.(h)&nbsp;Externalized creation"
+ class="sect">&sect;1.2.2.(h)</a> :
+ <strong>Externalized creation</strong><p>Added alternative syntax using value parameter and changed title.</p>
+ </li>
+ <li><a href="s1.html#s1.2.5.f" title="&sect;1.2.5.(f)&nbsp;Imports in role files"
+ class="sect">&sect;1.2.5.(f)</a> :
+ <strong>Imports in role files</strong><p>Added a missing rule defining the effect of imports in role files.</p>
+ </li>
+ <li><a href="s1.html#s1.3.1.c"
+ title="&sect;1.3.1.(c)&nbsp;Overriding and implicit inheritance"
+ class="sect">&sect;1.3.1.(c)</a> :
+ <strong>@Override annotation for roles</strong><p>The regular <code>@Override</code> annotation (Java &ge;5) has been extended to apply to role classes, too.
+
+ </p>
+ </li>
+ <li><a href="s1.html#s1.3.1.k" title="&sect;1.3.1.(k)&nbsp;Covariant return types"
+ class="sect">&sect;1.3.1.(k)</a> :
+ <strong>Covariant return types</strong><p>Necessary constraint for covariant return types in the presence of both implicit and explicit inheritance.
+
+ </p>
+ </li>
+ <li><a href="s2.html#s2.1.2.c"
+ title="&sect;2.1.2.(c)&nbsp;Base class decapsulation"
+ class="sect">&sect;2.1.2.(c)</a> :
+ <strong>Binding to final base class</strong><p>It has been added that binding to a final base class is now considered as decapsulation, too.
+
+ </p>
+ </li>
+ <li><a href="s2.html#s2.2.f" title="&sect;2.2.(f)&nbsp;Ambiguous lowering"
+ class="sect">&sect;2.2.(f)</a> :
+ <strong>Ambiguous lowering</strong><p>A diagnostic has been added to detect situations where lowering might be intended
+ but fails because the declared type is <code>java.lang.Object</code>,
+ which makes a potential lowering translation unnecessary and thus ambiguous.
+
+ </p>
+ </li>
+ <li><a href="s2.html#s2.3.2.e"
+ title="&sect;2.3.2.(e)&nbsp;Generic declared lifting"
+ class="sect">&sect;2.3.2.(e)</a> :
+ <strong>Generic declared lifting</strong><p>Support passing unrelated base types into the same method with declared lifting.
+
+ </p>
+ </li>
+ <li><a href="s2.html#s2.6.g"
+ title="&sect;2.6.(g)&nbsp;Decapsulation via base reference"
+ class="sect">&sect;2.6.(g)</a> :
+ <strong>Decapsulation via base reference</strong><p>Extended applicability of decapsulation to two more positions.
+
+ </p>
+ </li>
+ <li><a href="s4.html#s4.3.f" title="&sect;4.3.(f)&nbsp;Base super calls"
+ class="sect">&sect;4.3.(f)</a> :
+ <strong>Base super call</strong><p>Support base calls directly to the super version of the bound base method,
+ thus bypassing both the exact bound base method and also any further callins
+ relating to this base method or its super version.
+
+ </p>
+ </li>
+ <li><a href="s5.html#s5.4.b" title="&sect;5.4.(b)&nbsp;No side effects"
+ class="sect">&sect;5.4.(b)</a> :
+ <strong>Side-effects in guard predicates</strong><p>Migrate previous note about a future feature to a regular paragraph.</p>
+ </li>
+ <li><a href="s5.html#s5.4.c" title="&sect;5.4.(c)&nbsp;Exceptions" class="sect">&sect;5.4.(c)</a> :
+ <strong>Exceptions in guard predicates</strong><p>Clarify the effect of exceptions thrown from a guard predicate.</p>
+ </li>
+ <li><a href="s6.html#s6.2.d" title="&sect;6.2.(d)&nbsp;Exceptions" class="sect">&sect;6.2.(d)</a> :
+ <strong>LiftingVetoException</strong><p>Added documentation for the mostly internal <code>LiftingVetoException</code> and how
+ it could actually be used in client code.
+
+ </p>
+ </li>
+ <li><a href="s6.html#s6.2.e" title="&sect;6.2.(e)&nbsp;Role migration"
+ class="sect">&sect;6.2.(e)</a> :
+ <strong>Role migration</strong><p>Added two interfaces to add migration capabilities to a role class.
+
+ </p>
+ </li>
+ </ul>
+ </div>
+ <div class="subsect depth3" id="sB.2.3">
+ <h4 class="subsect">(3)&nbsp;<span class="title">Between OTJLD 1.2 and OTJLD 1.3</span></h4>
+ <ul>
+ <li><a href="s3.html#s3.1.k" title="&sect;3.1.(k)&nbsp;Callout to generic method"
+ class="sect">&sect;3.1.(k)</a> :
+ <strong>Callout to generic method</strong><p>Added a rule on how a callout binding may refer to a generic base method.
+
+ </p>
+ </li>
+ <li><a href="s4.html#s4.1.h" title="&sect;4.1.(h)&nbsp;Method of enclosing class"
+ class="sect">&sect;4.1.(h)</a> :
+ <strong>Binding to team methods</strong><p><code>before</code> and <code>after</code> callin bindings can now
+ bind to methods of an enclosing class, too.
+
+ </p>
+ </li>
+ <li><a href="s4.html#s4.10.e"
+ title="&sect;4.10.(e)&nbsp;Propagating type parameters"
+ class="sect">&sect;4.10.(e)</a> :
+ <strong>Propagating type parameters in callin bindings</strong><p>
+ In addition to capturing covariant return types, a callin binding
+ may also declared type parameters in order to propagate genericity
+ from its base method to the role method.
+
+ </p>
+ </li>
+ <li><a href="s5.html#s5.3.d"
+ title="&sect;5.3.(d)&nbsp;Configuring implicit activation"
+ class="sect">&sect;5.3.(d)</a> :
+ <strong>Configuring implicit activation</strong><p>Mechanisms have been added for configuring implicit team activation.
+ The default has been changed to not apply implicit activation.
+ A corresponding note has also been added to <a href="s5.html#s5.3" title="&sect;5.3&nbsp;Implicit team activation"
+ class="sect">&sect;5.3</a></p>
+ </li>
+ <li><a href="s9.html#s9.2.1.a"
+ title="&sect;9.2.1.(a)&nbsp;Instance constrained type parameters"
+ class="sect">&sect;9.2.1.(a)</a> :
+ <strong>Instance constrained type parameter</strong><p>
+ Type anchors can now be applied to type parameters, too,
+ thus expressing a new kind of constraint on the type parameter.
+
+ </p>
+ </li>
+ </ul>
+ </div>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="sA.html" rel="prev">&lt;&lt;&nbsp;&sect;A&nbsp;OT/J Syntax</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/xhtml11-flat.dtd b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/xhtml11-flat.dtd
new file mode 100644
index 000000000..00d3f045b
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/xhtml11-flat.dtd
@@ -0,0 +1,4615 @@
+<!-- ....................................................................... -->
+<!-- XHTML 1.1 DTD ........................................................ -->
+<!-- file: xhtml11.dtd
+-->
+
+<!-- XHTML 1.1 DTD
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+
+ The Extensible HyperText Markup Language (XHTML)
+ Copyright 1998-2005 World Wide Web Consortium
+ (Massachusetts Institute of Technology, European Research Consortium
+ for Informatics and Mathematics, Keio University).
+ All Rights Reserved.
+
+ Permission to use, copy, modify and distribute the XHTML DTD and its
+ accompanying documentation for any purpose and without fee is hereby
+ granted in perpetuity, provided that the above copyright notice and
+ this paragraph appear in all copies. The copyright holders make no
+ representation about the suitability of the DTD for any purpose.
+
+ It is provided "as is" without expressed or implied warranty.
+
+ Author: Murray M. Altheim <altheim@eng.sun.com>
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $
+
+-->
+<!-- This is the driver file for version 1.1 of the XHTML DTD.
+
+ Please use this public identifier to identify it:
+
+ "-//W3C//DTD XHTML 1.1//EN"
+-->
+<!ENTITY % XHTML.version "-//W3C//DTD XHTML 1.1//EN" >
+
+<!-- Use this URI to identify the default namespace:
+
+ "http://www.w3.org/1999/xhtml"
+
+ See the Qualified Names module for information
+ on the use of namespace prefixes in the DTD.
+
+ Note that XHTML namespace elements are not prefixed by default,
+ but the XHTML namespace prefix is defined as "xhtml" so that
+ other markup languages can extend this one and use the XHTML
+ prefixed global attributes if required.
+
+-->
+<!ENTITY % NS.prefixed "IGNORE" >
+<!ENTITY % XHTML.prefix "xhtml" >
+
+<!-- Be sure to include prefixed global attributes - we don't need
+ them, but languages that extend XHTML 1.1 might.
+-->
+<!ENTITY % XHTML.global.attrs.prefixed "INCLUDE" >
+
+<!-- Reserved for use with the XLink namespace:
+-->
+<!ENTITY % XLINK.xmlns "" >
+<!ENTITY % XLINK.xmlns.attrib "" >
+
+<!-- For example, if you are using XHTML 1.1 directly, use the public
+ identifier in the DOCTYPE declaration, with the namespace declaration
+ on the document element to identify the default namespace:
+
+ <?xml version="1.0"?>
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
+ "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+ <html xmlns="http://www.w3.org/1999/xhtml"
+ xml:lang="en">
+ ...
+ </html>
+
+ Revisions:
+ (none)
+-->
+
+<!-- reserved for future use with document profiles -->
+<!ENTITY % XHTML.profile "" >
+
+<!-- ensure XHTML Notations are disabled -->
+<!ENTITY % xhtml-notations.module "IGNORE" >
+
+<!-- Bidirectional Text features
+ This feature-test entity is used to declare elements
+ and attributes used for bidirectional text support.
+-->
+<!ENTITY % XHTML.bidi "INCLUDE" >
+
+<?doc type="doctype" role="title" { XHTML 1.1 } ?>
+
+<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
+
+<!-- Pre-Framework Redeclaration placeholder .................... -->
+<!-- this serves as a location to insert markup declarations
+ into the DTD prior to the framework declarations.
+-->
+<!ENTITY % xhtml-prefw-redecl.module "IGNORE" >
+<![%xhtml-prefw-redecl.module;[
+%xhtml-prefw-redecl.mod;
+<!-- end of xhtml-prefw-redecl.module -->]]>
+
+<!ENTITY % xhtml-events.module "INCLUDE" >
+
+<!-- Inline Style Module ........................................ -->
+<!ENTITY % xhtml-inlstyle.module "INCLUDE" >
+<![%xhtml-inlstyle.module;[
+<!ENTITY % xhtml-inlstyle.mod
+ PUBLIC "-//W3C//ELEMENTS XHTML Inline Style 1.0//EN"
+ "http://www.w3.org/MarkUp/DTD/xhtml-inlstyle-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Inline Style Module ........................................... -->
+<!-- file: xhtml-inlstyle-1.mod
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+ Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ENTITIES XHTML Inline Style 1.0//EN"
+ SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-inlstyle-1.mod"
+
+ Revisions:
+ (none)
+ ....................................................................... -->
+
+<!-- Inline Style
+
+ This module declares the 'style' attribute, used to support inline
+ style markup. This module must be instantiated prior to the XHTML
+ Common Attributes module in order to be included in %Core.attrib;.
+-->
+
+<!ENTITY % style.attrib
+ "style CDATA #IMPLIED"
+>
+
+
+<!ENTITY % Core.extra.attrib
+ "%style.attrib;"
+>
+
+<!-- end of xhtml-inlstyle-1.mod -->
+]]>
+
+<!-- declare Document Model module instantiated in framework
+-->
+<!ENTITY % xhtml-model.mod
+ PUBLIC "-//W3C//ENTITIES XHTML 1.1 Document Model 1.0//EN"
+ "http://www.w3.org/MarkUp/DTD/xhtml11-model-1.mod" >
+
+<!-- Modular Framework Module (required) ......................... -->
+<!ENTITY % xhtml-framework.module "INCLUDE" >
+<![%xhtml-framework.module;[
+<!ENTITY % xhtml-framework.mod
+ PUBLIC "-//W3C//ENTITIES XHTML Modular Framework 1.0//EN"
+ "http://www.w3.org/MarkUp/DTD/xhtml-framework-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Modular Framework Module ...................................... -->
+<!-- file: xhtml-framework-1.mod
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+ Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $ SMI
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ENTITIES XHTML Modular Framework 1.0//EN"
+ SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-framework-1.mod"
+
+ Revisions:
+ (none)
+ ....................................................................... -->
+
+<!-- Modular Framework
+
+ This required module instantiates the modules needed
+ to support the XHTML modularization model, including:
+
+ + notations
+ + datatypes
+ + namespace-qualified names
+ + common attributes
+ + document model
+ + character entities
+
+ The Intrinsic Events module is ignored by default but
+ occurs in this module because it must be instantiated
+ prior to Attributes but after Datatypes.
+-->
+
+<!ENTITY % xhtml-arch.module "IGNORE" >
+<![%xhtml-arch.module;[
+<!ENTITY % xhtml-arch.mod
+ PUBLIC "-//W3C//ELEMENTS XHTML Base Architecture 1.0//EN"
+ "xhtml-arch-1.mod" >
+%xhtml-arch.mod;]]>
+
+<!ENTITY % xhtml-notations.module "INCLUDE" >
+<![%xhtml-notations.module;[
+<!ENTITY % xhtml-notations.mod
+ PUBLIC "-//W3C//NOTATIONS XHTML Notations 1.0//EN"
+ "xhtml-notations-1.mod" >
+%xhtml-notations.mod;]]>
+
+<!ENTITY % xhtml-datatypes.module "INCLUDE" >
+<![%xhtml-datatypes.module;[
+<!ENTITY % xhtml-datatypes.mod
+ PUBLIC "-//W3C//ENTITIES XHTML Datatypes 1.0//EN"
+ "xhtml-datatypes-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Datatypes Module .............................................. -->
+<!-- file: xhtml-datatypes-1.mod
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+ Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $ SMI
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ENTITIES XHTML Datatypes 1.0//EN"
+ SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-datatypes-1.mod"
+
+ Revisions:
+ (none)
+ ....................................................................... -->
+
+<!-- Datatypes
+
+ defines containers for the following datatypes, many of
+ these imported from other specifications and standards.
+-->
+
+<!-- Length defined for cellpadding/cellspacing -->
+
+<!-- nn for pixels or nn% for percentage length -->
+<!ENTITY % Length.datatype "CDATA" >
+
+<!-- space-separated list of link types -->
+<!ENTITY % LinkTypes.datatype "NMTOKENS" >
+
+<!-- single or comma-separated list of media descriptors -->
+<!ENTITY % MediaDesc.datatype "CDATA" >
+
+<!-- pixel, percentage, or relative -->
+<!ENTITY % MultiLength.datatype "CDATA" >
+
+<!-- one or more digits (NUMBER) -->
+<!ENTITY % Number.datatype "CDATA" >
+
+<!-- integer representing length in pixels -->
+<!ENTITY % Pixels.datatype "CDATA" >
+
+<!-- script expression -->
+<!ENTITY % Script.datatype "CDATA" >
+
+<!-- textual content -->
+<!ENTITY % Text.datatype "CDATA" >
+
+<!-- Imported Datatypes ................................ -->
+
+<!-- a single character from [ISO10646] -->
+<!ENTITY % Character.datatype "CDATA" >
+
+<!-- a character encoding, as per [RFC2045] -->
+<!ENTITY % Charset.datatype "CDATA" >
+
+<!-- a space separated list of character encodings, as per [RFC2045] -->
+<!ENTITY % Charsets.datatype "CDATA" >
+
+<!-- Color specification using color name or sRGB (#RRGGBB) values -->
+<!ENTITY % Color.datatype "CDATA" >
+
+<!-- media type, as per [RFC2045] -->
+<!ENTITY % ContentType.datatype "CDATA" >
+
+<!-- comma-separated list of media types, as per [RFC2045] -->
+<!ENTITY % ContentTypes.datatype "CDATA" >
+
+<!-- date and time information. ISO date format -->
+<!ENTITY % Datetime.datatype "CDATA" >
+
+<!-- formal public identifier, as per [ISO8879] -->
+<!ENTITY % FPI.datatype "CDATA" >
+
+<!-- a language code, as per [RFC3066] or its successor -->
+<!ENTITY % LanguageCode.datatype "CDATA" >
+
+<!-- a Uniform Resource Identifier, see [URI] -->
+<!ENTITY % URI.datatype "CDATA" >
+
+<!-- a space-separated list of Uniform Resource Identifiers, see [URI] -->
+<!ENTITY % URIs.datatype "CDATA" >
+
+<!-- end of xhtml-datatypes-1.mod -->
+]]>
+
+<!-- placeholder for XLink support module -->
+<!ENTITY % xhtml-xlink.mod "" >
+
+
+<!ENTITY % xhtml-qname.module "INCLUDE" >
+<![%xhtml-qname.module;[
+<!ENTITY % xhtml-qname.mod
+ PUBLIC "-//W3C//ENTITIES XHTML Qualified Names 1.0//EN"
+ "xhtml-qname-1.mod" >
+<!-- ....................................................................... -->
+<!-- XHTML Qname Module ................................................... -->
+<!-- file: xhtml-qname-1.mod
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+ Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $ SMI
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ENTITIES XHTML Qualified Names 1.0//EN"
+ SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-qname-1.mod"
+
+ Revisions:
+#2000-10-22: added qname declarations for ruby elements
+ ....................................................................... -->
+
+<!-- XHTML Qname (Qualified Name) Module
+
+ This module is contained in two parts, labeled Section 'A' and 'B':
+
+ Section A declares parameter entities to support namespace-
+ qualified names, namespace declarations, and name prefixing
+ for XHTML and extensions.
+
+ Section B declares parameter entities used to provide
+ namespace-qualified names for all XHTML element types:
+
+ %applet.qname; the xmlns-qualified name for <applet>
+ %base.qname; the xmlns-qualified name for <base>
+ ...
+
+ XHTML extensions would create a module similar to this one.
+ Included in the XHTML distribution is a template module
+ ('template-qname-1.mod') suitable for this purpose.
+-->
+
+<!-- Section A: XHTML XML Namespace Framework :::::::::::::::::::: -->
+
+<!-- 1. Declare a %XHTML.prefixed; conditional section keyword, used
+ to activate namespace prefixing. The default value should
+ inherit '%NS.prefixed;' from the DTD driver, so that unless
+ overridden, the default behaviour follows the overall DTD
+ prefixing scheme.
+-->
+<!ENTITY % NS.prefixed "IGNORE" >
+<!ENTITY % XHTML.prefixed "%NS.prefixed;" >
+
+<!-- By default, we always permit XHTML attribute collections to have
+ namespace-qualified prefixes as well.
+-->
+<!ENTITY % XHTML.global.attrs.prefixed "INCLUDE" >
+<!-- By default, we allow the XML Schema attributes on the root
+ element.
+-->
+<!ENTITY % XHTML.xsi.attrs "INCLUDE" >
+
+<!-- 2. Declare a parameter entity (eg., %XHTML.xmlns;) containing
+ the URI reference used to identify the XHTML namespace:
+-->
+<!ENTITY % XHTML.xmlns "http://www.w3.org/1999/xhtml" >
+
+<!-- 3. Declare parameter entities (eg., %XHTML.prefix;) containing
+ the default namespace prefix string(s) to use when prefixing
+ is enabled. This may be overridden in the DTD driver or the
+ internal subset of an document instance. If no default prefix
+ is desired, this may be declared as an empty string.
+
+ NOTE: As specified in [XMLNAMES], the namespace prefix serves
+ as a proxy for the URI reference, and is not in itself significant.
+-->
+<!ENTITY % XHTML.prefix "xhtml" >
+
+<!-- 4. Declare parameter entities (eg., %XHTML.pfx;) containing the
+ colonized prefix(es) (eg., '%XHTML.prefix;:') used when
+ prefixing is active, an empty string when it is not.
+-->
+<![%XHTML.prefixed;[
+<!ENTITY % XHTML.pfx "%XHTML.prefix;:" >
+]]>
+<!ENTITY % XHTML.pfx "" >
+
+<!-- declare qualified name extensions here ............ -->
+<!ENTITY % xhtml-qname-extra.mod "" >
+
+
+<!-- 5. The parameter entity %XHTML.xmlns.extra.attrib; may be
+ redeclared to contain any non-XHTML namespace declaration
+ attributes for namespaces embedded in XHTML. The default
+ is an empty string. XLink should be included here if used
+ in the DTD.
+-->
+<!ENTITY % XHTML.xmlns.extra.attrib "" >
+
+<!-- The remainder of Section A is only followed in XHTML, not extensions. -->
+
+<!-- Declare a parameter entity %NS.decl.attrib; containing
+ all XML Namespace declarations used in the DTD, plus the
+ xmlns declaration for XHTML, its form dependent on whether
+ prefixing is active.
+-->
+<!ENTITY % XHTML.xmlns.attrib.prefixed
+ "xmlns:%XHTML.prefix; %URI.datatype; #FIXED '%XHTML.xmlns;'"
+>
+<![%XHTML.prefixed;[
+<!ENTITY % NS.decl.attrib
+ "%XHTML.xmlns.attrib.prefixed;
+ %XHTML.xmlns.extra.attrib;"
+>
+]]>
+<!ENTITY % NS.decl.attrib
+ "%XHTML.xmlns.extra.attrib;"
+>
+
+<!-- Declare a parameter entity %XSI.prefix as a prefix to use for XML
+ Schema Instance attributes.
+-->
+<!ENTITY % XSI.prefix "xsi" >
+
+<!ENTITY % XSI.xmlns "http://www.w3.org/2001/XMLSchema-instance" >
+
+<!-- Declare a parameter entity %XSI.xmlns.attrib as support for the
+ schemaLocation attribute, since this is legal throughout the DTD.
+-->
+<!ENTITY % XSI.xmlns.attrib
+ "xmlns:%XSI.prefix; %URI.datatype; #FIXED '%XSI.xmlns;'" >
+
+<!-- This is a placeholder for future XLink support.
+-->
+<!ENTITY % XLINK.xmlns.attrib "" >
+
+<!-- This is the attribute for the XML Schema namespace - XHTML
+ Modularization is also expressed in XML Schema, and it needs to
+ be legal to declare the XML Schema namespace and the
+ schemaLocation attribute on the root element of XHTML family
+ documents.
+-->
+<![%XHTML.xsi.attrs;[
+<!ENTITY % XSI.prefix "xsi" >
+<!ENTITY % XSI.pfx "%XSI.prefix;:" >
+<!ENTITY % XSI.xmlns "http://www.w3.org/2001/XMLSchema-instance" >
+
+<!ENTITY % XSI.xmlns.attrib
+ "xmlns:%XSI.prefix; %URI.datatype; #FIXED '%XSI.xmlns;'"
+>
+]]>
+<!ENTITY % XSI.prefix "" >
+<!ENTITY % XSI.pfx "" >
+<!ENTITY % XSI.xmlns.attrib "" >
+
+
+<!-- Declare a parameter entity %NS.decl.attrib; containing all
+ XML namespace declaration attributes used by XHTML, including
+ a default xmlns attribute when prefixing is inactive.
+-->
+<![%XHTML.prefixed;[
+<!ENTITY % XHTML.xmlns.attrib
+ "%NS.decl.attrib;
+ %XSI.xmlns.attrib;
+ %XLINK.xmlns.attrib;"
+>
+]]>
+<!ENTITY % XHTML.xmlns.attrib
+ "xmlns %URI.datatype; #FIXED '%XHTML.xmlns;'
+ %NS.decl.attrib;
+ %XSI.xmlns.attrib;
+ %XLINK.xmlns.attrib;"
+>
+
+<!-- placeholder for qualified name redeclarations -->
+<!ENTITY % xhtml-qname.redecl "" >
+
+
+<!-- Section B: XHTML Qualified Names ::::::::::::::::::::::::::::: -->
+
+<!-- 6. This section declares parameter entities used to provide
+ namespace-qualified names for all XHTML element types.
+-->
+
+<!-- module: xhtml-applet-1.mod -->
+<!ENTITY % applet.qname "%XHTML.pfx;applet" >
+
+<!-- module: xhtml-base-1.mod -->
+<!ENTITY % base.qname "%XHTML.pfx;base" >
+
+<!-- module: xhtml-bdo-1.mod -->
+<!ENTITY % bdo.qname "%XHTML.pfx;bdo" >
+
+<!-- module: xhtml-blkphras-1.mod -->
+<!ENTITY % address.qname "%XHTML.pfx;address" >
+<!ENTITY % blockquote.qname "%XHTML.pfx;blockquote" >
+<!ENTITY % pre.qname "%XHTML.pfx;pre" >
+<!ENTITY % h1.qname "%XHTML.pfx;h1" >
+<!ENTITY % h2.qname "%XHTML.pfx;h2" >
+<!ENTITY % h3.qname "%XHTML.pfx;h3" >
+<!ENTITY % h4.qname "%XHTML.pfx;h4" >
+<!ENTITY % h5.qname "%XHTML.pfx;h5" >
+<!ENTITY % h6.qname "%XHTML.pfx;h6" >
+
+<!-- module: xhtml-blkpres-1.mod -->
+<!ENTITY % hr.qname "%XHTML.pfx;hr" >
+
+<!-- module: xhtml-blkstruct-1.mod -->
+<!ENTITY % div.qname "%XHTML.pfx;div" >
+<!ENTITY % p.qname "%XHTML.pfx;p" >
+
+<!-- module: xhtml-edit-1.mod -->
+<!ENTITY % ins.qname "%XHTML.pfx;ins" >
+<!ENTITY % del.qname "%XHTML.pfx;del" >
+
+<!-- module: xhtml-form-1.mod -->
+<!ENTITY % form.qname "%XHTML.pfx;form" >
+<!ENTITY % label.qname "%XHTML.pfx;label" >
+<!ENTITY % input.qname "%XHTML.pfx;input" >
+<!ENTITY % select.qname "%XHTML.pfx;select" >
+<!ENTITY % optgroup.qname "%XHTML.pfx;optgroup" >
+<!ENTITY % option.qname "%XHTML.pfx;option" >
+<!ENTITY % textarea.qname "%XHTML.pfx;textarea" >
+<!ENTITY % fieldset.qname "%XHTML.pfx;fieldset" >
+<!ENTITY % legend.qname "%XHTML.pfx;legend" >
+<!ENTITY % button.qname "%XHTML.pfx;button" >
+
+<!-- module: xhtml-hypertext-1.mod -->
+<!ENTITY % a.qname "%XHTML.pfx;a" >
+
+<!-- module: xhtml-image-1.mod -->
+<!ENTITY % img.qname "%XHTML.pfx;img" >
+
+<!-- module: xhtml-inlphras-1.mod -->
+<!ENTITY % abbr.qname "%XHTML.pfx;abbr" >
+<!ENTITY % acronym.qname "%XHTML.pfx;acronym" >
+<!ENTITY % cite.qname "%XHTML.pfx;cite" >
+<!ENTITY % code.qname "%XHTML.pfx;code" >
+<!ENTITY % dfn.qname "%XHTML.pfx;dfn" >
+<!ENTITY % em.qname "%XHTML.pfx;em" >
+<!ENTITY % kbd.qname "%XHTML.pfx;kbd" >
+<!ENTITY % q.qname "%XHTML.pfx;q" >
+<!ENTITY % samp.qname "%XHTML.pfx;samp" >
+<!ENTITY % strong.qname "%XHTML.pfx;strong" >
+<!ENTITY % var.qname "%XHTML.pfx;var" >
+
+<!-- module: xhtml-inlpres-1.mod -->
+<!ENTITY % b.qname "%XHTML.pfx;b" >
+<!ENTITY % big.qname "%XHTML.pfx;big" >
+<!ENTITY % i.qname "%XHTML.pfx;i" >
+<!ENTITY % small.qname "%XHTML.pfx;small" >
+<!ENTITY % sub.qname "%XHTML.pfx;sub" >
+<!ENTITY % sup.qname "%XHTML.pfx;sup" >
+<!ENTITY % tt.qname "%XHTML.pfx;tt" >
+
+<!-- module: xhtml-inlstruct-1.mod -->
+<!ENTITY % br.qname "%XHTML.pfx;br" >
+<!ENTITY % span.qname "%XHTML.pfx;span" >
+
+<!-- module: xhtml-ismap-1.mod (also csismap, ssismap) -->
+<!ENTITY % map.qname "%XHTML.pfx;map" >
+<!ENTITY % area.qname "%XHTML.pfx;area" >
+
+<!-- module: xhtml-link-1.mod -->
+<!ENTITY % link.qname "%XHTML.pfx;link" >
+
+<!-- module: xhtml-list-1.mod -->
+<!ENTITY % dl.qname "%XHTML.pfx;dl" >
+<!ENTITY % dt.qname "%XHTML.pfx;dt" >
+<!ENTITY % dd.qname "%XHTML.pfx;dd" >
+<!ENTITY % ol.qname "%XHTML.pfx;ol" >
+<!ENTITY % ul.qname "%XHTML.pfx;ul" >
+<!ENTITY % li.qname "%XHTML.pfx;li" >
+
+<!-- module: xhtml-meta-1.mod -->
+<!ENTITY % meta.qname "%XHTML.pfx;meta" >
+
+<!-- module: xhtml-param-1.mod -->
+<!ENTITY % param.qname "%XHTML.pfx;param" >
+
+<!-- module: xhtml-object-1.mod -->
+<!ENTITY % object.qname "%XHTML.pfx;object" >
+
+<!-- module: xhtml-script-1.mod -->
+<!ENTITY % script.qname "%XHTML.pfx;script" >
+<!ENTITY % noscript.qname "%XHTML.pfx;noscript" >
+
+<!-- module: xhtml-struct-1.mod -->
+<!ENTITY % html.qname "%XHTML.pfx;html" >
+<!ENTITY % head.qname "%XHTML.pfx;head" >
+<!ENTITY % title.qname "%XHTML.pfx;title" >
+<!ENTITY % body.qname "%XHTML.pfx;body" >
+
+<!-- module: xhtml-style-1.mod -->
+<!ENTITY % style.qname "%XHTML.pfx;style" >
+
+<!-- module: xhtml-table-1.mod -->
+<!ENTITY % table.qname "%XHTML.pfx;table" >
+<!ENTITY % caption.qname "%XHTML.pfx;caption" >
+<!ENTITY % thead.qname "%XHTML.pfx;thead" >
+<!ENTITY % tfoot.qname "%XHTML.pfx;tfoot" >
+<!ENTITY % tbody.qname "%XHTML.pfx;tbody" >
+<!ENTITY % colgroup.qname "%XHTML.pfx;colgroup" >
+<!ENTITY % col.qname "%XHTML.pfx;col" >
+<!ENTITY % tr.qname "%XHTML.pfx;tr" >
+<!ENTITY % th.qname "%XHTML.pfx;th" >
+<!ENTITY % td.qname "%XHTML.pfx;td" >
+
+<!-- module: xhtml-ruby-1.mod -->
+
+<!ENTITY % ruby.qname "%XHTML.pfx;ruby" >
+<!ENTITY % rbc.qname "%XHTML.pfx;rbc" >
+<!ENTITY % rtc.qname "%XHTML.pfx;rtc" >
+<!ENTITY % rb.qname "%XHTML.pfx;rb" >
+<!ENTITY % rt.qname "%XHTML.pfx;rt" >
+<!ENTITY % rp.qname "%XHTML.pfx;rp" >
+
+<!-- Provisional XHTML 2.0 Qualified Names ...................... -->
+
+<!-- module: xhtml-image-2.mod -->
+<!ENTITY % alt.qname "%XHTML.pfx;alt" >
+
+<!-- end of xhtml-qname-1.mod -->
+]]>
+
+<!ENTITY % xhtml-events.module "IGNORE" >
+<![%xhtml-events.module;[
+<!ENTITY % xhtml-events.mod
+ PUBLIC "-//W3C//ENTITIES XHTML Intrinsic Events 1.0//EN"
+ "xhtml-events-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Intrinsic Events Module ....................................... -->
+<!-- file: xhtml-events-1.mod
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+ Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $ SMI
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ENTITIES XHTML Intrinsic Events 1.0//EN"
+ SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-events-1.mod"
+
+ Revisions:
+ (none)
+ ....................................................................... -->
+
+<!-- Intrinsic Event Attributes
+
+ These are the event attributes defined in HTML 4,
+ Section 18.2.3 "Intrinsic Events". This module must be
+ instantiated prior to the Attributes Module but after
+ the Datatype Module in the Modular Framework module.
+
+ "Note: Authors of HTML documents are advised that changes
+ are likely to occur in the realm of intrinsic events
+ (e.g., how scripts are bound to events). Research in
+ this realm is carried on by members of the W3C Document
+ Object Model Working Group (see the W3C Web site at
+ http://www.w3.org/ for more information)."
+-->
+<!-- NOTE: Because the ATTLIST declarations in this module occur
+ before their respective ELEMENT declarations in other
+ modules, there may be a dependency on this module that
+ should be considered if any of the parameter entities used
+ for element type names (eg., %a.qname;) are redeclared.
+-->
+
+<!ENTITY % Events.attrib
+ "onclick %Script.datatype; #IMPLIED
+ ondblclick %Script.datatype; #IMPLIED
+ onmousedown %Script.datatype; #IMPLIED
+ onmouseup %Script.datatype; #IMPLIED
+ onmouseover %Script.datatype; #IMPLIED
+ onmousemove %Script.datatype; #IMPLIED
+ onmouseout %Script.datatype; #IMPLIED
+ onkeypress %Script.datatype; #IMPLIED
+ onkeydown %Script.datatype; #IMPLIED
+ onkeyup %Script.datatype; #IMPLIED"
+>
+
+<![%XHTML.global.attrs.prefixed;[
+<!ENTITY % XHTML.global.events.attrib
+ "%XHTML.prefix;:onclick %Script.datatype; #IMPLIED
+ %XHTML.prefix;:ondblclick %Script.datatype; #IMPLIED
+ %XHTML.prefix;:onmousedown %Script.datatype; #IMPLIED
+ %XHTML.prefix;:onmouseup %Script.datatype; #IMPLIED
+ %XHTML.prefix;:onmouseover %Script.datatype; #IMPLIED
+ %XHTML.prefix;:onmousemove %Script.datatype; #IMPLIED
+ %XHTML.prefix;:onmouseout %Script.datatype; #IMPLIED
+ %XHTML.prefix;:onkeypress %Script.datatype; #IMPLIED
+ %XHTML.prefix;:onkeydown %Script.datatype; #IMPLIED
+ %XHTML.prefix;:onkeyup %Script.datatype; #IMPLIED"
+>
+]]>
+
+<!-- additional attributes on anchor element
+-->
+<!ATTLIST %a.qname;
+ onfocus %Script.datatype; #IMPLIED
+ onblur %Script.datatype; #IMPLIED
+>
+
+<!-- additional attributes on form element
+-->
+<!ATTLIST %form.qname;
+ onsubmit %Script.datatype; #IMPLIED
+ onreset %Script.datatype; #IMPLIED
+>
+
+<!-- additional attributes on label element
+-->
+<!ATTLIST %label.qname;
+ onfocus %Script.datatype; #IMPLIED
+ onblur %Script.datatype; #IMPLIED
+>
+
+<!-- additional attributes on input element
+-->
+<!ATTLIST %input.qname;
+ onfocus %Script.datatype; #IMPLIED
+ onblur %Script.datatype; #IMPLIED
+ onselect %Script.datatype; #IMPLIED
+ onchange %Script.datatype; #IMPLIED
+>
+
+<!-- additional attributes on select element
+-->
+<!ATTLIST %select.qname;
+ onfocus %Script.datatype; #IMPLIED
+ onblur %Script.datatype; #IMPLIED
+ onchange %Script.datatype; #IMPLIED
+>
+
+<!-- additional attributes on textarea element
+-->
+<!ATTLIST %textarea.qname;
+ onfocus %Script.datatype; #IMPLIED
+ onblur %Script.datatype; #IMPLIED
+ onselect %Script.datatype; #IMPLIED
+ onchange %Script.datatype; #IMPLIED
+>
+
+<!-- additional attributes on button element
+-->
+<!ATTLIST %button.qname;
+ onfocus %Script.datatype; #IMPLIED
+ onblur %Script.datatype; #IMPLIED
+>
+
+<!-- additional attributes on body element
+-->
+<!ATTLIST %body.qname;
+ onload %Script.datatype; #IMPLIED
+ onunload %Script.datatype; #IMPLIED
+>
+
+<!-- additional attributes on area element
+-->
+<!ATTLIST %area.qname;
+ onfocus %Script.datatype; #IMPLIED
+ onblur %Script.datatype; #IMPLIED
+>
+
+<!-- end of xhtml-events-1.mod -->
+]]>
+
+<!ENTITY % xhtml-attribs.module "INCLUDE" >
+<![%xhtml-attribs.module;[
+<!ENTITY % xhtml-attribs.mod
+ PUBLIC "-//W3C//ENTITIES XHTML Common Attributes 1.0//EN"
+ "xhtml-attribs-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Common Attributes Module ...................................... -->
+<!-- file: xhtml-attribs-1.mod
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+ Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $ SMI
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ENTITIES XHTML Common Attributes 1.0//EN"
+ SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-attribs-1.mod"
+
+ Revisions:
+ (none)
+ ....................................................................... -->
+
+<!-- Common Attributes
+
+ This module declares many of the common attributes for the XHTML DTD.
+ %NS.decl.attrib; is declared in the XHTML Qname module.
+
+ Note that this file was extended in XHTML Modularization Second Edition to
+ include declarations of "global" versions of the attribute collections.
+ The global versions of the attributes are for use on elements in other
+ namespaces. The global version of "common" includes the xmlns declaration
+ for the prefixed version of the xhtml namespace. If you are only using a
+ specific attribute or an individual attribute collection, you must also
+ include the XHTML.xmlns.attrib.prefixed PE on your elements.
+-->
+
+<!ENTITY % id.attrib
+ "id ID #IMPLIED"
+>
+
+<![%XHTML.global.attrs.prefixed;[
+<!ENTITY % XHTML.global.id.attrib
+ "%XHTML.prefix;:id ID #IMPLIED"
+>
+]]>
+
+<!ENTITY % class.attrib
+ "class NMTOKENS #IMPLIED"
+>
+
+<![%XHTML.global.attrs.prefixed;[
+<!ENTITY % XHTML.global.class.attrib
+ "%XHTML.prefix;:class NMTOKENS #IMPLIED"
+>
+]]>
+
+<!ENTITY % title.attrib
+ "title %Text.datatype; #IMPLIED"
+>
+
+<![%XHTML.global.attrs.prefixed;[
+<!ENTITY % XHTML.global.title.attrib
+ "%XHTML.prefix;:title %Text.datatype; #IMPLIED"
+>
+]]>
+
+<!ENTITY % Core.extra.attrib "" >
+
+<!ENTITY % Core.attrib
+ "%XHTML.xmlns.attrib;
+ %id.attrib;
+ %class.attrib;
+ %title.attrib;
+ xml:space ( preserve ) #FIXED 'preserve'
+ %Core.extra.attrib;"
+>
+
+<!ENTITY % XHTML.global.core.extra.attrib "" >
+
+<![%XHTML.global.attrs.prefixed;[
+
+<!ENTITY % XHTML.global.core.attrib
+ "%XHTML.global.id.attrib;
+ %XHTML.global.class.attrib;
+ %XHTML.global.title.attrib;
+ %XHTML.global.core.extra.attrib;"
+>
+]]>
+
+<!ENTITY % XHTML.global.core.attrib "" >
+
+
+<!ENTITY % lang.attrib
+ "xml:lang %LanguageCode.datatype; #IMPLIED"
+>
+
+<![%XHTML.bidi;[
+<!ENTITY % dir.attrib
+ "dir ( ltr | rtl ) #IMPLIED"
+>
+
+<!ENTITY % I18n.attrib
+ "%dir.attrib;
+ %lang.attrib;"
+>
+
+<![%XHTML.global.attrs.prefixed;[
+<!ENTITY XHTML.global.i18n.attrib
+ "%XHTML.prefix;:dir ( ltr | rtl ) #IMPLIED
+ %lang.attrib;"
+>
+]]>
+<!ENTITY XHTML.global.i18n.attrib "" >
+
+]]>
+<!ENTITY % I18n.attrib
+ "%lang.attrib;"
+>
+<!ENTITY % XHTML.global.i18n.attrib
+ "%lang.attrib;"
+>
+
+<!ENTITY % Common.extra.attrib "" >
+<!ENTITY % XHTML.global.common.extra.attrib "" >
+
+<!-- intrinsic event attributes declared previously
+-->
+<!ENTITY % Events.attrib "" >
+
+<!ENTITY % XHTML.global.events.attrib "" >
+
+<!ENTITY % Common.attrib
+ "%Core.attrib;
+ %I18n.attrib;
+ %Events.attrib;
+ %Common.extra.attrib;"
+>
+
+<!ENTITY % XHTML.global.common.attrib
+ "%XHTML.xmlns.attrib.prefixed;
+ %XHTML.global.core.attrib;
+ %XHTML.global.i18n.attrib;
+ %XHTML.global.events.attrib;
+ %XHTML.global.common.extra.attrib;"
+>
+
+<!-- end of xhtml-attribs-1.mod -->
+]]>
+
+<!-- placeholder for content model redeclarations -->
+<!ENTITY % xhtml-model.redecl "" >
+
+
+<!ENTITY % xhtml-model.module "INCLUDE" >
+<![%xhtml-model.module;[
+<!-- instantiate the Document Model module declared in the DTD driver
+-->
+<!-- ....................................................................... -->
+<!-- XHTML 1.1 Document Model Module ...................................... -->
+<!-- file: xhtml11-model-1.mod
+
+ This is XHTML 1.1, a reformulation of HTML as a modular XML application.
+ Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $ SMI
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ENTITIES XHTML 1.1 Document Model 1.0//EN"
+ SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml11-model-1.mod"
+
+ Revisions:
+ (none)
+ ....................................................................... -->
+
+<!-- XHTML 1.1 Document Model
+
+ This module describes the groupings of elements that make up
+ common content models for XHTML elements.
+
+ XHTML has three basic content models:
+
+ %Inline.mix; character-level elements
+ %Block.mix; block-like elements, eg., paragraphs and lists
+ %Flow.mix; any block or inline elements
+
+ Any parameter entities declared in this module may be used
+ to create element content models, but the above three are
+ considered 'global' (insofar as that term applies here).
+
+ The reserved word '#PCDATA' (indicating a text string) is now
+ included explicitly with each element declaration that is
+ declared as mixed content, as XML requires that this token
+ occur first in a content model specification.
+-->
+<!-- Extending the Model
+
+ While in some cases this module may need to be rewritten to
+ accommodate changes to the document model, minor extensions
+ may be accomplished by redeclaring any of the three *.extra;
+ parameter entities to contain extension element types as follows:
+
+ %Misc.extra; whose parent may be any block or
+ inline element.
+
+ %Inline.extra; whose parent may be any inline element.
+
+ %Block.extra; whose parent may be any block element.
+
+ If used, these parameter entities must be an OR-separated
+ list beginning with an OR separator ("|"), eg., "| a | b | c"
+
+ All block and inline *.class parameter entities not part
+ of the *struct.class classes begin with "| " to allow for
+ exclusion from mixes.
+-->
+
+<!-- .............. Optional Elements in head .................. -->
+
+<!ENTITY % HeadOpts.mix
+ "( %script.qname; | %style.qname; | %meta.qname;
+ | %link.qname; | %object.qname; )*"
+>
+
+<!-- ................. Miscellaneous Elements .................. -->
+
+<!-- ins and del are used to denote editing changes
+-->
+<!ENTITY % Edit.class "| %ins.qname; | %del.qname;" >
+
+<!-- script and noscript are used to contain scripts
+ and alternative content
+-->
+<!ENTITY % Script.class "| %script.qname; | %noscript.qname;" >
+
+<!ENTITY % Misc.extra "" >
+
+<!-- These elements are neither block nor inline, and can
+ essentially be used anywhere in the document body.
+-->
+<!ENTITY % Misc.class
+ "%Edit.class;
+ %Script.class;
+ %Misc.extra;"
+>
+
+<!-- .................... Inline Elements ...................... -->
+
+<!ENTITY % InlStruct.class "%br.qname; | %span.qname;" >
+
+<!ENTITY % InlPhras.class
+ "| %em.qname; | %strong.qname; | %dfn.qname; | %code.qname;
+ | %samp.qname; | %kbd.qname; | %var.qname; | %cite.qname;
+ | %abbr.qname; | %acronym.qname; | %q.qname;" >
+
+<!ENTITY % InlPres.class
+ "| %tt.qname; | %i.qname; | %b.qname; | %big.qname;
+ | %small.qname; | %sub.qname; | %sup.qname;" >
+
+<!ENTITY % I18n.class "| %bdo.qname;" >
+
+<!ENTITY % Anchor.class "| %a.qname;" >
+
+<!ENTITY % InlSpecial.class
+ "| %img.qname; | %map.qname;
+ | %object.qname;" >
+
+<!ENTITY % InlForm.class
+ "| %input.qname; | %select.qname; | %textarea.qname;
+ | %label.qname; | %button.qname;" >
+
+<!ENTITY % Inline.extra "" >
+
+<!ENTITY % Ruby.class "| %ruby.qname;" >
+
+<!-- %Inline.class; includes all inline elements,
+ used as a component in mixes
+-->
+<!ENTITY % Inline.class
+ "%InlStruct.class;
+ %InlPhras.class;
+ %InlPres.class;
+ %I18n.class;
+ %Anchor.class;
+ %InlSpecial.class;
+ %InlForm.class;
+ %Ruby.class;
+ %Inline.extra;"
+>
+
+<!-- %InlNoRuby.class; includes all inline elements
+ except ruby, used as a component in mixes
+-->
+<!ENTITY % InlNoRuby.class
+ "%InlStruct.class;
+ %InlPhras.class;
+ %InlPres.class;
+ %I18n.class;
+ %Anchor.class;
+ %InlSpecial.class;
+ %InlForm.class;
+ %Inline.extra;"
+>
+
+<!-- %NoRuby.content; includes all inlines except ruby
+-->
+<!ENTITY % NoRuby.content
+ "( #PCDATA
+ | %InlNoRuby.class;
+ %Misc.class; )*"
+>
+
+<!-- %InlNoAnchor.class; includes all non-anchor inlines,
+ used as a component in mixes
+-->
+<!ENTITY % InlNoAnchor.class
+ "%InlStruct.class;
+ %InlPhras.class;
+ %InlPres.class;
+ %I18n.class;
+ %InlSpecial.class;
+ %InlForm.class;
+ %Ruby.class;
+ %Inline.extra;"
+>
+
+<!-- %InlNoAnchor.mix; includes all non-anchor inlines
+-->
+<!ENTITY % InlNoAnchor.mix
+ "%InlNoAnchor.class;
+ %Misc.class;"
+>
+
+<!-- %Inline.mix; includes all inline elements, including %Misc.class;
+-->
+<!ENTITY % Inline.mix
+ "%Inline.class;
+ %Misc.class;"
+>
+
+<!-- ..................... Block Elements ...................... -->
+
+<!-- In the HTML 4.0 DTD, heading and list elements were included
+ in the %block; parameter entity. The %Heading.class; and
+ %List.class; parameter entities must now be included explicitly
+ on element declarations where desired.
+-->
+
+<!ENTITY % Heading.class
+ "%h1.qname; | %h2.qname; | %h3.qname;
+ | %h4.qname; | %h5.qname; | %h6.qname;" >
+
+<!ENTITY % List.class "%ul.qname; | %ol.qname; | %dl.qname;" >
+
+<!ENTITY % Table.class "| %table.qname;" >
+
+<!ENTITY % Form.class "| %form.qname;" >
+
+<!ENTITY % Fieldset.class "| %fieldset.qname;" >
+
+<!ENTITY % BlkStruct.class "%p.qname; | %div.qname;" >
+
+<!ENTITY % BlkPhras.class
+ "| %pre.qname; | %blockquote.qname; | %address.qname;" >
+
+<!ENTITY % BlkPres.class "| %hr.qname;" >
+
+<!ENTITY % BlkSpecial.class
+ "%Table.class;
+ %Form.class;
+ %Fieldset.class;"
+>
+
+<!ENTITY % Block.extra "" >
+
+<!-- %Block.class; includes all block elements,
+ used as an component in mixes
+-->
+<!ENTITY % Block.class
+ "%BlkStruct.class;
+ %BlkPhras.class;
+ %BlkPres.class;
+ %BlkSpecial.class;
+ %Block.extra;"
+>
+
+<!-- %Block.mix; includes all block elements plus %Misc.class;
+-->
+<!ENTITY % Block.mix
+ "%Heading.class;
+ | %List.class;
+ | %Block.class;
+ %Misc.class;"
+>
+
+<!-- ................ All Content Elements .................. -->
+
+<!-- %Flow.mix; includes all text content, block and inline
+-->
+<!ENTITY % Flow.mix
+ "%Heading.class;
+ | %List.class;
+ | %Block.class;
+ | %Inline.class;
+ %Misc.class;"
+>
+
+<!-- end of xhtml11-model-1.mod -->
+]]>
+
+<!ENTITY % xhtml-charent.module "INCLUDE" >
+<![%xhtml-charent.module;[
+<!ENTITY % xhtml-charent.mod
+ PUBLIC "-//W3C//ENTITIES XHTML Character Entities 1.0//EN"
+ "xhtml-charent-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Character Entities Module ......................................... -->
+<!-- file: xhtml-charent-1.mod
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+ Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $ SMI
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ENTITIES XHTML Character Entities 1.0//EN"
+ SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-charent-1.mod"
+
+ Revisions:
+ (none)
+ ....................................................................... -->
+
+<!-- Character Entities for XHTML
+
+ This module declares the set of character entities for XHTML,
+ including the Latin 1, Symbol and Special character collections.
+-->
+
+<!ENTITY % xhtml-lat1
+ PUBLIC "-//W3C//ENTITIES Latin 1 for XHTML//EN"
+ "xhtml-lat1.ent" >
+<!-- Portions (C) International Organization for Standardization 1986
+ Permission to copy in any form is granted for use with
+ conforming SGML systems and applications as defined in
+ ISO 8879, provided this notice is included in all copies.
+-->
+<!-- Character entity set. Typical invocation:
+ <!ENTITY % HTMLlat1 PUBLIC
+ "-//W3C//ENTITIES Latin 1 for XHTML//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent">
+ %HTMLlat1;
+-->
+
+<!ENTITY nbsp "&#160;"> <!-- no-break space = non-breaking space,
+ U+00A0 ISOnum -->
+<!ENTITY iexcl "&#161;"> <!-- inverted exclamation mark, U+00A1 ISOnum -->
+<!ENTITY cent "&#162;"> <!-- cent sign, U+00A2 ISOnum -->
+<!ENTITY pound "&#163;"> <!-- pound sign, U+00A3 ISOnum -->
+<!ENTITY curren "&#164;"> <!-- currency sign, U+00A4 ISOnum -->
+<!ENTITY yen "&#165;"> <!-- yen sign = yuan sign, U+00A5 ISOnum -->
+<!ENTITY brvbar "&#166;"> <!-- broken bar = broken vertical bar,
+ U+00A6 ISOnum -->
+<!ENTITY sect "&#167;"> <!-- section sign, U+00A7 ISOnum -->
+<!ENTITY uml "&#168;"> <!-- diaeresis = spacing diaeresis,
+ U+00A8 ISOdia -->
+<!ENTITY copy "&#169;"> <!-- copyright sign, U+00A9 ISOnum -->
+<!ENTITY ordf "&#170;"> <!-- feminine ordinal indicator, U+00AA ISOnum -->
+<!ENTITY laquo "&#171;"> <!-- left-pointing double angle quotation mark
+ = left pointing guillemet, U+00AB ISOnum -->
+<!ENTITY not "&#172;"> <!-- not sign = angled dash,
+ U+00AC ISOnum -->
+<!ENTITY shy "&#173;"> <!-- soft hyphen = discretionary hyphen,
+ U+00AD ISOnum -->
+<!ENTITY reg "&#174;"> <!-- registered sign = registered trade mark sign,
+ U+00AE ISOnum -->
+<!ENTITY macr "&#175;"> <!-- macron = spacing macron = overline
+ = APL overbar, U+00AF ISOdia -->
+<!ENTITY deg "&#176;"> <!-- degree sign, U+00B0 ISOnum -->
+<!ENTITY plusmn "&#177;"> <!-- plus-minus sign = plus-or-minus sign,
+ U+00B1 ISOnum -->
+<!ENTITY sup2 "&#178;"> <!-- superscript two = superscript digit two
+ = squared, U+00B2 ISOnum -->
+<!ENTITY sup3 "&#179;"> <!-- superscript three = superscript digit three
+ = cubed, U+00B3 ISOnum -->
+<!ENTITY acute "&#180;"> <!-- acute accent = spacing acute,
+ U+00B4 ISOdia -->
+<!ENTITY micro "&#181;"> <!-- micro sign, U+00B5 ISOnum -->
+<!ENTITY para "&#182;"> <!-- pilcrow sign = paragraph sign,
+ U+00B6 ISOnum -->
+<!ENTITY middot "&#183;"> <!-- middle dot = Georgian comma
+ = Greek middle dot, U+00B7 ISOnum -->
+<!ENTITY cedil "&#184;"> <!-- cedilla = spacing cedilla, U+00B8 ISOdia -->
+<!ENTITY sup1 "&#185;"> <!-- superscript one = superscript digit one,
+ U+00B9 ISOnum -->
+<!ENTITY ordm "&#186;"> <!-- masculine ordinal indicator,
+ U+00BA ISOnum -->
+<!ENTITY raquo "&#187;"> <!-- right-pointing double angle quotation mark
+ = right pointing guillemet, U+00BB ISOnum -->
+<!ENTITY frac14 "&#188;"> <!-- vulgar fraction one quarter
+ = fraction one quarter, U+00BC ISOnum -->
+<!ENTITY frac12 "&#189;"> <!-- vulgar fraction one half
+ = fraction one half, U+00BD ISOnum -->
+<!ENTITY frac34 "&#190;"> <!-- vulgar fraction three quarters
+ = fraction three quarters, U+00BE ISOnum -->
+<!ENTITY iquest "&#191;"> <!-- inverted question mark
+ = turned question mark, U+00BF ISOnum -->
+<!ENTITY Agrave "&#192;"> <!-- latin capital letter A with grave
+ = latin capital letter A grave,
+ U+00C0 ISOlat1 -->
+<!ENTITY Aacute "&#193;"> <!-- latin capital letter A with acute,
+ U+00C1 ISOlat1 -->
+<!ENTITY Acirc "&#194;"> <!-- latin capital letter A with circumflex,
+ U+00C2 ISOlat1 -->
+<!ENTITY Atilde "&#195;"> <!-- latin capital letter A with tilde,
+ U+00C3 ISOlat1 -->
+<!ENTITY Auml "&#196;"> <!-- latin capital letter A with diaeresis,
+ U+00C4 ISOlat1 -->
+<!ENTITY Aring "&#197;"> <!-- latin capital letter A with ring above
+ = latin capital letter A ring,
+ U+00C5 ISOlat1 -->
+<!ENTITY AElig "&#198;"> <!-- latin capital letter AE
+ = latin capital ligature AE,
+ U+00C6 ISOlat1 -->
+<!ENTITY Ccedil "&#199;"> <!-- latin capital letter C with cedilla,
+ U+00C7 ISOlat1 -->
+<!ENTITY Egrave "&#200;"> <!-- latin capital letter E with grave,
+ U+00C8 ISOlat1 -->
+<!ENTITY Eacute "&#201;"> <!-- latin capital letter E with acute,
+ U+00C9 ISOlat1 -->
+<!ENTITY Ecirc "&#202;"> <!-- latin capital letter E with circumflex,
+ U+00CA ISOlat1 -->
+<!ENTITY Euml "&#203;"> <!-- latin capital letter E with diaeresis,
+ U+00CB ISOlat1 -->
+<!ENTITY Igrave "&#204;"> <!-- latin capital letter I with grave,
+ U+00CC ISOlat1 -->
+<!ENTITY Iacute "&#205;"> <!-- latin capital letter I with acute,
+ U+00CD ISOlat1 -->
+<!ENTITY Icirc "&#206;"> <!-- latin capital letter I with circumflex,
+ U+00CE ISOlat1 -->
+<!ENTITY Iuml "&#207;"> <!-- latin capital letter I with diaeresis,
+ U+00CF ISOlat1 -->
+<!ENTITY ETH "&#208;"> <!-- latin capital letter ETH, U+00D0 ISOlat1 -->
+<!ENTITY Ntilde "&#209;"> <!-- latin capital letter N with tilde,
+ U+00D1 ISOlat1 -->
+<!ENTITY Ograve "&#210;"> <!-- latin capital letter O with grave,
+ U+00D2 ISOlat1 -->
+<!ENTITY Oacute "&#211;"> <!-- latin capital letter O with acute,
+ U+00D3 ISOlat1 -->
+<!ENTITY Ocirc "&#212;"> <!-- latin capital letter O with circumflex,
+ U+00D4 ISOlat1 -->
+<!ENTITY Otilde "&#213;"> <!-- latin capital letter O with tilde,
+ U+00D5 ISOlat1 -->
+<!ENTITY Ouml "&#214;"> <!-- latin capital letter O with diaeresis,
+ U+00D6 ISOlat1 -->
+<!ENTITY times "&#215;"> <!-- multiplication sign, U+00D7 ISOnum -->
+<!ENTITY Oslash "&#216;"> <!-- latin capital letter O with stroke
+ = latin capital letter O slash,
+ U+00D8 ISOlat1 -->
+<!ENTITY Ugrave "&#217;"> <!-- latin capital letter U with grave,
+ U+00D9 ISOlat1 -->
+<!ENTITY Uacute "&#218;"> <!-- latin capital letter U with acute,
+ U+00DA ISOlat1 -->
+<!ENTITY Ucirc "&#219;"> <!-- latin capital letter U with circumflex,
+ U+00DB ISOlat1 -->
+<!ENTITY Uuml "&#220;"> <!-- latin capital letter U with diaeresis,
+ U+00DC ISOlat1 -->
+<!ENTITY Yacute "&#221;"> <!-- latin capital letter Y with acute,
+ U+00DD ISOlat1 -->
+<!ENTITY THORN "&#222;"> <!-- latin capital letter THORN,
+ U+00DE ISOlat1 -->
+<!ENTITY szlig "&#223;"> <!-- latin small letter sharp s = ess-zed,
+ U+00DF ISOlat1 -->
+<!ENTITY agrave "&#224;"> <!-- latin small letter a with grave
+ = latin small letter a grave,
+ U+00E0 ISOlat1 -->
+<!ENTITY aacute "&#225;"> <!-- latin small letter a with acute,
+ U+00E1 ISOlat1 -->
+<!ENTITY acirc "&#226;"> <!-- latin small letter a with circumflex,
+ U+00E2 ISOlat1 -->
+<!ENTITY atilde "&#227;"> <!-- latin small letter a with tilde,
+ U+00E3 ISOlat1 -->
+<!ENTITY auml "&#228;"> <!-- latin small letter a with diaeresis,
+ U+00E4 ISOlat1 -->
+<!ENTITY aring "&#229;"> <!-- latin small letter a with ring above
+ = latin small letter a ring,
+ U+00E5 ISOlat1 -->
+<!ENTITY aelig "&#230;"> <!-- latin small letter ae
+ = latin small ligature ae, U+00E6 ISOlat1 -->
+<!ENTITY ccedil "&#231;"> <!-- latin small letter c with cedilla,
+ U+00E7 ISOlat1 -->
+<!ENTITY egrave "&#232;"> <!-- latin small letter e with grave,
+ U+00E8 ISOlat1 -->
+<!ENTITY eacute "&#233;"> <!-- latin small letter e with acute,
+ U+00E9 ISOlat1 -->
+<!ENTITY ecirc "&#234;"> <!-- latin small letter e with circumflex,
+ U+00EA ISOlat1 -->
+<!ENTITY euml "&#235;"> <!-- latin small letter e with diaeresis,
+ U+00EB ISOlat1 -->
+<!ENTITY igrave "&#236;"> <!-- latin small letter i with grave,
+ U+00EC ISOlat1 -->
+<!ENTITY iacute "&#237;"> <!-- latin small letter i with acute,
+ U+00ED ISOlat1 -->
+<!ENTITY icirc "&#238;"> <!-- latin small letter i with circumflex,
+ U+00EE ISOlat1 -->
+<!ENTITY iuml "&#239;"> <!-- latin small letter i with diaeresis,
+ U+00EF ISOlat1 -->
+<!ENTITY eth "&#240;"> <!-- latin small letter eth, U+00F0 ISOlat1 -->
+<!ENTITY ntilde "&#241;"> <!-- latin small letter n with tilde,
+ U+00F1 ISOlat1 -->
+<!ENTITY ograve "&#242;"> <!-- latin small letter o with grave,
+ U+00F2 ISOlat1 -->
+<!ENTITY oacute "&#243;"> <!-- latin small letter o with acute,
+ U+00F3 ISOlat1 -->
+<!ENTITY ocirc "&#244;"> <!-- latin small letter o with circumflex,
+ U+00F4 ISOlat1 -->
+<!ENTITY otilde "&#245;"> <!-- latin small letter o with tilde,
+ U+00F5 ISOlat1 -->
+<!ENTITY ouml "&#246;"> <!-- latin small letter o with diaeresis,
+ U+00F6 ISOlat1 -->
+<!ENTITY divide "&#247;"> <!-- division sign, U+00F7 ISOnum -->
+<!ENTITY oslash "&#248;"> <!-- latin small letter o with stroke,
+ = latin small letter o slash,
+ U+00F8 ISOlat1 -->
+<!ENTITY ugrave "&#249;"> <!-- latin small letter u with grave,
+ U+00F9 ISOlat1 -->
+<!ENTITY uacute "&#250;"> <!-- latin small letter u with acute,
+ U+00FA ISOlat1 -->
+<!ENTITY ucirc "&#251;"> <!-- latin small letter u with circumflex,
+ U+00FB ISOlat1 -->
+<!ENTITY uuml "&#252;"> <!-- latin small letter u with diaeresis,
+ U+00FC ISOlat1 -->
+<!ENTITY yacute "&#253;"> <!-- latin small letter y with acute,
+ U+00FD ISOlat1 -->
+<!ENTITY thorn "&#254;"> <!-- latin small letter thorn,
+ U+00FE ISOlat1 -->
+<!ENTITY yuml "&#255;"> <!-- latin small letter y with diaeresis,
+ U+00FF ISOlat1 -->
+
+
+<!ENTITY % xhtml-symbol
+ PUBLIC "-//W3C//ENTITIES Symbols for XHTML//EN"
+ "xhtml-symbol.ent" >
+<!-- Mathematical, Greek and Symbolic characters for XHTML -->
+
+<!-- Character entity set. Typical invocation:
+ <!ENTITY % HTMLsymbol PUBLIC
+ "-//W3C//ENTITIES Symbols for XHTML//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml-symbol.ent">
+ %HTMLsymbol;
+-->
+
+<!-- Portions (C) International Organization for Standardization 1986:
+ Permission to copy in any form is granted for use with
+ conforming SGML systems and applications as defined in
+ ISO 8879, provided this notice is included in all copies.
+-->
+
+<!-- Relevant ISO entity set is given unless names are newly introduced.
+ New names (i.e., not in ISO 8879 list) do not clash with any
+ existing ISO 8879 entity names. ISO 10646 character numbers
+ are given for each character, in hex. values are decimal
+ conversions of the ISO 10646 values and refer to the document
+ character set. Names are Unicode names.
+-->
+
+<!-- Latin Extended-B -->
+<!ENTITY fnof "&#402;"> <!-- latin small letter f with hook = function
+ = florin, U+0192 ISOtech -->
+
+<!-- Greek -->
+<!ENTITY Alpha "&#913;"> <!-- greek capital letter alpha, U+0391 -->
+<!ENTITY Beta "&#914;"> <!-- greek capital letter beta, U+0392 -->
+<!ENTITY Gamma "&#915;"> <!-- greek capital letter gamma,
+ U+0393 ISOgrk3 -->
+<!ENTITY Delta "&#916;"> <!-- greek capital letter delta,
+ U+0394 ISOgrk3 -->
+<!ENTITY Epsilon "&#917;"> <!-- greek capital letter epsilon, U+0395 -->
+<!ENTITY Zeta "&#918;"> <!-- greek capital letter zeta, U+0396 -->
+<!ENTITY Eta "&#919;"> <!-- greek capital letter eta, U+0397 -->
+<!ENTITY Theta "&#920;"> <!-- greek capital letter theta,
+ U+0398 ISOgrk3 -->
+<!ENTITY Iota "&#921;"> <!-- greek capital letter iota, U+0399 -->
+<!ENTITY Kappa "&#922;"> <!-- greek capital letter kappa, U+039A -->
+<!ENTITY Lambda "&#923;"> <!-- greek capital letter lamda,
+ U+039B ISOgrk3 -->
+<!ENTITY Mu "&#924;"> <!-- greek capital letter mu, U+039C -->
+<!ENTITY Nu "&#925;"> <!-- greek capital letter nu, U+039D -->
+<!ENTITY Xi "&#926;"> <!-- greek capital letter xi, U+039E ISOgrk3 -->
+<!ENTITY Omicron "&#927;"> <!-- greek capital letter omicron, U+039F -->
+<!ENTITY Pi "&#928;"> <!-- greek capital letter pi, U+03A0 ISOgrk3 -->
+<!ENTITY Rho "&#929;"> <!-- greek capital letter rho, U+03A1 -->
+<!-- there is no Sigmaf, and no U+03A2 character either -->
+<!ENTITY Sigma "&#931;"> <!-- greek capital letter sigma,
+ U+03A3 ISOgrk3 -->
+<!ENTITY Tau "&#932;"> <!-- greek capital letter tau, U+03A4 -->
+<!ENTITY Upsilon "&#933;"> <!-- greek capital letter upsilon,
+ U+03A5 ISOgrk3 -->
+<!ENTITY Phi "&#934;"> <!-- greek capital letter phi,
+ U+03A6 ISOgrk3 -->
+<!ENTITY Chi "&#935;"> <!-- greek capital letter chi, U+03A7 -->
+<!ENTITY Psi "&#936;"> <!-- greek capital letter psi,
+ U+03A8 ISOgrk3 -->
+<!ENTITY Omega "&#937;"> <!-- greek capital letter omega,
+ U+03A9 ISOgrk3 -->
+
+<!ENTITY alpha "&#945;"> <!-- greek small letter alpha,
+ U+03B1 ISOgrk3 -->
+<!ENTITY beta "&#946;"> <!-- greek small letter beta, U+03B2 ISOgrk3 -->
+<!ENTITY gamma "&#947;"> <!-- greek small letter gamma,
+ U+03B3 ISOgrk3 -->
+<!ENTITY delta "&#948;"> <!-- greek small letter delta,
+ U+03B4 ISOgrk3 -->
+<!ENTITY epsilon "&#949;"> <!-- greek small letter epsilon,
+ U+03B5 ISOgrk3 -->
+<!ENTITY zeta "&#950;"> <!-- greek small letter zeta, U+03B6 ISOgrk3 -->
+<!ENTITY eta "&#951;"> <!-- greek small letter eta, U+03B7 ISOgrk3 -->
+<!ENTITY theta "&#952;"> <!-- greek small letter theta,
+ U+03B8 ISOgrk3 -->
+<!ENTITY iota "&#953;"> <!-- greek small letter iota, U+03B9 ISOgrk3 -->
+<!ENTITY kappa "&#954;"> <!-- greek small letter kappa,
+ U+03BA ISOgrk3 -->
+<!ENTITY lambda "&#955;"> <!-- greek small letter lamda,
+ U+03BB ISOgrk3 -->
+<!ENTITY mu "&#956;"> <!-- greek small letter mu, U+03BC ISOgrk3 -->
+<!ENTITY nu "&#957;"> <!-- greek small letter nu, U+03BD ISOgrk3 -->
+<!ENTITY xi "&#958;"> <!-- greek small letter xi, U+03BE ISOgrk3 -->
+<!ENTITY omicron "&#959;"> <!-- greek small letter omicron, U+03BF NEW -->
+<!ENTITY pi "&#960;"> <!-- greek small letter pi, U+03C0 ISOgrk3 -->
+<!ENTITY rho "&#961;"> <!-- greek small letter rho, U+03C1 ISOgrk3 -->
+<!ENTITY sigmaf "&#962;"> <!-- greek small letter final sigma,
+ U+03C2 ISOgrk3 -->
+<!ENTITY sigma "&#963;"> <!-- greek small letter sigma,
+ U+03C3 ISOgrk3 -->
+<!ENTITY tau "&#964;"> <!-- greek small letter tau, U+03C4 ISOgrk3 -->
+<!ENTITY upsilon "&#965;"> <!-- greek small letter upsilon,
+ U+03C5 ISOgrk3 -->
+<!ENTITY phi "&#966;"> <!-- greek small letter phi, U+03C6 ISOgrk3 -->
+<!ENTITY chi "&#967;"> <!-- greek small letter chi, U+03C7 ISOgrk3 -->
+<!ENTITY psi "&#968;"> <!-- greek small letter psi, U+03C8 ISOgrk3 -->
+<!ENTITY omega "&#969;"> <!-- greek small letter omega,
+ U+03C9 ISOgrk3 -->
+<!ENTITY thetasym "&#977;"> <!-- greek theta symbol,
+ U+03D1 NEW -->
+<!ENTITY upsih "&#978;"> <!-- greek upsilon with hook symbol,
+ U+03D2 NEW -->
+<!ENTITY piv "&#982;"> <!-- greek pi symbol, U+03D6 ISOgrk3 -->
+
+<!-- General Punctuation -->
+<!ENTITY bull "&#8226;"> <!-- bullet = black small circle,
+ U+2022 ISOpub -->
+<!-- bullet is NOT the same as bullet operator, U+2219 -->
+<!ENTITY hellip "&#8230;"> <!-- horizontal ellipsis = three dot leader,
+ U+2026 ISOpub -->
+<!ENTITY prime "&#8242;"> <!-- prime = minutes = feet, U+2032 ISOtech -->
+<!ENTITY Prime "&#8243;"> <!-- double prime = seconds = inches,
+ U+2033 ISOtech -->
+<!ENTITY oline "&#8254;"> <!-- overline = spacing overscore,
+ U+203E NEW -->
+<!ENTITY frasl "&#8260;"> <!-- fraction slash, U+2044 NEW -->
+
+<!-- Letterlike Symbols -->
+<!ENTITY weierp "&#8472;"> <!-- script capital P = power set
+ = Weierstrass p, U+2118 ISOamso -->
+<!ENTITY image "&#8465;"> <!-- black-letter capital I = imaginary part,
+ U+2111 ISOamso -->
+<!ENTITY real "&#8476;"> <!-- black-letter capital R = real part symbol,
+ U+211C ISOamso -->
+<!ENTITY trade "&#8482;"> <!-- trade mark sign, U+2122 ISOnum -->
+<!ENTITY alefsym "&#8501;"> <!-- alef symbol = first transfinite cardinal,
+ U+2135 NEW -->
+<!-- alef symbol is NOT the same as hebrew letter alef,
+ U+05D0 although the same glyph could be used to depict both characters -->
+
+<!-- Arrows -->
+<!ENTITY larr "&#8592;"> <!-- leftwards arrow, U+2190 ISOnum -->
+<!ENTITY uarr "&#8593;"> <!-- upwards arrow, U+2191 ISOnum-->
+<!ENTITY rarr "&#8594;"> <!-- rightwards arrow, U+2192 ISOnum -->
+<!ENTITY darr "&#8595;"> <!-- downwards arrow, U+2193 ISOnum -->
+<!ENTITY harr "&#8596;"> <!-- left right arrow, U+2194 ISOamsa -->
+<!ENTITY crarr "&#8629;"> <!-- downwards arrow with corner leftwards
+ = carriage return, U+21B5 NEW -->
+<!ENTITY lArr "&#8656;"> <!-- leftwards double arrow, U+21D0 ISOtech -->
+<!-- Unicode does not say that lArr is the same as the 'is implied by' arrow
+ but also does not have any other character for that function. So lArr can
+ be used for 'is implied by' as ISOtech suggests -->
+<!ENTITY uArr "&#8657;"> <!-- upwards double arrow, U+21D1 ISOamsa -->
+<!ENTITY rArr "&#8658;"> <!-- rightwards double arrow,
+ U+21D2 ISOtech -->
+<!-- Unicode does not say this is the 'implies' character but does not have
+ another character with this function so rArr can be used for 'implies'
+ as ISOtech suggests -->
+<!ENTITY dArr "&#8659;"> <!-- downwards double arrow, U+21D3 ISOamsa -->
+<!ENTITY hArr "&#8660;"> <!-- left right double arrow,
+ U+21D4 ISOamsa -->
+
+<!-- Mathematical Operators -->
+<!ENTITY forall "&#8704;"> <!-- for all, U+2200 ISOtech -->
+<!ENTITY part "&#8706;"> <!-- partial differential, U+2202 ISOtech -->
+<!ENTITY exist "&#8707;"> <!-- there exists, U+2203 ISOtech -->
+<!ENTITY empty "&#8709;"> <!-- empty set = null set, U+2205 ISOamso -->
+<!ENTITY nabla "&#8711;"> <!-- nabla = backward difference,
+ U+2207 ISOtech -->
+<!ENTITY isin "&#8712;"> <!-- element of, U+2208 ISOtech -->
+<!ENTITY notin "&#8713;"> <!-- not an element of, U+2209 ISOtech -->
+<!ENTITY ni "&#8715;"> <!-- contains as member, U+220B ISOtech -->
+<!ENTITY prod "&#8719;"> <!-- n-ary product = product sign,
+ U+220F ISOamsb -->
+<!-- prod is NOT the same character as U+03A0 'greek capital letter pi' though
+ the same glyph might be used for both -->
+<!ENTITY sum "&#8721;"> <!-- n-ary summation, U+2211 ISOamsb -->
+<!-- sum is NOT the same character as U+03A3 'greek capital letter sigma'
+ though the same glyph might be used for both -->
+<!ENTITY minus "&#8722;"> <!-- minus sign, U+2212 ISOtech -->
+<!ENTITY lowast "&#8727;"> <!-- asterisk operator, U+2217 ISOtech -->
+<!ENTITY radic "&#8730;"> <!-- square root = radical sign,
+ U+221A ISOtech -->
+<!ENTITY prop "&#8733;"> <!-- proportional to, U+221D ISOtech -->
+<!ENTITY infin "&#8734;"> <!-- infinity, U+221E ISOtech -->
+<!ENTITY ang "&#8736;"> <!-- angle, U+2220 ISOamso -->
+<!ENTITY and "&#8743;"> <!-- logical and = wedge, U+2227 ISOtech -->
+<!ENTITY or "&#8744;"> <!-- logical or = vee, U+2228 ISOtech -->
+<!ENTITY cap "&#8745;"> <!-- intersection = cap, U+2229 ISOtech -->
+<!ENTITY cup "&#8746;"> <!-- union = cup, U+222A ISOtech -->
+<!ENTITY int "&#8747;"> <!-- integral, U+222B ISOtech -->
+<!ENTITY there4 "&#8756;"> <!-- therefore, U+2234 ISOtech -->
+<!ENTITY sim "&#8764;"> <!-- tilde operator = varies with = similar to,
+ U+223C ISOtech -->
+<!-- tilde operator is NOT the same character as the tilde, U+007E,
+ although the same glyph might be used to represent both -->
+<!ENTITY cong "&#8773;"> <!-- approximately equal to, U+2245 ISOtech -->
+<!ENTITY asymp "&#8776;"> <!-- almost equal to = asymptotic to,
+ U+2248 ISOamsr -->
+<!ENTITY ne "&#8800;"> <!-- not equal to, U+2260 ISOtech -->
+<!ENTITY equiv "&#8801;"> <!-- identical to, U+2261 ISOtech -->
+<!ENTITY le "&#8804;"> <!-- less-than or equal to, U+2264 ISOtech -->
+<!ENTITY ge "&#8805;"> <!-- greater-than or equal to,
+ U+2265 ISOtech -->
+<!ENTITY sub "&#8834;"> <!-- subset of, U+2282 ISOtech -->
+<!ENTITY sup "&#8835;"> <!-- superset of, U+2283 ISOtech -->
+<!ENTITY nsub "&#8836;"> <!-- not a subset of, U+2284 ISOamsn -->
+<!ENTITY sube "&#8838;"> <!-- subset of or equal to, U+2286 ISOtech -->
+<!ENTITY supe "&#8839;"> <!-- superset of or equal to,
+ U+2287 ISOtech -->
+<!ENTITY oplus "&#8853;"> <!-- circled plus = direct sum,
+ U+2295 ISOamsb -->
+<!ENTITY otimes "&#8855;"> <!-- circled times = vector product,
+ U+2297 ISOamsb -->
+<!ENTITY perp "&#8869;"> <!-- up tack = orthogonal to = perpendicular,
+ U+22A5 ISOtech -->
+<!ENTITY sdot "&#8901;"> <!-- dot operator, U+22C5 ISOamsb -->
+<!-- dot operator is NOT the same character as U+00B7 middle dot -->
+
+<!-- Miscellaneous Technical -->
+<!ENTITY lceil "&#8968;"> <!-- left ceiling = APL upstile,
+ U+2308 ISOamsc -->
+<!ENTITY rceil "&#8969;"> <!-- right ceiling, U+2309 ISOamsc -->
+<!ENTITY lfloor "&#8970;"> <!-- left floor = APL downstile,
+ U+230A ISOamsc -->
+<!ENTITY rfloor "&#8971;"> <!-- right floor, U+230B ISOamsc -->
+<!ENTITY lang "&#9001;"> <!-- left-pointing angle bracket = bra,
+ U+2329 ISOtech -->
+<!-- lang is NOT the same character as U+003C 'less than sign'
+ or U+2039 'single left-pointing angle quotation mark' -->
+<!ENTITY rang "&#9002;"> <!-- right-pointing angle bracket = ket,
+ U+232A ISOtech -->
+<!-- rang is NOT the same character as U+003E 'greater than sign'
+ or U+203A 'single right-pointing angle quotation mark' -->
+
+<!-- Geometric Shapes -->
+<!ENTITY loz "&#9674;"> <!-- lozenge, U+25CA ISOpub -->
+
+<!-- Miscellaneous Symbols -->
+<!ENTITY spades "&#9824;"> <!-- black spade suit, U+2660 ISOpub -->
+<!-- black here seems to mean filled as opposed to hollow -->
+<!ENTITY clubs "&#9827;"> <!-- black club suit = shamrock,
+ U+2663 ISOpub -->
+<!ENTITY hearts "&#9829;"> <!-- black heart suit = valentine,
+ U+2665 ISOpub -->
+<!ENTITY diams "&#9830;"> <!-- black diamond suit, U+2666 ISOpub -->
+
+
+<!ENTITY % xhtml-special
+ PUBLIC "-//W3C//ENTITIES Special for XHTML//EN"
+ "xhtml-special.ent" >
+<!-- Special characters for XHTML -->
+
+<!-- Character entity set. Typical invocation:
+ <!ENTITY % HTMLspecial PUBLIC
+ "-//W3C//ENTITIES Special for XHTML//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml-special.ent">
+ %HTMLspecial;
+-->
+
+<!-- Portions (C) International Organization for Standardization 1986:
+ Permission to copy in any form is granted for use with
+ conforming SGML systems and applications as defined in
+ ISO 8879, provided this notice is included in all copies.
+-->
+
+<!-- Relevant ISO entity set is given unless names are newly introduced.
+ New names (i.e., not in ISO 8879 list) do not clash with any
+ existing ISO 8879 entity names. ISO 10646 character numbers
+ are given for each character, in hex. values are decimal
+ conversions of the ISO 10646 values and refer to the document
+ character set. Names are Unicode names.
+-->
+
+<!-- C0 Controls and Basic Latin -->
+<!ENTITY quot "&#34;"> <!-- quotation mark, U+0022 ISOnum -->
+<!ENTITY amp "&#38;#38;"> <!-- ampersand, U+0026 ISOnum -->
+<!ENTITY lt "&#38;#60;"> <!-- less-than sign, U+003C ISOnum -->
+<!ENTITY gt "&#62;"> <!-- greater-than sign, U+003E ISOnum -->
+<!ENTITY apos "&#39;"> <!-- apostrophe = APL quote, U+0027 ISOnum -->
+
+<!-- Latin Extended-A -->
+<!ENTITY OElig "&#338;"> <!-- latin capital ligature OE,
+ U+0152 ISOlat2 -->
+<!ENTITY oelig "&#339;"> <!-- latin small ligature oe, U+0153 ISOlat2 -->
+<!-- ligature is a misnomer, this is a separate character in some languages -->
+<!ENTITY Scaron "&#352;"> <!-- latin capital letter S with caron,
+ U+0160 ISOlat2 -->
+<!ENTITY scaron "&#353;"> <!-- latin small letter s with caron,
+ U+0161 ISOlat2 -->
+<!ENTITY Yuml "&#376;"> <!-- latin capital letter Y with diaeresis,
+ U+0178 ISOlat2 -->
+
+<!-- Spacing Modifier Letters -->
+<!ENTITY circ "&#710;"> <!-- modifier letter circumflex accent,
+ U+02C6 ISOpub -->
+<!ENTITY tilde "&#732;"> <!-- small tilde, U+02DC ISOdia -->
+
+<!-- General Punctuation -->
+<!ENTITY ensp "&#8194;"> <!-- en space, U+2002 ISOpub -->
+<!ENTITY emsp "&#8195;"> <!-- em space, U+2003 ISOpub -->
+<!ENTITY thinsp "&#8201;"> <!-- thin space, U+2009 ISOpub -->
+<!ENTITY zwnj "&#8204;"> <!-- zero width non-joiner,
+ U+200C NEW RFC 2070 -->
+<!ENTITY zwj "&#8205;"> <!-- zero width joiner, U+200D NEW RFC 2070 -->
+<!ENTITY lrm "&#8206;"> <!-- left-to-right mark, U+200E NEW RFC 2070 -->
+<!ENTITY rlm "&#8207;"> <!-- right-to-left mark, U+200F NEW RFC 2070 -->
+<!ENTITY ndash "&#8211;"> <!-- en dash, U+2013 ISOpub -->
+<!ENTITY mdash "&#8212;"> <!-- em dash, U+2014 ISOpub -->
+<!ENTITY lsquo "&#8216;"> <!-- left single quotation mark,
+ U+2018 ISOnum -->
+<!ENTITY rsquo "&#8217;"> <!-- right single quotation mark,
+ U+2019 ISOnum -->
+<!ENTITY sbquo "&#8218;"> <!-- single low-9 quotation mark, U+201A NEW -->
+<!ENTITY ldquo "&#8220;"> <!-- left double quotation mark,
+ U+201C ISOnum -->
+<!ENTITY rdquo "&#8221;"> <!-- right double quotation mark,
+ U+201D ISOnum -->
+<!ENTITY bdquo "&#8222;"> <!-- double low-9 quotation mark, U+201E NEW -->
+<!ENTITY dagger "&#8224;"> <!-- dagger, U+2020 ISOpub -->
+<!ENTITY Dagger "&#8225;"> <!-- double dagger, U+2021 ISOpub -->
+<!ENTITY permil "&#8240;"> <!-- per mille sign, U+2030 ISOtech -->
+<!ENTITY lsaquo "&#8249;"> <!-- single left-pointing angle quotation mark,
+ U+2039 ISO proposed -->
+<!-- lsaquo is proposed but not yet ISO standardized -->
+<!ENTITY rsaquo "&#8250;"> <!-- single right-pointing angle quotation mark,
+ U+203A ISO proposed -->
+<!-- rsaquo is proposed but not yet ISO standardized -->
+
+<!-- Currency Symbols -->
+<!ENTITY euro "&#8364;"> <!-- euro sign, U+20AC NEW -->
+
+
+<!-- end of xhtml-charent-1.mod -->
+]]>
+
+<!-- end of xhtml-framework-1.mod -->
+]]>
+
+<!-- Post-Framework Redeclaration placeholder ................... -->
+<!-- this serves as a location to insert markup declarations
+ into the DTD following the framework declarations.
+-->
+<!ENTITY % xhtml-postfw-redecl.module "IGNORE" >
+<![%xhtml-postfw-redecl.module;[
+%xhtml-postfw-redecl.mod;
+<!-- end of xhtml-postfw-redecl.module -->]]>
+
+<!-- Text Module (Required) ..................................... -->
+<!ENTITY % xhtml-text.module "INCLUDE" >
+<![%xhtml-text.module;[
+<!ENTITY % xhtml-text.mod
+ PUBLIC "-//W3C//ELEMENTS XHTML Text 1.0//EN"
+ "http://www.w3.org/MarkUp/DTD/xhtml-text-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Text Module ................................................... -->
+<!-- file: xhtml-text-1.mod
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+ Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $ SMI
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ELEMENTS XHTML Text 1.0//EN"
+ SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-text-1.mod"
+
+ Revisions:
+ (none)
+ ....................................................................... -->
+
+<!-- Textual Content
+
+ The Text module includes declarations for all core
+ text container elements and their attributes.
+-->
+
+<!ENTITY % xhtml-inlstruct.module "INCLUDE" >
+<![%xhtml-inlstruct.module;[
+<!ENTITY % xhtml-inlstruct.mod
+ PUBLIC "-//W3C//ELEMENTS XHTML Inline Structural 1.0//EN"
+ "xhtml-inlstruct-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Inline Structural Module ...................................... -->
+<!-- file: xhtml-inlstruct-1.mod
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+ Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $ SMI
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ELEMENTS XHTML Inline Structural 1.0//EN"
+ SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-inlstruct-1.mod"
+
+ Revisions:
+ (none)
+ ....................................................................... -->
+
+<!-- Inline Structural
+
+ br, span
+
+ This module declares the elements and their attributes
+ used to support inline-level structural markup.
+-->
+
+<!-- br: forced line break ............................. -->
+
+<!ENTITY % br.element "INCLUDE" >
+<![%br.element;[
+
+<!ENTITY % br.content "EMPTY" >
+<!ENTITY % br.qname "br" >
+<!ELEMENT %br.qname; %br.content; >
+
+<!-- end of br.element -->]]>
+
+<!ENTITY % br.attlist "INCLUDE" >
+<![%br.attlist;[
+<!ATTLIST %br.qname;
+ %Core.attrib;
+>
+<!-- end of br.attlist -->]]>
+
+<!-- span: generic inline container .................... -->
+
+<!ENTITY % span.element "INCLUDE" >
+<![%span.element;[
+<!ENTITY % span.content
+ "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % span.qname "span" >
+<!ELEMENT %span.qname; %span.content; >
+<!-- end of span.element -->]]>
+
+<!ENTITY % span.attlist "INCLUDE" >
+<![%span.attlist;[
+<!ATTLIST %span.qname;
+ %Common.attrib;
+>
+<!-- end of span.attlist -->]]>
+
+<!-- end of xhtml-inlstruct-1.mod -->
+]]>
+
+<!ENTITY % xhtml-inlphras.module "INCLUDE" >
+<![%xhtml-inlphras.module;[
+<!ENTITY % xhtml-inlphras.mod
+ PUBLIC "-//W3C//ELEMENTS XHTML Inline Phrasal 1.0//EN"
+ "xhtml-inlphras-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Inline Phrasal Module ......................................... -->
+<!-- file: xhtml-inlphras-1.mod
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+ Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $ SMI
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ELEMENTS XHTML Inline Phrasal 1.0//EN"
+ SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-inlphras-1.mod"
+
+ Revisions:
+ (none)
+ ....................................................................... -->
+
+<!-- Inline Phrasal
+
+ abbr, acronym, cite, code, dfn, em, kbd, q, samp, strong, var
+
+ This module declares the elements and their attributes used to
+ support inline-level phrasal markup.
+-->
+
+<!ENTITY % abbr.element "INCLUDE" >
+<![%abbr.element;[
+<!ENTITY % abbr.content
+ "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % abbr.qname "abbr" >
+<!ELEMENT %abbr.qname; %abbr.content; >
+<!-- end of abbr.element -->]]>
+
+<!ENTITY % abbr.attlist "INCLUDE" >
+<![%abbr.attlist;[
+<!ATTLIST %abbr.qname;
+ %Common.attrib;
+>
+<!-- end of abbr.attlist -->]]>
+
+<!ENTITY % acronym.element "INCLUDE" >
+<![%acronym.element;[
+<!ENTITY % acronym.content
+ "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % acronym.qname "acronym" >
+<!ELEMENT %acronym.qname; %acronym.content; >
+<!-- end of acronym.element -->]]>
+
+<!ENTITY % acronym.attlist "INCLUDE" >
+<![%acronym.attlist;[
+<!ATTLIST %acronym.qname;
+ %Common.attrib;
+>
+<!-- end of acronym.attlist -->]]>
+
+<!ENTITY % cite.element "INCLUDE" >
+<![%cite.element;[
+<!ENTITY % cite.content
+ "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % cite.qname "cite" >
+<!ELEMENT %cite.qname; %cite.content; >
+<!-- end of cite.element -->]]>
+
+<!ENTITY % cite.attlist "INCLUDE" >
+<![%cite.attlist;[
+<!ATTLIST %cite.qname;
+ %Common.attrib;
+>
+<!-- end of cite.attlist -->]]>
+
+<!ENTITY % code.element "INCLUDE" >
+<![%code.element;[
+<!ENTITY % code.content
+ "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % code.qname "code" >
+<!ELEMENT %code.qname; %code.content; >
+<!-- end of code.element -->]]>
+
+<!ENTITY % code.attlist "INCLUDE" >
+<![%code.attlist;[
+<!ATTLIST %code.qname;
+ %Common.attrib;
+>
+<!-- end of code.attlist -->]]>
+
+<!ENTITY % dfn.element "INCLUDE" >
+<![%dfn.element;[
+<!ENTITY % dfn.content
+ "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % dfn.qname "dfn" >
+<!ELEMENT %dfn.qname; %dfn.content; >
+<!-- end of dfn.element -->]]>
+
+<!ENTITY % dfn.attlist "INCLUDE" >
+<![%dfn.attlist;[
+<!ATTLIST %dfn.qname;
+ %Common.attrib;
+>
+<!-- end of dfn.attlist -->]]>
+
+<!ENTITY % em.element "INCLUDE" >
+<![%em.element;[
+<!ENTITY % em.content
+ "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % em.qname "em" >
+<!ELEMENT %em.qname; %em.content; >
+<!-- end of em.element -->]]>
+
+<!ENTITY % em.attlist "INCLUDE" >
+<![%em.attlist;[
+<!ATTLIST %em.qname;
+ %Common.attrib;
+>
+<!-- end of em.attlist -->]]>
+
+<!ENTITY % kbd.element "INCLUDE" >
+<![%kbd.element;[
+<!ENTITY % kbd.content
+ "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % kbd.qname "kbd" >
+<!ELEMENT %kbd.qname; %kbd.content; >
+<!-- end of kbd.element -->]]>
+
+<!ENTITY % kbd.attlist "INCLUDE" >
+<![%kbd.attlist;[
+<!ATTLIST %kbd.qname;
+ %Common.attrib;
+>
+<!-- end of kbd.attlist -->]]>
+
+<!ENTITY % q.element "INCLUDE" >
+<![%q.element;[
+<!ENTITY % q.content
+ "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % q.qname "q" >
+<!ELEMENT %q.qname; %q.content; >
+<!-- end of q.element -->]]>
+
+<!ENTITY % q.attlist "INCLUDE" >
+<![%q.attlist;[
+<!ATTLIST %q.qname;
+ %Common.attrib;
+ cite %URI.datatype; #IMPLIED
+>
+<!-- end of q.attlist -->]]>
+
+<!ENTITY % samp.element "INCLUDE" >
+<![%samp.element;[
+<!ENTITY % samp.content
+ "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % samp.qname "samp" >
+<!ELEMENT %samp.qname; %samp.content; >
+<!-- end of samp.element -->]]>
+
+<!ENTITY % samp.attlist "INCLUDE" >
+<![%samp.attlist;[
+<!ATTLIST %samp.qname;
+ %Common.attrib;
+>
+<!-- end of samp.attlist -->]]>
+
+<!ENTITY % strong.element "INCLUDE" >
+<![%strong.element;[
+<!ENTITY % strong.content
+ "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % strong.qname "strong" >
+<!ELEMENT %strong.qname; %strong.content; >
+<!-- end of strong.element -->]]>
+
+<!ENTITY % strong.attlist "INCLUDE" >
+<![%strong.attlist;[
+<!ATTLIST %strong.qname;
+ %Common.attrib;
+>
+<!-- end of strong.attlist -->]]>
+
+<!ENTITY % var.element "INCLUDE" >
+<![%var.element;[
+<!ENTITY % var.content
+ "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % var.qname "var" >
+<!ELEMENT %var.qname; %var.content; >
+<!-- end of var.element -->]]>
+
+<!ENTITY % var.attlist "INCLUDE" >
+<![%var.attlist;[
+<!ATTLIST %var.qname;
+ %Common.attrib;
+>
+<!-- end of var.attlist -->]]>
+
+<!-- end of xhtml-inlphras-1.mod -->
+]]>
+
+<!ENTITY % xhtml-blkstruct.module "INCLUDE" >
+<![%xhtml-blkstruct.module;[
+<!ENTITY % xhtml-blkstruct.mod
+ PUBLIC "-//W3C//ELEMENTS XHTML Block Structural 1.0//EN"
+ "xhtml-blkstruct-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Block Structural Module ....................................... -->
+<!-- file: xhtml-blkstruct-1.mod
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+ Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $ SMI
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ELEMENTS XHTML Block Structural 1.0//EN"
+ SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-blkstruct-1.mod"
+
+ Revisions:
+ (none)
+ ....................................................................... -->
+
+<!-- Block Structural
+
+ div, p
+
+ This module declares the elements and their attributes used to
+ support block-level structural markup.
+-->
+
+<!ENTITY % div.element "INCLUDE" >
+<![%div.element;[
+<!ENTITY % div.content
+ "( #PCDATA | %Flow.mix; )*"
+>
+<!ENTITY % div.qname "div" >
+<!ELEMENT %div.qname; %div.content; >
+<!-- end of div.element -->]]>
+
+<!ENTITY % div.attlist "INCLUDE" >
+<![%div.attlist;[
+<!ATTLIST %div.qname;
+ %Common.attrib;
+>
+<!-- end of div.attlist -->]]>
+
+<!ENTITY % p.element "INCLUDE" >
+<![%p.element;[
+<!ENTITY % p.content
+ "( #PCDATA | %Inline.mix; )*" >
+<!ENTITY % p.qname "p" >
+<!ELEMENT %p.qname; %p.content; >
+<!-- end of p.element -->]]>
+
+<!ENTITY % p.attlist "INCLUDE" >
+<![%p.attlist;[
+<!ATTLIST %p.qname;
+ %Common.attrib;
+>
+<!-- end of p.attlist -->]]>
+
+<!-- end of xhtml-blkstruct-1.mod -->
+]]>
+
+<!ENTITY % xhtml-blkphras.module "INCLUDE" >
+<![%xhtml-blkphras.module;[
+<!ENTITY % xhtml-blkphras.mod
+ PUBLIC "-//W3C//ELEMENTS XHTML Block Phrasal 1.0//EN"
+ "xhtml-blkphras-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Block Phrasal Module .......................................... -->
+<!-- file: xhtml-blkphras-1.mod
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+ Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $ SMI
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ELEMENTS XHTML Block Phrasal 1.0//EN"
+ SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-blkphras-1.mod"
+
+ Revisions:
+ (none)
+ ....................................................................... -->
+
+<!-- Block Phrasal
+
+ address, blockquote, pre, h1, h2, h3, h4, h5, h6
+
+ This module declares the elements and their attributes used to
+ support block-level phrasal markup.
+-->
+
+<!ENTITY % address.element "INCLUDE" >
+<![%address.element;[
+<!ENTITY % address.content
+ "( #PCDATA | %Inline.mix; )*" >
+<!ENTITY % address.qname "address" >
+<!ELEMENT %address.qname; %address.content; >
+<!-- end of address.element -->]]>
+
+<!ENTITY % address.attlist "INCLUDE" >
+<![%address.attlist;[
+<!ATTLIST %address.qname;
+ %Common.attrib;
+>
+<!-- end of address.attlist -->]]>
+
+<!ENTITY % blockquote.element "INCLUDE" >
+<![%blockquote.element;[
+<!ENTITY % blockquote.content
+ "( %Block.mix; )+"
+>
+<!ENTITY % blockquote.qname "blockquote" >
+<!ELEMENT %blockquote.qname; %blockquote.content; >
+<!-- end of blockquote.element -->]]>
+
+<!ENTITY % blockquote.attlist "INCLUDE" >
+<![%blockquote.attlist;[
+<!ATTLIST %blockquote.qname;
+ %Common.attrib;
+ cite %URI.datatype; #IMPLIED
+>
+<!-- end of blockquote.attlist -->]]>
+
+<!ENTITY % pre.element "INCLUDE" >
+<![%pre.element;[
+<!ENTITY % pre.content
+ "( #PCDATA
+ | %InlStruct.class;
+ %InlPhras.class;
+ | %tt.qname; | %i.qname; | %b.qname;
+ %I18n.class;
+ %Anchor.class;
+ | %script.qname; | %map.qname;
+ %Inline.extra; )*"
+>
+<!ENTITY % pre.qname "pre" >
+<!ELEMENT %pre.qname; %pre.content; >
+<!-- end of pre.element -->]]>
+
+<!ENTITY % pre.attlist "INCLUDE" >
+<![%pre.attlist;[
+<!ATTLIST %pre.qname;
+ %Common.attrib;
+>
+<!-- end of pre.attlist -->]]>
+
+<!-- ................... Heading Elements ................... -->
+
+<!ENTITY % Heading.content "( #PCDATA | %Inline.mix; )*" >
+
+<!ENTITY % h1.element "INCLUDE" >
+<![%h1.element;[
+<!ENTITY % h1.qname "h1" >
+<!ELEMENT %h1.qname; %Heading.content; >
+<!-- end of h1.element -->]]>
+
+<!ENTITY % h1.attlist "INCLUDE" >
+<![%h1.attlist;[
+<!ATTLIST %h1.qname;
+ %Common.attrib;
+>
+<!-- end of h1.attlist -->]]>
+
+<!ENTITY % h2.element "INCLUDE" >
+<![%h2.element;[
+<!ENTITY % h2.qname "h2" >
+<!ELEMENT %h2.qname; %Heading.content; >
+<!-- end of h2.element -->]]>
+
+<!ENTITY % h2.attlist "INCLUDE" >
+<![%h2.attlist;[
+<!ATTLIST %h2.qname;
+ %Common.attrib;
+>
+<!-- end of h2.attlist -->]]>
+
+<!ENTITY % h3.element "INCLUDE" >
+<![%h3.element;[
+<!ENTITY % h3.qname "h3" >
+<!ELEMENT %h3.qname; %Heading.content; >
+<!-- end of h3.element -->]]>
+
+<!ENTITY % h3.attlist "INCLUDE" >
+<![%h3.attlist;[
+<!ATTLIST %h3.qname;
+ %Common.attrib;
+>
+<!-- end of h3.attlist -->]]>
+
+<!ENTITY % h4.element "INCLUDE" >
+<![%h4.element;[
+<!ENTITY % h4.qname "h4" >
+<!ELEMENT %h4.qname; %Heading.content; >
+<!-- end of h4.element -->]]>
+
+<!ENTITY % h4.attlist "INCLUDE" >
+<![%h4.attlist;[
+<!ATTLIST %h4.qname;
+ %Common.attrib;
+>
+<!-- end of h4.attlist -->]]>
+
+<!ENTITY % h5.element "INCLUDE" >
+<![%h5.element;[
+<!ENTITY % h5.qname "h5" >
+<!ELEMENT %h5.qname; %Heading.content; >
+<!-- end of h5.element -->]]>
+
+<!ENTITY % h5.attlist "INCLUDE" >
+<![%h5.attlist;[
+<!ATTLIST %h5.qname;
+ %Common.attrib;
+>
+<!-- end of h5.attlist -->]]>
+
+<!ENTITY % h6.element "INCLUDE" >
+<![%h6.element;[
+<!ENTITY % h6.qname "h6" >
+<!ELEMENT %h6.qname; %Heading.content; >
+<!-- end of h6.element -->]]>
+
+<!ENTITY % h6.attlist "INCLUDE" >
+<![%h6.attlist;[
+<!ATTLIST %h6.qname;
+ %Common.attrib;
+>
+<!-- end of h6.attlist -->]]>
+
+<!-- end of xhtml-blkphras-1.mod -->
+]]>
+
+<!-- end of xhtml-text-1.mod -->
+]]>
+
+<!-- Hypertext Module (required) ................................. -->
+<!ENTITY % xhtml-hypertext.module "INCLUDE" >
+<![%xhtml-hypertext.module;[
+<!ENTITY % xhtml-hypertext.mod
+ PUBLIC "-//W3C//ELEMENTS XHTML Hypertext 1.0//EN"
+ "http://www.w3.org/MarkUp/DTD/xhtml-hypertext-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Hypertext Module .............................................. -->
+<!-- file: xhtml-hypertext-1.mod
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+ Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $ SMI
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ELEMENTS XHTML Hypertext 1.0//EN"
+ SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-hypertext-1.mod"
+
+ Revisions:
+ (none)
+ ....................................................................... -->
+
+<!-- Hypertext
+
+ a
+
+ This module declares the anchor ('a') element type, which
+ defines the source of a hypertext link. The destination
+ (or link 'target') is identified via its 'id' attribute
+ rather than the 'name' attribute as was used in HTML.
+-->
+
+<!-- ............ Anchor Element ............ -->
+
+<!ENTITY % a.element "INCLUDE" >
+<![%a.element;[
+<!ENTITY % a.content
+ "( #PCDATA | %InlNoAnchor.mix; )*"
+>
+<!ENTITY % a.qname "a" >
+<!ELEMENT %a.qname; %a.content; >
+<!-- end of a.element -->]]>
+
+<!ENTITY % a.attlist "INCLUDE" >
+<![%a.attlist;[
+<!ATTLIST %a.qname;
+ %Common.attrib;
+ href %URI.datatype; #IMPLIED
+ charset %Charset.datatype; #IMPLIED
+ type %ContentType.datatype; #IMPLIED
+ hreflang %LanguageCode.datatype; #IMPLIED
+ rel %LinkTypes.datatype; #IMPLIED
+ rev %LinkTypes.datatype; #IMPLIED
+ accesskey %Character.datatype; #IMPLIED
+ tabindex %Number.datatype; #IMPLIED
+>
+<!-- end of a.attlist -->]]>
+
+<!-- end of xhtml-hypertext-1.mod -->
+]]>
+
+<!-- Lists Module (required) .................................... -->
+<!ENTITY % xhtml-list.module "INCLUDE" >
+<![%xhtml-list.module;[
+<!ENTITY % xhtml-list.mod
+ PUBLIC "-//W3C//ELEMENTS XHTML Lists 1.0//EN"
+ "http://www.w3.org/MarkUp/DTD/xhtml-list-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Lists Module .................................................. -->
+<!-- file: xhtml-list-1.mod
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+ Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $ SMI
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ELEMENTS XHTML Lists 1.0//EN"
+ SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-list-1.mod"
+
+ Revisions:
+ (none)
+ ....................................................................... -->
+
+<!-- Lists
+
+ dl, dt, dd, ol, ul, li
+
+ This module declares the list-oriented element types
+ and their attributes.
+-->
+
+<!ENTITY % dl.qname "dl" >
+<!ENTITY % dt.qname "dt" >
+<!ENTITY % dd.qname "dd" >
+<!ENTITY % ol.qname "ol" >
+<!ENTITY % ul.qname "ul" >
+<!ENTITY % li.qname "li" >
+
+<!-- dl: Definition List ............................... -->
+
+<!ENTITY % dl.element "INCLUDE" >
+<![%dl.element;[
+<!ENTITY % dl.content "( %dt.qname; | %dd.qname; )+" >
+<!ELEMENT %dl.qname; %dl.content; >
+<!-- end of dl.element -->]]>
+
+<!ENTITY % dl.attlist "INCLUDE" >
+<![%dl.attlist;[
+<!ATTLIST %dl.qname;
+ %Common.attrib;
+>
+<!-- end of dl.attlist -->]]>
+
+<!-- dt: Definition Term ............................... -->
+
+<!ENTITY % dt.element "INCLUDE" >
+<![%dt.element;[
+<!ENTITY % dt.content
+ "( #PCDATA | %Inline.mix; )*"
+>
+<!ELEMENT %dt.qname; %dt.content; >
+<!-- end of dt.element -->]]>
+
+<!ENTITY % dt.attlist "INCLUDE" >
+<![%dt.attlist;[
+<!ATTLIST %dt.qname;
+ %Common.attrib;
+>
+<!-- end of dt.attlist -->]]>
+
+<!-- dd: Definition Description ........................ -->
+
+<!ENTITY % dd.element "INCLUDE" >
+<![%dd.element;[
+<!ENTITY % dd.content
+ "( #PCDATA | %Flow.mix; )*"
+>
+<!ELEMENT %dd.qname; %dd.content; >
+<!-- end of dd.element -->]]>
+
+<!ENTITY % dd.attlist "INCLUDE" >
+<![%dd.attlist;[
+<!ATTLIST %dd.qname;
+ %Common.attrib;
+>
+<!-- end of dd.attlist -->]]>
+
+<!-- ol: Ordered List (numbered styles) ................ -->
+
+<!ENTITY % ol.element "INCLUDE" >
+<![%ol.element;[
+<!ENTITY % ol.content "( %li.qname; )+" >
+<!ELEMENT %ol.qname; %ol.content; >
+<!-- end of ol.element -->]]>
+
+<!ENTITY % ol.attlist "INCLUDE" >
+<![%ol.attlist;[
+<!ATTLIST %ol.qname;
+ %Common.attrib;
+>
+<!-- end of ol.attlist -->]]>
+
+<!-- ul: Unordered List (bullet styles) ................ -->
+
+<!ENTITY % ul.element "INCLUDE" >
+<![%ul.element;[
+<!ENTITY % ul.content "( %li.qname; )+" >
+<!ELEMENT %ul.qname; %ul.content; >
+<!-- end of ul.element -->]]>
+
+<!ENTITY % ul.attlist "INCLUDE" >
+<![%ul.attlist;[
+<!ATTLIST %ul.qname;
+ %Common.attrib;
+>
+<!-- end of ul.attlist -->]]>
+
+<!-- li: List Item ..................................... -->
+
+<!ENTITY % li.element "INCLUDE" >
+<![%li.element;[
+<!ENTITY % li.content
+ "( #PCDATA | %Flow.mix; )*"
+>
+<!ELEMENT %li.qname; %li.content; >
+<!-- end of li.element -->]]>
+
+<!ENTITY % li.attlist "INCLUDE" >
+<![%li.attlist;[
+<!ATTLIST %li.qname;
+ %Common.attrib;
+>
+<!-- end of li.attlist -->]]>
+
+<!-- end of xhtml-list-1.mod -->
+]]>
+
+<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
+
+<!-- Edit Module ................................................ -->
+<!ENTITY % xhtml-edit.module "INCLUDE" >
+<![%xhtml-edit.module;[
+<!ENTITY % xhtml-edit.mod
+ PUBLIC "-//W3C//ELEMENTS XHTML Editing Elements 1.0//EN"
+ "http://www.w3.org/MarkUp/DTD/xhtml-edit-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Editing Elements Module ....................................... -->
+<!-- file: xhtml-edit-1.mod
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+ Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $ SMI
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ELEMENTS XHTML Editing Markup 1.0//EN"
+ SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-edit-1.mod"
+
+ Revisions:
+ (none)
+ ....................................................................... -->
+
+<!-- Editing Elements
+
+ ins, del
+
+ This module declares element types and attributes used to indicate
+ inserted and deleted content while editing a document.
+-->
+
+<!-- ins: Inserted Text ............................... -->
+
+<!ENTITY % ins.element "INCLUDE" >
+<![%ins.element;[
+<!ENTITY % ins.content
+ "( #PCDATA | %Flow.mix; )*"
+>
+<!ENTITY % ins.qname "ins" >
+<!ELEMENT %ins.qname; %ins.content; >
+<!-- end of ins.element -->]]>
+
+<!ENTITY % ins.attlist "INCLUDE" >
+<![%ins.attlist;[
+<!ATTLIST %ins.qname;
+ %Common.attrib;
+ cite %URI.datatype; #IMPLIED
+ datetime %Datetime.datatype; #IMPLIED
+>
+<!-- end of ins.attlist -->]]>
+
+<!-- del: Deleted Text ................................ -->
+
+<!ENTITY % del.element "INCLUDE" >
+<![%del.element;[
+<!ENTITY % del.content
+ "( #PCDATA | %Flow.mix; )*"
+>
+<!ENTITY % del.qname "del" >
+<!ELEMENT %del.qname; %del.content; >
+<!-- end of del.element -->]]>
+
+<!ENTITY % del.attlist "INCLUDE" >
+<![%del.attlist;[
+<!ATTLIST %del.qname;
+ %Common.attrib;
+ cite %URI.datatype; #IMPLIED
+ datetime %Datetime.datatype; #IMPLIED
+>
+<!-- end of del.attlist -->]]>
+
+<!-- end of xhtml-edit-1.mod -->
+]]>
+
+<!-- BIDI Override Module ....................................... -->
+<!ENTITY % xhtml-bdo.module "%XHTML.bidi;" >
+<![%xhtml-bdo.module;[
+<!ENTITY % xhtml-bdo.mod
+ PUBLIC "-//W3C//ELEMENTS XHTML BIDI Override Element 1.0//EN"
+ "http://www.w3.org/MarkUp/DTD/xhtml-bdo-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML BDO Element Module ............................................. -->
+<!-- file: xhtml-bdo-1.mod
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+ Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $ SMI
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ELEMENTS XHTML BDO Element 1.0//EN"
+ SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-bdo-1.mod"
+
+ Revisions:
+ (none)
+ ....................................................................... -->
+
+<!-- Bidirectional Override (bdo) Element
+
+ This modules declares the element 'bdo', used to override the
+ Unicode bidirectional algorithm for selected fragments of text.
+
+ DEPENDENCIES:
+ Relies on the conditional section keyword %XHTML.bidi; declared
+ as "INCLUDE". Bidirectional text support includes both the bdo
+ element and the 'dir' attribute.
+-->
+
+<!ENTITY % bdo.element "INCLUDE" >
+<![%bdo.element;[
+<!ENTITY % bdo.content
+ "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % bdo.qname "bdo" >
+<!ELEMENT %bdo.qname; %bdo.content; >
+<!-- end of bdo.element -->]]>
+
+<!ENTITY % bdo.attlist "INCLUDE" >
+<![%bdo.attlist;[
+<!ATTLIST %bdo.qname;
+ %Core.attrib;
+ xml:lang %LanguageCode.datatype; #IMPLIED
+ dir ( ltr | rtl ) #REQUIRED
+>
+]]>
+
+<!-- end of xhtml-bdo-1.mod -->
+]]>
+
+<!-- Ruby Module ................................................ -->
+<!ENTITY % Ruby.common.attlists "INCLUDE" >
+<!ENTITY % Ruby.common.attrib "%Common.attrib;" >
+<!ENTITY % xhtml-ruby.module "INCLUDE" >
+<![%xhtml-ruby.module;[
+<!ENTITY % xhtml-ruby.mod
+ PUBLIC "-//W3C//ELEMENTS XHTML Ruby 1.0//EN"
+ "http://www.w3.org/TR/ruby/xhtml-ruby-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Ruby Module .................................................... -->
+<!-- file: xhtml-ruby-1.mod
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+ Copyright 1999-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $
+
+ This module is based on the W3C Ruby Annotation Specification:
+
+ http://www.w3.org/TR/ruby
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ELEMENTS XHTML Ruby 1.0//EN"
+ SYSTEM "http://www.w3.org/TR/ruby/xhtml-ruby-1.mod"
+
+ ...................................................................... -->
+
+<!-- Ruby Elements
+
+ ruby, rbc, rtc, rb, rt, rp
+
+ This module declares the elements and their attributes used to
+ support ruby annotation markup.
+-->
+
+<!-- declare qualified element type names:
+-->
+<!ENTITY % ruby.qname "ruby" >
+<!ENTITY % rbc.qname "rbc" >
+<!ENTITY % rtc.qname "rtc" >
+<!ENTITY % rb.qname "rb" >
+<!ENTITY % rt.qname "rt" >
+<!ENTITY % rp.qname "rp" >
+
+<!-- rp fallback is included by default.
+-->
+<!ENTITY % Ruby.fallback "INCLUDE" >
+<!ENTITY % Ruby.fallback.mandatory "IGNORE" >
+
+<!-- Complex ruby is included by default; it may be
+ overridden by other modules to ignore it.
+-->
+<!ENTITY % Ruby.complex "INCLUDE" >
+
+<!-- Fragments for the content model of the ruby element -->
+<![%Ruby.fallback;[
+<![%Ruby.fallback.mandatory;[
+<!ENTITY % Ruby.content.simple
+ "( %rb.qname;, %rp.qname;, %rt.qname;, %rp.qname; )"
+>
+]]>
+<!ENTITY % Ruby.content.simple
+ "( %rb.qname;, ( %rt.qname; | ( %rp.qname;, %rt.qname;, %rp.qname; ) ) )"
+>
+]]>
+<!ENTITY % Ruby.content.simple "( %rb.qname;, %rt.qname; )" >
+
+<![%Ruby.complex;[
+<!ENTITY % Ruby.content.complex
+ "| ( %rbc.qname;, %rtc.qname;, %rtc.qname;? )"
+>
+]]>
+<!ENTITY % Ruby.content.complex "" >
+
+<!-- Content models of the rb and the rt elements are intended to
+ allow other inline-level elements of its parent markup language,
+ but it should not include ruby descendent elements. The following
+ parameter entity %NoRuby.content; can be used to redefine
+ those content models with minimum effort. It's defined as
+ '( #PCDATA )' by default.
+-->
+<!ENTITY % NoRuby.content "( #PCDATA )" >
+
+<!-- one or more digits (NUMBER) -->
+<!ENTITY % Number.datatype "CDATA" >
+
+<!-- ruby element ...................................... -->
+
+<!ENTITY % ruby.element "INCLUDE" >
+<![%ruby.element;[
+<!ENTITY % ruby.content
+ "( %Ruby.content.simple; %Ruby.content.complex; )"
+>
+<!ELEMENT %ruby.qname; %ruby.content; >
+<!-- end of ruby.element -->]]>
+
+<![%Ruby.complex;[
+<!-- rbc (ruby base component) element ................. -->
+
+<!ENTITY % rbc.element "INCLUDE" >
+<![%rbc.element;[
+<!ENTITY % rbc.content
+ "(%rb.qname;)+"
+>
+<!ELEMENT %rbc.qname; %rbc.content; >
+<!-- end of rbc.element -->]]>
+
+<!-- rtc (ruby text component) element ................. -->
+
+<!ENTITY % rtc.element "INCLUDE" >
+<![%rtc.element;[
+<!ENTITY % rtc.content
+ "(%rt.qname;)+"
+>
+<!ELEMENT %rtc.qname; %rtc.content; >
+<!-- end of rtc.element -->]]>
+]]>
+
+<!-- rb (ruby base) element ............................ -->
+
+<!ENTITY % rb.element "INCLUDE" >
+<![%rb.element;[
+<!-- %rb.content; uses %NoRuby.content; as its content model,
+ which is '( #PCDATA )' by default. It may be overridden
+ by other modules to allow other inline-level elements
+ of its parent markup language, but it should not include
+ ruby descendent elements.
+-->
+<!ENTITY % rb.content "%NoRuby.content;" >
+<!ELEMENT %rb.qname; %rb.content; >
+<!-- end of rb.element -->]]>
+
+<!-- rt (ruby text) element ............................ -->
+
+<!ENTITY % rt.element "INCLUDE" >
+<![%rt.element;[
+<!-- %rt.content; uses %NoRuby.content; as its content model,
+ which is '( #PCDATA )' by default. It may be overridden
+ by other modules to allow other inline-level elements
+ of its parent markup language, but it should not include
+ ruby descendent elements.
+-->
+<!ENTITY % rt.content "%NoRuby.content;" >
+
+<!ELEMENT %rt.qname; %rt.content; >
+<!-- end of rt.element -->]]>
+
+<!-- rbspan attribute is used for complex ruby only ...... -->
+<![%Ruby.complex;[
+<!ENTITY % rt.attlist "INCLUDE" >
+<![%rt.attlist;[
+<!ATTLIST %rt.qname;
+ rbspan %Number.datatype; "1"
+>
+<!-- end of rt.attlist -->]]>
+]]>
+
+<!-- rp (ruby parenthesis) element ..................... -->
+
+<![%Ruby.fallback;[
+<!ENTITY % rp.element "INCLUDE" >
+<![%rp.element;[
+<!ENTITY % rp.content
+ "( #PCDATA )"
+>
+<!ELEMENT %rp.qname; %rp.content; >
+<!-- end of rp.element -->]]>
+]]>
+
+<!-- Ruby Common Attributes
+
+ The following optional ATTLIST declarations provide an easy way
+ to define common attributes for ruby elements. These declarations
+ are ignored by default.
+
+ Ruby elements are intended to have common attributes of its
+ parent markup language. For example, if a markup language defines
+ common attributes as a parameter entity %attrs;, you may add
+ those attributes by just declaring the following parameter entities
+
+ <!ENTITY % Ruby.common.attlists "INCLUDE" >
+ <!ENTITY % Ruby.common.attrib "%attrs;" >
+
+ before including the Ruby module.
+-->
+
+<!ENTITY % Ruby.common.attlists "IGNORE" >
+<![%Ruby.common.attlists;[
+<!ENTITY % Ruby.common.attrib "" >
+
+<!-- common attributes for ruby ........................ -->
+
+<!ENTITY % Ruby.common.attlist "INCLUDE" >
+<![%Ruby.common.attlist;[
+<!ATTLIST %ruby.qname;
+ %Ruby.common.attrib;
+>
+<!-- end of Ruby.common.attlist -->]]>
+
+<![%Ruby.complex;[
+<!-- common attributes for rbc ......................... -->
+
+<!ENTITY % Rbc.common.attlist "INCLUDE" >
+<![%Rbc.common.attlist;[
+<!ATTLIST %rbc.qname;
+ %Ruby.common.attrib;
+>
+<!-- end of Rbc.common.attlist -->]]>
+
+<!-- common attributes for rtc ......................... -->
+
+<!ENTITY % Rtc.common.attlist "INCLUDE" >
+<![%Rtc.common.attlist;[
+<!ATTLIST %rtc.qname;
+ %Ruby.common.attrib;
+>
+<!-- end of Rtc.common.attlist -->]]>
+]]>
+
+<!-- common attributes for rb .......................... -->
+
+<!ENTITY % Rb.common.attlist "INCLUDE" >
+<![%Rb.common.attlist;[
+<!ATTLIST %rb.qname;
+ %Ruby.common.attrib;
+>
+<!-- end of Rb.common.attlist -->]]>
+
+<!-- common attributes for rt .......................... -->
+
+<!ENTITY % Rt.common.attlist "INCLUDE" >
+<![%Rt.common.attlist;[
+<!ATTLIST %rt.qname;
+ %Ruby.common.attrib;
+>
+<!-- end of Rt.common.attlist -->]]>
+
+<![%Ruby.fallback;[
+<!-- common attributes for rp .......................... -->
+
+<!ENTITY % Rp.common.attlist "INCLUDE" >
+<![%Rp.common.attlist;[
+<!ATTLIST %rp.qname;
+ %Ruby.common.attrib;
+>
+<!-- end of Rp.common.attlist -->]]>
+]]>
+]]>
+
+<!-- end of xhtml-ruby-1.mod -->
+]]>
+
+<!-- Presentation Module ........................................ -->
+<!ENTITY % xhtml-pres.module "INCLUDE" >
+<![%xhtml-pres.module;[
+<!ENTITY % xhtml-pres.mod
+ PUBLIC "-//W3C//ELEMENTS XHTML Presentation 1.0//EN"
+ "http://www.w3.org/MarkUp/DTD/xhtml-pres-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Presentation Module ............................................ -->
+<!-- file: xhtml-pres-1.mod
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+ Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $ SMI
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ELEMENTS XHTML Presentation 1.0//EN"
+ SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-pres-1.mod"
+
+ Revisions:
+ (none)
+ ....................................................................... -->
+
+<!-- Presentational Elements
+
+ This module defines elements and their attributes for
+ simple presentation-related markup.
+-->
+
+<!ENTITY % xhtml-inlpres.module "INCLUDE" >
+<![%xhtml-inlpres.module;[
+<!ENTITY % xhtml-inlpres.mod
+ PUBLIC "-//W3C//ELEMENTS XHTML Inline Presentation 1.0//EN"
+ "xhtml-inlpres-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Inline Presentation Module .................................... -->
+<!-- file: xhtml-inlpres-1.mod
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+ Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $ SMI
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ELEMENTS XHTML Inline Presentation 1.0//EN"
+ SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-inlpres-1.mod"
+
+ Revisions:
+ (none)
+ ....................................................................... -->
+
+<!-- Inline Presentational Elements
+
+ b, big, i, small, sub, sup, tt
+
+ This module declares the elements and their attributes used to
+ support inline-level presentational markup.
+-->
+
+<!ENTITY % b.element "INCLUDE" >
+<![%b.element;[
+<!ENTITY % b.content
+ "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % b.qname "b" >
+<!ELEMENT %b.qname; %b.content; >
+<!-- end of b.element -->]]>
+
+<!ENTITY % b.attlist "INCLUDE" >
+<![%b.attlist;[
+<!ATTLIST %b.qname;
+ %Common.attrib;
+>
+<!-- end of b.attlist -->]]>
+
+<!ENTITY % big.element "INCLUDE" >
+<![%big.element;[
+<!ENTITY % big.content
+ "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % big.qname "big" >
+<!ELEMENT %big.qname; %big.content; >
+<!-- end of big.element -->]]>
+
+<!ENTITY % big.attlist "INCLUDE" >
+<![%big.attlist;[
+<!ATTLIST %big.qname;
+ %Common.attrib;
+>
+<!-- end of big.attlist -->]]>
+
+<!ENTITY % i.element "INCLUDE" >
+<![%i.element;[
+<!ENTITY % i.content
+ "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % i.qname "i" >
+<!ELEMENT %i.qname; %i.content; >
+<!-- end of i.element -->]]>
+
+<!ENTITY % i.attlist "INCLUDE" >
+<![%i.attlist;[
+<!ATTLIST %i.qname;
+ %Common.attrib;
+>
+<!-- end of i.attlist -->]]>
+
+<!ENTITY % small.element "INCLUDE" >
+<![%small.element;[
+<!ENTITY % small.content
+ "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % small.qname "small" >
+<!ELEMENT %small.qname; %small.content; >
+<!-- end of small.element -->]]>
+
+<!ENTITY % small.attlist "INCLUDE" >
+<![%small.attlist;[
+<!ATTLIST %small.qname;
+ %Common.attrib;
+>
+<!-- end of small.attlist -->]]>
+
+<!ENTITY % sub.element "INCLUDE" >
+<![%sub.element;[
+<!ENTITY % sub.content
+ "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % sub.qname "sub" >
+<!ELEMENT %sub.qname; %sub.content; >
+<!-- end of sub.element -->]]>
+
+<!ENTITY % sub.attlist "INCLUDE" >
+<![%sub.attlist;[
+<!ATTLIST %sub.qname;
+ %Common.attrib;
+>
+<!-- end of sub.attlist -->]]>
+
+<!ENTITY % sup.element "INCLUDE" >
+<![%sup.element;[
+<!ENTITY % sup.content
+ "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % sup.qname "sup" >
+<!ELEMENT %sup.qname; %sup.content; >
+<!-- end of sup.element -->]]>
+
+<!ENTITY % sup.attlist "INCLUDE" >
+<![%sup.attlist;[
+<!ATTLIST %sup.qname;
+ %Common.attrib;
+>
+<!-- end of sup.attlist -->]]>
+
+<!ENTITY % tt.element "INCLUDE" >
+<![%tt.element;[
+<!ENTITY % tt.content
+ "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % tt.qname "tt" >
+<!ELEMENT %tt.qname; %tt.content; >
+<!-- end of tt.element -->]]>
+
+<!ENTITY % tt.attlist "INCLUDE" >
+<![%tt.attlist;[
+<!ATTLIST %tt.qname;
+ %Common.attrib;
+>
+<!-- end of tt.attlist -->]]>
+
+<!-- end of xhtml-inlpres-1.mod -->
+]]>
+
+<!ENTITY % xhtml-blkpres.module "INCLUDE" >
+<![%xhtml-blkpres.module;[
+<!ENTITY % xhtml-blkpres.mod
+ PUBLIC "-//W3C//ELEMENTS XHTML Block Presentation 1.0//EN"
+ "xhtml-blkpres-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Block Presentation Module ..................................... -->
+<!-- file: xhtml-blkpres-1.mod
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+ Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $ SMI
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ELEMENTS XHTML Block Presentation 1.0//EN"
+ SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-blkpres-1.mod"
+
+ Revisions:
+ (none)
+ ....................................................................... -->
+
+<!-- Block Presentational Elements
+
+ hr
+
+ This module declares the elements and their attributes used to
+ support block-level presentational markup.
+-->
+
+<!ENTITY % hr.element "INCLUDE" >
+<![%hr.element;[
+<!ENTITY % hr.content "EMPTY" >
+<!ENTITY % hr.qname "hr" >
+<!ELEMENT %hr.qname; %hr.content; >
+<!-- end of hr.element -->]]>
+
+<!ENTITY % hr.attlist "INCLUDE" >
+<![%hr.attlist;[
+<!ATTLIST %hr.qname;
+ %Common.attrib;
+>
+<!-- end of hr.attlist -->]]>
+
+<!-- end of xhtml-blkpres-1.mod -->
+]]>
+
+<!-- end of xhtml-pres-1.mod -->
+]]>
+
+<!-- Link Element Module ........................................ -->
+<!ENTITY % xhtml-link.module "INCLUDE" >
+<![%xhtml-link.module;[
+<!ENTITY % xhtml-link.mod
+ PUBLIC "-//W3C//ELEMENTS XHTML Link Element 1.0//EN"
+ "http://www.w3.org/MarkUp/DTD/xhtml-link-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Link Element Module ........................................... -->
+<!-- file: xhtml-link-1.mod
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+ Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $ SMI
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ELEMENTS XHTML Link Element 1.0//EN"
+ SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-link-1.mod"
+
+ Revisions:
+ (none)
+ ....................................................................... -->
+
+<!-- Link element
+
+ link
+
+ This module declares the link element type and its attributes,
+ which could (in principle) be used to define document-level links
+ to external resources such as:
+
+ a) for document specific toolbars/menus, e.g. start, contents,
+ previous, next, index, end, help
+ b) to link to a separate style sheet (rel="stylesheet")
+ c) to make a link to a script (rel="script")
+ d) by style sheets to control how collections of html nodes are
+ rendered into printed documents
+ e) to make a link to a printable version of this document
+ e.g. a postscript or pdf version (rel="alternate" media="print")
+-->
+
+<!-- link: Media-Independent Link ...................... -->
+
+<!ENTITY % link.element "INCLUDE" >
+<![%link.element;[
+<!ENTITY % link.content "EMPTY" >
+<!ENTITY % link.qname "link" >
+<!ELEMENT %link.qname; %link.content; >
+<!-- end of link.element -->]]>
+
+<!ENTITY % link.attlist "INCLUDE" >
+<![%link.attlist;[
+<!ATTLIST %link.qname;
+ %Common.attrib;
+ charset %Charset.datatype; #IMPLIED
+ href %URI.datatype; #IMPLIED
+ hreflang %LanguageCode.datatype; #IMPLIED
+ type %ContentType.datatype; #IMPLIED
+ rel %LinkTypes.datatype; #IMPLIED
+ rev %LinkTypes.datatype; #IMPLIED
+ media %MediaDesc.datatype; #IMPLIED
+>
+<!-- end of link.attlist -->]]>
+
+<!-- end of xhtml-link-1.mod -->
+]]>
+
+<!-- Document Metainformation Module ............................ -->
+<!ENTITY % xhtml-meta.module "INCLUDE" >
+<![%xhtml-meta.module;[
+<!ENTITY % xhtml-meta.mod
+ PUBLIC "-//W3C//ELEMENTS XHTML Metainformation 1.0//EN"
+ "http://www.w3.org/MarkUp/DTD/xhtml-meta-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Document Metainformation Module ............................... -->
+<!-- file: xhtml-meta-1.mod
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+ Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $ SMI
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ELEMENTS XHTML Metainformation 1.0//EN"
+ SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-meta-1.mod"
+
+ Revisions:
+ (none)
+ ....................................................................... -->
+
+<!-- Meta Information
+
+ meta
+
+ This module declares the meta element type and its attributes,
+ used to provide declarative document metainformation.
+-->
+
+<!-- meta: Generic Metainformation ..................... -->
+
+<!ENTITY % meta.element "INCLUDE" >
+<![%meta.element;[
+<!ENTITY % meta.content "EMPTY" >
+<!ENTITY % meta.qname "meta" >
+<!ELEMENT %meta.qname; %meta.content; >
+<!-- end of meta.element -->]]>
+
+<!ENTITY % meta.attlist "INCLUDE" >
+<![%meta.attlist;[
+<!ATTLIST %meta.qname;
+ %XHTML.xmlns.attrib;
+ %I18n.attrib;
+ http-equiv NMTOKEN #IMPLIED
+ name NMTOKEN #IMPLIED
+ content CDATA #REQUIRED
+ scheme CDATA #IMPLIED
+>
+<!-- end of meta.attlist -->]]>
+
+<!-- end of xhtml-meta-1.mod -->
+]]>
+
+<!-- Base Element Module ........................................ -->
+<!ENTITY % xhtml-base.module "INCLUDE" >
+<![%xhtml-base.module;[
+<!ENTITY % xhtml-base.mod
+ PUBLIC "-//W3C//ELEMENTS XHTML Base Element 1.0//EN"
+ "http://www.w3.org/MarkUp/DTD/xhtml-base-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Base Element Module ........................................... -->
+<!-- file: xhtml-base-1.mod
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+ Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $ SMI
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ELEMENTS XHTML Base Element 1.0//EN"
+ SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-base-1.mod"
+
+ Revisions:
+ (none)
+ ....................................................................... -->
+
+<!-- Base element
+
+ base
+
+ This module declares the base element type and its attributes,
+ used to define a base URI against which relative URIs in the
+ document will be resolved.
+
+ Note that this module also redeclares the content model for
+ the head element to include the base element.
+-->
+
+<!-- base: Document Base URI ........................... -->
+
+<!ENTITY % base.element "INCLUDE" >
+<![%base.element;[
+<!ENTITY % base.content "EMPTY" >
+<!ENTITY % base.qname "base" >
+<!ELEMENT %base.qname; %base.content; >
+<!-- end of base.element -->]]>
+
+<!ENTITY % base.attlist "INCLUDE" >
+<![%base.attlist;[
+<!ATTLIST %base.qname;
+ %XHTML.xmlns.attrib;
+ href %URI.datatype; #REQUIRED
+>
+<!-- end of base.attlist -->]]>
+
+<!ENTITY % head.content
+ "( %HeadOpts.mix;,
+ ( ( %title.qname;, %HeadOpts.mix;, ( %base.qname;, %HeadOpts.mix; )? )
+ | ( %base.qname;, %HeadOpts.mix;, ( %title.qname;, %HeadOpts.mix; ))))"
+>
+
+<!-- end of xhtml-base-1.mod -->
+]]>
+
+<!-- Scripting Module ........................................... -->
+<!ENTITY % xhtml-script.module "INCLUDE" >
+<![%xhtml-script.module;[
+<!ENTITY % xhtml-script.mod
+ PUBLIC "-//W3C//ELEMENTS XHTML Scripting 1.0//EN"
+ "http://www.w3.org/MarkUp/DTD/xhtml-script-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Document Scripting Module ..................................... -->
+<!-- file: xhtml-script-1.mod
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+ Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $ SMI
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ELEMENTS XHTML Scripting 1.0//EN"
+ SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-script-1.mod"
+
+ Revisions:
+ (none)
+ ....................................................................... -->
+
+<!-- Scripting
+
+ script, noscript
+
+ This module declares element types and attributes used to provide
+ support for executable scripts as well as an alternate content
+ container where scripts are not supported.
+-->
+
+<!-- script: Scripting Statement ....................... -->
+
+<!ENTITY % script.element "INCLUDE" >
+<![%script.element;[
+<!ENTITY % script.content "( #PCDATA )" >
+<!ENTITY % script.qname "script" >
+<!ELEMENT %script.qname; %script.content; >
+<!-- end of script.element -->]]>
+
+<!ENTITY % script.attlist "INCLUDE" >
+<![%script.attlist;[
+<!ATTLIST %script.qname;
+ %XHTML.xmlns.attrib;
+ %id.attrib;
+ charset %Charset.datatype; #IMPLIED
+ type %ContentType.datatype; #REQUIRED
+ src %URI.datatype; #IMPLIED
+ defer ( defer ) #IMPLIED
+>
+<!-- end of script.attlist -->]]>
+
+<!-- noscript: No-Script Alternate Content ............. -->
+
+<!ENTITY % noscript.element "INCLUDE" >
+<![%noscript.element;[
+<!ENTITY % noscript.content
+ "( %Block.mix; )+"
+>
+<!ENTITY % noscript.qname "noscript" >
+<!ELEMENT %noscript.qname; %noscript.content; >
+<!-- end of noscript.element -->]]>
+
+<!ENTITY % noscript.attlist "INCLUDE" >
+<![%noscript.attlist;[
+<!ATTLIST %noscript.qname;
+ %Common.attrib;
+>
+<!-- end of noscript.attlist -->]]>
+
+<!-- end of xhtml-script-1.mod -->
+]]>
+
+<!-- Style Sheets Module ......................................... -->
+<!ENTITY % xhtml-style.module "INCLUDE" >
+<![%xhtml-style.module;[
+<!ENTITY % xhtml-style.mod
+ PUBLIC "-//W3C//ELEMENTS XHTML Style Sheets 1.0//EN"
+ "http://www.w3.org/MarkUp/DTD/xhtml-style-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Document Style Sheet Module ................................... -->
+<!-- file: xhtml-style-1.mod
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+ Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $ SMI
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//DTD XHTML Style Sheets 1.0//EN"
+ SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-style-1.mod"
+
+ Revisions:
+ (none)
+ ....................................................................... -->
+
+<!-- Style Sheets
+
+ style
+
+ This module declares the style element type and its attributes,
+ used to embed style sheet information in the document head element.
+-->
+
+<!-- style: Style Sheet Information .................... -->
+
+<!ENTITY % style.element "INCLUDE" >
+<![%style.element;[
+<!ENTITY % style.content "( #PCDATA )" >
+<!ENTITY % style.qname "style" >
+<!ELEMENT %style.qname; %style.content; >
+<!-- end of style.element -->]]>
+
+<!ENTITY % style.attlist "INCLUDE" >
+<![%style.attlist;[
+<!ATTLIST %style.qname;
+ %XHTML.xmlns.attrib;
+ %id.attrib;
+ %title.attrib;
+ %I18n.attrib;
+ type %ContentType.datatype; #REQUIRED
+ media %MediaDesc.datatype; #IMPLIED
+>
+<!-- end of style.attlist -->]]>
+
+<!-- end of xhtml-style-1.mod -->
+]]>
+
+<!-- Image Module ............................................... -->
+<!ENTITY % xhtml-image.module "INCLUDE" >
+<![%xhtml-image.module;[
+<!ENTITY % xhtml-image.mod
+ PUBLIC "-//W3C//ELEMENTS XHTML Images 1.0//EN"
+ "http://www.w3.org/MarkUp/DTD/xhtml-image-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Images Module ................................................. -->
+<!-- file: xhtml-image-1.mod
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+ Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ Rovision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $ SMI
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ELEMENTS XHTML Images 1.0//EN"
+ SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-image-1.mod"
+
+ Revisions:
+ (none)
+ ....................................................................... -->
+
+<!-- Images
+
+ img
+
+ This module provides markup to support basic image embedding.
+-->
+
+<!-- To avoid problems with text-only UAs as well as to make
+ image content understandable and navigable to users of
+ non-visual UAs, you need to provide a description with
+ the 'alt' attribute, and avoid server-side image maps.
+-->
+
+<!ENTITY % img.element "INCLUDE" >
+<![%img.element;[
+<!ENTITY % img.content "EMPTY" >
+<!ENTITY % img.qname "img" >
+<!ELEMENT %img.qname; %img.content; >
+<!-- end of img.element -->]]>
+
+<!ENTITY % img.attlist "INCLUDE" >
+<![%img.attlist;[
+<!ATTLIST %img.qname;
+ %Common.attrib;
+ src %URI.datatype; #REQUIRED
+ alt %Text.datatype; #REQUIRED
+ longdesc %URI.datatype; #IMPLIED
+ height %Length.datatype; #IMPLIED
+ width %Length.datatype; #IMPLIED
+>
+<!-- end of img.attlist -->]]>
+
+<!-- end of xhtml-image-1.mod -->
+]]>
+
+<!-- Client-side Image Map Module ............................... -->
+<!ENTITY % xhtml-csismap.module "INCLUDE" >
+<![%xhtml-csismap.module;[
+<!ENTITY % xhtml-csismap.mod
+ PUBLIC "-//W3C//ELEMENTS XHTML Client-side Image Maps 1.0//EN"
+ "http://www.w3.org/MarkUp/DTD/xhtml-csismap-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Client-side Image Map Module .................................. -->
+<!-- file: xhtml-csismap-1.mod
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+ Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $ SMI
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ELEMENTS XHTML Client-side Image Maps 1.0//EN"
+ SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-csismap-1.mod"
+
+ Revisions:
+ (none)
+ ....................................................................... -->
+
+<!-- Client-side Image Maps
+
+ area, map
+
+ This module declares elements and attributes to support client-side
+ image maps. This requires that the Image Module (or a module
+ declaring the img element type) be included in the DTD.
+
+ These can be placed in the same document or grouped in a
+ separate document, although the latter isn't widely supported
+-->
+
+<!ENTITY % area.element "INCLUDE" >
+<![%area.element;[
+<!ENTITY % area.content "EMPTY" >
+<!ENTITY % area.qname "area" >
+<!ELEMENT %area.qname; %area.content; >
+<!-- end of area.element -->]]>
+
+<!ENTITY % Shape.datatype "( rect | circle | poly | default )">
+<!ENTITY % Coords.datatype "CDATA" >
+
+<!ENTITY % area.attlist "INCLUDE" >
+<![%area.attlist;[
+<!ATTLIST %area.qname;
+ %Common.attrib;
+ href %URI.datatype; #IMPLIED
+ shape %Shape.datatype; 'rect'
+ coords %Coords.datatype; #IMPLIED
+ nohref ( nohref ) #IMPLIED
+ alt %Text.datatype; #REQUIRED
+ tabindex %Number.datatype; #IMPLIED
+ accesskey %Character.datatype; #IMPLIED
+>
+<!-- end of area.attlist -->]]>
+
+<!-- modify anchor attribute definition list
+ to allow for client-side image maps
+-->
+<!ATTLIST %a.qname;
+ shape %Shape.datatype; 'rect'
+ coords %Coords.datatype; #IMPLIED
+>
+
+<!-- modify img attribute definition list
+ to allow for client-side image maps
+-->
+<!ATTLIST %img.qname;
+ usemap IDREF #IMPLIED
+>
+
+<!-- modify form input attribute definition list
+ to allow for client-side image maps
+-->
+<!ATTLIST %input.qname;
+ usemap IDREF #IMPLIED
+>
+
+<!-- modify object attribute definition list
+ to allow for client-side image maps
+-->
+<!ATTLIST %object.qname;
+ usemap IDREF #IMPLIED
+>
+
+<!-- 'usemap' points to the 'id' attribute of a <map> element,
+ which must be in the same document; support for external
+ document maps was not widely supported in HTML and is
+ eliminated in XHTML.
+
+ It is considered an error for the element pointed to by
+ a usemap IDREF to occur in anything but a <map> element.
+-->
+
+<!ENTITY % map.element "INCLUDE" >
+<![%map.element;[
+<!ENTITY % map.content
+ "(( %Block.mix; ) | %area.qname; )+"
+>
+<!ENTITY % map.qname "map" >
+<!ELEMENT %map.qname; %map.content; >
+<!-- end of map.element -->]]>
+
+<!ENTITY % map.attlist "INCLUDE" >
+<![%map.attlist;[
+<!ATTLIST %map.qname;
+ %XHTML.xmlns.attrib;
+ id ID #REQUIRED
+ %class.attrib;
+ %title.attrib;
+ %Core.extra.attrib;
+ %I18n.attrib;
+ %Events.attrib;
+>
+<!-- end of map.attlist -->]]>
+
+<!-- end of xhtml-csismap-1.mod -->
+]]>
+
+<!-- Server-side Image Map Module ............................... -->
+<!ENTITY % xhtml-ssismap.module "INCLUDE" >
+<![%xhtml-ssismap.module;[
+<!ENTITY % xhtml-ssismap.mod
+ PUBLIC "-//W3C//ELEMENTS XHTML Server-side Image Maps 1.0//EN"
+ "http://www.w3.org/MarkUp/DTD/xhtml-ssismap-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Server-side Image Map Module .................................. -->
+<!-- file: xhtml-ssismap-1.mod
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+ Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $ SMI
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ELEMENTS XHTML Server-side Image Maps 1.0//EN"
+ SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-ssismap-1.mod"
+
+ Revisions:
+#2000-10-22: added declaration for 'ismap' on <input>
+ ....................................................................... -->
+
+<!-- Server-side Image Maps
+
+ This adds the 'ismap' attribute to the img and input elements
+ to support server-side processing of a user selection.
+-->
+
+<!ATTLIST %img.qname;
+ ismap ( ismap ) #IMPLIED
+>
+
+<!ATTLIST %input.qname;
+ ismap ( ismap ) #IMPLIED
+>
+
+<!-- end of xhtml-ssismap-1.mod -->
+]]>
+
+<!-- Param Element Module ....................................... -->
+<!ENTITY % xhtml-param.module "INCLUDE" >
+<![%xhtml-param.module;[
+<!ENTITY % xhtml-param.mod
+ PUBLIC "-//W3C//ELEMENTS XHTML Param Element 1.0//EN"
+ "http://www.w3.org/MarkUp/DTD/xhtml-param-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Param Element Module ..................................... -->
+<!-- file: xhtml-param-1.mod
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+ Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $ SMI
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ELEMENTS XHTML Param Element 1.0//EN"
+ SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-param-1.mod"
+
+ Revisions:
+ (none)
+ ....................................................................... -->
+
+<!-- Parameters for Java Applets and Embedded Objects
+
+ param
+
+ This module provides declarations for the param element,
+ used to provide named property values for the applet
+ and object elements.
+-->
+
+<!-- param: Named Property Value ....................... -->
+
+<!ENTITY % param.element "INCLUDE" >
+<![%param.element;[
+<!ENTITY % param.content "EMPTY" >
+<!ENTITY % param.qname "param" >
+<!ELEMENT %param.qname; %param.content; >
+<!-- end of param.element -->]]>
+
+<!ENTITY % param.attlist "INCLUDE" >
+<![%param.attlist;[
+<!ATTLIST %param.qname;
+ %XHTML.xmlns.attrib;
+ %id.attrib;
+ name CDATA #REQUIRED
+ value CDATA #IMPLIED
+ valuetype ( data | ref | object ) 'data'
+ type %ContentType.datatype; #IMPLIED
+>
+<!-- end of param.attlist -->]]>
+
+<!-- end of xhtml-param-1.mod -->
+]]>
+
+<!-- Embedded Object Module ..................................... -->
+<!ENTITY % xhtml-object.module "INCLUDE" >
+<![%xhtml-object.module;[
+<!ENTITY % xhtml-object.mod
+ PUBLIC "-//W3C//ELEMENTS XHTML Embedded Object 1.0//EN"
+ "http://www.w3.org/MarkUp/DTD/xhtml-object-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Embedded Object Module ........................................ -->
+<!-- file: xhtml-object-1.mod
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+ Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $ SMI
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ELEMENTS XHTML Embedded Object 1.0//EN"
+ SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-object-1.mod"
+
+ Revisions:
+ (none)
+ ....................................................................... -->
+
+<!-- Embedded Objects
+
+ object
+
+ This module declares the object element type and its attributes, used
+ to embed external objects as part of XHTML pages. In the document,
+ place param elements prior to other content within the object element.
+
+ Note that use of this module requires instantiation of the Param
+ Element Module.
+-->
+
+<!-- object: Generic Embedded Object ................... -->
+
+<!ENTITY % object.element "INCLUDE" >
+<![%object.element;[
+<!ENTITY % object.content
+ "( #PCDATA | %Flow.mix; | %param.qname; )*"
+>
+<!ENTITY % object.qname "object" >
+<!ELEMENT %object.qname; %object.content; >
+<!-- end of object.element -->]]>
+
+<!ENTITY % object.attlist "INCLUDE" >
+<![%object.attlist;[
+<!ATTLIST %object.qname;
+ %Common.attrib;
+ declare ( declare ) #IMPLIED
+ classid %URI.datatype; #IMPLIED
+ codebase %URI.datatype; #IMPLIED
+ data %URI.datatype; #IMPLIED
+ type %ContentType.datatype; #IMPLIED
+ codetype %ContentType.datatype; #IMPLIED
+ archive %URIs.datatype; #IMPLIED
+ standby %Text.datatype; #IMPLIED
+ height %Length.datatype; #IMPLIED
+ width %Length.datatype; #IMPLIED
+ name CDATA #IMPLIED
+ tabindex %Number.datatype; #IMPLIED
+>
+<!-- end of object.attlist -->]]>
+
+<!-- end of xhtml-object-1.mod -->
+]]>
+
+<!-- Tables Module ............................................... -->
+<!ENTITY % xhtml-table.module "INCLUDE" >
+<![%xhtml-table.module;[
+<!ENTITY % xhtml-table.mod
+ PUBLIC "-//W3C//ELEMENTS XHTML Tables 1.0//EN"
+ "http://www.w3.org/MarkUp/DTD/xhtml-table-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Table Module .................................................. -->
+<!-- file: xhtml-table-1.mod
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+ Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $ SMI
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ELEMENTS XHTML Tables 1.0//EN"
+ SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-table-1.mod"
+
+ Revisions:
+ (none)
+ ....................................................................... -->
+
+<!-- Tables
+
+ table, caption, thead, tfoot, tbody, colgroup, col, tr, th, td
+
+ This module declares element types and attributes used to provide
+ table markup similar to HTML 4, including features that enable
+ better accessibility for non-visual user agents.
+-->
+
+<!-- declare qualified element type names:
+-->
+<!ENTITY % table.qname "table" >
+<!ENTITY % caption.qname "caption" >
+<!ENTITY % thead.qname "thead" >
+<!ENTITY % tfoot.qname "tfoot" >
+<!ENTITY % tbody.qname "tbody" >
+<!ENTITY % colgroup.qname "colgroup" >
+<!ENTITY % col.qname "col" >
+<!ENTITY % tr.qname "tr" >
+<!ENTITY % th.qname "th" >
+<!ENTITY % td.qname "td" >
+
+<!-- The frame attribute specifies which parts of the frame around
+ the table should be rendered. The values are not the same as
+ CALS to avoid a name clash with the valign attribute.
+-->
+<!ENTITY % frame.attrib
+ "frame ( void
+ | above
+ | below
+ | hsides
+ | lhs
+ | rhs
+ | vsides
+ | box
+ | border ) #IMPLIED"
+>
+
+<!-- The rules attribute defines which rules to draw between cells:
+
+ If rules is absent then assume:
+
+ "none" if border is absent or border="0" otherwise "all"
+-->
+<!ENTITY % rules.attrib
+ "rules ( none
+ | groups
+ | rows
+ | cols
+ | all ) #IMPLIED"
+>
+
+<!-- horizontal alignment attributes for cell contents
+-->
+<!ENTITY % CellHAlign.attrib
+ "align ( left
+ | center
+ | right
+ | justify
+ | char ) #IMPLIED
+ char %Character.datatype; #IMPLIED
+ charoff %Length.datatype; #IMPLIED"
+>
+
+<!-- vertical alignment attribute for cell contents
+-->
+<!ENTITY % CellVAlign.attrib
+ "valign ( top
+ | middle
+ | bottom
+ | baseline ) #IMPLIED"
+>
+
+<!-- scope is simpler than axes attribute for common tables
+-->
+<!ENTITY % scope.attrib
+ "scope ( row
+ | col
+ | rowgroup
+ | colgroup ) #IMPLIED"
+>
+
+<!-- table: Table Element .............................. -->
+
+<!ENTITY % table.element "INCLUDE" >
+<![%table.element;[
+<!ENTITY % table.content
+ "( %caption.qname;?, ( %col.qname;* | %colgroup.qname;* ),
+ (( %thead.qname;?, %tfoot.qname;?, %tbody.qname;+ ) | ( %tr.qname;+ )))"
+>
+<!ELEMENT %table.qname; %table.content; >
+<!-- end of table.element -->]]>
+
+<!ENTITY % table.attlist "INCLUDE" >
+<![%table.attlist;[
+<!ATTLIST %table.qname;
+ %Common.attrib;
+ summary %Text.datatype; #IMPLIED
+ width %Length.datatype; #IMPLIED
+ border %Pixels.datatype; #IMPLIED
+ %frame.attrib;
+ %rules.attrib;
+ cellspacing %Length.datatype; #IMPLIED
+ cellpadding %Length.datatype; #IMPLIED
+>
+<!-- end of table.attlist -->]]>
+
+<!-- caption: Table Caption ............................ -->
+
+<!ENTITY % caption.element "INCLUDE" >
+<![%caption.element;[
+<!ENTITY % caption.content
+ "( #PCDATA | %Inline.mix; )*"
+>
+<!ELEMENT %caption.qname; %caption.content; >
+<!-- end of caption.element -->]]>
+
+<!ENTITY % caption.attlist "INCLUDE" >
+<![%caption.attlist;[
+<!ATTLIST %caption.qname;
+ %Common.attrib;
+>
+<!-- end of caption.attlist -->]]>
+
+<!-- thead: Table Header ............................... -->
+
+<!-- Use thead to duplicate headers when breaking table
+ across page boundaries, or for static headers when
+ tbody sections are rendered in scrolling panel.
+-->
+
+<!ENTITY % thead.element "INCLUDE" >
+<![%thead.element;[
+<!ENTITY % thead.content "( %tr.qname; )+" >
+<!ELEMENT %thead.qname; %thead.content; >
+<!-- end of thead.element -->]]>
+
+<!ENTITY % thead.attlist "INCLUDE" >
+<![%thead.attlist;[
+<!ATTLIST %thead.qname;
+ %Common.attrib;
+ %CellHAlign.attrib;
+ %CellVAlign.attrib;
+>
+<!-- end of thead.attlist -->]]>
+
+<!-- tfoot: Table Footer ............................... -->
+
+<!-- Use tfoot to duplicate footers when breaking table
+ across page boundaries, or for static footers when
+ tbody sections are rendered in scrolling panel.
+-->
+
+<!ENTITY % tfoot.element "INCLUDE" >
+<![%tfoot.element;[
+<!ENTITY % tfoot.content "( %tr.qname; )+" >
+<!ELEMENT %tfoot.qname; %tfoot.content; >
+<!-- end of tfoot.element -->]]>
+
+<!ENTITY % tfoot.attlist "INCLUDE" >
+<![%tfoot.attlist;[
+<!ATTLIST %tfoot.qname;
+ %Common.attrib;
+ %CellHAlign.attrib;
+ %CellVAlign.attrib;
+>
+<!-- end of tfoot.attlist -->]]>
+
+<!-- tbody: Table Body ................................. -->
+
+<!-- Use multiple tbody sections when rules are needed
+ between groups of table rows.
+-->
+
+<!ENTITY % tbody.element "INCLUDE" >
+<![%tbody.element;[
+<!ENTITY % tbody.content "( %tr.qname; )+" >
+<!ELEMENT %tbody.qname; %tbody.content; >
+<!-- end of tbody.element -->]]>
+
+<!ENTITY % tbody.attlist "INCLUDE" >
+<![%tbody.attlist;[
+<!ATTLIST %tbody.qname;
+ %Common.attrib;
+ %CellHAlign.attrib;
+ %CellVAlign.attrib;
+>
+<!-- end of tbody.attlist -->]]>
+
+<!-- colgroup: Table Column Group ...................... -->
+
+<!-- colgroup groups a set of col elements. It allows you
+ to group several semantically-related columns together.
+-->
+
+<!ENTITY % colgroup.element "INCLUDE" >
+<![%colgroup.element;[
+<!ENTITY % colgroup.content "( %col.qname; )*" >
+<!ELEMENT %colgroup.qname; %colgroup.content; >
+<!-- end of colgroup.element -->]]>
+
+<!ENTITY % colgroup.attlist "INCLUDE" >
+<![%colgroup.attlist;[
+<!ATTLIST %colgroup.qname;
+ %Common.attrib;
+ span %Number.datatype; '1'
+ width %MultiLength.datatype; #IMPLIED
+ %CellHAlign.attrib;
+ %CellVAlign.attrib;
+>
+<!-- end of colgroup.attlist -->]]>
+
+<!-- col: Table Column ................................. -->
+
+<!-- col elements define the alignment properties for
+ cells in one or more columns.
+
+ The width attribute specifies the width of the
+ columns, e.g.
+
+ width="64" width in screen pixels
+ width="0.5*" relative width of 0.5
+
+ The span attribute causes the attributes of one
+ col element to apply to more than one column.
+-->
+
+<!ENTITY % col.element "INCLUDE" >
+<![%col.element;[
+<!ENTITY % col.content "EMPTY" >
+<!ELEMENT %col.qname; %col.content; >
+<!-- end of col.element -->]]>
+
+<!ENTITY % col.attlist "INCLUDE" >
+<![%col.attlist;[
+<!ATTLIST %col.qname;
+ %Common.attrib;
+ span %Number.datatype; '1'
+ width %MultiLength.datatype; #IMPLIED
+ %CellHAlign.attrib;
+ %CellVAlign.attrib;
+>
+<!-- end of col.attlist -->]]>
+
+<!-- tr: Table Row ..................................... -->
+
+<!ENTITY % tr.element "INCLUDE" >
+<![%tr.element;[
+<!ENTITY % tr.content "( %th.qname; | %td.qname; )+" >
+<!ELEMENT %tr.qname; %tr.content; >
+<!-- end of tr.element -->]]>
+
+<!ENTITY % tr.attlist "INCLUDE" >
+<![%tr.attlist;[
+<!ATTLIST %tr.qname;
+ %Common.attrib;
+ %CellHAlign.attrib;
+ %CellVAlign.attrib;
+>
+<!-- end of tr.attlist -->]]>
+
+<!-- th: Table Header Cell ............................. -->
+
+<!-- th is for header cells, td for data,
+ but for cells acting as both use td
+-->
+
+<!ENTITY % th.element "INCLUDE" >
+<![%th.element;[
+<!ENTITY % th.content
+ "( #PCDATA | %Flow.mix; )*"
+>
+<!ELEMENT %th.qname; %th.content; >
+<!-- end of th.element -->]]>
+
+<!ENTITY % th.attlist "INCLUDE" >
+<![%th.attlist;[
+<!ATTLIST %th.qname;
+ %Common.attrib;
+ abbr %Text.datatype; #IMPLIED
+ axis CDATA #IMPLIED
+ headers IDREFS #IMPLIED
+ %scope.attrib;
+ rowspan %Number.datatype; '1'
+ colspan %Number.datatype; '1'
+ %CellHAlign.attrib;
+ %CellVAlign.attrib;
+>
+<!-- end of th.attlist -->]]>
+
+<!-- td: Table Data Cell ............................... -->
+
+<!ENTITY % td.element "INCLUDE" >
+<![%td.element;[
+<!ENTITY % td.content
+ "( #PCDATA | %Flow.mix; )*"
+>
+<!ELEMENT %td.qname; %td.content; >
+<!-- end of td.element -->]]>
+
+<!ENTITY % td.attlist "INCLUDE" >
+<![%td.attlist;[
+<!ATTLIST %td.qname;
+ %Common.attrib;
+ abbr %Text.datatype; #IMPLIED
+ axis CDATA #IMPLIED
+ headers IDREFS #IMPLIED
+ %scope.attrib;
+ rowspan %Number.datatype; '1'
+ colspan %Number.datatype; '1'
+ %CellHAlign.attrib;
+ %CellVAlign.attrib;
+>
+<!-- end of td.attlist -->]]>
+
+<!-- end of xhtml-table-1.mod -->
+]]>
+
+<!-- Forms Module ............................................... -->
+<!ENTITY % xhtml-form.module "INCLUDE" >
+<![%xhtml-form.module;[
+<!ENTITY % xhtml-form.mod
+ PUBLIC "-//W3C//ELEMENTS XHTML Forms 1.0//EN"
+ "http://www.w3.org/MarkUp/DTD/xhtml-form-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Forms Module .................................................. -->
+<!-- file: xhtml-form-1.mod
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+ Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $ SMI
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ELEMENTS XHTML Forms 1.0//EN"
+ SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-form-1.mod"
+
+ Revisions:
+ (none)
+ ....................................................................... -->
+
+<!-- Forms
+
+ form, label, input, select, optgroup, option,
+ textarea, fieldset, legend, button
+
+ This module declares markup to provide support for online
+ forms, based on the features found in HTML 4 forms.
+-->
+
+<!-- declare qualified element type names:
+-->
+<!ENTITY % form.qname "form" >
+<!ENTITY % label.qname "label" >
+<!ENTITY % input.qname "input" >
+<!ENTITY % select.qname "select" >
+<!ENTITY % optgroup.qname "optgroup" >
+<!ENTITY % option.qname "option" >
+<!ENTITY % textarea.qname "textarea" >
+<!ENTITY % fieldset.qname "fieldset" >
+<!ENTITY % legend.qname "legend" >
+<!ENTITY % button.qname "button" >
+
+<!-- %BlkNoForm.mix; includes all non-form block elements,
+ plus %Misc.class;
+-->
+<!ENTITY % BlkNoForm.mix
+ "%Heading.class;
+ | %List.class;
+ | %BlkStruct.class;
+ %BlkPhras.class;
+ %BlkPres.class;
+ %Table.class;
+ %Block.extra;
+ %Misc.class;"
+>
+
+<!-- form: Form Element ................................ -->
+
+<!ENTITY % form.element "INCLUDE" >
+<![%form.element;[
+<!ENTITY % form.content
+ "( %BlkNoForm.mix;
+ | %fieldset.qname; )+"
+>
+<!ELEMENT %form.qname; %form.content; >
+<!-- end of form.element -->]]>
+
+<!ENTITY % form.attlist "INCLUDE" >
+<![%form.attlist;[
+<!ATTLIST %form.qname;
+ %Common.attrib;
+ action %URI.datatype; #REQUIRED
+ method ( get | post ) 'get'
+ enctype %ContentType.datatype; 'application/x-www-form-urlencoded'
+ accept-charset %Charsets.datatype; #IMPLIED
+ accept %ContentTypes.datatype; #IMPLIED
+>
+<!-- end of form.attlist -->]]>
+
+<!-- label: Form Field Label Text ...................... -->
+
+<!-- Each label must not contain more than ONE field
+-->
+
+<!ENTITY % label.element "INCLUDE" >
+<![%label.element;[
+<!ENTITY % label.content
+ "( #PCDATA
+ | %input.qname; | %select.qname; | %textarea.qname; | %button.qname;
+ | %InlStruct.class;
+ %InlPhras.class;
+ %I18n.class;
+ %InlPres.class;
+ %Anchor.class;
+ %InlSpecial.class;
+ %Inline.extra;
+ %Misc.class; )*"
+>
+<!ELEMENT %label.qname; %label.content; >
+<!-- end of label.element -->]]>
+
+<!ENTITY % label.attlist "INCLUDE" >
+<![%label.attlist;[
+<!ATTLIST %label.qname;
+ %Common.attrib;
+ for IDREF #IMPLIED
+ accesskey %Character.datatype; #IMPLIED
+>
+<!-- end of label.attlist -->]]>
+
+<!-- input: Form Control ............................... -->
+
+<!ENTITY % input.element "INCLUDE" >
+<![%input.element;[
+<!ENTITY % input.content "EMPTY" >
+<!ELEMENT %input.qname; %input.content; >
+<!-- end of input.element -->]]>
+
+<!ENTITY % input.attlist "INCLUDE" >
+<![%input.attlist;[
+<!ENTITY % InputType.class
+ "( text | password | checkbox | radio | submit
+ | reset | file | hidden | image | button )"
+>
+<!-- attribute 'name' required for all but submit & reset
+-->
+<!ATTLIST %input.qname;
+ %Common.attrib;
+ type %InputType.class; 'text'
+ name CDATA #IMPLIED
+ value CDATA #IMPLIED
+ checked ( checked ) #IMPLIED
+ disabled ( disabled ) #IMPLIED
+ readonly ( readonly ) #IMPLIED
+ size %Number.datatype; #IMPLIED
+ maxlength %Number.datatype; #IMPLIED
+ src %URI.datatype; #IMPLIED
+ alt %Text.datatype; #IMPLIED
+ tabindex %Number.datatype; #IMPLIED
+ accesskey %Character.datatype; #IMPLIED
+ accept %ContentTypes.datatype; #IMPLIED
+>
+<!-- end of input.attlist -->]]>
+
+<!-- select: Option Selector ........................... -->
+
+<!ENTITY % select.element "INCLUDE" >
+<![%select.element;[
+<!ENTITY % select.content
+ "( %optgroup.qname; | %option.qname; )+"
+>
+<!ELEMENT %select.qname; %select.content; >
+<!-- end of select.element -->]]>
+
+<!ENTITY % select.attlist "INCLUDE" >
+<![%select.attlist;[
+<!ATTLIST %select.qname;
+ %Common.attrib;
+ name CDATA #IMPLIED
+ size %Number.datatype; #IMPLIED
+ multiple ( multiple ) #IMPLIED
+ disabled ( disabled ) #IMPLIED
+ tabindex %Number.datatype; #IMPLIED
+>
+<!-- end of select.attlist -->]]>
+
+<!-- optgroup: Option Group ............................ -->
+
+<!ENTITY % optgroup.element "INCLUDE" >
+<![%optgroup.element;[
+<!ENTITY % optgroup.content "( %option.qname; )+" >
+<!ELEMENT %optgroup.qname; %optgroup.content; >
+<!-- end of optgroup.element -->]]>
+
+<!ENTITY % optgroup.attlist "INCLUDE" >
+<![%optgroup.attlist;[
+<!ATTLIST %optgroup.qname;
+ %Common.attrib;
+ disabled ( disabled ) #IMPLIED
+ label %Text.datatype; #REQUIRED
+>
+<!-- end of optgroup.attlist -->]]>
+
+<!-- option: Selectable Choice ......................... -->
+
+<!ENTITY % option.element "INCLUDE" >
+<![%option.element;[
+<!ENTITY % option.content "( #PCDATA )" >
+<!ELEMENT %option.qname; %option.content; >
+<!-- end of option.element -->]]>
+
+<!ENTITY % option.attlist "INCLUDE" >
+<![%option.attlist;[
+<!ATTLIST %option.qname;
+ %Common.attrib;
+ selected ( selected ) #IMPLIED
+ disabled ( disabled ) #IMPLIED
+ label %Text.datatype; #IMPLIED
+ value CDATA #IMPLIED
+>
+<!-- end of option.attlist -->]]>
+
+<!-- textarea: Multi-Line Text Field ................... -->
+
+<!ENTITY % textarea.element "INCLUDE" >
+<![%textarea.element;[
+<!ENTITY % textarea.content "( #PCDATA )" >
+<!ELEMENT %textarea.qname; %textarea.content; >
+<!-- end of textarea.element -->]]>
+
+<!ENTITY % textarea.attlist "INCLUDE" >
+<![%textarea.attlist;[
+<!ATTLIST %textarea.qname;
+ %Common.attrib;
+ name CDATA #IMPLIED
+ rows %Number.datatype; #REQUIRED
+ cols %Number.datatype; #REQUIRED
+ disabled ( disabled ) #IMPLIED
+ readonly ( readonly ) #IMPLIED
+ tabindex %Number.datatype; #IMPLIED
+ accesskey %Character.datatype; #IMPLIED
+>
+<!-- end of textarea.attlist -->]]>
+
+<!-- fieldset: Form Control Group ...................... -->
+
+<!-- #PCDATA is to solve the mixed content problem,
+ per specification only whitespace is allowed
+-->
+
+<!ENTITY % fieldset.element "INCLUDE" >
+<![%fieldset.element;[
+<!ENTITY % fieldset.content
+ "( #PCDATA | %legend.qname; | %Flow.mix; )*"
+>
+<!ELEMENT %fieldset.qname; %fieldset.content; >
+<!-- end of fieldset.element -->]]>
+
+<!ENTITY % fieldset.attlist "INCLUDE" >
+<![%fieldset.attlist;[
+<!ATTLIST %fieldset.qname;
+ %Common.attrib;
+>
+<!-- end of fieldset.attlist -->]]>
+
+<!-- legend: Fieldset Legend ........................... -->
+
+<!ENTITY % legend.element "INCLUDE" >
+<![%legend.element;[
+<!ENTITY % legend.content
+ "( #PCDATA | %Inline.mix; )*"
+>
+<!ELEMENT %legend.qname; %legend.content; >
+<!-- end of legend.element -->]]>
+
+<!ENTITY % legend.attlist "INCLUDE" >
+<![%legend.attlist;[
+<!ATTLIST %legend.qname;
+ %Common.attrib;
+ accesskey %Character.datatype; #IMPLIED
+>
+<!-- end of legend.attlist -->]]>
+
+<!-- button: Push Button ............................... -->
+
+<!ENTITY % button.element "INCLUDE" >
+<![%button.element;[
+<!ENTITY % button.content
+ "( #PCDATA
+ | %BlkNoForm.mix;
+ | %InlStruct.class;
+ %InlPhras.class;
+ %InlPres.class;
+ %I18n.class;
+ %InlSpecial.class;
+ %Inline.extra; )*"
+>
+<!ELEMENT %button.qname; %button.content; >
+<!-- end of button.element -->]]>
+
+<!ENTITY % button.attlist "INCLUDE" >
+<![%button.attlist;[
+<!ATTLIST %button.qname;
+ %Common.attrib;
+ name CDATA #IMPLIED
+ value CDATA #IMPLIED
+ type ( button | submit | reset ) 'submit'
+ disabled ( disabled ) #IMPLIED
+ tabindex %Number.datatype; #IMPLIED
+ accesskey %Character.datatype; #IMPLIED
+>
+<!-- end of button.attlist -->]]>
+
+<!-- end of xhtml-form-1.mod -->
+]]>
+
+<!-- Target Attribute Module .................................... -->
+<!ENTITY % xhtml-target.module "INCLUDE" >
+<![%xhtml-target.module;[
+<!ENTITY % xhtml-target.mod
+ PUBLIC "-//W3C//ELEMENTS XHTML Target 1.0//EN"
+ "http://www.w3.org/MarkUp/DTD/xhtml-target-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Target Module ................................................. -->
+<!-- file: xhtml-target-1.mod
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+ Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $ SMI
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ELEMENTS XHTML Target 1.0//EN"
+ SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-target-1.mod"
+
+ Revisions:
+ (none)
+ ....................................................................... -->
+
+<!-- Target
+
+ target
+
+ This module declares the 'target' attribute used for opening windows
+-->
+
+<!-- render in this frame -->
+<!ENTITY % FrameTarget.datatype "CDATA" >
+
+<!-- add 'target' attribute to 'a' element -->
+<!ATTLIST %a.qname;
+ target %FrameTarget.datatype; #IMPLIED
+>
+
+<!-- add 'target' attribute to 'area' element -->
+<!ATTLIST %area.qname;
+ target %FrameTarget.datatype; #IMPLIED
+>
+
+<!-- add 'target' attribute to 'link' element -->
+<!ATTLIST %link.qname;
+ target %FrameTarget.datatype; #IMPLIED
+>
+
+<!-- add 'target' attribute to 'form' element -->
+<!ATTLIST %form.qname;
+ target %FrameTarget.datatype; #IMPLIED
+>
+
+<!-- add 'target' attribute to 'base' element -->
+<!ATTLIST %base.qname;
+ target %FrameTarget.datatype; #IMPLIED
+>
+
+<!-- end of xhtml-target-1.mod -->
+]]>
+
+<!-- Legacy Markup ............................................... -->
+<!ENTITY % xhtml-legacy.module "IGNORE" >
+<![%xhtml-legacy.module;[
+<!ENTITY % xhtml-legacy.mod
+ PUBLIC "-//W3C//ELEMENTS XHTML Legacy Markup 1.0//EN"
+ "http://www.w3.org/MarkUp/DTD/xhtml-legacy-1.mod" >
+%xhtml-legacy.mod;]]>
+
+<!-- Document Structure Module (required) ....................... -->
+<!ENTITY % xhtml-struct.module "INCLUDE" >
+<![%xhtml-struct.module;[
+<!ENTITY % xhtml-struct.mod
+ PUBLIC "-//W3C//ELEMENTS XHTML Document Structure 1.0//EN"
+ "http://www.w3.org/MarkUp/DTD/xhtml-struct-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Structure Module .............................................. -->
+<!-- file: xhtml-struct-1.mod
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+ Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $ SMI
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ELEMENTS XHTML Document Structure 1.0//EN"
+ SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-struct-1.mod"
+
+ Revisions:
+ (none)
+ ....................................................................... -->
+
+<!-- Document Structure
+
+ title, head, body, html
+
+ The Structure Module defines the major structural elements and
+ their attributes.
+
+ Note that the content model of the head element type is redeclared
+ when the Base Module is included in the DTD.
+
+ The parameter entity containing the XML namespace URI value used
+ for XHTML is '%XHTML.xmlns;', defined in the Qualified Names module.
+-->
+
+<!-- title: Document Title ............................. -->
+
+<!-- The title element is not considered part of the flow of text.
+ It should be displayed, for example as the page header or
+ window title. Exactly one title is required per document.
+-->
+
+<!ENTITY % title.element "INCLUDE" >
+<![%title.element;[
+<!ENTITY % title.content "( #PCDATA )" >
+<!ENTITY % title.qname "title" >
+<!ELEMENT %title.qname; %title.content; >
+<!-- end of title.element -->]]>
+
+<!ENTITY % title.attlist "INCLUDE" >
+<![%title.attlist;[
+<!ATTLIST %title.qname;
+ %XHTML.xmlns.attrib;
+ %I18n.attrib;
+>
+<!-- end of title.attlist -->]]>
+
+<!-- head: Document Head ............................... -->
+
+<!ENTITY % head.element "INCLUDE" >
+<![%head.element;[
+<!ENTITY % head.content
+ "( %HeadOpts.mix;, %title.qname;, %HeadOpts.mix; )"
+>
+<!ENTITY % head.qname "head" >
+<!ELEMENT %head.qname; %head.content; >
+<!-- end of head.element -->]]>
+
+<!ENTITY % head.attlist "INCLUDE" >
+<![%head.attlist;[
+<!-- reserved for future use with document profiles
+-->
+<!ENTITY % profile.attrib
+ "profile %URI.datatype; '%XHTML.profile;'"
+>
+
+<!ATTLIST %head.qname;
+ %XHTML.xmlns.attrib;
+ %I18n.attrib;
+ %profile.attrib;
+>
+<!-- end of head.attlist -->]]>
+
+<!-- body: Document Body ............................... -->
+
+<!ENTITY % body.element "INCLUDE" >
+<![%body.element;[
+<!ENTITY % body.content
+ "( %Block.mix; )*"
+>
+<!ENTITY % body.qname "body" >
+<!ELEMENT %body.qname; %body.content; >
+<!-- end of body.element -->]]>
+
+<!ENTITY % body.attlist "INCLUDE" >
+<![%body.attlist;[
+<!ATTLIST %body.qname;
+ %Common.attrib;
+>
+<!-- end of body.attlist -->]]>
+
+<!-- html: XHTML Document Element ...................... -->
+
+<!ENTITY % html.element "INCLUDE" >
+<![%html.element;[
+<!ENTITY % html.content "( %head.qname;, %body.qname; )" >
+<!ENTITY % html.qname "html" >
+<!ELEMENT %html.qname; %html.content; >
+<!-- end of html.element -->]]>
+
+<![%XHTML.xsi.attrs;[
+<!-- define a parameter for the XSI schemaLocation attribute -->
+<!ENTITY % XSI.schemaLocation.attrib
+ "%XSI.pfx;schemaLocation %URIs.datatype; #IMPLIED"
+>
+]]>
+<!ENTITY % XSI.schemaLocation.attrib "">
+
+<!ENTITY % html.attlist "INCLUDE" >
+<![%html.attlist;[
+<!-- version attribute value defined in driver
+-->
+<!ENTITY % XHTML.version.attrib
+ "version %FPI.datatype; #FIXED '%XHTML.version;'"
+>
+<!-- schemaLocation attribute from XML Schema
+-->
+<!ENTITY % XSI.schemaLocation.attrib
+ "schemaLocation %URIs.datatype; #IMPLIED"
+>
+
+<!-- see the Qualified Names module for information
+ on how to extend XHTML using XML namespaces
+-->
+<!ATTLIST %html.qname;
+ %XHTML.xmlns.attrib;
+ %XSI.schemaLocation.attrib;
+ %XHTML.version.attrib;
+ %I18n.attrib;
+>
+<!-- end of html.attlist -->]]>
+
+<!-- end of xhtml-struct-1.mod -->
+]]>
+
+<!-- end of XHTML 1.1 DTD ................................................. -->
+<!-- ....................................................................... -->
+
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/Layering.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/Layering.png
new file mode 100644
index 000000000..0f54738a2
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/Layering.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/WebHead1.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/WebHead1.png
new file mode 100644
index 000000000..d9ceb6fcb
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/WebHead1.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/WebHead2.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/WebHead2.png
new file mode 100644
index 000000000..348de135c
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/WebHead2.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/WebHeadBar.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/WebHeadBar.png
new file mode 100644
index 000000000..d049ac9ec
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/WebHeadBar.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/arrow-left-trans.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/arrow-left-trans.png
new file mode 100644
index 000000000..c782d3cc1
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/arrow-left-trans.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/arrow-right-trans.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/arrow-right-trans.png
new file mode 100644
index 000000000..2c86f2b47
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/arrow-right-trans.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/arrow-right2-trans.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/arrow-right2-trans.png
new file mode 100644
index 000000000..5c9d7ccfd
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/arrow-right2-trans.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/bend-trans.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/bend-trans.png
new file mode 100644
index 000000000..923ef5ba3
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/bend-trans.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/bottom-left-small.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/bottom-left-small.png
new file mode 100644
index 000000000..e9de86f6d
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/bottom-left-small.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/bottom-right-small.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/bottom-right-small.png
new file mode 100644
index 000000000..e2d132584
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/bottom-right-small.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/button.down.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/button.down.gif
new file mode 100644
index 000000000..3d7236d08
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/button.down.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/favicon.ico b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/favicon.ico
new file mode 100644
index 000000000..4520142f9
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/favicon.ico
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/feed.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/feed.png
new file mode 100644
index 000000000..7c3aceb66
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/feed.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/guards.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/guards.png
new file mode 100644
index 000000000..741696cc2
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/guards.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/heading-left-small.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/heading-left-small.png
new file mode 100644
index 000000000..c8db6954f
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/heading-left-small.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/heading-left.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/heading-left.png
new file mode 100644
index 000000000..df1f8120e
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/heading-left.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/heading-right-small.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/heading-right-small.png
new file mode 100644
index 000000000..99e1dc130
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/heading-right-small.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/heading-right.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/heading-right.png
new file mode 100644
index 000000000..0734cd06c
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/heading-right.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/implicitly_overriding_playedby.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/implicitly_overriding_playedby.png
new file mode 100644
index 000000000..b76a2cb9b
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/implicitly_overriding_playedby.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/implicitly_overriding_playedby_base.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/implicitly_overriding_playedby_base.png
new file mode 100644
index 000000000..b7c24e49c
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/implicitly_overriding_playedby_base.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/jira.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/jira.png
new file mode 100644
index 000000000..5f56e3272
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/jira.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/junit.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/junit.gif
new file mode 100644
index 000000000..229e93f47
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/junit.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/line.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/line.gif
new file mode 100644
index 000000000..212443d52
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/line.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/linkto_help.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/linkto_help.gif
new file mode 100644
index 000000000..86550fe9f
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/linkto_help.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/ot32.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/ot32.png
new file mode 100644
index 000000000..30e387217
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/ot32.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/pass.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/pass.gif
new file mode 100644
index 000000000..e21b9fcef
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/pass.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/pdficon_small.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/pdficon_small.gif
new file mode 100644
index 000000000..bb5edcac3
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/pdficon_small.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/permalink.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/permalink.png
new file mode 100644
index 000000000..3a7bcc1c6
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/permalink.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/smart_lifting_small.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/smart_lifting_small.png
new file mode 100644
index 000000000..362ff65e3
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/smart_lifting_small.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/team_nesting_hor.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/team_nesting_hor.png
new file mode 100644
index 000000000..aa2457589
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/team_nesting_hor.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/trac_logo_16.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/trac_logo_16.png
new file mode 100644
index 000000000..9c2f0f1d0
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/trac_logo_16.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/trac_logo_mini.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/trac_logo_mini.png
new file mode 100644
index 000000000..38c038d64
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/trac_logo_mini.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/valid-css2-blue.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/valid-css2-blue.png
new file mode 100644
index 000000000..6140a0fa7
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/valid-css2-blue.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/valid-xhtml10-blue.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/valid-xhtml10-blue.png
new file mode 100644
index 000000000..e971248a3
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/images/valid-xhtml10-blue.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/css/heading_left.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/css/heading_left.png
new file mode 100644
index 000000000..bc2bff7d4
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/css/heading_left.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/css/heading_right.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/css/heading_right.png
new file mode 100644
index 000000000..3c4af599d
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/css/heading_right.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/css/line.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/css/line.gif
new file mode 100644
index 000000000..212443d52
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/css/line.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/css/otjld.css b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/css/otjld.css
new file mode 100644
index 000000000..c1c2c9c88
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/css/otjld.css
@@ -0,0 +1,401 @@
+body {
+ background-color: #ffffff;
+ font-family: helvetica,avalon,sans-serif;
+ margin: 4px;
+ padding: 4px;
+}
+
+/* Links: */
+a:visited { color: #5060f7; text-decoration: none; }
+a:link { color: #3010ff; text-decoration: none; }
+a:hover { color: black; background-color: #e8e8fc; }
+
+a.syntax {
+ border: 1px solid red;
+ margin: 2px;
+ padding: 2px;
+}
+
+a img {
+ border-style: none;
+}
+
+/* ToC page: */
+div.toc {
+ font-weight: bold;
+ padding-left: 20px;
+}
+
+div.toc.depth1 {
+ font-size: 1.2em;
+}
+
+div.toc.depth2 {
+ padding-left: 50px;
+}
+div.toc.depth2 a {
+ color: black;
+}
+
+div.toc.depth3 {
+ padding-left: 80px;
+}
+div.toc.depth3 a {
+ color: black;
+}
+
+/* Chapter headings (with icon): */
+div.chapter {
+ margin: 0px;
+ padding: 0px;
+}
+
+div.headl {
+ height: 40px;
+ width: 100%;
+ background: url(heading_left.png) no-repeat left;
+ margin-bottom: 10px;
+ margin-top: 0px;
+ padding: 0px;
+}
+
+div.headr {
+ height: 40px;
+ background: url(heading_right.png) no-repeat top right;
+ margin: 0px;
+ padding: 0px;
+}
+
+div.headr h1 {
+ height: 34px;
+ border-top: 2px solid #626280;
+ border-bottom: 2px solid #626280;
+ background-color: #9090B0;
+ color:#ffffe0;
+ font-size: 20pt;
+ margin-left: 50px;
+ margin-right: 22px;
+ padding-left: 10px;
+ padding-top: 2px;
+ margin-top: 0px;
+ margin-bottom: 0px;
+ padding-bottom: 0px;
+}
+
+/* Mini-ToC-Box: */
+div#toc-box, div.toc-box {
+ position: fixed;
+ top: 100px;
+ right: 5px;
+ width: 22pt;
+ z-index: 9;
+ background-color: #fff8e0;
+ border: 2px solid #e0e0f0;
+ border-right: none;
+ font-size: 10pt;
+ white-space: nowrap;
+ opacity: 0.5;
+ -moz-opacity: 0.5;
+ filter: alpha(opacity=50);
+}
+
+div#toc-box:hover, div.toc-box:hover {
+ right: 5px;
+ width: auto;
+ border: 2px solid #e0e0f0;
+ opacity: 0.9;
+ -moz-opacity: 0.9;
+ filter: alpha(opacity=90);
+}
+
+ul.toc-box {
+ list-style-type: none;
+ margin: 5px;
+ padding: 0px;
+}
+
+/* Intro: */
+div.intro {
+ width: 90%;
+ max-width: 820px;
+ margin: 10px;
+ margin-left: 40px;
+ margin-right: auto;
+}
+
+div.line {
+ clear: both;
+ height: 5px;
+ background: url(line.gif) no-repeat left;
+}
+
+div.term {
+ float: left;
+ width: 25%;
+ min-width: 130px;
+ max-width: 190px;
+ padding: 2px;
+ color: #000060;
+}
+
+div.termdesc {
+ float: left;
+ width: 70%;
+ min-width: 300px;
+ max-width: 600px;
+ padding: 2px;
+}
+
+/* (Sub)sections: */
+div.sect, div.aux {
+ padding-left: 5px;
+ margin-right: 25pt;
+}
+
+h2.sect {
+ position: relative;
+ background-color: #e0e0f0;
+ padding: 2px;
+ padding-left: 10px;
+}
+
+h3.sect, h4.aux {
+ position: relative;
+ background-color: #e0e0f0;
+ padding: 2px;
+ padding-left: 5px;
+}
+
+div.subsect {
+ width: 90%;
+ margin-left: 20px;
+ margin-right: 20px;
+ margin-top: 10px;
+ margin-bottom: 10px;
+}
+
+h4.subsect {
+ font-weight: normal;
+ margin-left: -20px;
+ margin-bottom: 4px;
+}
+h4.subsect + p {
+ margin-top: 2px;
+}
+
+h4.subsect .title {
+ text-decoration: underline;
+}
+
+span.toplink {
+ position: absolute; right: 10px;
+ font-size: 10pt;
+ font-weight: normal;
+}
+
+/* Listings: */
+div.listing {
+ float: none;
+ width: 90%;
+ overflow: auto;
+ font-family: Courier;
+ font-size: 10pt;
+ padding: 0;
+ margin: 2px;
+}
+
+div.listing.frame {
+ border: 4px solid #9090B0;
+}
+
+table.listing {
+ width: 100%;
+ border: none;
+ border-spacing: 0;
+ border-collapse: collapse;
+}
+
+tr.line.odd {
+ background-color: #fff0c8;
+}
+
+tr.line.even {
+ background-color: #fff8e0;
+}
+
+div.listing pre {
+ margin: 0px;
+ padding: 2px;
+}
+
+td.ln {
+ color: #5060f7;
+ width: 20px;
+ text-align: right;
+ vertical-align: middle;
+ font-size: 12pt;
+ padding-left: 5px;
+ padding-right: 10px;
+}
+
+pre em {
+ font-style: normal;
+ color: blue;
+}
+pre .comment {
+ color: green;
+}
+
+h5.listing {
+ margin-bottom: 0px;
+}
+
+/* other OTJLD elements: */
+div.note {
+ font-style: italic;
+ margin-left: 10px;
+}
+
+div.codecomment {
+ width: 90%;
+ background-color: #fff8e0;
+ font-size: 0.8em;
+ margin-top: 5px;
+ padding: 2px;
+}
+div.codecomment>h5, div.note>h5 {
+ margin: 2px;
+}
+div.codecomment>h5+p, div.note>h5+p {
+ margin-top: 2px;
+}
+
+table.syntaxrule {
+ width: 80%;
+ border: 2px solid #e0e0f0;
+ border-spacing: 0px;
+ border-collapse: collapse;
+ margin: 4px;
+ padding: 0;
+}
+table.syntaxrule td.sect {
+ width: 80px;
+ border: 2px solid #e0e0f0;
+ padding: 5px;
+ vertical-align: top;
+ font-weight: bold;
+}
+table.syntaxrule td.rule {
+ padding-left: 20px;
+ background-color: #fff8e0;
+}
+table.syntaxrule .title {
+ margin-left: -10px;
+ font-weight: bold;
+ font-style: italic;
+ color: blue;
+}
+
+ol.constraints {
+ list-style-type: lower-alpha;
+}
+ol.constraints .title {
+ text-decoration: underline;
+}
+h5.constraints {
+ margin-bottom: 2px;
+}
+
+/* page navigation: */
+table.nav {
+ border: 2px solid #e0e0f0;
+ border-collapse: collapse;
+ width: 95%;
+ white-space: nowrap;
+ margin-left: auto;
+ margin-right: auto;
+ margin-top: 5px;
+ margin-bottom: 5px;
+ background-color: #fff8e0;
+ font-size: 10pt;
+}
+
+td.back {
+ width: 35%;
+ padding-left: 4px;
+ text-align: left;
+ white-space: nowrap;
+}
+td.top {
+ border: 2px solid #e0e0f0;
+ text-align: center;
+ white-space: nowrap;
+}
+td.next {
+ width: 35%;
+ padding-right: 4px;
+ text-align: right;
+ white-space: nowrap;
+}
+
+div.nav {
+ width: 95%;
+ margin-left: auto;
+ margin-right: auto;
+ white-space: nowrap;
+}
+
+a.nav {
+ font-size: 10pt;
+}
+
+/* page footer: */
+div.footer {
+ margin-top: 10px;
+ font-size: 10pt;
+ color: gray;
+}
+
+#w3c {
+ float: right;
+}
+
+/* to clear floats: */
+div.clearer {
+ clear: both;
+ line-height: 0pt;
+ font-size: 1px;
+}
+
+/* tables: */
+table {
+ border-style: solid;
+ border-color: #e0e0f0;
+ border-spacing: 0px;
+ border-collapse: collapse;
+}
+
+/* special highlighting: */
+.error {
+ color: red;
+}
+
+.blue {
+ color: blue;
+}
+.green {
+ color: green;
+}
+
+.underline {
+ text-decoration: underline;
+}
+
+/* zebra stripes ;-) */
+.z1 { background-color:#fff0c8; }
+
+.z2 { background-color:#fff8e0; }
+
+span.indent5 {
+ padding-left: 5mm;
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/css/valid-xhtml11-blue.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/css/valid-xhtml11-blue.png
new file mode 100644
index 000000000..88fefcbf1
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/css/valid-xhtml11-blue.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/images/Layering.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/images/Layering.png
new file mode 100644
index 000000000..0f54738a2
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/images/Layering.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/images/foo.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/images/foo.png
new file mode 100644
index 000000000..aefdfd651
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/images/foo.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/images/guards.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/images/guards.png
new file mode 100644
index 000000000..741696cc2
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/images/guards.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/images/implicitly_overriding_playedby.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/images/implicitly_overriding_playedby.png
new file mode 100644
index 000000000..b76a2cb9b
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/images/implicitly_overriding_playedby.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/images/implicitly_overriding_playedby_base.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/images/implicitly_overriding_playedby_base.png
new file mode 100644
index 000000000..b7c24e49c
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/images/implicitly_overriding_playedby_base.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/images/smart_lifting_small.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/images/smart_lifting_small.png
new file mode 100644
index 000000000..362ff65e3
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/images/smart_lifting_small.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/images/team_nesting_hor.png b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/images/team_nesting_hor.png
new file mode 100644
index 000000000..aa2457589
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/images/team_nesting_hor.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/index.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/index.html
new file mode 100644
index 000000000..3130288ac
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/index.html
@@ -0,0 +1,127 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <div class="headl">
+ <div class="headr">
+ <h1>Table of Contents</h1>
+ </div>
+ </div>
+ <div class="toc depth1"><a href="s0.html" rel="section">&sect;0&nbsp;About this Document</a></div>
+ <div class="toc depth2"><a href="s0.1.html" rel="section">&sect;0.1&nbsp;Purpose(s) of this document</a></div>
+ <div class="toc depth2"><a href="s0.2.html" rel="section">&sect;0.2&nbsp;Text structure</a></div>
+ <div class="toc depth2"><a href="s0.3.html" rel="section">&sect;0.3&nbsp;Compiler messages</a></div>
+ <div class="toc depth2"><a href="s0.4.html" rel="section">&sect;0.4&nbsp;Versions</a></div>
+ <div class="toc depth2"><a href="s0.5.html" rel="section">&sect;0.5&nbsp;Publishing</a></div>
+ <div class="toc depth1"><a href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a></div>
+ <div class="toc depth2"><a href="s1.1.html" rel="section">&sect;1.1&nbsp;Team classes</a></div>
+ <div class="toc depth2"><a href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a></div>
+ <div class="toc depth3"><a href="s1.2.1.html" rel="section">&sect;1.2.1&nbsp;Modifiers for roles</a></div>
+ <div class="toc depth3"><a href="s1.2.2.html" rel="section">&sect;1.2.2&nbsp;Externalized roles</a></div>
+ <div class="toc depth3"><a href="s1.2.3.html" rel="section">&sect;1.2.3&nbsp;Protected roles</a></div>
+ <div class="toc depth3"><a href="s1.2.4.html" rel="section">&sect;1.2.4&nbsp;Type tests and casts</a></div>
+ <div class="toc depth3"><a href="s1.2.5.html" rel="section">&sect;1.2.5&nbsp;File structure</a></div>
+ <div class="toc depth2"><a href="s1.3.html" rel="section">&sect;1.3&nbsp;Acquisition and implicit inheritance of role classes</a></div>
+ <div class="toc depth3"><a href="s1.3.1.html" rel="section">&sect;1.3.1&nbsp;Acquisition and implicit inheritance of role classes</a></div>
+ <div class="toc depth3"><a href="s1.3.2.html" rel="section">&sect;1.3.2&nbsp;Regular role inheritance</a></div>
+ <div class="toc depth2"><a href="s1.4.html" rel="section">&sect;1.4&nbsp;Name clashes</a></div>
+ <div class="toc depth2"><a href="s1.5.html" rel="section">&sect;1.5&nbsp;Team and role nesting</a></div>
+ <div class="toc depth1"><a href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a></div>
+ <div class="toc depth2"><a href="s2.1.html" rel="section">&sect;2.1&nbsp;playedBy relation</a></div>
+ <div class="toc depth3"><a href="s2.1.1.html" rel="section">&sect;2.1.1&nbsp;Binding interfaces</a></div>
+ <div class="toc depth3"><a href="s2.1.2.html" rel="section">&sect;2.1.2&nbsp;Legal base classes</a></div>
+ <div class="toc depth2"><a href="s2.2.html" rel="section">&sect;2.2&nbsp;Lowering</a></div>
+ <div class="toc depth2"><a href="s2.3.html" rel="section">&sect;2.3&nbsp;Lifting</a></div>
+ <div class="toc depth3"><a href="s2.3.1.html" rel="section">&sect;2.3.1&nbsp;Implicit role creation</a></div>
+ <div class="toc depth3"><a href="s2.3.2.html" rel="section">&sect;2.3.2&nbsp;Declared lifting</a></div>
+ <div class="toc depth3"><a href="s2.3.3.html" rel="section">&sect;2.3.3&nbsp;Smart lifting</a></div>
+ <div class="toc depth3"><a href="s2.3.4.html" rel="section">&sect;2.3.4&nbsp;Binding ambiguities</a></div>
+ <div class="toc depth2"><a href="s2.4.html" rel="section">&sect;2.4&nbsp;Explicit role creation</a></div>
+ <div class="toc depth3"><a href="s2.4.1.html" rel="section">&sect;2.4.1&nbsp;Role creation via a lifting constructor</a></div>
+ <div class="toc depth3"><a href="s2.4.2.html" rel="section">&sect;2.4.2&nbsp;Role creation via a regular constructor</a></div>
+ <div class="toc depth3"><a href="s2.4.3.html" rel="section">&sect;2.4.3&nbsp;Role creation in the presence of smart lifting</a></div>
+ <div class="toc depth2"><a href="s2.5.html" rel="section">&sect;2.5&nbsp;Abstract Roles</a></div>
+ <div class="toc depth2"><a href="s2.6.html" rel="section">&sect;2.6&nbsp;Explicit base references</a></div>
+ <div class="toc depth2"><a href="s2.7.html" rel="section">&sect;2.7&nbsp;Advanced structures</a></div>
+ <div class="toc depth1"><a href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a></div>
+ <div class="toc depth2"><a href="s3.1.html" rel="section">&sect;3.1&nbsp;Callout method binding</a></div>
+ <div class="toc depth2"><a href="s3.2.html" rel="section">&sect;3.2&nbsp;Callout parameter mapping</a></div>
+ <div class="toc depth2"><a href="s3.3.html" rel="section">&sect;3.3&nbsp;Lifting and lowering</a></div>
+ <div class="toc depth2"><a href="s3.4.html" rel="section">&sect;3.4&nbsp;Overriding access restrictions</a></div>
+ <div class="toc depth2"><a href="s3.5.html" rel="section">&sect;3.5&nbsp;Callout to field</a></div>
+ <div class="toc depth1"><a href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a></div>
+ <div class="toc depth2"><a href="s4.1.html" rel="section">&sect;4.1&nbsp;Callin method binding</a></div>
+ <div class="toc depth2"><a href="s4.2.html" rel="section">&sect;4.2&nbsp;Callin modifiers (before, after, replace)</a></div>
+ <div class="toc depth2"><a href="s4.3.html" rel="section">&sect;4.3&nbsp;Base calls</a></div>
+ <div class="toc depth2"><a href="s4.4.html" rel="section">&sect;4.4&nbsp;Callin parameter mapping</a></div>
+ <div class="toc depth2"><a href="s4.5.html" rel="section">&sect;4.5&nbsp;Lifting and lowering</a></div>
+ <div class="toc depth2"><a href="s4.6.html" rel="section">&sect;4.6&nbsp;Overriding access restrictions</a></div>
+ <div class="toc depth2"><a href="s4.7.html" rel="section">&sect;4.7&nbsp;Callin binding with static methods</a></div>
+ <div class="toc depth2"><a href="s4.8.html" rel="section">&sect;4.8&nbsp;Callin precedence</a></div>
+ <div class="toc depth2"><a href="s4.9.html" rel="section">&sect;4.9&nbsp;Callin inheritance</a></div>
+ <div class="toc depth3"><a href="s4.9.1.html" rel="section">&sect;4.9.1&nbsp;Base side inheritance</a></div>
+ <div class="toc depth3"><a href="s4.9.2.html" rel="section">&sect;4.9.2&nbsp;Role side inheritance</a></div>
+ <div class="toc depth3"><a href="s4.9.3.html" rel="section">&sect;4.9.3&nbsp;Covariant return types</a></div>
+ <div class="toc depth2"><a href="s4.10.html" rel="section">&sect;4.10&nbsp;Generic callin bindings</a></div>
+ <div class="toc depth1"><a href="s5.html" rel="section">&sect;5&nbsp;Team Activation</a></div>
+ <div class="toc depth2"><a href="s5.1.html" rel="section">&sect;5.1&nbsp;Effect of team activation</a></div>
+ <div class="toc depth3"><a href="s5.1.1.html" rel="section">&sect;5.1.1&nbsp;Global vs. thread local team activation</a></div>
+ <div class="toc depth3"><a href="s5.1.2.html" rel="section">&sect;5.1.2&nbsp;Effect on garbage collection</a></div>
+ <div class="toc depth2"><a href="s5.2.html" rel="section">&sect;5.2&nbsp;Explicit team activation</a></div>
+ <div class="toc depth2"><a href="s5.3.html" rel="section">&sect;5.3&nbsp;Implicit team activation</a></div>
+ <div class="toc depth2"><a href="s5.4.html" rel="section">&sect;5.4&nbsp;Guard predicates</a></div>
+ <div class="toc depth3"><a href="s5.4.1.html" rel="section">&sect;5.4.1&nbsp;Regular guards</a></div>
+ <div class="toc depth3"><a href="s5.4.2.html" rel="section">&sect;5.4.2&nbsp;Base guards</a></div>
+ <div class="toc depth3"><a href="s5.4.3.html" rel="section">&sect;5.4.3&nbsp;Multiple guards</a></div>
+ <div class="toc depth2"><a href="s5.5.html" rel="section">&sect;5.5&nbsp;Unanticipated team activation</a></div>
+ <div class="toc depth1"><a href="s6.html" rel="section">&sect;6&nbsp;Object Teams API</a></div>
+ <div class="toc depth2"><a href="s6.1.html" rel="section">&sect;6.1&nbsp;Reflection</a></div>
+ <div class="toc depth2"><a href="s6.2.html" rel="section">&sect;6.2&nbsp;Other API Elements</a></div>
+ <div class="toc depth1"><a href="s7.html" rel="section">&sect;7&nbsp;Role Encapsulation</a></div>
+ <div class="toc depth2"><a href="s7.1.html" rel="section">&sect;7.1&nbsp;Opaque roles</a></div>
+ <div class="toc depth2"><a href="s7.2.html" rel="section">&sect;7.2&nbsp;Confined roles</a></div>
+ <div class="toc depth1"><a href="s8.html" rel="section">&sect;8&nbsp;Join Point Queries</a></div>
+ <div class="toc depth2"><a href="s8.1.html" rel="section">&sect;8.1&nbsp;Join point queries</a></div>
+ <div class="toc depth2"><a href="s8.2.html" rel="section">&sect;8.2&nbsp;Query expressions</a></div>
+ <div class="toc depth2"><a href="s8.3.html" rel="section">&sect;8.3&nbsp;OT/J meta model</a></div>
+ <div class="toc depth1"><a href="s9.html" rel="section">&sect;9&nbsp;Value Dependent Classes</a></div>
+ <div class="toc depth2"><a href="s9.1.html" rel="section">&sect;9.1&nbsp;Defining classes with value parameters</a></div>
+ <div class="toc depth2"><a href="s9.2.html" rel="section">&sect;9.2&nbsp;Using classes with value parameters</a></div>
+ <div class="toc depth3"><a href="s9.2.1.html" rel="section">&sect;9.2.1&nbsp;Parameter substitution</a></div>
+ <div class="toc depth3"><a href="s9.2.2.html" rel="section">&sect;9.2.2&nbsp;Type conformance</a></div>
+ <div class="toc depth2"><a href="s9.3.html" rel="section">&sect;9.3&nbsp;Restrictions and limitations</a></div>
+ <div class="toc depth1"><a href="sA.html" rel="section">&sect;A&nbsp;OT/J Syntax</a></div>
+ <div class="toc depth2"><a href="sA.0.html" rel="section">&sect;A.0&nbsp;Keywords</a></div>
+ <div class="toc depth3"><a href="sA.0.1.html" rel="section">&sect;A.0.1&nbsp;Scoped keywords</a></div>
+ <div class="toc depth3"><a href="sA.0.2.html" rel="section">&sect;A.0.2&nbsp;Inheriting scoped keywords</a></div>
+ <div class="toc depth3"><a href="sA.0.3.html" rel="section">&sect;A.0.3&nbsp;Internal names</a></div>
+ <div class="toc depth2"><a href="sA.1.html" rel="section">&sect;A.1&nbsp;Class definitions</a></div>
+ <div class="toc depth2"><a href="sA.2.html" rel="section">&sect;A.2&nbsp;Modifiers</a></div>
+ <div class="toc depth2"><a href="sA.3.html" rel="section">&sect;A.3&nbsp;Method bindings</a></div>
+ <div class="toc depth2"><a href="sA.4.html" rel="section">&sect;A.4&nbsp;Parameter mappings</a></div>
+ <div class="toc depth2"><a href="sA.5.html" rel="section">&sect;A.5&nbsp;Statements</a></div>
+ <div class="toc depth2"><a href="sA.6.html" rel="section">&sect;A.6&nbsp;Types</a></div>
+ <div class="toc depth2"><a href="sA.7.html" rel="section">&sect;A.7&nbsp;Guard predicates</a></div>
+ <div class="toc depth2"><a href="sA.8.html" rel="section">&sect;A.8&nbsp;Precedence declaration</a></div>
+ <div class="toc depth2"><a href="sA.9.html" rel="section">&sect;A.9&nbsp;Value dependent types</a></div>
+ <div class="toc depth2"><a href="sA.10.html" rel="section">&sect;A.10&nbsp;Packages and imports</a></div>
+ <div class="toc depth1"><a href="sB.html" rel="section">&sect;B&nbsp;Changes between versions</a></div>
+ <div class="toc depth2"><a href="sB.1.html" rel="section">&sect;B.1&nbsp;Paragraphs changed between versions</a></div>
+ <div class="toc depth2"><a href="sB.2.html" rel="section">&sect;B.2&nbsp;Additions between versions</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s0.1.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s0.1.html
new file mode 100644
index 000000000..6fa8ec4c7
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s0.1.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s0.2.html" rel="next">&sect;0.2&nbsp;Text structure&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s0.html" rel="section">&sect;0&nbsp;About this Document</a></div>
+ <div class="sect depth2" id="s0.1">
+ <h2 class="sect">&sect;0.1&nbsp;Purpose(s) of this document</h2>
+ <p>This document defines the OT/J programming language.
+ The main goals were to create a precise and complete reference for this language.
+ Didactical considerations had lower priorities, which means that this document is not designed
+ as an introductory tutorial.
+ Still, we advise programmers learning the OT/J language, to consult this document whenever
+ a compiler error message is not perfectly clear to them (see <a href="s0.3.html" title="&sect;0.3&nbsp;Compiler messages" class="sect">&sect;0.3</a>).
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s0.2.html" rel="next">&sect;0.2&nbsp;Text structure&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s0.html" rel="section">&sect;0&nbsp;About this Document</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s0.2.a.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s0.2.a.html
new file mode 100644
index 000000000..2c83f9b77
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s0.2.a.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s0.2.b.html" rel="next">&sect;0.2.(b)&nbsp;Syntax Links&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s0.html" rel="section">&sect;0&nbsp;About this Document</a>&nbsp;&gt;&nbsp;<a class="nav" href="s0.2.html" rel="section">&sect;0.2&nbsp;Text structure</a></div>
+ <div class="subsect depth3" id="s0.2.a">
+ <h4 class="subsect">&sect;0.2.(a)&nbsp;<span class="title">Paragraphs</span></h4>
+ <p>The actual definition is structured into small paragraphs for easy referral.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s0.2.b.html" rel="next">&sect;0.2.(b)&nbsp;Syntax Links&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s0.html" rel="section">&sect;0&nbsp;About this Document</a>&nbsp;&gt;&nbsp;<a class="nav" href="s0.2.html" rel="section">&sect;0.2&nbsp;Text structure</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s0.2.b.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s0.2.b.html
new file mode 100644
index 000000000..6c46d140c
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s0.2.b.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s0.2.a.html" rel="prev">&lt;&lt;&nbsp;&sect;0.2.(a)&nbsp;Paragraphs</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s0.html" rel="section">&sect;0&nbsp;About this Document</a>&nbsp;&gt;&nbsp;<a class="nav" href="s0.2.html" rel="section">&sect;0.2&nbsp;Text structure</a></div>
+ <div class="subsect depth3" id="s0.2.b">
+ <h4 class="subsect">&sect;0.2.(b)&nbsp;<span class="title">Syntax Links</span></h4>
+ <p>Links to the syntax precede definitions whenever new syntax is introduced.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s0.2.a.html" rel="prev">&lt;&lt;&nbsp;&sect;0.2.(a)&nbsp;Paragraphs</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s0.html" rel="section">&sect;0&nbsp;About this Document</a>&nbsp;&gt;&nbsp;<a class="nav" href="s0.2.html" rel="section">&sect;0.2&nbsp;Text structure</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s0.2.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s0.2.html
new file mode 100644
index 000000000..539b9087c
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s0.2.html
@@ -0,0 +1,96 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s0.1.html" rel="prev">&lt;&lt;&nbsp;&sect;0.1&nbsp;Purpose(s) of this document</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s0.3.html" rel="next">&sect;0.3&nbsp;Compiler messages&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s0.html" rel="section">&sect;0&nbsp;About this Document</a></div>
+ <div class="sect depth2" id="s0.2">
+ <h2 class="sect">&sect;0.2&nbsp;Text structure</h2>
+ <p>Each chapter of this document starts with a short synopsis of
+ concepts covered by the chapter (see above).
+
+ </p>
+ <div class="syntaxlink"><a href="sA.html" title="&sect;A&nbsp;OT/J Syntax" class="syntax">&rarr;&nbsp;Syntax&nbsp;&sect;A</a></div>
+ <div class="subsect depth3" id="s0.2.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Paragraphs</span></h4>
+ <p>The actual definition is structured into small paragraphs for easy referral.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s0.2.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Syntax Links</span></h4>
+ <p>Links to the syntax precede definitions whenever new syntax is introduced.
+
+ </p>
+ </div>
+ <p>Interspersed you will find some example program listings.
+ Examples are typeset in a box:
+
+ </p>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> MyTeamA {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> ...</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <p>Explanations for examples look like the following:
+
+ </p>
+ <div class="codecomment">
+ <h5>Effects:</h5>
+ <ul>
+ <li>Lines 1-3 show a minimal OT/J program, which should not cause any headache.</li>
+ </ul>
+ </div>
+ <p>Examples are given for illustration only.
+
+ </p>
+ <p>Additional paragraphs like "Language implementation", or
+ "open issues" provide some background information which is
+ not necessary for understanding the definition, which might
+ however, help to understand why things are the way they are
+ and what other things might be added to the language in the future.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s0.1.html" rel="prev">&lt;&lt;&nbsp;&sect;0.1&nbsp;Purpose(s) of this document</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s0.3.html" rel="next">&sect;0.3&nbsp;Compiler messages&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s0.html" rel="section">&sect;0&nbsp;About this Document</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s0.3.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s0.3.html
new file mode 100644
index 000000000..c4d25d80d
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s0.3.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s0.2.html" rel="prev">&lt;&lt;&nbsp;&sect;0.2&nbsp;Text structure</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s0.4.html" rel="next">&sect;0.4&nbsp;Versions&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s0.html" rel="section">&sect;0&nbsp;About this Document</a></div>
+ <div class="sect depth2" id="s0.3">
+ <h2 class="sect">&sect;0.3&nbsp;Compiler messages</h2>
+ <p>Error messages given by the Object Teams compiler refer to this
+ definition whenever appropriate. This way it should be easy to find
+ out, why the compiler rejected your program. Please make sure
+ you are using a language definition whose version matches the
+ version of your compiler.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s0.2.html" rel="prev">&lt;&lt;&nbsp;&sect;0.2&nbsp;Text structure</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s0.4.html" rel="next">&sect;0.4&nbsp;Versions&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s0.html" rel="section">&sect;0&nbsp;About this Document</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s0.4.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s0.4.html
new file mode 100644
index 000000000..beef42b70
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s0.4.html
@@ -0,0 +1,55 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s0.3.html" rel="prev">&lt;&lt;&nbsp;&sect;0.3&nbsp;Compiler messages</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s0.5.html" rel="next">&sect;0.5&nbsp;Publishing&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s0.html" rel="section">&sect;0&nbsp;About this Document</a></div>
+ <div class="sect depth2" id="s0.4">
+ <h2 class="sect">&sect;0.4&nbsp;Versions</h2>
+ <p>The structure of this document has changed between versions
+ 0.6.1 and 0.7 of this document. This change reflects the
+ transition from our first compiler for OT/J (called <code>otc</code>)
+ and the <code>OTDT</code> (Object Teams Development Tooling)
+ plugin for Eclipse.
+
+ </p>
+ <p>Starting with the OTDT v0.7.x, the major and minor number of the tool
+ correspond to the major and minor version number of the OTJLD (this document),
+ ie., the OTDT v1.0.x implements the language as defined in the OTJLD v1.0.
+
+ </p>
+ <p><strong>Changes</strong> between the current and previous versions are listed in appendix <a href="sB.html" title="&sect;B&nbsp;Changes between versions" class="sect">&sect;B</a>.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s0.3.html" rel="prev">&lt;&lt;&nbsp;&sect;0.3&nbsp;Compiler messages</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s0.5.html" rel="next">&sect;0.5&nbsp;Publishing&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s0.html" rel="section">&sect;0&nbsp;About this Document</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s0.5.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s0.5.html
new file mode 100644
index 000000000..1fbce1127
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s0.5.html
@@ -0,0 +1,49 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s0.4.html" rel="prev">&lt;&lt;&nbsp;&sect;0.4&nbsp;Versions</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s0.html" rel="section">&sect;0&nbsp;About this Document</a></div>
+ <div class="sect depth2" id="s0.5">
+ <h2 class="sect">&sect;0.5&nbsp;Publishing</h2>
+ <p>The sources of this language definition are maintained in a target-independent XML format. Three different versions are generated
+ from these sources, using XSLT:
+ </p>
+ <ul>
+ <li><a href="http://www.objectteams.org/def/" class="ext">Online version</a> (XHTML)
+ </li>
+ <li>Tooling version (XHTML &ndash; directly accessible from inside the OTDT)</li>
+ <li>Print version (LaTeX/PDF)</li>
+ </ul>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s0.4.html" rel="prev">&lt;&lt;&nbsp;&sect;0.4&nbsp;Versions</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s0.html" rel="section">&sect;0&nbsp;About this Document</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s0.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s0.html
new file mode 100644
index 000000000..c84afc54f
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s0.html
@@ -0,0 +1,181 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.html" rel="next">&sect;1&nbsp;Teams and Roles&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"></div>
+ <div class="chapter" id="s0">
+ <div class="headl">
+ <div class="headr">
+ <h1>&sect;0&nbsp;About this Document</h1>
+ </div>
+ </div>
+ <div id="toc-box">
+ <ul class="toc-box">
+ <li><a href="s0.html">&sect;0&nbsp;About this Document</a></li>
+ <li><a href="#s0.1">&sect;0.1&nbsp;Purpose(s) of this document</a></li>
+ <li><a href="#s0.2">&sect;0.2&nbsp;Text structure</a></li>
+ <li><a href="#s0.3">&sect;0.3&nbsp;Compiler messages</a></li>
+ <li><a href="#s0.4">&sect;0.4&nbsp;Versions</a></li>
+ <li><a href="#s0.5">&sect;0.5&nbsp;Publishing</a></li>
+ </ul>
+ </div>
+ <div class="intro">
+ <h3>Levels of this document</h3>
+ <div class="line"></div>
+ <div class="term">Terms, concepts</div>
+ <div class="termdesc">Each chapter of this document starts with a short synopsis of
+ concepts covered by the chapter (like this).
+ </div>
+ <div class="line"></div>
+ <div class="term">Definition</div>
+ <div class="termdesc">The actual definition is given in small numbered paragraphs.</div>
+ <div class="line"></div>
+ <div class="term">Examples</div>
+ <div class="termdesc">Examples and accompanying explanations will be interspersed
+ into the definition.
+ </div>
+ <div class="line"></div>
+ </div>
+ <div class="sect depth2" id="s0.1">
+ <h2 class="sect">&sect;0.1&nbsp;Purpose(s) of this document<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;0</a></span></h2>
+ <p>This document defines the OT/J programming language.
+ The main goals were to create a precise and complete reference for this language.
+ Didactical considerations had lower priorities, which means that this document is not designed
+ as an introductory tutorial.
+ Still, we advise programmers learning the OT/J language, to consult this document whenever
+ a compiler error message is not perfectly clear to them (see <a href="#s0.3" title="&sect;0.3&nbsp;Compiler messages" class="sect">&sect;0.3</a>).
+
+ </p>
+ </div>
+ <div class="sect depth2" id="s0.2">
+ <h2 class="sect">&sect;0.2&nbsp;Text structure<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;0</a></span></h2>
+ <p>Each chapter of this document starts with a short synopsis of
+ concepts covered by the chapter (see above).
+
+ </p>
+ <div class="syntaxlink"><a href="sA.html" title="&sect;A&nbsp;OT/J Syntax" class="syntax">&rarr;&nbsp;Syntax&nbsp;&sect;A</a></div>
+ <div class="subsect depth3" id="s0.2.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Paragraphs</span></h4>
+ <p>The actual definition is structured into small paragraphs for easy referral.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s0.2.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Syntax Links</span></h4>
+ <p>Links to the syntax precede definitions whenever new syntax is introduced.
+
+ </p>
+ </div>
+ <p>Interspersed you will find some example program listings.
+ Examples are typeset in a box:
+
+ </p>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> MyTeamA {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> ...</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <p>Explanations for examples look like the following:
+
+ </p>
+ <div class="codecomment">
+ <h5>Effects:</h5>
+ <ul>
+ <li>Lines 1-3 show a minimal OT/J program, which should not cause any headache.</li>
+ </ul>
+ </div>
+ <p>Examples are given for illustration only.
+
+ </p>
+ <p>Additional paragraphs like "Language implementation", or
+ "open issues" provide some background information which is
+ not necessary for understanding the definition, which might
+ however, help to understand why things are the way they are
+ and what other things might be added to the language in the future.
+
+ </p>
+ </div>
+ <div class="sect depth2" id="s0.3">
+ <h2 class="sect">&sect;0.3&nbsp;Compiler messages<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;0</a></span></h2>
+ <p>Error messages given by the Object Teams compiler refer to this
+ definition whenever appropriate. This way it should be easy to find
+ out, why the compiler rejected your program. Please make sure
+ you are using a language definition whose version matches the
+ version of your compiler.
+
+ </p>
+ </div>
+ <div class="sect depth2" id="s0.4">
+ <h2 class="sect">&sect;0.4&nbsp;Versions<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;0</a></span></h2>
+ <p>The structure of this document has changed between versions
+ 0.6.1 and 0.7 of this document. This change reflects the
+ transition from our first compiler for OT/J (called <code>otc</code>)
+ and the <code>OTDT</code> (Object Teams Development Tooling)
+ plugin for Eclipse.
+
+ </p>
+ <p>Starting with the OTDT v0.7.x, the major and minor number of the tool
+ correspond to the major and minor version number of the OTJLD (this document),
+ ie., the OTDT v1.0.x implements the language as defined in the OTJLD v1.0.
+
+ </p>
+ <p><strong>Changes</strong> between the current and previous versions are listed in appendix <a href="sB.html" title="&sect;B&nbsp;Changes between versions" class="sect">&sect;B</a>.
+
+ </p>
+ </div>
+ <div class="sect depth2" id="s0.5">
+ <h2 class="sect">&sect;0.5&nbsp;Publishing<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;0</a></span></h2>
+ <p>The sources of this language definition are maintained in a target-independent XML format. Three different versions are generated
+ from these sources, using XSLT:
+ </p>
+ <ul>
+ <li><a href="http://www.objectteams.org/def/" class="ext">Online version</a> (XHTML)
+ </li>
+ <li>Tooling version (XHTML &ndash; directly accessible from inside the OTDT)</li>
+ <li>Print version (LaTeX/PDF)</li>
+ </ul>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.html" rel="next">&sect;1&nbsp;Teams and Roles&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.1.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.1.html
new file mode 100644
index 000000000..442f6342b
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.1.html
@@ -0,0 +1,110 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.2.html" rel="next">&sect;1.2&nbsp;Role classes and objects&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a></div>
+ <div class="sect depth2" id="s1.1">
+ <h2 class="sect">&sect;1.1&nbsp;Team classes</h2>
+ <div class="syntaxlink"><a href="sA.html#sA.1.1" title="&sect;A.1.1&nbsp;ClassDeclaration"
+ class="syntax">&rarr;&nbsp;Syntax&nbsp;&sect;A.1.1</a></div>
+ <p>A class declared with the modifier <code>team</code> is a <em>team class</em> (or team for short).
+
+ </p>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <em><b>team</b> <b>class</b> MyTeamA</em> {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> ...</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <p>Teams are meant as containers for <em>roles</em>, which are defined in the following
+ paragraphs.
+
+ </p>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> MyTeamA {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>public</b> <em><b>class</b> MyRole</em></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> ...</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <p>Teams introduce a new variant of inheritance for contained role classes
+ (see <a href="s1.3.1.html"
+ title="&sect;1.3.1&nbsp;Acquisition and implicit inheritance of role classes"
+ class="sect">&sect;1.3.1</a> below).
+ Other properties of teams, which are defined in later sections, are:
+
+ </p>
+ <ul>
+ <li>Team activation (<a href="s5.html" title="&sect;5&nbsp;Team Activation" class="sect">&sect;5</a>)
+ </li>
+ <li>Abstractness and instantiation (<a href="s2.5.html" title="&sect;2.5&nbsp;Abstract Roles" class="sect">&sect;2.5</a>)
+ </li>
+ <li>Declared lifting in team methods (<a href="s2.3.2.html" title="&sect;2.3.2&nbsp;Declared lifting" class="sect">&sect;2.3.2</a>)
+ </li>
+ <li>Reflective functions defined in <code>org.objectteams.ITeam</code> (<a href="s6.1.html" title="&sect;6.1&nbsp;Reflection" class="sect">&sect;6.1</a>)
+ </li>
+ </ul>
+ <p>Apart from these differences, team classes are regular Java classes with
+ methods and fields, whose instances are regular Java objects.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.2.html" rel="next">&sect;1.2&nbsp;Role classes and objects&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.1.a.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.1.a.html
new file mode 100644
index 000000000..ce0eb7395
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.1.a.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.2.1.b.html" rel="next">&sect;1.2.1.(b)&nbsp;protected role classes&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.1.html" rel="section">&sect;1.2.1&nbsp;Modifiers for roles</a></div>
+ <div class="subsect depth4" id="s1.2.1.a">
+ <h4 class="subsect">&sect;1.2.1.(a)&nbsp;<span class="title">Role class protection</span></h4>
+ <p>A role class must have exactly one of the access modifiers <code>public</code>
+ or <code>protected</code>.<br />
+ This rule does not affect the class modifiers <code>abstract</code>, <code>final</code> and <code>strictfp</code>.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.2.1.b.html" rel="next">&sect;1.2.1.(b)&nbsp;protected role classes&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.1.html" rel="section">&sect;1.2.1&nbsp;Modifiers for roles</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.1.b.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.1.b.html
new file mode 100644
index 000000000..ae2227a65
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.1.b.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s1.2.1.a.html" rel="prev">&lt;&lt;&nbsp;&sect;1.2.1.(a)&nbsp;Role class protection</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.2.1.c.html" rel="next">&sect;1.2.1.(c)&nbsp;public role classes&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.1.html" rel="section">&sect;1.2.1&nbsp;Modifiers for roles</a></div>
+ <div class="subsect depth4" id="s1.2.1.b">
+ <h4 class="subsect">&sect;1.2.1.(b)&nbsp;<span class="title">protected role classes</span></h4>
+ <p>A <code>protected</code> role can only be accessed from within the enclosing
+ team or any of its sub-teams. The actual border of encapsulation is the
+ enclosing team <em>instance</em>. The rules for protected roles are given
+ in <a href="s1.2.3.html" title="&sect;1.2.3&nbsp;Protected roles" class="sect">&sect;1.2.3</a> below.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s1.2.1.a.html" rel="prev">&lt;&lt;&nbsp;&sect;1.2.1.(a)&nbsp;Role class protection</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.2.1.c.html" rel="next">&sect;1.2.1.(c)&nbsp;public role classes&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.1.html" rel="section">&sect;1.2.1&nbsp;Modifiers for roles</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.1.c.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.1.c.html
new file mode 100644
index 000000000..d415080e5
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.1.c.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s1.2.1.b.html" rel="prev">&lt;&lt;&nbsp;&sect;1.2.1.(b)&nbsp;protected role classes</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.2.1.d.html" rel="next">&sect;1.2.1.(d)&nbsp;abstract role classes&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.1.html" rel="section">&sect;1.2.1&nbsp;Modifiers for roles</a></div>
+ <div class="subsect depth4" id="s1.2.1.c">
+ <h4 class="subsect">&sect;1.2.1.(c)&nbsp;<span class="title">public role classes</span></h4>
+ <p>Only <code>public</code> roles can ever be accessed outside their enclosing team.
+ Accessing a role outside the enclosing team instance is governed by the rules
+ of <strong>externalized roles</strong>, to be defined next (<a href="s1.2.2.html" title="&sect;1.2.2&nbsp;Externalized roles" class="sect">&sect;1.2.2</a>).
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s1.2.1.b.html" rel="prev">&lt;&lt;&nbsp;&sect;1.2.1.(b)&nbsp;protected role classes</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.2.1.d.html" rel="next">&sect;1.2.1.(d)&nbsp;abstract role classes&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.1.html" rel="section">&sect;1.2.1&nbsp;Modifiers for roles</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.1.d.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.1.d.html
new file mode 100644
index 000000000..2fc06f959
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.1.d.html
@@ -0,0 +1,61 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s1.2.1.c.html" rel="prev">&lt;&lt;&nbsp;&sect;1.2.1.(c)&nbsp;public role classes</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.2.1.e.html" rel="next">&sect;1.2.1.(e)&nbsp;Role features&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.1.html" rel="section">&sect;1.2.1&nbsp;Modifiers for roles</a></div>
+ <div class="subsect depth4" id="s1.2.1.d">
+ <h4 class="subsect">&sect;1.2.1.(d)&nbsp;<span class="title">abstract role classes</span></h4>
+ <p>A role class has to be marked <strong>abstract</strong> if any of its methods
+ is not effective.<br />
+ The <em>methods of a role class</em> comprise direct methods and
+ methods acquired by inheritance.
+ In addition to regular inheritance a role class may acquire methods
+ also via implicit inheritance (<a href="s1.3.1.html"
+ title="&sect;1.3.1&nbsp;Acquisition and implicit inheritance of role classes"
+ class="sect">&sect;1.3.1</a>).<br />
+ A method may become <em>effective</em> by either:
+
+ </p>
+ <ul>
+ <li>implementation (i.e., a regular method body), or</li>
+ <li>a callout binding (see <a href="s3.html" title="&sect;3&nbsp;Callout Binding" class="sect">&sect;3</a>).
+ </li>
+ </ul>
+ <p><a href="s2.5.html" title="&sect;2.5&nbsp;Abstract Roles" class="sect">&sect;2.5</a> discusses under which
+ circumstances abstract roles force the enclosing team to be abstract, too.
+
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s1.2.1.c.html" rel="prev">&lt;&lt;&nbsp;&sect;1.2.1.(c)&nbsp;public role classes</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.2.1.e.html" rel="next">&sect;1.2.1.(e)&nbsp;Role features&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.1.html" rel="section">&sect;1.2.1&nbsp;Modifiers for roles</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.1.e.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.1.e.html
new file mode 100644
index 000000000..3091c487f
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.1.e.html
@@ -0,0 +1,64 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s1.2.1.d.html" rel="prev">&lt;&lt;&nbsp;&sect;1.2.1.(d)&nbsp;abstract role classes</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.2.1.f.html" rel="next">&sect;1.2.1.(f)&nbsp;Static role methods&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.1.html" rel="section">&sect;1.2.1&nbsp;Modifiers for roles</a></div>
+ <div class="subsect depth4" id="s1.2.1.e">
+ <h4 class="subsect">&sect;1.2.1.(e)&nbsp;<span class="title">Role features</span></h4>
+ <p>Access modifiers for members of roles have some special interpretation:
+
+ </p>
+ <ol>
+ <li>A private member is also visible in any implicit sub role
+ (see implicit inheritance <a href="s1.3.1.c.html"
+ title="&sect;1.3.1.(c)&nbsp;Overriding and implicit inheritance"
+ class="sect">&sect;1.3.1.(c)</a>).<br />
+ In contrast to inner classes in Java, private members of a role are not
+ visible to the enclosing team.
+ </li>
+ <li>The default visibility of role members restricts access to the
+ current class and its sub-classes (explicit and implicit).
+ </li>
+ <li><code>protected</code> role members can only be accessed from the enclosing
+ team or via <a href="s4.html" title="&sect;4&nbsp;Callin Binding" class="sect">callin (&sect;4)</a>.
+ </li>
+ <li><code>public</code> role members grant unrestricted access.
+ </li>
+ </ol>
+ <p>Additionally, a role always has access to all the features that its enclosing team has access to.</p>
+ <p>Only <code>public</code> members can ever be accessed via an <a href="s1.2.2.html" title="&sect;1.2.2&nbsp;Externalized roles" class="sect">externalized role (&sect;1.2.2)</a>.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s1.2.1.d.html" rel="prev">&lt;&lt;&nbsp;&sect;1.2.1.(d)&nbsp;abstract role classes</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.2.1.f.html" rel="next">&sect;1.2.1.(f)&nbsp;Static role methods&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.1.html" rel="section">&sect;1.2.1&nbsp;Modifiers for roles</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.1.f.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.1.f.html
new file mode 100644
index 000000000..f5a07ec9e
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.1.f.html
@@ -0,0 +1,54 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s1.2.1.e.html" rel="prev">&lt;&lt;&nbsp;&sect;1.2.1.(e)&nbsp;Role features</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.2.1.g.html" rel="next">&sect;1.2.1.(g)&nbsp;No static initializers&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.1.html" rel="section">&sect;1.2.1&nbsp;Modifiers for roles</a></div>
+ <div class="subsect depth4" id="s1.2.1.f">
+ <h4 class="subsect">&sect;1.2.1.(f)&nbsp;<span class="title">Static role methods</span></h4>
+ <p>In contrast to inner classes in pure Java, a role class may indeed define static methods. A static role method requires no
+ role
+ instance <em>but</em> it still requires a team instance in scope. Static role methods can be called:
+
+ </p>
+ <ul>
+ <li>from the enclosing team,</li>
+ <li>via callin (see <a href="s4.7.html" title="&sect;4.7&nbsp;Callin binding with static methods"
+ class="sect">&sect;4.7</a>).
+ </li>
+ </ul>
+ <p>Within a static role method the syntax <code>MyTeam.this</code> is available for accessing the enclosing team instance.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s1.2.1.e.html" rel="prev">&lt;&lt;&nbsp;&sect;1.2.1.(e)&nbsp;Role features</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.2.1.g.html" rel="next">&sect;1.2.1.(g)&nbsp;No static initializers&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.1.html" rel="section">&sect;1.2.1&nbsp;Modifiers for roles</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.1.g.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.1.g.html
new file mode 100644
index 000000000..cfa50e2b5
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.1.g.html
@@ -0,0 +1,55 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s1.2.1.f.html" rel="prev">&lt;&lt;&nbsp;&sect;1.2.1.(f)&nbsp;Static role methods</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.1.html" rel="section">&sect;1.2.1&nbsp;Modifiers for roles</a></div>
+ <div class="subsect depth4" id="s1.2.1.g">
+ <h4 class="subsect">&sect;1.2.1.(g)&nbsp;<span class="title">No static initializers</span></h4>
+ <p>A static field of a role class must not have a non-constant initialization expression.
+ Static initialization blocks are already prohibited for inner classes by Java (see <a href="http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#262890"
+ class="ext">JLS &sect;8.1.2</a>).
+
+ </p>
+ <div class="note">
+ <h5>Note:</h5>
+ Static initialization generally provides a means for performing initialization code prior to instantiation, i.e., at
+ class-loading time.
+ Before any role can be created already two levels of initialization are performed: (1) The (outer most) enclosing team
+ class performs static initializations when it is loaded. (2) Any enclosing team executes
+ its constructor when it is instantiated. It should be possible to allocate any early initialization to either of these
+ two phases instead of using static role initializers.
+
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s1.2.1.f.html" rel="prev">&lt;&lt;&nbsp;&sect;1.2.1.(f)&nbsp;Static role methods</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.1.html" rel="section">&sect;1.2.1&nbsp;Modifiers for roles</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.1.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.1.html
new file mode 100644
index 000000000..6f9372b2f
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.1.html
@@ -0,0 +1,156 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.2.2.html" rel="next">&sect;1.2.2&nbsp;Externalized roles&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a></div>
+ <div class="sect depth3" id="s1.2.1">
+ <h3 class="sect">&sect;1.2.1&nbsp;Modifiers for roles</h3>
+ <p>Member classes of a team cannot be <code>static</code>.
+ Also the use of access modifiers for roles is restricted and modifiers have different (stronger) semantics than for
+ regular classes (see below). With respect to accessibility a team acts mainly like a package regarding its roles.
+
+ </p>
+ <div class="subsect depth4" id="s1.2.1.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Role class protection</span></h4>
+ <p>A role class must have exactly one of the access modifiers <code>public</code>
+ or <code>protected</code>.<br />
+ This rule does not affect the class modifiers <code>abstract</code>, <code>final</code> and <code>strictfp</code>.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.1.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">protected role classes</span></h4>
+ <p>A <code>protected</code> role can only be accessed from within the enclosing
+ team or any of its sub-teams. The actual border of encapsulation is the
+ enclosing team <em>instance</em>. The rules for protected roles are given
+ in <a href="s1.2.3.html" title="&sect;1.2.3&nbsp;Protected roles" class="sect">&sect;1.2.3</a> below.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.1.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">public role classes</span></h4>
+ <p>Only <code>public</code> roles can ever be accessed outside their enclosing team.
+ Accessing a role outside the enclosing team instance is governed by the rules
+ of <strong>externalized roles</strong>, to be defined next (<a href="s1.2.2.html" title="&sect;1.2.2&nbsp;Externalized roles" class="sect">&sect;1.2.2</a>).
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.1.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">abstract role classes</span></h4>
+ <p>A role class has to be marked <strong>abstract</strong> if any of its methods
+ is not effective.<br />
+ The <em>methods of a role class</em> comprise direct methods and
+ methods acquired by inheritance.
+ In addition to regular inheritance a role class may acquire methods
+ also via implicit inheritance (<a href="s1.3.1.html"
+ title="&sect;1.3.1&nbsp;Acquisition and implicit inheritance of role classes"
+ class="sect">&sect;1.3.1</a>).<br />
+ A method may become <em>effective</em> by either:
+
+ </p>
+ <ul>
+ <li>implementation (i.e., a regular method body), or</li>
+ <li>a callout binding (see <a href="s3.html" title="&sect;3&nbsp;Callout Binding" class="sect">&sect;3</a>).
+ </li>
+ </ul>
+ <p><a href="s2.5.html" title="&sect;2.5&nbsp;Abstract Roles" class="sect">&sect;2.5</a> discusses under which
+ circumstances abstract roles force the enclosing team to be abstract, too.
+
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.1.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Role features</span></h4>
+ <p>Access modifiers for members of roles have some special interpretation:
+
+ </p>
+ <ol>
+ <li>A private member is also visible in any implicit sub role
+ (see implicit inheritance <a href="s1.3.1.c.html"
+ title="&sect;1.3.1.(c)&nbsp;Overriding and implicit inheritance"
+ class="sect">&sect;1.3.1.(c)</a>).<br />
+ In contrast to inner classes in Java, private members of a role are not
+ visible to the enclosing team.
+ </li>
+ <li>The default visibility of role members restricts access to the
+ current class and its sub-classes (explicit and implicit).
+ </li>
+ <li><code>protected</code> role members can only be accessed from the enclosing
+ team or via <a href="s4.html" title="&sect;4&nbsp;Callin Binding" class="sect">callin (&sect;4)</a>.
+ </li>
+ <li><code>public</code> role members grant unrestricted access.
+ </li>
+ </ol>
+ <p>Additionally, a role always has access to all the features that its enclosing team has access to.</p>
+ <p>Only <code>public</code> members can ever be accessed via an <a href="s1.2.2.html" title="&sect;1.2.2&nbsp;Externalized roles" class="sect">externalized role (&sect;1.2.2)</a>.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.1.f">
+ <h4 class="subsect">(f)&nbsp;<span class="title">Static role methods</span></h4>
+ <p>In contrast to inner classes in pure Java, a role class may indeed define static methods. A static role method requires no
+ role
+ instance <em>but</em> it still requires a team instance in scope. Static role methods can be called:
+
+ </p>
+ <ul>
+ <li>from the enclosing team,</li>
+ <li>via callin (see <a href="s4.7.html" title="&sect;4.7&nbsp;Callin binding with static methods"
+ class="sect">&sect;4.7</a>).
+ </li>
+ </ul>
+ <p>Within a static role method the syntax <code>MyTeam.this</code> is available for accessing the enclosing team instance.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.1.g">
+ <h4 class="subsect">(g)&nbsp;<span class="title">No static initializers</span></h4>
+ <p>A static field of a role class must not have a non-constant initialization expression.
+ Static initialization blocks are already prohibited for inner classes by Java (see <a href="http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#262890"
+ class="ext">JLS &sect;8.1.2</a>).
+
+ </p>
+ <div class="note">
+ <h5>Note:</h5>
+ Static initialization generally provides a means for performing initialization code prior to instantiation, i.e., at
+ class-loading time.
+ Before any role can be created already two levels of initialization are performed: (1) The (outer most) enclosing team
+ class performs static initializations when it is loaded. (2) Any enclosing team executes
+ its constructor when it is instantiated. It should be possible to allocate any early initialization to either of these
+ two phases instead of using static role initializers.
+
+ </div>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.2.2.html" rel="next">&sect;1.2.2&nbsp;Externalized roles&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.2.a.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.2.a.html
new file mode 100644
index 000000000..834476eb1
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.2.a.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.2.2.b.html" rel="next">&sect;1.2.2.(b)&nbsp;Declaration with anchored type&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.2.html" rel="section">&sect;1.2.2&nbsp;Externalized roles</a></div>
+ <div class="subsect depth4" id="s1.2.2.a">
+ <h4 class="subsect">&sect;1.2.2.(a)&nbsp;<span class="title">Visibility</span></h4>
+ <p>Only instances of a <code>public</code> role class can ever be externalized.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.2.2.b.html" rel="next">&sect;1.2.2.(b)&nbsp;Declaration with anchored type&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.2.html" rel="section">&sect;1.2.2&nbsp;Externalized roles</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.2.b.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.2.b.html
new file mode 100644
index 000000000..abdcd81d8
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.2.b.html
@@ -0,0 +1,59 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s1.2.2.a.html" rel="prev">&lt;&lt;&nbsp;&sect;1.2.2.(a)&nbsp;Visibility</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.2.2.c.html" rel="next">&sect;1.2.2.(c)&nbsp;Immutable anchor&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.2.html" rel="section">&sect;1.2.2&nbsp;Externalized roles</a></div>
+ <div class="subsect depth4" id="s1.2.2.b">
+ <h4 class="subsect">&sect;1.2.2.(b)&nbsp;<span class="title">Declaration with anchored type</span></h4>
+ <p>Outside a team role types are legal only if denoted relative
+ to an existing team instance (further on called "anchored types").
+ The syntax is:
+ </p>
+ <div class="listing plain"><pre><em>final</em> MyTeam myTeam = <i>expression</i>;
+<em>RoleClass&lt;@myTeam&gt;</em> role = <i>expression</i>;</pre></div>
+ <p>The syntax <code>Type&lt;@anchor&gt;</code> is a special case of a parameterized type, more specifically a <a href="s9.html" title="&sect;9&nbsp;Value Dependent Classes" class="sect">value dependent type (&sect;9)</a>.
+ The type argument (i.e., the expression after the at-sign) can be a simple name or a path. It must refer to an instance
+ of a team class.
+ The role type is said to be <em>anchored</em> to this team instance.<br />
+ The type-part of this syntax (in front of the angle brackets) must be the simple name of a role type directly contained
+ in the given team (including roles that are acquired by implicit inheritance).<br /></p>
+ <div class="note">
+ <h5>Note:</h5>
+ Previous versions of the OTJLD used a different syntax for anchored types, where the role type was prefixed with the anchor
+ expression, separated by a dot (<code>anchor.Type</code>,
+ see <a href="sA.html#sA.6.3" title="&sect;A.6.3&nbsp;AnchoredType" class="sect">&sect;A.6.3</a>). A compiler may still support that path syntax but it should be flagged as being deprecated.
+
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s1.2.2.a.html" rel="prev">&lt;&lt;&nbsp;&sect;1.2.2.(a)&nbsp;Visibility</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.2.2.c.html" rel="next">&sect;1.2.2.(c)&nbsp;Immutable anchor&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.2.html" rel="section">&sect;1.2.2&nbsp;Externalized roles</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.2.c.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.2.c.html
new file mode 100644
index 000000000..6ac224757
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.2.c.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s1.2.2.b.html" rel="prev">&lt;&lt;&nbsp;&sect;1.2.2.(b)&nbsp;Declaration with anchored type</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.2.2.d.html" rel="next">&sect;1.2.2.(d)&nbsp;Implicit type anchors&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.2.html" rel="section">&sect;1.2.2&nbsp;Externalized roles</a></div>
+ <div class="subsect depth4" id="s1.2.2.c">
+ <h4 class="subsect">&sect;1.2.2.(c)&nbsp;<span class="title">Immutable anchor</span></h4>
+ <p>Anchoring the type of an externalized role to a team instance
+ requires the team to be referenced by a variable which
+ is marked <code>final</code> (i.e., immutable).
+ The type anchor can be a path <code>v.f1.f2...</code> where
+ <code>v</code> is any final variable and <code>f1</code> ...
+ are final fields.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s1.2.2.b.html" rel="prev">&lt;&lt;&nbsp;&sect;1.2.2.(b)&nbsp;Declaration with anchored type</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.2.2.d.html" rel="next">&sect;1.2.2.(d)&nbsp;Implicit type anchors&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.2.html" rel="section">&sect;1.2.2&nbsp;Externalized roles</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.2.d.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.2.d.html
new file mode 100644
index 000000000..fc2e96e0f
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.2.d.html
@@ -0,0 +1,61 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s1.2.2.c.html" rel="prev">&lt;&lt;&nbsp;&sect;1.2.2.(c)&nbsp;Immutable anchor</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.2.2.e.html" rel="next">&sect;1.2.2.(e)&nbsp;Conformance&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.2.html" rel="section">&sect;1.2.2&nbsp;Externalized roles</a></div>
+ <div class="subsect depth4" id="s1.2.2.d">
+ <h4 class="subsect">&sect;1.2.2.(d)&nbsp;<span class="title">Implicit type anchors</span></h4>
+ <p>The current team instance can be used as a default anchor
+ for role types:
+
+ </p>
+ <ol>
+ <li>In non-static team level methods role types are by default interpreted as anchored to <code>this</code> (referring to the team instance). I.e., the following two declarations express the same:
+
+ <div class="listing plain"><pre><b>public</b> RoleX getRoleX (RoleY r) { <i> stmts </i> }
+<b>public</b> RoleX&lt;@<em>this</em>&gt; getRoleX (RoleY&lt;@<em>this</em>&gt; r) { <i> stmts </i> }</pre></div>
+ </li>
+ <li>
+ In analogy, <em>role methods</em> use the enclosing team instance as the
+ default anchor for any role types.
+ </li>
+ </ol>
+ <p>Note, that <code>this</code> and <code><em>Outer</em>.this</code> are always
+ <code>final</code>.<br />
+ The compiler uses the pseudo identifier <strong><code>tthis</code></strong> to denote
+ such implicit type anchors in error messages.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s1.2.2.c.html" rel="prev">&lt;&lt;&nbsp;&sect;1.2.2.(c)&nbsp;Immutable anchor</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.2.2.e.html" rel="next">&sect;1.2.2.(e)&nbsp;Conformance&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.2.html" rel="section">&sect;1.2.2&nbsp;Externalized roles</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.2.e.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.2.e.html
new file mode 100644
index 000000000..a959f0573
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.2.e.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s1.2.2.d.html" rel="prev">&lt;&lt;&nbsp;&sect;1.2.2.(d)&nbsp;Implicit type anchors</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.2.2.f.html" rel="next">&sect;1.2.2.(f)&nbsp;Substitutions for type anchors&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.2.html" rel="section">&sect;1.2.2&nbsp;Externalized roles</a></div>
+ <div class="subsect depth4" id="s1.2.2.e">
+ <h4 class="subsect">&sect;1.2.2.(e)&nbsp;<span class="title">Conformance</span></h4>
+ <p>Conformance between
+ two types <code>RoleX&lt;@teamA&gt;</code> and <code>RoleY&lt;@teamB&gt;</code>
+ not only requires the role types to be compatible, but also
+ the team instances to be provably <em>the same object</em>.
+ The compiler must be able to statically analyze anchor identity.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s1.2.2.d.html" rel="prev">&lt;&lt;&nbsp;&sect;1.2.2.(d)&nbsp;Implicit type anchors</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.2.2.f.html" rel="next">&sect;1.2.2.(f)&nbsp;Substitutions for type anchors&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.2.html" rel="section">&sect;1.2.2&nbsp;Externalized roles</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.2.f.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.2.f.html
new file mode 100644
index 000000000..13719b541
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.2.f.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s1.2.2.e.html" rel="prev">&lt;&lt;&nbsp;&sect;1.2.2.(e)&nbsp;Conformance</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.2.2.g.html" rel="next">&sect;1.2.2.(g)&nbsp;Legal contexts&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.2.html" rel="section">&sect;1.2.2&nbsp;Externalized roles</a></div>
+ <div class="subsect depth4" id="s1.2.2.f">
+ <h4 class="subsect">&sect;1.2.2.(f)&nbsp;<span class="title">Substitutions for type anchors</span></h4>
+ <p>Only two substitutions are considered for determining
+ team identity:
+
+ </p>
+ <ol>
+ <li>
+ For type checking the application of team methods,
+ <code>this</code> is <strong>substituted</strong> by the actual call target.
+ For role methods a reference of the form <code><em>Outer</em>.this</code>
+ is substituted by the enclosing instance of the call target.
+
+ </li>
+ <li>Assignments from a <code>final</code> identifier
+ to another <code>final</code> identifier are transitively
+ followed, i.e., if <code>t1, t2</code> are final,
+ after an assignment <code>t1=t2</code>
+ the types <code>R&lt;@t1&gt;</code> and <code>R&lt;@t2&gt;</code> are considered
+ identical. Otherwise <code>R&lt;@t1&gt;</code> and <code>R&lt;@t2&gt;</code>
+ are incommensurable.<br />
+ Attaching an actual parameter to a formal parameter in a
+ method call is also considered as an assignment with respect to
+ this rule.
+
+ </li>
+ </ol>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s1.2.2.e.html" rel="prev">&lt;&lt;&nbsp;&sect;1.2.2.(e)&nbsp;Conformance</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.2.2.g.html" rel="next">&sect;1.2.2.(g)&nbsp;Legal contexts&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.2.html" rel="section">&sect;1.2.2&nbsp;Externalized roles</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.2.g.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.2.g.html
new file mode 100644
index 000000000..7de320f40
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.2.g.html
@@ -0,0 +1,68 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s1.2.2.f.html" rel="prev">&lt;&lt;&nbsp;&sect;1.2.2.(f)&nbsp;Substitutions for type anchors</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.2.2.h.html" rel="next">&sect;1.2.2.(h)&nbsp;Externalized creation&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.2.html" rel="section">&sect;1.2.2&nbsp;Externalized roles</a></div>
+ <div class="subsect depth4" id="s1.2.2.g">
+ <h4 class="subsect">&sect;1.2.2.(g)&nbsp;<span class="title">Legal contexts</span></h4>
+ <p>Anchored types for externalized roles may be used in the
+ following contexts:
+
+ </p>
+ <ol>
+ <li>Declaration of an attribute</li>
+ <li>Declaration of a local variable</li>
+ <li>Declaration of a parameter or result type
+ of a method or constructor
+ </li>
+ <li>In the <code>playedBy</code> clause of a role class
+ (see <a href="s2.1.html" title="&sect;2.1&nbsp;playedBy relation" class="sect">&sect;2.1</a>).
+ </li>
+ </ol>
+ <p>It is not legal to inherit from an anchored type, since
+ this would require membership of the referenced team instance,
+ which can only be achieved by class nesting.
+
+ </p>
+ <div class="note">
+ <h5>Note:</h5>
+ Item 4.
+ &mdash; within the given restriction &mdash; admits the case where
+ the same class is a role of one team and the base class for
+ the role of another team. Another form of nesting is
+ defined in <a href="s1.5.html" title="&sect;1.5&nbsp;Team and role nesting" class="sect">&sect;1.5</a>.
+
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s1.2.2.f.html" rel="prev">&lt;&lt;&nbsp;&sect;1.2.2.(f)&nbsp;Substitutions for type anchors</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.2.2.h.html" rel="next">&sect;1.2.2.(h)&nbsp;Externalized creation&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.2.html" rel="section">&sect;1.2.2&nbsp;Externalized roles</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.2.h.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.2.h.html
new file mode 100644
index 000000000..d09e892a2
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.2.h.html
@@ -0,0 +1,51 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s1.2.2.g.html" rel="prev">&lt;&lt;&nbsp;&sect;1.2.2.(g)&nbsp;Legal contexts</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.2.2.i.html" rel="next">&sect;1.2.2.(i)&nbsp;No import&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.2.html" rel="section">&sect;1.2.2&nbsp;Externalized roles</a></div>
+ <div class="subsect depth4" id="s1.2.2.h">
+ <h4 class="subsect">&sect;1.2.2.(h)&nbsp;<span class="title">Externalized creation</span></h4>
+ <p>A role can be created as externalized using either of these equivalent forms:</p>
+ <div class="listing plain"><pre>outer.<b>new</b> Role()
+<b>new</b> Role&lt;@outer&gt;()</pre></div>
+ <p>This requires the enclosing instance <code>outer</code> to be
+ declared <code>final</code>. The expression has the
+ type <code>Role&lt;@outer&gt;</code> following the rules of
+ externalized roles.<br />
+ The type <code>Role</code> in this expression must be a simple
+ (unqualified) name.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s1.2.2.g.html" rel="prev">&lt;&lt;&nbsp;&sect;1.2.2.(g)&nbsp;Legal contexts</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.2.2.i.html" rel="next">&sect;1.2.2.(i)&nbsp;No import&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.2.html" rel="section">&sect;1.2.2&nbsp;Externalized roles</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.2.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.2.html
new file mode 100644
index 000000000..109669b2d
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.2.html
@@ -0,0 +1,367 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s1.2.1.html" rel="prev">&lt;&lt;&nbsp;&sect;1.2.1&nbsp;Modifiers for roles</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.2.3.html" rel="next">&sect;1.2.3&nbsp;Protected roles&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a></div>
+ <div class="sect depth3" id="s1.2.2">
+ <h3 class="sect">&sect;1.2.2&nbsp;Externalized roles</h3>
+ <div class="syntaxlink"><a href="sA.html#sA.9.2" title="&sect;A.9.2&nbsp;ActualTypeArgument"
+ class="syntax">&rarr;&nbsp;Syntax&nbsp;&sect;A.9.2</a></div>
+ <p>Normally, a team encapsulates its role against unwanted access from the outside.
+ If roles are visible outside their enclosing team instance we speak of
+ <strong>externalized roles</strong>.
+
+ </p>
+ <p>Externalized roles are subject to specific typing rules in order to ensure,
+ that role instances from different team instances cannot be mixed in
+ inconsistent ways. In the presence of implicit inheritance
+ (<a href="s1.3.1.html"
+ title="&sect;1.3.1&nbsp;Acquisition and implicit inheritance of role classes"
+ class="sect">&sect;1.3.1</a>) inconsistencies could otherwise occur, which lead
+ to typing errors that could only be detected at run-time.
+ Externalized roles use the theory of
+ "virtual classes" <a href="s1.html#fn1-virtual-classes" class="int">[1]</a>,
+ or more specifically
+ "family polymorphism" <a href="s1.html#fn2-family-polymorphism" class="int">[2]</a>,
+ in order to achieve the desired type safety.
+ These theories use special forms of <em>dependent types</em>.
+ Externalized roles have <em>types that depend on a team instance</em>.
+
+ </p>
+ <p><a href="s1.2.3.html" title="&sect;1.2.3&nbsp;Protected roles" class="sect">&sect;1.2.3</a> deduces even stronger forms of encapsulation
+ from the rules about externalized roles.
+
+ </p>
+ <div class="subsect depth4" id="s1.2.2.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Visibility</span></h4>
+ <p>Only instances of a <code>public</code> role class can ever be externalized.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.2.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Declaration with anchored type</span></h4>
+ <p>Outside a team role types are legal only if denoted relative
+ to an existing team instance (further on called "anchored types").
+ The syntax is:
+ </p>
+ <div class="listing plain"><pre><em>final</em> MyTeam myTeam = <i>expression</i>;
+<em>RoleClass&lt;@myTeam&gt;</em> role = <i>expression</i>;</pre></div>
+ <p>The syntax <code>Type&lt;@anchor&gt;</code> is a special case of a parameterized type, more specifically a <a href="s9.html" title="&sect;9&nbsp;Value Dependent Classes" class="sect">value dependent type (&sect;9)</a>.
+ The type argument (i.e., the expression after the at-sign) can be a simple name or a path. It must refer to an instance
+ of a team class.
+ The role type is said to be <em>anchored</em> to this team instance.<br />
+ The type-part of this syntax (in front of the angle brackets) must be the simple name of a role type directly contained
+ in the given team (including roles that are acquired by implicit inheritance).<br /></p>
+ <div class="note">
+ <h5>Note:</h5>
+ Previous versions of the OTJLD used a different syntax for anchored types, where the role type was prefixed with the anchor
+ expression, separated by a dot (<code>anchor.Type</code>,
+ see <a href="sA.html#sA.6.3" title="&sect;A.6.3&nbsp;AnchoredType" class="sect">&sect;A.6.3</a>). A compiler may still support that path syntax but it should be flagged as being deprecated.
+
+ </div>
+ </div>
+ <div class="subsect depth4" id="s1.2.2.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Immutable anchor</span></h4>
+ <p>Anchoring the type of an externalized role to a team instance
+ requires the team to be referenced by a variable which
+ is marked <code>final</code> (i.e., immutable).
+ The type anchor can be a path <code>v.f1.f2...</code> where
+ <code>v</code> is any final variable and <code>f1</code> ...
+ are final fields.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.2.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Implicit type anchors</span></h4>
+ <p>The current team instance can be used as a default anchor
+ for role types:
+
+ </p>
+ <ol>
+ <li>In non-static team level methods role types are by default interpreted as anchored to <code>this</code> (referring to the team instance). I.e., the following two declarations express the same:
+
+ <div class="listing plain"><pre><b>public</b> RoleX getRoleX (RoleY r) { <i> stmts </i> }
+<b>public</b> RoleX&lt;@<em>this</em>&gt; getRoleX (RoleY&lt;@<em>this</em>&gt; r) { <i> stmts </i> }</pre></div>
+ </li>
+ <li>
+ In analogy, <em>role methods</em> use the enclosing team instance as the
+ default anchor for any role types.
+ </li>
+ </ol>
+ <p>Note, that <code>this</code> and <code><em>Outer</em>.this</code> are always
+ <code>final</code>.<br />
+ The compiler uses the pseudo identifier <strong><code>tthis</code></strong> to denote
+ such implicit type anchors in error messages.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.2.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Conformance</span></h4>
+ <p>Conformance between
+ two types <code>RoleX&lt;@teamA&gt;</code> and <code>RoleY&lt;@teamB&gt;</code>
+ not only requires the role types to be compatible, but also
+ the team instances to be provably <em>the same object</em>.
+ The compiler must be able to statically analyze anchor identity.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.2.f">
+ <h4 class="subsect">(f)&nbsp;<span class="title">Substitutions for type anchors</span></h4>
+ <p>Only two substitutions are considered for determining
+ team identity:
+
+ </p>
+ <ol>
+ <li>
+ For type checking the application of team methods,
+ <code>this</code> is <strong>substituted</strong> by the actual call target.
+ For role methods a reference of the form <code><em>Outer</em>.this</code>
+ is substituted by the enclosing instance of the call target.
+
+ </li>
+ <li>Assignments from a <code>final</code> identifier
+ to another <code>final</code> identifier are transitively
+ followed, i.e., if <code>t1, t2</code> are final,
+ after an assignment <code>t1=t2</code>
+ the types <code>R&lt;@t1&gt;</code> and <code>R&lt;@t2&gt;</code> are considered
+ identical. Otherwise <code>R&lt;@t1&gt;</code> and <code>R&lt;@t2&gt;</code>
+ are incommensurable.<br />
+ Attaching an actual parameter to a formal parameter in a
+ method call is also considered as an assignment with respect to
+ this rule.
+
+ </li>
+ </ol>
+ </div>
+ <div class="subsect depth4" id="s1.2.2.g">
+ <h4 class="subsect">(g)&nbsp;<span class="title">Legal contexts</span></h4>
+ <p>Anchored types for externalized roles may be used in the
+ following contexts:
+
+ </p>
+ <ol>
+ <li>Declaration of an attribute</li>
+ <li>Declaration of a local variable</li>
+ <li>Declaration of a parameter or result type
+ of a method or constructor
+ </li>
+ <li>In the <code>playedBy</code> clause of a role class
+ (see <a href="s2.1.html" title="&sect;2.1&nbsp;playedBy relation" class="sect">&sect;2.1</a>).
+ </li>
+ </ol>
+ <p>It is not legal to inherit from an anchored type, since
+ this would require membership of the referenced team instance,
+ which can only be achieved by class nesting.
+
+ </p>
+ <div class="note">
+ <h5>Note:</h5>
+ Item 4.
+ &mdash; within the given restriction &mdash; admits the case where
+ the same class is a role of one team and the base class for
+ the role of another team. Another form of nesting is
+ defined in <a href="s1.5.html" title="&sect;1.5&nbsp;Team and role nesting" class="sect">&sect;1.5</a>.
+
+ </div>
+ </div>
+ <div class="subsect depth4" id="s1.2.2.h">
+ <h4 class="subsect">(h)&nbsp;<span class="title">Externalized creation</span></h4>
+ <p>A role can be created as externalized using either of these equivalent forms:</p>
+ <div class="listing plain"><pre>outer.<b>new</b> Role()
+<b>new</b> Role&lt;@outer&gt;()</pre></div>
+ <p>This requires the enclosing instance <code>outer</code> to be
+ declared <code>final</code>. The expression has the
+ type <code>Role&lt;@outer&gt;</code> following the rules of
+ externalized roles.<br />
+ The type <code>Role</code> in this expression must be a simple
+ (unqualified) name.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.2.i">
+ <h4 class="subsect">(i)&nbsp;<span class="title">No import</span></h4>
+ <p>It is neither useful nor legal to import a role type.<br /></p>
+ <div class="note">
+ <h5>Rationale:</h5>
+ Importing a type allows to use the unqualified name in situations that would otherwise require to use the fully qualified
+ name,
+ i.e., the type prefixed with its containing package and enclosing class. Roles, however are contained in a team <i>instance</i>.
+ Outside their team, role types can only be accessed using an anchored type which uses a team instance to qualify the
+ role type.
+ Relative to this team anchor, roles are <i>always</i> denoted using their simple name, which makes importing roles useless.
+
+ </div>
+ <p>A static import for a constant declared in a role is, however, legal.
+
+ </p>
+ </div>
+ <h5 class="listing">Example code (Externalized Roles):</h5>
+ <div class="listing example frame" id="l1.2.2-1">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>team</b> <b>class</b> FlightBonus <b>extends</b> Bonus {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>public</b> <b>class</b> Subscriber {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>void</b> clearCredits() { ... }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> <b>void</b> unsubscribe(Subscriber subscr) { ... }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="listing example frame" id="l1.2.2-2">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre><b>class</b> ClearAction <b>extends</b> Action {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre> <em>final</em> FlightBonus context;</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre> <em>Subscriber&lt;@context&gt;</em> subscriber;</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">10</td>
+ <td><pre> ClearAction (<em>final</em> FlightBonus bonus, <em>Subscriber&lt;@bonus&gt;</em> subscr) {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">11</td>
+ <td><pre> context = bonus; <span class="comment">// unique assignment to 'context'</span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">12</td>
+ <td><pre> subscriber = subscr;</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">13</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">14</td>
+ <td><pre> <b>void</b> actionPerformed () {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">15</td>
+ <td><pre> subscriber.clearCredits();</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">16</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">17</td>
+ <td><pre> <b>protected</b> <b>void</b> finalize () {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">18</td>
+ <td><pre> context.unsubscribe(subscriber);</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">19</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">20</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="codecomment">
+ <h5>Effects:</h5>
+ <ul>
+ <li>Lines 1-6 show a terse extract of a published example
+ <a href="http://www.objectteams.org/publications/index.html#NODe02" class="ext">[NODe02]</a>. Here passengers can be subscribers in a flight bonus program.
+ </li>
+ <li>Lines 7-20 show a sub-class of <code>Action</code> which is
+ used to associate the action of resetting a subscriber's credits
+ to a button or similar element in an application's GUI.
+ </li>
+ <li>Attribute <code>context</code> (line 8) and parameter
+ <code>bonus</code> (line 10) serve as anchor for the type of
+ externalized roles.
+ </li>
+ <li>Attribute <code>subscriber</code> (line 9) and parameter
+ <code>subscr</code> (line 10) store a Subscriber role outside the
+ FlightBonus team.
+ </li>
+ <li>In order to type-check the assignment in line 12, the compiler
+ has to ensure that the types of LHS and RHS are anchored to
+ the same team instance. This can be verified by checking that
+ both anchors are indeed <code>final</code> and prior to the
+ role assignment a team assignment has taken place (line 11).<br /><span class="underline">Note,</span> that the Java rules for <strong>definite assignments</strong> to
+ final variables ensure that exactly one assignment to a variable occurs
+ prior to its use as type anchor. No further checks are needed.
+
+ </li>
+ <li>It is now legal to store this role reference and use it at
+ some later point in time, e.g., for invoking method
+ <code>clearCredits</code> (line 15).
+ This method call is also an example for implicit team activation
+ (<a href="s5.3.b.html" title="&sect;5.3.(b)&nbsp;Methods of externalized roles"
+ class="sect">&sect;5.3.(b)</a>).
+
+ </li>
+ <li>Line 18 demonstrates how an externalized role can be
+ passed to a team level method. The signature of <code>unsubscribe</code>
+ is for this call expanded to
+ <div class="indent">
+ void unsubscribe(Subscriber&lt;@context&gt; subscr)
+
+ </div>
+ (by substituting the call target <code>context</code> for
+ <code>this</code>). This proves identical types for actual and
+ formal parameters.
+ </li>
+ </ul>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s1.2.1.html" rel="prev">&lt;&lt;&nbsp;&sect;1.2.1&nbsp;Modifiers for roles</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.2.3.html" rel="next">&sect;1.2.3&nbsp;Protected roles&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.2.i.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.2.i.html
new file mode 100644
index 000000000..801887acb
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.2.i.html
@@ -0,0 +1,54 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s1.2.2.h.html" rel="prev">&lt;&lt;&nbsp;&sect;1.2.2.(h)&nbsp;Externalized creation</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.2.html" rel="section">&sect;1.2.2&nbsp;Externalized roles</a></div>
+ <div class="subsect depth4" id="s1.2.2.i">
+ <h4 class="subsect">&sect;1.2.2.(i)&nbsp;<span class="title">No import</span></h4>
+ <p>It is neither useful nor legal to import a role type.<br /></p>
+ <div class="note">
+ <h5>Rationale:</h5>
+ Importing a type allows to use the unqualified name in situations that would otherwise require to use the fully qualified
+ name,
+ i.e., the type prefixed with its containing package and enclosing class. Roles, however are contained in a team <i>instance</i>.
+ Outside their team, role types can only be accessed using an anchored type which uses a team instance to qualify the
+ role type.
+ Relative to this team anchor, roles are <i>always</i> denoted using their simple name, which makes importing roles useless.
+
+ </div>
+ <p>A static import for a constant declared in a role is, however, legal.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s1.2.2.h.html" rel="prev">&lt;&lt;&nbsp;&sect;1.2.2.(h)&nbsp;Externalized creation</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.2.html" rel="section">&sect;1.2.2&nbsp;Externalized roles</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.3.a.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.3.a.html
new file mode 100644
index 000000000..574756d5d
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.3.a.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.2.3.b.html" rel="next">&sect;1.2.3.(b)&nbsp;Qualified role types&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.3.html" rel="section">&sect;1.2.3&nbsp;Protected roles</a></div>
+ <div class="subsect depth4" id="s1.2.3.a">
+ <h4 class="subsect">&sect;1.2.3.(a)&nbsp;<span class="title">Importing role classes</span></h4>
+ <p><i>This rule is superseded by <a href="s1.2.2.i.html" title="&sect;1.2.2.(i)&nbsp;No import" class="sect">&sect;1.2.2.(i)</a></i></p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.2.3.b.html" rel="next">&sect;1.2.3.(b)&nbsp;Qualified role types&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.3.html" rel="section">&sect;1.2.3&nbsp;Protected roles</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.3.b.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.3.b.html
new file mode 100644
index 000000000..6a041ef0b
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.3.b.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s1.2.3.a.html" rel="prev">&lt;&lt;&nbsp;&sect;1.2.3.(a)&nbsp;Importing role classes</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.2.3.c.html" rel="next">&sect;1.2.3.(c)&nbsp;Mixing qualified and unqualified types&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.3.html" rel="section">&sect;1.2.3&nbsp;Protected roles</a></div>
+ <div class="subsect depth4" id="s1.2.3.b">
+ <h4 class="subsect">&sect;1.2.3.(b)&nbsp;<span class="title">Qualified role types</span></h4>
+ <p>The name of a <code>protected</code> role class may never be used qualified, neither
+ prefixed by its <em>enclosing type</em> nor parameterized by a <em>variable as type anchor</em> (cf. <a href="s1.2.2.a.html" title="&sect;1.2.2.(a)&nbsp;Visibility" class="sect">&sect;1.2.2.(a)</a>).
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s1.2.3.a.html" rel="prev">&lt;&lt;&nbsp;&sect;1.2.3.(a)&nbsp;Importing role classes</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.2.3.c.html" rel="next">&sect;1.2.3.(c)&nbsp;Mixing qualified and unqualified types&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.3.html" rel="section">&sect;1.2.3&nbsp;Protected roles</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.3.c.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.3.c.html
new file mode 100644
index 000000000..f5683808f
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.3.c.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s1.2.3.b.html" rel="prev">&lt;&lt;&nbsp;&sect;1.2.3.(b)&nbsp;Qualified role types</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.2.3.d.html" rel="next">&sect;1.2.3.(d)&nbsp;Levels of encapsulation&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.3.html" rel="section">&sect;1.2.3&nbsp;Protected roles</a></div>
+ <div class="subsect depth4" id="s1.2.3.c">
+ <h4 class="subsect">&sect;1.2.3.(c)&nbsp;<span class="title">Mixing qualified and unqualified types</span></h4>
+ <p>An externalized role type is never compatible to an unqualified role type,
+ except for the substitutions in <a href="s1.2.2.f.html"
+ title="&sect;1.2.2.(f)&nbsp;Substitutions for type anchors"
+ class="sect">&sect;1.2.2.(f)</a>, where
+ an explicit anchor can be matched with the implicit anchor <code>this</code>.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s1.2.3.b.html" rel="prev">&lt;&lt;&nbsp;&sect;1.2.3.(b)&nbsp;Qualified role types</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.2.3.d.html" rel="next">&sect;1.2.3.(d)&nbsp;Levels of encapsulation&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.3.html" rel="section">&sect;1.2.3&nbsp;Protected roles</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.3.d.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.3.d.html
new file mode 100644
index 000000000..bceb13588
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.3.d.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s1.2.3.c.html" rel="prev">&lt;&lt;&nbsp;&sect;1.2.3.(c)&nbsp;Mixing qualified and unqualified types</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.3.html" rel="section">&sect;1.2.3&nbsp;Protected roles</a></div>
+ <div class="subsect depth4" id="s1.2.3.d">
+ <h4 class="subsect">&sect;1.2.3.(d)&nbsp;<span class="title">Levels of encapsulation</span></h4>
+ <p>Since protected role types can not be used for externalization, instances of these types are already quite effectively encapsulated
+ by their enclosing team.
+ Based on this concept, encapsulation for protected roles can be made even stricter by the rules of <em>role confinement</em>.
+ On the contrary, even protected roles can be externalized as <em>opaque roles</em> which still expose (almost) no information.
+ Confinement and opaque roles are subject of <a href="s7.html" title="&sect;7&nbsp;Role Encapsulation" class="sect">&sect;7</a>.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s1.2.3.c.html" rel="prev">&lt;&lt;&nbsp;&sect;1.2.3.(c)&nbsp;Mixing qualified and unqualified types</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.3.html" rel="section">&sect;1.2.3&nbsp;Protected roles</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.3.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.3.html
new file mode 100644
index 000000000..13f94a045
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.3.html
@@ -0,0 +1,83 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s1.2.2.html" rel="prev">&lt;&lt;&nbsp;&sect;1.2.2&nbsp;Externalized roles</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.2.4.html" rel="next">&sect;1.2.4&nbsp;Type tests and casts&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a></div>
+ <div class="sect depth3" id="s1.2.3">
+ <h3 class="sect">&sect;1.2.3&nbsp;Protected roles</h3>
+ <p>Roles can only be <code>public</code> or <code>protected</code>.
+ A <code>protected</code> role is encapsulated
+ by its enclosing team instance. This is enforced by these rules:
+
+ </p>
+ <div class="subsect depth4" id="s1.2.3.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Importing role classes</span></h4>
+ <p><i>This rule is superseded by <a href="s1.2.2.i.html" title="&sect;1.2.2.(i)&nbsp;No import" class="sect">&sect;1.2.2.(i)</a></i></p>
+ </div>
+ <div class="subsect depth4" id="s1.2.3.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Qualified role types</span></h4>
+ <p>The name of a <code>protected</code> role class may never be used qualified, neither
+ prefixed by its <em>enclosing type</em> nor parameterized by a <em>variable as type anchor</em> (cf. <a href="s1.2.2.a.html" title="&sect;1.2.2.(a)&nbsp;Visibility" class="sect">&sect;1.2.2.(a)</a>).
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.3.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Mixing qualified and unqualified types</span></h4>
+ <p>An externalized role type is never compatible to an unqualified role type,
+ except for the substitutions in <a href="s1.2.2.f.html"
+ title="&sect;1.2.2.(f)&nbsp;Substitutions for type anchors"
+ class="sect">&sect;1.2.2.(f)</a>, where
+ an explicit anchor can be matched with the implicit anchor <code>this</code>.
+
+ </p>
+ </div>
+ <p>Rules (a) and (b) ensure that the name of a protected role class cannot be used
+ outside the lexical scope of its enclosing team. Rule (c) ensures that team methods
+ containing unqualified role types in their signature cannot be invoked on a team other
+ than the current team. Accordingly, for role methods the team context must be the
+ enclosing team instance.
+
+ </p>
+ <div class="subsect depth4" id="s1.2.3.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Levels of encapsulation</span></h4>
+ <p>Since protected role types can not be used for externalization, instances of these types are already quite effectively encapsulated
+ by their enclosing team.
+ Based on this concept, encapsulation for protected roles can be made even stricter by the rules of <em>role confinement</em>.
+ On the contrary, even protected roles can be externalized as <em>opaque roles</em> which still expose (almost) no information.
+ Confinement and opaque roles are subject of <a href="s7.html" title="&sect;7&nbsp;Role Encapsulation" class="sect">&sect;7</a>.
+
+ </p>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s1.2.2.html" rel="prev">&lt;&lt;&nbsp;&sect;1.2.2&nbsp;Externalized roles</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.2.4.html" rel="next">&sect;1.2.4&nbsp;Type tests and casts&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.4.a.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.4.a.html
new file mode 100644
index 000000000..07040014d
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.4.a.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.2.4.b.html" rel="next">&sect;1.2.4.(b)&nbsp;Casting&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.4.html" rel="section">&sect;1.2.4&nbsp;Type tests and casts</a></div>
+ <div class="subsect depth4" id="s1.2.4.a">
+ <h4 class="subsect">&sect;1.2.4.(a)&nbsp;<span class="title">instanceof</span></h4>
+ <p>For role types the <code>instanceof</code> operator yields true only if
+ both components of the type match: the dynamic role type must be compatible
+ to the given static type, and also type anchors must be the same instance.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.2.4.b.html" rel="next">&sect;1.2.4.(b)&nbsp;Casting&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.4.html" rel="section">&sect;1.2.4&nbsp;Type tests and casts</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.4.b.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.4.b.html
new file mode 100644
index 000000000..a0c0539bd
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.4.b.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s1.2.4.a.html" rel="prev">&lt;&lt;&nbsp;&sect;1.2.4.(a)&nbsp;instanceof</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.2.4.c.html" rel="next">&sect;1.2.4.(c)&nbsp;Class literal&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.4.html" rel="section">&sect;1.2.4&nbsp;Type tests and casts</a></div>
+ <div class="subsect depth4" id="s1.2.4.b">
+ <h4 class="subsect">&sect;1.2.4.(b)&nbsp;<span class="title">Casting</span></h4>
+ <p>Casts may also fail if the casted expression is anchored to a different
+ team instance than the cast type. Such failure is signaled by a
+ <code>org.objectteams.RoleCastException</code>.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s1.2.4.a.html" rel="prev">&lt;&lt;&nbsp;&sect;1.2.4.(a)&nbsp;instanceof</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.2.4.c.html" rel="next">&sect;1.2.4.(c)&nbsp;Class literal&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.4.html" rel="section">&sect;1.2.4&nbsp;Type tests and casts</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.4.c.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.4.c.html
new file mode 100644
index 000000000..b4f051fe5
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.4.c.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s1.2.4.b.html" rel="prev">&lt;&lt;&nbsp;&sect;1.2.4.(b)&nbsp;Casting</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.4.html" rel="section">&sect;1.2.4&nbsp;Type tests and casts</a></div>
+ <div class="subsect depth4" id="s1.2.4.c">
+ <h4 class="subsect">&sect;1.2.4.(c)&nbsp;<span class="title">Class literal</span></h4>
+ <p>A class literal of form <code>R.class</code> is dynamically bound to the class <code>R</code>
+ visible in the current instance context. Using a class literal for a role outside its
+ enclosing team instance (see <a href="s1.2.2.html" title="&sect;1.2.2&nbsp;Externalized roles" class="sect">&sect;1.2.2</a>) requires the following syntax:
+
+ </p>
+ <div class="listing plain"><pre>RoleClass<em>&lt;@teamAnchor&gt;</em><strong>.class</strong></pre></div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s1.2.4.b.html" rel="prev">&lt;&lt;&nbsp;&sect;1.2.4.(b)&nbsp;Casting</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.4.html" rel="section">&sect;1.2.4&nbsp;Type tests and casts</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.4.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.4.html
new file mode 100644
index 000000000..da80141f7
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.4.html
@@ -0,0 +1,69 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s1.2.3.html" rel="prev">&lt;&lt;&nbsp;&sect;1.2.3&nbsp;Protected roles</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.2.5.html" rel="next">&sect;1.2.5&nbsp;File structure&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a></div>
+ <div class="sect depth3" id="s1.2.4">
+ <h3 class="sect">&sect;1.2.4&nbsp;Type tests and casts</h3>
+ <p>In accordance with <a href="s1.2.2.e.html" title="&sect;1.2.2.(e)&nbsp;Conformance" class="sect">&sect;1.2.2.(e)</a>, in OT/J
+ the <code>instanceof</code> operator and type casts have extended semantics for roles.
+
+ </p>
+ <div class="subsect depth4" id="s1.2.4.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">instanceof</span></h4>
+ <p>For role types the <code>instanceof</code> operator yields true only if
+ both components of the type match: the dynamic role type must be compatible
+ to the given static type, and also type anchors must be the same instance.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.4.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Casting</span></h4>
+ <p>Casts may also fail if the casted expression is anchored to a different
+ team instance than the cast type. Such failure is signaled by a
+ <code>org.objectteams.RoleCastException</code>.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.4.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Class literal</span></h4>
+ <p>A class literal of form <code>R.class</code> is dynamically bound to the class <code>R</code>
+ visible in the current instance context. Using a class literal for a role outside its
+ enclosing team instance (see <a href="s1.2.2.html" title="&sect;1.2.2&nbsp;Externalized roles" class="sect">&sect;1.2.2</a>) requires the following syntax:
+
+ </p>
+ <div class="listing plain"><pre>RoleClass<em>&lt;@teamAnchor&gt;</em><strong>.class</strong></pre></div>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s1.2.3.html" rel="prev">&lt;&lt;&nbsp;&sect;1.2.3&nbsp;Protected roles</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.2.5.html" rel="next">&sect;1.2.5&nbsp;File structure&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.5.a.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.5.a.html
new file mode 100644
index 000000000..c6d2bc3ca
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.5.a.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.2.5.b.html" rel="next">&sect;1.2.5.(b)&nbsp;Role files&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.5.html" rel="section">&sect;1.2.5&nbsp;File structure</a></div>
+ <div class="subsect depth4" id="s1.2.5.a">
+ <h4 class="subsect">&sect;1.2.5.(a)&nbsp;<span class="title">Role directory</span></h4>
+ <p>In the directory of the team class a new directory is created
+ which has the same name as the team without the <tt>.java</tt> suffix.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.2.5.b.html" rel="next">&sect;1.2.5.(b)&nbsp;Role files&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.5.html" rel="section">&sect;1.2.5&nbsp;File structure</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.5.b.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.5.b.html
new file mode 100644
index 000000000..ba7f40d6d
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.5.b.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s1.2.5.a.html" rel="prev">&lt;&lt;&nbsp;&sect;1.2.5.(a)&nbsp;Role directory</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.2.5.c.html" rel="next">&sect;1.2.5.(c)&nbsp;package statement&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.5.html" rel="section">&sect;1.2.5&nbsp;File structure</a></div>
+ <div class="subsect depth4" id="s1.2.5.b">
+ <h4 class="subsect">&sect;1.2.5.(b)&nbsp;<span class="title">Role files</span></h4>
+ <p>Role classes are stored in this directory (a). The file names are
+ derived from the role class name extended by <tt>.java</tt>.<br />
+ A role file must contain exactly one top-level type.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s1.2.5.a.html" rel="prev">&lt;&lt;&nbsp;&sect;1.2.5.(a)&nbsp;Role directory</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.2.5.c.html" rel="next">&sect;1.2.5.(c)&nbsp;package statement&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.5.html" rel="section">&sect;1.2.5&nbsp;File structure</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.5.c.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.5.c.html
new file mode 100644
index 000000000..730f26195
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.5.c.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s1.2.5.b.html" rel="prev">&lt;&lt;&nbsp;&sect;1.2.5.(b)&nbsp;Role files</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.2.5.d.html" rel="next">&sect;1.2.5.(d)&nbsp;Reference to role file&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.5.html" rel="section">&sect;1.2.5&nbsp;File structure</a></div>
+ <div class="subsect depth4" id="s1.2.5.c">
+ <h4 class="subsect">&sect;1.2.5.(c)&nbsp;<span class="title">package statement</span></h4>
+ <p>A role class in a role file declares as its package the fully qualified
+ name of the enclosing team class. The package statement of a role file
+ must use the <code>team</code> modifier as its first token.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s1.2.5.b.html" rel="prev">&lt;&lt;&nbsp;&sect;1.2.5.(b)&nbsp;Role files</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.2.5.d.html" rel="next">&sect;1.2.5.(d)&nbsp;Reference to role file&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.5.html" rel="section">&sect;1.2.5&nbsp;File structure</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.5.d.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.5.d.html
new file mode 100644
index 000000000..9ac78ed0d
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.5.d.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s1.2.5.c.html" rel="prev">&lt;&lt;&nbsp;&sect;1.2.5.(c)&nbsp;package statement</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.2.5.e.html" rel="next">&sect;1.2.5.(e)&nbsp;Legal types in role files&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.5.html" rel="section">&sect;1.2.5&nbsp;File structure</a></div>
+ <div class="subsect depth4" id="s1.2.5.d">
+ <h4 class="subsect">&sect;1.2.5.(d)&nbsp;<span class="title">Reference to role file</span></h4>
+ <p>A team should mention in its javadoc comment each role class which
+ is stored externally using a <tt>@role</tt> tag.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s1.2.5.c.html" rel="prev">&lt;&lt;&nbsp;&sect;1.2.5.(c)&nbsp;package statement</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.2.5.e.html" rel="next">&sect;1.2.5.(e)&nbsp;Legal types in role files&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.5.html" rel="section">&sect;1.2.5&nbsp;File structure</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.5.e.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.5.e.html
new file mode 100644
index 000000000..fa8384068
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.5.e.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s1.2.5.d.html" rel="prev">&lt;&lt;&nbsp;&sect;1.2.5.(d)&nbsp;Reference to role file</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.2.5.f.html" rel="next">&sect;1.2.5.(f)&nbsp;Imports in role files&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.5.html" rel="section">&sect;1.2.5&nbsp;File structure</a></div>
+ <div class="subsect depth4" id="s1.2.5.e">
+ <h4 class="subsect">&sect;1.2.5.(e)&nbsp;<span class="title">Legal types in role files</span></h4>
+ <p>The type in a role file must not be an <code>enum</code>.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s1.2.5.d.html" rel="prev">&lt;&lt;&nbsp;&sect;1.2.5.(d)&nbsp;Reference to role file</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.2.5.f.html" rel="next">&sect;1.2.5.(f)&nbsp;Imports in role files&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.5.html" rel="section">&sect;1.2.5&nbsp;File structure</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.5.f.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.5.f.html
new file mode 100644
index 000000000..47fb16a4a
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.5.f.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s1.2.5.e.html" rel="prev">&lt;&lt;&nbsp;&sect;1.2.5.(e)&nbsp;Legal types in role files</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.5.html" rel="section">&sect;1.2.5&nbsp;File structure</a></div>
+ <div class="subsect depth4" id="s1.2.5.f">
+ <h4 class="subsect">&sect;1.2.5.(f)&nbsp;<span class="title">Imports in role files</span></h4>
+ <p>A role file may have imports of its own.
+ Within the role definition these imports are visible <em>in addition</em> to all imports of the enclosing team.
+ Only <code>base</code> imports (see <a href="s2.1.2.d.html" title="&sect;2.1.2.(d)&nbsp;Base imports" class="sect">&sect;2.1.2.(d)</a>)
+ <em>must</em> be defined in the team.
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s1.2.5.e.html" rel="prev">&lt;&lt;&nbsp;&sect;1.2.5.(e)&nbsp;Legal types in role files</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.5.html" rel="section">&sect;1.2.5&nbsp;File structure</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.5.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.5.html
new file mode 100644
index 000000000..a41f163e7
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.5.html
@@ -0,0 +1,174 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s1.2.4.html" rel="prev">&lt;&lt;&nbsp;&sect;1.2.4&nbsp;Type tests and casts</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a></div>
+ <div class="sect depth3" id="s1.2.5">
+ <h3 class="sect">&sect;1.2.5&nbsp;File structure</h3>
+ <p>Just like regular inner classes, role classes may be inlined in the
+ source code of the enclosing team. As an alternative style it is possible
+ to store role classes in separate <strong>role files</strong> according to the following rules:
+
+ </p>
+ <div class="subsect depth4" id="s1.2.5.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Role directory</span></h4>
+ <p>In the directory of the team class a new directory is created
+ which has the same name as the team without the <tt>.java</tt> suffix.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.5.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Role files</span></h4>
+ <p>Role classes are stored in this directory (a). The file names are
+ derived from the role class name extended by <tt>.java</tt>.<br />
+ A role file must contain exactly one top-level type.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.5.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">package statement</span></h4>
+ <p>A role class in a role file declares as its package the fully qualified
+ name of the enclosing team class. The package statement of a role file
+ must use the <code>team</code> modifier as its first token.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.5.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Reference to role file</span></h4>
+ <p>A team should mention in its javadoc comment each role class which
+ is stored externally using a <tt>@role</tt> tag.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.5.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Legal types in role files</span></h4>
+ <p>The type in a role file must not be an <code>enum</code>.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.5.f">
+ <h4 class="subsect">(f)&nbsp;<span class="title">Imports in role files</span></h4>
+ <p>A role file may have imports of its own.
+ Within the role definition these imports are visible <em>in addition</em> to all imports of the enclosing team.
+ Only <code>base</code> imports (see <a href="s2.1.2.d.html" title="&sect;2.1.2.(d)&nbsp;Base imports" class="sect">&sect;2.1.2.(d)</a>)
+ <em>must</em> be defined in the team.
+ </p>
+ </div>
+ <p>Semantically, there is no difference between inlined role classes and those
+ stored in separate role files.
+
+ </p>
+ <div class="note">
+ <h5>Note:</h5>
+ Current Java compilers disallow a type to have the same fully qualified
+ name as a package. However, the JLS does not seem to make a statement in this respect.
+ In OT/J, a package and a type are interpreted as being the same team, if both have the
+ same fully qualified name and both have the <code>team</code> modifier.
+
+ </div>
+ <h5 class="listing">Role file example:</h5>
+ <div class="listing example frame" id="l1.2.5-1">
+ <table class="listing">
+ <tr class="lhead">
+ <td colspan="2">in file <code>org/objectteams/examples/MyTeamA.java</code> :
+ </td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>package</b> org.objectteams.examples;</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre><span class="comment">/**</span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <span class="comment">* @author Stephan Herrmann</span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <span class="comment">* @date 20.02.2007</span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> <span class="comment">* @file MyTeamA.java</span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> <span class="comment">* <em>@role MyRole</em></span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> <span class="comment">*/</span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> MyTeamA {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre> ...</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">10</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="listing example frame" id="l1.2.5-2">
+ <table class="listing">
+ <tr class="lhead">
+ <td colspan="2">in file <code>org/objectteams/examples<strong class="blue">/MyTeamA/MyRole.java</strong></code>:
+ </td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><em><b>team</b> <b>package</b> org.objectteams.examples.MyTeamA;</em></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre><b>public</b> <b>class</b> MyRole {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> ...</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s1.2.4.html" rel="prev">&lt;&lt;&nbsp;&sect;1.2.4&nbsp;Type tests and casts</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.2.html" rel="section">&sect;1.2&nbsp;Role classes and objects</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.html
new file mode 100644
index 000000000..08b9dcb57
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.2.html
@@ -0,0 +1,742 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s1.1.html" rel="prev">&lt;&lt;&nbsp;&sect;1.1&nbsp;Team classes</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.3.html" rel="next">&sect;1.3&nbsp;Acquisition and implicit inheritance of role classes&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a></div>
+ <div class="sect depth2" id="s1.2">
+ <h2 class="sect">&sect;1.2&nbsp;Role classes and objects</h2>
+ <p>Each direct inner class of a team is a role class.
+ Just like inner classes, each instance of a role class has an implicit reference
+ to its enclosing team instance. This reference is immutable.
+ Within the implementation of a role it can be accessed by qualifying the identifier
+ <code>this</code> with the name of the team class, as in:
+
+ </p>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> MyTeamA {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>public</b> <em><b>class</b> MyRole</em> {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>public</b> <b>void</b> print() { System.out.println("Team: "+ <em>MyTeamA.this</em>); }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <p>Creation of role instances is further restricted as defined in
+ <a href="s2.4.html" title="&sect;2.4&nbsp;Explicit role creation" class="sect">&sect;2.4</a>.
+ Teams can also define role interfaces just like role classes.
+ With respect to role specific properties a role interface is treated like a fully
+ abstract class.
+
+ </p>
+ <div class="sect depth3" id="s1.2.1">
+ <h3 class="sect">&sect;1.2.1&nbsp;Modifiers for roles<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;1.2</a></span></h3>
+ <p>Member classes of a team cannot be <code>static</code>.
+ Also the use of access modifiers for roles is restricted and modifiers have different (stronger) semantics than for
+ regular classes (see below). With respect to accessibility a team acts mainly like a package regarding its roles.
+
+ </p>
+ <div class="subsect depth4" id="s1.2.1.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Role class protection</span></h4>
+ <p>A role class must have exactly one of the access modifiers <code>public</code>
+ or <code>protected</code>.<br />
+ This rule does not affect the class modifiers <code>abstract</code>, <code>final</code> and <code>strictfp</code>.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.1.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">protected role classes</span></h4>
+ <p>A <code>protected</code> role can only be accessed from within the enclosing
+ team or any of its sub-teams. The actual border of encapsulation is the
+ enclosing team <em>instance</em>. The rules for protected roles are given
+ in <a href="#s1.2.3" title="&sect;1.2.3&nbsp;Protected roles" class="sect">&sect;1.2.3</a> below.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.1.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">public role classes</span></h4>
+ <p>Only <code>public</code> roles can ever be accessed outside their enclosing team.
+ Accessing a role outside the enclosing team instance is governed by the rules
+ of <strong>externalized roles</strong>, to be defined next (<a href="#s1.2.2" title="&sect;1.2.2&nbsp;Externalized roles" class="sect">&sect;1.2.2</a>).
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.1.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">abstract role classes</span></h4>
+ <p>A role class has to be marked <strong>abstract</strong> if any of its methods
+ is not effective.<br />
+ The <em>methods of a role class</em> comprise direct methods and
+ methods acquired by inheritance.
+ In addition to regular inheritance a role class may acquire methods
+ also via implicit inheritance (<a href="s1.3.1.html"
+ title="&sect;1.3.1&nbsp;Acquisition and implicit inheritance of role classes"
+ class="sect">&sect;1.3.1</a>).<br />
+ A method may become <em>effective</em> by either:
+
+ </p>
+ <ul>
+ <li>implementation (i.e., a regular method body), or</li>
+ <li>a callout binding (see <a href="s3.html" title="&sect;3&nbsp;Callout Binding" class="sect">&sect;3</a>).
+ </li>
+ </ul>
+ <p><a href="s2.5.html" title="&sect;2.5&nbsp;Abstract Roles" class="sect">&sect;2.5</a> discusses under which
+ circumstances abstract roles force the enclosing team to be abstract, too.
+
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.1.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Role features</span></h4>
+ <p>Access modifiers for members of roles have some special interpretation:
+
+ </p>
+ <ol>
+ <li>A private member is also visible in any implicit sub role
+ (see implicit inheritance <a href="s1.3.1.c.html"
+ title="&sect;1.3.1.(c)&nbsp;Overriding and implicit inheritance"
+ class="sect">&sect;1.3.1.(c)</a>).<br />
+ In contrast to inner classes in Java, private members of a role are not
+ visible to the enclosing team.
+ </li>
+ <li>The default visibility of role members restricts access to the
+ current class and its sub-classes (explicit and implicit).
+ </li>
+ <li><code>protected</code> role members can only be accessed from the enclosing
+ team or via <a href="s4.html" title="&sect;4&nbsp;Callin Binding" class="sect">callin (&sect;4)</a>.
+ </li>
+ <li><code>public</code> role members grant unrestricted access.
+ </li>
+ </ol>
+ <p>Additionally, a role always has access to all the features that its enclosing team has access to.</p>
+ <p>Only <code>public</code> members can ever be accessed via an <a href="#s1.2.2" title="&sect;1.2.2&nbsp;Externalized roles" class="sect">externalized role (&sect;1.2.2)</a>.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.1.f">
+ <h4 class="subsect">(f)&nbsp;<span class="title">Static role methods</span></h4>
+ <p>In contrast to inner classes in pure Java, a role class may indeed define static methods. A static role method requires no
+ role
+ instance <em>but</em> it still requires a team instance in scope. Static role methods can be called:
+
+ </p>
+ <ul>
+ <li>from the enclosing team,</li>
+ <li>via callin (see <a href="s4.7.html" title="&sect;4.7&nbsp;Callin binding with static methods"
+ class="sect">&sect;4.7</a>).
+ </li>
+ </ul>
+ <p>Within a static role method the syntax <code>MyTeam.this</code> is available for accessing the enclosing team instance.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.1.g">
+ <h4 class="subsect">(g)&nbsp;<span class="title">No static initializers</span></h4>
+ <p>A static field of a role class must not have a non-constant initialization expression.
+ Static initialization blocks are already prohibited for inner classes by Java (see <a href="http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#262890"
+ class="ext">JLS &sect;8.1.2</a>).
+
+ </p>
+ <div class="note">
+ <h5>Note:</h5>
+ Static initialization generally provides a means for performing initialization code prior to instantiation, i.e., at
+ class-loading time.
+ Before any role can be created already two levels of initialization are performed: (1) The (outer most) enclosing team
+ class performs static initializations when it is loaded. (2) Any enclosing team executes
+ its constructor when it is instantiated. It should be possible to allocate any early initialization to either of these
+ two phases instead of using static role initializers.
+
+ </div>
+ </div>
+ </div>
+ <div class="sect depth3" id="s1.2.2">
+ <h3 class="sect">&sect;1.2.2&nbsp;Externalized roles<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;1.2</a></span></h3>
+ <div class="syntaxlink"><a href="sA.html#sA.9.2" title="&sect;A.9.2&nbsp;ActualTypeArgument"
+ class="syntax">&rarr;&nbsp;Syntax&nbsp;&sect;A.9.2</a></div>
+ <p>Normally, a team encapsulates its role against unwanted access from the outside.
+ If roles are visible outside their enclosing team instance we speak of
+ <strong>externalized roles</strong>.
+
+ </p>
+ <p>Externalized roles are subject to specific typing rules in order to ensure,
+ that role instances from different team instances cannot be mixed in
+ inconsistent ways. In the presence of implicit inheritance
+ (<a href="s1.3.1.html"
+ title="&sect;1.3.1&nbsp;Acquisition and implicit inheritance of role classes"
+ class="sect">&sect;1.3.1</a>) inconsistencies could otherwise occur, which lead
+ to typing errors that could only be detected at run-time.
+ Externalized roles use the theory of
+ "virtual classes" <a href="s1.html#fn1-virtual-classes" class="int">[1]</a>,
+ or more specifically
+ "family polymorphism" <a href="s1.html#fn2-family-polymorphism" class="int">[2]</a>,
+ in order to achieve the desired type safety.
+ These theories use special forms of <em>dependent types</em>.
+ Externalized roles have <em>types that depend on a team instance</em>.
+
+ </p>
+ <p><a href="#s1.2.3" title="&sect;1.2.3&nbsp;Protected roles" class="sect">&sect;1.2.3</a> deduces even stronger forms of encapsulation
+ from the rules about externalized roles.
+
+ </p>
+ <div class="subsect depth4" id="s1.2.2.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Visibility</span></h4>
+ <p>Only instances of a <code>public</code> role class can ever be externalized.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.2.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Declaration with anchored type</span></h4>
+ <p>Outside a team role types are legal only if denoted relative
+ to an existing team instance (further on called "anchored types").
+ The syntax is:
+ </p>
+ <div class="listing plain"><pre><em>final</em> MyTeam myTeam = <i>expression</i>;
+<em>RoleClass&lt;@myTeam&gt;</em> role = <i>expression</i>;</pre></div>
+ <p>The syntax <code>Type&lt;@anchor&gt;</code> is a special case of a parameterized type, more specifically a <a href="s9.html" title="&sect;9&nbsp;Value Dependent Classes" class="sect">value dependent type (&sect;9)</a>.
+ The type argument (i.e., the expression after the at-sign) can be a simple name or a path. It must refer to an instance
+ of a team class.
+ The role type is said to be <em>anchored</em> to this team instance.<br />
+ The type-part of this syntax (in front of the angle brackets) must be the simple name of a role type directly contained
+ in the given team (including roles that are acquired by implicit inheritance).<br /></p>
+ <div class="note">
+ <h5>Note:</h5>
+ Previous versions of the OTJLD used a different syntax for anchored types, where the role type was prefixed with the anchor
+ expression, separated by a dot (<code>anchor.Type</code>,
+ see <a href="sA.html#sA.6.3" title="&sect;A.6.3&nbsp;AnchoredType" class="sect">&sect;A.6.3</a>). A compiler may still support that path syntax but it should be flagged as being deprecated.
+
+ </div>
+ </div>
+ <div class="subsect depth4" id="s1.2.2.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Immutable anchor</span></h4>
+ <p>Anchoring the type of an externalized role to a team instance
+ requires the team to be referenced by a variable which
+ is marked <code>final</code> (i.e., immutable).
+ The type anchor can be a path <code>v.f1.f2...</code> where
+ <code>v</code> is any final variable and <code>f1</code> ...
+ are final fields.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.2.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Implicit type anchors</span></h4>
+ <p>The current team instance can be used as a default anchor
+ for role types:
+
+ </p>
+ <ol>
+ <li>In non-static team level methods role types are by default interpreted as anchored to <code>this</code> (referring to the team instance). I.e., the following two declarations express the same:
+
+ <div class="listing plain"><pre><b>public</b> RoleX getRoleX (RoleY r) { <i> stmts </i> }
+<b>public</b> RoleX&lt;@<em>this</em>&gt; getRoleX (RoleY&lt;@<em>this</em>&gt; r) { <i> stmts </i> }</pre></div>
+ </li>
+ <li>
+ In analogy, <em>role methods</em> use the enclosing team instance as the
+ default anchor for any role types.
+ </li>
+ </ol>
+ <p>Note, that <code>this</code> and <code><em>Outer</em>.this</code> are always
+ <code>final</code>.<br />
+ The compiler uses the pseudo identifier <strong><code>tthis</code></strong> to denote
+ such implicit type anchors in error messages.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.2.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Conformance</span></h4>
+ <p>Conformance between
+ two types <code>RoleX&lt;@teamA&gt;</code> and <code>RoleY&lt;@teamB&gt;</code>
+ not only requires the role types to be compatible, but also
+ the team instances to be provably <em>the same object</em>.
+ The compiler must be able to statically analyze anchor identity.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.2.f">
+ <h4 class="subsect">(f)&nbsp;<span class="title">Substitutions for type anchors</span></h4>
+ <p>Only two substitutions are considered for determining
+ team identity:
+
+ </p>
+ <ol>
+ <li>
+ For type checking the application of team methods,
+ <code>this</code> is <strong>substituted</strong> by the actual call target.
+ For role methods a reference of the form <code><em>Outer</em>.this</code>
+ is substituted by the enclosing instance of the call target.
+
+ </li>
+ <li>Assignments from a <code>final</code> identifier
+ to another <code>final</code> identifier are transitively
+ followed, i.e., if <code>t1, t2</code> are final,
+ after an assignment <code>t1=t2</code>
+ the types <code>R&lt;@t1&gt;</code> and <code>R&lt;@t2&gt;</code> are considered
+ identical. Otherwise <code>R&lt;@t1&gt;</code> and <code>R&lt;@t2&gt;</code>
+ are incommensurable.<br />
+ Attaching an actual parameter to a formal parameter in a
+ method call is also considered as an assignment with respect to
+ this rule.
+
+ </li>
+ </ol>
+ </div>
+ <div class="subsect depth4" id="s1.2.2.g">
+ <h4 class="subsect">(g)&nbsp;<span class="title">Legal contexts</span></h4>
+ <p>Anchored types for externalized roles may be used in the
+ following contexts:
+
+ </p>
+ <ol>
+ <li>Declaration of an attribute</li>
+ <li>Declaration of a local variable</li>
+ <li>Declaration of a parameter or result type
+ of a method or constructor
+ </li>
+ <li>In the <code>playedBy</code> clause of a role class
+ (see <a href="s2.1.html" title="&sect;2.1&nbsp;playedBy relation" class="sect">&sect;2.1</a>).
+ </li>
+ </ol>
+ <p>It is not legal to inherit from an anchored type, since
+ this would require membership of the referenced team instance,
+ which can only be achieved by class nesting.
+
+ </p>
+ <div class="note">
+ <h5>Note:</h5>
+ Item 4.
+ &mdash; within the given restriction &mdash; admits the case where
+ the same class is a role of one team and the base class for
+ the role of another team. Another form of nesting is
+ defined in <a href="s1.5.html" title="&sect;1.5&nbsp;Team and role nesting" class="sect">&sect;1.5</a>.
+
+ </div>
+ </div>
+ <div class="subsect depth4" id="s1.2.2.h">
+ <h4 class="subsect">(h)&nbsp;<span class="title">Externalized creation</span></h4>
+ <p>A role can be created as externalized using either of these equivalent forms:</p>
+ <div class="listing plain"><pre>outer.<b>new</b> Role()
+<b>new</b> Role&lt;@outer&gt;()</pre></div>
+ <p>This requires the enclosing instance <code>outer</code> to be
+ declared <code>final</code>. The expression has the
+ type <code>Role&lt;@outer&gt;</code> following the rules of
+ externalized roles.<br />
+ The type <code>Role</code> in this expression must be a simple
+ (unqualified) name.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.2.i">
+ <h4 class="subsect">(i)&nbsp;<span class="title">No import</span></h4>
+ <p>It is neither useful nor legal to import a role type.<br /></p>
+ <div class="note">
+ <h5>Rationale:</h5>
+ Importing a type allows to use the unqualified name in situations that would otherwise require to use the fully qualified
+ name,
+ i.e., the type prefixed with its containing package and enclosing class. Roles, however are contained in a team <i>instance</i>.
+ Outside their team, role types can only be accessed using an anchored type which uses a team instance to qualify the
+ role type.
+ Relative to this team anchor, roles are <i>always</i> denoted using their simple name, which makes importing roles useless.
+
+ </div>
+ <p>A static import for a constant declared in a role is, however, legal.
+
+ </p>
+ </div>
+ <h5 class="listing">Example code (Externalized Roles):</h5>
+ <div class="listing example frame" id="l1.2.2-1">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>team</b> <b>class</b> FlightBonus <b>extends</b> Bonus {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>public</b> <b>class</b> Subscriber {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>void</b> clearCredits() { ... }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> <b>void</b> unsubscribe(Subscriber subscr) { ... }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="listing example frame" id="l1.2.2-2">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre><b>class</b> ClearAction <b>extends</b> Action {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre> <em>final</em> FlightBonus context;</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre> <em>Subscriber&lt;@context&gt;</em> subscriber;</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">10</td>
+ <td><pre> ClearAction (<em>final</em> FlightBonus bonus, <em>Subscriber&lt;@bonus&gt;</em> subscr) {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">11</td>
+ <td><pre> context = bonus; <span class="comment">// unique assignment to 'context'</span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">12</td>
+ <td><pre> subscriber = subscr;</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">13</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">14</td>
+ <td><pre> <b>void</b> actionPerformed () {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">15</td>
+ <td><pre> subscriber.clearCredits();</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">16</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">17</td>
+ <td><pre> <b>protected</b> <b>void</b> finalize () {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">18</td>
+ <td><pre> context.unsubscribe(subscriber);</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">19</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">20</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="codecomment">
+ <h5>Effects:</h5>
+ <ul>
+ <li>Lines 1-6 show a terse extract of a published example
+ <a href="http://www.objectteams.org/publications/index.html#NODe02" class="ext">[NODe02]</a>. Here passengers can be subscribers in a flight bonus program.
+ </li>
+ <li>Lines 7-20 show a sub-class of <code>Action</code> which is
+ used to associate the action of resetting a subscriber's credits
+ to a button or similar element in an application's GUI.
+ </li>
+ <li>Attribute <code>context</code> (line 8) and parameter
+ <code>bonus</code> (line 10) serve as anchor for the type of
+ externalized roles.
+ </li>
+ <li>Attribute <code>subscriber</code> (line 9) and parameter
+ <code>subscr</code> (line 10) store a Subscriber role outside the
+ FlightBonus team.
+ </li>
+ <li>In order to type-check the assignment in line 12, the compiler
+ has to ensure that the types of LHS and RHS are anchored to
+ the same team instance. This can be verified by checking that
+ both anchors are indeed <code>final</code> and prior to the
+ role assignment a team assignment has taken place (line 11).<br /><span class="underline">Note,</span> that the Java rules for <strong>definite assignments</strong> to
+ final variables ensure that exactly one assignment to a variable occurs
+ prior to its use as type anchor. No further checks are needed.
+
+ </li>
+ <li>It is now legal to store this role reference and use it at
+ some later point in time, e.g., for invoking method
+ <code>clearCredits</code> (line 15).
+ This method call is also an example for implicit team activation
+ (<a href="s5.3.b.html" title="&sect;5.3.(b)&nbsp;Methods of externalized roles"
+ class="sect">&sect;5.3.(b)</a>).
+
+ </li>
+ <li>Line 18 demonstrates how an externalized role can be
+ passed to a team level method. The signature of <code>unsubscribe</code>
+ is for this call expanded to
+ <div class="indent">
+ void unsubscribe(Subscriber&lt;@context&gt; subscr)
+
+ </div>
+ (by substituting the call target <code>context</code> for
+ <code>this</code>). This proves identical types for actual and
+ formal parameters.
+ </li>
+ </ul>
+ </div>
+ </div>
+ <div class="sect depth3" id="s1.2.3">
+ <h3 class="sect">&sect;1.2.3&nbsp;Protected roles<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;1.2</a></span></h3>
+ <p>Roles can only be <code>public</code> or <code>protected</code>.
+ A <code>protected</code> role is encapsulated
+ by its enclosing team instance. This is enforced by these rules:
+
+ </p>
+ <div class="subsect depth4" id="s1.2.3.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Importing role classes</span></h4>
+ <p><i>This rule is superseded by <a href="#s1.2.2.i" title="&sect;1.2.2.(i)&nbsp;No import" class="sect">&sect;1.2.2.(i)</a></i></p>
+ </div>
+ <div class="subsect depth4" id="s1.2.3.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Qualified role types</span></h4>
+ <p>The name of a <code>protected</code> role class may never be used qualified, neither
+ prefixed by its <em>enclosing type</em> nor parameterized by a <em>variable as type anchor</em> (cf. <a href="#s1.2.2.a" title="&sect;1.2.2.(a)&nbsp;Visibility" class="sect">&sect;1.2.2.(a)</a>).
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.3.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Mixing qualified and unqualified types</span></h4>
+ <p>An externalized role type is never compatible to an unqualified role type,
+ except for the substitutions in <a href="#s1.2.2.f"
+ title="&sect;1.2.2.(f)&nbsp;Substitutions for type anchors"
+ class="sect">&sect;1.2.2.(f)</a>, where
+ an explicit anchor can be matched with the implicit anchor <code>this</code>.
+
+ </p>
+ </div>
+ <p>Rules (a) and (b) ensure that the name of a protected role class cannot be used
+ outside the lexical scope of its enclosing team. Rule (c) ensures that team methods
+ containing unqualified role types in their signature cannot be invoked on a team other
+ than the current team. Accordingly, for role methods the team context must be the
+ enclosing team instance.
+
+ </p>
+ <div class="subsect depth4" id="s1.2.3.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Levels of encapsulation</span></h4>
+ <p>Since protected role types can not be used for externalization, instances of these types are already quite effectively encapsulated
+ by their enclosing team.
+ Based on this concept, encapsulation for protected roles can be made even stricter by the rules of <em>role confinement</em>.
+ On the contrary, even protected roles can be externalized as <em>opaque roles</em> which still expose (almost) no information.
+ Confinement and opaque roles are subject of <a href="s7.html" title="&sect;7&nbsp;Role Encapsulation" class="sect">&sect;7</a>.
+
+ </p>
+ </div>
+ </div>
+ <div class="sect depth3" id="s1.2.4">
+ <h3 class="sect">&sect;1.2.4&nbsp;Type tests and casts<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;1.2</a></span></h3>
+ <p>In accordance with <a href="#s1.2.2.e" title="&sect;1.2.2.(e)&nbsp;Conformance" class="sect">&sect;1.2.2.(e)</a>, in OT/J
+ the <code>instanceof</code> operator and type casts have extended semantics for roles.
+
+ </p>
+ <div class="subsect depth4" id="s1.2.4.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">instanceof</span></h4>
+ <p>For role types the <code>instanceof</code> operator yields true only if
+ both components of the type match: the dynamic role type must be compatible
+ to the given static type, and also type anchors must be the same instance.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.4.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Casting</span></h4>
+ <p>Casts may also fail if the casted expression is anchored to a different
+ team instance than the cast type. Such failure is signaled by a
+ <code>org.objectteams.RoleCastException</code>.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.4.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Class literal</span></h4>
+ <p>A class literal of form <code>R.class</code> is dynamically bound to the class <code>R</code>
+ visible in the current instance context. Using a class literal for a role outside its
+ enclosing team instance (see <a href="#s1.2.2" title="&sect;1.2.2&nbsp;Externalized roles" class="sect">&sect;1.2.2</a>) requires the following syntax:
+
+ </p>
+ <div class="listing plain"><pre>RoleClass<em>&lt;@teamAnchor&gt;</em><strong>.class</strong></pre></div>
+ </div>
+ </div>
+ <div class="sect depth3" id="s1.2.5">
+ <h3 class="sect">&sect;1.2.5&nbsp;File structure<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;1.2</a></span></h3>
+ <p>Just like regular inner classes, role classes may be inlined in the
+ source code of the enclosing team. As an alternative style it is possible
+ to store role classes in separate <strong>role files</strong> according to the following rules:
+
+ </p>
+ <div class="subsect depth4" id="s1.2.5.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Role directory</span></h4>
+ <p>In the directory of the team class a new directory is created
+ which has the same name as the team without the <tt>.java</tt> suffix.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.5.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Role files</span></h4>
+ <p>Role classes are stored in this directory (a). The file names are
+ derived from the role class name extended by <tt>.java</tt>.<br />
+ A role file must contain exactly one top-level type.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.5.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">package statement</span></h4>
+ <p>A role class in a role file declares as its package the fully qualified
+ name of the enclosing team class. The package statement of a role file
+ must use the <code>team</code> modifier as its first token.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.5.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Reference to role file</span></h4>
+ <p>A team should mention in its javadoc comment each role class which
+ is stored externally using a <tt>@role</tt> tag.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.5.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Legal types in role files</span></h4>
+ <p>The type in a role file must not be an <code>enum</code>.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.5.f">
+ <h4 class="subsect">(f)&nbsp;<span class="title">Imports in role files</span></h4>
+ <p>A role file may have imports of its own.
+ Within the role definition these imports are visible <em>in addition</em> to all imports of the enclosing team.
+ Only <code>base</code> imports (see <a href="s2.1.2.d.html" title="&sect;2.1.2.(d)&nbsp;Base imports" class="sect">&sect;2.1.2.(d)</a>)
+ <em>must</em> be defined in the team.
+ </p>
+ </div>
+ <p>Semantically, there is no difference between inlined role classes and those
+ stored in separate role files.
+
+ </p>
+ <div class="note">
+ <h5>Note:</h5>
+ Current Java compilers disallow a type to have the same fully qualified
+ name as a package. However, the JLS does not seem to make a statement in this respect.
+ In OT/J, a package and a type are interpreted as being the same team, if both have the
+ same fully qualified name and both have the <code>team</code> modifier.
+
+ </div>
+ <h5 class="listing">Role file example:</h5>
+ <div class="listing example frame" id="l1.2.5-1">
+ <table class="listing">
+ <tr class="lhead">
+ <td colspan="2">in file <code>org/objectteams/examples/MyTeamA.java</code> :
+ </td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>package</b> org.objectteams.examples;</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre><span class="comment">/**</span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <span class="comment">* @author Stephan Herrmann</span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <span class="comment">* @date 20.02.2007</span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> <span class="comment">* @file MyTeamA.java</span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> <span class="comment">* <em>@role MyRole</em></span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> <span class="comment">*/</span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> MyTeamA {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre> ...</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">10</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="listing example frame" id="l1.2.5-2">
+ <table class="listing">
+ <tr class="lhead">
+ <td colspan="2">in file <code>org/objectteams/examples<strong class="blue">/MyTeamA/MyRole.java</strong></code>:
+ </td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><em><b>team</b> <b>package</b> org.objectteams.examples.MyTeamA;</em></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre><b>public</b> <b>class</b> MyRole {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> ...</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s1.1.html" rel="prev">&lt;&lt;&nbsp;&sect;1.1&nbsp;Team classes</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.3.html" rel="next">&sect;1.3&nbsp;Acquisition and implicit inheritance of role classes&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.1.a.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.1.a.html
new file mode 100644
index 000000000..c6919e62b
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.1.a.html
@@ -0,0 +1,55 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.3.1.b.html" rel="next">&sect;1.3.1.(b)&nbsp;Direct role acquisition&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.3.html" rel="section">&sect;1.3&nbsp;Acquisition and implicit inheritance of role classes</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.3.1.html" rel="section">&sect;1.3.1&nbsp;Acquisition and implicit inheritance of role classes</a></div>
+ <div class="subsect depth4" id="s1.3.1.a">
+ <h4 class="subsect">&sect;1.3.1.(a)&nbsp;<span class="title">Role class acquisition</span></h4>
+ <p>A team <code>T</code> which extends a super-team <code>S</code>
+ has one role class <code>T.R</code> corresponding to each role <code>S.R</code>
+ of the super-team.
+ The new type <code>T.R</code>&nbsp;<strong>overrides</strong>&nbsp;<code>R</code> for the
+ context of <code>T</code> and its roles.
+ Acquisition of role classes can either be direct (see (b) below), or
+ it may involve overriding and implicit inheritance ((c) below).
+
+ </p>
+ <div class="codecomment">In the above example (<a href="s1.html#l1.3.1-1" class="listing">Listing 1.3.1-1</a>) the team <code>S</code> operates
+ on types <code>S.R0</code>, <code>S.R1</code> and <code>S.R2</code>,
+ while <code>T</code> operates on types <code>T.R0</code>, <code>T.R1</code>
+ and <code>T.R2</code>.<br /><em>(Type references like "<code>S.R0</code>" are actually illegal in source code
+ (<a href="s1.2.3.b.html" title="&sect;1.2.3.(b)&nbsp;Qualified role types"
+ class="sect">&sect;1.2.3.(b)</a>). Here they are used for explanatory purposes only)</em></div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.3.1.b.html" rel="next">&sect;1.3.1.(b)&nbsp;Direct role acquisition&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.3.html" rel="section">&sect;1.3&nbsp;Acquisition and implicit inheritance of role classes</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.3.1.html" rel="section">&sect;1.3.1&nbsp;Acquisition and implicit inheritance of role classes</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.1.b.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.1.b.html
new file mode 100644
index 000000000..d32222a72
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.1.b.html
@@ -0,0 +1,49 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s1.3.1.a.html" rel="prev">&lt;&lt;&nbsp;&sect;1.3.1.(a)&nbsp;Role class acquisition</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.3.1.c.html" rel="next">&sect;1.3.1.(c)&nbsp;Overriding and implicit inheritance&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.3.html" rel="section">&sect;1.3&nbsp;Acquisition and implicit inheritance of role classes</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.3.1.html" rel="section">&sect;1.3.1&nbsp;Acquisition and implicit inheritance of role classes</a></div>
+ <div class="subsect depth4" id="s1.3.1.b">
+ <h4 class="subsect">&sect;1.3.1.(b)&nbsp;<span class="title">Direct role acquisition</span></h4>
+ <p>Within a sub-team <code>T</code> each role <code>S.R</code> of its
+ super-team <code>S</code> is available by the simple name <code>R</code>
+ without further declaration.
+
+ </p>
+ <div class="codecomment">The role <code>R2</code> in <a href="s1.html#l1.3.1-1" class="listing">Listing 1.3.1-1</a> can be used in the sub-team
+ <code>T</code> (line 12), because this role type is defined in the super class of the enclosing team.
+
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s1.3.1.a.html" rel="prev">&lt;&lt;&nbsp;&sect;1.3.1.(a)&nbsp;Role class acquisition</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.3.1.c.html" rel="next">&sect;1.3.1.(c)&nbsp;Overriding and implicit inheritance&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.3.html" rel="section">&sect;1.3&nbsp;Acquisition and implicit inheritance of role classes</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.3.1.html" rel="section">&sect;1.3.1&nbsp;Acquisition and implicit inheritance of role classes</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.1.c.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.1.c.html
new file mode 100644
index 000000000..ad05fe84e
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.1.c.html
@@ -0,0 +1,68 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s1.3.1.b.html" rel="prev">&lt;&lt;&nbsp;&sect;1.3.1.(b)&nbsp;Direct role acquisition</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.3.1.d.html" rel="next">&sect;1.3.1.(d)&nbsp;Lack of subtyping&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.3.html" rel="section">&sect;1.3&nbsp;Acquisition and implicit inheritance of role classes</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.3.1.html" rel="section">&sect;1.3.1&nbsp;Acquisition and implicit inheritance of role classes</a></div>
+ <div class="subsect depth4" id="s1.3.1.c">
+ <h4 class="subsect">&sect;1.3.1.(c)&nbsp;<span class="title">Overriding and implicit inheritance</span></h4>
+ <p>If a team contains a role class definition by the same name as
+ a role defined in its super-team,
+ the new role class overrides the corresponding role from the super-team
+ and <strong>implicitly inherits</strong> all of its features.
+ Such relation is established only by name correspondence.
+
+ </p>
+ <p>A role that overrides an inherited role should be marked with an <code>@Override</code> annotation.
+ A compiler should optionally flag a missing <code>@Override</code> annotation with a warning.
+ Conversely, it is an error if a role is marked with an <code>@Override</code> annotation but does not actually
+ override an inherited role.
+
+ </p>
+ <p>It is an error to override a role class with an interface or vice versa. A final role cannot be overridden.<br />
+ Unlike regular inheritance, <strong>constructors</strong> are also inherited
+ along implicit inheritance, and can be overridden just like normal methods.
+
+ </p>
+ <div class="codecomment">
+ In <a href="s1.html#l1.3.1-1" class="listing">Listing 1.3.1-1</a><code> R1</code> in <code>T</code> implicitly inherits all features of
+ <code>R1</code> in <code>S</code>. This is, because its enclosing team
+ <code>T</code> extends the team <code>S</code> (line 10) and the role
+ definition uses the same name <code>R1</code> (line 11).
+ Hence the attribute <code><strong>ok</strong></code> is available in the method
+ <code>m()</code> in <code>T.R1</code> (line 13). <code>T.R1</code> also overrides <code>S.R1</code>
+ which is marked by the <code>@Override</code> annotation in line 11.
+
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s1.3.1.b.html" rel="prev">&lt;&lt;&nbsp;&sect;1.3.1.(b)&nbsp;Direct role acquisition</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.3.1.d.html" rel="next">&sect;1.3.1.(d)&nbsp;Lack of subtyping&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.3.html" rel="section">&sect;1.3&nbsp;Acquisition and implicit inheritance of role classes</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.3.1.html" rel="section">&sect;1.3.1&nbsp;Acquisition and implicit inheritance of role classes</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.1.d.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.1.d.html
new file mode 100644
index 000000000..8c8d056ae
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.1.d.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s1.3.1.c.html" rel="prev">&lt;&lt;&nbsp;&sect;1.3.1.(c)&nbsp;Overriding and implicit inheritance</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.3.1.e.html" rel="next">&sect;1.3.1.(e)&nbsp;Dynamic binding of types&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.3.html" rel="section">&sect;1.3&nbsp;Acquisition and implicit inheritance of role classes</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.3.1.html" rel="section">&sect;1.3.1&nbsp;Acquisition and implicit inheritance of role classes</a></div>
+ <div class="subsect depth4" id="s1.3.1.d">
+ <h4 class="subsect">&sect;1.3.1.(d)&nbsp;<span class="title">Lack of subtyping</span></h4>
+ <p>Direct acquisition of roles from a super-team and implicit inheritance
+ do not establish a <strong>subtype</strong> relation.
+ A role of a given team is never conform (i.e., substitutable)
+ to any role of any <em>other</em> team.
+ <code>S.R</code> and <code>T.R</code> are always incommensurable.<br /><span class="underline">Note,</span> that this rule is a direct consequence of <a href="s1.2.2.e.html" title="&sect;1.2.2.(e)&nbsp;Conformance" class="sect">&sect;1.2.2.(e)</a>.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s1.3.1.c.html" rel="prev">&lt;&lt;&nbsp;&sect;1.3.1.(c)&nbsp;Overriding and implicit inheritance</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.3.1.e.html" rel="next">&sect;1.3.1.(e)&nbsp;Dynamic binding of types&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.3.html" rel="section">&sect;1.3&nbsp;Acquisition and implicit inheritance of role classes</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.3.1.html" rel="section">&sect;1.3.1&nbsp;Acquisition and implicit inheritance of role classes</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.1.e.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.1.e.html
new file mode 100644
index 000000000..92aa35486
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.1.e.html
@@ -0,0 +1,72 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s1.3.1.d.html" rel="prev">&lt;&lt;&nbsp;&sect;1.3.1.(d)&nbsp;Lack of subtyping</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.3.1.f.html" rel="next">&sect;1.3.1.(f)&nbsp;tsuper&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.3.html" rel="section">&sect;1.3&nbsp;Acquisition and implicit inheritance of role classes</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.3.1.html" rel="section">&sect;1.3.1&nbsp;Acquisition and implicit inheritance of role classes</a></div>
+ <div class="subsect depth4" id="s1.3.1.e">
+ <h4 class="subsect">&sect;1.3.1.(e)&nbsp;<span class="title">Dynamic binding of types</span></h4>
+ <p>Overriding an acquired role by a new role class has the following
+ implication: If an expression or declaration, which is evaluated on behalf of
+ an instance of team <code>T</code> or one of its contained roles,
+ refers to a role <code>R</code>, <code>R</code> will always
+ resolve to <code>T.R</code> even if <code>R</code> was introduced in
+ a super-team of <code>T</code> and even if the specific line of code
+ was inherited from a super-team or one of its roles.
+ Only the dynamic type of the enclosing team-instance is used to determine
+ the correct role class (see below for an example).
+
+ </p>
+ <p>A special case of dynamically binding role types relates to so-called class literals
+ (see <a href="http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#251530"
+ class="ext">JLS &sect;15.8.2</a>).
+ Role class literals are covered in <a href="s6.1.c.html" title="&sect;6.1.(c)&nbsp;Class literals for roles"
+ class="sect">&sect;6.1.(c)</a>.
+
+ </p>
+ <p>The above is strictly needed only for cases involving implicit inheritance.
+ It may, however, help intuition, to also consider the directly acquired
+ role <code>T.R</code> in (b) to override the given role <code>S.R</code>.
+
+ </p>
+ <div class="codecomment">
+ In line 17 of <a href="s1.html#l1.3.1-1" class="listing">Listing 1.3.1-1</a> the implicitly inherited method <code>n</code> is called
+ with the result of an invocation of <code>m</code>. Although
+ <code>n</code> was defined in <code>S</code> (thus with argument type
+ <code>S.R2, see line 6</code>) in the context of <code>T</code> it
+ expects an argument of <code>T.R2</code>. This is correctly provided by
+ the invocation of <code>m</code> in the context of <code>T</code>.
+
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s1.3.1.d.html" rel="prev">&lt;&lt;&nbsp;&sect;1.3.1.(d)&nbsp;Lack of subtyping</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.3.1.f.html" rel="next">&sect;1.3.1.(f)&nbsp;tsuper&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.3.html" rel="section">&sect;1.3&nbsp;Acquisition and implicit inheritance of role classes</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.3.1.html" rel="section">&sect;1.3.1&nbsp;Acquisition and implicit inheritance of role classes</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.1.f.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.1.f.html
new file mode 100644
index 000000000..9faf55f69
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.1.f.html
@@ -0,0 +1,69 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s1.3.1.e.html" rel="prev">&lt;&lt;&nbsp;&sect;1.3.1.(e)&nbsp;Dynamic binding of types</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.3.1.g.html" rel="next">&sect;1.3.1.(g)&nbsp;Implicitly inheriting super-types&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.3.html" rel="section">&sect;1.3&nbsp;Acquisition and implicit inheritance of role classes</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.3.1.html" rel="section">&sect;1.3.1&nbsp;Acquisition and implicit inheritance of role classes</a></div>
+ <div class="subsect depth4" id="s1.3.1.f">
+ <h4 class="subsect">&sect;1.3.1.(f)&nbsp;<span class="title">tsuper</span></h4>
+ <div class="syntaxlink"><a href="sA.html#sA.5.4" title="&sect;A.5.4&nbsp;TSuperCall" class="syntax">&rarr;&nbsp;Syntax&nbsp;&sect;A.5.4</a></div>
+ <p>Super calls along implicit inheritance use the new keyword
+ <strong>tsuper</strong>. While <code>super</code> is still available
+ along regular inheritance, a call <code>tsuper.m()</code>
+ selects the version of <code>m</code> of the corresponding role
+ acquired from the super-team.
+
+ </p>
+ <p>See <a href="s2.4.2.html"
+ title="&sect;2.4.2&nbsp;Role creation via a regular constructor"
+ class="sect">&sect;2.4.2</a> for <code>tsuper</code>
+ in the context of role constructors.
+
+ </p>
+ <p><code>tsuper</code> can only be used to invoke a corresponding
+ version of the enclosing method or constructor, i.e., an expression
+ <code>tsuper.m()</code> may only occur within the method <code>m</code>
+ with both methods having the same signature
+ (see <a href="s2.3.2.b.html"
+ title="&sect;2.3.2.(b)&nbsp;Super in the context of declared lifting"
+ class="sect">&sect;2.3.2.(b)</a> for an exception, where both methods have slightly different signatures).
+
+ </p>
+ <div class="codecomment">
+ In <a href="s1.html#l1.3.1-1" class="listing">Listing 1.3.1-1</a> the role <code>R1</code> in team <code>T</code>
+ overrides the implicitly inherited method <code>m()</code> from <code>S</code>. <code><strong>tsuper</strong>.m()</code> calls the overridden method <code>m()</code>
+ from <code>S.R1</code> (line 13).
+
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s1.3.1.e.html" rel="prev">&lt;&lt;&nbsp;&sect;1.3.1.(e)&nbsp;Dynamic binding of types</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.3.1.g.html" rel="next">&sect;1.3.1.(g)&nbsp;Implicitly inheriting super-types&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.3.html" rel="section">&sect;1.3&nbsp;Acquisition and implicit inheritance of role classes</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.3.1.html" rel="section">&sect;1.3.1&nbsp;Acquisition and implicit inheritance of role classes</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.1.g.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.1.g.html
new file mode 100644
index 000000000..47efcf162
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.1.g.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s1.3.1.f.html" rel="prev">&lt;&lt;&nbsp;&sect;1.3.1.(f)&nbsp;tsuper</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.3.1.h.html" rel="next">&sect;1.3.1.(h)&nbsp;Preserving visibility&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.3.html" rel="section">&sect;1.3&nbsp;Acquisition and implicit inheritance of role classes</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.3.1.html" rel="section">&sect;1.3.1&nbsp;Acquisition and implicit inheritance of role classes</a></div>
+ <div class="subsect depth4" id="s1.3.1.g">
+ <h4 class="subsect">&sect;1.3.1.(g)&nbsp;<span class="title">Implicitly inheriting super-types</span></h4>
+ <p>If a role class has an explicit super class (using <code>extends</code>)
+ this relation is inherited along implicit inheritance.
+
+ </p>
+ <div class="codecomment">
+ In <a href="s1.html#l1.3.1-1" class="listing">Listing 1.3.1-1</a> the role <code>R1</code> in <code>T</code> has <code>T.R0</code>
+ as its implicitly inherited super class, because the corresponding role in the super-team
+ <code><strong>extends R0</strong></code> (line 3).
+
+ </div>
+ <p>Overriding an implicitly inherited super class is governed by
+ <a href="s1.3.2.b.html"
+ title="&sect;1.3.2.(b)&nbsp;Inheriting and overriding the extends clause"
+ class="sect">&sect;1.3.2.(b)</a>, below.<br />
+ The list of implemented interfaces is merged along implicit
+ inheritance.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s1.3.1.f.html" rel="prev">&lt;&lt;&nbsp;&sect;1.3.1.(f)&nbsp;tsuper</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.3.1.h.html" rel="next">&sect;1.3.1.(h)&nbsp;Preserving visibility&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.3.html" rel="section">&sect;1.3&nbsp;Acquisition and implicit inheritance of role classes</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.3.1.html" rel="section">&sect;1.3.1&nbsp;Acquisition and implicit inheritance of role classes</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.1.h.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.1.h.html
new file mode 100644
index 000000000..509526b20
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.1.h.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s1.3.1.g.html" rel="prev">&lt;&lt;&nbsp;&sect;1.3.1.(g)&nbsp;Implicitly inheriting super-types</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.3.1.i.html" rel="next">&sect;1.3.1.(i)&nbsp;Dynamic binding of constructors&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.3.html" rel="section">&sect;1.3&nbsp;Acquisition and implicit inheritance of role classes</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.3.1.html" rel="section">&sect;1.3.1&nbsp;Acquisition and implicit inheritance of role classes</a></div>
+ <div class="subsect depth4" id="s1.3.1.h">
+ <h4 class="subsect">&sect;1.3.1.(h)&nbsp;<span class="title">Preserving visibility</span></h4>
+ <p>A role class must provide at least as much access as the implicit super role,
+ or a compile-time error occurs (this is in analogy to <a href="http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#227965"
+ class="ext">JLS &sect;8.4.6.3</a>).
+ Access rights of methods overridden by implicit inheritance follow
+ the same rules as for normal overriding.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s1.3.1.g.html" rel="prev">&lt;&lt;&nbsp;&sect;1.3.1.(g)&nbsp;Implicitly inheriting super-types</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.3.1.i.html" rel="next">&sect;1.3.1.(i)&nbsp;Dynamic binding of constructors&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.3.html" rel="section">&sect;1.3&nbsp;Acquisition and implicit inheritance of role classes</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.3.1.html" rel="section">&sect;1.3.1&nbsp;Acquisition and implicit inheritance of role classes</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.1.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.1.html
new file mode 100644
index 000000000..7b1a1f770
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.1.html
@@ -0,0 +1,512 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.3.2.html" rel="next">&sect;1.3.2&nbsp;Regular role inheritance&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.3.html" rel="section">&sect;1.3&nbsp;Acquisition and implicit inheritance of role classes</a></div>
+ <div class="sect depth3" id="s1.3.1">
+ <h3 class="sect">&sect;1.3.1&nbsp;Acquisition and implicit inheritance of role classes</h3>
+ <p>A team acquires all roles from its super-team. This relation is
+ similar to inheritance of inner classes, but with a few decisive
+ differences as defined next. Two implementation options are mentioned <a href="s1.html#aux1.1" class="int">below</a>,
+ which can be used to realize the special semantics of role
+ acquisition (virtual classes and copy inheritance).
+
+ </p>
+ <h5 class="listing">Implicit role inheritance</h5>
+ <div class="listing example frame" id="l1.3.1-1">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> S {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>protected</b> <b>class</b> R0 {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>protected</b> <b>class</b> R1 <em><b>extends</b> R0</em> {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <b>boolean</b> ok;</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> R2 m() {...}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> <b>void</b> n(<em>R2</em> r) {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre> <b>protected</b> <b>class</b> R2 {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="listing example frame" id="l1.3.1-2">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">10</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> T <em><b>extends</b> S</em> {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">11</td>
+ <td><pre> @Override <b>protected</b> <em><b>class</b> R1</em> {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">12</td>
+ <td><pre> <strong>R2</strong> m() {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">13</td>
+ <td><pre> if(<em>ok</em>) { <b>return</b> <em>tsuper</em>.m(); }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">14</td>
+ <td><pre> <b>else</b> { <b>return</b> null; }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">15</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">16</td>
+ <td><pre> <b>void</b> doIt() {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">17</td>
+ <td><pre> n(m());</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">18</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">19</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">20</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="subsect depth4" id="s1.3.1.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Role class acquisition</span></h4>
+ <p>A team <code>T</code> which extends a super-team <code>S</code>
+ has one role class <code>T.R</code> corresponding to each role <code>S.R</code>
+ of the super-team.
+ The new type <code>T.R</code>&nbsp;<strong>overrides</strong>&nbsp;<code>R</code> for the
+ context of <code>T</code> and its roles.
+ Acquisition of role classes can either be direct (see (b) below), or
+ it may involve overriding and implicit inheritance ((c) below).
+
+ </p>
+ <div class="codecomment">In the above example (<a href="#l1.3.1-1" class="listing">Listing 1.3.1-1</a>) the team <code>S</code> operates
+ on types <code>S.R0</code>, <code>S.R1</code> and <code>S.R2</code>,
+ while <code>T</code> operates on types <code>T.R0</code>, <code>T.R1</code>
+ and <code>T.R2</code>.<br /><em>(Type references like "<code>S.R0</code>" are actually illegal in source code
+ (<a href="s1.2.3.b.html" title="&sect;1.2.3.(b)&nbsp;Qualified role types"
+ class="sect">&sect;1.2.3.(b)</a>). Here they are used for explanatory purposes only)</em></div>
+ </div>
+ <div class="subsect depth4" id="s1.3.1.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Direct role acquisition</span></h4>
+ <p>Within a sub-team <code>T</code> each role <code>S.R</code> of its
+ super-team <code>S</code> is available by the simple name <code>R</code>
+ without further declaration.
+
+ </p>
+ <div class="codecomment">The role <code>R2</code> in <a href="#l1.3.1-1" class="listing">Listing 1.3.1-1</a> can be used in the sub-team
+ <code>T</code> (line 12), because this role type is defined in the super class of the enclosing team.
+
+ </div>
+ </div>
+ <div class="subsect depth4" id="s1.3.1.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Overriding and implicit inheritance</span></h4>
+ <p>If a team contains a role class definition by the same name as
+ a role defined in its super-team,
+ the new role class overrides the corresponding role from the super-team
+ and <strong>implicitly inherits</strong> all of its features.
+ Such relation is established only by name correspondence.
+
+ </p>
+ <p>A role that overrides an inherited role should be marked with an <code>@Override</code> annotation.
+ A compiler should optionally flag a missing <code>@Override</code> annotation with a warning.
+ Conversely, it is an error if a role is marked with an <code>@Override</code> annotation but does not actually
+ override an inherited role.
+
+ </p>
+ <p>It is an error to override a role class with an interface or vice versa. A final role cannot be overridden.<br />
+ Unlike regular inheritance, <strong>constructors</strong> are also inherited
+ along implicit inheritance, and can be overridden just like normal methods.
+
+ </p>
+ <div class="codecomment">
+ In <a href="#l1.3.1-1" class="listing">Listing 1.3.1-1</a><code> R1</code> in <code>T</code> implicitly inherits all features of
+ <code>R1</code> in <code>S</code>. This is, because its enclosing team
+ <code>T</code> extends the team <code>S</code> (line 10) and the role
+ definition uses the same name <code>R1</code> (line 11).
+ Hence the attribute <code><strong>ok</strong></code> is available in the method
+ <code>m()</code> in <code>T.R1</code> (line 13). <code>T.R1</code> also overrides <code>S.R1</code>
+ which is marked by the <code>@Override</code> annotation in line 11.
+
+ </div>
+ </div>
+ <div class="subsect depth4" id="s1.3.1.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Lack of subtyping</span></h4>
+ <p>Direct acquisition of roles from a super-team and implicit inheritance
+ do not establish a <strong>subtype</strong> relation.
+ A role of a given team is never conform (i.e., substitutable)
+ to any role of any <em>other</em> team.
+ <code>S.R</code> and <code>T.R</code> are always incommensurable.<br /><span class="underline">Note,</span> that this rule is a direct consequence of <a href="s1.2.2.e.html" title="&sect;1.2.2.(e)&nbsp;Conformance" class="sect">&sect;1.2.2.(e)</a>.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.3.1.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Dynamic binding of types</span></h4>
+ <p>Overriding an acquired role by a new role class has the following
+ implication: If an expression or declaration, which is evaluated on behalf of
+ an instance of team <code>T</code> or one of its contained roles,
+ refers to a role <code>R</code>, <code>R</code> will always
+ resolve to <code>T.R</code> even if <code>R</code> was introduced in
+ a super-team of <code>T</code> and even if the specific line of code
+ was inherited from a super-team or one of its roles.
+ Only the dynamic type of the enclosing team-instance is used to determine
+ the correct role class (see below for an example).
+
+ </p>
+ <p>A special case of dynamically binding role types relates to so-called class literals
+ (see <a href="http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#251530"
+ class="ext">JLS &sect;15.8.2</a>).
+ Role class literals are covered in <a href="s6.1.c.html" title="&sect;6.1.(c)&nbsp;Class literals for roles"
+ class="sect">&sect;6.1.(c)</a>.
+
+ </p>
+ <p>The above is strictly needed only for cases involving implicit inheritance.
+ It may, however, help intuition, to also consider the directly acquired
+ role <code>T.R</code> in (b) to override the given role <code>S.R</code>.
+
+ </p>
+ <div class="codecomment">
+ In line 17 of <a href="#l1.3.1-1" class="listing">Listing 1.3.1-1</a> the implicitly inherited method <code>n</code> is called
+ with the result of an invocation of <code>m</code>. Although
+ <code>n</code> was defined in <code>S</code> (thus with argument type
+ <code>S.R2, see line 6</code>) in the context of <code>T</code> it
+ expects an argument of <code>T.R2</code>. This is correctly provided by
+ the invocation of <code>m</code> in the context of <code>T</code>.
+
+ </div>
+ </div>
+ <div class="subsect depth4" id="s1.3.1.f">
+ <h4 class="subsect">(f)&nbsp;<span class="title">tsuper</span></h4>
+ <div class="syntaxlink"><a href="sA.html#sA.5.4" title="&sect;A.5.4&nbsp;TSuperCall" class="syntax">&rarr;&nbsp;Syntax&nbsp;&sect;A.5.4</a></div>
+ <p>Super calls along implicit inheritance use the new keyword
+ <strong>tsuper</strong>. While <code>super</code> is still available
+ along regular inheritance, a call <code>tsuper.m()</code>
+ selects the version of <code>m</code> of the corresponding role
+ acquired from the super-team.
+
+ </p>
+ <p>See <a href="s2.4.2.html"
+ title="&sect;2.4.2&nbsp;Role creation via a regular constructor"
+ class="sect">&sect;2.4.2</a> for <code>tsuper</code>
+ in the context of role constructors.
+
+ </p>
+ <p><code>tsuper</code> can only be used to invoke a corresponding
+ version of the enclosing method or constructor, i.e., an expression
+ <code>tsuper.m()</code> may only occur within the method <code>m</code>
+ with both methods having the same signature
+ (see <a href="s2.3.2.b.html"
+ title="&sect;2.3.2.(b)&nbsp;Super in the context of declared lifting"
+ class="sect">&sect;2.3.2.(b)</a> for an exception, where both methods have slightly different signatures).
+
+ </p>
+ <div class="codecomment">
+ In <a href="#l1.3.1-1" class="listing">Listing 1.3.1-1</a> the role <code>R1</code> in team <code>T</code>
+ overrides the implicitly inherited method <code>m()</code> from <code>S</code>. <code><strong>tsuper</strong>.m()</code> calls the overridden method <code>m()</code>
+ from <code>S.R1</code> (line 13).
+
+ </div>
+ </div>
+ <div class="subsect depth4" id="s1.3.1.g">
+ <h4 class="subsect">(g)&nbsp;<span class="title">Implicitly inheriting super-types</span></h4>
+ <p>If a role class has an explicit super class (using <code>extends</code>)
+ this relation is inherited along implicit inheritance.
+
+ </p>
+ <div class="codecomment">
+ In <a href="#l1.3.1-1" class="listing">Listing 1.3.1-1</a> the role <code>R1</code> in <code>T</code> has <code>T.R0</code>
+ as its implicitly inherited super class, because the corresponding role in the super-team
+ <code><strong>extends R0</strong></code> (line 3).
+
+ </div>
+ <p>Overriding an implicitly inherited super class is governed by
+ <a href="s1.3.2.b.html"
+ title="&sect;1.3.2.(b)&nbsp;Inheriting and overriding the extends clause"
+ class="sect">&sect;1.3.2.(b)</a>, below.<br />
+ The list of implemented interfaces is merged along implicit
+ inheritance.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.3.1.h">
+ <h4 class="subsect">(h)&nbsp;<span class="title">Preserving visibility</span></h4>
+ <p>A role class must provide at least as much access as the implicit super role,
+ or a compile-time error occurs (this is in analogy to <a href="http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#227965"
+ class="ext">JLS &sect;8.4.6.3</a>).
+ Access rights of methods overridden by implicit inheritance follow
+ the same rules as for normal overriding.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.3.1.i">
+ <h4 class="subsect">(i)&nbsp;<span class="title">Dynamic binding of constructors</span></h4>
+ <p>When creating a role instance using <code>new</code> not only the
+ type to instantiate is bound dynamically (cf. <a href="#s1.3.1.e" title="&sect;1.3.1.(e)&nbsp;Dynamic binding of types"
+ class="sect">&sect;1.3.1.(e)</a>), but also the constructor to
+ invoke is dynamically bound in accordance to the concrete
+ type.<br />
+ Within role constructors all <code>this(..)</code> and
+ <code>super(..)</code> calls are bound statically with respect to explicit inheritance
+ and dynamically with respect to implicit inheritance. This means the target role name is
+ determined statically, but using that name the suitable role type is determined
+ using dynamic binding.
+ <br />
+ See also <a href="s2.5.a.html"
+ title="&sect;2.5.(a)&nbsp;Using abstract classes for creation"
+ class="sect">&sect;2.5.(a)</a> on using constructors of abstract role classes.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.3.1.j">
+ <h4 class="subsect">(j)&nbsp;<span class="title">Overriding and compatibility</span></h4>
+ <p>The rules of <a href="http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#228745"
+ class="ext">JLS &sect;8.4.6</a>
+ also apply to methods <em>and constructors</em> inherited via implicit inheritance.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.3.1.k">
+ <h4 class="subsect">(k)&nbsp;<span class="title">Covariant return types</span></h4>
+ <p>Given a team <code>T1</code> with two roles <code>R1</code> and <code>R2</code> where <code>R2</code> explicitly inherits from <code>R1</code>, both roles defining
+ a method <code>m</code> returning some type <code>A</code>.
+ Given also a sub-team of <code>T1</code>, <code>T2</code>, where <code>T2.R1</code> overrides <code>m</code> with a covariant return type <code>B</code>
+ (sub-type of <code>A</code>):
+
+ </p>
+ <div class="listing plain"><pre> <b>public</b> <b>team</b> <b>class</b> T1 {
+ <b>protected</b> <b>abstract</b> <b>class</b> R1 {
+ <b>abstract</b> A m();
+ }
+ <b>protected</b> <b>class</b> R2 <b>extends</b> R1 {
+ A m() { <b>return</b> <b>new</b> A(); }
+ }
+ }
+ <b>public</b> <b>team</b> <b>class</b> T2 <b>extends</b> T1 {
+ <b>protected</b> <b>class</b> R1 {
+ @Override B m() { <b>return</b> <b>new</b> B(); } <span class="error">// this declaration renders <b>class</b> T2.R2 illegal</span>
+ }
+ }</pre></div>
+ <p>
+ In this situation role <code>T2.R2</code> will be illegal unless also overriding <code>m</code> with a return type that is at least <code>B</code>.
+ Note, that the actual error occurs at the implicitly inherited method <code>T2.R2.m</code> which is not visible in the source code,
+ even <code>T2.R2</code> need not be mentioned explicitly in the source code.
+ A compiler should flag this as an imcompatibility at the team level, because a team must specialize inherited roles
+ in a consistent way.
+
+ </p>
+ </div>
+ <h5 class="listing">Example code (Teams and Roles):</h5>
+ <div class="listing example frame" id="l1.3.1-3">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> MyTeamA {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>protected</b> <b>class</b> MyRole {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> String name;</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <b>public</b> MyRole (String n) { name = n; }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> <b>public</b> <b>void</b> print() { System.out.println("id="+name); }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> <b>protected</b> MyRole getRole() { <b>return</b> <b>new</b> MyRole("Joe"); }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="listing example frame" id="l1.3.1-4">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">10</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> MySubTeam <b>extends</b> MyTeamA {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">11</td>
+ <td><pre> <b>protected</b> <b>class</b> MyRole {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">12</td>
+ <td><pre> <b>int</b> age;</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">13</td>
+ <td><pre> <b>public</b> <b>void</b> setAge(<b>int</b> a) { age = a; }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">14</td>
+ <td><pre> <b>public</b> <b>void</b> print() {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">15</td>
+ <td><pre> tsuper.print();</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">16</td>
+ <td><pre> System.out.println("age="+age);</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">17</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">18</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">19</td>
+ <td><pre> <b>public</b> <b>void</b> doit() {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">20</td>
+ <td><pre> MyRole r = getRole();</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">21</td>
+ <td><pre> r.setAge(27);</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">22</td>
+ <td><pre> r.print();</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">23</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">24</td>
+ <td><pre>}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">25</td>
+ <td><pre>...</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">26</td>
+ <td><pre>MySubTeam myTeam = <b>new</b> MySubTeam();</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">27</td>
+ <td><pre>myTeam.doit();</pre></td>
+ </tr>
+ </table>
+ </div>
+ <h5 class="listing">Program output</h5>
+ <div class="listing example frame"><pre>id=Joe
+age=27</pre></div>
+ <div class="codecomment">
+ <h5>Effects:</h5>
+ <ul>
+ <li>According to <a href="s1.3.html"
+ title="&sect;1.3&nbsp;Acquisition and implicit inheritance of role classes"
+ class="sect">&sect;1.3</a>, <code>MyTeamA</code> implements
+ <code>ITeam</code> (line 1).
+ </li>
+ <li>An implicit role inheritance is created for
+ <code>MySubTeam.MyRole</code> (<a href="#s1.3.1.c"
+ title="&sect;1.3.1.(c)&nbsp;Overriding and implicit inheritance"
+ class="sect">&sect;1.3.1.(c)</a>; line&nbsp;11).<br />
+ If we visualize this special inheritance using a fictitious keyword
+ <code>overrides</code> the compiler would see a declaration:
+
+ <div class="listing plain"><pre><b>protected</b> <b>class</b> MyRole <em>overrides MyTeamA.MyRole</em> { ... }</pre></div>
+ </li>
+ <li>Invoking <code>getRole()</code> on <code>myTeam</code> (line&nbsp;27, 20)
+ creates an instance of <code>MySubTeam.MyRole</code> because the
+ acquired role <code>MyTeamA.MyRole</code> is overridden by
+ <code>MySubTeam.MyRole</code>
+ following the rules of implicit inheritance (cf. <a href="#s1.3.1.e" title="&sect;1.3.1.(e)&nbsp;Dynamic binding of types"
+ class="sect">&sect;1.3.1.(e)</a>).
+
+ </li>
+ <li>Overriding of role methods and access to inherited features works as usual.
+
+ </li>
+ <li>As an example for <a href="#s1.3.1.f" title="&sect;1.3.1.(f)&nbsp;tsuper" class="sect">&sect;1.3.1.(f)</a> see the call <code>tsuper.print()</code>
+ (line&nbsp;15), which selects the implementation of <code>MyTeamA.MyRole.print</code>.
+
+ </li>
+ </ul>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.3.2.html" rel="next">&sect;1.3.2&nbsp;Regular role inheritance&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.3.html" rel="section">&sect;1.3&nbsp;Acquisition and implicit inheritance of role classes</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.1.i.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.1.i.html
new file mode 100644
index 000000000..589d05de0
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.1.i.html
@@ -0,0 +1,56 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s1.3.1.h.html" rel="prev">&lt;&lt;&nbsp;&sect;1.3.1.(h)&nbsp;Preserving visibility</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.3.1.j.html" rel="next">&sect;1.3.1.(j)&nbsp;Overriding and compatibility&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.3.html" rel="section">&sect;1.3&nbsp;Acquisition and implicit inheritance of role classes</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.3.1.html" rel="section">&sect;1.3.1&nbsp;Acquisition and implicit inheritance of role classes</a></div>
+ <div class="subsect depth4" id="s1.3.1.i">
+ <h4 class="subsect">&sect;1.3.1.(i)&nbsp;<span class="title">Dynamic binding of constructors</span></h4>
+ <p>When creating a role instance using <code>new</code> not only the
+ type to instantiate is bound dynamically (cf. <a href="s1.3.1.e.html" title="&sect;1.3.1.(e)&nbsp;Dynamic binding of types"
+ class="sect">&sect;1.3.1.(e)</a>), but also the constructor to
+ invoke is dynamically bound in accordance to the concrete
+ type.<br />
+ Within role constructors all <code>this(..)</code> and
+ <code>super(..)</code> calls are bound statically with respect to explicit inheritance
+ and dynamically with respect to implicit inheritance. This means the target role name is
+ determined statically, but using that name the suitable role type is determined
+ using dynamic binding.
+ <br />
+ See also <a href="s2.5.a.html"
+ title="&sect;2.5.(a)&nbsp;Using abstract classes for creation"
+ class="sect">&sect;2.5.(a)</a> on using constructors of abstract role classes.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s1.3.1.h.html" rel="prev">&lt;&lt;&nbsp;&sect;1.3.1.(h)&nbsp;Preserving visibility</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.3.1.j.html" rel="next">&sect;1.3.1.(j)&nbsp;Overriding and compatibility&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.3.html" rel="section">&sect;1.3&nbsp;Acquisition and implicit inheritance of role classes</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.3.1.html" rel="section">&sect;1.3.1&nbsp;Acquisition and implicit inheritance of role classes</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.1.j.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.1.j.html
new file mode 100644
index 000000000..7368d0c6d
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.1.j.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s1.3.1.i.html" rel="prev">&lt;&lt;&nbsp;&sect;1.3.1.(i)&nbsp;Dynamic binding of constructors</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.3.1.k.html" rel="next">&sect;1.3.1.(k)&nbsp;Covariant return types&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.3.html" rel="section">&sect;1.3&nbsp;Acquisition and implicit inheritance of role classes</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.3.1.html" rel="section">&sect;1.3.1&nbsp;Acquisition and implicit inheritance of role classes</a></div>
+ <div class="subsect depth4" id="s1.3.1.j">
+ <h4 class="subsect">&sect;1.3.1.(j)&nbsp;<span class="title">Overriding and compatibility</span></h4>
+ <p>The rules of <a href="http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#228745"
+ class="ext">JLS &sect;8.4.6</a>
+ also apply to methods <em>and constructors</em> inherited via implicit inheritance.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s1.3.1.i.html" rel="prev">&lt;&lt;&nbsp;&sect;1.3.1.(i)&nbsp;Dynamic binding of constructors</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.3.1.k.html" rel="next">&sect;1.3.1.(k)&nbsp;Covariant return types&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.3.html" rel="section">&sect;1.3&nbsp;Acquisition and implicit inheritance of role classes</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.3.1.html" rel="section">&sect;1.3.1&nbsp;Acquisition and implicit inheritance of role classes</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.1.k.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.1.k.html
new file mode 100644
index 000000000..0aad400b1
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.1.k.html
@@ -0,0 +1,67 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s1.3.1.j.html" rel="prev">&lt;&lt;&nbsp;&sect;1.3.1.(j)&nbsp;Overriding and compatibility</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.3.html" rel="section">&sect;1.3&nbsp;Acquisition and implicit inheritance of role classes</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.3.1.html" rel="section">&sect;1.3.1&nbsp;Acquisition and implicit inheritance of role classes</a></div>
+ <div class="subsect depth4" id="s1.3.1.k">
+ <h4 class="subsect">&sect;1.3.1.(k)&nbsp;<span class="title">Covariant return types</span></h4>
+ <p>Given a team <code>T1</code> with two roles <code>R1</code> and <code>R2</code> where <code>R2</code> explicitly inherits from <code>R1</code>, both roles defining
+ a method <code>m</code> returning some type <code>A</code>.
+ Given also a sub-team of <code>T1</code>, <code>T2</code>, where <code>T2.R1</code> overrides <code>m</code> with a covariant return type <code>B</code>
+ (sub-type of <code>A</code>):
+
+ </p>
+ <div class="listing plain"><pre> <b>public</b> <b>team</b> <b>class</b> T1 {
+ <b>protected</b> <b>abstract</b> <b>class</b> R1 {
+ <b>abstract</b> A m();
+ }
+ <b>protected</b> <b>class</b> R2 <b>extends</b> R1 {
+ A m() { <b>return</b> <b>new</b> A(); }
+ }
+ }
+ <b>public</b> <b>team</b> <b>class</b> T2 <b>extends</b> T1 {
+ <b>protected</b> <b>class</b> R1 {
+ @Override B m() { <b>return</b> <b>new</b> B(); } <span class="error">// this declaration renders <b>class</b> T2.R2 illegal</span>
+ }
+ }</pre></div>
+ <p>
+ In this situation role <code>T2.R2</code> will be illegal unless also overriding <code>m</code> with a return type that is at least <code>B</code>.
+ Note, that the actual error occurs at the implicitly inherited method <code>T2.R2.m</code> which is not visible in the source code,
+ even <code>T2.R2</code> need not be mentioned explicitly in the source code.
+ A compiler should flag this as an imcompatibility at the team level, because a team must specialize inherited roles
+ in a consistent way.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s1.3.1.j.html" rel="prev">&lt;&lt;&nbsp;&sect;1.3.1.(j)&nbsp;Overriding and compatibility</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.3.html" rel="section">&sect;1.3&nbsp;Acquisition and implicit inheritance of role classes</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.3.1.html" rel="section">&sect;1.3.1&nbsp;Acquisition and implicit inheritance of role classes</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.2.a.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.2.a.html
new file mode 100644
index 000000000..c0f6a2efb
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.2.a.html
@@ -0,0 +1,49 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.3.2.b.html" rel="next">&sect;1.3.2.(b)&nbsp;Inheriting and overriding the extends clause&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.3.html" rel="section">&sect;1.3&nbsp;Acquisition and implicit inheritance of role classes</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.3.2.html" rel="section">&sect;1.3.2&nbsp;Regular role inheritance</a></div>
+ <div class="subsect depth4" id="s1.3.2.a">
+ <h4 class="subsect">&sect;1.3.2.(a)&nbsp;<span class="title">Super-class restrictions</span></h4>
+ <p>If the super-class of a role is again a role it must be a direct role of
+ an enclosing team
+ This rule is simply enforced by disallowing type anchors in the
+ <code>extends</code> clause
+ (see <a href="s1.2.2.g.html" title="&sect;1.2.2.(g)&nbsp;Legal contexts"
+ class="sect">&sect;1.2.2.(g)</a>).
+ As an effect, the super-class may never be more deeply nested than the sub-class.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.3.2.b.html" rel="next">&sect;1.3.2.(b)&nbsp;Inheriting and overriding the extends clause&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.3.html" rel="section">&sect;1.3&nbsp;Acquisition and implicit inheritance of role classes</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.3.2.html" rel="section">&sect;1.3.2&nbsp;Regular role inheritance</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.2.b.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.2.b.html
new file mode 100644
index 000000000..9b1e70f0d
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.2.b.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s1.3.2.a.html" rel="prev">&lt;&lt;&nbsp;&sect;1.3.2.(a)&nbsp;Super-class restrictions</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.3.2.c.html" rel="next">&sect;1.3.2.(c)&nbsp;Constructors and overridden 'extends' &nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.3.html" rel="section">&sect;1.3&nbsp;Acquisition and implicit inheritance of role classes</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.3.2.html" rel="section">&sect;1.3.2&nbsp;Regular role inheritance</a></div>
+ <div class="subsect depth4" id="s1.3.2.b">
+ <h4 class="subsect">&sect;1.3.2.(b)&nbsp;<span class="title">Inheriting and overriding the extends clause</span></h4>
+ <p>If a role overrides another role by implicit inheritance, it may
+ change the inherited <code>extends</code> clause
+ (see <a href="s1.3.1.g.html"
+ title="&sect;1.3.1.(g)&nbsp;Implicitly inheriting super-types"
+ class="sect">&sect;1.3.1.(g)</a> above) only if the new super-class
+ is a sub-class of the class in the overridden extends clause.
+ I.e., an implicit sub-role may <em>specialize</em> the extends clause of its
+ implicit super-role.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s1.3.2.a.html" rel="prev">&lt;&lt;&nbsp;&sect;1.3.2.(a)&nbsp;Super-class restrictions</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.3.2.c.html" rel="next">&sect;1.3.2.(c)&nbsp;Constructors and overridden 'extends' &nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.3.html" rel="section">&sect;1.3&nbsp;Acquisition and implicit inheritance of role classes</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.3.2.html" rel="section">&sect;1.3.2&nbsp;Regular role inheritance</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.2.c.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.2.c.html
new file mode 100644
index 000000000..72ccab13e
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.2.c.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s1.3.2.b.html" rel="prev">&lt;&lt;&nbsp;&sect;1.3.2.(b)&nbsp;Inheriting and overriding the extends clause</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.3.2.d.html" rel="next">&sect;1.3.2.(d)&nbsp;Adding implemented interfaces&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.3.html" rel="section">&sect;1.3&nbsp;Acquisition and implicit inheritance of role classes</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.3.2.html" rel="section">&sect;1.3.2&nbsp;Regular role inheritance</a></div>
+ <div class="subsect depth4" id="s1.3.2.c">
+ <h4 class="subsect">&sect;1.3.2.(c)&nbsp;<span class="title">Constructors and overridden 'extends' </span></h4>
+ <p>Each constructor of a role class that overrides the extends clause of its
+ implicit super-role must invoke a constructor of this newly introduced
+ explicit super-class. Thus it may not use a <code>tsuper</code> constructor
+ (see <a href="s2.4.2.html"
+ title="&sect;2.4.2&nbsp;Role creation via a regular constructor"
+ class="sect">&sect;2.4.2</a>).
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s1.3.2.b.html" rel="prev">&lt;&lt;&nbsp;&sect;1.3.2.(b)&nbsp;Inheriting and overriding the extends clause</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.3.2.d.html" rel="next">&sect;1.3.2.(d)&nbsp;Adding implemented interfaces&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.3.html" rel="section">&sect;1.3&nbsp;Acquisition and implicit inheritance of role classes</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.3.2.html" rel="section">&sect;1.3.2&nbsp;Regular role inheritance</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.2.d.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.2.d.html
new file mode 100644
index 000000000..1cbd520dc
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.2.d.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s1.3.2.c.html" rel="prev">&lt;&lt;&nbsp;&sect;1.3.2.(c)&nbsp;Constructors and overridden 'extends' </a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.3.2.e.html" rel="next">&sect;1.3.2.(e)&nbsp;Visibility of inherited methods&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.3.html" rel="section">&sect;1.3&nbsp;Acquisition and implicit inheritance of role classes</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.3.2.html" rel="section">&sect;1.3.2&nbsp;Regular role inheritance</a></div>
+ <div class="subsect depth4" id="s1.3.2.d">
+ <h4 class="subsect">&sect;1.3.2.(d)&nbsp;<span class="title">Adding implemented interfaces</span></h4>
+ <p><code>implements</code> declarations are additive, i.e., an implicit
+ sub-role may add more interfaces but has to implement all interfaces of
+ its implicit super-role, too.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s1.3.2.c.html" rel="prev">&lt;&lt;&nbsp;&sect;1.3.2.(c)&nbsp;Constructors and overridden 'extends' </a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.3.2.e.html" rel="next">&sect;1.3.2.(e)&nbsp;Visibility of inherited methods&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.3.html" rel="section">&sect;1.3&nbsp;Acquisition and implicit inheritance of role classes</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.3.2.html" rel="section">&sect;1.3.2&nbsp;Regular role inheritance</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.2.e.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.2.e.html
new file mode 100644
index 000000000..b734fe222
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.2.e.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s1.3.2.d.html" rel="prev">&lt;&lt;&nbsp;&sect;1.3.2.(d)&nbsp;Adding implemented interfaces</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.3.html" rel="section">&sect;1.3&nbsp;Acquisition and implicit inheritance of role classes</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.3.2.html" rel="section">&sect;1.3.2&nbsp;Regular role inheritance</a></div>
+ <div class="subsect depth4" id="s1.3.2.e">
+ <h4 class="subsect">&sect;1.3.2.(e)&nbsp;<span class="title">Visibility of inherited methods</span></h4>
+ <p>
+ When a role inherits non-public methods from a regular class (as its super class),
+ these methods are considered as private for the role, i.e., they can only be
+ accessed in an unqualified method call <code>m()</code> using the implicit receiver <code>this</code>.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s1.3.2.d.html" rel="prev">&lt;&lt;&nbsp;&sect;1.3.2.(d)&nbsp;Adding implemented interfaces</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.3.html" rel="section">&sect;1.3&nbsp;Acquisition and implicit inheritance of role classes</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.3.2.html" rel="section">&sect;1.3.2&nbsp;Regular role inheritance</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.2.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.2.html
new file mode 100644
index 000000000..1a5b3cac8
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.2.html
@@ -0,0 +1,97 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s1.3.1.html" rel="prev">&lt;&lt;&nbsp;&sect;1.3.1&nbsp;Acquisition and implicit inheritance of role classes</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.3.html" rel="section">&sect;1.3&nbsp;Acquisition and implicit inheritance of role classes</a></div>
+ <div class="sect depth3" id="s1.3.2">
+ <h3 class="sect">&sect;1.3.2&nbsp;Regular role inheritance</h3>
+ <p>In addition to implicit inheritance, roles may also inherit using
+ the standard Java keyword <code>extends</code>. These restrictions apply:
+
+ </p>
+ <div class="subsect depth4" id="s1.3.2.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Super-class restrictions</span></h4>
+ <p>If the super-class of a role is again a role it must be a direct role of
+ an enclosing team
+ This rule is simply enforced by disallowing type anchors in the
+ <code>extends</code> clause
+ (see <a href="s1.2.2.g.html" title="&sect;1.2.2.(g)&nbsp;Legal contexts"
+ class="sect">&sect;1.2.2.(g)</a>).
+ As an effect, the super-class may never be more deeply nested than the sub-class.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.3.2.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Inheriting and overriding the extends clause</span></h4>
+ <p>If a role overrides another role by implicit inheritance, it may
+ change the inherited <code>extends</code> clause
+ (see <a href="s1.3.1.g.html"
+ title="&sect;1.3.1.(g)&nbsp;Implicitly inheriting super-types"
+ class="sect">&sect;1.3.1.(g)</a> above) only if the new super-class
+ is a sub-class of the class in the overridden extends clause.
+ I.e., an implicit sub-role may <em>specialize</em> the extends clause of its
+ implicit super-role.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.3.2.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Constructors and overridden 'extends' </span></h4>
+ <p>Each constructor of a role class that overrides the extends clause of its
+ implicit super-role must invoke a constructor of this newly introduced
+ explicit super-class. Thus it may not use a <code>tsuper</code> constructor
+ (see <a href="s2.4.2.html"
+ title="&sect;2.4.2&nbsp;Role creation via a regular constructor"
+ class="sect">&sect;2.4.2</a>).
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.3.2.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Adding implemented interfaces</span></h4>
+ <p><code>implements</code> declarations are additive, i.e., an implicit
+ sub-role may add more interfaces but has to implement all interfaces of
+ its implicit super-role, too.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.3.2.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Visibility of inherited methods</span></h4>
+ <p>
+ When a role inherits non-public methods from a regular class (as its super class),
+ these methods are considered as private for the role, i.e., they can only be
+ accessed in an unqualified method call <code>m()</code> using the implicit receiver <code>this</code>.
+
+ </p>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s1.3.1.html" rel="prev">&lt;&lt;&nbsp;&sect;1.3.1&nbsp;Acquisition and implicit inheritance of role classes</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.3.html" rel="section">&sect;1.3&nbsp;Acquisition and implicit inheritance of role classes</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.html
new file mode 100644
index 000000000..da29b32b9
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.3.html
@@ -0,0 +1,587 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s1.2.html" rel="prev">&lt;&lt;&nbsp;&sect;1.2&nbsp;Role classes and objects</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.4.html" rel="next">&sect;1.4&nbsp;Name clashes&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a></div>
+ <div class="sect depth2" id="s1.3">
+ <h2 class="sect">&sect;1.3&nbsp;Acquisition and implicit inheritance of role classes</h2>
+ <p> Every team class implicitly implements the predefined interface <code>org.objectteams.ITeam</code>.
+ If a team class has no explicit <code>extends</code> clause it implicitly extends <code>org.objectteams.Team</code>,
+ thus providing implementations for the methods in <code>org.objectteams.ITeam</code>.
+ If a team class extends a non-team class, the compiler implicitly adds implementations for all methods declared
+ in <code>org.objectteams.ITeam</code> to the team class.
+ Any subclass of a team (including <code>org.objectteams.Team</code>) must again be a team.
+ Interface implementation is not affected by this rule.
+
+ </p>
+ <p>Infrastructure provided via interface <code>org.objectteams.ITeam</code> is presented in <a href="s6.html" title="&sect;6&nbsp;Object Teams API" class="sect">&sect;6</a>.
+
+ </p>
+ <div class="sect depth3" id="s1.3.1">
+ <h3 class="sect">&sect;1.3.1&nbsp;Acquisition and implicit inheritance of role classes<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;1.3</a></span></h3>
+ <p>A team acquires all roles from its super-team. This relation is
+ similar to inheritance of inner classes, but with a few decisive
+ differences as defined next. Two implementation options are mentioned <a href="s1.html#aux1.1" class="int">below</a>,
+ which can be used to realize the special semantics of role
+ acquisition (virtual classes and copy inheritance).
+
+ </p>
+ <h5 class="listing">Implicit role inheritance</h5>
+ <div class="listing example frame" id="l1.3.1-1">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> S {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>protected</b> <b>class</b> R0 {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>protected</b> <b>class</b> R1 <em><b>extends</b> R0</em> {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <b>boolean</b> ok;</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> R2 m() {...}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> <b>void</b> n(<em>R2</em> r) {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre> <b>protected</b> <b>class</b> R2 {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="listing example frame" id="l1.3.1-2">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">10</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> T <em><b>extends</b> S</em> {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">11</td>
+ <td><pre> @Override <b>protected</b> <em><b>class</b> R1</em> {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">12</td>
+ <td><pre> <strong>R2</strong> m() {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">13</td>
+ <td><pre> if(<em>ok</em>) { <b>return</b> <em>tsuper</em>.m(); }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">14</td>
+ <td><pre> <b>else</b> { <b>return</b> null; }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">15</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">16</td>
+ <td><pre> <b>void</b> doIt() {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">17</td>
+ <td><pre> n(m());</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">18</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">19</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">20</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="subsect depth4" id="s1.3.1.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Role class acquisition</span></h4>
+ <p>A team <code>T</code> which extends a super-team <code>S</code>
+ has one role class <code>T.R</code> corresponding to each role <code>S.R</code>
+ of the super-team.
+ The new type <code>T.R</code>&nbsp;<strong>overrides</strong>&nbsp;<code>R</code> for the
+ context of <code>T</code> and its roles.
+ Acquisition of role classes can either be direct (see (b) below), or
+ it may involve overriding and implicit inheritance ((c) below).
+
+ </p>
+ <div class="codecomment">In the above example (<a href="#l1.3.1-1" class="listing">Listing 1.3.1-1</a>) the team <code>S</code> operates
+ on types <code>S.R0</code>, <code>S.R1</code> and <code>S.R2</code>,
+ while <code>T</code> operates on types <code>T.R0</code>, <code>T.R1</code>
+ and <code>T.R2</code>.<br /><em>(Type references like "<code>S.R0</code>" are actually illegal in source code
+ (<a href="s1.2.3.b.html" title="&sect;1.2.3.(b)&nbsp;Qualified role types"
+ class="sect">&sect;1.2.3.(b)</a>). Here they are used for explanatory purposes only)</em></div>
+ </div>
+ <div class="subsect depth4" id="s1.3.1.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Direct role acquisition</span></h4>
+ <p>Within a sub-team <code>T</code> each role <code>S.R</code> of its
+ super-team <code>S</code> is available by the simple name <code>R</code>
+ without further declaration.
+
+ </p>
+ <div class="codecomment">The role <code>R2</code> in <a href="#l1.3.1-1" class="listing">Listing 1.3.1-1</a> can be used in the sub-team
+ <code>T</code> (line 12), because this role type is defined in the super class of the enclosing team.
+
+ </div>
+ </div>
+ <div class="subsect depth4" id="s1.3.1.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Overriding and implicit inheritance</span></h4>
+ <p>If a team contains a role class definition by the same name as
+ a role defined in its super-team,
+ the new role class overrides the corresponding role from the super-team
+ and <strong>implicitly inherits</strong> all of its features.
+ Such relation is established only by name correspondence.
+
+ </p>
+ <p>A role that overrides an inherited role should be marked with an <code>@Override</code> annotation.
+ A compiler should optionally flag a missing <code>@Override</code> annotation with a warning.
+ Conversely, it is an error if a role is marked with an <code>@Override</code> annotation but does not actually
+ override an inherited role.
+
+ </p>
+ <p>It is an error to override a role class with an interface or vice versa. A final role cannot be overridden.<br />
+ Unlike regular inheritance, <strong>constructors</strong> are also inherited
+ along implicit inheritance, and can be overridden just like normal methods.
+
+ </p>
+ <div class="codecomment">
+ In <a href="#l1.3.1-1" class="listing">Listing 1.3.1-1</a><code> R1</code> in <code>T</code> implicitly inherits all features of
+ <code>R1</code> in <code>S</code>. This is, because its enclosing team
+ <code>T</code> extends the team <code>S</code> (line 10) and the role
+ definition uses the same name <code>R1</code> (line 11).
+ Hence the attribute <code><strong>ok</strong></code> is available in the method
+ <code>m()</code> in <code>T.R1</code> (line 13). <code>T.R1</code> also overrides <code>S.R1</code>
+ which is marked by the <code>@Override</code> annotation in line 11.
+
+ </div>
+ </div>
+ <div class="subsect depth4" id="s1.3.1.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Lack of subtyping</span></h4>
+ <p>Direct acquisition of roles from a super-team and implicit inheritance
+ do not establish a <strong>subtype</strong> relation.
+ A role of a given team is never conform (i.e., substitutable)
+ to any role of any <em>other</em> team.
+ <code>S.R</code> and <code>T.R</code> are always incommensurable.<br /><span class="underline">Note,</span> that this rule is a direct consequence of <a href="s1.2.2.e.html" title="&sect;1.2.2.(e)&nbsp;Conformance" class="sect">&sect;1.2.2.(e)</a>.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.3.1.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Dynamic binding of types</span></h4>
+ <p>Overriding an acquired role by a new role class has the following
+ implication: If an expression or declaration, which is evaluated on behalf of
+ an instance of team <code>T</code> or one of its contained roles,
+ refers to a role <code>R</code>, <code>R</code> will always
+ resolve to <code>T.R</code> even if <code>R</code> was introduced in
+ a super-team of <code>T</code> and even if the specific line of code
+ was inherited from a super-team or one of its roles.
+ Only the dynamic type of the enclosing team-instance is used to determine
+ the correct role class (see below for an example).
+
+ </p>
+ <p>A special case of dynamically binding role types relates to so-called class literals
+ (see <a href="http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#251530"
+ class="ext">JLS &sect;15.8.2</a>).
+ Role class literals are covered in <a href="s6.1.c.html" title="&sect;6.1.(c)&nbsp;Class literals for roles"
+ class="sect">&sect;6.1.(c)</a>.
+
+ </p>
+ <p>The above is strictly needed only for cases involving implicit inheritance.
+ It may, however, help intuition, to also consider the directly acquired
+ role <code>T.R</code> in (b) to override the given role <code>S.R</code>.
+
+ </p>
+ <div class="codecomment">
+ In line 17 of <a href="#l1.3.1-1" class="listing">Listing 1.3.1-1</a> the implicitly inherited method <code>n</code> is called
+ with the result of an invocation of <code>m</code>. Although
+ <code>n</code> was defined in <code>S</code> (thus with argument type
+ <code>S.R2, see line 6</code>) in the context of <code>T</code> it
+ expects an argument of <code>T.R2</code>. This is correctly provided by
+ the invocation of <code>m</code> in the context of <code>T</code>.
+
+ </div>
+ </div>
+ <div class="subsect depth4" id="s1.3.1.f">
+ <h4 class="subsect">(f)&nbsp;<span class="title">tsuper</span></h4>
+ <div class="syntaxlink"><a href="sA.html#sA.5.4" title="&sect;A.5.4&nbsp;TSuperCall" class="syntax">&rarr;&nbsp;Syntax&nbsp;&sect;A.5.4</a></div>
+ <p>Super calls along implicit inheritance use the new keyword
+ <strong>tsuper</strong>. While <code>super</code> is still available
+ along regular inheritance, a call <code>tsuper.m()</code>
+ selects the version of <code>m</code> of the corresponding role
+ acquired from the super-team.
+
+ </p>
+ <p>See <a href="s2.4.2.html"
+ title="&sect;2.4.2&nbsp;Role creation via a regular constructor"
+ class="sect">&sect;2.4.2</a> for <code>tsuper</code>
+ in the context of role constructors.
+
+ </p>
+ <p><code>tsuper</code> can only be used to invoke a corresponding
+ version of the enclosing method or constructor, i.e., an expression
+ <code>tsuper.m()</code> may only occur within the method <code>m</code>
+ with both methods having the same signature
+ (see <a href="s2.3.2.b.html"
+ title="&sect;2.3.2.(b)&nbsp;Super in the context of declared lifting"
+ class="sect">&sect;2.3.2.(b)</a> for an exception, where both methods have slightly different signatures).
+
+ </p>
+ <div class="codecomment">
+ In <a href="#l1.3.1-1" class="listing">Listing 1.3.1-1</a> the role <code>R1</code> in team <code>T</code>
+ overrides the implicitly inherited method <code>m()</code> from <code>S</code>. <code><strong>tsuper</strong>.m()</code> calls the overridden method <code>m()</code>
+ from <code>S.R1</code> (line 13).
+
+ </div>
+ </div>
+ <div class="subsect depth4" id="s1.3.1.g">
+ <h4 class="subsect">(g)&nbsp;<span class="title">Implicitly inheriting super-types</span></h4>
+ <p>If a role class has an explicit super class (using <code>extends</code>)
+ this relation is inherited along implicit inheritance.
+
+ </p>
+ <div class="codecomment">
+ In <a href="#l1.3.1-1" class="listing">Listing 1.3.1-1</a> the role <code>R1</code> in <code>T</code> has <code>T.R0</code>
+ as its implicitly inherited super class, because the corresponding role in the super-team
+ <code><strong>extends R0</strong></code> (line 3).
+
+ </div>
+ <p>Overriding an implicitly inherited super class is governed by
+ <a href="#s1.3.2.b"
+ title="&sect;1.3.2.(b)&nbsp;Inheriting and overriding the extends clause"
+ class="sect">&sect;1.3.2.(b)</a>, below.<br />
+ The list of implemented interfaces is merged along implicit
+ inheritance.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.3.1.h">
+ <h4 class="subsect">(h)&nbsp;<span class="title">Preserving visibility</span></h4>
+ <p>A role class must provide at least as much access as the implicit super role,
+ or a compile-time error occurs (this is in analogy to <a href="http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#227965"
+ class="ext">JLS &sect;8.4.6.3</a>).
+ Access rights of methods overridden by implicit inheritance follow
+ the same rules as for normal overriding.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.3.1.i">
+ <h4 class="subsect">(i)&nbsp;<span class="title">Dynamic binding of constructors</span></h4>
+ <p>When creating a role instance using <code>new</code> not only the
+ type to instantiate is bound dynamically (cf. <a href="#s1.3.1.e" title="&sect;1.3.1.(e)&nbsp;Dynamic binding of types"
+ class="sect">&sect;1.3.1.(e)</a>), but also the constructor to
+ invoke is dynamically bound in accordance to the concrete
+ type.<br />
+ Within role constructors all <code>this(..)</code> and
+ <code>super(..)</code> calls are bound statically with respect to explicit inheritance
+ and dynamically with respect to implicit inheritance. This means the target role name is
+ determined statically, but using that name the suitable role type is determined
+ using dynamic binding.
+ <br />
+ See also <a href="s2.5.a.html"
+ title="&sect;2.5.(a)&nbsp;Using abstract classes for creation"
+ class="sect">&sect;2.5.(a)</a> on using constructors of abstract role classes.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.3.1.j">
+ <h4 class="subsect">(j)&nbsp;<span class="title">Overriding and compatibility</span></h4>
+ <p>The rules of <a href="http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#228745"
+ class="ext">JLS &sect;8.4.6</a>
+ also apply to methods <em>and constructors</em> inherited via implicit inheritance.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.3.1.k">
+ <h4 class="subsect">(k)&nbsp;<span class="title">Covariant return types</span></h4>
+ <p>Given a team <code>T1</code> with two roles <code>R1</code> and <code>R2</code> where <code>R2</code> explicitly inherits from <code>R1</code>, both roles defining
+ a method <code>m</code> returning some type <code>A</code>.
+ Given also a sub-team of <code>T1</code>, <code>T2</code>, where <code>T2.R1</code> overrides <code>m</code> with a covariant return type <code>B</code>
+ (sub-type of <code>A</code>):
+
+ </p>
+ <div class="listing plain"><pre> <b>public</b> <b>team</b> <b>class</b> T1 {
+ <b>protected</b> <b>abstract</b> <b>class</b> R1 {
+ <b>abstract</b> A m();
+ }
+ <b>protected</b> <b>class</b> R2 <b>extends</b> R1 {
+ A m() { <b>return</b> <b>new</b> A(); }
+ }
+ }
+ <b>public</b> <b>team</b> <b>class</b> T2 <b>extends</b> T1 {
+ <b>protected</b> <b>class</b> R1 {
+ @Override B m() { <b>return</b> <b>new</b> B(); } <span class="error">// this declaration renders <b>class</b> T2.R2 illegal</span>
+ }
+ }</pre></div>
+ <p>
+ In this situation role <code>T2.R2</code> will be illegal unless also overriding <code>m</code> with a return type that is at least <code>B</code>.
+ Note, that the actual error occurs at the implicitly inherited method <code>T2.R2.m</code> which is not visible in the source code,
+ even <code>T2.R2</code> need not be mentioned explicitly in the source code.
+ A compiler should flag this as an imcompatibility at the team level, because a team must specialize inherited roles
+ in a consistent way.
+
+ </p>
+ </div>
+ <h5 class="listing">Example code (Teams and Roles):</h5>
+ <div class="listing example frame" id="l1.3.1-3">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> MyTeamA {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>protected</b> <b>class</b> MyRole {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> String name;</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <b>public</b> MyRole (String n) { name = n; }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> <b>public</b> <b>void</b> print() { System.out.println("id="+name); }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> <b>protected</b> MyRole getRole() { <b>return</b> <b>new</b> MyRole("Joe"); }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="listing example frame" id="l1.3.1-4">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">10</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> MySubTeam <b>extends</b> MyTeamA {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">11</td>
+ <td><pre> <b>protected</b> <b>class</b> MyRole {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">12</td>
+ <td><pre> <b>int</b> age;</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">13</td>
+ <td><pre> <b>public</b> <b>void</b> setAge(<b>int</b> a) { age = a; }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">14</td>
+ <td><pre> <b>public</b> <b>void</b> print() {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">15</td>
+ <td><pre> tsuper.print();</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">16</td>
+ <td><pre> System.out.println("age="+age);</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">17</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">18</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">19</td>
+ <td><pre> <b>public</b> <b>void</b> doit() {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">20</td>
+ <td><pre> MyRole r = getRole();</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">21</td>
+ <td><pre> r.setAge(27);</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">22</td>
+ <td><pre> r.print();</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">23</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">24</td>
+ <td><pre>}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">25</td>
+ <td><pre>...</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">26</td>
+ <td><pre>MySubTeam myTeam = <b>new</b> MySubTeam();</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">27</td>
+ <td><pre>myTeam.doit();</pre></td>
+ </tr>
+ </table>
+ </div>
+ <h5 class="listing">Program output</h5>
+ <div class="listing example frame"><pre>id=Joe
+age=27</pre></div>
+ <div class="codecomment">
+ <h5>Effects:</h5>
+ <ul>
+ <li>According to <a href="s1.3.html"
+ title="&sect;1.3&nbsp;Acquisition and implicit inheritance of role classes"
+ class="sect">&sect;1.3</a>, <code>MyTeamA</code> implements
+ <code>ITeam</code> (line 1).
+ </li>
+ <li>An implicit role inheritance is created for
+ <code>MySubTeam.MyRole</code> (<a href="#s1.3.1.c"
+ title="&sect;1.3.1.(c)&nbsp;Overriding and implicit inheritance"
+ class="sect">&sect;1.3.1.(c)</a>; line&nbsp;11).<br />
+ If we visualize this special inheritance using a fictitious keyword
+ <code>overrides</code> the compiler would see a declaration:
+
+ <div class="listing plain"><pre><b>protected</b> <b>class</b> MyRole <em>overrides MyTeamA.MyRole</em> { ... }</pre></div>
+ </li>
+ <li>Invoking <code>getRole()</code> on <code>myTeam</code> (line&nbsp;27, 20)
+ creates an instance of <code>MySubTeam.MyRole</code> because the
+ acquired role <code>MyTeamA.MyRole</code> is overridden by
+ <code>MySubTeam.MyRole</code>
+ following the rules of implicit inheritance (cf. <a href="#s1.3.1.e" title="&sect;1.3.1.(e)&nbsp;Dynamic binding of types"
+ class="sect">&sect;1.3.1.(e)</a>).
+
+ </li>
+ <li>Overriding of role methods and access to inherited features works as usual.
+
+ </li>
+ <li>As an example for <a href="#s1.3.1.f" title="&sect;1.3.1.(f)&nbsp;tsuper" class="sect">&sect;1.3.1.(f)</a> see the call <code>tsuper.print()</code>
+ (line&nbsp;15), which selects the implementation of <code>MyTeamA.MyRole.print</code>.
+
+ </li>
+ </ul>
+ </div>
+ </div>
+ <div class="sect depth3" id="s1.3.2">
+ <h3 class="sect">&sect;1.3.2&nbsp;Regular role inheritance<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;1.3</a></span></h3>
+ <p>In addition to implicit inheritance, roles may also inherit using
+ the standard Java keyword <code>extends</code>. These restrictions apply:
+
+ </p>
+ <div class="subsect depth4" id="s1.3.2.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Super-class restrictions</span></h4>
+ <p>If the super-class of a role is again a role it must be a direct role of
+ an enclosing team
+ This rule is simply enforced by disallowing type anchors in the
+ <code>extends</code> clause
+ (see <a href="s1.2.2.g.html" title="&sect;1.2.2.(g)&nbsp;Legal contexts"
+ class="sect">&sect;1.2.2.(g)</a>).
+ As an effect, the super-class may never be more deeply nested than the sub-class.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.3.2.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Inheriting and overriding the extends clause</span></h4>
+ <p>If a role overrides another role by implicit inheritance, it may
+ change the inherited <code>extends</code> clause
+ (see <a href="#s1.3.1.g"
+ title="&sect;1.3.1.(g)&nbsp;Implicitly inheriting super-types"
+ class="sect">&sect;1.3.1.(g)</a> above) only if the new super-class
+ is a sub-class of the class in the overridden extends clause.
+ I.e., an implicit sub-role may <em>specialize</em> the extends clause of its
+ implicit super-role.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.3.2.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Constructors and overridden 'extends' </span></h4>
+ <p>Each constructor of a role class that overrides the extends clause of its
+ implicit super-role must invoke a constructor of this newly introduced
+ explicit super-class. Thus it may not use a <code>tsuper</code> constructor
+ (see <a href="s2.4.2.html"
+ title="&sect;2.4.2&nbsp;Role creation via a regular constructor"
+ class="sect">&sect;2.4.2</a>).
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.3.2.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Adding implemented interfaces</span></h4>
+ <p><code>implements</code> declarations are additive, i.e., an implicit
+ sub-role may add more interfaces but has to implement all interfaces of
+ its implicit super-role, too.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.3.2.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Visibility of inherited methods</span></h4>
+ <p>
+ When a role inherits non-public methods from a regular class (as its super class),
+ these methods are considered as private for the role, i.e., they can only be
+ accessed in an unqualified method call <code>m()</code> using the implicit receiver <code>this</code>.
+
+ </p>
+ </div>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s1.2.html" rel="prev">&lt;&lt;&nbsp;&sect;1.2&nbsp;Role classes and objects</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.4.html" rel="next">&sect;1.4&nbsp;Name clashes&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.4.a.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.4.a.html
new file mode 100644
index 000000000..b03cc159d
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.4.a.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.4.b.html" rel="next">&sect;1.4.(b)&nbsp;Names of role methods and fields&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.4.html" rel="section">&sect;1.4&nbsp;Name clashes</a></div>
+ <div class="subsect depth3" id="s1.4.a">
+ <h4 class="subsect">&sect;1.4.(a)&nbsp;<span class="title">Names of role classes</span></h4>
+ <p>A role class may not have the same name as a method or field of
+ its enclosing team. A role class may not shadow another class that is visible in the scope of the enclosing team.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.4.b.html" rel="next">&sect;1.4.(b)&nbsp;Names of role methods and fields&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.4.html" rel="section">&sect;1.4&nbsp;Name clashes</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.4.b.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.4.b.html
new file mode 100644
index 000000000..50e41f480
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.4.b.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s1.4.a.html" rel="prev">&lt;&lt;&nbsp;&sect;1.4.(a)&nbsp;Names of role classes</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.4.html" rel="section">&sect;1.4&nbsp;Name clashes</a></div>
+ <div class="subsect depth3" id="s1.4.b">
+ <h4 class="subsect">&sect;1.4.(b)&nbsp;<span class="title">Names of role methods and fields</span></h4>
+ <p>Along implicit inheritance, the names of methods or fields may
+ not hide, shadow or obscure any previously visible name.<br />
+ (see JLS <a href="http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#40898"
+ class="ext">&sect;8.3</a>,
+ <a href="http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#227928"
+ class="ext">&sect;8.4.6.2</a>,
+ <a href="http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#246026"
+ class="ext">&sect;8.5</a>,
+ <a href="http://java.sun.com/docs/books/jls/second_edition/html/interfaces.doc.html#78642"
+ class="ext">&sect;9.3</a>,
+ <a href="http://java.sun.com/docs/books/jls/second_edition/html/interfaces.doc.html#252566"
+ class="ext">&sect;9.5</a> (hiding),
+ <a href="http://java.sun.com/docs/books/jls/second_edition/html/names.doc.html#34133"
+ class="ext">&sect;6.3.1</a> (shadowing),
+ <a href="http://java.sun.com/docs/books/jls/second_edition/html/names.doc.html#104058"
+ class="ext">&sect;6.3.2</a> (obscuring).
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s1.4.a.html" rel="prev">&lt;&lt;&nbsp;&sect;1.4.(a)&nbsp;Names of role classes</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.4.html" rel="section">&sect;1.4&nbsp;Name clashes</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.4.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.4.html
new file mode 100644
index 000000000..aa2880061
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.4.html
@@ -0,0 +1,71 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s1.3.html" rel="prev">&lt;&lt;&nbsp;&sect;1.3&nbsp;Acquisition and implicit inheritance of role classes</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.5.html" rel="next">&sect;1.5&nbsp;Team and role nesting&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a></div>
+ <div class="sect depth2" id="s1.4">
+ <h2 class="sect">&sect;1.4&nbsp;Name clashes</h2>
+ <p>OT/J restricts Java with respect to handling of conflicting names.
+
+ </p>
+ <div class="subsect depth3" id="s1.4.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Names of role classes</span></h4>
+ <p>A role class may not have the same name as a method or field of
+ its enclosing team. A role class may not shadow another class that is visible in the scope of the enclosing team.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s1.4.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Names of role methods and fields</span></h4>
+ <p>Along implicit inheritance, the names of methods or fields may
+ not hide, shadow or obscure any previously visible name.<br />
+ (see JLS <a href="http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#40898"
+ class="ext">&sect;8.3</a>,
+ <a href="http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#227928"
+ class="ext">&sect;8.4.6.2</a>,
+ <a href="http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#246026"
+ class="ext">&sect;8.5</a>,
+ <a href="http://java.sun.com/docs/books/jls/second_edition/html/interfaces.doc.html#78642"
+ class="ext">&sect;9.3</a>,
+ <a href="http://java.sun.com/docs/books/jls/second_edition/html/interfaces.doc.html#252566"
+ class="ext">&sect;9.5</a> (hiding),
+ <a href="http://java.sun.com/docs/books/jls/second_edition/html/names.doc.html#34133"
+ class="ext">&sect;6.3.1</a> (shadowing),
+ <a href="http://java.sun.com/docs/books/jls/second_edition/html/names.doc.html#104058"
+ class="ext">&sect;6.3.2</a> (obscuring).
+
+ </p>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s1.3.html" rel="prev">&lt;&lt;&nbsp;&sect;1.3&nbsp;Acquisition and implicit inheritance of role classes</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.5.html" rel="next">&sect;1.5&nbsp;Team and role nesting&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.5.a.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.5.a.html
new file mode 100644
index 000000000..00b2befc6
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.5.a.html
@@ -0,0 +1,54 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.5.b.html" rel="next">&sect;1.5.(b)&nbsp;Nested classes of roles&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.5.html" rel="section">&sect;1.5&nbsp;Team and role nesting</a></div>
+ <div class="subsect depth3" id="s1.5.a">
+ <h4 class="subsect">&sect;1.5.(a)&nbsp;<span class="title">Nested teams</span></h4>
+ <p>If a role class is also marked using the <code>team</code> modifier,
+ it may contain roles at the next level of nesting.
+
+ </p>
+ <div class="codecomment">
+ <ul>
+ <li>In the above example (<a href="s1.html#l1.5" class="listing">Listing 1.5</a>) class <code>RoleAndTeam</code> starting in line 14
+ is a role of <code>OuterTeam</code> and at the same time a
+ team containing a further role <code>InnerRole</code></li>
+ </ul>
+ </div>
+ <p>Such a hybrid role-and-team has all properties of both kinds of classes.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.5.b.html" rel="next">&sect;1.5.(b)&nbsp;Nested classes of roles&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.5.html" rel="section">&sect;1.5&nbsp;Team and role nesting</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.5.b.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.5.b.html
new file mode 100644
index 000000000..285c41792
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.5.b.html
@@ -0,0 +1,56 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s1.5.a.html" rel="prev">&lt;&lt;&nbsp;&sect;1.5.(a)&nbsp;Nested teams</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.5.c.html" rel="next">&sect;1.5.(c)&nbsp;Prohibition of cycles&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.5.html" rel="section">&sect;1.5&nbsp;Team and role nesting</a></div>
+ <div class="subsect depth3" id="s1.5.b">
+ <h4 class="subsect">&sect;1.5.(b)&nbsp;<span class="title">Nested classes of roles</span></h4>
+ <p>A regular role class (ie., not marked as <code>team</code>, see above)
+ may contain local types (see <a href="http://java.sun.com/docs/books/jls/second_edition/html/statements.doc.html#247766"
+ class="ext">JLS &sect;14.3</a>
+ - in the example: class <code>Local</code>), anonymous types
+ (<a href="http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#252986"
+ class="ext">JLS &sect;15.9.5</a>
+ - in the example: class defined in lines 18-20)
+ but no member types (<a href="http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#246026"
+ class="ext">JLS &sect;8.5</a>
+ - in the example: illegal class
+ <code>IllegalMember</code>).
+ <br />
+ The effect is, that nested types of a regular role cannot be
+ used outside the scope of their enclosing role.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s1.5.a.html" rel="prev">&lt;&lt;&nbsp;&sect;1.5.(a)&nbsp;Nested teams</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.5.c.html" rel="next">&sect;1.5.(c)&nbsp;Prohibition of cycles&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.5.html" rel="section">&sect;1.5&nbsp;Team and role nesting</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.5.c.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.5.c.html
new file mode 100644
index 000000000..d7b941351
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.5.c.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s1.5.b.html" rel="prev">&lt;&lt;&nbsp;&sect;1.5.(b)&nbsp;Nested classes of roles</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.5.d.html" rel="next">&sect;1.5.(d)&nbsp;Prohibition of name clashes&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.5.html" rel="section">&sect;1.5&nbsp;Team and role nesting</a></div>
+ <div class="subsect depth3" id="s1.5.c">
+ <h4 class="subsect">&sect;1.5.(c)&nbsp;<span class="title">Prohibition of cycles</span></h4>
+ <p>A nested team may not extend its own enclosing team.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s1.5.b.html" rel="prev">&lt;&lt;&nbsp;&sect;1.5.(b)&nbsp;Nested classes of roles</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.5.d.html" rel="next">&sect;1.5.(d)&nbsp;Prohibition of name clashes&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.5.html" rel="section">&sect;1.5&nbsp;Team and role nesting</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.5.d.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.5.d.html
new file mode 100644
index 000000000..0bdd2af4a
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.5.d.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s1.5.c.html" rel="prev">&lt;&lt;&nbsp;&sect;1.5.(c)&nbsp;Prohibition of cycles</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.5.e.html" rel="next">&sect;1.5.(e)&nbsp;Precedence among different supers&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.5.html" rel="section">&sect;1.5&nbsp;Team and role nesting</a></div>
+ <div class="subsect depth3" id="s1.5.d">
+ <h4 class="subsect">&sect;1.5.(d)&nbsp;<span class="title">Prohibition of name clashes</span></h4>
+ <p>A nested team may inherit roles from multiple sources: its explicit super team
+ and any of its implicit super classes (roles) from different levels of nesting.
+ If from different sources a team inherits two or more roles of the same name
+ that are not related by implicit inheritance, this is an illegal name clash.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s1.5.c.html" rel="prev">&lt;&lt;&nbsp;&sect;1.5.(c)&nbsp;Prohibition of cycles</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.5.e.html" rel="next">&sect;1.5.(e)&nbsp;Precedence among different supers&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.5.html" rel="section">&sect;1.5&nbsp;Team and role nesting</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.5.e.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.5.e.html
new file mode 100644
index 000000000..92b4fbb7e
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.5.e.html
@@ -0,0 +1,62 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s1.5.d.html" rel="prev">&lt;&lt;&nbsp;&sect;1.5.(d)&nbsp;Prohibition of name clashes</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.5.f.html" rel="next">&sect;1.5.(f)&nbsp;Qualified tsuper&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.5.html" rel="section">&sect;1.5&nbsp;Team and role nesting</a></div>
+ <div class="subsect depth3" id="s1.5.e">
+ <h4 class="subsect">&sect;1.5.(e)&nbsp;<span class="title">Precedence among different supers</span></h4>
+ <p>If a role inherits the same feature from several super roles (super and tsuper),
+ an implicitly inherited version always overrides any explicitly inherited feature. <br />
+ Also implicit inheritance alone may produce several candidate methods inherited by a role class.
+ This is a result of team-nesting where each level of nesting may add one more tsuper role.
+ In that case inner team inheritance has precedence over outer team inheritance.
+
+ </p>
+ <div class="codecomment">
+ <table>
+ <colgroup span="1">
+ <col align="left" span="1" />
+ <col align="center" span="1" />
+ </colgroup>
+ <tr>
+ <td valign="top" rowspan="1" colspan="1">
+ <p>In the above example (<a href="s1.html#l1.5" class="listing">Listing 1.5</a>) role <code class="small">OuterTeam.RoleAndTeamSub.InnerRole</code> has two direct tsuper roles: <code class="small">OuterTeam.RoleAndTeam.InnerRole</code>&nbsp;and <code class="small">SuperOuter.RoleAndTeamSub.InnerRole</code>. Without the method <code>foo</code> defined in lines 27-30, the enclosing class <code class="small">OuterTeam.RoleAndTeamSub.InnerRole</code> would inherit the method <code>foo</code> defined in line 16, because the inner inheritance between <code>RoleAndTeamSub</code> and <code>RoleAndTeam</code> binds stronger than the outer inheritance between <code>OuterTeam</code> and <code>SuperOuter</code>.
+ </p>
+ </td>
+ <td rowspan="1" colspan="1"><img src="../images/team_nesting_hor.png" alt="Example diagram team nesting" /></td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s1.5.d.html" rel="prev">&lt;&lt;&nbsp;&sect;1.5.(d)&nbsp;Prohibition of name clashes</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s1.5.f.html" rel="next">&sect;1.5.(f)&nbsp;Qualified tsuper&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.5.html" rel="section">&sect;1.5&nbsp;Team and role nesting</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.5.f.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.5.f.html
new file mode 100644
index 000000000..c25f050ed
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.5.f.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s1.5.e.html" rel="prev">&lt;&lt;&nbsp;&sect;1.5.(e)&nbsp;Precedence among different supers</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.5.html" rel="section">&sect;1.5&nbsp;Team and role nesting</a></div>
+ <div class="subsect depth3" id="s1.5.f">
+ <h4 class="subsect">&sect;1.5.(f)&nbsp;<span class="title">Qualified tsuper</span></h4>
+ <p>A role in a nested team may qualify the keyword <code>tsuper</code> (see <a href="s1.3.1.f.html" title="&sect;1.3.1.(f)&nbsp;tsuper" class="sect">&sect;1.3.1.(f)</a> above) by a type name
+ in order to select among different method version inherited from different implicit super classes. A term <code>OuterTeam.tsuper</code> evaluates
+ to the super-class, say <code>SuperOuter</code>, of an enclosing team "<code>OuterTeam</code>". A method call <code>OuterTeam.tsuper.m()</code>
+ evaluates to the method version within <code>SuperOuter</code> that best corresponds to the current method containing the tsuper-call.
+
+ </p>
+ <div class="codecomment">
+ <ul>
+ <li>In the above example (<a href="s1.html#l1.5" class="listing">Listing 1.5</a>) line 28 is identical to an unqualified tsuper-call
+ </li>
+ <li>Line 29 selects a corresponding method from the context of <code>SuperOuter</code> resolving to <code>SuperOuter.RoleAndTeamSub.InnerRole.foo()</code></li>
+ </ul>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s1.5.e.html" rel="prev">&lt;&lt;&nbsp;&sect;1.5.(e)&nbsp;Precedence among different supers</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a>&nbsp;&gt;&nbsp;<a class="nav" href="s1.5.html" rel="section">&sect;1.5&nbsp;Team and role nesting</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.5.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.5.html
new file mode 100644
index 000000000..0981b3d31
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.5.html
@@ -0,0 +1,272 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s1.4.html" rel="prev">&lt;&lt;&nbsp;&sect;1.4&nbsp;Name clashes</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a></div>
+ <div class="sect depth2" id="s1.5">
+ <h2 class="sect">&sect;1.5&nbsp;Team and role nesting</h2>
+ <p>Multi-level nesting of classes is restricted only by the following rules.
+
+ </p>
+ <h5 class="listing">Example code (Nesting):</h5>
+ <div class="listing example frame" id="l1.5">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> SuperOuter {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>public</b> <em><b>team</b> <b>class</b> RoleAndTeam</em> {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>protected</b> <b>class</b> InnerRole {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> Runnable foo() { <b>return</b> null; }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> <b>public</b> <em><b>team</b> <b>class</b> RoleAndTeamSub</em> <b>extends</b> <strong>RoleAndTeam</strong> {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre> <b>protected</b> <b>class</b> InnerRole {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre> Runnable foo() { throw <b>new</b> RuntimeException(); }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">10</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">11</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">12</td>
+ <td><pre>}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">13</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> OuterTeam <b>extends</b> SuperOuter {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">14</td>
+ <td><pre> <b>public</b> <em><b>team</b> <b>class</b> RoleAndTeam</em> {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">15</td>
+ <td><pre> <b>protected</b> <b>class</b> InnerRole {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">16</td>
+ <td><pre> Runnable foo() {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">17</td>
+ <td><pre> <b>class</b> Local {};</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">18</td>
+ <td><pre> <b>return</b> <b>new</b> Runnable() { <span class="comment">// anonymous class definition</span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">19</td>
+ <td><pre> <b>public</b> <b>void</b> run() {}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">20</td>
+ <td><pre> };</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">21</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">22</td>
+ <td><pre> <span class="comment">// <span class="error">class IllegalMember {}</span></span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">23</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">24</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">25</td>
+ <td><pre> <b>public</b> <em><b>team</b> <b>class</b> RoleAndTeamSub</em> {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">26</td>
+ <td><pre> <b>protected</b> <b>class</b> InnerRole {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">27</td>
+ <td><pre> Runnable foo() {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">28</td>
+ <td><pre> <em>RoleAndTeamSub.tsuper</em>.foo();</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">29</td>
+ <td><pre> <b>return</b> <em>OuterTeam.tsuper</em>.foo();</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">30</td>
+ <td><pre> };</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">31</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">32</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">33</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="subsect depth3" id="s1.5.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Nested teams</span></h4>
+ <p>If a role class is also marked using the <code>team</code> modifier,
+ it may contain roles at the next level of nesting.
+
+ </p>
+ <div class="codecomment">
+ <ul>
+ <li>In the above example (<a href="#l1.5" class="listing">Listing 1.5</a>) class <code>RoleAndTeam</code> starting in line 14
+ is a role of <code>OuterTeam</code> and at the same time a
+ team containing a further role <code>InnerRole</code></li>
+ </ul>
+ </div>
+ <p>Such a hybrid role-and-team has all properties of both kinds of classes.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s1.5.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Nested classes of roles</span></h4>
+ <p>A regular role class (ie., not marked as <code>team</code>, see above)
+ may contain local types (see <a href="http://java.sun.com/docs/books/jls/second_edition/html/statements.doc.html#247766"
+ class="ext">JLS &sect;14.3</a>
+ - in the example: class <code>Local</code>), anonymous types
+ (<a href="http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#252986"
+ class="ext">JLS &sect;15.9.5</a>
+ - in the example: class defined in lines 18-20)
+ but no member types (<a href="http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#246026"
+ class="ext">JLS &sect;8.5</a>
+ - in the example: illegal class
+ <code>IllegalMember</code>).
+ <br />
+ The effect is, that nested types of a regular role cannot be
+ used outside the scope of their enclosing role.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s1.5.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Prohibition of cycles</span></h4>
+ <p>A nested team may not extend its own enclosing team.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s1.5.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Prohibition of name clashes</span></h4>
+ <p>A nested team may inherit roles from multiple sources: its explicit super team
+ and any of its implicit super classes (roles) from different levels of nesting.
+ If from different sources a team inherits two or more roles of the same name
+ that are not related by implicit inheritance, this is an illegal name clash.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s1.5.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Precedence among different supers</span></h4>
+ <p>If a role inherits the same feature from several super roles (super and tsuper),
+ an implicitly inherited version always overrides any explicitly inherited feature. <br />
+ Also implicit inheritance alone may produce several candidate methods inherited by a role class.
+ This is a result of team-nesting where each level of nesting may add one more tsuper role.
+ In that case inner team inheritance has precedence over outer team inheritance.
+
+ </p>
+ <div class="codecomment">
+ <table>
+ <colgroup span="1">
+ <col align="left" span="1" />
+ <col align="center" span="1" />
+ </colgroup>
+ <tr>
+ <td valign="top" rowspan="1" colspan="1">
+ <p>In the above example (<a href="#l1.5" class="listing">Listing 1.5</a>) role <code class="small">OuterTeam.RoleAndTeamSub.InnerRole</code> has two direct tsuper roles: <code class="small">OuterTeam.RoleAndTeam.InnerRole</code>&nbsp;and <code class="small">SuperOuter.RoleAndTeamSub.InnerRole</code>. Without the method <code>foo</code> defined in lines 27-30, the enclosing class <code class="small">OuterTeam.RoleAndTeamSub.InnerRole</code> would inherit the method <code>foo</code> defined in line 16, because the inner inheritance between <code>RoleAndTeamSub</code> and <code>RoleAndTeam</code> binds stronger than the outer inheritance between <code>OuterTeam</code> and <code>SuperOuter</code>.
+ </p>
+ </td>
+ <td rowspan="1" colspan="1"><img src="../images/team_nesting_hor.png" alt="Example diagram team nesting" /></td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ <div class="subsect depth3" id="s1.5.f">
+ <h4 class="subsect">(f)&nbsp;<span class="title">Qualified tsuper</span></h4>
+ <p>A role in a nested team may qualify the keyword <code>tsuper</code> (see <a href="s1.3.1.f.html" title="&sect;1.3.1.(f)&nbsp;tsuper" class="sect">&sect;1.3.1.(f)</a> above) by a type name
+ in order to select among different method version inherited from different implicit super classes. A term <code>OuterTeam.tsuper</code> evaluates
+ to the super-class, say <code>SuperOuter</code>, of an enclosing team "<code>OuterTeam</code>". A method call <code>OuterTeam.tsuper.m()</code>
+ evaluates to the method version within <code>SuperOuter</code> that best corresponds to the current method containing the tsuper-call.
+
+ </p>
+ <div class="codecomment">
+ <ul>
+ <li>In the above example (<a href="#l1.5" class="listing">Listing 1.5</a>) line 28 is identical to an unqualified tsuper-call
+ </li>
+ <li>Line 29 selects a corresponding method from the context of <code>SuperOuter</code> resolving to <code>SuperOuter.RoleAndTeamSub.InnerRole.foo()</code></li>
+ </ul>
+ </div>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s1.4.html" rel="prev">&lt;&lt;&nbsp;&sect;1.4&nbsp;Name clashes</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.html
new file mode 100644
index 000000000..1485e7ba8
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s1.html
@@ -0,0 +1,1708 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s0.html" rel="prev">&lt;&lt;&nbsp;&sect;0&nbsp;About this Document</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.html" rel="next">&sect;2&nbsp;Role Binding&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"></div>
+ <div class="chapter" id="s1">
+ <div class="headl">
+ <div class="headr">
+ <h1>&sect;1&nbsp;Teams and Roles</h1>
+ </div>
+ </div>
+ <div id="toc-box">
+ <ul class="toc-box">
+ <li><a href="s1.html">&sect;1&nbsp;Teams and Roles</a></li>
+ <li><a href="#s1.1">&sect;1.1&nbsp;Team classes</a></li>
+ <li><a href="#s1.2">&sect;1.2&nbsp;Role classes and objects</a></li>
+ <li><a href="#s1.3">&sect;1.3&nbsp;Acquisition and implicit inheritance of role classes</a></li>
+ <li><a href="#s1.4">&sect;1.4&nbsp;Name clashes</a></li>
+ <li><a href="#s1.5">&sect;1.5&nbsp;Team and role nesting</a></li>
+ </ul>
+ </div>
+ <div class="intro">
+ <h3>Fundamental concepts of Teams</h3>
+ <div class="line"></div>
+ <div class="term">Teams and Roles</div>
+ <div class="termdesc">Classes that are defined with the modifier <code>team</code>
+ are called team classes, or <strong>teams</strong> for short.<br />
+ Direct inner classes of a team are called role classes, or <strong>roles</strong>
+ for short.
+ </div>
+ <div class="line"></div>
+ <div class="term">Role inheritance</div>
+ <div class="termdesc">Inheritance between teams introduces a special inheritance relationship
+ between their contained roles. The rules of this <strong>implicit inheritance</strong> are given below (<a href="#s1.3.1"
+ title="&sect;1.3.1&nbsp;Acquisition and implicit inheritance of role classes"
+ class="sect">&sect;1.3.1</a>).
+ </div>
+ <div class="line"></div>
+ <div class="term">Externalized role</div>
+ <div class="termdesc">Roles are generally confined to the context of their
+ enclosing team instance. Subject to specific restrictions,
+ a role <em>may</em> be passed outside
+ its team using the concept of externalized roles (<a href="#s1.2.2" title="&sect;1.2.2&nbsp;Externalized roles" class="sect">&sect;1.2.2</a>).
+ </div>
+ <div class="line"></div>
+ </div>
+ <div class="sect depth2" id="s1.1">
+ <h2 class="sect">&sect;1.1&nbsp;Team classes<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;1</a></span></h2>
+ <div class="syntaxlink"><a href="sA.html#sA.1.1" title="&sect;A.1.1&nbsp;ClassDeclaration"
+ class="syntax">&rarr;&nbsp;Syntax&nbsp;&sect;A.1.1</a></div>
+ <p>A class declared with the modifier <code>team</code> is a <em>team class</em> (or team for short).
+
+ </p>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <em><b>team</b> <b>class</b> MyTeamA</em> {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> ...</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <p>Teams are meant as containers for <em>roles</em>, which are defined in the following
+ paragraphs.
+
+ </p>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> MyTeamA {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>public</b> <em><b>class</b> MyRole</em></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> ...</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <p>Teams introduce a new variant of inheritance for contained role classes
+ (see <a href="#s1.3.1"
+ title="&sect;1.3.1&nbsp;Acquisition and implicit inheritance of role classes"
+ class="sect">&sect;1.3.1</a> below).
+ Other properties of teams, which are defined in later sections, are:
+
+ </p>
+ <ul>
+ <li>Team activation (<a href="s5.html" title="&sect;5&nbsp;Team Activation" class="sect">&sect;5</a>)
+ </li>
+ <li>Abstractness and instantiation (<a href="s2.5.html" title="&sect;2.5&nbsp;Abstract Roles" class="sect">&sect;2.5</a>)
+ </li>
+ <li>Declared lifting in team methods (<a href="s2.3.2.html" title="&sect;2.3.2&nbsp;Declared lifting" class="sect">&sect;2.3.2</a>)
+ </li>
+ <li>Reflective functions defined in <code>org.objectteams.ITeam</code> (<a href="s6.1.html" title="&sect;6.1&nbsp;Reflection" class="sect">&sect;6.1</a>)
+ </li>
+ </ul>
+ <p>Apart from these differences, team classes are regular Java classes with
+ methods and fields, whose instances are regular Java objects.
+
+ </p>
+ </div>
+ <div class="sect depth2" id="s1.2">
+ <h2 class="sect">&sect;1.2&nbsp;Role classes and objects<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;1</a></span></h2>
+ <p>Each direct inner class of a team is a role class.
+ Just like inner classes, each instance of a role class has an implicit reference
+ to its enclosing team instance. This reference is immutable.
+ Within the implementation of a role it can be accessed by qualifying the identifier
+ <code>this</code> with the name of the team class, as in:
+
+ </p>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> MyTeamA {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>public</b> <em><b>class</b> MyRole</em> {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>public</b> <b>void</b> print() { System.out.println("Team: "+ <em>MyTeamA.this</em>); }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <p>Creation of role instances is further restricted as defined in
+ <a href="s2.4.html" title="&sect;2.4&nbsp;Explicit role creation" class="sect">&sect;2.4</a>.
+ Teams can also define role interfaces just like role classes.
+ With respect to role specific properties a role interface is treated like a fully
+ abstract class.
+
+ </p>
+ <div class="sect depth3" id="s1.2.1">
+ <h3 class="sect">&sect;1.2.1&nbsp;Modifiers for roles<span class="toplink"><a href="#s1.2">&uarr;&nbsp;&sect;1.2</a></span></h3>
+ <p>Member classes of a team cannot be <code>static</code>.
+ Also the use of access modifiers for roles is restricted and modifiers have different (stronger) semantics than for
+ regular classes (see below). With respect to accessibility a team acts mainly like a package regarding its roles.
+
+ </p>
+ <div class="subsect depth4" id="s1.2.1.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Role class protection</span></h4>
+ <p>A role class must have exactly one of the access modifiers <code>public</code>
+ or <code>protected</code>.<br />
+ This rule does not affect the class modifiers <code>abstract</code>, <code>final</code> and <code>strictfp</code>.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.1.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">protected role classes</span></h4>
+ <p>A <code>protected</code> role can only be accessed from within the enclosing
+ team or any of its sub-teams. The actual border of encapsulation is the
+ enclosing team <em>instance</em>. The rules for protected roles are given
+ in <a href="#s1.2.3" title="&sect;1.2.3&nbsp;Protected roles" class="sect">&sect;1.2.3</a> below.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.1.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">public role classes</span></h4>
+ <p>Only <code>public</code> roles can ever be accessed outside their enclosing team.
+ Accessing a role outside the enclosing team instance is governed by the rules
+ of <strong>externalized roles</strong>, to be defined next (<a href="#s1.2.2" title="&sect;1.2.2&nbsp;Externalized roles" class="sect">&sect;1.2.2</a>).
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.1.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">abstract role classes</span></h4>
+ <p>A role class has to be marked <strong>abstract</strong> if any of its methods
+ is not effective.<br />
+ The <em>methods of a role class</em> comprise direct methods and
+ methods acquired by inheritance.
+ In addition to regular inheritance a role class may acquire methods
+ also via implicit inheritance (<a href="#s1.3.1"
+ title="&sect;1.3.1&nbsp;Acquisition and implicit inheritance of role classes"
+ class="sect">&sect;1.3.1</a>).<br />
+ A method may become <em>effective</em> by either:
+
+ </p>
+ <ul>
+ <li>implementation (i.e., a regular method body), or</li>
+ <li>a callout binding (see <a href="s3.html" title="&sect;3&nbsp;Callout Binding" class="sect">&sect;3</a>).
+ </li>
+ </ul>
+ <p><a href="s2.5.html" title="&sect;2.5&nbsp;Abstract Roles" class="sect">&sect;2.5</a> discusses under which
+ circumstances abstract roles force the enclosing team to be abstract, too.
+
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.1.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Role features</span></h4>
+ <p>Access modifiers for members of roles have some special interpretation:
+
+ </p>
+ <ol>
+ <li>A private member is also visible in any implicit sub role
+ (see implicit inheritance <a href="#s1.3.1.c"
+ title="&sect;1.3.1.(c)&nbsp;Overriding and implicit inheritance"
+ class="sect">&sect;1.3.1.(c)</a>).<br />
+ In contrast to inner classes in Java, private members of a role are not
+ visible to the enclosing team.
+ </li>
+ <li>The default visibility of role members restricts access to the
+ current class and its sub-classes (explicit and implicit).
+ </li>
+ <li><code>protected</code> role members can only be accessed from the enclosing
+ team or via <a href="s4.html" title="&sect;4&nbsp;Callin Binding" class="sect">callin (&sect;4)</a>.
+ </li>
+ <li><code>public</code> role members grant unrestricted access.
+ </li>
+ </ol>
+ <p>Additionally, a role always has access to all the features that its enclosing team has access to.</p>
+ <p>Only <code>public</code> members can ever be accessed via an <a href="#s1.2.2" title="&sect;1.2.2&nbsp;Externalized roles" class="sect">externalized role (&sect;1.2.2)</a>.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.1.f">
+ <h4 class="subsect">(f)&nbsp;<span class="title">Static role methods</span></h4>
+ <p>In contrast to inner classes in pure Java, a role class may indeed define static methods. A static role method requires no
+ role
+ instance <em>but</em> it still requires a team instance in scope. Static role methods can be called:
+
+ </p>
+ <ul>
+ <li>from the enclosing team,</li>
+ <li>via callin (see <a href="s4.7.html" title="&sect;4.7&nbsp;Callin binding with static methods"
+ class="sect">&sect;4.7</a>).
+ </li>
+ </ul>
+ <p>Within a static role method the syntax <code>MyTeam.this</code> is available for accessing the enclosing team instance.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.1.g">
+ <h4 class="subsect">(g)&nbsp;<span class="title">No static initializers</span></h4>
+ <p>A static field of a role class must not have a non-constant initialization expression.
+ Static initialization blocks are already prohibited for inner classes by Java (see <a href="http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#262890"
+ class="ext">JLS &sect;8.1.2</a>).
+
+ </p>
+ <div class="note">
+ <h5>Note:</h5>
+ Static initialization generally provides a means for performing initialization code prior to instantiation, i.e., at
+ class-loading time.
+ Before any role can be created already two levels of initialization are performed: (1) The (outer most) enclosing team
+ class performs static initializations when it is loaded. (2) Any enclosing team executes
+ its constructor when it is instantiated. It should be possible to allocate any early initialization to either of these
+ two phases instead of using static role initializers.
+
+ </div>
+ </div>
+ </div>
+ <div class="sect depth3" id="s1.2.2">
+ <h3 class="sect">&sect;1.2.2&nbsp;Externalized roles<span class="toplink"><a href="#s1.2">&uarr;&nbsp;&sect;1.2</a></span></h3>
+ <div class="syntaxlink"><a href="sA.html#sA.9.2" title="&sect;A.9.2&nbsp;ActualTypeArgument"
+ class="syntax">&rarr;&nbsp;Syntax&nbsp;&sect;A.9.2</a></div>
+ <p>Normally, a team encapsulates its role against unwanted access from the outside.
+ If roles are visible outside their enclosing team instance we speak of
+ <strong>externalized roles</strong>.
+
+ </p>
+ <p>Externalized roles are subject to specific typing rules in order to ensure,
+ that role instances from different team instances cannot be mixed in
+ inconsistent ways. In the presence of implicit inheritance
+ (<a href="#s1.3.1"
+ title="&sect;1.3.1&nbsp;Acquisition and implicit inheritance of role classes"
+ class="sect">&sect;1.3.1</a>) inconsistencies could otherwise occur, which lead
+ to typing errors that could only be detected at run-time.
+ Externalized roles use the theory of
+ "virtual classes" <a href="#fn1-virtual-classes" class="int">[1]</a>,
+ or more specifically
+ "family polymorphism" <a href="#fn2-family-polymorphism" class="int">[2]</a>,
+ in order to achieve the desired type safety.
+ These theories use special forms of <em>dependent types</em>.
+ Externalized roles have <em>types that depend on a team instance</em>.
+
+ </p>
+ <p><a href="#s1.2.3" title="&sect;1.2.3&nbsp;Protected roles" class="sect">&sect;1.2.3</a> deduces even stronger forms of encapsulation
+ from the rules about externalized roles.
+
+ </p>
+ <div class="subsect depth4" id="s1.2.2.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Visibility</span></h4>
+ <p>Only instances of a <code>public</code> role class can ever be externalized.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.2.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Declaration with anchored type</span></h4>
+ <p>Outside a team role types are legal only if denoted relative
+ to an existing team instance (further on called "anchored types").
+ The syntax is:
+ </p>
+ <div class="listing plain"><pre><em>final</em> MyTeam myTeam = <i>expression</i>;
+<em>RoleClass&lt;@myTeam&gt;</em> role = <i>expression</i>;</pre></div>
+ <p>The syntax <code>Type&lt;@anchor&gt;</code> is a special case of a parameterized type, more specifically a <a href="s9.html" title="&sect;9&nbsp;Value Dependent Classes" class="sect">value dependent type (&sect;9)</a>.
+ The type argument (i.e., the expression after the at-sign) can be a simple name or a path. It must refer to an instance
+ of a team class.
+ The role type is said to be <em>anchored</em> to this team instance.<br />
+ The type-part of this syntax (in front of the angle brackets) must be the simple name of a role type directly contained
+ in the given team (including roles that are acquired by implicit inheritance).<br /></p>
+ <div class="note">
+ <h5>Note:</h5>
+ Previous versions of the OTJLD used a different syntax for anchored types, where the role type was prefixed with the anchor
+ expression, separated by a dot (<code>anchor.Type</code>,
+ see <a href="sA.html#sA.6.3" title="&sect;A.6.3&nbsp;AnchoredType" class="sect">&sect;A.6.3</a>). A compiler may still support that path syntax but it should be flagged as being deprecated.
+
+ </div>
+ </div>
+ <div class="subsect depth4" id="s1.2.2.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Immutable anchor</span></h4>
+ <p>Anchoring the type of an externalized role to a team instance
+ requires the team to be referenced by a variable which
+ is marked <code>final</code> (i.e., immutable).
+ The type anchor can be a path <code>v.f1.f2...</code> where
+ <code>v</code> is any final variable and <code>f1</code> ...
+ are final fields.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.2.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Implicit type anchors</span></h4>
+ <p>The current team instance can be used as a default anchor
+ for role types:
+
+ </p>
+ <ol>
+ <li>In non-static team level methods role types are by default interpreted as anchored to <code>this</code> (referring to the team instance). I.e., the following two declarations express the same:
+
+ <div class="listing plain"><pre><b>public</b> RoleX getRoleX (RoleY r) { <i> stmts </i> }
+<b>public</b> RoleX&lt;@<em>this</em>&gt; getRoleX (RoleY&lt;@<em>this</em>&gt; r) { <i> stmts </i> }</pre></div>
+ </li>
+ <li>
+ In analogy, <em>role methods</em> use the enclosing team instance as the
+ default anchor for any role types.
+ </li>
+ </ol>
+ <p>Note, that <code>this</code> and <code><em>Outer</em>.this</code> are always
+ <code>final</code>.<br />
+ The compiler uses the pseudo identifier <strong><code>tthis</code></strong> to denote
+ such implicit type anchors in error messages.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.2.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Conformance</span></h4>
+ <p>Conformance between
+ two types <code>RoleX&lt;@teamA&gt;</code> and <code>RoleY&lt;@teamB&gt;</code>
+ not only requires the role types to be compatible, but also
+ the team instances to be provably <em>the same object</em>.
+ The compiler must be able to statically analyze anchor identity.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.2.f">
+ <h4 class="subsect">(f)&nbsp;<span class="title">Substitutions for type anchors</span></h4>
+ <p>Only two substitutions are considered for determining
+ team identity:
+
+ </p>
+ <ol>
+ <li>
+ For type checking the application of team methods,
+ <code>this</code> is <strong>substituted</strong> by the actual call target.
+ For role methods a reference of the form <code><em>Outer</em>.this</code>
+ is substituted by the enclosing instance of the call target.
+
+ </li>
+ <li>Assignments from a <code>final</code> identifier
+ to another <code>final</code> identifier are transitively
+ followed, i.e., if <code>t1, t2</code> are final,
+ after an assignment <code>t1=t2</code>
+ the types <code>R&lt;@t1&gt;</code> and <code>R&lt;@t2&gt;</code> are considered
+ identical. Otherwise <code>R&lt;@t1&gt;</code> and <code>R&lt;@t2&gt;</code>
+ are incommensurable.<br />
+ Attaching an actual parameter to a formal parameter in a
+ method call is also considered as an assignment with respect to
+ this rule.
+
+ </li>
+ </ol>
+ </div>
+ <div class="subsect depth4" id="s1.2.2.g">
+ <h4 class="subsect">(g)&nbsp;<span class="title">Legal contexts</span></h4>
+ <p>Anchored types for externalized roles may be used in the
+ following contexts:
+
+ </p>
+ <ol>
+ <li>Declaration of an attribute</li>
+ <li>Declaration of a local variable</li>
+ <li>Declaration of a parameter or result type
+ of a method or constructor
+ </li>
+ <li>In the <code>playedBy</code> clause of a role class
+ (see <a href="s2.1.html" title="&sect;2.1&nbsp;playedBy relation" class="sect">&sect;2.1</a>).
+ </li>
+ </ol>
+ <p>It is not legal to inherit from an anchored type, since
+ this would require membership of the referenced team instance,
+ which can only be achieved by class nesting.
+
+ </p>
+ <div class="note">
+ <h5>Note:</h5>
+ Item 4.
+ &mdash; within the given restriction &mdash; admits the case where
+ the same class is a role of one team and the base class for
+ the role of another team. Another form of nesting is
+ defined in <a href="#s1.5" title="&sect;1.5&nbsp;Team and role nesting" class="sect">&sect;1.5</a>.
+
+ </div>
+ </div>
+ <div class="subsect depth4" id="s1.2.2.h">
+ <h4 class="subsect">(h)&nbsp;<span class="title">Externalized creation</span></h4>
+ <p>A role can be created as externalized using either of these equivalent forms:</p>
+ <div class="listing plain"><pre>outer.<b>new</b> Role()
+<b>new</b> Role&lt;@outer&gt;()</pre></div>
+ <p>This requires the enclosing instance <code>outer</code> to be
+ declared <code>final</code>. The expression has the
+ type <code>Role&lt;@outer&gt;</code> following the rules of
+ externalized roles.<br />
+ The type <code>Role</code> in this expression must be a simple
+ (unqualified) name.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.2.i">
+ <h4 class="subsect">(i)&nbsp;<span class="title">No import</span></h4>
+ <p>It is neither useful nor legal to import a role type.<br /></p>
+ <div class="note">
+ <h5>Rationale:</h5>
+ Importing a type allows to use the unqualified name in situations that would otherwise require to use the fully qualified
+ name,
+ i.e., the type prefixed with its containing package and enclosing class. Roles, however are contained in a team <i>instance</i>.
+ Outside their team, role types can only be accessed using an anchored type which uses a team instance to qualify the
+ role type.
+ Relative to this team anchor, roles are <i>always</i> denoted using their simple name, which makes importing roles useless.
+
+ </div>
+ <p>A static import for a constant declared in a role is, however, legal.
+
+ </p>
+ </div>
+ <h5 class="listing">Example code (Externalized Roles):</h5>
+ <div class="listing example frame" id="l1.2.2-1">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>team</b> <b>class</b> FlightBonus <b>extends</b> Bonus {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>public</b> <b>class</b> Subscriber {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>void</b> clearCredits() { ... }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> <b>void</b> unsubscribe(Subscriber subscr) { ... }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="listing example frame" id="l1.2.2-2">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre><b>class</b> ClearAction <b>extends</b> Action {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre> <em>final</em> FlightBonus context;</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre> <em>Subscriber&lt;@context&gt;</em> subscriber;</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">10</td>
+ <td><pre> ClearAction (<em>final</em> FlightBonus bonus, <em>Subscriber&lt;@bonus&gt;</em> subscr) {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">11</td>
+ <td><pre> context = bonus; <span class="comment">// unique assignment to 'context'</span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">12</td>
+ <td><pre> subscriber = subscr;</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">13</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">14</td>
+ <td><pre> <b>void</b> actionPerformed () {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">15</td>
+ <td><pre> subscriber.clearCredits();</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">16</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">17</td>
+ <td><pre> <b>protected</b> <b>void</b> finalize () {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">18</td>
+ <td><pre> context.unsubscribe(subscriber);</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">19</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">20</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="codecomment">
+ <h5>Effects:</h5>
+ <ul>
+ <li>Lines 1-6 show a terse extract of a published example
+ <a href="http://www.objectteams.org/publications/index.html#NODe02" class="ext">[NODe02]</a>. Here passengers can be subscribers in a flight bonus program.
+ </li>
+ <li>Lines 7-20 show a sub-class of <code>Action</code> which is
+ used to associate the action of resetting a subscriber's credits
+ to a button or similar element in an application's GUI.
+ </li>
+ <li>Attribute <code>context</code> (line 8) and parameter
+ <code>bonus</code> (line 10) serve as anchor for the type of
+ externalized roles.
+ </li>
+ <li>Attribute <code>subscriber</code> (line 9) and parameter
+ <code>subscr</code> (line 10) store a Subscriber role outside the
+ FlightBonus team.
+ </li>
+ <li>In order to type-check the assignment in line 12, the compiler
+ has to ensure that the types of LHS and RHS are anchored to
+ the same team instance. This can be verified by checking that
+ both anchors are indeed <code>final</code> and prior to the
+ role assignment a team assignment has taken place (line 11).<br /><span class="underline">Note,</span> that the Java rules for <strong>definite assignments</strong> to
+ final variables ensure that exactly one assignment to a variable occurs
+ prior to its use as type anchor. No further checks are needed.
+
+ </li>
+ <li>It is now legal to store this role reference and use it at
+ some later point in time, e.g., for invoking method
+ <code>clearCredits</code> (line 15).
+ This method call is also an example for implicit team activation
+ (<a href="s5.3.b.html" title="&sect;5.3.(b)&nbsp;Methods of externalized roles"
+ class="sect">&sect;5.3.(b)</a>).
+
+ </li>
+ <li>Line 18 demonstrates how an externalized role can be
+ passed to a team level method. The signature of <code>unsubscribe</code>
+ is for this call expanded to
+ <div class="indent">
+ void unsubscribe(Subscriber&lt;@context&gt; subscr)
+
+ </div>
+ (by substituting the call target <code>context</code> for
+ <code>this</code>). This proves identical types for actual and
+ formal parameters.
+ </li>
+ </ul>
+ </div>
+ </div>
+ <div class="sect depth3" id="s1.2.3">
+ <h3 class="sect">&sect;1.2.3&nbsp;Protected roles<span class="toplink"><a href="#s1.2">&uarr;&nbsp;&sect;1.2</a></span></h3>
+ <p>Roles can only be <code>public</code> or <code>protected</code>.
+ A <code>protected</code> role is encapsulated
+ by its enclosing team instance. This is enforced by these rules:
+
+ </p>
+ <div class="subsect depth4" id="s1.2.3.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Importing role classes</span></h4>
+ <p><i>This rule is superseded by <a href="#s1.2.2.i" title="&sect;1.2.2.(i)&nbsp;No import" class="sect">&sect;1.2.2.(i)</a></i></p>
+ </div>
+ <div class="subsect depth4" id="s1.2.3.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Qualified role types</span></h4>
+ <p>The name of a <code>protected</code> role class may never be used qualified, neither
+ prefixed by its <em>enclosing type</em> nor parameterized by a <em>variable as type anchor</em> (cf. <a href="#s1.2.2.a" title="&sect;1.2.2.(a)&nbsp;Visibility" class="sect">&sect;1.2.2.(a)</a>).
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.3.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Mixing qualified and unqualified types</span></h4>
+ <p>An externalized role type is never compatible to an unqualified role type,
+ except for the substitutions in <a href="#s1.2.2.f"
+ title="&sect;1.2.2.(f)&nbsp;Substitutions for type anchors"
+ class="sect">&sect;1.2.2.(f)</a>, where
+ an explicit anchor can be matched with the implicit anchor <code>this</code>.
+
+ </p>
+ </div>
+ <p>Rules (a) and (b) ensure that the name of a protected role class cannot be used
+ outside the lexical scope of its enclosing team. Rule (c) ensures that team methods
+ containing unqualified role types in their signature cannot be invoked on a team other
+ than the current team. Accordingly, for role methods the team context must be the
+ enclosing team instance.
+
+ </p>
+ <div class="subsect depth4" id="s1.2.3.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Levels of encapsulation</span></h4>
+ <p>Since protected role types can not be used for externalization, instances of these types are already quite effectively encapsulated
+ by their enclosing team.
+ Based on this concept, encapsulation for protected roles can be made even stricter by the rules of <em>role confinement</em>.
+ On the contrary, even protected roles can be externalized as <em>opaque roles</em> which still expose (almost) no information.
+ Confinement and opaque roles are subject of <a href="s7.html" title="&sect;7&nbsp;Role Encapsulation" class="sect">&sect;7</a>.
+
+ </p>
+ </div>
+ </div>
+ <div class="sect depth3" id="s1.2.4">
+ <h3 class="sect">&sect;1.2.4&nbsp;Type tests and casts<span class="toplink"><a href="#s1.2">&uarr;&nbsp;&sect;1.2</a></span></h3>
+ <p>In accordance with <a href="#s1.2.2.e" title="&sect;1.2.2.(e)&nbsp;Conformance" class="sect">&sect;1.2.2.(e)</a>, in OT/J
+ the <code>instanceof</code> operator and type casts have extended semantics for roles.
+
+ </p>
+ <div class="subsect depth4" id="s1.2.4.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">instanceof</span></h4>
+ <p>For role types the <code>instanceof</code> operator yields true only if
+ both components of the type match: the dynamic role type must be compatible
+ to the given static type, and also type anchors must be the same instance.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.4.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Casting</span></h4>
+ <p>Casts may also fail if the casted expression is anchored to a different
+ team instance than the cast type. Such failure is signaled by a
+ <code>org.objectteams.RoleCastException</code>.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.4.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Class literal</span></h4>
+ <p>A class literal of form <code>R.class</code> is dynamically bound to the class <code>R</code>
+ visible in the current instance context. Using a class literal for a role outside its
+ enclosing team instance (see <a href="#s1.2.2" title="&sect;1.2.2&nbsp;Externalized roles" class="sect">&sect;1.2.2</a>) requires the following syntax:
+
+ </p>
+ <div class="listing plain"><pre>RoleClass<em>&lt;@teamAnchor&gt;</em><strong>.class</strong></pre></div>
+ </div>
+ </div>
+ <div class="sect depth3" id="s1.2.5">
+ <h3 class="sect">&sect;1.2.5&nbsp;File structure<span class="toplink"><a href="#s1.2">&uarr;&nbsp;&sect;1.2</a></span></h3>
+ <p>Just like regular inner classes, role classes may be inlined in the
+ source code of the enclosing team. As an alternative style it is possible
+ to store role classes in separate <strong>role files</strong> according to the following rules:
+
+ </p>
+ <div class="subsect depth4" id="s1.2.5.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Role directory</span></h4>
+ <p>In the directory of the team class a new directory is created
+ which has the same name as the team without the <tt>.java</tt> suffix.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.5.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Role files</span></h4>
+ <p>Role classes are stored in this directory (a). The file names are
+ derived from the role class name extended by <tt>.java</tt>.<br />
+ A role file must contain exactly one top-level type.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.5.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">package statement</span></h4>
+ <p>A role class in a role file declares as its package the fully qualified
+ name of the enclosing team class. The package statement of a role file
+ must use the <code>team</code> modifier as its first token.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.5.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Reference to role file</span></h4>
+ <p>A team should mention in its javadoc comment each role class which
+ is stored externally using a <tt>@role</tt> tag.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.5.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Legal types in role files</span></h4>
+ <p>The type in a role file must not be an <code>enum</code>.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.2.5.f">
+ <h4 class="subsect">(f)&nbsp;<span class="title">Imports in role files</span></h4>
+ <p>A role file may have imports of its own.
+ Within the role definition these imports are visible <em>in addition</em> to all imports of the enclosing team.
+ Only <code>base</code> imports (see <a href="s2.1.2.d.html" title="&sect;2.1.2.(d)&nbsp;Base imports" class="sect">&sect;2.1.2.(d)</a>)
+ <em>must</em> be defined in the team.
+ </p>
+ </div>
+ <p>Semantically, there is no difference between inlined role classes and those
+ stored in separate role files.
+
+ </p>
+ <div class="note">
+ <h5>Note:</h5>
+ Current Java compilers disallow a type to have the same fully qualified
+ name as a package. However, the JLS does not seem to make a statement in this respect.
+ In OT/J, a package and a type are interpreted as being the same team, if both have the
+ same fully qualified name and both have the <code>team</code> modifier.
+
+ </div>
+ <h5 class="listing">Role file example:</h5>
+ <div class="listing example frame" id="l1.2.5-1">
+ <table class="listing">
+ <tr class="lhead">
+ <td colspan="2">in file <code>org/objectteams/examples/MyTeamA.java</code> :
+ </td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>package</b> org.objectteams.examples;</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre><span class="comment">/**</span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <span class="comment">* @author Stephan Herrmann</span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <span class="comment">* @date 20.02.2007</span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> <span class="comment">* @file MyTeamA.java</span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> <span class="comment">* <em>@role MyRole</em></span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> <span class="comment">*/</span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> MyTeamA {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre> ...</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">10</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="listing example frame" id="l1.2.5-2">
+ <table class="listing">
+ <tr class="lhead">
+ <td colspan="2">in file <code>org/objectteams/examples<strong class="blue">/MyTeamA/MyRole.java</strong></code>:
+ </td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><em><b>team</b> <b>package</b> org.objectteams.examples.MyTeamA;</em></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre><b>public</b> <b>class</b> MyRole {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> ...</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ </div>
+ <div class="sect depth2" id="s1.3">
+ <h2 class="sect">&sect;1.3&nbsp;Acquisition and implicit inheritance of role classes<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;1</a></span></h2>
+ <p> Every team class implicitly implements the predefined interface <code>org.objectteams.ITeam</code>.
+ If a team class has no explicit <code>extends</code> clause it implicitly extends <code>org.objectteams.Team</code>,
+ thus providing implementations for the methods in <code>org.objectteams.ITeam</code>.
+ If a team class extends a non-team class, the compiler implicitly adds implementations for all methods declared
+ in <code>org.objectteams.ITeam</code> to the team class.
+ Any subclass of a team (including <code>org.objectteams.Team</code>) must again be a team.
+ Interface implementation is not affected by this rule.
+
+ </p>
+ <p>Infrastructure provided via interface <code>org.objectteams.ITeam</code> is presented in <a href="s6.html" title="&sect;6&nbsp;Object Teams API" class="sect">&sect;6</a>.
+
+ </p>
+ <div class="sect depth3" id="s1.3.1">
+ <h3 class="sect">&sect;1.3.1&nbsp;Acquisition and implicit inheritance of role classes<span class="toplink"><a href="#s1.3">&uarr;&nbsp;&sect;1.3</a></span></h3>
+ <p>A team acquires all roles from its super-team. This relation is
+ similar to inheritance of inner classes, but with a few decisive
+ differences as defined next. Two implementation options are mentioned <a href="#aux1.1" class="int">below</a>,
+ which can be used to realize the special semantics of role
+ acquisition (virtual classes and copy inheritance).
+
+ </p>
+ <h5 class="listing">Implicit role inheritance</h5>
+ <div class="listing example frame" id="l1.3.1-1">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> S {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>protected</b> <b>class</b> R0 {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>protected</b> <b>class</b> R1 <em><b>extends</b> R0</em> {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <b>boolean</b> ok;</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> R2 m() {...}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> <b>void</b> n(<em>R2</em> r) {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre> <b>protected</b> <b>class</b> R2 {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="listing example frame" id="l1.3.1-2">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">10</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> T <em><b>extends</b> S</em> {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">11</td>
+ <td><pre> @Override <b>protected</b> <em><b>class</b> R1</em> {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">12</td>
+ <td><pre> <strong>R2</strong> m() {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">13</td>
+ <td><pre> if(<em>ok</em>) { <b>return</b> <em>tsuper</em>.m(); }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">14</td>
+ <td><pre> <b>else</b> { <b>return</b> null; }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">15</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">16</td>
+ <td><pre> <b>void</b> doIt() {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">17</td>
+ <td><pre> n(m());</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">18</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">19</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">20</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="subsect depth4" id="s1.3.1.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Role class acquisition</span></h4>
+ <p>A team <code>T</code> which extends a super-team <code>S</code>
+ has one role class <code>T.R</code> corresponding to each role <code>S.R</code>
+ of the super-team.
+ The new type <code>T.R</code>&nbsp;<strong>overrides</strong>&nbsp;<code>R</code> for the
+ context of <code>T</code> and its roles.
+ Acquisition of role classes can either be direct (see (b) below), or
+ it may involve overriding and implicit inheritance ((c) below).
+
+ </p>
+ <div class="codecomment">In the above example (<a href="#l1.3.1-1" class="listing">Listing 1.3.1-1</a>) the team <code>S</code> operates
+ on types <code>S.R0</code>, <code>S.R1</code> and <code>S.R2</code>,
+ while <code>T</code> operates on types <code>T.R0</code>, <code>T.R1</code>
+ and <code>T.R2</code>.<br /><em>(Type references like "<code>S.R0</code>" are actually illegal in source code
+ (<a href="#s1.2.3.b" title="&sect;1.2.3.(b)&nbsp;Qualified role types"
+ class="sect">&sect;1.2.3.(b)</a>). Here they are used for explanatory purposes only)</em></div>
+ </div>
+ <div class="subsect depth4" id="s1.3.1.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Direct role acquisition</span></h4>
+ <p>Within a sub-team <code>T</code> each role <code>S.R</code> of its
+ super-team <code>S</code> is available by the simple name <code>R</code>
+ without further declaration.
+
+ </p>
+ <div class="codecomment">The role <code>R2</code> in <a href="#l1.3.1-1" class="listing">Listing 1.3.1-1</a> can be used in the sub-team
+ <code>T</code> (line 12), because this role type is defined in the super class of the enclosing team.
+
+ </div>
+ </div>
+ <div class="subsect depth4" id="s1.3.1.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Overriding and implicit inheritance</span></h4>
+ <p>If a team contains a role class definition by the same name as
+ a role defined in its super-team,
+ the new role class overrides the corresponding role from the super-team
+ and <strong>implicitly inherits</strong> all of its features.
+ Such relation is established only by name correspondence.
+
+ </p>
+ <p>A role that overrides an inherited role should be marked with an <code>@Override</code> annotation.
+ A compiler should optionally flag a missing <code>@Override</code> annotation with a warning.
+ Conversely, it is an error if a role is marked with an <code>@Override</code> annotation but does not actually
+ override an inherited role.
+
+ </p>
+ <p>It is an error to override a role class with an interface or vice versa. A final role cannot be overridden.<br />
+ Unlike regular inheritance, <strong>constructors</strong> are also inherited
+ along implicit inheritance, and can be overridden just like normal methods.
+
+ </p>
+ <div class="codecomment">
+ In <a href="#l1.3.1-1" class="listing">Listing 1.3.1-1</a><code> R1</code> in <code>T</code> implicitly inherits all features of
+ <code>R1</code> in <code>S</code>. This is, because its enclosing team
+ <code>T</code> extends the team <code>S</code> (line 10) and the role
+ definition uses the same name <code>R1</code> (line 11).
+ Hence the attribute <code><strong>ok</strong></code> is available in the method
+ <code>m()</code> in <code>T.R1</code> (line 13). <code>T.R1</code> also overrides <code>S.R1</code>
+ which is marked by the <code>@Override</code> annotation in line 11.
+
+ </div>
+ </div>
+ <div class="subsect depth4" id="s1.3.1.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Lack of subtyping</span></h4>
+ <p>Direct acquisition of roles from a super-team and implicit inheritance
+ do not establish a <strong>subtype</strong> relation.
+ A role of a given team is never conform (i.e., substitutable)
+ to any role of any <em>other</em> team.
+ <code>S.R</code> and <code>T.R</code> are always incommensurable.<br /><span class="underline">Note,</span> that this rule is a direct consequence of <a href="#s1.2.2.e" title="&sect;1.2.2.(e)&nbsp;Conformance" class="sect">&sect;1.2.2.(e)</a>.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.3.1.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Dynamic binding of types</span></h4>
+ <p>Overriding an acquired role by a new role class has the following
+ implication: If an expression or declaration, which is evaluated on behalf of
+ an instance of team <code>T</code> or one of its contained roles,
+ refers to a role <code>R</code>, <code>R</code> will always
+ resolve to <code>T.R</code> even if <code>R</code> was introduced in
+ a super-team of <code>T</code> and even if the specific line of code
+ was inherited from a super-team or one of its roles.
+ Only the dynamic type of the enclosing team-instance is used to determine
+ the correct role class (see below for an example).
+
+ </p>
+ <p>A special case of dynamically binding role types relates to so-called class literals
+ (see <a href="http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#251530"
+ class="ext">JLS &sect;15.8.2</a>).
+ Role class literals are covered in <a href="s6.1.c.html" title="&sect;6.1.(c)&nbsp;Class literals for roles"
+ class="sect">&sect;6.1.(c)</a>.
+
+ </p>
+ <p>The above is strictly needed only for cases involving implicit inheritance.
+ It may, however, help intuition, to also consider the directly acquired
+ role <code>T.R</code> in (b) to override the given role <code>S.R</code>.
+
+ </p>
+ <div class="codecomment">
+ In line 17 of <a href="#l1.3.1-1" class="listing">Listing 1.3.1-1</a> the implicitly inherited method <code>n</code> is called
+ with the result of an invocation of <code>m</code>. Although
+ <code>n</code> was defined in <code>S</code> (thus with argument type
+ <code>S.R2, see line 6</code>) in the context of <code>T</code> it
+ expects an argument of <code>T.R2</code>. This is correctly provided by
+ the invocation of <code>m</code> in the context of <code>T</code>.
+
+ </div>
+ </div>
+ <div class="subsect depth4" id="s1.3.1.f">
+ <h4 class="subsect">(f)&nbsp;<span class="title">tsuper</span></h4>
+ <div class="syntaxlink"><a href="sA.html#sA.5.4" title="&sect;A.5.4&nbsp;TSuperCall" class="syntax">&rarr;&nbsp;Syntax&nbsp;&sect;A.5.4</a></div>
+ <p>Super calls along implicit inheritance use the new keyword
+ <strong>tsuper</strong>. While <code>super</code> is still available
+ along regular inheritance, a call <code>tsuper.m()</code>
+ selects the version of <code>m</code> of the corresponding role
+ acquired from the super-team.
+
+ </p>
+ <p>See <a href="s2.4.2.html"
+ title="&sect;2.4.2&nbsp;Role creation via a regular constructor"
+ class="sect">&sect;2.4.2</a> for <code>tsuper</code>
+ in the context of role constructors.
+
+ </p>
+ <p><code>tsuper</code> can only be used to invoke a corresponding
+ version of the enclosing method or constructor, i.e., an expression
+ <code>tsuper.m()</code> may only occur within the method <code>m</code>
+ with both methods having the same signature
+ (see <a href="s2.3.2.b.html"
+ title="&sect;2.3.2.(b)&nbsp;Super in the context of declared lifting"
+ class="sect">&sect;2.3.2.(b)</a> for an exception, where both methods have slightly different signatures).
+
+ </p>
+ <div class="codecomment">
+ In <a href="#l1.3.1-1" class="listing">Listing 1.3.1-1</a> the role <code>R1</code> in team <code>T</code>
+ overrides the implicitly inherited method <code>m()</code> from <code>S</code>. <code><strong>tsuper</strong>.m()</code> calls the overridden method <code>m()</code>
+ from <code>S.R1</code> (line 13).
+
+ </div>
+ </div>
+ <div class="subsect depth4" id="s1.3.1.g">
+ <h4 class="subsect">(g)&nbsp;<span class="title">Implicitly inheriting super-types</span></h4>
+ <p>If a role class has an explicit super class (using <code>extends</code>)
+ this relation is inherited along implicit inheritance.
+
+ </p>
+ <div class="codecomment">
+ In <a href="#l1.3.1-1" class="listing">Listing 1.3.1-1</a> the role <code>R1</code> in <code>T</code> has <code>T.R0</code>
+ as its implicitly inherited super class, because the corresponding role in the super-team
+ <code><strong>extends R0</strong></code> (line 3).
+
+ </div>
+ <p>Overriding an implicitly inherited super class is governed by
+ <a href="#s1.3.2.b"
+ title="&sect;1.3.2.(b)&nbsp;Inheriting and overriding the extends clause"
+ class="sect">&sect;1.3.2.(b)</a>, below.<br />
+ The list of implemented interfaces is merged along implicit
+ inheritance.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.3.1.h">
+ <h4 class="subsect">(h)&nbsp;<span class="title">Preserving visibility</span></h4>
+ <p>A role class must provide at least as much access as the implicit super role,
+ or a compile-time error occurs (this is in analogy to <a href="http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#227965"
+ class="ext">JLS &sect;8.4.6.3</a>).
+ Access rights of methods overridden by implicit inheritance follow
+ the same rules as for normal overriding.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.3.1.i">
+ <h4 class="subsect">(i)&nbsp;<span class="title">Dynamic binding of constructors</span></h4>
+ <p>When creating a role instance using <code>new</code> not only the
+ type to instantiate is bound dynamically (cf. <a href="#s1.3.1.e" title="&sect;1.3.1.(e)&nbsp;Dynamic binding of types"
+ class="sect">&sect;1.3.1.(e)</a>), but also the constructor to
+ invoke is dynamically bound in accordance to the concrete
+ type.<br />
+ Within role constructors all <code>this(..)</code> and
+ <code>super(..)</code> calls are bound statically with respect to explicit inheritance
+ and dynamically with respect to implicit inheritance. This means the target role name is
+ determined statically, but using that name the suitable role type is determined
+ using dynamic binding.
+ <br />
+ See also <a href="s2.5.a.html"
+ title="&sect;2.5.(a)&nbsp;Using abstract classes for creation"
+ class="sect">&sect;2.5.(a)</a> on using constructors of abstract role classes.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.3.1.j">
+ <h4 class="subsect">(j)&nbsp;<span class="title">Overriding and compatibility</span></h4>
+ <p>The rules of <a href="http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#228745"
+ class="ext">JLS &sect;8.4.6</a>
+ also apply to methods <em>and constructors</em> inherited via implicit inheritance.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.3.1.k">
+ <h4 class="subsect">(k)&nbsp;<span class="title">Covariant return types</span></h4>
+ <p>Given a team <code>T1</code> with two roles <code>R1</code> and <code>R2</code> where <code>R2</code> explicitly inherits from <code>R1</code>, both roles defining
+ a method <code>m</code> returning some type <code>A</code>.
+ Given also a sub-team of <code>T1</code>, <code>T2</code>, where <code>T2.R1</code> overrides <code>m</code> with a covariant return type <code>B</code>
+ (sub-type of <code>A</code>):
+
+ </p>
+ <div class="listing plain"><pre> <b>public</b> <b>team</b> <b>class</b> T1 {
+ <b>protected</b> <b>abstract</b> <b>class</b> R1 {
+ <b>abstract</b> A m();
+ }
+ <b>protected</b> <b>class</b> R2 <b>extends</b> R1 {
+ A m() { <b>return</b> <b>new</b> A(); }
+ }
+ }
+ <b>public</b> <b>team</b> <b>class</b> T2 <b>extends</b> T1 {
+ <b>protected</b> <b>class</b> R1 {
+ @Override B m() { <b>return</b> <b>new</b> B(); } <span class="error">// this declaration renders <b>class</b> T2.R2 illegal</span>
+ }
+ }</pre></div>
+ <p>
+ In this situation role <code>T2.R2</code> will be illegal unless also overriding <code>m</code> with a return type that is at least <code>B</code>.
+ Note, that the actual error occurs at the implicitly inherited method <code>T2.R2.m</code> which is not visible in the source code,
+ even <code>T2.R2</code> need not be mentioned explicitly in the source code.
+ A compiler should flag this as an imcompatibility at the team level, because a team must specialize inherited roles
+ in a consistent way.
+
+ </p>
+ </div>
+ <h5 class="listing">Example code (Teams and Roles):</h5>
+ <div class="listing example frame" id="l1.3.1-3">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> MyTeamA {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>protected</b> <b>class</b> MyRole {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> String name;</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <b>public</b> MyRole (String n) { name = n; }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> <b>public</b> <b>void</b> print() { System.out.println("id="+name); }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> <b>protected</b> MyRole getRole() { <b>return</b> <b>new</b> MyRole("Joe"); }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="listing example frame" id="l1.3.1-4">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">10</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> MySubTeam <b>extends</b> MyTeamA {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">11</td>
+ <td><pre> <b>protected</b> <b>class</b> MyRole {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">12</td>
+ <td><pre> <b>int</b> age;</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">13</td>
+ <td><pre> <b>public</b> <b>void</b> setAge(<b>int</b> a) { age = a; }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">14</td>
+ <td><pre> <b>public</b> <b>void</b> print() {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">15</td>
+ <td><pre> tsuper.print();</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">16</td>
+ <td><pre> System.out.println("age="+age);</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">17</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">18</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">19</td>
+ <td><pre> <b>public</b> <b>void</b> doit() {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">20</td>
+ <td><pre> MyRole r = getRole();</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">21</td>
+ <td><pre> r.setAge(27);</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">22</td>
+ <td><pre> r.print();</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">23</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">24</td>
+ <td><pre>}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">25</td>
+ <td><pre>...</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">26</td>
+ <td><pre>MySubTeam myTeam = <b>new</b> MySubTeam();</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">27</td>
+ <td><pre>myTeam.doit();</pre></td>
+ </tr>
+ </table>
+ </div>
+ <h5 class="listing">Program output</h5>
+ <div class="listing example frame"><pre>id=Joe
+age=27</pre></div>
+ <div class="codecomment">
+ <h5>Effects:</h5>
+ <ul>
+ <li>According to <a href="#s1.3"
+ title="&sect;1.3&nbsp;Acquisition and implicit inheritance of role classes"
+ class="sect">&sect;1.3</a>, <code>MyTeamA</code> implements
+ <code>ITeam</code> (line 1).
+ </li>
+ <li>An implicit role inheritance is created for
+ <code>MySubTeam.MyRole</code> (<a href="#s1.3.1.c"
+ title="&sect;1.3.1.(c)&nbsp;Overriding and implicit inheritance"
+ class="sect">&sect;1.3.1.(c)</a>; line&nbsp;11).<br />
+ If we visualize this special inheritance using a fictitious keyword
+ <code>overrides</code> the compiler would see a declaration:
+
+ <div class="listing plain"><pre><b>protected</b> <b>class</b> MyRole <em>overrides MyTeamA.MyRole</em> { ... }</pre></div>
+ </li>
+ <li>Invoking <code>getRole()</code> on <code>myTeam</code> (line&nbsp;27, 20)
+ creates an instance of <code>MySubTeam.MyRole</code> because the
+ acquired role <code>MyTeamA.MyRole</code> is overridden by
+ <code>MySubTeam.MyRole</code>
+ following the rules of implicit inheritance (cf. <a href="#s1.3.1.e" title="&sect;1.3.1.(e)&nbsp;Dynamic binding of types"
+ class="sect">&sect;1.3.1.(e)</a>).
+
+ </li>
+ <li>Overriding of role methods and access to inherited features works as usual.
+
+ </li>
+ <li>As an example for <a href="#s1.3.1.f" title="&sect;1.3.1.(f)&nbsp;tsuper" class="sect">&sect;1.3.1.(f)</a> see the call <code>tsuper.print()</code>
+ (line&nbsp;15), which selects the implementation of <code>MyTeamA.MyRole.print</code>.
+
+ </li>
+ </ul>
+ </div>
+ </div>
+ <div class="sect depth3" id="s1.3.2">
+ <h3 class="sect">&sect;1.3.2&nbsp;Regular role inheritance<span class="toplink"><a href="#s1.3">&uarr;&nbsp;&sect;1.3</a></span></h3>
+ <p>In addition to implicit inheritance, roles may also inherit using
+ the standard Java keyword <code>extends</code>. These restrictions apply:
+
+ </p>
+ <div class="subsect depth4" id="s1.3.2.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Super-class restrictions</span></h4>
+ <p>If the super-class of a role is again a role it must be a direct role of
+ an enclosing team
+ This rule is simply enforced by disallowing type anchors in the
+ <code>extends</code> clause
+ (see <a href="#s1.2.2.g" title="&sect;1.2.2.(g)&nbsp;Legal contexts" class="sect">&sect;1.2.2.(g)</a>).
+ As an effect, the super-class may never be more deeply nested than the sub-class.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.3.2.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Inheriting and overriding the extends clause</span></h4>
+ <p>If a role overrides another role by implicit inheritance, it may
+ change the inherited <code>extends</code> clause
+ (see <a href="#s1.3.1.g"
+ title="&sect;1.3.1.(g)&nbsp;Implicitly inheriting super-types"
+ class="sect">&sect;1.3.1.(g)</a> above) only if the new super-class
+ is a sub-class of the class in the overridden extends clause.
+ I.e., an implicit sub-role may <em>specialize</em> the extends clause of its
+ implicit super-role.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.3.2.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Constructors and overridden 'extends' </span></h4>
+ <p>Each constructor of a role class that overrides the extends clause of its
+ implicit super-role must invoke a constructor of this newly introduced
+ explicit super-class. Thus it may not use a <code>tsuper</code> constructor
+ (see <a href="s2.4.2.html"
+ title="&sect;2.4.2&nbsp;Role creation via a regular constructor"
+ class="sect">&sect;2.4.2</a>).
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.3.2.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Adding implemented interfaces</span></h4>
+ <p><code>implements</code> declarations are additive, i.e., an implicit
+ sub-role may add more interfaces but has to implement all interfaces of
+ its implicit super-role, too.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s1.3.2.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Visibility of inherited methods</span></h4>
+ <p>
+ When a role inherits non-public methods from a regular class (as its super class),
+ these methods are considered as private for the role, i.e., they can only be
+ accessed in an unqualified method call <code>m()</code> using the implicit receiver <code>this</code>.
+
+ </p>
+ </div>
+ </div>
+ </div>
+ <div class="sect depth2" id="s1.4">
+ <h2 class="sect">&sect;1.4&nbsp;Name clashes<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;1</a></span></h2>
+ <p>OT/J restricts Java with respect to handling of conflicting names.
+
+ </p>
+ <div class="subsect depth3" id="s1.4.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Names of role classes</span></h4>
+ <p>A role class may not have the same name as a method or field of
+ its enclosing team. A role class may not shadow another class that is visible in the scope of the enclosing team.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s1.4.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Names of role methods and fields</span></h4>
+ <p>Along implicit inheritance, the names of methods or fields may
+ not hide, shadow or obscure any previously visible name.<br />
+ (see JLS <a href="http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#40898"
+ class="ext">&sect;8.3</a>,
+ <a href="http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#227928"
+ class="ext">&sect;8.4.6.2</a>,
+ <a href="http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#246026"
+ class="ext">&sect;8.5</a>,
+ <a href="http://java.sun.com/docs/books/jls/second_edition/html/interfaces.doc.html#78642"
+ class="ext">&sect;9.3</a>,
+ <a href="http://java.sun.com/docs/books/jls/second_edition/html/interfaces.doc.html#252566"
+ class="ext">&sect;9.5</a> (hiding),
+ <a href="http://java.sun.com/docs/books/jls/second_edition/html/names.doc.html#34133"
+ class="ext">&sect;6.3.1</a> (shadowing),
+ <a href="http://java.sun.com/docs/books/jls/second_edition/html/names.doc.html#104058"
+ class="ext">&sect;6.3.2</a> (obscuring).
+
+ </p>
+ </div>
+ </div>
+ <div class="sect depth2" id="s1.5">
+ <h2 class="sect">&sect;1.5&nbsp;Team and role nesting<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;1</a></span></h2>
+ <p>Multi-level nesting of classes is restricted only by the following rules.
+
+ </p>
+ <h5 class="listing">Example code (Nesting):</h5>
+ <div class="listing example frame" id="l1.5">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> SuperOuter {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>public</b> <em><b>team</b> <b>class</b> RoleAndTeam</em> {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>protected</b> <b>class</b> InnerRole {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> Runnable foo() { <b>return</b> null; }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> <b>public</b> <em><b>team</b> <b>class</b> RoleAndTeamSub</em> <b>extends</b> <strong>RoleAndTeam</strong> {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre> <b>protected</b> <b>class</b> InnerRole {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre> Runnable foo() { throw <b>new</b> RuntimeException(); }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">10</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">11</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">12</td>
+ <td><pre>}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">13</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> OuterTeam <b>extends</b> SuperOuter {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">14</td>
+ <td><pre> <b>public</b> <em><b>team</b> <b>class</b> RoleAndTeam</em> {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">15</td>
+ <td><pre> <b>protected</b> <b>class</b> InnerRole {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">16</td>
+ <td><pre> Runnable foo() {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">17</td>
+ <td><pre> <b>class</b> Local {};</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">18</td>
+ <td><pre> <b>return</b> <b>new</b> Runnable() { <span class="comment">// anonymous class definition</span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">19</td>
+ <td><pre> <b>public</b> <b>void</b> run() {}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">20</td>
+ <td><pre> };</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">21</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">22</td>
+ <td><pre> <span class="comment">// <span class="error">class IllegalMember {}</span></span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">23</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">24</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">25</td>
+ <td><pre> <b>public</b> <em><b>team</b> <b>class</b> RoleAndTeamSub</em> {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">26</td>
+ <td><pre> <b>protected</b> <b>class</b> InnerRole {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">27</td>
+ <td><pre> Runnable foo() {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">28</td>
+ <td><pre> <em>RoleAndTeamSub.tsuper</em>.foo();</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">29</td>
+ <td><pre> <b>return</b> <em>OuterTeam.tsuper</em>.foo();</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">30</td>
+ <td><pre> };</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">31</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">32</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">33</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="subsect depth3" id="s1.5.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Nested teams</span></h4>
+ <p>If a role class is also marked using the <code>team</code> modifier,
+ it may contain roles at the next level of nesting.
+
+ </p>
+ <div class="codecomment">
+ <ul>
+ <li>In the above example (<a href="#l1.5" class="listing">Listing 1.5</a>) class <code>RoleAndTeam</code> starting in line 14
+ is a role of <code>OuterTeam</code> and at the same time a
+ team containing a further role <code>InnerRole</code></li>
+ </ul>
+ </div>
+ <p>Such a hybrid role-and-team has all properties of both kinds of classes.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s1.5.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Nested classes of roles</span></h4>
+ <p>A regular role class (ie., not marked as <code>team</code>, see above)
+ may contain local types (see <a href="http://java.sun.com/docs/books/jls/second_edition/html/statements.doc.html#247766"
+ class="ext">JLS &sect;14.3</a>
+ - in the example: class <code>Local</code>), anonymous types
+ (<a href="http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#252986"
+ class="ext">JLS &sect;15.9.5</a>
+ - in the example: class defined in lines 18-20)
+ but no member types (<a href="http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#246026"
+ class="ext">JLS &sect;8.5</a>
+ - in the example: illegal class
+ <code>IllegalMember</code>).
+ <br />
+ The effect is, that nested types of a regular role cannot be
+ used outside the scope of their enclosing role.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s1.5.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Prohibition of cycles</span></h4>
+ <p>A nested team may not extend its own enclosing team.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s1.5.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Prohibition of name clashes</span></h4>
+ <p>A nested team may inherit roles from multiple sources: its explicit super team
+ and any of its implicit super classes (roles) from different levels of nesting.
+ If from different sources a team inherits two or more roles of the same name
+ that are not related by implicit inheritance, this is an illegal name clash.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s1.5.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Precedence among different supers</span></h4>
+ <p>If a role inherits the same feature from several super roles (super and tsuper),
+ an implicitly inherited version always overrides any explicitly inherited feature. <br />
+ Also implicit inheritance alone may produce several candidate methods inherited by a role class.
+ This is a result of team-nesting where each level of nesting may add one more tsuper role.
+ In that case inner team inheritance has precedence over outer team inheritance.
+
+ </p>
+ <div class="codecomment">
+ <table>
+ <colgroup span="1">
+ <col align="left" span="1" />
+ <col align="center" span="1" />
+ </colgroup>
+ <tr>
+ <td valign="top" rowspan="1" colspan="1">
+ <p>In the above example (<a href="#l1.5" class="listing">Listing 1.5</a>) role <code class="small">OuterTeam.RoleAndTeamSub.InnerRole</code> has two direct tsuper roles: <code class="small">OuterTeam.RoleAndTeam.InnerRole</code>&nbsp;and <code class="small">SuperOuter.RoleAndTeamSub.InnerRole</code>. Without the method <code>foo</code> defined in lines 27-30, the enclosing class <code class="small">OuterTeam.RoleAndTeamSub.InnerRole</code> would inherit the method <code>foo</code> defined in line 16, because the inner inheritance between <code>RoleAndTeamSub</code> and <code>RoleAndTeam</code> binds stronger than the outer inheritance between <code>OuterTeam</code> and <code>SuperOuter</code>.
+ </p>
+ </td>
+ <td rowspan="1" colspan="1"><img src="../images/team_nesting_hor.png" alt="Example diagram team nesting" /></td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ <div class="subsect depth3" id="s1.5.f">
+ <h4 class="subsect">(f)&nbsp;<span class="title">Qualified tsuper</span></h4>
+ <p>A role in a nested team may qualify the keyword <code>tsuper</code> (see <a href="#s1.3.1.f" title="&sect;1.3.1.(f)&nbsp;tsuper" class="sect">&sect;1.3.1.(f)</a> above) by a type name
+ in order to select among different method version inherited from different implicit super classes. A term <code>OuterTeam.tsuper</code> evaluates
+ to the super-class, say <code>SuperOuter</code>, of an enclosing team "<code>OuterTeam</code>". A method call <code>OuterTeam.tsuper.m()</code>
+ evaluates to the method version within <code>SuperOuter</code> that best corresponds to the current method containing the tsuper-call.
+
+ </p>
+ <div class="codecomment">
+ <ul>
+ <li>In the above example (<a href="#l1.5" class="listing">Listing 1.5</a>) line 28 is identical to an unqualified tsuper-call
+ </li>
+ <li>Line 29 selects a corresponding method from the context of <code>SuperOuter</code> resolving to <code>SuperOuter.RoleAndTeamSub.InnerRole.foo()</code></li>
+ </ul>
+ </div>
+ </div>
+ </div>
+ <div class="aux" id="aux1.1">
+ <h4 class="aux">Language implementation:<span class="toplink"><a href="#s1">&uarr;&nbsp;&sect;1</a></span></h4>
+ <p>Role acquisition and implicit inheritance can be implemented in at least two ways.
+
+ </p>
+ <p><strong>Virtual classes:</strong> Each role class is an overridable feature of
+ its enclosing team. Role classes are resolved by dynamic binding
+ with respect to the enclosing team instance. This implementation
+ requires multiple-inheritance in order to also allow regular
+ inheritance between roles of the same team. <code>super</code>
+ and <code>tsuper</code> select parent versions of a method along
+ the two dimensions of inheritance.
+
+ </p>
+ <p><strong>Copy inheritance:</strong> Role acquisition from a super-team has the effect
+ of copying a role definition <code>T.R</code> yielding a new
+ role <code>Tsub.R</code>. All role applications <code>Rx</code>
+ in the role copy refer to <code>Tsub.Rx</code>. Implicit role
+ inheritance extends a role copy in-place. Only the <code>tsuper</code>
+ construct allows to access the previous version of a method
+ (i.e. before in-place overriding).
+
+ </p>
+ </div>
+ <div class="aux" id="aux1.2">
+ <h4 class="aux">References:<span class="toplink"><a href="#s1">&uarr;&nbsp;&sect;1</a></span></h4>
+ <p id="fn1-virtual-classes">[1] Ole Lehrmann Madsen and Birger M&oslash;ller-Pedersen. <em>Virtual classes: A powerful mechanism in object-oriented programming</em>. In Proceedings OOPSLA 89, ACM SIGPLAN Notices, volume 24, 10, pages 397-406, October 1989.
+
+ </p>
+ <p id="fn2-family-polymorphism">[2] Erik Ernst. <em>Family Polymorphism.</em> In Proceedings ECOOP 2001, LNCS 2072, pages 303-326, Springer, 2001.
+
+ </p>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s0.html" rel="prev">&lt;&lt;&nbsp;&sect;0&nbsp;About this Document</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.html" rel="next">&sect;2&nbsp;Role Binding&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.1.1.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.1.1.html
new file mode 100644
index 000000000..f1e0d9e83
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.1.1.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s2.1.f.html" rel="prev">&lt;&lt;&nbsp;&sect;2.1.(f)&nbsp;Effect on garbage collection</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.1.2.html" rel="next">&sect;2.1.2&nbsp;Legal base classes&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.1.html" rel="section">&sect;2.1&nbsp;playedBy relation</a></div>
+ <div class="sect depth3" id="s2.1.1">
+ <h3 class="sect">&sect;2.1.1&nbsp;Binding interfaces</h3>
+ <p>Role base bindings may involve classes and/or interfaces.
+ An interface defined as a member of a team is a role interface and may therefore
+ have a <code>playedBy</code> clause. Also the type mentioned after the
+ <code>playedBy</code> keyword may be an interface.
+
+ </p>
+ <div class="note">
+ <h5>Implementation limitation:</h5>
+ The language implementation as of OTDT version 1.0.<i>X</i> cannot yet bind
+ a role class to a base interface, but this restriction will go in the future.
+
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s2.1.f.html" rel="prev">&lt;&lt;&nbsp;&sect;2.1.(f)&nbsp;Effect on garbage collection</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.1.2.html" rel="next">&sect;2.1.2&nbsp;Legal base classes&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.1.html" rel="section">&sect;2.1&nbsp;playedBy relation</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.1.2.a.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.1.2.a.html
new file mode 100644
index 000000000..64117432c
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.1.2.a.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.1.2.b.html" rel="next">&sect;2.1.2.(b)&nbsp;No cycles&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.1.html" rel="section">&sect;2.1&nbsp;playedBy relation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.1.2.html" rel="section">&sect;2.1.2&nbsp;Legal base classes</a></div>
+ <div class="subsect depth4" id="s2.1.2.a">
+ <h4 class="subsect">&sect;2.1.2.(a)&nbsp;<span class="title">No role of the same team</span></h4>
+ <p>The base class of any role class must not be a role of the same team.
+ <br />
+ It is also not allowed to declare a role class of the same name
+ as a base class bound to this or another role of the enclosing team,
+ if that base class is given with its simple name and resolved using a regular import.
+ Put differently, a base class mentioned after <code>playedBy</code>
+ may not be <em>shadowed</em> by any role class of the enclosing team.
+ <br /><em>Base imports</em> as defined below (<a href="s2.1.2.d.html" title="&sect;2.1.2.(d)&nbsp;Base imports" class="sect">&sect;2.1.2.(d)</a>) relax this rule by
+ allowing to import a class as a base class only. In that case no shadowing occurs since the scopes for
+ base classes and roles are disjoint.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.1.2.b.html" rel="next">&sect;2.1.2.(b)&nbsp;No cycles&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.1.html" rel="section">&sect;2.1&nbsp;playedBy relation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.1.2.html" rel="section">&sect;2.1.2&nbsp;Legal base classes</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.1.2.b.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.1.2.b.html
new file mode 100644
index 000000000..3f1d70252
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.1.2.b.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s2.1.2.a.html" rel="prev">&lt;&lt;&nbsp;&sect;2.1.2.(a)&nbsp;No role of the same team</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.1.2.c.html" rel="next">&sect;2.1.2.(c)&nbsp;Base class decapsulation&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.1.html" rel="section">&sect;2.1&nbsp;playedBy relation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.1.2.html" rel="section">&sect;2.1.2&nbsp;Legal base classes</a></div>
+ <div class="subsect depth4" id="s2.1.2.b">
+ <h4 class="subsect">&sect;2.1.2.(b)&nbsp;<span class="title">No cycles</span></h4>
+ <p>The base class mentioned after <code>playedBy</code> may not be
+ an enclosing type (at any depth) of the role class being defined.
+ <br />
+ This rule prohibits the creation of cycles where the base instance of
+ a given role <code>R</code> contains roles of the same type <code>R</code>.
+ <br />
+ More generally any sequence of classes <code>C<sub>1</sub>, C<sub>2</sub>, .. C<sub>n</sub></code>
+ were each <code>C<sub>i+1</sub></code> is either a member or the base class of
+ <code>C<sub>i</sub></code> and <code>C<sub>n</sub> = C<sub>1</sub></code> is forbidden.
+ <br />
+ Conversely, it is also prohibited to bind a role class to its own inner class.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s2.1.2.a.html" rel="prev">&lt;&lt;&nbsp;&sect;2.1.2.(a)&nbsp;No role of the same team</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.1.2.c.html" rel="next">&sect;2.1.2.(c)&nbsp;Base class decapsulation&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.1.html" rel="section">&sect;2.1&nbsp;playedBy relation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.1.2.html" rel="section">&sect;2.1.2&nbsp;Legal base classes</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.1.2.c.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.1.2.c.html
new file mode 100644
index 000000000..b9e34c919
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.1.2.c.html
@@ -0,0 +1,71 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s2.1.2.b.html" rel="prev">&lt;&lt;&nbsp;&sect;2.1.2.(b)&nbsp;No cycles</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.1.2.d.html" rel="next">&sect;2.1.2.(d)&nbsp;Base imports&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.1.html" rel="section">&sect;2.1&nbsp;playedBy relation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.1.2.html" rel="section">&sect;2.1.2&nbsp;Legal base classes</a></div>
+ <div class="subsect depth4" id="s2.1.2.c">
+ <h4 class="subsect">&sect;2.1.2.(c)&nbsp;<span class="title">Base class decapsulation</span></h4>
+ <p>If a base class referenced after <code>playedBy</code> exists but is not visible under normal visibility rules of Java,
+ this restriction may be overridden. This concept is called <strong>decapsulation</strong>, i.e., the opposite of encapsulation
+ (see also <a href="s3.4.html" title="&sect;3.4&nbsp;Overriding access restrictions"
+ class="sect">&sect;3.4</a>). A compiler should signal any occurrence of base class decapsulation. If a compiler supports to
+ configure warnings this may be used to let the user choose to (a) ignore base class decapsulation, (b) treat it as a warning
+ or even
+ (c) treat it as an error.
+
+ </p>
+ <p>
+ Binding to a <code>final</code> base class is also considered as decapsulation, since a <code>playedBy</code> relationship has
+ powers similar to an <code>extends</code> relationship, which is prohibited by marking a class as <code>final</code>.
+
+ </p>
+ <p>
+ Decapsulation is not allowed if the base class is a confined role (see <a href="s7.2.html" title="&sect;7.2&nbsp;Confined roles" class="sect">&sect;7.2</a>).
+
+ </p>
+ <p>
+ Within the current role a decapsulated base class can be mentioned in the right-hand-side of any method binding
+ (<a href="s3.html" title="&sect;3&nbsp;Callout Binding" class="sect">callout (&sect;3)</a> or <a href="s4.html" title="&sect;4&nbsp;Callin Binding" class="sect">callin (&sect;4)</a>). Also arguments in these positions are allowed to mention the decapsulated base class:
+
+ </p>
+ <ul>
+ <li>the first argument of one of the role's constructors (see <a href="s2.4.1.html"
+ title="&sect;2.4.1&nbsp;Role creation via a lifting constructor"
+ class="sect">lifting constructor (&sect;2.4.1)</a>).
+ </li>
+ <li>the base side of an argument with declared lifting (see <a href="s2.3.2.html" title="&sect;2.3.2&nbsp;Declared lifting" class="sect">declared lifting (&sect;2.3.2)</a>).
+ </li>
+ </ul>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s2.1.2.b.html" rel="prev">&lt;&lt;&nbsp;&sect;2.1.2.(b)&nbsp;No cycles</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.1.2.d.html" rel="next">&sect;2.1.2.(d)&nbsp;Base imports&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.1.html" rel="section">&sect;2.1&nbsp;playedBy relation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.1.2.html" rel="section">&sect;2.1.2&nbsp;Legal base classes</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.1.2.d.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.1.2.d.html
new file mode 100644
index 000000000..a69fa1d6c
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.1.2.d.html
@@ -0,0 +1,82 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s2.1.2.c.html" rel="prev">&lt;&lt;&nbsp;&sect;2.1.2.(c)&nbsp;Base class decapsulation</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.1.2.e.html" rel="next">&sect;2.1.2.(e)&nbsp;No free type parameters&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.1.html" rel="section">&sect;2.1&nbsp;playedBy relation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.1.2.html" rel="section">&sect;2.1.2&nbsp;Legal base classes</a></div>
+ <div class="subsect depth4" id="s2.1.2.d">
+ <h4 class="subsect">&sect;2.1.2.(d)&nbsp;<span class="title">Base imports</span></h4>
+ <p>If the main type in a file denotes a team, the modifier <code>base</code> can be applied to an import in order to specify that this type
+ should be imported for application as a base type only. Example:
+
+ </p>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><em><b>import</b> base</em> some.pack.MyBase;</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> MyTeam {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <span class="comment">// simple name resolves to imported class:</span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <b>protected</b> <b>class</b> MyRole <em><b>playedBy</b> MyBase</em> { } </pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> <span class="error"><em>MyBase</em> illegalDeclaration;</span> <span class="comment">// base import does not apply for this position</span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <p>Types imported by a base import can only be used in the same positions where also base class decapsulation (<a href="s2.1.2.c.html" title="&sect;2.1.2.(c)&nbsp;Base class decapsulation"
+ class="sect">&sect;2.1.2.(c)</a>)
+ is applicable.<br />
+ It is recommended that a type mentioned after the keyword <code>playedBy</code> is always imported with the <code>base</code> modifier, otherwise the compiler
+ will give a warning.<br />
+ Base imports create a scope that is disjoint from the normal scope. Thus, names that are imported as base will never clash
+ with normally visible names
+ (in contrast to <a href="s1.4.html" title="&sect;1.4&nbsp;Name clashes" class="sect">&sect;1.4</a>). More specifically, it is not a problem to use a base class's name also for its role if a base import is used.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s2.1.2.c.html" rel="prev">&lt;&lt;&nbsp;&sect;2.1.2.(c)&nbsp;Base class decapsulation</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.1.2.e.html" rel="next">&sect;2.1.2.(e)&nbsp;No free type parameters&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.1.html" rel="section">&sect;2.1&nbsp;playedBy relation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.1.2.html" rel="section">&sect;2.1.2&nbsp;Legal base classes</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.1.2.e.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.1.2.e.html
new file mode 100644
index 000000000..ee60d4fb9
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.1.2.e.html
@@ -0,0 +1,182 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s2.1.2.d.html" rel="prev">&lt;&lt;&nbsp;&sect;2.1.2.(d)&nbsp;Base imports</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.1.html" rel="section">&sect;2.1&nbsp;playedBy relation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.1.2.html" rel="section">&sect;2.1.2&nbsp;Legal base classes</a></div>
+ <div class="subsect depth4" id="s2.1.2.e">
+ <h4 class="subsect">&sect;2.1.2.(e)&nbsp;<span class="title">No free type parameters</span></h4>
+ <p>
+ Neither the role class nor the base class in a playedBy binding must have any <em>free type parameters</em>.
+ If both classes are specified with a type parameter of the same name, both parameters are identified
+ and are not considered as <em>free</em>.
+
+ </p>
+ <p>
+ From this follows that a role class cannot have more type parameters than its base.
+ Conversely, only one situation exists where a base class can have more type parameters than a role class
+ bound to it: if the role class has no type parameters a generic base class can be bound using
+ the base class's raw type, i.e., without specifying type arguments.
+
+ </p>
+ <div class="note">
+ <h5>Note:</h5>
+ The information from the <code>playedBy</code> declaration is used at run-time
+ to associate role instances to base instances.
+ Specifying a base class with free type parameters would imply that only such base instances
+ are decorated by a role whose type is conform to the specified parameterized class.
+ However, type arguments are not available at run-time, thus the run-time environment
+ is not able to decide which base instances should have a role and which should not.
+ This is due to the design of generics in Java which are realized by erasure.
+
+ </div>
+ <p>The following example shows how generics can be used in various positions. Note, that some of the concepts used in the example
+ will be explained in later sections.
+ </p>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>class</b> ValueTrafo<em>&lt;T&gt;</em> {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>public</b> <em>T</em> transform(<em>T</em> val) throws Exception { /* ... */ }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre>}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> TransformTeam {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> <b>protected</b> <b>class</b> SafeTrafo<em>&lt;U&gt;</em> <b>playedBy</b> ValueTrafo<em>&lt;U&gt;</em> {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> <em>U</em> transform(<em>U</em> v) <b>-&gt;</b> <em>U</em> transform(<em>U</em> val); </pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> <b>protected</b> <em>U</em> safeTransform(<em>U</em> v) {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre> <b>try</b> {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre> <b>return</b> transform(v);</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">10</td>
+ <td><pre> } <b>catch</b> (Exception e) {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">11</td>
+ <td><pre> <b>return</b> v;</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">12</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">13</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">14</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">15</td>
+ <td><pre> <em>&lt;V&gt; V</em> perform(ValueTrafo<em>&lt;V&gt;</em> <b>as</b> SafeTrafo<em>&lt;V&gt;</em> trafo, <em>V</em> value) {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">16</td>
+ <td><pre> <b>return</b> trafo.safeTransform(value);</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">17</td>
+ <td><pre> } </pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">18</td>
+ <td><pre>}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">19</td>
+ <td><pre>...</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">20</td>
+ <td><pre>ValueTrafo<em>&lt;String&gt;</em> trafo = <b>new</b> ValueTrafo<em>&lt;String&gt;</em>();</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">21</td>
+ <td><pre>TransformTeam safeTrafo = <b>new</b> TransformTeam();</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">22</td>
+ <td><pre>String s = safeTrafo.perform(trafo, "Testing");</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">23</td>
+ <td><pre></pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="codecomment">
+ <h5>Explanation</h5>
+ <ul>
+ <li>Line 5 shows a role with type parameter <code>U</code> where the type parameter is identified with the
+ corresponding type parameter of the role's base class (which is originally declared as <code>T</code> in line 1.
+ </li>
+ <li>Line 6 shows a callout binding (<a href="s3.html" title="&sect;3&nbsp;Callout Binding" class="sect">&sect;3</a>) which mappes a base method to a corresponding role method
+ while maintaining the flexible typing.
+ </li>
+ <li>The regular method in lines 7-13 just passes values of type <code>U</code> around.
+ </li>
+ <li>The generic method in line 15 ff. uses declared lifting (<a href="s2.3.2.html" title="&sect;2.3.2&nbsp;Declared lifting" class="sect">&sect;2.3.2</a>) to obtain a role for a given base object.
+ The method has no knowledge about the concrete type arguments of either role nor base, but works under the guarantee
+ that both type arguments will be the same for any single invocation.
+ </li>
+ <li>Lines 20 ff. finally create instances of base and team and invoke the behavior thereby instantiating type parameters to <code>String</code>.
+ </li>
+ </ul>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s2.1.2.d.html" rel="prev">&lt;&lt;&nbsp;&sect;2.1.2.(d)&nbsp;Base imports</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.1.html" rel="section">&sect;2.1&nbsp;playedBy relation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.1.2.html" rel="section">&sect;2.1.2&nbsp;Legal base classes</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.1.2.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.1.2.html
new file mode 100644
index 000000000..bf02ef9e6
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.1.2.html
@@ -0,0 +1,305 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s2.1.1.html" rel="prev">&lt;&lt;&nbsp;&sect;2.1.1&nbsp;Binding interfaces</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.1.html" rel="section">&sect;2.1&nbsp;playedBy relation</a></div>
+ <div class="sect depth3" id="s2.1.2">
+ <h3 class="sect">&sect;2.1.2&nbsp;Legal base classes</h3>
+ <p>Generally, the base class mentioned after <code>playedBy</code> must be
+ visible in the enclosing scope (see <a href="#s2.1.2.c" title="&sect;2.1.2.(c)&nbsp;Base class decapsulation"
+ class="sect">below (&sect;2.1.2.(c))</a> for an exception).
+ Normally, this scope is defined just by the imports of the enclosing team.
+ For role files (<a href="s1.2.5.b.html" title="&sect;1.2.5.(b)&nbsp;Role files" class="sect">&sect;1.2.5.(b)</a>)
+ also additional imports in the role file are considered.
+ <br /><a href="#s2.1.2.d" title="&sect;2.1.2.(d)&nbsp;Base imports" class="sect">&sect;2.1.2.(d)</a> below defines how imports can be constrained so that certain types
+ can be used as base types, only.
+
+ </p>
+ <div class="subsect depth4" id="s2.1.2.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">No role of the same team</span></h4>
+ <p>The base class of any role class must not be a role of the same team.
+ <br />
+ It is also not allowed to declare a role class of the same name
+ as a base class bound to this or another role of the enclosing team,
+ if that base class is given with its simple name and resolved using a regular import.
+ Put differently, a base class mentioned after <code>playedBy</code>
+ may not be <em>shadowed</em> by any role class of the enclosing team.
+ <br /><em>Base imports</em> as defined below (<a href="#s2.1.2.d" title="&sect;2.1.2.(d)&nbsp;Base imports" class="sect">&sect;2.1.2.(d)</a>) relax this rule by
+ allowing to import a class as a base class only. In that case no shadowing occurs since the scopes for
+ base classes and roles are disjoint.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s2.1.2.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">No cycles</span></h4>
+ <p>The base class mentioned after <code>playedBy</code> may not be
+ an enclosing type (at any depth) of the role class being defined.
+ <br />
+ This rule prohibits the creation of cycles where the base instance of
+ a given role <code>R</code> contains roles of the same type <code>R</code>.
+ <br />
+ More generally any sequence of classes <code>C<sub>1</sub>, C<sub>2</sub>, .. C<sub>n</sub></code>
+ were each <code>C<sub>i+1</sub></code> is either a member or the base class of
+ <code>C<sub>i</sub></code> and <code>C<sub>n</sub> = C<sub>1</sub></code> is forbidden.
+ <br />
+ Conversely, it is also prohibited to bind a role class to its own inner class.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s2.1.2.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Base class decapsulation</span></h4>
+ <p>If a base class referenced after <code>playedBy</code> exists but is not visible under normal visibility rules of Java,
+ this restriction may be overridden. This concept is called <strong>decapsulation</strong>, i.e., the opposite of encapsulation
+ (see also <a href="s3.4.html" title="&sect;3.4&nbsp;Overriding access restrictions"
+ class="sect">&sect;3.4</a>). A compiler should signal any occurrence of base class decapsulation. If a compiler supports to
+ configure warnings this may be used to let the user choose to (a) ignore base class decapsulation, (b) treat it as a warning
+ or even
+ (c) treat it as an error.
+
+ </p>
+ <p>
+ Binding to a <code>final</code> base class is also considered as decapsulation, since a <code>playedBy</code> relationship has
+ powers similar to an <code>extends</code> relationship, which is prohibited by marking a class as <code>final</code>.
+
+ </p>
+ <p>
+ Decapsulation is not allowed if the base class is a confined role (see <a href="s7.2.html" title="&sect;7.2&nbsp;Confined roles" class="sect">&sect;7.2</a>).
+
+ </p>
+ <p>
+ Within the current role a decapsulated base class can be mentioned in the right-hand-side of any method binding
+ (<a href="s3.html" title="&sect;3&nbsp;Callout Binding" class="sect">callout (&sect;3)</a> or <a href="s4.html" title="&sect;4&nbsp;Callin Binding" class="sect">callin (&sect;4)</a>). Also arguments in these positions are allowed to mention the decapsulated base class:
+
+ </p>
+ <ul>
+ <li>the first argument of one of the role's constructors (see <a href="s2.4.1.html"
+ title="&sect;2.4.1&nbsp;Role creation via a lifting constructor"
+ class="sect">lifting constructor (&sect;2.4.1)</a>).
+ </li>
+ <li>the base side of an argument with declared lifting (see <a href="s2.3.2.html" title="&sect;2.3.2&nbsp;Declared lifting" class="sect">declared lifting (&sect;2.3.2)</a>).
+ </li>
+ </ul>
+ </div>
+ <div class="subsect depth4" id="s2.1.2.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Base imports</span></h4>
+ <p>If the main type in a file denotes a team, the modifier <code>base</code> can be applied to an import in order to specify that this type
+ should be imported for application as a base type only. Example:
+
+ </p>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><em><b>import</b> base</em> some.pack.MyBase;</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> MyTeam {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <span class="comment">// simple name resolves to imported class:</span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <b>protected</b> <b>class</b> MyRole <em><b>playedBy</b> MyBase</em> { } </pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> <span class="error"><em>MyBase</em> illegalDeclaration;</span> <span class="comment">// base import does not apply for this position</span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <p>Types imported by a base import can only be used in the same positions where also base class decapsulation (<a href="#s2.1.2.c" title="&sect;2.1.2.(c)&nbsp;Base class decapsulation"
+ class="sect">&sect;2.1.2.(c)</a>)
+ is applicable.<br />
+ It is recommended that a type mentioned after the keyword <code>playedBy</code> is always imported with the <code>base</code> modifier, otherwise the compiler
+ will give a warning.<br />
+ Base imports create a scope that is disjoint from the normal scope. Thus, names that are imported as base will never clash
+ with normally visible names
+ (in contrast to <a href="s1.4.html" title="&sect;1.4&nbsp;Name clashes" class="sect">&sect;1.4</a>). More specifically, it is not a problem to use a base class's name also for its role if a base import is used.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s2.1.2.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">No free type parameters</span></h4>
+ <p>
+ Neither the role class nor the base class in a playedBy binding must have any <em>free type parameters</em>.
+ If both classes are specified with a type parameter of the same name, both parameters are identified
+ and are not considered as <em>free</em>.
+
+ </p>
+ <p>
+ From this follows that a role class cannot have more type parameters than its base.
+ Conversely, only one situation exists where a base class can have more type parameters than a role class
+ bound to it: if the role class has no type parameters a generic base class can be bound using
+ the base class's raw type, i.e., without specifying type arguments.
+
+ </p>
+ <div class="note">
+ <h5>Note:</h5>
+ The information from the <code>playedBy</code> declaration is used at run-time
+ to associate role instances to base instances.
+ Specifying a base class with free type parameters would imply that only such base instances
+ are decorated by a role whose type is conform to the specified parameterized class.
+ However, type arguments are not available at run-time, thus the run-time environment
+ is not able to decide which base instances should have a role and which should not.
+ This is due to the design of generics in Java which are realized by erasure.
+
+ </div>
+ <p>The following example shows how generics can be used in various positions. Note, that some of the concepts used in the example
+ will be explained in later sections.
+ </p>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>class</b> ValueTrafo<em>&lt;T&gt;</em> {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>public</b> <em>T</em> transform(<em>T</em> val) throws Exception { /* ... */ }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre>}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> TransformTeam {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> <b>protected</b> <b>class</b> SafeTrafo<em>&lt;U&gt;</em> <b>playedBy</b> ValueTrafo<em>&lt;U&gt;</em> {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> <em>U</em> transform(<em>U</em> v) <b>-&gt;</b> <em>U</em> transform(<em>U</em> val); </pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> <b>protected</b> <em>U</em> safeTransform(<em>U</em> v) {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre> <b>try</b> {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre> <b>return</b> transform(v);</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">10</td>
+ <td><pre> } <b>catch</b> (Exception e) {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">11</td>
+ <td><pre> <b>return</b> v;</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">12</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">13</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">14</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">15</td>
+ <td><pre> <em>&lt;V&gt; V</em> perform(ValueTrafo<em>&lt;V&gt;</em> <b>as</b> SafeTrafo<em>&lt;V&gt;</em> trafo, <em>V</em> value) {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">16</td>
+ <td><pre> <b>return</b> trafo.safeTransform(value);</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">17</td>
+ <td><pre> } </pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">18</td>
+ <td><pre>}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">19</td>
+ <td><pre>...</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">20</td>
+ <td><pre>ValueTrafo<em>&lt;String&gt;</em> trafo = <b>new</b> ValueTrafo<em>&lt;String&gt;</em>();</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">21</td>
+ <td><pre>TransformTeam safeTrafo = <b>new</b> TransformTeam();</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">22</td>
+ <td><pre>String s = safeTrafo.perform(trafo, "Testing");</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">23</td>
+ <td><pre></pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="codecomment">
+ <h5>Explanation</h5>
+ <ul>
+ <li>Line 5 shows a role with type parameter <code>U</code> where the type parameter is identified with the
+ corresponding type parameter of the role's base class (which is originally declared as <code>T</code> in line 1.
+ </li>
+ <li>Line 6 shows a callout binding (<a href="s3.html" title="&sect;3&nbsp;Callout Binding" class="sect">&sect;3</a>) which mappes a base method to a corresponding role method
+ while maintaining the flexible typing.
+ </li>
+ <li>The regular method in lines 7-13 just passes values of type <code>U</code> around.
+ </li>
+ <li>The generic method in line 15 ff. uses declared lifting (<a href="s2.3.2.html" title="&sect;2.3.2&nbsp;Declared lifting" class="sect">&sect;2.3.2</a>) to obtain a role for a given base object.
+ The method has no knowledge about the concrete type arguments of either role nor base, but works under the guarantee
+ that both type arguments will be the same for any single invocation.
+ </li>
+ <li>Lines 20 ff. finally create instances of base and team and invoke the behavior thereby instantiating type parameters to <code>String</code>.
+ </li>
+ </ul>
+ </div>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s2.1.1.html" rel="prev">&lt;&lt;&nbsp;&sect;2.1.1&nbsp;Binding interfaces</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.1.html" rel="section">&sect;2.1&nbsp;playedBy relation</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.1.a.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.1.a.html
new file mode 100644
index 000000000..ff7d30609
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.1.a.html
@@ -0,0 +1,67 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.1.b.html" rel="next">&sect;2.1.(b)&nbsp;Inheritance&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.1.html" rel="section">&sect;2.1&nbsp;playedBy relation</a></div>
+ <div class="subsect depth3" id="s2.1.a">
+ <h4 class="subsect">&sect;2.1.(a)&nbsp;<span class="title">Role-base binding</span></h4>
+ <p>Roles are bound to a base class by the <code>playedBy</code> keyword.
+
+ </p>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> MyTeamA {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>public</b> <b>class</b> MyRole <em><b>playedBy</b> MyBase</em> {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> ...</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.1.b.html" rel="next">&sect;2.1.(b)&nbsp;Inheritance&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.1.html" rel="section">&sect;2.1&nbsp;playedBy relation</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.1.b.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.1.b.html
new file mode 100644
index 000000000..0e76e9fc3
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.1.b.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s2.1.a.html" rel="prev">&lt;&lt;&nbsp;&sect;2.1.(a)&nbsp;Role-base binding</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.1.c.html" rel="next">&sect;2.1.(c)&nbsp;Covariant refinement&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.1.html" rel="section">&sect;2.1&nbsp;playedBy relation</a></div>
+ <div class="subsect depth3" id="s2.1.b">
+ <h4 class="subsect">&sect;2.1.(b)&nbsp;<span class="title">Inheritance</span></h4>
+ <p>The <code>playedBy</code> relation is inherited along
+ explicit and implicit (<a href="s1.3.1.c.html"
+ title="&sect;1.3.1.(c)&nbsp;Overriding and implicit inheritance"
+ class="sect">&sect;1.3.1.(c)</a>)
+ role inheritance.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s2.1.a.html" rel="prev">&lt;&lt;&nbsp;&sect;2.1.(a)&nbsp;Role-base binding</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.1.c.html" rel="next">&sect;2.1.(c)&nbsp;Covariant refinement&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.1.html" rel="section">&sect;2.1&nbsp;playedBy relation</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.1.c.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.1.c.html
new file mode 100644
index 000000000..c9d89ada7
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.1.c.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s2.1.b.html" rel="prev">&lt;&lt;&nbsp;&sect;2.1.(b)&nbsp;Inheritance</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.1.d.html" rel="next">&sect;2.1.(d)&nbsp;No-variance&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.1.html" rel="section">&sect;2.1&nbsp;playedBy relation</a></div>
+ <div class="subsect depth3" id="s2.1.c">
+ <h4 class="subsect">&sect;2.1.(c)&nbsp;<span class="title">Covariant refinement</span></h4>
+ <p>An <em>explicit</em> sub-role (sub-class using <code>extends</code>)
+ can refine the <code>playedBy</code> relation to a more
+ specific base class (this is the basis for
+ <a href="s2.3.3.html" title="&sect;2.3.3&nbsp;Smart lifting" class="sect">smart lifting (&sect;2.3.3)</a>).<br />
+ If a role class inherits several <code>playedBy</code> relations from
+ its super-class and its super-interfaces, there must be a most specific
+ base-class among these relations, which is conform to all other base-classes.
+ This most specific base-class is the base-class of the current role.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s2.1.b.html" rel="prev">&lt;&lt;&nbsp;&sect;2.1.(b)&nbsp;Inheritance</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.1.d.html" rel="next">&sect;2.1.(d)&nbsp;No-variance&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.1.html" rel="section">&sect;2.1&nbsp;playedBy relation</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.1.d.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.1.d.html
new file mode 100644
index 000000000..8964b5057
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.1.d.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s2.1.c.html" rel="prev">&lt;&lt;&nbsp;&sect;2.1.(c)&nbsp;Covariant refinement</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.1.e.html" rel="next">&sect;2.1.(e)&nbsp;Use of playedBy bindings&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.1.html" rel="section">&sect;2.1&nbsp;playedBy relation</a></div>
+ <div class="subsect depth3" id="s2.1.d">
+ <h4 class="subsect">&sect;2.1.(d)&nbsp;<span class="title">No-variance</span></h4>
+ <p>An <em>implicit</em> sub-role (according to <a href="s1.3.1.c.html"
+ title="&sect;1.3.1.(c)&nbsp;Overriding and implicit inheritance"
+ class="sect">&sect;1.3.1.(c)</a>)
+ may only add a <code>playedBy</code> relation but never change an existing one.<br />
+ Note however, that implicit inheritance may implicitly specialize an existing <code>playedBy</code>
+ relation (this advanced situation is illustrated in <a href="s2.7.d.html"
+ title="&sect;2.7.(d)&nbsp;Implicit playedBy specialization"
+ class="sect">&sect;2.7.(d)</a>).
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s2.1.c.html" rel="prev">&lt;&lt;&nbsp;&sect;2.1.(c)&nbsp;Covariant refinement</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.1.e.html" rel="next">&sect;2.1.(e)&nbsp;Use of playedBy bindings&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.1.html" rel="section">&sect;2.1&nbsp;playedBy relation</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.1.e.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.1.e.html
new file mode 100644
index 000000000..3bc758bd5
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.1.e.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s2.1.d.html" rel="prev">&lt;&lt;&nbsp;&sect;2.1.(d)&nbsp;No-variance</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.1.f.html" rel="next">&sect;2.1.(f)&nbsp;Effect on garbage collection&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.1.html" rel="section">&sect;2.1&nbsp;playedBy relation</a></div>
+ <div class="subsect depth3" id="s2.1.e">
+ <h4 class="subsect">&sect;2.1.(e)&nbsp;<span class="title">Use of playedBy bindings</span></h4>
+ <p>The <code>playedBy</code> relation by itself has no effect
+ on the behavior of role and base objects.
+ It is, however, the precondition for translation polymorphism
+ (lowering: <a href="s2.2.html" title="&sect;2.2&nbsp;Lowering" class="sect">&sect;2.2</a> and lifting: <a href="s2.3.html" title="&sect;2.3&nbsp;Lifting" class="sect">&sect;2.3</a>)
+ and for method bindings (callout: <a href="s3.html" title="&sect;3&nbsp;Callout Binding" class="sect">&sect;3</a> and callin: <a href="s4.html" title="&sect;4&nbsp;Callin Binding" class="sect">&sect;4</a>).
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s2.1.d.html" rel="prev">&lt;&lt;&nbsp;&sect;2.1.(d)&nbsp;No-variance</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.1.f.html" rel="next">&sect;2.1.(f)&nbsp;Effect on garbage collection&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.1.html" rel="section">&sect;2.1&nbsp;playedBy relation</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.1.f.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.1.f.html
new file mode 100644
index 000000000..a471bb56e
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.1.f.html
@@ -0,0 +1,56 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s2.1.e.html" rel="prev">&lt;&lt;&nbsp;&sect;2.1.(e)&nbsp;Use of playedBy bindings</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.1.1.html" rel="next">&sect;2.1.1&nbsp;Binding interfaces&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.1.html" rel="section">&sect;2.1&nbsp;playedBy relation</a></div>
+ <div class="subsect depth3" id="s2.1.f">
+ <h4 class="subsect">&sect;2.1.(f)&nbsp;<span class="title">Effect on garbage collection</span></h4>
+ <p>A role and its base object form one conceptual entity. The garbage collector will see a role
+ and its base object as linked in a bidirectional manner. As a result, a role cannot be
+ garbage collected if its base is still reachable and vice versa.
+ <br />
+ Internally a team manages its roles and corresponding bases using weak references.
+ When using one of the <code>getAllRoles(..)</code>
+ methods (see <a href="s6.1.a.html"
+ title="&sect;6.1.(a)&nbsp;Interface to the role registry"
+ class="sect">&sect;6.1.(a)</a>),
+ the result may be non-deterministic because these internal structures
+ may hold weak references to objects that will be collected by the next run of the
+ garbage collector. We advise clients of <code>getAllRoles(..)</code> to call
+ <code>System.gc()</code> prior to calling <code>getAllRoles(..)</code> in order
+ to ensure deterministic results.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s2.1.e.html" rel="prev">&lt;&lt;&nbsp;&sect;2.1.(e)&nbsp;Use of playedBy bindings</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.1.1.html" rel="next">&sect;2.1.1&nbsp;Binding interfaces&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.1.html" rel="section">&sect;2.1&nbsp;playedBy relation</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.1.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.1.html
new file mode 100644
index 000000000..29ca5f52f
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.1.html
@@ -0,0 +1,420 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.2.html" rel="next">&sect;2.2&nbsp;Lowering&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a></div>
+ <div class="sect depth2" id="s2.1">
+ <h2 class="sect">&sect;2.1&nbsp;playedBy relation</h2>
+ <div class="syntaxlink"><a href="sA.html#sA.1.1" title="&sect;A.1.1&nbsp;ClassDeclaration"
+ class="syntax">&rarr;&nbsp;Syntax&nbsp;&sect;A.1.1</a></div>
+ <div class="subsect depth3" id="s2.1.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Role-base binding</span></h4>
+ <p>Roles are bound to a base class by the <code>playedBy</code> keyword.
+
+ </p>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> MyTeamA {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>public</b> <b>class</b> MyRole <em><b>playedBy</b> MyBase</em> {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> ...</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ <div class="subsect depth3" id="s2.1.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Inheritance</span></h4>
+ <p>The <code>playedBy</code> relation is inherited along
+ explicit and implicit (<a href="s1.3.1.c.html"
+ title="&sect;1.3.1.(c)&nbsp;Overriding and implicit inheritance"
+ class="sect">&sect;1.3.1.(c)</a>)
+ role inheritance.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s2.1.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Covariant refinement</span></h4>
+ <p>An <em>explicit</em> sub-role (sub-class using <code>extends</code>)
+ can refine the <code>playedBy</code> relation to a more
+ specific base class (this is the basis for
+ <a href="s2.3.3.html" title="&sect;2.3.3&nbsp;Smart lifting" class="sect">smart lifting (&sect;2.3.3)</a>).<br />
+ If a role class inherits several <code>playedBy</code> relations from
+ its super-class and its super-interfaces, there must be a most specific
+ base-class among these relations, which is conform to all other base-classes.
+ This most specific base-class is the base-class of the current role.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s2.1.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">No-variance</span></h4>
+ <p>An <em>implicit</em> sub-role (according to <a href="s1.3.1.c.html"
+ title="&sect;1.3.1.(c)&nbsp;Overriding and implicit inheritance"
+ class="sect">&sect;1.3.1.(c)</a>)
+ may only add a <code>playedBy</code> relation but never change an existing one.<br />
+ Note however, that implicit inheritance may implicitly specialize an existing <code>playedBy</code>
+ relation (this advanced situation is illustrated in <a href="s2.7.d.html"
+ title="&sect;2.7.(d)&nbsp;Implicit playedBy specialization"
+ class="sect">&sect;2.7.(d)</a>).
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s2.1.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Use of playedBy bindings</span></h4>
+ <p>The <code>playedBy</code> relation by itself has no effect
+ on the behavior of role and base objects.
+ It is, however, the precondition for translation polymorphism
+ (lowering: <a href="s2.2.html" title="&sect;2.2&nbsp;Lowering" class="sect">&sect;2.2</a> and lifting: <a href="s2.3.html" title="&sect;2.3&nbsp;Lifting" class="sect">&sect;2.3</a>)
+ and for method bindings (callout: <a href="s3.html" title="&sect;3&nbsp;Callout Binding" class="sect">&sect;3</a> and callin: <a href="s4.html" title="&sect;4&nbsp;Callin Binding" class="sect">&sect;4</a>).
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s2.1.f">
+ <h4 class="subsect">(f)&nbsp;<span class="title">Effect on garbage collection</span></h4>
+ <p>A role and its base object form one conceptual entity. The garbage collector will see a role
+ and its base object as linked in a bidirectional manner. As a result, a role cannot be
+ garbage collected if its base is still reachable and vice versa.
+ <br />
+ Internally a team manages its roles and corresponding bases using weak references.
+ When using one of the <code>getAllRoles(..)</code>
+ methods (see <a href="s6.1.a.html"
+ title="&sect;6.1.(a)&nbsp;Interface to the role registry"
+ class="sect">&sect;6.1.(a)</a>),
+ the result may be non-deterministic because these internal structures
+ may hold weak references to objects that will be collected by the next run of the
+ garbage collector. We advise clients of <code>getAllRoles(..)</code> to call
+ <code>System.gc()</code> prior to calling <code>getAllRoles(..)</code> in order
+ to ensure deterministic results.
+
+ </p>
+ </div>
+ <div class="sect depth3" id="s2.1.1">
+ <h3 class="sect">&sect;2.1.1&nbsp;Binding interfaces<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;2.1</a></span></h3>
+ <p>Role base bindings may involve classes and/or interfaces.
+ An interface defined as a member of a team is a role interface and may therefore
+ have a <code>playedBy</code> clause. Also the type mentioned after the
+ <code>playedBy</code> keyword may be an interface.
+
+ </p>
+ <div class="note">
+ <h5>Implementation limitation:</h5>
+ The language implementation as of OTDT version 1.0.<i>X</i> cannot yet bind
+ a role class to a base interface, but this restriction will go in the future.
+
+ </div>
+ </div>
+ <div class="sect depth3" id="s2.1.2">
+ <h3 class="sect">&sect;2.1.2&nbsp;Legal base classes<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;2.1</a></span></h3>
+ <p>Generally, the base class mentioned after <code>playedBy</code> must be
+ visible in the enclosing scope (see <a href="#s2.1.2.c" title="&sect;2.1.2.(c)&nbsp;Base class decapsulation"
+ class="sect">below (&sect;2.1.2.(c))</a> for an exception).
+ Normally, this scope is defined just by the imports of the enclosing team.
+ For role files (<a href="s1.2.5.b.html" title="&sect;1.2.5.(b)&nbsp;Role files" class="sect">&sect;1.2.5.(b)</a>)
+ also additional imports in the role file are considered.
+ <br /><a href="#s2.1.2.d" title="&sect;2.1.2.(d)&nbsp;Base imports" class="sect">&sect;2.1.2.(d)</a> below defines how imports can be constrained so that certain types
+ can be used as base types, only.
+
+ </p>
+ <div class="subsect depth4" id="s2.1.2.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">No role of the same team</span></h4>
+ <p>The base class of any role class must not be a role of the same team.
+ <br />
+ It is also not allowed to declare a role class of the same name
+ as a base class bound to this or another role of the enclosing team,
+ if that base class is given with its simple name and resolved using a regular import.
+ Put differently, a base class mentioned after <code>playedBy</code>
+ may not be <em>shadowed</em> by any role class of the enclosing team.
+ <br /><em>Base imports</em> as defined below (<a href="#s2.1.2.d" title="&sect;2.1.2.(d)&nbsp;Base imports" class="sect">&sect;2.1.2.(d)</a>) relax this rule by
+ allowing to import a class as a base class only. In that case no shadowing occurs since the scopes for
+ base classes and roles are disjoint.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s2.1.2.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">No cycles</span></h4>
+ <p>The base class mentioned after <code>playedBy</code> may not be
+ an enclosing type (at any depth) of the role class being defined.
+ <br />
+ This rule prohibits the creation of cycles where the base instance of
+ a given role <code>R</code> contains roles of the same type <code>R</code>.
+ <br />
+ More generally any sequence of classes <code>C<sub>1</sub>, C<sub>2</sub>, .. C<sub>n</sub></code>
+ were each <code>C<sub>i+1</sub></code> is either a member or the base class of
+ <code>C<sub>i</sub></code> and <code>C<sub>n</sub> = C<sub>1</sub></code> is forbidden.
+ <br />
+ Conversely, it is also prohibited to bind a role class to its own inner class.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s2.1.2.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Base class decapsulation</span></h4>
+ <p>If a base class referenced after <code>playedBy</code> exists but is not visible under normal visibility rules of Java,
+ this restriction may be overridden. This concept is called <strong>decapsulation</strong>, i.e., the opposite of encapsulation
+ (see also <a href="s3.4.html" title="&sect;3.4&nbsp;Overriding access restrictions"
+ class="sect">&sect;3.4</a>). A compiler should signal any occurrence of base class decapsulation. If a compiler supports to
+ configure warnings this may be used to let the user choose to (a) ignore base class decapsulation, (b) treat it as a warning
+ or even
+ (c) treat it as an error.
+
+ </p>
+ <p>
+ Binding to a <code>final</code> base class is also considered as decapsulation, since a <code>playedBy</code> relationship has
+ powers similar to an <code>extends</code> relationship, which is prohibited by marking a class as <code>final</code>.
+
+ </p>
+ <p>
+ Decapsulation is not allowed if the base class is a confined role (see <a href="s7.2.html" title="&sect;7.2&nbsp;Confined roles" class="sect">&sect;7.2</a>).
+
+ </p>
+ <p>
+ Within the current role a decapsulated base class can be mentioned in the right-hand-side of any method binding
+ (<a href="s3.html" title="&sect;3&nbsp;Callout Binding" class="sect">callout (&sect;3)</a> or <a href="s4.html" title="&sect;4&nbsp;Callin Binding" class="sect">callin (&sect;4)</a>). Also arguments in these positions are allowed to mention the decapsulated base class:
+
+ </p>
+ <ul>
+ <li>the first argument of one of the role's constructors (see <a href="s2.4.1.html"
+ title="&sect;2.4.1&nbsp;Role creation via a lifting constructor"
+ class="sect">lifting constructor (&sect;2.4.1)</a>).
+ </li>
+ <li>the base side of an argument with declared lifting (see <a href="s2.3.2.html" title="&sect;2.3.2&nbsp;Declared lifting" class="sect">declared lifting (&sect;2.3.2)</a>).
+ </li>
+ </ul>
+ </div>
+ <div class="subsect depth4" id="s2.1.2.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Base imports</span></h4>
+ <p>If the main type in a file denotes a team, the modifier <code>base</code> can be applied to an import in order to specify that this type
+ should be imported for application as a base type only. Example:
+
+ </p>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><em><b>import</b> base</em> some.pack.MyBase;</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> MyTeam {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <span class="comment">// simple name resolves to imported class:</span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <b>protected</b> <b>class</b> MyRole <em><b>playedBy</b> MyBase</em> { } </pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> <span class="error"><em>MyBase</em> illegalDeclaration;</span> <span class="comment">// base import does not apply for this position</span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <p>Types imported by a base import can only be used in the same positions where also base class decapsulation (<a href="#s2.1.2.c" title="&sect;2.1.2.(c)&nbsp;Base class decapsulation"
+ class="sect">&sect;2.1.2.(c)</a>)
+ is applicable.<br />
+ It is recommended that a type mentioned after the keyword <code>playedBy</code> is always imported with the <code>base</code> modifier, otherwise the compiler
+ will give a warning.<br />
+ Base imports create a scope that is disjoint from the normal scope. Thus, names that are imported as base will never clash
+ with normally visible names
+ (in contrast to <a href="s1.4.html" title="&sect;1.4&nbsp;Name clashes" class="sect">&sect;1.4</a>). More specifically, it is not a problem to use a base class's name also for its role if a base import is used.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s2.1.2.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">No free type parameters</span></h4>
+ <p>
+ Neither the role class nor the base class in a playedBy binding must have any <em>free type parameters</em>.
+ If both classes are specified with a type parameter of the same name, both parameters are identified
+ and are not considered as <em>free</em>.
+
+ </p>
+ <p>
+ From this follows that a role class cannot have more type parameters than its base.
+ Conversely, only one situation exists where a base class can have more type parameters than a role class
+ bound to it: if the role class has no type parameters a generic base class can be bound using
+ the base class's raw type, i.e., without specifying type arguments.
+
+ </p>
+ <div class="note">
+ <h5>Note:</h5>
+ The information from the <code>playedBy</code> declaration is used at run-time
+ to associate role instances to base instances.
+ Specifying a base class with free type parameters would imply that only such base instances
+ are decorated by a role whose type is conform to the specified parameterized class.
+ However, type arguments are not available at run-time, thus the run-time environment
+ is not able to decide which base instances should have a role and which should not.
+ This is due to the design of generics in Java which are realized by erasure.
+
+ </div>
+ <p>The following example shows how generics can be used in various positions. Note, that some of the concepts used in the example
+ will be explained in later sections.
+ </p>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>class</b> ValueTrafo<em>&lt;T&gt;</em> {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>public</b> <em>T</em> transform(<em>T</em> val) throws Exception { /* ... */ }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre>}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> TransformTeam {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> <b>protected</b> <b>class</b> SafeTrafo<em>&lt;U&gt;</em> <b>playedBy</b> ValueTrafo<em>&lt;U&gt;</em> {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> <em>U</em> transform(<em>U</em> v) <b>-&gt;</b> <em>U</em> transform(<em>U</em> val); </pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> <b>protected</b> <em>U</em> safeTransform(<em>U</em> v) {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre> <b>try</b> {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre> <b>return</b> transform(v);</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">10</td>
+ <td><pre> } <b>catch</b> (Exception e) {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">11</td>
+ <td><pre> <b>return</b> v;</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">12</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">13</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">14</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">15</td>
+ <td><pre> <em>&lt;V&gt; V</em> perform(ValueTrafo<em>&lt;V&gt;</em> <b>as</b> SafeTrafo<em>&lt;V&gt;</em> trafo, <em>V</em> value) {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">16</td>
+ <td><pre> <b>return</b> trafo.safeTransform(value);</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">17</td>
+ <td><pre> } </pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">18</td>
+ <td><pre>}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">19</td>
+ <td><pre>...</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">20</td>
+ <td><pre>ValueTrafo<em>&lt;String&gt;</em> trafo = <b>new</b> ValueTrafo<em>&lt;String&gt;</em>();</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">21</td>
+ <td><pre>TransformTeam safeTrafo = <b>new</b> TransformTeam();</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">22</td>
+ <td><pre>String s = safeTrafo.perform(trafo, "Testing");</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">23</td>
+ <td><pre></pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="codecomment">
+ <h5>Explanation</h5>
+ <ul>
+ <li>Line 5 shows a role with type parameter <code>U</code> where the type parameter is identified with the
+ corresponding type parameter of the role's base class (which is originally declared as <code>T</code> in line 1.
+ </li>
+ <li>Line 6 shows a callout binding (<a href="s3.html" title="&sect;3&nbsp;Callout Binding" class="sect">&sect;3</a>) which mappes a base method to a corresponding role method
+ while maintaining the flexible typing.
+ </li>
+ <li>The regular method in lines 7-13 just passes values of type <code>U</code> around.
+ </li>
+ <li>The generic method in line 15 ff. uses declared lifting (<a href="s2.3.2.html" title="&sect;2.3.2&nbsp;Declared lifting" class="sect">&sect;2.3.2</a>) to obtain a role for a given base object.
+ The method has no knowledge about the concrete type arguments of either role nor base, but works under the guarantee
+ that both type arguments will be the same for any single invocation.
+ </li>
+ <li>Lines 20 ff. finally create instances of base and team and invoke the behavior thereby instantiating type parameters to <code>String</code>.
+ </li>
+ </ul>
+ </div>
+ </div>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.2.html" rel="next">&sect;2.2&nbsp;Lowering&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.2.a.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.2.a.html
new file mode 100644
index 000000000..3e6f59218
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.2.a.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.2.b.html" rel="next">&sect;2.2.(b)&nbsp;Places of lowering&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.2.html" rel="section">&sect;2.2&nbsp;Lowering</a></div>
+ <div class="subsect depth3" id="s2.2.a">
+ <h4 class="subsect">&sect;2.2.(a)&nbsp;<span class="title">Definition of lowering</span></h4>
+ <p>Retrieving the base object from a role object is called <strong>lowering</strong>.
+ No other means exists for accessing the base reference.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.2.b.html" rel="next">&sect;2.2.(b)&nbsp;Places of lowering&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.2.html" rel="section">&sect;2.2&nbsp;Lowering</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.2.b.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.2.b.html
new file mode 100644
index 000000000..7a8ee203e
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.2.b.html
@@ -0,0 +1,141 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s2.2.a.html" rel="prev">&lt;&lt;&nbsp;&sect;2.2.(a)&nbsp;Definition of lowering</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.2.c.html" rel="next">&sect;2.2.(c)&nbsp;Typing&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.2.html" rel="section">&sect;2.2&nbsp;Lowering</a></div>
+ <div class="subsect depth3" id="s2.2.b">
+ <h4 class="subsect">&sect;2.2.(b)&nbsp;<span class="title">Places of lowering</span></h4>
+ <p>The lowering translation is not meant to be invoked
+ by client code, but <strong>implicit translations</strong> are inserted by
+ the compiler at all places where a role type is provided while the
+ corresponding base type (or a super type) was expected.<br />
+ In other words: lowering translations are inserted by the compiler at
+ all places in a program which would otherwise not be type correct
+ and which using lowering are statically type correct.
+ This may concern:
+
+ </p>
+ <ul>
+ <li>the right hand side of an assignment wrt. the static type of the left hand side,</li>
+ <li>the argument values of a method or constructor call wrt. the static type of the corresponding formal parameter,</li>
+ <li>the return value of a method compared to the declared return type of the method.</li>
+ <li>a role parameter in a callout binding (<a href="s3.3.d.html" title="&sect;3.3.(d)&nbsp;Typing rules" class="sect">&sect;3.3.(d)</a>)
+ </li>
+ <li>or the return value in a callin binding (<a href="s4.5.d.html" title="&sect;4.5.(d)&nbsp;Typing rules" class="sect">&sect;4.5.(d)</a>)
+ </li>
+ </ul>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> MyTeamA {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>public</b> <b>class</b> <em>MyRole <b>playedBy</b> MyBase</em> { ... }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>void</b> useMyBase(<em>MyBase</em> myb) {...}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <em>MyRole</em> returnMyRole() {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> <b>public</b> <b>void</b> doSomething() {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> <em>MyRole r</em> = <b>new</b> MyRole(<b>new</b> MyBase());</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> <em>MyBase b</em> = <em>r</em>;</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre> useMyBase(<em>r</em>);</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre> <em>MyBase b2</em> = returnMyRole();</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">10</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">11</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="codecomment">
+ <h5>Effects:</h5>
+ <p>An instance of type <code>MyRole</code> is lowered to type <code>MyBase</code> when
+ </p>
+ <ul>
+ <li>assigning it to <code>b</code> (line 7)
+ </li>
+ <li>passing it as argument to a method with formal parameter of type <code>MyBase</code> (line 8)
+ </li>
+ <li>assigning the return value to a variable of type <code>MyBase</code> (line 9)
+ </li>
+ </ul>
+ <p><em>Note</em>: The constructor call in line 6 uses the <em>lifting constructor</em> as defined in <a href="s2.4.1.html"
+ title="&sect;2.4.1&nbsp;Role creation via a lifting constructor"
+ class="sect">&sect;2.4.1</a></p>
+ </div>
+ <p>Lowering translations are <span class="underline">not</span> inserted for
+
+ </p>
+ <ul>
+ <li>reference comparison (using <code>==</code> or <code>!=</code>)
+ </li>
+ <li><code>instanceof</code> checks
+ </li>
+ <li>cast expressions</li>
+ <li>return values in callout bindings <a href="s3.3.d.html" title="&sect;3.3.(d)&nbsp;Typing rules" class="sect">&sect;3.3.(d)</a>)
+ </li>
+ <li>parameters in callin bindings (<a href="s4.5.d.html" title="&sect;4.5.(d)&nbsp;Typing rules" class="sect">&sect;4.5.(d)</a>)
+ </li>
+ </ul>
+ <p>For cases where lowering shall be <em>forced</em> see <a href="s2.2.d.html" title="&sect;2.2.(d)&nbsp;Explicit lowering"
+ class="sect">&sect;2.2.(d)</a> below.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s2.2.a.html" rel="prev">&lt;&lt;&nbsp;&sect;2.2.(a)&nbsp;Definition of lowering</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.2.c.html" rel="next">&sect;2.2.(c)&nbsp;Typing&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.2.html" rel="section">&sect;2.2&nbsp;Lowering</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.2.c.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.2.c.html
new file mode 100644
index 000000000..4ce9d7b8e
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.2.c.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s2.2.b.html" rel="prev">&lt;&lt;&nbsp;&sect;2.2.(b)&nbsp;Places of lowering</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.2.d.html" rel="next">&sect;2.2.(d)&nbsp;Explicit lowering&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.2.html" rel="section">&sect;2.2&nbsp;Lowering</a></div>
+ <div class="subsect depth3" id="s2.2.c">
+ <h4 class="subsect">&sect;2.2.(c)&nbsp;<span class="title">Typing</span></h4>
+ <p>The static type of an implicit lowering translation is the base class
+ declared using <code>playedBy</code> in the respective role class.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s2.2.b.html" rel="prev">&lt;&lt;&nbsp;&sect;2.2.(b)&nbsp;Places of lowering</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.2.d.html" rel="next">&sect;2.2.(d)&nbsp;Explicit lowering&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.2.html" rel="section">&sect;2.2&nbsp;Lowering</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.2.d.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.2.d.html
new file mode 100644
index 000000000..bf65defcb
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.2.d.html
@@ -0,0 +1,89 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s2.2.c.html" rel="prev">&lt;&lt;&nbsp;&sect;2.2.(c)&nbsp;Typing</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.2.e.html" rel="next">&sect;2.2.(e)&nbsp;Lowering of arrays&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.2.html" rel="section">&sect;2.2&nbsp;Lowering</a></div>
+ <div class="subsect depth3" id="s2.2.d">
+ <h4 class="subsect">&sect;2.2.(d)&nbsp;<span class="title">Explicit lowering</span></h4>
+ <p>If a base type is also the super type of its role,
+ which frequently happens, if a base reference is known only by
+ the type <code>Object</code>, lowering cannot be deduced automatically,
+ since a type could be interpreted both as a role type and a base type.
+ These cases may need <strong>explicit lowering</strong>.
+ For this purpose the role class must declare to implement the interface
+ <strong><code>ILowerable</code></strong> (from <code>org.objectteams.ITeam</code>).
+ This will cause the compiler to generate a method
+ </p>
+ <div class="listing plain"><pre><b>public</b> Object lower()</pre></div>
+ <p>for the given role class. Client code may use this method to
+ explicitly request the base object of a given role object.
+ </p>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> MyTeamA {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>public</b> <b>class</b> MyRole <em><b>implements</b> ILowerable</em> <b>playedBy</b> MyBase { ... }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>public</b> <b>void</b> doSomething() {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> MyRole r = <b>new</b> MyRole(<b>new</b> MyBase());</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> Object oMyRole = r;</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> Object oMyBase = r.<em>lower()</em>;</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s2.2.c.html" rel="prev">&lt;&lt;&nbsp;&sect;2.2.(c)&nbsp;Typing</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.2.e.html" rel="next">&sect;2.2.(e)&nbsp;Lowering of arrays&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.2.html" rel="section">&sect;2.2&nbsp;Lowering</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.2.e.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.2.e.html
new file mode 100644
index 000000000..b7665588d
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.2.e.html
@@ -0,0 +1,49 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s2.2.d.html" rel="prev">&lt;&lt;&nbsp;&sect;2.2.(d)&nbsp;Explicit lowering</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.2.f.html" rel="next">&sect;2.2.(f)&nbsp;Ambiguous lowering&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.2.html" rel="section">&sect;2.2&nbsp;Lowering</a></div>
+ <div class="subsect depth3" id="s2.2.e">
+ <h4 class="subsect">&sect;2.2.(e)&nbsp;<span class="title">Lowering of arrays</span></h4>
+ <p>Lowering also works for arrays of role objects.
+ In order to lower an array of role objects,
+ a new array is created and filled with base objects, one for each
+ role object in the original array. The array may have any number
+ of dimensions at any shape. The lowered array will have exactly the
+ same shape.<br />
+ Note, that each lowering translation will create a new array.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s2.2.d.html" rel="prev">&lt;&lt;&nbsp;&sect;2.2.(d)&nbsp;Explicit lowering</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.2.f.html" rel="next">&sect;2.2.(f)&nbsp;Ambiguous lowering&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.2.html" rel="section">&sect;2.2&nbsp;Lowering</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.2.f.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.2.f.html
new file mode 100644
index 000000000..1f43139e9
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.2.f.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s2.2.e.html" rel="prev">&lt;&lt;&nbsp;&sect;2.2.(e)&nbsp;Lowering of arrays</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.2.html" rel="section">&sect;2.2&nbsp;Lowering</a></div>
+ <div class="subsect depth3" id="s2.2.f">
+ <h4 class="subsect">&sect;2.2.(f)&nbsp;<span class="title">Ambiguous lowering</span></h4>
+ <p>When assigning a value of a bound role type to a variable or argument of type <code>java.lang.Object</code>
+ this situation is considered as ambiguous lowering because the assignment could apply either (a) a direct upcast to <code>Object</code>
+ or (b) lowering and then upcasting.
+ In such situations the compiler will <em>not</em> insert a lowering translation, but a configurable warning will be issued.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s2.2.e.html" rel="prev">&lt;&lt;&nbsp;&sect;2.2.(e)&nbsp;Lowering of arrays</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.2.html" rel="section">&sect;2.2&nbsp;Lowering</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.2.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.2.html
new file mode 100644
index 000000000..6f65b49f4
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.2.html
@@ -0,0 +1,235 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s2.1.html" rel="prev">&lt;&lt;&nbsp;&sect;2.1&nbsp;playedBy relation</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.3.html" rel="next">&sect;2.3&nbsp;Lifting&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a></div>
+ <div class="sect depth2" id="s2.2">
+ <h2 class="sect">&sect;2.2&nbsp;Lowering</h2>
+ <p>Each instance of a bound role class internally stores a reference to its
+ base object. The reference is guaranteed to exist for each bound role
+ instance, and cannot be changed during its lifetime.
+
+ </p>
+ <div class="subsect depth3" id="s2.2.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Definition of lowering</span></h4>
+ <p>Retrieving the base object from a role object is called <strong>lowering</strong>.
+ No other means exists for accessing the base reference.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s2.2.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Places of lowering</span></h4>
+ <p>The lowering translation is not meant to be invoked
+ by client code, but <strong>implicit translations</strong> are inserted by
+ the compiler at all places where a role type is provided while the
+ corresponding base type (or a super type) was expected.<br />
+ In other words: lowering translations are inserted by the compiler at
+ all places in a program which would otherwise not be type correct
+ and which using lowering are statically type correct.
+ This may concern:
+
+ </p>
+ <ul>
+ <li>the right hand side of an assignment wrt. the static type of the left hand side,</li>
+ <li>the argument values of a method or constructor call wrt. the static type of the corresponding formal parameter,</li>
+ <li>the return value of a method compared to the declared return type of the method.</li>
+ <li>a role parameter in a callout binding (<a href="s3.3.d.html" title="&sect;3.3.(d)&nbsp;Typing rules" class="sect">&sect;3.3.(d)</a>)
+ </li>
+ <li>or the return value in a callin binding (<a href="s4.5.d.html" title="&sect;4.5.(d)&nbsp;Typing rules" class="sect">&sect;4.5.(d)</a>)
+ </li>
+ </ul>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> MyTeamA {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>public</b> <b>class</b> <em>MyRole <b>playedBy</b> MyBase</em> { ... }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>void</b> useMyBase(<em>MyBase</em> myb) {...}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <em>MyRole</em> returnMyRole() {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> <b>public</b> <b>void</b> doSomething() {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> <em>MyRole r</em> = <b>new</b> MyRole(<b>new</b> MyBase());</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> <em>MyBase b</em> = <em>r</em>;</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre> useMyBase(<em>r</em>);</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre> <em>MyBase b2</em> = returnMyRole();</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">10</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">11</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="codecomment">
+ <h5>Effects:</h5>
+ <p>An instance of type <code>MyRole</code> is lowered to type <code>MyBase</code> when
+ </p>
+ <ul>
+ <li>assigning it to <code>b</code> (line 7)
+ </li>
+ <li>passing it as argument to a method with formal parameter of type <code>MyBase</code> (line 8)
+ </li>
+ <li>assigning the return value to a variable of type <code>MyBase</code> (line 9)
+ </li>
+ </ul>
+ <p><em>Note</em>: The constructor call in line 6 uses the <em>lifting constructor</em> as defined in <a href="s2.4.1.html"
+ title="&sect;2.4.1&nbsp;Role creation via a lifting constructor"
+ class="sect">&sect;2.4.1</a></p>
+ </div>
+ <p>Lowering translations are <span class="underline">not</span> inserted for
+
+ </p>
+ <ul>
+ <li>reference comparison (using <code>==</code> or <code>!=</code>)
+ </li>
+ <li><code>instanceof</code> checks
+ </li>
+ <li>cast expressions</li>
+ <li>return values in callout bindings <a href="s3.3.d.html" title="&sect;3.3.(d)&nbsp;Typing rules" class="sect">&sect;3.3.(d)</a>)
+ </li>
+ <li>parameters in callin bindings (<a href="s4.5.d.html" title="&sect;4.5.(d)&nbsp;Typing rules" class="sect">&sect;4.5.(d)</a>)
+ </li>
+ </ul>
+ <p>For cases where lowering shall be <em>forced</em> see <a href="#s2.2.d" title="&sect;2.2.(d)&nbsp;Explicit lowering" class="sect">&sect;2.2.(d)</a> below.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s2.2.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Typing</span></h4>
+ <p>The static type of an implicit lowering translation is the base class
+ declared using <code>playedBy</code> in the respective role class.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s2.2.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Explicit lowering</span></h4>
+ <p>If a base type is also the super type of its role,
+ which frequently happens, if a base reference is known only by
+ the type <code>Object</code>, lowering cannot be deduced automatically,
+ since a type could be interpreted both as a role type and a base type.
+ These cases may need <strong>explicit lowering</strong>.
+ For this purpose the role class must declare to implement the interface
+ <strong><code>ILowerable</code></strong> (from <code>org.objectteams.ITeam</code>).
+ This will cause the compiler to generate a method
+ </p>
+ <div class="listing plain"><pre><b>public</b> Object lower()</pre></div>
+ <p>for the given role class. Client code may use this method to
+ explicitly request the base object of a given role object.
+ </p>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> MyTeamA {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>public</b> <b>class</b> MyRole <em><b>implements</b> ILowerable</em> <b>playedBy</b> MyBase { ... }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>public</b> <b>void</b> doSomething() {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> MyRole r = <b>new</b> MyRole(<b>new</b> MyBase());</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> Object oMyRole = r;</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> Object oMyBase = r.<em>lower()</em>;</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ <div class="subsect depth3" id="s2.2.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Lowering of arrays</span></h4>
+ <p>Lowering also works for arrays of role objects.
+ In order to lower an array of role objects,
+ a new array is created and filled with base objects, one for each
+ role object in the original array. The array may have any number
+ of dimensions at any shape. The lowered array will have exactly the
+ same shape.<br />
+ Note, that each lowering translation will create a new array.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s2.2.f">
+ <h4 class="subsect">(f)&nbsp;<span class="title">Ambiguous lowering</span></h4>
+ <p>When assigning a value of a bound role type to a variable or argument of type <code>java.lang.Object</code>
+ this situation is considered as ambiguous lowering because the assignment could apply either (a) a direct upcast to <code>Object</code>
+ or (b) lowering and then upcasting.
+ In such situations the compiler will <em>not</em> insert a lowering translation, but a configurable warning will be issued.
+
+ </p>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s2.1.html" rel="prev">&lt;&lt;&nbsp;&sect;2.1&nbsp;playedBy relation</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.3.html" rel="next">&sect;2.3&nbsp;Lifting&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.1.a.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.1.a.html
new file mode 100644
index 000000000..f0e9e8388
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.1.a.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.3.1.b.html" rel="next">&sect;2.3.1.(b)&nbsp;Default lifting constructor&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.html" rel="section">&sect;2.3&nbsp;Lifting</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.1.html" rel="section">&sect;2.3.1&nbsp;Implicit role creation</a></div>
+ <div class="subsect depth4" id="s2.3.1.a">
+ <h4 class="subsect">&sect;2.3.1.(a)&nbsp;<span class="title">Reuse of existing role objects</span></h4>
+ <p>A role object is considered suitable for reuse during lifting, if
+ these three items are identical:
+
+ </p>
+ <ol>
+ <li>the given base object</li>
+ <li>the given team object</li>
+ <li>the statically required role type</li>
+ </ol>
+ <p>For the relation between the statically required role type and
+ the actual type of the role object see <a href="s2.3.3.html" title="&sect;2.3.3&nbsp;Smart lifting" class="sect">"smart lifting" (&sect;2.3.3)</a>.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.3.1.b.html" rel="next">&sect;2.3.1.(b)&nbsp;Default lifting constructor&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.html" rel="section">&sect;2.3&nbsp;Lifting</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.1.html" rel="section">&sect;2.3.1&nbsp;Implicit role creation</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.1.b.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.1.b.html
new file mode 100644
index 000000000..cd4525d9e
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.1.b.html
@@ -0,0 +1,57 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s2.3.1.a.html" rel="prev">&lt;&lt;&nbsp;&sect;2.3.1.(a)&nbsp;Reuse of existing role objects</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.3.1.c.html" rel="next">&sect;2.3.1.(c)&nbsp;Custom lifting constructor&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.html" rel="section">&sect;2.3&nbsp;Lifting</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.1.html" rel="section">&sect;2.3.1&nbsp;Implicit role creation</a></div>
+ <div class="subsect depth4" id="s2.3.1.b">
+ <h4 class="subsect">&sect;2.3.1.(b)&nbsp;<span class="title">Default lifting constructor</span></h4>
+ <p>Lifting uses a default constructor which takes exactly one argument of the type
+ of the declared base class (after <code>playedBy</code>).
+ By default the compiler generates such a constructor for each bound role.
+ On the other hand, default constructors that take no arguments
+ (as in <a href="http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#16823"
+ class="ext">JLS &sect;8.8.7</a>) are never generated for bound roles.
+ <br />
+ The super-constructor to be invoked by a default lifting constructor
+ depends on whether the role's super class is a bound role or not.
+
+ </p>
+ <ul>
+ <li>If the super-class is a bound role, the default lifting constructor will invoke the default lifting constructor of the super-class.</li>
+ <li>If the super-class is not a bound role, the default lifting constructor will invoke the normal argumentless default constructor
+ of the super-class.
+ </li>
+ </ul>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s2.3.1.a.html" rel="prev">&lt;&lt;&nbsp;&sect;2.3.1.(a)&nbsp;Reuse of existing role objects</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.3.1.c.html" rel="next">&sect;2.3.1.(c)&nbsp;Custom lifting constructor&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.html" rel="section">&sect;2.3&nbsp;Lifting</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.1.html" rel="section">&sect;2.3.1&nbsp;Implicit role creation</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.1.c.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.1.c.html
new file mode 100644
index 000000000..eec82eed1
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.1.c.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s2.3.1.b.html" rel="prev">&lt;&lt;&nbsp;&sect;2.3.1.(b)&nbsp;Default lifting constructor</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.html" rel="section">&sect;2.3&nbsp;Lifting</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.1.html" rel="section">&sect;2.3.1&nbsp;Implicit role creation</a></div>
+ <div class="subsect depth4" id="s2.3.1.c">
+ <h4 class="subsect">&sect;2.3.1.(c)&nbsp;<span class="title">Custom lifting constructor</span></h4>
+ <p>If a role class declares a custom constructor with the same signature
+ as the default lifting constructor, this constructor is used during lifting.
+ This custom constructor may pre-assume that the role has been setup
+ properly regarding its base-link and registered in the team's internal map of roles.
+ <br />
+ If a bound role has an unbound super-class without an argumentless
+ constructor, providing a custom lifting constructor is obligatory,
+ because no legal default lifting constructor can be generated.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s2.3.1.b.html" rel="prev">&lt;&lt;&nbsp;&sect;2.3.1.(b)&nbsp;Default lifting constructor</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.html" rel="section">&sect;2.3&nbsp;Lifting</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.1.html" rel="section">&sect;2.3.1&nbsp;Implicit role creation</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.1.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.1.html
new file mode 100644
index 000000000..37da61f1b
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.1.html
@@ -0,0 +1,94 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s2.3.d.html" rel="prev">&lt;&lt;&nbsp;&sect;2.3.(d)&nbsp;Lifting of arrays</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.3.2.html" rel="next">&sect;2.3.2&nbsp;Declared lifting&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.html" rel="section">&sect;2.3&nbsp;Lifting</a></div>
+ <div class="sect depth3" id="s2.3.1">
+ <h3 class="sect">&sect;2.3.1&nbsp;Implicit role creation</h3>
+ <p>Lifting tries to reuse existing role objects so that role state persists across
+ lifting and lowering. If no suitable role instance is found during lifting,
+ a new role is created.
+
+ </p>
+ <div class="subsect depth4" id="s2.3.1.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Reuse of existing role objects</span></h4>
+ <p>A role object is considered suitable for reuse during lifting, if
+ these three items are identical:
+
+ </p>
+ <ol>
+ <li>the given base object</li>
+ <li>the given team object</li>
+ <li>the statically required role type</li>
+ </ol>
+ <p>For the relation between the statically required role type and
+ the actual type of the role object see <a href="s2.3.3.html" title="&sect;2.3.3&nbsp;Smart lifting" class="sect">"smart lifting" (&sect;2.3.3)</a>.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s2.3.1.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Default lifting constructor</span></h4>
+ <p>Lifting uses a default constructor which takes exactly one argument of the type
+ of the declared base class (after <code>playedBy</code>).
+ By default the compiler generates such a constructor for each bound role.
+ On the other hand, default constructors that take no arguments
+ (as in <a href="http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#16823"
+ class="ext">JLS &sect;8.8.7</a>) are never generated for bound roles.
+ <br />
+ The super-constructor to be invoked by a default lifting constructor
+ depends on whether the role's super class is a bound role or not.
+
+ </p>
+ <ul>
+ <li>If the super-class is a bound role, the default lifting constructor will invoke the default lifting constructor of the super-class.</li>
+ <li>If the super-class is not a bound role, the default lifting constructor will invoke the normal argumentless default constructor
+ of the super-class.
+ </li>
+ </ul>
+ </div>
+ <div class="subsect depth4" id="s2.3.1.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Custom lifting constructor</span></h4>
+ <p>If a role class declares a custom constructor with the same signature
+ as the default lifting constructor, this constructor is used during lifting.
+ This custom constructor may pre-assume that the role has been setup
+ properly regarding its base-link and registered in the team's internal map of roles.
+ <br />
+ If a bound role has an unbound super-class without an argumentless
+ constructor, providing a custom lifting constructor is obligatory,
+ because no legal default lifting constructor can be generated.
+
+ </p>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s2.3.d.html" rel="prev">&lt;&lt;&nbsp;&sect;2.3.(d)&nbsp;Lifting of arrays</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.3.2.html" rel="next">&sect;2.3.2&nbsp;Declared lifting&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.html" rel="section">&sect;2.3&nbsp;Lifting</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.2.a.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.2.a.html
new file mode 100644
index 000000000..609463cae
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.2.a.html
@@ -0,0 +1,60 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.3.2.b.html" rel="next">&sect;2.3.2.(b)&nbsp;Super in the context of declared lifting&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.html" rel="section">&sect;2.3&nbsp;Lifting</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.2.html" rel="section">&sect;2.3.2&nbsp;Declared lifting</a></div>
+ <div class="subsect depth4" id="s2.3.2.a">
+ <h4 class="subsect">&sect;2.3.2.(a)&nbsp;<span class="title">Parameters with declared lifting</span></h4>
+ <p>A non-static team-level method or constructor may declare a parameter with two types
+ in order to explicitly denote a place of <strong>lifting</strong>. Using the syntax
+
+ </p>
+ <div class="listing plain"><pre><b>public</b> <b>void</b> m (BaseClass <em>as</em> RoleClass param) { <i>stmts</i> }</pre></div>
+ <p>a liftable parameter can be declared, provided the second type
+ (<code>RoleClass</code>) is a role of (<code>playedBy</code>) the first type (<code>BaseClass</code>).
+ Furthermore, the role type must be a role of the enclosing team class defining the given method.
+ The role type must be given by its simple (i.e., unqualified) name.
+ <br />
+ Such a signature requires the caller to provide a base object (here <code>BaseClass</code>), but
+ the callee receives a role object (here <code>RoleClass</code>).
+ In fact, the client sees a signature in which the "<code>as RoleClass</code>" part is omitted.
+ <br />
+ Compatibility between caller and callee sides is achieved by an implicitly inserted lifting translation.
+ A signature using declared lifting is only valid, if the requested lifting is possible
+ (see <a href="s2.3.3.html" title="&sect;2.3.3&nbsp;Smart lifting" class="sect">&sect;2.3.3</a> and <a href="s2.3.4.html" title="&sect;2.3.4&nbsp;Binding ambiguities"
+ class="sect">&sect;2.3.4</a> for details).
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.3.2.b.html" rel="next">&sect;2.3.2.(b)&nbsp;Super in the context of declared lifting&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.html" rel="section">&sect;2.3&nbsp;Lifting</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.2.html" rel="section">&sect;2.3.2&nbsp;Declared lifting</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.2.b.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.2.b.html
new file mode 100644
index 000000000..2639462ab
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.2.b.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s2.3.2.a.html" rel="prev">&lt;&lt;&nbsp;&sect;2.3.2.(a)&nbsp;Parameters with declared lifting</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.3.2.c.html" rel="next">&sect;2.3.2.(c)&nbsp;Declared lifting of arrays&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.html" rel="section">&sect;2.3&nbsp;Lifting</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.2.html" rel="section">&sect;2.3.2&nbsp;Declared lifting</a></div>
+ <div class="subsect depth4" id="s2.3.2.b">
+ <h4 class="subsect">&sect;2.3.2.(b)&nbsp;<span class="title">Super in the context of declared lifting</span></h4>
+ <p>Calling <code>super</code> or <code>tsuper</code> in a method or constructor which
+ declares lifting for one or more parameters refers to a method or constructor with role type parameters,
+ i.e., lifting takes place <em>before</em> super invocation. Nevertheless, the super method may also
+ have a declared lifting signature. It will then see the same role instance(s) as the current method.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s2.3.2.a.html" rel="prev">&lt;&lt;&nbsp;&sect;2.3.2.(a)&nbsp;Parameters with declared lifting</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.3.2.c.html" rel="next">&sect;2.3.2.(c)&nbsp;Declared lifting of arrays&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.html" rel="section">&sect;2.3&nbsp;Lifting</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.2.html" rel="section">&sect;2.3.2&nbsp;Declared lifting</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.2.c.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.2.c.html
new file mode 100644
index 000000000..794ce8761
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.2.c.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s2.3.2.b.html" rel="prev">&lt;&lt;&nbsp;&sect;2.3.2.(b)&nbsp;Super in the context of declared lifting</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.3.2.d.html" rel="next">&sect;2.3.2.(d)&nbsp;Declared lifting for catch blocks&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.html" rel="section">&sect;2.3&nbsp;Lifting</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.2.html" rel="section">&sect;2.3.2&nbsp;Declared lifting</a></div>
+ <div class="subsect depth4" id="s2.3.2.c">
+ <h4 class="subsect">&sect;2.3.2.(c)&nbsp;<span class="title">Declared lifting of arrays</span></h4>
+ <p>If a parameter involving explicit lifting should be of an <strong>array</strong> type, the syntax is
+
+ </p>
+ <div class="listing plain"><pre><b>public</b> <b>void</b> m (BaseClass <b>as</b> RoleClass param[]) ...</pre></div>
+ <p>Here the brackets denoting the array apply to both types, <code>BaseClass</code>
+ and <code>RoleClass</code>.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s2.3.2.b.html" rel="prev">&lt;&lt;&nbsp;&sect;2.3.2.(b)&nbsp;Super in the context of declared lifting</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.3.2.d.html" rel="next">&sect;2.3.2.(d)&nbsp;Declared lifting for catch blocks&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.html" rel="section">&sect;2.3&nbsp;Lifting</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.2.html" rel="section">&sect;2.3.2&nbsp;Declared lifting</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.2.d.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.2.d.html
new file mode 100644
index 000000000..08f1777c6
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.2.d.html
@@ -0,0 +1,55 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s2.3.2.c.html" rel="prev">&lt;&lt;&nbsp;&sect;2.3.2.(c)&nbsp;Declared lifting of arrays</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.3.2.e.html" rel="next">&sect;2.3.2.(e)&nbsp;Generic declared lifting&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.html" rel="section">&sect;2.3&nbsp;Lifting</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.2.html" rel="section">&sect;2.3.2&nbsp;Declared lifting</a></div>
+ <div class="subsect depth4" id="s2.3.2.d">
+ <h4 class="subsect">&sect;2.3.2.(d)&nbsp;<span class="title">Declared lifting for catch blocks</span></h4>
+ <p>Also the argument of a catch block may apply declared lifting like in:
+
+ </p>
+ <div class="listing plain"><pre><b>catch</b> (BaseException <b>as</b> RoleClass param) { <i>stmts</i> }</pre></div>
+ <p>This syntax is only valid in a non-static scope of a team (directly or nested).
+ In the given example, <code>RoleClass</code> must be played by <code>BaseException</code>.
+ Note, that <code>RoleClass</code> itself need not be a throwable.
+ As the effect of this declaration the catch block will catch any exception of type <code>BaseException</code>
+ and provides it wrapped with a <code>RoleClass</code> instance to the subsequent block.
+ <br />
+ Also note, that re-throwing the given instance <code>param</code> has the semantics of implicitly lowering
+ the role to its base exception before throwing, because the role conforms to the required type
+ <code>Throwable</code> only via lowering.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s2.3.2.c.html" rel="prev">&lt;&lt;&nbsp;&sect;2.3.2.(c)&nbsp;Declared lifting of arrays</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.3.2.e.html" rel="next">&sect;2.3.2.(e)&nbsp;Generic declared lifting&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.html" rel="section">&sect;2.3&nbsp;Lifting</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.2.html" rel="section">&sect;2.3.2&nbsp;Declared lifting</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.2.e.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.2.e.html
new file mode 100644
index 000000000..f030d41f9
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.2.e.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s2.3.2.d.html" rel="prev">&lt;&lt;&nbsp;&sect;2.3.2.(d)&nbsp;Declared lifting for catch blocks</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.html" rel="section">&sect;2.3&nbsp;Lifting</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.2.html" rel="section">&sect;2.3.2&nbsp;Declared lifting</a></div>
+ <div class="subsect depth4" id="s2.3.2.e">
+ <h4 class="subsect">&sect;2.3.2.(e)&nbsp;<span class="title">Generic declared lifting</span></h4>
+ <p>A method with declared lifting may introduce a type parameter that is bounded relative to a given role type.
+ Such bound is declared as:
+
+ </p>
+ <div class="listing plain"><pre>&lt;AnyBase <b>base</b> SuperRole&gt;
+<b>void</b> teamMethod(AnyBase <b>as</b> SuperRole arg) {
+ <span class="comment">// body using arg as of type SuperRole</span>
+}</pre></div>
+ <p>This means that <code>AnyBase</code> is a type parameter whose instantiations must all be liftable to role <code>SuperRole</code>.
+
+ </p>
+ <p>
+ The given type bound requires the call site to supply an argument that is compatible to any base class
+ for which the current team contains a bound role that is a sub class of <code>SuperRole</code>, including <code>SuperRole</code> itself.
+ However, <code>SuperRole</code> itself need not be bound to any base class.
+ On the other hand, different valid substitutions for <code>AnyBase</code> need not be related by inheritance.
+
+ </p>
+ <div class="note">
+ <h5>Note:</h5>
+ This feature supports generalized treatment of otherwise unrelated base classes.
+ This is done by defining one bound role for each base under consideration and by
+ having all these roles extend a common unbound role.
+
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s2.3.2.d.html" rel="prev">&lt;&lt;&nbsp;&sect;2.3.2.(d)&nbsp;Declared lifting for catch blocks</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.html" rel="section">&sect;2.3&nbsp;Lifting</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.2.html" rel="section">&sect;2.3.2&nbsp;Declared lifting</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.2.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.2.html
new file mode 100644
index 000000000..527a0375f
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.2.html
@@ -0,0 +1,197 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s2.3.1.html" rel="prev">&lt;&lt;&nbsp;&sect;2.3.1&nbsp;Implicit role creation</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.3.3.html" rel="next">&sect;2.3.3&nbsp;Smart lifting&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.html" rel="section">&sect;2.3&nbsp;Lifting</a></div>
+ <div class="sect depth3" id="s2.3.2">
+ <h3 class="sect">&sect;2.3.2&nbsp;Declared lifting</h3>
+ <div class="syntaxlink"><a href="sA.html#sA.6.2" title="&sect;A.6.2&nbsp;LiftingType" class="syntax">&rarr;&nbsp;Syntax&nbsp;&sect;A.6.2</a></div>
+ <div class="subsect depth4" id="s2.3.2.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Parameters with declared lifting</span></h4>
+ <p>A non-static team-level method or constructor may declare a parameter with two types
+ in order to explicitly denote a place of <strong>lifting</strong>. Using the syntax
+
+ </p>
+ <div class="listing plain"><pre><b>public</b> <b>void</b> m (BaseClass <em>as</em> RoleClass param) { <i>stmts</i> }</pre></div>
+ <p>a liftable parameter can be declared, provided the second type
+ (<code>RoleClass</code>) is a role of (<code>playedBy</code>) the first type (<code>BaseClass</code>).
+ Furthermore, the role type must be a role of the enclosing team class defining the given method.
+ The role type must be given by its simple (i.e., unqualified) name.
+ <br />
+ Such a signature requires the caller to provide a base object (here <code>BaseClass</code>), but
+ the callee receives a role object (here <code>RoleClass</code>).
+ In fact, the client sees a signature in which the "<code>as RoleClass</code>" part is omitted.
+ <br />
+ Compatibility between caller and callee sides is achieved by an implicitly inserted lifting translation.
+ A signature using declared lifting is only valid, if the requested lifting is possible
+ (see <a href="s2.3.3.html" title="&sect;2.3.3&nbsp;Smart lifting" class="sect">&sect;2.3.3</a> and <a href="s2.3.4.html" title="&sect;2.3.4&nbsp;Binding ambiguities"
+ class="sect">&sect;2.3.4</a> for details).
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s2.3.2.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Super in the context of declared lifting</span></h4>
+ <p>Calling <code>super</code> or <code>tsuper</code> in a method or constructor which
+ declares lifting for one or more parameters refers to a method or constructor with role type parameters,
+ i.e., lifting takes place <em>before</em> super invocation. Nevertheless, the super method may also
+ have a declared lifting signature. It will then see the same role instance(s) as the current method.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s2.3.2.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Declared lifting of arrays</span></h4>
+ <p>If a parameter involving explicit lifting should be of an <strong>array</strong> type, the syntax is
+
+ </p>
+ <div class="listing plain"><pre><b>public</b> <b>void</b> m (BaseClass <b>as</b> RoleClass param[]) ...</pre></div>
+ <p>Here the brackets denoting the array apply to both types, <code>BaseClass</code>
+ and <code>RoleClass</code>.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s2.3.2.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Declared lifting for catch blocks</span></h4>
+ <p>Also the argument of a catch block may apply declared lifting like in:
+
+ </p>
+ <div class="listing plain"><pre><b>catch</b> (BaseException <b>as</b> RoleClass param) { <i>stmts</i> }</pre></div>
+ <p>This syntax is only valid in a non-static scope of a team (directly or nested).
+ In the given example, <code>RoleClass</code> must be played by <code>BaseException</code>.
+ Note, that <code>RoleClass</code> itself need not be a throwable.
+ As the effect of this declaration the catch block will catch any exception of type <code>BaseException</code>
+ and provides it wrapped with a <code>RoleClass</code> instance to the subsequent block.
+ <br />
+ Also note, that re-throwing the given instance <code>param</code> has the semantics of implicitly lowering
+ the role to its base exception before throwing, because the role conforms to the required type
+ <code>Throwable</code> only via lowering.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s2.3.2.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Generic declared lifting</span></h4>
+ <p>A method with declared lifting may introduce a type parameter that is bounded relative to a given role type.
+ Such bound is declared as:
+
+ </p>
+ <div class="listing plain"><pre>&lt;AnyBase <b>base</b> SuperRole&gt;
+<b>void</b> teamMethod(AnyBase <b>as</b> SuperRole arg) {
+ <span class="comment">// body using arg as of type SuperRole</span>
+}</pre></div>
+ <p>This means that <code>AnyBase</code> is a type parameter whose instantiations must all be liftable to role <code>SuperRole</code>.
+
+ </p>
+ <p>
+ The given type bound requires the call site to supply an argument that is compatible to any base class
+ for which the current team contains a bound role that is a sub class of <code>SuperRole</code>, including <code>SuperRole</code> itself.
+ However, <code>SuperRole</code> itself need not be bound to any base class.
+ On the other hand, different valid substitutions for <code>AnyBase</code> need not be related by inheritance.
+
+ </p>
+ <div class="note">
+ <h5>Note:</h5>
+ This feature supports generalized treatment of otherwise unrelated base classes.
+ This is done by defining one bound role for each base under consideration and by
+ having all these roles extend a common unbound role.
+
+ </div>
+ </div>
+ <h5 class="listing">Example code (Declared Lifting):</h5>
+ <div class="listing example frame" id="l2.3.2">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>team</b> <b>class</b> Super {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>public</b> <b>class</b> MyRole <b>playedBy</b> MyBase { ... }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>void</b> m (MyRole o) { ... };</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre>}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre><b>team</b> <b>class</b> Sub <b>extends</b> Super {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> <b>void</b> m (<em>MyBase <b>as</b> MyRole o</em>) {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> <span class="comment">// inside this method o is of type MyRole</span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre> super.m(o);</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">10</td>
+ <td><pre>}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">11</td>
+ <td><pre>Sub s_<b>team</b> = <b>new</b> Sub();</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">12</td>
+ <td><pre>MyBase b = <b>new</b> MyBase();</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">13</td>
+ <td><pre>s_team.m(b); <span class="comment">// clients see a parameter "MyBase o"</span></pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="codecomment">
+ <h5>Effects:</h5>
+ <ul>
+ <li>Clients use method <code>m</code> with a base instance (type <code>MyBase</code>) as its argument (line 13).
+ </li>
+ <li>Before executing the body of <code>m</code>, the argument is lifted such that the method body receives
+ the argument as of type <code>MyRole</code> (line 8).
+ </li>
+ </ul>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s2.3.1.html" rel="prev">&lt;&lt;&nbsp;&sect;2.3.1&nbsp;Implicit role creation</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.3.3.html" rel="next">&sect;2.3.3&nbsp;Smart lifting&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.html" rel="section">&sect;2.3&nbsp;Lifting</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.3.a.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.3.a.html
new file mode 100644
index 000000000..a702e9496
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.3.a.html
@@ -0,0 +1,55 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.3.3.b.html" rel="next">&sect;2.3.3.(b)&nbsp;Dynamic selection of a role class&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.html" rel="section">&sect;2.3&nbsp;Lifting</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.3.html" rel="section">&sect;2.3.3&nbsp;Smart lifting</a></div>
+ <div class="subsect depth4" id="s2.3.3.a">
+ <h4 class="subsect">&sect;2.3.3.(a)&nbsp;<span class="title">Static adjustment</span></h4>
+ <p>If a base class <code>B</code> shall be lifted to a role class
+ <code>R</code> that is not bound to (<code>playedBy</code>)
+ <code>B</code>, but if a subclass of <code>R</code>
+ &mdash; say <code>R2</code> &mdash;
+ is bound to <code>B</code>, lifting is statically setup to use
+ <code>R2</code>, the most general subclass of <code>R</code> that
+ is bound to <code>B</code> or one of its super-types.
+
+ </p>
+ <div class="note">
+ <h5>Restriction:</h5>
+ This step is not applicable for parameter mappings of <code>replace</code>
+ callin bindings (<a href="s4.5.d.html" title="&sect;4.5.(d)&nbsp;Typing rules" class="sect">&sect;4.5.(d)</a>).
+
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.3.3.b.html" rel="next">&sect;2.3.3.(b)&nbsp;Dynamic selection of a role class&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.html" rel="section">&sect;2.3&nbsp;Lifting</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.3.html" rel="section">&sect;2.3.3&nbsp;Smart lifting</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.3.b.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.3.b.html
new file mode 100644
index 000000000..e39e3d4e6
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.3.b.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s2.3.3.a.html" rel="prev">&lt;&lt;&nbsp;&sect;2.3.3.(a)&nbsp;Static adjustment</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.3.3.c.html" rel="next">&sect;2.3.3.(c)&nbsp;Team as closed world&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.html" rel="section">&sect;2.3&nbsp;Lifting</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.3.html" rel="section">&sect;2.3.3&nbsp;Smart lifting</a></div>
+ <div class="subsect depth4" id="s2.3.3.b">
+ <h4 class="subsect">&sect;2.3.3.(b)&nbsp;<span class="title">Dynamic selection of a role class</span></h4>
+ <p>At runtime also the dynamic type of a base object is considered:
+ Lifting always tries to use a role class that is bound to the
+ exact class of the base object. Lifting considers all role&ndash;base
+ pairs bound by <code>playedBy</code> such that the role class is a
+ sub-class of the required (statically declared) role type
+ and the base class is a super-class of the
+ dynamic type of the base object.
+ <br />
+ From those possible pairs the most specific base class is chosen.
+ If multiple role classes are bound to this base class the most
+ specific of these classes is chosen.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s2.3.3.a.html" rel="prev">&lt;&lt;&nbsp;&sect;2.3.3.(a)&nbsp;Static adjustment</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.3.3.c.html" rel="next">&sect;2.3.3.(c)&nbsp;Team as closed world&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.html" rel="section">&sect;2.3&nbsp;Lifting</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.3.html" rel="section">&sect;2.3.3&nbsp;Smart lifting</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.3.c.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.3.c.html
new file mode 100644
index 000000000..9d4d9306f
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.3.c.html
@@ -0,0 +1,49 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s2.3.3.b.html" rel="prev">&lt;&lt;&nbsp;&sect;2.3.3.(b)&nbsp;Dynamic selection of a role class</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.3.3.d.html" rel="next">&sect;2.3.3.(d)&nbsp;Selection regardless of abstractness&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.html" rel="section">&sect;2.3&nbsp;Lifting</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.3.html" rel="section">&sect;2.3.3&nbsp;Smart lifting</a></div>
+ <div class="subsect depth4" id="s2.3.3.c">
+ <h4 class="subsect">&sect;2.3.3.(c)&nbsp;<span class="title">Team as closed world</span></h4>
+ <p>In the above analysis gathering all role-base pairs is performed at
+ compile-time. From this follows, that a team class can only be
+ compiled when all its contained role classes are known and a role class
+ can never be compiled without its team.
+ <br />
+ The analysis includes all roles and their bindings that are inherited
+ from the super-team.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s2.3.3.b.html" rel="prev">&lt;&lt;&nbsp;&sect;2.3.3.(b)&nbsp;Dynamic selection of a role class</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.3.3.d.html" rel="next">&sect;2.3.3.(d)&nbsp;Selection regardless of abstractness&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.html" rel="section">&sect;2.3&nbsp;Lifting</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.3.html" rel="section">&sect;2.3.3&nbsp;Smart lifting</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.3.d.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.3.d.html
new file mode 100644
index 000000000..40cdc4798
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.3.d.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s2.3.3.c.html" rel="prev">&lt;&lt;&nbsp;&sect;2.3.3.(c)&nbsp;Team as closed world</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.html" rel="section">&sect;2.3&nbsp;Lifting</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.3.html" rel="section">&sect;2.3.3&nbsp;Smart lifting</a></div>
+ <div class="subsect depth4" id="s2.3.3.d">
+ <h4 class="subsect">&sect;2.3.3.(d)&nbsp;<span class="title">Selection regardless of abstractness</span></h4>
+ <p>Smart lifting is not affected by abstractness of role classes.
+ For the effect of abstract role classes see <a href="s2.5.html" title="&sect;2.5&nbsp;Abstract Roles" class="sect">&sect;2.5</a>.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s2.3.3.c.html" rel="prev">&lt;&lt;&nbsp;&sect;2.3.3.(c)&nbsp;Team as closed world</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.html" rel="section">&sect;2.3&nbsp;Lifting</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.3.html" rel="section">&sect;2.3.3&nbsp;Smart lifting</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.3.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.3.html
new file mode 100644
index 000000000..9b1f38093
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.3.html
@@ -0,0 +1,175 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s2.3.2.html" rel="prev">&lt;&lt;&nbsp;&sect;2.3.2&nbsp;Declared lifting</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.3.4.html" rel="next">&sect;2.3.4&nbsp;Binding ambiguities&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.html" rel="section">&sect;2.3&nbsp;Lifting</a></div>
+ <div class="sect depth3" id="s2.3.3">
+ <h3 class="sect">&sect;2.3.3&nbsp;Smart lifting</h3>
+ <p>In situations where role and base classes are part of some inheritance
+ hierarchies (<code>extends</code>), choosing the appropriate role class during
+ lifting involves the following rules:
+
+ </p>
+ <div class="subsect depth4" id="s2.3.3.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Static adjustment</span></h4>
+ <p>If a base class <code>B</code> shall be lifted to a role class
+ <code>R</code> that is not bound to (<code>playedBy</code>)
+ <code>B</code>, but if a subclass of <code>R</code>
+ &mdash; say <code>R2</code> &mdash;
+ is bound to <code>B</code>, lifting is statically setup to use
+ <code>R2</code>, the most general subclass of <code>R</code> that
+ is bound to <code>B</code> or one of its super-types.
+
+ </p>
+ <div class="note">
+ <h5>Restriction:</h5>
+ This step is not applicable for parameter mappings of <code>replace</code>
+ callin bindings (<a href="s4.5.d.html" title="&sect;4.5.(d)&nbsp;Typing rules" class="sect">&sect;4.5.(d)</a>).
+
+ </div>
+ </div>
+ <div class="subsect depth4" id="s2.3.3.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Dynamic selection of a role class</span></h4>
+ <p>At runtime also the dynamic type of a base object is considered:
+ Lifting always tries to use a role class that is bound to the
+ exact class of the base object. Lifting considers all role&ndash;base
+ pairs bound by <code>playedBy</code> such that the role class is a
+ sub-class of the required (statically declared) role type
+ and the base class is a super-class of the
+ dynamic type of the base object.
+ <br />
+ From those possible pairs the most specific base class is chosen.
+ If multiple role classes are bound to this base class the most
+ specific of these classes is chosen.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s2.3.3.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Team as closed world</span></h4>
+ <p>In the above analysis gathering all role-base pairs is performed at
+ compile-time. From this follows, that a team class can only be
+ compiled when all its contained role classes are known and a role class
+ can never be compiled without its team.
+ <br />
+ The analysis includes all roles and their bindings that are inherited
+ from the super-team.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s2.3.3.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Selection regardless of abstractness</span></h4>
+ <p>Smart lifting is not affected by abstractness of role classes.
+ For the effect of abstract role classes see <a href="s2.5.html" title="&sect;2.5&nbsp;Abstract Roles" class="sect">&sect;2.5</a>.
+
+ </p>
+ </div>
+ <h5>Complex Example:</h5>
+ <p><img src="../images/smart_lifting_small.png" alt="smart lifting example" /></p>
+ <table border="2" width="80%">
+ <colgroup span="1">
+ <col align="left" span="1" />
+ <col align="left" span="1" />
+ </colgroup>
+ <tr>
+ <th rowspan="1" colspan="1">role class</th>
+ <th rowspan="1" colspan="1">base class</th>
+ </tr>
+ <tr>
+ <td rowspan="1" colspan="1">class R1</td>
+ <td rowspan="1" colspan="1">&nbsp;</td>
+ </tr>
+ <tr>
+ <td rowspan="1" colspan="1">class R2 extends R1 playedBy B2</td>
+ <td rowspan="1" colspan="1">class B2</td>
+ </tr>
+ <tr>
+ <td rowspan="1" colspan="1">class R3 extends R2 <em>/* inherited: playedBy B2 */ </em></td>
+ <td rowspan="1" colspan="1">class B3 extends B2</td>
+ </tr>
+ <tr>
+ <td rowspan="1" colspan="1">class R4 extends R3 playedBy B4</td>
+ <td rowspan="1" colspan="1">class B4 extends B3</td>
+ </tr>
+ <tr>
+ <td rowspan="1" colspan="1">class R5 extends R4 <em>/* inherited: playedBy B4 */</em></td>
+ <td rowspan="1" colspan="1">&nbsp;</td>
+ </tr>
+ <tr>
+ <td rowspan="1" colspan="1">&nbsp;</td>
+ <td rowspan="1" colspan="1">class B6 extends B4</td>
+ </tr>
+ <tr>
+ <td rowspan="1" colspan="1">class R7 extends R5 playedBy B7</td>
+ <td rowspan="1" colspan="1">class B7 extends B6</td>
+ </tr>
+ </table>
+ <div class="codecomment">
+ <ul>
+ <li>If declarations require lifting <code>B3</code> to <code>R1</code>
+ this is statically refined to use <code>R2</code> instead, because this
+ is the most general class declaring a binding to a super&ndash;class
+ of <code>B3</code>.
+
+ </li>
+ <li>If the dynamic base type in the same situation is <code>B6</code>,
+ three steps select the appropriate role:
+
+ <ol>
+ <li>By searching all <code>playedBy</code> clauses (including those
+ that are inherited) the following role&ndash;base pairs are
+ candidates:<br /><code>(R2,B2), (R3,B2), (R4,B4)</code> and <code>(R5,B4)</code>.
+ </li>
+ <li>From these pairs the two containing the most specific base class
+ <code>B4</code> are chosen.
+ </li>
+ <li>This makes <code>R4</code> and <code>R5</code> role candidates,
+ from which the most specific <code>R5</code> is finally chosen.
+ </li>
+ </ol>
+ </li>
+ </ul>
+ </div>
+ <p>If the inheritance hierarchies of the involved base and role classes are given (like in the figure above)
+ the smart lifting algorithm can be rephrased to the following "graphical" rule:<br /></p>
+ <div class="note">
+ Starting with the dynamic base type (<code>B6</code> in the example) move upwards the the inheritance
+ relation until you reach a base class bound to a role class indicated by a &laquo;playedBy&raquo;
+ arrow pointing to the base class (<code>B4</code>). This role class must be conform to the requested role type.
+ Switch to the role side along this arrow (<code>R4</code>). Now move downwards the role inheritance hierarchy
+ as long as the subrole does not refine the playedBy relationship (indicated by another &laquo;playedBy&raquo; arrow).
+ The bottom role you reach this way (<code>R5</code>) is the role type selected by smart lifting.
+
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s2.3.2.html" rel="prev">&lt;&lt;&nbsp;&sect;2.3.2&nbsp;Declared lifting</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.3.4.html" rel="next">&sect;2.3.4&nbsp;Binding ambiguities&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.html" rel="section">&sect;2.3&nbsp;Lifting</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.4.a.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.4.a.html
new file mode 100644
index 000000000..c215b6286
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.4.a.html
@@ -0,0 +1,101 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.3.4.b.html" rel="next">&sect;2.3.4.(b)&nbsp;Definite ambiguity&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.html" rel="section">&sect;2.3&nbsp;Lifting</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.4.html" rel="section">&sect;2.3.4&nbsp;Binding ambiguities</a></div>
+ <div class="subsect depth4" id="s2.3.4.a">
+ <h4 class="subsect">&sect;2.3.4.(a)&nbsp;<span class="title">Potential ambiguity</span></h4>
+ <p>A <strong>potential ambiguity</strong> is given,
+ if two role classes <code>R1</code> and <code>R2</code>
+ exist such that
+
+ </p>
+ <ul>
+ <li><code>R1</code> and <code>R2</code> are played by the
+ same base class <code>B</code>, and
+ </li>
+ <li><code>R1</code> and <code>R2</code> have a common
+ super role <code>R0</code>,
+ which is also bound to a base class <code>B0</code>, and
+ </li>
+ <li>neither role class <code>R1</code> nor
+ <code>R2</code> is a (indirect) sub-class of the other.
+ </li>
+ </ul>
+ <div class="note">
+ <h5>Note:</h5>
+ According to <a href="s2.1.c.html" title="&sect;2.1.(c)&nbsp;Covariant refinement"
+ class="sect">&sect;2.1.(c)</a>, if <code>B</code> is distinct from <code>B0</code>
+ it has to be a sub-class of <code>B0</code>.
+
+ </div>
+ <div class="note">
+ <h5>Effect:</h5>
+ In this case the compiler issues a warning, stating that the <code>B</code><em> may not be liftable,</em> because both role classes <code>R1</code>
+ and <code>R2</code> are candidates and there is no reason to prefer one over the other.
+ <br /><strong>If no potential ambiguity is detected, lifting will always be unambiguous.</strong></div>
+ <p>In the above situation, trying to lift an instance of type <code>B</code> to the role type
+ <code>R0</code> is an <strong>illegal lifting request</strong>. If <code>R0</code> is bound
+ to the same base class <code>B</code> as its sub-roles <code>R1</code> and <code>R2</code> are,
+ role <code>R0</code> is <strong>unliftable</strong>, meaning that no instance of <code>R0</code>
+ can ever by obtained by lifting.
+
+ </p>
+ <h5 class="listing">Example code (Potential Ambiguity):</h5>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>team</b> <b>class</b> MyTeam {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>public</b> <b>class</b> SuperRole <b>playedBy</b> MyBase {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>public</b> <b>class</b> SubRoleA <b>extends</b> SuperRole {...}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <b>public</b> <b>class</b> SubRoleB <b>extends</b> SuperRole {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.3.4.b.html" rel="next">&sect;2.3.4.(b)&nbsp;Definite ambiguity&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.html" rel="section">&sect;2.3&nbsp;Lifting</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.4.html" rel="section">&sect;2.3.4&nbsp;Binding ambiguities</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.4.b.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.4.b.html
new file mode 100644
index 000000000..08887d7d7
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.4.b.html
@@ -0,0 +1,90 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s2.3.4.a.html" rel="prev">&lt;&lt;&nbsp;&sect;2.3.4.(a)&nbsp;Potential ambiguity</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.3.4.c.html" rel="next">&sect;2.3.4.(c)&nbsp;Actual ambiguity&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.html" rel="section">&sect;2.3&nbsp;Lifting</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.4.html" rel="section">&sect;2.3.4&nbsp;Binding ambiguities</a></div>
+ <div class="subsect depth4" id="s2.3.4.b">
+ <h4 class="subsect">&sect;2.3.4.(b)&nbsp;<span class="title">Definite ambiguity</span></h4>
+ <p>A <strong>definite ambiguity</strong> is given if
+
+ </p>
+ <ul>
+ <li>the situation of potential ambiguity according to (a)
+ above is given and
+ </li>
+ <li>lifting is requested (either by method binding or explicitly
+ (<a href="s2.3.2.html" title="&sect;2.3.2&nbsp;Declared lifting" class="sect">&sect;2.3.2</a>)) from the shared base class <code>B</code> to any role
+ class <code>R0</code> that is a common super role for <code>R1</code> and <code>R2</code>.
+ </li>
+ </ul>
+ <div class="note">
+ <h5>Effect:</h5>
+ Definite ambiguity is a compile time error.
+
+ </div>
+ <h5 class="listing">Example code (Definite Ambiguity):</h5>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>team</b> <b>class</b> MyTeam {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>public</b> <b>class</b> SuperRole <b>playedBy</b> MyBase {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>public</b> <b>class</b> SubRoleA <b>extends</b> SuperRole <b>playedBy</b> SubBase {...}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <b>public</b> <b>class</b> SubRoleB <b>extends</b> SuperRole <b>playedBy</b> SubBase {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> <b>public</b> <b>void</b> useSuperRole(SubBase <b>as</b> SuperRole r) {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s2.3.4.a.html" rel="prev">&lt;&lt;&nbsp;&sect;2.3.4.(a)&nbsp;Potential ambiguity</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.3.4.c.html" rel="next">&sect;2.3.4.(c)&nbsp;Actual ambiguity&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.html" rel="section">&sect;2.3&nbsp;Lifting</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.4.html" rel="section">&sect;2.3.4&nbsp;Binding ambiguities</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.4.c.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.4.c.html
new file mode 100644
index 000000000..a9a0c3a08
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.4.c.html
@@ -0,0 +1,97 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s2.3.4.b.html" rel="prev">&lt;&lt;&nbsp;&sect;2.3.4.(b)&nbsp;Definite ambiguity</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.3.4.d.html" rel="next">&sect;2.3.4.(d)&nbsp;Mismatching role&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.html" rel="section">&sect;2.3&nbsp;Lifting</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.4.html" rel="section">&sect;2.3.4&nbsp;Binding ambiguities</a></div>
+ <div class="subsect depth4" id="s2.3.4.c">
+ <h4 class="subsect">&sect;2.3.4.(c)&nbsp;<span class="title">Actual ambiguity</span></h4>
+ <p>At runtime <strong>actual ambiguity</strong> may occur if for the
+ <em>dynamic type</em> of a base to be lifted the conditions of (b)
+ above hold accordingly. Actual ambiguity is only possible in cases
+ reported by the compiler as potential ambiguity.
+
+ </p>
+ <div class="note">
+ <h5>Effect:</h5>
+ An actual ambiguity is reported at runtime by throwing a
+ <code>org.objectteams.LiftingFailedException</code>.
+
+ </div>
+ <h5 class="listing">Example code (Actual Ambiguity):</h5>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>team</b> <b>class</b> MyTeam {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>public</b> <b>class</b> SuperRole <b>playedBy</b> MyBase {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>public</b> <b>class</b> SubRoleA <b>extends</b> SuperRole <b>playedBy</b> SubBase {...}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <b>public</b> <b>class</b> SubRoleB <b>extends</b> SuperRole <b>playedBy</b> SubBase {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> </pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> <b>public</b> <b>void</b> useSuperRole(MyBase <b>as</b> SuperRole r) {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre>}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre><span class="comment">// plus these calls:</span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre>MyTeam mt = <b>new</b> MyTeam();</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">10</td>
+ <td><pre>mt.useSuperRole(<b>new</b> SubBase());</pre></td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s2.3.4.b.html" rel="prev">&lt;&lt;&nbsp;&sect;2.3.4.(b)&nbsp;Definite ambiguity</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.3.4.d.html" rel="next">&sect;2.3.4.(d)&nbsp;Mismatching role&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.html" rel="section">&sect;2.3&nbsp;Lifting</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.4.html" rel="section">&sect;2.3.4&nbsp;Binding ambiguities</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.4.d.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.4.d.html
new file mode 100644
index 000000000..42fd74a8f
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.4.d.html
@@ -0,0 +1,123 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s2.3.4.c.html" rel="prev">&lt;&lt;&nbsp;&sect;2.3.4.(c)&nbsp;Actual ambiguity</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.html" rel="section">&sect;2.3&nbsp;Lifting</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.4.html" rel="section">&sect;2.3.4&nbsp;Binding ambiguities</a></div>
+ <div class="subsect depth4" id="s2.3.4.d">
+ <h4 class="subsect">&sect;2.3.4.(d)&nbsp;<span class="title">Mismatching role</span></h4>
+ <p>In cases of potential ambiguity another runtime error may occur:
+ a <strong>mismatching role</strong> is encountered when a role is found
+ in the cache, which is not conform to the required type.
+ This happens, if the base object has previously been lifted
+ to a type that is incompatible with the currently requested type.
+
+ </p>
+ <div class="note">
+ <h5>Effect:</h5>
+ This is reported by throwing a <code>org.objectteams.WrongRoleException</code>.
+
+ </div>
+ <h5 class="listing">Example code (Mismatching Role):</h5>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>team</b> <b>class</b> MyTeam {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>public</b> <b>class</b> SuperRole <b>playedBy</b> MyBase {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>public</b> <b>class</b> SubRoleA <b>extends</b> SuperRole {...}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <b>public</b> <b>class</b> SubRoleB <b>extends</b> SuperRole {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> </pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> <b>public</b> <b>void</b> useRoleA(MyBase <b>as</b> SubRoleA r) {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> <b>public</b> <b>void</b> useRoleB(MyBase <b>as</b> SubRoleB r) {...}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre>}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre><span class="comment">// plus these calls:</span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">10</td>
+ <td><pre>MyTeam mt = <b>new</b> MyTeam();</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">11</td>
+ <td><pre>MyBase b = <b>new</b> MyBase();</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">12</td>
+ <td><pre>mt.useRoleA(b); <span class="comment">// creates a SubRoleA for b</span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">13</td>
+ <td><pre>mt.useRoleB(b); <span class="comment">// finds the SubRoleA which is not compatible</span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">14</td>
+ <td><pre> <span class="comment">// to the expected type SubRoleB.</span></pre></td>
+ </tr>
+ </table>
+ </div>
+ <p>From the second item of <a href="s2.3.4.a.html" title="&sect;2.3.4.(a)&nbsp;Potential ambiguity"
+ class="sect">&sect;2.3.4.(a)</a> follows, that for binding ambiguities different
+ role hierarchies are analyzed in isolation.
+ For this analysis only those role classes are considered that are bound to a
+ base class (directly using <code>playedBy</code> or by inheriting this relation
+ from another role class).
+ I.e., two role classes that have no common bound super role will never cause
+ any ambiguity.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s2.3.4.c.html" rel="prev">&lt;&lt;&nbsp;&sect;2.3.4.(c)&nbsp;Actual ambiguity</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.html" rel="section">&sect;2.3&nbsp;Lifting</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.4.html" rel="section">&sect;2.3.4&nbsp;Binding ambiguities</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.4.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.4.html
new file mode 100644
index 000000000..089d9e56c
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.4.html
@@ -0,0 +1,308 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s2.3.3.html" rel="prev">&lt;&lt;&nbsp;&sect;2.3.3&nbsp;Smart lifting</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.html" rel="section">&sect;2.3&nbsp;Lifting</a></div>
+ <div class="sect depth3" id="s2.3.4">
+ <h3 class="sect">&sect;2.3.4&nbsp;Binding ambiguities</h3>
+ <p>While all examples so far have only shown 1-to-1 class bindings,
+ several cases of multiple bindings are allowable. Ambiguities may be
+ detected at compile time and/or at runtime.
+
+ </p>
+ <div class="subsect depth4" id="s2.3.4.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Potential ambiguity</span></h4>
+ <p>A <strong>potential ambiguity</strong> is given,
+ if two role classes <code>R1</code> and <code>R2</code>
+ exist such that
+
+ </p>
+ <ul>
+ <li><code>R1</code> and <code>R2</code> are played by the
+ same base class <code>B</code>, and
+ </li>
+ <li><code>R1</code> and <code>R2</code> have a common
+ super role <code>R0</code>,
+ which is also bound to a base class <code>B0</code>, and
+ </li>
+ <li>neither role class <code>R1</code> nor
+ <code>R2</code> is a (indirect) sub-class of the other.
+ </li>
+ </ul>
+ <div class="note">
+ <h5>Note:</h5>
+ According to <a href="s2.1.c.html" title="&sect;2.1.(c)&nbsp;Covariant refinement"
+ class="sect">&sect;2.1.(c)</a>, if <code>B</code> is distinct from <code>B0</code>
+ it has to be a sub-class of <code>B0</code>.
+
+ </div>
+ <div class="note">
+ <h5>Effect:</h5>
+ In this case the compiler issues a warning, stating that the <code>B</code><em> may not be liftable,</em> because both role classes <code>R1</code>
+ and <code>R2</code> are candidates and there is no reason to prefer one over the other.
+ <br /><strong>If no potential ambiguity is detected, lifting will always be unambiguous.</strong></div>
+ <p>In the above situation, trying to lift an instance of type <code>B</code> to the role type
+ <code>R0</code> is an <strong>illegal lifting request</strong>. If <code>R0</code> is bound
+ to the same base class <code>B</code> as its sub-roles <code>R1</code> and <code>R2</code> are,
+ role <code>R0</code> is <strong>unliftable</strong>, meaning that no instance of <code>R0</code>
+ can ever by obtained by lifting.
+
+ </p>
+ <h5 class="listing">Example code (Potential Ambiguity):</h5>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>team</b> <b>class</b> MyTeam {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>public</b> <b>class</b> SuperRole <b>playedBy</b> MyBase {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>public</b> <b>class</b> SubRoleA <b>extends</b> SuperRole {...}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <b>public</b> <b>class</b> SubRoleB <b>extends</b> SuperRole {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ <div class="subsect depth4" id="s2.3.4.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Definite ambiguity</span></h4>
+ <p>A <strong>definite ambiguity</strong> is given if
+
+ </p>
+ <ul>
+ <li>the situation of potential ambiguity according to (a)
+ above is given and
+ </li>
+ <li>lifting is requested (either by method binding or explicitly
+ (<a href="s2.3.2.html" title="&sect;2.3.2&nbsp;Declared lifting" class="sect">&sect;2.3.2</a>)) from the shared base class <code>B</code> to any role
+ class <code>R0</code> that is a common super role for <code>R1</code> and <code>R2</code>.
+ </li>
+ </ul>
+ <div class="note">
+ <h5>Effect:</h5>
+ Definite ambiguity is a compile time error.
+
+ </div>
+ <h5 class="listing">Example code (Definite Ambiguity):</h5>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>team</b> <b>class</b> MyTeam {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>public</b> <b>class</b> SuperRole <b>playedBy</b> MyBase {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>public</b> <b>class</b> SubRoleA <b>extends</b> SuperRole <b>playedBy</b> SubBase {...}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <b>public</b> <b>class</b> SubRoleB <b>extends</b> SuperRole <b>playedBy</b> SubBase {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> <b>public</b> <b>void</b> useSuperRole(SubBase <b>as</b> SuperRole r) {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ <div class="subsect depth4" id="s2.3.4.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Actual ambiguity</span></h4>
+ <p>At runtime <strong>actual ambiguity</strong> may occur if for the
+ <em>dynamic type</em> of a base to be lifted the conditions of (b)
+ above hold accordingly. Actual ambiguity is only possible in cases
+ reported by the compiler as potential ambiguity.
+
+ </p>
+ <div class="note">
+ <h5>Effect:</h5>
+ An actual ambiguity is reported at runtime by throwing a
+ <code>org.objectteams.LiftingFailedException</code>.
+
+ </div>
+ <h5 class="listing">Example code (Actual Ambiguity):</h5>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>team</b> <b>class</b> MyTeam {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>public</b> <b>class</b> SuperRole <b>playedBy</b> MyBase {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>public</b> <b>class</b> SubRoleA <b>extends</b> SuperRole <b>playedBy</b> SubBase {...}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <b>public</b> <b>class</b> SubRoleB <b>extends</b> SuperRole <b>playedBy</b> SubBase {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> </pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> <b>public</b> <b>void</b> useSuperRole(MyBase <b>as</b> SuperRole r) {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre>}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre><span class="comment">// plus these calls:</span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre>MyTeam mt = <b>new</b> MyTeam();</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">10</td>
+ <td><pre>mt.useSuperRole(<b>new</b> SubBase());</pre></td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ <div class="subsect depth4" id="s2.3.4.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Mismatching role</span></h4>
+ <p>In cases of potential ambiguity another runtime error may occur:
+ a <strong>mismatching role</strong> is encountered when a role is found
+ in the cache, which is not conform to the required type.
+ This happens, if the base object has previously been lifted
+ to a type that is incompatible with the currently requested type.
+
+ </p>
+ <div class="note">
+ <h5>Effect:</h5>
+ This is reported by throwing a <code>org.objectteams.WrongRoleException</code>.
+
+ </div>
+ <h5 class="listing">Example code (Mismatching Role):</h5>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>team</b> <b>class</b> MyTeam {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>public</b> <b>class</b> SuperRole <b>playedBy</b> MyBase {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>public</b> <b>class</b> SubRoleA <b>extends</b> SuperRole {...}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <b>public</b> <b>class</b> SubRoleB <b>extends</b> SuperRole {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> </pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> <b>public</b> <b>void</b> useRoleA(MyBase <b>as</b> SubRoleA r) {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> <b>public</b> <b>void</b> useRoleB(MyBase <b>as</b> SubRoleB r) {...}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre>}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre><span class="comment">// plus these calls:</span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">10</td>
+ <td><pre>MyTeam mt = <b>new</b> MyTeam();</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">11</td>
+ <td><pre>MyBase b = <b>new</b> MyBase();</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">12</td>
+ <td><pre>mt.useRoleA(b); <span class="comment">// creates a SubRoleA for b</span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">13</td>
+ <td><pre>mt.useRoleB(b); <span class="comment">// finds the SubRoleA which is not compatible</span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">14</td>
+ <td><pre> <span class="comment">// to the expected type SubRoleB.</span></pre></td>
+ </tr>
+ </table>
+ </div>
+ <p>From the second item of <a href="#s2.3.4.a" title="&sect;2.3.4.(a)&nbsp;Potential ambiguity"
+ class="sect">&sect;2.3.4.(a)</a> follows, that for binding ambiguities different
+ role hierarchies are analyzed in isolation.
+ For this analysis only those role classes are considered that are bound to a
+ base class (directly using <code>playedBy</code> or by inheriting this relation
+ from another role class).
+ I.e., two role classes that have no common bound super role will never cause
+ any ambiguity.
+
+ </p>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s2.3.3.html" rel="prev">&lt;&lt;&nbsp;&sect;2.3.3&nbsp;Smart lifting</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.html" rel="section">&sect;2.3&nbsp;Lifting</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.a.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.a.html
new file mode 100644
index 000000000..7f4c5c1a2
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.a.html
@@ -0,0 +1,49 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.3.b.html" rel="next">&sect;2.3.(b)&nbsp;Places of lifting&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.html" rel="section">&sect;2.3&nbsp;Lifting</a></div>
+ <div class="subsect depth3" id="s2.3.a">
+ <h4 class="subsect">&sect;2.3.(a)&nbsp;<span class="title">Definition of lifting</span></h4>
+ <p>Retrieving a role for a given base object is called <strong>lifting</strong>.
+ Lifting is guaranteed to yield the same role object for subsequent
+ calls regarding the same base object, the same team instance and
+ the same role class (see <a href="s2.3.4.html" title="&sect;2.3.4&nbsp;Binding ambiguities"
+ class="sect">&sect;2.3.4</a>
+ for cases of ambiguity that are signaled by compiler warnings
+ and possibly runtime exceptions).
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.3.b.html" rel="next">&sect;2.3.(b)&nbsp;Places of lifting&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.html" rel="section">&sect;2.3&nbsp;Lifting</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.b.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.b.html
new file mode 100644
index 000000000..093466748
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.b.html
@@ -0,0 +1,54 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s2.3.a.html" rel="prev">&lt;&lt;&nbsp;&sect;2.3.(a)&nbsp;Definition of lifting</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.3.c.html" rel="next">&sect;2.3.(c)&nbsp;Typing&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.html" rel="section">&sect;2.3&nbsp;Lifting</a></div>
+ <div class="subsect depth3" id="s2.3.b">
+ <h4 class="subsect">&sect;2.3.(b)&nbsp;<span class="title">Places of lifting</span></h4>
+ <p>The lifting translation is not meant to be invoked
+ by client code, but translations are inserted by the compiler
+ at the following locations:
+
+ </p>
+ <ul>
+ <li><a href="s3.3.c.html" title="&sect;3.3.(c)&nbsp;Result translation"
+ class="sect">Callout bindings (&sect;3.3.(c))</a> (result)
+ </li>
+ <li><a href="s4.5.a.html" title="&sect;4.5.(a)&nbsp;Call target translation"
+ class="sect">Callin bindings (&sect;4.5.(a))</a> (call target and parameters)
+ </li>
+ <li><a href="s2.3.2.html" title="&sect;2.3.2&nbsp;Declared lifting" class="sect">Declared lifting (&sect;2.3.2)</a></li>
+ </ul>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s2.3.a.html" rel="prev">&lt;&lt;&nbsp;&sect;2.3.(a)&nbsp;Definition of lifting</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.3.c.html" rel="next">&sect;2.3.(c)&nbsp;Typing&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.html" rel="section">&sect;2.3&nbsp;Lifting</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.c.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.c.html
new file mode 100644
index 000000000..e7db3eefc
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.c.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s2.3.b.html" rel="prev">&lt;&lt;&nbsp;&sect;2.3.(b)&nbsp;Places of lifting</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.3.d.html" rel="next">&sect;2.3.(d)&nbsp;Lifting of arrays&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.html" rel="section">&sect;2.3&nbsp;Lifting</a></div>
+ <div class="subsect depth3" id="s2.3.c">
+ <h4 class="subsect">&sect;2.3.(c)&nbsp;<span class="title">Typing</span></h4>
+ <p>A lifting translation statically expects a specific role class.
+ This expected role class must have a <code>playedBy</code> clause
+ (either directly, or inherited (explicitly or implicitly)
+ from a super role), to which the given base type is conform.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s2.3.b.html" rel="prev">&lt;&lt;&nbsp;&sect;2.3.(b)&nbsp;Places of lifting</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.3.d.html" rel="next">&sect;2.3.(d)&nbsp;Lifting of arrays&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.html" rel="section">&sect;2.3&nbsp;Lifting</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.d.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.d.html
new file mode 100644
index 000000000..32aadccf0
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.d.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s2.3.c.html" rel="prev">&lt;&lt;&nbsp;&sect;2.3.(c)&nbsp;Typing</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.3.1.html" rel="next">&sect;2.3.1&nbsp;Implicit role creation&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.html" rel="section">&sect;2.3&nbsp;Lifting</a></div>
+ <div class="subsect depth3" id="s2.3.d">
+ <h4 class="subsect">&sect;2.3.(d)&nbsp;<span class="title">Lifting of arrays</span></h4>
+ <p>Lifting also works for arrays of role objects.
+ For lifting an array of base objects
+ a new array is created and filled with role objects, one for each
+ base object in the original array. In contrast to the role objects
+ themselves, lifted arrays are never reused for subsequent lifting
+ invocations.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s2.3.c.html" rel="prev">&lt;&lt;&nbsp;&sect;2.3.(c)&nbsp;Typing</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.3.1.html" rel="next">&sect;2.3.1&nbsp;Implicit role creation&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.3.html" rel="section">&sect;2.3&nbsp;Lifting</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.html
new file mode 100644
index 000000000..646b382fb
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.3.html
@@ -0,0 +1,727 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s2.2.html" rel="prev">&lt;&lt;&nbsp;&sect;2.2&nbsp;Lowering</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.4.html" rel="next">&sect;2.4&nbsp;Explicit role creation&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a></div>
+ <div class="sect depth2" id="s2.3">
+ <h2 class="sect">&sect;2.3&nbsp;Lifting</h2>
+ <p>Lifting is the reverse translation of lowering. However, lifting is
+ a bit more demanding, since a given base object may have zero to
+ many role objects bound to it. Therefor, the lifting translation
+ requires more context information and may require to create role
+ objects on demand.
+
+ </p>
+ <div class="subsect depth3" id="s2.3.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Definition of lifting</span></h4>
+ <p>Retrieving a role for a given base object is called <strong>lifting</strong>.
+ Lifting is guaranteed to yield the same role object for subsequent
+ calls regarding the same base object, the same team instance and
+ the same role class (see <a href="#s2.3.4" title="&sect;2.3.4&nbsp;Binding ambiguities" class="sect">&sect;2.3.4</a>
+ for cases of ambiguity that are signaled by compiler warnings
+ and possibly runtime exceptions).
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s2.3.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Places of lifting</span></h4>
+ <p>The lifting translation is not meant to be invoked
+ by client code, but translations are inserted by the compiler
+ at the following locations:
+
+ </p>
+ <ul>
+ <li><a href="s3.3.c.html" title="&sect;3.3.(c)&nbsp;Result translation"
+ class="sect">Callout bindings (&sect;3.3.(c))</a> (result)
+ </li>
+ <li><a href="s4.5.a.html" title="&sect;4.5.(a)&nbsp;Call target translation"
+ class="sect">Callin bindings (&sect;4.5.(a))</a> (call target and parameters)
+ </li>
+ <li><a href="#s2.3.2" title="&sect;2.3.2&nbsp;Declared lifting" class="sect">Declared lifting (&sect;2.3.2)</a></li>
+ </ul>
+ </div>
+ <div class="subsect depth3" id="s2.3.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Typing</span></h4>
+ <p>A lifting translation statically expects a specific role class.
+ This expected role class must have a <code>playedBy</code> clause
+ (either directly, or inherited (explicitly or implicitly)
+ from a super role), to which the given base type is conform.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s2.3.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Lifting of arrays</span></h4>
+ <p>Lifting also works for arrays of role objects.
+ For lifting an array of base objects
+ a new array is created and filled with role objects, one for each
+ base object in the original array. In contrast to the role objects
+ themselves, lifted arrays are never reused for subsequent lifting
+ invocations.
+
+ </p>
+ </div>
+ <p id="s2.3.transpol">The term <strong>translation polymorphism</strong>
+ describes the fact that at certain points values can be passed which are not
+ conform to the respective declared type considering only regular
+ inheritance (<code>extends</code>). With translation polymorphism
+ it suffices that a value can be translated using lifting or lowering.
+
+ </p>
+ <div class="sect depth3" id="s2.3.1">
+ <h3 class="sect">&sect;2.3.1&nbsp;Implicit role creation<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;2.3</a></span></h3>
+ <p>Lifting tries to reuse existing role objects so that role state persists across
+ lifting and lowering. If no suitable role instance is found during lifting,
+ a new role is created.
+
+ </p>
+ <div class="subsect depth4" id="s2.3.1.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Reuse of existing role objects</span></h4>
+ <p>A role object is considered suitable for reuse during lifting, if
+ these three items are identical:
+
+ </p>
+ <ol>
+ <li>the given base object</li>
+ <li>the given team object</li>
+ <li>the statically required role type</li>
+ </ol>
+ <p>For the relation between the statically required role type and
+ the actual type of the role object see <a href="#s2.3.3" title="&sect;2.3.3&nbsp;Smart lifting" class="sect">"smart lifting" (&sect;2.3.3)</a>.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s2.3.1.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Default lifting constructor</span></h4>
+ <p>Lifting uses a default constructor which takes exactly one argument of the type
+ of the declared base class (after <code>playedBy</code>).
+ By default the compiler generates such a constructor for each bound role.
+ On the other hand, default constructors that take no arguments
+ (as in <a href="http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#16823"
+ class="ext">JLS &sect;8.8.7</a>) are never generated for bound roles.
+ <br />
+ The super-constructor to be invoked by a default lifting constructor
+ depends on whether the role's super class is a bound role or not.
+
+ </p>
+ <ul>
+ <li>If the super-class is a bound role, the default lifting constructor will invoke the default lifting constructor of the super-class.</li>
+ <li>If the super-class is not a bound role, the default lifting constructor will invoke the normal argumentless default constructor
+ of the super-class.
+ </li>
+ </ul>
+ </div>
+ <div class="subsect depth4" id="s2.3.1.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Custom lifting constructor</span></h4>
+ <p>If a role class declares a custom constructor with the same signature
+ as the default lifting constructor, this constructor is used during lifting.
+ This custom constructor may pre-assume that the role has been setup
+ properly regarding its base-link and registered in the team's internal map of roles.
+ <br />
+ If a bound role has an unbound super-class without an argumentless
+ constructor, providing a custom lifting constructor is obligatory,
+ because no legal default lifting constructor can be generated.
+
+ </p>
+ </div>
+ </div>
+ <div class="sect depth3" id="s2.3.2">
+ <h3 class="sect">&sect;2.3.2&nbsp;Declared lifting<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;2.3</a></span></h3>
+ <div class="syntaxlink"><a href="sA.html#sA.6.2" title="&sect;A.6.2&nbsp;LiftingType" class="syntax">&rarr;&nbsp;Syntax&nbsp;&sect;A.6.2</a></div>
+ <div class="subsect depth4" id="s2.3.2.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Parameters with declared lifting</span></h4>
+ <p>A non-static team-level method or constructor may declare a parameter with two types
+ in order to explicitly denote a place of <strong>lifting</strong>. Using the syntax
+
+ </p>
+ <div class="listing plain"><pre><b>public</b> <b>void</b> m (BaseClass <em>as</em> RoleClass param) { <i>stmts</i> }</pre></div>
+ <p>a liftable parameter can be declared, provided the second type
+ (<code>RoleClass</code>) is a role of (<code>playedBy</code>) the first type (<code>BaseClass</code>).
+ Furthermore, the role type must be a role of the enclosing team class defining the given method.
+ The role type must be given by its simple (i.e., unqualified) name.
+ <br />
+ Such a signature requires the caller to provide a base object (here <code>BaseClass</code>), but
+ the callee receives a role object (here <code>RoleClass</code>).
+ In fact, the client sees a signature in which the "<code>as RoleClass</code>" part is omitted.
+ <br />
+ Compatibility between caller and callee sides is achieved by an implicitly inserted lifting translation.
+ A signature using declared lifting is only valid, if the requested lifting is possible
+ (see <a href="#s2.3.3" title="&sect;2.3.3&nbsp;Smart lifting" class="sect">&sect;2.3.3</a> and <a href="#s2.3.4" title="&sect;2.3.4&nbsp;Binding ambiguities" class="sect">&sect;2.3.4</a> for details).
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s2.3.2.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Super in the context of declared lifting</span></h4>
+ <p>Calling <code>super</code> or <code>tsuper</code> in a method or constructor which
+ declares lifting for one or more parameters refers to a method or constructor with role type parameters,
+ i.e., lifting takes place <em>before</em> super invocation. Nevertheless, the super method may also
+ have a declared lifting signature. It will then see the same role instance(s) as the current method.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s2.3.2.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Declared lifting of arrays</span></h4>
+ <p>If a parameter involving explicit lifting should be of an <strong>array</strong> type, the syntax is
+
+ </p>
+ <div class="listing plain"><pre><b>public</b> <b>void</b> m (BaseClass <b>as</b> RoleClass param[]) ...</pre></div>
+ <p>Here the brackets denoting the array apply to both types, <code>BaseClass</code>
+ and <code>RoleClass</code>.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s2.3.2.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Declared lifting for catch blocks</span></h4>
+ <p>Also the argument of a catch block may apply declared lifting like in:
+
+ </p>
+ <div class="listing plain"><pre><b>catch</b> (BaseException <b>as</b> RoleClass param) { <i>stmts</i> }</pre></div>
+ <p>This syntax is only valid in a non-static scope of a team (directly or nested).
+ In the given example, <code>RoleClass</code> must be played by <code>BaseException</code>.
+ Note, that <code>RoleClass</code> itself need not be a throwable.
+ As the effect of this declaration the catch block will catch any exception of type <code>BaseException</code>
+ and provides it wrapped with a <code>RoleClass</code> instance to the subsequent block.
+ <br />
+ Also note, that re-throwing the given instance <code>param</code> has the semantics of implicitly lowering
+ the role to its base exception before throwing, because the role conforms to the required type
+ <code>Throwable</code> only via lowering.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s2.3.2.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Generic declared lifting</span></h4>
+ <p>A method with declared lifting may introduce a type parameter that is bounded relative to a given role type.
+ Such bound is declared as:
+
+ </p>
+ <div class="listing plain"><pre>&lt;AnyBase <b>base</b> SuperRole&gt;
+<b>void</b> teamMethod(AnyBase <b>as</b> SuperRole arg) {
+ <span class="comment">// body using arg as of type SuperRole</span>
+}</pre></div>
+ <p>This means that <code>AnyBase</code> is a type parameter whose instantiations must all be liftable to role <code>SuperRole</code>.
+
+ </p>
+ <p>
+ The given type bound requires the call site to supply an argument that is compatible to any base class
+ for which the current team contains a bound role that is a sub class of <code>SuperRole</code>, including <code>SuperRole</code> itself.
+ However, <code>SuperRole</code> itself need not be bound to any base class.
+ On the other hand, different valid substitutions for <code>AnyBase</code> need not be related by inheritance.
+
+ </p>
+ <div class="note">
+ <h5>Note:</h5>
+ This feature supports generalized treatment of otherwise unrelated base classes.
+ This is done by defining one bound role for each base under consideration and by
+ having all these roles extend a common unbound role.
+
+ </div>
+ </div>
+ <h5 class="listing">Example code (Declared Lifting):</h5>
+ <div class="listing example frame" id="l2.3.2">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>team</b> <b>class</b> Super {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>public</b> <b>class</b> MyRole <b>playedBy</b> MyBase { ... }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>void</b> m (MyRole o) { ... };</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre>}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre><b>team</b> <b>class</b> Sub <b>extends</b> Super {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> <b>void</b> m (<em>MyBase <b>as</b> MyRole o</em>) {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> <span class="comment">// inside this method o is of type MyRole</span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre> super.m(o);</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">10</td>
+ <td><pre>}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">11</td>
+ <td><pre>Sub s_<b>team</b> = <b>new</b> Sub();</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">12</td>
+ <td><pre>MyBase b = <b>new</b> MyBase();</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">13</td>
+ <td><pre>s_team.m(b); <span class="comment">// clients see a parameter "MyBase o"</span></pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="codecomment">
+ <h5>Effects:</h5>
+ <ul>
+ <li>Clients use method <code>m</code> with a base instance (type <code>MyBase</code>) as its argument (line 13).
+ </li>
+ <li>Before executing the body of <code>m</code>, the argument is lifted such that the method body receives
+ the argument as of type <code>MyRole</code> (line 8).
+ </li>
+ </ul>
+ </div>
+ </div>
+ <div class="sect depth3" id="s2.3.3">
+ <h3 class="sect">&sect;2.3.3&nbsp;Smart lifting<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;2.3</a></span></h3>
+ <p>In situations where role and base classes are part of some inheritance
+ hierarchies (<code>extends</code>), choosing the appropriate role class during
+ lifting involves the following rules:
+
+ </p>
+ <div class="subsect depth4" id="s2.3.3.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Static adjustment</span></h4>
+ <p>If a base class <code>B</code> shall be lifted to a role class
+ <code>R</code> that is not bound to (<code>playedBy</code>)
+ <code>B</code>, but if a subclass of <code>R</code>
+ &mdash; say <code>R2</code> &mdash;
+ is bound to <code>B</code>, lifting is statically setup to use
+ <code>R2</code>, the most general subclass of <code>R</code> that
+ is bound to <code>B</code> or one of its super-types.
+
+ </p>
+ <div class="note">
+ <h5>Restriction:</h5>
+ This step is not applicable for parameter mappings of <code>replace</code>
+ callin bindings (<a href="s4.5.d.html" title="&sect;4.5.(d)&nbsp;Typing rules" class="sect">&sect;4.5.(d)</a>).
+
+ </div>
+ </div>
+ <div class="subsect depth4" id="s2.3.3.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Dynamic selection of a role class</span></h4>
+ <p>At runtime also the dynamic type of a base object is considered:
+ Lifting always tries to use a role class that is bound to the
+ exact class of the base object. Lifting considers all role&ndash;base
+ pairs bound by <code>playedBy</code> such that the role class is a
+ sub-class of the required (statically declared) role type
+ and the base class is a super-class of the
+ dynamic type of the base object.
+ <br />
+ From those possible pairs the most specific base class is chosen.
+ If multiple role classes are bound to this base class the most
+ specific of these classes is chosen.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s2.3.3.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Team as closed world</span></h4>
+ <p>In the above analysis gathering all role-base pairs is performed at
+ compile-time. From this follows, that a team class can only be
+ compiled when all its contained role classes are known and a role class
+ can never be compiled without its team.
+ <br />
+ The analysis includes all roles and their bindings that are inherited
+ from the super-team.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s2.3.3.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Selection regardless of abstractness</span></h4>
+ <p>Smart lifting is not affected by abstractness of role classes.
+ For the effect of abstract role classes see <a href="s2.5.html" title="&sect;2.5&nbsp;Abstract Roles" class="sect">&sect;2.5</a>.
+
+ </p>
+ </div>
+ <h5>Complex Example:</h5>
+ <p><img src="../images/smart_lifting_small.png" alt="smart lifting example" /></p>
+ <table border="2" width="80%">
+ <colgroup span="1">
+ <col align="left" span="1" />
+ <col align="left" span="1" />
+ </colgroup>
+ <tr>
+ <th rowspan="1" colspan="1">role class</th>
+ <th rowspan="1" colspan="1">base class</th>
+ </tr>
+ <tr>
+ <td rowspan="1" colspan="1">class R1</td>
+ <td rowspan="1" colspan="1">&nbsp;</td>
+ </tr>
+ <tr>
+ <td rowspan="1" colspan="1">class R2 extends R1 playedBy B2</td>
+ <td rowspan="1" colspan="1">class B2</td>
+ </tr>
+ <tr>
+ <td rowspan="1" colspan="1">class R3 extends R2 <em>/* inherited: playedBy B2 */ </em></td>
+ <td rowspan="1" colspan="1">class B3 extends B2</td>
+ </tr>
+ <tr>
+ <td rowspan="1" colspan="1">class R4 extends R3 playedBy B4</td>
+ <td rowspan="1" colspan="1">class B4 extends B3</td>
+ </tr>
+ <tr>
+ <td rowspan="1" colspan="1">class R5 extends R4 <em>/* inherited: playedBy B4 */</em></td>
+ <td rowspan="1" colspan="1">&nbsp;</td>
+ </tr>
+ <tr>
+ <td rowspan="1" colspan="1">&nbsp;</td>
+ <td rowspan="1" colspan="1">class B6 extends B4</td>
+ </tr>
+ <tr>
+ <td rowspan="1" colspan="1">class R7 extends R5 playedBy B7</td>
+ <td rowspan="1" colspan="1">class B7 extends B6</td>
+ </tr>
+ </table>
+ <div class="codecomment">
+ <ul>
+ <li>If declarations require lifting <code>B3</code> to <code>R1</code>
+ this is statically refined to use <code>R2</code> instead, because this
+ is the most general class declaring a binding to a super&ndash;class
+ of <code>B3</code>.
+
+ </li>
+ <li>If the dynamic base type in the same situation is <code>B6</code>,
+ three steps select the appropriate role:
+
+ <ol>
+ <li>By searching all <code>playedBy</code> clauses (including those
+ that are inherited) the following role&ndash;base pairs are
+ candidates:<br /><code>(R2,B2), (R3,B2), (R4,B4)</code> and <code>(R5,B4)</code>.
+ </li>
+ <li>From these pairs the two containing the most specific base class
+ <code>B4</code> are chosen.
+ </li>
+ <li>This makes <code>R4</code> and <code>R5</code> role candidates,
+ from which the most specific <code>R5</code> is finally chosen.
+ </li>
+ </ol>
+ </li>
+ </ul>
+ </div>
+ <p>If the inheritance hierarchies of the involved base and role classes are given (like in the figure above)
+ the smart lifting algorithm can be rephrased to the following "graphical" rule:<br /></p>
+ <div class="note">
+ Starting with the dynamic base type (<code>B6</code> in the example) move upwards the the inheritance
+ relation until you reach a base class bound to a role class indicated by a &laquo;playedBy&raquo;
+ arrow pointing to the base class (<code>B4</code>). This role class must be conform to the requested role type.
+ Switch to the role side along this arrow (<code>R4</code>). Now move downwards the role inheritance hierarchy
+ as long as the subrole does not refine the playedBy relationship (indicated by another &laquo;playedBy&raquo; arrow).
+ The bottom role you reach this way (<code>R5</code>) is the role type selected by smart lifting.
+
+ </div>
+ </div>
+ <div class="sect depth3" id="s2.3.4">
+ <h3 class="sect">&sect;2.3.4&nbsp;Binding ambiguities<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;2.3</a></span></h3>
+ <p>While all examples so far have only shown 1-to-1 class bindings,
+ several cases of multiple bindings are allowable. Ambiguities may be
+ detected at compile time and/or at runtime.
+
+ </p>
+ <div class="subsect depth4" id="s2.3.4.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Potential ambiguity</span></h4>
+ <p>A <strong>potential ambiguity</strong> is given,
+ if two role classes <code>R1</code> and <code>R2</code>
+ exist such that
+
+ </p>
+ <ul>
+ <li><code>R1</code> and <code>R2</code> are played by the
+ same base class <code>B</code>, and
+ </li>
+ <li><code>R1</code> and <code>R2</code> have a common
+ super role <code>R0</code>,
+ which is also bound to a base class <code>B0</code>, and
+ </li>
+ <li>neither role class <code>R1</code> nor
+ <code>R2</code> is a (indirect) sub-class of the other.
+ </li>
+ </ul>
+ <div class="note">
+ <h5>Note:</h5>
+ According to <a href="s2.1.c.html" title="&sect;2.1.(c)&nbsp;Covariant refinement"
+ class="sect">&sect;2.1.(c)</a>, if <code>B</code> is distinct from <code>B0</code>
+ it has to be a sub-class of <code>B0</code>.
+
+ </div>
+ <div class="note">
+ <h5>Effect:</h5>
+ In this case the compiler issues a warning, stating that the <code>B</code><em> may not be liftable,</em> because both role classes <code>R1</code>
+ and <code>R2</code> are candidates and there is no reason to prefer one over the other.
+ <br /><strong>If no potential ambiguity is detected, lifting will always be unambiguous.</strong></div>
+ <p>In the above situation, trying to lift an instance of type <code>B</code> to the role type
+ <code>R0</code> is an <strong>illegal lifting request</strong>. If <code>R0</code> is bound
+ to the same base class <code>B</code> as its sub-roles <code>R1</code> and <code>R2</code> are,
+ role <code>R0</code> is <strong>unliftable</strong>, meaning that no instance of <code>R0</code>
+ can ever by obtained by lifting.
+
+ </p>
+ <h5 class="listing">Example code (Potential Ambiguity):</h5>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>team</b> <b>class</b> MyTeam {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>public</b> <b>class</b> SuperRole <b>playedBy</b> MyBase {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>public</b> <b>class</b> SubRoleA <b>extends</b> SuperRole {...}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <b>public</b> <b>class</b> SubRoleB <b>extends</b> SuperRole {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ <div class="subsect depth4" id="s2.3.4.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Definite ambiguity</span></h4>
+ <p>A <strong>definite ambiguity</strong> is given if
+
+ </p>
+ <ul>
+ <li>the situation of potential ambiguity according to (a)
+ above is given and
+ </li>
+ <li>lifting is requested (either by method binding or explicitly
+ (<a href="#s2.3.2" title="&sect;2.3.2&nbsp;Declared lifting" class="sect">&sect;2.3.2</a>)) from the shared base class <code>B</code> to any role
+ class <code>R0</code> that is a common super role for <code>R1</code> and <code>R2</code>.
+ </li>
+ </ul>
+ <div class="note">
+ <h5>Effect:</h5>
+ Definite ambiguity is a compile time error.
+
+ </div>
+ <h5 class="listing">Example code (Definite Ambiguity):</h5>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>team</b> <b>class</b> MyTeam {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>public</b> <b>class</b> SuperRole <b>playedBy</b> MyBase {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>public</b> <b>class</b> SubRoleA <b>extends</b> SuperRole <b>playedBy</b> SubBase {...}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <b>public</b> <b>class</b> SubRoleB <b>extends</b> SuperRole <b>playedBy</b> SubBase {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> <b>public</b> <b>void</b> useSuperRole(SubBase <b>as</b> SuperRole r) {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ <div class="subsect depth4" id="s2.3.4.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Actual ambiguity</span></h4>
+ <p>At runtime <strong>actual ambiguity</strong> may occur if for the
+ <em>dynamic type</em> of a base to be lifted the conditions of (b)
+ above hold accordingly. Actual ambiguity is only possible in cases
+ reported by the compiler as potential ambiguity.
+
+ </p>
+ <div class="note">
+ <h5>Effect:</h5>
+ An actual ambiguity is reported at runtime by throwing a
+ <code>org.objectteams.LiftingFailedException</code>.
+
+ </div>
+ <h5 class="listing">Example code (Actual Ambiguity):</h5>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>team</b> <b>class</b> MyTeam {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>public</b> <b>class</b> SuperRole <b>playedBy</b> MyBase {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>public</b> <b>class</b> SubRoleA <b>extends</b> SuperRole <b>playedBy</b> SubBase {...}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <b>public</b> <b>class</b> SubRoleB <b>extends</b> SuperRole <b>playedBy</b> SubBase {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> </pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> <b>public</b> <b>void</b> useSuperRole(MyBase <b>as</b> SuperRole r) {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre>}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre><span class="comment">// plus these calls:</span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre>MyTeam mt = <b>new</b> MyTeam();</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">10</td>
+ <td><pre>mt.useSuperRole(<b>new</b> SubBase());</pre></td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ <div class="subsect depth4" id="s2.3.4.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Mismatching role</span></h4>
+ <p>In cases of potential ambiguity another runtime error may occur:
+ a <strong>mismatching role</strong> is encountered when a role is found
+ in the cache, which is not conform to the required type.
+ This happens, if the base object has previously been lifted
+ to a type that is incompatible with the currently requested type.
+
+ </p>
+ <div class="note">
+ <h5>Effect:</h5>
+ This is reported by throwing a <code>org.objectteams.WrongRoleException</code>.
+
+ </div>
+ <h5 class="listing">Example code (Mismatching Role):</h5>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>team</b> <b>class</b> MyTeam {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>public</b> <b>class</b> SuperRole <b>playedBy</b> MyBase {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>public</b> <b>class</b> SubRoleA <b>extends</b> SuperRole {...}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <b>public</b> <b>class</b> SubRoleB <b>extends</b> SuperRole {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> </pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> <b>public</b> <b>void</b> useRoleA(MyBase <b>as</b> SubRoleA r) {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> <b>public</b> <b>void</b> useRoleB(MyBase <b>as</b> SubRoleB r) {...}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre>}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre><span class="comment">// plus these calls:</span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">10</td>
+ <td><pre>MyTeam mt = <b>new</b> MyTeam();</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">11</td>
+ <td><pre>MyBase b = <b>new</b> MyBase();</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">12</td>
+ <td><pre>mt.useRoleA(b); <span class="comment">// creates a SubRoleA for b</span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">13</td>
+ <td><pre>mt.useRoleB(b); <span class="comment">// finds the SubRoleA which is not compatible</span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">14</td>
+ <td><pre> <span class="comment">// to the expected type SubRoleB.</span></pre></td>
+ </tr>
+ </table>
+ </div>
+ <p>From the second item of <a href="#s2.3.4.a" title="&sect;2.3.4.(a)&nbsp;Potential ambiguity"
+ class="sect">&sect;2.3.4.(a)</a> follows, that for binding ambiguities different
+ role hierarchies are analyzed in isolation.
+ For this analysis only those role classes are considered that are bound to a
+ base class (directly using <code>playedBy</code> or by inheriting this relation
+ from another role class).
+ I.e., two role classes that have no common bound super role will never cause
+ any ambiguity.
+
+ </p>
+ </div>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s2.2.html" rel="prev">&lt;&lt;&nbsp;&sect;2.2&nbsp;Lowering</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.4.html" rel="next">&sect;2.4&nbsp;Explicit role creation&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.4.1.a.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.4.1.a.html
new file mode 100644
index 000000000..4aa86b3ec
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.4.1.a.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.4.1.b.html" rel="next">&sect;2.4.1.(b)&nbsp;Fresh base object&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.4.html" rel="section">&sect;2.4&nbsp;Explicit role creation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.4.1.html" rel="section">&sect;2.4.1&nbsp;Role creation via a lifting constructor</a></div>
+ <div class="subsect depth4" id="s2.4.1.a">
+ <h4 class="subsect">&sect;2.4.1.(a)&nbsp;<span class="title">Team context</span></h4>
+ <p>The lifting constructor can be used only within the enclosing team of
+ the role to be instantiated. Thus, qualified allocation expressions
+ (<code>someTeam.new SomeRole(..)</code>) may never use the lifting constructor.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.4.1.b.html" rel="next">&sect;2.4.1.(b)&nbsp;Fresh base object&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.4.html" rel="section">&sect;2.4&nbsp;Explicit role creation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.4.1.html" rel="section">&sect;2.4.1&nbsp;Role creation via a lifting constructor</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.4.1.b.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.4.1.b.html
new file mode 100644
index 000000000..28d286469
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.4.1.b.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s2.4.1.a.html" rel="prev">&lt;&lt;&nbsp;&sect;2.4.1.(a)&nbsp;Team context</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.4.1.c.html" rel="next">&sect;2.4.1.(c)&nbsp;Duplicate role runtime check&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.4.html" rel="section">&sect;2.4&nbsp;Explicit role creation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.4.1.html" rel="section">&sect;2.4.1&nbsp;Role creation via a lifting constructor</a></div>
+ <div class="subsect depth4" id="s2.4.1.b">
+ <h4 class="subsect">&sect;2.4.1.(b)&nbsp;<span class="title">Fresh base object</span></h4>
+ <p>If the argument to a lifting constructor invocation is a <code>new</code>
+ expression, creating a fresh base object, the use of the lifting constructor
+ is safe. Otherwise the rules of (c) below apply.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s2.4.1.a.html" rel="prev">&lt;&lt;&nbsp;&sect;2.4.1.(a)&nbsp;Team context</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.4.1.c.html" rel="next">&sect;2.4.1.(c)&nbsp;Duplicate role runtime check&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.4.html" rel="section">&sect;2.4&nbsp;Explicit role creation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.4.1.html" rel="section">&sect;2.4.1&nbsp;Role creation via a lifting constructor</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.4.1.c.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.4.1.c.html
new file mode 100644
index 000000000..87d3994d9
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.4.1.c.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s2.4.1.b.html" rel="prev">&lt;&lt;&nbsp;&sect;2.4.1.(b)&nbsp;Fresh base object</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.4.html" rel="section">&sect;2.4&nbsp;Explicit role creation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.4.1.html" rel="section">&sect;2.4.1&nbsp;Role creation via a lifting constructor</a></div>
+ <div class="subsect depth4" id="s2.4.1.c">
+ <h4 class="subsect">&sect;2.4.1.(c)&nbsp;<span class="title">Duplicate role runtime check</span></h4>
+ <p>If it cannot be syntactically derived, that the argument to a lifting
+ constructor is a freshly created base object (b), a compile time warning will
+ signal that an additional runtime check is needed: It must be prevented that
+ a new role is created for a base object, which already has a role of the
+ required type in the given team. It is not possible to replace an existing
+ role by use of the lifting constructor. At runtime, any attempt to do so
+ will cause a <code>org.objectteams.DuplicateRoleException</code> to be thrown.
+ This exception can only occur in situations where the mentioned compile
+ time warning had been issued.
+ <br /><a href="s6.1.html" title="&sect;6.1&nbsp;Reflection" class="sect">&sect;6.1</a> will introduce reflective functions
+ which can be used to manually prevent errors like a duplicate role.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s2.4.1.b.html" rel="prev">&lt;&lt;&nbsp;&sect;2.4.1.(b)&nbsp;Fresh base object</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.4.html" rel="section">&sect;2.4&nbsp;Explicit role creation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.4.1.html" rel="section">&sect;2.4.1&nbsp;Role creation via a lifting constructor</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.4.1.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.4.1.html
new file mode 100644
index 000000000..8367c3eac
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.4.1.html
@@ -0,0 +1,77 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.4.2.html" rel="next">&sect;2.4.2&nbsp;Role creation via a regular constructor&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.4.html" rel="section">&sect;2.4&nbsp;Explicit role creation</a></div>
+ <div class="sect depth3" id="s2.4.1">
+ <h3 class="sect">&sect;2.4.1&nbsp;Role creation via a lifting constructor</h3>
+ <p>Lifting uses the default constructor for roles (see <a href="s2.3.1.html" title="&sect;2.3.1&nbsp;Implicit role creation"
+ class="sect">&sect;2.3.1</a>).
+ This constructor can be invoked from client code, if the following rules are respected.
+
+ </p>
+ <div class="subsect depth4" id="s2.4.1.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Team context</span></h4>
+ <p>The lifting constructor can be used only within the enclosing team of
+ the role to be instantiated. Thus, qualified allocation expressions
+ (<code>someTeam.new SomeRole(..)</code>) may never use the lifting constructor.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s2.4.1.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Fresh base object</span></h4>
+ <p>If the argument to a lifting constructor invocation is a <code>new</code>
+ expression, creating a fresh base object, the use of the lifting constructor
+ is safe. Otherwise the rules of (c) below apply.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s2.4.1.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Duplicate role runtime check</span></h4>
+ <p>If it cannot be syntactically derived, that the argument to a lifting
+ constructor is a freshly created base object (b), a compile time warning will
+ signal that an additional runtime check is needed: It must be prevented that
+ a new role is created for a base object, which already has a role of the
+ required type in the given team. It is not possible to replace an existing
+ role by use of the lifting constructor. At runtime, any attempt to do so
+ will cause a <code>org.objectteams.DuplicateRoleException</code> to be thrown.
+ This exception can only occur in situations where the mentioned compile
+ time warning had been issued.
+ <br /><a href="s6.1.html" title="&sect;6.1&nbsp;Reflection" class="sect">&sect;6.1</a> will introduce reflective functions
+ which can be used to manually prevent errors like a duplicate role.
+
+ </p>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.4.2.html" rel="next">&sect;2.4.2&nbsp;Role creation via a regular constructor&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.4.html" rel="section">&sect;2.4&nbsp;Explicit role creation</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.4.2.a.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.4.2.a.html
new file mode 100644
index 000000000..be9576ae2
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.4.2.a.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.4.2.b.html" rel="next">&sect;2.4.2.(b)&nbsp;Bound roles&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.4.html" rel="section">&sect;2.4&nbsp;Explicit role creation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.4.2.html" rel="section">&sect;2.4.2&nbsp;Role creation via a regular constructor</a></div>
+ <div class="subsect depth4" id="s2.4.2.a">
+ <h4 class="subsect">&sect;2.4.2.(a)&nbsp;<span class="title">Unbound roles</span></h4>
+ <p>Each constructor of a role that is <strong>not bound</strong> to a base class must use
+ one of <code>this(..)</code>, <code>super(..)</code> or <code>tsuper(..)</code>.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.4.2.b.html" rel="next">&sect;2.4.2.(b)&nbsp;Bound roles&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.4.html" rel="section">&sect;2.4&nbsp;Explicit role creation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.4.2.html" rel="section">&sect;2.4.2&nbsp;Role creation via a regular constructor</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.4.2.b.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.4.2.b.html
new file mode 100644
index 000000000..dd8756a7e
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.4.2.b.html
@@ -0,0 +1,55 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s2.4.2.a.html" rel="prev">&lt;&lt;&nbsp;&sect;2.4.2.(a)&nbsp;Unbound roles</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.4.2.c.html" rel="next">&sect;2.4.2.(c)&nbsp;Super-call for bound roles&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.4.html" rel="section">&sect;2.4&nbsp;Explicit role creation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.4.2.html" rel="section">&sect;2.4.2&nbsp;Role creation via a regular constructor</a></div>
+ <div class="subsect depth4" id="s2.4.2.b">
+ <h4 class="subsect">&sect;2.4.2.(b)&nbsp;<span class="title">Bound roles</span></h4>
+ <p>Each constructor of a <strong>bound role</strong> must directly or indirectly invoke either
+ a <code>base(..)</code> constructor or a lifting constructor (see <a href="s2.3.1.html" title="&sect;2.3.1&nbsp;Implicit role creation"
+ class="sect">&sect;2.3.1</a>).
+ Indirect calls to the base constructor or lifting constructor may use any of <code>this(..)</code>, <code>super(..)</code>
+ or <code>tsuper(..)</code>, which simply delegates the obligation to the called constructor.
+ <br />
+ If a constructor referenced by <code>base(..)</code> is not visible according to the
+ regular rules of Java, it may still be called using <b>decapsulation</b> (see
+ also <a href="s3.4.html" title="&sect;3.4&nbsp;Overriding access restrictions"
+ class="sect">&sect;3.4</a>, <a href="s2.1.2.c.html" title="&sect;2.1.2.(c)&nbsp;Base class decapsulation"
+ class="sect">&sect;2.1.2.(c)</a>).
+ <br />
+ Note, that if the super or tsuper role is not bound, delegating the obligation to that unbound role will not work.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s2.4.2.a.html" rel="prev">&lt;&lt;&nbsp;&sect;2.4.2.(a)&nbsp;Unbound roles</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.4.2.c.html" rel="next">&sect;2.4.2.(c)&nbsp;Super-call for bound roles&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.4.html" rel="section">&sect;2.4&nbsp;Explicit role creation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.4.2.html" rel="section">&sect;2.4.2&nbsp;Role creation via a regular constructor</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.4.2.c.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.4.2.c.html
new file mode 100644
index 000000000..a66bd45ce
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.4.2.c.html
@@ -0,0 +1,75 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s2.4.2.b.html" rel="prev">&lt;&lt;&nbsp;&sect;2.4.2.(b)&nbsp;Bound roles</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.4.html" rel="section">&sect;2.4&nbsp;Explicit role creation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.4.2.html" rel="section">&sect;2.4.2&nbsp;Role creation via a regular constructor</a></div>
+ <div class="subsect depth4" id="s2.4.2.c">
+ <h4 class="subsect">&sect;2.4.2.(c)&nbsp;<span class="title">Super-call for bound roles</span></h4>
+ <p>Instead of or prior to calling <code>base(..)</code> a constructor of a bound role explicitly or implicitly calls a super constructor.
+ Which constructor is applicable depends on the super role and its <code>playedBy</code> clause.
+
+ </p>
+ <ul>
+ <li>If the super role is bound to the same base class as the current role is,
+
+ <ul>
+ <li>not writing a super-call causes the lifting constructor of the super role to be invoked.</li>
+ <li>explicitly calling a super constructor requires the super constructor to <i>either</i><ol>
+ <li>create a role instance using a base constructor call (directly or indirectly), <i>or</i></li>
+ <li>be a lifting constructor receiving a base instance, which the current role must provide as the argument.</li>
+ </ol>
+ </li>
+ </ul>
+ </li>
+ <li>If the super role is bound but the current role refines the <code>playedBy</code>
+ relationship (cf. <a href="s2.1.c.html" title="&sect;2.1.(c)&nbsp;Covariant refinement"
+ class="sect">&sect;2.1.(c)</a>),
+
+ <ul>
+ <li>a lifting constructor must be called explicitly passing a base object as the argument.</li>
+ </ul>
+ </li>
+ <li>If the role has an explicit or implicit super role which is unbound the constructor may optionally
+ call a super constructor (using <code>super(..)</code> or <code>tsuper(..)</code>) prior to calling
+ <code>base(..)</code>. Otherwise the default constructor is implicitly invoked.
+
+ </li>
+ </ul>
+ <p>When invoking a lifting constructor of a super role the base object can optionally be obtained by using a base constructor
+ call as an expression:
+
+ </p>
+ <div class="listing plain"><pre>super(base(<i>&lt;args&gt;</i>));</pre></div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s2.4.2.b.html" rel="prev">&lt;&lt;&nbsp;&sect;2.4.2.(b)&nbsp;Bound roles</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.4.html" rel="section">&sect;2.4&nbsp;Explicit role creation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.4.2.html" rel="section">&sect;2.4.2&nbsp;Role creation via a regular constructor</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.4.2.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.4.2.html
new file mode 100644
index 000000000..20287b9ab
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.4.2.html
@@ -0,0 +1,134 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s2.4.1.html" rel="prev">&lt;&lt;&nbsp;&sect;2.4.1&nbsp;Role creation via a lifting constructor</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.4.3.html" rel="next">&sect;2.4.3&nbsp;Role creation in the presence of smart lifting&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.4.html" rel="section">&sect;2.4&nbsp;Explicit role creation</a></div>
+ <div class="sect depth3" id="s2.4.2">
+ <h3 class="sect">&sect;2.4.2&nbsp;Role creation via a regular constructor</h3>
+ <p>Roles may also be created explicitly using a custom constructor with arbitrary signature
+ other than the signature of the lifting constructor.<br />
+ Within role constructors, four kinds of self-calls are possible:
+
+ </p>
+ <dl>
+ <dt><code>base(..)</code></dt>
+ <dd>A constructor of the corresponding base class (<a href="sA.html#sA.5.3" title="&sect;A.5.3&nbsp;BaseCall" class="sect">&sect;A.5.3</a>(c)).
+ </dd>
+ <dt><code>this(..)</code></dt>
+ <dd>Another constructor of the same class.</dd>
+ <dt><code>super(..)</code></dt>
+ <dd>A constructor of the super-class (normal <code>extends</code>), <span class="underline">unless</span> the super-class is bound to a different base class, in which case calling <code>super(..)</code> is not legal.
+ </dd>
+ <dt><code>tsuper(..)</code></dt>
+ <dd>A constructor of the corresponding role of the super-team (<a href="sA.html#sA.5.4" title="&sect;A.5.4&nbsp;TSuperCall" class="sect">&sect;A.5.4</a>(e)). Also see the constraint in <a href="s1.3.2.c.html"
+ title="&sect;1.3.2.(c)&nbsp;Constructors and overridden 'extends' "
+ class="sect">&sect;1.3.2.(c)</a>.
+ </dd>
+ </dl>
+ <div class="subsect depth4" id="s2.4.2.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Unbound roles</span></h4>
+ <p>Each constructor of a role that is <strong>not bound</strong> to a base class must use
+ one of <code>this(..)</code>, <code>super(..)</code> or <code>tsuper(..)</code>.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s2.4.2.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Bound roles</span></h4>
+ <p>Each constructor of a <strong>bound role</strong> must directly or indirectly invoke either
+ a <code>base(..)</code> constructor or a lifting constructor (see <a href="s2.3.1.html" title="&sect;2.3.1&nbsp;Implicit role creation"
+ class="sect">&sect;2.3.1</a>).
+ Indirect calls to the base constructor or lifting constructor may use any of <code>this(..)</code>, <code>super(..)</code>
+ or <code>tsuper(..)</code>, which simply delegates the obligation to the called constructor.
+ <br />
+ If a constructor referenced by <code>base(..)</code> is not visible according to the
+ regular rules of Java, it may still be called using <b>decapsulation</b> (see
+ also <a href="s3.4.html" title="&sect;3.4&nbsp;Overriding access restrictions"
+ class="sect">&sect;3.4</a>, <a href="s2.1.2.c.html" title="&sect;2.1.2.(c)&nbsp;Base class decapsulation"
+ class="sect">&sect;2.1.2.(c)</a>).
+ <br />
+ Note, that if the super or tsuper role is not bound, delegating the obligation to that unbound role will not work.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s2.4.2.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Super-call for bound roles</span></h4>
+ <p>Instead of or prior to calling <code>base(..)</code> a constructor of a bound role explicitly or implicitly calls a super constructor.
+ Which constructor is applicable depends on the super role and its <code>playedBy</code> clause.
+
+ </p>
+ <ul>
+ <li>If the super role is bound to the same base class as the current role is,
+
+ <ul>
+ <li>not writing a super-call causes the lifting constructor of the super role to be invoked.</li>
+ <li>explicitly calling a super constructor requires the super constructor to <i>either</i><ol>
+ <li>create a role instance using a base constructor call (directly or indirectly), <i>or</i></li>
+ <li>be a lifting constructor receiving a base instance, which the current role must provide as the argument.</li>
+ </ol>
+ </li>
+ </ul>
+ </li>
+ <li>If the super role is bound but the current role refines the <code>playedBy</code>
+ relationship (cf. <a href="s2.1.c.html" title="&sect;2.1.(c)&nbsp;Covariant refinement"
+ class="sect">&sect;2.1.(c)</a>),
+
+ <ul>
+ <li>a lifting constructor must be called explicitly passing a base object as the argument.</li>
+ </ul>
+ </li>
+ <li>If the role has an explicit or implicit super role which is unbound the constructor may optionally
+ call a super constructor (using <code>super(..)</code> or <code>tsuper(..)</code>) prior to calling
+ <code>base(..)</code>. Otherwise the default constructor is implicitly invoked.
+
+ </li>
+ </ul>
+ <p>When invoking a lifting constructor of a super role the base object can optionally be obtained by using a base constructor
+ call as an expression:
+
+ </p>
+ <div class="listing plain"><pre>super(base(<i>&lt;args&gt;</i>));</pre></div>
+ </div>
+ <p>The language system evaluates the base constructor by creating an
+ instance of the appropriate base class using a constructor with matching
+ signature. Also the internal links are setup that are needed for accessing the
+ base object from the role and for lifting the base object to the new role
+ in the future.
+
+ </p>
+ <p>The syntax for base constructors follows the rule that role implementations
+ never directly refer to any names of base classes or their features.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s2.4.1.html" rel="prev">&lt;&lt;&nbsp;&sect;2.4.1&nbsp;Role creation via a lifting constructor</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.4.3.html" rel="next">&sect;2.4.3&nbsp;Role creation in the presence of smart lifting&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.4.html" rel="section">&sect;2.4&nbsp;Explicit role creation</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.4.3.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.4.3.html
new file mode 100644
index 000000000..315e347db
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.4.3.html
@@ -0,0 +1,123 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s2.4.2.html" rel="prev">&lt;&lt;&nbsp;&sect;2.4.2&nbsp;Role creation via a regular constructor</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.4.html" rel="section">&sect;2.4&nbsp;Explicit role creation</a></div>
+ <div class="sect depth3" id="s2.4.3">
+ <h3 class="sect">&sect;2.4.3&nbsp;Role creation in the presence of smart lifting</h3>
+ <p>Explicitly instantiating a role <code>R1</code> bound to a base <code>B</code> where smart lifting of <code>B</code> to <code>R1</code> would actually
+ provide a subrole <code>R2</code> is dangerous: Instantiation enters the <code>R1</code> into the team's internal cache. If at any time later lifting
+ this <code>B</code> to <code>R2</code> is requested, which is a legal request, the runtime system will answer by throwing a <code>org.objectteams.WrongRoleException</code>
+ because it finds the <code>R1</code> instead of the required <code>R2</code>.
+ For this reason, in this specific situation the explicit instantiation <code>new R1(..)</code> will be flagged by a warning.
+ The problem can be avoided by using <code>R2</code> in the instantiation expression.
+
+ </p>
+ <h5 class="listing">Example code (WrongRoleException):</h5>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>class</b> B { <b>void</b> bm() {} }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> T {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>protected</b> <b>class</b> R1 <b>playedBy</b> B {...}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <b>protected</b> <b>class</b> R2 <b>extends</b> R1 { <span class="comment">// inherits the binding to B</span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> <b>void</b> rm() { <span class="comment">/* body omitted */</span> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> <b>public</b> B getDecoratedB() {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre> <b>return</b> <em><b>new</b> R1</em>(<b>new</b> B()); <span class="comment">// <span class="error">compile-time warning!</span></span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">10</td>
+ <td><pre> <b>public</b> <b>void</b> requestLifting(B <b>as</b> R2 r) {}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">11</td>
+ <td><pre>}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">12</td>
+ <td><pre><span class="comment">// plus these calls:</span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">13</td>
+ <td><pre>T t = <b>new</b> T();</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">14</td>
+ <td><pre>B b = t.getDecoratedB(); <span class="comment">// creates an R1 for b</span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">15</td>
+ <td><pre>t.requestLifting(b); <span class="comment">// =&gt; <span class="error"><code>org.objectteams.WrongRoleException!</code></span></span></pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="codecomment">
+ <ul>
+ <li>A note on line 8: this line passes a fresh instance of <code>B</code> to the lifting constructor of <code>R1</code>
+ (see <a href="s2.4.1.b.html" title="&sect;2.4.1.(b)&nbsp;Fresh base object"
+ class="sect">&sect;2.4.1.(b)</a>). In order to return this <code>B</code> instance lowering is implicitly used for the return statement.
+ </li>
+ <li>When line 15 is executed, a lifting of <code>b</code> to <code>R2</code> is requested but due to line 8 an <code>R1</code> is found in the internal cache.
+ </li>
+ </ul>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s2.4.2.html" rel="prev">&lt;&lt;&nbsp;&sect;2.4.2&nbsp;Role creation via a regular constructor</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.4.html" rel="section">&sect;2.4&nbsp;Explicit role creation</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.4.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.4.html
new file mode 100644
index 000000000..b4586d1d0
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.4.html
@@ -0,0 +1,267 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s2.3.html" rel="prev">&lt;&lt;&nbsp;&sect;2.3&nbsp;Lifting</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.5.html" rel="next">&sect;2.5&nbsp;Abstract Roles&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a></div>
+ <div class="sect depth2" id="s2.4">
+ <h2 class="sect">&sect;2.4&nbsp;Explicit role creation</h2>
+ <p>Lifting is the normal technique by which role objects are created implicitly.
+ This section defines under which conditions a role can also be created explicitly.
+
+ </p>
+ <div class="sect depth3" id="s2.4.1">
+ <h3 class="sect">&sect;2.4.1&nbsp;Role creation via a lifting constructor<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;2.4</a></span></h3>
+ <p>Lifting uses the default constructor for roles (see <a href="s2.3.1.html" title="&sect;2.3.1&nbsp;Implicit role creation"
+ class="sect">&sect;2.3.1</a>).
+ This constructor can be invoked from client code, if the following rules are respected.
+
+ </p>
+ <div class="subsect depth4" id="s2.4.1.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Team context</span></h4>
+ <p>The lifting constructor can be used only within the enclosing team of
+ the role to be instantiated. Thus, qualified allocation expressions
+ (<code>someTeam.new SomeRole(..)</code>) may never use the lifting constructor.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s2.4.1.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Fresh base object</span></h4>
+ <p>If the argument to a lifting constructor invocation is a <code>new</code>
+ expression, creating a fresh base object, the use of the lifting constructor
+ is safe. Otherwise the rules of (c) below apply.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s2.4.1.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Duplicate role runtime check</span></h4>
+ <p>If it cannot be syntactically derived, that the argument to a lifting
+ constructor is a freshly created base object (b), a compile time warning will
+ signal that an additional runtime check is needed: It must be prevented that
+ a new role is created for a base object, which already has a role of the
+ required type in the given team. It is not possible to replace an existing
+ role by use of the lifting constructor. At runtime, any attempt to do so
+ will cause a <code>org.objectteams.DuplicateRoleException</code> to be thrown.
+ This exception can only occur in situations where the mentioned compile
+ time warning had been issued.
+ <br /><a href="s6.1.html" title="&sect;6.1&nbsp;Reflection" class="sect">&sect;6.1</a> will introduce reflective functions
+ which can be used to manually prevent errors like a duplicate role.
+
+ </p>
+ </div>
+ </div>
+ <div class="sect depth3" id="s2.4.2">
+ <h3 class="sect">&sect;2.4.2&nbsp;Role creation via a regular constructor<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;2.4</a></span></h3>
+ <p>Roles may also be created explicitly using a custom constructor with arbitrary signature
+ other than the signature of the lifting constructor.<br />
+ Within role constructors, four kinds of self-calls are possible:
+
+ </p>
+ <dl>
+ <dt><code>base(..)</code></dt>
+ <dd>A constructor of the corresponding base class (<a href="sA.html#sA.5.3" title="&sect;A.5.3&nbsp;BaseCall" class="sect">&sect;A.5.3</a>(c)).
+ </dd>
+ <dt><code>this(..)</code></dt>
+ <dd>Another constructor of the same class.</dd>
+ <dt><code>super(..)</code></dt>
+ <dd>A constructor of the super-class (normal <code>extends</code>), <span class="underline">unless</span> the super-class is bound to a different base class, in which case calling <code>super(..)</code> is not legal.
+ </dd>
+ <dt><code>tsuper(..)</code></dt>
+ <dd>A constructor of the corresponding role of the super-team (<a href="sA.html#sA.5.4" title="&sect;A.5.4&nbsp;TSuperCall" class="sect">&sect;A.5.4</a>(e)). Also see the constraint in <a href="s1.3.2.c.html"
+ title="&sect;1.3.2.(c)&nbsp;Constructors and overridden 'extends' "
+ class="sect">&sect;1.3.2.(c)</a>.
+ </dd>
+ </dl>
+ <div class="subsect depth4" id="s2.4.2.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Unbound roles</span></h4>
+ <p>Each constructor of a role that is <strong>not bound</strong> to a base class must use
+ one of <code>this(..)</code>, <code>super(..)</code> or <code>tsuper(..)</code>.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s2.4.2.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Bound roles</span></h4>
+ <p>Each constructor of a <strong>bound role</strong> must directly or indirectly invoke either
+ a <code>base(..)</code> constructor or a lifting constructor (see <a href="s2.3.1.html" title="&sect;2.3.1&nbsp;Implicit role creation"
+ class="sect">&sect;2.3.1</a>).
+ Indirect calls to the base constructor or lifting constructor may use any of <code>this(..)</code>, <code>super(..)</code>
+ or <code>tsuper(..)</code>, which simply delegates the obligation to the called constructor.
+ <br />
+ If a constructor referenced by <code>base(..)</code> is not visible according to the
+ regular rules of Java, it may still be called using <b>decapsulation</b> (see
+ also <a href="s3.4.html" title="&sect;3.4&nbsp;Overriding access restrictions"
+ class="sect">&sect;3.4</a>, <a href="s2.1.2.c.html" title="&sect;2.1.2.(c)&nbsp;Base class decapsulation"
+ class="sect">&sect;2.1.2.(c)</a>).
+ <br />
+ Note, that if the super or tsuper role is not bound, delegating the obligation to that unbound role will not work.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s2.4.2.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Super-call for bound roles</span></h4>
+ <p>Instead of or prior to calling <code>base(..)</code> a constructor of a bound role explicitly or implicitly calls a super constructor.
+ Which constructor is applicable depends on the super role and its <code>playedBy</code> clause.
+
+ </p>
+ <ul>
+ <li>If the super role is bound to the same base class as the current role is,
+
+ <ul>
+ <li>not writing a super-call causes the lifting constructor of the super role to be invoked.</li>
+ <li>explicitly calling a super constructor requires the super constructor to <i>either</i><ol>
+ <li>create a role instance using a base constructor call (directly or indirectly), <i>or</i></li>
+ <li>be a lifting constructor receiving a base instance, which the current role must provide as the argument.</li>
+ </ol>
+ </li>
+ </ul>
+ </li>
+ <li>If the super role is bound but the current role refines the <code>playedBy</code>
+ relationship (cf. <a href="s2.1.c.html" title="&sect;2.1.(c)&nbsp;Covariant refinement"
+ class="sect">&sect;2.1.(c)</a>),
+
+ <ul>
+ <li>a lifting constructor must be called explicitly passing a base object as the argument.</li>
+ </ul>
+ </li>
+ <li>If the role has an explicit or implicit super role which is unbound the constructor may optionally
+ call a super constructor (using <code>super(..)</code> or <code>tsuper(..)</code>) prior to calling
+ <code>base(..)</code>. Otherwise the default constructor is implicitly invoked.
+
+ </li>
+ </ul>
+ <p>When invoking a lifting constructor of a super role the base object can optionally be obtained by using a base constructor
+ call as an expression:
+
+ </p>
+ <div class="listing plain"><pre>super(base(<i>&lt;args&gt;</i>));</pre></div>
+ </div>
+ <p>The language system evaluates the base constructor by creating an
+ instance of the appropriate base class using a constructor with matching
+ signature. Also the internal links are setup that are needed for accessing the
+ base object from the role and for lifting the base object to the new role
+ in the future.
+
+ </p>
+ <p>The syntax for base constructors follows the rule that role implementations
+ never directly refer to any names of base classes or their features.
+
+ </p>
+ </div>
+ <div class="sect depth3" id="s2.4.3">
+ <h3 class="sect">&sect;2.4.3&nbsp;Role creation in the presence of smart lifting<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;2.4</a></span></h3>
+ <p>Explicitly instantiating a role <code>R1</code> bound to a base <code>B</code> where smart lifting of <code>B</code> to <code>R1</code> would actually
+ provide a subrole <code>R2</code> is dangerous: Instantiation enters the <code>R1</code> into the team's internal cache. If at any time later lifting
+ this <code>B</code> to <code>R2</code> is requested, which is a legal request, the runtime system will answer by throwing a <code>org.objectteams.WrongRoleException</code>
+ because it finds the <code>R1</code> instead of the required <code>R2</code>.
+ For this reason, in this specific situation the explicit instantiation <code>new R1(..)</code> will be flagged by a warning.
+ The problem can be avoided by using <code>R2</code> in the instantiation expression.
+
+ </p>
+ <h5 class="listing">Example code (WrongRoleException):</h5>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>class</b> B { <b>void</b> bm() {} }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> T {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>protected</b> <b>class</b> R1 <b>playedBy</b> B {...}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <b>protected</b> <b>class</b> R2 <b>extends</b> R1 { <span class="comment">// inherits the binding to B</span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> <b>void</b> rm() { <span class="comment">/* body omitted */</span> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> <b>public</b> B getDecoratedB() {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre> <b>return</b> <em><b>new</b> R1</em>(<b>new</b> B()); <span class="comment">// <span class="error">compile-time warning!</span></span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">10</td>
+ <td><pre> <b>public</b> <b>void</b> requestLifting(B <b>as</b> R2 r) {}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">11</td>
+ <td><pre>}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">12</td>
+ <td><pre><span class="comment">// plus these calls:</span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">13</td>
+ <td><pre>T t = <b>new</b> T();</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">14</td>
+ <td><pre>B b = t.getDecoratedB(); <span class="comment">// creates an R1 for b</span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">15</td>
+ <td><pre>t.requestLifting(b); <span class="comment">// =&gt; <span class="error"><code>org.objectteams.WrongRoleException!</code></span></span></pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="codecomment">
+ <ul>
+ <li>A note on line 8: this line passes a fresh instance of <code>B</code> to the lifting constructor of <code>R1</code>
+ (see <a href="#s2.4.1.b" title="&sect;2.4.1.(b)&nbsp;Fresh base object"
+ class="sect">&sect;2.4.1.(b)</a>). In order to return this <code>B</code> instance lowering is implicitly used for the return statement.
+ </li>
+ <li>When line 15 is executed, a lifting of <code>b</code> to <code>R2</code> is requested but due to line 8 an <code>R1</code> is found in the internal cache.
+ </li>
+ </ul>
+ </div>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s2.3.html" rel="prev">&lt;&lt;&nbsp;&sect;2.3&nbsp;Lifting</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.5.html" rel="next">&sect;2.5&nbsp;Abstract Roles&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.5.a.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.5.a.html
new file mode 100644
index 000000000..649a659e7
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.5.a.html
@@ -0,0 +1,62 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.5.b.html" rel="next">&sect;2.5.(b)&nbsp;Relevant roles&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.5.html" rel="section">&sect;2.5&nbsp;Abstract Roles</a></div>
+ <div class="subsect depth3" id="s2.5.a">
+ <h4 class="subsect">&sect;2.5.(a)&nbsp;<span class="title">Using abstract classes for creation</span></h4>
+ <p>Abstract role classes can indeed be used for object creation.
+ The effect of such a statement is that the team must be
+ marked <code>abstract</code>. Only those sub-teams are concrete
+ that provide concrete versions for all role classes used in
+ creation expressions.<br />
+ This includes the case, where a
+ super-team has a concrete role class and creates
+ instances of this role class and only the sub-team changes
+ the status of this role class to abstract. Also here
+ the sub-team must be marked abstract, because it contains
+ an abstract role class that is used in creation expressions.
+
+ </p>
+ <div class="note">
+ <h5>Interpretation:</h5>
+ Since the type in a role creation expression is late-bound relative to the enclosing team instance, abstract role classes
+ can be seen
+ as the hook in a <strong>template&amp;hook pattern</strong> that is raised from the method level to the class level:
+ A super-team may already refer to the constructor of an abstract role class,
+ only the sub-team will provide the concrete role class to fill the hook with the necessary implementation.
+
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.5.b.html" rel="next">&sect;2.5.(b)&nbsp;Relevant roles&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.5.html" rel="section">&sect;2.5&nbsp;Abstract Roles</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.5.b.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.5.b.html
new file mode 100644
index 000000000..28493c36d
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.5.b.html
@@ -0,0 +1,70 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s2.5.a.html" rel="prev">&lt;&lt;&nbsp;&sect;2.5.(a)&nbsp;Using abstract classes for creation</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.5.html" rel="section">&sect;2.5&nbsp;Abstract Roles</a></div>
+ <div class="subsect depth3" id="s2.5.b">
+ <h4 class="subsect">&sect;2.5.(b)&nbsp;<span class="title">Relevant roles</span></h4>
+ <p>A team must be marked <code>abstract</code> if one of its <strong>relevant roles</strong> is abstract.
+ <br />
+ A role is relevant in this sense if
+
+ </p>
+ <ul>
+ <li>the role class is public <em>or if</em></li>
+ <li>an explicit <code>new</code> expression
+ would require to create instances of the role class, <em>or if</em></li>
+ <li>any of the lifting methods of the enclosing team
+ would require to create instances of the role class.<br />
+ A role is irrelevant with respect to lifting
+ if either of the following holds:
+
+ <ul>
+ <li>It is not bound to a base class, neither directly nor
+ by an inherited <code>playedBy</code> clause.
+ </li>
+ <li>It has a sub-role without a <code>playedBy</code> clause.
+ </li>
+ <li>It is bound to an abstract base class, and for all concrete
+ sub-classes of the base class, a binding to a more specific role class exists.
+ </li>
+ </ul>
+ </li>
+ </ul>
+ <p>If neither property, relevance nor irrelevance, can be shown for an abstract role,
+ a warning is given in case the enclosing team is not abstract.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s2.5.a.html" rel="prev">&lt;&lt;&nbsp;&sect;2.5.(a)&nbsp;Using abstract classes for creation</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.5.html" rel="section">&sect;2.5&nbsp;Abstract Roles</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.5.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.5.html
new file mode 100644
index 000000000..eeab45894
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.5.html
@@ -0,0 +1,103 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s2.4.html" rel="prev">&lt;&lt;&nbsp;&sect;2.4&nbsp;Explicit role creation</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.6.html" rel="next">&sect;2.6&nbsp;Explicit base references&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a></div>
+ <div class="sect depth2" id="s2.5">
+ <h2 class="sect">&sect;2.5&nbsp;Abstract Roles</h2>
+ <p>Overriding of role classes and dynamic binding of role types (<a href="s1.3.1.e.html" title="&sect;1.3.1.(e)&nbsp;Dynamic binding of types"
+ class="sect">&sect;1.3.1.(e)</a>)
+ adds new cases to <strong>creation</strong> with respect to abstract classes.
+
+ </p>
+ <div class="subsect depth3" id="s2.5.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Using abstract classes for creation</span></h4>
+ <p>Abstract role classes can indeed be used for object creation.
+ The effect of such a statement is that the team must be
+ marked <code>abstract</code>. Only those sub-teams are concrete
+ that provide concrete versions for all role classes used in
+ creation expressions.<br />
+ This includes the case, where a
+ super-team has a concrete role class and creates
+ instances of this role class and only the sub-team changes
+ the status of this role class to abstract. Also here
+ the sub-team must be marked abstract, because it contains
+ an abstract role class that is used in creation expressions.
+
+ </p>
+ <div class="note">
+ <h5>Interpretation:</h5>
+ Since the type in a role creation expression is late-bound relative to the enclosing team instance, abstract role classes
+ can be seen
+ as the hook in a <strong>template&amp;hook pattern</strong> that is raised from the method level to the class level:
+ A super-team may already refer to the constructor of an abstract role class,
+ only the sub-team will provide the concrete role class to fill the hook with the necessary implementation.
+
+ </div>
+ </div>
+ <div class="subsect depth3" id="s2.5.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Relevant roles</span></h4>
+ <p>A team must be marked <code>abstract</code> if one of its <strong>relevant roles</strong> is abstract.
+ <br />
+ A role is relevant in this sense if
+
+ </p>
+ <ul>
+ <li>the role class is public <em>or if</em></li>
+ <li>an explicit <code>new</code> expression
+ would require to create instances of the role class, <em>or if</em></li>
+ <li>any of the lifting methods of the enclosing team
+ would require to create instances of the role class.<br />
+ A role is irrelevant with respect to lifting
+ if either of the following holds:
+
+ <ul>
+ <li>It is not bound to a base class, neither directly nor
+ by an inherited <code>playedBy</code> clause.
+ </li>
+ <li>It has a sub-role without a <code>playedBy</code> clause.
+ </li>
+ <li>It is bound to an abstract base class, and for all concrete
+ sub-classes of the base class, a binding to a more specific role class exists.
+ </li>
+ </ul>
+ </li>
+ </ul>
+ <p>If neither property, relevance nor irrelevance, can be shown for an abstract role,
+ a warning is given in case the enclosing team is not abstract.
+
+ </p>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s2.4.html" rel="prev">&lt;&lt;&nbsp;&sect;2.4&nbsp;Explicit role creation</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.6.html" rel="next">&sect;2.6&nbsp;Explicit base references&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.6.a.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.6.a.html
new file mode 100644
index 000000000..0120cc2a1
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.6.a.html
@@ -0,0 +1,81 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.6.b.html" rel="next">&sect;2.6.(b)&nbsp;Explicit base object creation&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.6.html" rel="section">&sect;2.6&nbsp;Explicit base references</a></div>
+ <div class="subsect depth3" id="s2.6.a">
+ <h4 class="subsect">&sect;2.6.(a)&nbsp;<span class="title">Externalized roles of a base team</span></h4>
+ <p>If the base class of a role <code>T1.R1</code> is again a team
+ <code>T2</code>, roles of that team <code>T2</code> can be
+ externalized (see <a href="s1.2.2.html" title="&sect;1.2.2&nbsp;Externalized roles" class="sect">&sect;1.2.2</a>)
+ using <code>base</code> as their type anchor. Given that
+ <code>R2</code> is a role of <code>T2</code>, one could write:
+
+ </p>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> T1 {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>protected</b> <b>class</b> R1 <em><b>playedBy</b> T2</em> {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>protected</b> <em>R2&lt;@base&gt;</em> aRoleOfMyBase;</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <p>This syntax is only legal within the body of the role <code>T1.R1</code> which is bound
+ to the team <code>T2</code> containing role <code>R2</code>.
+ A static type prefix can be used to disambiguate a base anchor, so the explicit variant
+ of the above type would be <code>R2&lt;@<strong>R1</strong>.base&gt;</code>.
+ <br />
+ It is not legal to use a type anchor containing <code>base</code> as an element in a path
+ of references like <code>&lt;@base.<span class="error">field</span>&gt;</code>
+ or <code>&lt;@<span class="error">field</span>.base&gt;</code>.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.6.b.html" rel="next">&sect;2.6.(b)&nbsp;Explicit base object creation&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.6.html" rel="section">&sect;2.6&nbsp;Explicit base references</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.6.b.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.6.b.html
new file mode 100644
index 000000000..e58193faf
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.6.b.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s2.6.a.html" rel="prev">&lt;&lt;&nbsp;&sect;2.6.(a)&nbsp;Externalized roles of a base team</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.6.c.html" rel="next">&sect;2.6.(c)&nbsp;Base call in callin method&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.6.html" rel="section">&sect;2.6&nbsp;Explicit base references</a></div>
+ <div class="subsect depth3" id="s2.6.b">
+ <h4 class="subsect">&sect;2.6.(b)&nbsp;<span class="title">Explicit base object creation</span></h4>
+ <p>Within a role constructor (which is not the lifting constructor)
+ the syntax <code>base(<em>arguments</em>)</code> causes an instance
+ of the bound base class to be created and linked (see <a href="s2.4.2.html"
+ title="&sect;2.4.2&nbsp;Role creation via a regular constructor"
+ class="sect">&sect;2.4.2</a>).
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s2.6.a.html" rel="prev">&lt;&lt;&nbsp;&sect;2.6.(a)&nbsp;Externalized roles of a base team</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.6.c.html" rel="next">&sect;2.6.(c)&nbsp;Base call in callin method&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.6.html" rel="section">&sect;2.6&nbsp;Explicit base references</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.6.c.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.6.c.html
new file mode 100644
index 000000000..92612132d
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.6.c.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s2.6.b.html" rel="prev">&lt;&lt;&nbsp;&sect;2.6.(b)&nbsp;Explicit base object creation</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.6.d.html" rel="next">&sect;2.6.(d)&nbsp;Base guard predicates&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.6.html" rel="section">&sect;2.6&nbsp;Explicit base references</a></div>
+ <div class="subsect depth3" id="s2.6.c">
+ <h4 class="subsect">&sect;2.6.(c)&nbsp;<span class="title">Base call in callin method</span></h4>
+ <p>Within a <a href="s4.2.d.html" title="&sect;4.2.(d)&nbsp;Callin methods" class="sect">callin method (&sect;4.2.(d))</a>
+ an expression <code>base.m(<em>args</em>)</code> is used to invoke the
+ originally called method (see <a href="s4.3.html" title="&sect;4.3&nbsp;Base calls" class="sect">&sect;4.3</a>).
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s2.6.b.html" rel="prev">&lt;&lt;&nbsp;&sect;2.6.(b)&nbsp;Explicit base object creation</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.6.d.html" rel="next">&sect;2.6.(d)&nbsp;Base guard predicates&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.6.html" rel="section">&sect;2.6&nbsp;Explicit base references</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.6.d.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.6.d.html
new file mode 100644
index 000000000..a0f90c64a
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.6.d.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s2.6.c.html" rel="prev">&lt;&lt;&nbsp;&sect;2.6.(c)&nbsp;Base call in callin method</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.6.e.html" rel="next">&sect;2.6.(e)&nbsp;Parameter mappings&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.6.html" rel="section">&sect;2.6&nbsp;Explicit base references</a></div>
+ <div class="subsect depth3" id="s2.6.d">
+ <h4 class="subsect">&sect;2.6.(d)&nbsp;<span class="title">Base guard predicates</span></h4>
+ <p><a href="s5.4.html" title="&sect;5.4&nbsp;Guard predicates" class="sect">Guard predicates (&sect;5.4)</a> can
+ be specified to act on the base side using the <code><strong>base when</strong></code> keywords.
+ Within such a base guard predicate <code>base</code> is interpreted as a special identifier
+ holding a reference to the base object that is about to be lifted
+ for the sake of a callin method interception (see <a href="s5.4.2.a.html" title="&sect;5.4.2.(a)&nbsp;Base object reference"
+ class="sect">&sect;5.4.2.(a)</a>).
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s2.6.c.html" rel="prev">&lt;&lt;&nbsp;&sect;2.6.(c)&nbsp;Base call in callin method</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.6.e.html" rel="next">&sect;2.6.(e)&nbsp;Parameter mappings&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.6.html" rel="section">&sect;2.6&nbsp;Explicit base references</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.6.e.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.6.e.html
new file mode 100644
index 000000000..94da4c06a
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.6.e.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s2.6.d.html" rel="prev">&lt;&lt;&nbsp;&sect;2.6.(d)&nbsp;Base guard predicates</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.6.f.html" rel="next">&sect;2.6.(f)&nbsp;Inhibition of modification&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.6.html" rel="section">&sect;2.6&nbsp;Explicit base references</a></div>
+ <div class="subsect depth3" id="s2.6.e">
+ <h4 class="subsect">&sect;2.6.(e)&nbsp;<span class="title">Parameter mappings</span></h4>
+ <p>An expression at the right-hand side of a parameter mapping
+ (parameter in a callin binding (<a href="s4.4.html" title="&sect;4.4&nbsp;Callin parameter mapping"
+ class="sect">&sect;4.4</a>) or
+ result in a callout binding (<a href="s3.2.c.html" title="&sect;3.2.(c)&nbsp;Result mapping" class="sect">&sect;3.2.(c)</a>) ) may use the keyword <code>base</code>
+ to refer to the bound base instance. Such usage requires the role method bound in this method binding to be non-static.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s2.6.d.html" rel="prev">&lt;&lt;&nbsp;&sect;2.6.(d)&nbsp;Base guard predicates</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.6.f.html" rel="next">&sect;2.6.(f)&nbsp;Inhibition of modification&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.6.html" rel="section">&sect;2.6&nbsp;Explicit base references</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.6.f.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.6.f.html
new file mode 100644
index 000000000..5a0ed12f9
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.6.f.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s2.6.e.html" rel="prev">&lt;&lt;&nbsp;&sect;2.6.(e)&nbsp;Parameter mappings</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.6.g.html" rel="next">&sect;2.6.(g)&nbsp;Decapsulation via base reference&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.6.html" rel="section">&sect;2.6&nbsp;Explicit base references</a></div>
+ <div class="subsect depth3" id="s2.6.f">
+ <h4 class="subsect">&sect;2.6.(f)&nbsp;<span class="title">Inhibition of modification</span></h4>
+ <p>In all cases, the <code>base</code> reference is immutable,
+ i.e., <code>base</code> can never appear as the left-hand-side of an assignment.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s2.6.e.html" rel="prev">&lt;&lt;&nbsp;&sect;2.6.(e)&nbsp;Parameter mappings</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.6.g.html" rel="next">&sect;2.6.(g)&nbsp;Decapsulation via base reference&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.6.html" rel="section">&sect;2.6&nbsp;Explicit base references</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.6.g.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.6.g.html
new file mode 100644
index 000000000..ef072f381
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.6.g.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s2.6.f.html" rel="prev">&lt;&lt;&nbsp;&sect;2.6.(f)&nbsp;Inhibition of modification</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.6.html" rel="section">&sect;2.6&nbsp;Explicit base references</a></div>
+ <div class="subsect depth3" id="s2.6.g">
+ <h4 class="subsect">&sect;2.6.(g)&nbsp;<span class="title">Decapsulation via base reference</span></h4>
+ <p>In cases <a href="s2.6.d.html" title="&sect;2.6.(d)&nbsp;Base guard predicates"
+ class="sect">&sect;2.6.(d)</a> and <a href="s2.6.e.html" title="&sect;2.6.(e)&nbsp;Parameter mappings"
+ class="sect">&sect;2.6.(e)</a> above, members of the base
+ object may be accessed that would not be visible under Java's visibility rules.
+ Such references are treated as decapsulation in accordance with <a href="s3.4.a.html"
+ title="&sect;3.4.(a)&nbsp;Callout to inaccessible base method"
+ class="sect">&sect;3.4.(a)</a> and <a href="s3.5.e.html" title="&sect;3.5.(e)&nbsp;Access control" class="sect">&sect;3.5.(e)</a>.<br />
+ Note that accessing a base field via <code>base</code> only gives reading access to this field.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s2.6.f.html" rel="prev">&lt;&lt;&nbsp;&sect;2.6.(f)&nbsp;Inhibition of modification</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.6.html" rel="section">&sect;2.6&nbsp;Explicit base references</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.6.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.6.html
new file mode 100644
index 000000000..e3bf3c503
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.6.html
@@ -0,0 +1,151 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s2.5.html" rel="prev">&lt;&lt;&nbsp;&sect;2.5&nbsp;Abstract Roles</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.7.html" rel="next">&sect;2.7&nbsp;Advanced structures&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a></div>
+ <div class="sect depth2" id="s2.6">
+ <h2 class="sect">&sect;2.6&nbsp;Explicit base references</h2>
+ <p>The role-base link is not meant to be accessed explicitly from programs,
+ but it is fully under the control of compiler and runtime environment.
+ Accessing features of a role's base object is done by
+ <a href="s3.html" title="&sect;3&nbsp;Callout Binding" class="sect">callout bindings (&sect;3)</a>.
+ Yet, a keyword <code>base</code> exists, which can be used in the following
+ contexts:
+
+ </p>
+ <div class="subsect depth3" id="s2.6.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Externalized roles of a base team</span></h4>
+ <p>If the base class of a role <code>T1.R1</code> is again a team
+ <code>T2</code>, roles of that team <code>T2</code> can be
+ externalized (see <a href="s1.2.2.html" title="&sect;1.2.2&nbsp;Externalized roles" class="sect">&sect;1.2.2</a>)
+ using <code>base</code> as their type anchor. Given that
+ <code>R2</code> is a role of <code>T2</code>, one could write:
+
+ </p>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> T1 {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>protected</b> <b>class</b> R1 <em><b>playedBy</b> T2</em> {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>protected</b> <em>R2&lt;@base&gt;</em> aRoleOfMyBase;</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <p>This syntax is only legal within the body of the role <code>T1.R1</code> which is bound
+ to the team <code>T2</code> containing role <code>R2</code>.
+ A static type prefix can be used to disambiguate a base anchor, so the explicit variant
+ of the above type would be <code>R2&lt;@<strong>R1</strong>.base&gt;</code>.
+ <br />
+ It is not legal to use a type anchor containing <code>base</code> as an element in a path
+ of references like <code>&lt;@base.<span class="error">field</span>&gt;</code>
+ or <code>&lt;@<span class="error">field</span>.base&gt;</code>.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s2.6.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Explicit base object creation</span></h4>
+ <p>Within a role constructor (which is not the lifting constructor)
+ the syntax <code>base(<em>arguments</em>)</code> causes an instance
+ of the bound base class to be created and linked (see <a href="s2.4.2.html"
+ title="&sect;2.4.2&nbsp;Role creation via a regular constructor"
+ class="sect">&sect;2.4.2</a>).
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s2.6.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Base call in callin method</span></h4>
+ <p>Within a <a href="s4.2.d.html" title="&sect;4.2.(d)&nbsp;Callin methods" class="sect">callin method (&sect;4.2.(d))</a>
+ an expression <code>base.m(<em>args</em>)</code> is used to invoke the
+ originally called method (see <a href="s4.3.html" title="&sect;4.3&nbsp;Base calls" class="sect">&sect;4.3</a>).
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s2.6.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Base guard predicates</span></h4>
+ <p><a href="s5.4.html" title="&sect;5.4&nbsp;Guard predicates" class="sect">Guard predicates (&sect;5.4)</a> can
+ be specified to act on the base side using the <code><strong>base when</strong></code> keywords.
+ Within such a base guard predicate <code>base</code> is interpreted as a special identifier
+ holding a reference to the base object that is about to be lifted
+ for the sake of a callin method interception (see <a href="s5.4.2.a.html" title="&sect;5.4.2.(a)&nbsp;Base object reference"
+ class="sect">&sect;5.4.2.(a)</a>).
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s2.6.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Parameter mappings</span></h4>
+ <p>An expression at the right-hand side of a parameter mapping
+ (parameter in a callin binding (<a href="s4.4.html" title="&sect;4.4&nbsp;Callin parameter mapping"
+ class="sect">&sect;4.4</a>) or
+ result in a callout binding (<a href="s3.2.c.html" title="&sect;3.2.(c)&nbsp;Result mapping" class="sect">&sect;3.2.(c)</a>) ) may use the keyword <code>base</code>
+ to refer to the bound base instance. Such usage requires the role method bound in this method binding to be non-static.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s2.6.f">
+ <h4 class="subsect">(f)&nbsp;<span class="title">Inhibition of modification</span></h4>
+ <p>In all cases, the <code>base</code> reference is immutable,
+ i.e., <code>base</code> can never appear as the left-hand-side of an assignment.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s2.6.g">
+ <h4 class="subsect">(g)&nbsp;<span class="title">Decapsulation via base reference</span></h4>
+ <p>In cases <a href="#s2.6.d" title="&sect;2.6.(d)&nbsp;Base guard predicates"
+ class="sect">&sect;2.6.(d)</a> and <a href="#s2.6.e" title="&sect;2.6.(e)&nbsp;Parameter mappings" class="sect">&sect;2.6.(e)</a> above, members of the base
+ object may be accessed that would not be visible under Java's visibility rules.
+ Such references are treated as decapsulation in accordance with <a href="s3.4.a.html"
+ title="&sect;3.4.(a)&nbsp;Callout to inaccessible base method"
+ class="sect">&sect;3.4.(a)</a> and <a href="s3.5.e.html" title="&sect;3.5.(e)&nbsp;Access control" class="sect">&sect;3.5.(e)</a>.<br />
+ Note that accessing a base field via <code>base</code> only gives reading access to this field.
+
+ </p>
+ </div>
+ <div class="newpage"></div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s2.5.html" rel="prev">&lt;&lt;&nbsp;&sect;2.5&nbsp;Abstract Roles</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.7.html" rel="next">&sect;2.7&nbsp;Advanced structures&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.7.a.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.7.a.html
new file mode 100644
index 000000000..7b49e1656
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.7.a.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.7.b.html" rel="next">&sect;2.7.(b)&nbsp;Stacking&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.7.html" rel="section">&sect;2.7&nbsp;Advanced structures</a></div>
+ <div class="subsect depth3" id="s2.7.a">
+ <h4 class="subsect">&sect;2.7.(a)&nbsp;<span class="title">Nesting</span></h4>
+ <p>If a role (contained in a team) is also a team (marked with the <code>team</code> modifier)
+ it is a <strong>nested team</strong>. The depth of nesting is not restricted.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.7.b.html" rel="next">&sect;2.7.(b)&nbsp;Stacking&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.7.html" rel="section">&sect;2.7&nbsp;Advanced structures</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.7.b.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.7.b.html
new file mode 100644
index 000000000..fbe11c3f4
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.7.b.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s2.7.a.html" rel="prev">&lt;&lt;&nbsp;&sect;2.7.(a)&nbsp;Nesting</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.7.c.html" rel="next">&sect;2.7.(c)&nbsp;Layering&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.7.html" rel="section">&sect;2.7&nbsp;Advanced structures</a></div>
+ <div class="subsect depth3" id="s2.7.b">
+ <h4 class="subsect">&sect;2.7.(b)&nbsp;<span class="title">Stacking</span></h4>
+ <p>If the base class to which a role is bound using <code>playedBy</code> is a team,
+ the role is said to be <strong>stacked</strong> on the base team.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s2.7.a.html" rel="prev">&lt;&lt;&nbsp;&sect;2.7.(a)&nbsp;Nesting</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.7.c.html" rel="next">&sect;2.7.(c)&nbsp;Layering&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.7.html" rel="section">&sect;2.7&nbsp;Advanced structures</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.7.c.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.7.c.html
new file mode 100644
index 000000000..bed96f4a0
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.7.c.html
@@ -0,0 +1,60 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s2.7.b.html" rel="prev">&lt;&lt;&nbsp;&sect;2.7.(b)&nbsp;Stacking</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.7.d.html" rel="next">&sect;2.7.(d)&nbsp;Implicit playedBy specialization&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.7.html" rel="section">&sect;2.7&nbsp;Advanced structures</a></div>
+ <div class="subsect depth3" id="s2.7.c">
+ <h4 class="subsect">&sect;2.7.(c)&nbsp;<span class="title">Layering</span></h4>
+ <p>If roles of a team <code>Secondary</code> are played by roles of another team <code>Primary</code>
+ (i.e., base classes are roles), the team <code>Secondary</code> defines a <strong>layer</strong> over the team <code>Primary</code>.
+ Such layering requires a final reference <code>anchor</code> from <code>Secondary</code> to an instance of <code>Primary</code>.
+ All playedBy declarations within <code>Secondary</code> specify their base classes anchored to that final link <code>anchor</code>.
+
+ </p><img src="../images/Layering.png" alt="Team layering example" /><p>Due to the anchored base types, layered teams implicitly support the following guarantee:
+ all base objects of roles of <code>Secondary</code> are contained within the team instance specified by the link <code>anchor</code>.
+ If roles of <code>Secondary</code> contain any callin bindings to non-static base methods, these will be triggered only
+ when a base method is invoked on a base instance contained in the team specified by <code>anchor</code>.
+ <br />
+ In accordance with <a href="s2.6.a.html"
+ title="&sect;2.6.(a)&nbsp;Externalized roles of a base team"
+ class="sect">&sect;2.6.(a)</a> the anchor in such anchored playedBy declarations
+ could also be the pseudo identifier <code>base</code>, provided that <code>Secondary</code> is a nested team,
+ which has a playedBy binding to <code>Primary</code> as its base class.
+ This situation is part of the second example <a href="s2.7.d.html"
+ title="&sect;2.7.(d)&nbsp;Implicit playedBy specialization"
+ class="sect">below (&sect;2.7.(d))</a> (see <code>T1 playedBy TB1</code>).
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s2.7.b.html" rel="prev">&lt;&lt;&nbsp;&sect;2.7.(b)&nbsp;Stacking</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s2.7.d.html" rel="next">&sect;2.7.(d)&nbsp;Implicit playedBy specialization&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.7.html" rel="section">&sect;2.7&nbsp;Advanced structures</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.7.d.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.7.d.html
new file mode 100644
index 000000000..e9b0174e8
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.7.d.html
@@ -0,0 +1,84 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s2.7.c.html" rel="prev">&lt;&lt;&nbsp;&sect;2.7.(c)&nbsp;Layering</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.7.html" rel="section">&sect;2.7&nbsp;Advanced structures</a></div>
+ <div class="subsect depth3" id="s2.7.d">
+ <h4 class="subsect">&sect;2.7.(d)&nbsp;<span class="title">Implicit playedBy specialization</span></h4>
+ <p>According to <a href="s2.1.d.html" title="&sect;2.1.(d)&nbsp;No-variance" class="sect">&sect;2.1.(d)</a> an implicit sub-role may <em>implicitly</em> specialize an existing <code>playedBy</code> relation.
+ This requires the base class to be specified relative to some implicit (<code>OuterTeam.this</code>) or explicit (<code>OuterTeam.base</code>) team anchor.
+ Specializing that team anchor automatically specializes the playedBy declaration, too.
+ This rule never requires any action from a programmer but only explains the interpretation of a playedBy declaration in
+ complex situations.
+
+ </p>
+ <h5>Two advanced examples demonstrating the above are:</h5>
+ <table border="0">
+ <colgroup span="1">
+ <col align="left" span="1" />
+ <col align="left" span="1" />
+ </colgroup>
+ <tr>
+ <td rowspan="1" colspan="1">
+ <ul>
+ <li>If a role <code>TOuter1.T.R</code> of a <strong>nested team </strong><code>TOuter1.T</code> is played by
+ another role of the outer enclosing team <code>TOuter1.B</code>, subclassing the outer team <code>TOuter1</code> to <code>TOuter2</code>
+ will produce a new role <code>TOuter2.T.R</code> which is automatically played by <code>TOuter2.B</code>,
+ an implicit sub class of the original base class <code>TOuter1.B</code>.
+ </li>
+ </ul>
+ </td>
+ <td rowspan="1" colspan="1"><img src="../images/implicitly_overriding_playedby.png"
+ alt="Implicitly overriding playedBy" /></td>
+ </tr>
+ <tr>
+ <td rowspan="1" colspan="1">
+ <ul>
+ <li>Consider the case where a <strong>nested </strong><code>T1</code> as a role of <code>TOuter</code> is <strong>stacked</strong>
+ on a base team <code>TB1</code>. Also, <code>T1</code> is a <strong>layered team</strong> over <code>TB1</code>
+ because its role <code>R</code> adapts role <code>TB1.B</code>.
+ <br />
+ In this situation the playedBy relation of role <code>TOuter.T1.R</code> is given by a base-anchored type <code>B&lt;@T1.base&gt;</code>.
+ If furthermore <code>TOuter.T1</code> is subclassed to <code>TOuter.T2</code> which covariantly refines the inherited
+ playedBy declaration to <code>TB2</code>, then <code>TOuter.T2.R</code> will automatically refine the inherited playedBy relation
+ to <code>TB2.B</code> to follow the new interpretation of the <code>base</code> anchor.
+ </li>
+ </ul>
+ </td>
+ <td rowspan="1" colspan="1"><img src="../images/implicitly_overriding_playedby_base.png"
+ alt="Implicitly overriding playedBy base" /></td>
+ </tr>
+ </table>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s2.7.c.html" rel="prev">&lt;&lt;&nbsp;&sect;2.7.(c)&nbsp;Layering</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.7.html" rel="section">&sect;2.7&nbsp;Advanced structures</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.7.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.7.html
new file mode 100644
index 000000000..1890bcef2
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.7.html
@@ -0,0 +1,129 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s2.6.html" rel="prev">&lt;&lt;&nbsp;&sect;2.6&nbsp;Explicit base references</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a></div>
+ <div class="sect depth2" id="s2.7">
+ <h2 class="sect">&sect;2.7&nbsp;Advanced structures</h2>
+ <p>This section discusses how role containment and the playedBy relationship can be combined.
+ It does not define new rules, but illustrates rules defined above. The central idea is that any class
+ can have more than one of the three flavors <em>team, role, </em>and<em> base</em>.
+
+ </p>
+ <div class="subsect depth3" id="s2.7.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Nesting</span></h4>
+ <p>If a role (contained in a team) is also a team (marked with the <code>team</code> modifier)
+ it is a <strong>nested team</strong>. The depth of nesting is not restricted.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s2.7.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Stacking</span></h4>
+ <p>If the base class to which a role is bound using <code>playedBy</code> is a team,
+ the role is said to be <strong>stacked</strong> on the base team.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s2.7.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Layering</span></h4>
+ <p>If roles of a team <code>Secondary</code> are played by roles of another team <code>Primary</code>
+ (i.e., base classes are roles), the team <code>Secondary</code> defines a <strong>layer</strong> over the team <code>Primary</code>.
+ Such layering requires a final reference <code>anchor</code> from <code>Secondary</code> to an instance of <code>Primary</code>.
+ All playedBy declarations within <code>Secondary</code> specify their base classes anchored to that final link <code>anchor</code>.
+
+ </p><img src="../images/Layering.png" alt="Team layering example" /><p>Due to the anchored base types, layered teams implicitly support the following guarantee:
+ all base objects of roles of <code>Secondary</code> are contained within the team instance specified by the link <code>anchor</code>.
+ If roles of <code>Secondary</code> contain any callin bindings to non-static base methods, these will be triggered only
+ when a base method is invoked on a base instance contained in the team specified by <code>anchor</code>.
+ <br />
+ In accordance with <a href="s2.6.a.html"
+ title="&sect;2.6.(a)&nbsp;Externalized roles of a base team"
+ class="sect">&sect;2.6.(a)</a> the anchor in such anchored playedBy declarations
+ could also be the pseudo identifier <code>base</code>, provided that <code>Secondary</code> is a nested team,
+ which has a playedBy binding to <code>Primary</code> as its base class.
+ This situation is part of the second example <a href="#s2.7.d" title="&sect;2.7.(d)&nbsp;Implicit playedBy specialization"
+ class="sect">below (&sect;2.7.(d))</a> (see <code>T1 playedBy TB1</code>).
+
+ </p>
+ </div>
+ <div class="newpage"></div>
+ <div class="subsect depth3" id="s2.7.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Implicit playedBy specialization</span></h4>
+ <p>According to <a href="s2.1.d.html" title="&sect;2.1.(d)&nbsp;No-variance" class="sect">&sect;2.1.(d)</a> an implicit sub-role may <em>implicitly</em> specialize an existing <code>playedBy</code> relation.
+ This requires the base class to be specified relative to some implicit (<code>OuterTeam.this</code>) or explicit (<code>OuterTeam.base</code>) team anchor.
+ Specializing that team anchor automatically specializes the playedBy declaration, too.
+ This rule never requires any action from a programmer but only explains the interpretation of a playedBy declaration in
+ complex situations.
+
+ </p>
+ <h5>Two advanced examples demonstrating the above are:</h5>
+ <table border="0">
+ <colgroup span="1">
+ <col align="left" span="1" />
+ <col align="left" span="1" />
+ </colgroup>
+ <tr>
+ <td rowspan="1" colspan="1">
+ <ul>
+ <li>If a role <code>TOuter1.T.R</code> of a <strong>nested team </strong><code>TOuter1.T</code> is played by
+ another role of the outer enclosing team <code>TOuter1.B</code>, subclassing the outer team <code>TOuter1</code> to <code>TOuter2</code>
+ will produce a new role <code>TOuter2.T.R</code> which is automatically played by <code>TOuter2.B</code>,
+ an implicit sub class of the original base class <code>TOuter1.B</code>.
+ </li>
+ </ul>
+ </td>
+ <td rowspan="1" colspan="1"><img src="../images/implicitly_overriding_playedby.png"
+ alt="Implicitly overriding playedBy" /></td>
+ </tr>
+ <tr>
+ <td rowspan="1" colspan="1">
+ <ul>
+ <li>Consider the case where a <strong>nested </strong><code>T1</code> as a role of <code>TOuter</code> is <strong>stacked</strong>
+ on a base team <code>TB1</code>. Also, <code>T1</code> is a <strong>layered team</strong> over <code>TB1</code>
+ because its role <code>R</code> adapts role <code>TB1.B</code>.
+ <br />
+ In this situation the playedBy relation of role <code>TOuter.T1.R</code> is given by a base-anchored type <code>B&lt;@T1.base&gt;</code>.
+ If furthermore <code>TOuter.T1</code> is subclassed to <code>TOuter.T2</code> which covariantly refines the inherited
+ playedBy declaration to <code>TB2</code>, then <code>TOuter.T2.R</code> will automatically refine the inherited playedBy relation
+ to <code>TB2.B</code> to follow the new interpretation of the <code>base</code> anchor.
+ </li>
+ </ul>
+ </td>
+ <td rowspan="1" colspan="1"><img src="../images/implicitly_overriding_playedby_base.png"
+ alt="Implicitly overriding playedBy base" /></td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s2.6.html" rel="prev">&lt;&lt;&nbsp;&sect;2.6&nbsp;Explicit base references</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.html
new file mode 100644
index 000000000..c40aa221e
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s2.html
@@ -0,0 +1,1864 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s1.html" rel="prev">&lt;&lt;&nbsp;&sect;1&nbsp;Teams and Roles</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s3.html" rel="next">&sect;3&nbsp;Callout Binding&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"></div>
+ <div class="chapter" id="s2">
+ <div class="headl">
+ <div class="headr">
+ <h1>&sect;2&nbsp;Role Binding</h1>
+ </div>
+ </div>
+ <div id="toc-box">
+ <ul class="toc-box">
+ <li><a href="s2.html">&sect;2&nbsp;Role Binding</a></li>
+ <li><a href="#s2.1">&sect;2.1&nbsp;playedBy relation</a></li>
+ <li><a href="#s2.2">&sect;2.2&nbsp;Lowering</a></li>
+ <li><a href="#s2.3">&sect;2.3&nbsp;Lifting</a></li>
+ <li><a href="#s2.4">&sect;2.4&nbsp;Explicit role creation</a></li>
+ <li><a href="#s2.5">&sect;2.5&nbsp;Abstract Roles</a></li>
+ <li><a href="#s2.6">&sect;2.6&nbsp;Explicit base references</a></li>
+ <li><a href="#s2.7">&sect;2.7&nbsp;Advanced structures</a></li>
+ </ul>
+ </div>
+ <div class="intro">
+ <h3>Roles and base classes</h3>
+ <div class="line"></div>
+ <div class="term">playedBy relation</div>
+ <div class="termdesc">A role can be bound to a class outside the team by a <code>playedBy</code>
+ relation, which declares that each role instances is associated to a
+ base instances.
+ </div>
+ <div class="line"></div>
+ <div class="term">Base class</div>
+ <div class="termdesc">The class to which a role is bound (using <code>playedBy</code>) is called
+ its <strong>base class</strong>. Role instances may inherit and override
+ features from their base instance, which is declared using <strong>callout</strong>
+ (<a href="s3.html" title="&sect;3&nbsp;Callout Binding" class="sect">&sect;3</a>)
+ and <strong>callin</strong> (<a href="s4.html" title="&sect;4&nbsp;Callin Binding" class="sect">&sect;4</a>) method bindings.
+ </div>
+ <div class="line"></div>
+ <div class="term">Bound role</div>
+ <div class="termdesc">Each role class that declares a <code>playedBy</code> relation
+ is called a <strong>bound role</strong>. The term bound role may also be
+ used for the instances of such a class.
+ </div>
+ <div class="line"></div>
+ <div class="term">Lifting / lowering</div>
+ <div class="termdesc">Translations between a role and its base are called
+ <strong>lifting</strong> (base to role) (<a href="#s2.3" title="&sect;2.3&nbsp;Lifting" class="sect">&sect;2.3</a>)
+ and <strong>lowering</strong> (role to base) (<a href="#s2.2" title="&sect;2.2&nbsp;Lowering" class="sect">&sect;2.2</a>).
+ </div>
+ <div class="line"></div>
+ <div class="term">Translation polymorphism</div>
+ <div class="termdesc">Conformance between a role and a base is governed by <strong>translation polymorphism</strong>,
+ which refers to a substitutability that is achieved using either lifting or lowering.
+ </div>
+ <div class="line"></div>
+ <div class="term">Declared lifting</div>
+ <div class="termdesc">Generally, lifting happens implicitly at data flows between
+ a role object and its base. Team level methods provide additional
+ data flows, where lifting may be declared explicitly.
+ </div>
+ <div class="line"></div>
+ </div>
+ <div class="sect depth2" id="s2.1">
+ <h2 class="sect">&sect;2.1&nbsp;playedBy relation<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;2</a></span></h2>
+ <div class="syntaxlink"><a href="sA.html#sA.1.1" title="&sect;A.1.1&nbsp;ClassDeclaration"
+ class="syntax">&rarr;&nbsp;Syntax&nbsp;&sect;A.1.1</a></div>
+ <div class="subsect depth3" id="s2.1.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Role-base binding</span></h4>
+ <p>Roles are bound to a base class by the <code>playedBy</code> keyword.
+
+ </p>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> MyTeamA {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>public</b> <b>class</b> MyRole <em><b>playedBy</b> MyBase</em> {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> ...</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ <div class="subsect depth3" id="s2.1.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Inheritance</span></h4>
+ <p>The <code>playedBy</code> relation is inherited along
+ explicit and implicit (<a href="s1.3.1.c.html"
+ title="&sect;1.3.1.(c)&nbsp;Overriding and implicit inheritance"
+ class="sect">&sect;1.3.1.(c)</a>)
+ role inheritance.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s2.1.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Covariant refinement</span></h4>
+ <p>An <em>explicit</em> sub-role (sub-class using <code>extends</code>)
+ can refine the <code>playedBy</code> relation to a more
+ specific base class (this is the basis for
+ <a href="#s2.3.3" title="&sect;2.3.3&nbsp;Smart lifting" class="sect">smart lifting (&sect;2.3.3)</a>).<br />
+ If a role class inherits several <code>playedBy</code> relations from
+ its super-class and its super-interfaces, there must be a most specific
+ base-class among these relations, which is conform to all other base-classes.
+ This most specific base-class is the base-class of the current role.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s2.1.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">No-variance</span></h4>
+ <p>An <em>implicit</em> sub-role (according to <a href="s1.3.1.c.html"
+ title="&sect;1.3.1.(c)&nbsp;Overriding and implicit inheritance"
+ class="sect">&sect;1.3.1.(c)</a>)
+ may only add a <code>playedBy</code> relation but never change an existing one.<br />
+ Note however, that implicit inheritance may implicitly specialize an existing <code>playedBy</code>
+ relation (this advanced situation is illustrated in <a href="#s2.7.d" title="&sect;2.7.(d)&nbsp;Implicit playedBy specialization"
+ class="sect">&sect;2.7.(d)</a>).
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s2.1.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Use of playedBy bindings</span></h4>
+ <p>The <code>playedBy</code> relation by itself has no effect
+ on the behavior of role and base objects.
+ It is, however, the precondition for translation polymorphism
+ (lowering: <a href="#s2.2" title="&sect;2.2&nbsp;Lowering" class="sect">&sect;2.2</a> and lifting: <a href="#s2.3" title="&sect;2.3&nbsp;Lifting" class="sect">&sect;2.3</a>)
+ and for method bindings (callout: <a href="s3.html" title="&sect;3&nbsp;Callout Binding" class="sect">&sect;3</a> and callin: <a href="s4.html" title="&sect;4&nbsp;Callin Binding" class="sect">&sect;4</a>).
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s2.1.f">
+ <h4 class="subsect">(f)&nbsp;<span class="title">Effect on garbage collection</span></h4>
+ <p>A role and its base object form one conceptual entity. The garbage collector will see a role
+ and its base object as linked in a bidirectional manner. As a result, a role cannot be
+ garbage collected if its base is still reachable and vice versa.
+ <br />
+ Internally a team manages its roles and corresponding bases using weak references.
+ When using one of the <code>getAllRoles(..)</code>
+ methods (see <a href="s6.1.a.html"
+ title="&sect;6.1.(a)&nbsp;Interface to the role registry"
+ class="sect">&sect;6.1.(a)</a>),
+ the result may be non-deterministic because these internal structures
+ may hold weak references to objects that will be collected by the next run of the
+ garbage collector. We advise clients of <code>getAllRoles(..)</code> to call
+ <code>System.gc()</code> prior to calling <code>getAllRoles(..)</code> in order
+ to ensure deterministic results.
+
+ </p>
+ </div>
+ <div class="sect depth3" id="s2.1.1">
+ <h3 class="sect">&sect;2.1.1&nbsp;Binding interfaces<span class="toplink"><a href="#s2.1">&uarr;&nbsp;&sect;2.1</a></span></h3>
+ <p>Role base bindings may involve classes and/or interfaces.
+ An interface defined as a member of a team is a role interface and may therefore
+ have a <code>playedBy</code> clause. Also the type mentioned after the
+ <code>playedBy</code> keyword may be an interface.
+
+ </p>
+ <div class="note">
+ <h5>Implementation limitation:</h5>
+ The language implementation as of OTDT version 1.0.<i>X</i> cannot yet bind
+ a role class to a base interface, but this restriction will go in the future.
+
+ </div>
+ </div>
+ <div class="sect depth3" id="s2.1.2">
+ <h3 class="sect">&sect;2.1.2&nbsp;Legal base classes<span class="toplink"><a href="#s2.1">&uarr;&nbsp;&sect;2.1</a></span></h3>
+ <p>Generally, the base class mentioned after <code>playedBy</code> must be
+ visible in the enclosing scope (see <a href="#s2.1.2.c" title="&sect;2.1.2.(c)&nbsp;Base class decapsulation"
+ class="sect">below (&sect;2.1.2.(c))</a> for an exception).
+ Normally, this scope is defined just by the imports of the enclosing team.
+ For role files (<a href="s1.2.5.b.html" title="&sect;1.2.5.(b)&nbsp;Role files" class="sect">&sect;1.2.5.(b)</a>)
+ also additional imports in the role file are considered.
+ <br /><a href="#s2.1.2.d" title="&sect;2.1.2.(d)&nbsp;Base imports" class="sect">&sect;2.1.2.(d)</a> below defines how imports can be constrained so that certain types
+ can be used as base types, only.
+
+ </p>
+ <div class="subsect depth4" id="s2.1.2.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">No role of the same team</span></h4>
+ <p>The base class of any role class must not be a role of the same team.
+ <br />
+ It is also not allowed to declare a role class of the same name
+ as a base class bound to this or another role of the enclosing team,
+ if that base class is given with its simple name and resolved using a regular import.
+ Put differently, a base class mentioned after <code>playedBy</code>
+ may not be <em>shadowed</em> by any role class of the enclosing team.
+ <br /><em>Base imports</em> as defined below (<a href="#s2.1.2.d" title="&sect;2.1.2.(d)&nbsp;Base imports" class="sect">&sect;2.1.2.(d)</a>) relax this rule by
+ allowing to import a class as a base class only. In that case no shadowing occurs since the scopes for
+ base classes and roles are disjoint.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s2.1.2.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">No cycles</span></h4>
+ <p>The base class mentioned after <code>playedBy</code> may not be
+ an enclosing type (at any depth) of the role class being defined.
+ <br />
+ This rule prohibits the creation of cycles where the base instance of
+ a given role <code>R</code> contains roles of the same type <code>R</code>.
+ <br />
+ More generally any sequence of classes <code>C<sub>1</sub>, C<sub>2</sub>, .. C<sub>n</sub></code>
+ were each <code>C<sub>i+1</sub></code> is either a member or the base class of
+ <code>C<sub>i</sub></code> and <code>C<sub>n</sub> = C<sub>1</sub></code> is forbidden.
+ <br />
+ Conversely, it is also prohibited to bind a role class to its own inner class.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s2.1.2.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Base class decapsulation</span></h4>
+ <p>If a base class referenced after <code>playedBy</code> exists but is not visible under normal visibility rules of Java,
+ this restriction may be overridden. This concept is called <strong>decapsulation</strong>, i.e., the opposite of encapsulation
+ (see also <a href="s3.4.html" title="&sect;3.4&nbsp;Overriding access restrictions"
+ class="sect">&sect;3.4</a>). A compiler should signal any occurrence of base class decapsulation. If a compiler supports to
+ configure warnings this may be used to let the user choose to (a) ignore base class decapsulation, (b) treat it as a warning
+ or even
+ (c) treat it as an error.
+
+ </p>
+ <p>
+ Binding to a <code>final</code> base class is also considered as decapsulation, since a <code>playedBy</code> relationship has
+ powers similar to an <code>extends</code> relationship, which is prohibited by marking a class as <code>final</code>.
+
+ </p>
+ <p>
+ Decapsulation is not allowed if the base class is a confined role (see <a href="s7.2.html" title="&sect;7.2&nbsp;Confined roles" class="sect">&sect;7.2</a>).
+
+ </p>
+ <p>
+ Within the current role a decapsulated base class can be mentioned in the right-hand-side of any method binding
+ (<a href="s3.html" title="&sect;3&nbsp;Callout Binding" class="sect">callout (&sect;3)</a> or <a href="s4.html" title="&sect;4&nbsp;Callin Binding" class="sect">callin (&sect;4)</a>). Also arguments in these positions are allowed to mention the decapsulated base class:
+
+ </p>
+ <ul>
+ <li>the first argument of one of the role's constructors (see <a href="#s2.4.1"
+ title="&sect;2.4.1&nbsp;Role creation via a lifting constructor"
+ class="sect">lifting constructor (&sect;2.4.1)</a>).
+ </li>
+ <li>the base side of an argument with declared lifting (see <a href="#s2.3.2" title="&sect;2.3.2&nbsp;Declared lifting" class="sect">declared lifting (&sect;2.3.2)</a>).
+ </li>
+ </ul>
+ </div>
+ <div class="subsect depth4" id="s2.1.2.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Base imports</span></h4>
+ <p>If the main type in a file denotes a team, the modifier <code>base</code> can be applied to an import in order to specify that this type
+ should be imported for application as a base type only. Example:
+
+ </p>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><em><b>import</b> base</em> some.pack.MyBase;</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> MyTeam {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <span class="comment">// simple name resolves to imported class:</span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <b>protected</b> <b>class</b> MyRole <em><b>playedBy</b> MyBase</em> { } </pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> <span class="error"><em>MyBase</em> illegalDeclaration;</span> <span class="comment">// base import does not apply for this position</span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <p>Types imported by a base import can only be used in the same positions where also base class decapsulation (<a href="#s2.1.2.c" title="&sect;2.1.2.(c)&nbsp;Base class decapsulation"
+ class="sect">&sect;2.1.2.(c)</a>)
+ is applicable.<br />
+ It is recommended that a type mentioned after the keyword <code>playedBy</code> is always imported with the <code>base</code> modifier, otherwise the compiler
+ will give a warning.<br />
+ Base imports create a scope that is disjoint from the normal scope. Thus, names that are imported as base will never clash
+ with normally visible names
+ (in contrast to <a href="s1.4.html" title="&sect;1.4&nbsp;Name clashes" class="sect">&sect;1.4</a>). More specifically, it is not a problem to use a base class's name also for its role if a base import is used.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s2.1.2.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">No free type parameters</span></h4>
+ <p>
+ Neither the role class nor the base class in a playedBy binding must have any <em>free type parameters</em>.
+ If both classes are specified with a type parameter of the same name, both parameters are identified
+ and are not considered as <em>free</em>.
+
+ </p>
+ <p>
+ From this follows that a role class cannot have more type parameters than its base.
+ Conversely, only one situation exists where a base class can have more type parameters than a role class
+ bound to it: if the role class has no type parameters a generic base class can be bound using
+ the base class's raw type, i.e., without specifying type arguments.
+
+ </p>
+ <div class="note">
+ <h5>Note:</h5>
+ The information from the <code>playedBy</code> declaration is used at run-time
+ to associate role instances to base instances.
+ Specifying a base class with free type parameters would imply that only such base instances
+ are decorated by a role whose type is conform to the specified parameterized class.
+ However, type arguments are not available at run-time, thus the run-time environment
+ is not able to decide which base instances should have a role and which should not.
+ This is due to the design of generics in Java which are realized by erasure.
+
+ </div>
+ <p>The following example shows how generics can be used in various positions. Note, that some of the concepts used in the example
+ will be explained in later sections.
+ </p>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>class</b> ValueTrafo<em>&lt;T&gt;</em> {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>public</b> <em>T</em> transform(<em>T</em> val) throws Exception { /* ... */ }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre>}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> TransformTeam {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> <b>protected</b> <b>class</b> SafeTrafo<em>&lt;U&gt;</em> <b>playedBy</b> ValueTrafo<em>&lt;U&gt;</em> {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> <em>U</em> transform(<em>U</em> v) <b>-&gt;</b> <em>U</em> transform(<em>U</em> val); </pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> <b>protected</b> <em>U</em> safeTransform(<em>U</em> v) {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre> <b>try</b> {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre> <b>return</b> transform(v);</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">10</td>
+ <td><pre> } <b>catch</b> (Exception e) {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">11</td>
+ <td><pre> <b>return</b> v;</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">12</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">13</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">14</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">15</td>
+ <td><pre> <em>&lt;V&gt; V</em> perform(ValueTrafo<em>&lt;V&gt;</em> <b>as</b> SafeTrafo<em>&lt;V&gt;</em> trafo, <em>V</em> value) {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">16</td>
+ <td><pre> <b>return</b> trafo.safeTransform(value);</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">17</td>
+ <td><pre> } </pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">18</td>
+ <td><pre>}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">19</td>
+ <td><pre>...</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">20</td>
+ <td><pre>ValueTrafo<em>&lt;String&gt;</em> trafo = <b>new</b> ValueTrafo<em>&lt;String&gt;</em>();</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">21</td>
+ <td><pre>TransformTeam safeTrafo = <b>new</b> TransformTeam();</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">22</td>
+ <td><pre>String s = safeTrafo.perform(trafo, "Testing");</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">23</td>
+ <td><pre></pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="codecomment">
+ <h5>Explanation</h5>
+ <ul>
+ <li>Line 5 shows a role with type parameter <code>U</code> where the type parameter is identified with the
+ corresponding type parameter of the role's base class (which is originally declared as <code>T</code> in line 1.
+ </li>
+ <li>Line 6 shows a callout binding (<a href="s3.html" title="&sect;3&nbsp;Callout Binding" class="sect">&sect;3</a>) which mappes a base method to a corresponding role method
+ while maintaining the flexible typing.
+ </li>
+ <li>The regular method in lines 7-13 just passes values of type <code>U</code> around.
+ </li>
+ <li>The generic method in line 15 ff. uses declared lifting (<a href="#s2.3.2" title="&sect;2.3.2&nbsp;Declared lifting" class="sect">&sect;2.3.2</a>) to obtain a role for a given base object.
+ The method has no knowledge about the concrete type arguments of either role nor base, but works under the guarantee
+ that both type arguments will be the same for any single invocation.
+ </li>
+ <li>Lines 20 ff. finally create instances of base and team and invoke the behavior thereby instantiating type parameters to <code>String</code>.
+ </li>
+ </ul>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="sect depth2" id="s2.2">
+ <h2 class="sect">&sect;2.2&nbsp;Lowering<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;2</a></span></h2>
+ <p>Each instance of a bound role class internally stores a reference to its
+ base object. The reference is guaranteed to exist for each bound role
+ instance, and cannot be changed during its lifetime.
+
+ </p>
+ <div class="subsect depth3" id="s2.2.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Definition of lowering</span></h4>
+ <p>Retrieving the base object from a role object is called <strong>lowering</strong>.
+ No other means exists for accessing the base reference.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s2.2.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Places of lowering</span></h4>
+ <p>The lowering translation is not meant to be invoked
+ by client code, but <strong>implicit translations</strong> are inserted by
+ the compiler at all places where a role type is provided while the
+ corresponding base type (or a super type) was expected.<br />
+ In other words: lowering translations are inserted by the compiler at
+ all places in a program which would otherwise not be type correct
+ and which using lowering are statically type correct.
+ This may concern:
+
+ </p>
+ <ul>
+ <li>the right hand side of an assignment wrt. the static type of the left hand side,</li>
+ <li>the argument values of a method or constructor call wrt. the static type of the corresponding formal parameter,</li>
+ <li>the return value of a method compared to the declared return type of the method.</li>
+ <li>a role parameter in a callout binding (<a href="s3.3.d.html" title="&sect;3.3.(d)&nbsp;Typing rules" class="sect">&sect;3.3.(d)</a>)
+ </li>
+ <li>or the return value in a callin binding (<a href="s4.5.d.html" title="&sect;4.5.(d)&nbsp;Typing rules" class="sect">&sect;4.5.(d)</a>)
+ </li>
+ </ul>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> MyTeamA {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>public</b> <b>class</b> <em>MyRole <b>playedBy</b> MyBase</em> { ... }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>void</b> useMyBase(<em>MyBase</em> myb) {...}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <em>MyRole</em> returnMyRole() {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> <b>public</b> <b>void</b> doSomething() {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> <em>MyRole r</em> = <b>new</b> MyRole(<b>new</b> MyBase());</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> <em>MyBase b</em> = <em>r</em>;</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre> useMyBase(<em>r</em>);</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre> <em>MyBase b2</em> = returnMyRole();</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">10</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">11</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="codecomment">
+ <h5>Effects:</h5>
+ <p>An instance of type <code>MyRole</code> is lowered to type <code>MyBase</code> when
+ </p>
+ <ul>
+ <li>assigning it to <code>b</code> (line 7)
+ </li>
+ <li>passing it as argument to a method with formal parameter of type <code>MyBase</code> (line 8)
+ </li>
+ <li>assigning the return value to a variable of type <code>MyBase</code> (line 9)
+ </li>
+ </ul>
+ <p><em>Note</em>: The constructor call in line 6 uses the <em>lifting constructor</em> as defined in <a href="#s2.4.1"
+ title="&sect;2.4.1&nbsp;Role creation via a lifting constructor"
+ class="sect">&sect;2.4.1</a></p>
+ </div>
+ <p>Lowering translations are <span class="underline">not</span> inserted for
+
+ </p>
+ <ul>
+ <li>reference comparison (using <code>==</code> or <code>!=</code>)
+ </li>
+ <li><code>instanceof</code> checks
+ </li>
+ <li>cast expressions</li>
+ <li>return values in callout bindings <a href="s3.3.d.html" title="&sect;3.3.(d)&nbsp;Typing rules" class="sect">&sect;3.3.(d)</a>)
+ </li>
+ <li>parameters in callin bindings (<a href="s4.5.d.html" title="&sect;4.5.(d)&nbsp;Typing rules" class="sect">&sect;4.5.(d)</a>)
+ </li>
+ </ul>
+ <p>For cases where lowering shall be <em>forced</em> see <a href="#s2.2.d" title="&sect;2.2.(d)&nbsp;Explicit lowering" class="sect">&sect;2.2.(d)</a> below.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s2.2.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Typing</span></h4>
+ <p>The static type of an implicit lowering translation is the base class
+ declared using <code>playedBy</code> in the respective role class.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s2.2.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Explicit lowering</span></h4>
+ <p>If a base type is also the super type of its role,
+ which frequently happens, if a base reference is known only by
+ the type <code>Object</code>, lowering cannot be deduced automatically,
+ since a type could be interpreted both as a role type and a base type.
+ These cases may need <strong>explicit lowering</strong>.
+ For this purpose the role class must declare to implement the interface
+ <strong><code>ILowerable</code></strong> (from <code>org.objectteams.ITeam</code>).
+ This will cause the compiler to generate a method
+ </p>
+ <div class="listing plain"><pre><b>public</b> Object lower()</pre></div>
+ <p>for the given role class. Client code may use this method to
+ explicitly request the base object of a given role object.
+ </p>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> MyTeamA {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>public</b> <b>class</b> MyRole <em><b>implements</b> ILowerable</em> <b>playedBy</b> MyBase { ... }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>public</b> <b>void</b> doSomething() {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> MyRole r = <b>new</b> MyRole(<b>new</b> MyBase());</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> Object oMyRole = r;</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> Object oMyBase = r.<em>lower()</em>;</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ <div class="subsect depth3" id="s2.2.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Lowering of arrays</span></h4>
+ <p>Lowering also works for arrays of role objects.
+ In order to lower an array of role objects,
+ a new array is created and filled with base objects, one for each
+ role object in the original array. The array may have any number
+ of dimensions at any shape. The lowered array will have exactly the
+ same shape.<br />
+ Note, that each lowering translation will create a new array.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s2.2.f">
+ <h4 class="subsect">(f)&nbsp;<span class="title">Ambiguous lowering</span></h4>
+ <p>When assigning a value of a bound role type to a variable or argument of type <code>java.lang.Object</code>
+ this situation is considered as ambiguous lowering because the assignment could apply either (a) a direct upcast to <code>Object</code>
+ or (b) lowering and then upcasting.
+ In such situations the compiler will <em>not</em> insert a lowering translation, but a configurable warning will be issued.
+
+ </p>
+ </div>
+ </div>
+ <div class="sect depth2" id="s2.3">
+ <h2 class="sect">&sect;2.3&nbsp;Lifting<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;2</a></span></h2>
+ <p>Lifting is the reverse translation of lowering. However, lifting is
+ a bit more demanding, since a given base object may have zero to
+ many role objects bound to it. Therefor, the lifting translation
+ requires more context information and may require to create role
+ objects on demand.
+
+ </p>
+ <div class="subsect depth3" id="s2.3.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Definition of lifting</span></h4>
+ <p>Retrieving a role for a given base object is called <strong>lifting</strong>.
+ Lifting is guaranteed to yield the same role object for subsequent
+ calls regarding the same base object, the same team instance and
+ the same role class (see <a href="#s2.3.4" title="&sect;2.3.4&nbsp;Binding ambiguities" class="sect">&sect;2.3.4</a>
+ for cases of ambiguity that are signaled by compiler warnings
+ and possibly runtime exceptions).
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s2.3.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Places of lifting</span></h4>
+ <p>The lifting translation is not meant to be invoked
+ by client code, but translations are inserted by the compiler
+ at the following locations:
+
+ </p>
+ <ul>
+ <li><a href="s3.3.c.html" title="&sect;3.3.(c)&nbsp;Result translation"
+ class="sect">Callout bindings (&sect;3.3.(c))</a> (result)
+ </li>
+ <li><a href="s4.5.a.html" title="&sect;4.5.(a)&nbsp;Call target translation"
+ class="sect">Callin bindings (&sect;4.5.(a))</a> (call target and parameters)
+ </li>
+ <li><a href="#s2.3.2" title="&sect;2.3.2&nbsp;Declared lifting" class="sect">Declared lifting (&sect;2.3.2)</a></li>
+ </ul>
+ </div>
+ <div class="subsect depth3" id="s2.3.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Typing</span></h4>
+ <p>A lifting translation statically expects a specific role class.
+ This expected role class must have a <code>playedBy</code> clause
+ (either directly, or inherited (explicitly or implicitly)
+ from a super role), to which the given base type is conform.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s2.3.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Lifting of arrays</span></h4>
+ <p>Lifting also works for arrays of role objects.
+ For lifting an array of base objects
+ a new array is created and filled with role objects, one for each
+ base object in the original array. In contrast to the role objects
+ themselves, lifted arrays are never reused for subsequent lifting
+ invocations.
+
+ </p>
+ </div>
+ <p id="s2.3.transpol">The term <strong>translation polymorphism</strong>
+ describes the fact that at certain points values can be passed which are not
+ conform to the respective declared type considering only regular
+ inheritance (<code>extends</code>). With translation polymorphism
+ it suffices that a value can be translated using lifting or lowering.
+
+ </p>
+ <div class="sect depth3" id="s2.3.1">
+ <h3 class="sect">&sect;2.3.1&nbsp;Implicit role creation<span class="toplink"><a href="#s2.3">&uarr;&nbsp;&sect;2.3</a></span></h3>
+ <p>Lifting tries to reuse existing role objects so that role state persists across
+ lifting and lowering. If no suitable role instance is found during lifting,
+ a new role is created.
+
+ </p>
+ <div class="subsect depth4" id="s2.3.1.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Reuse of existing role objects</span></h4>
+ <p>A role object is considered suitable for reuse during lifting, if
+ these three items are identical:
+
+ </p>
+ <ol>
+ <li>the given base object</li>
+ <li>the given team object</li>
+ <li>the statically required role type</li>
+ </ol>
+ <p>For the relation between the statically required role type and
+ the actual type of the role object see <a href="#s2.3.3" title="&sect;2.3.3&nbsp;Smart lifting" class="sect">"smart lifting" (&sect;2.3.3)</a>.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s2.3.1.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Default lifting constructor</span></h4>
+ <p>Lifting uses a default constructor which takes exactly one argument of the type
+ of the declared base class (after <code>playedBy</code>).
+ By default the compiler generates such a constructor for each bound role.
+ On the other hand, default constructors that take no arguments
+ (as in <a href="http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#16823"
+ class="ext">JLS &sect;8.8.7</a>) are never generated for bound roles.
+ <br />
+ The super-constructor to be invoked by a default lifting constructor
+ depends on whether the role's super class is a bound role or not.
+
+ </p>
+ <ul>
+ <li>If the super-class is a bound role, the default lifting constructor will invoke the default lifting constructor of the super-class.</li>
+ <li>If the super-class is not a bound role, the default lifting constructor will invoke the normal argumentless default constructor
+ of the super-class.
+ </li>
+ </ul>
+ </div>
+ <div class="subsect depth4" id="s2.3.1.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Custom lifting constructor</span></h4>
+ <p>If a role class declares a custom constructor with the same signature
+ as the default lifting constructor, this constructor is used during lifting.
+ This custom constructor may pre-assume that the role has been setup
+ properly regarding its base-link and registered in the team's internal map of roles.
+ <br />
+ If a bound role has an unbound super-class without an argumentless
+ constructor, providing a custom lifting constructor is obligatory,
+ because no legal default lifting constructor can be generated.
+
+ </p>
+ </div>
+ </div>
+ <div class="sect depth3" id="s2.3.2">
+ <h3 class="sect">&sect;2.3.2&nbsp;Declared lifting<span class="toplink"><a href="#s2.3">&uarr;&nbsp;&sect;2.3</a></span></h3>
+ <div class="syntaxlink"><a href="sA.html#sA.6.2" title="&sect;A.6.2&nbsp;LiftingType" class="syntax">&rarr;&nbsp;Syntax&nbsp;&sect;A.6.2</a></div>
+ <div class="subsect depth4" id="s2.3.2.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Parameters with declared lifting</span></h4>
+ <p>A non-static team-level method or constructor may declare a parameter with two types
+ in order to explicitly denote a place of <strong>lifting</strong>. Using the syntax
+
+ </p>
+ <div class="listing plain"><pre><b>public</b> <b>void</b> m (BaseClass <em>as</em> RoleClass param) { <i>stmts</i> }</pre></div>
+ <p>a liftable parameter can be declared, provided the second type
+ (<code>RoleClass</code>) is a role of (<code>playedBy</code>) the first type (<code>BaseClass</code>).
+ Furthermore, the role type must be a role of the enclosing team class defining the given method.
+ The role type must be given by its simple (i.e., unqualified) name.
+ <br />
+ Such a signature requires the caller to provide a base object (here <code>BaseClass</code>), but
+ the callee receives a role object (here <code>RoleClass</code>).
+ In fact, the client sees a signature in which the "<code>as RoleClass</code>" part is omitted.
+ <br />
+ Compatibility between caller and callee sides is achieved by an implicitly inserted lifting translation.
+ A signature using declared lifting is only valid, if the requested lifting is possible
+ (see <a href="#s2.3.3" title="&sect;2.3.3&nbsp;Smart lifting" class="sect">&sect;2.3.3</a> and <a href="#s2.3.4" title="&sect;2.3.4&nbsp;Binding ambiguities" class="sect">&sect;2.3.4</a> for details).
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s2.3.2.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Super in the context of declared lifting</span></h4>
+ <p>Calling <code>super</code> or <code>tsuper</code> in a method or constructor which
+ declares lifting for one or more parameters refers to a method or constructor with role type parameters,
+ i.e., lifting takes place <em>before</em> super invocation. Nevertheless, the super method may also
+ have a declared lifting signature. It will then see the same role instance(s) as the current method.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s2.3.2.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Declared lifting of arrays</span></h4>
+ <p>If a parameter involving explicit lifting should be of an <strong>array</strong> type, the syntax is
+
+ </p>
+ <div class="listing plain"><pre><b>public</b> <b>void</b> m (BaseClass <b>as</b> RoleClass param[]) ...</pre></div>
+ <p>Here the brackets denoting the array apply to both types, <code>BaseClass</code>
+ and <code>RoleClass</code>.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s2.3.2.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Declared lifting for catch blocks</span></h4>
+ <p>Also the argument of a catch block may apply declared lifting like in:
+
+ </p>
+ <div class="listing plain"><pre><b>catch</b> (BaseException <b>as</b> RoleClass param) { <i>stmts</i> }</pre></div>
+ <p>This syntax is only valid in a non-static scope of a team (directly or nested).
+ In the given example, <code>RoleClass</code> must be played by <code>BaseException</code>.
+ Note, that <code>RoleClass</code> itself need not be a throwable.
+ As the effect of this declaration the catch block will catch any exception of type <code>BaseException</code>
+ and provides it wrapped with a <code>RoleClass</code> instance to the subsequent block.
+ <br />
+ Also note, that re-throwing the given instance <code>param</code> has the semantics of implicitly lowering
+ the role to its base exception before throwing, because the role conforms to the required type
+ <code>Throwable</code> only via lowering.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s2.3.2.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Generic declared lifting</span></h4>
+ <p>A method with declared lifting may introduce a type parameter that is bounded relative to a given role type.
+ Such bound is declared as:
+
+ </p>
+ <div class="listing plain"><pre>&lt;AnyBase <b>base</b> SuperRole&gt;
+<b>void</b> teamMethod(AnyBase <b>as</b> SuperRole arg) {
+ <span class="comment">// body using arg as of type SuperRole</span>
+}</pre></div>
+ <p>This means that <code>AnyBase</code> is a type parameter whose instantiations must all be liftable to role <code>SuperRole</code>.
+
+ </p>
+ <p>
+ The given type bound requires the call site to supply an argument that is compatible to any base class
+ for which the current team contains a bound role that is a sub class of <code>SuperRole</code>, including <code>SuperRole</code> itself.
+ However, <code>SuperRole</code> itself need not be bound to any base class.
+ On the other hand, different valid substitutions for <code>AnyBase</code> need not be related by inheritance.
+
+ </p>
+ <div class="note">
+ <h5>Note:</h5>
+ This feature supports generalized treatment of otherwise unrelated base classes.
+ This is done by defining one bound role for each base under consideration and by
+ having all these roles extend a common unbound role.
+
+ </div>
+ </div>
+ <h5 class="listing">Example code (Declared Lifting):</h5>
+ <div class="listing example frame" id="l2.3.2">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>team</b> <b>class</b> Super {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>public</b> <b>class</b> MyRole <b>playedBy</b> MyBase { ... }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>void</b> m (MyRole o) { ... };</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre>}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre><b>team</b> <b>class</b> Sub <b>extends</b> Super {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> <b>void</b> m (<em>MyBase <b>as</b> MyRole o</em>) {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> <span class="comment">// inside this method o is of type MyRole</span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre> super.m(o);</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">10</td>
+ <td><pre>}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">11</td>
+ <td><pre>Sub s_<b>team</b> = <b>new</b> Sub();</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">12</td>
+ <td><pre>MyBase b = <b>new</b> MyBase();</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">13</td>
+ <td><pre>s_team.m(b); <span class="comment">// clients see a parameter "MyBase o"</span></pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="codecomment">
+ <h5>Effects:</h5>
+ <ul>
+ <li>Clients use method <code>m</code> with a base instance (type <code>MyBase</code>) as its argument (line 13).
+ </li>
+ <li>Before executing the body of <code>m</code>, the argument is lifted such that the method body receives
+ the argument as of type <code>MyRole</code> (line 8).
+ </li>
+ </ul>
+ </div>
+ </div>
+ <div class="sect depth3" id="s2.3.3">
+ <h3 class="sect">&sect;2.3.3&nbsp;Smart lifting<span class="toplink"><a href="#s2.3">&uarr;&nbsp;&sect;2.3</a></span></h3>
+ <p>In situations where role and base classes are part of some inheritance
+ hierarchies (<code>extends</code>), choosing the appropriate role class during
+ lifting involves the following rules:
+
+ </p>
+ <div class="subsect depth4" id="s2.3.3.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Static adjustment</span></h4>
+ <p>If a base class <code>B</code> shall be lifted to a role class
+ <code>R</code> that is not bound to (<code>playedBy</code>)
+ <code>B</code>, but if a subclass of <code>R</code>
+ &mdash; say <code>R2</code> &mdash;
+ is bound to <code>B</code>, lifting is statically setup to use
+ <code>R2</code>, the most general subclass of <code>R</code> that
+ is bound to <code>B</code> or one of its super-types.
+
+ </p>
+ <div class="note">
+ <h5>Restriction:</h5>
+ This step is not applicable for parameter mappings of <code>replace</code>
+ callin bindings (<a href="s4.5.d.html" title="&sect;4.5.(d)&nbsp;Typing rules" class="sect">&sect;4.5.(d)</a>).
+
+ </div>
+ </div>
+ <div class="subsect depth4" id="s2.3.3.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Dynamic selection of a role class</span></h4>
+ <p>At runtime also the dynamic type of a base object is considered:
+ Lifting always tries to use a role class that is bound to the
+ exact class of the base object. Lifting considers all role&ndash;base
+ pairs bound by <code>playedBy</code> such that the role class is a
+ sub-class of the required (statically declared) role type
+ and the base class is a super-class of the
+ dynamic type of the base object.
+ <br />
+ From those possible pairs the most specific base class is chosen.
+ If multiple role classes are bound to this base class the most
+ specific of these classes is chosen.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s2.3.3.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Team as closed world</span></h4>
+ <p>In the above analysis gathering all role-base pairs is performed at
+ compile-time. From this follows, that a team class can only be
+ compiled when all its contained role classes are known and a role class
+ can never be compiled without its team.
+ <br />
+ The analysis includes all roles and their bindings that are inherited
+ from the super-team.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s2.3.3.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Selection regardless of abstractness</span></h4>
+ <p>Smart lifting is not affected by abstractness of role classes.
+ For the effect of abstract role classes see <a href="#s2.5" title="&sect;2.5&nbsp;Abstract Roles" class="sect">&sect;2.5</a>.
+
+ </p>
+ </div>
+ <h5>Complex Example:</h5>
+ <p><img src="../images/smart_lifting_small.png" alt="smart lifting example" /></p>
+ <table border="2" width="80%">
+ <colgroup span="1">
+ <col align="left" span="1" />
+ <col align="left" span="1" />
+ </colgroup>
+ <tr>
+ <th rowspan="1" colspan="1">role class</th>
+ <th rowspan="1" colspan="1">base class</th>
+ </tr>
+ <tr>
+ <td rowspan="1" colspan="1">class R1</td>
+ <td rowspan="1" colspan="1">&nbsp;</td>
+ </tr>
+ <tr>
+ <td rowspan="1" colspan="1">class R2 extends R1 playedBy B2</td>
+ <td rowspan="1" colspan="1">class B2</td>
+ </tr>
+ <tr>
+ <td rowspan="1" colspan="1">class R3 extends R2 <em>/* inherited: playedBy B2 */ </em></td>
+ <td rowspan="1" colspan="1">class B3 extends B2</td>
+ </tr>
+ <tr>
+ <td rowspan="1" colspan="1">class R4 extends R3 playedBy B4</td>
+ <td rowspan="1" colspan="1">class B4 extends B3</td>
+ </tr>
+ <tr>
+ <td rowspan="1" colspan="1">class R5 extends R4 <em>/* inherited: playedBy B4 */</em></td>
+ <td rowspan="1" colspan="1">&nbsp;</td>
+ </tr>
+ <tr>
+ <td rowspan="1" colspan="1">&nbsp;</td>
+ <td rowspan="1" colspan="1">class B6 extends B4</td>
+ </tr>
+ <tr>
+ <td rowspan="1" colspan="1">class R7 extends R5 playedBy B7</td>
+ <td rowspan="1" colspan="1">class B7 extends B6</td>
+ </tr>
+ </table>
+ <div class="codecomment">
+ <ul>
+ <li>If declarations require lifting <code>B3</code> to <code>R1</code>
+ this is statically refined to use <code>R2</code> instead, because this
+ is the most general class declaring a binding to a super&ndash;class
+ of <code>B3</code>.
+
+ </li>
+ <li>If the dynamic base type in the same situation is <code>B6</code>,
+ three steps select the appropriate role:
+
+ <ol>
+ <li>By searching all <code>playedBy</code> clauses (including those
+ that are inherited) the following role&ndash;base pairs are
+ candidates:<br /><code>(R2,B2), (R3,B2), (R4,B4)</code> and <code>(R5,B4)</code>.
+ </li>
+ <li>From these pairs the two containing the most specific base class
+ <code>B4</code> are chosen.
+ </li>
+ <li>This makes <code>R4</code> and <code>R5</code> role candidates,
+ from which the most specific <code>R5</code> is finally chosen.
+ </li>
+ </ol>
+ </li>
+ </ul>
+ </div>
+ <p>If the inheritance hierarchies of the involved base and role classes are given (like in the figure above)
+ the smart lifting algorithm can be rephrased to the following "graphical" rule:<br /></p>
+ <div class="note">
+ Starting with the dynamic base type (<code>B6</code> in the example) move upwards the the inheritance
+ relation until you reach a base class bound to a role class indicated by a &laquo;playedBy&raquo;
+ arrow pointing to the base class (<code>B4</code>). This role class must be conform to the requested role type.
+ Switch to the role side along this arrow (<code>R4</code>). Now move downwards the role inheritance hierarchy
+ as long as the subrole does not refine the playedBy relationship (indicated by another &laquo;playedBy&raquo; arrow).
+ The bottom role you reach this way (<code>R5</code>) is the role type selected by smart lifting.
+
+ </div>
+ </div>
+ <div class="sect depth3" id="s2.3.4">
+ <h3 class="sect">&sect;2.3.4&nbsp;Binding ambiguities<span class="toplink"><a href="#s2.3">&uarr;&nbsp;&sect;2.3</a></span></h3>
+ <p>While all examples so far have only shown 1-to-1 class bindings,
+ several cases of multiple bindings are allowable. Ambiguities may be
+ detected at compile time and/or at runtime.
+
+ </p>
+ <div class="subsect depth4" id="s2.3.4.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Potential ambiguity</span></h4>
+ <p>A <strong>potential ambiguity</strong> is given,
+ if two role classes <code>R1</code> and <code>R2</code>
+ exist such that
+
+ </p>
+ <ul>
+ <li><code>R1</code> and <code>R2</code> are played by the
+ same base class <code>B</code>, and
+ </li>
+ <li><code>R1</code> and <code>R2</code> have a common
+ super role <code>R0</code>,
+ which is also bound to a base class <code>B0</code>, and
+ </li>
+ <li>neither role class <code>R1</code> nor
+ <code>R2</code> is a (indirect) sub-class of the other.
+ </li>
+ </ul>
+ <div class="note">
+ <h5>Note:</h5>
+ According to <a href="#s2.1.c" title="&sect;2.1.(c)&nbsp;Covariant refinement" class="sect">&sect;2.1.(c)</a>, if <code>B</code> is distinct from <code>B0</code>
+ it has to be a sub-class of <code>B0</code>.
+
+ </div>
+ <div class="note">
+ <h5>Effect:</h5>
+ In this case the compiler issues a warning, stating that the <code>B</code><em> may not be liftable,</em> because both role classes <code>R1</code>
+ and <code>R2</code> are candidates and there is no reason to prefer one over the other.
+ <br /><strong>If no potential ambiguity is detected, lifting will always be unambiguous.</strong></div>
+ <p>In the above situation, trying to lift an instance of type <code>B</code> to the role type
+ <code>R0</code> is an <strong>illegal lifting request</strong>. If <code>R0</code> is bound
+ to the same base class <code>B</code> as its sub-roles <code>R1</code> and <code>R2</code> are,
+ role <code>R0</code> is <strong>unliftable</strong>, meaning that no instance of <code>R0</code>
+ can ever by obtained by lifting.
+
+ </p>
+ <h5 class="listing">Example code (Potential Ambiguity):</h5>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>team</b> <b>class</b> MyTeam {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>public</b> <b>class</b> SuperRole <b>playedBy</b> MyBase {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>public</b> <b>class</b> SubRoleA <b>extends</b> SuperRole {...}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <b>public</b> <b>class</b> SubRoleB <b>extends</b> SuperRole {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ <div class="subsect depth4" id="s2.3.4.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Definite ambiguity</span></h4>
+ <p>A <strong>definite ambiguity</strong> is given if
+
+ </p>
+ <ul>
+ <li>the situation of potential ambiguity according to (a)
+ above is given and
+ </li>
+ <li>lifting is requested (either by method binding or explicitly
+ (<a href="#s2.3.2" title="&sect;2.3.2&nbsp;Declared lifting" class="sect">&sect;2.3.2</a>)) from the shared base class <code>B</code> to any role
+ class <code>R0</code> that is a common super role for <code>R1</code> and <code>R2</code>.
+ </li>
+ </ul>
+ <div class="note">
+ <h5>Effect:</h5>
+ Definite ambiguity is a compile time error.
+
+ </div>
+ <h5 class="listing">Example code (Definite Ambiguity):</h5>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>team</b> <b>class</b> MyTeam {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>public</b> <b>class</b> SuperRole <b>playedBy</b> MyBase {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>public</b> <b>class</b> SubRoleA <b>extends</b> SuperRole <b>playedBy</b> SubBase {...}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <b>public</b> <b>class</b> SubRoleB <b>extends</b> SuperRole <b>playedBy</b> SubBase {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> <b>public</b> <b>void</b> useSuperRole(SubBase <b>as</b> SuperRole r) {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ <div class="subsect depth4" id="s2.3.4.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Actual ambiguity</span></h4>
+ <p>At runtime <strong>actual ambiguity</strong> may occur if for the
+ <em>dynamic type</em> of a base to be lifted the conditions of (b)
+ above hold accordingly. Actual ambiguity is only possible in cases
+ reported by the compiler as potential ambiguity.
+
+ </p>
+ <div class="note">
+ <h5>Effect:</h5>
+ An actual ambiguity is reported at runtime by throwing a
+ <code>org.objectteams.LiftingFailedException</code>.
+
+ </div>
+ <h5 class="listing">Example code (Actual Ambiguity):</h5>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>team</b> <b>class</b> MyTeam {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>public</b> <b>class</b> SuperRole <b>playedBy</b> MyBase {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>public</b> <b>class</b> SubRoleA <b>extends</b> SuperRole <b>playedBy</b> SubBase {...}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <b>public</b> <b>class</b> SubRoleB <b>extends</b> SuperRole <b>playedBy</b> SubBase {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> </pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> <b>public</b> <b>void</b> useSuperRole(MyBase <b>as</b> SuperRole r) {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre>}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre><span class="comment">// plus these calls:</span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre>MyTeam mt = <b>new</b> MyTeam();</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">10</td>
+ <td><pre>mt.useSuperRole(<b>new</b> SubBase());</pre></td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ <div class="subsect depth4" id="s2.3.4.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Mismatching role</span></h4>
+ <p>In cases of potential ambiguity another runtime error may occur:
+ a <strong>mismatching role</strong> is encountered when a role is found
+ in the cache, which is not conform to the required type.
+ This happens, if the base object has previously been lifted
+ to a type that is incompatible with the currently requested type.
+
+ </p>
+ <div class="note">
+ <h5>Effect:</h5>
+ This is reported by throwing a <code>org.objectteams.WrongRoleException</code>.
+
+ </div>
+ <h5 class="listing">Example code (Mismatching Role):</h5>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>team</b> <b>class</b> MyTeam {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>public</b> <b>class</b> SuperRole <b>playedBy</b> MyBase {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>public</b> <b>class</b> SubRoleA <b>extends</b> SuperRole {...}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <b>public</b> <b>class</b> SubRoleB <b>extends</b> SuperRole {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> </pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> <b>public</b> <b>void</b> useRoleA(MyBase <b>as</b> SubRoleA r) {...}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> <b>public</b> <b>void</b> useRoleB(MyBase <b>as</b> SubRoleB r) {...}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre>}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre><span class="comment">// plus these calls:</span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">10</td>
+ <td><pre>MyTeam mt = <b>new</b> MyTeam();</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">11</td>
+ <td><pre>MyBase b = <b>new</b> MyBase();</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">12</td>
+ <td><pre>mt.useRoleA(b); <span class="comment">// creates a SubRoleA for b</span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">13</td>
+ <td><pre>mt.useRoleB(b); <span class="comment">// finds the SubRoleA which is not compatible</span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">14</td>
+ <td><pre> <span class="comment">// to the expected type SubRoleB.</span></pre></td>
+ </tr>
+ </table>
+ </div>
+ <p>From the second item of <a href="#s2.3.4.a" title="&sect;2.3.4.(a)&nbsp;Potential ambiguity"
+ class="sect">&sect;2.3.4.(a)</a> follows, that for binding ambiguities different
+ role hierarchies are analyzed in isolation.
+ For this analysis only those role classes are considered that are bound to a
+ base class (directly using <code>playedBy</code> or by inheriting this relation
+ from another role class).
+ I.e., two role classes that have no common bound super role will never cause
+ any ambiguity.
+
+ </p>
+ </div>
+ </div>
+ </div>
+ <div class="sect depth2" id="s2.4">
+ <h2 class="sect">&sect;2.4&nbsp;Explicit role creation<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;2</a></span></h2>
+ <p>Lifting is the normal technique by which role objects are created implicitly.
+ This section defines under which conditions a role can also be created explicitly.
+
+ </p>
+ <div class="sect depth3" id="s2.4.1">
+ <h3 class="sect">&sect;2.4.1&nbsp;Role creation via a lifting constructor<span class="toplink"><a href="#s2.4">&uarr;&nbsp;&sect;2.4</a></span></h3>
+ <p>Lifting uses the default constructor for roles (see <a href="#s2.3.1" title="&sect;2.3.1&nbsp;Implicit role creation" class="sect">&sect;2.3.1</a>).
+ This constructor can be invoked from client code, if the following rules are respected.
+
+ </p>
+ <div class="subsect depth4" id="s2.4.1.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Team context</span></h4>
+ <p>The lifting constructor can be used only within the enclosing team of
+ the role to be instantiated. Thus, qualified allocation expressions
+ (<code>someTeam.new SomeRole(..)</code>) may never use the lifting constructor.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s2.4.1.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Fresh base object</span></h4>
+ <p>If the argument to a lifting constructor invocation is a <code>new</code>
+ expression, creating a fresh base object, the use of the lifting constructor
+ is safe. Otherwise the rules of (c) below apply.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s2.4.1.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Duplicate role runtime check</span></h4>
+ <p>If it cannot be syntactically derived, that the argument to a lifting
+ constructor is a freshly created base object (b), a compile time warning will
+ signal that an additional runtime check is needed: It must be prevented that
+ a new role is created for a base object, which already has a role of the
+ required type in the given team. It is not possible to replace an existing
+ role by use of the lifting constructor. At runtime, any attempt to do so
+ will cause a <code>org.objectteams.DuplicateRoleException</code> to be thrown.
+ This exception can only occur in situations where the mentioned compile
+ time warning had been issued.
+ <br /><a href="s6.1.html" title="&sect;6.1&nbsp;Reflection" class="sect">&sect;6.1</a> will introduce reflective functions
+ which can be used to manually prevent errors like a duplicate role.
+
+ </p>
+ </div>
+ </div>
+ <div class="sect depth3" id="s2.4.2">
+ <h3 class="sect">&sect;2.4.2&nbsp;Role creation via a regular constructor<span class="toplink"><a href="#s2.4">&uarr;&nbsp;&sect;2.4</a></span></h3>
+ <p>Roles may also be created explicitly using a custom constructor with arbitrary signature
+ other than the signature of the lifting constructor.<br />
+ Within role constructors, four kinds of self-calls are possible:
+
+ </p>
+ <dl>
+ <dt><code>base(..)</code></dt>
+ <dd>A constructor of the corresponding base class (<a href="sA.html#sA.5.3" title="&sect;A.5.3&nbsp;BaseCall" class="sect">&sect;A.5.3</a>(c)).
+ </dd>
+ <dt><code>this(..)</code></dt>
+ <dd>Another constructor of the same class.</dd>
+ <dt><code>super(..)</code></dt>
+ <dd>A constructor of the super-class (normal <code>extends</code>), <span class="underline">unless</span> the super-class is bound to a different base class, in which case calling <code>super(..)</code> is not legal.
+ </dd>
+ <dt><code>tsuper(..)</code></dt>
+ <dd>A constructor of the corresponding role of the super-team (<a href="sA.html#sA.5.4" title="&sect;A.5.4&nbsp;TSuperCall" class="sect">&sect;A.5.4</a>(e)). Also see the constraint in <a href="s1.3.2.c.html"
+ title="&sect;1.3.2.(c)&nbsp;Constructors and overridden 'extends' "
+ class="sect">&sect;1.3.2.(c)</a>.
+ </dd>
+ </dl>
+ <div class="subsect depth4" id="s2.4.2.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Unbound roles</span></h4>
+ <p>Each constructor of a role that is <strong>not bound</strong> to a base class must use
+ one of <code>this(..)</code>, <code>super(..)</code> or <code>tsuper(..)</code>.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s2.4.2.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Bound roles</span></h4>
+ <p>Each constructor of a <strong>bound role</strong> must directly or indirectly invoke either
+ a <code>base(..)</code> constructor or a lifting constructor (see <a href="#s2.3.1" title="&sect;2.3.1&nbsp;Implicit role creation" class="sect">&sect;2.3.1</a>).
+ Indirect calls to the base constructor or lifting constructor may use any of <code>this(..)</code>, <code>super(..)</code>
+ or <code>tsuper(..)</code>, which simply delegates the obligation to the called constructor.
+ <br />
+ If a constructor referenced by <code>base(..)</code> is not visible according to the
+ regular rules of Java, it may still be called using <b>decapsulation</b> (see
+ also <a href="s3.4.html" title="&sect;3.4&nbsp;Overriding access restrictions"
+ class="sect">&sect;3.4</a>, <a href="#s2.1.2.c" title="&sect;2.1.2.(c)&nbsp;Base class decapsulation"
+ class="sect">&sect;2.1.2.(c)</a>).
+ <br />
+ Note, that if the super or tsuper role is not bound, delegating the obligation to that unbound role will not work.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s2.4.2.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Super-call for bound roles</span></h4>
+ <p>Instead of or prior to calling <code>base(..)</code> a constructor of a bound role explicitly or implicitly calls a super constructor.
+ Which constructor is applicable depends on the super role and its <code>playedBy</code> clause.
+
+ </p>
+ <ul>
+ <li>If the super role is bound to the same base class as the current role is,
+
+ <ul>
+ <li>not writing a super-call causes the lifting constructor of the super role to be invoked.</li>
+ <li>explicitly calling a super constructor requires the super constructor to <i>either</i><ol>
+ <li>create a role instance using a base constructor call (directly or indirectly), <i>or</i></li>
+ <li>be a lifting constructor receiving a base instance, which the current role must provide as the argument.</li>
+ </ol>
+ </li>
+ </ul>
+ </li>
+ <li>If the super role is bound but the current role refines the <code>playedBy</code>
+ relationship (cf. <a href="#s2.1.c" title="&sect;2.1.(c)&nbsp;Covariant refinement" class="sect">&sect;2.1.(c)</a>),
+
+ <ul>
+ <li>a lifting constructor must be called explicitly passing a base object as the argument.</li>
+ </ul>
+ </li>
+ <li>If the role has an explicit or implicit super role which is unbound the constructor may optionally
+ call a super constructor (using <code>super(..)</code> or <code>tsuper(..)</code>) prior to calling
+ <code>base(..)</code>. Otherwise the default constructor is implicitly invoked.
+
+ </li>
+ </ul>
+ <p>When invoking a lifting constructor of a super role the base object can optionally be obtained by using a base constructor
+ call as an expression:
+
+ </p>
+ <div class="listing plain"><pre>super(base(<i>&lt;args&gt;</i>));</pre></div>
+ </div>
+ <p>The language system evaluates the base constructor by creating an
+ instance of the appropriate base class using a constructor with matching
+ signature. Also the internal links are setup that are needed for accessing the
+ base object from the role and for lifting the base object to the new role
+ in the future.
+
+ </p>
+ <p>The syntax for base constructors follows the rule that role implementations
+ never directly refer to any names of base classes or their features.
+
+ </p>
+ </div>
+ <div class="sect depth3" id="s2.4.3">
+ <h3 class="sect">&sect;2.4.3&nbsp;Role creation in the presence of smart lifting<span class="toplink"><a href="#s2.4">&uarr;&nbsp;&sect;2.4</a></span></h3>
+ <p>Explicitly instantiating a role <code>R1</code> bound to a base <code>B</code> where smart lifting of <code>B</code> to <code>R1</code> would actually
+ provide a subrole <code>R2</code> is dangerous: Instantiation enters the <code>R1</code> into the team's internal cache. If at any time later lifting
+ this <code>B</code> to <code>R2</code> is requested, which is a legal request, the runtime system will answer by throwing a <code>org.objectteams.WrongRoleException</code>
+ because it finds the <code>R1</code> instead of the required <code>R2</code>.
+ For this reason, in this specific situation the explicit instantiation <code>new R1(..)</code> will be flagged by a warning.
+ The problem can be avoided by using <code>R2</code> in the instantiation expression.
+
+ </p>
+ <h5 class="listing">Example code (WrongRoleException):</h5>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>class</b> B { <b>void</b> bm() {} }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> T {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>protected</b> <b>class</b> R1 <b>playedBy</b> B {...}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <b>protected</b> <b>class</b> R2 <b>extends</b> R1 { <span class="comment">// inherits the binding to B</span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> <b>void</b> rm() { <span class="comment">/* body omitted */</span> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> <b>public</b> B getDecoratedB() {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre> <b>return</b> <em><b>new</b> R1</em>(<b>new</b> B()); <span class="comment">// <span class="error">compile-time warning!</span></span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">10</td>
+ <td><pre> <b>public</b> <b>void</b> requestLifting(B <b>as</b> R2 r) {}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">11</td>
+ <td><pre>}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">12</td>
+ <td><pre><span class="comment">// plus these calls:</span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">13</td>
+ <td><pre>T t = <b>new</b> T();</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">14</td>
+ <td><pre>B b = t.getDecoratedB(); <span class="comment">// creates an R1 for b</span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">15</td>
+ <td><pre>t.requestLifting(b); <span class="comment">// =&gt; <span class="error"><code>org.objectteams.WrongRoleException!</code></span></span></pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="codecomment">
+ <ul>
+ <li>A note on line 8: this line passes a fresh instance of <code>B</code> to the lifting constructor of <code>R1</code>
+ (see <a href="#s2.4.1.b" title="&sect;2.4.1.(b)&nbsp;Fresh base object"
+ class="sect">&sect;2.4.1.(b)</a>). In order to return this <code>B</code> instance lowering is implicitly used for the return statement.
+ </li>
+ <li>When line 15 is executed, a lifting of <code>b</code> to <code>R2</code> is requested but due to line 8 an <code>R1</code> is found in the internal cache.
+ </li>
+ </ul>
+ </div>
+ </div>
+ </div>
+ <div class="sect depth2" id="s2.5">
+ <h2 class="sect">&sect;2.5&nbsp;Abstract Roles<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;2</a></span></h2>
+ <p>Overriding of role classes and dynamic binding of role types (<a href="s1.3.1.e.html" title="&sect;1.3.1.(e)&nbsp;Dynamic binding of types"
+ class="sect">&sect;1.3.1.(e)</a>)
+ adds new cases to <strong>creation</strong> with respect to abstract classes.
+
+ </p>
+ <div class="subsect depth3" id="s2.5.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Using abstract classes for creation</span></h4>
+ <p>Abstract role classes can indeed be used for object creation.
+ The effect of such a statement is that the team must be
+ marked <code>abstract</code>. Only those sub-teams are concrete
+ that provide concrete versions for all role classes used in
+ creation expressions.<br />
+ This includes the case, where a
+ super-team has a concrete role class and creates
+ instances of this role class and only the sub-team changes
+ the status of this role class to abstract. Also here
+ the sub-team must be marked abstract, because it contains
+ an abstract role class that is used in creation expressions.
+
+ </p>
+ <div class="note">
+ <h5>Interpretation:</h5>
+ Since the type in a role creation expression is late-bound relative to the enclosing team instance, abstract role classes
+ can be seen
+ as the hook in a <strong>template&amp;hook pattern</strong> that is raised from the method level to the class level:
+ A super-team may already refer to the constructor of an abstract role class,
+ only the sub-team will provide the concrete role class to fill the hook with the necessary implementation.
+
+ </div>
+ </div>
+ <div class="subsect depth3" id="s2.5.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Relevant roles</span></h4>
+ <p>A team must be marked <code>abstract</code> if one of its <strong>relevant roles</strong> is abstract.
+ <br />
+ A role is relevant in this sense if
+
+ </p>
+ <ul>
+ <li>the role class is public <em>or if</em></li>
+ <li>an explicit <code>new</code> expression
+ would require to create instances of the role class, <em>or if</em></li>
+ <li>any of the lifting methods of the enclosing team
+ would require to create instances of the role class.<br />
+ A role is irrelevant with respect to lifting
+ if either of the following holds:
+
+ <ul>
+ <li>It is not bound to a base class, neither directly nor
+ by an inherited <code>playedBy</code> clause.
+ </li>
+ <li>It has a sub-role without a <code>playedBy</code> clause.
+ </li>
+ <li>It is bound to an abstract base class, and for all concrete
+ sub-classes of the base class, a binding to a more specific role class exists.
+ </li>
+ </ul>
+ </li>
+ </ul>
+ <p>If neither property, relevance nor irrelevance, can be shown for an abstract role,
+ a warning is given in case the enclosing team is not abstract.
+
+ </p>
+ </div>
+ </div>
+ <div class="sect depth2" id="s2.6">
+ <h2 class="sect">&sect;2.6&nbsp;Explicit base references<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;2</a></span></h2>
+ <p>The role-base link is not meant to be accessed explicitly from programs,
+ but it is fully under the control of compiler and runtime environment.
+ Accessing features of a role's base object is done by
+ <a href="s3.html" title="&sect;3&nbsp;Callout Binding" class="sect">callout bindings (&sect;3)</a>.
+ Yet, a keyword <code>base</code> exists, which can be used in the following
+ contexts:
+
+ </p>
+ <div class="subsect depth3" id="s2.6.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Externalized roles of a base team</span></h4>
+ <p>If the base class of a role <code>T1.R1</code> is again a team
+ <code>T2</code>, roles of that team <code>T2</code> can be
+ externalized (see <a href="s1.2.2.html" title="&sect;1.2.2&nbsp;Externalized roles" class="sect">&sect;1.2.2</a>)
+ using <code>base</code> as their type anchor. Given that
+ <code>R2</code> is a role of <code>T2</code>, one could write:
+
+ </p>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> T1 {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>protected</b> <b>class</b> R1 <em><b>playedBy</b> T2</em> {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>protected</b> <em>R2&lt;@base&gt;</em> aRoleOfMyBase;</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <p>This syntax is only legal within the body of the role <code>T1.R1</code> which is bound
+ to the team <code>T2</code> containing role <code>R2</code>.
+ A static type prefix can be used to disambiguate a base anchor, so the explicit variant
+ of the above type would be <code>R2&lt;@<strong>R1</strong>.base&gt;</code>.
+ <br />
+ It is not legal to use a type anchor containing <code>base</code> as an element in a path
+ of references like <code>&lt;@base.<span class="error">field</span>&gt;</code>
+ or <code>&lt;@<span class="error">field</span>.base&gt;</code>.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s2.6.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Explicit base object creation</span></h4>
+ <p>Within a role constructor (which is not the lifting constructor)
+ the syntax <code>base(<em>arguments</em>)</code> causes an instance
+ of the bound base class to be created and linked (see <a href="#s2.4.2"
+ title="&sect;2.4.2&nbsp;Role creation via a regular constructor"
+ class="sect">&sect;2.4.2</a>).
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s2.6.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Base call in callin method</span></h4>
+ <p>Within a <a href="s4.2.d.html" title="&sect;4.2.(d)&nbsp;Callin methods" class="sect">callin method (&sect;4.2.(d))</a>
+ an expression <code>base.m(<em>args</em>)</code> is used to invoke the
+ originally called method (see <a href="s4.3.html" title="&sect;4.3&nbsp;Base calls" class="sect">&sect;4.3</a>).
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s2.6.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Base guard predicates</span></h4>
+ <p><a href="s5.4.html" title="&sect;5.4&nbsp;Guard predicates" class="sect">Guard predicates (&sect;5.4)</a> can
+ be specified to act on the base side using the <code><strong>base when</strong></code> keywords.
+ Within such a base guard predicate <code>base</code> is interpreted as a special identifier
+ holding a reference to the base object that is about to be lifted
+ for the sake of a callin method interception (see <a href="s5.4.2.a.html" title="&sect;5.4.2.(a)&nbsp;Base object reference"
+ class="sect">&sect;5.4.2.(a)</a>).
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s2.6.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Parameter mappings</span></h4>
+ <p>An expression at the right-hand side of a parameter mapping
+ (parameter in a callin binding (<a href="s4.4.html" title="&sect;4.4&nbsp;Callin parameter mapping"
+ class="sect">&sect;4.4</a>) or
+ result in a callout binding (<a href="s3.2.c.html" title="&sect;3.2.(c)&nbsp;Result mapping" class="sect">&sect;3.2.(c)</a>) ) may use the keyword <code>base</code>
+ to refer to the bound base instance. Such usage requires the role method bound in this method binding to be non-static.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s2.6.f">
+ <h4 class="subsect">(f)&nbsp;<span class="title">Inhibition of modification</span></h4>
+ <p>In all cases, the <code>base</code> reference is immutable,
+ i.e., <code>base</code> can never appear as the left-hand-side of an assignment.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s2.6.g">
+ <h4 class="subsect">(g)&nbsp;<span class="title">Decapsulation via base reference</span></h4>
+ <p>In cases <a href="#s2.6.d" title="&sect;2.6.(d)&nbsp;Base guard predicates"
+ class="sect">&sect;2.6.(d)</a> and <a href="#s2.6.e" title="&sect;2.6.(e)&nbsp;Parameter mappings" class="sect">&sect;2.6.(e)</a> above, members of the base
+ object may be accessed that would not be visible under Java's visibility rules.
+ Such references are treated as decapsulation in accordance with <a href="s3.4.a.html"
+ title="&sect;3.4.(a)&nbsp;Callout to inaccessible base method"
+ class="sect">&sect;3.4.(a)</a> and <a href="s3.5.e.html" title="&sect;3.5.(e)&nbsp;Access control" class="sect">&sect;3.5.(e)</a>.<br />
+ Note that accessing a base field via <code>base</code> only gives reading access to this field.
+
+ </p>
+ </div>
+ <div class="newpage"></div>
+ </div>
+ <div class="sect depth2" id="s2.7">
+ <h2 class="sect">&sect;2.7&nbsp;Advanced structures<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;2</a></span></h2>
+ <p>This section discusses how role containment and the playedBy relationship can be combined.
+ It does not define new rules, but illustrates rules defined above. The central idea is that any class
+ can have more than one of the three flavors <em>team, role, </em>and<em> base</em>.
+
+ </p>
+ <div class="subsect depth3" id="s2.7.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Nesting</span></h4>
+ <p>If a role (contained in a team) is also a team (marked with the <code>team</code> modifier)
+ it is a <strong>nested team</strong>. The depth of nesting is not restricted.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s2.7.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Stacking</span></h4>
+ <p>If the base class to which a role is bound using <code>playedBy</code> is a team,
+ the role is said to be <strong>stacked</strong> on the base team.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s2.7.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Layering</span></h4>
+ <p>If roles of a team <code>Secondary</code> are played by roles of another team <code>Primary</code>
+ (i.e., base classes are roles), the team <code>Secondary</code> defines a <strong>layer</strong> over the team <code>Primary</code>.
+ Such layering requires a final reference <code>anchor</code> from <code>Secondary</code> to an instance of <code>Primary</code>.
+ All playedBy declarations within <code>Secondary</code> specify their base classes anchored to that final link <code>anchor</code>.
+
+ </p><img src="../images/Layering.png" alt="Team layering example" /><p>Due to the anchored base types, layered teams implicitly support the following guarantee:
+ all base objects of roles of <code>Secondary</code> are contained within the team instance specified by the link <code>anchor</code>.
+ If roles of <code>Secondary</code> contain any callin bindings to non-static base methods, these will be triggered only
+ when a base method is invoked on a base instance contained in the team specified by <code>anchor</code>.
+ <br />
+ In accordance with <a href="#s2.6.a" title="&sect;2.6.(a)&nbsp;Externalized roles of a base team"
+ class="sect">&sect;2.6.(a)</a> the anchor in such anchored playedBy declarations
+ could also be the pseudo identifier <code>base</code>, provided that <code>Secondary</code> is a nested team,
+ which has a playedBy binding to <code>Primary</code> as its base class.
+ This situation is part of the second example <a href="#s2.7.d" title="&sect;2.7.(d)&nbsp;Implicit playedBy specialization"
+ class="sect">below (&sect;2.7.(d))</a> (see <code>T1 playedBy TB1</code>).
+
+ </p>
+ </div>
+ <div class="newpage"></div>
+ <div class="subsect depth3" id="s2.7.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Implicit playedBy specialization</span></h4>
+ <p>According to <a href="#s2.1.d" title="&sect;2.1.(d)&nbsp;No-variance" class="sect">&sect;2.1.(d)</a> an implicit sub-role may <em>implicitly</em> specialize an existing <code>playedBy</code> relation.
+ This requires the base class to be specified relative to some implicit (<code>OuterTeam.this</code>) or explicit (<code>OuterTeam.base</code>) team anchor.
+ Specializing that team anchor automatically specializes the playedBy declaration, too.
+ This rule never requires any action from a programmer but only explains the interpretation of a playedBy declaration in
+ complex situations.
+
+ </p>
+ <h5>Two advanced examples demonstrating the above are:</h5>
+ <table border="0">
+ <colgroup span="1">
+ <col align="left" span="1" />
+ <col align="left" span="1" />
+ </colgroup>
+ <tr>
+ <td rowspan="1" colspan="1">
+ <ul>
+ <li>If a role <code>TOuter1.T.R</code> of a <strong>nested team </strong><code>TOuter1.T</code> is played by
+ another role of the outer enclosing team <code>TOuter1.B</code>, subclassing the outer team <code>TOuter1</code> to <code>TOuter2</code>
+ will produce a new role <code>TOuter2.T.R</code> which is automatically played by <code>TOuter2.B</code>,
+ an implicit sub class of the original base class <code>TOuter1.B</code>.
+ </li>
+ </ul>
+ </td>
+ <td rowspan="1" colspan="1"><img src="../images/implicitly_overriding_playedby.png"
+ alt="Implicitly overriding playedBy" /></td>
+ </tr>
+ <tr>
+ <td rowspan="1" colspan="1">
+ <ul>
+ <li>Consider the case where a <strong>nested </strong><code>T1</code> as a role of <code>TOuter</code> is <strong>stacked</strong>
+ on a base team <code>TB1</code>. Also, <code>T1</code> is a <strong>layered team</strong> over <code>TB1</code>
+ because its role <code>R</code> adapts role <code>TB1.B</code>.
+ <br />
+ In this situation the playedBy relation of role <code>TOuter.T1.R</code> is given by a base-anchored type <code>B&lt;@T1.base&gt;</code>.
+ If furthermore <code>TOuter.T1</code> is subclassed to <code>TOuter.T2</code> which covariantly refines the inherited
+ playedBy declaration to <code>TB2</code>, then <code>TOuter.T2.R</code> will automatically refine the inherited playedBy relation
+ to <code>TB2.B</code> to follow the new interpretation of the <code>base</code> anchor.
+ </li>
+ </ul>
+ </td>
+ <td rowspan="1" colspan="1"><img src="../images/implicitly_overriding_playedby_base.png"
+ alt="Implicitly overriding playedBy base" /></td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s1.html" rel="prev">&lt;&lt;&nbsp;&sect;1&nbsp;Teams and Roles</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s3.html" rel="next">&sect;3&nbsp;Callout Binding&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.1.a.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.1.a.html
new file mode 100644
index 000000000..c7895a006
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.1.a.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s3.1.b.html" rel="next">&sect;3.1.(b)&nbsp;Definition&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s3.1.html" rel="section">&sect;3.1&nbsp;Callout method binding</a></div>
+ <div class="subsect depth3" id="s3.1.a">
+ <h4 class="subsect">&sect;3.1.(a)&nbsp;<span class="title">Prerequisite: Class binding</span></h4>
+ <p>A callout binding requires the enclosing class to be a role class
+ bound to a base class according to <a href="s2.1.html" title="&sect;2.1&nbsp;playedBy relation" class="sect">&sect;2.1</a>.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s3.1.b.html" rel="next">&sect;3.1.(b)&nbsp;Definition&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s3.1.html" rel="section">&sect;3.1&nbsp;Callout method binding</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.1.b.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.1.b.html
new file mode 100644
index 000000000..be6f1f9b6
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.1.b.html
@@ -0,0 +1,80 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s3.1.a.html" rel="prev">&lt;&lt;&nbsp;&sect;3.1.(a)&nbsp;Prerequisite: Class binding</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s3.1.c.html" rel="next">&sect;3.1.(c)&nbsp;Kinds of method designators&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s3.1.html" rel="section">&sect;3.1&nbsp;Callout method binding</a></div>
+ <div class="subsect depth3" id="s3.1.b">
+ <h4 class="subsect">&sect;3.1.(b)&nbsp;<span class="title">Definition</span></h4>
+ <p>A callout binding maps an abstract role method ("expected method")
+ to a concrete base method ("provided method").
+ It may appear within the role class at any place where feature
+ declarations are allowed. It is denoted by
+
+ </p>
+ <div class="listing plain"><pre><i>expected_method_designator</i> <b>-&gt;</b> <i>provided_method_designator;</i></pre></div>
+ <p>The effect is that any call to the role method will be forwarded to the
+ associated base object using the provided base method.
+
+ </p>
+ <h5 class="listing">Example code (Callout):</h5>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>team</b> <b>class</b> Company {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>public</b> <b>class</b> Employee <b>playedBy</b> Person {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>abstract</b> String getIdentification();</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <span class="comment">// callout binding see below...</span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s3.1.a.html" rel="prev">&lt;&lt;&nbsp;&sect;3.1.(a)&nbsp;Prerequisite: Class binding</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s3.1.c.html" rel="next">&sect;3.1.(c)&nbsp;Kinds of method designators&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s3.1.html" rel="section">&sect;3.1&nbsp;Callout method binding</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.1.c.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.1.c.html
new file mode 100644
index 000000000..d709d9497
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.1.c.html
@@ -0,0 +1,85 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s3.1.b.html" rel="prev">&lt;&lt;&nbsp;&sect;3.1.(b)&nbsp;Definition</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s3.1.d.html" rel="next">&sect;3.1.(d)&nbsp;Inheritance of role method declarations&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s3.1.html" rel="section">&sect;3.1&nbsp;Callout method binding</a></div>
+ <div class="subsect depth3" id="s3.1.c">
+ <h4 class="subsect">&sect;3.1.(c)&nbsp;<span class="title">Kinds of method designators</span></h4>
+ <p>A method designator may either be a method name
+
+ </p>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">4</td>
+ <td><pre>getIdentification <em>-&gt;</em> getName;</pre></td>
+ </tr>
+ </table>
+ </div>
+ <p><strong>or</strong>
+ a complete method signature including parameter declarations and
+ return type declaration, but excluding any modifiers and declared exceptions.
+
+ </p>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">4</td>
+ <td><pre>String getIdentification() <em>-&gt;</em> String getName();</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="codecomment">
+ <h5>Effects:</h5>
+ <ul>
+ <li> Line 4 declares a callout binding for the role method <code>getIdentification()</code>,
+ providing an implementation for the abstract method defined in line 3.
+ </li>
+ <li> In combination with the role binding in line 2 this has the following effect:</li>
+ <li> Any call to <code>Employee.getIdentification</code>
+ is forwarded to the method <code>Person.getName</code>.
+ </li>
+ </ul>
+ </div>
+ <p>Both sides of a callout binding must use the same kind of
+ designators, i.e., designators with and without signature may not be mixed.
+ <br />
+ Each method designator must uniquely select one method.
+ If a method designator contains a signature this signature must match exactly with the signature
+ of an existing method, i.e., no implicit conversions are applied for this matching.
+ If overloading is involved, signatures <em>must</em> be used to disambiguate.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s3.1.b.html" rel="prev">&lt;&lt;&nbsp;&sect;3.1.(b)&nbsp;Definition</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s3.1.d.html" rel="next">&sect;3.1.(d)&nbsp;Inheritance of role method declarations&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s3.1.html" rel="section">&sect;3.1&nbsp;Callout method binding</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.1.d.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.1.d.html
new file mode 100644
index 000000000..cb52118a3
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.1.d.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s3.1.c.html" rel="prev">&lt;&lt;&nbsp;&sect;3.1.(c)&nbsp;Kinds of method designators</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s3.1.e.html" rel="next">&sect;3.1.(e)&nbsp;Callout override&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s3.1.html" rel="section">&sect;3.1&nbsp;Callout method binding</a></div>
+ <div class="subsect depth3" id="s3.1.d">
+ <h4 class="subsect">&sect;3.1.(d)&nbsp;<span class="title">Inheritance of role method declarations</span></h4>
+ <p>The role method being bound by a callout may be declared in the same
+ class as the binding or it may be inherited from a super class or
+ super interface.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s3.1.c.html" rel="prev">&lt;&lt;&nbsp;&sect;3.1.(c)&nbsp;Kinds of method designators</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s3.1.e.html" rel="next">&sect;3.1.(e)&nbsp;Callout override&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s3.1.html" rel="section">&sect;3.1&nbsp;Callout method binding</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.1.e.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.1.e.html
new file mode 100644
index 000000000..1a6bd1297
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.1.e.html
@@ -0,0 +1,51 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s3.1.d.html" rel="prev">&lt;&lt;&nbsp;&sect;3.1.(d)&nbsp;Inheritance of role method declarations</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s3.1.f.html" rel="next">&sect;3.1.(f)&nbsp;Inheritance of callout bindings&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s3.1.html" rel="section">&sect;3.1&nbsp;Callout method binding</a></div>
+ <div class="subsect depth3" id="s3.1.e">
+ <h4 class="subsect">&sect;3.1.(e)&nbsp;<span class="title">Callout override</span></h4>
+ <p>If an inherited role method is concrete, callout binding regarding this
+ method must use the token "<code>=&gt;</code>" instead of "<code>-&gt;</code>"
+ in order to declare that this binding overrides an existing implementation.
+ <br />
+
+ Using the "<code>=&gt;</code>" operator for an abstract method is an error.
+ <br />
+ It is also an error (and not useful anyway) to callout-bind a method that is
+ implemented in the same class as the binding.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s3.1.d.html" rel="prev">&lt;&lt;&nbsp;&sect;3.1.(d)&nbsp;Inheritance of role method declarations</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s3.1.f.html" rel="next">&sect;3.1.(f)&nbsp;Inheritance of callout bindings&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s3.1.html" rel="section">&sect;3.1&nbsp;Callout method binding</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.1.f.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.1.f.html
new file mode 100644
index 000000000..158cb02d6
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.1.f.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s3.1.e.html" rel="prev">&lt;&lt;&nbsp;&sect;3.1.(e)&nbsp;Callout override</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s3.1.g.html" rel="next">&sect;3.1.(g)&nbsp;Duplicate bindings&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s3.1.html" rel="section">&sect;3.1&nbsp;Callout method binding</a></div>
+ <div class="subsect depth3" id="s3.1.f">
+ <h4 class="subsect">&sect;3.1.(f)&nbsp;<span class="title">Inheritance of callout bindings</span></h4>
+ <p> Callout bindings are inherited along explicit and implicit inheritance.
+ Inherited callout bindings can be overridden using "<code>=&gt;</code>".
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s3.1.e.html" rel="prev">&lt;&lt;&nbsp;&sect;3.1.(e)&nbsp;Callout override</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s3.1.g.html" rel="next">&sect;3.1.(g)&nbsp;Duplicate bindings&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s3.1.html" rel="section">&sect;3.1&nbsp;Callout method binding</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.1.g.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.1.g.html
new file mode 100644
index 000000000..49f21d6f6
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.1.g.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s3.1.f.html" rel="prev">&lt;&lt;&nbsp;&sect;3.1.(f)&nbsp;Inheritance of callout bindings</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s3.1.h.html" rel="next">&sect;3.1.(h)&nbsp;Declared exceptions&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s3.1.html" rel="section">&sect;3.1&nbsp;Callout method binding</a></div>
+ <div class="subsect depth3" id="s3.1.g">
+ <h4 class="subsect">&sect;3.1.(g)&nbsp;<span class="title">Duplicate bindings</span></h4>
+ <p>It is an error if a role class has multiple callout bindings for the
+ same role method.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s3.1.f.html" rel="prev">&lt;&lt;&nbsp;&sect;3.1.(f)&nbsp;Inheritance of callout bindings</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s3.1.h.html" rel="next">&sect;3.1.(h)&nbsp;Declared exceptions&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s3.1.html" rel="section">&sect;3.1&nbsp;Callout method binding</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.1.h.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.1.h.html
new file mode 100644
index 000000000..c0548e03c
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.1.h.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s3.1.g.html" rel="prev">&lt;&lt;&nbsp;&sect;3.1.(g)&nbsp;Duplicate bindings</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s3.1.i.html" rel="next">&sect;3.1.(i)&nbsp;Shorthand definition&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s3.1.html" rel="section">&sect;3.1&nbsp;Callout method binding</a></div>
+ <div class="subsect depth3" id="s3.1.h">
+ <h4 class="subsect">&sect;3.1.(h)&nbsp;<span class="title">Declared exceptions</span></h4>
+ <p>It is an error if a base method to be bound by <strong>callout</strong>
+ declares in its <code>throws</code> clause any exceptions that
+ are not declared by the corresponding role method.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s3.1.g.html" rel="prev">&lt;&lt;&nbsp;&sect;3.1.(g)&nbsp;Duplicate bindings</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s3.1.i.html" rel="next">&sect;3.1.(i)&nbsp;Shorthand definition&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s3.1.html" rel="section">&sect;3.1&nbsp;Callout method binding</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.1.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.1.html
new file mode 100644
index 000000000..3ba2079a4
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.1.html
@@ -0,0 +1,282 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s3.2.html" rel="next">&sect;3.2&nbsp;Callout parameter mapping&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a></div>
+ <div class="sect depth2" id="s3.1">
+ <h2 class="sect">&sect;3.1&nbsp;Callout method binding</h2>
+ <div class="syntaxlink"><a href="sA.html#sA.3.2" title="&sect;A.3.2&nbsp;CalloutBinding"
+ class="syntax">&rarr;&nbsp;Syntax&nbsp;&sect;A.3.2</a></div>
+ <p>A role class may acquire the implementation for any of its
+ (expected) methods by declaring a <strong>callout</strong> binding.
+
+ </p>
+ <div class="subsect depth3" id="s3.1.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Prerequisite: Class binding</span></h4>
+ <p>A callout binding requires the enclosing class to be a role class
+ bound to a base class according to <a href="s2.1.html" title="&sect;2.1&nbsp;playedBy relation" class="sect">&sect;2.1</a>.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.1.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Definition</span></h4>
+ <p>A callout binding maps an abstract role method ("expected method")
+ to a concrete base method ("provided method").
+ It may appear within the role class at any place where feature
+ declarations are allowed. It is denoted by
+
+ </p>
+ <div class="listing plain"><pre><i>expected_method_designator</i> <b>-&gt;</b> <i>provided_method_designator;</i></pre></div>
+ <p>The effect is that any call to the role method will be forwarded to the
+ associated base object using the provided base method.
+
+ </p>
+ <h5 class="listing">Example code (Callout):</h5>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>team</b> <b>class</b> Company {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>public</b> <b>class</b> Employee <b>playedBy</b> Person {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>abstract</b> String getIdentification();</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <span class="comment">// callout binding see below...</span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ <div class="subsect depth3" id="s3.1.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Kinds of method designators</span></h4>
+ <p>A method designator may either be a method name
+
+ </p>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">4</td>
+ <td><pre>getIdentification <em>-&gt;</em> getName;</pre></td>
+ </tr>
+ </table>
+ </div>
+ <p><strong>or</strong>
+ a complete method signature including parameter declarations and
+ return type declaration, but excluding any modifiers and declared exceptions.
+
+ </p>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">4</td>
+ <td><pre>String getIdentification() <em>-&gt;</em> String getName();</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="codecomment">
+ <h5>Effects:</h5>
+ <ul>
+ <li> Line 4 declares a callout binding for the role method <code>getIdentification()</code>,
+ providing an implementation for the abstract method defined in line 3.
+ </li>
+ <li> In combination with the role binding in line 2 this has the following effect:</li>
+ <li> Any call to <code>Employee.getIdentification</code>
+ is forwarded to the method <code>Person.getName</code>.
+ </li>
+ </ul>
+ </div>
+ <p>Both sides of a callout binding must use the same kind of
+ designators, i.e., designators with and without signature may not be mixed.
+ <br />
+ Each method designator must uniquely select one method.
+ If a method designator contains a signature this signature must match exactly with the signature
+ of an existing method, i.e., no implicit conversions are applied for this matching.
+ If overloading is involved, signatures <em>must</em> be used to disambiguate.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.1.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Inheritance of role method declarations</span></h4>
+ <p>The role method being bound by a callout may be declared in the same
+ class as the binding or it may be inherited from a super class or
+ super interface.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.1.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Callout override</span></h4>
+ <p>If an inherited role method is concrete, callout binding regarding this
+ method must use the token "<code>=&gt;</code>" instead of "<code>-&gt;</code>"
+ in order to declare that this binding overrides an existing implementation.
+ <br />
+
+ Using the "<code>=&gt;</code>" operator for an abstract method is an error.
+ <br />
+ It is also an error (and not useful anyway) to callout-bind a method that is
+ implemented in the same class as the binding.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.1.f">
+ <h4 class="subsect">(f)&nbsp;<span class="title">Inheritance of callout bindings</span></h4>
+ <p> Callout bindings are inherited along explicit and implicit inheritance.
+ Inherited callout bindings can be overridden using "<code>=&gt;</code>".
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.1.g">
+ <h4 class="subsect">(g)&nbsp;<span class="title">Duplicate bindings</span></h4>
+ <p>It is an error if a role class has multiple callout bindings for the
+ same role method.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.1.h">
+ <h4 class="subsect">(h)&nbsp;<span class="title">Declared exceptions</span></h4>
+ <p>It is an error if a base method to be bound by <strong>callout</strong>
+ declares in its <code>throws</code> clause any exceptions that
+ are not declared by the corresponding role method.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.1.i">
+ <h4 class="subsect">(i)&nbsp;<span class="title">Shorthand definition</span></h4>
+ <p> A callout binding whose method designators specify
+ full method signatures does not require an existing role method.
+ If no role method is found matching the expected method of
+ such a callout binding, a new method is implicitly generated.
+ The new method is static iff the bound base method is static,
+ and it declares the same exceptions as the bound base method.
+
+ </p>
+ <p>
+ A shorthand callout may optionally declare a <strong>visibility modifier</strong>,
+ otherwise the generated method inherits the visibility modifier of the bound base method.
+ No further modifiers are set.
+ If a callout overrides an inherited method or callout,
+ it must not reduce the visibility of the inherited method/callout.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.1.j">
+ <h4 class="subsect">(j)&nbsp;<span class="title">Inferred callout</span></h4>
+ <p> If a non-abstract role class inherits an abstract method the compiler
+ tries to infer a callout binding for implementing the abstract method.
+ Similarly, if a self-call in a role class cannot be resolved, the compiler
+ tries to infer a callout to resolve the self-call.<br />
+ Inference searches for a method in the bound base class such that
+
+ </p>
+ <ol>
+ <li>both methods have the same name</li>
+ <li>both methods have the same number of arguments</li>
+ <li>each argument of the abstract role method is compatible to the
+ corresponding argument of the base method directly, or using
+ boxing/unboxing or lowering.
+ </li>
+ </ol>
+ <p>
+ Callouts inferred from an interface have <code>public</code> visibility,
+ callouts inferred from a self-call have <code>private</code> visibility.
+
+ </p>
+ <p>
+ Per default inferred callout bindings are disabled, i.e., a compiler
+ must report these as an error. However, a compiler should allow to
+ configure reporting to produce a warning only (which can be suppressed
+ using a <code>@SuppressWarnings("inferredcallout")</code> annotation),
+ or to completely ignore the diagnostic.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.1.k">
+ <h4 class="subsect">(k)&nbsp;<span class="title">Callout to generic method</span></h4>
+ <p>When referring to a generic base method</p>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre>&lt;T&gt; T bm(T a)</pre></td>
+ </tr>
+ </table>
+ </div>
+ <p>a callout binding may either propagate the method's genericity as in</p>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">2</td>
+ <td><pre>&lt;T&gt; T rm(T a) <b>-&gt;</b> T bm(T a);</pre></td>
+ </tr>
+ </table>
+ </div>
+ <p>or it may supply a valid substitution for the type parameter as in</p>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">2</td>
+ <td><pre>String rm(String a) <b>-&gt;</b> String bm(String a);</pre></td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ <p>A callout binding either attaches an implementation to a previously declared method
+ or adds (<a href="#s3.1.i" title="&sect;3.1.(i)&nbsp;Shorthand definition" class="sect">&sect;3.1.(i)</a> above) a forwarding method to a role class.
+ Apart from this implementation, callout-bound methods do not differ from regular methods.
+
+ </p>
+ <p>When we say, a callout binding defines <strong>forwarding</strong> this means that
+ control is passed to the base object. In contrast, by a <strong>delegation</strong>
+ semantics control <em>would</em> remain at the role object, such that self-calls
+ would again be dispatched starting at the role. Callout bindings on
+ their own do not support delegation. However, in conjunction with method
+ overriding by means of callin bindings (see <a href="s4.html" title="&sect;4&nbsp;Callin Binding" class="sect">&sect;4</a>)
+ the effect of delegation can easily be achieved.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s3.2.html" rel="next">&sect;3.2&nbsp;Callout parameter mapping&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.1.i.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.1.i.html
new file mode 100644
index 000000000..635101d3b
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.1.i.html
@@ -0,0 +1,56 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s3.1.h.html" rel="prev">&lt;&lt;&nbsp;&sect;3.1.(h)&nbsp;Declared exceptions</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s3.1.j.html" rel="next">&sect;3.1.(j)&nbsp;Inferred callout&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s3.1.html" rel="section">&sect;3.1&nbsp;Callout method binding</a></div>
+ <div class="subsect depth3" id="s3.1.i">
+ <h4 class="subsect">&sect;3.1.(i)&nbsp;<span class="title">Shorthand definition</span></h4>
+ <p> A callout binding whose method designators specify
+ full method signatures does not require an existing role method.
+ If no role method is found matching the expected method of
+ such a callout binding, a new method is implicitly generated.
+ The new method is static iff the bound base method is static,
+ and it declares the same exceptions as the bound base method.
+
+ </p>
+ <p>
+ A shorthand callout may optionally declare a <strong>visibility modifier</strong>,
+ otherwise the generated method inherits the visibility modifier of the bound base method.
+ No further modifiers are set.
+ If a callout overrides an inherited method or callout,
+ it must not reduce the visibility of the inherited method/callout.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s3.1.h.html" rel="prev">&lt;&lt;&nbsp;&sect;3.1.(h)&nbsp;Declared exceptions</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s3.1.j.html" rel="next">&sect;3.1.(j)&nbsp;Inferred callout&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s3.1.html" rel="section">&sect;3.1&nbsp;Callout method binding</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.1.j.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.1.j.html
new file mode 100644
index 000000000..1b447626b
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.1.j.html
@@ -0,0 +1,68 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s3.1.i.html" rel="prev">&lt;&lt;&nbsp;&sect;3.1.(i)&nbsp;Shorthand definition</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s3.1.k.html" rel="next">&sect;3.1.(k)&nbsp;Callout to generic method&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s3.1.html" rel="section">&sect;3.1&nbsp;Callout method binding</a></div>
+ <div class="subsect depth3" id="s3.1.j">
+ <h4 class="subsect">&sect;3.1.(j)&nbsp;<span class="title">Inferred callout</span></h4>
+ <p> If a non-abstract role class inherits an abstract method the compiler
+ tries to infer a callout binding for implementing the abstract method.
+ Similarly, if a self-call in a role class cannot be resolved, the compiler
+ tries to infer a callout to resolve the self-call.<br />
+ Inference searches for a method in the bound base class such that
+
+ </p>
+ <ol>
+ <li>both methods have the same name</li>
+ <li>both methods have the same number of arguments</li>
+ <li>each argument of the abstract role method is compatible to the
+ corresponding argument of the base method directly, or using
+ boxing/unboxing or lowering.
+ </li>
+ </ol>
+ <p>
+ Callouts inferred from an interface have <code>public</code> visibility,
+ callouts inferred from a self-call have <code>private</code> visibility.
+
+ </p>
+ <p>
+ Per default inferred callout bindings are disabled, i.e., a compiler
+ must report these as an error. However, a compiler should allow to
+ configure reporting to produce a warning only (which can be suppressed
+ using a <code>@SuppressWarnings("inferredcallout")</code> annotation),
+ or to completely ignore the diagnostic.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s3.1.i.html" rel="prev">&lt;&lt;&nbsp;&sect;3.1.(i)&nbsp;Shorthand definition</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s3.1.k.html" rel="next">&sect;3.1.(k)&nbsp;Callout to generic method&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s3.1.html" rel="section">&sect;3.1&nbsp;Callout method binding</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.1.k.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.1.k.html
new file mode 100644
index 000000000..e489871ba
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.1.k.html
@@ -0,0 +1,67 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s3.1.j.html" rel="prev">&lt;&lt;&nbsp;&sect;3.1.(j)&nbsp;Inferred callout</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s3.1.html" rel="section">&sect;3.1&nbsp;Callout method binding</a></div>
+ <div class="subsect depth3" id="s3.1.k">
+ <h4 class="subsect">&sect;3.1.(k)&nbsp;<span class="title">Callout to generic method</span></h4>
+ <p>When referring to a generic base method</p>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre>&lt;T&gt; T bm(T a)</pre></td>
+ </tr>
+ </table>
+ </div>
+ <p>a callout binding may either propagate the method's genericity as in</p>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">2</td>
+ <td><pre>&lt;T&gt; T rm(T a) <b>-&gt;</b> T bm(T a);</pre></td>
+ </tr>
+ </table>
+ </div>
+ <p>or it may supply a valid substitution for the type parameter as in</p>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">2</td>
+ <td><pre>String rm(String a) <b>-&gt;</b> String bm(String a);</pre></td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s3.1.j.html" rel="prev">&lt;&lt;&nbsp;&sect;3.1.(j)&nbsp;Inferred callout</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s3.1.html" rel="section">&sect;3.1&nbsp;Callout method binding</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.2.a.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.2.a.html
new file mode 100644
index 000000000..83f05562e
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.2.a.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s3.2.b.html" rel="next">&sect;3.2.(b)&nbsp;Mapping one parameter&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s3.2.html" rel="section">&sect;3.2&nbsp;Callout parameter mapping</a></div>
+ <div class="subsect depth3" id="s3.2.a">
+ <h4 class="subsect">&sect;3.2.(a)&nbsp;<span class="title">with clause</span></h4>
+ <p> If the method designators in a callout binding are signatures
+ (not just method names), parameters and return value may
+ be mapped by a <code>with{...}</code> sub-clause. Parameter mappings may only occur if the enclosing role is a class, not an interface.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s3.2.b.html" rel="next">&sect;3.2.(b)&nbsp;Mapping one parameter&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s3.2.html" rel="section">&sect;3.2&nbsp;Callout parameter mapping</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.2.b.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.2.b.html
new file mode 100644
index 000000000..792addb4e
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.2.b.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s3.2.a.html" rel="prev">&lt;&lt;&nbsp;&sect;3.2.(a)&nbsp;with clause</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s3.2.c.html" rel="next">&sect;3.2.(c)&nbsp;Result mapping&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s3.2.html" rel="section">&sect;3.2&nbsp;Callout parameter mapping</a></div>
+ <div class="subsect depth3" id="s3.2.b">
+ <h4 class="subsect">&sect;3.2.(b)&nbsp;<span class="title">Mapping one parameter</span></h4>
+ <p> For each parameter of the provided base method, exactly one parameter
+ mapping defines, which value will actually be passed to
+ the base method. Callout parameter mappings have this form:
+
+ </p>
+ <div class="listing plain"><pre><i>expression</i> <b>-&gt;</b> <i>base_method_parameter_name</i></pre></div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s3.2.a.html" rel="prev">&lt;&lt;&nbsp;&sect;3.2.(a)&nbsp;with clause</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s3.2.c.html" rel="next">&sect;3.2.(c)&nbsp;Result mapping&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s3.2.html" rel="section">&sect;3.2&nbsp;Callout parameter mapping</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.2.c.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.2.c.html
new file mode 100644
index 000000000..550973b03
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.2.c.html
@@ -0,0 +1,72 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s3.2.b.html" rel="prev">&lt;&lt;&nbsp;&sect;3.2.(b)&nbsp;Mapping one parameter</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s3.2.d.html" rel="next">&sect;3.2.(d)&nbsp;Visible names&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s3.2.html" rel="section">&sect;3.2&nbsp;Callout parameter mapping</a></div>
+ <div class="subsect depth3" id="s3.2.c">
+ <h4 class="subsect">&sect;3.2.(c)&nbsp;<span class="title">Result mapping</span></h4>
+ <p>The return value of a callout method may be provided by a result mapping:
+
+ </p>
+ <div class="listing plain"><pre>result <b>&lt;-</b> <i>expression</i></pre></div>
+ <p>The right hand side expression of a result mapping may use the special identifier
+ <code>result</code> to refer to the value returned by the base method.
+ <br />
+ In a method binding with parameter mappings, it is an error to use
+ <code>result</code> as the name of a regular method argument.
+
+ </p>
+ <h5 class="listing">Example code (Callout Parameter Mapping):</h5>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre>Integer absoluteValue(Integer integer) <b>-&gt;</b> <b>int</b> abs(<b>int</b> i) <em><b>with</b> {</em></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> integer.intValue() <b>-&gt;</b> i,</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <em>result</em> <b>&lt;-</b> <b>new</b> Integer(<em>result</em>)</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre><em>}</em></pre></td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s3.2.b.html" rel="prev">&lt;&lt;&nbsp;&sect;3.2.(b)&nbsp;Mapping one parameter</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s3.2.d.html" rel="next">&sect;3.2.(d)&nbsp;Visible names&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s3.2.html" rel="section">&sect;3.2&nbsp;Callout parameter mapping</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.2.d.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.2.d.html
new file mode 100644
index 000000000..3b1405651
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.2.d.html
@@ -0,0 +1,59 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s3.2.c.html" rel="prev">&lt;&lt;&nbsp;&sect;3.2.(c)&nbsp;Result mapping</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s3.2.e.html" rel="next">&sect;3.2.(e)&nbsp;Implicit parameter mappings&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s3.2.html" rel="section">&sect;3.2&nbsp;Callout parameter mapping</a></div>
+ <div class="subsect depth3" id="s3.2.d">
+ <h4 class="subsect">&sect;3.2.(d)&nbsp;<span class="title">Visible names</span></h4>
+ <p>Each identifier that appears within the expressions of a parameter
+ mapping must be either:
+
+ </p>
+ <ul>
+ <li>a feature visible in the scope of the role instance.</li>
+ <li>a parameter of the role method (for parameter mappings).</li>
+ <li>the special name <code>result</code> (for result mappings).
+ </li>
+ <li>in a result mapping also the special name <code>base</code> can be used
+ in order to refer to the bound base instance (provided the method being
+ bound is not static).
+ </li>
+ </ul>
+ <p>The names of base method arguments (i.e., names after mapping) are only
+ legal in the position given in <a href="s3.2.b.html" title="&sect;3.2.(b)&nbsp;Mapping one parameter"
+ class="sect">&sect;3.2.(b)</a>.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s3.2.c.html" rel="prev">&lt;&lt;&nbsp;&sect;3.2.(c)&nbsp;Result mapping</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s3.2.e.html" rel="next">&sect;3.2.(e)&nbsp;Implicit parameter mappings&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s3.2.html" rel="section">&sect;3.2&nbsp;Callout parameter mapping</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.2.e.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.2.e.html
new file mode 100644
index 000000000..ae92c77a4
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.2.e.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s3.2.d.html" rel="prev">&lt;&lt;&nbsp;&sect;3.2.(d)&nbsp;Visible names</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s3.2.html" rel="section">&sect;3.2&nbsp;Callout parameter mapping</a></div>
+ <div class="subsect depth3" id="s3.2.e">
+ <h4 class="subsect">&sect;3.2.(e)&nbsp;<span class="title">Implicit parameter mappings</span></h4>
+ <p>If parameter mappings should be omitted the following conditions must hold:
+
+ </p>
+ <ol>
+ <li>each method parameter of the role method must conform to the
+ corresponding parameter of the base method, <em>and</em></li>
+ <li>the result type of the base method must conform to the result type
+ of the role method.
+ </li>
+ </ol>
+ <p>Here conformance includes translation polymorphism (cf. <a href="s3.3.d.html" title="&sect;3.3.(d)&nbsp;Typing rules" class="sect">&sect;3.3.(d)</a>).
+ <br />
+ Parameter correspondence without parameter mapping is determined by declaration order not by names.
+ <br />
+ Two adjustments can, however, be performed implicitly:
+
+ </p>
+ <ul>
+ <li>If the role method has more parameters than the base method,
+ unused trailing parameters may be silently ignored.
+ </li>
+ <li>If the role method returns <code>void</code>, any result from
+ the base method may be silently ignored.
+ </li>
+ </ul>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s3.2.d.html" rel="prev">&lt;&lt;&nbsp;&sect;3.2.(d)&nbsp;Visible names</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s3.2.html" rel="section">&sect;3.2&nbsp;Callout parameter mapping</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.2.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.2.html
new file mode 100644
index 000000000..2f21ccbb7
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.2.html
@@ -0,0 +1,308 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s3.1.html" rel="prev">&lt;&lt;&nbsp;&sect;3.1&nbsp;Callout method binding</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s3.3.html" rel="next">&sect;3.3&nbsp;Lifting and lowering&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a></div>
+ <div class="sect depth2" id="s3.2">
+ <h2 class="sect">&sect;3.2&nbsp;Callout parameter mapping</h2>
+ <div class="syntaxlink"><a href="sA.html#sA.4.1" title="&sect;A.4.1&nbsp;CalloutParameterMappings"
+ class="syntax">&rarr;&nbsp;Syntax&nbsp;&sect;A.4.1</a></div>
+ <div class="subsect depth3" id="s3.2.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">with clause</span></h4>
+ <p> If the method designators in a callout binding are signatures
+ (not just method names), parameters and return value may
+ be mapped by a <code>with{...}</code> sub-clause. Parameter mappings may only occur if the enclosing role is a class, not an interface.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.2.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Mapping one parameter</span></h4>
+ <p> For each parameter of the provided base method, exactly one parameter
+ mapping defines, which value will actually be passed to
+ the base method. Callout parameter mappings have this form:
+
+ </p>
+ <div class="listing plain"><pre><i>expression</i> <b>-&gt;</b> <i>base_method_parameter_name</i></pre></div>
+ </div>
+ <div class="subsect depth3" id="s3.2.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Result mapping</span></h4>
+ <p>The return value of a callout method may be provided by a result mapping:
+
+ </p>
+ <div class="listing plain"><pre>result <b>&lt;-</b> <i>expression</i></pre></div>
+ <p>The right hand side expression of a result mapping may use the special identifier
+ <code>result</code> to refer to the value returned by the base method.
+ <br />
+ In a method binding with parameter mappings, it is an error to use
+ <code>result</code> as the name of a regular method argument.
+
+ </p>
+ <h5 class="listing">Example code (Callout Parameter Mapping):</h5>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre>Integer absoluteValue(Integer integer) <b>-&gt;</b> <b>int</b> abs(<b>int</b> i) <em><b>with</b> {</em></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> integer.intValue() <b>-&gt;</b> i,</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <em>result</em> <b>&lt;-</b> <b>new</b> Integer(<em>result</em>)</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre><em>}</em></pre></td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ <div class="subsect depth3" id="s3.2.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Visible names</span></h4>
+ <p>Each identifier that appears within the expressions of a parameter
+ mapping must be either:
+
+ </p>
+ <ul>
+ <li>a feature visible in the scope of the role instance.</li>
+ <li>a parameter of the role method (for parameter mappings).</li>
+ <li>the special name <code>result</code> (for result mappings).
+ </li>
+ <li>in a result mapping also the special name <code>base</code> can be used
+ in order to refer to the bound base instance (provided the method being
+ bound is not static).
+ </li>
+ </ul>
+ <p>The names of base method arguments (i.e., names after mapping) are only
+ legal in the position given in <a href="#s3.2.b" title="&sect;3.2.(b)&nbsp;Mapping one parameter"
+ class="sect">&sect;3.2.(b)</a>.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.2.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Implicit parameter mappings</span></h4>
+ <p>If parameter mappings should be omitted the following conditions must hold:
+
+ </p>
+ <ol>
+ <li>each method parameter of the role method must conform to the
+ corresponding parameter of the base method, <em>and</em></li>
+ <li>the result type of the base method must conform to the result type
+ of the role method.
+ </li>
+ </ol>
+ <p>Here conformance includes translation polymorphism (cf. <a href="s3.3.d.html" title="&sect;3.3.(d)&nbsp;Typing rules" class="sect">&sect;3.3.(d)</a>).
+ <br />
+ Parameter correspondence without parameter mapping is determined by declaration order not by names.
+ <br />
+ Two adjustments can, however, be performed implicitly:
+
+ </p>
+ <ul>
+ <li>If the role method has more parameters than the base method,
+ unused trailing parameters may be silently ignored.
+ </li>
+ <li>If the role method returns <code>void</code>, any result from
+ the base method may be silently ignored.
+ </li>
+ </ul>
+ </div>
+ <h5 class="listing">Example code (Callout with Parameter Mapping):</h5>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> MyTeamA {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>public</b> <b>abstract</b> <b>class</b> Role1 {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>abstract</b> <b>void</b> payEuro(float euro);</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <b>abstract</b> float earnEuro();</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> <b>void</b> idle(<b>int</b> seconds) { <span class="comment">/* do nothing */</span> };</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> Role1 boss, worker = <span class="comment">// initialization omitted</span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre> <b>public</b> <b>void</b> transaction () {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre> boss.payEuro(worker.earnEuro());</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">10</td>
+ <td><pre> boss.idle(123);</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">11</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">12</td>
+ <td><pre>}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">13</td>
+ <td><pre><b>public</b> <b>class</b> Staff { <span class="comment">// a base class </span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">14</td>
+ <td><pre> <b>public</b> <b>void</b> payDM (float dm) { … };</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">15</td>
+ <td><pre> <b>public</b> float earnDM () { … };</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">16</td>
+ <td><pre> <b>public</b> <b>int</b> doze() { … };</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">17</td>
+ <td><pre> <span class="comment">// other methods omitted</span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">18</td>
+ <td><pre>}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">19</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> MySubTeam <b>extends</b> MyTeamA {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">20</td>
+ <td><pre> <b>public</b> <b>class</b> Role1 <b>playedBy</b> Staff {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">21</td>
+ <td><pre> <b>void</b> payEuro(float euro) <b>-&gt;</b> <b>void</b> payDM(float dm) <b>with</b> {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">22</td>
+ <td><pre> euro * 1.95583f <b>-&gt;</b> dm</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">23</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">24</td>
+ <td><pre> float earnEuro() <b>-&gt;</b> float earnDM () <b>with</b> {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">25</td>
+ <td><pre> result <b>&lt;-</b> result / 1.95583f</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">26</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">27</td>
+ <td><pre> idle <b>=&gt;</b> doze; <span class="comment">// override existing implementation of idle()</span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">28</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">29</td>
+ <td><pre> <b>void</b> doit() {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">30</td>
+ <td><pre> transaction();</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">31</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">32</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="codecomment">
+ <h5>Effects:</h5>
+ <ul>
+ <li>Class <code>MyTeamA</code> is declaratively complete and can be
+ type checked because it only uses methods that are visible or declared within this
+ context. <code>MyTeamA.Role1</code> can, however, not be instantiated, because it is
+ abstract.
+ </li>
+ <li>Line 30 has the normal effect of invoking <code>transaction</code>.
+ </li>
+ <li>When executing <code>transaction</code>, the call of <code>worker.earnEuro()</code>
+ is forwarded to the corresponding base object using method <code>earnDM()</code>
+ (binding declaration in line 24).
+ The result is converted by "<code>result / 1.95583f</code>" (line 25).
+ </li>
+ <li>Within the same execution of <code>transaction</code>, the call of
+ <code>boss.payEuro()</code>
+ is forwarded to the corresponding base object using method <code>payDM()</code>
+ (binding declaration in line 21).
+ The parameter <code>euro</code> is converted by "<code>euro * 1.95583f</code>"
+ (line 22).
+ </li>
+ <li>Method <code>idle</code> is forwarded to <code>doze</code> without any
+ parameter mapping. This requires <code>doze</code> to have a signature
+ that is conformable to the signature of <code>idle</code>.
+ In this case a role parameter and a base result are ignored.<br />
+ Using the <code>=&gt;</code> operator, this binding overrides the existing
+ implementation of <code>idle</code>.
+ </li>
+ </ul>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s3.1.html" rel="prev">&lt;&lt;&nbsp;&sect;3.1&nbsp;Callout method binding</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s3.3.html" rel="next">&sect;3.3&nbsp;Lifting and lowering&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.3.a.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.3.a.html
new file mode 100644
index 000000000..e3e30b3db
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.3.a.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s3.3.b.html" rel="next">&sect;3.3.(b)&nbsp;Parameter translation&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s3.3.html" rel="section">&sect;3.3&nbsp;Lifting and lowering</a></div>
+ <div class="subsect depth3" id="s3.3.a">
+ <h4 class="subsect">&sect;3.3.(a)&nbsp;<span class="title">Call target translation</span></h4>
+ <p>Invoking a base method due to a callout binding first
+ <strong>lowers</strong> the role object in order to obtain the effective call target.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s3.3.b.html" rel="next">&sect;3.3.(b)&nbsp;Parameter translation&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s3.3.html" rel="section">&sect;3.3&nbsp;Lifting and lowering</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.3.b.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.3.b.html
new file mode 100644
index 000000000..c53fbca69
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.3.b.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s3.3.a.html" rel="prev">&lt;&lt;&nbsp;&sect;3.3.(a)&nbsp;Call target translation</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s3.3.c.html" rel="next">&sect;3.3.(c)&nbsp;Result translation&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s3.3.html" rel="section">&sect;3.3&nbsp;Lifting and lowering</a></div>
+ <div class="subsect depth3" id="s3.3.b">
+ <h4 class="subsect">&sect;3.3.(b)&nbsp;<span class="title">Parameter translation</span></h4>
+ <p>Passing a role object as parameter to a callout method implicitly <strong>lowers</strong>
+ this parameter, if the base method declares a corresponding base type parameter.
+ <br />
+ Lifting of callout parameters is not possible.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s3.3.a.html" rel="prev">&lt;&lt;&nbsp;&sect;3.3.(a)&nbsp;Call target translation</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s3.3.c.html" rel="next">&sect;3.3.(c)&nbsp;Result translation&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s3.3.html" rel="section">&sect;3.3&nbsp;Lifting and lowering</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.3.c.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.3.c.html
new file mode 100644
index 000000000..2b45bb463
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.3.c.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s3.3.b.html" rel="prev">&lt;&lt;&nbsp;&sect;3.3.(b)&nbsp;Parameter translation</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s3.3.d.html" rel="next">&sect;3.3.(d)&nbsp;Typing rules&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s3.3.html" rel="section">&sect;3.3&nbsp;Lifting and lowering</a></div>
+ <div class="subsect depth3" id="s3.3.c">
+ <h4 class="subsect">&sect;3.3.(c)&nbsp;<span class="title">Result translation</span></h4>
+ <p> When returning a base object from a callout method where the role
+ method declares the result to be of a role class,
+ this object is implicitly <strong>lifted</strong> to the appropriate role.
+ <br />
+ Lowering the result of a callout binding is not possible.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s3.3.b.html" rel="prev">&lt;&lt;&nbsp;&sect;3.3.(b)&nbsp;Parameter translation</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s3.3.d.html" rel="next">&sect;3.3.(d)&nbsp;Typing rules&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s3.3.html" rel="section">&sect;3.3&nbsp;Lifting and lowering</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.3.d.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.3.d.html
new file mode 100644
index 000000000..bfe5d280b
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.3.d.html
@@ -0,0 +1,61 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s3.3.c.html" rel="prev">&lt;&lt;&nbsp;&sect;3.3.(c)&nbsp;Result translation</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s3.3.e.html" rel="next">&sect;3.3.(e)&nbsp;Role arrays&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s3.3.html" rel="section">&sect;3.3&nbsp;Lifting and lowering</a></div>
+ <div class="subsect depth3" id="s3.3.d">
+ <h4 class="subsect">&sect;3.3.(d)&nbsp;<span class="title">Typing rules</span></h4>
+ <p>A parameter mapping (implicit by parameter position or explicit
+ by a <code>with</code> clause) is <strong>well typed</strong> if
+ the left hand side conforms to the right hand side, either by
+
+ </p>
+ <ul>
+ <li>type equality</li>
+ <li>implicit primitive type conversion</li>
+ <li>subtype polymorphism</li>
+ <li>translation polymorphism, here: <em>lowering</em>,
+ </li>
+ <li><em>or</em> by a combination of the above.
+ </li>
+ </ul>
+ <p>A result mapping (implicit or explicit by a <code>with</code> clause)
+ is well typed, if the value at the right hand side conforms to the
+ left hand side according to the rules given above, except that
+ translation polymorphism here applies <em>lifting</em> instead of
+ lowering.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s3.3.c.html" rel="prev">&lt;&lt;&nbsp;&sect;3.3.(c)&nbsp;Result translation</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s3.3.e.html" rel="next">&sect;3.3.(e)&nbsp;Role arrays&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s3.3.html" rel="section">&sect;3.3&nbsp;Lifting and lowering</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.3.e.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.3.e.html
new file mode 100644
index 000000000..49d74b66c
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.3.e.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s3.3.d.html" rel="prev">&lt;&lt;&nbsp;&sect;3.3.(d)&nbsp;Typing rules</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s3.3.html" rel="section">&sect;3.3&nbsp;Lifting and lowering</a></div>
+ <div class="subsect depth3" id="s3.3.e">
+ <h4 class="subsect">&sect;3.3.(e)&nbsp;<span class="title">Role arrays</span></h4>
+ <p>For arrays of roles as parameters <a href="s2.2.e.html" title="&sect;2.2.(e)&nbsp;Lowering of arrays"
+ class="sect">&sect;2.2.(e)</a> applies accordingly.
+ For arrays as a return value <a href="s2.3.d.html" title="&sect;2.3.(d)&nbsp;Lifting of arrays"
+ class="sect">&sect;2.3.(d)</a> applies.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s3.3.d.html" rel="prev">&lt;&lt;&nbsp;&sect;3.3.(d)&nbsp;Typing rules</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s3.3.html" rel="section">&sect;3.3&nbsp;Lifting and lowering</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.3.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.3.html
new file mode 100644
index 000000000..dfdc8ff8f
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.3.html
@@ -0,0 +1,102 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s3.2.html" rel="prev">&lt;&lt;&nbsp;&sect;3.2&nbsp;Callout parameter mapping</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s3.4.html" rel="next">&sect;3.4&nbsp;Overriding access restrictions&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a></div>
+ <div class="sect depth2" id="s3.3">
+ <h2 class="sect">&sect;3.3&nbsp;Lifting and lowering</h2>
+ <p> (For basic definitions see <a href="s2.2.html" title="&sect;2.2&nbsp;Lowering" class="sect">&sect;2.2</a> and <a href="s2.3.html" title="&sect;2.3&nbsp;Lifting" class="sect">&sect;2.3</a>)
+
+ </p>
+ <div class="subsect depth3" id="s3.3.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Call target translation</span></h4>
+ <p>Invoking a base method due to a callout binding first
+ <strong>lowers</strong> the role object in order to obtain the effective call target.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.3.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Parameter translation</span></h4>
+ <p>Passing a role object as parameter to a callout method implicitly <strong>lowers</strong>
+ this parameter, if the base method declares a corresponding base type parameter.
+ <br />
+ Lifting of callout parameters is not possible.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.3.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Result translation</span></h4>
+ <p> When returning a base object from a callout method where the role
+ method declares the result to be of a role class,
+ this object is implicitly <strong>lifted</strong> to the appropriate role.
+ <br />
+ Lowering the result of a callout binding is not possible.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.3.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Typing rules</span></h4>
+ <p>A parameter mapping (implicit by parameter position or explicit
+ by a <code>with</code> clause) is <strong>well typed</strong> if
+ the left hand side conforms to the right hand side, either by
+
+ </p>
+ <ul>
+ <li>type equality</li>
+ <li>implicit primitive type conversion</li>
+ <li>subtype polymorphism</li>
+ <li>translation polymorphism, here: <em>lowering</em>,
+ </li>
+ <li><em>or</em> by a combination of the above.
+ </li>
+ </ul>
+ <p>A result mapping (implicit or explicit by a <code>with</code> clause)
+ is well typed, if the value at the right hand side conforms to the
+ left hand side according to the rules given above, except that
+ translation polymorphism here applies <em>lifting</em> instead of
+ lowering.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.3.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Role arrays</span></h4>
+ <p>For arrays of roles as parameters <a href="s2.2.e.html" title="&sect;2.2.(e)&nbsp;Lowering of arrays"
+ class="sect">&sect;2.2.(e)</a> applies accordingly.
+ For arrays as a return value <a href="s2.3.d.html" title="&sect;2.3.(d)&nbsp;Lifting of arrays"
+ class="sect">&sect;2.3.(d)</a> applies.
+
+ </p>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s3.2.html" rel="prev">&lt;&lt;&nbsp;&sect;3.2&nbsp;Callout parameter mapping</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s3.4.html" rel="next">&sect;3.4&nbsp;Overriding access restrictions&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.4.a.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.4.a.html
new file mode 100644
index 000000000..3be1b293a
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.4.a.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s3.4.b.html" rel="next">&sect;3.4.(b)&nbsp;Sealing against decapsulation&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s3.4.html" rel="section">&sect;3.4&nbsp;Overriding access restrictions</a></div>
+ <div class="subsect depth3" id="s3.4.a">
+ <h4 class="subsect">&sect;3.4.(a)&nbsp;<span class="title">Callout to inaccessible base method</span></h4>
+ <p>By means of <strong>callout</strong> bindings it is possible to access
+ methods of a base class regardless of their access modifiers.
+ Method bindings are the only place in a program which may mention otherwise
+ inaccessible methods.
+ Access to the callout method at the role side is controlled by regular mechanisms,
+ based on the declaration of the role method.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s3.4.b.html" rel="next">&sect;3.4.(b)&nbsp;Sealing against decapsulation&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s3.4.html" rel="section">&sect;3.4&nbsp;Overriding access restrictions</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.4.b.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.4.b.html
new file mode 100644
index 000000000..876d011ea
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.4.b.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s3.4.a.html" rel="prev">&lt;&lt;&nbsp;&sect;3.4.(a)&nbsp;Callout to inaccessible base method</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s3.4.c.html" rel="next">&sect;3.4.(c)&nbsp;Warning levels&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s3.4.html" rel="section">&sect;3.4&nbsp;Overriding access restrictions</a></div>
+ <div class="subsect depth3" id="s3.4.b">
+ <h4 class="subsect">&sect;3.4.(b)&nbsp;<span class="title">Sealing against decapsulation</span></h4>
+ <p>A base package may be "sealed" which re-establishes the standard Java visibility rules.
+ <br />
+ Sealing is achieved by the corresponding capability of Jar files.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s3.4.a.html" rel="prev">&lt;&lt;&nbsp;&sect;3.4.(a)&nbsp;Callout to inaccessible base method</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s3.4.c.html" rel="next">&sect;3.4.(c)&nbsp;Warning levels&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s3.4.html" rel="section">&sect;3.4&nbsp;Overriding access restrictions</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.4.c.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.4.c.html
new file mode 100644
index 000000000..871d48e61
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.4.c.html
@@ -0,0 +1,63 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s3.4.b.html" rel="prev">&lt;&lt;&nbsp;&sect;3.4.(b)&nbsp;Sealing against decapsulation</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s3.4.d.html" rel="next">&sect;3.4.(d)&nbsp;Private methods from super classes&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s3.4.html" rel="section">&sect;3.4&nbsp;Overriding access restrictions</a></div>
+ <div class="subsect depth3" id="s3.4.c">
+ <h4 class="subsect">&sect;3.4.(c)&nbsp;<span class="title">Warning levels</span></h4>
+ <p>A compiler should signal any occurrence of decapsulation.
+ If a compiler supports to configure warnings this may be used to let the user choose to
+ (a) ignore base class decapsulation, (b) treat it as a warning or even
+ (c) treat it as an error (cf. <a href="s2.1.2.c.html" title="&sect;2.1.2.(c)&nbsp;Base class decapsulation"
+ class="sect">&sect;2.1.2.(c)</a>).
+ <br />
+ Optionally, a batch compiler may support three levels of verbosity with respect to decapsulation:
+
+ </p>
+ <table border="1">
+ <tr>
+ <td rowspan="1" colspan="1"><tt>-nodecapsulation</tt></td>
+ <td rowspan="1" colspan="1">No warnings.</td>
+ </tr>
+ <tr>
+ <td rowspan="1" colspan="1"><em>default</em></td>
+ <td rowspan="1" colspan="1">Warn only if/that access restrictions are overridden.</td>
+ </tr>
+ <tr>
+ <td rowspan="1" colspan="1"><tt>-decapsulation</tt></td>
+ <td rowspan="1" colspan="1">Detailed messages containing the binding and the hidden base method.</td>
+ </tr>
+ </table>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s3.4.b.html" rel="prev">&lt;&lt;&nbsp;&sect;3.4.(b)&nbsp;Sealing against decapsulation</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s3.4.d.html" rel="next">&sect;3.4.(d)&nbsp;Private methods from super classes&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s3.4.html" rel="section">&sect;3.4&nbsp;Overriding access restrictions</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.4.d.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.4.d.html
new file mode 100644
index 000000000..61d36b361
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.4.d.html
@@ -0,0 +1,108 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s3.4.c.html" rel="prev">&lt;&lt;&nbsp;&sect;3.4.(c)&nbsp;Warning levels</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s3.4.html" rel="section">&sect;3.4&nbsp;Overriding access restrictions</a></div>
+ <div class="subsect depth3" id="s3.4.d">
+ <h4 class="subsect">&sect;3.4.(d)&nbsp;<span class="title">Private methods from super classes</span></h4>
+ <p>If a callout binding shall bind to a private base method, that method
+ must be defined in the exact base class to which the current role
+ class is bound using <code>playedBy</code>. I.e., for private methods
+ <a href="s3.1.d.html"
+ title="&sect;3.1.(d)&nbsp;Inheritance of role method declarations"
+ class="sect">&sect;3.1.(d)</a> does not hold.
+ <br />
+ The same holds for private base fields (see below).
+ <br />
+ If a private base feature must indeed be callout-bound, a role class
+ must be defined that is played by the exact base class defining the
+ private feature. Another role bound to a sub-base-class can then
+ be defined as a sub class of the first role. It will inherit the
+ callout binding and through this it can access the desired feature.
+
+ </p>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>class</b> SuperBase {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <em><b>private</b> <b>int</b> secret;</em></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre>}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre><b>public</b> <b>class</b> SubBase <b>extends</b> SuperBase { <span class="comment">/* details omitted */</span> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> MyTeam {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> <b>protected</b> <b>class</b> SuperRole <b>playedBy</b> SuperBase {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> <b>int</b> steal() <b>-&gt;</b> <b>get</b> <b>int</b> <em>secret</em>; <span class="comment">// <span class="green"><strong>OK</strong></span></span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre> <b>protected</b> <b>class</b> SubRole <b>extends</b> SuperRole <b>playedBy</b> SubBase {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">10</td>
+ <td><pre> <b>int</b> steal() <b>-&gt;</b> <b>get</b> <b>int</b> <em>secret</em>; <span class="comment">// <span class="error"><strong>illegal!</strong></span></span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">11</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">12</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s3.4.c.html" rel="prev">&lt;&lt;&nbsp;&sect;3.4.(c)&nbsp;Warning levels</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s3.4.html" rel="section">&sect;3.4&nbsp;Overriding access restrictions</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.4.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.4.html
new file mode 100644
index 000000000..49558486e
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.4.html
@@ -0,0 +1,177 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s3.3.html" rel="prev">&lt;&lt;&nbsp;&sect;3.3&nbsp;Lifting and lowering</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s3.5.html" rel="next">&sect;3.5&nbsp;Callout to field&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a></div>
+ <div class="sect depth2" id="s3.4">
+ <h2 class="sect">&sect;3.4&nbsp;Overriding access restrictions</h2>
+ <p>In contrast to normal access restrictions, method bindings
+ may refer to hidden base methods.
+ This concept is the inverse of encapsulation, hence it is called
+ <strong>decapsulation</strong>.
+ <br />
+ Decapsulation may occur in these positions:
+
+ </p>
+ <ul>
+ <li><code>playedBy</code> declaration (see <a href="s2.1.2.c.html" title="&sect;2.1.2.(c)&nbsp;Base class decapsulation"
+ class="sect">&sect;2.1.2.(c)</a>)
+ </li>
+ <li>base constructor call (see <a href="s2.4.2.b.html" title="&sect;2.4.2.(b)&nbsp;Bound roles" class="sect">&sect;2.4.2.(b)</a>).
+ </li>
+ <li>callout bindings (see next)</li>
+ <li>callout to field (see <a href="s3.5.e.html" title="&sect;3.5.(e)&nbsp;Access control" class="sect">&sect;3.5.(e)</a>)
+ </li>
+ <li>base call within a callin method (see <a href="s4.6.html" title="&sect;4.6&nbsp;Overriding access restrictions"
+ class="sect">&sect;4.6</a>)
+ </li>
+ </ul>
+ <div class="subsect depth3" id="s3.4.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Callout to inaccessible base method</span></h4>
+ <p>By means of <strong>callout</strong> bindings it is possible to access
+ methods of a base class regardless of their access modifiers.
+ Method bindings are the only place in a program which may mention otherwise
+ inaccessible methods.
+ Access to the callout method at the role side is controlled by regular mechanisms,
+ based on the declaration of the role method.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.4.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Sealing against decapsulation</span></h4>
+ <p>A base package may be "sealed" which re-establishes the standard Java visibility rules.
+ <br />
+ Sealing is achieved by the corresponding capability of Jar files.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.4.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Warning levels</span></h4>
+ <p>A compiler should signal any occurrence of decapsulation.
+ If a compiler supports to configure warnings this may be used to let the user choose to
+ (a) ignore base class decapsulation, (b) treat it as a warning or even
+ (c) treat it as an error (cf. <a href="s2.1.2.c.html" title="&sect;2.1.2.(c)&nbsp;Base class decapsulation"
+ class="sect">&sect;2.1.2.(c)</a>).
+ <br />
+ Optionally, a batch compiler may support three levels of verbosity with respect to decapsulation:
+
+ </p>
+ <table border="1">
+ <tr>
+ <td rowspan="1" colspan="1"><tt>-nodecapsulation</tt></td>
+ <td rowspan="1" colspan="1">No warnings.</td>
+ </tr>
+ <tr>
+ <td rowspan="1" colspan="1"><em>default</em></td>
+ <td rowspan="1" colspan="1">Warn only if/that access restrictions are overridden.</td>
+ </tr>
+ <tr>
+ <td rowspan="1" colspan="1"><tt>-decapsulation</tt></td>
+ <td rowspan="1" colspan="1">Detailed messages containing the binding and the hidden base method.</td>
+ </tr>
+ </table>
+ </div>
+ <div class="subsect depth3" id="s3.4.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Private methods from super classes</span></h4>
+ <p>If a callout binding shall bind to a private base method, that method
+ must be defined in the exact base class to which the current role
+ class is bound using <code>playedBy</code>. I.e., for private methods
+ <a href="s3.1.d.html"
+ title="&sect;3.1.(d)&nbsp;Inheritance of role method declarations"
+ class="sect">&sect;3.1.(d)</a> does not hold.
+ <br />
+ The same holds for private base fields (see below).
+ <br />
+ If a private base feature must indeed be callout-bound, a role class
+ must be defined that is played by the exact base class defining the
+ private feature. Another role bound to a sub-base-class can then
+ be defined as a sub class of the first role. It will inherit the
+ callout binding and through this it can access the desired feature.
+
+ </p>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>class</b> SuperBase {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <em><b>private</b> <b>int</b> secret;</em></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre>}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre><b>public</b> <b>class</b> SubBase <b>extends</b> SuperBase { <span class="comment">/* details omitted */</span> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> MyTeam {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> <b>protected</b> <b>class</b> SuperRole <b>playedBy</b> SuperBase {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> <b>int</b> steal() <b>-&gt;</b> <b>get</b> <b>int</b> <em>secret</em>; <span class="comment">// <span class="green"><strong>OK</strong></span></span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre> <b>protected</b> <b>class</b> SubRole <b>extends</b> SuperRole <b>playedBy</b> SubBase {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">10</td>
+ <td><pre> <b>int</b> steal() <b>-&gt;</b> <b>get</b> <b>int</b> <em>secret</em>; <span class="comment">// <span class="error"><strong>illegal!</strong></span></span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">11</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">12</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s3.3.html" rel="prev">&lt;&lt;&nbsp;&sect;3.3&nbsp;Lifting and lowering</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s3.5.html" rel="next">&sect;3.5&nbsp;Callout to field&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.5.a.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.5.a.html
new file mode 100644
index 000000000..e3bd073d3
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.5.a.html
@@ -0,0 +1,69 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s3.5.b.html" rel="next">&sect;3.5.(b)&nbsp;Compatibility&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s3.5.html" rel="section">&sect;3.5&nbsp;Callout to field</a></div>
+ <div class="subsect depth3" id="s3.5.a">
+ <h4 class="subsect">&sect;3.5.(a)&nbsp;<span class="title">Syntax</span></h4>
+ <p>Using one of the callout modifiers <code>get</code> or <code>set</code> a role method
+ can be bound to a field of the role's base class:
+
+ </p>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre>getValue <b>-&gt;</b> <em>get</em> value;</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre>setValue <b>-&gt;</b> <em>set</em> value;</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre><b>int</b> getValue() <b>-&gt;</b> <em>get</em> <b>int</b> value;</pre></td>
+ </tr>
+ </table>
+ </div>
+ <p>where <code>getValue</code>, <code>setValue</code> are abstract role methods of
+ appropriate signatures and <code>value</code> is a field of the bound base class.
+ <br />
+ A longer syntax is available, too (see line 3 above), which uses complete signatures.
+ For the left hand side <a href="s3.1.c.html" title="&sect;3.1.(c)&nbsp;Kinds of method designators"
+ class="sect">&sect;3.1.(c)</a> applies, for the
+ right hand side, this longer version prepends the field type to the field name.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s3.5.b.html" rel="next">&sect;3.5.(b)&nbsp;Compatibility&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s3.5.html" rel="section">&sect;3.5&nbsp;Callout to field</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.5.b.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.5.b.html
new file mode 100644
index 000000000..2eba6dde7
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.5.b.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s3.5.a.html" rel="prev">&lt;&lt;&nbsp;&sect;3.5.(a)&nbsp;Syntax</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s3.5.c.html" rel="next">&sect;3.5.(c)&nbsp;Value mapping&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s3.5.html" rel="section">&sect;3.5&nbsp;Callout to field</a></div>
+ <div class="subsect depth3" id="s3.5.b">
+ <h4 class="subsect">&sect;3.5.(b)&nbsp;<span class="title">Compatibility</span></h4>
+ <p>A role method bound with the modifier <code>get</code>
+ should have no arguments
+ (it <em>may</em> have arbitrary arguments, which are silently ignored)
+ and should have a return type to which the base field is compatible.
+ A role method returning void will ignore the given value and thus has
+ no effect at all, which will be signaled by a compiler warning.
+ <br />
+ A role method bound with the modifier <code>set</code> must have a first argument
+ that is compatible to the base field's type (additional arguments - if present -
+ are silently ignored) and must not declare a return type.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s3.5.a.html" rel="prev">&lt;&lt;&nbsp;&sect;3.5.(a)&nbsp;Syntax</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s3.5.c.html" rel="next">&sect;3.5.(c)&nbsp;Value mapping&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s3.5.html" rel="section">&sect;3.5&nbsp;Callout to field</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.5.c.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.5.c.html
new file mode 100644
index 000000000..7617cc6c6
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.5.c.html
@@ -0,0 +1,68 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s3.5.b.html" rel="prev">&lt;&lt;&nbsp;&sect;3.5.(b)&nbsp;Compatibility</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s3.5.d.html" rel="next">&sect;3.5.(d)&nbsp;Effect&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s3.5.html" rel="section">&sect;3.5&nbsp;Callout to field</a></div>
+ <div class="subsect depth3" id="s3.5.c">
+ <h4 class="subsect">&sect;3.5.(c)&nbsp;<span class="title">Value mapping</span></h4>
+ <p>Values can be mapped similar to parameter mappings in pure method bindings
+ (<a href="s3.2.html" title="&sect;3.2&nbsp;Callout parameter mapping"
+ class="sect">&sect;3.2</a>). Such mappings can be used to establish compatibility as required above.
+ <br />
+ In both <code>get</code> and <code>set</code> bindings, the base side value is denoted
+ by the field's name (lines 2 and 4 below).
+
+ </p>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre>Integer getValue() -&gt; <em>get</em> <b>int</b> val</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <em>with</em> { result &lt;- <b>new</b> Integer(val) }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre><b>void</b> setValue(Integer i) -&gt; <em>set</em> <b>int</b> val</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <em>with</em> { i.intValue() -&gt; val }</pre></td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s3.5.b.html" rel="prev">&lt;&lt;&nbsp;&sect;3.5.(b)&nbsp;Compatibility</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s3.5.d.html" rel="next">&sect;3.5.(d)&nbsp;Effect&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s3.5.html" rel="section">&sect;3.5&nbsp;Callout to field</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.5.d.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.5.d.html
new file mode 100644
index 000000000..55ec94c3c
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.5.d.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s3.5.c.html" rel="prev">&lt;&lt;&nbsp;&sect;3.5.(c)&nbsp;Value mapping</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s3.5.e.html" rel="next">&sect;3.5.(e)&nbsp;Access control&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s3.5.html" rel="section">&sect;3.5&nbsp;Callout to field</a></div>
+ <div class="subsect depth3" id="s3.5.d">
+ <h4 class="subsect">&sect;3.5.(d)&nbsp;<span class="title">Effect</span></h4>
+ <p>Callout-binding a role method to a base field generates an implementation for
+ this role method, by which it acts as a getter or setter for the given
+ field of the associated base object.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s3.5.c.html" rel="prev">&lt;&lt;&nbsp;&sect;3.5.(c)&nbsp;Value mapping</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s3.5.e.html" rel="next">&sect;3.5.(e)&nbsp;Access control&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s3.5.html" rel="section">&sect;3.5&nbsp;Callout to field</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.5.e.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.5.e.html
new file mode 100644
index 000000000..f485a827a
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.5.e.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s3.5.d.html" rel="prev">&lt;&lt;&nbsp;&sect;3.5.(d)&nbsp;Effect</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s3.5.f.html" rel="next">&sect;3.5.(f)&nbsp;Shorthand definition&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s3.5.html" rel="section">&sect;3.5&nbsp;Callout to field</a></div>
+ <div class="subsect depth3" id="s3.5.e">
+ <h4 class="subsect">&sect;3.5.(e)&nbsp;<span class="title">Access control</span></h4>
+ <p>For accessing an otherwise invisible field, the rules for
+ <a href="s3.4.html" title="&sect;3.4&nbsp;Overriding access restrictions"
+ class="sect">decapsulation (&sect;3.4)</a> apply accordingly.
+ <br />
+ Recall, that according to
+ <a href="http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#40898"
+ class="ext">JLS &sect;8.3</a>
+ fields may be hidden in sub-classes of a given base class. Therefore, it is relevant to know that a callout to
+ a field will always access the field that is visible in the exact base
+ class of the role class defining the callout. This is especially relevant
+ for accessing private fields.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s3.5.d.html" rel="prev">&lt;&lt;&nbsp;&sect;3.5.(d)&nbsp;Effect</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s3.5.f.html" rel="next">&sect;3.5.(f)&nbsp;Shorthand definition&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s3.5.html" rel="section">&sect;3.5&nbsp;Callout to field</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.5.f.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.5.f.html
new file mode 100644
index 000000000..5257de625
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.5.f.html
@@ -0,0 +1,55 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s3.5.e.html" rel="prev">&lt;&lt;&nbsp;&sect;3.5.(e)&nbsp;Access control</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s3.5.g.html" rel="next">&sect;3.5.(g)&nbsp;Callout override&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s3.5.html" rel="section">&sect;3.5&nbsp;Callout to field</a></div>
+ <div class="subsect depth3" id="s3.5.f">
+ <h4 class="subsect">&sect;3.5.(f)&nbsp;<span class="title">Shorthand definition</span></h4>
+ <p>Just as in <a href="s3.1.i.html" title="&sect;3.1.(i)&nbsp;Shorthand definition"
+ class="sect">&sect;3.1.(i)</a> a shorthand definition allows to introduce
+ a callout field access method without prior abstract declaration.
+ This requires the callout field binding to specify types as in line 3 of <a href="s3.5.a.html" title="&sect;3.5.(a)&nbsp;Syntax" class="sect">&sect;3.5.(a)</a> above.
+ The generated access method is static iff the bound base field is static.
+
+ </p>
+ <p>
+ A shorthand callout to field may optionally declare a <strong>visibility modifier</strong>,
+ otherwise the generated method inherits the visibility modifier of the bound base field.
+ No further modifiers are set.
+ If a callout to field overrides an inherited method or callout,
+ it must not reduce the visibility of the inherited method/callout.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s3.5.e.html" rel="prev">&lt;&lt;&nbsp;&sect;3.5.(e)&nbsp;Access control</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s3.5.g.html" rel="next">&sect;3.5.(g)&nbsp;Callout override&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s3.5.html" rel="section">&sect;3.5&nbsp;Callout to field</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.5.g.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.5.g.html
new file mode 100644
index 000000000..84397655c
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.5.g.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s3.5.f.html" rel="prev">&lt;&lt;&nbsp;&sect;3.5.(f)&nbsp;Shorthand definition</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s3.5.h.html" rel="next">&sect;3.5.(h)&nbsp;Inferred callout&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s3.5.html" rel="section">&sect;3.5&nbsp;Callout to field</a></div>
+ <div class="subsect depth3" id="s3.5.g">
+ <h4 class="subsect">&sect;3.5.(g)&nbsp;<span class="title">Callout override</span></h4>
+ <p>Similar to method callouts a callout to field may override an existing role
+ method if and only if the token <code>=&gt;</code> is used instead of <code>-&gt;</code>
+ (see <a href="s3.1.e.html" title="&sect;3.1.(e)&nbsp;Callout override" class="sect">&sect;3.1.(e)</a> and <a href="s3.1.f.html"
+ title="&sect;3.1.(f)&nbsp;Inheritance of callout bindings"
+ class="sect">&sect;3.1.(f)</a>).
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s3.5.f.html" rel="prev">&lt;&lt;&nbsp;&sect;3.5.(f)&nbsp;Shorthand definition</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s3.5.h.html" rel="next">&sect;3.5.(h)&nbsp;Inferred callout&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s3.5.html" rel="section">&sect;3.5&nbsp;Callout to field</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.5.h.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.5.h.html
new file mode 100644
index 000000000..dca3ed92d
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.5.h.html
@@ -0,0 +1,78 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s3.5.g.html" rel="prev">&lt;&lt;&nbsp;&sect;3.5.(g)&nbsp;Callout override</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s3.5.html" rel="section">&sect;3.5&nbsp;Callout to field</a></div>
+ <div class="subsect depth3" id="s3.5.h">
+ <h4 class="subsect">&sect;3.5.(h)&nbsp;<span class="title">Inferred callout</span></h4>
+ <p> If a statement or expression within the body of a bound role class
+ uses a simple name or a name qualified by <code>this</code>
+ which can not be resolved using normal rules,
+ the compiler may infer to use a callout to field instead,
+ given that a field of the required name can be found in the role's declared baseclass.
+
+ </p>
+ <p> If a callout to field has explicitly been declared it is used for the otherwise
+ unresolved name, if and only if:
+
+ </p>
+ <ul>
+ <li>the callout declares a role method name the is constructed from the token "set" for
+ a setter or "get" for a getter plus the field name with capital first letter,
+ </li>
+ <li>the base field referenced by the callout has exactly the required name, and</li>
+ <li>the callout kind (set/get) matches the application of the unresolved name as either
+ the left-hand side of an assignment (set) or as an expression (get).
+ </li>
+ </ul>
+ <p>
+ If a matching callout to field is not found, the compiler generates one automatically,
+ which has <code>private</code> visibility.
+
+ </p>
+ <p>
+ If a callout to field has been inferred it is an error to directly invoke the
+ implicitly generated callout accessor that is formed according to the above rules.
+
+ </p>
+ <p>
+ Per default inferred callout bindings are disabled, i.e., a compiler
+ must report these as an error. However, a compiler should allow to
+ configure reporting to produce a warning only (which can be suppressed
+ using a <code>@SuppressWarnings("inferredcallout")</code> annotation),
+ or to completely ignore the diagnostic. See also <a href="s3.1.j.html" title="&sect;3.1.(j)&nbsp;Inferred callout" class="sect">&sect;3.1.(j)</a>.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s3.5.g.html" rel="prev">&lt;&lt;&nbsp;&sect;3.5.(g)&nbsp;Callout override</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s3.5.html" rel="section">&sect;3.5&nbsp;Callout to field</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.5.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.5.html
new file mode 100644
index 000000000..a1fcf7c7a
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.5.html
@@ -0,0 +1,214 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s3.4.html" rel="prev">&lt;&lt;&nbsp;&sect;3.4&nbsp;Overriding access restrictions</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a></div>
+ <div class="sect depth2" id="s3.5">
+ <h2 class="sect">&sect;3.5&nbsp;Callout to field</h2>
+ <p>Also fields of a base class can be made accessible using a callout binding.
+
+ </p>
+ <div class="subsect depth3" id="s3.5.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Syntax</span></h4>
+ <p>Using one of the callout modifiers <code>get</code> or <code>set</code> a role method
+ can be bound to a field of the role's base class:
+
+ </p>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre>getValue <b>-&gt;</b> <em>get</em> value;</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre>setValue <b>-&gt;</b> <em>set</em> value;</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre><b>int</b> getValue() <b>-&gt;</b> <em>get</em> <b>int</b> value;</pre></td>
+ </tr>
+ </table>
+ </div>
+ <p>where <code>getValue</code>, <code>setValue</code> are abstract role methods of
+ appropriate signatures and <code>value</code> is a field of the bound base class.
+ <br />
+ A longer syntax is available, too (see line 3 above), which uses complete signatures.
+ For the left hand side <a href="s3.1.c.html" title="&sect;3.1.(c)&nbsp;Kinds of method designators"
+ class="sect">&sect;3.1.(c)</a> applies, for the
+ right hand side, this longer version prepends the field type to the field name.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.5.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Compatibility</span></h4>
+ <p>A role method bound with the modifier <code>get</code>
+ should have no arguments
+ (it <em>may</em> have arbitrary arguments, which are silently ignored)
+ and should have a return type to which the base field is compatible.
+ A role method returning void will ignore the given value and thus has
+ no effect at all, which will be signaled by a compiler warning.
+ <br />
+ A role method bound with the modifier <code>set</code> must have a first argument
+ that is compatible to the base field's type (additional arguments - if present -
+ are silently ignored) and must not declare a return type.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.5.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Value mapping</span></h4>
+ <p>Values can be mapped similar to parameter mappings in pure method bindings
+ (<a href="s3.2.html" title="&sect;3.2&nbsp;Callout parameter mapping"
+ class="sect">&sect;3.2</a>). Such mappings can be used to establish compatibility as required above.
+ <br />
+ In both <code>get</code> and <code>set</code> bindings, the base side value is denoted
+ by the field's name (lines 2 and 4 below).
+
+ </p>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre>Integer getValue() -&gt; <em>get</em> <b>int</b> val</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <em>with</em> { result &lt;- <b>new</b> Integer(val) }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre><b>void</b> setValue(Integer i) -&gt; <em>set</em> <b>int</b> val</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <em>with</em> { i.intValue() -&gt; val }</pre></td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ <div class="subsect depth3" id="s3.5.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Effect</span></h4>
+ <p>Callout-binding a role method to a base field generates an implementation for
+ this role method, by which it acts as a getter or setter for the given
+ field of the associated base object.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.5.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Access control</span></h4>
+ <p>For accessing an otherwise invisible field, the rules for
+ <a href="s3.4.html" title="&sect;3.4&nbsp;Overriding access restrictions"
+ class="sect">decapsulation (&sect;3.4)</a> apply accordingly.
+ <br />
+ Recall, that according to
+ <a href="http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#40898"
+ class="ext">JLS &sect;8.3</a>
+ fields may be hidden in sub-classes of a given base class. Therefore, it is relevant to know that a callout to
+ a field will always access the field that is visible in the exact base
+ class of the role class defining the callout. This is especially relevant
+ for accessing private fields.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.5.f">
+ <h4 class="subsect">(f)&nbsp;<span class="title">Shorthand definition</span></h4>
+ <p>Just as in <a href="s3.1.i.html" title="&sect;3.1.(i)&nbsp;Shorthand definition"
+ class="sect">&sect;3.1.(i)</a> a shorthand definition allows to introduce
+ a callout field access method without prior abstract declaration.
+ This requires the callout field binding to specify types as in line 3 of <a href="#s3.5.a" title="&sect;3.5.(a)&nbsp;Syntax" class="sect">&sect;3.5.(a)</a> above.
+ The generated access method is static iff the bound base field is static.
+
+ </p>
+ <p>
+ A shorthand callout to field may optionally declare a <strong>visibility modifier</strong>,
+ otherwise the generated method inherits the visibility modifier of the bound base field.
+ No further modifiers are set.
+ If a callout to field overrides an inherited method or callout,
+ it must not reduce the visibility of the inherited method/callout.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.5.g">
+ <h4 class="subsect">(g)&nbsp;<span class="title">Callout override</span></h4>
+ <p>Similar to method callouts a callout to field may override an existing role
+ method if and only if the token <code>=&gt;</code> is used instead of <code>-&gt;</code>
+ (see <a href="s3.1.e.html" title="&sect;3.1.(e)&nbsp;Callout override" class="sect">&sect;3.1.(e)</a> and <a href="s3.1.f.html"
+ title="&sect;3.1.(f)&nbsp;Inheritance of callout bindings"
+ class="sect">&sect;3.1.(f)</a>).
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.5.h">
+ <h4 class="subsect">(h)&nbsp;<span class="title">Inferred callout</span></h4>
+ <p> If a statement or expression within the body of a bound role class
+ uses a simple name or a name qualified by <code>this</code>
+ which can not be resolved using normal rules,
+ the compiler may infer to use a callout to field instead,
+ given that a field of the required name can be found in the role's declared baseclass.
+
+ </p>
+ <p> If a callout to field has explicitly been declared it is used for the otherwise
+ unresolved name, if and only if:
+
+ </p>
+ <ul>
+ <li>the callout declares a role method name the is constructed from the token "set" for
+ a setter or "get" for a getter plus the field name with capital first letter,
+ </li>
+ <li>the base field referenced by the callout has exactly the required name, and</li>
+ <li>the callout kind (set/get) matches the application of the unresolved name as either
+ the left-hand side of an assignment (set) or as an expression (get).
+ </li>
+ </ul>
+ <p>
+ If a matching callout to field is not found, the compiler generates one automatically,
+ which has <code>private</code> visibility.
+
+ </p>
+ <p>
+ If a callout to field has been inferred it is an error to directly invoke the
+ implicitly generated callout accessor that is formed according to the above rules.
+
+ </p>
+ <p>
+ Per default inferred callout bindings are disabled, i.e., a compiler
+ must report these as an error. However, a compiler should allow to
+ configure reporting to produce a warning only (which can be suppressed
+ using a <code>@SuppressWarnings("inferredcallout")</code> annotation),
+ or to completely ignore the diagnostic. See also <a href="s3.1.j.html" title="&sect;3.1.(j)&nbsp;Inferred callout" class="sect">&sect;3.1.(j)</a>.
+
+ </p>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s3.4.html" rel="prev">&lt;&lt;&nbsp;&sect;3.4&nbsp;Overriding access restrictions</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s3.html" rel="section">&sect;3&nbsp;Callout Binding</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.html
new file mode 100644
index 000000000..95f1f271e
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s3.html
@@ -0,0 +1,972 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s2.html" rel="prev">&lt;&lt;&nbsp;&sect;2&nbsp;Role Binding</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.html" rel="next">&sect;4&nbsp;Callin Binding&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"></div>
+ <div class="chapter" id="s3">
+ <div class="headl">
+ <div class="headr">
+ <h1>&sect;3&nbsp;Callout Binding</h1>
+ </div>
+ </div>
+ <div id="toc-box">
+ <ul class="toc-box">
+ <li><a href="s3.html">&sect;3&nbsp;Callout Binding</a></li>
+ <li><a href="#s3.1">&sect;3.1&nbsp;Callout method binding</a></li>
+ <li><a href="#s3.2">&sect;3.2&nbsp;Callout parameter mapping</a></li>
+ <li><a href="#s3.3">&sect;3.3&nbsp;Lifting and lowering</a></li>
+ <li><a href="#s3.4">&sect;3.4&nbsp;Overriding access restrictions</a></li>
+ <li><a href="#s3.5">&sect;3.5&nbsp;Callout to field</a></li>
+ </ul>
+ </div>
+ <div class="intro">
+ <h3>Notion of callout binding</h3>
+ <div class="line"></div>
+ <div class="term">callout binding</div>
+ <div class="termdesc">A callout binding declares that a method call to a role
+ object may be <strong>forwarded</strong> to a base method of the associated
+ base object <em>(the role object "calls out" to the base)</em>.
+ </div>
+ <div class="line"></div>
+ <div class="term">declarative completeness</div>
+ <div class="termdesc"> Even if a role class does not implement all needed methods,
+ but forwards some to its base, also these methods must be declared
+ within the role.
+ Secondly, no forwarding occurs, unless explicitly declared by a callout binding.
+ </div>
+ <div class="line"></div>
+ <div class="term">expected/provided</div>
+ <div class="termdesc"> A callout binding binds an <strong>expected</strong> method of the role
+ class (needed but not implemented here) to a <strong>provided</strong>
+ method of the base class.
+ </div>
+ <div class="line"></div>
+ </div>
+ <div class="sect depth2" id="s3.1">
+ <h2 class="sect">&sect;3.1&nbsp;Callout method binding<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;3</a></span></h2>
+ <div class="syntaxlink"><a href="sA.html#sA.3.2" title="&sect;A.3.2&nbsp;CalloutBinding"
+ class="syntax">&rarr;&nbsp;Syntax&nbsp;&sect;A.3.2</a></div>
+ <p>A role class may acquire the implementation for any of its
+ (expected) methods by declaring a <strong>callout</strong> binding.
+
+ </p>
+ <div class="subsect depth3" id="s3.1.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Prerequisite: Class binding</span></h4>
+ <p>A callout binding requires the enclosing class to be a role class
+ bound to a base class according to <a href="s2.1.html" title="&sect;2.1&nbsp;playedBy relation" class="sect">&sect;2.1</a>.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.1.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Definition</span></h4>
+ <p>A callout binding maps an abstract role method ("expected method")
+ to a concrete base method ("provided method").
+ It may appear within the role class at any place where feature
+ declarations are allowed. It is denoted by
+
+ </p>
+ <div class="listing plain"><pre><i>expected_method_designator</i> <b>-&gt;</b> <i>provided_method_designator;</i></pre></div>
+ <p>The effect is that any call to the role method will be forwarded to the
+ associated base object using the provided base method.
+
+ </p>
+ <h5 class="listing">Example code (Callout):</h5>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>team</b> <b>class</b> Company {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>public</b> <b>class</b> Employee <b>playedBy</b> Person {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>abstract</b> String getIdentification();</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <span class="comment">// callout binding see below...</span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ <div class="subsect depth3" id="s3.1.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Kinds of method designators</span></h4>
+ <p>A method designator may either be a method name
+
+ </p>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">4</td>
+ <td><pre>getIdentification <em>-&gt;</em> getName;</pre></td>
+ </tr>
+ </table>
+ </div>
+ <p><strong>or</strong>
+ a complete method signature including parameter declarations and
+ return type declaration, but excluding any modifiers and declared exceptions.
+
+ </p>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">4</td>
+ <td><pre>String getIdentification() <em>-&gt;</em> String getName();</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="codecomment">
+ <h5>Effects:</h5>
+ <ul>
+ <li> Line 4 declares a callout binding for the role method <code>getIdentification()</code>,
+ providing an implementation for the abstract method defined in line 3.
+ </li>
+ <li> In combination with the role binding in line 2 this has the following effect:</li>
+ <li> Any call to <code>Employee.getIdentification</code>
+ is forwarded to the method <code>Person.getName</code>.
+ </li>
+ </ul>
+ </div>
+ <p>Both sides of a callout binding must use the same kind of
+ designators, i.e., designators with and without signature may not be mixed.
+ <br />
+ Each method designator must uniquely select one method.
+ If a method designator contains a signature this signature must match exactly with the signature
+ of an existing method, i.e., no implicit conversions are applied for this matching.
+ If overloading is involved, signatures <em>must</em> be used to disambiguate.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.1.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Inheritance of role method declarations</span></h4>
+ <p>The role method being bound by a callout may be declared in the same
+ class as the binding or it may be inherited from a super class or
+ super interface.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.1.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Callout override</span></h4>
+ <p>If an inherited role method is concrete, callout binding regarding this
+ method must use the token "<code>=&gt;</code>" instead of "<code>-&gt;</code>"
+ in order to declare that this binding overrides an existing implementation.
+ <br />
+
+ Using the "<code>=&gt;</code>" operator for an abstract method is an error.
+ <br />
+ It is also an error (and not useful anyway) to callout-bind a method that is
+ implemented in the same class as the binding.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.1.f">
+ <h4 class="subsect">(f)&nbsp;<span class="title">Inheritance of callout bindings</span></h4>
+ <p> Callout bindings are inherited along explicit and implicit inheritance.
+ Inherited callout bindings can be overridden using "<code>=&gt;</code>".
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.1.g">
+ <h4 class="subsect">(g)&nbsp;<span class="title">Duplicate bindings</span></h4>
+ <p>It is an error if a role class has multiple callout bindings for the
+ same role method.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.1.h">
+ <h4 class="subsect">(h)&nbsp;<span class="title">Declared exceptions</span></h4>
+ <p>It is an error if a base method to be bound by <strong>callout</strong>
+ declares in its <code>throws</code> clause any exceptions that
+ are not declared by the corresponding role method.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.1.i">
+ <h4 class="subsect">(i)&nbsp;<span class="title">Shorthand definition</span></h4>
+ <p> A callout binding whose method designators specify
+ full method signatures does not require an existing role method.
+ If no role method is found matching the expected method of
+ such a callout binding, a new method is implicitly generated.
+ The new method is static iff the bound base method is static,
+ and it declares the same exceptions as the bound base method.
+
+ </p>
+ <p>
+ A shorthand callout may optionally declare a <strong>visibility modifier</strong>,
+ otherwise the generated method inherits the visibility modifier of the bound base method.
+ No further modifiers are set.
+ If a callout overrides an inherited method or callout,
+ it must not reduce the visibility of the inherited method/callout.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.1.j">
+ <h4 class="subsect">(j)&nbsp;<span class="title">Inferred callout</span></h4>
+ <p> If a non-abstract role class inherits an abstract method the compiler
+ tries to infer a callout binding for implementing the abstract method.
+ Similarly, if a self-call in a role class cannot be resolved, the compiler
+ tries to infer a callout to resolve the self-call.<br />
+ Inference searches for a method in the bound base class such that
+
+ </p>
+ <ol>
+ <li>both methods have the same name</li>
+ <li>both methods have the same number of arguments</li>
+ <li>each argument of the abstract role method is compatible to the
+ corresponding argument of the base method directly, or using
+ boxing/unboxing or lowering.
+ </li>
+ </ol>
+ <p>
+ Callouts inferred from an interface have <code>public</code> visibility,
+ callouts inferred from a self-call have <code>private</code> visibility.
+
+ </p>
+ <p>
+ Per default inferred callout bindings are disabled, i.e., a compiler
+ must report these as an error. However, a compiler should allow to
+ configure reporting to produce a warning only (which can be suppressed
+ using a <code>@SuppressWarnings("inferredcallout")</code> annotation),
+ or to completely ignore the diagnostic.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.1.k">
+ <h4 class="subsect">(k)&nbsp;<span class="title">Callout to generic method</span></h4>
+ <p>When referring to a generic base method</p>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre>&lt;T&gt; T bm(T a)</pre></td>
+ </tr>
+ </table>
+ </div>
+ <p>a callout binding may either propagate the method's genericity as in</p>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">2</td>
+ <td><pre>&lt;T&gt; T rm(T a) <b>-&gt;</b> T bm(T a);</pre></td>
+ </tr>
+ </table>
+ </div>
+ <p>or it may supply a valid substitution for the type parameter as in</p>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">2</td>
+ <td><pre>String rm(String a) <b>-&gt;</b> String bm(String a);</pre></td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ <p>A callout binding either attaches an implementation to a previously declared method
+ or adds (<a href="#s3.1.i" title="&sect;3.1.(i)&nbsp;Shorthand definition" class="sect">&sect;3.1.(i)</a> above) a forwarding method to a role class.
+ Apart from this implementation, callout-bound methods do not differ from regular methods.
+
+ </p>
+ <p>When we say, a callout binding defines <strong>forwarding</strong> this means that
+ control is passed to the base object. In contrast, by a <strong>delegation</strong>
+ semantics control <em>would</em> remain at the role object, such that self-calls
+ would again be dispatched starting at the role. Callout bindings on
+ their own do not support delegation. However, in conjunction with method
+ overriding by means of callin bindings (see <a href="s4.html" title="&sect;4&nbsp;Callin Binding" class="sect">&sect;4</a>)
+ the effect of delegation can easily be achieved.
+
+ </p>
+ </div>
+ <div class="sect depth2" id="s3.2">
+ <h2 class="sect">&sect;3.2&nbsp;Callout parameter mapping<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;3</a></span></h2>
+ <div class="syntaxlink"><a href="sA.html#sA.4.1" title="&sect;A.4.1&nbsp;CalloutParameterMappings"
+ class="syntax">&rarr;&nbsp;Syntax&nbsp;&sect;A.4.1</a></div>
+ <div class="subsect depth3" id="s3.2.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">with clause</span></h4>
+ <p> If the method designators in a callout binding are signatures
+ (not just method names), parameters and return value may
+ be mapped by a <code>with{...}</code> sub-clause. Parameter mappings may only occur if the enclosing role is a class, not an interface.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.2.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Mapping one parameter</span></h4>
+ <p> For each parameter of the provided base method, exactly one parameter
+ mapping defines, which value will actually be passed to
+ the base method. Callout parameter mappings have this form:
+
+ </p>
+ <div class="listing plain"><pre><i>expression</i> <b>-&gt;</b> <i>base_method_parameter_name</i></pre></div>
+ </div>
+ <div class="subsect depth3" id="s3.2.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Result mapping</span></h4>
+ <p>The return value of a callout method may be provided by a result mapping:
+
+ </p>
+ <div class="listing plain"><pre>result <b>&lt;-</b> <i>expression</i></pre></div>
+ <p>The right hand side expression of a result mapping may use the special identifier
+ <code>result</code> to refer to the value returned by the base method.
+ <br />
+ In a method binding with parameter mappings, it is an error to use
+ <code>result</code> as the name of a regular method argument.
+
+ </p>
+ <h5 class="listing">Example code (Callout Parameter Mapping):</h5>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre>Integer absoluteValue(Integer integer) <b>-&gt;</b> <b>int</b> abs(<b>int</b> i) <em><b>with</b> {</em></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> integer.intValue() <b>-&gt;</b> i,</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <em>result</em> <b>&lt;-</b> <b>new</b> Integer(<em>result</em>)</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre><em>}</em></pre></td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ <div class="subsect depth3" id="s3.2.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Visible names</span></h4>
+ <p>Each identifier that appears within the expressions of a parameter
+ mapping must be either:
+
+ </p>
+ <ul>
+ <li>a feature visible in the scope of the role instance.</li>
+ <li>a parameter of the role method (for parameter mappings).</li>
+ <li>the special name <code>result</code> (for result mappings).
+ </li>
+ <li>in a result mapping also the special name <code>base</code> can be used
+ in order to refer to the bound base instance (provided the method being
+ bound is not static).
+ </li>
+ </ul>
+ <p>The names of base method arguments (i.e., names after mapping) are only
+ legal in the position given in <a href="#s3.2.b" title="&sect;3.2.(b)&nbsp;Mapping one parameter"
+ class="sect">&sect;3.2.(b)</a>.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.2.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Implicit parameter mappings</span></h4>
+ <p>If parameter mappings should be omitted the following conditions must hold:
+
+ </p>
+ <ol>
+ <li>each method parameter of the role method must conform to the
+ corresponding parameter of the base method, <em>and</em></li>
+ <li>the result type of the base method must conform to the result type
+ of the role method.
+ </li>
+ </ol>
+ <p>Here conformance includes translation polymorphism (cf. <a href="#s3.3.d" title="&sect;3.3.(d)&nbsp;Typing rules" class="sect">&sect;3.3.(d)</a>).
+ <br />
+ Parameter correspondence without parameter mapping is determined by declaration order not by names.
+ <br />
+ Two adjustments can, however, be performed implicitly:
+
+ </p>
+ <ul>
+ <li>If the role method has more parameters than the base method,
+ unused trailing parameters may be silently ignored.
+ </li>
+ <li>If the role method returns <code>void</code>, any result from
+ the base method may be silently ignored.
+ </li>
+ </ul>
+ </div>
+ <h5 class="listing">Example code (Callout with Parameter Mapping):</h5>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> MyTeamA {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>public</b> <b>abstract</b> <b>class</b> Role1 {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>abstract</b> <b>void</b> payEuro(float euro);</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <b>abstract</b> float earnEuro();</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> <b>void</b> idle(<b>int</b> seconds) { <span class="comment">/* do nothing */</span> };</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> Role1 boss, worker = <span class="comment">// initialization omitted</span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre> <b>public</b> <b>void</b> transaction () {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre> boss.payEuro(worker.earnEuro());</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">10</td>
+ <td><pre> boss.idle(123);</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">11</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">12</td>
+ <td><pre>}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">13</td>
+ <td><pre><b>public</b> <b>class</b> Staff { <span class="comment">// a base class </span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">14</td>
+ <td><pre> <b>public</b> <b>void</b> payDM (float dm) { … };</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">15</td>
+ <td><pre> <b>public</b> float earnDM () { … };</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">16</td>
+ <td><pre> <b>public</b> <b>int</b> doze() { … };</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">17</td>
+ <td><pre> <span class="comment">// other methods omitted</span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">18</td>
+ <td><pre>}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">19</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> MySubTeam <b>extends</b> MyTeamA {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">20</td>
+ <td><pre> <b>public</b> <b>class</b> Role1 <b>playedBy</b> Staff {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">21</td>
+ <td><pre> <b>void</b> payEuro(float euro) <b>-&gt;</b> <b>void</b> payDM(float dm) <b>with</b> {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">22</td>
+ <td><pre> euro * 1.95583f <b>-&gt;</b> dm</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">23</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">24</td>
+ <td><pre> float earnEuro() <b>-&gt;</b> float earnDM () <b>with</b> {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">25</td>
+ <td><pre> result <b>&lt;-</b> result / 1.95583f</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">26</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">27</td>
+ <td><pre> idle <b>=&gt;</b> doze; <span class="comment">// override existing implementation of idle()</span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">28</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">29</td>
+ <td><pre> <b>void</b> doit() {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">30</td>
+ <td><pre> transaction();</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">31</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">32</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="codecomment">
+ <h5>Effects:</h5>
+ <ul>
+ <li>Class <code>MyTeamA</code> is declaratively complete and can be
+ type checked because it only uses methods that are visible or declared within this
+ context. <code>MyTeamA.Role1</code> can, however, not be instantiated, because it is
+ abstract.
+ </li>
+ <li>Line 30 has the normal effect of invoking <code>transaction</code>.
+ </li>
+ <li>When executing <code>transaction</code>, the call of <code>worker.earnEuro()</code>
+ is forwarded to the corresponding base object using method <code>earnDM()</code>
+ (binding declaration in line 24).
+ The result is converted by "<code>result / 1.95583f</code>" (line 25).
+ </li>
+ <li>Within the same execution of <code>transaction</code>, the call of
+ <code>boss.payEuro()</code>
+ is forwarded to the corresponding base object using method <code>payDM()</code>
+ (binding declaration in line 21).
+ The parameter <code>euro</code> is converted by "<code>euro * 1.95583f</code>"
+ (line 22).
+ </li>
+ <li>Method <code>idle</code> is forwarded to <code>doze</code> without any
+ parameter mapping. This requires <code>doze</code> to have a signature
+ that is conformable to the signature of <code>idle</code>.
+ In this case a role parameter and a base result are ignored.<br />
+ Using the <code>=&gt;</code> operator, this binding overrides the existing
+ implementation of <code>idle</code>.
+ </li>
+ </ul>
+ </div>
+ </div>
+ <div class="sect depth2" id="s3.3">
+ <h2 class="sect">&sect;3.3&nbsp;Lifting and lowering<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;3</a></span></h2>
+ <p> (For basic definitions see <a href="s2.2.html" title="&sect;2.2&nbsp;Lowering" class="sect">&sect;2.2</a> and <a href="s2.3.html" title="&sect;2.3&nbsp;Lifting" class="sect">&sect;2.3</a>)
+
+ </p>
+ <div class="subsect depth3" id="s3.3.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Call target translation</span></h4>
+ <p>Invoking a base method due to a callout binding first
+ <strong>lowers</strong> the role object in order to obtain the effective call target.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.3.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Parameter translation</span></h4>
+ <p>Passing a role object as parameter to a callout method implicitly <strong>lowers</strong>
+ this parameter, if the base method declares a corresponding base type parameter.
+ <br />
+ Lifting of callout parameters is not possible.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.3.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Result translation</span></h4>
+ <p> When returning a base object from a callout method where the role
+ method declares the result to be of a role class,
+ this object is implicitly <strong>lifted</strong> to the appropriate role.
+ <br />
+ Lowering the result of a callout binding is not possible.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.3.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Typing rules</span></h4>
+ <p>A parameter mapping (implicit by parameter position or explicit
+ by a <code>with</code> clause) is <strong>well typed</strong> if
+ the left hand side conforms to the right hand side, either by
+
+ </p>
+ <ul>
+ <li>type equality</li>
+ <li>implicit primitive type conversion</li>
+ <li>subtype polymorphism</li>
+ <li>translation polymorphism, here: <em>lowering</em>,
+ </li>
+ <li><em>or</em> by a combination of the above.
+ </li>
+ </ul>
+ <p>A result mapping (implicit or explicit by a <code>with</code> clause)
+ is well typed, if the value at the right hand side conforms to the
+ left hand side according to the rules given above, except that
+ translation polymorphism here applies <em>lifting</em> instead of
+ lowering.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.3.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Role arrays</span></h4>
+ <p>For arrays of roles as parameters <a href="s2.2.e.html" title="&sect;2.2.(e)&nbsp;Lowering of arrays"
+ class="sect">&sect;2.2.(e)</a> applies accordingly.
+ For arrays as a return value <a href="s2.3.d.html" title="&sect;2.3.(d)&nbsp;Lifting of arrays"
+ class="sect">&sect;2.3.(d)</a> applies.
+
+ </p>
+ </div>
+ </div>
+ <div class="sect depth2" id="s3.4">
+ <h2 class="sect">&sect;3.4&nbsp;Overriding access restrictions<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;3</a></span></h2>
+ <p>In contrast to normal access restrictions, method bindings
+ may refer to hidden base methods.
+ This concept is the inverse of encapsulation, hence it is called
+ <strong>decapsulation</strong>.
+ <br />
+ Decapsulation may occur in these positions:
+
+ </p>
+ <ul>
+ <li><code>playedBy</code> declaration (see <a href="s2.1.2.c.html" title="&sect;2.1.2.(c)&nbsp;Base class decapsulation"
+ class="sect">&sect;2.1.2.(c)</a>)
+ </li>
+ <li>base constructor call (see <a href="s2.4.2.b.html" title="&sect;2.4.2.(b)&nbsp;Bound roles" class="sect">&sect;2.4.2.(b)</a>).
+ </li>
+ <li>callout bindings (see next)</li>
+ <li>callout to field (see <a href="#s3.5.e" title="&sect;3.5.(e)&nbsp;Access control" class="sect">&sect;3.5.(e)</a>)
+ </li>
+ <li>base call within a callin method (see <a href="s4.6.html" title="&sect;4.6&nbsp;Overriding access restrictions"
+ class="sect">&sect;4.6</a>)
+ </li>
+ </ul>
+ <div class="subsect depth3" id="s3.4.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Callout to inaccessible base method</span></h4>
+ <p>By means of <strong>callout</strong> bindings it is possible to access
+ methods of a base class regardless of their access modifiers.
+ Method bindings are the only place in a program which may mention otherwise
+ inaccessible methods.
+ Access to the callout method at the role side is controlled by regular mechanisms,
+ based on the declaration of the role method.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.4.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Sealing against decapsulation</span></h4>
+ <p>A base package may be "sealed" which re-establishes the standard Java visibility rules.
+ <br />
+ Sealing is achieved by the corresponding capability of Jar files.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.4.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Warning levels</span></h4>
+ <p>A compiler should signal any occurrence of decapsulation.
+ If a compiler supports to configure warnings this may be used to let the user choose to
+ (a) ignore base class decapsulation, (b) treat it as a warning or even
+ (c) treat it as an error (cf. <a href="s2.1.2.c.html" title="&sect;2.1.2.(c)&nbsp;Base class decapsulation"
+ class="sect">&sect;2.1.2.(c)</a>).
+ <br />
+ Optionally, a batch compiler may support three levels of verbosity with respect to decapsulation:
+
+ </p>
+ <table border="1">
+ <tr>
+ <td rowspan="1" colspan="1"><tt>-nodecapsulation</tt></td>
+ <td rowspan="1" colspan="1">No warnings.</td>
+ </tr>
+ <tr>
+ <td rowspan="1" colspan="1"><em>default</em></td>
+ <td rowspan="1" colspan="1">Warn only if/that access restrictions are overridden.</td>
+ </tr>
+ <tr>
+ <td rowspan="1" colspan="1"><tt>-decapsulation</tt></td>
+ <td rowspan="1" colspan="1">Detailed messages containing the binding and the hidden base method.</td>
+ </tr>
+ </table>
+ </div>
+ <div class="subsect depth3" id="s3.4.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Private methods from super classes</span></h4>
+ <p>If a callout binding shall bind to a private base method, that method
+ must be defined in the exact base class to which the current role
+ class is bound using <code>playedBy</code>. I.e., for private methods
+ <a href="#s3.1.d"
+ title="&sect;3.1.(d)&nbsp;Inheritance of role method declarations"
+ class="sect">&sect;3.1.(d)</a> does not hold.
+ <br />
+ The same holds for private base fields (see below).
+ <br />
+ If a private base feature must indeed be callout-bound, a role class
+ must be defined that is played by the exact base class defining the
+ private feature. Another role bound to a sub-base-class can then
+ be defined as a sub class of the first role. It will inherit the
+ callout binding and through this it can access the desired feature.
+
+ </p>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>class</b> SuperBase {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <em><b>private</b> <b>int</b> secret;</em></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre>}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre><b>public</b> <b>class</b> SubBase <b>extends</b> SuperBase { <span class="comment">/* details omitted */</span> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> MyTeam {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> <b>protected</b> <b>class</b> SuperRole <b>playedBy</b> SuperBase {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> <b>int</b> steal() <b>-&gt;</b> <b>get</b> <b>int</b> <em>secret</em>; <span class="comment">// <span class="green"><strong>OK</strong></span></span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre> <b>protected</b> <b>class</b> SubRole <b>extends</b> SuperRole <b>playedBy</b> SubBase {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">10</td>
+ <td><pre> <b>int</b> steal() <b>-&gt;</b> <b>get</b> <b>int</b> <em>secret</em>; <span class="comment">// <span class="error"><strong>illegal!</strong></span></span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">11</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">12</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ </div>
+ <div class="sect depth2" id="s3.5">
+ <h2 class="sect">&sect;3.5&nbsp;Callout to field<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;3</a></span></h2>
+ <p>Also fields of a base class can be made accessible using a callout binding.
+
+ </p>
+ <div class="subsect depth3" id="s3.5.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Syntax</span></h4>
+ <p>Using one of the callout modifiers <code>get</code> or <code>set</code> a role method
+ can be bound to a field of the role's base class:
+
+ </p>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre>getValue <b>-&gt;</b> <em>get</em> value;</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre>setValue <b>-&gt;</b> <em>set</em> value;</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre><b>int</b> getValue() <b>-&gt;</b> <em>get</em> <b>int</b> value;</pre></td>
+ </tr>
+ </table>
+ </div>
+ <p>where <code>getValue</code>, <code>setValue</code> are abstract role methods of
+ appropriate signatures and <code>value</code> is a field of the bound base class.
+ <br />
+ A longer syntax is available, too (see line 3 above), which uses complete signatures.
+ For the left hand side <a href="#s3.1.c" title="&sect;3.1.(c)&nbsp;Kinds of method designators"
+ class="sect">&sect;3.1.(c)</a> applies, for the
+ right hand side, this longer version prepends the field type to the field name.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.5.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Compatibility</span></h4>
+ <p>A role method bound with the modifier <code>get</code>
+ should have no arguments
+ (it <em>may</em> have arbitrary arguments, which are silently ignored)
+ and should have a return type to which the base field is compatible.
+ A role method returning void will ignore the given value and thus has
+ no effect at all, which will be signaled by a compiler warning.
+ <br />
+ A role method bound with the modifier <code>set</code> must have a first argument
+ that is compatible to the base field's type (additional arguments - if present -
+ are silently ignored) and must not declare a return type.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.5.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Value mapping</span></h4>
+ <p>Values can be mapped similar to parameter mappings in pure method bindings
+ (<a href="#s3.2" title="&sect;3.2&nbsp;Callout parameter mapping" class="sect">&sect;3.2</a>). Such mappings can be used to establish compatibility as required above.
+ <br />
+ In both <code>get</code> and <code>set</code> bindings, the base side value is denoted
+ by the field's name (lines 2 and 4 below).
+
+ </p>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre>Integer getValue() -&gt; <em>get</em> <b>int</b> val</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <em>with</em> { result &lt;- <b>new</b> Integer(val) }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre><b>void</b> setValue(Integer i) -&gt; <em>set</em> <b>int</b> val</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <em>with</em> { i.intValue() -&gt; val }</pre></td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ <div class="subsect depth3" id="s3.5.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Effect</span></h4>
+ <p>Callout-binding a role method to a base field generates an implementation for
+ this role method, by which it acts as a getter or setter for the given
+ field of the associated base object.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.5.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Access control</span></h4>
+ <p>For accessing an otherwise invisible field, the rules for
+ <a href="#s3.4" title="&sect;3.4&nbsp;Overriding access restrictions"
+ class="sect">decapsulation (&sect;3.4)</a> apply accordingly.
+ <br />
+ Recall, that according to
+ <a href="http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#40898"
+ class="ext">JLS &sect;8.3</a>
+ fields may be hidden in sub-classes of a given base class. Therefore, it is relevant to know that a callout to
+ a field will always access the field that is visible in the exact base
+ class of the role class defining the callout. This is especially relevant
+ for accessing private fields.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.5.f">
+ <h4 class="subsect">(f)&nbsp;<span class="title">Shorthand definition</span></h4>
+ <p>Just as in <a href="#s3.1.i" title="&sect;3.1.(i)&nbsp;Shorthand definition" class="sect">&sect;3.1.(i)</a> a shorthand definition allows to introduce
+ a callout field access method without prior abstract declaration.
+ This requires the callout field binding to specify types as in line 3 of <a href="#s3.5.a" title="&sect;3.5.(a)&nbsp;Syntax" class="sect">&sect;3.5.(a)</a> above.
+ The generated access method is static iff the bound base field is static.
+
+ </p>
+ <p>
+ A shorthand callout to field may optionally declare a <strong>visibility modifier</strong>,
+ otherwise the generated method inherits the visibility modifier of the bound base field.
+ No further modifiers are set.
+ If a callout to field overrides an inherited method or callout,
+ it must not reduce the visibility of the inherited method/callout.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.5.g">
+ <h4 class="subsect">(g)&nbsp;<span class="title">Callout override</span></h4>
+ <p>Similar to method callouts a callout to field may override an existing role
+ method if and only if the token <code>=&gt;</code> is used instead of <code>-&gt;</code>
+ (see <a href="#s3.1.e" title="&sect;3.1.(e)&nbsp;Callout override" class="sect">&sect;3.1.(e)</a> and <a href="#s3.1.f" title="&sect;3.1.(f)&nbsp;Inheritance of callout bindings"
+ class="sect">&sect;3.1.(f)</a>).
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s3.5.h">
+ <h4 class="subsect">(h)&nbsp;<span class="title">Inferred callout</span></h4>
+ <p> If a statement or expression within the body of a bound role class
+ uses a simple name or a name qualified by <code>this</code>
+ which can not be resolved using normal rules,
+ the compiler may infer to use a callout to field instead,
+ given that a field of the required name can be found in the role's declared baseclass.
+
+ </p>
+ <p> If a callout to field has explicitly been declared it is used for the otherwise
+ unresolved name, if and only if:
+
+ </p>
+ <ul>
+ <li>the callout declares a role method name the is constructed from the token "set" for
+ a setter or "get" for a getter plus the field name with capital first letter,
+ </li>
+ <li>the base field referenced by the callout has exactly the required name, and</li>
+ <li>the callout kind (set/get) matches the application of the unresolved name as either
+ the left-hand side of an assignment (set) or as an expression (get).
+ </li>
+ </ul>
+ <p>
+ If a matching callout to field is not found, the compiler generates one automatically,
+ which has <code>private</code> visibility.
+
+ </p>
+ <p>
+ If a callout to field has been inferred it is an error to directly invoke the
+ implicitly generated callout accessor that is formed according to the above rules.
+
+ </p>
+ <p>
+ Per default inferred callout bindings are disabled, i.e., a compiler
+ must report these as an error. However, a compiler should allow to
+ configure reporting to produce a warning only (which can be suppressed
+ using a <code>@SuppressWarnings("inferredcallout")</code> annotation),
+ or to completely ignore the diagnostic. See also <a href="#s3.1.j" title="&sect;3.1.(j)&nbsp;Inferred callout" class="sect">&sect;3.1.(j)</a>.
+
+ </p>
+ </div>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s2.html" rel="prev">&lt;&lt;&nbsp;&sect;2&nbsp;Role Binding</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.html" rel="next">&sect;4&nbsp;Callin Binding&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.1.a.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.1.a.html
new file mode 100644
index 000000000..e83bbfbb6
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.1.a.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.1.b.html" rel="next">&sect;4.1.(b)&nbsp;Prerequisite: Class binding&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.1.html" rel="section">&sect;4.1&nbsp;Callin method binding</a></div>
+ <div class="subsect depth3" id="s4.1.a">
+ <h4 class="subsect">&sect;4.1.(a)&nbsp;<span class="title">Method call interception</span></h4>
+ <p>A role method may intercept calls to a base method by
+ a callin binding.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.1.b.html" rel="next">&sect;4.1.(b)&nbsp;Prerequisite: Class binding&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.1.html" rel="section">&sect;4.1&nbsp;Callin method binding</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.1.b.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.1.b.html
new file mode 100644
index 000000000..0773ebfc0
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.1.b.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s4.1.a.html" rel="prev">&lt;&lt;&nbsp;&sect;4.1.(a)&nbsp;Method call interception</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.1.c.html" rel="next">&sect;4.1.(c)&nbsp;Callin declaration&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.1.html" rel="section">&sect;4.1&nbsp;Callin method binding</a></div>
+ <div class="subsect depth3" id="s4.1.b">
+ <h4 class="subsect">&sect;4.1.(b)&nbsp;<span class="title">Prerequisite: Class binding</span></h4>
+ <p>A callin binding requires the enclosing class to be a role class
+ bound to a base class according to <a href="s2.1.html" title="&sect;2.1&nbsp;playedBy relation" class="sect">&sect;2.1</a>.
+ An <em>unliftable</em> role (see <a href="s2.3.4.a.html" title="&sect;2.3.4.(a)&nbsp;Potential ambiguity"
+ class="sect">&sect;2.3.4.(a)</a>) cannot define
+ callin bindings. In that case callin bindings can only be introduced in sub-roles
+ which (by an appropriately refined <code>playedBy</code> clause) disambiguate the lifting translation.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s4.1.a.html" rel="prev">&lt;&lt;&nbsp;&sect;4.1.(a)&nbsp;Method call interception</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.1.c.html" rel="next">&sect;4.1.(c)&nbsp;Callin declaration&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.1.html" rel="section">&sect;4.1&nbsp;Callin method binding</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.1.c.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.1.c.html
new file mode 100644
index 000000000..6de743ba9
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.1.c.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s4.1.b.html" rel="prev">&lt;&lt;&nbsp;&sect;4.1.(b)&nbsp;Prerequisite: Class binding</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.1.d.html" rel="next">&sect;4.1.(d)&nbsp;Multiple base methods&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.1.html" rel="section">&sect;4.1&nbsp;Callin method binding</a></div>
+ <div class="subsect depth3" id="s4.1.c">
+ <h4 class="subsect">&sect;4.1.(c)&nbsp;<span class="title">Callin declaration</span></h4>
+ <p>A callin binding composes an existing role method with a
+ given base method.
+ It may appear within the role class at any place where feature
+ declarations are allowed. It is denoted by
+
+ </p>
+ <div class="listing plain"><pre><i>role_method_designator</i> <b>&lt;-</b> <i>callin_modifier </i><i>base_method_designator;</i></pre></div>
+ <p>Just like with callout bindings, method designators may
+ or may not contain parameters lists and return type but no modifiers;
+ also, each method designator must exactly and uniquely select one method
+ (cf. <a href="s3.1.c.html" title="&sect;3.1.(c)&nbsp;Kinds of method designators"
+ class="sect">&sect;3.1.(c)</a>).
+ <br />
+ For <em>callin modifiers</em> see <a href="s4.2.html"
+ title="&sect;4.2&nbsp;Callin modifiers (before, after, replace)"
+ class="sect">below (&sect;4.2)</a>.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s4.1.b.html" rel="prev">&lt;&lt;&nbsp;&sect;4.1.(b)&nbsp;Prerequisite: Class binding</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.1.d.html" rel="next">&sect;4.1.(d)&nbsp;Multiple base methods&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.1.html" rel="section">&sect;4.1&nbsp;Callin method binding</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.1.d.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.1.d.html
new file mode 100644
index 000000000..e0b04ec5f
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.1.d.html
@@ -0,0 +1,51 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s4.1.c.html" rel="prev">&lt;&lt;&nbsp;&sect;4.1.(c)&nbsp;Callin declaration</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.1.e.html" rel="next">&sect;4.1.(e)&nbsp;Named callin bindin&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.1.html" rel="section">&sect;4.1&nbsp;Callin method binding</a></div>
+ <div class="subsect depth3" id="s4.1.d">
+ <h4 class="subsect">&sect;4.1.(d)&nbsp;<span class="title">Multiple base methods</span></h4>
+ <p>Base method designators may furthermore enumerate a
+ list of methods. If multiple base methods are bound in one
+ callin declaration generally all signatures in this binding must be conform.
+ <br />
+ However, <em>extraneous parameters</em> from base methods may be ignored
+ at the role.
+ <br />
+ For <em>result types</em> different rules exist, depending on the
+ applied callin modifier (see next).
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s4.1.c.html" rel="prev">&lt;&lt;&nbsp;&sect;4.1.(c)&nbsp;Callin declaration</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.1.e.html" rel="next">&sect;4.1.(e)&nbsp;Named callin bindin&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.1.html" rel="section">&sect;4.1&nbsp;Callin method binding</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.1.e.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.1.e.html
new file mode 100644
index 000000000..f5bc0cefc
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.1.e.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s4.1.d.html" rel="prev">&lt;&lt;&nbsp;&sect;4.1.(d)&nbsp;Multiple base methods</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.1.f.html" rel="next">&sect;4.1.(f)&nbsp;Callin to final&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.1.html" rel="section">&sect;4.1&nbsp;Callin method binding</a></div>
+ <div class="subsect depth3" id="s4.1.e">
+ <h4 class="subsect">&sect;4.1.(e)&nbsp;<span class="title">Named callin bindin</span></h4>
+ <p>Any callin binding may be labeled with a name. The name of a callin binding is used
+ for declaring <em>precedence</em> (<a href="s4.8.html" title="&sect;4.8&nbsp;Callin precedence" class="sect">&sect;4.8</a>).
+ A named callin binding <em>overrides</em> any inherited callin binding
+ (explicit and implicit (<a href="s1.3.1.html"
+ title="&sect;1.3.1&nbsp;Acquisition and implicit inheritance of role classes"
+ class="sect">&sect;1.3.1</a>)) with the same name.
+ <br />
+ It is an error to use the same callin name more than once within the same role class.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s4.1.d.html" rel="prev">&lt;&lt;&nbsp;&sect;4.1.(d)&nbsp;Multiple base methods</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.1.f.html" rel="next">&sect;4.1.(f)&nbsp;Callin to final&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.1.html" rel="section">&sect;4.1&nbsp;Callin method binding</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.1.f.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.1.f.html
new file mode 100644
index 000000000..c407652c3
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.1.f.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s4.1.e.html" rel="prev">&lt;&lt;&nbsp;&sect;4.1.(e)&nbsp;Named callin bindin</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.1.g.html" rel="next">&sect;4.1.(g)&nbsp;Declared exceptions&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.1.html" rel="section">&sect;4.1&nbsp;Callin method binding</a></div>
+ <div class="subsect depth3" id="s4.1.f">
+ <h4 class="subsect">&sect;4.1.(f)&nbsp;<span class="title">Callin to final</span></h4>
+ <p>When binding to a final base method, the enclosing role must be played by the exact base class
+ declaring the final method. I.e., callin binding to a final method inherited from the
+ base class's super-class is not allowed. This is motivated by the fact that no sub-class may have
+ a version of a final method with different semantics.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s4.1.e.html" rel="prev">&lt;&lt;&nbsp;&sect;4.1.(e)&nbsp;Named callin bindin</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.1.g.html" rel="next">&sect;4.1.(g)&nbsp;Declared exceptions&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.1.html" rel="section">&sect;4.1&nbsp;Callin method binding</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.1.g.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.1.g.html
new file mode 100644
index 000000000..c0317cc04
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.1.g.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s4.1.f.html" rel="prev">&lt;&lt;&nbsp;&sect;4.1.(f)&nbsp;Callin to final</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.1.h.html" rel="next">&sect;4.1.(h)&nbsp;Method of enclosing class&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.1.html" rel="section">&sect;4.1&nbsp;Callin method binding</a></div>
+ <div class="subsect depth3" id="s4.1.g">
+ <h4 class="subsect">&sect;4.1.(g)&nbsp;<span class="title">Declared exceptions</span></h4>
+ <p>It is an error if a role method to be bound by callin declares in its <tt>throws</tt> clause
+ any exceptions that are not declared by the corresponding base method(s).
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s4.1.f.html" rel="prev">&lt;&lt;&nbsp;&sect;4.1.(f)&nbsp;Callin to final</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.1.h.html" rel="next">&sect;4.1.(h)&nbsp;Method of enclosing class&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.1.html" rel="section">&sect;4.1&nbsp;Callin method binding</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.1.h.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.1.h.html
new file mode 100644
index 000000000..6249fb7d0
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.1.h.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s4.1.g.html" rel="prev">&lt;&lt;&nbsp;&sect;4.1.(g)&nbsp;Declared exceptions</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.1.html" rel="section">&sect;4.1&nbsp;Callin method binding</a></div>
+ <div class="subsect depth3" id="s4.1.h">
+ <h4 class="subsect">&sect;4.1.(h)&nbsp;<span class="title">Method of enclosing class</span></h4>
+ <p>In a <code>before</code> or <code>after</code> callin binding the left hand side may alternatively
+ resolve to a method of an enclosing class rather than the current role.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s4.1.g.html" rel="prev">&lt;&lt;&nbsp;&sect;4.1.(g)&nbsp;Declared exceptions</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.1.html" rel="section">&sect;4.1&nbsp;Callin method binding</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.1.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.1.html
new file mode 100644
index 000000000..ff4a94357
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.1.html
@@ -0,0 +1,131 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.2.html" rel="next">&sect;4.2&nbsp;Callin modifiers (before, after, replace)&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a></div>
+ <div class="sect depth2" id="s4.1">
+ <h2 class="sect">&sect;4.1&nbsp;Callin method binding</h2>
+ <div class="syntaxlink"><a href="sA.html#sA.3.3" title="&sect;A.3.3&nbsp;Callin binding"
+ class="syntax">&rarr;&nbsp;Syntax&nbsp;&sect;A.3.3</a></div>
+ <div class="subsect depth3" id="s4.1.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Method call interception</span></h4>
+ <p>A role method may intercept calls to a base method by
+ a callin binding.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.1.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Prerequisite: Class binding</span></h4>
+ <p>A callin binding requires the enclosing class to be a role class
+ bound to a base class according to <a href="s2.1.html" title="&sect;2.1&nbsp;playedBy relation" class="sect">&sect;2.1</a>.
+ An <em>unliftable</em> role (see <a href="s2.3.4.a.html" title="&sect;2.3.4.(a)&nbsp;Potential ambiguity"
+ class="sect">&sect;2.3.4.(a)</a>) cannot define
+ callin bindings. In that case callin bindings can only be introduced in sub-roles
+ which (by an appropriately refined <code>playedBy</code> clause) disambiguate the lifting translation.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.1.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Callin declaration</span></h4>
+ <p>A callin binding composes an existing role method with a
+ given base method.
+ It may appear within the role class at any place where feature
+ declarations are allowed. It is denoted by
+
+ </p>
+ <div class="listing plain"><pre><i>role_method_designator</i> <b>&lt;-</b> <i>callin_modifier </i><i>base_method_designator;</i></pre></div>
+ <p>Just like with callout bindings, method designators may
+ or may not contain parameters lists and return type but no modifiers;
+ also, each method designator must exactly and uniquely select one method
+ (cf. <a href="s3.1.c.html" title="&sect;3.1.(c)&nbsp;Kinds of method designators"
+ class="sect">&sect;3.1.(c)</a>).
+ <br />
+ For <em>callin modifiers</em> see <a href="s4.2.html"
+ title="&sect;4.2&nbsp;Callin modifiers (before, after, replace)"
+ class="sect">below (&sect;4.2)</a>.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.1.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Multiple base methods</span></h4>
+ <p>Base method designators may furthermore enumerate a
+ list of methods. If multiple base methods are bound in one
+ callin declaration generally all signatures in this binding must be conform.
+ <br />
+ However, <em>extraneous parameters</em> from base methods may be ignored
+ at the role.
+ <br />
+ For <em>result types</em> different rules exist, depending on the
+ applied callin modifier (see next).
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.1.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Named callin bindin</span></h4>
+ <p>Any callin binding may be labeled with a name. The name of a callin binding is used
+ for declaring <em>precedence</em> (<a href="s4.8.html" title="&sect;4.8&nbsp;Callin precedence" class="sect">&sect;4.8</a>).
+ A named callin binding <em>overrides</em> any inherited callin binding
+ (explicit and implicit (<a href="s1.3.1.html"
+ title="&sect;1.3.1&nbsp;Acquisition and implicit inheritance of role classes"
+ class="sect">&sect;1.3.1</a>)) with the same name.
+ <br />
+ It is an error to use the same callin name more than once within the same role class.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.1.f">
+ <h4 class="subsect">(f)&nbsp;<span class="title">Callin to final</span></h4>
+ <p>When binding to a final base method, the enclosing role must be played by the exact base class
+ declaring the final method. I.e., callin binding to a final method inherited from the
+ base class's super-class is not allowed. This is motivated by the fact that no sub-class may have
+ a version of a final method with different semantics.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.1.g">
+ <h4 class="subsect">(g)&nbsp;<span class="title">Declared exceptions</span></h4>
+ <p>It is an error if a role method to be bound by callin declares in its <tt>throws</tt> clause
+ any exceptions that are not declared by the corresponding base method(s).
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.1.h">
+ <h4 class="subsect">(h)&nbsp;<span class="title">Method of enclosing class</span></h4>
+ <p>In a <code>before</code> or <code>after</code> callin binding the left hand side may alternatively
+ resolve to a method of an enclosing class rather than the current role.
+
+ </p>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.2.html" rel="next">&sect;4.2&nbsp;Callin modifiers (before, after, replace)&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.10.a.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.10.a.html
new file mode 100644
index 000000000..fc73978ed
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.10.a.html
@@ -0,0 +1,51 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.10.b.html" rel="next">&sect;4.10.(b)&nbsp;Type bounds&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.10.html" rel="section">&sect;4.10&nbsp;Generic callin bindings</a></div>
+ <div class="subsect depth3" id="s4.10.a">
+ <h4 class="subsect">&sect;4.10.(a)&nbsp;<span class="title">Fresh type parameter</span></h4>
+ <p>
+ If a callin method declares a type parameter <code>&lt;T&gt;</code> for
+ capturing a covariant return type
+ this type <code>T</code>
+ can be used for specifying the type of exactly one parameter or the return type.
+ If a type parameter is used in more than one position of a <code>callin</code> method
+ it is not considered a <em>fresh type parameter</em>
+ and can thus not be bound to a covariant return type (see <a href="s4.10.d.html" title="&sect;4.10.(d)&nbsp;Binding to a type parameter"
+ class="sect">&sect;4.10.(d)</a>).
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.10.b.html" rel="next">&sect;4.10.(b)&nbsp;Type bounds&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.10.html" rel="section">&sect;4.10&nbsp;Generic callin bindings</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.10.b.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.10.b.html
new file mode 100644
index 000000000..b79c4294e
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.10.b.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s4.10.a.html" rel="prev">&lt;&lt;&nbsp;&sect;4.10.(a)&nbsp;Fresh type parameter</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.10.c.html" rel="next">&sect;4.10.(c)&nbsp;Generic replace binding&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.10.html" rel="section">&sect;4.10&nbsp;Generic callin bindings</a></div>
+ <div class="subsect depth3" id="s4.10.b">
+ <h4 class="subsect">&sect;4.10.(b)&nbsp;<span class="title">Type bounds</span></h4>
+ <p>
+ The type parameter of a callin binding may be bounded by an upper bound as in <code>&lt;T extends C&gt;</code>.
+ In this case <code>T</code> can only be instantiated by types conforming to the upper bound <code>C</code>.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s4.10.a.html" rel="prev">&lt;&lt;&nbsp;&sect;4.10.(a)&nbsp;Fresh type parameter</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.10.c.html" rel="next">&sect;4.10.(c)&nbsp;Generic replace binding&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.10.html" rel="section">&sect;4.10&nbsp;Generic callin bindings</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.10.c.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.10.c.html
new file mode 100644
index 000000000..608cc4559
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.10.c.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s4.10.b.html" rel="prev">&lt;&lt;&nbsp;&sect;4.10.(b)&nbsp;Type bounds</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.10.d.html" rel="next">&sect;4.10.(d)&nbsp;Binding to a type parameter&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.10.html" rel="section">&sect;4.10&nbsp;Generic callin bindings</a></div>
+ <div class="subsect depth3" id="s4.10.c">
+ <h4 class="subsect">&sect;4.10.(c)&nbsp;<span class="title">Generic replace binding</span></h4>
+ <p>
+ A generic <code>callin</code> method according to the above rules is bound using a replace
+ binding that declares the same number of type parameters,
+ where type parameters of the binding and its callin method are identified.
+ If the <code>callin</code> method declares bounds for its type parameters
+ so should the replace binding.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s4.10.b.html" rel="prev">&lt;&lt;&nbsp;&sect;4.10.(b)&nbsp;Type bounds</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.10.d.html" rel="next">&sect;4.10.(d)&nbsp;Binding to a type parameter&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.10.html" rel="section">&sect;4.10&nbsp;Generic callin bindings</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.10.d.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.10.d.html
new file mode 100644
index 000000000..0397da907
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.10.d.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s4.10.c.html" rel="prev">&lt;&lt;&nbsp;&sect;4.10.(c)&nbsp;Generic replace binding</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.10.e.html" rel="next">&sect;4.10.(e)&nbsp;Propagating type parameters&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.10.html" rel="section">&sect;4.10&nbsp;Generic callin bindings</a></div>
+ <div class="subsect depth3" id="s4.10.d">
+ <h4 class="subsect">&sect;4.10.(d)&nbsp;<span class="title">Binding to a type parameter</span></h4>
+ <p>
+ A fresh type parameter can be used to capture arbitrary types in the base methods to be bound.
+ The type parameter may be instantiated differently for each bound base method.
+ By such type parameter instantiation the types in role and base signatures are actually identical,
+ thus satisfying the requirement of two-way substitutability.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s4.10.c.html" rel="prev">&lt;&lt;&nbsp;&sect;4.10.(c)&nbsp;Generic replace binding</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.10.e.html" rel="next">&sect;4.10.(e)&nbsp;Propagating type parameters&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.10.html" rel="section">&sect;4.10&nbsp;Generic callin bindings</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.10.e.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.10.e.html
new file mode 100644
index 000000000..1a9dd5c10
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.10.e.html
@@ -0,0 +1,96 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s4.10.d.html" rel="prev">&lt;&lt;&nbsp;&sect;4.10.(d)&nbsp;Binding to a type parameter</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.10.html" rel="section">&sect;4.10&nbsp;Generic callin bindings</a></div>
+ <div class="subsect depth3" id="s4.10.e">
+ <h4 class="subsect">&sect;4.10.(e)&nbsp;<span class="title">Propagating type parameters</span></h4>
+ <p>
+ If a callin binding binds to a generic base method,
+ any type parameter(s) of the base method must be propagated into the role method
+ by declaring the callin binding with type parameters, too.
+ By matching a type parameter of a base method with a type variable
+ of the callin binding, this genericity is propagated through the callin binding.
+
+ </p>
+ <div class="listing frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>class</b> MyBase {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> &lt;T&gt; T getIt(T it) { <b>return</b> it; }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre>}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre><b>team</b> <b>class</b> MyTeam {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> <b>protected</b> <b>class</b> MyRole <b>playedBy</b> MyBase {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> <b>callin</b> &lt;U&gt; U rm(U a) { <b>return</b> base.rm(a); }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> &lt;U&gt; U rm(U a) <b>&lt;-</b> <b>replace</b> U getIt(U it);</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="codecomment">
+ <h5>Explanation:</h5>
+ The callin binding declares a type parameter <code>&lt;U&gt;</code>
+ which is used to match all occurrences of <code>T</code> in the signature of <code>getIt</code>.
+ Thus the implementation of <code>rm</code> uses the type <code>U</code>
+ in exactly the same generic way as <code>getIt</code> uses <code>T</code>.
+
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s4.10.d.html" rel="prev">&lt;&lt;&nbsp;&sect;4.10.(d)&nbsp;Binding to a type parameter</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.10.html" rel="section">&sect;4.10&nbsp;Generic callin bindings</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.10.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.10.html
new file mode 100644
index 000000000..cfdcf0192
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.10.html
@@ -0,0 +1,248 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s4.9.html" rel="prev">&lt;&lt;&nbsp;&sect;4.9&nbsp;Callin inheritance</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a></div>
+ <div class="sect depth2" id="s4.10">
+ <h2 class="sect">&sect;4.10&nbsp;Generic callin bindings</h2>
+ <p>
+ As mentioned in <a href="s4.5.d.html" title="&sect;4.5.(d)&nbsp;Typing rules" class="sect">&sect;4.5.(d)</a> replace bindings do not support subtype polymorphism
+ in either direction.
+ On the other hand, binding several base methods to the same <code>callin</code> method
+ may require some more flexibility if these base methods have different signatures.
+ This is where type parameter come to the rescue to allow for generic <code>callin</code> methods
+ and their binding to base methods with different signatures.<br />
+ Note that this rule is a generalization of rule <a href="s4.9.3.c.html" title="&sect;4.9.3.(c)&nbsp;Covariant replace binding"
+ class="sect">&sect;4.9.3.(c)</a>.
+
+ </p>
+ <p>
+ Additionally, any callin binding (before,replace,after) may declare one or more type parameters
+ for propagating type parameters of the bound base method(s) (<a href="#s4.10.e" title="&sect;4.10.(e)&nbsp;Propagating type parameters"
+ class="sect">&sect;4.10.(e)</a>).
+
+ </p>
+ <div class="subsect depth3" id="s4.10.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Fresh type parameter</span></h4>
+ <p>
+ If a callin method declares a type parameter <code>&lt;T&gt;</code> for
+ capturing a covariant return type
+ this type <code>T</code>
+ can be used for specifying the type of exactly one parameter or the return type.
+ If a type parameter is used in more than one position of a <code>callin</code> method
+ it is not considered a <em>fresh type parameter</em>
+ and can thus not be bound to a covariant return type (see <a href="#s4.10.d" title="&sect;4.10.(d)&nbsp;Binding to a type parameter"
+ class="sect">&sect;4.10.(d)</a>).
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.10.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Type bounds</span></h4>
+ <p>
+ The type parameter of a callin binding may be bounded by an upper bound as in <code>&lt;T extends C&gt;</code>.
+ In this case <code>T</code> can only be instantiated by types conforming to the upper bound <code>C</code>.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.10.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Generic replace binding</span></h4>
+ <p>
+ A generic <code>callin</code> method according to the above rules is bound using a replace
+ binding that declares the same number of type parameters,
+ where type parameters of the binding and its callin method are identified.
+ If the <code>callin</code> method declares bounds for its type parameters
+ so should the replace binding.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.10.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Binding to a type parameter</span></h4>
+ <p>
+ A fresh type parameter can be used to capture arbitrary types in the base methods to be bound.
+ The type parameter may be instantiated differently for each bound base method.
+ By such type parameter instantiation the types in role and base signatures are actually identical,
+ thus satisfying the requirement of two-way substitutability.
+
+ </p>
+ </div>
+ <p>
+ Within the body of a generic <code>callin</code> method no further rules have to be followed,
+ because the fresh type variable actually guarantees, that the role method cannot replace the
+ original value (initial argument or base-call result) with a different object,
+ because no type exists that is guaranteed to conform to the type parameters.
+ Yet, the type bound allows the role method to invoke methods of the provided object.
+
+ </p>
+ <h5 class="listing">Generic replace binding</h5>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> MyTeam {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>protected</b> <b>class</b> R <b>playedBy</b> Figures {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>callin</b> &lt;E <b>extends</b> Shape, F <b>extends</b> Shape&gt; E ci(F arg) {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> E result= base.ci(arg);</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> <span class="error">result= arg; // illegal, types E and F are incommensurable</span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> <span class="error">arg= result; // illegal, types E and F are incommensurable</span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> <b>int</b> size= arg.getSize(); <span class="comment">// getSize() is availabel on F via type bound Shape</span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre> result.resize(size); <span class="comment"> // resize() is available on E via type bound Shape</span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre> <b>return</b> result; <span class="comment">// only two legal values exist: <code>result</code> and <code>null</code></span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">10</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">11</td>
+ <td><pre> &lt;E <b>extends</b> Shape, F <b>extends</b> Shape&gt; </pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">12</td>
+ <td><pre> E ci(F arg) <b>&lt;-</b> <b>replace</b> Rectangle getBoundingBox(Shape original), </pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">13</td>
+ <td><pre> Rectangle stretch(Square original);</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">14</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">15</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="codecomment">
+ <h5>Explanation:</h5>
+ These declaration generate two version of the <code>callin</code> method <code>ci</code>:
+
+ <ol>
+ <li><code>Rectangle ci (Shape arg)</code></li>
+ <li><code>Rectangle ci (Square arg)</code></li>
+ </ol>
+ Within the <code>callin</code> method the following observations hold:
+
+ <ul>
+ <li>Line 5 is illegal for the first signature as <code>Shape</code> is not conform to <code>Rectangle</code></li>
+ <li>Line 6 is illegal for the second signature as <code>Rectangle</code> is not conform to <code>Square</code></li>
+ <li>Everything else is type-safe.</li>
+ </ul>
+ </div>
+ <div class="subsect depth3" id="s4.10.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Propagating type parameters</span></h4>
+ <p>
+ If a callin binding binds to a generic base method,
+ any type parameter(s) of the base method must be propagated into the role method
+ by declaring the callin binding with type parameters, too.
+ By matching a type parameter of a base method with a type variable
+ of the callin binding, this genericity is propagated through the callin binding.
+
+ </p>
+ <div class="listing frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>class</b> MyBase {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> &lt;T&gt; T getIt(T it) { <b>return</b> it; }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre>}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre><b>team</b> <b>class</b> MyTeam {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> <b>protected</b> <b>class</b> MyRole <b>playedBy</b> MyBase {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> <b>callin</b> &lt;U&gt; U rm(U a) { <b>return</b> base.rm(a); }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> &lt;U&gt; U rm(U a) <b>&lt;-</b> <b>replace</b> U getIt(U it);</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="codecomment">
+ <h5>Explanation:</h5>
+ The callin binding declares a type parameter <code>&lt;U&gt;</code>
+ which is used to match all occurrences of <code>T</code> in the signature of <code>getIt</code>.
+ Thus the implementation of <code>rm</code> uses the type <code>U</code>
+ in exactly the same generic way as <code>getIt</code> uses <code>T</code>.
+
+ </div>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s4.9.html" rel="prev">&lt;&lt;&nbsp;&sect;4.9&nbsp;Callin inheritance</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.2.a.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.2.a.html
new file mode 100644
index 000000000..2b5599983
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.2.a.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.2.b.html" rel="next">&sect;4.2.(b)&nbsp;Additive composition&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.2.html" rel="section">&sect;4.2&nbsp;Callin modifiers (before, after, replace)</a></div>
+ <div class="subsect depth3" id="s4.2.a">
+ <h4 class="subsect">&sect;4.2.(a)&nbsp;<span class="title">Method composition</span></h4>
+ <p>The kind of method composition is controlled by adding one
+ of the modifiers <strong>before, after</strong> or <strong>replace</strong> after the
+ "<code>&lt;-</code>" token of the binding declaration.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.2.b.html" rel="next">&sect;4.2.(b)&nbsp;Additive composition&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.2.html" rel="section">&sect;4.2&nbsp;Callin modifiers (before, after, replace)</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.2.b.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.2.b.html
new file mode 100644
index 000000000..0110b701a
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.2.b.html
@@ -0,0 +1,87 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s4.2.a.html" rel="prev">&lt;&lt;&nbsp;&sect;4.2.(a)&nbsp;Method composition</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.2.c.html" rel="next">&sect;4.2.(c)&nbsp;Replacing composition&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.2.html" rel="section">&sect;4.2&nbsp;Callin modifiers (before, after, replace)</a></div>
+ <div class="subsect depth3" id="s4.2.b">
+ <h4 class="subsect">&sect;4.2.(b)&nbsp;<span class="title">Additive composition</span></h4>
+ <p>The <code>before</code> and <code>after</code> modifiers have the
+ effect of adding a call to the role method at the beginning or end
+ of the base method, resp.<br />
+ In this case no data are transferred from the role to the base,
+ so if the role method has a result, this will always be ignored.
+
+ </p>
+ <h5 class="listing">Example code (Callin):</h5>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>team</b> <b>class</b> Company {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>protected</b> <b>class</b> Employee <b>playedBy</b> Person {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>public</b> <b>void</b> recalculateIncome() { ... }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> recalculateIncome <em><b>&lt;-</b> after</em> haveBirthday; <span class="comment">// callin binding</span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="codecomment">
+ <p>Line 4 declares a callin binding for the role method <code>recalculateIncome()</code>
+ defined in line 3. In combination with the role binding in line 2 this has the following effect:
+
+ </p>
+ <ul>
+ <li><strong>After</strong> every call of the method <code>Person.haveBirthday</code>
+ the method <code>Company.recalculateIncome</code> is called.
+ </li>
+ </ul>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s4.2.a.html" rel="prev">&lt;&lt;&nbsp;&sect;4.2.(a)&nbsp;Method composition</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.2.c.html" rel="next">&sect;4.2.(c)&nbsp;Replacing composition&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.2.html" rel="section">&sect;4.2&nbsp;Callin modifiers (before, after, replace)</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.2.c.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.2.c.html
new file mode 100644
index 000000000..b2ceb1b13
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.2.c.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s4.2.b.html" rel="prev">&lt;&lt;&nbsp;&sect;4.2.(b)&nbsp;Additive composition</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.2.d.html" rel="next">&sect;4.2.(d)&nbsp;Callin methods&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.2.html" rel="section">&sect;4.2&nbsp;Callin modifiers (before, after, replace)</a></div>
+ <div class="subsect depth3" id="s4.2.c">
+ <h4 class="subsect">&sect;4.2.(c)&nbsp;<span class="title">Replacing composition</span></h4>
+ <p>The <code>replace</code> modifier causes <em>only</em> the role method to be
+ invoked, replacing the base method.
+ <br />
+ In this case, if the base method declares a result, this should be provided by the role method.
+ Special cases of return values in callin bindings are discussed in <a href="s4.3.e.html" title="&sect;4.3.(e)&nbsp;Fragile callin binding"
+ class="sect">&sect;4.3.(e)</a></p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s4.2.b.html" rel="prev">&lt;&lt;&nbsp;&sect;4.2.(b)&nbsp;Additive composition</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.2.d.html" rel="next">&sect;4.2.(d)&nbsp;Callin methods&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.2.html" rel="section">&sect;4.2&nbsp;Callin modifiers (before, after, replace)</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.2.d.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.2.d.html
new file mode 100644
index 000000000..a0512fa1b
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.2.d.html
@@ -0,0 +1,70 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s4.2.c.html" rel="prev">&lt;&lt;&nbsp;&sect;4.2.(c)&nbsp;Replacing composition</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.2.html" rel="section">&sect;4.2&nbsp;Callin modifiers (before, after, replace)</a></div>
+ <div class="subsect depth3" id="s4.2.d">
+ <h4 class="subsect">&sect;4.2.(d)&nbsp;<span class="title">Callin methods</span></h4>
+ <p>Role methods to be bound by a callin replacement binding must have
+ the modifier <code>callin</code>. This modifier is only allowed for methods
+ of a role class.<br />
+ A method with the <code>callin</code> modifier can only be called
+
+ </p>
+ <ul>
+ <li>via a callin replace binding</li>
+ <li>by a <code>super</code> or <code>tsuper</code> call from an overriding callin method.
+ </li>
+ </ul>
+ <p>It is illegal for a <code>callin</code> method
+ </p>
+ <ul>
+ <li>to be called directly,</li>
+ <li>to be bound using a callout binding, and</li>
+ <li>to be bound to a base method using a <code>before</code> or <code>after</code> callin binding.
+ </li>
+ </ul>
+ <p>Despite these rules a second level role &mdash; which is played by the current role &mdash;
+ can intercept the execution of a callin method using any form of callin binding.</p>
+ <p>A callin method cannot override a regular method and vice versa, however,
+ overriding one callin method with another callin method is legal and
+ dynamic binding applies to callin method just like regular methods.
+ <br />
+ A callin method must not declare its visibility using any of the modifiers <code>public</code>,
+ <code>protected</code> or <code>private</code>. Since callin methods can only be invoked via callin bindings
+ such visibility control would not be useful.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s4.2.c.html" rel="prev">&lt;&lt;&nbsp;&sect;4.2.(c)&nbsp;Replacing composition</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.2.html" rel="section">&sect;4.2&nbsp;Callin modifiers (before, after, replace)</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.2.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.2.html
new file mode 100644
index 000000000..f8f4e8e9d
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.2.html
@@ -0,0 +1,140 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s4.1.html" rel="prev">&lt;&lt;&nbsp;&sect;4.1&nbsp;Callin method binding</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.3.html" rel="next">&sect;4.3&nbsp;Base calls&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a></div>
+ <div class="sect depth2" id="s4.2">
+ <h2 class="sect">&sect;4.2&nbsp;Callin modifiers (before, after, replace)</h2>
+ <div class="subsect depth3" id="s4.2.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Method composition</span></h4>
+ <p>The kind of method composition is controlled by adding one
+ of the modifiers <strong>before, after</strong> or <strong>replace</strong> after the
+ "<code>&lt;-</code>" token of the binding declaration.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.2.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Additive composition</span></h4>
+ <p>The <code>before</code> and <code>after</code> modifiers have the
+ effect of adding a call to the role method at the beginning or end
+ of the base method, resp.<br />
+ In this case no data are transferred from the role to the base,
+ so if the role method has a result, this will always be ignored.
+
+ </p>
+ <h5 class="listing">Example code (Callin):</h5>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>team</b> <b>class</b> Company {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>protected</b> <b>class</b> Employee <b>playedBy</b> Person {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>public</b> <b>void</b> recalculateIncome() { ... }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> recalculateIncome <em><b>&lt;-</b> after</em> haveBirthday; <span class="comment">// callin binding</span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="codecomment">
+ <p>Line 4 declares a callin binding for the role method <code>recalculateIncome()</code>
+ defined in line 3. In combination with the role binding in line 2 this has the following effect:
+
+ </p>
+ <ul>
+ <li><strong>After</strong> every call of the method <code>Person.haveBirthday</code>
+ the method <code>Company.recalculateIncome</code> is called.
+ </li>
+ </ul>
+ </div>
+ </div>
+ <div class="subsect depth3" id="s4.2.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Replacing composition</span></h4>
+ <p>The <code>replace</code> modifier causes <em>only</em> the role method to be
+ invoked, replacing the base method.
+ <br />
+ In this case, if the base method declares a result, this should be provided by the role method.
+ Special cases of return values in callin bindings are discussed in <a href="s4.3.e.html" title="&sect;4.3.(e)&nbsp;Fragile callin binding"
+ class="sect">&sect;4.3.(e)</a></p>
+ </div>
+ <div class="subsect depth3" id="s4.2.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Callin methods</span></h4>
+ <p>Role methods to be bound by a callin replacement binding must have
+ the modifier <code>callin</code>. This modifier is only allowed for methods
+ of a role class.<br />
+ A method with the <code>callin</code> modifier can only be called
+
+ </p>
+ <ul>
+ <li>via a callin replace binding</li>
+ <li>by a <code>super</code> or <code>tsuper</code> call from an overriding callin method.
+ </li>
+ </ul>
+ <p>It is illegal for a <code>callin</code> method
+ </p>
+ <ul>
+ <li>to be called directly,</li>
+ <li>to be bound using a callout binding, and</li>
+ <li>to be bound to a base method using a <code>before</code> or <code>after</code> callin binding.
+ </li>
+ </ul>
+ <p>Despite these rules a second level role &mdash; which is played by the current role &mdash;
+ can intercept the execution of a callin method using any form of callin binding.</p>
+ <p>A callin method cannot override a regular method and vice versa, however,
+ overriding one callin method with another callin method is legal and
+ dynamic binding applies to callin method just like regular methods.
+ <br />
+ A callin method must not declare its visibility using any of the modifiers <code>public</code>,
+ <code>protected</code> or <code>private</code>. Since callin methods can only be invoked via callin bindings
+ such visibility control would not be useful.
+
+ </p>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s4.1.html" rel="prev">&lt;&lt;&nbsp;&sect;4.1&nbsp;Callin method binding</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.3.html" rel="next">&sect;4.3&nbsp;Base calls&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.3.a.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.3.a.html
new file mode 100644
index 000000000..57ca131bf
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.3.a.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.3.b.html" rel="next">&sect;4.3.(b)&nbsp;Missing base call&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.3.html" rel="section">&sect;4.3&nbsp;Base calls</a></div>
+ <div class="subsect depth3" id="s4.3.a">
+ <h4 class="subsect">&sect;4.3.(a)&nbsp;<span class="title">Syntax</span></h4>
+ <p>The syntax for base calls is <code>base.m()</code>,
+ which is in analogy to super calls.
+ A <code>base.m()</code> call must use the same name and signature
+ as the enclosing method. This again follows the rule, that roles
+ should never explicitly use base names, except in binding declarations.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.3.b.html" rel="next">&sect;4.3.(b)&nbsp;Missing base call&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.3.html" rel="section">&sect;4.3&nbsp;Base calls</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.3.b.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.3.b.html
new file mode 100644
index 000000000..08e935f1f
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.3.b.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s4.3.a.html" rel="prev">&lt;&lt;&nbsp;&sect;4.3.(a)&nbsp;Syntax</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.3.c.html" rel="next">&sect;4.3.(c)&nbsp;Duplicate base call&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.3.html" rel="section">&sect;4.3&nbsp;Base calls</a></div>
+ <div class="subsect depth3" id="s4.3.b">
+ <h4 class="subsect">&sect;4.3.(b)&nbsp;<span class="title">Missing base call</span></h4>
+ <p>For each callin method, the compiler uses some flow analysis to check whether
+ a base call will be invoked on each path of execution (analysis is very similar
+ to the analysis for definite assignment regarding final variables -
+ <a href="http://java.sun.com/docs/books/jls/third_edition/html/defAssign.html"
+ class="ext">JLS &sect;16</a>).
+ The compiler will issue a warning if a base call is missing either
+ on each path (definitely missing) or on some paths (potentially missing).
+ Instead of directly invoking a base call, a callin method may also call
+ its explicit or implicit super version using <code>super.m()</code> or <code>tsuper.m()</code> (see <a href="s1.3.1.f.html" title="&sect;1.3.1.(f)&nbsp;tsuper" class="sect">&sect;1.3.1.(f)</a>).
+ In this case the flow analysis will transitively include the called super/tsuper version.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s4.3.a.html" rel="prev">&lt;&lt;&nbsp;&sect;4.3.(a)&nbsp;Syntax</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.3.c.html" rel="next">&sect;4.3.(c)&nbsp;Duplicate base call&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.3.html" rel="section">&sect;4.3&nbsp;Base calls</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.3.c.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.3.c.html
new file mode 100644
index 000000000..2b774eae6
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.3.c.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s4.3.b.html" rel="prev">&lt;&lt;&nbsp;&sect;4.3.(b)&nbsp;Missing base call</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.3.d.html" rel="next">&sect;4.3.(d)&nbsp;Parameter tunneling&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.3.html" rel="section">&sect;4.3&nbsp;Base calls</a></div>
+ <div class="subsect depth3" id="s4.3.c">
+ <h4 class="subsect">&sect;4.3.(c)&nbsp;<span class="title">Duplicate base call</span></h4>
+ <p>If a callin method contains several base calls, the compiler gives
+ a warning if this will result in duplicate base call invocations on all
+ paths (definitely duplicate) or on some paths (potentially duplicate).
+ Again super/tsuper calls are included in the flow analysis (see 4.3(b)).
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s4.3.b.html" rel="prev">&lt;&lt;&nbsp;&sect;4.3.(b)&nbsp;Missing base call</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.3.d.html" rel="next">&sect;4.3.(d)&nbsp;Parameter tunneling&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.3.html" rel="section">&sect;4.3&nbsp;Base calls</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.3.d.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.3.d.html
new file mode 100644
index 000000000..1ed666db6
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.3.d.html
@@ -0,0 +1,49 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s4.3.c.html" rel="prev">&lt;&lt;&nbsp;&sect;4.3.(c)&nbsp;Duplicate base call</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.3.e.html" rel="next">&sect;4.3.(e)&nbsp;Fragile callin binding&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.3.html" rel="section">&sect;4.3&nbsp;Base calls</a></div>
+ <div class="subsect depth3" id="s4.3.d">
+ <h4 class="subsect">&sect;4.3.(d)&nbsp;<span class="title">Parameter tunneling</span></h4>
+ <p>If a base method has more parameters
+ than a callin method to which it is composed, additional
+ parameters are implicitly passed unchanged from the original
+ call to the base call (original means: before interception).
+ I.e., a call <code>base.m()</code> may invisibly pass additional
+ parameters that were provided by the caller, but are hidden from the
+ role method.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s4.3.c.html" rel="prev">&lt;&lt;&nbsp;&sect;4.3.(c)&nbsp;Duplicate base call</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.3.e.html" rel="next">&sect;4.3.(e)&nbsp;Fragile callin binding&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.3.html" rel="section">&sect;4.3&nbsp;Base calls</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.3.e.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.3.e.html
new file mode 100644
index 000000000..c2aa6c24b
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.3.e.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s4.3.d.html" rel="prev">&lt;&lt;&nbsp;&sect;4.3.(d)&nbsp;Parameter tunneling</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.3.f.html" rel="next">&sect;4.3.(f)&nbsp;Base super calls&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.3.html" rel="section">&sect;4.3&nbsp;Base calls</a></div>
+ <div class="subsect depth3" id="s4.3.e">
+ <h4 class="subsect">&sect;4.3.(e)&nbsp;<span class="title">Fragile callin binding</span></h4>
+ <p>If a role method returns void, but the bound base method declares a
+ non-void result, this is reported as a <em>fragile callin binding</em>:
+ The result can still be provided by the base call, but omitting the
+ base call may cause problems depending on the return type:
+
+ </p>
+ <ul>
+ <li>For reference return types <code>null</code> will be returned
+ in this case.
+ </li>
+ <li>In the case of primitive return types this will cause a
+ <code>ResultNotProvidedException</code> at run-time.
+ </li>
+ </ul>
+ <p>It is an error if a callin method involved in a fragile callin binding
+ has definitely no base call.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s4.3.d.html" rel="prev">&lt;&lt;&nbsp;&sect;4.3.(d)&nbsp;Parameter tunneling</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.3.f.html" rel="next">&sect;4.3.(f)&nbsp;Base super calls&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.3.html" rel="section">&sect;4.3&nbsp;Base calls</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.3.f.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.3.f.html
new file mode 100644
index 000000000..5f9d0f196
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.3.f.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s4.3.e.html" rel="prev">&lt;&lt;&nbsp;&sect;4.3.(e)&nbsp;Fragile callin binding</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.3.html" rel="section">&sect;4.3&nbsp;Base calls</a></div>
+ <div class="subsect depth3" id="s4.3.f">
+ <h4 class="subsect">&sect;4.3.(f)&nbsp;<span class="title">Base super calls</span></h4>
+ <p>If a callin method <code>rm</code> is bound to a base method <code>B1.m</code>
+ that in turn overrides an inherited method <code>B0.m</code>
+ (<code>B0</code> is a super class of <code>B1</code>),
+ the callin method may use a special form of a base call denoted as
+
+ </p>
+ <div class="listing plain"><pre><strong>base.super</strong>.rm();</pre></div>
+ <p>Such base super call invokes the super method of the bound base method,
+ here <code>B0.m</code>. This invocation is not affected by any further callin binding.
+
+ </p>
+ <p>A base super call bypasses both the original method <code>B1.m</code> and
+ also other callin bindings that would be triggered by a regular base call.
+ For this reason any application of this construct is flagged by a decapsulation warning
+ (see <a href="s3.4.html" title="&sect;3.4&nbsp;Overriding access restrictions"
+ class="sect">&sect;3.4</a>).
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s4.3.e.html" rel="prev">&lt;&lt;&nbsp;&sect;4.3.(e)&nbsp;Fragile callin binding</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.3.html" rel="section">&sect;4.3&nbsp;Base calls</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.3.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.3.html
new file mode 100644
index 000000000..272955239
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.3.html
@@ -0,0 +1,201 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s4.2.html" rel="prev">&lt;&lt;&nbsp;&sect;4.2&nbsp;Callin modifiers (before, after, replace)</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.4.html" rel="next">&sect;4.4&nbsp;Callin parameter mapping&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a></div>
+ <div class="sect depth2" id="s4.3">
+ <h2 class="sect">&sect;4.3&nbsp;Base calls</h2>
+ <div class="syntaxlink"><a href="sA.html#sA.5.3" title="&sect;A.5.3&nbsp;BaseCall" class="syntax">&rarr;&nbsp;Syntax&nbsp;&sect;A.5.3</a></div>
+ <p>Role methods with a <code>callin</code> modifier should contain
+ a <em>base call</em> which uses the special name <code>base</code>
+ in order to invoke the original base method (original means: before replacement).
+
+ </p>
+ <div class="subsect depth3" id="s4.3.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Syntax</span></h4>
+ <p>The syntax for base calls is <code>base.m()</code>,
+ which is in analogy to super calls.
+ A <code>base.m()</code> call must use the same name and signature
+ as the enclosing method. This again follows the rule, that roles
+ should never explicitly use base names, except in binding declarations.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.3.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Missing base call</span></h4>
+ <p>For each callin method, the compiler uses some flow analysis to check whether
+ a base call will be invoked on each path of execution (analysis is very similar
+ to the analysis for definite assignment regarding final variables -
+ <a href="http://java.sun.com/docs/books/jls/third_edition/html/defAssign.html"
+ class="ext">JLS &sect;16</a>).
+ The compiler will issue a warning if a base call is missing either
+ on each path (definitely missing) or on some paths (potentially missing).
+ Instead of directly invoking a base call, a callin method may also call
+ its explicit or implicit super version using <code>super.m()</code> or <code>tsuper.m()</code> (see <a href="s1.3.1.f.html" title="&sect;1.3.1.(f)&nbsp;tsuper" class="sect">&sect;1.3.1.(f)</a>).
+ In this case the flow analysis will transitively include the called super/tsuper version.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.3.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Duplicate base call</span></h4>
+ <p>If a callin method contains several base calls, the compiler gives
+ a warning if this will result in duplicate base call invocations on all
+ paths (definitely duplicate) or on some paths (potentially duplicate).
+ Again super/tsuper calls are included in the flow analysis (see 4.3(b)).
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.3.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Parameter tunneling</span></h4>
+ <p>If a base method has more parameters
+ than a callin method to which it is composed, additional
+ parameters are implicitly passed unchanged from the original
+ call to the base call (original means: before interception).
+ I.e., a call <code>base.m()</code> may invisibly pass additional
+ parameters that were provided by the caller, but are hidden from the
+ role method.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.3.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Fragile callin binding</span></h4>
+ <p>If a role method returns void, but the bound base method declares a
+ non-void result, this is reported as a <em>fragile callin binding</em>:
+ The result can still be provided by the base call, but omitting the
+ base call may cause problems depending on the return type:
+
+ </p>
+ <ul>
+ <li>For reference return types <code>null</code> will be returned
+ in this case.
+ </li>
+ <li>In the case of primitive return types this will cause a
+ <code>ResultNotProvidedException</code> at run-time.
+ </li>
+ </ul>
+ <p>It is an error if a callin method involved in a fragile callin binding
+ has definitely no base call.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.3.f">
+ <h4 class="subsect">(f)&nbsp;<span class="title">Base super calls</span></h4>
+ <p>If a callin method <code>rm</code> is bound to a base method <code>B1.m</code>
+ that in turn overrides an inherited method <code>B0.m</code>
+ (<code>B0</code> is a super class of <code>B1</code>),
+ the callin method may use a special form of a base call denoted as
+
+ </p>
+ <div class="listing plain"><pre><strong>base.super</strong>.rm();</pre></div>
+ <p>Such base super call invokes the super method of the bound base method,
+ here <code>B0.m</code>. This invocation is not affected by any further callin binding.
+
+ </p>
+ <p>A base super call bypasses both the original method <code>B1.m</code> and
+ also other callin bindings that would be triggered by a regular base call.
+ For this reason any application of this construct is flagged by a decapsulation warning
+ (see <a href="s3.4.html" title="&sect;3.4&nbsp;Overriding access restrictions"
+ class="sect">&sect;3.4</a>).
+
+ </p>
+ </div>
+ <div class="note">
+ <h5>Comment:</h5>
+ Base calls can occur in callin methods that are not
+ yet bound. These methods have no idea of the names of base methods that
+ a sub-role will bind to them. Also multiple base methods may be bound
+ to the same callin method.
+ Hence the use of the role method's own name and signature.
+ The language implementation translates the method name and signature
+ back to the base method that has originally been invoked.
+
+ </div>
+ <h5 class="listing">Example code (Base Call):</h5>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>class</b> ValidatorRole <b>playedBy</b> Po<b>int</b> {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <em>callin</em> <b>void</b> checkCoordinate(<b>int</b> value) {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>if</b> (value &lt; 0)</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <em>base</em>.checkCoordinate(-value);</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> else</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> <em>base</em>.checkCoordinate(value);</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre> checkCoordinate <b>&lt;-</b> <b>replace</b> setX, setY;</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="codecomment">
+ <h5>Effects:</h5>
+ <ul>
+ <li>Line 2 defines a callin method which is bound to two methods
+ of the base class <code>Point</code> (see line 8).
+ </li>
+ <li>The value passed to either setX or setY is checked if it is
+ positive (line 3).
+ </li>
+ <li>Lines 4 and 6 show calls of the original method (base calls).
+ While line 6 passes the original value, in the negative case (line 4)
+ the passed value is made positive.
+ </li>
+ </ul>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s4.2.html" rel="prev">&lt;&lt;&nbsp;&sect;4.2&nbsp;Callin modifiers (before, after, replace)</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.4.html" rel="next">&sect;4.4&nbsp;Callin parameter mapping&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.4.a.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.4.a.html
new file mode 100644
index 000000000..be57a425c
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.4.a.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.4.b.html" rel="next">&sect;4.4.(b)&nbsp;Restrictions for callin replace bindings&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.4.html" rel="section">&sect;4.4&nbsp;Callin parameter mapping</a></div>
+ <div class="subsect depth3" id="s4.4.a">
+ <h4 class="subsect">&sect;4.4.(a)&nbsp;<span class="title">General case parameter mapping</span></h4>
+ <p>The rules for mapping callin parameters and result type
+ are mainly the same as for callout bindings (<a href="s3.2.html" title="&sect;3.2&nbsp;Callout parameter mapping"
+ class="sect">&sect;3.2</a>)
+ except for reversing the <code>-&gt;</code> and <code>&lt;-</code> tokens and
+ swapping left hand side and right hand side.
+ <br />
+ Callin bindings using <code>before</code> have no result mapping.
+ For <code>result</code> in <code>after</code> callin bindings
+ see <a href="s4.4.c.html"
+ title="&sect;4.4.(c)&nbsp;Mapping the result of a base method"
+ class="sect">&sect;4.4.(c)</a> below.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.4.b.html" rel="next">&sect;4.4.(b)&nbsp;Restrictions for callin replace bindings&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.4.html" rel="section">&sect;4.4&nbsp;Callin parameter mapping</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.4.b.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.4.b.html
new file mode 100644
index 000000000..42cfea62d
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.4.b.html
@@ -0,0 +1,80 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s4.4.a.html" rel="prev">&lt;&lt;&nbsp;&sect;4.4.(a)&nbsp;General case parameter mapping</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.4.c.html" rel="next">&sect;4.4.(c)&nbsp;Mapping the result of a base method&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.4.html" rel="section">&sect;4.4&nbsp;Callin parameter mapping</a></div>
+ <div class="subsect depth3" id="s4.4.b">
+ <h4 class="subsect">&sect;4.4.(b)&nbsp;<span class="title">Restrictions for callin replace bindings</span></h4>
+ <p>The right-hand side of a parameter mapping may either be
+ the simple name of a base method argument without further computation,
+ or an arbitrary expression <em>not</em> containing any base method argument.
+ <br />
+ Each base method argument must either appear as a simple name in exactly one parameter mapping
+ or not be mapped at all. In the latter case, the original argument is "tunneled" to
+ the base call, meaning, the callin method does not see the argument, but it is passed
+ to the base method as expected.
+ <br />
+ If the base method declares a result, then
+
+ </p>
+ <ul>
+ <li>if the role method also declares a result, <code>result</code> must be mapped to itself:
+ <br /><code>result -&gt; result</code></li>
+ <li>if the role method does not declare a result, an arbitrary expression may be mapped to result:
+ <br /><code><em>expression</em> -&gt; result</code><br />
+ If in this situation no result mapping exists, the result of the base call
+ is "tunneled" and passed to the original caller (see <a href="s4.3.e.html" title="&sect;4.3.(e)&nbsp;Fragile callin binding"
+ class="sect">
+ fragile callin binding (&sect;4.3.(e))</a> above).
+
+ </li>
+ </ul>
+ <p>These rules ensure that these bindings are reversible
+ for the sake of base calls (<a href="s4.3.html" title="&sect;4.3&nbsp;Base calls" class="sect">&sect;4.3</a>).
+
+ </p>
+ <p>As stated above a fragile callin binding (<a href="s4.3.e.html" title="&sect;4.3.(e)&nbsp;Fragile callin binding"
+ class="sect">&sect;4.3.(e)</a>)
+ is not allowed with a callin method that definitely has no base call
+ (<a href="s4.3.b.html" title="&sect;4.3.(b)&nbsp;Missing base call"
+ class="sect">&sect;4.3.(b)</a>). A callin replace binding is not fragile if it provides
+ the base result using a result mapping.
+
+ </p>
+ <p>A callin method bound with replace to a base method returning
+ void must not declare a non-void result.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s4.4.a.html" rel="prev">&lt;&lt;&nbsp;&sect;4.4.(a)&nbsp;General case parameter mapping</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.4.c.html" rel="next">&sect;4.4.(c)&nbsp;Mapping the result of a base method&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.4.html" rel="section">&sect;4.4&nbsp;Callin parameter mapping</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.4.c.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.4.c.html
new file mode 100644
index 000000000..8071f28a4
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.4.c.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s4.4.b.html" rel="prev">&lt;&lt;&nbsp;&sect;4.4.(b)&nbsp;Restrictions for callin replace bindings</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.4.d.html" rel="next">&sect;4.4.(d)&nbsp;Multiple base methods&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.4.html" rel="section">&sect;4.4&nbsp;Callin parameter mapping</a></div>
+ <div class="subsect depth3" id="s4.4.c">
+ <h4 class="subsect">&sect;4.4.(c)&nbsp;<span class="title">Mapping the result of a base method</span></h4>
+ <p>In an <code>after</code> callin binding, the right-hand side
+ of a parameter mapping may use the identifier <code>result</code>
+ to refer to the result of the base method.
+
+ </p>
+ <p>
+ An <code>after</code> callin binding
+ can, however, not <em>influence</em> the result of the base method,
+ thus mappings with the <code>-&gt;</code> token are not allowed for after callin bindings.
+ For <code>before</code> mappings using the <code>-&gt;</code> token is already ruled out by <a href="s4.4.a.html"
+ title="&sect;4.4.(a)&nbsp;General case parameter mapping"
+ class="sect">&sect;4.4.(a)</a></p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s4.4.b.html" rel="prev">&lt;&lt;&nbsp;&sect;4.4.(b)&nbsp;Restrictions for callin replace bindings</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.4.d.html" rel="next">&sect;4.4.(d)&nbsp;Multiple base methods&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.4.html" rel="section">&sect;4.4&nbsp;Callin parameter mapping</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.4.d.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.4.d.html
new file mode 100644
index 000000000..1a998301b
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.4.d.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s4.4.c.html" rel="prev">&lt;&lt;&nbsp;&sect;4.4.(c)&nbsp;Mapping the result of a base method</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.4.html" rel="section">&sect;4.4&nbsp;Callin parameter mapping</a></div>
+ <div class="subsect depth3" id="s4.4.d">
+ <h4 class="subsect">&sect;4.4.(d)&nbsp;<span class="title">Multiple base methods</span></h4>
+ <p>A callin binding listing more than one base method may use parameter
+ mappings with only the following restriction: if any base parameter should be mapped this parameter
+ must have the same name and type in all listed base method designators.
+ However, different parameter mappings for different base methods bound to the same role method
+ can be defined if separate callin bindings are used.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s4.4.c.html" rel="prev">&lt;&lt;&nbsp;&sect;4.4.(c)&nbsp;Mapping the result of a base method</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.4.html" rel="section">&sect;4.4&nbsp;Callin parameter mapping</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.4.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.4.html
new file mode 100644
index 000000000..971be4496
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.4.html
@@ -0,0 +1,123 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s4.3.html" rel="prev">&lt;&lt;&nbsp;&sect;4.3&nbsp;Base calls</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.5.html" rel="next">&sect;4.5&nbsp;Lifting and lowering&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a></div>
+ <div class="sect depth2" id="s4.4">
+ <h2 class="sect">&sect;4.4&nbsp;Callin parameter mapping</h2>
+ <div class="subsect depth3" id="s4.4.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">General case parameter mapping</span></h4>
+ <p>The rules for mapping callin parameters and result type
+ are mainly the same as for callout bindings (<a href="s3.2.html" title="&sect;3.2&nbsp;Callout parameter mapping"
+ class="sect">&sect;3.2</a>)
+ except for reversing the <code>-&gt;</code> and <code>&lt;-</code> tokens and
+ swapping left hand side and right hand side.
+ <br />
+ Callin bindings using <code>before</code> have no result mapping.
+ For <code>result</code> in <code>after</code> callin bindings
+ see <a href="#s4.4.c"
+ title="&sect;4.4.(c)&nbsp;Mapping the result of a base method"
+ class="sect">&sect;4.4.(c)</a> below.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.4.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Restrictions for callin replace bindings</span></h4>
+ <p>The right-hand side of a parameter mapping may either be
+ the simple name of a base method argument without further computation,
+ or an arbitrary expression <em>not</em> containing any base method argument.
+ <br />
+ Each base method argument must either appear as a simple name in exactly one parameter mapping
+ or not be mapped at all. In the latter case, the original argument is "tunneled" to
+ the base call, meaning, the callin method does not see the argument, but it is passed
+ to the base method as expected.
+ <br />
+ If the base method declares a result, then
+
+ </p>
+ <ul>
+ <li>if the role method also declares a result, <code>result</code> must be mapped to itself:
+ <br /><code>result -&gt; result</code></li>
+ <li>if the role method does not declare a result, an arbitrary expression may be mapped to result:
+ <br /><code><em>expression</em> -&gt; result</code><br />
+ If in this situation no result mapping exists, the result of the base call
+ is "tunneled" and passed to the original caller (see <a href="s4.3.e.html" title="&sect;4.3.(e)&nbsp;Fragile callin binding"
+ class="sect">
+ fragile callin binding (&sect;4.3.(e))</a> above).
+
+ </li>
+ </ul>
+ <p>These rules ensure that these bindings are reversible
+ for the sake of base calls (<a href="s4.3.html" title="&sect;4.3&nbsp;Base calls" class="sect">&sect;4.3</a>).
+
+ </p>
+ <p>As stated above a fragile callin binding (<a href="s4.3.e.html" title="&sect;4.3.(e)&nbsp;Fragile callin binding"
+ class="sect">&sect;4.3.(e)</a>)
+ is not allowed with a callin method that definitely has no base call
+ (<a href="s4.3.b.html" title="&sect;4.3.(b)&nbsp;Missing base call"
+ class="sect">&sect;4.3.(b)</a>). A callin replace binding is not fragile if it provides
+ the base result using a result mapping.
+
+ </p>
+ <p>A callin method bound with replace to a base method returning
+ void must not declare a non-void result.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.4.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Mapping the result of a base method</span></h4>
+ <p>In an <code>after</code> callin binding, the right-hand side
+ of a parameter mapping may use the identifier <code>result</code>
+ to refer to the result of the base method.
+
+ </p>
+ <p>
+ An <code>after</code> callin binding
+ can, however, not <em>influence</em> the result of the base method,
+ thus mappings with the <code>-&gt;</code> token are not allowed for after callin bindings.
+ For <code>before</code> mappings using the <code>-&gt;</code> token is already ruled out by <a href="#s4.4.a" title="&sect;4.4.(a)&nbsp;General case parameter mapping"
+ class="sect">&sect;4.4.(a)</a></p>
+ </div>
+ <div class="subsect depth3" id="s4.4.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Multiple base methods</span></h4>
+ <p>A callin binding listing more than one base method may use parameter
+ mappings with only the following restriction: if any base parameter should be mapped this parameter
+ must have the same name and type in all listed base method designators.
+ However, different parameter mappings for different base methods bound to the same role method
+ can be defined if separate callin bindings are used.
+
+ </p>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s4.3.html" rel="prev">&lt;&lt;&nbsp;&sect;4.3&nbsp;Base calls</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.5.html" rel="next">&sect;4.5&nbsp;Lifting and lowering&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.5.a.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.5.a.html
new file mode 100644
index 000000000..0dabb2472
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.5.a.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.5.b.html" rel="next">&sect;4.5.(b)&nbsp;Parameter translation&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.5.html" rel="section">&sect;4.5&nbsp;Lifting and lowering</a></div>
+ <div class="subsect depth3" id="s4.5.a">
+ <h4 class="subsect">&sect;4.5.(a)&nbsp;<span class="title">Call target translation</span></h4>
+ <p>Invoking a role method due to a callin binding first
+ <strong>lifts</strong> the base object to the role class of the
+ callin binding, in order to obtain the effective call target.
+ This is why callin bindings cannot be defined in roles that are <em>unliftable</em>
+ due to <em>potential binding ambiguity</em> (see <a href="s4.1.b.html" title="&sect;4.1.(b)&nbsp;Prerequisite: Class binding"
+ class="sect">&sect;4.1.(b)</a>
+ above and <a href="s2.3.4.a.html" title="&sect;2.3.4.(a)&nbsp;Potential ambiguity"
+ class="sect">&sect;2.3.4.(a)</a>).
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.5.b.html" rel="next">&sect;4.5.(b)&nbsp;Parameter translation&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.5.html" rel="section">&sect;4.5&nbsp;Lifting and lowering</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.5.b.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.5.b.html
new file mode 100644
index 000000000..a13b02e21
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.5.b.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s4.5.a.html" rel="prev">&lt;&lt;&nbsp;&sect;4.5.(a)&nbsp;Call target translation</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.5.c.html" rel="next">&sect;4.5.(c)&nbsp;Result translation&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.5.html" rel="section">&sect;4.5&nbsp;Lifting and lowering</a></div>
+ <div class="subsect depth3" id="s4.5.b">
+ <h4 class="subsect">&sect;4.5.(b)&nbsp;<span class="title">Parameter translation</span></h4>
+ <p>During callin execution, each parameter for which the role method expects a role
+ object is implicitly <strong>lifted</strong> to the declared role class.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s4.5.a.html" rel="prev">&lt;&lt;&nbsp;&sect;4.5.(a)&nbsp;Call target translation</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.5.c.html" rel="next">&sect;4.5.(c)&nbsp;Result translation&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.5.html" rel="section">&sect;4.5&nbsp;Lifting and lowering</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.5.c.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.5.c.html
new file mode 100644
index 000000000..eb2fb3b5a
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.5.c.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s4.5.b.html" rel="prev">&lt;&lt;&nbsp;&sect;4.5.(b)&nbsp;Parameter translation</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.5.d.html" rel="next">&sect;4.5.(d)&nbsp;Typing rules&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.5.html" rel="section">&sect;4.5&nbsp;Lifting and lowering</a></div>
+ <div class="subsect depth3" id="s4.5.c">
+ <h4 class="subsect">&sect;4.5.(c)&nbsp;<span class="title">Result translation</span></h4>
+ <p>Returning a role object from a callin method implicitly
+ <strong>lowers</strong> this object.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s4.5.b.html" rel="prev">&lt;&lt;&nbsp;&sect;4.5.(b)&nbsp;Parameter translation</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.5.d.html" rel="next">&sect;4.5.(d)&nbsp;Typing rules&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.5.html" rel="section">&sect;4.5&nbsp;Lifting and lowering</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.5.d.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.5.d.html
new file mode 100644
index 000000000..be4b81fb4
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.5.d.html
@@ -0,0 +1,76 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s4.5.c.html" rel="prev">&lt;&lt;&nbsp;&sect;4.5.(c)&nbsp;Result translation</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.5.e.html" rel="next">&sect;4.5.(e)&nbsp;Role arrays&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.5.html" rel="section">&sect;4.5&nbsp;Lifting and lowering</a></div>
+ <div class="subsect depth3" id="s4.5.d">
+ <h4 class="subsect">&sect;4.5.(d)&nbsp;<span class="title">Typing rules</span></h4>
+ <p>A parameter mapping (implicit by parameter position or explicit
+ by a <code>with</code> clause) is <strong>well typed</strong> if
+ the right hand side conforms to the left hand side, either by
+
+ </p>
+ <ul>
+ <li>type equality</li>
+ <li>implicit primitive type conversion</li>
+ <li>subtype polymorphism</li>
+ <li>translation polymorphism, here: <em>lifting</em>;<br />
+ however, within <code>replace</code> bindings step 1 of the smart lifting
+ algorithm (<a href="s2.3.3.a.html" title="&sect;2.3.3.(a)&nbsp;Static adjustment"
+ class="sect">&sect;2.3.3.(a)</a>) is not applicable
+ </li>
+ <li><em>or</em> by a combination of the above.
+ </li>
+ </ul>
+ <p>A result mapping (implicit or explicit by a <code>with</code> clause)
+ is well typed, if the value at the left hand conforms to the
+ right hand side according to the rules given above, except that
+ translation polymorphism here applies <em>lowering</em> instead of
+ lifting.
+ </p>
+ <p>
+ These rules define <strong>translation polymorphism</strong> as introduced in
+ <a href="s2.3.html" title="&sect;2.3&nbsp;Lifting" class="sect">&sect;2.3</a>.
+
+ </p>
+ <p>Additionally, in a <code>replace</code> callin binding compatibility of parameters and return
+ types must hold in both directions.
+ Thus, from the above list of conversions a replace binding cannot apply subtype polymorphism
+ nor primitive type conversion.
+ If more flexibility is desired, type parameters can be used as defined in <a href="s4.10.html" title="&sect;4.10&nbsp;Generic callin bindings"
+ class="sect">&sect;4.10</a>.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s4.5.c.html" rel="prev">&lt;&lt;&nbsp;&sect;4.5.(c)&nbsp;Result translation</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.5.e.html" rel="next">&sect;4.5.(e)&nbsp;Role arrays&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.5.html" rel="section">&sect;4.5&nbsp;Lifting and lowering</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.5.e.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.5.e.html
new file mode 100644
index 000000000..46bf1a013
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.5.e.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s4.5.d.html" rel="prev">&lt;&lt;&nbsp;&sect;4.5.(d)&nbsp;Typing rules</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.5.f.html" rel="next">&sect;4.5.(f)&nbsp;Base calls&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.5.html" rel="section">&sect;4.5&nbsp;Lifting and lowering</a></div>
+ <div class="subsect depth3" id="s4.5.e">
+ <h4 class="subsect">&sect;4.5.(e)&nbsp;<span class="title">Role arrays</span></h4>
+ <p>For arrays of roles as parameters <a href="s2.3.d.html" title="&sect;2.3.(d)&nbsp;Lifting of arrays"
+ class="sect">&sect;2.3.(d)</a> applies
+ accordingly. For arrays as return value <a href="s2.2.e.html" title="&sect;2.2.(e)&nbsp;Lowering of arrays"
+ class="sect">&sect;2.2.(e)</a> applies.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s4.5.d.html" rel="prev">&lt;&lt;&nbsp;&sect;4.5.(d)&nbsp;Typing rules</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.5.f.html" rel="next">&sect;4.5.(f)&nbsp;Base calls&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.5.html" rel="section">&sect;4.5&nbsp;Lifting and lowering</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.5.f.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.5.f.html
new file mode 100644
index 000000000..2ba4bc52e
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.5.f.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s4.5.e.html" rel="prev">&lt;&lt;&nbsp;&sect;4.5.(e)&nbsp;Role arrays</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.5.html" rel="section">&sect;4.5&nbsp;Lifting and lowering</a></div>
+ <div class="subsect depth3" id="s4.5.f">
+ <h4 class="subsect">&sect;4.5.(f)&nbsp;<span class="title">Base calls</span></h4>
+ <p>For base calls these rules are reversed again, i.e., a
+ base call behaves like a callout binding.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s4.5.e.html" rel="prev">&lt;&lt;&nbsp;&sect;4.5.(e)&nbsp;Role arrays</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.5.html" rel="section">&sect;4.5&nbsp;Lifting and lowering</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.5.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.5.html
new file mode 100644
index 000000000..dd2f391b8
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.5.html
@@ -0,0 +1,128 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s4.4.html" rel="prev">&lt;&lt;&nbsp;&sect;4.4&nbsp;Callin parameter mapping</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.6.html" rel="next">&sect;4.6&nbsp;Overriding access restrictions&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a></div>
+ <div class="sect depth2" id="s4.5">
+ <h2 class="sect">&sect;4.5&nbsp;Lifting and lowering</h2>
+ <p>For basic definition see <a href="s2.2.html" title="&sect;2.2&nbsp;Lowering" class="sect">&sect;2.2</a>
+ and <a href="s2.3.html" title="&sect;2.3&nbsp;Lifting" class="sect">&sect;2.3</a>.
+ <br />
+ (The following rules are reverse forms of those from <a href="s3.3.html" title="&sect;3.3&nbsp;Lifting and lowering" class="sect">&sect;3.3</a>)
+
+ </p>
+ <div class="subsect depth3" id="s4.5.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Call target translation</span></h4>
+ <p>Invoking a role method due to a callin binding first
+ <strong>lifts</strong> the base object to the role class of the
+ callin binding, in order to obtain the effective call target.
+ This is why callin bindings cannot be defined in roles that are <em>unliftable</em>
+ due to <em>potential binding ambiguity</em> (see <a href="s4.1.b.html" title="&sect;4.1.(b)&nbsp;Prerequisite: Class binding"
+ class="sect">&sect;4.1.(b)</a>
+ above and <a href="s2.3.4.a.html" title="&sect;2.3.4.(a)&nbsp;Potential ambiguity"
+ class="sect">&sect;2.3.4.(a)</a>).
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.5.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Parameter translation</span></h4>
+ <p>During callin execution, each parameter for which the role method expects a role
+ object is implicitly <strong>lifted</strong> to the declared role class.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.5.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Result translation</span></h4>
+ <p>Returning a role object from a callin method implicitly
+ <strong>lowers</strong> this object.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.5.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Typing rules</span></h4>
+ <p>A parameter mapping (implicit by parameter position or explicit
+ by a <code>with</code> clause) is <strong>well typed</strong> if
+ the right hand side conforms to the left hand side, either by
+
+ </p>
+ <ul>
+ <li>type equality</li>
+ <li>implicit primitive type conversion</li>
+ <li>subtype polymorphism</li>
+ <li>translation polymorphism, here: <em>lifting</em>;<br />
+ however, within <code>replace</code> bindings step 1 of the smart lifting
+ algorithm (<a href="s2.3.3.a.html" title="&sect;2.3.3.(a)&nbsp;Static adjustment"
+ class="sect">&sect;2.3.3.(a)</a>) is not applicable
+ </li>
+ <li><em>or</em> by a combination of the above.
+ </li>
+ </ul>
+ <p>A result mapping (implicit or explicit by a <code>with</code> clause)
+ is well typed, if the value at the left hand conforms to the
+ right hand side according to the rules given above, except that
+ translation polymorphism here applies <em>lowering</em> instead of
+ lifting.
+ </p>
+ <p>
+ These rules define <strong>translation polymorphism</strong> as introduced in
+ <a href="s2.3.html" title="&sect;2.3&nbsp;Lifting" class="sect">&sect;2.3</a>.
+
+ </p>
+ <p>Additionally, in a <code>replace</code> callin binding compatibility of parameters and return
+ types must hold in both directions.
+ Thus, from the above list of conversions a replace binding cannot apply subtype polymorphism
+ nor primitive type conversion.
+ If more flexibility is desired, type parameters can be used as defined in <a href="s4.10.html" title="&sect;4.10&nbsp;Generic callin bindings"
+ class="sect">&sect;4.10</a>.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.5.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Role arrays</span></h4>
+ <p>For arrays of roles as parameters <a href="s2.3.d.html" title="&sect;2.3.(d)&nbsp;Lifting of arrays"
+ class="sect">&sect;2.3.(d)</a> applies
+ accordingly. For arrays as return value <a href="s2.2.e.html" title="&sect;2.2.(e)&nbsp;Lowering of arrays"
+ class="sect">&sect;2.2.(e)</a> applies.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.5.f">
+ <h4 class="subsect">(f)&nbsp;<span class="title">Base calls</span></h4>
+ <p>For base calls these rules are reversed again, i.e., a
+ base call behaves like a callout binding.
+
+ </p>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s4.4.html" rel="prev">&lt;&lt;&nbsp;&sect;4.4&nbsp;Callin parameter mapping</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.6.html" rel="next">&sect;4.6&nbsp;Overriding access restrictions&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.6.a.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.6.a.html
new file mode 100644
index 000000000..347c9a651
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.6.a.html
@@ -0,0 +1,54 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.6.html" rel="section">&sect;4.6&nbsp;Overriding access restrictions</a></div>
+ <div class="subsect depth3" id="s4.6.a">
+ <h4 class="subsect">&sect;4.6.(a)&nbsp;<span class="title">Private methods from super classes</span></h4>
+ <p><em>(Cf. <a href="s3.4.d.html"
+ title="&sect;3.4.(d)&nbsp;Private methods from super classes"
+ class="sect">&sect;3.4.(d)</a>)</em>
+ If a callin binding shall bind to a private base method, that method
+ must be defined in the exact base class to which the current role
+ class is bound using <code>playedBy</code>.
+ <br />
+ If a private base feature must indeed be callin-bound, a role class
+ must be defined that is played by the exact base class defining the
+ private feature. Another role bound to a sub-base-class can then
+ be defined as a sub class of the first role. It will inherit the
+ callin binding and through this it can access the desired feature.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.6.html" rel="section">&sect;4.6&nbsp;Overriding access restrictions</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.6.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.6.html
new file mode 100644
index 000000000..1c0ae6758
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.6.html
@@ -0,0 +1,73 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s4.5.html" rel="prev">&lt;&lt;&nbsp;&sect;4.5&nbsp;Lifting and lowering</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.7.html" rel="next">&sect;4.7&nbsp;Callin binding with static methods&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a></div>
+ <div class="sect depth2" id="s4.6">
+ <h2 class="sect">&sect;4.6&nbsp;Overriding access restrictions</h2>
+ <p>Callin bindings may also mention inaccessible methods
+ (cf. decapsulation <a href="s3.4.html" title="&sect;3.4&nbsp;Overriding access restrictions"
+ class="sect">&sect;3.4</a>).
+ Due to the reverse call direction this is relevant only for base calls within
+ <code>callin</code> methods.
+ Base calls have unrestricted access to protected base methods.
+ Accessing a base method with private or default visibility is
+ also allowed, but signaled by a compiler warning.
+
+ </p>
+ <div class="note">
+ <h5>Comment:</h5>
+ A base call to an inaccessible base method is considered harmless,
+ since this is the originally intended method execution.
+
+ </div>
+ <div class="subsect depth3" id="s4.6.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Private methods from super classes</span></h4>
+ <p><em>(Cf. <a href="s3.4.d.html"
+ title="&sect;3.4.(d)&nbsp;Private methods from super classes"
+ class="sect">&sect;3.4.(d)</a>)</em>
+ If a callin binding shall bind to a private base method, that method
+ must be defined in the exact base class to which the current role
+ class is bound using <code>playedBy</code>.
+ <br />
+ If a private base feature must indeed be callin-bound, a role class
+ must be defined that is played by the exact base class defining the
+ private feature. Another role bound to a sub-base-class can then
+ be defined as a sub class of the first role. It will inherit the
+ callin binding and through this it can access the desired feature.
+
+ </p>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s4.5.html" rel="prev">&lt;&lt;&nbsp;&sect;4.5&nbsp;Lifting and lowering</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.7.html" rel="next">&sect;4.7&nbsp;Callin binding with static methods&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.7.a.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.7.a.html
new file mode 100644
index 000000000..8950db4ba
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.7.a.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.7.b.html" rel="next">&sect;4.7.(b)&nbsp;Binding static to static&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.7.html" rel="section">&sect;4.7&nbsp;Callin binding with static methods</a></div>
+ <div class="subsect depth3" id="s4.7.a">
+ <h4 class="subsect">&sect;4.7.(a)&nbsp;<span class="title">Static role methods</span></h4>
+ <p>A role class may define static methods (see also <a href="s1.2.1.f.html" title="&sect;1.2.1.(f)&nbsp;Static role methods"
+ class="sect">&sect;1.2.1.(f)</a>).
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.7.b.html" rel="next">&sect;4.7.(b)&nbsp;Binding static to static&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.7.html" rel="section">&sect;4.7&nbsp;Callin binding with static methods</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.7.b.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.7.b.html
new file mode 100644
index 000000000..d62fece9d
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.7.b.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s4.7.a.html" rel="prev">&lt;&lt;&nbsp;&sect;4.7.(a)&nbsp;Static role methods</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.7.c.html" rel="next">&sect;4.7.(c)&nbsp;before/after&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.7.html" rel="section">&sect;4.7&nbsp;Callin binding with static methods</a></div>
+ <div class="subsect depth3" id="s4.7.b">
+ <h4 class="subsect">&sect;4.7.(b)&nbsp;<span class="title">Binding static to static</span></h4>
+ <p>A callin binding may bind a static role method to one or more
+ static base methods. It is, however, an error to bind a static base method to a non-static role method,
+ because such binding would require to lift a base object that is not provided.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s4.7.a.html" rel="prev">&lt;&lt;&nbsp;&sect;4.7.(a)&nbsp;Static role methods</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.7.c.html" rel="next">&sect;4.7.(c)&nbsp;before/after&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.7.html" rel="section">&sect;4.7&nbsp;Callin binding with static methods</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.7.c.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.7.c.html
new file mode 100644
index 000000000..b1941fccc
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.7.c.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s4.7.b.html" rel="prev">&lt;&lt;&nbsp;&sect;4.7.(b)&nbsp;Binding static to static</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.7.d.html" rel="next">&sect;4.7.(d)&nbsp;replace&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.7.html" rel="section">&sect;4.7&nbsp;Callin binding with static methods</a></div>
+ <div class="subsect depth3" id="s4.7.c">
+ <h4 class="subsect">&sect;4.7.(c)&nbsp;<span class="title">before/after</span></h4>
+ <p>In addition to the above, <code>before</code> and <code>after</code>
+ callin bindings may also bind a static role method to non-static base methods.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s4.7.b.html" rel="prev">&lt;&lt;&nbsp;&sect;4.7.(b)&nbsp;Binding static to static</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.7.d.html" rel="next">&sect;4.7.(d)&nbsp;replace&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.7.html" rel="section">&sect;4.7&nbsp;Callin binding with static methods</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.7.d.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.7.d.html
new file mode 100644
index 000000000..c81834f14
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.7.d.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s4.7.c.html" rel="prev">&lt;&lt;&nbsp;&sect;4.7.(c)&nbsp;before/after</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.7.e.html" rel="next">&sect;4.7.(e)&nbsp;No overriding&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.7.html" rel="section">&sect;4.7&nbsp;Callin binding with static methods</a></div>
+ <div class="subsect depth3" id="s4.7.d">
+ <h4 class="subsect">&sect;4.7.(d)&nbsp;<span class="title">replace</span></h4>
+ <p>In contrast to <a href="s4.7.c.html" title="&sect;4.7.(c)&nbsp;before/after" class="sect">&sect;4.7.(c)</a> above, a <code>replace</code> callin binding
+ cannot bind a static role method to a non-static base method.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s4.7.c.html" rel="prev">&lt;&lt;&nbsp;&sect;4.7.(c)&nbsp;before/after</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.7.e.html" rel="next">&sect;4.7.(e)&nbsp;No overriding&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.7.html" rel="section">&sect;4.7&nbsp;Callin binding with static methods</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.7.e.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.7.e.html
new file mode 100644
index 000000000..b339c636d
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.7.e.html
@@ -0,0 +1,66 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s4.7.d.html" rel="prev">&lt;&lt;&nbsp;&sect;4.7.(d)&nbsp;replace</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.7.html" rel="section">&sect;4.7&nbsp;Callin binding with static methods</a></div>
+ <div class="subsect depth3" id="s4.7.e">
+ <h4 class="subsect">&sect;4.7.(e)&nbsp;<span class="title">No overriding</span></h4>
+ <p>Since static methods are not dynamically bound, <i>overriding</i> does not
+ apply in the normal semantics. Regarding callin bindings this has the
+ following consequences (assuming a role <code>RMid</code> played by
+ <code>BMid</code> plus its super-class <code>BSuper</code> and its sub-class
+ <code>BSub</code>.
+
+ </p>
+ <ol>
+ <li>If a static base method <code>BMid.m</code> is bound by a callin binding
+ this has no effect on any method <code>m</code> in <code>BSub</code>.
+ </li>
+ <li>If a callin binding mentions a method <code>m</code> which is not present
+ in <code>BMid</code> but resolves to a static method in <code>BSuper</code>
+ the binding only affects invocations as <code>BMid.m()</code> but not
+ <code>BSuper.m()</code>. If the latter call should be affected, too,
+ the callin binding must appear in a role class bound to <code>BSuper</code>,
+ not <code>BMid</code>.
+ </li>
+ <li>In order to bind two static base methods with equal signatures, one being
+ defined in a sub-class of the other one, two roles have to be defined
+ where one role refines the <code>playedBy</code> clause of the other role
+ (say: <code>public class RSub extends RMid playedBy BSub</code>).
+ Now each role may bind to the static base method accessible in its direct
+ base-class.
+ </li>
+ </ol>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s4.7.d.html" rel="prev">&lt;&lt;&nbsp;&sect;4.7.(d)&nbsp;replace</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.7.html" rel="section">&sect;4.7&nbsp;Callin binding with static methods</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.7.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.7.html
new file mode 100644
index 000000000..0a2c52c75
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.7.html
@@ -0,0 +1,128 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s4.6.html" rel="prev">&lt;&lt;&nbsp;&sect;4.6&nbsp;Overriding access restrictions</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.8.html" rel="next">&sect;4.8&nbsp;Callin precedence&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a></div>
+ <div class="sect depth2" id="s4.7">
+ <h2 class="sect">&sect;4.7&nbsp;Callin binding with static methods</h2>
+ <p>The normal case of callin bindings refers to non-static methods on both
+ sides (base and role). Furthermore, in Java inner classes can not define
+ static methods. Both restrictions are relaxed by the following rules:
+
+ </p>
+ <div class="subsect depth3" id="s4.7.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Static role methods</span></h4>
+ <p>A role class may define static methods (see also <a href="s1.2.1.f.html" title="&sect;1.2.1.(f)&nbsp;Static role methods"
+ class="sect">&sect;1.2.1.(f)</a>).
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.7.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Binding static to static</span></h4>
+ <p>A callin binding may bind a static role method to one or more
+ static base methods. It is, however, an error to bind a static base method to a non-static role method,
+ because such binding would require to lift a base object that is not provided.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.7.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">before/after</span></h4>
+ <p>In addition to the above, <code>before</code> and <code>after</code>
+ callin bindings may also bind a static role method to non-static base methods.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.7.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">replace</span></h4>
+ <p>In contrast to <a href="#s4.7.c" title="&sect;4.7.(c)&nbsp;before/after" class="sect">&sect;4.7.(c)</a> above, a <code>replace</code> callin binding
+ cannot bind a static role method to a non-static base method.
+
+ </p>
+ </div>
+ <p>The following table summarizes the combinations defined above:
+
+ </p>
+ <table border="2" class="sep" cellpadding="5" width="80%">
+ <tr class="z1">
+ <td colspan="2" rowspan="2" align="right"><strong>&lt;-</strong>&nbsp;&nbsp;
+ </td>
+ <td colspan="2" align="center" rowspan="1"><strong>base method</strong></td>
+ </tr>
+ <tr class="z1">
+ <td align="center" rowspan="1" colspan="1">static</td>
+ <td align="center" rowspan="1" colspan="1">non-static</td>
+ </tr>
+ <tr class="z2">
+ <td rowspan="2" align="center" class="z1" colspan="1"><strong>role<br />method</strong></td>
+ <td align="center" class="z1" rowspan="1" colspan="1">static</td>
+ <td rowspan="1" colspan="1"><span class="green">OK</span></td>
+ <td rowspan="1" colspan="1"><code>before/after</code>: <span class="green">OK</span><br /><code>replace</code>: <span class="error">illegal</span></td>
+ </tr>
+ <tr class="z2">
+ <td align="center" class="z1" rowspan="1" colspan="1">non-static</td>
+ <td rowspan="1" colspan="1"><span class="error">illegal</span></td>
+ <td rowspan="1" colspan="1"><span class="green">OK</span></td>
+ </tr>
+ </table>
+ <div class="subsect depth3" id="s4.7.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">No overriding</span></h4>
+ <p>Since static methods are not dynamically bound, <i>overriding</i> does not
+ apply in the normal semantics. Regarding callin bindings this has the
+ following consequences (assuming a role <code>RMid</code> played by
+ <code>BMid</code> plus its super-class <code>BSuper</code> and its sub-class
+ <code>BSub</code>.
+
+ </p>
+ <ol>
+ <li>If a static base method <code>BMid.m</code> is bound by a callin binding
+ this has no effect on any method <code>m</code> in <code>BSub</code>.
+ </li>
+ <li>If a callin binding mentions a method <code>m</code> which is not present
+ in <code>BMid</code> but resolves to a static method in <code>BSuper</code>
+ the binding only affects invocations as <code>BMid.m()</code> but not
+ <code>BSuper.m()</code>. If the latter call should be affected, too,
+ the callin binding must appear in a role class bound to <code>BSuper</code>,
+ not <code>BMid</code>.
+ </li>
+ <li>In order to bind two static base methods with equal signatures, one being
+ defined in a sub-class of the other one, two roles have to be defined
+ where one role refines the <code>playedBy</code> clause of the other role
+ (say: <code>public class RSub extends RMid playedBy BSub</code>).
+ Now each role may bind to the static base method accessible in its direct
+ base-class.
+ </li>
+ </ol>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s4.6.html" rel="prev">&lt;&lt;&nbsp;&sect;4.6&nbsp;Overriding access restrictions</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.8.html" rel="next">&sect;4.8&nbsp;Callin precedence&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.8.a.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.8.a.html
new file mode 100644
index 000000000..32d8d828d
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.8.a.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.8.b.html" rel="next">&sect;4.8.(b)&nbsp;Qualified and unqualified names&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.8.html" rel="section">&sect;4.8&nbsp;Callin precedence</a></div>
+ <div class="subsect depth3" id="s4.8.a">
+ <h4 class="subsect">&sect;4.8.(a)&nbsp;<span class="title">Precedence declaration</span></h4>
+ <p>A precedence declaration consists of the keyword <code>precedence</code> followed by
+ a list of names referring to callin bindings (see <a href="s4.1.e.html" title="&sect;4.1.(e)&nbsp;Named callin bindin"
+ class="sect">&sect;4.1.(e)</a> for named callin bindings).
+ <br />
+ A precedence declaration is only legal within a role or team class.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.8.b.html" rel="next">&sect;4.8.(b)&nbsp;Qualified and unqualified names&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.8.html" rel="section">&sect;4.8&nbsp;Callin precedence</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.8.b.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.8.b.html
new file mode 100644
index 000000000..896a6804e
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.8.b.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s4.8.a.html" rel="prev">&lt;&lt;&nbsp;&sect;4.8.(a)&nbsp;Precedence declaration</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.8.c.html" rel="next">&sect;4.8.(c)&nbsp;Class based precedence&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.8.html" rel="section">&sect;4.8&nbsp;Callin precedence</a></div>
+ <div class="subsect depth3" id="s4.8.b">
+ <h4 class="subsect">&sect;4.8.(b)&nbsp;<span class="title">Qualified and unqualified names</span></h4>
+ <p>Within a role class a callin binding may be referenced by its unqualified name.
+ A precedence declaration in a team class must qualify the callin name with the name of the declaring
+ role class. A team with nested teams may concat role class names.
+ Elements of a qualified callin name are separated by ".".
+ <br />
+ The callin binding must be found in the role specified by the qualifying prefix or
+ in the enclosing role for unqualified names, or any super class of this role
+ (including implicit super classes <a href="s1.3.1.html"
+ title="&sect;1.3.1&nbsp;Acquisition and implicit inheritance of role classes"
+ class="sect">&sect;1.3.1</a>).
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s4.8.a.html" rel="prev">&lt;&lt;&nbsp;&sect;4.8.(a)&nbsp;Precedence declaration</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.8.c.html" rel="next">&sect;4.8.(c)&nbsp;Class based precedence&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.8.html" rel="section">&sect;4.8&nbsp;Callin precedence</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.8.c.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.8.c.html
new file mode 100644
index 000000000..ae33dae48
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.8.c.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s4.8.b.html" rel="prev">&lt;&lt;&nbsp;&sect;4.8.(b)&nbsp;Qualified and unqualified names</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.8.d.html" rel="next">&sect;4.8.(d)&nbsp;Multiple precedence statements&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.8.html" rel="section">&sect;4.8&nbsp;Callin precedence</a></div>
+ <div class="subsect depth3" id="s4.8.c">
+ <h4 class="subsect">&sect;4.8.(c)&nbsp;<span class="title">Class based precedence</span></h4>
+ <p>At the team level a precedence declaration may contain role class names without
+ explicitly mentioning callin bindings in order to refer to all callin bindings of the role.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s4.8.b.html" rel="prev">&lt;&lt;&nbsp;&sect;4.8.(b)&nbsp;Qualified and unqualified names</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.8.d.html" rel="next">&sect;4.8.(d)&nbsp;Multiple precedence statements&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.8.html" rel="section">&sect;4.8&nbsp;Callin precedence</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.8.d.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.8.d.html
new file mode 100644
index 000000000..1dfa38b30
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.8.d.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s4.8.c.html" rel="prev">&lt;&lt;&nbsp;&sect;4.8.(c)&nbsp;Class based precedence</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.8.e.html" rel="next">&sect;4.8.(e)&nbsp;Binding overriding&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.8.html" rel="section">&sect;4.8&nbsp;Callin precedence</a></div>
+ <div class="subsect depth3" id="s4.8.d">
+ <h4 class="subsect">&sect;4.8.(d)&nbsp;<span class="title">Multiple precedence statements</span></h4>
+ <p>All precedence statements are collected at the outer-most team. At that level all
+ precedence declarations involving the same base method are merged using the
+ C3 algorithm <a href="s4.html#fn3-c3-algorithm" class="int">[3]</a>. It is an error to declare
+ incompatible precedence lists that cannot be merged by the C3 algorithm.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s4.8.c.html" rel="prev">&lt;&lt;&nbsp;&sect;4.8.(c)&nbsp;Class based precedence</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.8.e.html" rel="next">&sect;4.8.(e)&nbsp;Binding overriding&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.8.html" rel="section">&sect;4.8&nbsp;Callin precedence</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.8.e.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.8.e.html
new file mode 100644
index 000000000..5596b0ef1
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.8.e.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s4.8.d.html" rel="prev">&lt;&lt;&nbsp;&sect;4.8.(d)&nbsp;Multiple precedence statements</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.8.html" rel="section">&sect;4.8&nbsp;Callin precedence</a></div>
+ <div class="subsect depth3" id="s4.8.e">
+ <h4 class="subsect">&sect;4.8.(e)&nbsp;<span class="title">Binding overriding</span></h4>
+ <p>Precedence declarations may conflict with overriding of callin bindings
+ (see <a href="s4.1.e.html" title="&sect;4.1.(e)&nbsp;Named callin bindin"
+ class="sect">&sect;4.1.(e)</a>): For each pair of callin bindings of which one
+ callin binding overrides the other one, precedence declarations are not applicable,
+ since dynamic binding will already select exactly one callin binding.
+ <br />
+ It is an error to <i>explicitly mention</i> such a pair of overriding callin bindings in a precedence declaration.
+ <br />
+ When a class-based precedence declaration <i>implicitly refers to</i> a callin binding that is overridden by,
+ or overrides any other callin binding within the same precedence declaration, this does not affect the fact,
+ that the most specific callin binding overrides less specific ones.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s4.8.d.html" rel="prev">&lt;&lt;&nbsp;&sect;4.8.(d)&nbsp;Multiple precedence statements</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.8.html" rel="section">&sect;4.8&nbsp;Callin precedence</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.8.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.8.html
new file mode 100644
index 000000000..25ceeb5e5
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.8.html
@@ -0,0 +1,173 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s4.7.html" rel="prev">&lt;&lt;&nbsp;&sect;4.7&nbsp;Callin binding with static methods</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.9.html" rel="next">&sect;4.9&nbsp;Callin inheritance&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a></div>
+ <div class="sect depth2" id="s4.8">
+ <h2 class="sect">&sect;4.8&nbsp;Callin precedence</h2>
+ <div class="syntaxlink"><a href="sA.8.html" title="&sect;A.8&nbsp;Precedence declaration"
+ class="syntax">&rarr;&nbsp;Syntax&nbsp;&sect;A.8</a></div>
+ <p>If multiple callins from the same team refer to the same base method and also have the same
+ callin modifier (<code>before</code>, <code>after</code> or <code>replace</code>), the order in which
+ the callin bindings shall be triggered has to be declared using a precedence declaration.
+
+ </p>
+ <div class="subsect depth3" id="s4.8.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Precedence declaration</span></h4>
+ <p>A precedence declaration consists of the keyword <code>precedence</code> followed by
+ a list of names referring to callin bindings (see <a href="s4.1.e.html" title="&sect;4.1.(e)&nbsp;Named callin bindin"
+ class="sect">&sect;4.1.(e)</a> for named callin bindings).
+ <br />
+ A precedence declaration is only legal within a role or team class.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.8.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Qualified and unqualified names</span></h4>
+ <p>Within a role class a callin binding may be referenced by its unqualified name.
+ A precedence declaration in a team class must qualify the callin name with the name of the declaring
+ role class. A team with nested teams may concat role class names.
+ Elements of a qualified callin name are separated by ".".
+ <br />
+ The callin binding must be found in the role specified by the qualifying prefix or
+ in the enclosing role for unqualified names, or any super class of this role
+ (including implicit super classes <a href="s1.3.1.html"
+ title="&sect;1.3.1&nbsp;Acquisition and implicit inheritance of role classes"
+ class="sect">&sect;1.3.1</a>).
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.8.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Class based precedence</span></h4>
+ <p>At the team level a precedence declaration may contain role class names without
+ explicitly mentioning callin bindings in order to refer to all callin bindings of the role.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.8.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Multiple precedence statements</span></h4>
+ <p>All precedence statements are collected at the outer-most team. At that level all
+ precedence declarations involving the same base method are merged using the
+ C3 algorithm <a href="s4.html#fn3-c3-algorithm" class="int">[3]</a>. It is an error to declare
+ incompatible precedence lists that cannot be merged by the C3 algorithm.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.8.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Binding overriding</span></h4>
+ <p>Precedence declarations may conflict with overriding of callin bindings
+ (see <a href="s4.1.e.html" title="&sect;4.1.(e)&nbsp;Named callin bindin"
+ class="sect">&sect;4.1.(e)</a>): For each pair of callin bindings of which one
+ callin binding overrides the other one, precedence declarations are not applicable,
+ since dynamic binding will already select exactly one callin binding.
+ <br />
+ It is an error to <i>explicitly mention</i> such a pair of overriding callin bindings in a precedence declaration.
+ <br />
+ When a class-based precedence declaration <i>implicitly refers to</i> a callin binding that is overridden by,
+ or overrides any other callin binding within the same precedence declaration, this does not affect the fact,
+ that the most specific callin binding overrides less specific ones.
+
+ </p>
+ </div>
+ <h5 class="listing">Callin binding example</h5>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>class</b> LogLog<b>in</b> <b>playedBy</b> Data<b>base</b> {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>callin</b> <b>void</b> log (String what) {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> System.out.println("enter " + what);</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> base.log(what.toLowerCase());</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> System.out.println("leave " + what);</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> <b>void</b> log(String what) <b>&lt;-</b> <b>replace</b> <b>void</b> login(String uid, String passwd) </pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre> <b>with</b> { what <b>&lt;-</b> uid }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre>}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">10</td>
+ <td><pre>(<b>new</b> Database()).login("Admin", "Passwd");</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="codecomment">
+ <h5>Effects:</h5>
+ <p>Provided the callin bindings are active (cf. <a href="s5.html" title="&sect;5&nbsp;Team Activation" class="sect">&sect;5</a>) then:
+
+ </p>
+ <ul>
+ <li>the call in line 10 is intercepted by method <code>log</code>
+ of role <code>LogLogin</code>.
+ </li>
+ <li>the call target of <code>log</code> is a role of type
+ <code>LogLogin</code> which is created by lifting the
+ original call target (of type <code>Database</code>) to
+ <code>LogLogin</code>.
+ </li>
+ <li>only parameter <code>uid</code> is passed to <code>log</code>
+ (bound to formal parameter <code>what</code>).
+ </li>
+ <li>within method <code>log</code> the base call (line 4) invokes
+ the original method passing a modified uid (converted to lower case, cf. line 4)
+ and the unmodified password, which is hidden from the callin method due to the
+ parameter mapping in line 8.
+ </li>
+ </ul>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s4.7.html" rel="prev">&lt;&lt;&nbsp;&sect;4.7&nbsp;Callin binding with static methods</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.9.html" rel="next">&sect;4.9&nbsp;Callin inheritance&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.9.1.a.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.9.1.a.html
new file mode 100644
index 000000000..d6920bbf6
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.9.1.a.html
@@ -0,0 +1,51 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.9.1.b.html" rel="next">&sect;4.9.1.(b)&nbsp;No effect on super-classes&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.9.html" rel="section">&sect;4.9&nbsp;Callin inheritance</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.9.1.html" rel="section">&sect;4.9.1&nbsp;Base side inheritance</a></div>
+ <div class="subsect depth4" id="s4.9.1.a">
+ <h4 class="subsect">&sect;4.9.1.(a)&nbsp;<span class="title">Effect on sub-classes</span></h4>
+ <p>The callin binding also effects instances of any type <code>BSub</code>
+ that is a sub-type of <code>B</code>.
+ If <code>BSub</code> overrides the bound base method <code>bm</code>,
+ the overridden version is generally affected, too.
+ However, if <code>bm</code> covariantly redefines the return type from its
+ super version, the callin binding has to explicitly specify if the covariant
+ sub-class version should be affected, too (see <a href="s4.9.3.b.html"
+ title="&sect;4.9.3.(b)&nbsp;Capturing covariant base methods"
+ class="sect">&sect;4.9.3.(b)</a>).
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.9.1.b.html" rel="next">&sect;4.9.1.(b)&nbsp;No effect on super-classes&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.9.html" rel="section">&sect;4.9&nbsp;Callin inheritance</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.9.1.html" rel="section">&sect;4.9.1&nbsp;Base side inheritance</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.9.1.b.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.9.1.b.html
new file mode 100644
index 000000000..205f9ab56
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.9.1.b.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s4.9.1.a.html" rel="prev">&lt;&lt;&nbsp;&sect;4.9.1.(a)&nbsp;Effect on sub-classes</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.9.html" rel="section">&sect;4.9&nbsp;Callin inheritance</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.9.1.html" rel="section">&sect;4.9.1&nbsp;Base side inheritance</a></div>
+ <div class="subsect depth4" id="s4.9.1.b">
+ <h4 class="subsect">&sect;4.9.1.(b)&nbsp;<span class="title">No effect on super-classes</span></h4>
+ <p>The binding never affects an instance of any super-type of <code>B</code>
+ even if the method <code>bm</code> is inherited from a super-class
+ or overrides an inherited method.
+ This ensures that dispatching to a role method due to a callin binding
+ always provides a base instance that has at least the type declared in the role's
+ <code>playedBy</code> clause.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s4.9.1.a.html" rel="prev">&lt;&lt;&nbsp;&sect;4.9.1.(a)&nbsp;Effect on sub-classes</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.9.html" rel="section">&sect;4.9&nbsp;Callin inheritance</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.9.1.html" rel="section">&sect;4.9.1&nbsp;Base side inheritance</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.9.1.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.9.1.html
new file mode 100644
index 000000000..8cdc933f2
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.9.1.html
@@ -0,0 +1,76 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.9.2.html" rel="next">&sect;4.9.2&nbsp;Role side inheritance&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.9.html" rel="section">&sect;4.9&nbsp;Callin inheritance</a></div>
+ <div class="sect depth3" id="s4.9.1">
+ <h3 class="sect">&sect;4.9.1&nbsp;Base side inheritance</h3>
+ <p>
+ Generally, a callin binding affects all sub-types of its bound base.
+ Specifically, if a role type <code>R</code> bound to a base type <code>B</code>
+ defines a callin binding <code>rm &lt;- <i>callin_modifier</i> bm</code>,
+ the following rules apply:
+
+ </p>
+ <div class="subsect depth4" id="s4.9.1.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Effect on sub-classes</span></h4>
+ <p>The callin binding also effects instances of any type <code>BSub</code>
+ that is a sub-type of <code>B</code>.
+ If <code>BSub</code> overrides the bound base method <code>bm</code>,
+ the overridden version is generally affected, too.
+ However, if <code>bm</code> covariantly redefines the return type from its
+ super version, the callin binding has to explicitly specify if the covariant
+ sub-class version should be affected, too (see <a href="s4.9.3.b.html"
+ title="&sect;4.9.3.(b)&nbsp;Capturing covariant base methods"
+ class="sect">&sect;4.9.3.(b)</a>).
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s4.9.1.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">No effect on super-classes</span></h4>
+ <p>The binding never affects an instance of any super-type of <code>B</code>
+ even if the method <code>bm</code> is inherited from a super-class
+ or overrides an inherited method.
+ This ensures that dispatching to a role method due to a callin binding
+ always provides a base instance that has at least the type declared in the role's
+ <code>playedBy</code> clause.
+
+ </p>
+ </div>
+ <p>
+ For corresponding definitions regarding static methods see <a href="s4.7.e.html" title="&sect;4.7.(e)&nbsp;No overriding" class="sect">&sect;4.7.(e)</a>.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.9.2.html" rel="next">&sect;4.9.2&nbsp;Role side inheritance&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.9.html" rel="section">&sect;4.9&nbsp;Callin inheritance</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.9.2.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.9.2.html
new file mode 100644
index 000000000..4ab5faa5f
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.9.2.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s4.9.1.html" rel="prev">&lt;&lt;&nbsp;&sect;4.9.1&nbsp;Base side inheritance</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.9.3.html" rel="next">&sect;4.9.3&nbsp;Covariant return types&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.9.html" rel="section">&sect;4.9&nbsp;Callin inheritance</a></div>
+ <div class="sect depth3" id="s4.9.2">
+ <h3 class="sect">&sect;4.9.2&nbsp;Role side inheritance</h3>
+ <p>
+ Any sub-type of <code>R</code> inherits the given callin binding
+ (for overriding of bindings see <a href="s4.8.e.html" title="&sect;4.8.(e)&nbsp;Binding overriding"
+ class="sect">&sect;4.8.(e)</a>).
+ If the sub-role overrides the role method <code>rm</code> this will be considered
+ for dynamic dispatch when the callin binding is triggered.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s4.9.1.html" rel="prev">&lt;&lt;&nbsp;&sect;4.9.1&nbsp;Base side inheritance</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.9.3.html" rel="next">&sect;4.9.3&nbsp;Covariant return types&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.9.html" rel="section">&sect;4.9&nbsp;Callin inheritance</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.9.3.a.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.9.3.a.html
new file mode 100644
index 000000000..2d3df6d8c
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.9.3.a.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.9.3.b.html" rel="next">&sect;4.9.3.(b)&nbsp;Capturing covariant base methods&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.9.html" rel="section">&sect;4.9&nbsp;Callin inheritance</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.9.3.html" rel="section">&sect;4.9.3&nbsp;Covariant return types</a></div>
+ <div class="subsect depth4" id="s4.9.3.a">
+ <h4 class="subsect">&sect;4.9.3.(a)&nbsp;<span class="title">No covariant callin methods</span></h4>
+ <p>
+ A method declared with the <code>callin</code> modifier that overrides an inherited method
+ must not redefine the return type with respect to the inherited method.
+ This reflects that fact that an inherited callin binding should remain type-safe
+ while binding to the new, overriding role method.
+ Binding a covariant role method to the original base method would break constraint (1) above.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.9.3.b.html" rel="next">&sect;4.9.3.(b)&nbsp;Capturing covariant base methods&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.9.html" rel="section">&sect;4.9&nbsp;Callin inheritance</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.9.3.html" rel="section">&sect;4.9.3&nbsp;Covariant return types</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.9.3.b.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.9.3.b.html
new file mode 100644
index 000000000..bf780b465
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.9.3.b.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s4.9.3.a.html" rel="prev">&lt;&lt;&nbsp;&sect;4.9.3.(a)&nbsp;No covariant callin methods</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.9.3.c.html" rel="next">&sect;4.9.3.(c)&nbsp;Covariant replace binding&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.9.html" rel="section">&sect;4.9&nbsp;Callin inheritance</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.9.3.html" rel="section">&sect;4.9.3&nbsp;Covariant return types</a></div>
+ <div class="subsect depth4" id="s4.9.3.b">
+ <h4 class="subsect">&sect;4.9.3.(b)&nbsp;<span class="title">Capturing covariant base methods</span></h4>
+ <p>
+ If a callin binding should indeed affect not only the specified base method
+ but also overriding versions which covariantly redefine the return type,
+ the binding must specify the base method's return type with a "+" appended
+ to the type name as in
+ </p>
+ <div class="listing plain"><pre><b>void</b> rm() <b>&lt;-</b> <b>before</b> <em>RT+</em> bm();</pre></div>
+ <p>Without the "+" sign the binding would only capture base methods whose
+ return type is exactly <code>RT</code>;
+ by appending "+" also sub-types of <code>RT</code>
+ are accepted as the declared return type.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s4.9.3.a.html" rel="prev">&lt;&lt;&nbsp;&sect;4.9.3.(a)&nbsp;No covariant callin methods</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.9.3.c.html" rel="next">&sect;4.9.3.(c)&nbsp;Covariant replace binding&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.9.html" rel="section">&sect;4.9&nbsp;Callin inheritance</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.9.3.html" rel="section">&sect;4.9.3&nbsp;Covariant return types</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.9.3.c.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.9.3.c.html
new file mode 100644
index 000000000..dc7aaea5a
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.9.3.c.html
@@ -0,0 +1,200 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s4.9.3.b.html" rel="prev">&lt;&lt;&nbsp;&sect;4.9.3.(b)&nbsp;Capturing covariant base methods</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.9.html" rel="section">&sect;4.9&nbsp;Callin inheritance</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.9.3.html" rel="section">&sect;4.9.3&nbsp;Covariant return types</a></div>
+ <div class="subsect depth4" id="s4.9.3.c">
+ <h4 class="subsect">&sect;4.9.3.(c)&nbsp;<span class="title">Covariant replace binding</span></h4>
+ <p>
+ When using the syntax of <a href="s4.9.3.b.html"
+ title="&sect;4.9.3.(b)&nbsp;Capturing covariant base methods"
+ class="sect">&sect;4.9.3.(b)</a> to capture base methods with
+ covariant return types in a callin binding with the <code>replace</code> modifier,
+ the role method must be specified using a free type parameter as follows:
+ </p>
+ <div class="listing plain"><pre><em>&lt;E <b>extends</b> RT&gt; E</em> rm() <b>&lt;-</b> <b>replace</b> RT+ bm();</pre></div>
+ <p>The role method <code>rm</code> referenced by this callin binding must use the same style
+ of return type using a type parameter.
+ The only possible non-null value of type <code>E</code>
+ to be returned from such method is the value provided by a base-call or a tsuper-call.<br />
+ This rule enforces the constraint (2) above.<br />
+ Note that this rule is further generalized in <a href="s4.10.html" title="&sect;4.10&nbsp;Generic callin bindings"
+ class="sect">&sect;4.10</a>.
+
+ </p>
+ <h5 class="listing">Binding a parametric role method</h5>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>class</b> SuperBase {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> SuperBase foo() { <b>return</b> this; }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>void</b> check() { System.out.print("OK"); }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre>}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre><b>public</b> <b>class</b> SubBase <b>extends</b> SuperBase {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> @Override</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> SubBase foo() { <b>return</b> this; }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre> <b>void</b> print() { System.out.print("SubBase"); }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre> String test() { </pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">10</td>
+ <td><pre> this.foo().print(); <span class="comment">// print() requires a SubBase</span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">11</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">12</td>
+ <td><pre>}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">13</td>
+ <td><pre></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">14</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> MyTeam {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">15</td>
+ <td><pre> <b>protected</b> <b>class</b> R <b>playedBy</b> SuperBase {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">16</td>
+ <td><pre> <b>callin</b> &lt;E <b>extends</b> SuperBase&gt; E ci() {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">17</td>
+ <td><pre> E result= base.ci();</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">18</td>
+ <td><pre> result.check(); <span class="comment">// check() is available on E via type bound SuperBase</span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">19</td>
+ <td><pre> <b>return</b> result;</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">20</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">21</td>
+ <td><pre> &lt;E <b>extends</b> SuperBase&gt; E ci() <b>&lt;-</b> <b>replace</b> SuperBase+ foo();</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">22</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">23</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="codecomment">
+ <h5>Explanation:</h5>
+ <ul>
+ <li>
+ Method <code>SubBase.foo</code> in line 7 redefines the return type
+ from <code>SuperBase</code> (inherited version) to <code>SubBase</code>,
+ thus clients like the method call in line 10 must be safe to assume
+ that the return value will always conform to <code>SubBase</code>.
+
+ </li>
+ <li>
+ The callin binding in line 21 explicitly captures both versions of <code>foo</code>
+ by specifying <code>SuperBase+</code> as the expected return type.
+ Thus, if an instance of <code>MyTeam</code> is active at the method call
+ in line 10, this call to <code>foo</code> will indeed be intercepted
+ even though this call is statically known to return a value of type <code>SubBase</code>.
+
+ </li>
+ <li>
+ The callin method in lines 16-20 has a return type which is not known statically,
+ but the return type is represented by the type variable <code>E</code>.
+ Since the base call is known to have the exact same signature as its enclosing
+ method, the value provided by the base call is of the same type <code>E</code>
+ and thus can be safely returned from <code>ci</code>.
+ <em>Note,</em> that no other non-null value is known to have the type <code>E</code>.
+
+ </li>
+ <li>
+ By specifying <code>SuperBase</code> as an upper bound for the type <code>E</code>
+ the callin method <code>ci</code> may invoke
+ any method declared in type <code>SuperBase</code>
+ on any value of type <code>E</code>. For an example see the call to <code>check</code>
+ in line 18.
+
+ </li>
+ </ul>
+ <p><em>
+ As an aside note that the above example uses type <code>SuperBase</code>
+ in an undisciplined way: within role <code>R</code> this type is bound
+ using <code>playedBy</code><strong> and</strong> the same type is also
+ used directly (as the upper bound for <code>E</code>).
+ This is considered bad style and it is prohibited if <code>SuperBase</code>
+ is imported using an base import (<a href="s2.1.2.d.html" title="&sect;2.1.2.(d)&nbsp;Base imports" class="sect">&sect;2.1.2.(d)</a>).
+ Here this rule is neglegted just for the purpose of keeping the example small.
+ </em></p>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s4.9.3.b.html" rel="prev">&lt;&lt;&nbsp;&sect;4.9.3.(b)&nbsp;Capturing covariant base methods</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.9.html" rel="section">&sect;4.9&nbsp;Callin inheritance</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.9.3.html" rel="section">&sect;4.9.3&nbsp;Covariant return types</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.9.3.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.9.3.html
new file mode 100644
index 000000000..530841f8e
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.9.3.html
@@ -0,0 +1,255 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s4.9.2.html" rel="prev">&lt;&lt;&nbsp;&sect;4.9.2&nbsp;Role side inheritance</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.9.html" rel="section">&sect;4.9&nbsp;Callin inheritance</a></div>
+ <div class="sect depth3" id="s4.9.3">
+ <h3 class="sect">&sect;4.9.3&nbsp;Covariant return types</h3>
+ <p>
+ Since version 5, Java supports the covariant redefinition of a method's return type
+ (see <a href="http://java.sun.com/docs/books/jls/third_edition/html/classes.html#8.4.5"
+ class="ext">JLS 8.4.5</a>).
+ This is <em>not</em> supported for <code>callin</code> methods (<a href="#s4.9.3.a" title="&sect;4.9.3.(a)&nbsp;No covariant callin methods"
+ class="sect">&sect;4.9.3.(a)</a>).
+ If base methods with covariant redefinition of the return type are to be bound by a callin binding
+ the subsequent rules ensure that type safety is preserved.
+ Two <em>constraints</em> have to be considered:
+
+ </p>
+ <ol>
+ <li>
+ When a callin method issues a base-call or calls its tsuper version,
+ this call must produce a value whose type is compatible to the
+ enclosing method's declared return type.
+
+ </li>
+ <li>
+ If a replace-bound role method returns a value that is not the result of a base-call,
+ it must be ensured that the return value actually satisfies the declared signature of
+ the bound base method.
+
+ </li>
+ </ol>
+ <div class="subsect depth4" id="s4.9.3.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">No covariant callin methods</span></h4>
+ <p>
+ A method declared with the <code>callin</code> modifier that overrides an inherited method
+ must not redefine the return type with respect to the inherited method.
+ This reflects that fact that an inherited callin binding should remain type-safe
+ while binding to the new, overriding role method.
+ Binding a covariant role method to the original base method would break constraint (1) above.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s4.9.3.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Capturing covariant base methods</span></h4>
+ <p>
+ If a callin binding should indeed affect not only the specified base method
+ but also overriding versions which covariantly redefine the return type,
+ the binding must specify the base method's return type with a "+" appended
+ to the type name as in
+ </p>
+ <div class="listing plain"><pre><b>void</b> rm() <b>&lt;-</b> <b>before</b> <em>RT+</em> bm();</pre></div>
+ <p>Without the "+" sign the binding would only capture base methods whose
+ return type is exactly <code>RT</code>;
+ by appending "+" also sub-types of <code>RT</code>
+ are accepted as the declared return type.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s4.9.3.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Covariant replace binding</span></h4>
+ <p>
+ When using the syntax of <a href="#s4.9.3.b"
+ title="&sect;4.9.3.(b)&nbsp;Capturing covariant base methods"
+ class="sect">&sect;4.9.3.(b)</a> to capture base methods with
+ covariant return types in a callin binding with the <code>replace</code> modifier,
+ the role method must be specified using a free type parameter as follows:
+ </p>
+ <div class="listing plain"><pre><em>&lt;E <b>extends</b> RT&gt; E</em> rm() <b>&lt;-</b> <b>replace</b> RT+ bm();</pre></div>
+ <p>The role method <code>rm</code> referenced by this callin binding must use the same style
+ of return type using a type parameter.
+ The only possible non-null value of type <code>E</code>
+ to be returned from such method is the value provided by a base-call or a tsuper-call.<br />
+ This rule enforces the constraint (2) above.<br />
+ Note that this rule is further generalized in <a href="s4.10.html" title="&sect;4.10&nbsp;Generic callin bindings"
+ class="sect">&sect;4.10</a>.
+
+ </p>
+ <h5 class="listing">Binding a parametric role method</h5>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>class</b> SuperBase {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> SuperBase foo() { <b>return</b> this; }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>void</b> check() { System.out.print("OK"); }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre>}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre><b>public</b> <b>class</b> SubBase <b>extends</b> SuperBase {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> @Override</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> SubBase foo() { <b>return</b> this; }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre> <b>void</b> print() { System.out.print("SubBase"); }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre> String test() { </pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">10</td>
+ <td><pre> this.foo().print(); <span class="comment">// print() requires a SubBase</span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">11</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">12</td>
+ <td><pre>}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">13</td>
+ <td><pre></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">14</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> MyTeam {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">15</td>
+ <td><pre> <b>protected</b> <b>class</b> R <b>playedBy</b> SuperBase {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">16</td>
+ <td><pre> <b>callin</b> &lt;E <b>extends</b> SuperBase&gt; E ci() {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">17</td>
+ <td><pre> E result= base.ci();</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">18</td>
+ <td><pre> result.check(); <span class="comment">// check() is available on E via type bound SuperBase</span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">19</td>
+ <td><pre> <b>return</b> result;</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">20</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">21</td>
+ <td><pre> &lt;E <b>extends</b> SuperBase&gt; E ci() <b>&lt;-</b> <b>replace</b> SuperBase+ foo();</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">22</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">23</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="codecomment">
+ <h5>Explanation:</h5>
+ <ul>
+ <li>
+ Method <code>SubBase.foo</code> in line 7 redefines the return type
+ from <code>SuperBase</code> (inherited version) to <code>SubBase</code>,
+ thus clients like the method call in line 10 must be safe to assume
+ that the return value will always conform to <code>SubBase</code>.
+
+ </li>
+ <li>
+ The callin binding in line 21 explicitly captures both versions of <code>foo</code>
+ by specifying <code>SuperBase+</code> as the expected return type.
+ Thus, if an instance of <code>MyTeam</code> is active at the method call
+ in line 10, this call to <code>foo</code> will indeed be intercepted
+ even though this call is statically known to return a value of type <code>SubBase</code>.
+
+ </li>
+ <li>
+ The callin method in lines 16-20 has a return type which is not known statically,
+ but the return type is represented by the type variable <code>E</code>.
+ Since the base call is known to have the exact same signature as its enclosing
+ method, the value provided by the base call is of the same type <code>E</code>
+ and thus can be safely returned from <code>ci</code>.
+ <em>Note,</em> that no other non-null value is known to have the type <code>E</code>.
+
+ </li>
+ <li>
+ By specifying <code>SuperBase</code> as an upper bound for the type <code>E</code>
+ the callin method <code>ci</code> may invoke
+ any method declared in type <code>SuperBase</code>
+ on any value of type <code>E</code>. For an example see the call to <code>check</code>
+ in line 18.
+
+ </li>
+ </ul>
+ <p><em>
+ As an aside note that the above example uses type <code>SuperBase</code>
+ in an undisciplined way: within role <code>R</code> this type is bound
+ using <code>playedBy</code><strong> and</strong> the same type is also
+ used directly (as the upper bound for <code>E</code>).
+ This is considered bad style and it is prohibited if <code>SuperBase</code>
+ is imported using an base import (<a href="s2.1.2.d.html" title="&sect;2.1.2.(d)&nbsp;Base imports" class="sect">&sect;2.1.2.(d)</a>).
+ Here this rule is neglegted just for the purpose of keeping the example small.
+ </em></p>
+ </div>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s4.9.2.html" rel="prev">&lt;&lt;&nbsp;&sect;4.9.2&nbsp;Role side inheritance</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s4.9.html" rel="section">&sect;4.9&nbsp;Callin inheritance</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.9.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.9.html
new file mode 100644
index 000000000..66e7c0718
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.9.html
@@ -0,0 +1,312 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s4.8.html" rel="prev">&lt;&lt;&nbsp;&sect;4.8&nbsp;Callin precedence</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.10.html" rel="next">&sect;4.10&nbsp;Generic callin bindings&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a></div>
+ <div class="sect depth2" id="s4.9">
+ <h2 class="sect">&sect;4.9&nbsp;Callin inheritance</h2>
+ <p>
+ This section defines how callin bindings and callin methods relate to inheritance.
+
+ </p>
+ <div class="sect depth3" id="s4.9.1">
+ <h3 class="sect">&sect;4.9.1&nbsp;Base side inheritance<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;4.9</a></span></h3>
+ <p>
+ Generally, a callin binding affects all sub-types of its bound base.
+ Specifically, if a role type <code>R</code> bound to a base type <code>B</code>
+ defines a callin binding <code>rm &lt;- <i>callin_modifier</i> bm</code>,
+ the following rules apply:
+
+ </p>
+ <div class="subsect depth4" id="s4.9.1.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Effect on sub-classes</span></h4>
+ <p>The callin binding also effects instances of any type <code>BSub</code>
+ that is a sub-type of <code>B</code>.
+ If <code>BSub</code> overrides the bound base method <code>bm</code>,
+ the overridden version is generally affected, too.
+ However, if <code>bm</code> covariantly redefines the return type from its
+ super version, the callin binding has to explicitly specify if the covariant
+ sub-class version should be affected, too (see <a href="#s4.9.3.b"
+ title="&sect;4.9.3.(b)&nbsp;Capturing covariant base methods"
+ class="sect">&sect;4.9.3.(b)</a>).
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s4.9.1.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">No effect on super-classes</span></h4>
+ <p>The binding never affects an instance of any super-type of <code>B</code>
+ even if the method <code>bm</code> is inherited from a super-class
+ or overrides an inherited method.
+ This ensures that dispatching to a role method due to a callin binding
+ always provides a base instance that has at least the type declared in the role's
+ <code>playedBy</code> clause.
+
+ </p>
+ </div>
+ <p>
+ For corresponding definitions regarding static methods see <a href="s4.7.e.html" title="&sect;4.7.(e)&nbsp;No overriding" class="sect">&sect;4.7.(e)</a>.
+
+ </p>
+ </div>
+ <div class="sect depth3" id="s4.9.2">
+ <h3 class="sect">&sect;4.9.2&nbsp;Role side inheritance<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;4.9</a></span></h3>
+ <p>
+ Any sub-type of <code>R</code> inherits the given callin binding
+ (for overriding of bindings see <a href="s4.8.e.html" title="&sect;4.8.(e)&nbsp;Binding overriding"
+ class="sect">&sect;4.8.(e)</a>).
+ If the sub-role overrides the role method <code>rm</code> this will be considered
+ for dynamic dispatch when the callin binding is triggered.
+
+ </p>
+ </div>
+ <div class="sect depth3" id="s4.9.3">
+ <h3 class="sect">&sect;4.9.3&nbsp;Covariant return types<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;4.9</a></span></h3>
+ <p>
+ Since version 5, Java supports the covariant redefinition of a method's return type
+ (see <a href="http://java.sun.com/docs/books/jls/third_edition/html/classes.html#8.4.5"
+ class="ext">JLS 8.4.5</a>).
+ This is <em>not</em> supported for <code>callin</code> methods (<a href="#s4.9.3.a" title="&sect;4.9.3.(a)&nbsp;No covariant callin methods"
+ class="sect">&sect;4.9.3.(a)</a>).
+ If base methods with covariant redefinition of the return type are to be bound by a callin binding
+ the subsequent rules ensure that type safety is preserved.
+ Two <em>constraints</em> have to be considered:
+
+ </p>
+ <ol>
+ <li>
+ When a callin method issues a base-call or calls its tsuper version,
+ this call must produce a value whose type is compatible to the
+ enclosing method's declared return type.
+
+ </li>
+ <li>
+ If a replace-bound role method returns a value that is not the result of a base-call,
+ it must be ensured that the return value actually satisfies the declared signature of
+ the bound base method.
+
+ </li>
+ </ol>
+ <div class="subsect depth4" id="s4.9.3.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">No covariant callin methods</span></h4>
+ <p>
+ A method declared with the <code>callin</code> modifier that overrides an inherited method
+ must not redefine the return type with respect to the inherited method.
+ This reflects that fact that an inherited callin binding should remain type-safe
+ while binding to the new, overriding role method.
+ Binding a covariant role method to the original base method would break constraint (1) above.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s4.9.3.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Capturing covariant base methods</span></h4>
+ <p>
+ If a callin binding should indeed affect not only the specified base method
+ but also overriding versions which covariantly redefine the return type,
+ the binding must specify the base method's return type with a "+" appended
+ to the type name as in
+ </p>
+ <div class="listing plain"><pre><b>void</b> rm() <b>&lt;-</b> <b>before</b> <em>RT+</em> bm();</pre></div>
+ <p>Without the "+" sign the binding would only capture base methods whose
+ return type is exactly <code>RT</code>;
+ by appending "+" also sub-types of <code>RT</code>
+ are accepted as the declared return type.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s4.9.3.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Covariant replace binding</span></h4>
+ <p>
+ When using the syntax of <a href="#s4.9.3.b"
+ title="&sect;4.9.3.(b)&nbsp;Capturing covariant base methods"
+ class="sect">&sect;4.9.3.(b)</a> to capture base methods with
+ covariant return types in a callin binding with the <code>replace</code> modifier,
+ the role method must be specified using a free type parameter as follows:
+ </p>
+ <div class="listing plain"><pre><em>&lt;E <b>extends</b> RT&gt; E</em> rm() <b>&lt;-</b> <b>replace</b> RT+ bm();</pre></div>
+ <p>The role method <code>rm</code> referenced by this callin binding must use the same style
+ of return type using a type parameter.
+ The only possible non-null value of type <code>E</code>
+ to be returned from such method is the value provided by a base-call or a tsuper-call.<br />
+ This rule enforces the constraint (2) above.<br />
+ Note that this rule is further generalized in <a href="s4.10.html" title="&sect;4.10&nbsp;Generic callin bindings"
+ class="sect">&sect;4.10</a>.
+
+ </p>
+ <h5 class="listing">Binding a parametric role method</h5>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>class</b> SuperBase {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> SuperBase foo() { <b>return</b> this; }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>void</b> check() { System.out.print("OK"); }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre>}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre><b>public</b> <b>class</b> SubBase <b>extends</b> SuperBase {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> @Override</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> SubBase foo() { <b>return</b> this; }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre> <b>void</b> print() { System.out.print("SubBase"); }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre> String test() { </pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">10</td>
+ <td><pre> this.foo().print(); <span class="comment">// print() requires a SubBase</span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">11</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">12</td>
+ <td><pre>}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">13</td>
+ <td><pre></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">14</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> MyTeam {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">15</td>
+ <td><pre> <b>protected</b> <b>class</b> R <b>playedBy</b> SuperBase {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">16</td>
+ <td><pre> <b>callin</b> &lt;E <b>extends</b> SuperBase&gt; E ci() {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">17</td>
+ <td><pre> E result= base.ci();</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">18</td>
+ <td><pre> result.check(); <span class="comment">// check() is available on E via type bound SuperBase</span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">19</td>
+ <td><pre> <b>return</b> result;</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">20</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">21</td>
+ <td><pre> &lt;E <b>extends</b> SuperBase&gt; E ci() <b>&lt;-</b> <b>replace</b> SuperBase+ foo();</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">22</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">23</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="codecomment">
+ <h5>Explanation:</h5>
+ <ul>
+ <li>
+ Method <code>SubBase.foo</code> in line 7 redefines the return type
+ from <code>SuperBase</code> (inherited version) to <code>SubBase</code>,
+ thus clients like the method call in line 10 must be safe to assume
+ that the return value will always conform to <code>SubBase</code>.
+
+ </li>
+ <li>
+ The callin binding in line 21 explicitly captures both versions of <code>foo</code>
+ by specifying <code>SuperBase+</code> as the expected return type.
+ Thus, if an instance of <code>MyTeam</code> is active at the method call
+ in line 10, this call to <code>foo</code> will indeed be intercepted
+ even though this call is statically known to return a value of type <code>SubBase</code>.
+
+ </li>
+ <li>
+ The callin method in lines 16-20 has a return type which is not known statically,
+ but the return type is represented by the type variable <code>E</code>.
+ Since the base call is known to have the exact same signature as its enclosing
+ method, the value provided by the base call is of the same type <code>E</code>
+ and thus can be safely returned from <code>ci</code>.
+ <em>Note,</em> that no other non-null value is known to have the type <code>E</code>.
+
+ </li>
+ <li>
+ By specifying <code>SuperBase</code> as an upper bound for the type <code>E</code>
+ the callin method <code>ci</code> may invoke
+ any method declared in type <code>SuperBase</code>
+ on any value of type <code>E</code>. For an example see the call to <code>check</code>
+ in line 18.
+
+ </li>
+ </ul>
+ <p><em>
+ As an aside note that the above example uses type <code>SuperBase</code>
+ in an undisciplined way: within role <code>R</code> this type is bound
+ using <code>playedBy</code><strong> and</strong> the same type is also
+ used directly (as the upper bound for <code>E</code>).
+ This is considered bad style and it is prohibited if <code>SuperBase</code>
+ is imported using an base import (<a href="s2.1.2.d.html" title="&sect;2.1.2.(d)&nbsp;Base imports" class="sect">&sect;2.1.2.(d)</a>).
+ Here this rule is neglegted just for the purpose of keeping the example small.
+ </em></p>
+ </div>
+ </div>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s4.8.html" rel="prev">&lt;&lt;&nbsp;&sect;4.8&nbsp;Callin precedence</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s4.10.html" rel="next">&sect;4.10&nbsp;Generic callin bindings&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s4.html" rel="section">&sect;4&nbsp;Callin Binding</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.html
new file mode 100644
index 000000000..fc5f9cb0a
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s4.html
@@ -0,0 +1,1384 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s3.html" rel="prev">&lt;&lt;&nbsp;&sect;3&nbsp;Callout Binding</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s5.html" rel="next">&sect;5&nbsp;Team Activation&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"></div>
+ <div class="chapter" id="s4">
+ <div class="headl">
+ <div class="headr">
+ <h1>&sect;4&nbsp;Callin Binding</h1>
+ </div>
+ </div>
+ <div id="toc-box">
+ <ul class="toc-box">
+ <li><a href="s4.html">&sect;4&nbsp;Callin Binding</a></li>
+ <li><a href="#s4.1">&sect;4.1&nbsp;Callin method binding</a></li>
+ <li><a href="#s4.2">&sect;4.2&nbsp;Callin modifiers (before, after, replace)</a></li>
+ <li><a href="#s4.3">&sect;4.3&nbsp;Base calls</a></li>
+ <li><a href="#s4.4">&sect;4.4&nbsp;Callin parameter mapping</a></li>
+ <li><a href="#s4.5">&sect;4.5&nbsp;Lifting and lowering</a></li>
+ <li><a href="#s4.6">&sect;4.6&nbsp;Overriding access restrictions</a></li>
+ <li><a href="#s4.7">&sect;4.7&nbsp;Callin binding with static methods</a></li>
+ <li><a href="#s4.8">&sect;4.8&nbsp;Callin precedence</a></li>
+ <li><a href="#s4.9">&sect;4.9&nbsp;Callin inheritance</a></li>
+ <li><a href="#s4.10">&sect;4.10&nbsp;Generic callin bindings</a></li>
+ </ul>
+ </div>
+ <div class="intro">
+ <h3>Notion of callin binding</h3>
+ <p>
+ Callin bindings realize a forwarding in the direction opposite to callout bindings
+ (see <a href="s3.html" title="&sect;3&nbsp;Callout Binding" class="sect">&sect;3</a>).
+ Both terms are chosen from the perspective of a role, which controls its communication with
+ an associated base object.
+ Technically, callin bindings are equivalent to weaving additional code (triggers)
+ into existing base methods.
+
+ </p>
+ <div class="line"></div>
+ <div class="term">Callin</div>
+ <div class="termdesc">Methods of a base class may be <strong>intercepted</strong> by a callin binding
+ (<em>the base method "calls into" the role</em>).
+ </div>
+ <div class="line"></div>
+ <div class="term">Before/after/replace</div>
+ <div class="termdesc">The modifiers <strong>before, after, replace</strong> control the composition
+ of original method and callin method.
+ </div>
+ <div class="line"></div>
+ <div class="term">Activation</div>
+ <div class="termdesc">Callin bindings may be active or inactive according to
+ <a href="s5.html" title="&sect;5&nbsp;Team Activation" class="sect">&sect;5</a>.
+ </div>
+ <div class="line"></div>
+ </div>
+ <div class="sect depth2" id="s4.1">
+ <h2 class="sect">&sect;4.1&nbsp;Callin method binding<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;4</a></span></h2>
+ <div class="syntaxlink"><a href="sA.html#sA.3.3" title="&sect;A.3.3&nbsp;Callin binding"
+ class="syntax">&rarr;&nbsp;Syntax&nbsp;&sect;A.3.3</a></div>
+ <div class="subsect depth3" id="s4.1.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Method call interception</span></h4>
+ <p>A role method may intercept calls to a base method by
+ a callin binding.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.1.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Prerequisite: Class binding</span></h4>
+ <p>A callin binding requires the enclosing class to be a role class
+ bound to a base class according to <a href="s2.1.html" title="&sect;2.1&nbsp;playedBy relation" class="sect">&sect;2.1</a>.
+ An <em>unliftable</em> role (see <a href="s2.3.4.a.html" title="&sect;2.3.4.(a)&nbsp;Potential ambiguity"
+ class="sect">&sect;2.3.4.(a)</a>) cannot define
+ callin bindings. In that case callin bindings can only be introduced in sub-roles
+ which (by an appropriately refined <code>playedBy</code> clause) disambiguate the lifting translation.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.1.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Callin declaration</span></h4>
+ <p>A callin binding composes an existing role method with a
+ given base method.
+ It may appear within the role class at any place where feature
+ declarations are allowed. It is denoted by
+
+ </p>
+ <div class="listing plain"><pre><i>role_method_designator</i> <b>&lt;-</b> <i>callin_modifier </i><i>base_method_designator;</i></pre></div>
+ <p>Just like with callout bindings, method designators may
+ or may not contain parameters lists and return type but no modifiers;
+ also, each method designator must exactly and uniquely select one method
+ (cf. <a href="s3.1.c.html" title="&sect;3.1.(c)&nbsp;Kinds of method designators"
+ class="sect">&sect;3.1.(c)</a>).
+ <br />
+ For <em>callin modifiers</em> see <a href="#s4.2"
+ title="&sect;4.2&nbsp;Callin modifiers (before, after, replace)"
+ class="sect">below (&sect;4.2)</a>.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.1.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Multiple base methods</span></h4>
+ <p>Base method designators may furthermore enumerate a
+ list of methods. If multiple base methods are bound in one
+ callin declaration generally all signatures in this binding must be conform.
+ <br />
+ However, <em>extraneous parameters</em> from base methods may be ignored
+ at the role.
+ <br />
+ For <em>result types</em> different rules exist, depending on the
+ applied callin modifier (see next).
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.1.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Named callin bindin</span></h4>
+ <p>Any callin binding may be labeled with a name. The name of a callin binding is used
+ for declaring <em>precedence</em> (<a href="#s4.8" title="&sect;4.8&nbsp;Callin precedence" class="sect">&sect;4.8</a>).
+ A named callin binding <em>overrides</em> any inherited callin binding
+ (explicit and implicit (<a href="s1.3.1.html"
+ title="&sect;1.3.1&nbsp;Acquisition and implicit inheritance of role classes"
+ class="sect">&sect;1.3.1</a>)) with the same name.
+ <br />
+ It is an error to use the same callin name more than once within the same role class.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.1.f">
+ <h4 class="subsect">(f)&nbsp;<span class="title">Callin to final</span></h4>
+ <p>When binding to a final base method, the enclosing role must be played by the exact base class
+ declaring the final method. I.e., callin binding to a final method inherited from the
+ base class's super-class is not allowed. This is motivated by the fact that no sub-class may have
+ a version of a final method with different semantics.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.1.g">
+ <h4 class="subsect">(g)&nbsp;<span class="title">Declared exceptions</span></h4>
+ <p>It is an error if a role method to be bound by callin declares in its <tt>throws</tt> clause
+ any exceptions that are not declared by the corresponding base method(s).
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.1.h">
+ <h4 class="subsect">(h)&nbsp;<span class="title">Method of enclosing class</span></h4>
+ <p>In a <code>before</code> or <code>after</code> callin binding the left hand side may alternatively
+ resolve to a method of an enclosing class rather than the current role.
+
+ </p>
+ </div>
+ </div>
+ <div class="sect depth2" id="s4.2">
+ <h2 class="sect">&sect;4.2&nbsp;Callin modifiers (before, after, replace)<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;4</a></span></h2>
+ <div class="subsect depth3" id="s4.2.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Method composition</span></h4>
+ <p>The kind of method composition is controlled by adding one
+ of the modifiers <strong>before, after</strong> or <strong>replace</strong> after the
+ "<code>&lt;-</code>" token of the binding declaration.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.2.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Additive composition</span></h4>
+ <p>The <code>before</code> and <code>after</code> modifiers have the
+ effect of adding a call to the role method at the beginning or end
+ of the base method, resp.<br />
+ In this case no data are transferred from the role to the base,
+ so if the role method has a result, this will always be ignored.
+
+ </p>
+ <h5 class="listing">Example code (Callin):</h5>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>team</b> <b>class</b> Company {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>protected</b> <b>class</b> Employee <b>playedBy</b> Person {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>public</b> <b>void</b> recalculateIncome() { ... }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> recalculateIncome <em><b>&lt;-</b> after</em> haveBirthday; <span class="comment">// callin binding</span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="codecomment">
+ <p>Line 4 declares a callin binding for the role method <code>recalculateIncome()</code>
+ defined in line 3. In combination with the role binding in line 2 this has the following effect:
+
+ </p>
+ <ul>
+ <li><strong>After</strong> every call of the method <code>Person.haveBirthday</code>
+ the method <code>Company.recalculateIncome</code> is called.
+ </li>
+ </ul>
+ </div>
+ </div>
+ <div class="subsect depth3" id="s4.2.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Replacing composition</span></h4>
+ <p>The <code>replace</code> modifier causes <em>only</em> the role method to be
+ invoked, replacing the base method.
+ <br />
+ In this case, if the base method declares a result, this should be provided by the role method.
+ Special cases of return values in callin bindings are discussed in <a href="#s4.3.e" title="&sect;4.3.(e)&nbsp;Fragile callin binding"
+ class="sect">&sect;4.3.(e)</a></p>
+ </div>
+ <div class="subsect depth3" id="s4.2.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Callin methods</span></h4>
+ <p>Role methods to be bound by a callin replacement binding must have
+ the modifier <code>callin</code>. This modifier is only allowed for methods
+ of a role class.<br />
+ A method with the <code>callin</code> modifier can only be called
+
+ </p>
+ <ul>
+ <li>via a callin replace binding</li>
+ <li>by a <code>super</code> or <code>tsuper</code> call from an overriding callin method.
+ </li>
+ </ul>
+ <p>It is illegal for a <code>callin</code> method
+ </p>
+ <ul>
+ <li>to be called directly,</li>
+ <li>to be bound using a callout binding, and</li>
+ <li>to be bound to a base method using a <code>before</code> or <code>after</code> callin binding.
+ </li>
+ </ul>
+ <p>Despite these rules a second level role &mdash; which is played by the current role &mdash;
+ can intercept the execution of a callin method using any form of callin binding.</p>
+ <p>A callin method cannot override a regular method and vice versa, however,
+ overriding one callin method with another callin method is legal and
+ dynamic binding applies to callin method just like regular methods.
+ <br />
+ A callin method must not declare its visibility using any of the modifiers <code>public</code>,
+ <code>protected</code> or <code>private</code>. Since callin methods can only be invoked via callin bindings
+ such visibility control would not be useful.
+
+ </p>
+ </div>
+ </div>
+ <div class="sect depth2" id="s4.3">
+ <h2 class="sect">&sect;4.3&nbsp;Base calls<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;4</a></span></h2>
+ <div class="syntaxlink"><a href="sA.html#sA.5.3" title="&sect;A.5.3&nbsp;BaseCall" class="syntax">&rarr;&nbsp;Syntax&nbsp;&sect;A.5.3</a></div>
+ <p>Role methods with a <code>callin</code> modifier should contain
+ a <em>base call</em> which uses the special name <code>base</code>
+ in order to invoke the original base method (original means: before replacement).
+
+ </p>
+ <div class="subsect depth3" id="s4.3.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Syntax</span></h4>
+ <p>The syntax for base calls is <code>base.m()</code>,
+ which is in analogy to super calls.
+ A <code>base.m()</code> call must use the same name and signature
+ as the enclosing method. This again follows the rule, that roles
+ should never explicitly use base names, except in binding declarations.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.3.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Missing base call</span></h4>
+ <p>For each callin method, the compiler uses some flow analysis to check whether
+ a base call will be invoked on each path of execution (analysis is very similar
+ to the analysis for definite assignment regarding final variables -
+ <a href="http://java.sun.com/docs/books/jls/third_edition/html/defAssign.html"
+ class="ext">JLS &sect;16</a>).
+ The compiler will issue a warning if a base call is missing either
+ on each path (definitely missing) or on some paths (potentially missing).
+ Instead of directly invoking a base call, a callin method may also call
+ its explicit or implicit super version using <code>super.m()</code> or <code>tsuper.m()</code> (see <a href="s1.3.1.f.html" title="&sect;1.3.1.(f)&nbsp;tsuper" class="sect">&sect;1.3.1.(f)</a>).
+ In this case the flow analysis will transitively include the called super/tsuper version.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.3.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Duplicate base call</span></h4>
+ <p>If a callin method contains several base calls, the compiler gives
+ a warning if this will result in duplicate base call invocations on all
+ paths (definitely duplicate) or on some paths (potentially duplicate).
+ Again super/tsuper calls are included in the flow analysis (see 4.3(b)).
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.3.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Parameter tunneling</span></h4>
+ <p>If a base method has more parameters
+ than a callin method to which it is composed, additional
+ parameters are implicitly passed unchanged from the original
+ call to the base call (original means: before interception).
+ I.e., a call <code>base.m()</code> may invisibly pass additional
+ parameters that were provided by the caller, but are hidden from the
+ role method.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.3.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Fragile callin binding</span></h4>
+ <p>If a role method returns void, but the bound base method declares a
+ non-void result, this is reported as a <em>fragile callin binding</em>:
+ The result can still be provided by the base call, but omitting the
+ base call may cause problems depending on the return type:
+
+ </p>
+ <ul>
+ <li>For reference return types <code>null</code> will be returned
+ in this case.
+ </li>
+ <li>In the case of primitive return types this will cause a
+ <code>ResultNotProvidedException</code> at run-time.
+ </li>
+ </ul>
+ <p>It is an error if a callin method involved in a fragile callin binding
+ has definitely no base call.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.3.f">
+ <h4 class="subsect">(f)&nbsp;<span class="title">Base super calls</span></h4>
+ <p>If a callin method <code>rm</code> is bound to a base method <code>B1.m</code>
+ that in turn overrides an inherited method <code>B0.m</code>
+ (<code>B0</code> is a super class of <code>B1</code>),
+ the callin method may use a special form of a base call denoted as
+
+ </p>
+ <div class="listing plain"><pre><strong>base.super</strong>.rm();</pre></div>
+ <p>Such base super call invokes the super method of the bound base method,
+ here <code>B0.m</code>. This invocation is not affected by any further callin binding.
+
+ </p>
+ <p>A base super call bypasses both the original method <code>B1.m</code> and
+ also other callin bindings that would be triggered by a regular base call.
+ For this reason any application of this construct is flagged by a decapsulation warning
+ (see <a href="s3.4.html" title="&sect;3.4&nbsp;Overriding access restrictions"
+ class="sect">&sect;3.4</a>).
+
+ </p>
+ </div>
+ <div class="note">
+ <h5>Comment:</h5>
+ Base calls can occur in callin methods that are not
+ yet bound. These methods have no idea of the names of base methods that
+ a sub-role will bind to them. Also multiple base methods may be bound
+ to the same callin method.
+ Hence the use of the role method's own name and signature.
+ The language implementation translates the method name and signature
+ back to the base method that has originally been invoked.
+
+ </div>
+ <h5 class="listing">Example code (Base Call):</h5>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>class</b> ValidatorRole <b>playedBy</b> Po<b>int</b> {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <em>callin</em> <b>void</b> checkCoordinate(<b>int</b> value) {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>if</b> (value &lt; 0)</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <em>base</em>.checkCoordinate(-value);</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> else</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> <em>base</em>.checkCoordinate(value);</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre> checkCoordinate <b>&lt;-</b> <b>replace</b> setX, setY;</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="codecomment">
+ <h5>Effects:</h5>
+ <ul>
+ <li>Line 2 defines a callin method which is bound to two methods
+ of the base class <code>Point</code> (see line 8).
+ </li>
+ <li>The value passed to either setX or setY is checked if it is
+ positive (line 3).
+ </li>
+ <li>Lines 4 and 6 show calls of the original method (base calls).
+ While line 6 passes the original value, in the negative case (line 4)
+ the passed value is made positive.
+ </li>
+ </ul>
+ </div>
+ </div>
+ <div class="sect depth2" id="s4.4">
+ <h2 class="sect">&sect;4.4&nbsp;Callin parameter mapping<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;4</a></span></h2>
+ <div class="subsect depth3" id="s4.4.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">General case parameter mapping</span></h4>
+ <p>The rules for mapping callin parameters and result type
+ are mainly the same as for callout bindings (<a href="s3.2.html" title="&sect;3.2&nbsp;Callout parameter mapping"
+ class="sect">&sect;3.2</a>)
+ except for reversing the <code>-&gt;</code> and <code>&lt;-</code> tokens and
+ swapping left hand side and right hand side.
+ <br />
+ Callin bindings using <code>before</code> have no result mapping.
+ For <code>result</code> in <code>after</code> callin bindings
+ see <a href="#s4.4.c"
+ title="&sect;4.4.(c)&nbsp;Mapping the result of a base method"
+ class="sect">&sect;4.4.(c)</a> below.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.4.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Restrictions for callin replace bindings</span></h4>
+ <p>The right-hand side of a parameter mapping may either be
+ the simple name of a base method argument without further computation,
+ or an arbitrary expression <em>not</em> containing any base method argument.
+ <br />
+ Each base method argument must either appear as a simple name in exactly one parameter mapping
+ or not be mapped at all. In the latter case, the original argument is "tunneled" to
+ the base call, meaning, the callin method does not see the argument, but it is passed
+ to the base method as expected.
+ <br />
+ If the base method declares a result, then
+
+ </p>
+ <ul>
+ <li>if the role method also declares a result, <code>result</code> must be mapped to itself:
+ <br /><code>result -&gt; result</code></li>
+ <li>if the role method does not declare a result, an arbitrary expression may be mapped to result:
+ <br /><code><em>expression</em> -&gt; result</code><br />
+ If in this situation no result mapping exists, the result of the base call
+ is "tunneled" and passed to the original caller (see <a href="#s4.3.e" title="&sect;4.3.(e)&nbsp;Fragile callin binding"
+ class="sect">
+ fragile callin binding (&sect;4.3.(e))</a> above).
+
+ </li>
+ </ul>
+ <p>These rules ensure that these bindings are reversible
+ for the sake of base calls (<a href="#s4.3" title="&sect;4.3&nbsp;Base calls" class="sect">&sect;4.3</a>).
+
+ </p>
+ <p>As stated above a fragile callin binding (<a href="#s4.3.e" title="&sect;4.3.(e)&nbsp;Fragile callin binding"
+ class="sect">&sect;4.3.(e)</a>)
+ is not allowed with a callin method that definitely has no base call
+ (<a href="#s4.3.b" title="&sect;4.3.(b)&nbsp;Missing base call" class="sect">&sect;4.3.(b)</a>). A callin replace binding is not fragile if it provides
+ the base result using a result mapping.
+
+ </p>
+ <p>A callin method bound with replace to a base method returning
+ void must not declare a non-void result.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.4.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Mapping the result of a base method</span></h4>
+ <p>In an <code>after</code> callin binding, the right-hand side
+ of a parameter mapping may use the identifier <code>result</code>
+ to refer to the result of the base method.
+
+ </p>
+ <p>
+ An <code>after</code> callin binding
+ can, however, not <em>influence</em> the result of the base method,
+ thus mappings with the <code>-&gt;</code> token are not allowed for after callin bindings.
+ For <code>before</code> mappings using the <code>-&gt;</code> token is already ruled out by <a href="#s4.4.a" title="&sect;4.4.(a)&nbsp;General case parameter mapping"
+ class="sect">&sect;4.4.(a)</a></p>
+ </div>
+ <div class="subsect depth3" id="s4.4.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Multiple base methods</span></h4>
+ <p>A callin binding listing more than one base method may use parameter
+ mappings with only the following restriction: if any base parameter should be mapped this parameter
+ must have the same name and type in all listed base method designators.
+ However, different parameter mappings for different base methods bound to the same role method
+ can be defined if separate callin bindings are used.
+
+ </p>
+ </div>
+ </div>
+ <div class="sect depth2" id="s4.5">
+ <h2 class="sect">&sect;4.5&nbsp;Lifting and lowering<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;4</a></span></h2>
+ <p>For basic definition see <a href="s2.2.html" title="&sect;2.2&nbsp;Lowering" class="sect">&sect;2.2</a>
+ and <a href="s2.3.html" title="&sect;2.3&nbsp;Lifting" class="sect">&sect;2.3</a>.
+ <br />
+ (The following rules are reverse forms of those from <a href="s3.3.html" title="&sect;3.3&nbsp;Lifting and lowering" class="sect">&sect;3.3</a>)
+
+ </p>
+ <div class="subsect depth3" id="s4.5.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Call target translation</span></h4>
+ <p>Invoking a role method due to a callin binding first
+ <strong>lifts</strong> the base object to the role class of the
+ callin binding, in order to obtain the effective call target.
+ This is why callin bindings cannot be defined in roles that are <em>unliftable</em>
+ due to <em>potential binding ambiguity</em> (see <a href="#s4.1.b" title="&sect;4.1.(b)&nbsp;Prerequisite: Class binding"
+ class="sect">&sect;4.1.(b)</a>
+ above and <a href="s2.3.4.a.html" title="&sect;2.3.4.(a)&nbsp;Potential ambiguity"
+ class="sect">&sect;2.3.4.(a)</a>).
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.5.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Parameter translation</span></h4>
+ <p>During callin execution, each parameter for which the role method expects a role
+ object is implicitly <strong>lifted</strong> to the declared role class.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.5.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Result translation</span></h4>
+ <p>Returning a role object from a callin method implicitly
+ <strong>lowers</strong> this object.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.5.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Typing rules</span></h4>
+ <p>A parameter mapping (implicit by parameter position or explicit
+ by a <code>with</code> clause) is <strong>well typed</strong> if
+ the right hand side conforms to the left hand side, either by
+
+ </p>
+ <ul>
+ <li>type equality</li>
+ <li>implicit primitive type conversion</li>
+ <li>subtype polymorphism</li>
+ <li>translation polymorphism, here: <em>lifting</em>;<br />
+ however, within <code>replace</code> bindings step 1 of the smart lifting
+ algorithm (<a href="s2.3.3.a.html" title="&sect;2.3.3.(a)&nbsp;Static adjustment"
+ class="sect">&sect;2.3.3.(a)</a>) is not applicable
+ </li>
+ <li><em>or</em> by a combination of the above.
+ </li>
+ </ul>
+ <p>A result mapping (implicit or explicit by a <code>with</code> clause)
+ is well typed, if the value at the left hand conforms to the
+ right hand side according to the rules given above, except that
+ translation polymorphism here applies <em>lowering</em> instead of
+ lifting.
+ </p>
+ <p>
+ These rules define <strong>translation polymorphism</strong> as introduced in
+ <a href="s2.3.html" title="&sect;2.3&nbsp;Lifting" class="sect">&sect;2.3</a>.
+
+ </p>
+ <p>Additionally, in a <code>replace</code> callin binding compatibility of parameters and return
+ types must hold in both directions.
+ Thus, from the above list of conversions a replace binding cannot apply subtype polymorphism
+ nor primitive type conversion.
+ If more flexibility is desired, type parameters can be used as defined in <a href="#s4.10" title="&sect;4.10&nbsp;Generic callin bindings" class="sect">&sect;4.10</a>.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.5.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Role arrays</span></h4>
+ <p>For arrays of roles as parameters <a href="s2.3.d.html" title="&sect;2.3.(d)&nbsp;Lifting of arrays"
+ class="sect">&sect;2.3.(d)</a> applies
+ accordingly. For arrays as return value <a href="s2.2.e.html" title="&sect;2.2.(e)&nbsp;Lowering of arrays"
+ class="sect">&sect;2.2.(e)</a> applies.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.5.f">
+ <h4 class="subsect">(f)&nbsp;<span class="title">Base calls</span></h4>
+ <p>For base calls these rules are reversed again, i.e., a
+ base call behaves like a callout binding.
+
+ </p>
+ </div>
+ </div>
+ <div class="sect depth2" id="s4.6">
+ <h2 class="sect">&sect;4.6&nbsp;Overriding access restrictions<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;4</a></span></h2>
+ <p>Callin bindings may also mention inaccessible methods
+ (cf. decapsulation <a href="s3.4.html" title="&sect;3.4&nbsp;Overriding access restrictions"
+ class="sect">&sect;3.4</a>).
+ Due to the reverse call direction this is relevant only for base calls within
+ <code>callin</code> methods.
+ Base calls have unrestricted access to protected base methods.
+ Accessing a base method with private or default visibility is
+ also allowed, but signaled by a compiler warning.
+
+ </p>
+ <div class="note">
+ <h5>Comment:</h5>
+ A base call to an inaccessible base method is considered harmless,
+ since this is the originally intended method execution.
+
+ </div>
+ <div class="subsect depth3" id="s4.6.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Private methods from super classes</span></h4>
+ <p><em>(Cf. <a href="s3.4.d.html"
+ title="&sect;3.4.(d)&nbsp;Private methods from super classes"
+ class="sect">&sect;3.4.(d)</a>)</em>
+ If a callin binding shall bind to a private base method, that method
+ must be defined in the exact base class to which the current role
+ class is bound using <code>playedBy</code>.
+ <br />
+ If a private base feature must indeed be callin-bound, a role class
+ must be defined that is played by the exact base class defining the
+ private feature. Another role bound to a sub-base-class can then
+ be defined as a sub class of the first role. It will inherit the
+ callin binding and through this it can access the desired feature.
+
+ </p>
+ </div>
+ </div>
+ <div class="sect depth2" id="s4.7">
+ <h2 class="sect">&sect;4.7&nbsp;Callin binding with static methods<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;4</a></span></h2>
+ <p>The normal case of callin bindings refers to non-static methods on both
+ sides (base and role). Furthermore, in Java inner classes can not define
+ static methods. Both restrictions are relaxed by the following rules:
+
+ </p>
+ <div class="subsect depth3" id="s4.7.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Static role methods</span></h4>
+ <p>A role class may define static methods (see also <a href="s1.2.1.f.html" title="&sect;1.2.1.(f)&nbsp;Static role methods"
+ class="sect">&sect;1.2.1.(f)</a>).
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.7.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Binding static to static</span></h4>
+ <p>A callin binding may bind a static role method to one or more
+ static base methods. It is, however, an error to bind a static base method to a non-static role method,
+ because such binding would require to lift a base object that is not provided.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.7.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">before/after</span></h4>
+ <p>In addition to the above, <code>before</code> and <code>after</code>
+ callin bindings may also bind a static role method to non-static base methods.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.7.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">replace</span></h4>
+ <p>In contrast to <a href="#s4.7.c" title="&sect;4.7.(c)&nbsp;before/after" class="sect">&sect;4.7.(c)</a> above, a <code>replace</code> callin binding
+ cannot bind a static role method to a non-static base method.
+
+ </p>
+ </div>
+ <p>The following table summarizes the combinations defined above:
+
+ </p>
+ <table border="2" class="sep" cellpadding="5" width="80%">
+ <tr class="z1">
+ <td colspan="2" rowspan="2" align="right"><strong>&lt;-</strong>&nbsp;&nbsp;
+ </td>
+ <td colspan="2" align="center" rowspan="1"><strong>base method</strong></td>
+ </tr>
+ <tr class="z1">
+ <td align="center" rowspan="1" colspan="1">static</td>
+ <td align="center" rowspan="1" colspan="1">non-static</td>
+ </tr>
+ <tr class="z2">
+ <td rowspan="2" align="center" class="z1" colspan="1"><strong>role<br />method</strong></td>
+ <td align="center" class="z1" rowspan="1" colspan="1">static</td>
+ <td rowspan="1" colspan="1"><span class="green">OK</span></td>
+ <td rowspan="1" colspan="1"><code>before/after</code>: <span class="green">OK</span><br /><code>replace</code>: <span class="error">illegal</span></td>
+ </tr>
+ <tr class="z2">
+ <td align="center" class="z1" rowspan="1" colspan="1">non-static</td>
+ <td rowspan="1" colspan="1"><span class="error">illegal</span></td>
+ <td rowspan="1" colspan="1"><span class="green">OK</span></td>
+ </tr>
+ </table>
+ <div class="subsect depth3" id="s4.7.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">No overriding</span></h4>
+ <p>Since static methods are not dynamically bound, <i>overriding</i> does not
+ apply in the normal semantics. Regarding callin bindings this has the
+ following consequences (assuming a role <code>RMid</code> played by
+ <code>BMid</code> plus its super-class <code>BSuper</code> and its sub-class
+ <code>BSub</code>.
+
+ </p>
+ <ol>
+ <li>If a static base method <code>BMid.m</code> is bound by a callin binding
+ this has no effect on any method <code>m</code> in <code>BSub</code>.
+ </li>
+ <li>If a callin binding mentions a method <code>m</code> which is not present
+ in <code>BMid</code> but resolves to a static method in <code>BSuper</code>
+ the binding only affects invocations as <code>BMid.m()</code> but not
+ <code>BSuper.m()</code>. If the latter call should be affected, too,
+ the callin binding must appear in a role class bound to <code>BSuper</code>,
+ not <code>BMid</code>.
+ </li>
+ <li>In order to bind two static base methods with equal signatures, one being
+ defined in a sub-class of the other one, two roles have to be defined
+ where one role refines the <code>playedBy</code> clause of the other role
+ (say: <code>public class RSub extends RMid playedBy BSub</code>).
+ Now each role may bind to the static base method accessible in its direct
+ base-class.
+ </li>
+ </ol>
+ </div>
+ </div>
+ <div class="sect depth2" id="s4.8">
+ <h2 class="sect">&sect;4.8&nbsp;Callin precedence<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;4</a></span></h2>
+ <div class="syntaxlink"><a href="sA.8.html" title="&sect;A.8&nbsp;Precedence declaration"
+ class="syntax">&rarr;&nbsp;Syntax&nbsp;&sect;A.8</a></div>
+ <p>If multiple callins from the same team refer to the same base method and also have the same
+ callin modifier (<code>before</code>, <code>after</code> or <code>replace</code>), the order in which
+ the callin bindings shall be triggered has to be declared using a precedence declaration.
+
+ </p>
+ <div class="subsect depth3" id="s4.8.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Precedence declaration</span></h4>
+ <p>A precedence declaration consists of the keyword <code>precedence</code> followed by
+ a list of names referring to callin bindings (see <a href="#s4.1.e" title="&sect;4.1.(e)&nbsp;Named callin bindin" class="sect">&sect;4.1.(e)</a> for named callin bindings).
+ <br />
+ A precedence declaration is only legal within a role or team class.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.8.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Qualified and unqualified names</span></h4>
+ <p>Within a role class a callin binding may be referenced by its unqualified name.
+ A precedence declaration in a team class must qualify the callin name with the name of the declaring
+ role class. A team with nested teams may concat role class names.
+ Elements of a qualified callin name are separated by ".".
+ <br />
+ The callin binding must be found in the role specified by the qualifying prefix or
+ in the enclosing role for unqualified names, or any super class of this role
+ (including implicit super classes <a href="s1.3.1.html"
+ title="&sect;1.3.1&nbsp;Acquisition and implicit inheritance of role classes"
+ class="sect">&sect;1.3.1</a>).
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.8.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Class based precedence</span></h4>
+ <p>At the team level a precedence declaration may contain role class names without
+ explicitly mentioning callin bindings in order to refer to all callin bindings of the role.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.8.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Multiple precedence statements</span></h4>
+ <p>All precedence statements are collected at the outer-most team. At that level all
+ precedence declarations involving the same base method are merged using the
+ C3 algorithm <a href="#fn3-c3-algorithm" class="int">[3]</a>. It is an error to declare
+ incompatible precedence lists that cannot be merged by the C3 algorithm.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.8.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Binding overriding</span></h4>
+ <p>Precedence declarations may conflict with overriding of callin bindings
+ (see <a href="#s4.1.e" title="&sect;4.1.(e)&nbsp;Named callin bindin" class="sect">&sect;4.1.(e)</a>): For each pair of callin bindings of which one
+ callin binding overrides the other one, precedence declarations are not applicable,
+ since dynamic binding will already select exactly one callin binding.
+ <br />
+ It is an error to <i>explicitly mention</i> such a pair of overriding callin bindings in a precedence declaration.
+ <br />
+ When a class-based precedence declaration <i>implicitly refers to</i> a callin binding that is overridden by,
+ or overrides any other callin binding within the same precedence declaration, this does not affect the fact,
+ that the most specific callin binding overrides less specific ones.
+
+ </p>
+ </div>
+ <h5 class="listing">Callin binding example</h5>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>class</b> LogLog<b>in</b> <b>playedBy</b> Data<b>base</b> {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>callin</b> <b>void</b> log (String what) {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> System.out.println("enter " + what);</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> base.log(what.toLowerCase());</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> System.out.println("leave " + what);</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> <b>void</b> log(String what) <b>&lt;-</b> <b>replace</b> <b>void</b> login(String uid, String passwd) </pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre> <b>with</b> { what <b>&lt;-</b> uid }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre>}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">10</td>
+ <td><pre>(<b>new</b> Database()).login("Admin", "Passwd");</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="codecomment">
+ <h5>Effects:</h5>
+ <p>Provided the callin bindings are active (cf. <a href="s5.html" title="&sect;5&nbsp;Team Activation" class="sect">&sect;5</a>) then:
+
+ </p>
+ <ul>
+ <li>the call in line 10 is intercepted by method <code>log</code>
+ of role <code>LogLogin</code>.
+ </li>
+ <li>the call target of <code>log</code> is a role of type
+ <code>LogLogin</code> which is created by lifting the
+ original call target (of type <code>Database</code>) to
+ <code>LogLogin</code>.
+ </li>
+ <li>only parameter <code>uid</code> is passed to <code>log</code>
+ (bound to formal parameter <code>what</code>).
+ </li>
+ <li>within method <code>log</code> the base call (line 4) invokes
+ the original method passing a modified uid (converted to lower case, cf. line 4)
+ and the unmodified password, which is hidden from the callin method due to the
+ parameter mapping in line 8.
+ </li>
+ </ul>
+ </div>
+ </div>
+ <div class="sect depth2" id="s4.9">
+ <h2 class="sect">&sect;4.9&nbsp;Callin inheritance<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;4</a></span></h2>
+ <p>
+ This section defines how callin bindings and callin methods relate to inheritance.
+
+ </p>
+ <div class="sect depth3" id="s4.9.1">
+ <h3 class="sect">&sect;4.9.1&nbsp;Base side inheritance<span class="toplink"><a href="#s4.9">&uarr;&nbsp;&sect;4.9</a></span></h3>
+ <p>
+ Generally, a callin binding affects all sub-types of its bound base.
+ Specifically, if a role type <code>R</code> bound to a base type <code>B</code>
+ defines a callin binding <code>rm &lt;- <i>callin_modifier</i> bm</code>,
+ the following rules apply:
+
+ </p>
+ <div class="subsect depth4" id="s4.9.1.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Effect on sub-classes</span></h4>
+ <p>The callin binding also effects instances of any type <code>BSub</code>
+ that is a sub-type of <code>B</code>.
+ If <code>BSub</code> overrides the bound base method <code>bm</code>,
+ the overridden version is generally affected, too.
+ However, if <code>bm</code> covariantly redefines the return type from its
+ super version, the callin binding has to explicitly specify if the covariant
+ sub-class version should be affected, too (see <a href="#s4.9.3.b"
+ title="&sect;4.9.3.(b)&nbsp;Capturing covariant base methods"
+ class="sect">&sect;4.9.3.(b)</a>).
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s4.9.1.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">No effect on super-classes</span></h4>
+ <p>The binding never affects an instance of any super-type of <code>B</code>
+ even if the method <code>bm</code> is inherited from a super-class
+ or overrides an inherited method.
+ This ensures that dispatching to a role method due to a callin binding
+ always provides a base instance that has at least the type declared in the role's
+ <code>playedBy</code> clause.
+
+ </p>
+ </div>
+ <p>
+ For corresponding definitions regarding static methods see <a href="#s4.7.e" title="&sect;4.7.(e)&nbsp;No overriding" class="sect">&sect;4.7.(e)</a>.
+
+ </p>
+ </div>
+ <div class="sect depth3" id="s4.9.2">
+ <h3 class="sect">&sect;4.9.2&nbsp;Role side inheritance<span class="toplink"><a href="#s4.9">&uarr;&nbsp;&sect;4.9</a></span></h3>
+ <p>
+ Any sub-type of <code>R</code> inherits the given callin binding
+ (for overriding of bindings see <a href="#s4.8.e" title="&sect;4.8.(e)&nbsp;Binding overriding" class="sect">&sect;4.8.(e)</a>).
+ If the sub-role overrides the role method <code>rm</code> this will be considered
+ for dynamic dispatch when the callin binding is triggered.
+
+ </p>
+ </div>
+ <div class="sect depth3" id="s4.9.3">
+ <h3 class="sect">&sect;4.9.3&nbsp;Covariant return types<span class="toplink"><a href="#s4.9">&uarr;&nbsp;&sect;4.9</a></span></h3>
+ <p>
+ Since version 5, Java supports the covariant redefinition of a method's return type
+ (see <a href="http://java.sun.com/docs/books/jls/third_edition/html/classes.html#8.4.5"
+ class="ext">JLS 8.4.5</a>).
+ This is <em>not</em> supported for <code>callin</code> methods (<a href="#s4.9.3.a" title="&sect;4.9.3.(a)&nbsp;No covariant callin methods"
+ class="sect">&sect;4.9.3.(a)</a>).
+ If base methods with covariant redefinition of the return type are to be bound by a callin binding
+ the subsequent rules ensure that type safety is preserved.
+ Two <em>constraints</em> have to be considered:
+
+ </p>
+ <ol>
+ <li>
+ When a callin method issues a base-call or calls its tsuper version,
+ this call must produce a value whose type is compatible to the
+ enclosing method's declared return type.
+
+ </li>
+ <li>
+ If a replace-bound role method returns a value that is not the result of a base-call,
+ it must be ensured that the return value actually satisfies the declared signature of
+ the bound base method.
+
+ </li>
+ </ol>
+ <div class="subsect depth4" id="s4.9.3.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">No covariant callin methods</span></h4>
+ <p>
+ A method declared with the <code>callin</code> modifier that overrides an inherited method
+ must not redefine the return type with respect to the inherited method.
+ This reflects that fact that an inherited callin binding should remain type-safe
+ while binding to the new, overriding role method.
+ Binding a covariant role method to the original base method would break constraint (1) above.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s4.9.3.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Capturing covariant base methods</span></h4>
+ <p>
+ If a callin binding should indeed affect not only the specified base method
+ but also overriding versions which covariantly redefine the return type,
+ the binding must specify the base method's return type with a "+" appended
+ to the type name as in
+ </p>
+ <div class="listing plain"><pre><b>void</b> rm() <b>&lt;-</b> <b>before</b> <em>RT+</em> bm();</pre></div>
+ <p>Without the "+" sign the binding would only capture base methods whose
+ return type is exactly <code>RT</code>;
+ by appending "+" also sub-types of <code>RT</code>
+ are accepted as the declared return type.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s4.9.3.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Covariant replace binding</span></h4>
+ <p>
+ When using the syntax of <a href="#s4.9.3.b"
+ title="&sect;4.9.3.(b)&nbsp;Capturing covariant base methods"
+ class="sect">&sect;4.9.3.(b)</a> to capture base methods with
+ covariant return types in a callin binding with the <code>replace</code> modifier,
+ the role method must be specified using a free type parameter as follows:
+ </p>
+ <div class="listing plain"><pre><em>&lt;E <b>extends</b> RT&gt; E</em> rm() <b>&lt;-</b> <b>replace</b> RT+ bm();</pre></div>
+ <p>The role method <code>rm</code> referenced by this callin binding must use the same style
+ of return type using a type parameter.
+ The only possible non-null value of type <code>E</code>
+ to be returned from such method is the value provided by a base-call or a tsuper-call.<br />
+ This rule enforces the constraint (2) above.<br />
+ Note that this rule is further generalized in <a href="#s4.10" title="&sect;4.10&nbsp;Generic callin bindings" class="sect">&sect;4.10</a>.
+
+ </p>
+ <h5 class="listing">Binding a parametric role method</h5>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>class</b> SuperBase {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> SuperBase foo() { <b>return</b> this; }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>void</b> check() { System.out.print("OK"); }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre>}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre><b>public</b> <b>class</b> SubBase <b>extends</b> SuperBase {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> @Override</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> SubBase foo() { <b>return</b> this; }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre> <b>void</b> print() { System.out.print("SubBase"); }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre> String test() { </pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">10</td>
+ <td><pre> this.foo().print(); <span class="comment">// print() requires a SubBase</span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">11</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">12</td>
+ <td><pre>}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">13</td>
+ <td><pre></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">14</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> MyTeam {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">15</td>
+ <td><pre> <b>protected</b> <b>class</b> R <b>playedBy</b> SuperBase {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">16</td>
+ <td><pre> <b>callin</b> &lt;E <b>extends</b> SuperBase&gt; E ci() {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">17</td>
+ <td><pre> E result= base.ci();</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">18</td>
+ <td><pre> result.check(); <span class="comment">// check() is available on E via type bound SuperBase</span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">19</td>
+ <td><pre> <b>return</b> result;</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">20</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">21</td>
+ <td><pre> &lt;E <b>extends</b> SuperBase&gt; E ci() <b>&lt;-</b> <b>replace</b> SuperBase+ foo();</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">22</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">23</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="codecomment">
+ <h5>Explanation:</h5>
+ <ul>
+ <li>
+ Method <code>SubBase.foo</code> in line 7 redefines the return type
+ from <code>SuperBase</code> (inherited version) to <code>SubBase</code>,
+ thus clients like the method call in line 10 must be safe to assume
+ that the return value will always conform to <code>SubBase</code>.
+
+ </li>
+ <li>
+ The callin binding in line 21 explicitly captures both versions of <code>foo</code>
+ by specifying <code>SuperBase+</code> as the expected return type.
+ Thus, if an instance of <code>MyTeam</code> is active at the method call
+ in line 10, this call to <code>foo</code> will indeed be intercepted
+ even though this call is statically known to return a value of type <code>SubBase</code>.
+
+ </li>
+ <li>
+ The callin method in lines 16-20 has a return type which is not known statically,
+ but the return type is represented by the type variable <code>E</code>.
+ Since the base call is known to have the exact same signature as its enclosing
+ method, the value provided by the base call is of the same type <code>E</code>
+ and thus can be safely returned from <code>ci</code>.
+ <em>Note,</em> that no other non-null value is known to have the type <code>E</code>.
+
+ </li>
+ <li>
+ By specifying <code>SuperBase</code> as an upper bound for the type <code>E</code>
+ the callin method <code>ci</code> may invoke
+ any method declared in type <code>SuperBase</code>
+ on any value of type <code>E</code>. For an example see the call to <code>check</code>
+ in line 18.
+
+ </li>
+ </ul>
+ <p><em>
+ As an aside note that the above example uses type <code>SuperBase</code>
+ in an undisciplined way: within role <code>R</code> this type is bound
+ using <code>playedBy</code><strong> and</strong> the same type is also
+ used directly (as the upper bound for <code>E</code>).
+ This is considered bad style and it is prohibited if <code>SuperBase</code>
+ is imported using an base import (<a href="s2.1.2.d.html" title="&sect;2.1.2.(d)&nbsp;Base imports" class="sect">&sect;2.1.2.(d)</a>).
+ Here this rule is neglegted just for the purpose of keeping the example small.
+ </em></p>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="sect depth2" id="s4.10">
+ <h2 class="sect">&sect;4.10&nbsp;Generic callin bindings<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;4</a></span></h2>
+ <p>
+ As mentioned in <a href="#s4.5.d" title="&sect;4.5.(d)&nbsp;Typing rules" class="sect">&sect;4.5.(d)</a> replace bindings do not support subtype polymorphism
+ in either direction.
+ On the other hand, binding several base methods to the same <code>callin</code> method
+ may require some more flexibility if these base methods have different signatures.
+ This is where type parameter come to the rescue to allow for generic <code>callin</code> methods
+ and their binding to base methods with different signatures.<br />
+ Note that this rule is a generalization of rule <a href="#s4.9.3.c" title="&sect;4.9.3.(c)&nbsp;Covariant replace binding"
+ class="sect">&sect;4.9.3.(c)</a>.
+
+ </p>
+ <p>
+ Additionally, any callin binding (before,replace,after) may declare one or more type parameters
+ for propagating type parameters of the bound base method(s) (<a href="#s4.10.e" title="&sect;4.10.(e)&nbsp;Propagating type parameters"
+ class="sect">&sect;4.10.(e)</a>).
+
+ </p>
+ <div class="subsect depth3" id="s4.10.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Fresh type parameter</span></h4>
+ <p>
+ If a callin method declares a type parameter <code>&lt;T&gt;</code> for
+ capturing a covariant return type
+ this type <code>T</code>
+ can be used for specifying the type of exactly one parameter or the return type.
+ If a type parameter is used in more than one position of a <code>callin</code> method
+ it is not considered a <em>fresh type parameter</em>
+ and can thus not be bound to a covariant return type (see <a href="#s4.10.d" title="&sect;4.10.(d)&nbsp;Binding to a type parameter"
+ class="sect">&sect;4.10.(d)</a>).
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.10.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Type bounds</span></h4>
+ <p>
+ The type parameter of a callin binding may be bounded by an upper bound as in <code>&lt;T extends C&gt;</code>.
+ In this case <code>T</code> can only be instantiated by types conforming to the upper bound <code>C</code>.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.10.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Generic replace binding</span></h4>
+ <p>
+ A generic <code>callin</code> method according to the above rules is bound using a replace
+ binding that declares the same number of type parameters,
+ where type parameters of the binding and its callin method are identified.
+ If the <code>callin</code> method declares bounds for its type parameters
+ so should the replace binding.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s4.10.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Binding to a type parameter</span></h4>
+ <p>
+ A fresh type parameter can be used to capture arbitrary types in the base methods to be bound.
+ The type parameter may be instantiated differently for each bound base method.
+ By such type parameter instantiation the types in role and base signatures are actually identical,
+ thus satisfying the requirement of two-way substitutability.
+
+ </p>
+ </div>
+ <p>
+ Within the body of a generic <code>callin</code> method no further rules have to be followed,
+ because the fresh type variable actually guarantees, that the role method cannot replace the
+ original value (initial argument or base-call result) with a different object,
+ because no type exists that is guaranteed to conform to the type parameters.
+ Yet, the type bound allows the role method to invoke methods of the provided object.
+
+ </p>
+ <h5 class="listing">Generic replace binding</h5>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> MyTeam {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>protected</b> <b>class</b> R <b>playedBy</b> Figures {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>callin</b> &lt;E <b>extends</b> Shape, F <b>extends</b> Shape&gt; E ci(F arg) {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> E result= base.ci(arg);</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> <span class="error">result= arg; // illegal, types E and F are incommensurable</span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> <span class="error">arg= result; // illegal, types E and F are incommensurable</span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> <b>int</b> size= arg.getSize(); <span class="comment">// getSize() is availabel on F via type bound Shape</span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre> result.resize(size); <span class="comment"> // resize() is available on E via type bound Shape</span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre> <b>return</b> result; <span class="comment">// only two legal values exist: <code>result</code> and <code>null</code></span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">10</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">11</td>
+ <td><pre> &lt;E <b>extends</b> Shape, F <b>extends</b> Shape&gt; </pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">12</td>
+ <td><pre> E ci(F arg) <b>&lt;-</b> <b>replace</b> Rectangle getBoundingBox(Shape original), </pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">13</td>
+ <td><pre> Rectangle stretch(Square original);</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">14</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">15</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="codecomment">
+ <h5>Explanation:</h5>
+ These declaration generate two version of the <code>callin</code> method <code>ci</code>:
+
+ <ol>
+ <li><code>Rectangle ci (Shape arg)</code></li>
+ <li><code>Rectangle ci (Square arg)</code></li>
+ </ol>
+ Within the <code>callin</code> method the following observations hold:
+
+ <ul>
+ <li>Line 5 is illegal for the first signature as <code>Shape</code> is not conform to <code>Rectangle</code></li>
+ <li>Line 6 is illegal for the second signature as <code>Rectangle</code> is not conform to <code>Square</code></li>
+ <li>Everything else is type-safe.</li>
+ </ul>
+ </div>
+ <div class="subsect depth3" id="s4.10.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Propagating type parameters</span></h4>
+ <p>
+ If a callin binding binds to a generic base method,
+ any type parameter(s) of the base method must be propagated into the role method
+ by declaring the callin binding with type parameters, too.
+ By matching a type parameter of a base method with a type variable
+ of the callin binding, this genericity is propagated through the callin binding.
+
+ </p>
+ <div class="listing frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>class</b> MyBase {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> &lt;T&gt; T getIt(T it) { <b>return</b> it; }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre>}</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre><b>team</b> <b>class</b> MyTeam {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> <b>protected</b> <b>class</b> MyRole <b>playedBy</b> MyBase {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> <b>callin</b> &lt;U&gt; U rm(U a) { <b>return</b> base.rm(a); }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> &lt;U&gt; U rm(U a) <b>&lt;-</b> <b>replace</b> U getIt(U it);</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="codecomment">
+ <h5>Explanation:</h5>
+ The callin binding declares a type parameter <code>&lt;U&gt;</code>
+ which is used to match all occurrences of <code>T</code> in the signature of <code>getIt</code>.
+ Thus the implementation of <code>rm</code> uses the type <code>U</code>
+ in exactly the same generic way as <code>getIt</code> uses <code>T</code>.
+
+ </div>
+ </div>
+ </div>
+ <div class="aux" id="aux4.2">
+ <h4 class="aux">Open issues:<span class="toplink"><a href="#s4">&uarr;&nbsp;&sect;4</a></span></h4>
+ <p>The query language for specifying sets of base methods (<a href="#s4.1.d" title="&sect;4.1.(d)&nbsp;Multiple base methods"
+ class="sect">&sect;4.1.(d)</a>)
+ has not been finalized yet. In this version of the OTJLD <a href="s8.html" title="&sect;8&nbsp;Join Point Queries" class="sect">&sect;8</a>
+ acts as a placeholder for the section that will define a join point query language in the future.
+ </p>
+ </div>
+ <div class="aux" id="aux4.1">
+ <h4 class="aux">References:<span class="toplink"><a href="#s4">&uarr;&nbsp;&sect;4</a></span></h4>
+ <p id="fn3-c3-algorithm">
+ [3] Kim Barrett, Bob Cassels, Paul Haahr, David A. Moon, Keith Playford, P. Tucker Withington. <em>A monotonic superclass linearization for Dylan</em>. OOPSLA '96: Proceedings of the 11th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications,
+ pages 69-82, 1996.
+
+ </p>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s3.html" rel="prev">&lt;&lt;&nbsp;&sect;3&nbsp;Callout Binding</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s5.html" rel="next">&sect;5&nbsp;Team Activation&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.1.1.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.1.1.html
new file mode 100644
index 000000000..79757f799
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.1.1.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s5.1.2.html" rel="next">&sect;5.1.2&nbsp;Effect on garbage collection&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s5.html" rel="section">&sect;5&nbsp;Team Activation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.1.html" rel="section">&sect;5.1&nbsp;Effect of team activation</a></div>
+ <div class="sect depth3" id="s5.1.1">
+ <h3 class="sect">&sect;5.1.1&nbsp;Global vs. thread local team activation</h3>
+ <p>While <strong>thread local</strong> activation only enables the callin bindings of
+ a team instance for a certain thread, <strong>global</strong> activation activates the
+ team instance for all threads of the application.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s5.1.2.html" rel="next">&sect;5.1.2&nbsp;Effect on garbage collection&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s5.html" rel="section">&sect;5&nbsp;Team Activation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.1.html" rel="section">&sect;5.1&nbsp;Effect of team activation</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.1.2.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.1.2.html
new file mode 100644
index 000000000..941a80e8b
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.1.2.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s5.1.1.html" rel="prev">&lt;&lt;&nbsp;&sect;5.1.1&nbsp;Global vs. thread local team activation</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s5.html" rel="section">&sect;5&nbsp;Team Activation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.1.html" rel="section">&sect;5.1&nbsp;Effect of team activation</a></div>
+ <div class="sect depth3" id="s5.1.2">
+ <h3 class="sect">&sect;5.1.2&nbsp;Effect on garbage collection</h3>
+ <p>Any active team is referenced by internal infrastructure.
+ Thus, a team cannot be reclaimed by the garbage collector while it is active.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s5.1.1.html" rel="prev">&lt;&lt;&nbsp;&sect;5.1.1&nbsp;Global vs. thread local team activation</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s5.html" rel="section">&sect;5&nbsp;Team Activation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.1.html" rel="section">&sect;5.1&nbsp;Effect of team activation</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.1.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.1.html
new file mode 100644
index 000000000..61fd5a354
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.1.html
@@ -0,0 +1,64 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s5.2.html" rel="next">&sect;5.2&nbsp;Explicit team activation&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s5.html" rel="section">&sect;5&nbsp;Team Activation</a></div>
+ <div class="sect depth2" id="s5.1">
+ <h2 class="sect">&sect;5.1&nbsp;Effect of team activation</h2>
+ <p>Activating a team instance has the effect of enabling all its callin bindings.
+ All effects defined in <a href="s4.html" title="&sect;4&nbsp;Callin Binding" class="sect">&sect;4</a> apply only if a corresponding
+ team instance is active.<br />
+ The <strong>order</strong> of team activation controls the order of callin executions.
+ If more than one team intercepts calls to the same base method, the most recently activated
+ team has highest priority in that its before or replace callins are executed first while its after
+ callins are executed last.
+
+ </p>
+ <div class="sect depth3" id="s5.1.1">
+ <h3 class="sect">&sect;5.1.1&nbsp;Global vs. thread local team activation<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;5.1</a></span></h3>
+ <p>While <strong>thread local</strong> activation only enables the callin bindings of
+ a team instance for a certain thread, <strong>global</strong> activation activates the
+ team instance for all threads of the application.
+
+ </p>
+ </div>
+ <div class="sect depth3" id="s5.1.2">
+ <h3 class="sect">&sect;5.1.2&nbsp;Effect on garbage collection<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;5.1</a></span></h3>
+ <p>Any active team is referenced by internal infrastructure.
+ Thus, a team cannot be reclaimed by the garbage collector while it is active.
+
+ </p>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s5.2.html" rel="next">&sect;5.2&nbsp;Explicit team activation&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s5.html" rel="section">&sect;5&nbsp;Team Activation</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.2.a.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.2.a.html
new file mode 100644
index 000000000..30418921b
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.2.a.html
@@ -0,0 +1,57 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s5.2.b.html" rel="next">&sect;5.2.(b)&nbsp;Imperative activation&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s5.html" rel="section">&sect;5&nbsp;Team Activation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.2.html" rel="section">&sect;5.2&nbsp;Explicit team activation</a></div>
+ <div class="subsect depth3" id="s5.2.a">
+ <h4 class="subsect">&sect;5.2.(a)&nbsp;<span class="title">Activation block</span></h4>
+ <p>A team can be activated thread local by the block construct</p>
+ <div class="listing plain"><pre><b>within</b> (myTeam) { <i>stmts</i> }</pre></div>
+ <p>If <em>stmts</em> has only one statement this can be abbreviated to
+ </p>
+ <div class="listing plain"><pre><b>within</b> (myTeam) <i>stmt</i></pre></div>
+ <p>In these statements, <code>myTeam</code> must denote a team instance.
+ For the time of executing this block, this team instance is activated for the current thread,
+ which has entered the within block.
+
+ </p>
+ <p>The <code>within</code> block statement guarantees that it leaves
+ the team in exactly the same activation state as it was in when
+ entering this block. This includes the cases of exceptions, meaning
+ that deactivation will also occur if the execution of the block
+ terminates abnormally.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s5.2.b.html" rel="next">&sect;5.2.(b)&nbsp;Imperative activation&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s5.html" rel="section">&sect;5&nbsp;Team Activation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.2.html" rel="section">&sect;5.2&nbsp;Explicit team activation</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.2.b.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.2.b.html
new file mode 100644
index 000000000..f2bfcb776
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.2.b.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s5.2.a.html" rel="prev">&lt;&lt;&nbsp;&sect;5.2.(a)&nbsp;Activation block</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s5.2.c.html" rel="next">&sect;5.2.(c)&nbsp;Multiple and mixed activations&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s5.html" rel="section">&sect;5&nbsp;Team Activation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.2.html" rel="section">&sect;5.2&nbsp;Explicit team activation</a></div>
+ <div class="subsect depth3" id="s5.2.b">
+ <h4 class="subsect">&sect;5.2.(b)&nbsp;<span class="title">Imperative activation</span></h4>
+ <p>Each team class implicitly provides methods from the predefined interface
+ <code>org.objectteams.ITeam</code> (super interface of all team classes) to control team
+ activation disregarding the block structure of the program. The methods <code>activate()</code>
+ and <code>deactivate()</code> are used to activate and deactivate a team instance for
+ the current thread.<br />
+ If a team should be de-/activated for another thread this can be done by the methods
+ <code>activate(Thread aThread)</code> and <code>deactivate(Thread aThread)</code>.
+ In order to achieve global activation for all threads the predefined constant
+ <code>org.objectteams.Team.ALL_THREADS</code> is passed to these methods (e.g.
+ <code>activate(Team.ALL_THREADS)</code>).<br />
+ Note, that this methods make no guarantees with respect to exceptions.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s5.2.a.html" rel="prev">&lt;&lt;&nbsp;&sect;5.2.(a)&nbsp;Activation block</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s5.2.c.html" rel="next">&sect;5.2.(c)&nbsp;Multiple and mixed activations&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s5.html" rel="section">&sect;5&nbsp;Team Activation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.2.html" rel="section">&sect;5.2&nbsp;Explicit team activation</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.2.c.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.2.c.html
new file mode 100644
index 000000000..285a8bb18
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.2.c.html
@@ -0,0 +1,57 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s5.2.b.html" rel="prev">&lt;&lt;&nbsp;&sect;5.2.(b)&nbsp;Imperative activation</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s5.html" rel="section">&sect;5&nbsp;Team Activation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.2.html" rel="section">&sect;5.2&nbsp;Explicit team activation</a></div>
+ <div class="subsect depth3" id="s5.2.c">
+ <h4 class="subsect">&sect;5.2.(c)&nbsp;<span class="title">Multiple and mixed activations</span></h4>
+ <ul>
+ <li>If <code>activate()</code> is invoked on a team instance
+ that has been explicitly activated before, this statement has
+ no effect at all (note the difference in <a href="s5.3.a.html" title="&sect;5.3.(a)&nbsp;Team level methods"
+ class="sect">&sect;5.3.(a)</a> below).
+ <br />
+ The same applies to deactivating an inactive team.
+ </li>
+ <li>If a team was already active when entering a <code>within</code>
+ block, it will remain active after leaving the block.
+ </li>
+ <li>If the team was active on entry of a <code>within</code> block
+ and if <code>deactivate()</code> is invoked on the same team
+ instance from within the <code>within</code> block,
+ leaving the block will re-activate the team.
+ </li>
+ </ul>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s5.2.b.html" rel="prev">&lt;&lt;&nbsp;&sect;5.2.(b)&nbsp;Imperative activation</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s5.html" rel="section">&sect;5&nbsp;Team Activation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.2.html" rel="section">&sect;5.2&nbsp;Explicit team activation</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.2.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.2.html
new file mode 100644
index 000000000..779920e16
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.2.html
@@ -0,0 +1,96 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s5.1.html" rel="prev">&lt;&lt;&nbsp;&sect;5.1&nbsp;Effect of team activation</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s5.3.html" rel="next">&sect;5.3&nbsp;Implicit team activation&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s5.html" rel="section">&sect;5&nbsp;Team Activation</a></div>
+ <div class="sect depth2" id="s5.2">
+ <h2 class="sect">&sect;5.2&nbsp;Explicit team activation</h2>
+ <div class="subsect depth3" id="s5.2.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Activation block</span></h4>
+ <p>A team can be activated thread local by the block construct</p>
+ <div class="listing plain"><pre><b>within</b> (myTeam) { <i>stmts</i> }</pre></div>
+ <p>If <em>stmts</em> has only one statement this can be abbreviated to
+ </p>
+ <div class="listing plain"><pre><b>within</b> (myTeam) <i>stmt</i></pre></div>
+ <p>In these statements, <code>myTeam</code> must denote a team instance.
+ For the time of executing this block, this team instance is activated for the current thread,
+ which has entered the within block.
+
+ </p>
+ <p>The <code>within</code> block statement guarantees that it leaves
+ the team in exactly the same activation state as it was in when
+ entering this block. This includes the cases of exceptions, meaning
+ that deactivation will also occur if the execution of the block
+ terminates abnormally.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s5.2.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Imperative activation</span></h4>
+ <p>Each team class implicitly provides methods from the predefined interface
+ <code>org.objectteams.ITeam</code> (super interface of all team classes) to control team
+ activation disregarding the block structure of the program. The methods <code>activate()</code>
+ and <code>deactivate()</code> are used to activate and deactivate a team instance for
+ the current thread.<br />
+ If a team should be de-/activated for another thread this can be done by the methods
+ <code>activate(Thread aThread)</code> and <code>deactivate(Thread aThread)</code>.
+ In order to achieve global activation for all threads the predefined constant
+ <code>org.objectteams.Team.ALL_THREADS</code> is passed to these methods (e.g.
+ <code>activate(Team.ALL_THREADS)</code>).<br />
+ Note, that this methods make no guarantees with respect to exceptions.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s5.2.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Multiple and mixed activations</span></h4>
+ <ul>
+ <li>If <code>activate()</code> is invoked on a team instance
+ that has been explicitly activated before, this statement has
+ no effect at all (note the difference in <a href="s5.3.a.html" title="&sect;5.3.(a)&nbsp;Team level methods"
+ class="sect">&sect;5.3.(a)</a> below).
+ <br />
+ The same applies to deactivating an inactive team.
+ </li>
+ <li>If a team was already active when entering a <code>within</code>
+ block, it will remain active after leaving the block.
+ </li>
+ <li>If the team was active on entry of a <code>within</code> block
+ and if <code>deactivate()</code> is invoked on the same team
+ instance from within the <code>within</code> block,
+ leaving the block will re-activate the team.
+ </li>
+ </ul>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s5.1.html" rel="prev">&lt;&lt;&nbsp;&sect;5.1&nbsp;Effect of team activation</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s5.3.html" rel="next">&sect;5.3&nbsp;Implicit team activation&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s5.html" rel="section">&sect;5&nbsp;Team Activation</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.3.a.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.3.a.html
new file mode 100644
index 000000000..d1b6ee711
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.3.a.html
@@ -0,0 +1,49 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s5.3.b.html" rel="next">&sect;5.3.(b)&nbsp;Methods of externalized roles&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s5.html" rel="section">&sect;5&nbsp;Team Activation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.3.html" rel="section">&sect;5.3&nbsp;Implicit team activation</a></div>
+ <div class="subsect depth3" id="s5.3.a">
+ <h4 class="subsect">&sect;5.3.(a)&nbsp;<span class="title">Team level methods</span></h4>
+ <p>While executing a <strong>team level method</strong>, the target team
+ is always active. Activation is reset to the previous state
+ when leaving the team method, unless the team has been explicitly activated during
+ execution of the team method by a call to <code>activate()</code>.
+ Explicit activation is stronger than implicit activation and thus persists after the
+ team level method terminates. Ie., leaving a team level method will never reset
+ an explicit activation.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s5.3.b.html" rel="next">&sect;5.3.(b)&nbsp;Methods of externalized roles&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s5.html" rel="section">&sect;5&nbsp;Team Activation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.3.html" rel="section">&sect;5.3&nbsp;Implicit team activation</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.3.b.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.3.b.html
new file mode 100644
index 000000000..5b0b05126
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.3.b.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s5.3.a.html" rel="prev">&lt;&lt;&nbsp;&sect;5.3.(a)&nbsp;Team level methods</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s5.3.c.html" rel="next">&sect;5.3.(c)&nbsp;Nested teams&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s5.html" rel="section">&sect;5&nbsp;Team Activation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.3.html" rel="section">&sect;5.3&nbsp;Implicit team activation</a></div>
+ <div class="subsect depth3" id="s5.3.b">
+ <h4 class="subsect">&sect;5.3.(b)&nbsp;<span class="title">Methods of externalized roles</span></h4>
+ <p>Invoking a method on an <strong>externalized role</strong>
+ (see <a href="s1.2.2.html" title="&sect;1.2.2&nbsp;Externalized roles" class="sect">&sect;1.2.2</a>) also has the
+ effect of temporary activation of the team containing the role for the current thread.
+ Regarding deactivation the rule of <a href="s5.3.a.html" title="&sect;5.3.(a)&nbsp;Team level methods"
+ class="sect">&sect;5.3.(a)</a> above applies accordingly.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s5.3.a.html" rel="prev">&lt;&lt;&nbsp;&sect;5.3.(a)&nbsp;Team level methods</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s5.3.c.html" rel="next">&sect;5.3.(c)&nbsp;Nested teams&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s5.html" rel="section">&sect;5&nbsp;Team Activation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.3.html" rel="section">&sect;5.3&nbsp;Implicit team activation</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.3.c.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.3.c.html
new file mode 100644
index 000000000..107c98681
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.3.c.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s5.3.b.html" rel="prev">&lt;&lt;&nbsp;&sect;5.3.(b)&nbsp;Methods of externalized roles</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s5.3.d.html" rel="next">&sect;5.3.(d)&nbsp;Configuring implicit activation&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s5.html" rel="section">&sect;5&nbsp;Team Activation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.3.html" rel="section">&sect;5.3&nbsp;Implicit team activation</a></div>
+ <div class="subsect depth3" id="s5.3.c">
+ <h4 class="subsect">&sect;5.3.(c)&nbsp;<span class="title">Nested teams</span></h4>
+ <p>Implicit activation has additional consequences for nested teams
+ (see <a href="s1.5.html" title="&sect;1.5&nbsp;Team and role nesting" class="sect">&sect;1.5</a>):
+
+ </p>
+ <ul>
+ <li>Implicit activation of a team causes the activation of its outer teams.</li>
+ <li>Implicit deactivation of a team causes the deactivation of its inner teams.</li>
+ </ul>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s5.3.b.html" rel="prev">&lt;&lt;&nbsp;&sect;5.3.(b)&nbsp;Methods of externalized roles</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s5.3.d.html" rel="next">&sect;5.3.(d)&nbsp;Configuring implicit activation&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s5.html" rel="section">&sect;5&nbsp;Team Activation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.3.html" rel="section">&sect;5.3&nbsp;Implicit team activation</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.3.d.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.3.d.html
new file mode 100644
index 000000000..cfea9a801
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.3.d.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s5.3.c.html" rel="prev">&lt;&lt;&nbsp;&sect;5.3.(c)&nbsp;Nested teams</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s5.html" rel="section">&sect;5&nbsp;Team Activation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.3.html" rel="section">&sect;5.3&nbsp;Implicit team activation</a></div>
+ <div class="subsect depth3" id="s5.3.d">
+ <h4 class="subsect">&sect;5.3.(d)&nbsp;<span class="title">Configuring implicit activation</span></h4>
+ <p>Implicit activation is disabled by default and can be enabled by adding the annotation
+ <code>@org.objectteams.ImplicitTeamActivation</code>, which can be applied to a type or a method.
+ When applied to a method it is ensured that invoking this method will trigger implicit activation.
+ When the annotation is applied to a type this has the same effect as applying it to all externally
+ visible methods of the type. Member types are not affected and have to be annotated separately.
+ </p>
+ <p>The runtime environment can be configured globally by defining the system property
+ <code>ot.implicit.team.activation</code> to one of these values:
+ </p>
+ <dl>
+ <dt>NEVER</dt>
+ <dd>Implicit activation is completely disabled.</dd>
+ <dt>ANNOTATED</dt>
+ <dd>This is the default: implicit activation applies only where declared by <code>@ImplicitTeamActivation</code>.
+ </dd>
+ <dt>ALWAYS</dt>
+ <dd>Implicit activation applies to all externally visible methods (this was the default in OTJLD versions &le;1.2)</dd>
+ </dl>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s5.3.c.html" rel="prev">&lt;&lt;&nbsp;&sect;5.3.(c)&nbsp;Nested teams</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s5.html" rel="section">&sect;5&nbsp;Team Activation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.3.html" rel="section">&sect;5.3&nbsp;Implicit team activation</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.3.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.3.html
new file mode 100644
index 000000000..04e062759
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.3.html
@@ -0,0 +1,113 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s5.2.html" rel="prev">&lt;&lt;&nbsp;&sect;5.2&nbsp;Explicit team activation</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s5.4.html" rel="next">&sect;5.4&nbsp;Guard predicates&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s5.html" rel="section">&sect;5&nbsp;Team Activation</a></div>
+ <div class="sect depth2" id="s5.3">
+ <h2 class="sect">&sect;5.3&nbsp;Implicit team activation</h2>
+ <p>Implicit team activation is intended to ensure that
+ whenever the control flow is passed to a team or one of its roles,
+ the team is implicitly activated for the current thread.
+ Implicit activation can be configured at different levels (see <a href="#s5.3.d" title="&sect;5.3.(d)&nbsp;Configuring implicit activation"
+ class="sect">&sect;5.3.(d)</a>).
+
+ </p>
+ <p>When implicit activation is enabled a programmer may assume,
+ that whenever a role forwards calls to its base object via callout,
+ the callin bindings of the same role will be active at that time.
+ Exceptions to this rule have to be programmed explicitly.
+
+ </p>
+ <div class="subsect depth3" id="s5.3.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Team level methods</span></h4>
+ <p>While executing a <strong>team level method</strong>, the target team
+ is always active. Activation is reset to the previous state
+ when leaving the team method, unless the team has been explicitly activated during
+ execution of the team method by a call to <code>activate()</code>.
+ Explicit activation is stronger than implicit activation and thus persists after the
+ team level method terminates. Ie., leaving a team level method will never reset
+ an explicit activation.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s5.3.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Methods of externalized roles</span></h4>
+ <p>Invoking a method on an <strong>externalized role</strong>
+ (see <a href="s1.2.2.html" title="&sect;1.2.2&nbsp;Externalized roles" class="sect">&sect;1.2.2</a>) also has the
+ effect of temporary activation of the team containing the role for the current thread.
+ Regarding deactivation the rule of <a href="#s5.3.a" title="&sect;5.3.(a)&nbsp;Team level methods" class="sect">&sect;5.3.(a)</a> above applies accordingly.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s5.3.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Nested teams</span></h4>
+ <p>Implicit activation has additional consequences for nested teams
+ (see <a href="s1.5.html" title="&sect;1.5&nbsp;Team and role nesting" class="sect">&sect;1.5</a>):
+
+ </p>
+ <ul>
+ <li>Implicit activation of a team causes the activation of its outer teams.</li>
+ <li>Implicit deactivation of a team causes the deactivation of its inner teams.</li>
+ </ul>
+ </div>
+ <div class="subsect depth3" id="s5.3.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Configuring implicit activation</span></h4>
+ <p>Implicit activation is disabled by default and can be enabled by adding the annotation
+ <code>@org.objectteams.ImplicitTeamActivation</code>, which can be applied to a type or a method.
+ When applied to a method it is ensured that invoking this method will trigger implicit activation.
+ When the annotation is applied to a type this has the same effect as applying it to all externally
+ visible methods of the type. Member types are not affected and have to be annotated separately.
+ </p>
+ <p>The runtime environment can be configured globally by defining the system property
+ <code>ot.implicit.team.activation</code> to one of these values:
+ </p>
+ <dl>
+ <dt>NEVER</dt>
+ <dd>Implicit activation is completely disabled.</dd>
+ <dt>ANNOTATED</dt>
+ <dd>This is the default: implicit activation applies only where declared by <code>@ImplicitTeamActivation</code>.
+ </dd>
+ <dt>ALWAYS</dt>
+ <dd>Implicit activation applies to all externally visible methods (this was the default in OTJLD versions &le;1.2)</dd>
+ </dl>
+ </div>
+ <p>Note that among the different mechanisms for activation, <code>within</code> is strongest,
+ followed by <code>(de)activate()</code>, weakest is implicit activation. In this sense,
+ explicit imperative (de)activation may override the block structure of implicit activation
+ (by explicit activation within a team level method), but not that of a <code>within</code>
+ block (by deactivation from a within block).
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s5.2.html" rel="prev">&lt;&lt;&nbsp;&sect;5.2&nbsp;Explicit team activation</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s5.4.html" rel="next">&sect;5.4&nbsp;Guard predicates&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s5.html" rel="section">&sect;5&nbsp;Team Activation</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.4.1.a.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.4.1.a.html
new file mode 100644
index 000000000..8a0473c48
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.4.1.a.html
@@ -0,0 +1,69 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s5.4.1.b.html" rel="next">&sect;5.4.1.(b)&nbsp;Method guards&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s5.html" rel="section">&sect;5&nbsp;Team Activation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.4.html" rel="section">&sect;5.4&nbsp;Guard predicates</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.4.1.html" rel="section">&sect;5.4.1&nbsp;Regular guards</a></div>
+ <div class="subsect depth4" id="s5.4.1.a">
+ <h4 class="subsect">&sect;5.4.1.(a)&nbsp;<span class="title">Method binding guards</span></h4>
+ <p>A guard may be attached to a callin method binding as in:
+
+ </p>
+ <div class="listing plain"><pre><b>void</b> roleMethod(<b>int</b> ir) <b>&lt;-</b> <b>after</b> <b>void</b> baseMethod(<b>int</b> ib)
+ <b>when</b> (ir &gt; MyTeam.this.threshold);</pre></div>
+ <p>Such a guard only affects the callin binding to which it is attached,
+ i.e., this specific callin binding is only effective,
+ if the predicate evaluates to <code>true</code>.
+ <br />
+ The following values are within the scope of the predicate expression,
+ and thus can be used to express the condition:
+
+ </p>
+ <ul>
+ <li>The role instance denoted by <code>this</code>.<br />
+ Features of the role instance can also be accessed relative to
+ <code>this</code> with or without explicit qualifying <code>this</code>.
+
+ </li>
+ <li>The team instance denoted by a qualified this reference as in
+ <code>MyTeam.this</code>.
+
+ </li>
+ <li>If the callin binding includes signatures (as in the example above):
+ Parameters of the role method.<br />
+ If parameter mappings are involved, they will be evaluated before evaluating the guard.
+
+ </li>
+ </ul>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s5.4.1.b.html" rel="next">&sect;5.4.1.(b)&nbsp;Method guards&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s5.html" rel="section">&sect;5&nbsp;Team Activation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.4.html" rel="section">&sect;5.4&nbsp;Guard predicates</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.4.1.html" rel="section">&sect;5.4.1&nbsp;Regular guards</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.4.1.b.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.4.1.b.html
new file mode 100644
index 000000000..f4e530a44
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.4.1.b.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s5.4.1.a.html" rel="prev">&lt;&lt;&nbsp;&sect;5.4.1.(a)&nbsp;Method binding guards</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s5.4.1.c.html" rel="next">&sect;5.4.1.(c)&nbsp;Role level guards&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s5.html" rel="section">&sect;5&nbsp;Team Activation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.4.html" rel="section">&sect;5.4&nbsp;Guard predicates</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.4.1.html" rel="section">&sect;5.4.1&nbsp;Regular guards</a></div>
+ <div class="subsect depth4" id="s5.4.1.b">
+ <h4 class="subsect">&sect;5.4.1.(b)&nbsp;<span class="title">Method guards</span></h4>
+ <p>A method guard is similar to a method binding guard, but it applies
+ to all callin method bindings of this method.<br />
+ A method guard is declared between the method signature and the method body:
+
+ </p>
+ <div class="listing plain"><pre><b>void</b> roleMethod(<b>int</b> ir)
+ <b>when</b> (ir &gt; MyTeam.this.threshold) { <i>body statements</i> }</pre></div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s5.4.1.a.html" rel="prev">&lt;&lt;&nbsp;&sect;5.4.1.(a)&nbsp;Method binding guards</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s5.4.1.c.html" rel="next">&sect;5.4.1.(c)&nbsp;Role level guards&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s5.html" rel="section">&sect;5&nbsp;Team Activation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.4.html" rel="section">&sect;5.4&nbsp;Guard predicates</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.4.1.html" rel="section">&sect;5.4.1&nbsp;Regular guards</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.4.1.c.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.4.1.c.html
new file mode 100644
index 000000000..436e205a7
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.4.1.c.html
@@ -0,0 +1,61 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s5.4.1.b.html" rel="prev">&lt;&lt;&nbsp;&sect;5.4.1.(b)&nbsp;Method guards</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s5.4.1.d.html" rel="next">&sect;5.4.1.(d)&nbsp;Team level guards&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s5.html" rel="section">&sect;5&nbsp;Team Activation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.4.html" rel="section">&sect;5.4&nbsp;Guard predicates</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.4.1.html" rel="section">&sect;5.4.1&nbsp;Regular guards</a></div>
+ <div class="subsect depth4" id="s5.4.1.c">
+ <h4 class="subsect">&sect;5.4.1.(c)&nbsp;<span class="title">Role level guards</span></h4>
+ <p>When a guard is specified at the role level, i.e., directly before the
+ class body of a role class, it applies to all callin method bindings of
+ the role class:
+
+ </p>
+ <div class="listing plain"><pre><b>protected</b> <b>class</b> MyRole
+ <b>when</b> (value &gt; MyTeam.this.threshold)
+{
+ <b>int</b> value;
+ <i>other <b>class</b> body declarations</i>
+}</pre></div>
+ <p>The following values are within the scope of the predicate expression:
+
+ </p>
+ <ul>
+ <li>The role instance denoted by <code>this</code> (explicit or implicit, see above).
+ Thus, in the example <code>value</code> will be interpreted as a field of the enclosing role.
+
+ </li>
+ <li>The team instance denoted by a qualified this reference as in <code>MyTeam.this</code></li>
+ </ul>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s5.4.1.b.html" rel="prev">&lt;&lt;&nbsp;&sect;5.4.1.(b)&nbsp;Method guards</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s5.4.1.d.html" rel="next">&sect;5.4.1.(d)&nbsp;Team level guards&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s5.html" rel="section">&sect;5&nbsp;Team Activation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.4.html" rel="section">&sect;5.4&nbsp;Guard predicates</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.4.1.html" rel="section">&sect;5.4.1&nbsp;Regular guards</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.4.1.d.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.4.1.d.html
new file mode 100644
index 000000000..ee609f5bb
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.4.1.d.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s5.4.1.c.html" rel="prev">&lt;&lt;&nbsp;&sect;5.4.1.(c)&nbsp;Role level guards</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s5.html" rel="section">&sect;5&nbsp;Team Activation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.4.html" rel="section">&sect;5.4&nbsp;Guard predicates</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.4.1.html" rel="section">&sect;5.4.1&nbsp;Regular guards</a></div>
+ <div class="subsect depth4" id="s5.4.1.d">
+ <h4 class="subsect">&sect;5.4.1.(d)&nbsp;<span class="title">Team level guards</span></h4>
+ <p>A guard specified in the header of a team class may disable the callin
+ bindings of all contained role classes. The syntax corresponds to the syntax
+ of role level guards.<br />
+ The only value directly available within team level guard is the
+ team instance (denoted by <code>this</code>) and its features.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s5.4.1.c.html" rel="prev">&lt;&lt;&nbsp;&sect;5.4.1.(c)&nbsp;Role level guards</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s5.html" rel="section">&sect;5&nbsp;Team Activation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.4.html" rel="section">&sect;5.4&nbsp;Guard predicates</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.4.1.html" rel="section">&sect;5.4.1&nbsp;Regular guards</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.4.1.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.4.1.html
new file mode 100644
index 000000000..76bb92922
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.4.1.html
@@ -0,0 +1,130 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s5.4.c.html" rel="prev">&lt;&lt;&nbsp;&sect;5.4.(c)&nbsp;Exceptions</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s5.4.2.html" rel="next">&sect;5.4.2&nbsp;Base guards&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s5.html" rel="section">&sect;5&nbsp;Team Activation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.4.html" rel="section">&sect;5.4&nbsp;Guard predicates</a></div>
+ <div class="sect depth3" id="s5.4.1">
+ <h3 class="sect">&sect;5.4.1&nbsp;Regular guards</h3>
+ <p>This group of guards evaluates within the context of a given role.
+ These guards are evaluated <em>after</em> a callin target is lifted and
+ <em>before</em> a callin bound role method is invoked.
+
+ </p>
+ <div class="subsect depth4" id="s5.4.1.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Method binding guards</span></h4>
+ <p>A guard may be attached to a callin method binding as in:
+
+ </p>
+ <div class="listing plain"><pre><b>void</b> roleMethod(<b>int</b> ir) <b>&lt;-</b> <b>after</b> <b>void</b> baseMethod(<b>int</b> ib)
+ <b>when</b> (ir &gt; MyTeam.this.threshold);</pre></div>
+ <p>Such a guard only affects the callin binding to which it is attached,
+ i.e., this specific callin binding is only effective,
+ if the predicate evaluates to <code>true</code>.
+ <br />
+ The following values are within the scope of the predicate expression,
+ and thus can be used to express the condition:
+
+ </p>
+ <ul>
+ <li>The role instance denoted by <code>this</code>.<br />
+ Features of the role instance can also be accessed relative to
+ <code>this</code> with or without explicit qualifying <code>this</code>.
+
+ </li>
+ <li>The team instance denoted by a qualified this reference as in
+ <code>MyTeam.this</code>.
+
+ </li>
+ <li>If the callin binding includes signatures (as in the example above):
+ Parameters of the role method.<br />
+ If parameter mappings are involved, they will be evaluated before evaluating the guard.
+
+ </li>
+ </ul>
+ </div>
+ <div class="subsect depth4" id="s5.4.1.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Method guards</span></h4>
+ <p>A method guard is similar to a method binding guard, but it applies
+ to all callin method bindings of this method.<br />
+ A method guard is declared between the method signature and the method body:
+
+ </p>
+ <div class="listing plain"><pre><b>void</b> roleMethod(<b>int</b> ir)
+ <b>when</b> (ir &gt; MyTeam.this.threshold) { <i>body statements</i> }</pre></div>
+ </div>
+ <div class="subsect depth4" id="s5.4.1.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Role level guards</span></h4>
+ <p>When a guard is specified at the role level, i.e., directly before the
+ class body of a role class, it applies to all callin method bindings of
+ the role class:
+
+ </p>
+ <div class="listing plain"><pre><b>protected</b> <b>class</b> MyRole
+ <b>when</b> (value &gt; MyTeam.this.threshold)
+{
+ <b>int</b> value;
+ <i>other <b>class</b> body declarations</i>
+}</pre></div>
+ <p>The following values are within the scope of the predicate expression:
+
+ </p>
+ <ul>
+ <li>The role instance denoted by <code>this</code> (explicit or implicit, see above).
+ Thus, in the example <code>value</code> will be interpreted as a field of the enclosing role.
+
+ </li>
+ <li>The team instance denoted by a qualified this reference as in <code>MyTeam.this</code></li>
+ </ul>
+ </div>
+ <div class="subsect depth4" id="s5.4.1.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Team level guards</span></h4>
+ <p>A guard specified in the header of a team class may disable the callin
+ bindings of all contained role classes. The syntax corresponds to the syntax
+ of role level guards.<br />
+ The only value directly available within team level guard is the
+ team instance (denoted by <code>this</code>) and its features.
+
+ </p>
+ </div>
+ <p>Of course all guards can also access any visible static feature of a visible class.
+
+ </p>
+ <p>Even if a guard has no direct effect, because, e.g., a role class has no callin
+ bindings (maybe not even a role-base binding), predicates at such abstract
+ levels are useful, because all predicates are inherited by all sub classes
+ (explicit and implicit).
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s5.4.c.html" rel="prev">&lt;&lt;&nbsp;&sect;5.4.(c)&nbsp;Exceptions</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s5.4.2.html" rel="next">&sect;5.4.2&nbsp;Base guards&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s5.html" rel="section">&sect;5&nbsp;Team Activation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.4.html" rel="section">&sect;5.4&nbsp;Guard predicates</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.4.2.a.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.4.2.a.html
new file mode 100644
index 000000000..99dfebc6a
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.4.2.a.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s5.4.2.b.html" rel="next">&sect;5.4.2.(b)&nbsp;Method binding guards&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s5.html" rel="section">&sect;5&nbsp;Team Activation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.4.html" rel="section">&sect;5.4&nbsp;Guard predicates</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.4.2.html" rel="section">&sect;5.4.2&nbsp;Base guards</a></div>
+ <div class="subsect depth4" id="s5.4.2.a">
+ <h4 class="subsect">&sect;5.4.2.(a)&nbsp;<span class="title">Base object reference</span></h4>
+ <p>In all base guard predicates the special identifier <code>base</code>
+ can be used to denote the base object that is about to be lifted.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s5.4.2.b.html" rel="next">&sect;5.4.2.(b)&nbsp;Method binding guards&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s5.html" rel="section">&sect;5&nbsp;Team Activation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.4.html" rel="section">&sect;5.4&nbsp;Guard predicates</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.4.2.html" rel="section">&sect;5.4.2&nbsp;Base guards</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.4.2.b.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.4.2.b.html
new file mode 100644
index 000000000..0ef3ff379
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.4.2.b.html
@@ -0,0 +1,56 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s5.4.2.a.html" rel="prev">&lt;&lt;&nbsp;&sect;5.4.2.(a)&nbsp;Base object reference</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s5.4.2.c.html" rel="next">&sect;5.4.2.(c)&nbsp;Method guards&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s5.html" rel="section">&sect;5&nbsp;Team Activation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.4.html" rel="section">&sect;5.4&nbsp;Guard predicates</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.4.2.html" rel="section">&sect;5.4.2&nbsp;Base guards</a></div>
+ <div class="subsect depth4" id="s5.4.2.b">
+ <h4 class="subsect">&sect;5.4.2.(b)&nbsp;<span class="title">Method binding guards</span></h4>
+ <p>A base method binding guard may access parameters as passed to the
+ base method. Parameter mappings are not considered.<br />
+ Additionally, for <code>after</code> callin bindings, the identifier <code>result</code>
+ may be used to refer to the result of the base method (if any).
+
+ </p>
+ <div class="note">
+ <h5>Note:</h5>
+ <p>In order to achieve the same effect of accessing
+ the base method's result, a regular binding guard (not a base guard)
+ must use a suitable parameter mapping (see <a href="s4.4.c.html"
+ title="&sect;4.4.(c)&nbsp;Mapping the result of a base method"
+ class="sect">&sect;4.4.(c)</a>).
+
+ </p>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s5.4.2.a.html" rel="prev">&lt;&lt;&nbsp;&sect;5.4.2.(a)&nbsp;Base object reference</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s5.4.2.c.html" rel="next">&sect;5.4.2.(c)&nbsp;Method guards&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s5.html" rel="section">&sect;5&nbsp;Team Activation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.4.html" rel="section">&sect;5.4&nbsp;Guard predicates</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.4.2.html" rel="section">&sect;5.4.2&nbsp;Base guards</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.4.2.c.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.4.2.c.html
new file mode 100644
index 000000000..87bb82e8b
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.4.2.c.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s5.4.2.b.html" rel="prev">&lt;&lt;&nbsp;&sect;5.4.2.(b)&nbsp;Method binding guards</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s5.4.2.d.html" rel="next">&sect;5.4.2.(d)&nbsp;Role level guards&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s5.html" rel="section">&sect;5&nbsp;Team Activation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.4.html" rel="section">&sect;5.4&nbsp;Guard predicates</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.4.2.html" rel="section">&sect;5.4.2&nbsp;Base guards</a></div>
+ <div class="subsect depth4" id="s5.4.2.c">
+ <h4 class="subsect">&sect;5.4.2.(c)&nbsp;<span class="title">Method guards</span></h4>
+ <p>In contrast to regular method guards, a <em>base</em> guard attached to a role method
+ cannot access any method parameters. See the next item (d) for values that are actually in scope.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s5.4.2.b.html" rel="prev">&lt;&lt;&nbsp;&sect;5.4.2.(b)&nbsp;Method binding guards</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s5.4.2.d.html" rel="next">&sect;5.4.2.(d)&nbsp;Role level guards&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s5.html" rel="section">&sect;5&nbsp;Team Activation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.4.html" rel="section">&sect;5.4&nbsp;Guard predicates</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.4.2.html" rel="section">&sect;5.4.2&nbsp;Base guards</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.4.2.d.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.4.2.d.html
new file mode 100644
index 000000000..8addfdde0
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.4.2.d.html
@@ -0,0 +1,49 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s5.4.2.c.html" rel="prev">&lt;&lt;&nbsp;&sect;5.4.2.(c)&nbsp;Method guards</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s5.4.2.e.html" rel="next">&sect;5.4.2.(e)&nbsp;Team level guards&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s5.html" rel="section">&sect;5&nbsp;Team Activation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.4.html" rel="section">&sect;5.4&nbsp;Guard predicates</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.4.2.html" rel="section">&sect;5.4.2&nbsp;Base guards</a></div>
+ <div class="subsect depth4" id="s5.4.2.d">
+ <h4 class="subsect">&sect;5.4.2.(d)&nbsp;<span class="title">Role level guards</span></h4>
+ <p>Role level base guards may use these values:
+
+ </p>
+ <ul>
+ <li>The base instance using the special identifier <code>base</code>.
+ </li>
+ <li>The team instance using a qualified this references (<code>MyTeam.this</code>).
+ </li>
+ </ul>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s5.4.2.c.html" rel="prev">&lt;&lt;&nbsp;&sect;5.4.2.(c)&nbsp;Method guards</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s5.4.2.e.html" rel="next">&sect;5.4.2.(e)&nbsp;Team level guards&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s5.html" rel="section">&sect;5&nbsp;Team Activation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.4.html" rel="section">&sect;5.4&nbsp;Guard predicates</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.4.2.html" rel="section">&sect;5.4.2&nbsp;Base guards</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.4.2.e.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.4.2.e.html
new file mode 100644
index 000000000..36a3ee344
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.4.2.e.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s5.4.2.d.html" rel="prev">&lt;&lt;&nbsp;&sect;5.4.2.(d)&nbsp;Role level guards</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s5.4.2.f.html" rel="next">&sect;5.4.2.(f)&nbsp;Unbound roles&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s5.html" rel="section">&sect;5&nbsp;Team Activation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.4.html" rel="section">&sect;5.4&nbsp;Guard predicates</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.4.2.html" rel="section">&sect;5.4.2&nbsp;Base guards</a></div>
+ <div class="subsect depth4" id="s5.4.2.e">
+ <h4 class="subsect">&sect;5.4.2.(e)&nbsp;<span class="title">Team level guards</span></h4>
+ <p>Team level base guards have the same scope as role level base guards (d).
+ However, the type of the role instance is not known here, i.e., here <code>base</code>
+ has the static type <code>java.lang.Object</code>.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s5.4.2.d.html" rel="prev">&lt;&lt;&nbsp;&sect;5.4.2.(d)&nbsp;Role level guards</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s5.4.2.f.html" rel="next">&sect;5.4.2.(f)&nbsp;Unbound roles&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s5.html" rel="section">&sect;5&nbsp;Team Activation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.4.html" rel="section">&sect;5.4&nbsp;Guard predicates</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.4.2.html" rel="section">&sect;5.4.2&nbsp;Base guards</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.4.2.f.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.4.2.f.html
new file mode 100644
index 000000000..8d1298023
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.4.2.f.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s5.4.2.e.html" rel="prev">&lt;&lt;&nbsp;&sect;5.4.2.(e)&nbsp;Team level guards</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s5.html" rel="section">&sect;5&nbsp;Team Activation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.4.html" rel="section">&sect;5.4&nbsp;Guard predicates</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.4.2.html" rel="section">&sect;5.4.2&nbsp;Base guards</a></div>
+ <div class="subsect depth4" id="s5.4.2.f">
+ <h4 class="subsect">&sect;5.4.2.(f)&nbsp;<span class="title">Unbound roles</span></h4>
+ <p>In contrast to regular guards, base guards cannot be attached to
+ unbound role classes nor to their methods.<br />
+ Only team level base guards are independent of role binding.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s5.4.2.e.html" rel="prev">&lt;&lt;&nbsp;&sect;5.4.2.(e)&nbsp;Team level guards</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s5.html" rel="section">&sect;5&nbsp;Team Activation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.4.html" rel="section">&sect;5.4&nbsp;Guard predicates</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.4.2.html" rel="section">&sect;5.4.2&nbsp;Base guards</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.4.2.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.4.2.html
new file mode 100644
index 000000000..995e54cb8
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.4.2.html
@@ -0,0 +1,137 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s5.4.1.html" rel="prev">&lt;&lt;&nbsp;&sect;5.4.1&nbsp;Regular guards</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s5.4.3.html" rel="next">&sect;5.4.3&nbsp;Multiple guards&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s5.html" rel="section">&sect;5&nbsp;Team Activation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.4.html" rel="section">&sect;5.4&nbsp;Guard predicates</a></div>
+ <div class="sect depth3" id="s5.4.2">
+ <h3 class="sect">&sect;5.4.2&nbsp;Base guards</h3>
+ <p>The intention behind base guards is to prevent lifting of a callin-target
+ if a guard evaluates to <code>false</code> and thus refuses to invoke the
+ callin bound role method. Using base guards it is easier to prevent any
+ side-effects caused by a callin binding, because lifting could cause side-effects
+ at two levels:
+
+ </p>
+ <ul>
+ <li>Creating a role on-demand already is a side-effect (observable e.g.
+ by the reflective function <code><a href="s6.1.html" title="&sect;6.1&nbsp;Reflection" class="sect">hasRole (&sect;6.1)</a></code>)
+
+ </li>
+ <li>Role creation triggers execution of a role constructor
+ (see <a href="s2.3.1.c.html"
+ title="&sect;2.3.1.(c)&nbsp;Custom lifting constructor"
+ class="sect">custom lifting constructor (&sect;2.3.1.(c))</a>)
+ which could produce arbitrary side-effects.
+
+ </li>
+ </ul>
+ <p>Both kinds of side-effects can be avoided using a base guard which prevents
+ unnecessary lifting.
+
+ </p>
+ <p>Any guard (5.4.1 (b)-(e)) can be turned into a base guard by adding
+ the modifier <code>base</code> as in:
+
+ </p>
+ <div class="listing plain"><pre><b>protected</b> <b>class</b> MyRole <b>playedBy</b> MyBase
+ <em><b>base</b> when</em> (base.value &gt; MyTeam.this.threshold)
+{
+ <i><b>class</b> body declarations</i>
+}</pre></div>
+ <p>However, different scoping rules apply for the identifiers
+ that can be used in a base guard:
+
+ </p>
+ <div class="subsect depth4" id="s5.4.2.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Base object reference</span></h4>
+ <p>In all base guard predicates the special identifier <code>base</code>
+ can be used to denote the base object that is about to be lifted.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s5.4.2.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Method binding guards</span></h4>
+ <p>A base method binding guard may access parameters as passed to the
+ base method. Parameter mappings are not considered.<br />
+ Additionally, for <code>after</code> callin bindings, the identifier <code>result</code>
+ may be used to refer to the result of the base method (if any).
+
+ </p>
+ <div class="note">
+ <h5>Note:</h5>
+ <p>In order to achieve the same effect of accessing
+ the base method's result, a regular binding guard (not a base guard)
+ must use a suitable parameter mapping (see <a href="s4.4.c.html"
+ title="&sect;4.4.(c)&nbsp;Mapping the result of a base method"
+ class="sect">&sect;4.4.(c)</a>).
+
+ </p>
+ </div>
+ </div>
+ <div class="subsect depth4" id="s5.4.2.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Method guards</span></h4>
+ <p>In contrast to regular method guards, a <em>base</em> guard attached to a role method
+ cannot access any method parameters. See the next item (d) for values that are actually in scope.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s5.4.2.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Role level guards</span></h4>
+ <p>Role level base guards may use these values:
+
+ </p>
+ <ul>
+ <li>The base instance using the special identifier <code>base</code>.
+ </li>
+ <li>The team instance using a qualified this references (<code>MyTeam.this</code>).
+ </li>
+ </ul>
+ </div>
+ <div class="subsect depth4" id="s5.4.2.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Team level guards</span></h4>
+ <p>Team level base guards have the same scope as role level base guards (d).
+ However, the type of the role instance is not known here, i.e., here <code>base</code>
+ has the static type <code>java.lang.Object</code>.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s5.4.2.f">
+ <h4 class="subsect">(f)&nbsp;<span class="title">Unbound roles</span></h4>
+ <p>In contrast to regular guards, base guards cannot be attached to
+ unbound role classes nor to their methods.<br />
+ Only team level base guards are independent of role binding.
+
+ </p>
+ </div><img src="../images/guards.png" alt="Overview: Guard predicates" /></div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s5.4.1.html" rel="prev">&lt;&lt;&nbsp;&sect;5.4.1&nbsp;Regular guards</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s5.4.3.html" rel="next">&sect;5.4.3&nbsp;Multiple guards&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s5.html" rel="section">&sect;5&nbsp;Team Activation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.4.html" rel="section">&sect;5.4&nbsp;Guard predicates</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.4.3.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.4.3.html
new file mode 100644
index 000000000..b9f82430b
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.4.3.html
@@ -0,0 +1,130 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s5.4.2.html" rel="prev">&lt;&lt;&nbsp;&sect;5.4.2&nbsp;Base guards</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s5.html" rel="section">&sect;5&nbsp;Team Activation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.4.html" rel="section">&sect;5.4&nbsp;Guard predicates</a></div>
+ <div class="sect depth3" id="s5.4.3">
+ <h3 class="sect">&sect;5.4.3&nbsp;Multiple guards</h3>
+ <p>Due to the different ranges of applicability different guards may affect the same method binding.
+ In that case all applicable guards are conjoined using a logical <code>and</code>.<br />
+ Any guard is interpreted as the conjunction of these predicates (if present):
+
+ </p>
+ <ul>
+ <li>The direct predicate expression of the guard.</li>
+ <li>The next outer guard along the chain
+ <em>method binding -&gt; method -&gt; role level -&gt; team level</em></li>
+ <li>The guard at the same level that is inherited from the <em>implicit</em> super role.
+ </li>
+ <li>The guard at the same level that is inherited from the <em>explicit</em> super role.
+ </li>
+ </ul>
+ <h5 class="listing">Example code (Guard Predicates):</h5>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> ATM {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>private</b> Bank myBank;</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>public</b> <b>class</b> ForeignAccount <b>playedBy</b> Account</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <em><b>base</b> when</em> (!ATM.this.myBank.equals(<em>base</em>.getBank()))</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> <b>callin</b> <b>void</b> debitWithFee(<b>int</b> amount) {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> base.debitWithFee(fee+amount);</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre> <b>void</b> debitWithFee(<b>int</b> i) <b>&lt;-</b> <b>replace</b> <b>void</b> debit(<b>int</b> amount)</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">10</td>
+ <td><pre> <em><b>base</b> when</em> (amount &lt; 1000);</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">11</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">12</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="codecomment">
+ <h5>Effects:</h5>
+ The team in this example causes that an additional fee has to be payed while debiting
+ less than 1000 Euros from a "foreign" account.
+
+ <ul>
+ <li>The base guard in line 4 ensures that <code>Account</code> objects only get
+ <code>ForeignAccount</code> roles, if they belong to a different bank than the
+ surrounding <code>ATM</code> team.<br />
+ It accesses the bank of the base via the <code>base</code> identifier.
+
+ </li>
+ <li>The method binding guard in line 10 restricts the callin to
+ <code>debitWithFee</code> to calls where the base method argument
+ <code>amount</code> is lower than 1000.
+
+ </li>
+ <li>A call to <code>Account.debit</code> causes a replace callin to
+ <code>debitWithFee</code><em> only</em> if <em>both</em> predicates evaluate to true.
+
+ </li>
+ </ul>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s5.4.2.html" rel="prev">&lt;&lt;&nbsp;&sect;5.4.2&nbsp;Base guards</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s5.html" rel="section">&sect;5&nbsp;Team Activation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.4.html" rel="section">&sect;5.4&nbsp;Guard predicates</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.4.a.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.4.a.html
new file mode 100644
index 000000000..3e8a3d607
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.4.a.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s5.4.b.html" rel="next">&sect;5.4.(b)&nbsp;No side effects&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s5.html" rel="section">&sect;5&nbsp;Team Activation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.4.html" rel="section">&sect;5.4&nbsp;Guard predicates</a></div>
+ <div class="subsect depth3" id="s5.4.a">
+ <h4 class="subsect">&sect;5.4.(a)&nbsp;<span class="title">General syntax for guards</span></h4>
+ <p>A guard is declared using the keyword <code>when</code> followed by a
+ boolean expression in parentheses:
+
+ </p>
+ <div class="listing plain"><pre><em><b>when</b> (</em><i>predicateExpression</i><em>)</em></pre></div>
+ <p>Depending on the kind of guard different objects are in scope using
+ special identifiers like <code>this</code>, <code>base</code>.<br />
+ Any predicate expression that evaluates to <code>true</code> enables
+ the callin binding(s) to which it applies.
+ Evaluation to <code>false</code> disables the callin binding(s).
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s5.4.b.html" rel="next">&sect;5.4.(b)&nbsp;No side effects&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s5.html" rel="section">&sect;5&nbsp;Team Activation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.4.html" rel="section">&sect;5.4&nbsp;Guard predicates</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.4.b.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.4.b.html
new file mode 100644
index 000000000..90198ae2a
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.4.b.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s5.4.a.html" rel="prev">&lt;&lt;&nbsp;&sect;5.4.(a)&nbsp;General syntax for guards</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s5.4.c.html" rel="next">&sect;5.4.(c)&nbsp;Exceptions&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s5.html" rel="section">&sect;5&nbsp;Team Activation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.4.html" rel="section">&sect;5.4&nbsp;Guard predicates</a></div>
+ <div class="subsect depth3" id="s5.4.b">
+ <h4 class="subsect">&sect;5.4.(b)&nbsp;<span class="title">No side effects</span></h4>
+ <p>A guard predicate should have no side effects.
+ A compiler should optionally check this condition, but inter-procedural analysis
+ actually depends on the availability of appropriate means to mark any method as side-effect free.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s5.4.a.html" rel="prev">&lt;&lt;&nbsp;&sect;5.4.(a)&nbsp;General syntax for guards</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s5.4.c.html" rel="next">&sect;5.4.(c)&nbsp;Exceptions&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s5.html" rel="section">&sect;5&nbsp;Team Activation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.4.html" rel="section">&sect;5.4&nbsp;Guard predicates</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.4.c.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.4.c.html
new file mode 100644
index 000000000..f8a33e477
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.4.c.html
@@ -0,0 +1,49 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s5.4.b.html" rel="prev">&lt;&lt;&nbsp;&sect;5.4.(b)&nbsp;No side effects</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s5.4.1.html" rel="next">&sect;5.4.1&nbsp;Regular guards&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s5.html" rel="section">&sect;5&nbsp;Team Activation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.4.html" rel="section">&sect;5.4&nbsp;Guard predicates</a></div>
+ <div class="subsect depth3" id="s5.4.c">
+ <h4 class="subsect">&sect;5.4.(c)&nbsp;<span class="title">Exceptions</span></h4>
+ <p>A guard predicate should not throw any exceptions.
+ Yet, any exception thrown within a guard predicate cause the guard to evaluate to <code>false</code>
+ rather than propagating the exception, meaning that the evaluation of a guard predicate will never
+ interrupt the current base behaviour.<br />
+ A compiler should flag any checked exception that is thrown within a guard.
+ Such diagnosis should by default be treated as an error, with the option of configuring
+ its severity to warning or ignore.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s5.4.b.html" rel="prev">&lt;&lt;&nbsp;&sect;5.4.(b)&nbsp;No side effects</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s5.4.1.html" rel="next">&sect;5.4.1&nbsp;Regular guards&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s5.html" rel="section">&sect;5&nbsp;Team Activation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s5.4.html" rel="section">&sect;5.4&nbsp;Guard predicates</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.4.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.4.html
new file mode 100644
index 000000000..6dddcdfc6
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.4.html
@@ -0,0 +1,376 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s5.3.html" rel="prev">&lt;&lt;&nbsp;&sect;5.3&nbsp;Implicit team activation</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s5.5.html" rel="next">&sect;5.5&nbsp;Unanticipated team activation&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s5.html" rel="section">&sect;5&nbsp;Team Activation</a></div>
+ <div class="sect depth2" id="s5.4">
+ <h2 class="sect">&sect;5.4&nbsp;Guard predicates</h2>
+ <div class="syntaxlink"><a href="sA.7.html" title="&sect;A.7&nbsp;Guard predicates" class="syntax">&rarr;&nbsp;Syntax&nbsp;&sect;A.7</a></div>
+ <p>The effect of callins can further be controlled using so called guard predicates.
+ Guards appear at four different levels:
+
+ </p>
+ <ul>
+ <li>callin method binding</li>
+ <li>role method</li>
+ <li>role class</li>
+ <li>team class</li>
+ </ul>
+ <p>Guards can be specified as <em>regular</em> guards or <code>base</code> guards,
+ which affects the exact point in the control flow, where the guard will be evaluated.
+
+ </p>
+ <div class="subsect depth3" id="s5.4.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">General syntax for guards</span></h4>
+ <p>A guard is declared using the keyword <code>when</code> followed by a
+ boolean expression in parentheses:
+
+ </p>
+ <div class="listing plain"><pre><em><b>when</b> (</em><i>predicateExpression</i><em>)</em></pre></div>
+ <p>Depending on the kind of guard different objects are in scope using
+ special identifiers like <code>this</code>, <code>base</code>.<br />
+ Any predicate expression that evaluates to <code>true</code> enables
+ the callin binding(s) to which it applies.
+ Evaluation to <code>false</code> disables the callin binding(s).
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s5.4.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">No side effects</span></h4>
+ <p>A guard predicate should have no side effects.
+ A compiler should optionally check this condition, but inter-procedural analysis
+ actually depends on the availability of appropriate means to mark any method as side-effect free.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s5.4.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Exceptions</span></h4>
+ <p>A guard predicate should not throw any exceptions.
+ Yet, any exception thrown within a guard predicate cause the guard to evaluate to <code>false</code>
+ rather than propagating the exception, meaning that the evaluation of a guard predicate will never
+ interrupt the current base behaviour.<br />
+ A compiler should flag any checked exception that is thrown within a guard.
+ Such diagnosis should by default be treated as an error, with the option of configuring
+ its severity to warning or ignore.
+
+ </p>
+ </div>
+ <div class="sect depth3" id="s5.4.1">
+ <h3 class="sect">&sect;5.4.1&nbsp;Regular guards<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;5.4</a></span></h3>
+ <p>This group of guards evaluates within the context of a given role.
+ These guards are evaluated <em>after</em> a callin target is lifted and
+ <em>before</em> a callin bound role method is invoked.
+
+ </p>
+ <div class="subsect depth4" id="s5.4.1.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Method binding guards</span></h4>
+ <p>A guard may be attached to a callin method binding as in:
+
+ </p>
+ <div class="listing plain"><pre><b>void</b> roleMethod(<b>int</b> ir) <b>&lt;-</b> <b>after</b> <b>void</b> baseMethod(<b>int</b> ib)
+ <b>when</b> (ir &gt; MyTeam.this.threshold);</pre></div>
+ <p>Such a guard only affects the callin binding to which it is attached,
+ i.e., this specific callin binding is only effective,
+ if the predicate evaluates to <code>true</code>.
+ <br />
+ The following values are within the scope of the predicate expression,
+ and thus can be used to express the condition:
+
+ </p>
+ <ul>
+ <li>The role instance denoted by <code>this</code>.<br />
+ Features of the role instance can also be accessed relative to
+ <code>this</code> with or without explicit qualifying <code>this</code>.
+
+ </li>
+ <li>The team instance denoted by a qualified this reference as in
+ <code>MyTeam.this</code>.
+
+ </li>
+ <li>If the callin binding includes signatures (as in the example above):
+ Parameters of the role method.<br />
+ If parameter mappings are involved, they will be evaluated before evaluating the guard.
+
+ </li>
+ </ul>
+ </div>
+ <div class="subsect depth4" id="s5.4.1.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Method guards</span></h4>
+ <p>A method guard is similar to a method binding guard, but it applies
+ to all callin method bindings of this method.<br />
+ A method guard is declared between the method signature and the method body:
+
+ </p>
+ <div class="listing plain"><pre><b>void</b> roleMethod(<b>int</b> ir)
+ <b>when</b> (ir &gt; MyTeam.this.threshold) { <i>body statements</i> }</pre></div>
+ </div>
+ <div class="subsect depth4" id="s5.4.1.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Role level guards</span></h4>
+ <p>When a guard is specified at the role level, i.e., directly before the
+ class body of a role class, it applies to all callin method bindings of
+ the role class:
+
+ </p>
+ <div class="listing plain"><pre><b>protected</b> <b>class</b> MyRole
+ <b>when</b> (value &gt; MyTeam.this.threshold)
+{
+ <b>int</b> value;
+ <i>other <b>class</b> body declarations</i>
+}</pre></div>
+ <p>The following values are within the scope of the predicate expression:
+
+ </p>
+ <ul>
+ <li>The role instance denoted by <code>this</code> (explicit or implicit, see above).
+ Thus, in the example <code>value</code> will be interpreted as a field of the enclosing role.
+
+ </li>
+ <li>The team instance denoted by a qualified this reference as in <code>MyTeam.this</code></li>
+ </ul>
+ </div>
+ <div class="subsect depth4" id="s5.4.1.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Team level guards</span></h4>
+ <p>A guard specified in the header of a team class may disable the callin
+ bindings of all contained role classes. The syntax corresponds to the syntax
+ of role level guards.<br />
+ The only value directly available within team level guard is the
+ team instance (denoted by <code>this</code>) and its features.
+
+ </p>
+ </div>
+ <p>Of course all guards can also access any visible static feature of a visible class.
+
+ </p>
+ <p>Even if a guard has no direct effect, because, e.g., a role class has no callin
+ bindings (maybe not even a role-base binding), predicates at such abstract
+ levels are useful, because all predicates are inherited by all sub classes
+ (explicit and implicit).
+
+ </p>
+ </div>
+ <div class="sect depth3" id="s5.4.2">
+ <h3 class="sect">&sect;5.4.2&nbsp;Base guards<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;5.4</a></span></h3>
+ <p>The intention behind base guards is to prevent lifting of a callin-target
+ if a guard evaluates to <code>false</code> and thus refuses to invoke the
+ callin bound role method. Using base guards it is easier to prevent any
+ side-effects caused by a callin binding, because lifting could cause side-effects
+ at two levels:
+
+ </p>
+ <ul>
+ <li>Creating a role on-demand already is a side-effect (observable e.g.
+ by the reflective function <code><a href="s6.1.html" title="&sect;6.1&nbsp;Reflection" class="sect">hasRole (&sect;6.1)</a></code>)
+
+ </li>
+ <li>Role creation triggers execution of a role constructor
+ (see <a href="s2.3.1.c.html"
+ title="&sect;2.3.1.(c)&nbsp;Custom lifting constructor"
+ class="sect">custom lifting constructor (&sect;2.3.1.(c))</a>)
+ which could produce arbitrary side-effects.
+
+ </li>
+ </ul>
+ <p>Both kinds of side-effects can be avoided using a base guard which prevents
+ unnecessary lifting.
+
+ </p>
+ <p>Any guard (5.4.1 (b)-(e)) can be turned into a base guard by adding
+ the modifier <code>base</code> as in:
+
+ </p>
+ <div class="listing plain"><pre><b>protected</b> <b>class</b> MyRole <b>playedBy</b> MyBase
+ <em><b>base</b> when</em> (base.value &gt; MyTeam.this.threshold)
+{
+ <i><b>class</b> body declarations</i>
+}</pre></div>
+ <p>However, different scoping rules apply for the identifiers
+ that can be used in a base guard:
+
+ </p>
+ <div class="subsect depth4" id="s5.4.2.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Base object reference</span></h4>
+ <p>In all base guard predicates the special identifier <code>base</code>
+ can be used to denote the base object that is about to be lifted.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s5.4.2.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Method binding guards</span></h4>
+ <p>A base method binding guard may access parameters as passed to the
+ base method. Parameter mappings are not considered.<br />
+ Additionally, for <code>after</code> callin bindings, the identifier <code>result</code>
+ may be used to refer to the result of the base method (if any).
+
+ </p>
+ <div class="note">
+ <h5>Note:</h5>
+ <p>In order to achieve the same effect of accessing
+ the base method's result, a regular binding guard (not a base guard)
+ must use a suitable parameter mapping (see <a href="s4.4.c.html"
+ title="&sect;4.4.(c)&nbsp;Mapping the result of a base method"
+ class="sect">&sect;4.4.(c)</a>).
+
+ </p>
+ </div>
+ </div>
+ <div class="subsect depth4" id="s5.4.2.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Method guards</span></h4>
+ <p>In contrast to regular method guards, a <em>base</em> guard attached to a role method
+ cannot access any method parameters. See the next item (d) for values that are actually in scope.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s5.4.2.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Role level guards</span></h4>
+ <p>Role level base guards may use these values:
+
+ </p>
+ <ul>
+ <li>The base instance using the special identifier <code>base</code>.
+ </li>
+ <li>The team instance using a qualified this references (<code>MyTeam.this</code>).
+ </li>
+ </ul>
+ </div>
+ <div class="subsect depth4" id="s5.4.2.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Team level guards</span></h4>
+ <p>Team level base guards have the same scope as role level base guards (d).
+ However, the type of the role instance is not known here, i.e., here <code>base</code>
+ has the static type <code>java.lang.Object</code>.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s5.4.2.f">
+ <h4 class="subsect">(f)&nbsp;<span class="title">Unbound roles</span></h4>
+ <p>In contrast to regular guards, base guards cannot be attached to
+ unbound role classes nor to their methods.<br />
+ Only team level base guards are independent of role binding.
+
+ </p>
+ </div><img src="../images/guards.png" alt="Overview: Guard predicates" /></div>
+ <div class="sect depth3" id="s5.4.3">
+ <h3 class="sect">&sect;5.4.3&nbsp;Multiple guards<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;5.4</a></span></h3>
+ <p>Due to the different ranges of applicability different guards may affect the same method binding.
+ In that case all applicable guards are conjoined using a logical <code>and</code>.<br />
+ Any guard is interpreted as the conjunction of these predicates (if present):
+
+ </p>
+ <ul>
+ <li>The direct predicate expression of the guard.</li>
+ <li>The next outer guard along the chain
+ <em>method binding -&gt; method -&gt; role level -&gt; team level</em></li>
+ <li>The guard at the same level that is inherited from the <em>implicit</em> super role.
+ </li>
+ <li>The guard at the same level that is inherited from the <em>explicit</em> super role.
+ </li>
+ </ul>
+ <h5 class="listing">Example code (Guard Predicates):</h5>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> ATM {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>private</b> Bank myBank;</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>public</b> <b>class</b> ForeignAccount <b>playedBy</b> Account</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <em><b>base</b> when</em> (!ATM.this.myBank.equals(<em>base</em>.getBank()))</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> <b>callin</b> <b>void</b> debitWithFee(<b>int</b> amount) {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> base.debitWithFee(fee+amount);</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre> <b>void</b> debitWithFee(<b>int</b> i) <b>&lt;-</b> <b>replace</b> <b>void</b> debit(<b>int</b> amount)</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">10</td>
+ <td><pre> <em><b>base</b> when</em> (amount &lt; 1000);</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">11</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">12</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="codecomment">
+ <h5>Effects:</h5>
+ The team in this example causes that an additional fee has to be payed while debiting
+ less than 1000 Euros from a "foreign" account.
+
+ <ul>
+ <li>The base guard in line 4 ensures that <code>Account</code> objects only get
+ <code>ForeignAccount</code> roles, if they belong to a different bank than the
+ surrounding <code>ATM</code> team.<br />
+ It accesses the bank of the base via the <code>base</code> identifier.
+
+ </li>
+ <li>The method binding guard in line 10 restricts the callin to
+ <code>debitWithFee</code> to calls where the base method argument
+ <code>amount</code> is lower than 1000.
+
+ </li>
+ <li>A call to <code>Account.debit</code> causes a replace callin to
+ <code>debitWithFee</code><em> only</em> if <em>both</em> predicates evaluate to true.
+
+ </li>
+ </ul>
+ </div>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s5.3.html" rel="prev">&lt;&lt;&nbsp;&sect;5.3&nbsp;Implicit team activation</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s5.5.html" rel="next">&sect;5.5&nbsp;Unanticipated team activation&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s5.html" rel="section">&sect;5&nbsp;Team Activation</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.5.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.5.html
new file mode 100644
index 000000000..4a9036ae1
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.5.html
@@ -0,0 +1,135 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s5.4.html" rel="prev">&lt;&lt;&nbsp;&sect;5.4&nbsp;Guard predicates</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s5.html" rel="section">&sect;5&nbsp;Team Activation</a></div>
+ <div class="sect depth2" id="s5.5">
+ <h2 class="sect">&sect;5.5&nbsp;Unanticipated team activation</h2>
+ <p>If an application should be adapted unanticipatedly by one or more teams,
+ this can be achieved without explicitly changing the program code of this application.
+
+ </p>
+ <p><span class="underline">General activation via config file:</span><br />
+ Instead of adding the team initialization
+ and activation code to the main program, it is possible to add the respective teams via a config file.
+ Every line of this text file contains the fully qualified name of a compiled team, which has to be available
+ on the classpath.
+ For the instantiation of these teams the default constructor is used, which means adding a team to
+ an application this way requires the team to provide a default constructor.
+ The activation order (see <a href="s5.1.html" title="&sect;5.1&nbsp;Effect of team activation"
+ class="sect">&sect;5.1</a>) for these teams corresponds to the order
+ in which they are listed in the config file.<br />
+ Lines starting with a '#' denote comment lines.
+
+ </p>
+ <h5 class="listing">Example config file:</h5>
+ <div class="listing config frame"><pre><span class="comment"># Config file for an ObjectTeams application:</span>
+<em>mypackage1.MyTeam1</em>
+<span class="comment"># ...</span>
+<em>mypackageM.MyTeamN</em></pre></div>
+ <p>To get this config file recognized by the application the VM argument<br /><strong>'-Dot.teamconfig=&lt;<em>config_file_name</em>&gt;'</strong><br />
+ has to be used when starting the application.
+
+ </p>
+ <div class="note">
+ <h5>Note:</h5>
+ In the ObjectTeams Development Tooling (OTDT) teams are activated unanticipatedly
+ via a special tab in the "Run-Configuration" (see <a href="http://www.objectteams.org/distrib/features.html#execution" class="ext">OTDT features</a>), instead.
+
+ </div>
+ <p><span class="underline">Activation adjustment example:</span><br />
+ Teams added via the config file mechanism are activated by default. Because no reference to them is
+ stored anywhere, it is not possible to deactivate them later.
+ If deactivation of unanticipated added teams is required, this can be achieved by adding a manager team
+ via config file and encapsulate the actual functionality in another team managed by the manager team.
+ This way a functional team can be activated and deactivated as needed.
+
+ </p>
+ <h5 class="listing">Example code (Activation Adjustment):</h5>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> MyManagerTeam {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>private</b> FunctionalTeam myFunctionalTeam = <b>new</b> FunctionalTeam();</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>protected</b> <b>class</b> MyRole <b>playedBy</b> MyApplication {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <b>void</b> startAdaption() { myFunctionalTeam.activate(); }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> startAdaption <b>&lt;-</b> <b>before</b> startMethod;</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> <b>void</b> stopAdaption() { myFunctionalTeam.deactivate(); }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> stopAdaption <b>&lt;-</b> <b>after</b> stopMethod;</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="listing config frame"><pre><span class="comment"># Config file for the manager team example:</span>
+<em>MyManagerTeam</em></pre></div>
+ <div class="codecomment">
+ <h5>Effects:</h5>
+ <ul>
+ <li><code>startMethod</code> and <code>stopMethod</code> are methods which demand
+ the activation and deactivation respectively.
+
+ </li>
+ <li>If the activation/deactivation depends on other conditions these can be checked in addition.
+
+ </li>
+ </ul>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s5.4.html" rel="prev">&lt;&lt;&nbsp;&sect;5.4&nbsp;Guard predicates</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s5.html" rel="section">&sect;5&nbsp;Team Activation</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.html
new file mode 100644
index 000000000..84e709322
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s5.html
@@ -0,0 +1,669 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s4.html" rel="prev">&lt;&lt;&nbsp;&sect;4&nbsp;Callin Binding</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s6.html" rel="next">&sect;6&nbsp;Object Teams API&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"></div>
+ <div class="chapter" id="s5">
+ <div class="headl">
+ <div class="headr">
+ <h1>&sect;5&nbsp;Team Activation</h1>
+ </div>
+ </div>
+ <div id="toc-box">
+ <ul class="toc-box">
+ <li><a href="s5.html">&sect;5&nbsp;Team Activation</a></li>
+ <li><a href="#s5.1">&sect;5.1&nbsp;Effect of team activation</a></li>
+ <li><a href="#s5.2">&sect;5.2&nbsp;Explicit team activation</a></li>
+ <li><a href="#s5.3">&sect;5.3&nbsp;Implicit team activation</a></li>
+ <li><a href="#s5.4">&sect;5.4&nbsp;Guard predicates</a></li>
+ <li><a href="#s5.5">&sect;5.5&nbsp;Unanticipated team activation</a></li>
+ </ul>
+ </div>
+ <div class="intro">
+ <h3>The concept of Activation</h3>
+ <div class="line"></div>
+ <div class="term">Binding activation</div>
+ <div class="termdesc">All <strong>callin</strong> bindings of a team only have effect if
+ the team is <strong>active</strong>. Activation may be caused by explicit
+ statements and also happens implicitly at certain points
+ during program execution.
+ </div>
+ <div class="line"></div>
+ <div class="term">Guard predicates</div>
+ <div class="termdesc">Callin bindings can further be controlled using guard predicates,
+ which can be attached to roles and teams at different levels. If a guard
+ predicate evaluates to <code>false</code>, all affected callin bindings
+ are disabled.
+ </div>
+ <div class="line"></div>
+ </div>
+ <div class="sect depth2" id="s5.1">
+ <h2 class="sect">&sect;5.1&nbsp;Effect of team activation<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;5</a></span></h2>
+ <p>Activating a team instance has the effect of enabling all its callin bindings.
+ All effects defined in <a href="s4.html" title="&sect;4&nbsp;Callin Binding" class="sect">&sect;4</a> apply only if a corresponding
+ team instance is active.<br />
+ The <strong>order</strong> of team activation controls the order of callin executions.
+ If more than one team intercepts calls to the same base method, the most recently activated
+ team has highest priority in that its before or replace callins are executed first while its after
+ callins are executed last.
+
+ </p>
+ <div class="sect depth3" id="s5.1.1">
+ <h3 class="sect">&sect;5.1.1&nbsp;Global vs. thread local team activation<span class="toplink"><a href="#s5.1">&uarr;&nbsp;&sect;5.1</a></span></h3>
+ <p>While <strong>thread local</strong> activation only enables the callin bindings of
+ a team instance for a certain thread, <strong>global</strong> activation activates the
+ team instance for all threads of the application.
+
+ </p>
+ </div>
+ <div class="sect depth3" id="s5.1.2">
+ <h3 class="sect">&sect;5.1.2&nbsp;Effect on garbage collection<span class="toplink"><a href="#s5.1">&uarr;&nbsp;&sect;5.1</a></span></h3>
+ <p>Any active team is referenced by internal infrastructure.
+ Thus, a team cannot be reclaimed by the garbage collector while it is active.
+
+ </p>
+ </div>
+ </div>
+ <div class="sect depth2" id="s5.2">
+ <h2 class="sect">&sect;5.2&nbsp;Explicit team activation<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;5</a></span></h2>
+ <div class="subsect depth3" id="s5.2.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Activation block</span></h4>
+ <p>A team can be activated thread local by the block construct</p>
+ <div class="listing plain"><pre><b>within</b> (myTeam) { <i>stmts</i> }</pre></div>
+ <p>If <em>stmts</em> has only one statement this can be abbreviated to
+ </p>
+ <div class="listing plain"><pre><b>within</b> (myTeam) <i>stmt</i></pre></div>
+ <p>In these statements, <code>myTeam</code> must denote a team instance.
+ For the time of executing this block, this team instance is activated for the current thread,
+ which has entered the within block.
+
+ </p>
+ <p>The <code>within</code> block statement guarantees that it leaves
+ the team in exactly the same activation state as it was in when
+ entering this block. This includes the cases of exceptions, meaning
+ that deactivation will also occur if the execution of the block
+ terminates abnormally.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s5.2.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Imperative activation</span></h4>
+ <p>Each team class implicitly provides methods from the predefined interface
+ <code>org.objectteams.ITeam</code> (super interface of all team classes) to control team
+ activation disregarding the block structure of the program. The methods <code>activate()</code>
+ and <code>deactivate()</code> are used to activate and deactivate a team instance for
+ the current thread.<br />
+ If a team should be de-/activated for another thread this can be done by the methods
+ <code>activate(Thread aThread)</code> and <code>deactivate(Thread aThread)</code>.
+ In order to achieve global activation for all threads the predefined constant
+ <code>org.objectteams.Team.ALL_THREADS</code> is passed to these methods (e.g.
+ <code>activate(Team.ALL_THREADS)</code>).<br />
+ Note, that this methods make no guarantees with respect to exceptions.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s5.2.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Multiple and mixed activations</span></h4>
+ <ul>
+ <li>If <code>activate()</code> is invoked on a team instance
+ that has been explicitly activated before, this statement has
+ no effect at all (note the difference in <a href="#s5.3.a" title="&sect;5.3.(a)&nbsp;Team level methods" class="sect">&sect;5.3.(a)</a> below).
+ <br />
+ The same applies to deactivating an inactive team.
+ </li>
+ <li>If a team was already active when entering a <code>within</code>
+ block, it will remain active after leaving the block.
+ </li>
+ <li>If the team was active on entry of a <code>within</code> block
+ and if <code>deactivate()</code> is invoked on the same team
+ instance from within the <code>within</code> block,
+ leaving the block will re-activate the team.
+ </li>
+ </ul>
+ </div>
+ </div>
+ <div class="sect depth2" id="s5.3">
+ <h2 class="sect">&sect;5.3&nbsp;Implicit team activation<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;5</a></span></h2>
+ <p>Implicit team activation is intended to ensure that
+ whenever the control flow is passed to a team or one of its roles,
+ the team is implicitly activated for the current thread.
+ Implicit activation can be configured at different levels (see <a href="#s5.3.d" title="&sect;5.3.(d)&nbsp;Configuring implicit activation"
+ class="sect">&sect;5.3.(d)</a>).
+
+ </p>
+ <p>When implicit activation is enabled a programmer may assume,
+ that whenever a role forwards calls to its base object via callout,
+ the callin bindings of the same role will be active at that time.
+ Exceptions to this rule have to be programmed explicitly.
+
+ </p>
+ <div class="subsect depth3" id="s5.3.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Team level methods</span></h4>
+ <p>While executing a <strong>team level method</strong>, the target team
+ is always active. Activation is reset to the previous state
+ when leaving the team method, unless the team has been explicitly activated during
+ execution of the team method by a call to <code>activate()</code>.
+ Explicit activation is stronger than implicit activation and thus persists after the
+ team level method terminates. Ie., leaving a team level method will never reset
+ an explicit activation.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s5.3.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Methods of externalized roles</span></h4>
+ <p>Invoking a method on an <strong>externalized role</strong>
+ (see <a href="s1.2.2.html" title="&sect;1.2.2&nbsp;Externalized roles" class="sect">&sect;1.2.2</a>) also has the
+ effect of temporary activation of the team containing the role for the current thread.
+ Regarding deactivation the rule of <a href="#s5.3.a" title="&sect;5.3.(a)&nbsp;Team level methods" class="sect">&sect;5.3.(a)</a> above applies accordingly.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s5.3.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Nested teams</span></h4>
+ <p>Implicit activation has additional consequences for nested teams
+ (see <a href="s1.5.html" title="&sect;1.5&nbsp;Team and role nesting" class="sect">&sect;1.5</a>):
+
+ </p>
+ <ul>
+ <li>Implicit activation of a team causes the activation of its outer teams.</li>
+ <li>Implicit deactivation of a team causes the deactivation of its inner teams.</li>
+ </ul>
+ </div>
+ <div class="subsect depth3" id="s5.3.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Configuring implicit activation</span></h4>
+ <p>Implicit activation is disabled by default and can be enabled by adding the annotation
+ <code>@org.objectteams.ImplicitTeamActivation</code>, which can be applied to a type or a method.
+ When applied to a method it is ensured that invoking this method will trigger implicit activation.
+ When the annotation is applied to a type this has the same effect as applying it to all externally
+ visible methods of the type. Member types are not affected and have to be annotated separately.
+ </p>
+ <p>The runtime environment can be configured globally by defining the system property
+ <code>ot.implicit.team.activation</code> to one of these values:
+ </p>
+ <dl>
+ <dt>NEVER</dt>
+ <dd>Implicit activation is completely disabled.</dd>
+ <dt>ANNOTATED</dt>
+ <dd>This is the default: implicit activation applies only where declared by <code>@ImplicitTeamActivation</code>.
+ </dd>
+ <dt>ALWAYS</dt>
+ <dd>Implicit activation applies to all externally visible methods (this was the default in OTJLD versions &le;1.2)</dd>
+ </dl>
+ </div>
+ <p>Note that among the different mechanisms for activation, <code>within</code> is strongest,
+ followed by <code>(de)activate()</code>, weakest is implicit activation. In this sense,
+ explicit imperative (de)activation may override the block structure of implicit activation
+ (by explicit activation within a team level method), but not that of a <code>within</code>
+ block (by deactivation from a within block).
+
+ </p>
+ </div>
+ <div class="sect depth2" id="s5.4">
+ <h2 class="sect">&sect;5.4&nbsp;Guard predicates<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;5</a></span></h2>
+ <div class="syntaxlink"><a href="sA.7.html" title="&sect;A.7&nbsp;Guard predicates" class="syntax">&rarr;&nbsp;Syntax&nbsp;&sect;A.7</a></div>
+ <p>The effect of callins can further be controlled using so called guard predicates.
+ Guards appear at four different levels:
+
+ </p>
+ <ul>
+ <li>callin method binding</li>
+ <li>role method</li>
+ <li>role class</li>
+ <li>team class</li>
+ </ul>
+ <p>Guards can be specified as <em>regular</em> guards or <code>base</code> guards,
+ which affects the exact point in the control flow, where the guard will be evaluated.
+
+ </p>
+ <div class="subsect depth3" id="s5.4.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">General syntax for guards</span></h4>
+ <p>A guard is declared using the keyword <code>when</code> followed by a
+ boolean expression in parentheses:
+
+ </p>
+ <div class="listing plain"><pre><em><b>when</b> (</em><i>predicateExpression</i><em>)</em></pre></div>
+ <p>Depending on the kind of guard different objects are in scope using
+ special identifiers like <code>this</code>, <code>base</code>.<br />
+ Any predicate expression that evaluates to <code>true</code> enables
+ the callin binding(s) to which it applies.
+ Evaluation to <code>false</code> disables the callin binding(s).
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s5.4.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">No side effects</span></h4>
+ <p>A guard predicate should have no side effects.
+ A compiler should optionally check this condition, but inter-procedural analysis
+ actually depends on the availability of appropriate means to mark any method as side-effect free.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s5.4.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Exceptions</span></h4>
+ <p>A guard predicate should not throw any exceptions.
+ Yet, any exception thrown within a guard predicate cause the guard to evaluate to <code>false</code>
+ rather than propagating the exception, meaning that the evaluation of a guard predicate will never
+ interrupt the current base behaviour.<br />
+ A compiler should flag any checked exception that is thrown within a guard.
+ Such diagnosis should by default be treated as an error, with the option of configuring
+ its severity to warning or ignore.
+
+ </p>
+ </div>
+ <div class="sect depth3" id="s5.4.1">
+ <h3 class="sect">&sect;5.4.1&nbsp;Regular guards<span class="toplink"><a href="#s5.4">&uarr;&nbsp;&sect;5.4</a></span></h3>
+ <p>This group of guards evaluates within the context of a given role.
+ These guards are evaluated <em>after</em> a callin target is lifted and
+ <em>before</em> a callin bound role method is invoked.
+
+ </p>
+ <div class="subsect depth4" id="s5.4.1.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Method binding guards</span></h4>
+ <p>A guard may be attached to a callin method binding as in:
+
+ </p>
+ <div class="listing plain"><pre><b>void</b> roleMethod(<b>int</b> ir) <b>&lt;-</b> <b>after</b> <b>void</b> baseMethod(<b>int</b> ib)
+ <b>when</b> (ir &gt; MyTeam.this.threshold);</pre></div>
+ <p>Such a guard only affects the callin binding to which it is attached,
+ i.e., this specific callin binding is only effective,
+ if the predicate evaluates to <code>true</code>.
+ <br />
+ The following values are within the scope of the predicate expression,
+ and thus can be used to express the condition:
+
+ </p>
+ <ul>
+ <li>The role instance denoted by <code>this</code>.<br />
+ Features of the role instance can also be accessed relative to
+ <code>this</code> with or without explicit qualifying <code>this</code>.
+
+ </li>
+ <li>The team instance denoted by a qualified this reference as in
+ <code>MyTeam.this</code>.
+
+ </li>
+ <li>If the callin binding includes signatures (as in the example above):
+ Parameters of the role method.<br />
+ If parameter mappings are involved, they will be evaluated before evaluating the guard.
+
+ </li>
+ </ul>
+ </div>
+ <div class="subsect depth4" id="s5.4.1.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Method guards</span></h4>
+ <p>A method guard is similar to a method binding guard, but it applies
+ to all callin method bindings of this method.<br />
+ A method guard is declared between the method signature and the method body:
+
+ </p>
+ <div class="listing plain"><pre><b>void</b> roleMethod(<b>int</b> ir)
+ <b>when</b> (ir &gt; MyTeam.this.threshold) { <i>body statements</i> }</pre></div>
+ </div>
+ <div class="subsect depth4" id="s5.4.1.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Role level guards</span></h4>
+ <p>When a guard is specified at the role level, i.e., directly before the
+ class body of a role class, it applies to all callin method bindings of
+ the role class:
+
+ </p>
+ <div class="listing plain"><pre><b>protected</b> <b>class</b> MyRole
+ <b>when</b> (value &gt; MyTeam.this.threshold)
+{
+ <b>int</b> value;
+ <i>other <b>class</b> body declarations</i>
+}</pre></div>
+ <p>The following values are within the scope of the predicate expression:
+
+ </p>
+ <ul>
+ <li>The role instance denoted by <code>this</code> (explicit or implicit, see above).
+ Thus, in the example <code>value</code> will be interpreted as a field of the enclosing role.
+
+ </li>
+ <li>The team instance denoted by a qualified this reference as in <code>MyTeam.this</code></li>
+ </ul>
+ </div>
+ <div class="subsect depth4" id="s5.4.1.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Team level guards</span></h4>
+ <p>A guard specified in the header of a team class may disable the callin
+ bindings of all contained role classes. The syntax corresponds to the syntax
+ of role level guards.<br />
+ The only value directly available within team level guard is the
+ team instance (denoted by <code>this</code>) and its features.
+
+ </p>
+ </div>
+ <p>Of course all guards can also access any visible static feature of a visible class.
+
+ </p>
+ <p>Even if a guard has no direct effect, because, e.g., a role class has no callin
+ bindings (maybe not even a role-base binding), predicates at such abstract
+ levels are useful, because all predicates are inherited by all sub classes
+ (explicit and implicit).
+
+ </p>
+ </div>
+ <div class="sect depth3" id="s5.4.2">
+ <h3 class="sect">&sect;5.4.2&nbsp;Base guards<span class="toplink"><a href="#s5.4">&uarr;&nbsp;&sect;5.4</a></span></h3>
+ <p>The intention behind base guards is to prevent lifting of a callin-target
+ if a guard evaluates to <code>false</code> and thus refuses to invoke the
+ callin bound role method. Using base guards it is easier to prevent any
+ side-effects caused by a callin binding, because lifting could cause side-effects
+ at two levels:
+
+ </p>
+ <ul>
+ <li>Creating a role on-demand already is a side-effect (observable e.g.
+ by the reflective function <code><a href="s6.1.html" title="&sect;6.1&nbsp;Reflection" class="sect">hasRole (&sect;6.1)</a></code>)
+
+ </li>
+ <li>Role creation triggers execution of a role constructor
+ (see <a href="s2.3.1.c.html"
+ title="&sect;2.3.1.(c)&nbsp;Custom lifting constructor"
+ class="sect">custom lifting constructor (&sect;2.3.1.(c))</a>)
+ which could produce arbitrary side-effects.
+
+ </li>
+ </ul>
+ <p>Both kinds of side-effects can be avoided using a base guard which prevents
+ unnecessary lifting.
+
+ </p>
+ <p>Any guard (5.4.1 (b)-(e)) can be turned into a base guard by adding
+ the modifier <code>base</code> as in:
+
+ </p>
+ <div class="listing plain"><pre><b>protected</b> <b>class</b> MyRole <b>playedBy</b> MyBase
+ <em><b>base</b> when</em> (base.value &gt; MyTeam.this.threshold)
+{
+ <i><b>class</b> body declarations</i>
+}</pre></div>
+ <p>However, different scoping rules apply for the identifiers
+ that can be used in a base guard:
+
+ </p>
+ <div class="subsect depth4" id="s5.4.2.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Base object reference</span></h4>
+ <p>In all base guard predicates the special identifier <code>base</code>
+ can be used to denote the base object that is about to be lifted.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s5.4.2.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Method binding guards</span></h4>
+ <p>A base method binding guard may access parameters as passed to the
+ base method. Parameter mappings are not considered.<br />
+ Additionally, for <code>after</code> callin bindings, the identifier <code>result</code>
+ may be used to refer to the result of the base method (if any).
+
+ </p>
+ <div class="note">
+ <h5>Note:</h5>
+ <p>In order to achieve the same effect of accessing
+ the base method's result, a regular binding guard (not a base guard)
+ must use a suitable parameter mapping (see <a href="s4.4.c.html"
+ title="&sect;4.4.(c)&nbsp;Mapping the result of a base method"
+ class="sect">&sect;4.4.(c)</a>).
+
+ </p>
+ </div>
+ </div>
+ <div class="subsect depth4" id="s5.4.2.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Method guards</span></h4>
+ <p>In contrast to regular method guards, a <em>base</em> guard attached to a role method
+ cannot access any method parameters. See the next item (d) for values that are actually in scope.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s5.4.2.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Role level guards</span></h4>
+ <p>Role level base guards may use these values:
+
+ </p>
+ <ul>
+ <li>The base instance using the special identifier <code>base</code>.
+ </li>
+ <li>The team instance using a qualified this references (<code>MyTeam.this</code>).
+ </li>
+ </ul>
+ </div>
+ <div class="subsect depth4" id="s5.4.2.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Team level guards</span></h4>
+ <p>Team level base guards have the same scope as role level base guards (d).
+ However, the type of the role instance is not known here, i.e., here <code>base</code>
+ has the static type <code>java.lang.Object</code>.
+
+ </p>
+ </div>
+ <div class="subsect depth4" id="s5.4.2.f">
+ <h4 class="subsect">(f)&nbsp;<span class="title">Unbound roles</span></h4>
+ <p>In contrast to regular guards, base guards cannot be attached to
+ unbound role classes nor to their methods.<br />
+ Only team level base guards are independent of role binding.
+
+ </p>
+ </div><img src="../images/guards.png" alt="Overview: Guard predicates" /></div>
+ <div class="sect depth3" id="s5.4.3">
+ <h3 class="sect">&sect;5.4.3&nbsp;Multiple guards<span class="toplink"><a href="#s5.4">&uarr;&nbsp;&sect;5.4</a></span></h3>
+ <p>Due to the different ranges of applicability different guards may affect the same method binding.
+ In that case all applicable guards are conjoined using a logical <code>and</code>.<br />
+ Any guard is interpreted as the conjunction of these predicates (if present):
+
+ </p>
+ <ul>
+ <li>The direct predicate expression of the guard.</li>
+ <li>The next outer guard along the chain
+ <em>method binding -&gt; method -&gt; role level -&gt; team level</em></li>
+ <li>The guard at the same level that is inherited from the <em>implicit</em> super role.
+ </li>
+ <li>The guard at the same level that is inherited from the <em>explicit</em> super role.
+ </li>
+ </ul>
+ <h5 class="listing">Example code (Guard Predicates):</h5>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> ATM {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>private</b> Bank myBank;</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>public</b> <b>class</b> ForeignAccount <b>playedBy</b> Account</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <em><b>base</b> when</em> (!ATM.this.myBank.equals(<em>base</em>.getBank()))</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> <b>callin</b> <b>void</b> debitWithFee(<b>int</b> amount) {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> base.debitWithFee(fee+amount);</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre> <b>void</b> debitWithFee(<b>int</b> i) <b>&lt;-</b> <b>replace</b> <b>void</b> debit(<b>int</b> amount)</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">10</td>
+ <td><pre> <em><b>base</b> when</em> (amount &lt; 1000);</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">11</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">12</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="codecomment">
+ <h5>Effects:</h5>
+ The team in this example causes that an additional fee has to be payed while debiting
+ less than 1000 Euros from a "foreign" account.
+
+ <ul>
+ <li>The base guard in line 4 ensures that <code>Account</code> objects only get
+ <code>ForeignAccount</code> roles, if they belong to a different bank than the
+ surrounding <code>ATM</code> team.<br />
+ It accesses the bank of the base via the <code>base</code> identifier.
+
+ </li>
+ <li>The method binding guard in line 10 restricts the callin to
+ <code>debitWithFee</code> to calls where the base method argument
+ <code>amount</code> is lower than 1000.
+
+ </li>
+ <li>A call to <code>Account.debit</code> causes a replace callin to
+ <code>debitWithFee</code><em> only</em> if <em>both</em> predicates evaluate to true.
+
+ </li>
+ </ul>
+ </div>
+ </div>
+ </div>
+ <div class="sect depth2" id="s5.5">
+ <h2 class="sect">&sect;5.5&nbsp;Unanticipated team activation<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;5</a></span></h2>
+ <p>If an application should be adapted unanticipatedly by one or more teams,
+ this can be achieved without explicitly changing the program code of this application.
+
+ </p>
+ <p><span class="underline">General activation via config file:</span><br />
+ Instead of adding the team initialization
+ and activation code to the main program, it is possible to add the respective teams via a config file.
+ Every line of this text file contains the fully qualified name of a compiled team, which has to be available
+ on the classpath.
+ For the instantiation of these teams the default constructor is used, which means adding a team to
+ an application this way requires the team to provide a default constructor.
+ The activation order (see <a href="#s5.1" title="&sect;5.1&nbsp;Effect of team activation" class="sect">&sect;5.1</a>) for these teams corresponds to the order
+ in which they are listed in the config file.<br />
+ Lines starting with a '#' denote comment lines.
+
+ </p>
+ <h5 class="listing">Example config file:</h5>
+ <div class="listing config frame"><pre><span class="comment"># Config file for an ObjectTeams application:</span>
+<em>mypackage1.MyTeam1</em>
+<span class="comment"># ...</span>
+<em>mypackageM.MyTeamN</em></pre></div>
+ <p>To get this config file recognized by the application the VM argument<br /><strong>'-Dot.teamconfig=&lt;<em>config_file_name</em>&gt;'</strong><br />
+ has to be used when starting the application.
+
+ </p>
+ <div class="note">
+ <h5>Note:</h5>
+ In the ObjectTeams Development Tooling (OTDT) teams are activated unanticipatedly
+ via a special tab in the "Run-Configuration" (see <a href="http://www.objectteams.org/distrib/features.html#execution" class="ext">OTDT features</a>), instead.
+
+ </div>
+ <p><span class="underline">Activation adjustment example:</span><br />
+ Teams added via the config file mechanism are activated by default. Because no reference to them is
+ stored anywhere, it is not possible to deactivate them later.
+ If deactivation of unanticipated added teams is required, this can be achieved by adding a manager team
+ via config file and encapsulate the actual functionality in another team managed by the manager team.
+ This way a functional team can be activated and deactivated as needed.
+
+ </p>
+ <h5 class="listing">Example code (Activation Adjustment):</h5>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> MyManagerTeam {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>private</b> FunctionalTeam myFunctionalTeam = <b>new</b> FunctionalTeam();</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>protected</b> <b>class</b> MyRole <b>playedBy</b> MyApplication {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <b>void</b> startAdaption() { myFunctionalTeam.activate(); }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> startAdaption <b>&lt;-</b> <b>before</b> startMethod;</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> <b>void</b> stopAdaption() { myFunctionalTeam.deactivate(); }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> stopAdaption <b>&lt;-</b> <b>after</b> stopMethod;</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="listing config frame"><pre><span class="comment"># Config file for the manager team example:</span>
+<em>MyManagerTeam</em></pre></div>
+ <div class="codecomment">
+ <h5>Effects:</h5>
+ <ul>
+ <li><code>startMethod</code> and <code>stopMethod</code> are methods which demand
+ the activation and deactivation respectively.
+
+ </li>
+ <li>If the activation/deactivation depends on other conditions these can be checked in addition.
+
+ </li>
+ </ul>
+ </div>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s4.html" rel="prev">&lt;&lt;&nbsp;&sect;4&nbsp;Callin Binding</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s6.html" rel="next">&sect;6&nbsp;Object Teams API&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s6.1.a.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s6.1.a.html
new file mode 100644
index 000000000..b1334cceb
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s6.1.a.html
@@ -0,0 +1,181 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s6.1.b.html" rel="next">&sect;6.1.(b)&nbsp;Behavioral reflection&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s6.html" rel="section">&sect;6&nbsp;Object Teams API</a>&nbsp;&gt;&nbsp;<a class="nav" href="s6.1.html" rel="section">&sect;6.1&nbsp;Reflection</a></div>
+ <div class="subsect depth3" id="s6.1.a">
+ <h4 class="subsect">&sect;6.1.(a)&nbsp;<span class="title">Interface to the role registry</span></h4>
+ <p>Each team instance internally has a registry of known role objects indexed by their base object.
+ Programmers may make use of this registry using the following reflective methods defined in
+ <code>org.objectteams.ITeam</code>:
+
+ </p>
+ <dl>
+ <dt><code>boolean hasRole ( Object aBase ) ;</code></dt>
+ <dd>This method checks whether a role for the passed base object already exists in the target team.
+
+ </dd>
+ <dt><code>boolean hasRole ( Object aBase, Class expectedRole ) ;</code></dt>
+ <dd>This method checks whether a instance of type <code>expectedRole</code> as a role for the passed base object
+ <code>aBase</code> already exists in the target team.
+ The role may also be of any subtype of the specified role type.
+
+ </dd>
+ <dt><code>Object getRole ( Object aBase ) ;</code></dt>
+ <dd>If the passed base object <code>aBase</code> already has a role in the target team, this role is returned.
+ Otherwise <code>null</code> is returned.
+
+ </dd>
+ <dt><code>&lt;T&gt; T getRole ( Object aBase, Class&lt;T&gt; expectedRole ) ;</code></dt>
+ <dd>If the passed base object <code>aBase</code> already has a role in the target team that is assignable to the type represented by <code>expectedRole</code>,
+ this role is returned. Otherwise <code>null</code> is returned.
+
+ </dd>
+ <dt><code>Object[] getAllRoles () ;</code></dt>
+ <dd>Retrieves all existing (registered) <a href="s2.1.a.html" title="&sect;2.1.(a)&nbsp;Role-base binding"
+ class="sect">bound roles (&sect;2.1.(a))</a> in the target team.
+ <br />
+ This method uses internal structures of weak references. For that reason it may return role instances which were about
+ to be reclaimed by the garbage collector. If performance permits, it is thus advisable to always call <code>System.gc()</code>
+ prior to calling <code>getAllRoles()</code> in order to achieve deterministic results (see also <a href="s2.1.f.html" title="&sect;2.1.(f)&nbsp;Effect on garbage collection"
+ class="sect">&sect;2.1.(f)</a>).
+
+ </dd>
+ <dt><code>&lt;T&gt; T[] getAllRoles ( Class&lt;T&gt; expectedRole ) ;</code></dt>
+ <dd>Retrieves all existing (registered) <a href="s2.1.a.html" title="&sect;2.1.(a)&nbsp;Role-base binding"
+ class="sect">bound roles (&sect;2.1.(a))</a> in the target team that are assignable to the type represented by <code>expectedRole</code>.
+ Class <code>expectedRole</code> must be a bound role otherwise an <code>IllegalArgumentException</code> is thrown.
+ <br />
+ See the note about garbage collection above.
+
+ </dd>
+ <dt><code>void unregisterRole ( Object aRole ) ;</code></dt>
+ <dd>This method unregisters the passed role object from the target team. Thus the corresponding base looses this role.
+ After calling this method the role should no longer be used.
+
+ </dd>
+ <dt><code>void unregisterRole ( Object aRole, Class roleClass ) ;</code></dt>
+ <dd>This method unregisters the passed role object from the target team. Thus the corresponding base looses this role.
+ After calling this method the role should no longer be used.
+ The only difference to the previous method is improved speed because no search for the corresponding registry
+ has to be performed.
+
+ </dd>
+ </dl>
+ <p>It is desirable and possible to use these methods within guards (see <a href="s5.4.html" title="&sect;5.4&nbsp;Guard predicates" class="sect">&sect;5.4</a>).
+ These methods allow to write the specification of guards in a more concise and more expressive way. Determined by the signature,
+
+ the first four methods can only be used in a base-level guard (<a href="s5.4.2.html" title="&sect;5.4.2&nbsp;Base guards" class="sect">&sect;5.4.2</a>) because they require a reference to a base object.
+
+ </p>
+ <h5 class="listing">Example code (Guards and Reflection):</h5>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> SpecialConditions {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>public</b> <b>void</b> participate(Account <b>as</b> BonusAccount ba) {}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>public</b> <b>class</b> BonusAccount <b>playedBy</b> Account</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <b>base</b> when(SpecialConditions.this.<em>hasRole</em>(base, BonusAccount.class))</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> <b>callin</b> <b>void</b> creditBonus(<b>int</b> amount) {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> base.creditBonus(amount + bonus);</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre> <b>void</b> creditBonus(<b>int</b> amount) <b>&lt;-</b> <b>replace</b> <b>void</b> credit(<b>int</b> i)</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">10</td>
+ <td><pre> <b>base</b> <b>when</b> (i &gt; 1000);</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">11</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">12</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="codecomment">
+ <h5>Effects:</h5>
+ This teams provides a bonus system for registered <code>Account</code>s. Every time an amount of more than 1000 is
+ deposited to a registered account, additional 1% of the amount is credited.
+
+ <ul>
+ <li>The team level method <code>participate</code> in line 2 uses declared lifting (see <a href="s2.3.2.html" title="&sect;2.3.2&nbsp;Declared lifting" class="sect">&sect;2.3.2</a>)
+ to allow the passed <code>Account</code> object to participate the bonus system provided by the
+ <code>SpecialConditions</code> team.
+
+ </li>
+ <li>The base guard in line 4 uses the reflective method <code>hasRole</code> to check whether the base object already has a role
+ of type <code>BonusAccount</code> in the surrounding team. The expression <code>BonusAccount.class</code> returns
+ the <code>java.lang.Class</code> object representing the role <code>BonusAccount</code>
+ (see <a href="http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#251530"
+ class="ext">JLS &sect;15.8.2</a>).
+ This guard ensures, that only accounts explicitly registered via <code>participate</code> are ever decorated with a role of type <code>BonusAccount</code>.
+
+ </li>
+ <li>The method binding guard in line 10 restricts the callin to <code>creditBonus</code> to calls where
+ the base method argument <code>amount</code> is greater than 1000.
+
+ </li>
+ </ul>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s6.1.b.html" rel="next">&sect;6.1.(b)&nbsp;Behavioral reflection&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s6.html" rel="section">&sect;6&nbsp;Object Teams API</a>&nbsp;&gt;&nbsp;<a class="nav" href="s6.1.html" rel="section">&sect;6.1&nbsp;Reflection</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s6.1.b.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s6.1.b.html
new file mode 100644
index 000000000..64182259d
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s6.1.b.html
@@ -0,0 +1,60 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s6.1.a.html" rel="prev">&lt;&lt;&nbsp;&sect;6.1.(a)&nbsp;Interface to the role registry</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s6.1.c.html" rel="next">&sect;6.1.(c)&nbsp;Class literals for roles&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s6.html" rel="section">&sect;6&nbsp;Object Teams API</a>&nbsp;&gt;&nbsp;<a class="nav" href="s6.1.html" rel="section">&sect;6.1&nbsp;Reflection</a></div>
+ <div class="subsect depth3" id="s6.1.b">
+ <h4 class="subsect">&sect;6.1.(b)&nbsp;<span class="title">Behavioral reflection</span></h4>
+ <p>The following reflective methods defined in org.objectteams.ITeam can be used to
+ inspect the dynamic behavior of a team:
+
+ </p>
+ <dl>
+ <dt><code>boolean isExecutingCallin () ;</code></dt>
+ <dd>This method is used to inspect whether a control flow has already been intercepted by at least one callin binding of the current
+ team.
+ It can be used to avoid undesirable re-entrance to a team.
+
+ </dd>
+ <dt><code>boolean isActive () ;</code></dt>
+ <dd>This method checks whether the team instance is active for the current thread.
+
+ </dd>
+ <dt><code>boolean isActive ( Thread aThread ) ;</code></dt>
+ <dd>This method checks whether the team instance is active for the thread <code>aThread</code>.
+
+ </dd>
+ </dl>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s6.1.a.html" rel="prev">&lt;&lt;&nbsp;&sect;6.1.(a)&nbsp;Interface to the role registry</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s6.1.c.html" rel="next">&sect;6.1.(c)&nbsp;Class literals for roles&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s6.html" rel="section">&sect;6&nbsp;Object Teams API</a>&nbsp;&gt;&nbsp;<a class="nav" href="s6.1.html" rel="section">&sect;6.1&nbsp;Reflection</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s6.1.c.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s6.1.c.html
new file mode 100644
index 000000000..123420c88
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s6.1.c.html
@@ -0,0 +1,57 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s6.1.b.html" rel="prev">&lt;&lt;&nbsp;&sect;6.1.(b)&nbsp;Behavioral reflection</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s6.html" rel="section">&sect;6&nbsp;Object Teams API</a>&nbsp;&gt;&nbsp;<a class="nav" href="s6.1.html" rel="section">&sect;6.1&nbsp;Reflection</a></div>
+ <div class="subsect depth3" id="s6.1.c">
+ <h4 class="subsect">&sect;6.1.(c)&nbsp;<span class="title">Class literals for roles</span></h4>
+ <p>The Java syntax for so-called class literals, <code>MyClass<strong>.class</strong></code>
+ (see <a href="http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#251530"
+ class="ext">JLS &sect;15.8.2</a>)
+ can be used for role types with slightly changed semantics: Role types are virtual types (<a href="s1.3.1.html"
+ title="&sect;1.3.1&nbsp;Acquisition and implicit inheritance of role classes"
+ class="sect">&sect;1.3.1</a>)
+ that are bound dynamically (<a href="s1.3.1.e.html" title="&sect;1.3.1.(e)&nbsp;Dynamic binding of types"
+ class="sect">&sect;1.3.1.(e)</a>). This applies to role class literals, too.
+ From this follows the constraint that a role class literal can only be used within the non-static context of a team,
+ ie., for evaluating a role class literal an enclosing team instance must be in scope.
+ <br />
+ Unlike regular type checking for role types, the class literal itself does not have a dependent type.
+ Thus type checking of calls to methods like <code>hasRole(Object, Class)</code> cannot detect, whether the <code>Class</code> instance
+ has actually been obtained from the correct team instance. Any attempt to pass a class that is not known
+ as a bound role within the given team results in an <code>IllegalArgumentException</code> at run-time.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s6.1.b.html" rel="prev">&lt;&lt;&nbsp;&sect;6.1.(b)&nbsp;Behavioral reflection</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s6.html" rel="section">&sect;6&nbsp;Object Teams API</a>&nbsp;&gt;&nbsp;<a class="nav" href="s6.1.html" rel="section">&sect;6.1&nbsp;Reflection</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s6.1.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s6.1.html
new file mode 100644
index 000000000..655996d64
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s6.1.html
@@ -0,0 +1,230 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s6.2.html" rel="next">&sect;6.2&nbsp;Other API Elements&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s6.html" rel="section">&sect;6&nbsp;Object Teams API</a></div>
+ <div class="sect depth2" id="s6.1">
+ <h2 class="sect">&sect;6.1&nbsp;Reflection</h2>
+ <p>Object Teams supports reflection with respect to teams, roles, and role-base relationships.
+
+ </p>
+ <div class="subsect depth3" id="s6.1.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Interface to the role registry</span></h4>
+ <p>Each team instance internally has a registry of known role objects indexed by their base object.
+ Programmers may make use of this registry using the following reflective methods defined in
+ <code>org.objectteams.ITeam</code>:
+
+ </p>
+ <dl>
+ <dt><code>boolean hasRole ( Object aBase ) ;</code></dt>
+ <dd>This method checks whether a role for the passed base object already exists in the target team.
+
+ </dd>
+ <dt><code>boolean hasRole ( Object aBase, Class expectedRole ) ;</code></dt>
+ <dd>This method checks whether a instance of type <code>expectedRole</code> as a role for the passed base object
+ <code>aBase</code> already exists in the target team.
+ The role may also be of any subtype of the specified role type.
+
+ </dd>
+ <dt><code>Object getRole ( Object aBase ) ;</code></dt>
+ <dd>If the passed base object <code>aBase</code> already has a role in the target team, this role is returned.
+ Otherwise <code>null</code> is returned.
+
+ </dd>
+ <dt><code>&lt;T&gt; T getRole ( Object aBase, Class&lt;T&gt; expectedRole ) ;</code></dt>
+ <dd>If the passed base object <code>aBase</code> already has a role in the target team that is assignable to the type represented by <code>expectedRole</code>,
+ this role is returned. Otherwise <code>null</code> is returned.
+
+ </dd>
+ <dt><code>Object[] getAllRoles () ;</code></dt>
+ <dd>Retrieves all existing (registered) <a href="s2.1.a.html" title="&sect;2.1.(a)&nbsp;Role-base binding"
+ class="sect">bound roles (&sect;2.1.(a))</a> in the target team.
+ <br />
+ This method uses internal structures of weak references. For that reason it may return role instances which were about
+ to be reclaimed by the garbage collector. If performance permits, it is thus advisable to always call <code>System.gc()</code>
+ prior to calling <code>getAllRoles()</code> in order to achieve deterministic results (see also <a href="s2.1.f.html" title="&sect;2.1.(f)&nbsp;Effect on garbage collection"
+ class="sect">&sect;2.1.(f)</a>).
+
+ </dd>
+ <dt><code>&lt;T&gt; T[] getAllRoles ( Class&lt;T&gt; expectedRole ) ;</code></dt>
+ <dd>Retrieves all existing (registered) <a href="s2.1.a.html" title="&sect;2.1.(a)&nbsp;Role-base binding"
+ class="sect">bound roles (&sect;2.1.(a))</a> in the target team that are assignable to the type represented by <code>expectedRole</code>.
+ Class <code>expectedRole</code> must be a bound role otherwise an <code>IllegalArgumentException</code> is thrown.
+ <br />
+ See the note about garbage collection above.
+
+ </dd>
+ <dt><code>void unregisterRole ( Object aRole ) ;</code></dt>
+ <dd>This method unregisters the passed role object from the target team. Thus the corresponding base looses this role.
+ After calling this method the role should no longer be used.
+
+ </dd>
+ <dt><code>void unregisterRole ( Object aRole, Class roleClass ) ;</code></dt>
+ <dd>This method unregisters the passed role object from the target team. Thus the corresponding base looses this role.
+ After calling this method the role should no longer be used.
+ The only difference to the previous method is improved speed because no search for the corresponding registry
+ has to be performed.
+
+ </dd>
+ </dl>
+ <p>It is desirable and possible to use these methods within guards (see <a href="s5.4.html" title="&sect;5.4&nbsp;Guard predicates" class="sect">&sect;5.4</a>).
+ These methods allow to write the specification of guards in a more concise and more expressive way. Determined by the signature,
+
+ the first four methods can only be used in a base-level guard (<a href="s5.4.2.html" title="&sect;5.4.2&nbsp;Base guards" class="sect">&sect;5.4.2</a>) because they require a reference to a base object.
+
+ </p>
+ <h5 class="listing">Example code (Guards and Reflection):</h5>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> SpecialConditions {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>public</b> <b>void</b> participate(Account <b>as</b> BonusAccount ba) {}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>public</b> <b>class</b> BonusAccount <b>playedBy</b> Account</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <b>base</b> when(SpecialConditions.this.<em>hasRole</em>(base, BonusAccount.class))</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> <b>callin</b> <b>void</b> creditBonus(<b>int</b> amount) {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> base.creditBonus(amount + bonus);</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre> <b>void</b> creditBonus(<b>int</b> amount) <b>&lt;-</b> <b>replace</b> <b>void</b> credit(<b>int</b> i)</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">10</td>
+ <td><pre> <b>base</b> <b>when</b> (i &gt; 1000);</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">11</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">12</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="codecomment">
+ <h5>Effects:</h5>
+ This teams provides a bonus system for registered <code>Account</code>s. Every time an amount of more than 1000 is
+ deposited to a registered account, additional 1% of the amount is credited.
+
+ <ul>
+ <li>The team level method <code>participate</code> in line 2 uses declared lifting (see <a href="s2.3.2.html" title="&sect;2.3.2&nbsp;Declared lifting" class="sect">&sect;2.3.2</a>)
+ to allow the passed <code>Account</code> object to participate the bonus system provided by the
+ <code>SpecialConditions</code> team.
+
+ </li>
+ <li>The base guard in line 4 uses the reflective method <code>hasRole</code> to check whether the base object already has a role
+ of type <code>BonusAccount</code> in the surrounding team. The expression <code>BonusAccount.class</code> returns
+ the <code>java.lang.Class</code> object representing the role <code>BonusAccount</code>
+ (see <a href="http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#251530"
+ class="ext">JLS &sect;15.8.2</a>).
+ This guard ensures, that only accounts explicitly registered via <code>participate</code> are ever decorated with a role of type <code>BonusAccount</code>.
+
+ </li>
+ <li>The method binding guard in line 10 restricts the callin to <code>creditBonus</code> to calls where
+ the base method argument <code>amount</code> is greater than 1000.
+
+ </li>
+ </ul>
+ </div>
+ </div>
+ <div class="subsect depth3" id="s6.1.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Behavioral reflection</span></h4>
+ <p>The following reflective methods defined in org.objectteams.ITeam can be used to
+ inspect the dynamic behavior of a team:
+
+ </p>
+ <dl>
+ <dt><code>boolean isExecutingCallin () ;</code></dt>
+ <dd>This method is used to inspect whether a control flow has already been intercepted by at least one callin binding of the current
+ team.
+ It can be used to avoid undesirable re-entrance to a team.
+
+ </dd>
+ <dt><code>boolean isActive () ;</code></dt>
+ <dd>This method checks whether the team instance is active for the current thread.
+
+ </dd>
+ <dt><code>boolean isActive ( Thread aThread ) ;</code></dt>
+ <dd>This method checks whether the team instance is active for the thread <code>aThread</code>.
+
+ </dd>
+ </dl>
+ </div>
+ <div class="subsect depth3" id="s6.1.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Class literals for roles</span></h4>
+ <p>The Java syntax for so-called class literals, <code>MyClass<strong>.class</strong></code>
+ (see <a href="http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#251530"
+ class="ext">JLS &sect;15.8.2</a>)
+ can be used for role types with slightly changed semantics: Role types are virtual types (<a href="s1.3.1.html"
+ title="&sect;1.3.1&nbsp;Acquisition and implicit inheritance of role classes"
+ class="sect">&sect;1.3.1</a>)
+ that are bound dynamically (<a href="s1.3.1.e.html" title="&sect;1.3.1.(e)&nbsp;Dynamic binding of types"
+ class="sect">&sect;1.3.1.(e)</a>). This applies to role class literals, too.
+ From this follows the constraint that a role class literal can only be used within the non-static context of a team,
+ ie., for evaluating a role class literal an enclosing team instance must be in scope.
+ <br />
+ Unlike regular type checking for role types, the class literal itself does not have a dependent type.
+ Thus type checking of calls to methods like <code>hasRole(Object, Class)</code> cannot detect, whether the <code>Class</code> instance
+ has actually been obtained from the correct team instance. Any attempt to pass a class that is not known
+ as a bound role within the given team results in an <code>IllegalArgumentException</code> at run-time.
+
+ </p>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s6.2.html" rel="next">&sect;6.2&nbsp;Other API Elements&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s6.html" rel="section">&sect;6&nbsp;Object Teams API</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s6.2.a.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s6.2.a.html
new file mode 100644
index 000000000..160295552
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s6.2.a.html
@@ -0,0 +1,70 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s6.2.b.html" rel="next">&sect;6.2.(b)&nbsp;Interface for explicit lowering&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s6.html" rel="section">&sect;6&nbsp;Object Teams API</a>&nbsp;&gt;&nbsp;<a class="nav" href="s6.2.html" rel="section">&sect;6.2&nbsp;Other API Elements</a></div>
+ <div class="subsect depth3" id="s6.2.a">
+ <h4 class="subsect">&sect;6.2.(a)&nbsp;<span class="title">Interfaces for role encapsulation</span></h4>
+ <p>A set of pre-defined types exist that do <span class="underline">not</span> extend <code>java.lang.Object</code>
+ and have <span class="underline">no</span> features except the operators <code>==</code> and <code>!=</code>.
+
+ </p>
+ <div class="note">
+ <h5>Note:</h5>
+ The JLS defines that each interface declares all methods defined in <code>java.lang.Object</code>
+ (<a href="http://java.sun.com/docs/books/jls/second_edition/html/interfaces.doc.html#32392"
+ class="ext">JLS &sect;9.2</a>)
+ and also each object referenced by an interface type can be widened to <code>java.lang.Object</code>.
+ Compilers commonly implement this by declaring <code>java.lang.Object</code> the super-type of all interfaces.
+ Such implementation has no visible difference with respect to the more complex definition in the JLS.
+
+ </div>
+ <p>These predefined types are
+
+ </p>
+ <dl>
+ <dt><code>org.objectteams.IConfined</code></dt>
+ <dd>regular interface</dd>
+ <dt><code>org.objectteams.ITeam.IConfined</code></dt>
+ <dd>role interface</dd>
+ <dt><code>org.objectteams.Team.Confined</code></dt>
+ <dd>role class</dd>
+ </dl>
+ <p>These types provide no new functionality but inheriting from these types influences the semantics with respect to encapsulation.
+
+ The purpose and usage of these types is described in <a href="s7.html" title="&sect;7&nbsp;Role Encapsulation" class="sect">&sect;7</a>.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s6.2.b.html" rel="next">&sect;6.2.(b)&nbsp;Interface for explicit lowering&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s6.html" rel="section">&sect;6&nbsp;Object Teams API</a>&nbsp;&gt;&nbsp;<a class="nav" href="s6.2.html" rel="section">&sect;6.2&nbsp;Other API Elements</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s6.2.b.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s6.2.b.html
new file mode 100644
index 000000000..3a97e4cb8
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s6.2.b.html
@@ -0,0 +1,51 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s6.2.a.html" rel="prev">&lt;&lt;&nbsp;&sect;6.2.(a)&nbsp;Interfaces for role encapsulation</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s6.2.c.html" rel="next">&sect;6.2.(c)&nbsp;Team activation methods&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s6.html" rel="section">&sect;6&nbsp;Object Teams API</a>&nbsp;&gt;&nbsp;<a class="nav" href="s6.2.html" rel="section">&sect;6.2&nbsp;Other API Elements</a></div>
+ <div class="subsect depth3" id="s6.2.b">
+ <h4 class="subsect">&sect;6.2.(b)&nbsp;<span class="title">Interface for explicit lowering</span></h4>
+ <p>The following role interface exists for the purpose of allowing explicit lowering:
+
+ </p>
+ <dl>
+ <dt><code>org.objectteams.ITeam.ILowerable</code></dt>
+ <dd>role interface</dd>
+ </dl>
+ <p>This interface was introduced in detail in <a href="s2.2.d.html" title="&sect;2.2.(d)&nbsp;Explicit lowering"
+ class="sect">&sect;2.2.(d)</a>.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s6.2.a.html" rel="prev">&lt;&lt;&nbsp;&sect;6.2.(a)&nbsp;Interfaces for role encapsulation</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s6.2.c.html" rel="next">&sect;6.2.(c)&nbsp;Team activation methods&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s6.html" rel="section">&sect;6&nbsp;Object Teams API</a>&nbsp;&gt;&nbsp;<a class="nav" href="s6.2.html" rel="section">&sect;6.2&nbsp;Other API Elements</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s6.2.c.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s6.2.c.html
new file mode 100644
index 000000000..5b41b0ebc
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s6.2.c.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s6.2.b.html" rel="prev">&lt;&lt;&nbsp;&sect;6.2.(b)&nbsp;Interface for explicit lowering</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s6.2.d.html" rel="next">&sect;6.2.(d)&nbsp;Exceptions&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s6.html" rel="section">&sect;6&nbsp;Object Teams API</a>&nbsp;&gt;&nbsp;<a class="nav" href="s6.2.html" rel="section">&sect;6.2&nbsp;Other API Elements</a></div>
+ <div class="subsect depth3" id="s6.2.c">
+ <h4 class="subsect">&sect;6.2.(c)&nbsp;<span class="title">Team activation methods</span></h4>
+ <p>Every team can be activated and deactivated by predefined methods of the interface <code>org.objectteams.ITeam</code>.
+
+ </p>
+ <dl>
+ <dt><code>activate()</code> and <code>activate(Thread th)</code></dt>
+ <dd>Methods for activation of a team</dd>
+ <dt><code>deactivate()</code> and <code>deactivate(Thread th)</code></dt>
+ <dd>Methods for deactivation of a team</dd>
+ </dl>
+ <p>The usage of these Methods is described in <a href="s5.2.b.html" title="&sect;5.2.(b)&nbsp;Imperative activation"
+ class="sect">&sect;5.2.(b)</a>.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s6.2.b.html" rel="prev">&lt;&lt;&nbsp;&sect;6.2.(b)&nbsp;Interface for explicit lowering</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s6.2.d.html" rel="next">&sect;6.2.(d)&nbsp;Exceptions&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s6.html" rel="section">&sect;6&nbsp;Object Teams API</a>&nbsp;&gt;&nbsp;<a class="nav" href="s6.2.html" rel="section">&sect;6.2&nbsp;Other API Elements</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s6.2.d.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s6.2.d.html
new file mode 100644
index 000000000..2c7579434
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s6.2.d.html
@@ -0,0 +1,83 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s6.2.c.html" rel="prev">&lt;&lt;&nbsp;&sect;6.2.(c)&nbsp;Team activation methods</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s6.2.e.html" rel="next">&sect;6.2.(e)&nbsp;Role migration&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s6.html" rel="section">&sect;6&nbsp;Object Teams API</a>&nbsp;&gt;&nbsp;<a class="nav" href="s6.2.html" rel="section">&sect;6.2&nbsp;Other API Elements</a></div>
+ <div class="subsect depth3" id="s6.2.d">
+ <h4 class="subsect">&sect;6.2.(d)&nbsp;<span class="title">Exceptions</span></h4>
+ <p>The following <code>Exceptions</code> can be thrown during the execution of an ObjectTeam/Java program:
+
+ </p>
+ <dl>
+ <dt><code>ResultNotProvidedException</code></dt>
+ <dd>Thrown if a replace callin without a base call does not provide the necessary (primitive type) base result
+ (see <a href="s4.3.e.html" title="&sect;4.3.(e)&nbsp;Fragile callin binding"
+ class="sect">&sect;4.3.(e)</a>).
+ </dd>
+ <dt><code>LiftingFailedException</code></dt>
+ <dd>Thrown if an actual ambiguity occurs during lifting (see <a href="s2.3.4.c.html" title="&sect;2.3.4.(c)&nbsp;Actual ambiguity"
+ class="sect">&sect;2.3.4.(c)</a>).
+ </dd>
+ <dt><code>WrongRoleException</code></dt>
+ <dd>Thrown during lifting if the base object has, with respect to the same team instance, previously been lifted
+ to a role type that is not conform to the currently requested type
+ (see <a href="s2.3.4.d.html" title="&sect;2.3.4.(d)&nbsp;Mismatching role"
+ class="sect">&sect;2.3.4.(d)</a> and <a href="s2.4.3.html"
+ title="&sect;2.4.3&nbsp;Role creation in the presence of smart lifting"
+ class="sect">&sect;2.4.3</a>).
+ </dd>
+ <dt><code>DuplicateRoleException</code></dt>
+ <dd>Thrown during explicit role creation, if a new role is created for a base object, which already has a role
+ of the required type in the given team (see <a href="s2.4.1.c.html"
+ title="&sect;2.4.1.(c)&nbsp;Duplicate role runtime check"
+ class="sect">&sect;2.4.1.(c)</a>).
+ </dd>
+ <dt><code>RoleCastException</code></dt>
+ <dd>Thrown during cast of an externalized role, if the casted expression is anchored to a different team instance
+ than the cast type (see <a href="s1.2.4.b.html" title="&sect;1.2.4.(b)&nbsp;Casting" class="sect">&sect;1.2.4.(b)</a>).
+ </dd>
+ <dt><code>LiftingVetoException</code></dt>
+ <dd>This exception is used internally to abort the process of lifting when a relevant guard predicate (<a href="s5.4.html" title="&sect;5.4&nbsp;Guard predicates" class="sect">&sect;5.4</a>) evaluated to false.
+ Such exceptions thrown from generated code will never appear in client code, so there is usually no need to catch a <code>LiftingVetoException</code>.
+ However, in some situations it is useful to explicitly <em>throw</em> a <code>LiftingVetoException</code> from a lifting constructor (<a href="s2.3.1.b.html"
+ title="&sect;2.3.1.(b)&nbsp;Default lifting constructor"
+ class="sect">&sect;2.3.1.(b)</a>) of a role.
+ This style allows to abort lifting even after the lifting constructor has started to work and also for method parameters
+ requiring lifting.
+ If lifting was triggered due to a callin method binding, this binding will simply not trigger if a <code>LiftingVetoException</code> is thrown
+ while preparing the call to the role method.
+ </dd>
+ </dl>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s6.2.c.html" rel="prev">&lt;&lt;&nbsp;&sect;6.2.(c)&nbsp;Team activation methods</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s6.2.e.html" rel="next">&sect;6.2.(e)&nbsp;Role migration&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s6.html" rel="section">&sect;6&nbsp;Object Teams API</a>&nbsp;&gt;&nbsp;<a class="nav" href="s6.2.html" rel="section">&sect;6.2&nbsp;Other API Elements</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s6.2.e.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s6.2.e.html
new file mode 100644
index 000000000..043053559
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s6.2.e.html
@@ -0,0 +1,78 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s6.2.d.html" rel="prev">&lt;&lt;&nbsp;&sect;6.2.(d)&nbsp;Exceptions</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s6.html" rel="section">&sect;6&nbsp;Object Teams API</a>&nbsp;&gt;&nbsp;<a class="nav" href="s6.2.html" rel="section">&sect;6.2&nbsp;Other API Elements</a></div>
+ <div class="subsect depth3" id="s6.2.e">
+ <h4 class="subsect">&sect;6.2.(e)&nbsp;<span class="title">Role migration</span></h4>
+ <p>The following interfaces can be used to enable role migration:</p>
+ <dl>
+ <dt><code>IBaseMigratable</code></dt>
+ <dd>This interface declares a method
+ <div class="listing plain"><pre>
+ <code>&lt;B&gt; <b>void</b> migrateToBase(B otherBase)</code> </pre></div>
+ and instructs the compiler to generate an implementation of this method
+ for any bound role declaring <code>IBaseMigratable</code> as its super-interface.<br />
+ The effect of calling <code>migrateToBase</code> on a role instance is to re-bind this role to a new base instance.
+ The base instance must be compatible to the role's base class (in order to avoid problems during lifting the
+ compiler may require the base to be of the exact type of the role's base class).
+ Passing <code>null</code> to this method causes an <code>NullPointerException</code> to be thrown.
+ </dd>
+ <dt><code>ITeamMigratable</code></dt>
+ <dd>This interface declares a method
+ <div class="listing plain"><pre>
+ <code>&lt;R&gt; R&lt;@otherTeam&gt; migrateToTeam(<b>final</b> ITeam otherTeam)</code></pre></div>
+ and instructs the compiler to
+ generate an implementation of this method for any role declaring <code>ITeamMigratable</code> as its super-interface.<br />
+ The effect of calling <code>migrateToTeam</code> on a role instance is to re-bind this role to become a contained part of a new team instance.
+ The team instance must be of the exact type of the role's enclosing team.
+ Passing <code>null</code> to this method causes a <code>NullPointerException</code> to be thrown.<br /><div class="note">
+ <h5>Caveat:</h5>
+ This method intentionally breaks the rules of family polymorphism: any reference <code>R&lt;@previousTeam&gt; r</code>
+ which was established before migration will incorrectly imply that the role's enclosing team still is <code>previousTeam</code>,
+ which is no longer true after migration.
+ While this does not effect any method lookup (which is still safe), further assumptions based on a role's dependent type
+ are invalidated by team migration. The same holds for references from the migrating role to any sibling role instances.<br />
+ If the rules of family polymorphism should be maintained one should just refrain from declaring <code>ITeamMigratable</code>
+ as a role's super-interface.
+ </div>
+ </dd>
+ </dl>
+ <p>For both methods the signature declared in the interface is over-generalized, yet the compiler performs the necessary checks
+ to
+ ensure that role, base and team instances are indeed compatible and additionally the return type of <code>migrateToTeam</code>
+ is checked as a self-type, i.e., it reflects the exact type of the call target.
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s6.2.d.html" rel="prev">&lt;&lt;&nbsp;&sect;6.2.(d)&nbsp;Exceptions</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s6.html" rel="section">&sect;6&nbsp;Object Teams API</a>&nbsp;&gt;&nbsp;<a class="nav" href="s6.2.html" rel="section">&sect;6.2&nbsp;Other API Elements</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s6.2.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s6.2.html
new file mode 100644
index 000000000..7a20f102b
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s6.2.html
@@ -0,0 +1,190 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s6.1.html" rel="prev">&lt;&lt;&nbsp;&sect;6.1&nbsp;Reflection</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s6.html" rel="section">&sect;6&nbsp;Object Teams API</a></div>
+ <div class="sect depth2" id="s6.2">
+ <h2 class="sect">&sect;6.2&nbsp;Other API Elements</h2>
+ <div class="subsect depth3" id="s6.2.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Interfaces for role encapsulation</span></h4>
+ <p>A set of pre-defined types exist that do <span class="underline">not</span> extend <code>java.lang.Object</code>
+ and have <span class="underline">no</span> features except the operators <code>==</code> and <code>!=</code>.
+
+ </p>
+ <div class="note">
+ <h5>Note:</h5>
+ The JLS defines that each interface declares all methods defined in <code>java.lang.Object</code>
+ (<a href="http://java.sun.com/docs/books/jls/second_edition/html/interfaces.doc.html#32392"
+ class="ext">JLS &sect;9.2</a>)
+ and also each object referenced by an interface type can be widened to <code>java.lang.Object</code>.
+ Compilers commonly implement this by declaring <code>java.lang.Object</code> the super-type of all interfaces.
+ Such implementation has no visible difference with respect to the more complex definition in the JLS.
+
+ </div>
+ <p>These predefined types are
+
+ </p>
+ <dl>
+ <dt><code>org.objectteams.IConfined</code></dt>
+ <dd>regular interface</dd>
+ <dt><code>org.objectteams.ITeam.IConfined</code></dt>
+ <dd>role interface</dd>
+ <dt><code>org.objectteams.Team.Confined</code></dt>
+ <dd>role class</dd>
+ </dl>
+ <p>These types provide no new functionality but inheriting from these types influences the semantics with respect to encapsulation.
+
+ The purpose and usage of these types is described in <a href="s7.html" title="&sect;7&nbsp;Role Encapsulation" class="sect">&sect;7</a>.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s6.2.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Interface for explicit lowering</span></h4>
+ <p>The following role interface exists for the purpose of allowing explicit lowering:
+
+ </p>
+ <dl>
+ <dt><code>org.objectteams.ITeam.ILowerable</code></dt>
+ <dd>role interface</dd>
+ </dl>
+ <p>This interface was introduced in detail in <a href="s2.2.d.html" title="&sect;2.2.(d)&nbsp;Explicit lowering"
+ class="sect">&sect;2.2.(d)</a>.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s6.2.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Team activation methods</span></h4>
+ <p>Every team can be activated and deactivated by predefined methods of the interface <code>org.objectteams.ITeam</code>.
+
+ </p>
+ <dl>
+ <dt><code>activate()</code> and <code>activate(Thread th)</code></dt>
+ <dd>Methods for activation of a team</dd>
+ <dt><code>deactivate()</code> and <code>deactivate(Thread th)</code></dt>
+ <dd>Methods for deactivation of a team</dd>
+ </dl>
+ <p>The usage of these Methods is described in <a href="s5.2.b.html" title="&sect;5.2.(b)&nbsp;Imperative activation"
+ class="sect">&sect;5.2.(b)</a>.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s6.2.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Exceptions</span></h4>
+ <p>The following <code>Exceptions</code> can be thrown during the execution of an ObjectTeam/Java program:
+
+ </p>
+ <dl>
+ <dt><code>ResultNotProvidedException</code></dt>
+ <dd>Thrown if a replace callin without a base call does not provide the necessary (primitive type) base result
+ (see <a href="s4.3.e.html" title="&sect;4.3.(e)&nbsp;Fragile callin binding"
+ class="sect">&sect;4.3.(e)</a>).
+ </dd>
+ <dt><code>LiftingFailedException</code></dt>
+ <dd>Thrown if an actual ambiguity occurs during lifting (see <a href="s2.3.4.c.html" title="&sect;2.3.4.(c)&nbsp;Actual ambiguity"
+ class="sect">&sect;2.3.4.(c)</a>).
+ </dd>
+ <dt><code>WrongRoleException</code></dt>
+ <dd>Thrown during lifting if the base object has, with respect to the same team instance, previously been lifted
+ to a role type that is not conform to the currently requested type
+ (see <a href="s2.3.4.d.html" title="&sect;2.3.4.(d)&nbsp;Mismatching role"
+ class="sect">&sect;2.3.4.(d)</a> and <a href="s2.4.3.html"
+ title="&sect;2.4.3&nbsp;Role creation in the presence of smart lifting"
+ class="sect">&sect;2.4.3</a>).
+ </dd>
+ <dt><code>DuplicateRoleException</code></dt>
+ <dd>Thrown during explicit role creation, if a new role is created for a base object, which already has a role
+ of the required type in the given team (see <a href="s2.4.1.c.html"
+ title="&sect;2.4.1.(c)&nbsp;Duplicate role runtime check"
+ class="sect">&sect;2.4.1.(c)</a>).
+ </dd>
+ <dt><code>RoleCastException</code></dt>
+ <dd>Thrown during cast of an externalized role, if the casted expression is anchored to a different team instance
+ than the cast type (see <a href="s1.2.4.b.html" title="&sect;1.2.4.(b)&nbsp;Casting" class="sect">&sect;1.2.4.(b)</a>).
+ </dd>
+ <dt><code>LiftingVetoException</code></dt>
+ <dd>This exception is used internally to abort the process of lifting when a relevant guard predicate (<a href="s5.4.html" title="&sect;5.4&nbsp;Guard predicates" class="sect">&sect;5.4</a>) evaluated to false.
+ Such exceptions thrown from generated code will never appear in client code, so there is usually no need to catch a <code>LiftingVetoException</code>.
+ However, in some situations it is useful to explicitly <em>throw</em> a <code>LiftingVetoException</code> from a lifting constructor (<a href="s2.3.1.b.html"
+ title="&sect;2.3.1.(b)&nbsp;Default lifting constructor"
+ class="sect">&sect;2.3.1.(b)</a>) of a role.
+ This style allows to abort lifting even after the lifting constructor has started to work and also for method parameters
+ requiring lifting.
+ If lifting was triggered due to a callin method binding, this binding will simply not trigger if a <code>LiftingVetoException</code> is thrown
+ while preparing the call to the role method.
+ </dd>
+ </dl>
+ </div>
+ <div class="subsect depth3" id="s6.2.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Role migration</span></h4>
+ <p>The following interfaces can be used to enable role migration:</p>
+ <dl>
+ <dt><code>IBaseMigratable</code></dt>
+ <dd>This interface declares a method
+ <div class="listing plain"><pre>
+ <code>&lt;B&gt; <b>void</b> migrateToBase(B otherBase)</code> </pre></div>
+ and instructs the compiler to generate an implementation of this method
+ for any bound role declaring <code>IBaseMigratable</code> as its super-interface.<br />
+ The effect of calling <code>migrateToBase</code> on a role instance is to re-bind this role to a new base instance.
+ The base instance must be compatible to the role's base class (in order to avoid problems during lifting the
+ compiler may require the base to be of the exact type of the role's base class).
+ Passing <code>null</code> to this method causes an <code>NullPointerException</code> to be thrown.
+ </dd>
+ <dt><code>ITeamMigratable</code></dt>
+ <dd>This interface declares a method
+ <div class="listing plain"><pre>
+ <code>&lt;R&gt; R&lt;@otherTeam&gt; migrateToTeam(<b>final</b> ITeam otherTeam)</code></pre></div>
+ and instructs the compiler to
+ generate an implementation of this method for any role declaring <code>ITeamMigratable</code> as its super-interface.<br />
+ The effect of calling <code>migrateToTeam</code> on a role instance is to re-bind this role to become a contained part of a new team instance.
+ The team instance must be of the exact type of the role's enclosing team.
+ Passing <code>null</code> to this method causes a <code>NullPointerException</code> to be thrown.<br /><div class="note">
+ <h5>Caveat:</h5>
+ This method intentionally breaks the rules of family polymorphism: any reference <code>R&lt;@previousTeam&gt; r</code>
+ which was established before migration will incorrectly imply that the role's enclosing team still is <code>previousTeam</code>,
+ which is no longer true after migration.
+ While this does not effect any method lookup (which is still safe), further assumptions based on a role's dependent type
+ are invalidated by team migration. The same holds for references from the migrating role to any sibling role instances.<br />
+ If the rules of family polymorphism should be maintained one should just refrain from declaring <code>ITeamMigratable</code>
+ as a role's super-interface.
+ </div>
+ </dd>
+ </dl>
+ <p>For both methods the signature declared in the interface is over-generalized, yet the compiler performs the necessary checks
+ to
+ ensure that role, base and team instances are indeed compatible and additionally the return type of <code>migrateToTeam</code>
+ is checked as a self-type, i.e., it reflects the exact type of the call target.
+ </p>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s6.1.html" rel="prev">&lt;&lt;&nbsp;&sect;6.1&nbsp;Reflection</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s6.html" rel="section">&sect;6&nbsp;Object Teams API</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s6.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s6.html
new file mode 100644
index 000000000..5c63088ae
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s6.html
@@ -0,0 +1,404 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s5.html" rel="prev">&lt;&lt;&nbsp;&sect;5&nbsp;Team Activation</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s7.html" rel="next">&sect;7&nbsp;Role Encapsulation&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"></div>
+ <div class="chapter" id="s6">
+ <div class="headl">
+ <div class="headr">
+ <h1>&sect;6&nbsp;Object Teams API</h1>
+ </div>
+ </div>
+ <div id="toc-box">
+ <ul class="toc-box">
+ <li><a href="s6.html">&sect;6&nbsp;Object Teams API</a></li>
+ <li><a href="#s6.1">&sect;6.1&nbsp;Reflection</a></li>
+ <li><a href="#s6.2">&sect;6.2&nbsp;Other API Elements</a></li>
+ </ul>
+ </div>
+ <div class="intro">
+ <h3>The role of predefined types and methods</h3>
+ <div class="line"></div>
+ <div class="term">Application Programming Interface (API)</div>
+ <div class="termdesc">Some features of OT/J are supported without introducing new syntax but by predefined types and methods.</div>
+ <div class="line"></div>
+ </div>
+ <div class="sect depth2" id="s6.1">
+ <h2 class="sect">&sect;6.1&nbsp;Reflection<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;6</a></span></h2>
+ <p>Object Teams supports reflection with respect to teams, roles, and role-base relationships.
+
+ </p>
+ <div class="subsect depth3" id="s6.1.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Interface to the role registry</span></h4>
+ <p>Each team instance internally has a registry of known role objects indexed by their base object.
+ Programmers may make use of this registry using the following reflective methods defined in
+ <code>org.objectteams.ITeam</code>:
+
+ </p>
+ <dl>
+ <dt><code>boolean hasRole ( Object aBase ) ;</code></dt>
+ <dd>This method checks whether a role for the passed base object already exists in the target team.
+
+ </dd>
+ <dt><code>boolean hasRole ( Object aBase, Class expectedRole ) ;</code></dt>
+ <dd>This method checks whether a instance of type <code>expectedRole</code> as a role for the passed base object
+ <code>aBase</code> already exists in the target team.
+ The role may also be of any subtype of the specified role type.
+
+ </dd>
+ <dt><code>Object getRole ( Object aBase ) ;</code></dt>
+ <dd>If the passed base object <code>aBase</code> already has a role in the target team, this role is returned.
+ Otherwise <code>null</code> is returned.
+
+ </dd>
+ <dt><code>&lt;T&gt; T getRole ( Object aBase, Class&lt;T&gt; expectedRole ) ;</code></dt>
+ <dd>If the passed base object <code>aBase</code> already has a role in the target team that is assignable to the type represented by <code>expectedRole</code>,
+ this role is returned. Otherwise <code>null</code> is returned.
+
+ </dd>
+ <dt><code>Object[] getAllRoles () ;</code></dt>
+ <dd>Retrieves all existing (registered) <a href="s2.1.a.html" title="&sect;2.1.(a)&nbsp;Role-base binding"
+ class="sect">bound roles (&sect;2.1.(a))</a> in the target team.
+ <br />
+ This method uses internal structures of weak references. For that reason it may return role instances which were about
+ to be reclaimed by the garbage collector. If performance permits, it is thus advisable to always call <code>System.gc()</code>
+ prior to calling <code>getAllRoles()</code> in order to achieve deterministic results (see also <a href="s2.1.f.html" title="&sect;2.1.(f)&nbsp;Effect on garbage collection"
+ class="sect">&sect;2.1.(f)</a>).
+
+ </dd>
+ <dt><code>&lt;T&gt; T[] getAllRoles ( Class&lt;T&gt; expectedRole ) ;</code></dt>
+ <dd>Retrieves all existing (registered) <a href="s2.1.a.html" title="&sect;2.1.(a)&nbsp;Role-base binding"
+ class="sect">bound roles (&sect;2.1.(a))</a> in the target team that are assignable to the type represented by <code>expectedRole</code>.
+ Class <code>expectedRole</code> must be a bound role otherwise an <code>IllegalArgumentException</code> is thrown.
+ <br />
+ See the note about garbage collection above.
+
+ </dd>
+ <dt><code>void unregisterRole ( Object aRole ) ;</code></dt>
+ <dd>This method unregisters the passed role object from the target team. Thus the corresponding base looses this role.
+ After calling this method the role should no longer be used.
+
+ </dd>
+ <dt><code>void unregisterRole ( Object aRole, Class roleClass ) ;</code></dt>
+ <dd>This method unregisters the passed role object from the target team. Thus the corresponding base looses this role.
+ After calling this method the role should no longer be used.
+ The only difference to the previous method is improved speed because no search for the corresponding registry
+ has to be performed.
+
+ </dd>
+ </dl>
+ <p>It is desirable and possible to use these methods within guards (see <a href="s5.4.html" title="&sect;5.4&nbsp;Guard predicates" class="sect">&sect;5.4</a>).
+ These methods allow to write the specification of guards in a more concise and more expressive way. Determined by the signature,
+
+ the first four methods can only be used in a base-level guard (<a href="s5.4.2.html" title="&sect;5.4.2&nbsp;Base guards" class="sect">&sect;5.4.2</a>) because they require a reference to a base object.
+
+ </p>
+ <h5 class="listing">Example code (Guards and Reflection):</h5>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> SpecialConditions {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>public</b> <b>void</b> participate(Account <b>as</b> BonusAccount ba) {}</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> <b>public</b> <b>class</b> BonusAccount <b>playedBy</b> Account</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <b>base</b> when(SpecialConditions.this.<em>hasRole</em>(base, BonusAccount.class))</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> <b>callin</b> <b>void</b> creditBonus(<b>int</b> amount) {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> base.creditBonus(amount + bonus);</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre> <b>void</b> creditBonus(<b>int</b> amount) <b>&lt;-</b> <b>replace</b> <b>void</b> credit(<b>int</b> i)</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">10</td>
+ <td><pre> <b>base</b> <b>when</b> (i &gt; 1000);</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">11</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">12</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="codecomment">
+ <h5>Effects:</h5>
+ This teams provides a bonus system for registered <code>Account</code>s. Every time an amount of more than 1000 is
+ deposited to a registered account, additional 1% of the amount is credited.
+
+ <ul>
+ <li>The team level method <code>participate</code> in line 2 uses declared lifting (see <a href="s2.3.2.html" title="&sect;2.3.2&nbsp;Declared lifting" class="sect">&sect;2.3.2</a>)
+ to allow the passed <code>Account</code> object to participate the bonus system provided by the
+ <code>SpecialConditions</code> team.
+
+ </li>
+ <li>The base guard in line 4 uses the reflective method <code>hasRole</code> to check whether the base object already has a role
+ of type <code>BonusAccount</code> in the surrounding team. The expression <code>BonusAccount.class</code> returns
+ the <code>java.lang.Class</code> object representing the role <code>BonusAccount</code>
+ (see <a href="http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#251530"
+ class="ext">JLS &sect;15.8.2</a>).
+ This guard ensures, that only accounts explicitly registered via <code>participate</code> are ever decorated with a role of type <code>BonusAccount</code>.
+
+ </li>
+ <li>The method binding guard in line 10 restricts the callin to <code>creditBonus</code> to calls where
+ the base method argument <code>amount</code> is greater than 1000.
+
+ </li>
+ </ul>
+ </div>
+ </div>
+ <div class="subsect depth3" id="s6.1.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Behavioral reflection</span></h4>
+ <p>The following reflective methods defined in org.objectteams.ITeam can be used to
+ inspect the dynamic behavior of a team:
+
+ </p>
+ <dl>
+ <dt><code>boolean isExecutingCallin () ;</code></dt>
+ <dd>This method is used to inspect whether a control flow has already been intercepted by at least one callin binding of the current
+ team.
+ It can be used to avoid undesirable re-entrance to a team.
+
+ </dd>
+ <dt><code>boolean isActive () ;</code></dt>
+ <dd>This method checks whether the team instance is active for the current thread.
+
+ </dd>
+ <dt><code>boolean isActive ( Thread aThread ) ;</code></dt>
+ <dd>This method checks whether the team instance is active for the thread <code>aThread</code>.
+
+ </dd>
+ </dl>
+ </div>
+ <div class="subsect depth3" id="s6.1.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Class literals for roles</span></h4>
+ <p>The Java syntax for so-called class literals, <code>MyClass<strong>.class</strong></code>
+ (see <a href="http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#251530"
+ class="ext">JLS &sect;15.8.2</a>)
+ can be used for role types with slightly changed semantics: Role types are virtual types (<a href="s1.3.1.html"
+ title="&sect;1.3.1&nbsp;Acquisition and implicit inheritance of role classes"
+ class="sect">&sect;1.3.1</a>)
+ that are bound dynamically (<a href="s1.3.1.e.html" title="&sect;1.3.1.(e)&nbsp;Dynamic binding of types"
+ class="sect">&sect;1.3.1.(e)</a>). This applies to role class literals, too.
+ From this follows the constraint that a role class literal can only be used within the non-static context of a team,
+ ie., for evaluating a role class literal an enclosing team instance must be in scope.
+ <br />
+ Unlike regular type checking for role types, the class literal itself does not have a dependent type.
+ Thus type checking of calls to methods like <code>hasRole(Object, Class)</code> cannot detect, whether the <code>Class</code> instance
+ has actually been obtained from the correct team instance. Any attempt to pass a class that is not known
+ as a bound role within the given team results in an <code>IllegalArgumentException</code> at run-time.
+
+ </p>
+ </div>
+ </div>
+ <div class="sect depth2" id="s6.2">
+ <h2 class="sect">&sect;6.2&nbsp;Other API Elements<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;6</a></span></h2>
+ <div class="subsect depth3" id="s6.2.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Interfaces for role encapsulation</span></h4>
+ <p>A set of pre-defined types exist that do <span class="underline">not</span> extend <code>java.lang.Object</code>
+ and have <span class="underline">no</span> features except the operators <code>==</code> and <code>!=</code>.
+
+ </p>
+ <div class="note">
+ <h5>Note:</h5>
+ The JLS defines that each interface declares all methods defined in <code>java.lang.Object</code>
+ (<a href="http://java.sun.com/docs/books/jls/second_edition/html/interfaces.doc.html#32392"
+ class="ext">JLS &sect;9.2</a>)
+ and also each object referenced by an interface type can be widened to <code>java.lang.Object</code>.
+ Compilers commonly implement this by declaring <code>java.lang.Object</code> the super-type of all interfaces.
+ Such implementation has no visible difference with respect to the more complex definition in the JLS.
+
+ </div>
+ <p>These predefined types are
+
+ </p>
+ <dl>
+ <dt><code>org.objectteams.IConfined</code></dt>
+ <dd>regular interface</dd>
+ <dt><code>org.objectteams.ITeam.IConfined</code></dt>
+ <dd>role interface</dd>
+ <dt><code>org.objectteams.Team.Confined</code></dt>
+ <dd>role class</dd>
+ </dl>
+ <p>These types provide no new functionality but inheriting from these types influences the semantics with respect to encapsulation.
+
+ The purpose and usage of these types is described in <a href="s7.html" title="&sect;7&nbsp;Role Encapsulation" class="sect">&sect;7</a>.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s6.2.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Interface for explicit lowering</span></h4>
+ <p>The following role interface exists for the purpose of allowing explicit lowering:
+
+ </p>
+ <dl>
+ <dt><code>org.objectteams.ITeam.ILowerable</code></dt>
+ <dd>role interface</dd>
+ </dl>
+ <p>This interface was introduced in detail in <a href="s2.2.d.html" title="&sect;2.2.(d)&nbsp;Explicit lowering"
+ class="sect">&sect;2.2.(d)</a>.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s6.2.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Team activation methods</span></h4>
+ <p>Every team can be activated and deactivated by predefined methods of the interface <code>org.objectteams.ITeam</code>.
+
+ </p>
+ <dl>
+ <dt><code>activate()</code> and <code>activate(Thread th)</code></dt>
+ <dd>Methods for activation of a team</dd>
+ <dt><code>deactivate()</code> and <code>deactivate(Thread th)</code></dt>
+ <dd>Methods for deactivation of a team</dd>
+ </dl>
+ <p>The usage of these Methods is described in <a href="s5.2.b.html" title="&sect;5.2.(b)&nbsp;Imperative activation"
+ class="sect">&sect;5.2.(b)</a>.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s6.2.d">
+ <h4 class="subsect">(d)&nbsp;<span class="title">Exceptions</span></h4>
+ <p>The following <code>Exceptions</code> can be thrown during the execution of an ObjectTeam/Java program:
+
+ </p>
+ <dl>
+ <dt><code>ResultNotProvidedException</code></dt>
+ <dd>Thrown if a replace callin without a base call does not provide the necessary (primitive type) base result
+ (see <a href="s4.3.e.html" title="&sect;4.3.(e)&nbsp;Fragile callin binding"
+ class="sect">&sect;4.3.(e)</a>).
+ </dd>
+ <dt><code>LiftingFailedException</code></dt>
+ <dd>Thrown if an actual ambiguity occurs during lifting (see <a href="s2.3.4.c.html" title="&sect;2.3.4.(c)&nbsp;Actual ambiguity"
+ class="sect">&sect;2.3.4.(c)</a>).
+ </dd>
+ <dt><code>WrongRoleException</code></dt>
+ <dd>Thrown during lifting if the base object has, with respect to the same team instance, previously been lifted
+ to a role type that is not conform to the currently requested type
+ (see <a href="s2.3.4.d.html" title="&sect;2.3.4.(d)&nbsp;Mismatching role"
+ class="sect">&sect;2.3.4.(d)</a> and <a href="s2.4.3.html"
+ title="&sect;2.4.3&nbsp;Role creation in the presence of smart lifting"
+ class="sect">&sect;2.4.3</a>).
+ </dd>
+ <dt><code>DuplicateRoleException</code></dt>
+ <dd>Thrown during explicit role creation, if a new role is created for a base object, which already has a role
+ of the required type in the given team (see <a href="s2.4.1.c.html"
+ title="&sect;2.4.1.(c)&nbsp;Duplicate role runtime check"
+ class="sect">&sect;2.4.1.(c)</a>).
+ </dd>
+ <dt><code>RoleCastException</code></dt>
+ <dd>Thrown during cast of an externalized role, if the casted expression is anchored to a different team instance
+ than the cast type (see <a href="s1.2.4.b.html" title="&sect;1.2.4.(b)&nbsp;Casting" class="sect">&sect;1.2.4.(b)</a>).
+ </dd>
+ <dt><code>LiftingVetoException</code></dt>
+ <dd>This exception is used internally to abort the process of lifting when a relevant guard predicate (<a href="s5.4.html" title="&sect;5.4&nbsp;Guard predicates" class="sect">&sect;5.4</a>) evaluated to false.
+ Such exceptions thrown from generated code will never appear in client code, so there is usually no need to catch a <code>LiftingVetoException</code>.
+ However, in some situations it is useful to explicitly <em>throw</em> a <code>LiftingVetoException</code> from a lifting constructor (<a href="s2.3.1.b.html"
+ title="&sect;2.3.1.(b)&nbsp;Default lifting constructor"
+ class="sect">&sect;2.3.1.(b)</a>) of a role.
+ This style allows to abort lifting even after the lifting constructor has started to work and also for method parameters
+ requiring lifting.
+ If lifting was triggered due to a callin method binding, this binding will simply not trigger if a <code>LiftingVetoException</code> is thrown
+ while preparing the call to the role method.
+ </dd>
+ </dl>
+ </div>
+ <div class="subsect depth3" id="s6.2.e">
+ <h4 class="subsect">(e)&nbsp;<span class="title">Role migration</span></h4>
+ <p>The following interfaces can be used to enable role migration:</p>
+ <dl>
+ <dt><code>IBaseMigratable</code></dt>
+ <dd>This interface declares a method
+ <div class="listing plain"><pre>
+ <code>&lt;B&gt; <b>void</b> migrateToBase(B otherBase)</code> </pre></div>
+ and instructs the compiler to generate an implementation of this method
+ for any bound role declaring <code>IBaseMigratable</code> as its super-interface.<br />
+ The effect of calling <code>migrateToBase</code> on a role instance is to re-bind this role to a new base instance.
+ The base instance must be compatible to the role's base class (in order to avoid problems during lifting the
+ compiler may require the base to be of the exact type of the role's base class).
+ Passing <code>null</code> to this method causes an <code>NullPointerException</code> to be thrown.
+ </dd>
+ <dt><code>ITeamMigratable</code></dt>
+ <dd>This interface declares a method
+ <div class="listing plain"><pre>
+ <code>&lt;R&gt; R&lt;@otherTeam&gt; migrateToTeam(<b>final</b> ITeam otherTeam)</code></pre></div>
+ and instructs the compiler to
+ generate an implementation of this method for any role declaring <code>ITeamMigratable</code> as its super-interface.<br />
+ The effect of calling <code>migrateToTeam</code> on a role instance is to re-bind this role to become a contained part of a new team instance.
+ The team instance must be of the exact type of the role's enclosing team.
+ Passing <code>null</code> to this method causes a <code>NullPointerException</code> to be thrown.<br /><div class="note">
+ <h5>Caveat:</h5>
+ This method intentionally breaks the rules of family polymorphism: any reference <code>R&lt;@previousTeam&gt; r</code>
+ which was established before migration will incorrectly imply that the role's enclosing team still is <code>previousTeam</code>,
+ which is no longer true after migration.
+ While this does not effect any method lookup (which is still safe), further assumptions based on a role's dependent type
+ are invalidated by team migration. The same holds for references from the migrating role to any sibling role instances.<br />
+ If the rules of family polymorphism should be maintained one should just refrain from declaring <code>ITeamMigratable</code>
+ as a role's super-interface.
+ </div>
+ </dd>
+ </dl>
+ <p>For both methods the signature declared in the interface is over-generalized, yet the compiler performs the necessary checks
+ to
+ ensure that role, base and team instances are indeed compatible and additionally the return type of <code>migrateToTeam</code>
+ is checked as a self-type, i.e., it reflects the exact type of the call target.
+ </p>
+ </div>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s5.html" rel="prev">&lt;&lt;&nbsp;&sect;5&nbsp;Team Activation</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s7.html" rel="next">&sect;7&nbsp;Role Encapsulation&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s7.1.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s7.1.html
new file mode 100644
index 000000000..a68cff20e
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s7.1.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s7.2.html" rel="next">&sect;7.2&nbsp;Confined roles&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s7.html" rel="section">&sect;7&nbsp;Role Encapsulation</a></div>
+ <div class="sect depth2" id="s7.1">
+ <h2 class="sect">&sect;7.1&nbsp;Opaque roles</h2>
+ <p>The purpose of the two <code>IConfined</code> interfaces (see <a href="s6.2.a.html"
+ title="&sect;6.2.(a)&nbsp;Interfaces for role encapsulation"
+ class="sect">&sect;6.2.(a)</a>) is to define
+ <strong>opaque roles</strong>: Any role implementing <code>IConfined</code>
+ can be externalized using this type, such that external clients
+ cannot access any features of the role. The type <code>IConfined</code>
+ exposes no features and references of this type cannot be widened
+ to any type not even to <code>java.lang.Object</code>.
+ <br />
+ If the actual role type is furthermore invisible outside the team
+ (by not declaring it <code>public</code>), it is perfectly safe to externalize
+ such roles using type <code>IConfined</code> (which is a public interface)
+ and pass them back to the owning team. The encapsulation
+ of the team is in no way breached by externalizing opaque roles,
+ which can only be used as a handle into internal state of the team.
+
+ </p>
+ <p>The difference between the two mentioned interfaces is that
+ <code>ITeam.IConfined</code> requires to use this type or any subtype
+ as externalized role. Such a reference contains the information of
+ the enclosing team. Even stricter control can be imposed using the
+ regular interface <code>IConfined</code>. Here not even team membership
+ is visible to clients using a reference of this type.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s7.2.html" rel="next">&sect;7.2&nbsp;Confined roles&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s7.html" rel="section">&sect;7&nbsp;Role Encapsulation</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s7.2.a.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s7.2.a.html
new file mode 100644
index 000000000..fbfceddab
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s7.2.a.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s7.2.b.html" rel="next">&sect;7.2.(b)&nbsp;Arrays of Confined&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s7.html" rel="section">&sect;7&nbsp;Role Encapsulation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s7.2.html" rel="section">&sect;7.2&nbsp;Confined roles</a></div>
+ <div class="subsect depth3" id="s7.2.a">
+ <h4 class="subsect">&sect;7.2.(a)&nbsp;<span class="title">Inhibition of overriding</span></h4>
+ <p>The types <code>ITeam.IConfined</code> and <code>Team.Confined</code>
+ cannot be overridden (cf. <a href="s1.3.1.c.html"
+ title="&sect;1.3.1.(c)&nbsp;Overriding and implicit inheritance"
+ class="sect">&sect;1.3.1.(c)</a>).
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s7.2.b.html" rel="next">&sect;7.2.(b)&nbsp;Arrays of Confined&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s7.html" rel="section">&sect;7&nbsp;Role Encapsulation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s7.2.html" rel="section">&sect;7.2&nbsp;Confined roles</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s7.2.b.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s7.2.b.html
new file mode 100644
index 000000000..0e4af07ee
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s7.2.b.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s7.2.a.html" rel="prev">&lt;&lt;&nbsp;&sect;7.2.(a)&nbsp;Inhibition of overriding</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s7.html" rel="section">&sect;7&nbsp;Role Encapsulation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s7.2.html" rel="section">&sect;7.2&nbsp;Confined roles</a></div>
+ <div class="subsect depth3" id="s7.2.b">
+ <h4 class="subsect">&sect;7.2.(b)&nbsp;<span class="title">Arrays of Confined</span></h4>
+ <p>For any confined type <code>C</code>, i.e., a type which is not compatible to <code>Object</code>, an array of <code>C</code> is not compatible to an array of <code>Object</code> nor to <code>Object</code> itself. This rule ensures that confinement cannot be bypassed by a sequence of compatible assignments and casts.
+
+ </p>
+ <div class="note">
+ <h5>Upcoming:</h5>
+ Only by widening to a non-role super-type, a role instance can
+ be accessed from outside the team. In the future this can be inhibited by
+ restricted inheritance.
+
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s7.2.a.html" rel="prev">&lt;&lt;&nbsp;&sect;7.2.(a)&nbsp;Inhibition of overriding</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s7.html" rel="section">&sect;7&nbsp;Role Encapsulation</a>&nbsp;&gt;&nbsp;<a class="nav" href="s7.2.html" rel="section">&sect;7.2&nbsp;Confined roles</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s7.2.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s7.2.html
new file mode 100644
index 000000000..918d47ac7
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s7.2.html
@@ -0,0 +1,194 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s7.1.html" rel="prev">&lt;&lt;&nbsp;&sect;7.1&nbsp;Opaque roles</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s7.html" rel="section">&sect;7&nbsp;Role Encapsulation</a></div>
+ <div class="sect depth2" id="s7.2">
+ <h2 class="sect">&sect;7.2&nbsp;Confined roles</h2>
+ <p>
+ Subclassing <code>Team.Confined</code> with a protected class
+ yields a role class to which no object outside the team will
+ ever have a reference.
+ The point here is that instances of a role class with a regular super class
+ can be widened to this super class.
+ Widening can occur either in an assignment or when invoking a method which the role
+ inherits from the regular super class, where the <code>this</code> reference is widened.
+ In both cases the widened reference is no longer protected by the team and can leak out.
+ This would break encapsulation of a role object that should only be accessible within the enclosing team.<br />
+ Subclasses of <code>Team.Confined</code> are not compatible to any class outside their enclosing team (including <code>java.lang.Object</code>) and do not inherit any methods
+ that have the danger of leaking <code>this</code>.
+
+ </p>
+ <div class="subsect depth3" id="s7.2.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Inhibition of overriding</span></h4>
+ <p>The types <code>ITeam.IConfined</code> and <code>Team.Confined</code>
+ cannot be overridden (cf. <a href="s1.3.1.c.html"
+ title="&sect;1.3.1.(c)&nbsp;Overriding and implicit inheritance"
+ class="sect">&sect;1.3.1.(c)</a>).
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s7.2.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Arrays of Confined</span></h4>
+ <p>For any confined type <code>C</code>, i.e., a type which is not compatible to <code>Object</code>, an array of <code>C</code> is not compatible to an array of <code>Object</code> nor to <code>Object</code> itself. This rule ensures that confinement cannot be bypassed by a sequence of compatible assignments and casts.
+
+ </p>
+ <div class="note">
+ <h5>Upcoming:</h5>
+ Only by widening to a non-role super-type, a role instance can
+ be accessed from outside the team. In the future this can be inhibited by
+ restricted inheritance.
+
+ </div>
+ </div>
+ <h5 class="listing">Example code (Role Encapsulation):</h5>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> Company {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>private</b> HashMap&lt;String,Employee&gt; employees;</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> ...</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <b>protected</b> <b>class</b> Employee <em><b>implements</b> IConfined</em> {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> <b>void</b> pay(<b>int</b> amount) { ... }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> ...</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre> <b>public</b> <em>IConfined</em> getEmployee(String ID) {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre> <b>return</b> employees.get(ID); <span class="comment">// implicit widening to IConfined</span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">10</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">11</td>
+ <td><pre> <b>public</b> <b>void</b> payBonus(<em>IConfined</em> emp, <b>int</b> amount) {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">12</td>
+ <td><pre> ((Employee)emp).pay(amount); <span class="comment">// explicit narrowing</span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">13</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">14</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">15</td>
+ <td><pre><b>public</b> <b>class</b> Ma<b>in</b> {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">16</td>
+ <td><pre> <b>public</b> <b>static</b> <b>void</b> main(String[] args) {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">17</td>
+ <td><pre> <b>final</b> Company comp = <b>new</b> Company();</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">18</td>
+ <td><pre> <em>IConfined</em>&lt;@comp&gt; emp = comp.getEmployee("emp1");</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">19</td>
+ <td><pre> <span class="comment">// System.out.println(emp); &lt;– <span class="error"><strong>forbidden!</strong></span></span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">20</td>
+ <td><pre> comp.payBonus(emp, 100);</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">21</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">22</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="codecomment">
+ <h5>Effects:</h5>
+ <ul>
+ <li>The <code>protected</code> role <code>Employee</code> implements
+ the above described interface <code>IConfined</code> and therefore
+ becomes <strong>opaque</strong> (line 4).
+ </li>
+ <li>Methods sharing such an opaque role with the outside of the enclosing team
+ have to use the type <code>IConfined</code> (line 8, line 11).
+ </li>
+ <li>It is possible to obtain an instance of such a role by using the type <code>IConfined</code> (line 18).
+ </li>
+ <li>Trying to access any feature of this instance, for example <code>toString()</code>,
+ will cause a compilation error (line 19).
+ </li>
+ <li>Passing the opaque role reference back into the team works well (line 20).</li>
+ <li>Inside the team some conversions between the types <code>IConfined</code>
+ and the intrinsic role type <code>Employee</code> may be necessary (line 9 and 12).
+ </li>
+ </ul>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s7.1.html" rel="prev">&lt;&lt;&nbsp;&sect;7.1&nbsp;Opaque roles</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s7.html" rel="section">&sect;7&nbsp;Role Encapsulation</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s7.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s7.html
new file mode 100644
index 000000000..b82a6f560
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s7.html
@@ -0,0 +1,255 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s6.html" rel="prev">&lt;&lt;&nbsp;&sect;6&nbsp;Object Teams API</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s8.html" rel="next">&sect;8&nbsp;Join Point Queries&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"></div>
+ <div class="chapter" id="s7">
+ <div class="headl">
+ <div class="headr">
+ <h1>&sect;7&nbsp;Role Encapsulation</h1>
+ </div>
+ </div>
+ <div id="toc-box">
+ <ul class="toc-box">
+ <li><a href="s7.html">&sect;7&nbsp;Role Encapsulation</a></li>
+ <li><a href="#s7.1">&sect;7.1&nbsp;Opaque roles</a></li>
+ <li><a href="#s7.2">&sect;7.2&nbsp;Confined roles</a></li>
+ </ul>
+ </div>
+ <div class="intro">
+ <h3>Concepts of encapsulation</h3>
+ <div class="line"></div>
+ <div class="term">Protected roles</div>
+ <div class="termdesc">A role with visibility <code>protected</code> cannot be externalized, which means its type
+ cannot be used outside the declaring team (<a href="s1.2.3.html" title="&sect;1.2.3&nbsp;Protected roles" class="sect">&sect;1.2.3</a>).
+ </div>
+ <div class="line"></div>
+ <div class="term">Confined roles</div>
+ <div class="termdesc">Confined roles are encapsulated even stricter than protected roles: the compiler will ensure that
+ by no means any object outside the enclosing team will ever have a reference to a confined role.
+ </div>
+ <div class="line"></div>
+ <div class="term">Opaque roles</div>
+ <div class="termdesc">Opaque roles build on the guarantees of confined roles but allow to be shared in a limited way such that
+ no information is exposed.
+ </div>
+ <div class="line"></div>
+ </div>
+ <div class="sect depth2" id="s7.1">
+ <h2 class="sect">&sect;7.1&nbsp;Opaque roles<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;7</a></span></h2>
+ <p>The purpose of the two <code>IConfined</code> interfaces (see <a href="s6.2.a.html"
+ title="&sect;6.2.(a)&nbsp;Interfaces for role encapsulation"
+ class="sect">&sect;6.2.(a)</a>) is to define
+ <strong>opaque roles</strong>: Any role implementing <code>IConfined</code>
+ can be externalized using this type, such that external clients
+ cannot access any features of the role. The type <code>IConfined</code>
+ exposes no features and references of this type cannot be widened
+ to any type not even to <code>java.lang.Object</code>.
+ <br />
+ If the actual role type is furthermore invisible outside the team
+ (by not declaring it <code>public</code>), it is perfectly safe to externalize
+ such roles using type <code>IConfined</code> (which is a public interface)
+ and pass them back to the owning team. The encapsulation
+ of the team is in no way breached by externalizing opaque roles,
+ which can only be used as a handle into internal state of the team.
+
+ </p>
+ <p>The difference between the two mentioned interfaces is that
+ <code>ITeam.IConfined</code> requires to use this type or any subtype
+ as externalized role. Such a reference contains the information of
+ the enclosing team. Even stricter control can be imposed using the
+ regular interface <code>IConfined</code>. Here not even team membership
+ is visible to clients using a reference of this type.
+
+ </p>
+ </div>
+ <div class="sect depth2" id="s7.2">
+ <h2 class="sect">&sect;7.2&nbsp;Confined roles<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;7</a></span></h2>
+ <p>
+ Subclassing <code>Team.Confined</code> with a protected class
+ yields a role class to which no object outside the team will
+ ever have a reference.
+ The point here is that instances of a role class with a regular super class
+ can be widened to this super class.
+ Widening can occur either in an assignment or when invoking a method which the role
+ inherits from the regular super class, where the <code>this</code> reference is widened.
+ In both cases the widened reference is no longer protected by the team and can leak out.
+ This would break encapsulation of a role object that should only be accessible within the enclosing team.<br />
+ Subclasses of <code>Team.Confined</code> are not compatible to any class outside their enclosing team (including <code>java.lang.Object</code>) and do not inherit any methods
+ that have the danger of leaking <code>this</code>.
+
+ </p>
+ <div class="subsect depth3" id="s7.2.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Inhibition of overriding</span></h4>
+ <p>The types <code>ITeam.IConfined</code> and <code>Team.Confined</code>
+ cannot be overridden (cf. <a href="s1.3.1.c.html"
+ title="&sect;1.3.1.(c)&nbsp;Overriding and implicit inheritance"
+ class="sect">&sect;1.3.1.(c)</a>).
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s7.2.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Arrays of Confined</span></h4>
+ <p>For any confined type <code>C</code>, i.e., a type which is not compatible to <code>Object</code>, an array of <code>C</code> is not compatible to an array of <code>Object</code> nor to <code>Object</code> itself. This rule ensures that confinement cannot be bypassed by a sequence of compatible assignments and casts.
+
+ </p>
+ <div class="note">
+ <h5>Upcoming:</h5>
+ Only by widening to a non-role super-type, a role instance can
+ be accessed from outside the team. In the future this can be inhibited by
+ restricted inheritance.
+
+ </div>
+ </div>
+ <h5 class="listing">Example code (Role Encapsulation):</h5>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">1</td>
+ <td><pre><b>public</b> <b>team</b> <b>class</b> Company {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">2</td>
+ <td><pre> <b>private</b> HashMap&lt;String,Employee&gt; employees;</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">3</td>
+ <td><pre> ...</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">4</td>
+ <td><pre> <b>protected</b> <b>class</b> Employee <em><b>implements</b> IConfined</em> {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">5</td>
+ <td><pre> <b>void</b> pay(<b>int</b> amount) { ... }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">6</td>
+ <td><pre> ...</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">7</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">8</td>
+ <td><pre> <b>public</b> <em>IConfined</em> getEmployee(String ID) {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">9</td>
+ <td><pre> <b>return</b> employees.get(ID); <span class="comment">// implicit widening to IConfined</span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">10</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">11</td>
+ <td><pre> <b>public</b> <b>void</b> payBonus(<em>IConfined</em> emp, <b>int</b> amount) {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">12</td>
+ <td><pre> ((Employee)emp).pay(amount); <span class="comment">// explicit narrowing</span></pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">13</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">14</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="listing example frame">
+ <table class="listing">
+ <tr class="line odd">
+ <td class="ln">15</td>
+ <td><pre><b>public</b> <b>class</b> Ma<b>in</b> {</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">16</td>
+ <td><pre> <b>public</b> <b>static</b> <b>void</b> main(String[] args) {</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">17</td>
+ <td><pre> <b>final</b> Company comp = <b>new</b> Company();</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">18</td>
+ <td><pre> <em>IConfined</em>&lt;@comp&gt; emp = comp.getEmployee("emp1");</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">19</td>
+ <td><pre> <span class="comment">// System.out.println(emp); &lt;– <span class="error"><strong>forbidden!</strong></span></span></pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">20</td>
+ <td><pre> comp.payBonus(emp, 100);</pre></td>
+ </tr>
+ <tr class="line odd">
+ <td class="ln">21</td>
+ <td><pre> }</pre></td>
+ </tr>
+ <tr class="line even">
+ <td class="ln">22</td>
+ <td><pre>}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div class="codecomment">
+ <h5>Effects:</h5>
+ <ul>
+ <li>The <code>protected</code> role <code>Employee</code> implements
+ the above described interface <code>IConfined</code> and therefore
+ becomes <strong>opaque</strong> (line 4).
+ </li>
+ <li>Methods sharing such an opaque role with the outside of the enclosing team
+ have to use the type <code>IConfined</code> (line 8, line 11).
+ </li>
+ <li>It is possible to obtain an instance of such a role by using the type <code>IConfined</code> (line 18).
+ </li>
+ <li>Trying to access any feature of this instance, for example <code>toString()</code>,
+ will cause a compilation error (line 19).
+ </li>
+ <li>Passing the opaque role reference back into the team works well (line 20).</li>
+ <li>Inside the team some conversions between the types <code>IConfined</code>
+ and the intrinsic role type <code>Employee</code> may be necessary (line 9 and 12).
+ </li>
+ </ul>
+ </div>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s6.html" rel="prev">&lt;&lt;&nbsp;&sect;6&nbsp;Object Teams API</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s8.html" rel="next">&sect;8&nbsp;Join Point Queries&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s8.1.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s8.1.html
new file mode 100644
index 000000000..89553ea32
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s8.1.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s8.2.html" rel="next">&sect;8.2&nbsp;Query expressions&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s8.html" rel="section">&sect;8&nbsp;Join Point Queries</a></div>
+ <div class="sect depth2" id="s8.1">
+ <h2 class="sect">&sect;8.1&nbsp;Join point queries</h2>
+ <p><strong><em>This section will describe the query language used to define sets
+ of join points. As of version 1.4.0 of the OTDT this query language is not yet supported.</em></strong></p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s8.2.html" rel="next">&sect;8.2&nbsp;Query expressions&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s8.html" rel="section">&sect;8&nbsp;Join Point Queries</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s8.2.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s8.2.html
new file mode 100644
index 000000000..3809a5497
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s8.2.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s8.1.html" rel="prev">&lt;&lt;&nbsp;&sect;8.1&nbsp;Join point queries</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s8.3.html" rel="next">&sect;8.3&nbsp;OT/J meta model&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s8.html" rel="section">&sect;8&nbsp;Join Point Queries</a></div>
+ <div class="sect depth2" id="s8.2">
+ <h2 class="sect">&sect;8.2&nbsp;Query expressions</h2>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s8.1.html" rel="prev">&lt;&lt;&nbsp;&sect;8.1&nbsp;Join point queries</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s8.3.html" rel="next">&sect;8.3&nbsp;OT/J meta model&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s8.html" rel="section">&sect;8&nbsp;Join Point Queries</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s8.3.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s8.3.html
new file mode 100644
index 000000000..7f975e1b8
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s8.3.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s8.2.html" rel="prev">&lt;&lt;&nbsp;&sect;8.2&nbsp;Query expressions</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s8.html" rel="section">&sect;8&nbsp;Join Point Queries</a></div>
+ <div class="sect depth2" id="s8.3">
+ <h2 class="sect">&sect;8.3&nbsp;OT/J meta model</h2>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s8.2.html" rel="prev">&lt;&lt;&nbsp;&sect;8.2&nbsp;Query expressions</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s8.html" rel="section">&sect;8&nbsp;Join Point Queries</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s8.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s8.html
new file mode 100644
index 000000000..34b80e2db
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s8.html
@@ -0,0 +1,88 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s7.html" rel="prev">&lt;&lt;&nbsp;&sect;7&nbsp;Role Encapsulation</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s9.html" rel="next">&sect;9&nbsp;Value Dependent Classes&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"></div>
+ <div class="chapter" id="s8">
+ <div class="headl">
+ <div class="headr">
+ <h1>&sect;8&nbsp;Join Point Queries</h1>
+ </div>
+ </div>
+ <div id="toc-box">
+ <ul class="toc-box">
+ <li><a href="s8.html">&sect;8&nbsp;Join Point Queries</a></li>
+ <li><a href="#s8.1">&sect;8.1&nbsp;Join point queries</a></li>
+ <li><a href="#s8.2">&sect;8.2&nbsp;Query expressions</a></li>
+ <li><a href="#s8.3">&sect;8.3&nbsp;OT/J meta model</a></li>
+ </ul>
+ </div>
+ <div class="intro">
+ <h3>Defining sets of join points for interception</h3>
+ <div class="line"></div>
+ <div class="term">join point</div>
+ <div class="termdesc">In OT/J a join point is considered to be an element
+ of the program. A meta model exists which defines the <strong>kinds</strong>
+ of join points that can be identified.
+ </div>
+ <div class="line"></div>
+ <div class="term">join point interception</div>
+ <div class="termdesc">The purpose of identifying join points is to intercept program execution at these points
+ by means of <em>callin</em> bindings.
+ </div>
+ <div class="line"></div>
+ <div class="term">join point query</div>
+ <div class="termdesc">Sets of join points are defined using functional queries of the program's reflective representation.</div>
+ <div class="line"></div>
+ <div class="term"><i>pointcuts</i></div>
+ <div class="termdesc">Dynamic "pointcuts" comparable to AspectJ's <code>cflow</code> or even the Trace-Matches approach
+ are not subject to the join point language of OT/J. These features will be added at a different level
+ of abstraction. Note, that guard predicates (<a href="s5.4.html" title="&sect;5.4&nbsp;Guard predicates" class="sect">&sect;5.4</a>) subsume the dynamic
+ capabilities of the pointcuts <code>if, target, this, args</code>.
+ </div>
+ <div class="line"></div>
+ </div>
+ <div class="sect depth2" id="s8.1">
+ <h2 class="sect">&sect;8.1&nbsp;Join point queries<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;8</a></span></h2>
+ <p><strong><em>This section will describe the query language used to define sets
+ of join points. As of version 1.4.0 of the OTDT this query language is not yet supported.</em></strong></p>
+ </div>
+ <div class="sect depth2" id="s8.2">
+ <h2 class="sect">&sect;8.2&nbsp;Query expressions<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;8</a></span></h2>
+ </div>
+ <div class="sect depth2" id="s8.3">
+ <h2 class="sect">&sect;8.3&nbsp;OT/J meta model<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;8</a></span></h2>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s7.html" rel="prev">&lt;&lt;&nbsp;&sect;7&nbsp;Role Encapsulation</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s9.html" rel="next">&sect;9&nbsp;Value Dependent Classes&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s9.1.a.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s9.1.a.html
new file mode 100644
index 000000000..80d4bfad0
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s9.1.a.html
@@ -0,0 +1,49 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s9.1.b.html" rel="next">&sect;9.1.(b)&nbsp;Value parameter application&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s9.html" rel="section">&sect;9&nbsp;Value Dependent Classes</a>&nbsp;&gt;&nbsp;<a class="nav" href="s9.1.html" rel="section">&sect;9.1&nbsp;Defining classes with value parameters</a></div>
+ <div class="subsect depth3" id="s9.1.a">
+ <h4 class="subsect">&sect;9.1.(a)&nbsp;<span class="title">Value parameter declaration</span></h4>
+ <p>Within the angle brackets that mark the parameters of a generic class also value parameters
+ can be declared. In contrast to a type parameter, a value parameter is denoted as a pair
+ of two identifiers: a type and a free name, e.g.,
+
+ </p>
+ <div class="listing plain"><pre><b>class</b> MyClass<em>&lt;YourType aName&gt;</em> { ...</pre></div>
+ <p>Note that value parameters are valid for classes only, not for interfaces.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s9.1.b.html" rel="next">&sect;9.1.(b)&nbsp;Value parameter application&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s9.html" rel="section">&sect;9&nbsp;Value Dependent Classes</a>&nbsp;&gt;&nbsp;<a class="nav" href="s9.1.html" rel="section">&sect;9.1&nbsp;Defining classes with value parameters</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s9.1.b.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s9.1.b.html
new file mode 100644
index 000000000..ec0bc27d5
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s9.1.b.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s9.1.a.html" rel="prev">&lt;&lt;&nbsp;&sect;9.1.(a)&nbsp;Value parameter declaration</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s9.1.c.html" rel="next">&sect;9.1.(c)&nbsp;Role types as dependent types&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s9.html" rel="section">&sect;9&nbsp;Value Dependent Classes</a>&nbsp;&gt;&nbsp;<a class="nav" href="s9.1.html" rel="section">&sect;9.1&nbsp;Defining classes with value parameters</a></div>
+ <div class="subsect depth3" id="s9.1.b">
+ <h4 class="subsect">&sect;9.1.(b)&nbsp;<span class="title">Value parameter application</span></h4>
+ <p>Within the given class (<code>MyClass</code>) the parameter name (<code>aName</code>) can be used
+ like a final field of the given type (<code>YourType</code>). In contrast to regular final fields
+ the assignment to this name occurs even before the constructor is executed.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s9.1.a.html" rel="prev">&lt;&lt;&nbsp;&sect;9.1.(a)&nbsp;Value parameter declaration</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s9.1.c.html" rel="next">&sect;9.1.(c)&nbsp;Role types as dependent types&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s9.html" rel="section">&sect;9&nbsp;Value Dependent Classes</a>&nbsp;&gt;&nbsp;<a class="nav" href="s9.1.html" rel="section">&sect;9.1&nbsp;Defining classes with value parameters</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s9.1.c.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s9.1.c.html
new file mode 100644
index 000000000..5d4b85650
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s9.1.c.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s9.1.b.html" rel="prev">&lt;&lt;&nbsp;&sect;9.1.(b)&nbsp;Value parameter application</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s9.html" rel="section">&sect;9&nbsp;Value Dependent Classes</a>&nbsp;&gt;&nbsp;<a class="nav" href="s9.1.html" rel="section">&sect;9.1&nbsp;Defining classes with value parameters</a></div>
+ <div class="subsect depth3" id="s9.1.c">
+ <h4 class="subsect">&sect;9.1.(c)&nbsp;<span class="title">Role types as dependent types</span></h4>
+ <p>Any role type can be interpreted as a value dependent type, however, in the declaration
+ of a role type the value parameter remains implicit: it is identical to the enclosing team instance.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s9.1.b.html" rel="prev">&lt;&lt;&nbsp;&sect;9.1.(b)&nbsp;Value parameter application</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s9.html" rel="section">&sect;9&nbsp;Value Dependent Classes</a>&nbsp;&gt;&nbsp;<a class="nav" href="s9.1.html" rel="section">&sect;9.1&nbsp;Defining classes with value parameters</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s9.1.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s9.1.html
new file mode 100644
index 000000000..20736cc27
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s9.1.html
@@ -0,0 +1,68 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s9.2.html" rel="next">&sect;9.2&nbsp;Using classes with value parameters&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s9.html" rel="section">&sect;9&nbsp;Value Dependent Classes</a></div>
+ <div class="sect depth2" id="s9.1">
+ <h2 class="sect">&sect;9.1&nbsp;Defining classes with value parameters</h2>
+ <div class="syntaxlink"><a href="sA.html#sA.9.1" title="&sect;A.9.1&nbsp;TypeParameter" class="syntax">&rarr;&nbsp;Syntax&nbsp;&sect;A.9.1</a></div>
+ <div class="subsect depth3" id="s9.1.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Value parameter declaration</span></h4>
+ <p>Within the angle brackets that mark the parameters of a generic class also value parameters
+ can be declared. In contrast to a type parameter, a value parameter is denoted as a pair
+ of two identifiers: a type and a free name, e.g.,
+
+ </p>
+ <div class="listing plain"><pre><b>class</b> MyClass<em>&lt;YourType aName&gt;</em> { ...</pre></div>
+ <p>Note that value parameters are valid for classes only, not for interfaces.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s9.1.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Value parameter application</span></h4>
+ <p>Within the given class (<code>MyClass</code>) the parameter name (<code>aName</code>) can be used
+ like a final field of the given type (<code>YourType</code>). In contrast to regular final fields
+ the assignment to this name occurs even before the constructor is executed.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s9.1.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Role types as dependent types</span></h4>
+ <p>Any role type can be interpreted as a value dependent type, however, in the declaration
+ of a role type the value parameter remains implicit: it is identical to the enclosing team instance.
+
+ </p>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s9.2.html" rel="next">&sect;9.2&nbsp;Using classes with value parameters&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s9.html" rel="section">&sect;9&nbsp;Value Dependent Classes</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s9.2.1.a.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s9.2.1.a.html
new file mode 100644
index 000000000..a1198e4dc
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s9.2.1.a.html
@@ -0,0 +1,60 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s9.html" rel="section">&sect;9&nbsp;Value Dependent Classes</a>&nbsp;&gt;&nbsp;<a class="nav" href="s9.2.html" rel="section">&sect;9.2&nbsp;Using classes with value parameters</a>&nbsp;&gt;&nbsp;<a class="nav" href="s9.2.1.html" rel="section">&sect;9.2.1&nbsp;Parameter substitution</a></div>
+ <div class="subsect depth4" id="s9.2.1.a">
+ <h4 class="subsect">&sect;9.2.1.(a)&nbsp;<span class="title">Instance constrained type parameters</span></h4>
+ <p>In addition to normal usage, a value parameter can be applied nested to a regular type parameter:
+
+ </p>
+ <div class="listing plain"><pre><b>class</b> MyClass&lt;YourType aName, DependentParam&lt;<em>@aName&gt;</em>&gt; { ...</pre></div>
+ <p>
+ Here the type parameter <code>DependentParam</code> is constrained to be anchored to <code>aName</code>.
+
+ </p>
+ <p>If a value parameter is used as a constraint for a regular type parameter
+ any substitution for the type parameter must also supply a value matching the value parameter.
+ The class from above could be applied like this:
+
+ </p>
+ <div class="listing plain"><pre><b>final</b> YourType anchor = <b>new</b> YourType();
+MyClass <em>&lt;anchor, YourDependent&lt;<strong>anchor</strong>&gt;&gt;</em></pre></div>
+ <p>Within the declaring element (class or method)
+ applications of the type variable representing the instance constrained type parameter
+ must repeat the anchor verbatim, i.e., no substitutions are performed here.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s9.html" rel="section">&sect;9&nbsp;Value Dependent Classes</a>&nbsp;&gt;&nbsp;<a class="nav" href="s9.2.html" rel="section">&sect;9.2&nbsp;Using classes with value parameters</a>&nbsp;&gt;&nbsp;<a class="nav" href="s9.2.1.html" rel="section">&sect;9.2.1&nbsp;Parameter substitution</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s9.2.1.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s9.2.1.html
new file mode 100644
index 000000000..40c96a508
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s9.2.1.html
@@ -0,0 +1,83 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s9.2.2.html" rel="next">&sect;9.2.2&nbsp;Type conformance&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s9.html" rel="section">&sect;9&nbsp;Value Dependent Classes</a>&nbsp;&gt;&nbsp;<a class="nav" href="s9.2.html" rel="section">&sect;9.2&nbsp;Using classes with value parameters</a></div>
+ <div class="sect depth3" id="s9.2.1">
+ <h3 class="sect">&sect;9.2.1&nbsp;Parameter substitution</h3>
+ <p>Substitution of a type anchor of a class <code>MyClass&lt;YourType p&gt;</code> is denoted as
+ <code>MyClass&lt;@v&gt;</code>.
+ In this term <code>v</code> must be a value which is conform to the declaration of the value
+ parameter "<code>YourType p</code>", ie., <code>v</code> must have the static type <code>YourType</code>.
+ <br />
+ The value passed for substituting a type anchor must be a path of variables declared as <code>final</code>.
+ Obviously, only the first element in such a path can be a local variable or a method argument,
+ all other elements have to be fields. The reason for requiring final variables is
+ in type checking as discussed next.
+
+ </p>
+ <div class="note">
+ <h5>Note:</h5>
+ Externalized roles as defined in <a href="s1.2.2.b.html"
+ title="&sect;1.2.2.(b)&nbsp;Declaration with anchored type"
+ class="sect">&sect;1.2.2.(b)</a> are
+ a special case of types with a value parameter, where the value
+ is an instance of the enclosing team.
+
+ </div>
+ <div class="subsect depth4" id="s9.2.1.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Instance constrained type parameters</span></h4>
+ <p>In addition to normal usage, a value parameter can be applied nested to a regular type parameter:
+
+ </p>
+ <div class="listing plain"><pre><b>class</b> MyClass&lt;YourType aName, DependentParam&lt;<em>@aName&gt;</em>&gt; { ...</pre></div>
+ <p>
+ Here the type parameter <code>DependentParam</code> is constrained to be anchored to <code>aName</code>.
+
+ </p>
+ <p>If a value parameter is used as a constraint for a regular type parameter
+ any substitution for the type parameter must also supply a value matching the value parameter.
+ The class from above could be applied like this:
+
+ </p>
+ <div class="listing plain"><pre><b>final</b> YourType anchor = <b>new</b> YourType();
+MyClass <em>&lt;anchor, YourDependent&lt;<strong>anchor</strong>&gt;&gt;</em></pre></div>
+ <p>Within the declaring element (class or method)
+ applications of the type variable representing the instance constrained type parameter
+ must repeat the anchor verbatim, i.e., no substitutions are performed here.
+
+ </p>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s9.2.2.html" rel="next">&sect;9.2.2&nbsp;Type conformance&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s9.html" rel="section">&sect;9&nbsp;Value Dependent Classes</a>&nbsp;&gt;&nbsp;<a class="nav" href="s9.2.html" rel="section">&sect;9.2&nbsp;Using classes with value parameters</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s9.2.2.a.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s9.2.2.a.html
new file mode 100644
index 000000000..f5c1da0e2
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s9.2.2.a.html
@@ -0,0 +1,63 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s9.2.2.b.html" rel="next">&sect;9.2.2.(b)&nbsp;Conformance of raw types&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s9.html" rel="section">&sect;9&nbsp;Value Dependent Classes</a>&nbsp;&gt;&nbsp;<a class="nav" href="s9.2.html" rel="section">&sect;9.2&nbsp;Using classes with value parameters</a>&nbsp;&gt;&nbsp;<a class="nav" href="s9.2.2.html" rel="section">&sect;9.2.2&nbsp;Type conformance</a></div>
+ <div class="subsect depth4" id="s9.2.2.a">
+ <h4 class="subsect">&sect;9.2.2.(a)&nbsp;<span class="title">Substitutions for type anchors</span></h4>
+ <p>Only two substitutions are considered for determining anchor identity:
+
+ </p>
+ <ol>
+ <li>If a method signature uses <code>this</code> as the anchor of any of its types,
+ type checking an application of this method performs the following substitutions:
+ <br />
+ A simple <code>this</code> expression is substituted by the actual call target
+ of the method application.
+ <br />
+ A qualified <code>Outer.this</code> expression is substituted by the corresponding
+ enclosing instance of the call target.
+ </li>
+ <li>Assignments from a <code>final</code> identifier to another <code>final</code>
+ identifier are transitively followed, i.e., if <code>t1, t2</code> are final,
+ after an assignment <code>t1=t2</code> the types <code>C&lt;@t1&gt;</code> and
+ <code>C&lt;@t2&gt;</code> are considered identical. Otherwise <code>C&lt;@t1&gt;</code>
+ and <code>C&lt;@t2&gt;</code> are incommensurable.
+ <br />
+ Attaching an actual parameter to a formal parameter in a method call is also considered
+ as an assignment with respect to this rule.
+ </li>
+ </ol>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s9.2.2.b.html" rel="next">&sect;9.2.2.(b)&nbsp;Conformance of raw types&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s9.html" rel="section">&sect;9&nbsp;Value Dependent Classes</a>&nbsp;&gt;&nbsp;<a class="nav" href="s9.2.html" rel="section">&sect;9.2&nbsp;Using classes with value parameters</a>&nbsp;&gt;&nbsp;<a class="nav" href="s9.2.2.html" rel="section">&sect;9.2.2&nbsp;Type conformance</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s9.2.2.b.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s9.2.2.b.html
new file mode 100644
index 000000000..5a1d7e414
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s9.2.2.b.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s9.2.2.a.html" rel="prev">&lt;&lt;&nbsp;&sect;9.2.2.(a)&nbsp;Substitutions for type anchors</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s9.html" rel="section">&sect;9&nbsp;Value Dependent Classes</a>&nbsp;&gt;&nbsp;<a class="nav" href="s9.2.html" rel="section">&sect;9.2&nbsp;Using classes with value parameters</a>&nbsp;&gt;&nbsp;<a class="nav" href="s9.2.2.html" rel="section">&sect;9.2.2&nbsp;Type conformance</a></div>
+ <div class="subsect depth4" id="s9.2.2.b">
+ <h4 class="subsect">&sect;9.2.2.(b)&nbsp;<span class="title">Conformance of raw types</span></h4>
+ <p>After anchors have been proven identical, the raw types are checked for compatibility
+ using the standard Java rules.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s9.2.2.a.html" rel="prev">&lt;&lt;&nbsp;&sect;9.2.2.(a)&nbsp;Substitutions for type anchors</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s9.html" rel="section">&sect;9&nbsp;Value Dependent Classes</a>&nbsp;&gt;&nbsp;<a class="nav" href="s9.2.html" rel="section">&sect;9.2&nbsp;Using classes with value parameters</a>&nbsp;&gt;&nbsp;<a class="nav" href="s9.2.2.html" rel="section">&sect;9.2.2&nbsp;Type conformance</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s9.2.2.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s9.2.2.html
new file mode 100644
index 000000000..c7692585e
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s9.2.2.html
@@ -0,0 +1,78 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s9.2.1.html" rel="prev">&lt;&lt;&nbsp;&sect;9.2.1&nbsp;Parameter substitution</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s9.html" rel="section">&sect;9&nbsp;Value Dependent Classes</a>&nbsp;&gt;&nbsp;<a class="nav" href="s9.2.html" rel="section">&sect;9.2&nbsp;Using classes with value parameters</a></div>
+ <div class="sect depth3" id="s9.2.2">
+ <h3 class="sect">&sect;9.2.2&nbsp;Type conformance</h3>
+ <p>Two value dependent types (anchored types) are considered conform only if the anchors
+ of both types refer to <i>the same object(s)</i>. The compiler must be able to statically
+ analyze this anchor identity.
+
+ </p>
+ <div class="subsect depth4" id="s9.2.2.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Substitutions for type anchors</span></h4>
+ <p>Only two substitutions are considered for determining anchor identity:
+
+ </p>
+ <ol>
+ <li>If a method signature uses <code>this</code> as the anchor of any of its types,
+ type checking an application of this method performs the following substitutions:
+ <br />
+ A simple <code>this</code> expression is substituted by the actual call target
+ of the method application.
+ <br />
+ A qualified <code>Outer.this</code> expression is substituted by the corresponding
+ enclosing instance of the call target.
+ </li>
+ <li>Assignments from a <code>final</code> identifier to another <code>final</code>
+ identifier are transitively followed, i.e., if <code>t1, t2</code> are final,
+ after an assignment <code>t1=t2</code> the types <code>C&lt;@t1&gt;</code> and
+ <code>C&lt;@t2&gt;</code> are considered identical. Otherwise <code>C&lt;@t1&gt;</code>
+ and <code>C&lt;@t2&gt;</code> are incommensurable.
+ <br />
+ Attaching an actual parameter to a formal parameter in a method call is also considered
+ as an assignment with respect to this rule.
+ </li>
+ </ol>
+ </div>
+ <div class="subsect depth4" id="s9.2.2.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Conformance of raw types</span></h4>
+ <p>After anchors have been proven identical, the raw types are checked for compatibility
+ using the standard Java rules.
+
+ </p>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s9.2.1.html" rel="prev">&lt;&lt;&nbsp;&sect;9.2.1&nbsp;Parameter substitution</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s9.html" rel="section">&sect;9&nbsp;Value Dependent Classes</a>&nbsp;&gt;&nbsp;<a class="nav" href="s9.2.html" rel="section">&sect;9.2&nbsp;Using classes with value parameters</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s9.2.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s9.2.html
new file mode 100644
index 000000000..cfa9d6373
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s9.2.html
@@ -0,0 +1,133 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s9.1.html" rel="prev">&lt;&lt;&nbsp;&sect;9.1&nbsp;Defining classes with value parameters</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s9.3.html" rel="next">&sect;9.3&nbsp;Restrictions and limitations&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s9.html" rel="section">&sect;9&nbsp;Value Dependent Classes</a></div>
+ <div class="sect depth2" id="s9.2">
+ <h2 class="sect">&sect;9.2&nbsp;Using classes with value parameters</h2>
+ <div class="syntaxlink"><a href="sA.html#sA.9.2" title="&sect;A.9.2&nbsp;ActualTypeArgument"
+ class="syntax">&rarr;&nbsp;Syntax&nbsp;&sect;A.9.2</a></div>
+ <p>When using a class which declares one or more value parameters (type anchors)
+ a corresponding <strong>anchor value</strong> has to be provided.
+
+ </p>
+ <div class="sect depth3" id="s9.2.1">
+ <h3 class="sect">&sect;9.2.1&nbsp;Parameter substitution<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;9.2</a></span></h3>
+ <p>Substitution of a type anchor of a class <code>MyClass&lt;YourType p&gt;</code> is denoted as
+ <code>MyClass&lt;@v&gt;</code>.
+ In this term <code>v</code> must be a value which is conform to the declaration of the value
+ parameter "<code>YourType p</code>", ie., <code>v</code> must have the static type <code>YourType</code>.
+ <br />
+ The value passed for substituting a type anchor must be a path of variables declared as <code>final</code>.
+ Obviously, only the first element in such a path can be a local variable or a method argument,
+ all other elements have to be fields. The reason for requiring final variables is
+ in type checking as discussed next.
+
+ </p>
+ <div class="note">
+ <h5>Note:</h5>
+ Externalized roles as defined in <a href="s1.2.2.b.html"
+ title="&sect;1.2.2.(b)&nbsp;Declaration with anchored type"
+ class="sect">&sect;1.2.2.(b)</a> are
+ a special case of types with a value parameter, where the value
+ is an instance of the enclosing team.
+
+ </div>
+ <div class="subsect depth4" id="s9.2.1.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Instance constrained type parameters</span></h4>
+ <p>In addition to normal usage, a value parameter can be applied nested to a regular type parameter:
+
+ </p>
+ <div class="listing plain"><pre><b>class</b> MyClass&lt;YourType aName, DependentParam&lt;<em>@aName&gt;</em>&gt; { ...</pre></div>
+ <p>
+ Here the type parameter <code>DependentParam</code> is constrained to be anchored to <code>aName</code>.
+
+ </p>
+ <p>If a value parameter is used as a constraint for a regular type parameter
+ any substitution for the type parameter must also supply a value matching the value parameter.
+ The class from above could be applied like this:
+
+ </p>
+ <div class="listing plain"><pre><b>final</b> YourType anchor = <b>new</b> YourType();
+MyClass <em>&lt;anchor, YourDependent&lt;<strong>anchor</strong>&gt;&gt;</em></pre></div>
+ <p>Within the declaring element (class or method)
+ applications of the type variable representing the instance constrained type parameter
+ must repeat the anchor verbatim, i.e., no substitutions are performed here.
+
+ </p>
+ </div>
+ </div>
+ <div class="sect depth3" id="s9.2.2">
+ <h3 class="sect">&sect;9.2.2&nbsp;Type conformance<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;9.2</a></span></h3>
+ <p>Two value dependent types (anchored types) are considered conform only if the anchors
+ of both types refer to <i>the same object(s)</i>. The compiler must be able to statically
+ analyze this anchor identity.
+
+ </p>
+ <div class="subsect depth4" id="s9.2.2.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Substitutions for type anchors</span></h4>
+ <p>Only two substitutions are considered for determining anchor identity:
+
+ </p>
+ <ol>
+ <li>If a method signature uses <code>this</code> as the anchor of any of its types,
+ type checking an application of this method performs the following substitutions:
+ <br />
+ A simple <code>this</code> expression is substituted by the actual call target
+ of the method application.
+ <br />
+ A qualified <code>Outer.this</code> expression is substituted by the corresponding
+ enclosing instance of the call target.
+ </li>
+ <li>Assignments from a <code>final</code> identifier to another <code>final</code>
+ identifier are transitively followed, i.e., if <code>t1, t2</code> are final,
+ after an assignment <code>t1=t2</code> the types <code>C&lt;@t1&gt;</code> and
+ <code>C&lt;@t2&gt;</code> are considered identical. Otherwise <code>C&lt;@t1&gt;</code>
+ and <code>C&lt;@t2&gt;</code> are incommensurable.
+ <br />
+ Attaching an actual parameter to a formal parameter in a method call is also considered
+ as an assignment with respect to this rule.
+ </li>
+ </ol>
+ </div>
+ <div class="subsect depth4" id="s9.2.2.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Conformance of raw types</span></h4>
+ <p>After anchors have been proven identical, the raw types are checked for compatibility
+ using the standard Java rules.
+
+ </p>
+ </div>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s9.1.html" rel="prev">&lt;&lt;&nbsp;&sect;9.1&nbsp;Defining classes with value parameters</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s9.3.html" rel="next">&sect;9.3&nbsp;Restrictions and limitations&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s9.html" rel="section">&sect;9&nbsp;Value Dependent Classes</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s9.3.a.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s9.3.a.html
new file mode 100644
index 000000000..27b0b61d6
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s9.3.a.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s9.3.b.html" rel="next">&sect;9.3.(b)&nbsp;Only first parameter&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s9.html" rel="section">&sect;9&nbsp;Value Dependent Classes</a>&nbsp;&gt;&nbsp;<a class="nav" href="s9.3.html" rel="section">&sect;9.3&nbsp;Restrictions and limitations</a></div>
+ <div class="subsect depth3" id="s9.3.a">
+ <h4 class="subsect">&sect;9.3.(a)&nbsp;<span class="title">No overriding</span></h4>
+ <p>Types with value parameters that are declared outside a team cannot be overridden,
+ as roles can be. Therefor, implicit inheritance does not apply for these types.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="s9.3.b.html" rel="next">&sect;9.3.(b)&nbsp;Only first parameter&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s9.html" rel="section">&sect;9&nbsp;Value Dependent Classes</a>&nbsp;&gt;&nbsp;<a class="nav" href="s9.3.html" rel="section">&sect;9.3&nbsp;Restrictions and limitations</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s9.3.b.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s9.3.b.html
new file mode 100644
index 000000000..9864912c8
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s9.3.b.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s9.3.a.html" rel="prev">&lt;&lt;&nbsp;&sect;9.3.(a)&nbsp;No overriding</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s9.html" rel="section">&sect;9&nbsp;Value Dependent Classes</a>&nbsp;&gt;&nbsp;<a class="nav" href="s9.3.html" rel="section">&sect;9.3&nbsp;Restrictions and limitations</a></div>
+ <div class="subsect depth3" id="s9.3.b">
+ <h4 class="subsect">&sect;9.3.(b)&nbsp;<span class="title">Only first parameter</span></h4>
+ <div class="note">
+ <p>Currently only the first parameter of a class may be a value parameter.
+ This restriction may be removed in the future.
+ </p>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s9.3.a.html" rel="prev">&lt;&lt;&nbsp;&sect;9.3.(a)&nbsp;No overriding</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s9.html" rel="section">&sect;9&nbsp;Value Dependent Classes</a>&nbsp;&gt;&nbsp;<a class="nav" href="s9.3.html" rel="section">&sect;9.3&nbsp;Restrictions and limitations</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s9.3.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s9.3.html
new file mode 100644
index 000000000..3365171b8
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s9.3.html
@@ -0,0 +1,55 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s9.2.html" rel="prev">&lt;&lt;&nbsp;&sect;9.2&nbsp;Using classes with value parameters</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s9.html" rel="section">&sect;9&nbsp;Value Dependent Classes</a></div>
+ <div class="sect depth2" id="s9.3">
+ <h2 class="sect">&sect;9.3&nbsp;Restrictions and limitations</h2>
+ <div class="subsect depth3" id="s9.3.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">No overriding</span></h4>
+ <p>Types with value parameters that are declared outside a team cannot be overridden,
+ as roles can be. Therefor, implicit inheritance does not apply for these types.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s9.3.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Only first parameter</span></h4>
+ <div class="note">
+ <p>Currently only the first parameter of a class may be a value parameter.
+ This restriction may be removed in the future.
+ </p>
+ </div>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s9.2.html" rel="prev">&lt;&lt;&nbsp;&sect;9.2&nbsp;Using classes with value parameters</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="s9.html" rel="section">&sect;9&nbsp;Value Dependent Classes</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s9.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s9.html
new file mode 100644
index 000000000..4e0bd6038
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/s9.html
@@ -0,0 +1,217 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s8.html" rel="prev">&lt;&lt;&nbsp;&sect;8&nbsp;Join Point Queries</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="sA.html" rel="next">&sect;A&nbsp;OT/J Syntax&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"></div>
+ <div class="chapter" id="s9">
+ <div class="headl">
+ <div class="headr">
+ <h1>&sect;9&nbsp;Value Dependent Classes</h1>
+ </div>
+ </div>
+ <div id="toc-box">
+ <ul class="toc-box">
+ <li><a href="s9.html">&sect;9&nbsp;Value Dependent Classes</a></li>
+ <li><a href="#s9.1">&sect;9.1&nbsp;Defining classes with value parameters</a></li>
+ <li><a href="#s9.2">&sect;9.2&nbsp;Using classes with value parameters</a></li>
+ <li><a href="#s9.3">&sect;9.3&nbsp;Restrictions and limitations</a></li>
+ </ul>
+ </div>
+ <div class="intro">
+ <h3>Generalizing externalized roles</h3>
+ <div class="line"></div>
+ <div class="term">Type Value Parameter</div>
+ <div class="termdesc">In addition to regular generics, a class may declare parameters that represent an object value.
+ Such a value parameter is called the <strong>type anchor</strong> for this class,
+ the class's type is said to be <strong>anchored</strong> to this parameter.
+ </div>
+ <div class="line"></div>
+ <div class="term">Value Dependent Classes</div>
+ <div class="termdesc">A class that declares one or more value parameters depends on the
+ runtime instance(s) denoted by its anchor(s).
+ </div>
+ <div class="line"></div>
+ <div class="term">Externalized Roles</div>
+ <div class="termdesc">The concept of externalized roles (<a href="s1.2.2.html" title="&sect;1.2.2&nbsp;Externalized roles" class="sect">&sect;1.2.2</a>)
+ is a special case of the concepts presented here.
+ </div>
+ <div class="line"></div>
+ </div>
+ <div class="sect depth2" id="s9.1">
+ <h2 class="sect">&sect;9.1&nbsp;Defining classes with value parameters<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;9</a></span></h2>
+ <div class="syntaxlink"><a href="sA.html#sA.9.1" title="&sect;A.9.1&nbsp;TypeParameter" class="syntax">&rarr;&nbsp;Syntax&nbsp;&sect;A.9.1</a></div>
+ <div class="subsect depth3" id="s9.1.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Value parameter declaration</span></h4>
+ <p>Within the angle brackets that mark the parameters of a generic class also value parameters
+ can be declared. In contrast to a type parameter, a value parameter is denoted as a pair
+ of two identifiers: a type and a free name, e.g.,
+
+ </p>
+ <div class="listing plain"><pre><b>class</b> MyClass<em>&lt;YourType aName&gt;</em> { ...</pre></div>
+ <p>Note that value parameters are valid for classes only, not for interfaces.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s9.1.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Value parameter application</span></h4>
+ <p>Within the given class (<code>MyClass</code>) the parameter name (<code>aName</code>) can be used
+ like a final field of the given type (<code>YourType</code>). In contrast to regular final fields
+ the assignment to this name occurs even before the constructor is executed.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s9.1.c">
+ <h4 class="subsect">(c)&nbsp;<span class="title">Role types as dependent types</span></h4>
+ <p>Any role type can be interpreted as a value dependent type, however, in the declaration
+ of a role type the value parameter remains implicit: it is identical to the enclosing team instance.
+
+ </p>
+ </div>
+ </div>
+ <div class="sect depth2" id="s9.2">
+ <h2 class="sect">&sect;9.2&nbsp;Using classes with value parameters<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;9</a></span></h2>
+ <div class="syntaxlink"><a href="sA.html#sA.9.2" title="&sect;A.9.2&nbsp;ActualTypeArgument"
+ class="syntax">&rarr;&nbsp;Syntax&nbsp;&sect;A.9.2</a></div>
+ <p>When using a class which declares one or more value parameters (type anchors)
+ a corresponding <strong>anchor value</strong> has to be provided.
+
+ </p>
+ <div class="sect depth3" id="s9.2.1">
+ <h3 class="sect">&sect;9.2.1&nbsp;Parameter substitution<span class="toplink"><a href="#s9.2">&uarr;&nbsp;&sect;9.2</a></span></h3>
+ <p>Substitution of a type anchor of a class <code>MyClass&lt;YourType p&gt;</code> is denoted as
+ <code>MyClass&lt;@v&gt;</code>.
+ In this term <code>v</code> must be a value which is conform to the declaration of the value
+ parameter "<code>YourType p</code>", ie., <code>v</code> must have the static type <code>YourType</code>.
+ <br />
+ The value passed for substituting a type anchor must be a path of variables declared as <code>final</code>.
+ Obviously, only the first element in such a path can be a local variable or a method argument,
+ all other elements have to be fields. The reason for requiring final variables is
+ in type checking as discussed next.
+
+ </p>
+ <div class="note">
+ <h5>Note:</h5>
+ Externalized roles as defined in <a href="s1.2.2.b.html"
+ title="&sect;1.2.2.(b)&nbsp;Declaration with anchored type"
+ class="sect">&sect;1.2.2.(b)</a> are
+ a special case of types with a value parameter, where the value
+ is an instance of the enclosing team.
+
+ </div>
+ <div class="subsect depth4" id="s9.2.1.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Instance constrained type parameters</span></h4>
+ <p>In addition to normal usage, a value parameter can be applied nested to a regular type parameter:
+
+ </p>
+ <div class="listing plain"><pre><b>class</b> MyClass&lt;YourType aName, DependentParam&lt;<em>@aName&gt;</em>&gt; { ...</pre></div>
+ <p>
+ Here the type parameter <code>DependentParam</code> is constrained to be anchored to <code>aName</code>.
+
+ </p>
+ <p>If a value parameter is used as a constraint for a regular type parameter
+ any substitution for the type parameter must also supply a value matching the value parameter.
+ The class from above could be applied like this:
+
+ </p>
+ <div class="listing plain"><pre><b>final</b> YourType anchor = <b>new</b> YourType();
+MyClass <em>&lt;anchor, YourDependent&lt;<strong>anchor</strong>&gt;&gt;</em></pre></div>
+ <p>Within the declaring element (class or method)
+ applications of the type variable representing the instance constrained type parameter
+ must repeat the anchor verbatim, i.e., no substitutions are performed here.
+
+ </p>
+ </div>
+ </div>
+ <div class="sect depth3" id="s9.2.2">
+ <h3 class="sect">&sect;9.2.2&nbsp;Type conformance<span class="toplink"><a href="#s9.2">&uarr;&nbsp;&sect;9.2</a></span></h3>
+ <p>Two value dependent types (anchored types) are considered conform only if the anchors
+ of both types refer to <i>the same object(s)</i>. The compiler must be able to statically
+ analyze this anchor identity.
+
+ </p>
+ <div class="subsect depth4" id="s9.2.2.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">Substitutions for type anchors</span></h4>
+ <p>Only two substitutions are considered for determining anchor identity:
+
+ </p>
+ <ol>
+ <li>If a method signature uses <code>this</code> as the anchor of any of its types,
+ type checking an application of this method performs the following substitutions:
+ <br />
+ A simple <code>this</code> expression is substituted by the actual call target
+ of the method application.
+ <br />
+ A qualified <code>Outer.this</code> expression is substituted by the corresponding
+ enclosing instance of the call target.
+ </li>
+ <li>Assignments from a <code>final</code> identifier to another <code>final</code>
+ identifier are transitively followed, i.e., if <code>t1, t2</code> are final,
+ after an assignment <code>t1=t2</code> the types <code>C&lt;@t1&gt;</code> and
+ <code>C&lt;@t2&gt;</code> are considered identical. Otherwise <code>C&lt;@t1&gt;</code>
+ and <code>C&lt;@t2&gt;</code> are incommensurable.
+ <br />
+ Attaching an actual parameter to a formal parameter in a method call is also considered
+ as an assignment with respect to this rule.
+ </li>
+ </ol>
+ </div>
+ <div class="subsect depth4" id="s9.2.2.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Conformance of raw types</span></h4>
+ <p>After anchors have been proven identical, the raw types are checked for compatibility
+ using the standard Java rules.
+
+ </p>
+ </div>
+ </div>
+ </div>
+ <div class="sect depth2" id="s9.3">
+ <h2 class="sect">&sect;9.3&nbsp;Restrictions and limitations<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;9</a></span></h2>
+ <div class="subsect depth3" id="s9.3.a">
+ <h4 class="subsect">(a)&nbsp;<span class="title">No overriding</span></h4>
+ <p>Types with value parameters that are declared outside a team cannot be overridden,
+ as roles can be. Therefor, implicit inheritance does not apply for these types.
+
+ </p>
+ </div>
+ <div class="subsect depth3" id="s9.3.b">
+ <h4 class="subsect">(b)&nbsp;<span class="title">Only first parameter</span></h4>
+ <div class="note">
+ <p>Currently only the first parameter of a class may be a value parameter.
+ This restriction may be removed in the future.
+ </p>
+ </div>
+ </div>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s8.html" rel="prev">&lt;&lt;&nbsp;&sect;8&nbsp;Join Point Queries</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="sA.html" rel="next">&sect;A&nbsp;OT/J Syntax&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sA.0.1.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sA.0.1.html
new file mode 100644
index 000000000..e43eebdf1
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sA.0.1.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="sA.0.2.html" rel="next">&sect;A.0.2&nbsp;Inheriting scoped keywords&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="sA.html" rel="section">&sect;A&nbsp;OT/J Syntax</a>&nbsp;&gt;&nbsp;<a class="nav" href="sA.0.html" rel="section">&sect;A.0&nbsp;Keywords</a></div>
+ <div class="sect depth3" id="sA.0.1">
+ <h3 class="sect">&sect;A.0.1&nbsp;Scoped keywords</h3>
+ <p>The following names are keywords in OT/J only if they appear within a team or role class,
+ ie., after the keyword <strong class="blue">team</strong> has been recognized:
+
+ </p>
+ <div class="listing plain"><pre>as, base, callin, playedBy, precedence, tsuper, with, when</pre></div>
+ <p>These names are keywords only in the context of a callin or callout binding
+ respectively (<a href="sA.3.html" title="&sect;A.3&nbsp;Method bindings" class="sect">&sect;A.3</a>):
+
+ </p>
+ <div class="listing plain"><pre>after, before, replace, get, set</pre></div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="sA.0.2.html" rel="next">&sect;A.0.2&nbsp;Inheriting scoped keywords&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="sA.html" rel="section">&sect;A&nbsp;OT/J Syntax</a>&nbsp;&gt;&nbsp;<a class="nav" href="sA.0.html" rel="section">&sect;A.0&nbsp;Keywords</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sA.0.2.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sA.0.2.html
new file mode 100644
index 000000000..cd2a7ceb3
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sA.0.2.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="sA.0.1.html" rel="prev">&lt;&lt;&nbsp;&sect;A.0.1&nbsp;Scoped keywords</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="sA.0.3.html" rel="next">&sect;A.0.3&nbsp;Internal names&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="sA.html" rel="section">&sect;A&nbsp;OT/J Syntax</a>&nbsp;&gt;&nbsp;<a class="nav" href="sA.0.html" rel="section">&sect;A.0&nbsp;Keywords</a></div>
+ <div class="sect depth3" id="sA.0.2">
+ <h3 class="sect">&sect;A.0.2&nbsp;Inheriting scoped keywords</h3>
+ <p>While regular Java classes may use the scoped keywords
+ (<a href="sA.0.1.html" title="&sect;A.0.1&nbsp;Scoped keywords" class="sect">&sect;A.0.1</a>) of OT/J freely, it is an error if a role class
+ inherits a feature whose name is a scoped keyword.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="sA.0.1.html" rel="prev">&lt;&lt;&nbsp;&sect;A.0.1&nbsp;Scoped keywords</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="sA.0.3.html" rel="next">&sect;A.0.3&nbsp;Internal names&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="sA.html" rel="section">&sect;A&nbsp;OT/J Syntax</a>&nbsp;&gt;&nbsp;<a class="nav" href="sA.0.html" rel="section">&sect;A.0&nbsp;Keywords</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sA.0.3.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sA.0.3.html
new file mode 100644
index 000000000..1c8a5532b
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sA.0.3.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="sA.0.2.html" rel="prev">&lt;&lt;&nbsp;&sect;A.0.2&nbsp;Inheriting scoped keywords</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="sA.html" rel="section">&sect;A&nbsp;OT/J Syntax</a>&nbsp;&gt;&nbsp;<a class="nav" href="sA.0.html" rel="section">&sect;A.0&nbsp;Keywords</a></div>
+ <div class="sect depth3" id="sA.0.3">
+ <h3 class="sect">&sect;A.0.3&nbsp;Internal names</h3>
+ <p>Compiler and runtime environment generate internal methods and fields which start with
+ the prefix <code>_OT$</code>. It is illegal to use any of these methods and fields within client code.
+
+ </p>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="sA.0.2.html" rel="prev">&lt;&lt;&nbsp;&sect;A.0.2&nbsp;Inheriting scoped keywords</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="sA.html" rel="section">&sect;A&nbsp;OT/J Syntax</a>&nbsp;&gt;&nbsp;<a class="nav" href="sA.0.html" rel="section">&sect;A.0&nbsp;Keywords</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sA.0.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sA.0.html
new file mode 100644
index 000000000..6f370b5e6
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sA.0.html
@@ -0,0 +1,74 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="sA.1.html" rel="next">&sect;A.1&nbsp;Class definitions&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="sA.html" rel="section">&sect;A&nbsp;OT/J Syntax</a></div>
+ <div class="sect depth2" id="sA.0">
+ <h2 class="sect">&sect;A.0&nbsp;Keywords</h2>
+ <p>The keywords introduced by OT/J have different scopes, which means outside their
+ given scope these keywords can be used for regular identifiers. Only these names
+ are keywords unconditionally:
+
+ </p>
+ <div class="listing plain"><pre>readonly, team, within</pre></div>
+ <div class="sect depth3" id="sA.0.1">
+ <h3 class="sect">&sect;A.0.1&nbsp;Scoped keywords<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;A.0</a></span></h3>
+ <p>The following names are keywords in OT/J only if they appear within a team or role class,
+ ie., after the keyword <strong class="blue">team</strong> has been recognized:
+
+ </p>
+ <div class="listing plain"><pre>as, base, callin, playedBy, precedence, tsuper, with, when</pre></div>
+ <p>These names are keywords only in the context of a callin or callout binding
+ respectively (<a href="sA.3.html" title="&sect;A.3&nbsp;Method bindings" class="sect">&sect;A.3</a>):
+
+ </p>
+ <div class="listing plain"><pre>after, before, replace, get, set</pre></div>
+ </div>
+ <div class="sect depth3" id="sA.0.2">
+ <h3 class="sect">&sect;A.0.2&nbsp;Inheriting scoped keywords<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;A.0</a></span></h3>
+ <p>While regular Java classes may use the scoped keywords
+ (<a href="#sA.0.1" title="&sect;A.0.1&nbsp;Scoped keywords" class="sect">&sect;A.0.1</a>) of OT/J freely, it is an error if a role class
+ inherits a feature whose name is a scoped keyword.
+
+ </p>
+ </div>
+ <div class="sect depth3" id="sA.0.3">
+ <h3 class="sect">&sect;A.0.3&nbsp;Internal names<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;A.0</a></span></h3>
+ <p>Compiler and runtime environment generate internal methods and fields which start with
+ the prefix <code>_OT$</code>. It is illegal to use any of these methods and fields within client code.
+
+ </p>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="sA.1.html" rel="next">&sect;A.1&nbsp;Class definitions&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="sA.html" rel="section">&sect;A&nbsp;OT/J Syntax</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sA.1.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sA.1.html
new file mode 100644
index 000000000..0c833a1a5
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sA.1.html
@@ -0,0 +1,72 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="sA.0.html" rel="prev">&lt;&lt;&nbsp;&sect;A.0&nbsp;Keywords</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="sA.2.html" rel="next">&sect;A.2&nbsp;Modifiers&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="sA.html" rel="section">&sect;A&nbsp;OT/J Syntax</a></div>
+ <div class="sect depth2" id="sA.1">
+ <h2 class="sect">&sect;A.1&nbsp;Class definitions</h2>
+ <p>Class definitions add two new keywords <code>team</code> and
+ <code>playedBy</code>. Classes which use these keywords are called
+ <strong>teams</strong> and <strong>bound roles</strong>, respectively.
+ Any class that inherits from a bound role class (either by an
+ <code>extends</code> clause or by implicit inheritance, cf.
+ <a href="s1.3.1.c.html"
+ title="&sect;1.3.1.(c)&nbsp;Overriding and implicit inheritance"
+ class="sect">&sect;1.3.1.(c)</a>) is again a bound role class.
+
+ </p>
+ <table class="syntaxrule" id="sA.1.1">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.1.1</td>
+ <td class="rule"><span class="title">ClassDeclaration</span><br /><em>[Modifiers] </em><strong class="blue"><em>[</em>team<em>]</em></strong> class <em>Identifier [</em>extends <em>Type] [</em>implements <em>TypeList]</em><br /><span class="indent5"></span><strong class="blue"><em>[</em>playedBy <em>Type] [Guard]</em></strong><em> ClassBody</em></td>
+ </tr>
+ </table>
+ <div class="constraints">
+ <h5 class="constraints">Contextual constraints:</h5>
+ <ol class="constraints">
+ <li>A class which has a <code>playedBy</code> clause (a <strong>bound
+ role</strong> class) may not be declared static and
+ must be directly contained in a class that has the
+ <code>team</code> modifier (a <strong>team</strong> class).
+ </li>
+ <li>A class which inherits from a team class must have the
+ <code>team</code> modifier, too.
+ </li>
+ <li>A class which has a guard (see <a href="s5.4.html" title="&sect;5.4&nbsp;Guard predicates" class="sect">&sect;5.4</a>)
+ must be a team or a role.
+ </li>
+ </ol>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="sA.0.html" rel="prev">&lt;&lt;&nbsp;&sect;A.0&nbsp;Keywords</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="sA.2.html" rel="next">&sect;A.2&nbsp;Modifiers&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="sA.html" rel="section">&sect;A&nbsp;OT/J Syntax</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sA.10.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sA.10.html
new file mode 100644
index 000000000..6759f6fb4
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sA.10.html
@@ -0,0 +1,56 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="sA.9.html" rel="prev">&lt;&lt;&nbsp;&sect;A.9&nbsp;Value dependent types</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="sA.html" rel="section">&sect;A&nbsp;OT/J Syntax</a></div>
+ <div class="sect depth2" id="sA.10">
+ <h2 class="sect">&sect;A.10&nbsp;Packages and imports</h2>
+ <table class="syntaxrule" id="sA.10.1">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.10.1</td>
+ <td class="rule"><span class="title">PackageDeclaration</span><br />...<br /><strong class="blue">team </strong><em>QualifiedName</em> ;
+
+ </td>
+ </tr>
+ </table>
+ <table class="syntaxrule" id="sA.10.2">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.10.2</td>
+ <td class="rule"><span class="title">Import</span><br />...<br /><strong>import </strong><strong class="blue">base </strong><em>QualifiedName</em> ;
+
+ </td>
+ </tr>
+ </table>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="sA.9.html" rel="prev">&lt;&lt;&nbsp;&sect;A.9&nbsp;Value dependent types</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="sA.html" rel="section">&sect;A&nbsp;OT/J Syntax</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sA.2.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sA.2.html
new file mode 100644
index 000000000..fedbbba54
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sA.2.html
@@ -0,0 +1,60 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="sA.1.html" rel="prev">&lt;&lt;&nbsp;&sect;A.1&nbsp;Class definitions</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="sA.3.html" rel="next">&sect;A.3&nbsp;Method bindings&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="sA.html" rel="section">&sect;A&nbsp;OT/J Syntax</a></div>
+ <div class="sect depth2" id="sA.2">
+ <h2 class="sect">&sect;A.2&nbsp;Modifiers</h2>
+ <p>The rule for method modifiers adds one keyword: <code>callin</code>:
+
+ </p>
+ <table class="syntaxrule" id="sA.2.1">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.2.1</td>
+ <td class="rule"><span class="title">Modifier</span><br />... <br /><strong class="blue">callin</strong></td>
+ </tr>
+ </table>
+ <div class="constraints">
+ <h5 class="constraints">Contextual constraints:</h5>
+ <ol class="constraints">
+ <li>The class of a method which has the <code>callin</code> modifier
+ may not be declared static and must be directly contained in a team class.
+ </li>
+ <li>A method that has the <code>callin</code> modifier may not
+ appear in an explicit method call (rule Apply in JLS).
+ </li>
+ </ol>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="sA.1.html" rel="prev">&lt;&lt;&nbsp;&sect;A.1&nbsp;Class definitions</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="sA.3.html" rel="next">&sect;A.3&nbsp;Method bindings&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="sA.html" rel="section">&sect;A&nbsp;OT/J Syntax</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sA.3.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sA.3.html
new file mode 100644
index 000000000..9cc33ec90
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sA.3.html
@@ -0,0 +1,131 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="sA.2.html" rel="prev">&lt;&lt;&nbsp;&sect;A.2&nbsp;Modifiers</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="sA.4.html" rel="next">&sect;A.4&nbsp;Parameter mappings&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="sA.html" rel="section">&sect;A&nbsp;OT/J Syntax</a></div>
+ <div class="sect depth2" id="sA.3">
+ <h2 class="sect">&sect;A.3&nbsp;Method bindings</h2>
+ <p>The rule of items declarable in a class body is augmented by method
+ bindings:
+
+ </p>
+ <table class="syntaxrule" id="sA.3.1">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.3.1</td>
+ <td class="rule"><span class="title">ClassBodyDeclaration</span><br />... <br /><strong class="blue"><em>CalloutBinding</em></strong><br /><strong class="blue"><em>CallinBinding</em></strong></td>
+ </tr>
+ </table>
+ <table class="syntaxrule" id="sA.3.2">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.3.2</td>
+ <td class="rule"><span class="title">CalloutBinding</span><br /><em>[Modifier] [TypeArguments] <strong class="blue">MethodSpec CalloutKind MethodSpec CalloutParameterMappings</strong></em><br /><em>[Modifier] [TypeArguments] <strong class="blue">MethodSpec CalloutKind CalloutModifier FieldSpec</strong></em></td>
+ </tr>
+ </table>
+ <table class="syntaxrule" id="sA.3.3">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.3.3</td>
+ <td class="rule"><span class="title">Callin binding</span><br /><em>[ Identifier </em>:<em> ] [TypeArguments]</em><strong class="blue"><em> MethodSpec</em> &lt;- <em>CallinModifier MethodSpecs </em><br /><span class="indent5"></span>
+ [<em>Guard</em>]<em> CallinParameterMappings</em></strong></td>
+ </tr>
+ </table>
+ <table class="syntaxrule" id="sA.3.4">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.3.4</td>
+ <td class="rule"><span class="title">MethodSpec</span><br /><em>Identifier</em><br /><em>ResultType MethodDeclarator</em></td>
+ </tr>
+ </table>
+ <div class="note">
+ Note, that <em>ResultType</em> and <em>MethodDeclarator</em> are not explicit in the
+ overall syntax of the Java language specification. For convenience we refer to the definition in
+ section <a href="http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#40420"
+ class="ext">8.4. Method Declarations</a>
+ of the Java language specification.
+
+ </div>
+ <table class="syntaxrule" id="sA.3.5">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.3.5</td>
+ <td class="rule"><span class="title">MethodSpecs</span><br /><strong class="blue"><em>MethodSpec [</em>, <em>MethodSpecs]</em></strong></td>
+ </tr>
+ </table>
+ <table class="syntaxrule" id="sA.3.6">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.3.6</td>
+ <td class="rule"><span class="title">CalloutKind</span><br /><strong class="blue">-&gt;<br />=&gt;</strong></td>
+ </tr>
+ </table>
+ <table class="syntaxrule" id="sA.3.7">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.3.7</td>
+ <td class="rule"><span class="title">CallinModifier</span><br /><strong class="blue">before</strong><br /><strong class="blue">after</strong><br /><strong class="blue">replace</strong></td>
+ </tr>
+ </table>
+ <table class="syntaxrule" id="sA.3.8">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.3.8</td>
+ <td class="rule"><span class="title">CalloutModifier</span><br /><strong class="blue">get</strong><br /><strong class="blue">set</strong></td>
+ </tr>
+ </table>
+ <table class="syntaxrule" id="sA.3.9">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.3.9</td>
+ <td class="rule"><span class="title">FieldSpec</span><br /><em>[Type] Identifier</em></td>
+ </tr>
+ </table>
+ <div class="constraints">
+ <h5 class="constraints">Contextual constraints:</h5>
+ <ol class="constraints">
+ <li><code>CalloutBinding</code>s and <code>CallinBinding</code>s
+ may occur only in bound role classes.
+ </li>
+ <li>A <code>CalloutBinding</code> or <code>CallinBinding</code>
+ may not mix identifiers and full signatures (<code>MethodDeclarationHead</code>)
+ for its method specifiers (<code>MethodSpec</code>).
+ <br />
+ Binding a full method signature to a field requires the <code>FieldSpec</code>
+ to include the <code>Type</code>.
+ </li>
+ <li>The method specifier at the left hand side of a
+ <code>CallinBinding</code> which has the <code>replace</code> modifier
+ must refer to a method that has the <code>callin</code> modifier.
+ </li>
+ <li>The <code>Modifier</code> of a callout binding can only be one of the visility
+ modifiers <code>public</code>, <code>protected</code> or <code>private</code>.
+ A short callout binding (i.e., without signatures) must not specify
+ a visibility modifier.
+ </li>
+ </ol>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="sA.2.html" rel="prev">&lt;&lt;&nbsp;&sect;A.2&nbsp;Modifiers</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="sA.4.html" rel="next">&sect;A.4&nbsp;Parameter mappings&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="sA.html" rel="section">&sect;A&nbsp;OT/J Syntax</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sA.4.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sA.4.html
new file mode 100644
index 000000000..4af459f55
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sA.4.html
@@ -0,0 +1,85 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="sA.3.html" rel="prev">&lt;&lt;&nbsp;&sect;A.3&nbsp;Method bindings</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="sA.5.html" rel="next">&sect;A.5&nbsp;Statements&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="sA.html" rel="section">&sect;A&nbsp;OT/J Syntax</a></div>
+ <div class="sect depth2" id="sA.4">
+ <h2 class="sect">&sect;A.4&nbsp;Parameter mappings</h2>
+ <table class="syntaxrule" id="sA.4.1">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.4.1</td>
+ <td class="rule"><span class="title">CalloutParameterMappings</span><br /><strong class="blue">with { <em>CalloutParameterMappingList [,]</em> }</strong><br /><strong class="blue">;</strong></td>
+ </tr>
+ </table>
+ <table class="syntaxrule" id="sA.4.2">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.4.2</td>
+ <td class="rule"><span class="title">CallinParameterMappings</span><br /><strong class="blue">with { <em>CallinParameterMappingList [,]</em> }</strong><br /><strong class="blue">;</strong></td>
+ </tr>
+ </table>
+ <table class="syntaxrule" id="sA.4.3">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.4.3</td>
+ <td class="rule"><span class="title">CalloutParameterMappingList</span><br /><strong class="blue"><em>CalloutParameterMapping [</em>,<em> CalloutParameterMappingList]</em></strong></td>
+ </tr>
+ </table>
+ <table class="syntaxrule" id="sA.4.4">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.4.4</td>
+ <td class="rule"><span class="title">CallinParameterMappingList</span><br /><strong class="blue"><em>CallinParameterMapping [</em>,<em> CallinParameterMappingList]</em></strong></td>
+ </tr>
+ </table>
+ <table class="syntaxrule" id="sA.4.5">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.4.5</td>
+ <td class="rule"><span class="title">CalloutParameterMapping</span><br /><em>Expression</em><strong class="blue"> -&gt; </strong><em>Identifier</em><br /><strong class="blue">result &lt;- </strong><em>Expression</em></td>
+ </tr>
+ </table>
+ <table class="syntaxrule" id="sA.4.6">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.4.6</td>
+ <td class="rule"><span class="title">CallinParameterMapping</span><br /><em>Identifier</em><strong class="blue"> &lt;- </strong><em>Expression</em><br /><em>Expression</em><strong class="blue"> -&gt; </strong><strong class="blue">result</strong></td>
+ </tr>
+ </table>
+ <div class="note">
+ <h5>Note:</h5>
+ By defining ";" as an option for parameter mappings, the grammar enforces that
+ method bindings without a parameter mapping are terminated by a ";".
+ Also method bindings with parameter mappings may optionally be terminated by a ";",
+ which in that case is interpreted as an empty member declaration, following the
+ same pattern how non-abstract methods in Java may optionally have a trailing ";".
+
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="sA.3.html" rel="prev">&lt;&lt;&nbsp;&sect;A.3&nbsp;Method bindings</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="sA.5.html" rel="next">&sect;A.5&nbsp;Statements&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="sA.html" rel="section">&sect;A&nbsp;OT/J Syntax</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sA.5.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sA.5.html
new file mode 100644
index 000000000..56a384e4a
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sA.5.html
@@ -0,0 +1,91 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="sA.4.html" rel="prev">&lt;&lt;&nbsp;&sect;A.4&nbsp;Parameter mappings</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="sA.6.html" rel="next">&sect;A.6&nbsp;Types&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="sA.html" rel="section">&sect;A&nbsp;OT/J Syntax</a></div>
+ <div class="sect depth2" id="sA.5">
+ <h2 class="sect">&sect;A.5&nbsp;Statements</h2>
+ <table class="syntaxrule" id="sA.5.1">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.5.1</td>
+ <td class="rule"><span class="title">Statement</span><br />... <br /><em><strong class="blue">Within</strong><br /><strong class="blue">BaseCall</strong><br /><strong class="blue">TSuperCall</strong></em></td>
+ </tr>
+ </table>
+ <table class="syntaxrule" id="sA.5.2">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.5.2</td>
+ <td class="rule"><span class="title">Within</span><br /><strong class="blue">within</strong> ( <em>Expression</em> ) <em>Statement</em></td>
+ </tr>
+ </table>
+ <table class="syntaxrule" id="sA.5.3">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.5.3</td>
+ <td class="rule"><span class="title">BaseCall</span><br /><strong class="blue">base</strong> . <em>Identifier</em> ( <em>Arguments<sub>opt</sub></em> )
+ <br /><strong class="blue">base</strong> ( <em>Arguments<sub>opt</sub></em> )
+
+ </td>
+ </tr>
+ </table>
+ <table class="syntaxrule" id="sA.5.4">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.5.4</td>
+ <td class="rule"><span class="title">TSuperCall</span><br /><strong class="blue">tsuper</strong> . <em>Identifier</em> ( <em>Arguments<sub>opt</sub></em> )
+ <br /><strong class="blue">tsuper</strong> ( <em>Arguments<sub>opt</sub></em> )
+
+ </td>
+ </tr>
+ </table>
+ <div class="constraints">
+ <h5 class="constraints">Contextual constraints:</h5>
+ <ol class="constraints">
+ <li>The expression of a <code>Within</code> must evaluate
+ to an instance of a team class.
+ </li>
+ <li>The first form of a <code>BaseCall</code> may occur only
+ in the body of a method that has the <code>callin</code> modifier.
+ The identifier must be the name of the enclosing method.
+ </li>
+ <li>The second form of a <code>BaseCall</code> may occur only in a constructor of a
+ bound role class.
+ </li>
+ <li>The first form of a <code>TSuperCall</code> may occur only in a method of
+ a role class.
+ </li>
+ <li>The second form of a <code>TSuperCall</code> may occur only in a constructor of a
+ role class.
+ </li>
+ </ol>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="sA.4.html" rel="prev">&lt;&lt;&nbsp;&sect;A.4&nbsp;Parameter mappings</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="sA.6.html" rel="next">&sect;A.6&nbsp;Types&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="sA.html" rel="section">&sect;A&nbsp;OT/J Syntax</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sA.6.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sA.6.html
new file mode 100644
index 000000000..257c375e6
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sA.6.html
@@ -0,0 +1,88 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="sA.5.html" rel="prev">&lt;&lt;&nbsp;&sect;A.5&nbsp;Statements</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="sA.7.html" rel="next">&sect;A.7&nbsp;Guard predicates&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="sA.html" rel="section">&sect;A&nbsp;OT/J Syntax</a></div>
+ <div class="sect depth2" id="sA.6">
+ <h2 class="sect">&sect;A.6&nbsp;Types</h2>
+ <table class="syntaxrule" id="sA.6.1">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.6.1</td>
+ <td class="rule"><span class="title">Type</span><br />... <br /><strong class="blue"><em>LiftingType</em></strong><br /><strong class="blue"><em>AnchoredType</em></strong></td>
+ </tr>
+ </table>
+ <table class="syntaxrule" id="sA.6.2">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.6.2</td>
+ <td class="rule"><span class="title">LiftingType</span><br /><em>Type</em><strong class="blue"> as </strong><em>Type</em></td>
+ </tr>
+ </table>
+ <table class="syntaxrule" id="sA.6.3">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.6.3</td>
+ <td class="rule"><span class="title">AnchoredType</span><br /><strong class="blue"><em>Path</em></strong>.<em>Type</em></td>
+ </tr>
+ </table>
+ <table class="syntaxrule" id="sA.6.4">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.6.4</td>
+ <td class="rule"><span class="title">Path</span><br /><em>Identifier</em><br /><strong class="blue"><em>Path</em></strong>.<em>Identifier</em></td>
+ </tr>
+ </table>
+ <div class="constraints">
+ <h5 class="constraints">Contextual constraints:</h5>
+ <ol class="constraints">
+ <li id="sA.6.a"><span class="title">Location</span><br />
+ A <code>LiftingType</code> may only occur in the parameter list
+ of a method of a team class.
+
+ </li>
+ <li id="sA.6.b"><span class="title">Role in scope</span><br />
+ The right hand side type in a <code>LiftingType</code>
+ must be a class directly contained in the enclosing team class
+ (the class may be acquired by <a href="s1.3.1.c.html"
+ title="&sect;1.3.1.(c)&nbsp;Overriding and implicit inheritance"
+ class="sect">implicit inheritance (&sect;1.3.1.(c))</a>).
+
+ </li>
+ <li id="sA.6.c"><span class="title">Team path</span><br /><em>Note, that the syntax of &sect;A.6.3/4 is deprecated in favor of <a href="sA.9.html" title="&sect;A.9&nbsp;Value dependent types" class="sect">&sect;A.9</a></em>.
+ <br />
+ The path in an <code>AnchoredType</code> must refer to an instance of a team class.
+ Each identifier in the path must be declared with the <code>final</code> modifier.
+
+ </li>
+ </ol>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="sA.5.html" rel="prev">&lt;&lt;&nbsp;&sect;A.5&nbsp;Statements</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="sA.7.html" rel="next">&sect;A.7&nbsp;Guard predicates&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="sA.html" rel="section">&sect;A&nbsp;OT/J Syntax</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sA.7.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sA.7.html
new file mode 100644
index 000000000..d0c19531e
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sA.7.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="sA.6.html" rel="prev">&lt;&lt;&nbsp;&sect;A.6&nbsp;Types</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="sA.8.html" rel="next">&sect;A.8&nbsp;Precedence declaration&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="sA.html" rel="section">&sect;A&nbsp;OT/J Syntax</a></div>
+ <div class="sect depth2" id="sA.7">
+ <h2 class="sect">&sect;A.7&nbsp;Guard predicates</h2>
+ <table class="syntaxrule" id="sA.7.1">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.7.1</td>
+ <td class="rule"><span class="title">Guard</span><br /><strong class="blue"><em>[</em>base<em>]</em> when</strong> ( <em>Expression</em> )
+
+ </td>
+ </tr>
+ </table>
+ <table class="syntaxrule" id="sA.7.2">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.7.2</td>
+ <td class="rule"><span class="title">MethodDeclaration</span><br />...<br /><em>MethodHeader <strong class="blue">[Guard]</strong> MethodBody</em></td>
+ </tr>
+ </table>
+ <p>Other rules referring to <em><code>Guard</code></em>:
+ <a href="sA.html#sA.1.1" title="&sect;A.1.1&nbsp;ClassDeclaration"
+ class="sect">ClassDeclaration (&sect;A.1.1)</a>,
+ <a href="sA.html#sA.3.3" title="&sect;A.3.3&nbsp;Callin binding" class="sect">CallinBinding (&sect;A.3.3)</a></p>
+ <div class="constraints">
+ <h5 class="constraints">Contextual constraints:</h5>
+ <ol class="constraints">
+ <li>The <code>Expression</code> in a guard must have type <code>boolean</code>.
+ </li>
+ </ol>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="sA.6.html" rel="prev">&lt;&lt;&nbsp;&sect;A.6&nbsp;Types</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="sA.8.html" rel="next">&sect;A.8&nbsp;Precedence declaration&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="sA.html" rel="section">&sect;A&nbsp;OT/J Syntax</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sA.8.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sA.8.html
new file mode 100644
index 000000000..9ba58db4d
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sA.8.html
@@ -0,0 +1,54 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="sA.7.html" rel="prev">&lt;&lt;&nbsp;&sect;A.7&nbsp;Guard predicates</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="sA.9.html" rel="next">&sect;A.9&nbsp;Value dependent types&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="sA.html" rel="section">&sect;A&nbsp;OT/J Syntax</a></div>
+ <div class="sect depth2" id="sA.8">
+ <h2 class="sect">&sect;A.8&nbsp;Precedence declaration</h2>
+ <table class="syntaxrule" id="sA.8.1">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.8.1</td>
+ <td class="rule"><span class="title">PrecedenceDeclaration</span><br /><strong class="blue">precedence</strong><em> CallinNameList</em> ;
+
+ </td>
+ </tr>
+ </table>
+ <table class="syntaxrule" id="sA.8.2">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.8.2</td>
+ <td class="rule"><span class="title">CallinNameList</span><br /><em>Name [, CallinNameList]</em></td>
+ </tr>
+ </table>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="sA.7.html" rel="prev">&lt;&lt;&nbsp;&sect;A.7&nbsp;Guard predicates</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="sA.9.html" rel="next">&sect;A.9&nbsp;Value dependent types&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="sA.html" rel="section">&sect;A&nbsp;OT/J Syntax</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sA.9.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sA.9.html
new file mode 100644
index 000000000..aa0c154bb
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sA.9.html
@@ -0,0 +1,66 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="sA.8.html" rel="prev">&lt;&lt;&nbsp;&sect;A.8&nbsp;Precedence declaration</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="sA.10.html" rel="next">&sect;A.10&nbsp;Packages and imports&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="sA.html" rel="section">&sect;A&nbsp;OT/J Syntax</a></div>
+ <div class="sect depth2" id="sA.9">
+ <h2 class="sect">&sect;A.9&nbsp;Value dependent types</h2>
+ <table class="syntaxrule" id="sA.9.1">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.9.1</td>
+ <td class="rule"><span class="title">TypeParameter</span><br /><em>TypeVariable [TypeBound]</em><br /><strong class="blue"><em>ReferenceType Name</em></strong></td>
+ </tr>
+ </table>
+ <p>See <a href="http://java.sun.com/docs/books/jls/third_edition/html/typesValues.html#108850"
+ class="ext">JLS 3 &sect;4.4</a></p>
+ <table class="syntaxrule" id="sA.9.2">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.9.2</td>
+ <td class="rule"><span class="title">ActualTypeArgument</span><br /><em>ReferenceType</em><br /><em>Wildcard</em><br /><strong class="blue"><em>@Name</em></strong></td>
+ </tr>
+ </table>
+ <p>See <a href="http://java.sun.com/docs/books/jls/third_edition/html/typesValues.html#107353"
+ class="ext">JLS 3 &sect;4.5.1</a></p>
+ <div class="constraints">
+ <h5 class="constraints">Contextual constraints:</h5>
+ <ol class="constraints">
+ <li id="sA.9.a"><span class="title">ActualTypeParameter</span><br />
+ An <code>ActualTypeArgument</code> of the form <code>@Name</code> may only occur
+ as a parameter of a simple name type reference.
+
+ </li>
+ </ol>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="sA.8.html" rel="prev">&lt;&lt;&nbsp;&sect;A.8&nbsp;Precedence declaration</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="sA.10.html" rel="next">&sect;A.10&nbsp;Packages and imports&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="sA.html" rel="section">&sect;A&nbsp;OT/J Syntax</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sA.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sA.html
new file mode 100644
index 000000000..1f3166078
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sA.html
@@ -0,0 +1,509 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="s9.html" rel="prev">&lt;&lt;&nbsp;&sect;9&nbsp;Value Dependent Classes</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="sB.html" rel="next">&sect;B&nbsp;Changes between versions&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"></div>
+ <div class="chapter" id="sA">
+ <div class="headl">
+ <div class="headr">
+ <h1>&sect;A&nbsp;OT/J Syntax</h1>
+ </div>
+ </div>
+ <div id="toc-box">
+ <ul class="toc-box">
+ <li><a href="sA.html">&sect;A&nbsp;OT/J Syntax</a></li>
+ <li><a href="#sA.0">&sect;A.0&nbsp;Keywords</a></li>
+ <li><a href="#sA.1">&sect;A.1&nbsp;Class definitions</a></li>
+ <li><a href="#sA.2">&sect;A.2&nbsp;Modifiers</a></li>
+ <li><a href="#sA.3">&sect;A.3&nbsp;Method bindings</a></li>
+ <li><a href="#sA.4">&sect;A.4&nbsp;Parameter mappings</a></li>
+ <li><a href="#sA.5">&sect;A.5&nbsp;Statements</a></li>
+ <li><a href="#sA.6">&sect;A.6&nbsp;Types</a></li>
+ <li><a href="#sA.7">&sect;A.7&nbsp;Guard predicates</a></li>
+ <li><a href="#sA.8">&sect;A.8&nbsp;Precedence declaration</a></li>
+ <li><a href="#sA.9">&sect;A.9&nbsp;Value dependent types</a></li>
+ <li><a href="#sA.10">&sect;A.10&nbsp;Packages and imports</a></li>
+ </ul>
+ </div>
+ <div class="intro">
+ <h3>Notation</h3>
+ <p>The following grammar rules extend the Java grammar given in the
+ <a href="http://java.sun.com/docs/books/jls/second_edition/html/syntax.doc.html"
+ class="ext">Java Language Specification</a>.
+ We adopt the conventions of printing non-terminal symbols in italic font
+ (e.g., <tt><em>ClassDeclaration</em></tt>),
+ and terminal symbols in roman font (e.g., <tt>class</tt>).
+ Names printed in black refer to definitions from the original Java grammar.
+ Object Teams additions are printed in <strong class="blue">blue boldface</strong>.
+ For those rules that simply add a new option to an existing rule,
+ the original options are indicated by an ellipse (<code>...</code>).
+
+ </p>
+ </div>
+ <div class="sect depth2" id="sA.0">
+ <h2 class="sect">&sect;A.0&nbsp;Keywords<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;A</a></span></h2>
+ <p>The keywords introduced by OT/J have different scopes, which means outside their
+ given scope these keywords can be used for regular identifiers. Only these names
+ are keywords unconditionally:
+
+ </p>
+ <div class="listing plain"><pre>readonly, team, within</pre></div>
+ <div class="sect depth3" id="sA.0.1">
+ <h3 class="sect">&sect;A.0.1&nbsp;Scoped keywords<span class="toplink"><a href="#sA.0">&uarr;&nbsp;&sect;A.0</a></span></h3>
+ <p>The following names are keywords in OT/J only if they appear within a team or role class,
+ ie., after the keyword <strong class="blue">team</strong> has been recognized:
+
+ </p>
+ <div class="listing plain"><pre>as, base, callin, playedBy, precedence, tsuper, with, when</pre></div>
+ <p>These names are keywords only in the context of a callin or callout binding
+ respectively (<a href="#sA.3" title="&sect;A.3&nbsp;Method bindings" class="sect">&sect;A.3</a>):
+
+ </p>
+ <div class="listing plain"><pre>after, before, replace, get, set</pre></div>
+ </div>
+ <div class="sect depth3" id="sA.0.2">
+ <h3 class="sect">&sect;A.0.2&nbsp;Inheriting scoped keywords<span class="toplink"><a href="#sA.0">&uarr;&nbsp;&sect;A.0</a></span></h3>
+ <p>While regular Java classes may use the scoped keywords
+ (<a href="#sA.0.1" title="&sect;A.0.1&nbsp;Scoped keywords" class="sect">&sect;A.0.1</a>) of OT/J freely, it is an error if a role class
+ inherits a feature whose name is a scoped keyword.
+
+ </p>
+ </div>
+ <div class="sect depth3" id="sA.0.3">
+ <h3 class="sect">&sect;A.0.3&nbsp;Internal names<span class="toplink"><a href="#sA.0">&uarr;&nbsp;&sect;A.0</a></span></h3>
+ <p>Compiler and runtime environment generate internal methods and fields which start with
+ the prefix <code>_OT$</code>. It is illegal to use any of these methods and fields within client code.
+
+ </p>
+ </div>
+ </div>
+ <div class="sect depth2" id="sA.1">
+ <h2 class="sect">&sect;A.1&nbsp;Class definitions<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;A</a></span></h2>
+ <p>Class definitions add two new keywords <code>team</code> and
+ <code>playedBy</code>. Classes which use these keywords are called
+ <strong>teams</strong> and <strong>bound roles</strong>, respectively.
+ Any class that inherits from a bound role class (either by an
+ <code>extends</code> clause or by implicit inheritance, cf.
+ <a href="s1.3.1.c.html"
+ title="&sect;1.3.1.(c)&nbsp;Overriding and implicit inheritance"
+ class="sect">&sect;1.3.1.(c)</a>) is again a bound role class.
+
+ </p>
+ <table class="syntaxrule" id="sA.1.1">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.1.1</td>
+ <td class="rule"><span class="title">ClassDeclaration</span><br /><em>[Modifiers] </em><strong class="blue"><em>[</em>team<em>]</em></strong> class <em>Identifier [</em>extends <em>Type] [</em>implements <em>TypeList]</em><br /><span class="indent5"></span><strong class="blue"><em>[</em>playedBy <em>Type] [Guard]</em></strong><em> ClassBody</em></td>
+ </tr>
+ </table>
+ <div class="constraints">
+ <h5 class="constraints">Contextual constraints:</h5>
+ <ol class="constraints">
+ <li>A class which has a <code>playedBy</code> clause (a <strong>bound
+ role</strong> class) may not be declared static and
+ must be directly contained in a class that has the
+ <code>team</code> modifier (a <strong>team</strong> class).
+ </li>
+ <li>A class which inherits from a team class must have the
+ <code>team</code> modifier, too.
+ </li>
+ <li>A class which has a guard (see <a href="s5.4.html" title="&sect;5.4&nbsp;Guard predicates" class="sect">&sect;5.4</a>)
+ must be a team or a role.
+ </li>
+ </ol>
+ </div>
+ </div>
+ <div class="sect depth2" id="sA.2">
+ <h2 class="sect">&sect;A.2&nbsp;Modifiers<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;A</a></span></h2>
+ <p>The rule for method modifiers adds one keyword: <code>callin</code>:
+
+ </p>
+ <table class="syntaxrule" id="sA.2.1">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.2.1</td>
+ <td class="rule"><span class="title">Modifier</span><br />... <br /><strong class="blue">callin</strong></td>
+ </tr>
+ </table>
+ <div class="constraints">
+ <h5 class="constraints">Contextual constraints:</h5>
+ <ol class="constraints">
+ <li>The class of a method which has the <code>callin</code> modifier
+ may not be declared static and must be directly contained in a team class.
+ </li>
+ <li>A method that has the <code>callin</code> modifier may not
+ appear in an explicit method call (rule Apply in JLS).
+ </li>
+ </ol>
+ </div>
+ </div>
+ <div class="sect depth2" id="sA.3">
+ <h2 class="sect">&sect;A.3&nbsp;Method bindings<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;A</a></span></h2>
+ <p>The rule of items declarable in a class body is augmented by method
+ bindings:
+
+ </p>
+ <table class="syntaxrule" id="sA.3.1">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.3.1</td>
+ <td class="rule"><span class="title">ClassBodyDeclaration</span><br />... <br /><strong class="blue"><em>CalloutBinding</em></strong><br /><strong class="blue"><em>CallinBinding</em></strong></td>
+ </tr>
+ </table>
+ <table class="syntaxrule" id="sA.3.2">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.3.2</td>
+ <td class="rule"><span class="title">CalloutBinding</span><br /><em>[Modifier] [TypeArguments] <strong class="blue">MethodSpec CalloutKind MethodSpec CalloutParameterMappings</strong></em><br /><em>[Modifier] [TypeArguments] <strong class="blue">MethodSpec CalloutKind CalloutModifier FieldSpec</strong></em></td>
+ </tr>
+ </table>
+ <table class="syntaxrule" id="sA.3.3">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.3.3</td>
+ <td class="rule"><span class="title">Callin binding</span><br /><em>[ Identifier </em>:<em> ] [TypeArguments]</em><strong class="blue"><em> MethodSpec</em> &lt;- <em>CallinModifier MethodSpecs </em><br /><span class="indent5"></span>
+ [<em>Guard</em>]<em> CallinParameterMappings</em></strong></td>
+ </tr>
+ </table>
+ <table class="syntaxrule" id="sA.3.4">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.3.4</td>
+ <td class="rule"><span class="title">MethodSpec</span><br /><em>Identifier</em><br /><em>ResultType MethodDeclarator</em></td>
+ </tr>
+ </table>
+ <div class="note">
+ Note, that <em>ResultType</em> and <em>MethodDeclarator</em> are not explicit in the
+ overall syntax of the Java language specification. For convenience we refer to the definition in
+ section <a href="http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#40420"
+ class="ext">8.4. Method Declarations</a>
+ of the Java language specification.
+
+ </div>
+ <table class="syntaxrule" id="sA.3.5">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.3.5</td>
+ <td class="rule"><span class="title">MethodSpecs</span><br /><strong class="blue"><em>MethodSpec [</em>, <em>MethodSpecs]</em></strong></td>
+ </tr>
+ </table>
+ <table class="syntaxrule" id="sA.3.6">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.3.6</td>
+ <td class="rule"><span class="title">CalloutKind</span><br /><strong class="blue">-&gt;<br />=&gt;</strong></td>
+ </tr>
+ </table>
+ <table class="syntaxrule" id="sA.3.7">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.3.7</td>
+ <td class="rule"><span class="title">CallinModifier</span><br /><strong class="blue">before</strong><br /><strong class="blue">after</strong><br /><strong class="blue">replace</strong></td>
+ </tr>
+ </table>
+ <table class="syntaxrule" id="sA.3.8">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.3.8</td>
+ <td class="rule"><span class="title">CalloutModifier</span><br /><strong class="blue">get</strong><br /><strong class="blue">set</strong></td>
+ </tr>
+ </table>
+ <table class="syntaxrule" id="sA.3.9">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.3.9</td>
+ <td class="rule"><span class="title">FieldSpec</span><br /><em>[Type] Identifier</em></td>
+ </tr>
+ </table>
+ <div class="constraints">
+ <h5 class="constraints">Contextual constraints:</h5>
+ <ol class="constraints">
+ <li><code>CalloutBinding</code>s and <code>CallinBinding</code>s
+ may occur only in bound role classes.
+ </li>
+ <li>A <code>CalloutBinding</code> or <code>CallinBinding</code>
+ may not mix identifiers and full signatures (<code>MethodDeclarationHead</code>)
+ for its method specifiers (<code>MethodSpec</code>).
+ <br />
+ Binding a full method signature to a field requires the <code>FieldSpec</code>
+ to include the <code>Type</code>.
+ </li>
+ <li>The method specifier at the left hand side of a
+ <code>CallinBinding</code> which has the <code>replace</code> modifier
+ must refer to a method that has the <code>callin</code> modifier.
+ </li>
+ <li>The <code>Modifier</code> of a callout binding can only be one of the visility
+ modifiers <code>public</code>, <code>protected</code> or <code>private</code>.
+ A short callout binding (i.e., without signatures) must not specify
+ a visibility modifier.
+ </li>
+ </ol>
+ </div>
+ </div>
+ <div class="sect depth2" id="sA.4">
+ <h2 class="sect">&sect;A.4&nbsp;Parameter mappings<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;A</a></span></h2>
+ <table class="syntaxrule" id="sA.4.1">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.4.1</td>
+ <td class="rule"><span class="title">CalloutParameterMappings</span><br /><strong class="blue">with { <em>CalloutParameterMappingList [,]</em> }</strong><br /><strong class="blue">;</strong></td>
+ </tr>
+ </table>
+ <table class="syntaxrule" id="sA.4.2">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.4.2</td>
+ <td class="rule"><span class="title">CallinParameterMappings</span><br /><strong class="blue">with { <em>CallinParameterMappingList [,]</em> }</strong><br /><strong class="blue">;</strong></td>
+ </tr>
+ </table>
+ <table class="syntaxrule" id="sA.4.3">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.4.3</td>
+ <td class="rule"><span class="title">CalloutParameterMappingList</span><br /><strong class="blue"><em>CalloutParameterMapping [</em>,<em> CalloutParameterMappingList]</em></strong></td>
+ </tr>
+ </table>
+ <table class="syntaxrule" id="sA.4.4">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.4.4</td>
+ <td class="rule"><span class="title">CallinParameterMappingList</span><br /><strong class="blue"><em>CallinParameterMapping [</em>,<em> CallinParameterMappingList]</em></strong></td>
+ </tr>
+ </table>
+ <table class="syntaxrule" id="sA.4.5">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.4.5</td>
+ <td class="rule"><span class="title">CalloutParameterMapping</span><br /><em>Expression</em><strong class="blue"> -&gt; </strong><em>Identifier</em><br /><strong class="blue">result &lt;- </strong><em>Expression</em></td>
+ </tr>
+ </table>
+ <table class="syntaxrule" id="sA.4.6">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.4.6</td>
+ <td class="rule"><span class="title">CallinParameterMapping</span><br /><em>Identifier</em><strong class="blue"> &lt;- </strong><em>Expression</em><br /><em>Expression</em><strong class="blue"> -&gt; </strong><strong class="blue">result</strong></td>
+ </tr>
+ </table>
+ <div class="note">
+ <h5>Note:</h5>
+ By defining ";" as an option for parameter mappings, the grammar enforces that
+ method bindings without a parameter mapping are terminated by a ";".
+ Also method bindings with parameter mappings may optionally be terminated by a ";",
+ which in that case is interpreted as an empty member declaration, following the
+ same pattern how non-abstract methods in Java may optionally have a trailing ";".
+
+ </div>
+ </div>
+ <div class="sect depth2" id="sA.5">
+ <h2 class="sect">&sect;A.5&nbsp;Statements<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;A</a></span></h2>
+ <table class="syntaxrule" id="sA.5.1">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.5.1</td>
+ <td class="rule"><span class="title">Statement</span><br />... <br /><em><strong class="blue">Within</strong><br /><strong class="blue">BaseCall</strong><br /><strong class="blue">TSuperCall</strong></em></td>
+ </tr>
+ </table>
+ <table class="syntaxrule" id="sA.5.2">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.5.2</td>
+ <td class="rule"><span class="title">Within</span><br /><strong class="blue">within</strong> ( <em>Expression</em> ) <em>Statement</em></td>
+ </tr>
+ </table>
+ <table class="syntaxrule" id="sA.5.3">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.5.3</td>
+ <td class="rule"><span class="title">BaseCall</span><br /><strong class="blue">base</strong> . <em>Identifier</em> ( <em>Arguments<sub>opt</sub></em> )
+ <br /><strong class="blue">base</strong> ( <em>Arguments<sub>opt</sub></em> )
+
+ </td>
+ </tr>
+ </table>
+ <table class="syntaxrule" id="sA.5.4">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.5.4</td>
+ <td class="rule"><span class="title">TSuperCall</span><br /><strong class="blue">tsuper</strong> . <em>Identifier</em> ( <em>Arguments<sub>opt</sub></em> )
+ <br /><strong class="blue">tsuper</strong> ( <em>Arguments<sub>opt</sub></em> )
+
+ </td>
+ </tr>
+ </table>
+ <div class="constraints">
+ <h5 class="constraints">Contextual constraints:</h5>
+ <ol class="constraints">
+ <li>The expression of a <code>Within</code> must evaluate
+ to an instance of a team class.
+ </li>
+ <li>The first form of a <code>BaseCall</code> may occur only
+ in the body of a method that has the <code>callin</code> modifier.
+ The identifier must be the name of the enclosing method.
+ </li>
+ <li>The second form of a <code>BaseCall</code> may occur only in a constructor of a
+ bound role class.
+ </li>
+ <li>The first form of a <code>TSuperCall</code> may occur only in a method of
+ a role class.
+ </li>
+ <li>The second form of a <code>TSuperCall</code> may occur only in a constructor of a
+ role class.
+ </li>
+ </ol>
+ </div>
+ </div>
+ <div class="sect depth2" id="sA.6">
+ <h2 class="sect">&sect;A.6&nbsp;Types<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;A</a></span></h2>
+ <table class="syntaxrule" id="sA.6.1">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.6.1</td>
+ <td class="rule"><span class="title">Type</span><br />... <br /><strong class="blue"><em>LiftingType</em></strong><br /><strong class="blue"><em>AnchoredType</em></strong></td>
+ </tr>
+ </table>
+ <table class="syntaxrule" id="sA.6.2">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.6.2</td>
+ <td class="rule"><span class="title">LiftingType</span><br /><em>Type</em><strong class="blue"> as </strong><em>Type</em></td>
+ </tr>
+ </table>
+ <table class="syntaxrule" id="sA.6.3">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.6.3</td>
+ <td class="rule"><span class="title">AnchoredType</span><br /><strong class="blue"><em>Path</em></strong>.<em>Type</em></td>
+ </tr>
+ </table>
+ <table class="syntaxrule" id="sA.6.4">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.6.4</td>
+ <td class="rule"><span class="title">Path</span><br /><em>Identifier</em><br /><strong class="blue"><em>Path</em></strong>.<em>Identifier</em></td>
+ </tr>
+ </table>
+ <div class="constraints">
+ <h5 class="constraints">Contextual constraints:</h5>
+ <ol class="constraints">
+ <li id="sA.6.a"><span class="title">Location</span><br />
+ A <code>LiftingType</code> may only occur in the parameter list
+ of a method of a team class.
+
+ </li>
+ <li id="sA.6.b"><span class="title">Role in scope</span><br />
+ The right hand side type in a <code>LiftingType</code>
+ must be a class directly contained in the enclosing team class
+ (the class may be acquired by <a href="s1.3.1.c.html"
+ title="&sect;1.3.1.(c)&nbsp;Overriding and implicit inheritance"
+ class="sect">implicit inheritance (&sect;1.3.1.(c))</a>).
+
+ </li>
+ <li id="sA.6.c"><span class="title">Team path</span><br /><em>Note, that the syntax of &sect;A.6.3/4 is deprecated in favor of <a href="#sA.9" title="&sect;A.9&nbsp;Value dependent types" class="sect">&sect;A.9</a></em>.
+ <br />
+ The path in an <code>AnchoredType</code> must refer to an instance of a team class.
+ Each identifier in the path must be declared with the <code>final</code> modifier.
+
+ </li>
+ </ol>
+ </div>
+ </div>
+ <div class="sect depth2" id="sA.7">
+ <h2 class="sect">&sect;A.7&nbsp;Guard predicates<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;A</a></span></h2>
+ <table class="syntaxrule" id="sA.7.1">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.7.1</td>
+ <td class="rule"><span class="title">Guard</span><br /><strong class="blue"><em>[</em>base<em>]</em> when</strong> ( <em>Expression</em> )
+
+ </td>
+ </tr>
+ </table>
+ <table class="syntaxrule" id="sA.7.2">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.7.2</td>
+ <td class="rule"><span class="title">MethodDeclaration</span><br />...<br /><em>MethodHeader <strong class="blue">[Guard]</strong> MethodBody</em></td>
+ </tr>
+ </table>
+ <p>Other rules referring to <em><code>Guard</code></em>:
+ <a href="#sA.1.1" title="&sect;A.1.1&nbsp;ClassDeclaration" class="sect">ClassDeclaration (&sect;A.1.1)</a>,
+ <a href="#sA.3.3" title="&sect;A.3.3&nbsp;Callin binding" class="sect">CallinBinding (&sect;A.3.3)</a></p>
+ <div class="constraints">
+ <h5 class="constraints">Contextual constraints:</h5>
+ <ol class="constraints">
+ <li>The <code>Expression</code> in a guard must have type <code>boolean</code>.
+ </li>
+ </ol>
+ </div>
+ </div>
+ <div class="sect depth2" id="sA.8">
+ <h2 class="sect">&sect;A.8&nbsp;Precedence declaration<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;A</a></span></h2>
+ <table class="syntaxrule" id="sA.8.1">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.8.1</td>
+ <td class="rule"><span class="title">PrecedenceDeclaration</span><br /><strong class="blue">precedence</strong><em> CallinNameList</em> ;
+
+ </td>
+ </tr>
+ </table>
+ <table class="syntaxrule" id="sA.8.2">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.8.2</td>
+ <td class="rule"><span class="title">CallinNameList</span><br /><em>Name [, CallinNameList]</em></td>
+ </tr>
+ </table>
+ </div>
+ <div class="sect depth2" id="sA.9">
+ <h2 class="sect">&sect;A.9&nbsp;Value dependent types<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;A</a></span></h2>
+ <table class="syntaxrule" id="sA.9.1">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.9.1</td>
+ <td class="rule"><span class="title">TypeParameter</span><br /><em>TypeVariable [TypeBound]</em><br /><strong class="blue"><em>ReferenceType Name</em></strong></td>
+ </tr>
+ </table>
+ <p>See <a href="http://java.sun.com/docs/books/jls/third_edition/html/typesValues.html#108850"
+ class="ext">JLS 3 &sect;4.4</a></p>
+ <table class="syntaxrule" id="sA.9.2">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.9.2</td>
+ <td class="rule"><span class="title">ActualTypeArgument</span><br /><em>ReferenceType</em><br /><em>Wildcard</em><br /><strong class="blue"><em>@Name</em></strong></td>
+ </tr>
+ </table>
+ <p>See <a href="http://java.sun.com/docs/books/jls/third_edition/html/typesValues.html#107353"
+ class="ext">JLS 3 &sect;4.5.1</a></p>
+ <div class="constraints">
+ <h5 class="constraints">Contextual constraints:</h5>
+ <ol class="constraints">
+ <li id="sA.9.a"><span class="title">ActualTypeParameter</span><br />
+ An <code>ActualTypeArgument</code> of the form <code>@Name</code> may only occur
+ as a parameter of a simple name type reference.
+
+ </li>
+ </ol>
+ </div>
+ </div>
+ <div class="sect depth2" id="sA.10">
+ <h2 class="sect">&sect;A.10&nbsp;Packages and imports<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;A</a></span></h2>
+ <table class="syntaxrule" id="sA.10.1">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.10.1</td>
+ <td class="rule"><span class="title">PackageDeclaration</span><br />...<br /><strong class="blue">team </strong><em>QualifiedName</em> ;
+
+ </td>
+ </tr>
+ </table>
+ <table class="syntaxrule" id="sA.10.2">
+ <tr>
+ <td class="sect">&sect;&nbsp;A.10.2</td>
+ <td class="rule"><span class="title">Import</span><br />...<br /><strong>import </strong><strong class="blue">base </strong><em>QualifiedName</em> ;
+
+ </td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="s9.html" rel="prev">&lt;&lt;&nbsp;&sect;9&nbsp;Value Dependent Classes</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="sB.html" rel="next">&sect;B&nbsp;Changes between versions&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sB.1.1.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sB.1.1.html
new file mode 100644
index 000000000..a336843c9
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sB.1.1.html
@@ -0,0 +1,68 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="sB.1.2.html" rel="next">&sect;B.1.(2)&nbsp;Between OTJLD 1.1 and OTJLD 1.2&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="sB.html" rel="section">&sect;B&nbsp;Changes between versions</a>&nbsp;&gt;&nbsp;<a class="nav" href="sB.1.html" rel="section">&sect;B.1&nbsp;Paragraphs changed between versions</a></div>
+ <div class="subsect depth3" id="sB.1.1">
+ <h4 class="subsect">&sect;B.1.(1)&nbsp;<span class="title">Between OTJLD 1.0 and OTJLD 1.1</span></h4>
+ <ul>
+ <li><a href="s3.2.a.html" title="&sect;3.2.(a)&nbsp;with clause" class="sect">&sect;3.2.(a)</a> :
+ <strong>Parameter mappings</strong><p>
+ Disallow parameter mappings in a role interface.
+
+ </p>
+ </li>
+ <li><a href="s4.5.d.html" title="&sect;4.5.(d)&nbsp;Typing rules" class="sect">&sect;4.5.(d)</a> :
+ <strong>Replace bindings</strong><p>
+ Disallow unsafe use of polymorphism and primitive type conversions.
+
+ </p>
+ </li>
+ <li><a href="s6.1.a.html"
+ title="&sect;6.1.(a)&nbsp;Interface to the role registry"
+ class="sect">&sect;6.1.(a)</a> :
+ <strong>Signatures of reflective methods</strong><p>
+ Made two methods generic so that return values can be used without the need of casting.
+
+ </p>
+ </li>
+ <li><a href="s7.2.html" title="&sect;7.2&nbsp;Confined roles" class="sect">&sect;7.2</a> :
+ <strong>Confined roles</strong><p>
+ Improved explanation.
+
+ </p>
+ </li>
+ </ul>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="sB.1.2.html" rel="next">&sect;B.1.(2)&nbsp;Between OTJLD 1.1 and OTJLD 1.2&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="sB.html" rel="section">&sect;B&nbsp;Changes between versions</a>&nbsp;&gt;&nbsp;<a class="nav" href="sB.1.html" rel="section">&sect;B.1&nbsp;Paragraphs changed between versions</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sB.1.2.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sB.1.2.html
new file mode 100644
index 000000000..9afd6d9b1
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sB.1.2.html
@@ -0,0 +1,105 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="sB.1.1.html" rel="prev">&lt;&lt;&nbsp;&sect;B.1.(1)&nbsp;Between OTJLD 1.0 and OTJLD 1.1</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="sB.1.3.html" rel="next">&sect;B.1.(3)&nbsp;Between OTJLD 1.2 and OTJLD 1.3&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="sB.html" rel="section">&sect;B&nbsp;Changes between versions</a>&nbsp;&gt;&nbsp;<a class="nav" href="sB.1.html" rel="section">&sect;B.1&nbsp;Paragraphs changed between versions</a></div>
+ <div class="subsect depth3" id="sB.1.2">
+ <h4 class="subsect">&sect;B.1.(2)&nbsp;<span class="title">Between OTJLD 1.1 and OTJLD 1.2</span></h4>
+ <ul>
+ <li><a href="s1.2.1.e.html" title="&sect;1.2.1.(e)&nbsp;Role features"
+ class="sect">&sect;1.2.1.(e)</a>:
+ <strong>Visibility of role features</strong><p>
+ Clarification has been added that a role can always access all the
+ features that its enclosing team has access to.
+
+ </p>
+ </li>
+ <li><a href="s2.1.2.e.html" title="&sect;2.1.2.(e)&nbsp;No free type parameters"
+ class="sect">&sect;2.1.2.(e)</a>:
+ <strong>Generic roles/bases</strong><p>
+ Relaxed the rules about generic bound roles. This change also subsumes what previously was a specific restriction in
+ <a href="s4.1.b.html" title="&sect;4.1.(b)&nbsp;Prerequisite: Class binding"
+ class="sect">&sect;4.1.(b)</a>.
+
+ </p>
+ </li>
+ <li><a href="s3.1.i.html" title="&sect;3.1.(i)&nbsp;Shorthand definition"
+ class="sect">&sect;3.1.(i)</a> and <a href="s3.5.f.html" title="&sect;3.5.(f)&nbsp;Shorthand definition"
+ class="sect">&sect;3.5.(f)</a>:
+ <strong>Visibility of shorthand callout</strong><p>
+ A role method defined by a shorthand callout binding can now specify a visibility modifier
+ (see also <a href="sA.html#sA.3.2" title="&sect;A.3.2&nbsp;CalloutBinding" class="sect">&sect;A.3.2</a>),
+ otherwise it inherits the visibility modifier of it's bound base method/field.
+
+ </p>
+ </li>
+ <li><a href="s3.1.j.html" title="&sect;3.1.(j)&nbsp;Inferred callout" class="sect">&sect;3.1.(j)</a> and <a href="s3.5.h.html" title="&sect;3.5.(h)&nbsp;Inferred callout" class="sect">&sect;3.5.(h)</a>:
+ <strong>Visibility of inferred callout</strong><p>
+ Role methods inferred as a callout binding are either <code>public</code>
+ (inferred via interface) or <code>private</code> inferred from
+ self call / field access.
+
+ </p>
+ </li>
+ <li><a href="s3.5.h.html" title="&sect;3.5.(h)&nbsp;Inferred callout" class="sect">&sect;3.5.(h)</a>:
+ <strong>No explicit use of inferred callout to field</strong><p>
+ Clarification has been added that an accessor method generated for an inferred callout to field
+ can not be explicitly invoked.
+
+ </p>
+ </li>
+ <li><a href="s4.1.b.html" title="&sect;4.1.(b)&nbsp;Prerequisite: Class binding"
+ class="sect">&sect;4.1.(b)</a>:
+ <strong>No callin in generic role</strong><p>
+ A restriction has been made explicit that a generic role cannot define callin bindings.
+
+ </p>
+ </li>
+ <li><a href="s4.2.d.html" title="&sect;4.2.(d)&nbsp;Callin methods" class="sect">&sect;4.2.(d)</a> :
+ <strong>Callin methods</strong><p>Slightly rephrased and extended the rule to make explicit that a callin method can
+ indeed be intercepted using a second level callin binding.
+
+ </p>
+ </li>
+ <li><a href="s6.1.a.html"
+ title="&sect;6.1.(a)&nbsp;Interface to the role registry"
+ class="sect">&sect;6.1.(a)</a> :
+ <strong>Reflective methods <code>getAllRoles</code></strong><p>
+ More precision: answer only <em>bound</em> roles.
+
+ </p>
+ </li>
+ </ul>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="sB.1.1.html" rel="prev">&lt;&lt;&nbsp;&sect;B.1.(1)&nbsp;Between OTJLD 1.0 and OTJLD 1.1</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="sB.1.3.html" rel="next">&sect;B.1.(3)&nbsp;Between OTJLD 1.2 and OTJLD 1.3&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="sB.html" rel="section">&sect;B&nbsp;Changes between versions</a>&nbsp;&gt;&nbsp;<a class="nav" href="sB.1.html" rel="section">&sect;B.1&nbsp;Paragraphs changed between versions</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sB.1.3.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sB.1.3.html
new file mode 100644
index 000000000..1e05cb38c
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sB.1.3.html
@@ -0,0 +1,90 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="sB.1.2.html" rel="prev">&lt;&lt;&nbsp;&sect;B.1.(2)&nbsp;Between OTJLD 1.1 and OTJLD 1.2</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="sB.html" rel="section">&sect;B&nbsp;Changes between versions</a>&nbsp;&gt;&nbsp;<a class="nav" href="sB.1.html" rel="section">&sect;B.1&nbsp;Paragraphs changed between versions</a></div>
+ <div class="subsect depth3" id="sB.1.3">
+ <h4 class="subsect">&sect;B.1.(3)&nbsp;<span class="title">Between OTJLD 1.2 and OTJLD 1.3</span></h4>
+ <ul>
+ <li><a href="s1.2.4.c.html" title="&sect;1.2.4.(c)&nbsp;Class literal"
+ class="sect">&sect;1.2.4.(c)</a> :
+ <strong>Syntax for role class literals</strong><p>Previously, the syntax <code>R&lt;@t&gt;.class</code> was not supported.
+ This restriction has been removed.
+
+ </p>
+ </li>
+ <li><a href="s1.3.html"
+ title="&sect;1.3&nbsp;Acquisition and implicit inheritance of role classes"
+ class="sect">&sect;1.3</a> :
+ <strong>Teams extending non-team classes</strong><p>Previously, <code>org.objectteams.Team</code> was the super class of all team classes.
+ As a consequence a team could not extend a non-team class.
+ This restriction has been removed by introducing a new super-type of all teams,
+ the interface <code>org.objectteams.ITeam</code>.
+ This change also affects some paragraphs in <a href="s6.html" title="&sect;6&nbsp;Object Teams API" class="sect">&sect;6</a> as members
+ have been moved to the new interface.
+
+ </p>
+ </li>
+ <li><a href="s4.4.c.html"
+ title="&sect;4.4.(c)&nbsp;Mapping the result of a base method"
+ class="sect">&sect;4.4.(c)</a> :
+ <strong>Further restrict result mapping in after callin bindings</strong><p>Clarify that <code>after</code> callin bindings cannot use the <code>-&gt;</code>
+ token to map a result value.
+
+ </p>
+ </li>
+ <li><a href="s4.10.html" title="&sect;4.10&nbsp;Generic callin bindings"
+ class="sect">&sect;4.10</a>, <a href="s4.10.a.html" title="&sect;4.10.(a)&nbsp;Fresh type parameter"
+ class="sect">&sect;4.10.(a)</a> :
+ <strong>Generic callin bindings</strong><p>Minor changes to give room for new paragraph <a href="s4.10.e.html" title="&sect;4.10.(e)&nbsp;Propagating type parameters"
+ class="sect">&sect;4.10.(e)</a>.
+ </p>
+ </li>
+ <li><a href="s5.4.1.a.html" title="&sect;5.4.1.(a)&nbsp;Method binding guards"
+ class="sect">&sect;5.4.1.(a)</a> :
+ <strong>Scope of regular binding guard</strong><p>Removed an erroneous sentence about the special identifier <code>result</code> in a regular method binding guard.
+ Since parameter mappings are applied before evaluating the guard, the result value can be accessed through
+ a result mapping (<a href="s4.4.c.html"
+ title="&sect;4.4.(c)&nbsp;Mapping the result of a base method"
+ class="sect">&sect;4.4.(c)</a>). Furthermore, the sentence actually confused
+ base and role sides.
+
+ </p>
+ </li>
+ <li><a href="sA.html#sA.3.2" title="&sect;A.3.2&nbsp;CalloutBinding" class="sect">&sect;A.3.2</a>, <a href="sA.html#sA.3.3" title="&sect;A.3.3&nbsp;Callin binding" class="sect">&sect;A.3.3</a> :
+ <strong>Syntax: generic method bindings</strong><p>The location of possible type parameters in a method binding has been made explicit.</p>
+ </li>
+ </ul>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="sB.1.2.html" rel="prev">&lt;&lt;&nbsp;&sect;B.1.(2)&nbsp;Between OTJLD 1.1 and OTJLD 1.2</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="sB.html" rel="section">&sect;B&nbsp;Changes between versions</a>&nbsp;&gt;&nbsp;<a class="nav" href="sB.1.html" rel="section">&sect;B.1&nbsp;Paragraphs changed between versions</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sB.1.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sB.1.html
new file mode 100644
index 000000000..e5a8960f6
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sB.1.html
@@ -0,0 +1,192 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="sB.2.html" rel="next">&sect;B.2&nbsp;Additions between versions&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="sB.html" rel="section">&sect;B&nbsp;Changes between versions</a></div>
+ <div class="sect depth2" id="sB.1">
+ <h2 class="sect">&sect;B.1&nbsp;Paragraphs changed between versions</h2>
+ <div class="subsect depth3" id="sB.1.1">
+ <h4 class="subsect">(1)&nbsp;<span class="title">Between OTJLD 1.0 and OTJLD 1.1</span></h4>
+ <ul>
+ <li><a href="s3.2.a.html" title="&sect;3.2.(a)&nbsp;with clause" class="sect">&sect;3.2.(a)</a> :
+ <strong>Parameter mappings</strong><p>
+ Disallow parameter mappings in a role interface.
+
+ </p>
+ </li>
+ <li><a href="s4.5.d.html" title="&sect;4.5.(d)&nbsp;Typing rules" class="sect">&sect;4.5.(d)</a> :
+ <strong>Replace bindings</strong><p>
+ Disallow unsafe use of polymorphism and primitive type conversions.
+
+ </p>
+ </li>
+ <li><a href="s6.1.a.html"
+ title="&sect;6.1.(a)&nbsp;Interface to the role registry"
+ class="sect">&sect;6.1.(a)</a> :
+ <strong>Signatures of reflective methods</strong><p>
+ Made two methods generic so that return values can be used without the need of casting.
+
+ </p>
+ </li>
+ <li><a href="s7.2.html" title="&sect;7.2&nbsp;Confined roles" class="sect">&sect;7.2</a> :
+ <strong>Confined roles</strong><p>
+ Improved explanation.
+
+ </p>
+ </li>
+ </ul>
+ </div>
+ <div class="subsect depth3" id="sB.1.2">
+ <h4 class="subsect">(2)&nbsp;<span class="title">Between OTJLD 1.1 and OTJLD 1.2</span></h4>
+ <ul>
+ <li><a href="s1.2.1.e.html" title="&sect;1.2.1.(e)&nbsp;Role features"
+ class="sect">&sect;1.2.1.(e)</a>:
+ <strong>Visibility of role features</strong><p>
+ Clarification has been added that a role can always access all the
+ features that its enclosing team has access to.
+
+ </p>
+ </li>
+ <li><a href="s2.1.2.e.html" title="&sect;2.1.2.(e)&nbsp;No free type parameters"
+ class="sect">&sect;2.1.2.(e)</a>:
+ <strong>Generic roles/bases</strong><p>
+ Relaxed the rules about generic bound roles. This change also subsumes what previously was a specific restriction in
+ <a href="s4.1.b.html" title="&sect;4.1.(b)&nbsp;Prerequisite: Class binding"
+ class="sect">&sect;4.1.(b)</a>.
+
+ </p>
+ </li>
+ <li><a href="s3.1.i.html" title="&sect;3.1.(i)&nbsp;Shorthand definition"
+ class="sect">&sect;3.1.(i)</a> and <a href="s3.5.f.html" title="&sect;3.5.(f)&nbsp;Shorthand definition"
+ class="sect">&sect;3.5.(f)</a>:
+ <strong>Visibility of shorthand callout</strong><p>
+ A role method defined by a shorthand callout binding can now specify a visibility modifier
+ (see also <a href="sA.html#sA.3.2" title="&sect;A.3.2&nbsp;CalloutBinding" class="sect">&sect;A.3.2</a>),
+ otherwise it inherits the visibility modifier of it's bound base method/field.
+
+ </p>
+ </li>
+ <li><a href="s3.1.j.html" title="&sect;3.1.(j)&nbsp;Inferred callout" class="sect">&sect;3.1.(j)</a> and <a href="s3.5.h.html" title="&sect;3.5.(h)&nbsp;Inferred callout" class="sect">&sect;3.5.(h)</a>:
+ <strong>Visibility of inferred callout</strong><p>
+ Role methods inferred as a callout binding are either <code>public</code>
+ (inferred via interface) or <code>private</code> inferred from
+ self call / field access.
+
+ </p>
+ </li>
+ <li><a href="s3.5.h.html" title="&sect;3.5.(h)&nbsp;Inferred callout" class="sect">&sect;3.5.(h)</a>:
+ <strong>No explicit use of inferred callout to field</strong><p>
+ Clarification has been added that an accessor method generated for an inferred callout to field
+ can not be explicitly invoked.
+
+ </p>
+ </li>
+ <li><a href="s4.1.b.html" title="&sect;4.1.(b)&nbsp;Prerequisite: Class binding"
+ class="sect">&sect;4.1.(b)</a>:
+ <strong>No callin in generic role</strong><p>
+ A restriction has been made explicit that a generic role cannot define callin bindings.
+
+ </p>
+ </li>
+ <li><a href="s4.2.d.html" title="&sect;4.2.(d)&nbsp;Callin methods" class="sect">&sect;4.2.(d)</a> :
+ <strong>Callin methods</strong><p>Slightly rephrased and extended the rule to make explicit that a callin method can
+ indeed be intercepted using a second level callin binding.
+
+ </p>
+ </li>
+ <li><a href="s6.1.a.html"
+ title="&sect;6.1.(a)&nbsp;Interface to the role registry"
+ class="sect">&sect;6.1.(a)</a> :
+ <strong>Reflective methods <code>getAllRoles</code></strong><p>
+ More precision: answer only <em>bound</em> roles.
+
+ </p>
+ </li>
+ </ul>
+ </div>
+ <div class="subsect depth3" id="sB.1.3">
+ <h4 class="subsect">(3)&nbsp;<span class="title">Between OTJLD 1.2 and OTJLD 1.3</span></h4>
+ <ul>
+ <li><a href="s1.2.4.c.html" title="&sect;1.2.4.(c)&nbsp;Class literal"
+ class="sect">&sect;1.2.4.(c)</a> :
+ <strong>Syntax for role class literals</strong><p>Previously, the syntax <code>R&lt;@t&gt;.class</code> was not supported.
+ This restriction has been removed.
+
+ </p>
+ </li>
+ <li><a href="s1.3.html"
+ title="&sect;1.3&nbsp;Acquisition and implicit inheritance of role classes"
+ class="sect">&sect;1.3</a> :
+ <strong>Teams extending non-team classes</strong><p>Previously, <code>org.objectteams.Team</code> was the super class of all team classes.
+ As a consequence a team could not extend a non-team class.
+ This restriction has been removed by introducing a new super-type of all teams,
+ the interface <code>org.objectteams.ITeam</code>.
+ This change also affects some paragraphs in <a href="s6.html" title="&sect;6&nbsp;Object Teams API" class="sect">&sect;6</a> as members
+ have been moved to the new interface.
+
+ </p>
+ </li>
+ <li><a href="s4.4.c.html"
+ title="&sect;4.4.(c)&nbsp;Mapping the result of a base method"
+ class="sect">&sect;4.4.(c)</a> :
+ <strong>Further restrict result mapping in after callin bindings</strong><p>Clarify that <code>after</code> callin bindings cannot use the <code>-&gt;</code>
+ token to map a result value.
+
+ </p>
+ </li>
+ <li><a href="s4.10.html" title="&sect;4.10&nbsp;Generic callin bindings"
+ class="sect">&sect;4.10</a>, <a href="s4.10.a.html" title="&sect;4.10.(a)&nbsp;Fresh type parameter"
+ class="sect">&sect;4.10.(a)</a> :
+ <strong>Generic callin bindings</strong><p>Minor changes to give room for new paragraph <a href="s4.10.e.html" title="&sect;4.10.(e)&nbsp;Propagating type parameters"
+ class="sect">&sect;4.10.(e)</a>.
+ </p>
+ </li>
+ <li><a href="s5.4.1.a.html" title="&sect;5.4.1.(a)&nbsp;Method binding guards"
+ class="sect">&sect;5.4.1.(a)</a> :
+ <strong>Scope of regular binding guard</strong><p>Removed an erroneous sentence about the special identifier <code>result</code> in a regular method binding guard.
+ Since parameter mappings are applied before evaluating the guard, the result value can be accessed through
+ a result mapping (<a href="s4.4.c.html"
+ title="&sect;4.4.(c)&nbsp;Mapping the result of a base method"
+ class="sect">&sect;4.4.(c)</a>). Furthermore, the sentence actually confused
+ base and role sides.
+
+ </p>
+ </li>
+ <li><a href="sA.html#sA.3.2" title="&sect;A.3.2&nbsp;CalloutBinding" class="sect">&sect;A.3.2</a>, <a href="sA.html#sA.3.3" title="&sect;A.3.3&nbsp;Callin binding" class="sect">&sect;A.3.3</a> :
+ <strong>Syntax: generic method bindings</strong><p>The location of possible type parameters in a method binding has been made explicit.</p>
+ </li>
+ </ul>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="sB.2.html" rel="next">&sect;B.2&nbsp;Additions between versions&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="sB.html" rel="section">&sect;B&nbsp;Changes between versions</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sB.2.1.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sB.2.1.html
new file mode 100644
index 000000000..2fefc6e6c
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sB.2.1.html
@@ -0,0 +1,94 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="sB.2.2.html" rel="next">&sect;B.2.(2)&nbsp;Between OTJLD 1.1 and OTJLD 1.2&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="sB.html" rel="section">&sect;B&nbsp;Changes between versions</a>&nbsp;&gt;&nbsp;<a class="nav" href="sB.2.html" rel="section">&sect;B.2&nbsp;Additions between versions</a></div>
+ <div class="subsect depth3" id="sB.2.1">
+ <h4 class="subsect">&sect;B.2.(1)&nbsp;<span class="title">Between OTJLD 1.0 and OTJLD 1.1</span></h4>
+ <ul>
+ <li><a href="s1.2.4.c.html" title="&sect;1.2.4.(c)&nbsp;Class literal"
+ class="sect">&sect;1.2.4.(c)</a>:
+ <strong>Role class literal</strong><p>
+ Made existing feature explicit and introduce new qualified class literal for externalized roles.
+
+ </p>
+ </li>
+ <li><a href="s3.1.j.html" title="&sect;3.1.(j)&nbsp;Inferred callout" class="sect">&sect;3.1.(j)</a> and <a href="s3.5.h.html" title="&sect;3.5.(h)&nbsp;Inferred callout" class="sect">&sect;3.5.(h)</a> :
+ <strong>Inferred callout</strong><p>
+ New feature.
+
+ </p>
+ </li>
+ <li><a href="s4.6.a.html"
+ title="&sect;4.6.(a)&nbsp;Private methods from super classes"
+ class="sect">&sect;4.6.(a)</a> :
+ <strong>Callin-binding private methods from super classes</strong><p>
+ Added a necessary restriction.
+
+ </p>
+ </li>
+ <li><a href="s4.9.html" title="&sect;4.9&nbsp;Callin inheritance" class="sect">&sect;4.9</a> :
+ <strong>Callin inheritance</strong><p>
+ Clarified issues that where under-specified or insufficiently explained, specifically:
+
+ </p>
+ <ul>
+ <li>Effect of callin bindings on inherited or overridden base methods
+ (<a href="s4.9.1.html" title="&sect;4.9.1&nbsp;Base side inheritance"
+ class="sect">&sect;4.9.1</a>).
+ </li>
+ <li>Interplay of callin bindings and base methods with covariant return types
+ (<a href="s4.9.3.html" title="&sect;4.9.3&nbsp;Covariant return types"
+ class="sect">&sect;4.9.3</a>)
+ </li>
+ </ul>
+ </li>
+ <li><a href="s4.10.html" title="&sect;4.10&nbsp;Generic callin bindings"
+ class="sect">&sect;4.10</a>:
+ <strong>Generic replace bindings</strong><p>
+ Reconcile type safety of replace bindings as introduced in <a href="s4.5.d.html" title="&sect;4.5.(d)&nbsp;Typing rules" class="sect">&sect;4.5.(d)</a>
+ with desirable flexibility by using type parameters.
+
+ </p>
+ </li>
+ <li><a href="s7.2.b.html" title="&sect;7.2.(b)&nbsp;Arrays of Confined"
+ class="sect">&sect;7.2.(b)</a> :
+ <strong>Arrays of Confined</strong><p>
+ Added a necessary restriction.
+
+ </p>
+ </li>
+ </ul>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="sB.2.2.html" rel="next">&sect;B.2.(2)&nbsp;Between OTJLD 1.1 and OTJLD 1.2&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="sB.html" rel="section">&sect;B&nbsp;Changes between versions</a>&nbsp;&gt;&nbsp;<a class="nav" href="sB.2.html" rel="section">&sect;B.2&nbsp;Additions between versions</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sB.2.2.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sB.2.2.html
new file mode 100644
index 000000000..d9902bcb2
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sB.2.2.html
@@ -0,0 +1,114 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="sB.2.1.html" rel="prev">&lt;&lt;&nbsp;&sect;B.2.(1)&nbsp;Between OTJLD 1.0 and OTJLD 1.1</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="sB.2.3.html" rel="next">&sect;B.2.(3)&nbsp;Between OTJLD 1.2 and OTJLD 1.3&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="sB.html" rel="section">&sect;B&nbsp;Changes between versions</a>&nbsp;&gt;&nbsp;<a class="nav" href="sB.2.html" rel="section">&sect;B.2&nbsp;Additions between versions</a></div>
+ <div class="subsect depth3" id="sB.2.2">
+ <h4 class="subsect">&sect;B.2.(2)&nbsp;<span class="title">Between OTJLD 1.1 and OTJLD 1.2</span></h4>
+ <ul>
+ <li><a href="s1.2.2.h.html" title="&sect;1.2.2.(h)&nbsp;Externalized creation"
+ class="sect">&sect;1.2.2.(h)</a> :
+ <strong>Externalized creation</strong><p>Added alternative syntax using value parameter and changed title.</p>
+ </li>
+ <li><a href="s1.2.5.f.html" title="&sect;1.2.5.(f)&nbsp;Imports in role files"
+ class="sect">&sect;1.2.5.(f)</a> :
+ <strong>Imports in role files</strong><p>Added a missing rule defining the effect of imports in role files.</p>
+ </li>
+ <li><a href="s1.3.1.c.html"
+ title="&sect;1.3.1.(c)&nbsp;Overriding and implicit inheritance"
+ class="sect">&sect;1.3.1.(c)</a> :
+ <strong>@Override annotation for roles</strong><p>The regular <code>@Override</code> annotation (Java &ge;5) has been extended to apply to role classes, too.
+
+ </p>
+ </li>
+ <li><a href="s1.3.1.k.html" title="&sect;1.3.1.(k)&nbsp;Covariant return types"
+ class="sect">&sect;1.3.1.(k)</a> :
+ <strong>Covariant return types</strong><p>Necessary constraint for covariant return types in the presence of both implicit and explicit inheritance.
+
+ </p>
+ </li>
+ <li><a href="s2.1.2.c.html" title="&sect;2.1.2.(c)&nbsp;Base class decapsulation"
+ class="sect">&sect;2.1.2.(c)</a> :
+ <strong>Binding to final base class</strong><p>It has been added that binding to a final base class is now considered as decapsulation, too.
+
+ </p>
+ </li>
+ <li><a href="s2.2.f.html" title="&sect;2.2.(f)&nbsp;Ambiguous lowering"
+ class="sect">&sect;2.2.(f)</a> :
+ <strong>Ambiguous lowering</strong><p>A diagnostic has been added to detect situations where lowering might be intended
+ but fails because the declared type is <code>java.lang.Object</code>,
+ which makes a potential lowering translation unnecessary and thus ambiguous.
+
+ </p>
+ </li>
+ <li><a href="s2.3.2.e.html" title="&sect;2.3.2.(e)&nbsp;Generic declared lifting"
+ class="sect">&sect;2.3.2.(e)</a> :
+ <strong>Generic declared lifting</strong><p>Support passing unrelated base types into the same method with declared lifting.
+
+ </p>
+ </li>
+ <li><a href="s2.6.g.html"
+ title="&sect;2.6.(g)&nbsp;Decapsulation via base reference"
+ class="sect">&sect;2.6.(g)</a> :
+ <strong>Decapsulation via base reference</strong><p>Extended applicability of decapsulation to two more positions.
+
+ </p>
+ </li>
+ <li><a href="s4.3.f.html" title="&sect;4.3.(f)&nbsp;Base super calls" class="sect">&sect;4.3.(f)</a> :
+ <strong>Base super call</strong><p>Support base calls directly to the super version of the bound base method,
+ thus bypassing both the exact bound base method and also any further callins
+ relating to this base method or its super version.
+
+ </p>
+ </li>
+ <li><a href="s5.4.b.html" title="&sect;5.4.(b)&nbsp;No side effects" class="sect">&sect;5.4.(b)</a> :
+ <strong>Side-effects in guard predicates</strong><p>Migrate previous note about a future feature to a regular paragraph.</p>
+ </li>
+ <li><a href="s5.4.c.html" title="&sect;5.4.(c)&nbsp;Exceptions" class="sect">&sect;5.4.(c)</a> :
+ <strong>Exceptions in guard predicates</strong><p>Clarify the effect of exceptions thrown from a guard predicate.</p>
+ </li>
+ <li><a href="s6.2.d.html" title="&sect;6.2.(d)&nbsp;Exceptions" class="sect">&sect;6.2.(d)</a> :
+ <strong>LiftingVetoException</strong><p>Added documentation for the mostly internal <code>LiftingVetoException</code> and how
+ it could actually be used in client code.
+
+ </p>
+ </li>
+ <li><a href="s6.2.e.html" title="&sect;6.2.(e)&nbsp;Role migration" class="sect">&sect;6.2.(e)</a> :
+ <strong>Role migration</strong><p>Added two interfaces to add migration capabilities to a role class.
+
+ </p>
+ </li>
+ </ul>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="sB.2.1.html" rel="prev">&lt;&lt;&nbsp;&sect;B.2.(1)&nbsp;Between OTJLD 1.0 and OTJLD 1.1</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"><a href="sB.2.3.html" rel="next">&sect;B.2.(3)&nbsp;Between OTJLD 1.2 and OTJLD 1.3&nbsp;&gt;&gt;</a></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="sB.html" rel="section">&sect;B&nbsp;Changes between versions</a>&nbsp;&gt;&nbsp;<a class="nav" href="sB.2.html" rel="section">&sect;B.2&nbsp;Additions between versions</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sB.2.3.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sB.2.3.html
new file mode 100644
index 000000000..379f7d4b0
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sB.2.3.html
@@ -0,0 +1,81 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="sB.2.2.html" rel="prev">&lt;&lt;&nbsp;&sect;B.2.(2)&nbsp;Between OTJLD 1.1 and OTJLD 1.2</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="sB.html" rel="section">&sect;B&nbsp;Changes between versions</a>&nbsp;&gt;&nbsp;<a class="nav" href="sB.2.html" rel="section">&sect;B.2&nbsp;Additions between versions</a></div>
+ <div class="subsect depth3" id="sB.2.3">
+ <h4 class="subsect">&sect;B.2.(3)&nbsp;<span class="title">Between OTJLD 1.2 and OTJLD 1.3</span></h4>
+ <ul>
+ <li><a href="s3.1.k.html" title="&sect;3.1.(k)&nbsp;Callout to generic method"
+ class="sect">&sect;3.1.(k)</a> :
+ <strong>Callout to generic method</strong><p>Added a rule on how a callout binding may refer to a generic base method.
+
+ </p>
+ </li>
+ <li><a href="s4.1.h.html" title="&sect;4.1.(h)&nbsp;Method of enclosing class"
+ class="sect">&sect;4.1.(h)</a> :
+ <strong>Binding to team methods</strong><p><code>before</code> and <code>after</code> callin bindings can now
+ bind to methods of an enclosing class, too.
+
+ </p>
+ </li>
+ <li><a href="s4.10.e.html" title="&sect;4.10.(e)&nbsp;Propagating type parameters"
+ class="sect">&sect;4.10.(e)</a> :
+ <strong>Propagating type parameters in callin bindings</strong><p>
+ In addition to capturing covariant return types, a callin binding
+ may also declared type parameters in order to propagate genericity
+ from its base method to the role method.
+
+ </p>
+ </li>
+ <li><a href="s5.3.d.html"
+ title="&sect;5.3.(d)&nbsp;Configuring implicit activation"
+ class="sect">&sect;5.3.(d)</a> :
+ <strong>Configuring implicit activation</strong><p>Mechanisms have been added for configuring implicit team activation.
+ The default has been changed to not apply implicit activation.
+ A corresponding note has also been added to <a href="s5.3.html" title="&sect;5.3&nbsp;Implicit team activation"
+ class="sect">&sect;5.3</a></p>
+ </li>
+ <li><a href="s9.2.1.a.html"
+ title="&sect;9.2.1.(a)&nbsp;Instance constrained type parameters"
+ class="sect">&sect;9.2.1.(a)</a> :
+ <strong>Instance constrained type parameter</strong><p>
+ Type anchors can now be applied to type parameters, too,
+ thus expressing a new kind of constraint on the type parameter.
+
+ </p>
+ </li>
+ </ul>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="sB.2.2.html" rel="prev">&lt;&lt;&nbsp;&sect;B.2.(2)&nbsp;Between OTJLD 1.1 and OTJLD 1.2</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="sB.html" rel="section">&sect;B&nbsp;Changes between versions</a>&nbsp;&gt;&nbsp;<a class="nav" href="sB.2.html" rel="section">&sect;B.2&nbsp;Additions between versions</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sB.2.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sB.2.html
new file mode 100644
index 000000000..aaf2b2814
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sB.2.html
@@ -0,0 +1,218 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="sB.1.html" rel="prev">&lt;&lt;&nbsp;&sect;B.1&nbsp;Paragraphs changed between versions</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="sB.html" rel="section">&sect;B&nbsp;Changes between versions</a></div>
+ <div class="sect depth2" id="sB.2">
+ <h2 class="sect">&sect;B.2&nbsp;Additions between versions</h2>
+ <div class="subsect depth3" id="sB.2.1">
+ <h4 class="subsect">(1)&nbsp;<span class="title">Between OTJLD 1.0 and OTJLD 1.1</span></h4>
+ <ul>
+ <li><a href="s1.2.4.c.html" title="&sect;1.2.4.(c)&nbsp;Class literal"
+ class="sect">&sect;1.2.4.(c)</a>:
+ <strong>Role class literal</strong><p>
+ Made existing feature explicit and introduce new qualified class literal for externalized roles.
+
+ </p>
+ </li>
+ <li><a href="s3.1.j.html" title="&sect;3.1.(j)&nbsp;Inferred callout" class="sect">&sect;3.1.(j)</a> and <a href="s3.5.h.html" title="&sect;3.5.(h)&nbsp;Inferred callout" class="sect">&sect;3.5.(h)</a> :
+ <strong>Inferred callout</strong><p>
+ New feature.
+
+ </p>
+ </li>
+ <li><a href="s4.6.a.html"
+ title="&sect;4.6.(a)&nbsp;Private methods from super classes"
+ class="sect">&sect;4.6.(a)</a> :
+ <strong>Callin-binding private methods from super classes</strong><p>
+ Added a necessary restriction.
+
+ </p>
+ </li>
+ <li><a href="s4.9.html" title="&sect;4.9&nbsp;Callin inheritance" class="sect">&sect;4.9</a> :
+ <strong>Callin inheritance</strong><p>
+ Clarified issues that where under-specified or insufficiently explained, specifically:
+
+ </p>
+ <ul>
+ <li>Effect of callin bindings on inherited or overridden base methods
+ (<a href="s4.9.1.html" title="&sect;4.9.1&nbsp;Base side inheritance"
+ class="sect">&sect;4.9.1</a>).
+ </li>
+ <li>Interplay of callin bindings and base methods with covariant return types
+ (<a href="s4.9.3.html" title="&sect;4.9.3&nbsp;Covariant return types"
+ class="sect">&sect;4.9.3</a>)
+ </li>
+ </ul>
+ </li>
+ <li><a href="s4.10.html" title="&sect;4.10&nbsp;Generic callin bindings"
+ class="sect">&sect;4.10</a>:
+ <strong>Generic replace bindings</strong><p>
+ Reconcile type safety of replace bindings as introduced in <a href="s4.5.d.html" title="&sect;4.5.(d)&nbsp;Typing rules" class="sect">&sect;4.5.(d)</a>
+ with desirable flexibility by using type parameters.
+
+ </p>
+ </li>
+ <li><a href="s7.2.b.html" title="&sect;7.2.(b)&nbsp;Arrays of Confined"
+ class="sect">&sect;7.2.(b)</a> :
+ <strong>Arrays of Confined</strong><p>
+ Added a necessary restriction.
+
+ </p>
+ </li>
+ </ul>
+ </div>
+ <div class="subsect depth3" id="sB.2.2">
+ <h4 class="subsect">(2)&nbsp;<span class="title">Between OTJLD 1.1 and OTJLD 1.2</span></h4>
+ <ul>
+ <li><a href="s1.2.2.h.html" title="&sect;1.2.2.(h)&nbsp;Externalized creation"
+ class="sect">&sect;1.2.2.(h)</a> :
+ <strong>Externalized creation</strong><p>Added alternative syntax using value parameter and changed title.</p>
+ </li>
+ <li><a href="s1.2.5.f.html" title="&sect;1.2.5.(f)&nbsp;Imports in role files"
+ class="sect">&sect;1.2.5.(f)</a> :
+ <strong>Imports in role files</strong><p>Added a missing rule defining the effect of imports in role files.</p>
+ </li>
+ <li><a href="s1.3.1.c.html"
+ title="&sect;1.3.1.(c)&nbsp;Overriding and implicit inheritance"
+ class="sect">&sect;1.3.1.(c)</a> :
+ <strong>@Override annotation for roles</strong><p>The regular <code>@Override</code> annotation (Java &ge;5) has been extended to apply to role classes, too.
+
+ </p>
+ </li>
+ <li><a href="s1.3.1.k.html" title="&sect;1.3.1.(k)&nbsp;Covariant return types"
+ class="sect">&sect;1.3.1.(k)</a> :
+ <strong>Covariant return types</strong><p>Necessary constraint for covariant return types in the presence of both implicit and explicit inheritance.
+
+ </p>
+ </li>
+ <li><a href="s2.1.2.c.html" title="&sect;2.1.2.(c)&nbsp;Base class decapsulation"
+ class="sect">&sect;2.1.2.(c)</a> :
+ <strong>Binding to final base class</strong><p>It has been added that binding to a final base class is now considered as decapsulation, too.
+
+ </p>
+ </li>
+ <li><a href="s2.2.f.html" title="&sect;2.2.(f)&nbsp;Ambiguous lowering"
+ class="sect">&sect;2.2.(f)</a> :
+ <strong>Ambiguous lowering</strong><p>A diagnostic has been added to detect situations where lowering might be intended
+ but fails because the declared type is <code>java.lang.Object</code>,
+ which makes a potential lowering translation unnecessary and thus ambiguous.
+
+ </p>
+ </li>
+ <li><a href="s2.3.2.e.html" title="&sect;2.3.2.(e)&nbsp;Generic declared lifting"
+ class="sect">&sect;2.3.2.(e)</a> :
+ <strong>Generic declared lifting</strong><p>Support passing unrelated base types into the same method with declared lifting.
+
+ </p>
+ </li>
+ <li><a href="s2.6.g.html"
+ title="&sect;2.6.(g)&nbsp;Decapsulation via base reference"
+ class="sect">&sect;2.6.(g)</a> :
+ <strong>Decapsulation via base reference</strong><p>Extended applicability of decapsulation to two more positions.
+
+ </p>
+ </li>
+ <li><a href="s4.3.f.html" title="&sect;4.3.(f)&nbsp;Base super calls" class="sect">&sect;4.3.(f)</a> :
+ <strong>Base super call</strong><p>Support base calls directly to the super version of the bound base method,
+ thus bypassing both the exact bound base method and also any further callins
+ relating to this base method or its super version.
+
+ </p>
+ </li>
+ <li><a href="s5.4.b.html" title="&sect;5.4.(b)&nbsp;No side effects" class="sect">&sect;5.4.(b)</a> :
+ <strong>Side-effects in guard predicates</strong><p>Migrate previous note about a future feature to a regular paragraph.</p>
+ </li>
+ <li><a href="s5.4.c.html" title="&sect;5.4.(c)&nbsp;Exceptions" class="sect">&sect;5.4.(c)</a> :
+ <strong>Exceptions in guard predicates</strong><p>Clarify the effect of exceptions thrown from a guard predicate.</p>
+ </li>
+ <li><a href="s6.2.d.html" title="&sect;6.2.(d)&nbsp;Exceptions" class="sect">&sect;6.2.(d)</a> :
+ <strong>LiftingVetoException</strong><p>Added documentation for the mostly internal <code>LiftingVetoException</code> and how
+ it could actually be used in client code.
+
+ </p>
+ </li>
+ <li><a href="s6.2.e.html" title="&sect;6.2.(e)&nbsp;Role migration" class="sect">&sect;6.2.(e)</a> :
+ <strong>Role migration</strong><p>Added two interfaces to add migration capabilities to a role class.
+
+ </p>
+ </li>
+ </ul>
+ </div>
+ <div class="subsect depth3" id="sB.2.3">
+ <h4 class="subsect">(3)&nbsp;<span class="title">Between OTJLD 1.2 and OTJLD 1.3</span></h4>
+ <ul>
+ <li><a href="s3.1.k.html" title="&sect;3.1.(k)&nbsp;Callout to generic method"
+ class="sect">&sect;3.1.(k)</a> :
+ <strong>Callout to generic method</strong><p>Added a rule on how a callout binding may refer to a generic base method.
+
+ </p>
+ </li>
+ <li><a href="s4.1.h.html" title="&sect;4.1.(h)&nbsp;Method of enclosing class"
+ class="sect">&sect;4.1.(h)</a> :
+ <strong>Binding to team methods</strong><p><code>before</code> and <code>after</code> callin bindings can now
+ bind to methods of an enclosing class, too.
+
+ </p>
+ </li>
+ <li><a href="s4.10.e.html" title="&sect;4.10.(e)&nbsp;Propagating type parameters"
+ class="sect">&sect;4.10.(e)</a> :
+ <strong>Propagating type parameters in callin bindings</strong><p>
+ In addition to capturing covariant return types, a callin binding
+ may also declared type parameters in order to propagate genericity
+ from its base method to the role method.
+
+ </p>
+ </li>
+ <li><a href="s5.3.d.html"
+ title="&sect;5.3.(d)&nbsp;Configuring implicit activation"
+ class="sect">&sect;5.3.(d)</a> :
+ <strong>Configuring implicit activation</strong><p>Mechanisms have been added for configuring implicit team activation.
+ The default has been changed to not apply implicit activation.
+ A corresponding note has also been added to <a href="s5.3.html" title="&sect;5.3&nbsp;Implicit team activation"
+ class="sect">&sect;5.3</a></p>
+ </li>
+ <li><a href="s9.2.1.a.html"
+ title="&sect;9.2.1.(a)&nbsp;Instance constrained type parameters"
+ class="sect">&sect;9.2.1.(a)</a> :
+ <strong>Instance constrained type parameter</strong><p>
+ Type anchors can now be applied to type parameters, too,
+ thus expressing a new kind of constraint on the type parameter.
+
+ </p>
+ </li>
+ </ul>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="sB.1.html" rel="prev">&lt;&lt;&nbsp;&sect;B.1&nbsp;Paragraphs changed between versions</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"><a class="nav" href="sB.html" rel="section">&sect;B&nbsp;Changes between versions</a></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sB.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sB.html
new file mode 100644
index 000000000..582bc0e8e
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/sB.html
@@ -0,0 +1,387 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="copyright"
+ content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel="stylesheet" type="text/css" href="../css/ot.css" />
+ <link rel="stylesheet" type="text/css" href="../css/otjld.css" />
+ <title>OT/J Language Definition v1.3</title>
+ </head>
+ <body class="otdt">
+ <div id="content">
+ <table class="nav">
+ <tr>
+ <td class="back"><a id="top"></a><a href="sA.html" rel="prev">&lt;&lt;&nbsp;&sect;A&nbsp;OT/J Syntax</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"></div>
+ <div class="chapter" id="sB">
+ <div class="headl">
+ <div class="headr">
+ <h1>&sect;B&nbsp;Changes between versions</h1>
+ </div>
+ </div>
+ <div id="toc-box">
+ <ul class="toc-box">
+ <li><a href="sB.html">&sect;B&nbsp;Changes between versions</a></li>
+ <li><a href="#sB.1">&sect;B.1&nbsp;Paragraphs changed between versions</a></li>
+ <li><a href="#sB.2">&sect;B.2&nbsp;Additions between versions</a></li>
+ </ul>
+ </div>
+ <div class="sect depth2" id="sB.1">
+ <h2 class="sect">&sect;B.1&nbsp;Paragraphs changed between versions<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;B</a></span></h2>
+ <div class="subsect depth3" id="sB.1.1">
+ <h4 class="subsect">(1)&nbsp;<span class="title">Between OTJLD 1.0 and OTJLD 1.1</span></h4>
+ <ul>
+ <li><a href="s3.2.a.html" title="&sect;3.2.(a)&nbsp;with clause" class="sect">&sect;3.2.(a)</a> :
+ <strong>Parameter mappings</strong><p>
+ Disallow parameter mappings in a role interface.
+
+ </p>
+ </li>
+ <li><a href="s4.5.d.html" title="&sect;4.5.(d)&nbsp;Typing rules" class="sect">&sect;4.5.(d)</a> :
+ <strong>Replace bindings</strong><p>
+ Disallow unsafe use of polymorphism and primitive type conversions.
+
+ </p>
+ </li>
+ <li><a href="s6.1.a.html"
+ title="&sect;6.1.(a)&nbsp;Interface to the role registry"
+ class="sect">&sect;6.1.(a)</a> :
+ <strong>Signatures of reflective methods</strong><p>
+ Made two methods generic so that return values can be used without the need of casting.
+
+ </p>
+ </li>
+ <li><a href="s7.2.html" title="&sect;7.2&nbsp;Confined roles" class="sect">&sect;7.2</a> :
+ <strong>Confined roles</strong><p>
+ Improved explanation.
+
+ </p>
+ </li>
+ </ul>
+ </div>
+ <div class="subsect depth3" id="sB.1.2">
+ <h4 class="subsect">(2)&nbsp;<span class="title">Between OTJLD 1.1 and OTJLD 1.2</span></h4>
+ <ul>
+ <li><a href="s1.2.1.e.html" title="&sect;1.2.1.(e)&nbsp;Role features"
+ class="sect">&sect;1.2.1.(e)</a>:
+ <strong>Visibility of role features</strong><p>
+ Clarification has been added that a role can always access all the
+ features that its enclosing team has access to.
+
+ </p>
+ </li>
+ <li><a href="s2.1.2.e.html" title="&sect;2.1.2.(e)&nbsp;No free type parameters"
+ class="sect">&sect;2.1.2.(e)</a>:
+ <strong>Generic roles/bases</strong><p>
+ Relaxed the rules about generic bound roles. This change also subsumes what previously was a specific restriction in
+ <a href="s4.1.b.html" title="&sect;4.1.(b)&nbsp;Prerequisite: Class binding"
+ class="sect">&sect;4.1.(b)</a>.
+
+ </p>
+ </li>
+ <li><a href="s3.1.i.html" title="&sect;3.1.(i)&nbsp;Shorthand definition"
+ class="sect">&sect;3.1.(i)</a> and <a href="s3.5.f.html" title="&sect;3.5.(f)&nbsp;Shorthand definition"
+ class="sect">&sect;3.5.(f)</a>:
+ <strong>Visibility of shorthand callout</strong><p>
+ A role method defined by a shorthand callout binding can now specify a visibility modifier
+ (see also <a href="sA.html#sA.3.2" title="&sect;A.3.2&nbsp;CalloutBinding" class="sect">&sect;A.3.2</a>),
+ otherwise it inherits the visibility modifier of it's bound base method/field.
+
+ </p>
+ </li>
+ <li><a href="s3.1.j.html" title="&sect;3.1.(j)&nbsp;Inferred callout" class="sect">&sect;3.1.(j)</a> and <a href="s3.5.h.html" title="&sect;3.5.(h)&nbsp;Inferred callout" class="sect">&sect;3.5.(h)</a>:
+ <strong>Visibility of inferred callout</strong><p>
+ Role methods inferred as a callout binding are either <code>public</code>
+ (inferred via interface) or <code>private</code> inferred from
+ self call / field access.
+
+ </p>
+ </li>
+ <li><a href="s3.5.h.html" title="&sect;3.5.(h)&nbsp;Inferred callout" class="sect">&sect;3.5.(h)</a>:
+ <strong>No explicit use of inferred callout to field</strong><p>
+ Clarification has been added that an accessor method generated for an inferred callout to field
+ can not be explicitly invoked.
+
+ </p>
+ </li>
+ <li><a href="s4.1.b.html" title="&sect;4.1.(b)&nbsp;Prerequisite: Class binding"
+ class="sect">&sect;4.1.(b)</a>:
+ <strong>No callin in generic role</strong><p>
+ A restriction has been made explicit that a generic role cannot define callin bindings.
+
+ </p>
+ </li>
+ <li><a href="s4.2.d.html" title="&sect;4.2.(d)&nbsp;Callin methods" class="sect">&sect;4.2.(d)</a> :
+ <strong>Callin methods</strong><p>Slightly rephrased and extended the rule to make explicit that a callin method can
+ indeed be intercepted using a second level callin binding.
+
+ </p>
+ </li>
+ <li><a href="s6.1.a.html"
+ title="&sect;6.1.(a)&nbsp;Interface to the role registry"
+ class="sect">&sect;6.1.(a)</a> :
+ <strong>Reflective methods <code>getAllRoles</code></strong><p>
+ More precision: answer only <em>bound</em> roles.
+
+ </p>
+ </li>
+ </ul>
+ </div>
+ <div class="subsect depth3" id="sB.1.3">
+ <h4 class="subsect">(3)&nbsp;<span class="title">Between OTJLD 1.2 and OTJLD 1.3</span></h4>
+ <ul>
+ <li><a href="s1.2.4.c.html" title="&sect;1.2.4.(c)&nbsp;Class literal"
+ class="sect">&sect;1.2.4.(c)</a> :
+ <strong>Syntax for role class literals</strong><p>Previously, the syntax <code>R&lt;@t&gt;.class</code> was not supported.
+ This restriction has been removed.
+
+ </p>
+ </li>
+ <li><a href="s1.3.html"
+ title="&sect;1.3&nbsp;Acquisition and implicit inheritance of role classes"
+ class="sect">&sect;1.3</a> :
+ <strong>Teams extending non-team classes</strong><p>Previously, <code>org.objectteams.Team</code> was the super class of all team classes.
+ As a consequence a team could not extend a non-team class.
+ This restriction has been removed by introducing a new super-type of all teams,
+ the interface <code>org.objectteams.ITeam</code>.
+ This change also affects some paragraphs in <a href="s6.html" title="&sect;6&nbsp;Object Teams API" class="sect">&sect;6</a> as members
+ have been moved to the new interface.
+
+ </p>
+ </li>
+ <li><a href="s4.4.c.html"
+ title="&sect;4.4.(c)&nbsp;Mapping the result of a base method"
+ class="sect">&sect;4.4.(c)</a> :
+ <strong>Further restrict result mapping in after callin bindings</strong><p>Clarify that <code>after</code> callin bindings cannot use the <code>-&gt;</code>
+ token to map a result value.
+
+ </p>
+ </li>
+ <li><a href="s4.10.html" title="&sect;4.10&nbsp;Generic callin bindings"
+ class="sect">&sect;4.10</a>, <a href="s4.10.a.html" title="&sect;4.10.(a)&nbsp;Fresh type parameter"
+ class="sect">&sect;4.10.(a)</a> :
+ <strong>Generic callin bindings</strong><p>Minor changes to give room for new paragraph <a href="s4.10.e.html" title="&sect;4.10.(e)&nbsp;Propagating type parameters"
+ class="sect">&sect;4.10.(e)</a>.
+ </p>
+ </li>
+ <li><a href="s5.4.1.a.html" title="&sect;5.4.1.(a)&nbsp;Method binding guards"
+ class="sect">&sect;5.4.1.(a)</a> :
+ <strong>Scope of regular binding guard</strong><p>Removed an erroneous sentence about the special identifier <code>result</code> in a regular method binding guard.
+ Since parameter mappings are applied before evaluating the guard, the result value can be accessed through
+ a result mapping (<a href="s4.4.c.html"
+ title="&sect;4.4.(c)&nbsp;Mapping the result of a base method"
+ class="sect">&sect;4.4.(c)</a>). Furthermore, the sentence actually confused
+ base and role sides.
+
+ </p>
+ </li>
+ <li><a href="sA.html#sA.3.2" title="&sect;A.3.2&nbsp;CalloutBinding" class="sect">&sect;A.3.2</a>, <a href="sA.html#sA.3.3" title="&sect;A.3.3&nbsp;Callin binding" class="sect">&sect;A.3.3</a> :
+ <strong>Syntax: generic method bindings</strong><p>The location of possible type parameters in a method binding has been made explicit.</p>
+ </li>
+ </ul>
+ </div>
+ </div>
+ <div class="sect depth2" id="sB.2">
+ <h2 class="sect">&sect;B.2&nbsp;Additions between versions<span class="toplink"><a href="#top">&uarr;&nbsp;&sect;B</a></span></h2>
+ <div class="subsect depth3" id="sB.2.1">
+ <h4 class="subsect">(1)&nbsp;<span class="title">Between OTJLD 1.0 and OTJLD 1.1</span></h4>
+ <ul>
+ <li><a href="s1.2.4.c.html" title="&sect;1.2.4.(c)&nbsp;Class literal"
+ class="sect">&sect;1.2.4.(c)</a>:
+ <strong>Role class literal</strong><p>
+ Made existing feature explicit and introduce new qualified class literal for externalized roles.
+
+ </p>
+ </li>
+ <li><a href="s3.1.j.html" title="&sect;3.1.(j)&nbsp;Inferred callout" class="sect">&sect;3.1.(j)</a> and <a href="s3.5.h.html" title="&sect;3.5.(h)&nbsp;Inferred callout" class="sect">&sect;3.5.(h)</a> :
+ <strong>Inferred callout</strong><p>
+ New feature.
+
+ </p>
+ </li>
+ <li><a href="s4.6.a.html"
+ title="&sect;4.6.(a)&nbsp;Private methods from super classes"
+ class="sect">&sect;4.6.(a)</a> :
+ <strong>Callin-binding private methods from super classes</strong><p>
+ Added a necessary restriction.
+
+ </p>
+ </li>
+ <li><a href="s4.9.html" title="&sect;4.9&nbsp;Callin inheritance" class="sect">&sect;4.9</a> :
+ <strong>Callin inheritance</strong><p>
+ Clarified issues that where under-specified or insufficiently explained, specifically:
+
+ </p>
+ <ul>
+ <li>Effect of callin bindings on inherited or overridden base methods
+ (<a href="s4.9.1.html" title="&sect;4.9.1&nbsp;Base side inheritance"
+ class="sect">&sect;4.9.1</a>).
+ </li>
+ <li>Interplay of callin bindings and base methods with covariant return types
+ (<a href="s4.9.3.html" title="&sect;4.9.3&nbsp;Covariant return types"
+ class="sect">&sect;4.9.3</a>)
+ </li>
+ </ul>
+ </li>
+ <li><a href="s4.10.html" title="&sect;4.10&nbsp;Generic callin bindings"
+ class="sect">&sect;4.10</a>:
+ <strong>Generic replace bindings</strong><p>
+ Reconcile type safety of replace bindings as introduced in <a href="s4.5.d.html" title="&sect;4.5.(d)&nbsp;Typing rules" class="sect">&sect;4.5.(d)</a>
+ with desirable flexibility by using type parameters.
+
+ </p>
+ </li>
+ <li><a href="s7.2.b.html" title="&sect;7.2.(b)&nbsp;Arrays of Confined"
+ class="sect">&sect;7.2.(b)</a> :
+ <strong>Arrays of Confined</strong><p>
+ Added a necessary restriction.
+
+ </p>
+ </li>
+ </ul>
+ </div>
+ <div class="subsect depth3" id="sB.2.2">
+ <h4 class="subsect">(2)&nbsp;<span class="title">Between OTJLD 1.1 and OTJLD 1.2</span></h4>
+ <ul>
+ <li><a href="s1.2.2.h.html" title="&sect;1.2.2.(h)&nbsp;Externalized creation"
+ class="sect">&sect;1.2.2.(h)</a> :
+ <strong>Externalized creation</strong><p>Added alternative syntax using value parameter and changed title.</p>
+ </li>
+ <li><a href="s1.2.5.f.html" title="&sect;1.2.5.(f)&nbsp;Imports in role files"
+ class="sect">&sect;1.2.5.(f)</a> :
+ <strong>Imports in role files</strong><p>Added a missing rule defining the effect of imports in role files.</p>
+ </li>
+ <li><a href="s1.3.1.c.html"
+ title="&sect;1.3.1.(c)&nbsp;Overriding and implicit inheritance"
+ class="sect">&sect;1.3.1.(c)</a> :
+ <strong>@Override annotation for roles</strong><p>The regular <code>@Override</code> annotation (Java &ge;5) has been extended to apply to role classes, too.
+
+ </p>
+ </li>
+ <li><a href="s1.3.1.k.html" title="&sect;1.3.1.(k)&nbsp;Covariant return types"
+ class="sect">&sect;1.3.1.(k)</a> :
+ <strong>Covariant return types</strong><p>Necessary constraint for covariant return types in the presence of both implicit and explicit inheritance.
+
+ </p>
+ </li>
+ <li><a href="s2.1.2.c.html" title="&sect;2.1.2.(c)&nbsp;Base class decapsulation"
+ class="sect">&sect;2.1.2.(c)</a> :
+ <strong>Binding to final base class</strong><p>It has been added that binding to a final base class is now considered as decapsulation, too.
+
+ </p>
+ </li>
+ <li><a href="s2.2.f.html" title="&sect;2.2.(f)&nbsp;Ambiguous lowering"
+ class="sect">&sect;2.2.(f)</a> :
+ <strong>Ambiguous lowering</strong><p>A diagnostic has been added to detect situations where lowering might be intended
+ but fails because the declared type is <code>java.lang.Object</code>,
+ which makes a potential lowering translation unnecessary and thus ambiguous.
+
+ </p>
+ </li>
+ <li><a href="s2.3.2.e.html" title="&sect;2.3.2.(e)&nbsp;Generic declared lifting"
+ class="sect">&sect;2.3.2.(e)</a> :
+ <strong>Generic declared lifting</strong><p>Support passing unrelated base types into the same method with declared lifting.
+
+ </p>
+ </li>
+ <li><a href="s2.6.g.html"
+ title="&sect;2.6.(g)&nbsp;Decapsulation via base reference"
+ class="sect">&sect;2.6.(g)</a> :
+ <strong>Decapsulation via base reference</strong><p>Extended applicability of decapsulation to two more positions.
+
+ </p>
+ </li>
+ <li><a href="s4.3.f.html" title="&sect;4.3.(f)&nbsp;Base super calls" class="sect">&sect;4.3.(f)</a> :
+ <strong>Base super call</strong><p>Support base calls directly to the super version of the bound base method,
+ thus bypassing both the exact bound base method and also any further callins
+ relating to this base method or its super version.
+
+ </p>
+ </li>
+ <li><a href="s5.4.b.html" title="&sect;5.4.(b)&nbsp;No side effects" class="sect">&sect;5.4.(b)</a> :
+ <strong>Side-effects in guard predicates</strong><p>Migrate previous note about a future feature to a regular paragraph.</p>
+ </li>
+ <li><a href="s5.4.c.html" title="&sect;5.4.(c)&nbsp;Exceptions" class="sect">&sect;5.4.(c)</a> :
+ <strong>Exceptions in guard predicates</strong><p>Clarify the effect of exceptions thrown from a guard predicate.</p>
+ </li>
+ <li><a href="s6.2.d.html" title="&sect;6.2.(d)&nbsp;Exceptions" class="sect">&sect;6.2.(d)</a> :
+ <strong>LiftingVetoException</strong><p>Added documentation for the mostly internal <code>LiftingVetoException</code> and how
+ it could actually be used in client code.
+
+ </p>
+ </li>
+ <li><a href="s6.2.e.html" title="&sect;6.2.(e)&nbsp;Role migration" class="sect">&sect;6.2.(e)</a> :
+ <strong>Role migration</strong><p>Added two interfaces to add migration capabilities to a role class.
+
+ </p>
+ </li>
+ </ul>
+ </div>
+ <div class="subsect depth3" id="sB.2.3">
+ <h4 class="subsect">(3)&nbsp;<span class="title">Between OTJLD 1.2 and OTJLD 1.3</span></h4>
+ <ul>
+ <li><a href="s3.1.k.html" title="&sect;3.1.(k)&nbsp;Callout to generic method"
+ class="sect">&sect;3.1.(k)</a> :
+ <strong>Callout to generic method</strong><p>Added a rule on how a callout binding may refer to a generic base method.
+
+ </p>
+ </li>
+ <li><a href="s4.1.h.html" title="&sect;4.1.(h)&nbsp;Method of enclosing class"
+ class="sect">&sect;4.1.(h)</a> :
+ <strong>Binding to team methods</strong><p><code>before</code> and <code>after</code> callin bindings can now
+ bind to methods of an enclosing class, too.
+
+ </p>
+ </li>
+ <li><a href="s4.10.e.html" title="&sect;4.10.(e)&nbsp;Propagating type parameters"
+ class="sect">&sect;4.10.(e)</a> :
+ <strong>Propagating type parameters in callin bindings</strong><p>
+ In addition to capturing covariant return types, a callin binding
+ may also declared type parameters in order to propagate genericity
+ from its base method to the role method.
+
+ </p>
+ </li>
+ <li><a href="s5.3.d.html"
+ title="&sect;5.3.(d)&nbsp;Configuring implicit activation"
+ class="sect">&sect;5.3.(d)</a> :
+ <strong>Configuring implicit activation</strong><p>Mechanisms have been added for configuring implicit team activation.
+ The default has been changed to not apply implicit activation.
+ A corresponding note has also been added to <a href="s5.3.html" title="&sect;5.3&nbsp;Implicit team activation"
+ class="sect">&sect;5.3</a></p>
+ </li>
+ <li><a href="s9.2.1.a.html"
+ title="&sect;9.2.1.(a)&nbsp;Instance constrained type parameters"
+ class="sect">&sect;9.2.1.(a)</a> :
+ <strong>Instance constrained type parameter</strong><p>
+ Type anchors can now be applied to type parameters, too,
+ thus expressing a new kind of constraint on the type parameter.
+
+ </p>
+ </li>
+ </ul>
+ </div>
+ </div>
+ </div>
+ <table class="nav">
+ <tr>
+ <td class="back"><a href="sA.html" rel="prev">&lt;&lt;&nbsp;&sect;A&nbsp;OT/J Syntax</a></td>
+ <td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
+ <td class="next"></td>
+ </tr>
+ </table>
+ <div class="breadcrumb"></div>
+ </div>
+ <div id="footer">
+ <hr />
+ <address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
+ OT/J version 1.3 &mdash; last modified: 2010-02-20
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/xhtml11-flat.dtd b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/xhtml11-flat.dtd
new file mode 100644
index 000000000..d98b8e505
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xdef/xhtml11-flat.dtd
@@ -0,0 +1,4615 @@
+<!-- ....................................................................... -->
+<!-- XHTML 1.1 DTD ........................................................ -->
+<!-- file: xhtml11.dtd
+-->
+
+<!-- XHTML 1.1 DTD
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+
+ The Extensible HyperText Markup Language (XHTML)
+ Copyright 1998-2005 World Wide Web Consortium
+ (Massachusetts Institute of Technology, European Research Consortium
+ for Informatics and Mathematics, Keio University).
+ All Rights Reserved.
+
+ Permission to use, copy, modify and distribute the XHTML DTD and its
+ accompanying documentation for any purpose and without fee is hereby
+ granted in perpetuity, provided that the above copyright notice and
+ this paragraph appear in all copies. The copyright holders make no
+ representation about the suitability of the DTD for any purpose.
+
+ It is provided "as is" without expressed or implied warranty.
+
+ Author: Murray M. Altheim <altheim@eng.sun.com>
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $
+
+-->
+<!-- This is the driver file for version 1.1 of the XHTML DTD.
+
+ Please use this public identifier to identify it:
+
+ "-//W3C//DTD XHTML 1.1//EN"
+-->
+<!ENTITY % XHTML.version "-//W3C//DTD XHTML 1.1//EN" >
+
+<!-- Use this URI to identify the default namespace:
+
+ "http://www.w3.org/1999/xhtml"
+
+ See the Qualified Names module for information
+ on the use of namespace prefixes in the DTD.
+
+ Note that XHTML namespace elements are not prefixed by default,
+ but the XHTML namespace prefix is defined as "xhtml" so that
+ other markup languages can extend this one and use the XHTML
+ prefixed global attributes if required.
+
+-->
+<!ENTITY % NS.prefixed "IGNORE" >
+<!ENTITY % XHTML.prefix "xhtml" >
+
+<!-- Be sure to include prefixed global attributes - we don't need
+ them, but languages that extend XHTML 1.1 might.
+-->
+<!ENTITY % XHTML.global.attrs.prefixed "INCLUDE" >
+
+<!-- Reserved for use with the XLink namespace:
+-->
+<!ENTITY % XLINK.xmlns "" >
+<!ENTITY % XLINK.xmlns.attrib "" >
+
+<!-- For example, if you are using XHTML 1.1 directly, use the public
+ identifier in the DOCTYPE declaration, with the namespace declaration
+ on the document element to identify the default namespace:
+
+ <?xml version="1.0"?>
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
+ "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+ <html xmlns="http://www.w3.org/1999/xhtml"
+ xml:lang="en">
+ ...
+ </html>
+
+ Revisions:
+ (none)
+-->
+
+<!-- reserved for future use with document profiles -->
+<!ENTITY % XHTML.profile "" >
+
+<!-- ensure XHTML Notations are disabled -->
+<!ENTITY % xhtml-notations.module "IGNORE" >
+
+<!-- Bidirectional Text features
+ This feature-test entity is used to declare elements
+ and attributes used for bidirectional text support.
+-->
+<!ENTITY % XHTML.bidi "INCLUDE" >
+
+<?doc type="doctype" role="title" { XHTML 1.1 } ?>
+
+<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
+
+<!-- Pre-Framework Redeclaration placeholder .................... -->
+<!-- this serves as a location to insert markup declarations
+ into the DTD prior to the framework declarations.
+-->
+<!ENTITY % xhtml-prefw-redecl.module "IGNORE" >
+<![%xhtml-prefw-redecl.module;[
+%xhtml-prefw-redecl.mod;
+<!-- end of xhtml-prefw-redecl.module -->]]>
+
+<!ENTITY % xhtml-events.module "INCLUDE" >
+
+<!-- Inline Style Module ........................................ -->
+<!ENTITY % xhtml-inlstyle.module "INCLUDE" >
+<![%xhtml-inlstyle.module;[
+<!ENTITY % xhtml-inlstyle.mod
+ PUBLIC "-//W3C//ELEMENTS XHTML Inline Style 1.0//EN"
+ "http://www.w3.org/MarkUp/DTD/xhtml-inlstyle-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Inline Style Module ........................................... -->
+<!-- file: xhtml-inlstyle-1.mod
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+ Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ENTITIES XHTML Inline Style 1.0//EN"
+ SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-inlstyle-1.mod"
+
+ Revisions:
+ (none)
+ ....................................................................... -->
+
+<!-- Inline Style
+
+ This module declares the 'style' attribute, used to support inline
+ style markup. This module must be instantiated prior to the XHTML
+ Common Attributes module in order to be included in %Core.attrib;.
+-->
+
+<!ENTITY % style.attrib
+ "style CDATA #IMPLIED"
+>
+
+
+<!ENTITY % Core.extra.attrib
+ "%style.attrib;"
+>
+
+<!-- end of xhtml-inlstyle-1.mod -->
+]]>
+
+<!-- declare Document Model module instantiated in framework
+-->
+<!ENTITY % xhtml-model.mod
+ PUBLIC "-//W3C//ENTITIES XHTML 1.1 Document Model 1.0//EN"
+ "http://www.w3.org/MarkUp/DTD/xhtml11-model-1.mod" >
+
+<!-- Modular Framework Module (required) ......................... -->
+<!ENTITY % xhtml-framework.module "INCLUDE" >
+<![%xhtml-framework.module;[
+<!ENTITY % xhtml-framework.mod
+ PUBLIC "-//W3C//ENTITIES XHTML Modular Framework 1.0//EN"
+ "http://www.w3.org/MarkUp/DTD/xhtml-framework-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Modular Framework Module ...................................... -->
+<!-- file: xhtml-framework-1.mod
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+ Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $ SMI
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ENTITIES XHTML Modular Framework 1.0//EN"
+ SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-framework-1.mod"
+
+ Revisions:
+ (none)
+ ....................................................................... -->
+
+<!-- Modular Framework
+
+ This required module instantiates the modules needed
+ to support the XHTML modularization model, including:
+
+ + notations
+ + datatypes
+ + namespace-qualified names
+ + common attributes
+ + document model
+ + character entities
+
+ The Intrinsic Events module is ignored by default but
+ occurs in this module because it must be instantiated
+ prior to Attributes but after Datatypes.
+-->
+
+<!ENTITY % xhtml-arch.module "IGNORE" >
+<![%xhtml-arch.module;[
+<!ENTITY % xhtml-arch.mod
+ PUBLIC "-//W3C//ELEMENTS XHTML Base Architecture 1.0//EN"
+ "xhtml-arch-1.mod" >
+%xhtml-arch.mod;]]>
+
+<!ENTITY % xhtml-notations.module "INCLUDE" >
+<![%xhtml-notations.module;[
+<!ENTITY % xhtml-notations.mod
+ PUBLIC "-//W3C//NOTATIONS XHTML Notations 1.0//EN"
+ "xhtml-notations-1.mod" >
+%xhtml-notations.mod;]]>
+
+<!ENTITY % xhtml-datatypes.module "INCLUDE" >
+<![%xhtml-datatypes.module;[
+<!ENTITY % xhtml-datatypes.mod
+ PUBLIC "-//W3C//ENTITIES XHTML Datatypes 1.0//EN"
+ "xhtml-datatypes-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Datatypes Module .............................................. -->
+<!-- file: xhtml-datatypes-1.mod
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+ Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $ SMI
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ENTITIES XHTML Datatypes 1.0//EN"
+ SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-datatypes-1.mod"
+
+ Revisions:
+ (none)
+ ....................................................................... -->
+
+<!-- Datatypes
+
+ defines containers for the following datatypes, many of
+ these imported from other specifications and standards.
+-->
+
+<!-- Length defined for cellpadding/cellspacing -->
+
+<!-- nn for pixels or nn% for percentage length -->
+<!ENTITY % Length.datatype "CDATA" >
+
+<!-- space-separated list of link types -->
+<!ENTITY % LinkTypes.datatype "NMTOKENS" >
+
+<!-- single or comma-separated list of media descriptors -->
+<!ENTITY % MediaDesc.datatype "CDATA" >
+
+<!-- pixel, percentage, or relative -->
+<!ENTITY % MultiLength.datatype "CDATA" >
+
+<!-- one or more digits (NUMBER) -->
+<!ENTITY % Number.datatype "CDATA" >
+
+<!-- integer representing length in pixels -->
+<!ENTITY % Pixels.datatype "CDATA" >
+
+<!-- script expression -->
+<!ENTITY % Script.datatype "CDATA" >
+
+<!-- textual content -->
+<!ENTITY % Text.datatype "CDATA" >
+
+<!-- Imported Datatypes ................................ -->
+
+<!-- a single character from [ISO10646] -->
+<!ENTITY % Character.datatype "CDATA" >
+
+<!-- a character encoding, as per [RFC2045] -->
+<!ENTITY % Charset.datatype "CDATA" >
+
+<!-- a space separated list of character encodings, as per [RFC2045] -->
+<!ENTITY % Charsets.datatype "CDATA" >
+
+<!-- Color specification using color name or sRGB (#RRGGBB) values -->
+<!ENTITY % Color.datatype "CDATA" >
+
+<!-- media type, as per [RFC2045] -->
+<!ENTITY % ContentType.datatype "CDATA" >
+
+<!-- comma-separated list of media types, as per [RFC2045] -->
+<!ENTITY % ContentTypes.datatype "CDATA" >
+
+<!-- date and time information. ISO date format -->
+<!ENTITY % Datetime.datatype "CDATA" >
+
+<!-- formal public identifier, as per [ISO8879] -->
+<!ENTITY % FPI.datatype "CDATA" >
+
+<!-- a language code, as per [RFC3066] or its successor -->
+<!ENTITY % LanguageCode.datatype "CDATA" >
+
+<!-- a Uniform Resource Identifier, see [URI] -->
+<!ENTITY % URI.datatype "CDATA" >
+
+<!-- a space-separated list of Uniform Resource Identifiers, see [URI] -->
+<!ENTITY % URIs.datatype "CDATA" >
+
+<!-- end of xhtml-datatypes-1.mod -->
+]]>
+
+<!-- placeholder for XLink support module -->
+<!ENTITY % xhtml-xlink.mod "" >
+
+
+<!ENTITY % xhtml-qname.module "INCLUDE" >
+<![%xhtml-qname.module;[
+<!ENTITY % xhtml-qname.mod
+ PUBLIC "-//W3C//ENTITIES XHTML Qualified Names 1.0//EN"
+ "xhtml-qname-1.mod" >
+<!-- ....................................................................... -->
+<!-- XHTML Qname Module ................................................... -->
+<!-- file: xhtml-qname-1.mod
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+ Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $ SMI
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ENTITIES XHTML Qualified Names 1.0//EN"
+ SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-qname-1.mod"
+
+ Revisions:
+#2000-10-22: added qname declarations for ruby elements
+ ....................................................................... -->
+
+<!-- XHTML Qname (Qualified Name) Module
+
+ This module is contained in two parts, labeled Section 'A' and 'B':
+
+ Section A declares parameter entities to support namespace-
+ qualified names, namespace declarations, and name prefixing
+ for XHTML and extensions.
+
+ Section B declares parameter entities used to provide
+ namespace-qualified names for all XHTML element types:
+
+ %applet.qname; the xmlns-qualified name for <applet>
+ %base.qname; the xmlns-qualified name for <base>
+ ...
+
+ XHTML extensions would create a module similar to this one.
+ Included in the XHTML distribution is a template module
+ ('template-qname-1.mod') suitable for this purpose.
+-->
+
+<!-- Section A: XHTML XML Namespace Framework :::::::::::::::::::: -->
+
+<!-- 1. Declare a %XHTML.prefixed; conditional section keyword, used
+ to activate namespace prefixing. The default value should
+ inherit '%NS.prefixed;' from the DTD driver, so that unless
+ overridden, the default behaviour follows the overall DTD
+ prefixing scheme.
+-->
+<!ENTITY % NS.prefixed "IGNORE" >
+<!ENTITY % XHTML.prefixed "%NS.prefixed;" >
+
+<!-- By default, we always permit XHTML attribute collections to have
+ namespace-qualified prefixes as well.
+-->
+<!ENTITY % XHTML.global.attrs.prefixed "INCLUDE" >
+<!-- By default, we allow the XML Schema attributes on the root
+ element.
+-->
+<!ENTITY % XHTML.xsi.attrs "INCLUDE" >
+
+<!-- 2. Declare a parameter entity (eg., %XHTML.xmlns;) containing
+ the URI reference used to identify the XHTML namespace:
+-->
+<!ENTITY % XHTML.xmlns "http://www.w3.org/1999/xhtml" >
+
+<!-- 3. Declare parameter entities (eg., %XHTML.prefix;) containing
+ the default namespace prefix string(s) to use when prefixing
+ is enabled. This may be overridden in the DTD driver or the
+ internal subset of an document instance. If no default prefix
+ is desired, this may be declared as an empty string.
+
+ NOTE: As specified in [XMLNAMES], the namespace prefix serves
+ as a proxy for the URI reference, and is not in itself significant.
+-->
+<!ENTITY % XHTML.prefix "xhtml" >
+
+<!-- 4. Declare parameter entities (eg., %XHTML.pfx;) containing the
+ colonized prefix(es) (eg., '%XHTML.prefix;:') used when
+ prefixing is active, an empty string when it is not.
+-->
+<![%XHTML.prefixed;[
+<!ENTITY % XHTML.pfx "%XHTML.prefix;:" >
+]]>
+<!ENTITY % XHTML.pfx "" >
+
+<!-- declare qualified name extensions here ............ -->
+<!ENTITY % xhtml-qname-extra.mod "" >
+
+
+<!-- 5. The parameter entity %XHTML.xmlns.extra.attrib; may be
+ redeclared to contain any non-XHTML namespace declaration
+ attributes for namespaces embedded in XHTML. The default
+ is an empty string. XLink should be included here if used
+ in the DTD.
+-->
+<!ENTITY % XHTML.xmlns.extra.attrib "" >
+
+<!-- The remainder of Section A is only followed in XHTML, not extensions. -->
+
+<!-- Declare a parameter entity %NS.decl.attrib; containing
+ all XML Namespace declarations used in the DTD, plus the
+ xmlns declaration for XHTML, its form dependent on whether
+ prefixing is active.
+-->
+<!ENTITY % XHTML.xmlns.attrib.prefixed
+ "xmlns:%XHTML.prefix; %URI.datatype; #FIXED '%XHTML.xmlns;'"
+>
+<![%XHTML.prefixed;[
+<!ENTITY % NS.decl.attrib
+ "%XHTML.xmlns.attrib.prefixed;
+ %XHTML.xmlns.extra.attrib;"
+>
+]]>
+<!ENTITY % NS.decl.attrib
+ "%XHTML.xmlns.extra.attrib;"
+>
+
+<!-- Declare a parameter entity %XSI.prefix as a prefix to use for XML
+ Schema Instance attributes.
+-->
+<!ENTITY % XSI.prefix "xsi" >
+
+<!ENTITY % XSI.xmlns "http://www.w3.org/2001/XMLSchema-instance" >
+
+<!-- Declare a parameter entity %XSI.xmlns.attrib as support for the
+ schemaLocation attribute, since this is legal throughout the DTD.
+-->
+<!ENTITY % XSI.xmlns.attrib
+ "xmlns:%XSI.prefix; %URI.datatype; #FIXED '%XSI.xmlns;'" >
+
+<!-- This is a placeholder for future XLink support.
+-->
+<!ENTITY % XLINK.xmlns.attrib "" >
+
+<!-- This is the attribute for the XML Schema namespace - XHTML
+ Modularization is also expressed in XML Schema, and it needs to
+ be legal to declare the XML Schema namespace and the
+ schemaLocation attribute on the root element of XHTML family
+ documents.
+-->
+<![%XHTML.xsi.attrs;[
+<!ENTITY % XSI.prefix "xsi" >
+<!ENTITY % XSI.pfx "%XSI.prefix;:" >
+<!ENTITY % XSI.xmlns "http://www.w3.org/2001/XMLSchema-instance" >
+
+<!ENTITY % XSI.xmlns.attrib
+ "xmlns:%XSI.prefix; %URI.datatype; #FIXED '%XSI.xmlns;'"
+>
+]]>
+<!ENTITY % XSI.prefix "" >
+<!ENTITY % XSI.pfx "" >
+<!ENTITY % XSI.xmlns.attrib "" >
+
+
+<!-- Declare a parameter entity %NS.decl.attrib; containing all
+ XML namespace declaration attributes used by XHTML, including
+ a default xmlns attribute when prefixing is inactive.
+-->
+<![%XHTML.prefixed;[
+<!ENTITY % XHTML.xmlns.attrib
+ "%NS.decl.attrib;
+ %XSI.xmlns.attrib;
+ %XLINK.xmlns.attrib;"
+>
+]]>
+<!ENTITY % XHTML.xmlns.attrib
+ "xmlns %URI.datatype; #FIXED '%XHTML.xmlns;'
+ %NS.decl.attrib;
+ %XSI.xmlns.attrib;
+ %XLINK.xmlns.attrib;"
+>
+
+<!-- placeholder for qualified name redeclarations -->
+<!ENTITY % xhtml-qname.redecl "" >
+
+
+<!-- Section B: XHTML Qualified Names ::::::::::::::::::::::::::::: -->
+
+<!-- 6. This section declares parameter entities used to provide
+ namespace-qualified names for all XHTML element types.
+-->
+
+<!-- module: xhtml-applet-1.mod -->
+<!ENTITY % applet.qname "%XHTML.pfx;applet" >
+
+<!-- module: xhtml-base-1.mod -->
+<!ENTITY % base.qname "%XHTML.pfx;base" >
+
+<!-- module: xhtml-bdo-1.mod -->
+<!ENTITY % bdo.qname "%XHTML.pfx;bdo" >
+
+<!-- module: xhtml-blkphras-1.mod -->
+<!ENTITY % address.qname "%XHTML.pfx;address" >
+<!ENTITY % blockquote.qname "%XHTML.pfx;blockquote" >
+<!ENTITY % pre.qname "%XHTML.pfx;pre" >
+<!ENTITY % h1.qname "%XHTML.pfx;h1" >
+<!ENTITY % h2.qname "%XHTML.pfx;h2" >
+<!ENTITY % h3.qname "%XHTML.pfx;h3" >
+<!ENTITY % h4.qname "%XHTML.pfx;h4" >
+<!ENTITY % h5.qname "%XHTML.pfx;h5" >
+<!ENTITY % h6.qname "%XHTML.pfx;h6" >
+
+<!-- module: xhtml-blkpres-1.mod -->
+<!ENTITY % hr.qname "%XHTML.pfx;hr" >
+
+<!-- module: xhtml-blkstruct-1.mod -->
+<!ENTITY % div.qname "%XHTML.pfx;div" >
+<!ENTITY % p.qname "%XHTML.pfx;p" >
+
+<!-- module: xhtml-edit-1.mod -->
+<!ENTITY % ins.qname "%XHTML.pfx;ins" >
+<!ENTITY % del.qname "%XHTML.pfx;del" >
+
+<!-- module: xhtml-form-1.mod -->
+<!ENTITY % form.qname "%XHTML.pfx;form" >
+<!ENTITY % label.qname "%XHTML.pfx;label" >
+<!ENTITY % input.qname "%XHTML.pfx;input" >
+<!ENTITY % select.qname "%XHTML.pfx;select" >
+<!ENTITY % optgroup.qname "%XHTML.pfx;optgroup" >
+<!ENTITY % option.qname "%XHTML.pfx;option" >
+<!ENTITY % textarea.qname "%XHTML.pfx;textarea" >
+<!ENTITY % fieldset.qname "%XHTML.pfx;fieldset" >
+<!ENTITY % legend.qname "%XHTML.pfx;legend" >
+<!ENTITY % button.qname "%XHTML.pfx;button" >
+
+<!-- module: xhtml-hypertext-1.mod -->
+<!ENTITY % a.qname "%XHTML.pfx;a" >
+
+<!-- module: xhtml-image-1.mod -->
+<!ENTITY % img.qname "%XHTML.pfx;img" >
+
+<!-- module: xhtml-inlphras-1.mod -->
+<!ENTITY % abbr.qname "%XHTML.pfx;abbr" >
+<!ENTITY % acronym.qname "%XHTML.pfx;acronym" >
+<!ENTITY % cite.qname "%XHTML.pfx;cite" >
+<!ENTITY % code.qname "%XHTML.pfx;code" >
+<!ENTITY % dfn.qname "%XHTML.pfx;dfn" >
+<!ENTITY % em.qname "%XHTML.pfx;em" >
+<!ENTITY % kbd.qname "%XHTML.pfx;kbd" >
+<!ENTITY % q.qname "%XHTML.pfx;q" >
+<!ENTITY % samp.qname "%XHTML.pfx;samp" >
+<!ENTITY % strong.qname "%XHTML.pfx;strong" >
+<!ENTITY % var.qname "%XHTML.pfx;var" >
+
+<!-- module: xhtml-inlpres-1.mod -->
+<!ENTITY % b.qname "%XHTML.pfx;b" >
+<!ENTITY % big.qname "%XHTML.pfx;big" >
+<!ENTITY % i.qname "%XHTML.pfx;i" >
+<!ENTITY % small.qname "%XHTML.pfx;small" >
+<!ENTITY % sub.qname "%XHTML.pfx;sub" >
+<!ENTITY % sup.qname "%XHTML.pfx;sup" >
+<!ENTITY % tt.qname "%XHTML.pfx;tt" >
+
+<!-- module: xhtml-inlstruct-1.mod -->
+<!ENTITY % br.qname "%XHTML.pfx;br" >
+<!ENTITY % span.qname "%XHTML.pfx;span" >
+
+<!-- module: xhtml-ismap-1.mod (also csismap, ssismap) -->
+<!ENTITY % map.qname "%XHTML.pfx;map" >
+<!ENTITY % area.qname "%XHTML.pfx;area" >
+
+<!-- module: xhtml-link-1.mod -->
+<!ENTITY % link.qname "%XHTML.pfx;link" >
+
+<!-- module: xhtml-list-1.mod -->
+<!ENTITY % dl.qname "%XHTML.pfx;dl" >
+<!ENTITY % dt.qname "%XHTML.pfx;dt" >
+<!ENTITY % dd.qname "%XHTML.pfx;dd" >
+<!ENTITY % ol.qname "%XHTML.pfx;ol" >
+<!ENTITY % ul.qname "%XHTML.pfx;ul" >
+<!ENTITY % li.qname "%XHTML.pfx;li" >
+
+<!-- module: xhtml-meta-1.mod -->
+<!ENTITY % meta.qname "%XHTML.pfx;meta" >
+
+<!-- module: xhtml-param-1.mod -->
+<!ENTITY % param.qname "%XHTML.pfx;param" >
+
+<!-- module: xhtml-object-1.mod -->
+<!ENTITY % object.qname "%XHTML.pfx;object" >
+
+<!-- module: xhtml-script-1.mod -->
+<!ENTITY % script.qname "%XHTML.pfx;script" >
+<!ENTITY % noscript.qname "%XHTML.pfx;noscript" >
+
+<!-- module: xhtml-struct-1.mod -->
+<!ENTITY % html.qname "%XHTML.pfx;html" >
+<!ENTITY % head.qname "%XHTML.pfx;head" >
+<!ENTITY % title.qname "%XHTML.pfx;title" >
+<!ENTITY % body.qname "%XHTML.pfx;body" >
+
+<!-- module: xhtml-style-1.mod -->
+<!ENTITY % style.qname "%XHTML.pfx;style" >
+
+<!-- module: xhtml-table-1.mod -->
+<!ENTITY % table.qname "%XHTML.pfx;table" >
+<!ENTITY % caption.qname "%XHTML.pfx;caption" >
+<!ENTITY % thead.qname "%XHTML.pfx;thead" >
+<!ENTITY % tfoot.qname "%XHTML.pfx;tfoot" >
+<!ENTITY % tbody.qname "%XHTML.pfx;tbody" >
+<!ENTITY % colgroup.qname "%XHTML.pfx;colgroup" >
+<!ENTITY % col.qname "%XHTML.pfx;col" >
+<!ENTITY % tr.qname "%XHTML.pfx;tr" >
+<!ENTITY % th.qname "%XHTML.pfx;th" >
+<!ENTITY % td.qname "%XHTML.pfx;td" >
+
+<!-- module: xhtml-ruby-1.mod -->
+
+<!ENTITY % ruby.qname "%XHTML.pfx;ruby" >
+<!ENTITY % rbc.qname "%XHTML.pfx;rbc" >
+<!ENTITY % rtc.qname "%XHTML.pfx;rtc" >
+<!ENTITY % rb.qname "%XHTML.pfx;rb" >
+<!ENTITY % rt.qname "%XHTML.pfx;rt" >
+<!ENTITY % rp.qname "%XHTML.pfx;rp" >
+
+<!-- Provisional XHTML 2.0 Qualified Names ...................... -->
+
+<!-- module: xhtml-image-2.mod -->
+<!ENTITY % alt.qname "%XHTML.pfx;alt" >
+
+<!-- end of xhtml-qname-1.mod -->
+]]>
+
+<!ENTITY % xhtml-events.module "IGNORE" >
+<![%xhtml-events.module;[
+<!ENTITY % xhtml-events.mod
+ PUBLIC "-//W3C//ENTITIES XHTML Intrinsic Events 1.0//EN"
+ "xhtml-events-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Intrinsic Events Module ....................................... -->
+<!-- file: xhtml-events-1.mod
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+ Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $ SMI
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ENTITIES XHTML Intrinsic Events 1.0//EN"
+ SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-events-1.mod"
+
+ Revisions:
+ (none)
+ ....................................................................... -->
+
+<!-- Intrinsic Event Attributes
+
+ These are the event attributes defined in HTML 4,
+ Section 18.2.3 "Intrinsic Events". This module must be
+ instantiated prior to the Attributes Module but after
+ the Datatype Module in the Modular Framework module.
+
+ "Note: Authors of HTML documents are advised that changes
+ are likely to occur in the realm of intrinsic events
+ (e.g., how scripts are bound to events). Research in
+ this realm is carried on by members of the W3C Document
+ Object Model Working Group (see the W3C Web site at
+ http://www.w3.org/ for more information)."
+-->
+<!-- NOTE: Because the ATTLIST declarations in this module occur
+ before their respective ELEMENT declarations in other
+ modules, there may be a dependency on this module that
+ should be considered if any of the parameter entities used
+ for element type names (eg., %a.qname;) are redeclared.
+-->
+
+<!ENTITY % Events.attrib
+ "onclick %Script.datatype; #IMPLIED
+ ondblclick %Script.datatype; #IMPLIED
+ onmousedown %Script.datatype; #IMPLIED
+ onmouseup %Script.datatype; #IMPLIED
+ onmouseover %Script.datatype; #IMPLIED
+ onmousemove %Script.datatype; #IMPLIED
+ onmouseout %Script.datatype; #IMPLIED
+ onkeypress %Script.datatype; #IMPLIED
+ onkeydown %Script.datatype; #IMPLIED
+ onkeyup %Script.datatype; #IMPLIED"
+>
+
+<![%XHTML.global.attrs.prefixed;[
+<!ENTITY % XHTML.global.events.attrib
+ "%XHTML.prefix;:onclick %Script.datatype; #IMPLIED
+ %XHTML.prefix;:ondblclick %Script.datatype; #IMPLIED
+ %XHTML.prefix;:onmousedown %Script.datatype; #IMPLIED
+ %XHTML.prefix;:onmouseup %Script.datatype; #IMPLIED
+ %XHTML.prefix;:onmouseover %Script.datatype; #IMPLIED
+ %XHTML.prefix;:onmousemove %Script.datatype; #IMPLIED
+ %XHTML.prefix;:onmouseout %Script.datatype; #IMPLIED
+ %XHTML.prefix;:onkeypress %Script.datatype; #IMPLIED
+ %XHTML.prefix;:onkeydown %Script.datatype; #IMPLIED
+ %XHTML.prefix;:onkeyup %Script.datatype; #IMPLIED"
+>
+]]>
+
+<!-- additional attributes on anchor element
+-->
+<!ATTLIST %a.qname;
+ onfocus %Script.datatype; #IMPLIED
+ onblur %Script.datatype; #IMPLIED
+>
+
+<!-- additional attributes on form element
+-->
+<!ATTLIST %form.qname;
+ onsubmit %Script.datatype; #IMPLIED
+ onreset %Script.datatype; #IMPLIED
+>
+
+<!-- additional attributes on label element
+-->
+<!ATTLIST %label.qname;
+ onfocus %Script.datatype; #IMPLIED
+ onblur %Script.datatype; #IMPLIED
+>
+
+<!-- additional attributes on input element
+-->
+<!ATTLIST %input.qname;
+ onfocus %Script.datatype; #IMPLIED
+ onblur %Script.datatype; #IMPLIED
+ onselect %Script.datatype; #IMPLIED
+ onchange %Script.datatype; #IMPLIED
+>
+
+<!-- additional attributes on select element
+-->
+<!ATTLIST %select.qname;
+ onfocus %Script.datatype; #IMPLIED
+ onblur %Script.datatype; #IMPLIED
+ onchange %Script.datatype; #IMPLIED
+>
+
+<!-- additional attributes on textarea element
+-->
+<!ATTLIST %textarea.qname;
+ onfocus %Script.datatype; #IMPLIED
+ onblur %Script.datatype; #IMPLIED
+ onselect %Script.datatype; #IMPLIED
+ onchange %Script.datatype; #IMPLIED
+>
+
+<!-- additional attributes on button element
+-->
+<!ATTLIST %button.qname;
+ onfocus %Script.datatype; #IMPLIED
+ onblur %Script.datatype; #IMPLIED
+>
+
+<!-- additional attributes on body element
+-->
+<!ATTLIST %body.qname;
+ onload %Script.datatype; #IMPLIED
+ onunload %Script.datatype; #IMPLIED
+>
+
+<!-- additional attributes on area element
+-->
+<!ATTLIST %area.qname;
+ onfocus %Script.datatype; #IMPLIED
+ onblur %Script.datatype; #IMPLIED
+>
+
+<!-- end of xhtml-events-1.mod -->
+]]>
+
+<!ENTITY % xhtml-attribs.module "INCLUDE" >
+<![%xhtml-attribs.module;[
+<!ENTITY % xhtml-attribs.mod
+ PUBLIC "-//W3C//ENTITIES XHTML Common Attributes 1.0//EN"
+ "xhtml-attribs-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Common Attributes Module ...................................... -->
+<!-- file: xhtml-attribs-1.mod
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+ Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $ SMI
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ENTITIES XHTML Common Attributes 1.0//EN"
+ SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-attribs-1.mod"
+
+ Revisions:
+ (none)
+ ....................................................................... -->
+
+<!-- Common Attributes
+
+ This module declares many of the common attributes for the XHTML DTD.
+ %NS.decl.attrib; is declared in the XHTML Qname module.
+
+ Note that this file was extended in XHTML Modularization Second Edition to
+ include declarations of "global" versions of the attribute collections.
+ The global versions of the attributes are for use on elements in other
+ namespaces. The global version of "common" includes the xmlns declaration
+ for the prefixed version of the xhtml namespace. If you are only using a
+ specific attribute or an individual attribute collection, you must also
+ include the XHTML.xmlns.attrib.prefixed PE on your elements.
+-->
+
+<!ENTITY % id.attrib
+ "id ID #IMPLIED"
+>
+
+<![%XHTML.global.attrs.prefixed;[
+<!ENTITY % XHTML.global.id.attrib
+ "%XHTML.prefix;:id ID #IMPLIED"
+>
+]]>
+
+<!ENTITY % class.attrib
+ "class NMTOKENS #IMPLIED"
+>
+
+<![%XHTML.global.attrs.prefixed;[
+<!ENTITY % XHTML.global.class.attrib
+ "%XHTML.prefix;:class NMTOKENS #IMPLIED"
+>
+]]>
+
+<!ENTITY % title.attrib
+ "title %Text.datatype; #IMPLIED"
+>
+
+<![%XHTML.global.attrs.prefixed;[
+<!ENTITY % XHTML.global.title.attrib
+ "%XHTML.prefix;:title %Text.datatype; #IMPLIED"
+>
+]]>
+
+<!ENTITY % Core.extra.attrib "" >
+
+<!ENTITY % Core.attrib
+ "%XHTML.xmlns.attrib;
+ %id.attrib;
+ %class.attrib;
+ %title.attrib;
+ xml:space ( preserve ) #FIXED 'preserve'
+ %Core.extra.attrib;"
+>
+
+<!ENTITY % XHTML.global.core.extra.attrib "" >
+
+<![%XHTML.global.attrs.prefixed;[
+
+<!ENTITY % XHTML.global.core.attrib
+ "%XHTML.global.id.attrib;
+ %XHTML.global.class.attrib;
+ %XHTML.global.title.attrib;
+ %XHTML.global.core.extra.attrib;"
+>
+]]>
+
+<!ENTITY % XHTML.global.core.attrib "" >
+
+
+<!ENTITY % lang.attrib
+ "xml:lang %LanguageCode.datatype; #IMPLIED"
+>
+
+<![%XHTML.bidi;[
+<!ENTITY % dir.attrib
+ "dir ( ltr | rtl ) #IMPLIED"
+>
+
+<!ENTITY % I18n.attrib
+ "%dir.attrib;
+ %lang.attrib;"
+>
+
+<![%XHTML.global.attrs.prefixed;[
+<!ENTITY XHTML.global.i18n.attrib
+ "%XHTML.prefix;:dir ( ltr | rtl ) #IMPLIED
+ %lang.attrib;"
+>
+]]>
+<!ENTITY XHTML.global.i18n.attrib "" >
+
+]]>
+<!ENTITY % I18n.attrib
+ "%lang.attrib;"
+>
+<!ENTITY % XHTML.global.i18n.attrib
+ "%lang.attrib;"
+>
+
+<!ENTITY % Common.extra.attrib "" >
+<!ENTITY % XHTML.global.common.extra.attrib "" >
+
+<!-- intrinsic event attributes declared previously
+-->
+<!ENTITY % Events.attrib "" >
+
+<!ENTITY % XHTML.global.events.attrib "" >
+
+<!ENTITY % Common.attrib
+ "%Core.attrib;
+ %I18n.attrib;
+ %Events.attrib;
+ %Common.extra.attrib;"
+>
+
+<!ENTITY % XHTML.global.common.attrib
+ "%XHTML.xmlns.attrib.prefixed;
+ %XHTML.global.core.attrib;
+ %XHTML.global.i18n.attrib;
+ %XHTML.global.events.attrib;
+ %XHTML.global.common.extra.attrib;"
+>
+
+<!-- end of xhtml-attribs-1.mod -->
+]]>
+
+<!-- placeholder for content model redeclarations -->
+<!ENTITY % xhtml-model.redecl "" >
+
+
+<!ENTITY % xhtml-model.module "INCLUDE" >
+<![%xhtml-model.module;[
+<!-- instantiate the Document Model module declared in the DTD driver
+-->
+<!-- ....................................................................... -->
+<!-- XHTML 1.1 Document Model Module ...................................... -->
+<!-- file: xhtml11-model-1.mod
+
+ This is XHTML 1.1, a reformulation of HTML as a modular XML application.
+ Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $ SMI
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ENTITIES XHTML 1.1 Document Model 1.0//EN"
+ SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml11-model-1.mod"
+
+ Revisions:
+ (none)
+ ....................................................................... -->
+
+<!-- XHTML 1.1 Document Model
+
+ This module describes the groupings of elements that make up
+ common content models for XHTML elements.
+
+ XHTML has three basic content models:
+
+ %Inline.mix; character-level elements
+ %Block.mix; block-like elements, eg., paragraphs and lists
+ %Flow.mix; any block or inline elements
+
+ Any parameter entities declared in this module may be used
+ to create element content models, but the above three are
+ considered 'global' (insofar as that term applies here).
+
+ The reserved word '#PCDATA' (indicating a text string) is now
+ included explicitly with each element declaration that is
+ declared as mixed content, as XML requires that this token
+ occur first in a content model specification.
+-->
+<!-- Extending the Model
+
+ While in some cases this module may need to be rewritten to
+ accommodate changes to the document model, minor extensions
+ may be accomplished by redeclaring any of the three *.extra;
+ parameter entities to contain extension element types as follows:
+
+ %Misc.extra; whose parent may be any block or
+ inline element.
+
+ %Inline.extra; whose parent may be any inline element.
+
+ %Block.extra; whose parent may be any block element.
+
+ If used, these parameter entities must be an OR-separated
+ list beginning with an OR separator ("|"), eg., "| a | b | c"
+
+ All block and inline *.class parameter entities not part
+ of the *struct.class classes begin with "| " to allow for
+ exclusion from mixes.
+-->
+
+<!-- .............. Optional Elements in head .................. -->
+
+<!ENTITY % HeadOpts.mix
+ "( %script.qname; | %style.qname; | %meta.qname;
+ | %link.qname; | %object.qname; )*"
+>
+
+<!-- ................. Miscellaneous Elements .................. -->
+
+<!-- ins and del are used to denote editing changes
+-->
+<!ENTITY % Edit.class "| %ins.qname; | %del.qname;" >
+
+<!-- script and noscript are used to contain scripts
+ and alternative content
+-->
+<!ENTITY % Script.class "| %script.qname; | %noscript.qname;" >
+
+<!ENTITY % Misc.extra "" >
+
+<!-- These elements are neither block nor inline, and can
+ essentially be used anywhere in the document body.
+-->
+<!ENTITY % Misc.class
+ "%Edit.class;
+ %Script.class;
+ %Misc.extra;"
+>
+
+<!-- .................... Inline Elements ...................... -->
+
+<!ENTITY % InlStruct.class "%br.qname; | %span.qname;" >
+
+<!ENTITY % InlPhras.class
+ "| %em.qname; | %strong.qname; | %dfn.qname; | %code.qname;
+ | %samp.qname; | %kbd.qname; | %var.qname; | %cite.qname;
+ | %abbr.qname; | %acronym.qname; | %q.qname;" >
+
+<!ENTITY % InlPres.class
+ "| %tt.qname; | %i.qname; | %b.qname; | %big.qname;
+ | %small.qname; | %sub.qname; | %sup.qname;" >
+
+<!ENTITY % I18n.class "| %bdo.qname;" >
+
+<!ENTITY % Anchor.class "| %a.qname;" >
+
+<!ENTITY % InlSpecial.class
+ "| %img.qname; | %map.qname;
+ | %object.qname;" >
+
+<!ENTITY % InlForm.class
+ "| %input.qname; | %select.qname; | %textarea.qname;
+ | %label.qname; | %button.qname;" >
+
+<!ENTITY % Inline.extra "" >
+
+<!ENTITY % Ruby.class "| %ruby.qname;" >
+
+<!-- %Inline.class; includes all inline elements,
+ used as a component in mixes
+-->
+<!ENTITY % Inline.class
+ "%InlStruct.class;
+ %InlPhras.class;
+ %InlPres.class;
+ %I18n.class;
+ %Anchor.class;
+ %InlSpecial.class;
+ %InlForm.class;
+ %Ruby.class;
+ %Inline.extra;"
+>
+
+<!-- %InlNoRuby.class; includes all inline elements
+ except ruby, used as a component in mixes
+-->
+<!ENTITY % InlNoRuby.class
+ "%InlStruct.class;
+ %InlPhras.class;
+ %InlPres.class;
+ %I18n.class;
+ %Anchor.class;
+ %InlSpecial.class;
+ %InlForm.class;
+ %Inline.extra;"
+>
+
+<!-- %NoRuby.content; includes all inlines except ruby
+-->
+<!ENTITY % NoRuby.content
+ "( #PCDATA
+ | %InlNoRuby.class;
+ %Misc.class; )*"
+>
+
+<!-- %InlNoAnchor.class; includes all non-anchor inlines,
+ used as a component in mixes
+-->
+<!ENTITY % InlNoAnchor.class
+ "%InlStruct.class;
+ %InlPhras.class;
+ %InlPres.class;
+ %I18n.class;
+ %InlSpecial.class;
+ %InlForm.class;
+ %Ruby.class;
+ %Inline.extra;"
+>
+
+<!-- %InlNoAnchor.mix; includes all non-anchor inlines
+-->
+<!ENTITY % InlNoAnchor.mix
+ "%InlNoAnchor.class;
+ %Misc.class;"
+>
+
+<!-- %Inline.mix; includes all inline elements, including %Misc.class;
+-->
+<!ENTITY % Inline.mix
+ "%Inline.class;
+ %Misc.class;"
+>
+
+<!-- ..................... Block Elements ...................... -->
+
+<!-- In the HTML 4.0 DTD, heading and list elements were included
+ in the %block; parameter entity. The %Heading.class; and
+ %List.class; parameter entities must now be included explicitly
+ on element declarations where desired.
+-->
+
+<!ENTITY % Heading.class
+ "%h1.qname; | %h2.qname; | %h3.qname;
+ | %h4.qname; | %h5.qname; | %h6.qname;" >
+
+<!ENTITY % List.class "%ul.qname; | %ol.qname; | %dl.qname;" >
+
+<!ENTITY % Table.class "| %table.qname;" >
+
+<!ENTITY % Form.class "| %form.qname;" >
+
+<!ENTITY % Fieldset.class "| %fieldset.qname;" >
+
+<!ENTITY % BlkStruct.class "%p.qname; | %div.qname;" >
+
+<!ENTITY % BlkPhras.class
+ "| %pre.qname; | %blockquote.qname; | %address.qname;" >
+
+<!ENTITY % BlkPres.class "| %hr.qname;" >
+
+<!ENTITY % BlkSpecial.class
+ "%Table.class;
+ %Form.class;
+ %Fieldset.class;"
+>
+
+<!ENTITY % Block.extra "" >
+
+<!-- %Block.class; includes all block elements,
+ used as an component in mixes
+-->
+<!ENTITY % Block.class
+ "%BlkStruct.class;
+ %BlkPhras.class;
+ %BlkPres.class;
+ %BlkSpecial.class;
+ %Block.extra;"
+>
+
+<!-- %Block.mix; includes all block elements plus %Misc.class;
+-->
+<!ENTITY % Block.mix
+ "%Heading.class;
+ | %List.class;
+ | %Block.class;
+ %Misc.class;"
+>
+
+<!-- ................ All Content Elements .................. -->
+
+<!-- %Flow.mix; includes all text content, block and inline
+-->
+<!ENTITY % Flow.mix
+ "%Heading.class;
+ | %List.class;
+ | %Block.class;
+ | %Inline.class;
+ %Misc.class;"
+>
+
+<!-- end of xhtml11-model-1.mod -->
+]]>
+
+<!ENTITY % xhtml-charent.module "INCLUDE" >
+<![%xhtml-charent.module;[
+<!ENTITY % xhtml-charent.mod
+ PUBLIC "-//W3C//ENTITIES XHTML Character Entities 1.0//EN"
+ "xhtml-charent-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Character Entities Module ......................................... -->
+<!-- file: xhtml-charent-1.mod
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+ Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $ SMI
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ENTITIES XHTML Character Entities 1.0//EN"
+ SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-charent-1.mod"
+
+ Revisions:
+ (none)
+ ....................................................................... -->
+
+<!-- Character Entities for XHTML
+
+ This module declares the set of character entities for XHTML,
+ including the Latin 1, Symbol and Special character collections.
+-->
+
+<!ENTITY % xhtml-lat1
+ PUBLIC "-//W3C//ENTITIES Latin 1 for XHTML//EN"
+ "xhtml-lat1.ent" >
+<!-- Portions (C) International Organization for Standardization 1986
+ Permission to copy in any form is granted for use with
+ conforming SGML systems and applications as defined in
+ ISO 8879, provided this notice is included in all copies.
+-->
+<!-- Character entity set. Typical invocation:
+ <!ENTITY % HTMLlat1 PUBLIC
+ "-//W3C//ENTITIES Latin 1 for XHTML//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent">
+ %HTMLlat1;
+-->
+
+<!ENTITY nbsp "&#160;"> <!-- no-break space = non-breaking space,
+ U+00A0 ISOnum -->
+<!ENTITY iexcl "&#161;"> <!-- inverted exclamation mark, U+00A1 ISOnum -->
+<!ENTITY cent "&#162;"> <!-- cent sign, U+00A2 ISOnum -->
+<!ENTITY pound "&#163;"> <!-- pound sign, U+00A3 ISOnum -->
+<!ENTITY curren "&#164;"> <!-- currency sign, U+00A4 ISOnum -->
+<!ENTITY yen "&#165;"> <!-- yen sign = yuan sign, U+00A5 ISOnum -->
+<!ENTITY brvbar "&#166;"> <!-- broken bar = broken vertical bar,
+ U+00A6 ISOnum -->
+<!ENTITY sect "&#167;"> <!-- section sign, U+00A7 ISOnum -->
+<!ENTITY uml "&#168;"> <!-- diaeresis = spacing diaeresis,
+ U+00A8 ISOdia -->
+<!ENTITY copy "&#169;"> <!-- copyright sign, U+00A9 ISOnum -->
+<!ENTITY ordf "&#170;"> <!-- feminine ordinal indicator, U+00AA ISOnum -->
+<!ENTITY laquo "&#171;"> <!-- left-pointing double angle quotation mark
+ = left pointing guillemet, U+00AB ISOnum -->
+<!ENTITY not "&#172;"> <!-- not sign = angled dash,
+ U+00AC ISOnum -->
+<!ENTITY shy "&#173;"> <!-- soft hyphen = discretionary hyphen,
+ U+00AD ISOnum -->
+<!ENTITY reg "&#174;"> <!-- registered sign = registered trade mark sign,
+ U+00AE ISOnum -->
+<!ENTITY macr "&#175;"> <!-- macron = spacing macron = overline
+ = APL overbar, U+00AF ISOdia -->
+<!ENTITY deg "&#176;"> <!-- degree sign, U+00B0 ISOnum -->
+<!ENTITY plusmn "&#177;"> <!-- plus-minus sign = plus-or-minus sign,
+ U+00B1 ISOnum -->
+<!ENTITY sup2 "&#178;"> <!-- superscript two = superscript digit two
+ = squared, U+00B2 ISOnum -->
+<!ENTITY sup3 "&#179;"> <!-- superscript three = superscript digit three
+ = cubed, U+00B3 ISOnum -->
+<!ENTITY acute "&#180;"> <!-- acute accent = spacing acute,
+ U+00B4 ISOdia -->
+<!ENTITY micro "&#181;"> <!-- micro sign, U+00B5 ISOnum -->
+<!ENTITY para "&#182;"> <!-- pilcrow sign = paragraph sign,
+ U+00B6 ISOnum -->
+<!ENTITY middot "&#183;"> <!-- middle dot = Georgian comma
+ = Greek middle dot, U+00B7 ISOnum -->
+<!ENTITY cedil "&#184;"> <!-- cedilla = spacing cedilla, U+00B8 ISOdia -->
+<!ENTITY sup1 "&#185;"> <!-- superscript one = superscript digit one,
+ U+00B9 ISOnum -->
+<!ENTITY ordm "&#186;"> <!-- masculine ordinal indicator,
+ U+00BA ISOnum -->
+<!ENTITY raquo "&#187;"> <!-- right-pointing double angle quotation mark
+ = right pointing guillemet, U+00BB ISOnum -->
+<!ENTITY frac14 "&#188;"> <!-- vulgar fraction one quarter
+ = fraction one quarter, U+00BC ISOnum -->
+<!ENTITY frac12 "&#189;"> <!-- vulgar fraction one half
+ = fraction one half, U+00BD ISOnum -->
+<!ENTITY frac34 "&#190;"> <!-- vulgar fraction three quarters
+ = fraction three quarters, U+00BE ISOnum -->
+<!ENTITY iquest "&#191;"> <!-- inverted question mark
+ = turned question mark, U+00BF ISOnum -->
+<!ENTITY Agrave "&#192;"> <!-- latin capital letter A with grave
+ = latin capital letter A grave,
+ U+00C0 ISOlat1 -->
+<!ENTITY Aacute "&#193;"> <!-- latin capital letter A with acute,
+ U+00C1 ISOlat1 -->
+<!ENTITY Acirc "&#194;"> <!-- latin capital letter A with circumflex,
+ U+00C2 ISOlat1 -->
+<!ENTITY Atilde "&#195;"> <!-- latin capital letter A with tilde,
+ U+00C3 ISOlat1 -->
+<!ENTITY Auml "&#196;"> <!-- latin capital letter A with diaeresis,
+ U+00C4 ISOlat1 -->
+<!ENTITY Aring "&#197;"> <!-- latin capital letter A with ring above
+ = latin capital letter A ring,
+ U+00C5 ISOlat1 -->
+<!ENTITY AElig "&#198;"> <!-- latin capital letter AE
+ = latin capital ligature AE,
+ U+00C6 ISOlat1 -->
+<!ENTITY Ccedil "&#199;"> <!-- latin capital letter C with cedilla,
+ U+00C7 ISOlat1 -->
+<!ENTITY Egrave "&#200;"> <!-- latin capital letter E with grave,
+ U+00C8 ISOlat1 -->
+<!ENTITY Eacute "&#201;"> <!-- latin capital letter E with acute,
+ U+00C9 ISOlat1 -->
+<!ENTITY Ecirc "&#202;"> <!-- latin capital letter E with circumflex,
+ U+00CA ISOlat1 -->
+<!ENTITY Euml "&#203;"> <!-- latin capital letter E with diaeresis,
+ U+00CB ISOlat1 -->
+<!ENTITY Igrave "&#204;"> <!-- latin capital letter I with grave,
+ U+00CC ISOlat1 -->
+<!ENTITY Iacute "&#205;"> <!-- latin capital letter I with acute,
+ U+00CD ISOlat1 -->
+<!ENTITY Icirc "&#206;"> <!-- latin capital letter I with circumflex,
+ U+00CE ISOlat1 -->
+<!ENTITY Iuml "&#207;"> <!-- latin capital letter I with diaeresis,
+ U+00CF ISOlat1 -->
+<!ENTITY ETH "&#208;"> <!-- latin capital letter ETH, U+00D0 ISOlat1 -->
+<!ENTITY Ntilde "&#209;"> <!-- latin capital letter N with tilde,
+ U+00D1 ISOlat1 -->
+<!ENTITY Ograve "&#210;"> <!-- latin capital letter O with grave,
+ U+00D2 ISOlat1 -->
+<!ENTITY Oacute "&#211;"> <!-- latin capital letter O with acute,
+ U+00D3 ISOlat1 -->
+<!ENTITY Ocirc "&#212;"> <!-- latin capital letter O with circumflex,
+ U+00D4 ISOlat1 -->
+<!ENTITY Otilde "&#213;"> <!-- latin capital letter O with tilde,
+ U+00D5 ISOlat1 -->
+<!ENTITY Ouml "&#214;"> <!-- latin capital letter O with diaeresis,
+ U+00D6 ISOlat1 -->
+<!ENTITY times "&#215;"> <!-- multiplication sign, U+00D7 ISOnum -->
+<!ENTITY Oslash "&#216;"> <!-- latin capital letter O with stroke
+ = latin capital letter O slash,
+ U+00D8 ISOlat1 -->
+<!ENTITY Ugrave "&#217;"> <!-- latin capital letter U with grave,
+ U+00D9 ISOlat1 -->
+<!ENTITY Uacute "&#218;"> <!-- latin capital letter U with acute,
+ U+00DA ISOlat1 -->
+<!ENTITY Ucirc "&#219;"> <!-- latin capital letter U with circumflex,
+ U+00DB ISOlat1 -->
+<!ENTITY Uuml "&#220;"> <!-- latin capital letter U with diaeresis,
+ U+00DC ISOlat1 -->
+<!ENTITY Yacute "&#221;"> <!-- latin capital letter Y with acute,
+ U+00DD ISOlat1 -->
+<!ENTITY THORN "&#222;"> <!-- latin capital letter THORN,
+ U+00DE ISOlat1 -->
+<!ENTITY szlig "&#223;"> <!-- latin small letter sharp s = ess-zed,
+ U+00DF ISOlat1 -->
+<!ENTITY agrave "&#224;"> <!-- latin small letter a with grave
+ = latin small letter a grave,
+ U+00E0 ISOlat1 -->
+<!ENTITY aacute "&#225;"> <!-- latin small letter a with acute,
+ U+00E1 ISOlat1 -->
+<!ENTITY acirc "&#226;"> <!-- latin small letter a with circumflex,
+ U+00E2 ISOlat1 -->
+<!ENTITY atilde "&#227;"> <!-- latin small letter a with tilde,
+ U+00E3 ISOlat1 -->
+<!ENTITY auml "&#228;"> <!-- latin small letter a with diaeresis,
+ U+00E4 ISOlat1 -->
+<!ENTITY aring "&#229;"> <!-- latin small letter a with ring above
+ = latin small letter a ring,
+ U+00E5 ISOlat1 -->
+<!ENTITY aelig "&#230;"> <!-- latin small letter ae
+ = latin small ligature ae, U+00E6 ISOlat1 -->
+<!ENTITY ccedil "&#231;"> <!-- latin small letter c with cedilla,
+ U+00E7 ISOlat1 -->
+<!ENTITY egrave "&#232;"> <!-- latin small letter e with grave,
+ U+00E8 ISOlat1 -->
+<!ENTITY eacute "&#233;"> <!-- latin small letter e with acute,
+ U+00E9 ISOlat1 -->
+<!ENTITY ecirc "&#234;"> <!-- latin small letter e with circumflex,
+ U+00EA ISOlat1 -->
+<!ENTITY euml "&#235;"> <!-- latin small letter e with diaeresis,
+ U+00EB ISOlat1 -->
+<!ENTITY igrave "&#236;"> <!-- latin small letter i with grave,
+ U+00EC ISOlat1 -->
+<!ENTITY iacute "&#237;"> <!-- latin small letter i with acute,
+ U+00ED ISOlat1 -->
+<!ENTITY icirc "&#238;"> <!-- latin small letter i with circumflex,
+ U+00EE ISOlat1 -->
+<!ENTITY iuml "&#239;"> <!-- latin small letter i with diaeresis,
+ U+00EF ISOlat1 -->
+<!ENTITY eth "&#240;"> <!-- latin small letter eth, U+00F0 ISOlat1 -->
+<!ENTITY ntilde "&#241;"> <!-- latin small letter n with tilde,
+ U+00F1 ISOlat1 -->
+<!ENTITY ograve "&#242;"> <!-- latin small letter o with grave,
+ U+00F2 ISOlat1 -->
+<!ENTITY oacute "&#243;"> <!-- latin small letter o with acute,
+ U+00F3 ISOlat1 -->
+<!ENTITY ocirc "&#244;"> <!-- latin small letter o with circumflex,
+ U+00F4 ISOlat1 -->
+<!ENTITY otilde "&#245;"> <!-- latin small letter o with tilde,
+ U+00F5 ISOlat1 -->
+<!ENTITY ouml "&#246;"> <!-- latin small letter o with diaeresis,
+ U+00F6 ISOlat1 -->
+<!ENTITY divide "&#247;"> <!-- division sign, U+00F7 ISOnum -->
+<!ENTITY oslash "&#248;"> <!-- latin small letter o with stroke,
+ = latin small letter o slash,
+ U+00F8 ISOlat1 -->
+<!ENTITY ugrave "&#249;"> <!-- latin small letter u with grave,
+ U+00F9 ISOlat1 -->
+<!ENTITY uacute "&#250;"> <!-- latin small letter u with acute,
+ U+00FA ISOlat1 -->
+<!ENTITY ucirc "&#251;"> <!-- latin small letter u with circumflex,
+ U+00FB ISOlat1 -->
+<!ENTITY uuml "&#252;"> <!-- latin small letter u with diaeresis,
+ U+00FC ISOlat1 -->
+<!ENTITY yacute "&#253;"> <!-- latin small letter y with acute,
+ U+00FD ISOlat1 -->
+<!ENTITY thorn "&#254;"> <!-- latin small letter thorn,
+ U+00FE ISOlat1 -->
+<!ENTITY yuml "&#255;"> <!-- latin small letter y with diaeresis,
+ U+00FF ISOlat1 -->
+
+
+<!ENTITY % xhtml-symbol
+ PUBLIC "-//W3C//ENTITIES Symbols for XHTML//EN"
+ "xhtml-symbol.ent" >
+<!-- Mathematical, Greek and Symbolic characters for XHTML -->
+
+<!-- Character entity set. Typical invocation:
+ <!ENTITY % HTMLsymbol PUBLIC
+ "-//W3C//ENTITIES Symbols for XHTML//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml-symbol.ent">
+ %HTMLsymbol;
+-->
+
+<!-- Portions (C) International Organization for Standardization 1986:
+ Permission to copy in any form is granted for use with
+ conforming SGML systems and applications as defined in
+ ISO 8879, provided this notice is included in all copies.
+-->
+
+<!-- Relevant ISO entity set is given unless names are newly introduced.
+ New names (i.e., not in ISO 8879 list) do not clash with any
+ existing ISO 8879 entity names. ISO 10646 character numbers
+ are given for each character, in hex. values are decimal
+ conversions of the ISO 10646 values and refer to the document
+ character set. Names are Unicode names.
+-->
+
+<!-- Latin Extended-B -->
+<!ENTITY fnof "&#402;"> <!-- latin small letter f with hook = function
+ = florin, U+0192 ISOtech -->
+
+<!-- Greek -->
+<!ENTITY Alpha "&#913;"> <!-- greek capital letter alpha, U+0391 -->
+<!ENTITY Beta "&#914;"> <!-- greek capital letter beta, U+0392 -->
+<!ENTITY Gamma "&#915;"> <!-- greek capital letter gamma,
+ U+0393 ISOgrk3 -->
+<!ENTITY Delta "&#916;"> <!-- greek capital letter delta,
+ U+0394 ISOgrk3 -->
+<!ENTITY Epsilon "&#917;"> <!-- greek capital letter epsilon, U+0395 -->
+<!ENTITY Zeta "&#918;"> <!-- greek capital letter zeta, U+0396 -->
+<!ENTITY Eta "&#919;"> <!-- greek capital letter eta, U+0397 -->
+<!ENTITY Theta "&#920;"> <!-- greek capital letter theta,
+ U+0398 ISOgrk3 -->
+<!ENTITY Iota "&#921;"> <!-- greek capital letter iota, U+0399 -->
+<!ENTITY Kappa "&#922;"> <!-- greek capital letter kappa, U+039A -->
+<!ENTITY Lambda "&#923;"> <!-- greek capital letter lamda,
+ U+039B ISOgrk3 -->
+<!ENTITY Mu "&#924;"> <!-- greek capital letter mu, U+039C -->
+<!ENTITY Nu "&#925;"> <!-- greek capital letter nu, U+039D -->
+<!ENTITY Xi "&#926;"> <!-- greek capital letter xi, U+039E ISOgrk3 -->
+<!ENTITY Omicron "&#927;"> <!-- greek capital letter omicron, U+039F -->
+<!ENTITY Pi "&#928;"> <!-- greek capital letter pi, U+03A0 ISOgrk3 -->
+<!ENTITY Rho "&#929;"> <!-- greek capital letter rho, U+03A1 -->
+<!-- there is no Sigmaf, and no U+03A2 character either -->
+<!ENTITY Sigma "&#931;"> <!-- greek capital letter sigma,
+ U+03A3 ISOgrk3 -->
+<!ENTITY Tau "&#932;"> <!-- greek capital letter tau, U+03A4 -->
+<!ENTITY Upsilon "&#933;"> <!-- greek capital letter upsilon,
+ U+03A5 ISOgrk3 -->
+<!ENTITY Phi "&#934;"> <!-- greek capital letter phi,
+ U+03A6 ISOgrk3 -->
+<!ENTITY Chi "&#935;"> <!-- greek capital letter chi, U+03A7 -->
+<!ENTITY Psi "&#936;"> <!-- greek capital letter psi,
+ U+03A8 ISOgrk3 -->
+<!ENTITY Omega "&#937;"> <!-- greek capital letter omega,
+ U+03A9 ISOgrk3 -->
+
+<!ENTITY alpha "&#945;"> <!-- greek small letter alpha,
+ U+03B1 ISOgrk3 -->
+<!ENTITY beta "&#946;"> <!-- greek small letter beta, U+03B2 ISOgrk3 -->
+<!ENTITY gamma "&#947;"> <!-- greek small letter gamma,
+ U+03B3 ISOgrk3 -->
+<!ENTITY delta "&#948;"> <!-- greek small letter delta,
+ U+03B4 ISOgrk3 -->
+<!ENTITY epsilon "&#949;"> <!-- greek small letter epsilon,
+ U+03B5 ISOgrk3 -->
+<!ENTITY zeta "&#950;"> <!-- greek small letter zeta, U+03B6 ISOgrk3 -->
+<!ENTITY eta "&#951;"> <!-- greek small letter eta, U+03B7 ISOgrk3 -->
+<!ENTITY theta "&#952;"> <!-- greek small letter theta,
+ U+03B8 ISOgrk3 -->
+<!ENTITY iota "&#953;"> <!-- greek small letter iota, U+03B9 ISOgrk3 -->
+<!ENTITY kappa "&#954;"> <!-- greek small letter kappa,
+ U+03BA ISOgrk3 -->
+<!ENTITY lambda "&#955;"> <!-- greek small letter lamda,
+ U+03BB ISOgrk3 -->
+<!ENTITY mu "&#956;"> <!-- greek small letter mu, U+03BC ISOgrk3 -->
+<!ENTITY nu "&#957;"> <!-- greek small letter nu, U+03BD ISOgrk3 -->
+<!ENTITY xi "&#958;"> <!-- greek small letter xi, U+03BE ISOgrk3 -->
+<!ENTITY omicron "&#959;"> <!-- greek small letter omicron, U+03BF NEW -->
+<!ENTITY pi "&#960;"> <!-- greek small letter pi, U+03C0 ISOgrk3 -->
+<!ENTITY rho "&#961;"> <!-- greek small letter rho, U+03C1 ISOgrk3 -->
+<!ENTITY sigmaf "&#962;"> <!-- greek small letter final sigma,
+ U+03C2 ISOgrk3 -->
+<!ENTITY sigma "&#963;"> <!-- greek small letter sigma,
+ U+03C3 ISOgrk3 -->
+<!ENTITY tau "&#964;"> <!-- greek small letter tau, U+03C4 ISOgrk3 -->
+<!ENTITY upsilon "&#965;"> <!-- greek small letter upsilon,
+ U+03C5 ISOgrk3 -->
+<!ENTITY phi "&#966;"> <!-- greek small letter phi, U+03C6 ISOgrk3 -->
+<!ENTITY chi "&#967;"> <!-- greek small letter chi, U+03C7 ISOgrk3 -->
+<!ENTITY psi "&#968;"> <!-- greek small letter psi, U+03C8 ISOgrk3 -->
+<!ENTITY omega "&#969;"> <!-- greek small letter omega,
+ U+03C9 ISOgrk3 -->
+<!ENTITY thetasym "&#977;"> <!-- greek theta symbol,
+ U+03D1 NEW -->
+<!ENTITY upsih "&#978;"> <!-- greek upsilon with hook symbol,
+ U+03D2 NEW -->
+<!ENTITY piv "&#982;"> <!-- greek pi symbol, U+03D6 ISOgrk3 -->
+
+<!-- General Punctuation -->
+<!ENTITY bull "&#8226;"> <!-- bullet = black small circle,
+ U+2022 ISOpub -->
+<!-- bullet is NOT the same as bullet operator, U+2219 -->
+<!ENTITY hellip "&#8230;"> <!-- horizontal ellipsis = three dot leader,
+ U+2026 ISOpub -->
+<!ENTITY prime "&#8242;"> <!-- prime = minutes = feet, U+2032 ISOtech -->
+<!ENTITY Prime "&#8243;"> <!-- double prime = seconds = inches,
+ U+2033 ISOtech -->
+<!ENTITY oline "&#8254;"> <!-- overline = spacing overscore,
+ U+203E NEW -->
+<!ENTITY frasl "&#8260;"> <!-- fraction slash, U+2044 NEW -->
+
+<!-- Letterlike Symbols -->
+<!ENTITY weierp "&#8472;"> <!-- script capital P = power set
+ = Weierstrass p, U+2118 ISOamso -->
+<!ENTITY image "&#8465;"> <!-- black-letter capital I = imaginary part,
+ U+2111 ISOamso -->
+<!ENTITY real "&#8476;"> <!-- black-letter capital R = real part symbol,
+ U+211C ISOamso -->
+<!ENTITY trade "&#8482;"> <!-- trade mark sign, U+2122 ISOnum -->
+<!ENTITY alefsym "&#8501;"> <!-- alef symbol = first transfinite cardinal,
+ U+2135 NEW -->
+<!-- alef symbol is NOT the same as hebrew letter alef,
+ U+05D0 although the same glyph could be used to depict both characters -->
+
+<!-- Arrows -->
+<!ENTITY larr "&#8592;"> <!-- leftwards arrow, U+2190 ISOnum -->
+<!ENTITY uarr "&#8593;"> <!-- upwards arrow, U+2191 ISOnum-->
+<!ENTITY rarr "&#8594;"> <!-- rightwards arrow, U+2192 ISOnum -->
+<!ENTITY darr "&#8595;"> <!-- downwards arrow, U+2193 ISOnum -->
+<!ENTITY harr "&#8596;"> <!-- left right arrow, U+2194 ISOamsa -->
+<!ENTITY crarr "&#8629;"> <!-- downwards arrow with corner leftwards
+ = carriage return, U+21B5 NEW -->
+<!ENTITY lArr "&#8656;"> <!-- leftwards double arrow, U+21D0 ISOtech -->
+<!-- Unicode does not say that lArr is the same as the 'is implied by' arrow
+ but also does not have any other character for that function. So lArr can
+ be used for 'is implied by' as ISOtech suggests -->
+<!ENTITY uArr "&#8657;"> <!-- upwards double arrow, U+21D1 ISOamsa -->
+<!ENTITY rArr "&#8658;"> <!-- rightwards double arrow,
+ U+21D2 ISOtech -->
+<!-- Unicode does not say this is the 'implies' character but does not have
+ another character with this function so rArr can be used for 'implies'
+ as ISOtech suggests -->
+<!ENTITY dArr "&#8659;"> <!-- downwards double arrow, U+21D3 ISOamsa -->
+<!ENTITY hArr "&#8660;"> <!-- left right double arrow,
+ U+21D4 ISOamsa -->
+
+<!-- Mathematical Operators -->
+<!ENTITY forall "&#8704;"> <!-- for all, U+2200 ISOtech -->
+<!ENTITY part "&#8706;"> <!-- partial differential, U+2202 ISOtech -->
+<!ENTITY exist "&#8707;"> <!-- there exists, U+2203 ISOtech -->
+<!ENTITY empty "&#8709;"> <!-- empty set = null set, U+2205 ISOamso -->
+<!ENTITY nabla "&#8711;"> <!-- nabla = backward difference,
+ U+2207 ISOtech -->
+<!ENTITY isin "&#8712;"> <!-- element of, U+2208 ISOtech -->
+<!ENTITY notin "&#8713;"> <!-- not an element of, U+2209 ISOtech -->
+<!ENTITY ni "&#8715;"> <!-- contains as member, U+220B ISOtech -->
+<!ENTITY prod "&#8719;"> <!-- n-ary product = product sign,
+ U+220F ISOamsb -->
+<!-- prod is NOT the same character as U+03A0 'greek capital letter pi' though
+ the same glyph might be used for both -->
+<!ENTITY sum "&#8721;"> <!-- n-ary summation, U+2211 ISOamsb -->
+<!-- sum is NOT the same character as U+03A3 'greek capital letter sigma'
+ though the same glyph might be used for both -->
+<!ENTITY minus "&#8722;"> <!-- minus sign, U+2212 ISOtech -->
+<!ENTITY lowast "&#8727;"> <!-- asterisk operator, U+2217 ISOtech -->
+<!ENTITY radic "&#8730;"> <!-- square root = radical sign,
+ U+221A ISOtech -->
+<!ENTITY prop "&#8733;"> <!-- proportional to, U+221D ISOtech -->
+<!ENTITY infin "&#8734;"> <!-- infinity, U+221E ISOtech -->
+<!ENTITY ang "&#8736;"> <!-- angle, U+2220 ISOamso -->
+<!ENTITY and "&#8743;"> <!-- logical and = wedge, U+2227 ISOtech -->
+<!ENTITY or "&#8744;"> <!-- logical or = vee, U+2228 ISOtech -->
+<!ENTITY cap "&#8745;"> <!-- intersection = cap, U+2229 ISOtech -->
+<!ENTITY cup "&#8746;"> <!-- union = cup, U+222A ISOtech -->
+<!ENTITY int "&#8747;"> <!-- integral, U+222B ISOtech -->
+<!ENTITY there4 "&#8756;"> <!-- therefore, U+2234 ISOtech -->
+<!ENTITY sim "&#8764;"> <!-- tilde operator = varies with = similar to,
+ U+223C ISOtech -->
+<!-- tilde operator is NOT the same character as the tilde, U+007E,
+ although the same glyph might be used to represent both -->
+<!ENTITY cong "&#8773;"> <!-- approximately equal to, U+2245 ISOtech -->
+<!ENTITY asymp "&#8776;"> <!-- almost equal to = asymptotic to,
+ U+2248 ISOamsr -->
+<!ENTITY ne "&#8800;"> <!-- not equal to, U+2260 ISOtech -->
+<!ENTITY equiv "&#8801;"> <!-- identical to, U+2261 ISOtech -->
+<!ENTITY le "&#8804;"> <!-- less-than or equal to, U+2264 ISOtech -->
+<!ENTITY ge "&#8805;"> <!-- greater-than or equal to,
+ U+2265 ISOtech -->
+<!ENTITY sub "&#8834;"> <!-- subset of, U+2282 ISOtech -->
+<!ENTITY sup "&#8835;"> <!-- superset of, U+2283 ISOtech -->
+<!ENTITY nsub "&#8836;"> <!-- not a subset of, U+2284 ISOamsn -->
+<!ENTITY sube "&#8838;"> <!-- subset of or equal to, U+2286 ISOtech -->
+<!ENTITY supe "&#8839;"> <!-- superset of or equal to,
+ U+2287 ISOtech -->
+<!ENTITY oplus "&#8853;"> <!-- circled plus = direct sum,
+ U+2295 ISOamsb -->
+<!ENTITY otimes "&#8855;"> <!-- circled times = vector product,
+ U+2297 ISOamsb -->
+<!ENTITY perp "&#8869;"> <!-- up tack = orthogonal to = perpendicular,
+ U+22A5 ISOtech -->
+<!ENTITY sdot "&#8901;"> <!-- dot operator, U+22C5 ISOamsb -->
+<!-- dot operator is NOT the same character as U+00B7 middle dot -->
+
+<!-- Miscellaneous Technical -->
+<!ENTITY lceil "&#8968;"> <!-- left ceiling = APL upstile,
+ U+2308 ISOamsc -->
+<!ENTITY rceil "&#8969;"> <!-- right ceiling, U+2309 ISOamsc -->
+<!ENTITY lfloor "&#8970;"> <!-- left floor = APL downstile,
+ U+230A ISOamsc -->
+<!ENTITY rfloor "&#8971;"> <!-- right floor, U+230B ISOamsc -->
+<!ENTITY lang "&#9001;"> <!-- left-pointing angle bracket = bra,
+ U+2329 ISOtech -->
+<!-- lang is NOT the same character as U+003C 'less than sign'
+ or U+2039 'single left-pointing angle quotation mark' -->
+<!ENTITY rang "&#9002;"> <!-- right-pointing angle bracket = ket,
+ U+232A ISOtech -->
+<!-- rang is NOT the same character as U+003E 'greater than sign'
+ or U+203A 'single right-pointing angle quotation mark' -->
+
+<!-- Geometric Shapes -->
+<!ENTITY loz "&#9674;"> <!-- lozenge, U+25CA ISOpub -->
+
+<!-- Miscellaneous Symbols -->
+<!ENTITY spades "&#9824;"> <!-- black spade suit, U+2660 ISOpub -->
+<!-- black here seems to mean filled as opposed to hollow -->
+<!ENTITY clubs "&#9827;"> <!-- black club suit = shamrock,
+ U+2663 ISOpub -->
+<!ENTITY hearts "&#9829;"> <!-- black heart suit = valentine,
+ U+2665 ISOpub -->
+<!ENTITY diams "&#9830;"> <!-- black diamond suit, U+2666 ISOpub -->
+
+
+<!ENTITY % xhtml-special
+ PUBLIC "-//W3C//ENTITIES Special for XHTML//EN"
+ "xhtml-special.ent" >
+<!-- Special characters for XHTML -->
+
+<!-- Character entity set. Typical invocation:
+ <!ENTITY % HTMLspecial PUBLIC
+ "-//W3C//ENTITIES Special for XHTML//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml-special.ent">
+ %HTMLspecial;
+-->
+
+<!-- Portions (C) International Organization for Standardization 1986:
+ Permission to copy in any form is granted for use with
+ conforming SGML systems and applications as defined in
+ ISO 8879, provided this notice is included in all copies.
+-->
+
+<!-- Relevant ISO entity set is given unless names are newly introduced.
+ New names (i.e., not in ISO 8879 list) do not clash with any
+ existing ISO 8879 entity names. ISO 10646 character numbers
+ are given for each character, in hex. values are decimal
+ conversions of the ISO 10646 values and refer to the document
+ character set. Names are Unicode names.
+-->
+
+<!-- C0 Controls and Basic Latin -->
+<!ENTITY quot "&#34;"> <!-- quotation mark, U+0022 ISOnum -->
+<!ENTITY amp "&#38;#38;"> <!-- ampersand, U+0026 ISOnum -->
+<!ENTITY lt "&#38;#60;"> <!-- less-than sign, U+003C ISOnum -->
+<!ENTITY gt "&#62;"> <!-- greater-than sign, U+003E ISOnum -->
+<!ENTITY apos "&#39;"> <!-- apostrophe = APL quote, U+0027 ISOnum -->
+
+<!-- Latin Extended-A -->
+<!ENTITY OElig "&#338;"> <!-- latin capital ligature OE,
+ U+0152 ISOlat2 -->
+<!ENTITY oelig "&#339;"> <!-- latin small ligature oe, U+0153 ISOlat2 -->
+<!-- ligature is a misnomer, this is a separate character in some languages -->
+<!ENTITY Scaron "&#352;"> <!-- latin capital letter S with caron,
+ U+0160 ISOlat2 -->
+<!ENTITY scaron "&#353;"> <!-- latin small letter s with caron,
+ U+0161 ISOlat2 -->
+<!ENTITY Yuml "&#376;"> <!-- latin capital letter Y with diaeresis,
+ U+0178 ISOlat2 -->
+
+<!-- Spacing Modifier Letters -->
+<!ENTITY circ "&#710;"> <!-- modifier letter circumflex accent,
+ U+02C6 ISOpub -->
+<!ENTITY tilde "&#732;"> <!-- small tilde, U+02DC ISOdia -->
+
+<!-- General Punctuation -->
+<!ENTITY ensp "&#8194;"> <!-- en space, U+2002 ISOpub -->
+<!ENTITY emsp "&#8195;"> <!-- em space, U+2003 ISOpub -->
+<!ENTITY thinsp "&#8201;"> <!-- thin space, U+2009 ISOpub -->
+<!ENTITY zwnj "&#8204;"> <!-- zero width non-joiner,
+ U+200C NEW RFC 2070 -->
+<!ENTITY zwj "&#8205;"> <!-- zero width joiner, U+200D NEW RFC 2070 -->
+<!ENTITY lrm "&#8206;"> <!-- left-to-right mark, U+200E NEW RFC 2070 -->
+<!ENTITY rlm "&#8207;"> <!-- right-to-left mark, U+200F NEW RFC 2070 -->
+<!ENTITY ndash "&#8211;"> <!-- en dash, U+2013 ISOpub -->
+<!ENTITY mdash "&#8212;"> <!-- em dash, U+2014 ISOpub -->
+<!ENTITY lsquo "&#8216;"> <!-- left single quotation mark,
+ U+2018 ISOnum -->
+<!ENTITY rsquo "&#8217;"> <!-- right single quotation mark,
+ U+2019 ISOnum -->
+<!ENTITY sbquo "&#8218;"> <!-- single low-9 quotation mark, U+201A NEW -->
+<!ENTITY ldquo "&#8220;"> <!-- left double quotation mark,
+ U+201C ISOnum -->
+<!ENTITY rdquo "&#8221;"> <!-- right double quotation mark,
+ U+201D ISOnum -->
+<!ENTITY bdquo "&#8222;"> <!-- double low-9 quotation mark, U+201E NEW -->
+<!ENTITY dagger "&#8224;"> <!-- dagger, U+2020 ISOpub -->
+<!ENTITY Dagger "&#8225;"> <!-- double dagger, U+2021 ISOpub -->
+<!ENTITY permil "&#8240;"> <!-- per mille sign, U+2030 ISOtech -->
+<!ENTITY lsaquo "&#8249;"> <!-- single left-pointing angle quotation mark,
+ U+2039 ISO proposed -->
+<!-- lsaquo is proposed but not yet ISO standardized -->
+<!ENTITY rsaquo "&#8250;"> <!-- single right-pointing angle quotation mark,
+ U+203A ISO proposed -->
+<!-- rsaquo is proposed but not yet ISO standardized -->
+
+<!-- Currency Symbols -->
+<!ENTITY euro "&#8364;"> <!-- euro sign, U+20AC NEW -->
+
+
+<!-- end of xhtml-charent-1.mod -->
+]]>
+
+<!-- end of xhtml-framework-1.mod -->
+]]>
+
+<!-- Post-Framework Redeclaration placeholder ................... -->
+<!-- this serves as a location to insert markup declarations
+ into the DTD following the framework declarations.
+-->
+<!ENTITY % xhtml-postfw-redecl.module "IGNORE" >
+<![%xhtml-postfw-redecl.module;[
+%xhtml-postfw-redecl.mod;
+<!-- end of xhtml-postfw-redecl.module -->]]>
+
+<!-- Text Module (Required) ..................................... -->
+<!ENTITY % xhtml-text.module "INCLUDE" >
+<![%xhtml-text.module;[
+<!ENTITY % xhtml-text.mod
+ PUBLIC "-//W3C//ELEMENTS XHTML Text 1.0//EN"
+ "http://www.w3.org/MarkUp/DTD/xhtml-text-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Text Module ................................................... -->
+<!-- file: xhtml-text-1.mod
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+ Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $ SMI
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ELEMENTS XHTML Text 1.0//EN"
+ SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-text-1.mod"
+
+ Revisions:
+ (none)
+ ....................................................................... -->
+
+<!-- Textual Content
+
+ The Text module includes declarations for all core
+ text container elements and their attributes.
+-->
+
+<!ENTITY % xhtml-inlstruct.module "INCLUDE" >
+<![%xhtml-inlstruct.module;[
+<!ENTITY % xhtml-inlstruct.mod
+ PUBLIC "-//W3C//ELEMENTS XHTML Inline Structural 1.0//EN"
+ "xhtml-inlstruct-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Inline Structural Module ...................................... -->
+<!-- file: xhtml-inlstruct-1.mod
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+ Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $ SMI
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ELEMENTS XHTML Inline Structural 1.0//EN"
+ SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-inlstruct-1.mod"
+
+ Revisions:
+ (none)
+ ....................................................................... -->
+
+<!-- Inline Structural
+
+ br, span
+
+ This module declares the elements and their attributes
+ used to support inline-level structural markup.
+-->
+
+<!-- br: forced line break ............................. -->
+
+<!ENTITY % br.element "INCLUDE" >
+<![%br.element;[
+
+<!ENTITY % br.content "EMPTY" >
+<!ENTITY % br.qname "br" >
+<!ELEMENT %br.qname; %br.content; >
+
+<!-- end of br.element -->]]>
+
+<!ENTITY % br.attlist "INCLUDE" >
+<![%br.attlist;[
+<!ATTLIST %br.qname;
+ %Core.attrib;
+>
+<!-- end of br.attlist -->]]>
+
+<!-- span: generic inline container .................... -->
+
+<!ENTITY % span.element "INCLUDE" >
+<![%span.element;[
+<!ENTITY % span.content
+ "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % span.qname "span" >
+<!ELEMENT %span.qname; %span.content; >
+<!-- end of span.element -->]]>
+
+<!ENTITY % span.attlist "INCLUDE" >
+<![%span.attlist;[
+<!ATTLIST %span.qname;
+ %Common.attrib;
+>
+<!-- end of span.attlist -->]]>
+
+<!-- end of xhtml-inlstruct-1.mod -->
+]]>
+
+<!ENTITY % xhtml-inlphras.module "INCLUDE" >
+<![%xhtml-inlphras.module;[
+<!ENTITY % xhtml-inlphras.mod
+ PUBLIC "-//W3C//ELEMENTS XHTML Inline Phrasal 1.0//EN"
+ "xhtml-inlphras-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Inline Phrasal Module ......................................... -->
+<!-- file: xhtml-inlphras-1.mod
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+ Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $ SMI
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ELEMENTS XHTML Inline Phrasal 1.0//EN"
+ SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-inlphras-1.mod"
+
+ Revisions:
+ (none)
+ ....................................................................... -->
+
+<!-- Inline Phrasal
+
+ abbr, acronym, cite, code, dfn, em, kbd, q, samp, strong, var
+
+ This module declares the elements and their attributes used to
+ support inline-level phrasal markup.
+-->
+
+<!ENTITY % abbr.element "INCLUDE" >
+<![%abbr.element;[
+<!ENTITY % abbr.content
+ "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % abbr.qname "abbr" >
+<!ELEMENT %abbr.qname; %abbr.content; >
+<!-- end of abbr.element -->]]>
+
+<!ENTITY % abbr.attlist "INCLUDE" >
+<![%abbr.attlist;[
+<!ATTLIST %abbr.qname;
+ %Common.attrib;
+>
+<!-- end of abbr.attlist -->]]>
+
+<!ENTITY % acronym.element "INCLUDE" >
+<![%acronym.element;[
+<!ENTITY % acronym.content
+ "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % acronym.qname "acronym" >
+<!ELEMENT %acronym.qname; %acronym.content; >
+<!-- end of acronym.element -->]]>
+
+<!ENTITY % acronym.attlist "INCLUDE" >
+<![%acronym.attlist;[
+<!ATTLIST %acronym.qname;
+ %Common.attrib;
+>
+<!-- end of acronym.attlist -->]]>
+
+<!ENTITY % cite.element "INCLUDE" >
+<![%cite.element;[
+<!ENTITY % cite.content
+ "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % cite.qname "cite" >
+<!ELEMENT %cite.qname; %cite.content; >
+<!-- end of cite.element -->]]>
+
+<!ENTITY % cite.attlist "INCLUDE" >
+<![%cite.attlist;[
+<!ATTLIST %cite.qname;
+ %Common.attrib;
+>
+<!-- end of cite.attlist -->]]>
+
+<!ENTITY % code.element "INCLUDE" >
+<![%code.element;[
+<!ENTITY % code.content
+ "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % code.qname "code" >
+<!ELEMENT %code.qname; %code.content; >
+<!-- end of code.element -->]]>
+
+<!ENTITY % code.attlist "INCLUDE" >
+<![%code.attlist;[
+<!ATTLIST %code.qname;
+ %Common.attrib;
+>
+<!-- end of code.attlist -->]]>
+
+<!ENTITY % dfn.element "INCLUDE" >
+<![%dfn.element;[
+<!ENTITY % dfn.content
+ "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % dfn.qname "dfn" >
+<!ELEMENT %dfn.qname; %dfn.content; >
+<!-- end of dfn.element -->]]>
+
+<!ENTITY % dfn.attlist "INCLUDE" >
+<![%dfn.attlist;[
+<!ATTLIST %dfn.qname;
+ %Common.attrib;
+>
+<!-- end of dfn.attlist -->]]>
+
+<!ENTITY % em.element "INCLUDE" >
+<![%em.element;[
+<!ENTITY % em.content
+ "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % em.qname "em" >
+<!ELEMENT %em.qname; %em.content; >
+<!-- end of em.element -->]]>
+
+<!ENTITY % em.attlist "INCLUDE" >
+<![%em.attlist;[
+<!ATTLIST %em.qname;
+ %Common.attrib;
+>
+<!-- end of em.attlist -->]]>
+
+<!ENTITY % kbd.element "INCLUDE" >
+<![%kbd.element;[
+<!ENTITY % kbd.content
+ "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % kbd.qname "kbd" >
+<!ELEMENT %kbd.qname; %kbd.content; >
+<!-- end of kbd.element -->]]>
+
+<!ENTITY % kbd.attlist "INCLUDE" >
+<![%kbd.attlist;[
+<!ATTLIST %kbd.qname;
+ %Common.attrib;
+>
+<!-- end of kbd.attlist -->]]>
+
+<!ENTITY % q.element "INCLUDE" >
+<![%q.element;[
+<!ENTITY % q.content
+ "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % q.qname "q" >
+<!ELEMENT %q.qname; %q.content; >
+<!-- end of q.element -->]]>
+
+<!ENTITY % q.attlist "INCLUDE" >
+<![%q.attlist;[
+<!ATTLIST %q.qname;
+ %Common.attrib;
+ cite %URI.datatype; #IMPLIED
+>
+<!-- end of q.attlist -->]]>
+
+<!ENTITY % samp.element "INCLUDE" >
+<![%samp.element;[
+<!ENTITY % samp.content
+ "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % samp.qname "samp" >
+<!ELEMENT %samp.qname; %samp.content; >
+<!-- end of samp.element -->]]>
+
+<!ENTITY % samp.attlist "INCLUDE" >
+<![%samp.attlist;[
+<!ATTLIST %samp.qname;
+ %Common.attrib;
+>
+<!-- end of samp.attlist -->]]>
+
+<!ENTITY % strong.element "INCLUDE" >
+<![%strong.element;[
+<!ENTITY % strong.content
+ "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % strong.qname "strong" >
+<!ELEMENT %strong.qname; %strong.content; >
+<!-- end of strong.element -->]]>
+
+<!ENTITY % strong.attlist "INCLUDE" >
+<![%strong.attlist;[
+<!ATTLIST %strong.qname;
+ %Common.attrib;
+>
+<!-- end of strong.attlist -->]]>
+
+<!ENTITY % var.element "INCLUDE" >
+<![%var.element;[
+<!ENTITY % var.content
+ "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % var.qname "var" >
+<!ELEMENT %var.qname; %var.content; >
+<!-- end of var.element -->]]>
+
+<!ENTITY % var.attlist "INCLUDE" >
+<![%var.attlist;[
+<!ATTLIST %var.qname;
+ %Common.attrib;
+>
+<!-- end of var.attlist -->]]>
+
+<!-- end of xhtml-inlphras-1.mod -->
+]]>
+
+<!ENTITY % xhtml-blkstruct.module "INCLUDE" >
+<![%xhtml-blkstruct.module;[
+<!ENTITY % xhtml-blkstruct.mod
+ PUBLIC "-//W3C//ELEMENTS XHTML Block Structural 1.0//EN"
+ "xhtml-blkstruct-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Block Structural Module ....................................... -->
+<!-- file: xhtml-blkstruct-1.mod
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+ Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $ SMI
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ELEMENTS XHTML Block Structural 1.0//EN"
+ SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-blkstruct-1.mod"
+
+ Revisions:
+ (none)
+ ....................................................................... -->
+
+<!-- Block Structural
+
+ div, p
+
+ This module declares the elements and their attributes used to
+ support block-level structural markup.
+-->
+
+<!ENTITY % div.element "INCLUDE" >
+<![%div.element;[
+<!ENTITY % div.content
+ "( #PCDATA | %Flow.mix; )*"
+>
+<!ENTITY % div.qname "div" >
+<!ELEMENT %div.qname; %div.content; >
+<!-- end of div.element -->]]>
+
+<!ENTITY % div.attlist "INCLUDE" >
+<![%div.attlist;[
+<!ATTLIST %div.qname;
+ %Common.attrib;
+>
+<!-- end of div.attlist -->]]>
+
+<!ENTITY % p.element "INCLUDE" >
+<![%p.element;[
+<!ENTITY % p.content
+ "( #PCDATA | %Inline.mix; )*" >
+<!ENTITY % p.qname "p" >
+<!ELEMENT %p.qname; %p.content; >
+<!-- end of p.element -->]]>
+
+<!ENTITY % p.attlist "INCLUDE" >
+<![%p.attlist;[
+<!ATTLIST %p.qname;
+ %Common.attrib;
+>
+<!-- end of p.attlist -->]]>
+
+<!-- end of xhtml-blkstruct-1.mod -->
+]]>
+
+<!ENTITY % xhtml-blkphras.module "INCLUDE" >
+<![%xhtml-blkphras.module;[
+<!ENTITY % xhtml-blkphras.mod
+ PUBLIC "-//W3C//ELEMENTS XHTML Block Phrasal 1.0//EN"
+ "xhtml-blkphras-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Block Phrasal Module .......................................... -->
+<!-- file: xhtml-blkphras-1.mod
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+ Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $ SMI
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ELEMENTS XHTML Block Phrasal 1.0//EN"
+ SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-blkphras-1.mod"
+
+ Revisions:
+ (none)
+ ....................................................................... -->
+
+<!-- Block Phrasal
+
+ address, blockquote, pre, h1, h2, h3, h4, h5, h6
+
+ This module declares the elements and their attributes used to
+ support block-level phrasal markup.
+-->
+
+<!ENTITY % address.element "INCLUDE" >
+<![%address.element;[
+<!ENTITY % address.content
+ "( #PCDATA | %Inline.mix; )*" >
+<!ENTITY % address.qname "address" >
+<!ELEMENT %address.qname; %address.content; >
+<!-- end of address.element -->]]>
+
+<!ENTITY % address.attlist "INCLUDE" >
+<![%address.attlist;[
+<!ATTLIST %address.qname;
+ %Common.attrib;
+>
+<!-- end of address.attlist -->]]>
+
+<!ENTITY % blockquote.element "INCLUDE" >
+<![%blockquote.element;[
+<!ENTITY % blockquote.content
+ "( %Block.mix; )+"
+>
+<!ENTITY % blockquote.qname "blockquote" >
+<!ELEMENT %blockquote.qname; %blockquote.content; >
+<!-- end of blockquote.element -->]]>
+
+<!ENTITY % blockquote.attlist "INCLUDE" >
+<![%blockquote.attlist;[
+<!ATTLIST %blockquote.qname;
+ %Common.attrib;
+ cite %URI.datatype; #IMPLIED
+>
+<!-- end of blockquote.attlist -->]]>
+
+<!ENTITY % pre.element "INCLUDE" >
+<![%pre.element;[
+<!ENTITY % pre.content
+ "( #PCDATA
+ | %InlStruct.class;
+ %InlPhras.class;
+ | %tt.qname; | %i.qname; | %b.qname;
+ %I18n.class;
+ %Anchor.class;
+ | %script.qname; | %map.qname;
+ %Inline.extra; )*"
+>
+<!ENTITY % pre.qname "pre" >
+<!ELEMENT %pre.qname; %pre.content; >
+<!-- end of pre.element -->]]>
+
+<!ENTITY % pre.attlist "INCLUDE" >
+<![%pre.attlist;[
+<!ATTLIST %pre.qname;
+ %Common.attrib;
+>
+<!-- end of pre.attlist -->]]>
+
+<!-- ................... Heading Elements ................... -->
+
+<!ENTITY % Heading.content "( #PCDATA | %Inline.mix; )*" >
+
+<!ENTITY % h1.element "INCLUDE" >
+<![%h1.element;[
+<!ENTITY % h1.qname "h1" >
+<!ELEMENT %h1.qname; %Heading.content; >
+<!-- end of h1.element -->]]>
+
+<!ENTITY % h1.attlist "INCLUDE" >
+<![%h1.attlist;[
+<!ATTLIST %h1.qname;
+ %Common.attrib;
+>
+<!-- end of h1.attlist -->]]>
+
+<!ENTITY % h2.element "INCLUDE" >
+<![%h2.element;[
+<!ENTITY % h2.qname "h2" >
+<!ELEMENT %h2.qname; %Heading.content; >
+<!-- end of h2.element -->]]>
+
+<!ENTITY % h2.attlist "INCLUDE" >
+<![%h2.attlist;[
+<!ATTLIST %h2.qname;
+ %Common.attrib;
+>
+<!-- end of h2.attlist -->]]>
+
+<!ENTITY % h3.element "INCLUDE" >
+<![%h3.element;[
+<!ENTITY % h3.qname "h3" >
+<!ELEMENT %h3.qname; %Heading.content; >
+<!-- end of h3.element -->]]>
+
+<!ENTITY % h3.attlist "INCLUDE" >
+<![%h3.attlist;[
+<!ATTLIST %h3.qname;
+ %Common.attrib;
+>
+<!-- end of h3.attlist -->]]>
+
+<!ENTITY % h4.element "INCLUDE" >
+<![%h4.element;[
+<!ENTITY % h4.qname "h4" >
+<!ELEMENT %h4.qname; %Heading.content; >
+<!-- end of h4.element -->]]>
+
+<!ENTITY % h4.attlist "INCLUDE" >
+<![%h4.attlist;[
+<!ATTLIST %h4.qname;
+ %Common.attrib;
+>
+<!-- end of h4.attlist -->]]>
+
+<!ENTITY % h5.element "INCLUDE" >
+<![%h5.element;[
+<!ENTITY % h5.qname "h5" >
+<!ELEMENT %h5.qname; %Heading.content; >
+<!-- end of h5.element -->]]>
+
+<!ENTITY % h5.attlist "INCLUDE" >
+<![%h5.attlist;[
+<!ATTLIST %h5.qname;
+ %Common.attrib;
+>
+<!-- end of h5.attlist -->]]>
+
+<!ENTITY % h6.element "INCLUDE" >
+<![%h6.element;[
+<!ENTITY % h6.qname "h6" >
+<!ELEMENT %h6.qname; %Heading.content; >
+<!-- end of h6.element -->]]>
+
+<!ENTITY % h6.attlist "INCLUDE" >
+<![%h6.attlist;[
+<!ATTLIST %h6.qname;
+ %Common.attrib;
+>
+<!-- end of h6.attlist -->]]>
+
+<!-- end of xhtml-blkphras-1.mod -->
+]]>
+
+<!-- end of xhtml-text-1.mod -->
+]]>
+
+<!-- Hypertext Module (required) ................................. -->
+<!ENTITY % xhtml-hypertext.module "INCLUDE" >
+<![%xhtml-hypertext.module;[
+<!ENTITY % xhtml-hypertext.mod
+ PUBLIC "-//W3C//ELEMENTS XHTML Hypertext 1.0//EN"
+ "http://www.w3.org/MarkUp/DTD/xhtml-hypertext-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Hypertext Module .............................................. -->
+<!-- file: xhtml-hypertext-1.mod
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+ Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $ SMI
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ELEMENTS XHTML Hypertext 1.0//EN"
+ SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-hypertext-1.mod"
+
+ Revisions:
+ (none)
+ ....................................................................... -->
+
+<!-- Hypertext
+
+ a
+
+ This module declares the anchor ('a') element type, which
+ defines the source of a hypertext link. The destination
+ (or link 'target') is identified via its 'id' attribute
+ rather than the 'name' attribute as was used in HTML.
+-->
+
+<!-- ............ Anchor Element ............ -->
+
+<!ENTITY % a.element "INCLUDE" >
+<![%a.element;[
+<!ENTITY % a.content
+ "( #PCDATA | %InlNoAnchor.mix; )*"
+>
+<!ENTITY % a.qname "a" >
+<!ELEMENT %a.qname; %a.content; >
+<!-- end of a.element -->]]>
+
+<!ENTITY % a.attlist "INCLUDE" >
+<![%a.attlist;[
+<!ATTLIST %a.qname;
+ %Common.attrib;
+ href %URI.datatype; #IMPLIED
+ charset %Charset.datatype; #IMPLIED
+ type %ContentType.datatype; #IMPLIED
+ hreflang %LanguageCode.datatype; #IMPLIED
+ rel %LinkTypes.datatype; #IMPLIED
+ rev %LinkTypes.datatype; #IMPLIED
+ accesskey %Character.datatype; #IMPLIED
+ tabindex %Number.datatype; #IMPLIED
+>
+<!-- end of a.attlist -->]]>
+
+<!-- end of xhtml-hypertext-1.mod -->
+]]>
+
+<!-- Lists Module (required) .................................... -->
+<!ENTITY % xhtml-list.module "INCLUDE" >
+<![%xhtml-list.module;[
+<!ENTITY % xhtml-list.mod
+ PUBLIC "-//W3C//ELEMENTS XHTML Lists 1.0//EN"
+ "http://www.w3.org/MarkUp/DTD/xhtml-list-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Lists Module .................................................. -->
+<!-- file: xhtml-list-1.mod
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+ Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $ SMI
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ELEMENTS XHTML Lists 1.0//EN"
+ SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-list-1.mod"
+
+ Revisions:
+ (none)
+ ....................................................................... -->
+
+<!-- Lists
+
+ dl, dt, dd, ol, ul, li
+
+ This module declares the list-oriented element types
+ and their attributes.
+-->
+
+<!ENTITY % dl.qname "dl" >
+<!ENTITY % dt.qname "dt" >
+<!ENTITY % dd.qname "dd" >
+<!ENTITY % ol.qname "ol" >
+<!ENTITY % ul.qname "ul" >
+<!ENTITY % li.qname "li" >
+
+<!-- dl: Definition List ............................... -->
+
+<!ENTITY % dl.element "INCLUDE" >
+<![%dl.element;[
+<!ENTITY % dl.content "( %dt.qname; | %dd.qname; )+" >
+<!ELEMENT %dl.qname; %dl.content; >
+<!-- end of dl.element -->]]>
+
+<!ENTITY % dl.attlist "INCLUDE" >
+<![%dl.attlist;[
+<!ATTLIST %dl.qname;
+ %Common.attrib;
+>
+<!-- end of dl.attlist -->]]>
+
+<!-- dt: Definition Term ............................... -->
+
+<!ENTITY % dt.element "INCLUDE" >
+<![%dt.element;[
+<!ENTITY % dt.content
+ "( #PCDATA | %Inline.mix; )*"
+>
+<!ELEMENT %dt.qname; %dt.content; >
+<!-- end of dt.element -->]]>
+
+<!ENTITY % dt.attlist "INCLUDE" >
+<![%dt.attlist;[
+<!ATTLIST %dt.qname;
+ %Common.attrib;
+>
+<!-- end of dt.attlist -->]]>
+
+<!-- dd: Definition Description ........................ -->
+
+<!ENTITY % dd.element "INCLUDE" >
+<![%dd.element;[
+<!ENTITY % dd.content
+ "( #PCDATA | %Flow.mix; )*"
+>
+<!ELEMENT %dd.qname; %dd.content; >
+<!-- end of dd.element -->]]>
+
+<!ENTITY % dd.attlist "INCLUDE" >
+<![%dd.attlist;[
+<!ATTLIST %dd.qname;
+ %Common.attrib;
+>
+<!-- end of dd.attlist -->]]>
+
+<!-- ol: Ordered List (numbered styles) ................ -->
+
+<!ENTITY % ol.element "INCLUDE" >
+<![%ol.element;[
+<!ENTITY % ol.content "( %li.qname; )+" >
+<!ELEMENT %ol.qname; %ol.content; >
+<!-- end of ol.element -->]]>
+
+<!ENTITY % ol.attlist "INCLUDE" >
+<![%ol.attlist;[
+<!ATTLIST %ol.qname;
+ %Common.attrib;
+>
+<!-- end of ol.attlist -->]]>
+
+<!-- ul: Unordered List (bullet styles) ................ -->
+
+<!ENTITY % ul.element "INCLUDE" >
+<![%ul.element;[
+<!ENTITY % ul.content "( %li.qname; )+" >
+<!ELEMENT %ul.qname; %ul.content; >
+<!-- end of ul.element -->]]>
+
+<!ENTITY % ul.attlist "INCLUDE" >
+<![%ul.attlist;[
+<!ATTLIST %ul.qname;
+ %Common.attrib;
+>
+<!-- end of ul.attlist -->]]>
+
+<!-- li: List Item ..................................... -->
+
+<!ENTITY % li.element "INCLUDE" >
+<![%li.element;[
+<!ENTITY % li.content
+ "( #PCDATA | %Flow.mix; )*"
+>
+<!ELEMENT %li.qname; %li.content; >
+<!-- end of li.element -->]]>
+
+<!ENTITY % li.attlist "INCLUDE" >
+<![%li.attlist;[
+<!ATTLIST %li.qname;
+ %Common.attrib;
+>
+<!-- end of li.attlist -->]]>
+
+<!-- end of xhtml-list-1.mod -->
+]]>
+
+<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
+
+<!-- Edit Module ................................................ -->
+<!ENTITY % xhtml-edit.module "INCLUDE" >
+<![%xhtml-edit.module;[
+<!ENTITY % xhtml-edit.mod
+ PUBLIC "-//W3C//ELEMENTS XHTML Editing Elements 1.0//EN"
+ "http://www.w3.org/MarkUp/DTD/xhtml-edit-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Editing Elements Module ....................................... -->
+<!-- file: xhtml-edit-1.mod
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+ Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $ SMI
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ELEMENTS XHTML Editing Markup 1.0//EN"
+ SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-edit-1.mod"
+
+ Revisions:
+ (none)
+ ....................................................................... -->
+
+<!-- Editing Elements
+
+ ins, del
+
+ This module declares element types and attributes used to indicate
+ inserted and deleted content while editing a document.
+-->
+
+<!-- ins: Inserted Text ............................... -->
+
+<!ENTITY % ins.element "INCLUDE" >
+<![%ins.element;[
+<!ENTITY % ins.content
+ "( #PCDATA | %Flow.mix; )*"
+>
+<!ENTITY % ins.qname "ins" >
+<!ELEMENT %ins.qname; %ins.content; >
+<!-- end of ins.element -->]]>
+
+<!ENTITY % ins.attlist "INCLUDE" >
+<![%ins.attlist;[
+<!ATTLIST %ins.qname;
+ %Common.attrib;
+ cite %URI.datatype; #IMPLIED
+ datetime %Datetime.datatype; #IMPLIED
+>
+<!-- end of ins.attlist -->]]>
+
+<!-- del: Deleted Text ................................ -->
+
+<!ENTITY % del.element "INCLUDE" >
+<![%del.element;[
+<!ENTITY % del.content
+ "( #PCDATA | %Flow.mix; )*"
+>
+<!ENTITY % del.qname "del" >
+<!ELEMENT %del.qname; %del.content; >
+<!-- end of del.element -->]]>
+
+<!ENTITY % del.attlist "INCLUDE" >
+<![%del.attlist;[
+<!ATTLIST %del.qname;
+ %Common.attrib;
+ cite %URI.datatype; #IMPLIED
+ datetime %Datetime.datatype; #IMPLIED
+>
+<!-- end of del.attlist -->]]>
+
+<!-- end of xhtml-edit-1.mod -->
+]]>
+
+<!-- BIDI Override Module ....................................... -->
+<!ENTITY % xhtml-bdo.module "%XHTML.bidi;" >
+<![%xhtml-bdo.module;[
+<!ENTITY % xhtml-bdo.mod
+ PUBLIC "-//W3C//ELEMENTS XHTML BIDI Override Element 1.0//EN"
+ "http://www.w3.org/MarkUp/DTD/xhtml-bdo-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML BDO Element Module ............................................. -->
+<!-- file: xhtml-bdo-1.mod
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+ Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $ SMI
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ELEMENTS XHTML BDO Element 1.0//EN"
+ SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-bdo-1.mod"
+
+ Revisions:
+ (none)
+ ....................................................................... -->
+
+<!-- Bidirectional Override (bdo) Element
+
+ This modules declares the element 'bdo', used to override the
+ Unicode bidirectional algorithm for selected fragments of text.
+
+ DEPENDENCIES:
+ Relies on the conditional section keyword %XHTML.bidi; declared
+ as "INCLUDE". Bidirectional text support includes both the bdo
+ element and the 'dir' attribute.
+-->
+
+<!ENTITY % bdo.element "INCLUDE" >
+<![%bdo.element;[
+<!ENTITY % bdo.content
+ "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % bdo.qname "bdo" >
+<!ELEMENT %bdo.qname; %bdo.content; >
+<!-- end of bdo.element -->]]>
+
+<!ENTITY % bdo.attlist "INCLUDE" >
+<![%bdo.attlist;[
+<!ATTLIST %bdo.qname;
+ %Core.attrib;
+ xml:lang %LanguageCode.datatype; #IMPLIED
+ dir ( ltr | rtl ) #REQUIRED
+>
+]]>
+
+<!-- end of xhtml-bdo-1.mod -->
+]]>
+
+<!-- Ruby Module ................................................ -->
+<!ENTITY % Ruby.common.attlists "INCLUDE" >
+<!ENTITY % Ruby.common.attrib "%Common.attrib;" >
+<!ENTITY % xhtml-ruby.module "INCLUDE" >
+<![%xhtml-ruby.module;[
+<!ENTITY % xhtml-ruby.mod
+ PUBLIC "-//W3C//ELEMENTS XHTML Ruby 1.0//EN"
+ "http://www.w3.org/TR/ruby/xhtml-ruby-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Ruby Module .................................................... -->
+<!-- file: xhtml-ruby-1.mod
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+ Copyright 1999-2001 W3C (MIT, INRIA, Keio), All Rights Reserved.
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $
+
+ This module is based on the W3C Ruby Annotation Specification:
+
+ http://www.w3.org/TR/ruby
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ELEMENTS XHTML Ruby 1.0//EN"
+ SYSTEM "http://www.w3.org/TR/ruby/xhtml-ruby-1.mod"
+
+ ...................................................................... -->
+
+<!-- Ruby Elements
+
+ ruby, rbc, rtc, rb, rt, rp
+
+ This module declares the elements and their attributes used to
+ support ruby annotation markup.
+-->
+
+<!-- declare qualified element type names:
+-->
+<!ENTITY % ruby.qname "ruby" >
+<!ENTITY % rbc.qname "rbc" >
+<!ENTITY % rtc.qname "rtc" >
+<!ENTITY % rb.qname "rb" >
+<!ENTITY % rt.qname "rt" >
+<!ENTITY % rp.qname "rp" >
+
+<!-- rp fallback is included by default.
+-->
+<!ENTITY % Ruby.fallback "INCLUDE" >
+<!ENTITY % Ruby.fallback.mandatory "IGNORE" >
+
+<!-- Complex ruby is included by default; it may be
+ overridden by other modules to ignore it.
+-->
+<!ENTITY % Ruby.complex "INCLUDE" >
+
+<!-- Fragments for the content model of the ruby element -->
+<![%Ruby.fallback;[
+<![%Ruby.fallback.mandatory;[
+<!ENTITY % Ruby.content.simple
+ "( %rb.qname;, %rp.qname;, %rt.qname;, %rp.qname; )"
+>
+]]>
+<!ENTITY % Ruby.content.simple
+ "( %rb.qname;, ( %rt.qname; | ( %rp.qname;, %rt.qname;, %rp.qname; ) ) )"
+>
+]]>
+<!ENTITY % Ruby.content.simple "( %rb.qname;, %rt.qname; )" >
+
+<![%Ruby.complex;[
+<!ENTITY % Ruby.content.complex
+ "| ( %rbc.qname;, %rtc.qname;, %rtc.qname;? )"
+>
+]]>
+<!ENTITY % Ruby.content.complex "" >
+
+<!-- Content models of the rb and the rt elements are intended to
+ allow other inline-level elements of its parent markup language,
+ but it should not include ruby descendent elements. The following
+ parameter entity %NoRuby.content; can be used to redefine
+ those content models with minimum effort. It's defined as
+ '( #PCDATA )' by default.
+-->
+<!ENTITY % NoRuby.content "( #PCDATA )" >
+
+<!-- one or more digits (NUMBER) -->
+<!ENTITY % Number.datatype "CDATA" >
+
+<!-- ruby element ...................................... -->
+
+<!ENTITY % ruby.element "INCLUDE" >
+<![%ruby.element;[
+<!ENTITY % ruby.content
+ "( %Ruby.content.simple; %Ruby.content.complex; )"
+>
+<!ELEMENT %ruby.qname; %ruby.content; >
+<!-- end of ruby.element -->]]>
+
+<![%Ruby.complex;[
+<!-- rbc (ruby base component) element ................. -->
+
+<!ENTITY % rbc.element "INCLUDE" >
+<![%rbc.element;[
+<!ENTITY % rbc.content
+ "(%rb.qname;)+"
+>
+<!ELEMENT %rbc.qname; %rbc.content; >
+<!-- end of rbc.element -->]]>
+
+<!-- rtc (ruby text component) element ................. -->
+
+<!ENTITY % rtc.element "INCLUDE" >
+<![%rtc.element;[
+<!ENTITY % rtc.content
+ "(%rt.qname;)+"
+>
+<!ELEMENT %rtc.qname; %rtc.content; >
+<!-- end of rtc.element -->]]>
+]]>
+
+<!-- rb (ruby base) element ............................ -->
+
+<!ENTITY % rb.element "INCLUDE" >
+<![%rb.element;[
+<!-- %rb.content; uses %NoRuby.content; as its content model,
+ which is '( #PCDATA )' by default. It may be overridden
+ by other modules to allow other inline-level elements
+ of its parent markup language, but it should not include
+ ruby descendent elements.
+-->
+<!ENTITY % rb.content "%NoRuby.content;" >
+<!ELEMENT %rb.qname; %rb.content; >
+<!-- end of rb.element -->]]>
+
+<!-- rt (ruby text) element ............................ -->
+
+<!ENTITY % rt.element "INCLUDE" >
+<![%rt.element;[
+<!-- %rt.content; uses %NoRuby.content; as its content model,
+ which is '( #PCDATA )' by default. It may be overridden
+ by other modules to allow other inline-level elements
+ of its parent markup language, but it should not include
+ ruby descendent elements.
+-->
+<!ENTITY % rt.content "%NoRuby.content;" >
+
+<!ELEMENT %rt.qname; %rt.content; >
+<!-- end of rt.element -->]]>
+
+<!-- rbspan attribute is used for complex ruby only ...... -->
+<![%Ruby.complex;[
+<!ENTITY % rt.attlist "INCLUDE" >
+<![%rt.attlist;[
+<!ATTLIST %rt.qname;
+ rbspan %Number.datatype; "1"
+>
+<!-- end of rt.attlist -->]]>
+]]>
+
+<!-- rp (ruby parenthesis) element ..................... -->
+
+<![%Ruby.fallback;[
+<!ENTITY % rp.element "INCLUDE" >
+<![%rp.element;[
+<!ENTITY % rp.content
+ "( #PCDATA )"
+>
+<!ELEMENT %rp.qname; %rp.content; >
+<!-- end of rp.element -->]]>
+]]>
+
+<!-- Ruby Common Attributes
+
+ The following optional ATTLIST declarations provide an easy way
+ to define common attributes for ruby elements. These declarations
+ are ignored by default.
+
+ Ruby elements are intended to have common attributes of its
+ parent markup language. For example, if a markup language defines
+ common attributes as a parameter entity %attrs;, you may add
+ those attributes by just declaring the following parameter entities
+
+ <!ENTITY % Ruby.common.attlists "INCLUDE" >
+ <!ENTITY % Ruby.common.attrib "%attrs;" >
+
+ before including the Ruby module.
+-->
+
+<!ENTITY % Ruby.common.attlists "IGNORE" >
+<![%Ruby.common.attlists;[
+<!ENTITY % Ruby.common.attrib "" >
+
+<!-- common attributes for ruby ........................ -->
+
+<!ENTITY % Ruby.common.attlist "INCLUDE" >
+<![%Ruby.common.attlist;[
+<!ATTLIST %ruby.qname;
+ %Ruby.common.attrib;
+>
+<!-- end of Ruby.common.attlist -->]]>
+
+<![%Ruby.complex;[
+<!-- common attributes for rbc ......................... -->
+
+<!ENTITY % Rbc.common.attlist "INCLUDE" >
+<![%Rbc.common.attlist;[
+<!ATTLIST %rbc.qname;
+ %Ruby.common.attrib;
+>
+<!-- end of Rbc.common.attlist -->]]>
+
+<!-- common attributes for rtc ......................... -->
+
+<!ENTITY % Rtc.common.attlist "INCLUDE" >
+<![%Rtc.common.attlist;[
+<!ATTLIST %rtc.qname;
+ %Ruby.common.attrib;
+>
+<!-- end of Rtc.common.attlist -->]]>
+]]>
+
+<!-- common attributes for rb .......................... -->
+
+<!ENTITY % Rb.common.attlist "INCLUDE" >
+<![%Rb.common.attlist;[
+<!ATTLIST %rb.qname;
+ %Ruby.common.attrib;
+>
+<!-- end of Rb.common.attlist -->]]>
+
+<!-- common attributes for rt .......................... -->
+
+<!ENTITY % Rt.common.attlist "INCLUDE" >
+<![%Rt.common.attlist;[
+<!ATTLIST %rt.qname;
+ %Ruby.common.attrib;
+>
+<!-- end of Rt.common.attlist -->]]>
+
+<![%Ruby.fallback;[
+<!-- common attributes for rp .......................... -->
+
+<!ENTITY % Rp.common.attlist "INCLUDE" >
+<![%Rp.common.attlist;[
+<!ATTLIST %rp.qname;
+ %Ruby.common.attrib;
+>
+<!-- end of Rp.common.attlist -->]]>
+]]>
+]]>
+
+<!-- end of xhtml-ruby-1.mod -->
+]]>
+
+<!-- Presentation Module ........................................ -->
+<!ENTITY % xhtml-pres.module "INCLUDE" >
+<![%xhtml-pres.module;[
+<!ENTITY % xhtml-pres.mod
+ PUBLIC "-//W3C//ELEMENTS XHTML Presentation 1.0//EN"
+ "http://www.w3.org/MarkUp/DTD/xhtml-pres-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Presentation Module ............................................ -->
+<!-- file: xhtml-pres-1.mod
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+ Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $ SMI
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ELEMENTS XHTML Presentation 1.0//EN"
+ SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-pres-1.mod"
+
+ Revisions:
+ (none)
+ ....................................................................... -->
+
+<!-- Presentational Elements
+
+ This module defines elements and their attributes for
+ simple presentation-related markup.
+-->
+
+<!ENTITY % xhtml-inlpres.module "INCLUDE" >
+<![%xhtml-inlpres.module;[
+<!ENTITY % xhtml-inlpres.mod
+ PUBLIC "-//W3C//ELEMENTS XHTML Inline Presentation 1.0//EN"
+ "xhtml-inlpres-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Inline Presentation Module .................................... -->
+<!-- file: xhtml-inlpres-1.mod
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+ Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $ SMI
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ELEMENTS XHTML Inline Presentation 1.0//EN"
+ SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-inlpres-1.mod"
+
+ Revisions:
+ (none)
+ ....................................................................... -->
+
+<!-- Inline Presentational Elements
+
+ b, big, i, small, sub, sup, tt
+
+ This module declares the elements and their attributes used to
+ support inline-level presentational markup.
+-->
+
+<!ENTITY % b.element "INCLUDE" >
+<![%b.element;[
+<!ENTITY % b.content
+ "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % b.qname "b" >
+<!ELEMENT %b.qname; %b.content; >
+<!-- end of b.element -->]]>
+
+<!ENTITY % b.attlist "INCLUDE" >
+<![%b.attlist;[
+<!ATTLIST %b.qname;
+ %Common.attrib;
+>
+<!-- end of b.attlist -->]]>
+
+<!ENTITY % big.element "INCLUDE" >
+<![%big.element;[
+<!ENTITY % big.content
+ "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % big.qname "big" >
+<!ELEMENT %big.qname; %big.content; >
+<!-- end of big.element -->]]>
+
+<!ENTITY % big.attlist "INCLUDE" >
+<![%big.attlist;[
+<!ATTLIST %big.qname;
+ %Common.attrib;
+>
+<!-- end of big.attlist -->]]>
+
+<!ENTITY % i.element "INCLUDE" >
+<![%i.element;[
+<!ENTITY % i.content
+ "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % i.qname "i" >
+<!ELEMENT %i.qname; %i.content; >
+<!-- end of i.element -->]]>
+
+<!ENTITY % i.attlist "INCLUDE" >
+<![%i.attlist;[
+<!ATTLIST %i.qname;
+ %Common.attrib;
+>
+<!-- end of i.attlist -->]]>
+
+<!ENTITY % small.element "INCLUDE" >
+<![%small.element;[
+<!ENTITY % small.content
+ "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % small.qname "small" >
+<!ELEMENT %small.qname; %small.content; >
+<!-- end of small.element -->]]>
+
+<!ENTITY % small.attlist "INCLUDE" >
+<![%small.attlist;[
+<!ATTLIST %small.qname;
+ %Common.attrib;
+>
+<!-- end of small.attlist -->]]>
+
+<!ENTITY % sub.element "INCLUDE" >
+<![%sub.element;[
+<!ENTITY % sub.content
+ "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % sub.qname "sub" >
+<!ELEMENT %sub.qname; %sub.content; >
+<!-- end of sub.element -->]]>
+
+<!ENTITY % sub.attlist "INCLUDE" >
+<![%sub.attlist;[
+<!ATTLIST %sub.qname;
+ %Common.attrib;
+>
+<!-- end of sub.attlist -->]]>
+
+<!ENTITY % sup.element "INCLUDE" >
+<![%sup.element;[
+<!ENTITY % sup.content
+ "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % sup.qname "sup" >
+<!ELEMENT %sup.qname; %sup.content; >
+<!-- end of sup.element -->]]>
+
+<!ENTITY % sup.attlist "INCLUDE" >
+<![%sup.attlist;[
+<!ATTLIST %sup.qname;
+ %Common.attrib;
+>
+<!-- end of sup.attlist -->]]>
+
+<!ENTITY % tt.element "INCLUDE" >
+<![%tt.element;[
+<!ENTITY % tt.content
+ "( #PCDATA | %Inline.mix; )*"
+>
+<!ENTITY % tt.qname "tt" >
+<!ELEMENT %tt.qname; %tt.content; >
+<!-- end of tt.element -->]]>
+
+<!ENTITY % tt.attlist "INCLUDE" >
+<![%tt.attlist;[
+<!ATTLIST %tt.qname;
+ %Common.attrib;
+>
+<!-- end of tt.attlist -->]]>
+
+<!-- end of xhtml-inlpres-1.mod -->
+]]>
+
+<!ENTITY % xhtml-blkpres.module "INCLUDE" >
+<![%xhtml-blkpres.module;[
+<!ENTITY % xhtml-blkpres.mod
+ PUBLIC "-//W3C//ELEMENTS XHTML Block Presentation 1.0//EN"
+ "xhtml-blkpres-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Block Presentation Module ..................................... -->
+<!-- file: xhtml-blkpres-1.mod
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+ Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $ SMI
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ELEMENTS XHTML Block Presentation 1.0//EN"
+ SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-blkpres-1.mod"
+
+ Revisions:
+ (none)
+ ....................................................................... -->
+
+<!-- Block Presentational Elements
+
+ hr
+
+ This module declares the elements and their attributes used to
+ support block-level presentational markup.
+-->
+
+<!ENTITY % hr.element "INCLUDE" >
+<![%hr.element;[
+<!ENTITY % hr.content "EMPTY" >
+<!ENTITY % hr.qname "hr" >
+<!ELEMENT %hr.qname; %hr.content; >
+<!-- end of hr.element -->]]>
+
+<!ENTITY % hr.attlist "INCLUDE" >
+<![%hr.attlist;[
+<!ATTLIST %hr.qname;
+ %Common.attrib;
+>
+<!-- end of hr.attlist -->]]>
+
+<!-- end of xhtml-blkpres-1.mod -->
+]]>
+
+<!-- end of xhtml-pres-1.mod -->
+]]>
+
+<!-- Link Element Module ........................................ -->
+<!ENTITY % xhtml-link.module "INCLUDE" >
+<![%xhtml-link.module;[
+<!ENTITY % xhtml-link.mod
+ PUBLIC "-//W3C//ELEMENTS XHTML Link Element 1.0//EN"
+ "http://www.w3.org/MarkUp/DTD/xhtml-link-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Link Element Module ........................................... -->
+<!-- file: xhtml-link-1.mod
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+ Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $ SMI
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ELEMENTS XHTML Link Element 1.0//EN"
+ SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-link-1.mod"
+
+ Revisions:
+ (none)
+ ....................................................................... -->
+
+<!-- Link element
+
+ link
+
+ This module declares the link element type and its attributes,
+ which could (in principle) be used to define document-level links
+ to external resources such as:
+
+ a) for document specific toolbars/menus, e.g. start, contents,
+ previous, next, index, end, help
+ b) to link to a separate style sheet (rel="stylesheet")
+ c) to make a link to a script (rel="script")
+ d) by style sheets to control how collections of html nodes are
+ rendered into printed documents
+ e) to make a link to a printable version of this document
+ e.g. a postscript or pdf version (rel="alternate" media="print")
+-->
+
+<!-- link: Media-Independent Link ...................... -->
+
+<!ENTITY % link.element "INCLUDE" >
+<![%link.element;[
+<!ENTITY % link.content "EMPTY" >
+<!ENTITY % link.qname "link" >
+<!ELEMENT %link.qname; %link.content; >
+<!-- end of link.element -->]]>
+
+<!ENTITY % link.attlist "INCLUDE" >
+<![%link.attlist;[
+<!ATTLIST %link.qname;
+ %Common.attrib;
+ charset %Charset.datatype; #IMPLIED
+ href %URI.datatype; #IMPLIED
+ hreflang %LanguageCode.datatype; #IMPLIED
+ type %ContentType.datatype; #IMPLIED
+ rel %LinkTypes.datatype; #IMPLIED
+ rev %LinkTypes.datatype; #IMPLIED
+ media %MediaDesc.datatype; #IMPLIED
+>
+<!-- end of link.attlist -->]]>
+
+<!-- end of xhtml-link-1.mod -->
+]]>
+
+<!-- Document Metainformation Module ............................ -->
+<!ENTITY % xhtml-meta.module "INCLUDE" >
+<![%xhtml-meta.module;[
+<!ENTITY % xhtml-meta.mod
+ PUBLIC "-//W3C//ELEMENTS XHTML Metainformation 1.0//EN"
+ "http://www.w3.org/MarkUp/DTD/xhtml-meta-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Document Metainformation Module ............................... -->
+<!-- file: xhtml-meta-1.mod
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+ Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $ SMI
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ELEMENTS XHTML Metainformation 1.0//EN"
+ SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-meta-1.mod"
+
+ Revisions:
+ (none)
+ ....................................................................... -->
+
+<!-- Meta Information
+
+ meta
+
+ This module declares the meta element type and its attributes,
+ used to provide declarative document metainformation.
+-->
+
+<!-- meta: Generic Metainformation ..................... -->
+
+<!ENTITY % meta.element "INCLUDE" >
+<![%meta.element;[
+<!ENTITY % meta.content "EMPTY" >
+<!ENTITY % meta.qname "meta" >
+<!ELEMENT %meta.qname; %meta.content; >
+<!-- end of meta.element -->]]>
+
+<!ENTITY % meta.attlist "INCLUDE" >
+<![%meta.attlist;[
+<!ATTLIST %meta.qname;
+ %XHTML.xmlns.attrib;
+ %I18n.attrib;
+ http-equiv NMTOKEN #IMPLIED
+ name NMTOKEN #IMPLIED
+ content CDATA #REQUIRED
+ scheme CDATA #IMPLIED
+>
+<!-- end of meta.attlist -->]]>
+
+<!-- end of xhtml-meta-1.mod -->
+]]>
+
+<!-- Base Element Module ........................................ -->
+<!ENTITY % xhtml-base.module "INCLUDE" >
+<![%xhtml-base.module;[
+<!ENTITY % xhtml-base.mod
+ PUBLIC "-//W3C//ELEMENTS XHTML Base Element 1.0//EN"
+ "http://www.w3.org/MarkUp/DTD/xhtml-base-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Base Element Module ........................................... -->
+<!-- file: xhtml-base-1.mod
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+ Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $ SMI
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ELEMENTS XHTML Base Element 1.0//EN"
+ SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-base-1.mod"
+
+ Revisions:
+ (none)
+ ....................................................................... -->
+
+<!-- Base element
+
+ base
+
+ This module declares the base element type and its attributes,
+ used to define a base URI against which relative URIs in the
+ document will be resolved.
+
+ Note that this module also redeclares the content model for
+ the head element to include the base element.
+-->
+
+<!-- base: Document Base URI ........................... -->
+
+<!ENTITY % base.element "INCLUDE" >
+<![%base.element;[
+<!ENTITY % base.content "EMPTY" >
+<!ENTITY % base.qname "base" >
+<!ELEMENT %base.qname; %base.content; >
+<!-- end of base.element -->]]>
+
+<!ENTITY % base.attlist "INCLUDE" >
+<![%base.attlist;[
+<!ATTLIST %base.qname;
+ %XHTML.xmlns.attrib;
+ href %URI.datatype; #REQUIRED
+>
+<!-- end of base.attlist -->]]>
+
+<!ENTITY % head.content
+ "( %HeadOpts.mix;,
+ ( ( %title.qname;, %HeadOpts.mix;, ( %base.qname;, %HeadOpts.mix; )? )
+ | ( %base.qname;, %HeadOpts.mix;, ( %title.qname;, %HeadOpts.mix; ))))"
+>
+
+<!-- end of xhtml-base-1.mod -->
+]]>
+
+<!-- Scripting Module ........................................... -->
+<!ENTITY % xhtml-script.module "INCLUDE" >
+<![%xhtml-script.module;[
+<!ENTITY % xhtml-script.mod
+ PUBLIC "-//W3C//ELEMENTS XHTML Scripting 1.0//EN"
+ "http://www.w3.org/MarkUp/DTD/xhtml-script-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Document Scripting Module ..................................... -->
+<!-- file: xhtml-script-1.mod
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+ Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $ SMI
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ELEMENTS XHTML Scripting 1.0//EN"
+ SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-script-1.mod"
+
+ Revisions:
+ (none)
+ ....................................................................... -->
+
+<!-- Scripting
+
+ script, noscript
+
+ This module declares element types and attributes used to provide
+ support for executable scripts as well as an alternate content
+ container where scripts are not supported.
+-->
+
+<!-- script: Scripting Statement ....................... -->
+
+<!ENTITY % script.element "INCLUDE" >
+<![%script.element;[
+<!ENTITY % script.content "( #PCDATA )" >
+<!ENTITY % script.qname "script" >
+<!ELEMENT %script.qname; %script.content; >
+<!-- end of script.element -->]]>
+
+<!ENTITY % script.attlist "INCLUDE" >
+<![%script.attlist;[
+<!ATTLIST %script.qname;
+ %XHTML.xmlns.attrib;
+ %id.attrib;
+ charset %Charset.datatype; #IMPLIED
+ type %ContentType.datatype; #REQUIRED
+ src %URI.datatype; #IMPLIED
+ defer ( defer ) #IMPLIED
+>
+<!-- end of script.attlist -->]]>
+
+<!-- noscript: No-Script Alternate Content ............. -->
+
+<!ENTITY % noscript.element "INCLUDE" >
+<![%noscript.element;[
+<!ENTITY % noscript.content
+ "( %Block.mix; )+"
+>
+<!ENTITY % noscript.qname "noscript" >
+<!ELEMENT %noscript.qname; %noscript.content; >
+<!-- end of noscript.element -->]]>
+
+<!ENTITY % noscript.attlist "INCLUDE" >
+<![%noscript.attlist;[
+<!ATTLIST %noscript.qname;
+ %Common.attrib;
+>
+<!-- end of noscript.attlist -->]]>
+
+<!-- end of xhtml-script-1.mod -->
+]]>
+
+<!-- Style Sheets Module ......................................... -->
+<!ENTITY % xhtml-style.module "INCLUDE" >
+<![%xhtml-style.module;[
+<!ENTITY % xhtml-style.mod
+ PUBLIC "-//W3C//ELEMENTS XHTML Style Sheets 1.0//EN"
+ "http://www.w3.org/MarkUp/DTD/xhtml-style-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Document Style Sheet Module ................................... -->
+<!-- file: xhtml-style-1.mod
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+ Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $ SMI
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//DTD XHTML Style Sheets 1.0//EN"
+ SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-style-1.mod"
+
+ Revisions:
+ (none)
+ ....................................................................... -->
+
+<!-- Style Sheets
+
+ style
+
+ This module declares the style element type and its attributes,
+ used to embed style sheet information in the document head element.
+-->
+
+<!-- style: Style Sheet Information .................... -->
+
+<!ENTITY % style.element "INCLUDE" >
+<![%style.element;[
+<!ENTITY % style.content "( #PCDATA )" >
+<!ENTITY % style.qname "style" >
+<!ELEMENT %style.qname; %style.content; >
+<!-- end of style.element -->]]>
+
+<!ENTITY % style.attlist "INCLUDE" >
+<![%style.attlist;[
+<!ATTLIST %style.qname;
+ %XHTML.xmlns.attrib;
+ %id.attrib;
+ %title.attrib;
+ %I18n.attrib;
+ type %ContentType.datatype; #REQUIRED
+ media %MediaDesc.datatype; #IMPLIED
+>
+<!-- end of style.attlist -->]]>
+
+<!-- end of xhtml-style-1.mod -->
+]]>
+
+<!-- Image Module ............................................... -->
+<!ENTITY % xhtml-image.module "INCLUDE" >
+<![%xhtml-image.module;[
+<!ENTITY % xhtml-image.mod
+ PUBLIC "-//W3C//ELEMENTS XHTML Images 1.0//EN"
+ "http://www.w3.org/MarkUp/DTD/xhtml-image-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Images Module ................................................. -->
+<!-- file: xhtml-image-1.mod
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+ Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ Rovision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $ SMI
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ELEMENTS XHTML Images 1.0//EN"
+ SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-image-1.mod"
+
+ Revisions:
+ (none)
+ ....................................................................... -->
+
+<!-- Images
+
+ img
+
+ This module provides markup to support basic image embedding.
+-->
+
+<!-- To avoid problems with text-only UAs as well as to make
+ image content understandable and navigable to users of
+ non-visual UAs, you need to provide a description with
+ the 'alt' attribute, and avoid server-side image maps.
+-->
+
+<!ENTITY % img.element "INCLUDE" >
+<![%img.element;[
+<!ENTITY % img.content "EMPTY" >
+<!ENTITY % img.qname "img" >
+<!ELEMENT %img.qname; %img.content; >
+<!-- end of img.element -->]]>
+
+<!ENTITY % img.attlist "INCLUDE" >
+<![%img.attlist;[
+<!ATTLIST %img.qname;
+ %Common.attrib;
+ src %URI.datatype; #REQUIRED
+ alt %Text.datatype; #REQUIRED
+ longdesc %URI.datatype; #IMPLIED
+ height %Length.datatype; #IMPLIED
+ width %Length.datatype; #IMPLIED
+>
+<!-- end of img.attlist -->]]>
+
+<!-- end of xhtml-image-1.mod -->
+]]>
+
+<!-- Client-side Image Map Module ............................... -->
+<!ENTITY % xhtml-csismap.module "INCLUDE" >
+<![%xhtml-csismap.module;[
+<!ENTITY % xhtml-csismap.mod
+ PUBLIC "-//W3C//ELEMENTS XHTML Client-side Image Maps 1.0//EN"
+ "http://www.w3.org/MarkUp/DTD/xhtml-csismap-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Client-side Image Map Module .................................. -->
+<!-- file: xhtml-csismap-1.mod
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+ Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $ SMI
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ELEMENTS XHTML Client-side Image Maps 1.0//EN"
+ SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-csismap-1.mod"
+
+ Revisions:
+ (none)
+ ....................................................................... -->
+
+<!-- Client-side Image Maps
+
+ area, map
+
+ This module declares elements and attributes to support client-side
+ image maps. This requires that the Image Module (or a module
+ declaring the img element type) be included in the DTD.
+
+ These can be placed in the same document or grouped in a
+ separate document, although the latter isn't widely supported
+-->
+
+<!ENTITY % area.element "INCLUDE" >
+<![%area.element;[
+<!ENTITY % area.content "EMPTY" >
+<!ENTITY % area.qname "area" >
+<!ELEMENT %area.qname; %area.content; >
+<!-- end of area.element -->]]>
+
+<!ENTITY % Shape.datatype "( rect | circle | poly | default )">
+<!ENTITY % Coords.datatype "CDATA" >
+
+<!ENTITY % area.attlist "INCLUDE" >
+<![%area.attlist;[
+<!ATTLIST %area.qname;
+ %Common.attrib;
+ href %URI.datatype; #IMPLIED
+ shape %Shape.datatype; 'rect'
+ coords %Coords.datatype; #IMPLIED
+ nohref ( nohref ) #IMPLIED
+ alt %Text.datatype; #REQUIRED
+ tabindex %Number.datatype; #IMPLIED
+ accesskey %Character.datatype; #IMPLIED
+>
+<!-- end of area.attlist -->]]>
+
+<!-- modify anchor attribute definition list
+ to allow for client-side image maps
+-->
+<!ATTLIST %a.qname;
+ shape %Shape.datatype; 'rect'
+ coords %Coords.datatype; #IMPLIED
+>
+
+<!-- modify img attribute definition list
+ to allow for client-side image maps
+-->
+<!ATTLIST %img.qname;
+ usemap IDREF #IMPLIED
+>
+
+<!-- modify form input attribute definition list
+ to allow for client-side image maps
+-->
+<!ATTLIST %input.qname;
+ usemap IDREF #IMPLIED
+>
+
+<!-- modify object attribute definition list
+ to allow for client-side image maps
+-->
+<!ATTLIST %object.qname;
+ usemap IDREF #IMPLIED
+>
+
+<!-- 'usemap' points to the 'id' attribute of a <map> element,
+ which must be in the same document; support for external
+ document maps was not widely supported in HTML and is
+ eliminated in XHTML.
+
+ It is considered an error for the element pointed to by
+ a usemap IDREF to occur in anything but a <map> element.
+-->
+
+<!ENTITY % map.element "INCLUDE" >
+<![%map.element;[
+<!ENTITY % map.content
+ "(( %Block.mix; ) | %area.qname; )+"
+>
+<!ENTITY % map.qname "map" >
+<!ELEMENT %map.qname; %map.content; >
+<!-- end of map.element -->]]>
+
+<!ENTITY % map.attlist "INCLUDE" >
+<![%map.attlist;[
+<!ATTLIST %map.qname;
+ %XHTML.xmlns.attrib;
+ id ID #REQUIRED
+ %class.attrib;
+ %title.attrib;
+ %Core.extra.attrib;
+ %I18n.attrib;
+ %Events.attrib;
+>
+<!-- end of map.attlist -->]]>
+
+<!-- end of xhtml-csismap-1.mod -->
+]]>
+
+<!-- Server-side Image Map Module ............................... -->
+<!ENTITY % xhtml-ssismap.module "INCLUDE" >
+<![%xhtml-ssismap.module;[
+<!ENTITY % xhtml-ssismap.mod
+ PUBLIC "-//W3C//ELEMENTS XHTML Server-side Image Maps 1.0//EN"
+ "http://www.w3.org/MarkUp/DTD/xhtml-ssismap-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Server-side Image Map Module .................................. -->
+<!-- file: xhtml-ssismap-1.mod
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+ Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $ SMI
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ELEMENTS XHTML Server-side Image Maps 1.0//EN"
+ SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-ssismap-1.mod"
+
+ Revisions:
+#2000-10-22: added declaration for 'ismap' on <input>
+ ....................................................................... -->
+
+<!-- Server-side Image Maps
+
+ This adds the 'ismap' attribute to the img and input elements
+ to support server-side processing of a user selection.
+-->
+
+<!ATTLIST %img.qname;
+ ismap ( ismap ) #IMPLIED
+>
+
+<!ATTLIST %input.qname;
+ ismap ( ismap ) #IMPLIED
+>
+
+<!-- end of xhtml-ssismap-1.mod -->
+]]>
+
+<!-- Param Element Module ....................................... -->
+<!ENTITY % xhtml-param.module "INCLUDE" >
+<![%xhtml-param.module;[
+<!ENTITY % xhtml-param.mod
+ PUBLIC "-//W3C//ELEMENTS XHTML Param Element 1.0//EN"
+ "http://www.w3.org/MarkUp/DTD/xhtml-param-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Param Element Module ..................................... -->
+<!-- file: xhtml-param-1.mod
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+ Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $ SMI
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ELEMENTS XHTML Param Element 1.0//EN"
+ SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-param-1.mod"
+
+ Revisions:
+ (none)
+ ....................................................................... -->
+
+<!-- Parameters for Java Applets and Embedded Objects
+
+ param
+
+ This module provides declarations for the param element,
+ used to provide named property values for the applet
+ and object elements.
+-->
+
+<!-- param: Named Property Value ....................... -->
+
+<!ENTITY % param.element "INCLUDE" >
+<![%param.element;[
+<!ENTITY % param.content "EMPTY" >
+<!ENTITY % param.qname "param" >
+<!ELEMENT %param.qname; %param.content; >
+<!-- end of param.element -->]]>
+
+<!ENTITY % param.attlist "INCLUDE" >
+<![%param.attlist;[
+<!ATTLIST %param.qname;
+ %XHTML.xmlns.attrib;
+ %id.attrib;
+ name CDATA #REQUIRED
+ value CDATA #IMPLIED
+ valuetype ( data | ref | object ) 'data'
+ type %ContentType.datatype; #IMPLIED
+>
+<!-- end of param.attlist -->]]>
+
+<!-- end of xhtml-param-1.mod -->
+]]>
+
+<!-- Embedded Object Module ..................................... -->
+<!ENTITY % xhtml-object.module "INCLUDE" >
+<![%xhtml-object.module;[
+<!ENTITY % xhtml-object.mod
+ PUBLIC "-//W3C//ELEMENTS XHTML Embedded Object 1.0//EN"
+ "http://www.w3.org/MarkUp/DTD/xhtml-object-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Embedded Object Module ........................................ -->
+<!-- file: xhtml-object-1.mod
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+ Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $ SMI
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ELEMENTS XHTML Embedded Object 1.0//EN"
+ SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-object-1.mod"
+
+ Revisions:
+ (none)
+ ....................................................................... -->
+
+<!-- Embedded Objects
+
+ object
+
+ This module declares the object element type and its attributes, used
+ to embed external objects as part of XHTML pages. In the document,
+ place param elements prior to other content within the object element.
+
+ Note that use of this module requires instantiation of the Param
+ Element Module.
+-->
+
+<!-- object: Generic Embedded Object ................... -->
+
+<!ENTITY % object.element "INCLUDE" >
+<![%object.element;[
+<!ENTITY % object.content
+ "( #PCDATA | %Flow.mix; | %param.qname; )*"
+>
+<!ENTITY % object.qname "object" >
+<!ELEMENT %object.qname; %object.content; >
+<!-- end of object.element -->]]>
+
+<!ENTITY % object.attlist "INCLUDE" >
+<![%object.attlist;[
+<!ATTLIST %object.qname;
+ %Common.attrib;
+ declare ( declare ) #IMPLIED
+ classid %URI.datatype; #IMPLIED
+ codebase %URI.datatype; #IMPLIED
+ data %URI.datatype; #IMPLIED
+ type %ContentType.datatype; #IMPLIED
+ codetype %ContentType.datatype; #IMPLIED
+ archive %URIs.datatype; #IMPLIED
+ standby %Text.datatype; #IMPLIED
+ height %Length.datatype; #IMPLIED
+ width %Length.datatype; #IMPLIED
+ name CDATA #IMPLIED
+ tabindex %Number.datatype; #IMPLIED
+>
+<!-- end of object.attlist -->]]>
+
+<!-- end of xhtml-object-1.mod -->
+]]>
+
+<!-- Tables Module ............................................... -->
+<!ENTITY % xhtml-table.module "INCLUDE" >
+<![%xhtml-table.module;[
+<!ENTITY % xhtml-table.mod
+ PUBLIC "-//W3C//ELEMENTS XHTML Tables 1.0//EN"
+ "http://www.w3.org/MarkUp/DTD/xhtml-table-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Table Module .................................................. -->
+<!-- file: xhtml-table-1.mod
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+ Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $ SMI
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ELEMENTS XHTML Tables 1.0//EN"
+ SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-table-1.mod"
+
+ Revisions:
+ (none)
+ ....................................................................... -->
+
+<!-- Tables
+
+ table, caption, thead, tfoot, tbody, colgroup, col, tr, th, td
+
+ This module declares element types and attributes used to provide
+ table markup similar to HTML 4, including features that enable
+ better accessibility for non-visual user agents.
+-->
+
+<!-- declare qualified element type names:
+-->
+<!ENTITY % table.qname "table" >
+<!ENTITY % caption.qname "caption" >
+<!ENTITY % thead.qname "thead" >
+<!ENTITY % tfoot.qname "tfoot" >
+<!ENTITY % tbody.qname "tbody" >
+<!ENTITY % colgroup.qname "colgroup" >
+<!ENTITY % col.qname "col" >
+<!ENTITY % tr.qname "tr" >
+<!ENTITY % th.qname "th" >
+<!ENTITY % td.qname "td" >
+
+<!-- The frame attribute specifies which parts of the frame around
+ the table should be rendered. The values are not the same as
+ CALS to avoid a name clash with the valign attribute.
+-->
+<!ENTITY % frame.attrib
+ "frame ( void
+ | above
+ | below
+ | hsides
+ | lhs
+ | rhs
+ | vsides
+ | box
+ | border ) #IMPLIED"
+>
+
+<!-- The rules attribute defines which rules to draw between cells:
+
+ If rules is absent then assume:
+
+ "none" if border is absent or border="0" otherwise "all"
+-->
+<!ENTITY % rules.attrib
+ "rules ( none
+ | groups
+ | rows
+ | cols
+ | all ) #IMPLIED"
+>
+
+<!-- horizontal alignment attributes for cell contents
+-->
+<!ENTITY % CellHAlign.attrib
+ "align ( left
+ | center
+ | right
+ | justify
+ | char ) #IMPLIED
+ char %Character.datatype; #IMPLIED
+ charoff %Length.datatype; #IMPLIED"
+>
+
+<!-- vertical alignment attribute for cell contents
+-->
+<!ENTITY % CellVAlign.attrib
+ "valign ( top
+ | middle
+ | bottom
+ | baseline ) #IMPLIED"
+>
+
+<!-- scope is simpler than axes attribute for common tables
+-->
+<!ENTITY % scope.attrib
+ "scope ( row
+ | col
+ | rowgroup
+ | colgroup ) #IMPLIED"
+>
+
+<!-- table: Table Element .............................. -->
+
+<!ENTITY % table.element "INCLUDE" >
+<![%table.element;[
+<!ENTITY % table.content
+ "( %caption.qname;?, ( %col.qname;* | %colgroup.qname;* ),
+ (( %thead.qname;?, %tfoot.qname;?, %tbody.qname;+ ) | ( %tr.qname;+ )))"
+>
+<!ELEMENT %table.qname; %table.content; >
+<!-- end of table.element -->]]>
+
+<!ENTITY % table.attlist "INCLUDE" >
+<![%table.attlist;[
+<!ATTLIST %table.qname;
+ %Common.attrib;
+ summary %Text.datatype; #IMPLIED
+ width %Length.datatype; #IMPLIED
+ border %Pixels.datatype; #IMPLIED
+ %frame.attrib;
+ %rules.attrib;
+ cellspacing %Length.datatype; #IMPLIED
+ cellpadding %Length.datatype; #IMPLIED
+>
+<!-- end of table.attlist -->]]>
+
+<!-- caption: Table Caption ............................ -->
+
+<!ENTITY % caption.element "INCLUDE" >
+<![%caption.element;[
+<!ENTITY % caption.content
+ "( #PCDATA | %Inline.mix; )*"
+>
+<!ELEMENT %caption.qname; %caption.content; >
+<!-- end of caption.element -->]]>
+
+<!ENTITY % caption.attlist "INCLUDE" >
+<![%caption.attlist;[
+<!ATTLIST %caption.qname;
+ %Common.attrib;
+>
+<!-- end of caption.attlist -->]]>
+
+<!-- thead: Table Header ............................... -->
+
+<!-- Use thead to duplicate headers when breaking table
+ across page boundaries, or for static headers when
+ tbody sections are rendered in scrolling panel.
+-->
+
+<!ENTITY % thead.element "INCLUDE" >
+<![%thead.element;[
+<!ENTITY % thead.content "( %tr.qname; )+" >
+<!ELEMENT %thead.qname; %thead.content; >
+<!-- end of thead.element -->]]>
+
+<!ENTITY % thead.attlist "INCLUDE" >
+<![%thead.attlist;[
+<!ATTLIST %thead.qname;
+ %Common.attrib;
+ %CellHAlign.attrib;
+ %CellVAlign.attrib;
+>
+<!-- end of thead.attlist -->]]>
+
+<!-- tfoot: Table Footer ............................... -->
+
+<!-- Use tfoot to duplicate footers when breaking table
+ across page boundaries, or for static footers when
+ tbody sections are rendered in scrolling panel.
+-->
+
+<!ENTITY % tfoot.element "INCLUDE" >
+<![%tfoot.element;[
+<!ENTITY % tfoot.content "( %tr.qname; )+" >
+<!ELEMENT %tfoot.qname; %tfoot.content; >
+<!-- end of tfoot.element -->]]>
+
+<!ENTITY % tfoot.attlist "INCLUDE" >
+<![%tfoot.attlist;[
+<!ATTLIST %tfoot.qname;
+ %Common.attrib;
+ %CellHAlign.attrib;
+ %CellVAlign.attrib;
+>
+<!-- end of tfoot.attlist -->]]>
+
+<!-- tbody: Table Body ................................. -->
+
+<!-- Use multiple tbody sections when rules are needed
+ between groups of table rows.
+-->
+
+<!ENTITY % tbody.element "INCLUDE" >
+<![%tbody.element;[
+<!ENTITY % tbody.content "( %tr.qname; )+" >
+<!ELEMENT %tbody.qname; %tbody.content; >
+<!-- end of tbody.element -->]]>
+
+<!ENTITY % tbody.attlist "INCLUDE" >
+<![%tbody.attlist;[
+<!ATTLIST %tbody.qname;
+ %Common.attrib;
+ %CellHAlign.attrib;
+ %CellVAlign.attrib;
+>
+<!-- end of tbody.attlist -->]]>
+
+<!-- colgroup: Table Column Group ...................... -->
+
+<!-- colgroup groups a set of col elements. It allows you
+ to group several semantically-related columns together.
+-->
+
+<!ENTITY % colgroup.element "INCLUDE" >
+<![%colgroup.element;[
+<!ENTITY % colgroup.content "( %col.qname; )*" >
+<!ELEMENT %colgroup.qname; %colgroup.content; >
+<!-- end of colgroup.element -->]]>
+
+<!ENTITY % colgroup.attlist "INCLUDE" >
+<![%colgroup.attlist;[
+<!ATTLIST %colgroup.qname;
+ %Common.attrib;
+ span %Number.datatype; '1'
+ width %MultiLength.datatype; #IMPLIED
+ %CellHAlign.attrib;
+ %CellVAlign.attrib;
+>
+<!-- end of colgroup.attlist -->]]>
+
+<!-- col: Table Column ................................. -->
+
+<!-- col elements define the alignment properties for
+ cells in one or more columns.
+
+ The width attribute specifies the width of the
+ columns, e.g.
+
+ width="64" width in screen pixels
+ width="0.5*" relative width of 0.5
+
+ The span attribute causes the attributes of one
+ col element to apply to more than one column.
+-->
+
+<!ENTITY % col.element "INCLUDE" >
+<![%col.element;[
+<!ENTITY % col.content "EMPTY" >
+<!ELEMENT %col.qname; %col.content; >
+<!-- end of col.element -->]]>
+
+<!ENTITY % col.attlist "INCLUDE" >
+<![%col.attlist;[
+<!ATTLIST %col.qname;
+ %Common.attrib;
+ span %Number.datatype; '1'
+ width %MultiLength.datatype; #IMPLIED
+ %CellHAlign.attrib;
+ %CellVAlign.attrib;
+>
+<!-- end of col.attlist -->]]>
+
+<!-- tr: Table Row ..................................... -->
+
+<!ENTITY % tr.element "INCLUDE" >
+<![%tr.element;[
+<!ENTITY % tr.content "( %th.qname; | %td.qname; )+" >
+<!ELEMENT %tr.qname; %tr.content; >
+<!-- end of tr.element -->]]>
+
+<!ENTITY % tr.attlist "INCLUDE" >
+<![%tr.attlist;[
+<!ATTLIST %tr.qname;
+ %Common.attrib;
+ %CellHAlign.attrib;
+ %CellVAlign.attrib;
+>
+<!-- end of tr.attlist -->]]>
+
+<!-- th: Table Header Cell ............................. -->
+
+<!-- th is for header cells, td for data,
+ but for cells acting as both use td
+-->
+
+<!ENTITY % th.element "INCLUDE" >
+<![%th.element;[
+<!ENTITY % th.content
+ "( #PCDATA | %Flow.mix; )*"
+>
+<!ELEMENT %th.qname; %th.content; >
+<!-- end of th.element -->]]>
+
+<!ENTITY % th.attlist "INCLUDE" >
+<![%th.attlist;[
+<!ATTLIST %th.qname;
+ %Common.attrib;
+ abbr %Text.datatype; #IMPLIED
+ axis CDATA #IMPLIED
+ headers IDREFS #IMPLIED
+ %scope.attrib;
+ rowspan %Number.datatype; '1'
+ colspan %Number.datatype; '1'
+ %CellHAlign.attrib;
+ %CellVAlign.attrib;
+>
+<!-- end of th.attlist -->]]>
+
+<!-- td: Table Data Cell ............................... -->
+
+<!ENTITY % td.element "INCLUDE" >
+<![%td.element;[
+<!ENTITY % td.content
+ "( #PCDATA | %Flow.mix; )*"
+>
+<!ELEMENT %td.qname; %td.content; >
+<!-- end of td.element -->]]>
+
+<!ENTITY % td.attlist "INCLUDE" >
+<![%td.attlist;[
+<!ATTLIST %td.qname;
+ %Common.attrib;
+ abbr %Text.datatype; #IMPLIED
+ axis CDATA #IMPLIED
+ headers IDREFS #IMPLIED
+ %scope.attrib;
+ rowspan %Number.datatype; '1'
+ colspan %Number.datatype; '1'
+ %CellHAlign.attrib;
+ %CellVAlign.attrib;
+>
+<!-- end of td.attlist -->]]>
+
+<!-- end of xhtml-table-1.mod -->
+]]>
+
+<!-- Forms Module ............................................... -->
+<!ENTITY % xhtml-form.module "INCLUDE" >
+<![%xhtml-form.module;[
+<!ENTITY % xhtml-form.mod
+ PUBLIC "-//W3C//ELEMENTS XHTML Forms 1.0//EN"
+ "http://www.w3.org/MarkUp/DTD/xhtml-form-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Forms Module .................................................. -->
+<!-- file: xhtml-form-1.mod
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+ Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $ SMI
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ELEMENTS XHTML Forms 1.0//EN"
+ SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-form-1.mod"
+
+ Revisions:
+ (none)
+ ....................................................................... -->
+
+<!-- Forms
+
+ form, label, input, select, optgroup, option,
+ textarea, fieldset, legend, button
+
+ This module declares markup to provide support for online
+ forms, based on the features found in HTML 4 forms.
+-->
+
+<!-- declare qualified element type names:
+-->
+<!ENTITY % form.qname "form" >
+<!ENTITY % label.qname "label" >
+<!ENTITY % input.qname "input" >
+<!ENTITY % select.qname "select" >
+<!ENTITY % optgroup.qname "optgroup" >
+<!ENTITY % option.qname "option" >
+<!ENTITY % textarea.qname "textarea" >
+<!ENTITY % fieldset.qname "fieldset" >
+<!ENTITY % legend.qname "legend" >
+<!ENTITY % button.qname "button" >
+
+<!-- %BlkNoForm.mix; includes all non-form block elements,
+ plus %Misc.class;
+-->
+<!ENTITY % BlkNoForm.mix
+ "%Heading.class;
+ | %List.class;
+ | %BlkStruct.class;
+ %BlkPhras.class;
+ %BlkPres.class;
+ %Table.class;
+ %Block.extra;
+ %Misc.class;"
+>
+
+<!-- form: Form Element ................................ -->
+
+<!ENTITY % form.element "INCLUDE" >
+<![%form.element;[
+<!ENTITY % form.content
+ "( %BlkNoForm.mix;
+ | %fieldset.qname; )+"
+>
+<!ELEMENT %form.qname; %form.content; >
+<!-- end of form.element -->]]>
+
+<!ENTITY % form.attlist "INCLUDE" >
+<![%form.attlist;[
+<!ATTLIST %form.qname;
+ %Common.attrib;
+ action %URI.datatype; #REQUIRED
+ method ( get | post ) 'get'
+ enctype %ContentType.datatype; 'application/x-www-form-urlencoded'
+ accept-charset %Charsets.datatype; #IMPLIED
+ accept %ContentTypes.datatype; #IMPLIED
+>
+<!-- end of form.attlist -->]]>
+
+<!-- label: Form Field Label Text ...................... -->
+
+<!-- Each label must not contain more than ONE field
+-->
+
+<!ENTITY % label.element "INCLUDE" >
+<![%label.element;[
+<!ENTITY % label.content
+ "( #PCDATA
+ | %input.qname; | %select.qname; | %textarea.qname; | %button.qname;
+ | %InlStruct.class;
+ %InlPhras.class;
+ %I18n.class;
+ %InlPres.class;
+ %Anchor.class;
+ %InlSpecial.class;
+ %Inline.extra;
+ %Misc.class; )*"
+>
+<!ELEMENT %label.qname; %label.content; >
+<!-- end of label.element -->]]>
+
+<!ENTITY % label.attlist "INCLUDE" >
+<![%label.attlist;[
+<!ATTLIST %label.qname;
+ %Common.attrib;
+ for IDREF #IMPLIED
+ accesskey %Character.datatype; #IMPLIED
+>
+<!-- end of label.attlist -->]]>
+
+<!-- input: Form Control ............................... -->
+
+<!ENTITY % input.element "INCLUDE" >
+<![%input.element;[
+<!ENTITY % input.content "EMPTY" >
+<!ELEMENT %input.qname; %input.content; >
+<!-- end of input.element -->]]>
+
+<!ENTITY % input.attlist "INCLUDE" >
+<![%input.attlist;[
+<!ENTITY % InputType.class
+ "( text | password | checkbox | radio | submit
+ | reset | file | hidden | image | button )"
+>
+<!-- attribute 'name' required for all but submit & reset
+-->
+<!ATTLIST %input.qname;
+ %Common.attrib;
+ type %InputType.class; 'text'
+ name CDATA #IMPLIED
+ value CDATA #IMPLIED
+ checked ( checked ) #IMPLIED
+ disabled ( disabled ) #IMPLIED
+ readonly ( readonly ) #IMPLIED
+ size %Number.datatype; #IMPLIED
+ maxlength %Number.datatype; #IMPLIED
+ src %URI.datatype; #IMPLIED
+ alt %Text.datatype; #IMPLIED
+ tabindex %Number.datatype; #IMPLIED
+ accesskey %Character.datatype; #IMPLIED
+ accept %ContentTypes.datatype; #IMPLIED
+>
+<!-- end of input.attlist -->]]>
+
+<!-- select: Option Selector ........................... -->
+
+<!ENTITY % select.element "INCLUDE" >
+<![%select.element;[
+<!ENTITY % select.content
+ "( %optgroup.qname; | %option.qname; )+"
+>
+<!ELEMENT %select.qname; %select.content; >
+<!-- end of select.element -->]]>
+
+<!ENTITY % select.attlist "INCLUDE" >
+<![%select.attlist;[
+<!ATTLIST %select.qname;
+ %Common.attrib;
+ name CDATA #IMPLIED
+ size %Number.datatype; #IMPLIED
+ multiple ( multiple ) #IMPLIED
+ disabled ( disabled ) #IMPLIED
+ tabindex %Number.datatype; #IMPLIED
+>
+<!-- end of select.attlist -->]]>
+
+<!-- optgroup: Option Group ............................ -->
+
+<!ENTITY % optgroup.element "INCLUDE" >
+<![%optgroup.element;[
+<!ENTITY % optgroup.content "( %option.qname; )+" >
+<!ELEMENT %optgroup.qname; %optgroup.content; >
+<!-- end of optgroup.element -->]]>
+
+<!ENTITY % optgroup.attlist "INCLUDE" >
+<![%optgroup.attlist;[
+<!ATTLIST %optgroup.qname;
+ %Common.attrib;
+ disabled ( disabled ) #IMPLIED
+ label %Text.datatype; #REQUIRED
+>
+<!-- end of optgroup.attlist -->]]>
+
+<!-- option: Selectable Choice ......................... -->
+
+<!ENTITY % option.element "INCLUDE" >
+<![%option.element;[
+<!ENTITY % option.content "( #PCDATA )" >
+<!ELEMENT %option.qname; %option.content; >
+<!-- end of option.element -->]]>
+
+<!ENTITY % option.attlist "INCLUDE" >
+<![%option.attlist;[
+<!ATTLIST %option.qname;
+ %Common.attrib;
+ selected ( selected ) #IMPLIED
+ disabled ( disabled ) #IMPLIED
+ label %Text.datatype; #IMPLIED
+ value CDATA #IMPLIED
+>
+<!-- end of option.attlist -->]]>
+
+<!-- textarea: Multi-Line Text Field ................... -->
+
+<!ENTITY % textarea.element "INCLUDE" >
+<![%textarea.element;[
+<!ENTITY % textarea.content "( #PCDATA )" >
+<!ELEMENT %textarea.qname; %textarea.content; >
+<!-- end of textarea.element -->]]>
+
+<!ENTITY % textarea.attlist "INCLUDE" >
+<![%textarea.attlist;[
+<!ATTLIST %textarea.qname;
+ %Common.attrib;
+ name CDATA #IMPLIED
+ rows %Number.datatype; #REQUIRED
+ cols %Number.datatype; #REQUIRED
+ disabled ( disabled ) #IMPLIED
+ readonly ( readonly ) #IMPLIED
+ tabindex %Number.datatype; #IMPLIED
+ accesskey %Character.datatype; #IMPLIED
+>
+<!-- end of textarea.attlist -->]]>
+
+<!-- fieldset: Form Control Group ...................... -->
+
+<!-- #PCDATA is to solve the mixed content problem,
+ per specification only whitespace is allowed
+-->
+
+<!ENTITY % fieldset.element "INCLUDE" >
+<![%fieldset.element;[
+<!ENTITY % fieldset.content
+ "( #PCDATA | %legend.qname; | %Flow.mix; )*"
+>
+<!ELEMENT %fieldset.qname; %fieldset.content; >
+<!-- end of fieldset.element -->]]>
+
+<!ENTITY % fieldset.attlist "INCLUDE" >
+<![%fieldset.attlist;[
+<!ATTLIST %fieldset.qname;
+ %Common.attrib;
+>
+<!-- end of fieldset.attlist -->]]>
+
+<!-- legend: Fieldset Legend ........................... -->
+
+<!ENTITY % legend.element "INCLUDE" >
+<![%legend.element;[
+<!ENTITY % legend.content
+ "( #PCDATA | %Inline.mix; )*"
+>
+<!ELEMENT %legend.qname; %legend.content; >
+<!-- end of legend.element -->]]>
+
+<!ENTITY % legend.attlist "INCLUDE" >
+<![%legend.attlist;[
+<!ATTLIST %legend.qname;
+ %Common.attrib;
+ accesskey %Character.datatype; #IMPLIED
+>
+<!-- end of legend.attlist -->]]>
+
+<!-- button: Push Button ............................... -->
+
+<!ENTITY % button.element "INCLUDE" >
+<![%button.element;[
+<!ENTITY % button.content
+ "( #PCDATA
+ | %BlkNoForm.mix;
+ | %InlStruct.class;
+ %InlPhras.class;
+ %InlPres.class;
+ %I18n.class;
+ %InlSpecial.class;
+ %Inline.extra; )*"
+>
+<!ELEMENT %button.qname; %button.content; >
+<!-- end of button.element -->]]>
+
+<!ENTITY % button.attlist "INCLUDE" >
+<![%button.attlist;[
+<!ATTLIST %button.qname;
+ %Common.attrib;
+ name CDATA #IMPLIED
+ value CDATA #IMPLIED
+ type ( button | submit | reset ) 'submit'
+ disabled ( disabled ) #IMPLIED
+ tabindex %Number.datatype; #IMPLIED
+ accesskey %Character.datatype; #IMPLIED
+>
+<!-- end of button.attlist -->]]>
+
+<!-- end of xhtml-form-1.mod -->
+]]>
+
+<!-- Target Attribute Module .................................... -->
+<!ENTITY % xhtml-target.module "INCLUDE" >
+<![%xhtml-target.module;[
+<!ENTITY % xhtml-target.mod
+ PUBLIC "-//W3C//ELEMENTS XHTML Target 1.0//EN"
+ "http://www.w3.org/MarkUp/DTD/xhtml-target-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Target Module ................................................. -->
+<!-- file: xhtml-target-1.mod
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+ Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $ SMI
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ELEMENTS XHTML Target 1.0//EN"
+ SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-target-1.mod"
+
+ Revisions:
+ (none)
+ ....................................................................... -->
+
+<!-- Target
+
+ target
+
+ This module declares the 'target' attribute used for opening windows
+-->
+
+<!-- render in this frame -->
+<!ENTITY % FrameTarget.datatype "CDATA" >
+
+<!-- add 'target' attribute to 'a' element -->
+<!ATTLIST %a.qname;
+ target %FrameTarget.datatype; #IMPLIED
+>
+
+<!-- add 'target' attribute to 'area' element -->
+<!ATTLIST %area.qname;
+ target %FrameTarget.datatype; #IMPLIED
+>
+
+<!-- add 'target' attribute to 'link' element -->
+<!ATTLIST %link.qname;
+ target %FrameTarget.datatype; #IMPLIED
+>
+
+<!-- add 'target' attribute to 'form' element -->
+<!ATTLIST %form.qname;
+ target %FrameTarget.datatype; #IMPLIED
+>
+
+<!-- add 'target' attribute to 'base' element -->
+<!ATTLIST %base.qname;
+ target %FrameTarget.datatype; #IMPLIED
+>
+
+<!-- end of xhtml-target-1.mod -->
+]]>
+
+<!-- Legacy Markup ............................................... -->
+<!ENTITY % xhtml-legacy.module "IGNORE" >
+<![%xhtml-legacy.module;[
+<!ENTITY % xhtml-legacy.mod
+ PUBLIC "-//W3C//ELEMENTS XHTML Legacy Markup 1.0//EN"
+ "http://www.w3.org/MarkUp/DTD/xhtml-legacy-1.mod" >
+%xhtml-legacy.mod;]]>
+
+<!-- Document Structure Module (required) ....................... -->
+<!ENTITY % xhtml-struct.module "INCLUDE" >
+<![%xhtml-struct.module;[
+<!ENTITY % xhtml-struct.mod
+ PUBLIC "-//W3C//ELEMENTS XHTML Document Structure 1.0//EN"
+ "http://www.w3.org/MarkUp/DTD/xhtml-struct-1.mod" >
+<!-- ...................................................................... -->
+<!-- XHTML Structure Module .............................................. -->
+<!-- file: xhtml-struct-1.mod
+
+ This is XHTML, a reformulation of HTML as a modular XML application.
+ Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ Revision: $Id: xhtml11-flat.dtd,v 1.1 2008-01-22 18:15:32 ace Exp $ SMI
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ELEMENTS XHTML Document Structure 1.0//EN"
+ SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-struct-1.mod"
+
+ Revisions:
+ (none)
+ ....................................................................... -->
+
+<!-- Document Structure
+
+ title, head, body, html
+
+ The Structure Module defines the major structural elements and
+ their attributes.
+
+ Note that the content model of the head element type is redeclared
+ when the Base Module is included in the DTD.
+
+ The parameter entity containing the XML namespace URI value used
+ for XHTML is '%XHTML.xmlns;', defined in the Qualified Names module.
+-->
+
+<!-- title: Document Title ............................. -->
+
+<!-- The title element is not considered part of the flow of text.
+ It should be displayed, for example as the page header or
+ window title. Exactly one title is required per document.
+-->
+
+<!ENTITY % title.element "INCLUDE" >
+<![%title.element;[
+<!ENTITY % title.content "( #PCDATA )" >
+<!ENTITY % title.qname "title" >
+<!ELEMENT %title.qname; %title.content; >
+<!-- end of title.element -->]]>
+
+<!ENTITY % title.attlist "INCLUDE" >
+<![%title.attlist;[
+<!ATTLIST %title.qname;
+ %XHTML.xmlns.attrib;
+ %I18n.attrib;
+>
+<!-- end of title.attlist -->]]>
+
+<!-- head: Document Head ............................... -->
+
+<!ENTITY % head.element "INCLUDE" >
+<![%head.element;[
+<!ENTITY % head.content
+ "( %HeadOpts.mix;, %title.qname;, %HeadOpts.mix; )"
+>
+<!ENTITY % head.qname "head" >
+<!ELEMENT %head.qname; %head.content; >
+<!-- end of head.element -->]]>
+
+<!ENTITY % head.attlist "INCLUDE" >
+<![%head.attlist;[
+<!-- reserved for future use with document profiles
+-->
+<!ENTITY % profile.attrib
+ "profile %URI.datatype; '%XHTML.profile;'"
+>
+
+<!ATTLIST %head.qname;
+ %XHTML.xmlns.attrib;
+ %I18n.attrib;
+ %profile.attrib;
+>
+<!-- end of head.attlist -->]]>
+
+<!-- body: Document Body ............................... -->
+
+<!ENTITY % body.element "INCLUDE" >
+<![%body.element;[
+<!ENTITY % body.content
+ "( %Block.mix; )*"
+>
+<!ENTITY % body.qname "body" >
+<!ELEMENT %body.qname; %body.content; >
+<!-- end of body.element -->]]>
+
+<!ENTITY % body.attlist "INCLUDE" >
+<![%body.attlist;[
+<!ATTLIST %body.qname;
+ %Common.attrib;
+>
+<!-- end of body.attlist -->]]>
+
+<!-- html: XHTML Document Element ...................... -->
+
+<!ENTITY % html.element "INCLUDE" >
+<![%html.element;[
+<!ENTITY % html.content "( %head.qname;, %body.qname; )" >
+<!ENTITY % html.qname "html" >
+<!ELEMENT %html.qname; %html.content; >
+<!-- end of html.element -->]]>
+
+<![%XHTML.xsi.attrs;[
+<!-- define a parameter for the XSI schemaLocation attribute -->
+<!ENTITY % XSI.schemaLocation.attrib
+ "%XSI.pfx;schemaLocation %URIs.datatype; #IMPLIED"
+>
+]]>
+<!ENTITY % XSI.schemaLocation.attrib "">
+
+<!ENTITY % html.attlist "INCLUDE" >
+<![%html.attlist;[
+<!-- version attribute value defined in driver
+-->
+<!ENTITY % XHTML.version.attrib
+ "version %FPI.datatype; #FIXED '%XHTML.version;'"
+>
+<!-- schemaLocation attribute from XML Schema
+-->
+<!ENTITY % XSI.schemaLocation.attrib
+ "schemaLocation %URIs.datatype; #IMPLIED"
+>
+
+<!-- see the Qualified Names module for information
+ on how to extend XHTML using XML namespaces
+-->
+<!ATTLIST %html.qname;
+ %XHTML.xmlns.attrib;
+ %XSI.schemaLocation.attrib;
+ %XHTML.version.attrib;
+ %I18n.attrib;
+>
+<!-- end of html.attlist -->]]>
+
+<!-- end of xhtml-struct-1.mod -->
+]]>
+
+<!-- end of XHTML 1.1 DTD ................................................. -->
+<!-- ....................................................................... -->
+
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xhtml1-strict.dtd b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xhtml1-strict.dtd
new file mode 100644
index 000000000..2927b9ece
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/otjld/xhtml1-strict.dtd
@@ -0,0 +1,978 @@
+<!--
+ Extensible HTML version 1.0 Strict DTD
+
+ This is the same as HTML 4 Strict except for
+ changes due to the differences between XML and SGML.
+
+ Namespace = http://www.w3.org/1999/xhtml
+
+ For further information, see: http://www.w3.org/TR/xhtml1
+
+ Copyright (c) 1998-2002 W3C (MIT, INRIA, Keio),
+ All Rights Reserved.
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
+
+ $Revision: 1.1 $
+ $Date: 2002/08/01 13:56:03 $
+
+-->
+
+<!--================ Character mnemonic entities =========================-->
+
+<!ENTITY % HTMLlat1 PUBLIC
+ "-//W3C//ENTITIES Latin 1 for XHTML//EN"
+ "xhtml-lat1.ent">
+%HTMLlat1;
+
+<!ENTITY % HTMLsymbol PUBLIC
+ "-//W3C//ENTITIES Symbols for XHTML//EN"
+ "xhtml-symbol.ent">
+%HTMLsymbol;
+
+<!ENTITY % HTMLspecial PUBLIC
+ "-//W3C//ENTITIES Special for XHTML//EN"
+ "xhtml-special.ent">
+%HTMLspecial;
+
+<!--================== Imported Names ====================================-->
+
+<!ENTITY % ContentType "CDATA">
+ <!-- media type, as per [RFC2045] -->
+
+<!ENTITY % ContentTypes "CDATA">
+ <!-- comma-separated list of media types, as per [RFC2045] -->
+
+<!ENTITY % Charset "CDATA">
+ <!-- a character encoding, as per [RFC2045] -->
+
+<!ENTITY % Charsets "CDATA">
+ <!-- a space separated list of character encodings, as per [RFC2045] -->
+
+<!ENTITY % LanguageCode "NMTOKEN">
+ <!-- a language code, as per [RFC3066] -->
+
+<!ENTITY % Character "CDATA">
+ <!-- a single character, as per section 2.2 of [XML] -->
+
+<!ENTITY % Number "CDATA">
+ <!-- one or more digits -->
+
+<!ENTITY % LinkTypes "CDATA">
+ <!-- space-separated list of link types -->
+
+<!ENTITY % MediaDesc "CDATA">
+ <!-- single or comma-separated list of media descriptors -->
+
+<!ENTITY % URI "CDATA">
+ <!-- a Uniform Resource Identifier, see [RFC2396] -->
+
+<!ENTITY % UriList "CDATA">
+ <!-- a space separated list of Uniform Resource Identifiers -->
+
+<!ENTITY % Datetime "CDATA">
+ <!-- date and time information. ISO date format -->
+
+<!ENTITY % Script "CDATA">
+ <!-- script expression -->
+
+<!ENTITY % StyleSheet "CDATA">
+ <!-- style sheet data -->
+
+<!ENTITY % Text "CDATA">
+ <!-- used for titles etc. -->
+
+<!ENTITY % Length "CDATA">
+ <!-- nn for pixels or nn% for percentage length -->
+
+<!ENTITY % MultiLength "CDATA">
+ <!-- pixel, percentage, or relative -->
+
+<!ENTITY % Pixels "CDATA">
+ <!-- integer representing length in pixels -->
+
+<!-- these are used for image maps -->
+
+<!ENTITY % Shape "(rect|circle|poly|default)">
+
+<!ENTITY % Coords "CDATA">
+ <!-- comma separated list of lengths -->
+
+<!--=================== Generic Attributes ===============================-->
+
+<!-- core attributes common to most elements
+ id document-wide unique id
+ class space separated list of classes
+ style associated style info
+ title advisory title/amplification
+-->
+<!ENTITY % coreattrs
+ "id ID #IMPLIED
+ class CDATA #IMPLIED
+ style %StyleSheet; #IMPLIED
+ title %Text; #IMPLIED"
+ >
+
+<!-- internationalization attributes
+ lang language code (backwards compatible)
+ xml:lang language code (as per XML 1.0 spec)
+ dir direction for weak/neutral text
+-->
+<!ENTITY % i18n
+ "lang %LanguageCode; #IMPLIED
+ xml:lang %LanguageCode; #IMPLIED
+ dir (ltr|rtl) #IMPLIED"
+ >
+
+<!-- attributes for common UI events
+ onclick a pointer button was clicked
+ ondblclick a pointer button was double clicked
+ onmousedown a pointer button was pressed down
+ onmouseup a pointer button was released
+ onmousemove a pointer was moved onto the element
+ onmouseout a pointer was moved away from the element
+ onkeypress a key was pressed and released
+ onkeydown a key was pressed down
+ onkeyup a key was released
+-->
+<!ENTITY % events
+ "onclick %Script; #IMPLIED
+ ondblclick %Script; #IMPLIED
+ onmousedown %Script; #IMPLIED
+ onmouseup %Script; #IMPLIED
+ onmouseover %Script; #IMPLIED
+ onmousemove %Script; #IMPLIED
+ onmouseout %Script; #IMPLIED
+ onkeypress %Script; #IMPLIED
+ onkeydown %Script; #IMPLIED
+ onkeyup %Script; #IMPLIED"
+ >
+
+<!-- attributes for elements that can get the focus
+ accesskey accessibility key character
+ tabindex position in tabbing order
+ onfocus the element got the focus
+ onblur the element lost the focus
+-->
+<!ENTITY % focus
+ "accesskey %Character; #IMPLIED
+ tabindex %Number; #IMPLIED
+ onfocus %Script; #IMPLIED
+ onblur %Script; #IMPLIED"
+ >
+
+<!ENTITY % attrs "%coreattrs; %i18n; %events;">
+
+<!--=================== Text Elements ====================================-->
+
+<!ENTITY % special.pre
+ "br | span | bdo | map">
+
+
+<!ENTITY % special
+ "%special.pre; | object | img ">
+
+<!ENTITY % fontstyle "tt | i | b | big | small ">
+
+<!ENTITY % phrase "em | strong | dfn | code | q |
+ samp | kbd | var | cite | abbr | acronym | sub | sup ">
+
+<!ENTITY % inline.forms "input | select | textarea | label | button">
+
+<!-- these can occur at block or inline level -->
+<!ENTITY % misc.inline "ins | del | script">
+
+<!-- these can only occur at block level -->
+<!ENTITY % misc "noscript | %misc.inline;">
+
+<!ENTITY % inline "a | %special; | %fontstyle; | %phrase; | %inline.forms;">
+
+<!-- %Inline; covers inline or "text-level" elements -->
+<!ENTITY % Inline "(#PCDATA | %inline; | %misc.inline;)*">
+
+<!--================== Block level elements ==============================-->
+
+<!ENTITY % heading "h1|h2|h3|h4|h5|h6">
+<!ENTITY % lists "ul | ol | dl">
+<!ENTITY % blocktext "pre | hr | blockquote | address">
+
+<!ENTITY % block
+ "p | %heading; | div | %lists; | %blocktext; | fieldset | table">
+
+<!ENTITY % Block "(%block; | form | %misc;)*">
+
+<!-- %Flow; mixes block and inline and is used for list items etc. -->
+<!ENTITY % Flow "(#PCDATA | %block; | form | %inline; | %misc;)*">
+
+<!--================== Content models for exclusions =====================-->
+
+<!-- a elements use %Inline; excluding a -->
+
+<!ENTITY % a.content
+ "(#PCDATA | %special; | %fontstyle; | %phrase; | %inline.forms; | %misc.inline;)*">
+
+<!-- pre uses %Inline excluding big, small, sup or sup -->
+
+<!ENTITY % pre.content
+ "(#PCDATA | a | %fontstyle; | %phrase; | %special.pre; | %misc.inline;
+ | %inline.forms;)*">
+
+<!-- form uses %Block; excluding form -->
+
+<!ENTITY % form.content "(%block; | %misc;)*">
+
+<!-- button uses %Flow; but excludes a, form and form controls -->
+
+<!ENTITY % button.content
+ "(#PCDATA | p | %heading; | div | %lists; | %blocktext; |
+ table | %special; | %fontstyle; | %phrase; | %misc;)*">
+
+<!--================ Document Structure ==================================-->
+
+<!-- the namespace URI designates the document profile -->
+
+<!ELEMENT html (head, body)>
+<!ATTLIST html
+ %i18n;
+ id ID #IMPLIED
+ xmlns %URI; #FIXED 'http://www.w3.org/1999/xhtml'
+ >
+
+<!--================ Document Head =======================================-->
+
+<!ENTITY % head.misc "(script|style|meta|link|object)*">
+
+<!-- content model is %head.misc; combined with a single
+ title and an optional base element in any order -->
+
+<!ELEMENT head (%head.misc;,
+ ((title, %head.misc;, (base, %head.misc;)?) |
+ (base, %head.misc;, (title, %head.misc;))))>
+
+<!ATTLIST head
+ %i18n;
+ id ID #IMPLIED
+ profile %URI; #IMPLIED
+ >
+
+<!-- The title element is not considered part of the flow of text.
+ It should be displayed, for example as the page header or
+ window title. Exactly one title is required per document.
+ -->
+<!ELEMENT title (#PCDATA)>
+<!ATTLIST title
+ %i18n;
+ id ID #IMPLIED
+ >
+
+<!-- document base URI -->
+
+<!ELEMENT base EMPTY>
+<!ATTLIST base
+ href %URI; #REQUIRED
+ id ID #IMPLIED
+ >
+
+<!-- generic metainformation -->
+<!ELEMENT meta EMPTY>
+<!ATTLIST meta
+ %i18n;
+ id ID #IMPLIED
+ http-equiv CDATA #IMPLIED
+ name CDATA #IMPLIED
+ content CDATA #REQUIRED
+ scheme CDATA #IMPLIED
+ >
+
+<!--
+ Relationship values can be used in principle:
+
+ a) for document specific toolbars/menus when used
+ with the link element in document head e.g.
+ start, contents, previous, next, index, end, help
+ b) to link to a separate style sheet (rel="stylesheet")
+ c) to make a link to a script (rel="script")
+ d) by stylesheets to control how collections of
+ html nodes are rendered into printed documents
+ e) to make a link to a printable version of this document
+ e.g. a PostScript or PDF version (rel="alternate" media="print")
+-->
+
+<!ELEMENT link EMPTY>
+<!ATTLIST link
+ %attrs;
+ charset %Charset; #IMPLIED
+ href %URI; #IMPLIED
+ hreflang %LanguageCode; #IMPLIED
+ type %ContentType; #IMPLIED
+ rel %LinkTypes; #IMPLIED
+ rev %LinkTypes; #IMPLIED
+ media %MediaDesc; #IMPLIED
+ >
+
+<!-- style info, which may include CDATA sections -->
+<!ELEMENT style (#PCDATA)>
+<!ATTLIST style
+ %i18n;
+ id ID #IMPLIED
+ type %ContentType; #REQUIRED
+ media %MediaDesc; #IMPLIED
+ title %Text; #IMPLIED
+ xml:space (preserve) #FIXED 'preserve'
+ >
+
+<!-- script statements, which may include CDATA sections -->
+<!ELEMENT script (#PCDATA)>
+<!ATTLIST script
+ id ID #IMPLIED
+ charset %Charset; #IMPLIED
+ type %ContentType; #REQUIRED
+ src %URI; #IMPLIED
+ defer (defer) #IMPLIED
+ xml:space (preserve) #FIXED 'preserve'
+ >
+
+<!-- alternate content container for non script-based rendering -->
+
+<!ELEMENT noscript %Block;>
+<!ATTLIST noscript
+ %attrs;
+ >
+
+<!--=================== Document Body ====================================-->
+
+<!ELEMENT body %Block;>
+<!ATTLIST body
+ %attrs;
+ onload %Script; #IMPLIED
+ onunload %Script; #IMPLIED
+ >
+
+<!ELEMENT div %Flow;> <!-- generic language/style container -->
+<!ATTLIST div
+ %attrs;
+ >
+
+<!--=================== Paragraphs =======================================-->
+
+<!ELEMENT p %Inline;>
+<!ATTLIST p
+ %attrs;
+ >
+
+<!--=================== Headings =========================================-->
+
+<!--
+ There are six levels of headings from h1 (the most important)
+ to h6 (the least important).
+-->
+
+<!ELEMENT h1 %Inline;>
+<!ATTLIST h1
+ %attrs;
+ >
+
+<!ELEMENT h2 %Inline;>
+<!ATTLIST h2
+ %attrs;
+ >
+
+<!ELEMENT h3 %Inline;>
+<!ATTLIST h3
+ %attrs;
+ >
+
+<!ELEMENT h4 %Inline;>
+<!ATTLIST h4
+ %attrs;
+ >
+
+<!ELEMENT h5 %Inline;>
+<!ATTLIST h5
+ %attrs;
+ >
+
+<!ELEMENT h6 %Inline;>
+<!ATTLIST h6
+ %attrs;
+ >
+
+<!--=================== Lists ============================================-->
+
+<!-- Unordered list -->
+
+<!ELEMENT ul (li)+>
+<!ATTLIST ul
+ %attrs;
+ >
+
+<!-- Ordered (numbered) list -->
+
+<!ELEMENT ol (li)+>
+<!ATTLIST ol
+ %attrs;
+ >
+
+<!-- list item -->
+
+<!ELEMENT li %Flow;>
+<!ATTLIST li
+ %attrs;
+ >
+
+<!-- definition lists - dt for term, dd for its definition -->
+
+<!ELEMENT dl (dt|dd)+>
+<!ATTLIST dl
+ %attrs;
+ >
+
+<!ELEMENT dt %Inline;>
+<!ATTLIST dt
+ %attrs;
+ >
+
+<!ELEMENT dd %Flow;>
+<!ATTLIST dd
+ %attrs;
+ >
+
+<!--=================== Address ==========================================-->
+
+<!-- information on author -->
+
+<!ELEMENT address %Inline;>
+<!ATTLIST address
+ %attrs;
+ >
+
+<!--=================== Horizontal Rule ==================================-->
+
+<!ELEMENT hr EMPTY>
+<!ATTLIST hr
+ %attrs;
+ >
+
+<!--=================== Preformatted Text ================================-->
+
+<!-- content is %Inline; excluding "img|object|big|small|sub|sup" -->
+
+<!ELEMENT pre %pre.content;>
+<!ATTLIST pre
+ %attrs;
+ xml:space (preserve) #FIXED 'preserve'
+ >
+
+<!--=================== Block-like Quotes ================================-->
+
+<!ELEMENT blockquote %Block;>
+<!ATTLIST blockquote
+ %attrs;
+ cite %URI; #IMPLIED
+ >
+
+<!--=================== Inserted/Deleted Text ============================-->
+
+<!--
+ ins/del are allowed in block and inline content, but its
+ inappropriate to include block content within an ins element
+ occurring in inline content.
+-->
+<!ELEMENT ins %Flow;>
+<!ATTLIST ins
+ %attrs;
+ cite %URI; #IMPLIED
+ datetime %Datetime; #IMPLIED
+ >
+
+<!ELEMENT del %Flow;>
+<!ATTLIST del
+ %attrs;
+ cite %URI; #IMPLIED
+ datetime %Datetime; #IMPLIED
+ >
+
+<!--================== The Anchor Element ================================-->
+
+<!-- content is %Inline; except that anchors shouldn't be nested -->
+
+<!ELEMENT a %a.content;>
+<!ATTLIST a
+ %attrs;
+ %focus;
+ charset %Charset; #IMPLIED
+ type %ContentType; #IMPLIED
+ name NMTOKEN #IMPLIED
+ href %URI; #IMPLIED
+ hreflang %LanguageCode; #IMPLIED
+ rel %LinkTypes; #IMPLIED
+ rev %LinkTypes; #IMPLIED
+ shape %Shape; "rect"
+ coords %Coords; #IMPLIED
+ >
+
+<!--===================== Inline Elements ================================-->
+
+<!ELEMENT span %Inline;> <!-- generic language/style container -->
+<!ATTLIST span
+ %attrs;
+ >
+
+<!ELEMENT bdo %Inline;> <!-- I18N BiDi over-ride -->
+<!ATTLIST bdo
+ %coreattrs;
+ %events;
+ lang %LanguageCode; #IMPLIED
+ xml:lang %LanguageCode; #IMPLIED
+ dir (ltr|rtl) #REQUIRED
+ >
+
+<!ELEMENT br EMPTY> <!-- forced line break -->
+<!ATTLIST br
+ %coreattrs;
+ >
+
+<!ELEMENT em %Inline;> <!-- emphasis -->
+<!ATTLIST em %attrs;>
+
+<!ELEMENT strong %Inline;> <!-- strong emphasis -->
+<!ATTLIST strong %attrs;>
+
+<!ELEMENT dfn %Inline;> <!-- definitional -->
+<!ATTLIST dfn %attrs;>
+
+<!ELEMENT code %Inline;> <!-- program code -->
+<!ATTLIST code %attrs;>
+
+<!ELEMENT samp %Inline;> <!-- sample -->
+<!ATTLIST samp %attrs;>
+
+<!ELEMENT kbd %Inline;> <!-- something user would type -->
+<!ATTLIST kbd %attrs;>
+
+<!ELEMENT var %Inline;> <!-- variable -->
+<!ATTLIST var %attrs;>
+
+<!ELEMENT cite %Inline;> <!-- citation -->
+<!ATTLIST cite %attrs;>
+
+<!ELEMENT abbr %Inline;> <!-- abbreviation -->
+<!ATTLIST abbr %attrs;>
+
+<!ELEMENT acronym %Inline;> <!-- acronym -->
+<!ATTLIST acronym %attrs;>
+
+<!ELEMENT q %Inline;> <!-- inlined quote -->
+<!ATTLIST q
+ %attrs;
+ cite %URI; #IMPLIED
+ >
+
+<!ELEMENT sub %Inline;> <!-- subscript -->
+<!ATTLIST sub %attrs;>
+
+<!ELEMENT sup %Inline;> <!-- superscript -->
+<!ATTLIST sup %attrs;>
+
+<!ELEMENT tt %Inline;> <!-- fixed pitch font -->
+<!ATTLIST tt %attrs;>
+
+<!ELEMENT i %Inline;> <!-- italic font -->
+<!ATTLIST i %attrs;>
+
+<!ELEMENT b %Inline;> <!-- bold font -->
+<!ATTLIST b %attrs;>
+
+<!ELEMENT big %Inline;> <!-- bigger font -->
+<!ATTLIST big %attrs;>
+
+<!ELEMENT small %Inline;> <!-- smaller font -->
+<!ATTLIST small %attrs;>
+
+<!--==================== Object ======================================-->
+<!--
+ object is used to embed objects as part of HTML pages.
+ param elements should precede other content. Parameters
+ can also be expressed as attribute/value pairs on the
+ object element itself when brevity is desired.
+-->
+
+<!ELEMENT object (#PCDATA | param | %block; | form | %inline; | %misc;)*>
+<!ATTLIST object
+ %attrs;
+ declare (declare) #IMPLIED
+ classid %URI; #IMPLIED
+ codebase %URI; #IMPLIED
+ data %URI; #IMPLIED
+ type %ContentType; #IMPLIED
+ codetype %ContentType; #IMPLIED
+ archive %UriList; #IMPLIED
+ standby %Text; #IMPLIED
+ height %Length; #IMPLIED
+ width %Length; #IMPLIED
+ usemap %URI; #IMPLIED
+ name NMTOKEN #IMPLIED
+ tabindex %Number; #IMPLIED
+ >
+
+<!--
+ param is used to supply a named property value.
+ In XML it would seem natural to follow RDF and support an
+ abbreviated syntax where the param elements are replaced
+ by attribute value pairs on the object start tag.
+-->
+<!ELEMENT param EMPTY>
+<!ATTLIST param
+ id ID #IMPLIED
+ name CDATA #IMPLIED
+ value CDATA #IMPLIED
+ valuetype (data|ref|object) "data"
+ type %ContentType; #IMPLIED
+ >
+
+<!--=================== Images ===========================================-->
+
+<!--
+ To avoid accessibility problems for people who aren't
+ able to see the image, you should provide a text
+ description using the alt and longdesc attributes.
+ In addition, avoid the use of server-side image maps.
+ Note that in this DTD there is no name attribute. That
+ is only available in the transitional and frameset DTD.
+-->
+
+<!ELEMENT img EMPTY>
+<!ATTLIST img
+ %attrs;
+ src %URI; #REQUIRED
+ alt %Text; #REQUIRED
+ longdesc %URI; #IMPLIED
+ height %Length; #IMPLIED
+ width %Length; #IMPLIED
+ usemap %URI; #IMPLIED
+ ismap (ismap) #IMPLIED
+ >
+
+<!-- usemap points to a map element which may be in this document
+ or an external document, although the latter is not widely supported -->
+
+<!--================== Client-side image maps ============================-->
+
+<!-- These can be placed in the same document or grouped in a
+ separate document although this isn't yet widely supported -->
+
+<!ELEMENT map ((%block; | form | %misc;)+ | area+)>
+<!ATTLIST map
+ %i18n;
+ %events;
+ id ID #REQUIRED
+ class CDATA #IMPLIED
+ style %StyleSheet; #IMPLIED
+ title %Text; #IMPLIED
+ name NMTOKEN #IMPLIED
+ >
+
+<!ELEMENT area EMPTY>
+<!ATTLIST area
+ %attrs;
+ %focus;
+ shape %Shape; "rect"
+ coords %Coords; #IMPLIED
+ href %URI; #IMPLIED
+ nohref (nohref) #IMPLIED
+ alt %Text; #REQUIRED
+ >
+
+<!--================ Forms ===============================================-->
+<!ELEMENT form %form.content;> <!-- forms shouldn't be nested -->
+
+<!ATTLIST form
+ %attrs;
+ action %URI; #REQUIRED
+ method (get|post) "get"
+ enctype %ContentType; "application/x-www-form-urlencoded"
+ onsubmit %Script; #IMPLIED
+ onreset %Script; #IMPLIED
+ accept %ContentTypes; #IMPLIED
+ accept-charset %Charsets; #IMPLIED
+ >
+
+<!--
+ Each label must not contain more than ONE field
+ Label elements shouldn't be nested.
+-->
+<!ELEMENT label %Inline;>
+<!ATTLIST label
+ %attrs;
+ for IDREF #IMPLIED
+ accesskey %Character; #IMPLIED
+ onfocus %Script; #IMPLIED
+ onblur %Script; #IMPLIED
+ >
+
+<!ENTITY % InputType
+ "(text | password | checkbox |
+ radio | submit | reset |
+ file | hidden | image | button)"
+ >
+
+<!-- the name attribute is required for all but submit & reset -->
+
+<!ELEMENT input EMPTY> <!-- form control -->
+<!ATTLIST input
+ %attrs;
+ %focus;
+ type %InputType; "text"
+ name CDATA #IMPLIED
+ value CDATA #IMPLIED
+ checked (checked) #IMPLIED
+ disabled (disabled) #IMPLIED
+ readonly (readonly) #IMPLIED
+ size CDATA #IMPLIED
+ maxlength %Number; #IMPLIED
+ src %URI; #IMPLIED
+ alt CDATA #IMPLIED
+ usemap %URI; #IMPLIED
+ onselect %Script; #IMPLIED
+ onchange %Script; #IMPLIED
+ accept %ContentTypes; #IMPLIED
+ >
+
+<!ELEMENT select (optgroup|option)+> <!-- option selector -->
+<!ATTLIST select
+ %attrs;
+ name CDATA #IMPLIED
+ size %Number; #IMPLIED
+ multiple (multiple) #IMPLIED
+ disabled (disabled) #IMPLIED
+ tabindex %Number; #IMPLIED
+ onfocus %Script; #IMPLIED
+ onblur %Script; #IMPLIED
+ onchange %Script; #IMPLIED
+ >
+
+<!ELEMENT optgroup (option)+> <!-- option group -->
+<!ATTLIST optgroup
+ %attrs;
+ disabled (disabled) #IMPLIED
+ label %Text; #REQUIRED
+ >
+
+<!ELEMENT option (#PCDATA)> <!-- selectable choice -->
+<!ATTLIST option
+ %attrs;
+ selected (selected) #IMPLIED
+ disabled (disabled) #IMPLIED
+ label %Text; #IMPLIED
+ value CDATA #IMPLIED
+ >
+
+<!ELEMENT textarea (#PCDATA)> <!-- multi-line text field -->
+<!ATTLIST textarea
+ %attrs;
+ %focus;
+ name CDATA #IMPLIED
+ rows %Number; #REQUIRED
+ cols %Number; #REQUIRED
+ disabled (disabled) #IMPLIED
+ readonly (readonly) #IMPLIED
+ onselect %Script; #IMPLIED
+ onchange %Script; #IMPLIED
+ >
+
+<!--
+ The fieldset element is used to group form fields.
+ Only one legend element should occur in the content
+ and if present should only be preceded by whitespace.
+-->
+<!ELEMENT fieldset (#PCDATA | legend | %block; | form | %inline; | %misc;)*>
+<!ATTLIST fieldset
+ %attrs;
+ >
+
+<!ELEMENT legend %Inline;> <!-- fieldset label -->
+<!ATTLIST legend
+ %attrs;
+ accesskey %Character; #IMPLIED
+ >
+
+<!--
+ Content is %Flow; excluding a, form and form controls
+-->
+<!ELEMENT button %button.content;> <!-- push button -->
+<!ATTLIST button
+ %attrs;
+ %focus;
+ name CDATA #IMPLIED
+ value CDATA #IMPLIED
+ type (button|submit|reset) "submit"
+ disabled (disabled) #IMPLIED
+ >
+
+<!--======================= Tables =======================================-->
+
+<!-- Derived from IETF HTML table standard, see [RFC1942] -->
+
+<!--
+ The border attribute sets the thickness of the frame around the
+ table. The default units are screen pixels.
+
+ The frame attribute specifies which parts of the frame around
+ the table should be rendered. The values are not the same as
+ CALS to avoid a name clash with the valign attribute.
+-->
+<!ENTITY % TFrame "(void|above|below|hsides|lhs|rhs|vsides|box|border)">
+
+<!--
+ The rules attribute defines which rules to draw between cells:
+
+ If rules is absent then assume:
+ "none" if border is absent or border="0" otherwise "all"
+-->
+
+<!ENTITY % TRules "(none | groups | rows | cols | all)">
+
+<!-- horizontal alignment attributes for cell contents
+
+ char alignment char, e.g. char=':'
+ charoff offset for alignment char
+-->
+<!ENTITY % cellhalign
+ "align (left|center|right|justify|char) #IMPLIED
+ char %Character; #IMPLIED
+ charoff %Length; #IMPLIED"
+ >
+
+<!-- vertical alignment attributes for cell contents -->
+<!ENTITY % cellvalign
+ "valign (top|middle|bottom|baseline) #IMPLIED"
+ >
+
+<!ELEMENT table
+ (caption?, (col*|colgroup*), thead?, tfoot?, (tbody+|tr+))>
+<!ELEMENT caption %Inline;>
+<!ELEMENT thead (tr)+>
+<!ELEMENT tfoot (tr)+>
+<!ELEMENT tbody (tr)+>
+<!ELEMENT colgroup (col)*>
+<!ELEMENT col EMPTY>
+<!ELEMENT tr (th|td)+>
+<!ELEMENT th %Flow;>
+<!ELEMENT td %Flow;>
+
+<!ATTLIST table
+ %attrs;
+ summary %Text; #IMPLIED
+ width %Length; #IMPLIED
+ border %Pixels; #IMPLIED
+ frame %TFrame; #IMPLIED
+ rules %TRules; #IMPLIED
+ cellspacing %Length; #IMPLIED
+ cellpadding %Length; #IMPLIED
+ >
+
+<!ATTLIST caption
+ %attrs;
+ >
+
+<!--
+colgroup groups a set of col elements. It allows you to group
+several semantically related columns together.
+-->
+<!ATTLIST colgroup
+ %attrs;
+ span %Number; "1"
+ width %MultiLength; #IMPLIED
+ %cellhalign;
+ %cellvalign;
+ >
+
+<!--
+ col elements define the alignment properties for cells in
+ one or more columns.
+
+ The width attribute specifies the width of the columns, e.g.
+
+ width=64 width in screen pixels
+ width=0.5* relative width of 0.5
+
+ The span attribute causes the attributes of one
+ col element to apply to more than one column.
+-->
+<!ATTLIST col
+ %attrs;
+ span %Number; "1"
+ width %MultiLength; #IMPLIED
+ %cellhalign;
+ %cellvalign;
+ >
+
+<!--
+ Use thead to duplicate headers when breaking table
+ across page boundaries, or for static headers when
+ tbody sections are rendered in scrolling panel.
+
+ Use tfoot to duplicate footers when breaking table
+ across page boundaries, or for static footers when
+ tbody sections are rendered in scrolling panel.
+
+ Use multiple tbody sections when rules are needed
+ between groups of table rows.
+-->
+<!ATTLIST thead
+ %attrs;
+ %cellhalign;
+ %cellvalign;
+ >
+
+<!ATTLIST tfoot
+ %attrs;
+ %cellhalign;
+ %cellvalign;
+ >
+
+<!ATTLIST tbody
+ %attrs;
+ %cellhalign;
+ %cellvalign;
+ >
+
+<!ATTLIST tr
+ %attrs;
+ %cellhalign;
+ %cellvalign;
+ >
+
+
+<!-- Scope is simpler than headers attribute for common tables -->
+<!ENTITY % Scope "(row|col|rowgroup|colgroup)">
+
+<!-- th is for headers, td for data and for cells acting as both -->
+
+<!ATTLIST th
+ %attrs;
+ abbr %Text; #IMPLIED
+ axis CDATA #IMPLIED
+ headers IDREFS #IMPLIED
+ scope %Scope; #IMPLIED
+ rowspan %Number; "1"
+ colspan %Number; "1"
+ %cellhalign;
+ %cellvalign;
+ >
+
+<!ATTLIST td
+ %attrs;
+ abbr %Text; #IMPLIED
+ axis CDATA #IMPLIED
+ headers IDREFS #IMPLIED
+ scope %Scope; #IMPLIED
+ rowspan %Number; "1"
+ colspan %Number; "1"
+ %cellhalign;
+ %cellvalign;
+ >
+
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/outline.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/outline.html
new file mode 100644
index 000000000..3cfaa1b0b
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/outline.html
@@ -0,0 +1,28 @@
+<html>
+ <head>
+ <meta name="copyright" content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel=stylesheet type="text/css" href="../css/book.css">
+ <title>Object Teams Outline</title>
+ <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+ </head>
+ <body>
+ <h1>Object Teams Outline</h1>
+ The <b>Object Teams outline</b> provides the following features
+ (in addition to the features of the standard JDT
+ <a href="/help/topic/org.eclipse.platform.doc.user/concepts/coutline.htm">
+ outline view</a>):
+ <ul>
+ <li>lists the <b>structural elements</b> of an Object Teams source file, i.e. team
+ classes, role classes, callin/callout bindings, methods, fields etc.
+ </li>
+ <li>shows <b>Object Teams specific icons</b> for team classes, role classes and method
+ bindings<br />
+ See the <a href="packageexplorer.html">package explorer</a> for icons and their meaning.
+ </li>
+ </ul>
+ <p>
+ <img src="images/screenshots/outline.jpg"
+ alt="Object Teams outline view">
+ </p>
+ </body>
+</html>
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/packageexplorer.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/packageexplorer.html
new file mode 100644
index 000000000..ccfe173c5
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/packageexplorer.html
@@ -0,0 +1,103 @@
+<html>
+ <head>
+ <meta name="copyright" content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel=stylesheet type="text/css" href="../css/book.css">
+ <link rel=stylesheet type="text/css" href="otguide.css">
+ <title>Object Teams Package Explorer</title>
+ <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+ </head>
+ <body>
+ <h1>Object Teams Package Explorer</h1>
+ <p>
+ The <b>Object Teams package explorer</b> provides the following features
+ (in addition to the features of the standard JDT
+ <a href="/help/topic/org.eclipse.jdt.doc.user/reference/ref-view-package-explorer.htm">
+ package explorer view</a>):<br>
+ <ul>
+ <li>Showing the <b>Object Teams element hierarchy</b> of the Object Teams projects in the
+ workbench including
+ <ul>
+ <li><u>specific classes:</u><br />
+ &ndash; <b>team</b> class (<img src="../images/team_obj.gif">).<br>
+ &ndash; <b>role</b> class (<img src="../images/role_obj.png">).<br>
+ &ndash; a <b>nested team</b> (<img src="../images/team_role_obj.gif">) is a role as well as a team.
+ </li>
+ <li><u>role class decorations:</u><br>
+ &ndash; <b>bound role</b> class (<span><img style="position:relative;left:0px;" src="../images/role_obj.png"><img style="position:relative;left:-2px;top:-4px;" src="../images/boundrole_co.gif"></span>)
+ &mdash; <em>has a <code class="keyword">playedBy</code> declaration.</em>
+ <br>
+ &ndash; <b>overriding role</b> class (<span><img style="position:relative;left:0px;" src="../images/role_obj.png"><img style="position:relative;left:-2px;top:4px;" src="../images/over_co_ovr16.gif"></span>)
+ &mdash <em>overrides a role from the super team</em><br>
+ <li><u>methods:</u><br />
+ &ndash; <b>callin</b> methods are marked with a decoration <img src="../images/callinmethod_co.gif">.
+ </li>
+ <li><u>method bindings:</u><br />
+ &ndash; <b>callin</b>: before(<img src="../images/callinbindingbefore_obj.gif">),
+ after (<img src="../images/callinbindingafter_obj.gif">), replace (<img src="../images/callinbindingreplace_obj.gif">)
+ <br />
+ &ndash; <b>callout</b>: (<img src="../images/calloutbinding_obj.gif">)
+ </li>
+ <li><u>guard predicates:</u><br>
+ &ndash; <b>regular guard</b> (<img src="../images/guard_obj.gif">)<br>
+ &ndash; <b>base guard</b> (<img src="../images/baseguard_obj.gif">)<br>
+ </ul>
+ <li>Displaying <b>Role Files</b> physically/logically (<img src="../images/external_roles.gif">):
+ <ul>
+ <li><b>Physical</b> display uses the file and directory structure, i.e.,
+ role files will appear in a special folder/package representing the enclosing team.</li>
+ <li><b>Logical</b> display presents role files and inline roles uniformly as direct
+ children of their enclosing team.</li>
+ </ul>
+ <li><b>Overlay icons</b> for <b>compilations units</b> (team or role file)
+ and <b>packages</b> (team package) can be enabled by checking
+ <span class="ui">Preferences-&gt;General-&gt;Appearance-&gt;Label Decorations-&gt;Java Type Indicator</span>.
+ <ul>
+ <li><u>compilation unit:</u><br>
+ &ndash holding a team class (<span><img style="position:relative;left:0px;" src="../images/jcu_obj.gif"><img style="position:relative;left:-7px;top:-5px;" src="../images/team_ovr.gif"></span>)<br>
+ &ndash holding a role class (<span><img style="position:relative;left:0px;" src="../images/jcu_obj.gif"><img style="position:relative;left:-7px;top:-5px;" src="../images/role_ovr.png"></span> or
+ <span><img style="position:relative;left:0px;" src="../images/jcu_obj.gif"><img style="position:relative;left:-7px;top:-5px;" src="../images/team_role_ovr.gif"></span>)</li>
+ <li><u>package:</u><br>
+ &ndash team package (<span><img style="position:relative;left:0px;" src="../images/package.gif"><img style="position:relative;left:-7px;top:-5px;" src="../images/team_ovr.gif"></span>)
+ </ul>
+ </ul>
+ </p>
+ <table>
+ <tr><td>
+ <p><u><b>Physical view:</b></u><br>
+ role file <code>FlightBonusDialog</code> is displayed as
+ a child of its team package.
+ </p>
+ <img src="images/screenshots/packageExplorer.png"
+ alt="Object Teams package explorer view">
+ </td><td><span style="width=20px;">&nbsp;</span></td><td>
+ <p><u><b>Logical view:</b></u><br>
+ role <code>FlightBonusDialog</code> is displayed as
+ a child of its enclosing team class.
+ </p>
+ <img src="images/screenshots/packageExplorer_logical.png"
+ alt="Object Teams package explorer logical view">
+
+ </td></tr></table>
+ <h2>Aspect bindings in Object Teams Plug-in projects</h2>
+ <p>
+ If an Object Teams Plug-in project has
+ <a href="../reference/extension-points/org_objectteams_otequinox_aspectBindings.html">aspect bindings</a>
+ these will be displayed in the package explorer directly under the project's root:
+ </p><p>
+ <img src="images/screenshots/AspectBindingsInPackageExplorer.png" title="Package explorer showing aspect bindings"/>
+ </p><p>
+ Below the node called <span class="ui">OT/Equinox Aspect Bindings</span> you will find the list of all <img src="../images/plugin_obj.gif"/> <strong>base plug-ins</strong>
+ adapted by the given OT plug-in. Each base plug-in in turn lists all <img src="../images/team_obj.gif"/> <strong>teams</strong> that implement this adaptation.<br/>
+ Base plug-ins to which <strong>forced exports</strong> are applied are decorated with a little up-and-left arrow:
+ </p><p>
+ <img alt="Decoration for base plug-in with forced export" src="images/screenshots/ForcedExports.png">
+ </p><p>
+ Double clicking a base plugin or a team shows the corresponding element in an editor:
+ <ul>
+ <li>a base plugin as sub-element of an aspectBinding extension in the PDE's extension editor.</li>
+ <li>a team class in the source code editor</li>
+ </ul>
+ </p>
+
+ </body>
+</html>
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/perspective.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/perspective.html
new file mode 100644
index 000000000..5a074bcd0
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/perspective.html
@@ -0,0 +1,42 @@
+<html>
+ <head>
+ <meta name="copyright" content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel=stylesheet type="text/css" href="../css/book.css">
+ <title>Object Teams perspective</title>
+ <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+ <style type="text/css">
+ h2 {color: blue}
+ </style>
+ </head>
+ <body>
+ <h1>Object Teams perspective</h1>
+ The <b>Object Teams perspective</b> combines views that you use while
+ editing OT/J source files (see
+ <a href="/help/topic/org.eclipse.platform.doc.user/concepts/concepts-4.htm">
+ perspectives</a>).
+ <h2>Opening the Object Teams perspective</h2>
+ To open the Object Teams perspective:
+ <ol>
+ <li>Click the <b>Open Perspective</b> button on the shortcut bar on the left side of
+ the Workbench window or select <b>Window > Open Perspective </b> from the
+ Workbench window menu bar.</li>
+ <li>To see a complete list of perspectives, select <b>Other...</b> from the drop-down
+ menu.
+ </li>
+ <li>Select the "Object Teams" perspective.</li>
+ </ol>
+ <p>When the perspective opens, the title bar of the window changes to display the name
+ of the perspective (i.e. Object Teams). In addition, an icon is added to the shortcut
+ bar, allowing you to quickly switch back to that perspective from other perspectives in
+ the same window.
+ <p>
+ <img src="images/screenshots/perspective.png" width=285 height=63
+ alt="Object Teams icon in shortcut bar"<br>
+ Object Teams icon in the shortcut bar ("Show text" disabled).
+ </p>
+ <p>By default, a perspective will open in the same window. If you would rather it opened
+ in a new window, change the setting in <b>Window > Preferences > Workbench > Perspectives
+ </b>.
+ </p>
+ </body>
+</html>
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/project.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/project.html
new file mode 100644
index 000000000..d384fda97
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/project.html
@@ -0,0 +1,51 @@
+<html>
+ <head>
+ <meta name="copyright" content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel=stylesheet type="text/css" href="../css/book.css">
+ <link rel=stylesheet type="text/css" href="otguide.css">
+ <title>Object Teams project creation</title>
+ <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+ <style type="text/css">
+ h2 {color: blue}
+ </style>
+ </head>
+ <body>
+ <h1>Object Teams project creation</h1>
+ <h2>Opening the project wizard</h2>
+ <p>The easiest way to create a new Object Teams project is to use the Object Teams
+ project wizard. The project wizard selection dialog can be opened either by selecting
+ <b>File > New > Project...</b> from the main workbench window or by selecting
+ <b>New > Project...</b> from the package explorer's pop-up menu or by selecting
+ <b>Project...</b> from the drop-down menu on the <b>New</b> button in the workbench
+ toolbar. Afterwards the wizard for creating an Object Teams project has to be chosen.
+ </p>
+
+ <h2>Define settings</h2>
+ <p>On the first page of the project wizard the name of the project has to be entered.
+ On the second and last page the standard Java build settings can be defined as desired
+ (source folder, output folder, libraries etc.).
+ </p>
+
+ <h2>Resulting effects</h2>
+ <p>After all information has been entered the project with the chosen name will be created,
+ the files <i>.classpath</i> and <i>.project</i> will be created and the tree view in the
+ package explorer will be updated and the new project displayed.
+ </p>
+ <p>
+ <img src="images/screenshots/projectWizard.jpg"
+ alt="Object Teams project wizard">
+ </p>
+ <h2>OT/Equinox: Plug-in project</h2>
+ <p>
+ If the project is to develop an Eclipse plug-in using Object Teams (OT/Equinox) choose
+ the wizard for "Object Teams Plugin Project". This wizard is a variant of the regular
+ "Plug-in Project" wizard.
+ </p>
+ <h1>Adding Object Teams support to an existing project</h1>
+ <p>
+ Alternatively, if you already have a valid Java project or Plug-in project, you may
+ add Object Teams support using the project's context menu <span class="ui">Configure &gt; Add Object Teams support</span>.
+ </p>
+ <img src="images/screenshots/addOTNature.png" alt="Add Object Teams support menu option"/>
+ </body>
+</html>
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/quickfix.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/quickfix.html
new file mode 100644
index 000000000..dc26cc6b0
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/quickfix.html
@@ -0,0 +1,65 @@
+<html>
+ <head>
+ <meta name="copyright" content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel=stylesheet type="text/css" href="../css/book.css">
+ <link rel=stylesheet type="text/css" href="otjld/css/ot.css">
+ <link rel=stylesheet type="text/css" href="otguide.css">
+ <title>OT/J content/code assist</title>
+ <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+ </head>
+ <body>
+ <h1 align="center">OT/J quick fixes</h1>
+ <u>Specific <a href="/help/topic/org.eclipse.jdt.doc.user/reference/ref-java-editor-quickfix.htm">quick fixes</a> are available for mending OT/J-related problems, including:</u>
+ <dl>
+ <dt>class modifiers
+ <dd>
+ &ndash; missing <code class="keyword">team</code> modifier,<br />
+ &ndash; illegal modifier for a role,<br />
+ &ndash; reducing the visibility from an (explicitly or implicitly) inherited role,<br />
+ &ndash; abstract relevant role (<a href="otjld/def/s2.html#s2.5.b"><img src="../icons/ot_paragraph.gif"> 2.5(b)</a>).
+ <dt>modifiers of methods and method bindings
+ <dd>
+ &ndash; mismatch between a method's <code class="keyword">callin</code> modifier and a callin binding's modifier (<code class="keyword">before/after/replace</code>),<br />
+ &ndash; static/non-static incompatibility in a callin replace binding,<br />
+ &ndash; mismatching override of callin vs. regular role methods (<a href="otjld/def/s4.html#s4.2.d"><img src="../icons/ot_paragraph.gif"> 4.2(d)</a>),<br />
+ &ndash; missing callin binding modifier (<code class="keyword">before/after/replace</code>).<br />
+ &ndash; wrong callout token (<code class="keyword">-&gt;</code> vs. <code class="keyword">=&gt;</code>, <a href="otjld/def/s3.html#s3.1.e"><img src="../icons/ot_paragraph.gif"> 3.1(e)</a>).<br />
+ &ndash; insufficient visibility of a role method / constructor / field.<br />
+ &ndash; also insufficient visibility of a shorthand callout binding can be fixed be prepending a visibility modifier (protected or public, see <a href="otjld/def/s3.html#s3.1.i"><img src="../icons/ot_paragraph.gif"> 3.1(i)</a>).<br />
+ <dt>inferred callout
+ <dd>&ndash; materializing inferred callout bindings (<a href="otjld/def/s3.html#s3.1.j"><img src="../icons/ot_paragraph.gif"> 3.1(j)</a>, <a href="otjld/def/s3.html#s3.5.h"><img src="../icons/ot_paragraph.gif"> 3.5(h)</a>)
+ <dt>callin precedence
+ <dd>&ndash; missing callin precedence declaration (<a href="otjld/def/s4.html#s4.8"><img src="../icons/ot_paragraph.gif"> 4.8</a>).
+ <dt>typing
+ <dd>
+ &ndash; add a missing anchor for the type of an externalized role
+ (<a href="otjld/def/s1.html#s1.2.2"><img src="../icons/ot_paragraph.gif"> 1.2.2</a>, <a href="otjld/def/s9.html#s9.2"><img src="../icons/ot_paragraph.gif"> 9.2</a>)
+ (proposals are infered from the context),<br />
+ &ndash; adding missing <code class="keyword">final</code> modifier to a variable used as a type anchor, <br />
+ &ndash; adding required type parameter to a callin binding capturing covariant base methods (<a href="otjld/def/s4.html#s4.9.3"><img src="../icons/ot_paragraph.gif"> 4.9.3</a>).
+
+ <dt>role files
+ <dd>
+ &ndash; adding <code>@role</code> javadoc tags referring to a team's role files (<a href="otjld/def/s1.html#s1.2.5.d"><img src="../icons/ot_paragraph.gif"> 1.2.5.d</a>).
+ <dt>coding style
+ <dd>
+ &ndash; change import to "<code class="keyword">import <strong>base</strong></code> ...", (<a href="otjld/def/s2.html#s2.1.2.d"><img src="../icons/ot_paragraph.gif"> 2.1.2(d)</a>)<br/>
+ &ndash; change qualified reference to a role's base class to using a simple name and "<code class="keyword">import <strong>base</strong></code> ...", <br/>
+ &ndash; migrate syntax for externalized role from "<code>anchor.R</code>" to "<code>R&lt;@anchor&gt;</code>" (<a href="otjld/def/s1.html#s1.2.2.b"><img src="../icons/ot_paragraph.gif"> 1.2.2(b)</a>).<br/>
+ &ndash; adding a missing <code>@Override</code> annotation to a role class that overrides a corresponding role from the super team (<a href="otjld/def/s1.html#s1.3.1.c"><img src="../icons/ot_paragraph.gif"> 1.3.1(c)</a>).<br />
+ &ndash; adding a missing <code>@Override</code> annotation to a role method that overrides a corresponding method from the implicit super role.<br />
+ </dl>
+
+ <u>Additionally, some standard Java quickfixes and content assists have been extended to be applicable for OT/J elements, too.</u>
+ <dl>
+ <dt>suppress warnings
+ <dd>&ndash; <code style="color:#505050;">@SuppressWarnings</code> annotations can be added to method bindings, too.
+ <dt>create method
+ <dd>&ndash; applies to unresolved method specs in callout/callin bindings, too.<br />
+ &ndash; generate inherited abstract methods also respects implicit inheritance.
+ <dt>organize imports
+ <dd>&ndash; creates "<code class="keyword">import <strong>base</strong></code> ...", if appropriate
+ <dt><em>and more..</em>
+ </dl>
+ </body>
+</html>
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/refactoring.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/refactoring.html
new file mode 100644
index 000000000..b765934e1
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/refactoring.html
@@ -0,0 +1,32 @@
+<html>
+ <head>
+ <meta name="copyright" content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel=stylesheet type="text/css" href="../css/book.css">
+ <title>Refactoring Object Teams programs</title>
+ <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+ </head>
+ <body>
+ <h1>Refactoring Object Teams programs</h1>
+ <p style="margin:20px;"><em><u>Note:</u>
+ The extended refactoring support has been developed based on Eclipse 3.0.
+ Some of this functionality has not yet been ported to Eclipse 3.5 and thus is not yet available in OTDT 1.3.0.<br>
+ Work is underway to integrate even more complete refactoring support later in the 1.3 cycle.
+ </em></p>
+ <p>Significant work has been put into supporting the automated refactoring of OT/J code.
+The following refactorings take into account the Object Teams-specific
+relationships (implicit role inheritance, team nesting, role-base bindings and method
+bindings).
+<ul>
+<li>Extract Method
+<li>Move Method
+<li>Rename Method
+<li>Rename Project
+<li>Rename Source folder
+<li>Rename Field
+</ul>
+The Rename Package refactoring is also available, with the only limitation
+that you cannot rename team-packages. The Rename Type refactoring does not
+yet support role files (<a href="otjld/def/s1.html#s1.2.5"><img width="15" border="0" src="../images/ot_paragraph.gif"> 1.2.5</a>).
+ </p>
+ </body>
+</html>
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/running.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/running.html
new file mode 100644
index 000000000..d9ec72841
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/running.html
@@ -0,0 +1,84 @@
+<html>
+ <head>
+ <meta name="copyright" content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel=stylesheet type="text/css" href="../css/book.css">
+ <link rel=stylesheet type="text/css" href="otguide.css">
+ <title>Running Object Teams programs</title>
+ <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+ </head>
+ <body>
+ <h1>Running Object Teams programs</h1>
+ <p>
+ Technically running an Object Teams program involves a special runtime enviroment
+ (the <strong>OTRE - Object Teams Runtime Environment</strong>) which provides fundamental classes
+ and performs load-time weaving for connecting aspects with their bases.
+ All this is hidden as to make running Object Teams programs as easy as running Java programs.
+ </p>
+ <p style="margin-left:20px;margin-right:40px;font-style:italic;">
+ The OT/J specific launch types (<img src="../images/otj_launch.gif" valign="absmiddle"> Object Teams Application, <img src="../images/ote_launch.gif" valign="absmiddle"> Object Teams Eclipse Application <img src="../images/ote_osgi_launch.gif" valign="absmiddle"> OT/Equinox Framework) are no longer needed and are gradually being faded out.
+ </p>
+ <p>
+ For launching OT/J programs use any of the launching techniques offered by Eclipse:
+ You may, e.g., invoke a <span class="ui">Run As</span>/<span class="ui">Debug As</span> option
+ from a context menu or use one of the run/debug tool bar buttons.
+ From here just select one of the standard launch configuration types:
+ <ul>
+ <li><a href="#JavaApp"><img src="images/java_app.gif" valing="absmiddle"> Java Application</a></li>
+ <li><a href="#RemoteJavaApp"><img src="images/java_attach.gif" valing="absmiddle"> Remote Java Application</a></li>
+ <li><a href="#JavaApp"><img src="images/julaunch.gif" valing="absmiddle"> JUnit</a></li>
+ <li><a href="#Plugin"><img src="images/julaunchpgn.gif" valing="absmiddle"> JUnit Plug-in Test</a></li>
+ <li><a href="#Plugin"><img src="images/eclipse_launcher.gif" valing="absmiddle"> Eclipse Application</a></li>
+ <li><a href="#OSGi"><img src="images/bundle_obj.gif" valing="absmiddle"> OSGi Framework</a></li>
+ </ul>
+ All these launches now consistently provide one additional checkbox, which is shown next to where the Runtime JRE is configured.
+ </p>
+
+ <p style="margin-top:30px;"><a name="JavaApp"/>
+ For <strong>Java Applications</strong> (<img src="images/java_app.gif" valing="absmiddle">, <img src="images/julaunch.gif" valing="absmiddle">) this checkbox is found on the <img src="images/library_obj.gif"><code>JRE</code> tab:
+ </p>
+ <p><img src="images/screenshots/JRETab.png"></p>
+ <ul>
+ <li style="margin-bottom:7px;">If the new option is checked the application will be launched with the Object Teams Runtime Environment (OTRE) enabled which is needed to weave callin bindings into base classes. Conversely, disabling the OTRE lets you run an OT/J application with all callin-bindings disabled. But note that a few more OT/J mechanisms will not work either (like decapsulation).</li>
+ <li style="margin-bottom:7px;">For OT/J projects this option is enabled by default.</li>
+ <li style="margin-bottom:7px;">If <span class="ui">Enable OTRE</span> is checked an additional <a href="#activation"><img valing="absmiddle" src="../images/team_obj.gif"><code>Team Activation</code> tab</a> will be shown.<br>
+ <i>(If a launch configuration was opened while the OTRE was disabled, you need to re-open this configuration (e.g., unselect and select) in order for the new tab to show.)</i></li>
+ <li>Additionally, the check box <span class="ui">Java 5 JPLIS Launching</span> lets you select between two technologies (JMangler vs. JPLIS),
+ by which the OTRE is hooked into the JVM. The newer option JPLIS has graduated from experimental status and its use is now encouraged.
+ </ul>
+ </p>
+
+ <p style="margin-top:30px;"><a name="RemoteJavaApp"/>
+ For <strong>Remote Debugging</strong> of a java applications</strong> (<img src="images/java_attach.gif" valing="absmiddle">) this checkbox is found on the <img src="images/disconnect_co.gif"><code>Connect</code> tab:
+ </p>
+ <p><img alt="Remote Debugging" src="images/screenshots/RemoteDebugging.png" /></p>
+
+ <p style="margin-top:30px;"><a name="Plugin">
+ For launching a <strong>Runtime Workbench</strong> (<img src="images/julaunchpgn.gif" valing="absmiddle">, <img src="images/eclipse_launcher.gif" valing="absmiddle">) the new checkbox is right on the main page:
+ </p>
+ <p><img src="images/screenshots/RuntimeWorkbenchMainTab.png">
+ </p>
+ <p style="margin-top:30px;"><a name="OSGi">
+ For <strong>OSGi Framework</strong> launches (<img src="images/bundle_obj.gif" valing="absmiddle">) the runtime environment is configured on the <code>Settings</code> tab:
+ </p>
+ <p><img src="images/screenshots/OSGiLaunchSettings.png"></p></td></tr>
+
+
+ <h2><a name="activation">Team activation:</a></h2>
+ <p>
+ I you wish to compose your program from a base application and a number of aspects,
+ you may use a launch configuration to select which aspects should be included.
+ Use the tab <b><img src="../images/team_obj.gif">Team Activation</b>
+ to select existing teams and put them into the desired order.
+ </p><p>
+ The effect is that each team in the list will be instantiated and activated before
+ the main method of the program executes. This can actually be observed if <span class="ui">Stop in main</span>
+ is checked for debugging: the program will actually stop <i>before</i> entering main, the next step
+ will perform all pending team instantiations/activations and only then the program starts
+ (You might want to use the <a href="teammonitor.html">team monitor</a> to observe
+ team instantiation/activation).
+ </p>
+ <p>Since a team can intercept method calls in a base application simply adding a team to
+ an existing application can indeed produce different behavior.
+ </p>
+ </body>
+</html>
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/stepping.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/stepping.html
new file mode 100644
index 000000000..b701c7b4a
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/stepping.html
@@ -0,0 +1,149 @@
+<html>
+ <head>
+ <meta name="copyright" content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel=stylesheet type="text/css" href="../css/book.css">
+ <link rel=stylesheet type="text/css" href="otjld/css/ot.css">
+ <link rel=stylesheet type="text/css" href="otguide.css">
+ <style type="text/css">
+.high { background-color:#fff0c8;color:black; }
+.pale { color:#b6b6d1; }
+.caption { text-decoration:underline; vertical-align:top;position:relative;top:20px; margin-top:10px;}
+ </style>
+ <title>Debugging OT/J programs - Team Monitor View</title>
+ <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+ </head>
+ <body>
+ <h1>Stepping through OT/J code</h1>
+ The byte code into which OT/J programs are translated has some significant differences
+ to the original source code. In order to hide some generated code and to provide
+ convenient stepping even through declarative method bindings, the debug view has
+ been enhanced for OT/J.
+ <h2>Filtering infrastructure code</h2>
+ <p>
+ By default the debugger is configured to filter certain packages in order to hide
+ the Object Teams Runtime Environment (OTRE) and its libraries. This means that
+ the debugger will not show stack frames corresponding to the OTRE while stepping
+ through code. This filtering can be disabled on the preference page at <code class="high">Object&nbsp;Teams&nbsp;&mdash;&nbsp;Debug</code>
+ </p>
+ <a name="prefs"><img src="images/screenshots/debug_prefs_filtering.png" /></a>
+ <h2>Callin bindings</h2>
+ <p>
+ In order to realize the runtime dispatch for callin bindings, additional dispatch
+ code is generated and woven into the byte code of bound base classes.
+ Most of this dispatch code is hidden by the debugger,
+ but an abstract view of it is presented
+ in order to support different paths of stepping into/through/over callin bindings.
+ </p>
+ <p>
+ Typical stepping paths will be explained using the example <code>OTSample-Flightbonus</code>
+ which can be installed using the wizard at
+ <code><ul><li>New...<ul><li>Other... <ul><li>Code Samples</li></ul></li></ul></li></ul></code>
+ </p>
+ <p>
+ After the example has been installed and configured for running with the team
+ <code>GUIConnector</code> activated (see the example's documentation),
+ assume a new passenger has been registered and subscribed for the bonus system.
+ Also assume a <img src="images/brkp_obj.gif"/>line breakpoint has been set somewhere in method <code>Segment#book()</code>.
+ When the lastly added passenger books a flight, this line breakpoint is triggered.
+ </p>
+ <table>
+ <tr><td colspan=2>
+ From here on stepping proceeds as follows:
+ <ul>
+ <li style="list-style-image: url('images/stepover_co.gif');"> Step (<b>F6</b>) out of method <code>book()</code> until the debugger jumps to the top of the current method <code>book(Passenger)</code>:</li>
+ </ul>
+ <tr><td class="caption">Hitting callin dispatch: <td><img src="images/screenshots/stack_hit_callin.png" />
+
+ <tr><td colspan=2>
+ At this point the debug view signals that some dispatch is pending for method <code>book</code>. A few words on what you see in this picture:
+ <ul>
+ <li>The current stack frame says <code class="high">{{Dispatch callins for book}}</code>, at what time the list of currently active teams is investigated.<br>
+ This stack frame is drawn in a <span class="pale">pale color</span> (unless <span class="high">highlighted</span>) to visualize that this is generated code.<br>
+ If multiple teams are active that have interest in this method, the generated dispatch code will be invoked recursively,
+ causing multiple stack frames to show up in the debug view.</li>
+ <li>Below you see another pale stack frame saying <code class="high">[about to enter]</code>. This stack frame contains no interesting code
+ and can safely be ignored.</li>
+ <li>The highlighted line in the editor has a <a href="callinmarker.html">callin marker</a> (<img src="../images/callinbinding_obj.gif">) associated, hinting at the callin bindings that are about to fire
+ (see also the hover of this line's annotations).</li>
+ </ul>
+ You now have two options:
+ <ul>
+ <li style="list-style-image: url('images/stepreturn_co.gif');">If at this point <b>F7</b> is pressed the debugger skips over all dispatching and
+ proceeds in the base program.</li>
+ <li style="list-style-image: url('images/stepinto_co.gif');">By pressing <b>F5</b> you <i>enter</i> the current callin binding:
+ </ul>
+
+ <tr><td class="caption">Entering a callin binding: <td><img src="images/screenshots/stack_entered_callin.png" />
+
+ <tr><td colspan=2>
+ Now the debug view displays a new
+ faked stack frame labeled with the callin binding: <code class="high">[Item.earnCredit&lt;-book]</code>.
+ <ul>
+ <li style="list-style-image: url('images/stepinto_co.gif');">The next <b>F5</b> takes you to the lifting translation (this step is missing if dispatching to a static role method).</li>
+ </ul><br />
+
+ <tr><td class="caption">Lifting: <td><img src="images/screenshots/stack_lifting.png" />
+
+ <tr><td colspan=2>
+ The above screenshot shows the debugger while a lifting translation is pending.
+ The Debug view signals this by the faked stack frame labeled <code class="high">{{Lift&nbsp;to&nbsp;Item}}</code>.<br>
+ Since no real source code exists for the lifting method the editor highlights the
+ <code class="keyword">playedBy</code> declaration from the class header.<br>
+ This declaration tells you that the current lifting operation will translate a <code>Segment</code>
+ into an <code>Item</code>.
+ You'll normally want to just leave the lifting method:
+ <ol>
+ <li style="list-style-image: url('images/stepreturn_co.gif');"><b>F7</b> (or F6) takes you out off the lifting method and back to the callin binding.
+ <li style="list-style-image: url('images/stepinto_co.gif');"><a name="abouttoentermethod">Once more pressing <b>F5</b></a> finally steps into the bound role method.<br>
+ If a guard predicate were present, the guard would be entered here, before finally proceeding to the role method.<br>
+ Of course, entering a guard predicate can be skipped by pressing F6 at that point.
+ </ol>
+
+ <tr><td class="caption">Entering the role method: <td><img src="images/screenshots/stack_entered_earnCredit.png" />
+ <tr><td colspan=2>
+ At this point you're back in a normal Java method (role method), just the pale and green stack frames tell you
+ that you haven't entered this method via a normal method call but via callin dispatch.<br>
+ If we would be looking at a callin method with a base call, stepping into that base call
+ would also trigger some dispatch before either stepping into the original base method
+ or proceeding with dispatching to other pending callin bindings.</td></tr>
+ </table>
+ <h2>Stack frame coloring</h2>
+ In the above screenshots you see some stack frames printed in colors.
+ While the exact colors to use can be configured in the preference page shown <a href="#prefs">above</a>,
+ the meaning of colors is as follows:
+ <dl>
+ <dt style="color:#B6B6D1;">light purple
+ <dd>Dispatch code with no direct correspondence in the source code.</dd>
+ <dt style="color:#189810;">green</span>
+ <dd>Callin binding declarations and base-calls &ndash; each green stack frame signals a crossing of a team boundary.</dd>
+ </dl>
+ <h2><a name="configure"></a>Configuring the callin stepping behavior</h2>
+ <p>
+ In the above scenario the debugger stops at several locations where the current stack frame says: <code class="pale">{{Dispatching callins for book}}</code>.<br>
+ All these locations can be configured such that the debugger will automatically step into the next action.<br>
+ Looking again at the preference page <code class="high">Object Teams &mdash; Debug</code>:
+ </p>
+ <img src="images/screenshots/debug_prefs_callin_stepping.png" />
+ <p>
+ The highlighted section of this preference page shows three options, each of which represents a particular kind of dispatching situation:
+ <dl>
+ <dt>Pending dispatch to the callin binding:</dt>
+ <dd>The next step-into will take you to a callin method binding, because an active team instance claims interest in the control flow.<br>
+ At this stage the appropriate team instance has already been selected, however, guard predicates may still cancel dispatch to the role method.</dd>
+ <dt>Pending recursive dispatch:</dt>
+ <dd>The next step-into will take you into the next recursion of the current dispatch method.<br>
+ This is relevant mostly if you want to analyze how multiple teams that affect the same base method are scheduled.<br>
+ When enabling the display of OT/J internal variables you may inspect the internal iterator of team instances (an array of teams plus an index into the array).</dd>
+ <dt>Pending call to the original base method</dt>
+ <dd>This signifies the final iteration of the dispatch code at what point the original method will be entered by the next step-into.</br>
+ This stage can, e.g., be reached when a <code class="keyword">callin</code> method has issued a base-call.<br>
+ Instead of directly entering the base method, the dispatch code needs to take over,
+ because more team instances might be waiting to receive the control.</dd>
+ </dl>
+ By default all of these pending actions are visualized as mentioned.<br>
+ Disabling any of the check boxes causes the debugger to skip the corresponding step and automatically step into the pending method.<br>
+ In this mode debugging may be faster, because fewer steps are needed, but the execution may jump to unpredicted locations.<br>
+ If the scheduling of perhaps multiple active teams needs investigation, the more verbose modes might be of more help.
+ </p>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/syntaxhighlight.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/syntaxhighlight.html
new file mode 100644
index 000000000..b04a6794d
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/syntaxhighlight.html
@@ -0,0 +1,18 @@
+<html>
+ <head>
+ <meta name="copyright" content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel=stylesheet type="text/css" href="../css/book.css">
+ <link rel=stylesheet type="text/css" href="otjld/css/ot.css">
+ <link rel=stylesheet type="text/css" href="otguide.css">
+ <title>OT/J syntax highlighting</title>
+ <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+ </head>
+ <body>
+ <h1>OT/J syntax highlighting</h1>
+ <p>In addition to the <b>syntax highlighting</b> for standard Java keywords and
+ modifiers incorporated in the <a href="/help/topic/org.eclipse.jdt.doc.user/concepts/concepts-7.htm">Java editor</a>,
+ the new Object Teams specific keywords and modifiers like <code class="keyword">team, playedBy, callin,
+ base, within</code> etc. are also highlighted for better accentuation and clearness.
+ </p>
+ </body>
+</html>
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/teammonitor.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/teammonitor.html
new file mode 100644
index 000000000..16c273ea0
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/teammonitor.html
@@ -0,0 +1,42 @@
+<html>
+ <head>
+ <meta name="copyright" content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel=stylesheet type="text/css" href="../css/book.css">
+ <link rel=stylesheet type="text/css" href="otguide.css">
+ <title>Debugging OT/J programs - Team Monitor View</title>
+ <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+ </head>
+ <body>
+ <h1>Team Monitor View</h1>
+ <p>
+ A special view exists for monitoring which team instances have been created and whether each
+ of them is currently active or not. When debugging callin bindings which do not trigger while
+ they are intended to do so, the team monitor should provide first help to find out whether
+ there is any active instance of the team being considered. If no active instance exists,
+ callins can not trigger.
+ </p>
+ <img src="images/screenshots/team_monitor_marked.png" />
+ <p>
+ The team monitor view is a variant of the variables view with the following features:
+ <ul>
+ <li>Display all instances of all teams in the system.
+ <li>Display the activation state of each team instance as one of
+ <br /><img src="images/team_inact.gif"> a team instance in not active (for the current thread, if one is selected)
+ <br /><img src="images/team_act.gif"> a team instance is active, either globally or for the
+ thread selected in the debug view
+ <br /><img src="images/team_act_implicit.gif"> a team instance is implicitly active due to executing a team or role method.
+ <li>Change the activation state of a team using the context menu (<span class="ui">Activate Team</span> or <span class="ui">Deactivate Team</span>).<br />
+ This operation affects the currently selected thread. If global (de)activation should be
+ achieved, select the debug target (<img src="images/debugt_obj.gif"/>) instead of any individual thread.
+ <li>Inspect fields of a team instance or perform any operation inherited from the <a href="debugging.html#variables">variables view</a>.<br/>
+ Note, that filtering of OT/J Internal Variables is also supported (and enabled by default).
+ </ul>
+ <i>Note that teams may only appear if a thread is currently suspended. If teams are visible while
+ all threads are running, the <span class="ui">Activate Team</span> or <span class="ui">Deactivate Team</span> options
+ cannot be performed.
+ </p>
+ <p><u>Technical note:</u> When debugging an Eclipse application or OSGi fragment with OT/Equinox enabled,
+ the team monitor can only work if an open Object Teams Plug-in Project can be found in the workspace.
+ If this requirement is not met a corresponding warning will be logged.</p>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/toc.xml b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/toc.xml
new file mode 100644
index 000000000..6b9cc405a
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/toc.xml
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?NLS TYPE="org.eclipse.help.toc"?>
+<?eclipse version="3.0"?>
+
+<toc label="Object Teams Development User Guide">
+ <topic label="Object Teams Development Tooling (OTDT)" href="guide/develop.html">
+ <topic label="OTDT Features" href="guide/features.html"/>
+ <topic label="Object Teams perspective" href="guide/perspective.html"/>
+ <topic label="Object Teams project creation" href="guide/project.html"/>
+ <topic label="Team and role creation wizards" href="guide/wizards.html"/>
+ <topic label="Java editor with Object Teams capability" href="guide/editor.html">
+ <topic label="OT/J syntax highlighting" href="guide/syntaxhighlight.html"/>
+ <topic label="OT/J content/code assist" href="guide/contentassist.html">
+ <topic label="OT/J code completion" href="guide/completion.html"/>
+ <topic label="OT/J quick fixes" href="guide/quickfix.html"/>
+ </topic>
+ <topic label="Binding markers" href="guide/callinmarker.html"/>
+ </topic>
+ <topic label="Object Teams structural/navigational views" href="guide/views.html">
+ <topic label="OT/J package explorer" href="guide/packageexplorer.html"/>
+ <topic label="OT/J outline" href="guide/outline.html"/>
+ <topic label="OT/J type hierarchy" href="guide/typehierarchy.html"/>
+ <topic href="guide/callhierarchy.html" label="Call hierarchy extended for OT/J">
+ </topic>
+ </topic>
+ <topic label="Compiling Object Teams programs" href="guide/compilation.html">
+ <topic label="Java builder extended for Object Teams" href="guide/builder.html"/>
+ </topic>
+ <topic label="Running Object Teams programs" href="guide/running.html"/>
+ <topic label="Debugging Object Teams programs" href="guide/debugging.html">
+ <topic label="Team monitor view" href="guide/teammonitor.html"/>
+ <topic label="Stepping through OT/J code" href="guide/stepping.html"/>
+ </topic>
+ <topic label="Refactoring Object Teams programs" href="guide/refactoring.html"/>
+ </topic>
+ <topic label="Object Teams Language Definition" href="/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/index.html">
+ <topic label="Teams and Roles" href="/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/s1.html"/>
+ <topic label="Role Binding" href="/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/s2.html"/>
+ <topic label="Callout Binding" href="/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/s3.html"/>
+ <topic label="Callin Binding" href="/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/s4.html"/>
+ <topic label="Team Activation" href="/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/s5.html"/>
+ <topic label="Object Teams API" href="/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/s6.html"/>
+ <topic label="Role Encapsulation" href="/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/s7.html"/>
+ <topic label="Value Dependent Classes" href="/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/s9.html"/>
+ <topic label="OT/J Syntax" href="/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/sA.html"/>
+ <topic label="Changes between versions" href="/org.eclipse.objectteams.otdt.ui.help/guide/otjld/def/sB.html"/>
+ </topic>
+ <topic label="OT/Equinox Extension Points Reference">
+ <topic label="org.eclipse.objectteams.otequinox.aspectBindings" href="/org.eclipse.objectteams.otdt.ui.help/reference/extension-points/org_objectteams_otequinox_aspectBindings.html"/>
+ <topic label="org.eclipse.objectteams.otequinox.aspectBindingNegotiators" href="/org.eclipse.objectteams.otdt.ui.help/reference/extension-points/org_objectteams_otequinox_aspectBindingNegotiators.html"/>
+ </topic>
+</toc>
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/typehierarchy.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/typehierarchy.html
new file mode 100644
index 000000000..5b7aa287e
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/typehierarchy.html
@@ -0,0 +1,61 @@
+<html>
+ <head>
+ <meta name="copyright" content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel=stylesheet type="text/css" href="../css/book.css">
+ <title>Object Teams Type Hierarchy</title>
+ <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+ <style type="text/css">
+ h2 {color: blue}
+ h3 {color: green}
+ </style>
+ </head>
+ <body>
+ <h1>Object Teams Type Hierarchy</h1>
+ The <b>Object Teams type hierarchy</b> provides the following features
+ (in addition to the features of the standard JDT
+ <a href="/help/topic/org.eclipse.jdt.doc.user/reference/ref-type-hierarchy.htm">
+ type hierarchy view</a>):
+ <h3>Type hierarchy tree:</h3>
+ <ul>
+ <li>shows <b>supertype/subtype hierarchy</b> of Object Teams types (team classes,
+ role classes)
+ </li>
+ <li>shows full <b>role type hierarchy</b> incl. <b>implicit inheritance</b></li>
+ <li>displays <b>Object Teams specific icons</b> for team classes, role classes and
+ method bindings
+ </li>
+ </ul>
+ <h3>Member list (method viewer):</h3>
+ <ul>
+ <li>shows <b>methods</b> in hierachy</li>
+ <li>shows <b>implicitly inherited methods</b></li>
+ <li>shows <b>method bindings</b></li>
+ <li>shows <b>inherited method bindings</b></li>
+ </ul>
+
+ <h2>Opening a type hierarchy on the current text selection</h2>
+ To open a type hierarchy on a text selection, select the name of an Object Teams element
+ or Java element in the editor or package explorer and do one of the following:
+ <ul>
+ <li>Press <b>F4</b></li>
+ <li>select <b>Open Type Hierarchy</b> from the package explorer's pop-up menu</li>
+ </ul>
+ <b>Note</b>: If the selected Object Teams element or Java element is not a type or a
+ compilation unit, the hierarchy opens on the type enclosing the current selection.
+ <p>
+ <strong>Type hierarchy</strong>:<br>
+ <img src="images/screenshots/typeHierarchy.jpg"
+ styles="left" alt="Object Teams type hierarchy view">
+ </p>
+ <p>
+ <strong>Role hierarchy</strong>:<br>
+ <img src="images/screenshots/implicitRoleHierarchy.jpg"
+ styles="bottom" alt="Object Teams implicit role hierarchy view">
+ </p>
+ Note, that for roles, the super types are not restricted to a linear chain, but due to combination
+ of explicit and implicit inheritance (<a href="otjld/def/s1.html#s1.3.1">OTJLD &sect;1.3.1 </a>)
+ a role may have multiple supers. E.g., in the picture, <code>HierarchyDisplayImpl.CompositeNode</code>
+ explicitly inherits from <code>HierarchyDisplayImpl.Node</code> and implicitly
+ inherits from <code>HierarchyDisplay.CompositeNode</code>.
+ </body>
+</html>
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/views.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/views.html
new file mode 100644
index 000000000..00ce24c0b
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/views.html
@@ -0,0 +1,20 @@
+<html>
+ <head>
+ <meta name="copyright" content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel=stylesheet type="text/css" href="../css/book.css">
+ <title>Structural views</title>
+ <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+ </head>
+ <body>
+ <h1>Object Teams structural/navigational views</h1>
+ The following structural/navigational views have been extended for Object Teams
+ in order to represent Object Teams elements (team classes, role classes, callin/callout
+ bindings):
+ <ul>
+ <li><b><a href="packageexplorer.html">package explorer</a></b></li>
+ <li><b><a href="outline.html">outline</a></b></li>
+ <li><b><a href="typehierarchy.html">type hierarchy</a></b></li>
+ <li><b><a href="callhierarchy.html">call hierarchy</a></b></li>
+ </ul>
+ </body>
+</html>
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/webindex.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/webindex.html
new file mode 100644
index 000000000..eb1cda39e
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/webindex.html
@@ -0,0 +1,56 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+
+<html>
+ <head>
+ <meta name="copyright" content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel=stylesheet type="text/css" href="../css/book.css">
+ <style type="text/css">
+ td,th {padding-left:15px; padding-right:15px; padding-top:2px; padding-bottom:2px;};
+ </style>
+ <title>OTDT Feature List</title>
+ </head>
+<body>
+
+<h1>Object Teams Development User Guide</h1>
+<ul>
+ <li><a href="develop.html">Object Teams Development Tooling (OTDT)</a>
+ <ul>
+ <li><a href="features.html">OTDT Features</a></li>
+ <li><a href="perspective.html">Object Teams perspective</a></li>
+ <li><a href="project.html">Object Teams project creation</a></li>
+ <li><a href="wizards.html">Team and role creation wizards</a></li>
+ <li><a href="editor.html">Java editor with Object Teams capability</a>
+ <ul>
+ <li><a href="syntaxhighlight.html">OT/J syntax highlighting</a></li>
+ <li><a href="contentassist.html">OT/J content/code assist</a>
+ <ul>
+ <li><a href="completion.html">OT/J completion</a></li>
+ <li><a href="quickfix.html">OT/J quick fixes</a></li>
+ </ul>
+ </li>
+ <li><a href="callinmarker.html">Callin marker</a></li>
+ </ul></li>
+ <li><a href="views.html">Object Teams structural/navigational views</a>
+ <ul>
+ <li><a href="packageexplorer.html">Object Teams package explorer</a></li>
+ <li><a href="outline.html">Object Teams outline</a></li>
+ <li><a href="typehierarchy.html">Object Teams type hierarchy</a></li>
+ <li><a href="callhierarchy.html">Call hierarchy extended for OT/J</a></li>
+ </ul></li>
+ <li><a href="compilation.html">Compiling Object Teams programs</a>
+ <ul>
+ <li><a href="builder.html">Java builder extended for Object Teams</a></li>
+ </ul></li>
+ <li><a href="running.html">Running Object Teams programs</a></li>
+ <li><a href="debugging.html">Debugging Object Teams programs</a>
+ <ul>
+ <li><a href="teammonitor.html">Team monitor view</a></li>
+ <li><a href="stepping.html">Stepping through callin bindings</a></li>
+ </ul>
+ </li>
+ <li><a href="refactoring.html">Refactoring Object Teams programs</a></li>
+ </li></ul>
+ <li><a href="otjld/def/index.html">Object Teams Language Definition</a></li>
+</ul>
+</body>
+</html>
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/guide/wizards.html b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/wizards.html
new file mode 100644
index 000000000..d08f78f83
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/guide/wizards.html
@@ -0,0 +1,89 @@
+<html>
+ <head>
+ <meta name="copyright" content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel=stylesheet type="text/css" href="../css/book.css">
+ <title>Team and role creation wizards</title>
+ <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+ <style type="text/css">
+ h2 {color: orange}
+ h3 {color: blue}
+ h4 {color: brown}
+ </style>
+ </head>
+ <body>
+ <h1>Team and role creation wizards</h1>
+ <h2>Team wizard</h2>
+ <p>
+ <img src="images/screenshots/teamWizard.jpg"
+ alt="Wizard for creating a new team class">
+ </p>
+ <h3>Opening the team wizard</h3>
+ The easiest way to create a new team class is to use the team wizard.
+ First select the container where you want the new team class to reside.
+ Then the wizard can be opened either by selecting <b>File > New > Team</b> from the main
+ workbench window or by selecting <b>New > Team</b> from the container's pop-up menu or
+ by choosing <b>Team</b> from the drop-down menu on the <b>New</b> button in the
+ workbench toolbar.
+ <h3>Define settings / enter information</h3>
+ Most settings for a new team correspond exactly to those specified for a regular
+ <a href="/help/topic/org.eclipse.jdt.doc.user/reference/ref-126.htm">Java class</a>.
+ <h4>Edit using the Binding Editor</h4>
+ If a super-team has been selected and if the team should be constructed as a <i>connector</i>
+ the binding editor can be launched for adding class and method bindings.
+ <h3>Resulting effects</h3>
+ By clicking the <b>Finish</b> button the team is created with the chosen properties.
+ The tree view of the package explorer and the outline is updated and the new team is
+ displayed.<br><br>
+ <h2>Role wizard</h2>
+ <p>
+ <img src="images/screenshots/roleWizard.jpg"
+ alt="Wizard for creating a new role class">
+ </p>
+ <h3>Opening the role wizard</h3>
+ The easiest way to create a new role class is to use the role wizard.
+ First select the container where you want the new role class to reside.
+ Then the wizard can be opened either by selecting <b>File > New > Role</b> from the main
+ workbench window or by selecting <b>New > Role</b> from the container's pop-up menu or
+ by choosing <b>Role</b> from the drop-down menu on the <b>New</b> button in the
+ workbench toolbar.
+ <h3>Define settings / enter information</h3>
+ <h4>Source folder and enclosing team</h4>
+ The fields of the source folder and the enclosing team incorporate the same semantics
+ as in the team creation wizard. Entries can be modified/changed by clicking the
+ respective <b>Browse...</b> button and choosing a folder and team class in the selection
+ dialog respectively. The fully qualified name of the enclosing team is displayed unless
+ it stands in the default package. A role is inlined by default, i.e. a role is defined
+ inside the specified enclosing team. If an external role should be created the checkbox
+ "inlined" has to be deselected.<br>
+ <h4>Role name</h4>
+ A valid name for the new role class must be entered. The type name is mandatory.<br>
+ <h4>Modifiers</h4>
+ Possible visibility modifiers for role types are <code>public</code> and
+ <code>protected</code>. Roles can also be either <code>abstract</code> or
+ <code>final</code>.<br>
+ <h4>Implicit superclass</h4>
+ The implicit superclass field is set automatically if the entered type name matches a
+ role type which already exists in a team class which is present in the supertype
+ hierarchy of the enclosing team. The fully qualified name of the implicit superclass is
+ then shown.<br>
+ <h4>Explicit superclass</h4>
+ Initially the explicit superclass is set to "java.lang.Object". It can be changed by
+ clicking the <b>Browse...</b> button and selecting a class from the selection dialog.
+ A role can explicitly inherit from another role class of the same team or from any other
+ regular class other than team classes.<br>
+ <h4>Bound base class</h4>
+ A bound base class can be defined by clicking the <b>Browse...</b> button and selecting
+ a class from the selection dialog. A bound base class can be any class.<br>
+ <h4>Interfaces</h4>
+ Interfaces which the role should implement can be added/removed with the <b>Add.../
+ Remove</b> buttons.
+ <h4>Method stubs</h4>
+ Method stubs for inherited abstract methods can be created by selecting the according
+ checkbox. The checkbox is selected by default.
+ <h3>Resulting effects</h3>
+ By clicking the <b>Finish</b> button the role with the chosen properties is created
+ inside the enclosing team, or, in the case of an external role, in a package which has
+ the name of the enclosing team. The tree view of the package explorer and the outline
+ is updated and the new role is displayed.
+ </body>
+</html>
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/icons/clcl16/nav_backward.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/icons/clcl16/nav_backward.gif
new file mode 100644
index 000000000..740e8cae8
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/icons/clcl16/nav_backward.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/icons/clcl16/nav_forward.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/icons/clcl16/nav_forward.gif
new file mode 100644
index 000000000..19567890a
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/icons/clcl16/nav_forward.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/icons/clcl16/nav_home.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/icons/clcl16/nav_home.gif
new file mode 100644
index 000000000..77efb692e
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/icons/clcl16/nav_home.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/icons/dlcl16/nav_backward.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/icons/dlcl16/nav_backward.gif
new file mode 100644
index 000000000..82b0e87bc
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/icons/dlcl16/nav_backward.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/icons/dlcl16/nav_forward.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/icons/dlcl16/nav_forward.gif
new file mode 100644
index 000000000..3f3e5ebd0
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/icons/dlcl16/nav_forward.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/icons/dlcl16/nav_home.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/icons/dlcl16/nav_home.gif
new file mode 100644
index 000000000..4d5d56ecc
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/icons/dlcl16/nav_home.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/icons/elcl16/nav_backward.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/icons/elcl16/nav_backward.gif
new file mode 100644
index 000000000..740e8cae8
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/icons/elcl16/nav_backward.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/icons/elcl16/nav_forward.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/icons/elcl16/nav_forward.gif
new file mode 100644
index 000000000..19567890a
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/icons/elcl16/nav_forward.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/icons/elcl16/nav_home.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/icons/elcl16/nav_home.gif
new file mode 100644
index 000000000..77efb692e
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/icons/elcl16/nav_home.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/icons/ot_paragraph.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/icons/ot_paragraph.gif
new file mode 100644
index 000000000..456fde939
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/icons/ot_paragraph.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/icons/sample.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/icons/sample.gif
new file mode 100644
index 000000000..34fb3c9d8
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/icons/sample.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/images/baseguard_obj.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/images/baseguard_obj.gif
new file mode 100644
index 000000000..85d8fa776
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/images/baseguard_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/images/boundrole_co.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/images/boundrole_co.gif
new file mode 100644
index 000000000..5ff97896e
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/images/boundrole_co.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/images/built-on-eclipse.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/images/built-on-eclipse.gif
new file mode 100644
index 000000000..c24d07a3d
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/images/built-on-eclipse.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/images/callinbinding_obj.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/images/callinbinding_obj.gif
new file mode 100644
index 000000000..b3b5254d7
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/images/callinbinding_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/images/callinbindingafter_obj.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/images/callinbindingafter_obj.gif
new file mode 100644
index 000000000..dde17c8e4
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/images/callinbindingafter_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/images/callinbindingbefore_obj.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/images/callinbindingbefore_obj.gif
new file mode 100644
index 000000000..c71a184db
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/images/callinbindingbefore_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/images/callinbindingreplace_obj.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/images/callinbindingreplace_obj.gif
new file mode 100644
index 000000000..0000be342
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/images/callinbindingreplace_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/images/callinmethod_co.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/images/callinmethod_co.gif
new file mode 100644
index 000000000..04cdef143
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/images/callinmethod_co.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/images/callout_marker.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/images/callout_marker.gif
new file mode 100644
index 000000000..afd816da6
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/images/callout_marker.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/images/calloutbinding_obj.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/images/calloutbinding_obj.gif
new file mode 100644
index 000000000..f96f75506
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/images/calloutbinding_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/images/class_hi.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/images/class_hi.gif
new file mode 100644
index 000000000..9af8584f0
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/images/class_hi.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/images/class_public.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/images/class_public.gif
new file mode 100644
index 000000000..e2bf583f5
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/images/class_public.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/images/external_roles.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/images/external_roles.gif
new file mode 100644
index 000000000..b9a2c5643
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/images/external_roles.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/images/file_obj.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/images/file_obj.gif
new file mode 100644
index 000000000..b226e41c5
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/images/file_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/images/guard_obj.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/images/guard_obj.gif
new file mode 100644
index 000000000..67c562375
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/images/guard_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/images/heading_left.png b/plugins/org.eclipse.objectteams.otdt.ui.help/images/heading_left.png
new file mode 100644
index 000000000..bc2bff7d4
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/images/heading_left.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/images/heading_right.png b/plugins/org.eclipse.objectteams.otdt.ui.help/images/heading_right.png
new file mode 100644
index 000000000..3c4af599d
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/images/heading_right.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/images/jar_src_obj.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/images/jar_src_obj.gif
new file mode 100644
index 000000000..a6e9c69dd
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/images/jar_src_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/images/jcu_obj.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/images/jcu_obj.gif
new file mode 100644
index 000000000..200e5ed8f
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/images/jcu_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/images/line.rainbow.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/images/line.rainbow.gif
new file mode 100644
index 000000000..212443d52
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/images/line.rainbow.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/images/newpprj_wiz.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/images/newpprj_wiz.gif
new file mode 100644
index 000000000..98fb8a0ed
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/images/newpprj_wiz.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/images/newprj_wiz.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/images/newprj_wiz.gif
new file mode 100644
index 000000000..858f4c988
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/images/newprj_wiz.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/images/ot-eclipse.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/images/ot-eclipse.gif
new file mode 100644
index 000000000..9940eb12c
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/images/ot-eclipse.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/images/ot_paragraph.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/images/ot_paragraph.gif
new file mode 100644
index 000000000..456fde939
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/images/ot_paragraph.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/images/ot_paragraph.png b/plugins/org.eclipse.objectteams.otdt.ui.help/images/ot_paragraph.png
new file mode 100644
index 000000000..d540c89a0
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/images/ot_paragraph.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/images/ote_launch.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/images/ote_launch.gif
new file mode 100644
index 000000000..9f24ffe51
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/images/ote_launch.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/images/ote_osgi_launch.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/images/ote_osgi_launch.gif
new file mode 100644
index 000000000..4e5be98f8
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/images/ote_osgi_launch.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/images/otj_launch.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/images/otj_launch.gif
new file mode 100644
index 000000000..8a004453e
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/images/otj_launch.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/images/over_co_ovr16.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/images/over_co_ovr16.gif
new file mode 100644
index 000000000..8533e2e1c
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/images/over_co_ovr16.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/images/package.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/images/package.gif
new file mode 100644
index 000000000..131c28da4
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/images/package.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/images/playedBy_obj.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/images/playedBy_obj.gif
new file mode 100644
index 000000000..85202819c
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/images/playedBy_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/images/plugin_obj.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/images/plugin_obj.gif
new file mode 100644
index 000000000..8493df40d
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/images/plugin_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/images/role_obj.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/images/role_obj.gif
new file mode 100644
index 000000000..2cb56c517
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/images/role_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/images/role_obj.png b/plugins/org.eclipse.objectteams.otdt.ui.help/images/role_obj.png
new file mode 100644
index 000000000..f89af2d0a
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/images/role_obj.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/images/role_ovr.png b/plugins/org.eclipse.objectteams.otdt.ui.help/images/role_ovr.png
new file mode 100644
index 000000000..a9d9dc39b
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/images/role_ovr.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/images/run_exc.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/images/run_exc.gif
new file mode 100644
index 000000000..57f410224
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/images/run_exc.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/images/team_act.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/images/team_act.gif
new file mode 100644
index 000000000..58a8638cc
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/images/team_act.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/images/team_act_implicit.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/images/team_act_implicit.gif
new file mode 100644
index 000000000..41dc6c2aa
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/images/team_act_implicit.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/images/team_inact.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/images/team_inact.gif
new file mode 100644
index 000000000..2b5ea0d1e
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/images/team_inact.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/images/team_obj.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/images/team_obj.gif
new file mode 100644
index 000000000..9958edfbb
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/images/team_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/images/team_ovr.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/images/team_ovr.gif
new file mode 100644
index 000000000..595f58495
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/images/team_ovr.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/images/team_package.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/images/team_package.gif
new file mode 100644
index 000000000..fa76f9983
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/images/team_package.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/images/team_role_obj.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/images/team_role_obj.gif
new file mode 100644
index 000000000..c1411d71e
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/images/team_role_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/images/team_role_ovr.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/images/team_role_ovr.gif
new file mode 100644
index 000000000..e2899350c
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/images/team_role_ovr.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/images/tm.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/images/tm.gif
new file mode 100644
index 000000000..67fd7ccab
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/images/tm.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/intro/css/graphics/obj_48/ot_obj.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/intro/css/graphics/obj_48/ot_obj.gif
new file mode 100644
index 000000000..f4e0f8f45
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/intro/css/graphics/obj_48/ot_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/intro/css/graphics/obj_48/otapp_obj.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/intro/css/graphics/obj_48/otapp_obj.gif
new file mode 100644
index 000000000..d501aef4f
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/intro/css/graphics/obj_48/otapp_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/intro/css/graphics/obj_48/otapphov_obj.png b/plugins/org.eclipse.objectteams.otdt.ui.help/intro/css/graphics/obj_48/otapphov_obj.png
new file mode 100644
index 000000000..3724dd340
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/intro/css/graphics/obj_48/otapphov_obj.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/intro/css/graphics/obj_48/otdt_obj.png b/plugins/org.eclipse.objectteams.otdt.ui.help/intro/css/graphics/obj_48/otdt_obj.png
new file mode 100644
index 000000000..be61c41a0
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/intro/css/graphics/obj_48/otdt_obj.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/intro/css/graphics/obj_48/otdthov_obj.png b/plugins/org.eclipse.objectteams.otdt.ui.help/intro/css/graphics/obj_48/otdthov_obj.png
new file mode 100644
index 000000000..cc0104eb6
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/intro/css/graphics/obj_48/otdthov_obj.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/intro/css/graphics/obj_48/othov_obj.gif b/plugins/org.eclipse.objectteams.otdt.ui.help/intro/css/graphics/obj_48/othov_obj.gif
new file mode 100644
index 000000000..00a8819b0
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/intro/css/graphics/obj_48/othov_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/intro/css/overview.css b/plugins/org.eclipse.objectteams.otdt.ui.help/intro/css/overview.css
new file mode 100644
index 000000000..328d280af
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/intro/css/overview.css
@@ -0,0 +1,4 @@
+
+/* ot-overview is the id of the link defined in overviewExtensionContent.xml */
+a#ot-overview img { background-image : url( 'graphics/obj_48/ot_obj.gif'); }
+a#ot-overview:hover img { background-image : url('graphics/obj_48/othov_obj.gif'); }
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/intro/css/swt-intro.properties b/plugins/org.eclipse.objectteams.otdt.ui.help/intro/css/swt-intro.properties
new file mode 100644
index 000000000..3c0819b37
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/intro/css/swt-intro.properties
@@ -0,0 +1,26 @@
+###############################################################################
+# Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
+# for its Fraunhofer Institute and Computer Architecture and Software
+# Technology (FIRST), Berlin, Germany and Technical University Berlin,
+# Germany.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+# $Id$
+#
+# Please visit http://www.eclipse.org/objectteams for updates and contact.
+#
+# Contributors:
+# Fraunhofer FIRST - Initial API and implementation
+# Technical University Berlin - Initial API and implementation
+###############################################################################
+tutorials.page-content.java.layout.ncolumns = 2
+
+overview.ot-overview.link-icon = css/graphics/obj_48/otdt_obj.png
+overview.ot-overview.hover-icon = css/graphics/obj_48/otdthov_obj.png
+
+tutorials.ot-tutorial.link-icon = intro/css/graphics/obj_48/otapp_obj.gif
+tutorials.ot-tutorial.hover-icon = intro/css/graphics/obj_48/otdtapp_obj.gif
+ \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/intro/css/tutorials.css b/plugins/org.eclipse.objectteams.otdt.ui.help/intro/css/tutorials.css
new file mode 100644
index 000000000..e7ac3ab02
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/intro/css/tutorials.css
@@ -0,0 +1,3 @@
+
+a#ot-tutorial img { background-image : url('graphics/obj_48/otapp_obj.gif'); }
+a#ot-tutorial:hover img { background-image : url('graphics/obj_48/otapphov_obj.png'); }
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/intro/overviewExtensionContent.xml b/plugins/org.eclipse.objectteams.otdt.ui.help/intro/overviewExtensionContent.xml
new file mode 100644
index 000000000..180f0a88b
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/intro/overviewExtensionContent.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<introContent>
+ <extensionContent
+ id="org.eclipse.objectteams.otdt"
+ name="Object Teams introduction"
+ alt-style="css/swt-intro.properties"
+ style="css/overview.css"
+ path="overview/@">
+
+ <group id="content-group" style-id="content-group">
+ <link
+ style-id="content-link"
+ label="Object Teams introduction"
+ url="http://org.eclipse.ui.intro/showHelpTopic?id=//org.eclipse.objectteams.otdt.ui.help/ot.html"
+ id="ot-overview">
+ <text>Learn about Object Teams and the OTDT</text>
+ </link>
+ </group>
+ </extensionContent>
+</introContent> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/intro/tutorialsExtensionContentOT.xml b/plugins/org.eclipse.objectteams.otdt.ui.help/intro/tutorialsExtensionContentOT.xml
new file mode 100644
index 000000000..5a54cf7ea
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/intro/tutorialsExtensionContentOT.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<introContent>
+ <!-- Extension to the SDK Tutorial Page. -->
+ <extensionContent id="org.eclipse.pde"
+ name="OT Tutorial Extension"
+ alt-style="css/swt-intro.properties"
+ style="css/tutorials.css"
+ path="tutorials/@">
+ <group label="Object Teams Development" id="ot" style-id="content-group">
+ <link url="http://org.eclipse.ui.intro/showStandby?partId=org.eclipse.platform.cheatsheet&amp;input=org.eclipse.objectteams.otdt.ui.help.cheatsheets.SimpleOTApplication"
+ label="Build a simple Object Teams application"
+ id="ot-tutorial"
+ style-id="content-link">
+ <text>Create a small Object Teams program consisting of a team, a role, a callin binding and a callout binding</text>
+ </link>
+ </group>
+
+ </extensionContent>
+</introContent>
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/ot.html b/plugins/org.eclipse.objectteams.otdt.ui.help/ot.html
new file mode 100644
index 000000000..90f94d948
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/ot.html
@@ -0,0 +1,151 @@
+<html>
+ <head>
+ <meta name="copyright" content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
+ <link rel=stylesheet type="text/css" href="guide/otjld/css/ot.css">
+ <title>Object Teams Introduction</title>
+ </head>
+
+ <body bgcolor="white">
+ <table width="100%"><tr>
+ <td align="right">next: <a href="guide/develop.html">OTDT User Guide</a></td></tr>
+ </table>
+ <br />
+ <div id="content" style="margin-left:0px;padding-top:5px;">
+ <p class="center">&raquo;<i>Programming with roles and beyond.</i>&laquo;</p>
+ <div class="headl">
+ <div class="headr">
+ <h1>Why Object Teams?</h1>
+ </div>
+ </div>
+ <div class="intro">
+ <div class="line"></div>
+ <div class="term">Team spirit for objects</div>
+ <div class="termdesc">
+ Building complex systems from isolated objects often yields poor
+ structure which readily decays during system evolution.
+ Objects should <b>team-up</b> in order to co-operate and jointly
+ deliver complex behaviors.
+ Objects play specific <b>roles</b> within a given Team.
+ </div>
+ <div class="line"></div>
+ <div class="term">Context based dispatch</div>
+ <div class="termdesc">
+ Object behavior is controled by the currently active
+ <b>context</b> of execution. Contexts are reified into
+ <b>Team instances</b>, which may be used to mediate
+ between roles and maintain state of the collaboration.
+ </div>
+ <div class="line"></div>
+ <div class="term">Modules larger than classes</div>
+ <div class="termdesc">
+ On the road to re-use of modules larger than classes two
+ approaches compete: <b>frameworks</b> and <b>components</b>.
+ For many applications white box frameworks are too fragile and
+ black box components to rigid.
+ Object Teams provide a middle road which balances
+ <b>encapsulation</b> and <b>adaptability</b>.
+ </div>
+ <div class="line"></div>
+ </div>
+
+ <div class="headl">
+ <div class="headr">
+ <h1>Key Features of Object Teams</h1>
+ </div>
+ </div>
+ <ul>
+ <li>
+ <div class="black">
+ Weaving of aspect code into existing classes (no source code needed).
+ </div>
+ </li>
+ <li>
+ <div class="black">
+ Teams are modules that encapsulate the interaction of
+ a set of role objects.
+ </div>
+ <ul>
+ <li>
+ <div class="darkblue">
+ Teams can be type-checked in a modular way.
+ </div>
+ </li>
+ <li>
+ <div class="darkblue">
+ Roles are automatically managed by their enclosing
+ Team instance.
+ </div>
+ </li>
+ </ul>
+ </li>
+ <li>
+ <div class="black">
+ Teams can be refined using inheritance.
+ </div>
+ <ul>
+ <li>
+ <div class="darkblue">
+ Collective refinement of role classes.
+ </div>
+ </li>
+ <li>
+ <div class="darkblue">
+ Team refinement realizes type-safe covariance of
+ role signatures.
+ </div>
+ </li>
+ </ul>
+ </li>
+ <li>
+ <div class="black">
+ Teams are instantiable first class entities.
+ </div>
+ <ul>
+ <li>
+ <div class="darkblue">
+ Teams are aspects that can be
+ activated/deactivated at run-time.
+ </div>
+ </li>
+ <li>
+ <div class="darkblue">
+ Roles may refer to their enclosing Team.
+ </div>
+ </li>
+ </ul>
+ </li>
+ <li>
+ <div class="black">
+ Explicit connectors bind an abstract Team definition
+ to a base package.
+ </div>
+ <ul>
+ <li>
+ <div class="darkblue">
+ Binding happens a-posteriori, i.e., no modification
+ in the base package is required.
+ </div>
+ </li>
+ <li>
+ <div class="darkblue">
+ Team binding is specified in a declarative style.
+ </div>
+ </li>
+ <li>
+ <div class="darkblue">
+ Bindings may specify different kinds of adaptations.
+ </div>
+ </li>
+ </ul>
+ </li>
+ <li>
+ <div class="black">
+ Object Teams require a minimal number of new
+ language constructs to be learned for a maximum of modularity and
+ composability.
+ </div>
+ </li>
+ </ul>
+ </div>
+</body>
+</html>
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/plugin.properties b/plugins/org.eclipse.objectteams.otdt.ui.help/plugin.properties
new file mode 100644
index 000000000..350068409
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/plugin.properties
@@ -0,0 +1,3 @@
+cheatsheet.SimpleOTApplication.name = Object Teams Application
+cheatsheet.SimpleOTApplication.desc = This tutorial will show you how to use Eclipse to create an Object Teams program.
+simple Object Teams application.
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/plugin.xml b/plugins/org.eclipse.objectteams.otdt.ui.help/plugin.xml
new file mode 100644
index 000000000..b7273d719
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/plugin.xml
@@ -0,0 +1,129 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+<plugin>
+
+
+<!-- OTDT extensions for intro/welcome page -->
+ <extension point="org.eclipse.ui.intro.configExtension">
+ <configExtension
+ configId="org.eclipse.ui.intro.universalConfig"
+ content="intro/overviewExtensionContent.xml"/>
+ </extension>
+
+ <extension point="org.eclipse.ui.intro.configExtension">
+ <configExtension
+ configId="org.eclipse.ui.intro.universalConfig"
+ content="intro/tutorialsExtensionContentOT.xml"/>
+ </extension>
+
+<!-- OTDT cheat sheet extension for small OT example -->
+ <extension point="org.eclipse.ui.cheatsheets.cheatSheetContent">
+ <cheatsheet
+ category="org.eclipse.objectteams.otdt.ui.java"
+ contentFile="cheatsheets/SimpleOTApplication.xml"
+ id="org.eclipse.objectteams.otdt.ui.help.cheatsheets.SimpleOTApplication"
+ name="%cheatsheet.SimpleOTApplication.name">
+ <description>%cheatsheet.SimpleOTApplication.desc</description>
+ </cheatsheet>
+ </extension>
+
+<!-- OTDT help extension-->
+ <extension point="org.eclipse.help.toc">
+ <toc file="guide/toc.xml" primary="true"/>
+ </extension>
+
+ <extension
+ point="org.eclipse.ui.views">
+ <view
+ name="OT/J Language Definition"
+ icon="icons/ot_paragraph.gif"
+ category="org.eclipse.objectteams.otdt.ui"
+ class="org.eclipse.objectteams.otdt.ui.help.views.OTJLDView"
+ id="org.eclipse.objectteams.otdt.ui.help.views.OTJLDView">
+ <description>
+ Browsable view of the OT/J Language Definition.
+ </description>
+ </view>
+ </extension>
+ <extension
+ point="org.eclipse.ui.popupMenus">
+ <viewerContribution
+ targetID="org.eclipse.ui.views.ProblemView"
+ id="org.eclipse.objectteams.otdt.ui.help.problemContribution">
+ <action
+ class="org.eclipse.objectteams.otdt.ui.help.actions.ShowOTJLDAction"
+ enablesFor="1"
+ icon="icons/ot_paragraph.gif"
+ id="org.eclipse.objectteams.otdt.ui.help.actions.ShowOTJLDAction"
+ label="Go to Language Definition"
+ menubarPath="group.showIn"/>
+ </viewerContribution>
+ </extension>
+
+ <extension
+ point="org.eclipse.ui.viewActions">
+ <viewContribution
+ id="org.eclipse.objectteams.otdt.ui.help.OTJLDView.actions"
+ targetID="org.eclipse.objectteams.otdt.ui.help.views.OTJLDView">
+ <action
+ class="org.eclipse.objectteams.otdt.ui.help.actions.OTJLDViewActionDelegate"
+ disabledIcon="icons/dlcl16/nav_home.gif"
+ hoverIcon="icons/clcl16/nav_home.gif"
+ icon="icons/elcl16/nav_home.gif"
+ id="org.eclipse.objectteams.otdt.ui.help.OTJLDView.home"
+ label="Table Of Contents"
+ style="push"
+ toolbarPath="additions"
+ tooltip="Table Of Contents">
+ </action>
+ <action
+ class="org.eclipse.objectteams.otdt.ui.help.actions.OTJLDViewActionDelegate"
+ disabledIcon="icons/dlcl16/nav_forward.gif"
+ hoverIcon="icons/clcl16/nav_forward.gif"
+ icon="icons/elcl16/nav_forward.gif"
+ id="org.eclipse.objectteams.otdt.ui.help.OTJLDView.next"
+ label="Forward to the next page"
+ style="push"
+ toolbarPath="additions"
+ tooltip="Forward to the next page">
+ </action>
+ <action
+ class="org.eclipse.objectteams.otdt.ui.help.actions.OTJLDViewActionDelegate"
+ disabledIcon="icons/dlcl16/nav_backward.gif"
+ hoverIcon="icons/clcl16/nav_backward.gif"
+ icon="icons/elcl16/nav_backward.gif"
+ id="org.eclipse.objectteams.otdt.ui.help.OTJLDView.back"
+ label="Back to the previous page"
+ style="push"
+ toolbarPath="additions"
+ tooltip="Back to the previous page">
+ </action>
+ </viewContribution>
+ </extension>
+ <extension
+ point="org.eclipse.ui.perspectiveExtensions">
+ <perspectiveExtension
+ targetID="org.eclipse.objectteams.otdt.ui.OTJavaPerspective">
+ <viewShortcut
+ id="org.eclipse.objectteams.otdt.ui.help.views.OTJLDView">
+ </viewShortcut>
+ <view
+ id="org.eclipse.objectteams.otdt.ui.help.views.OTJLDView"
+ minimized="false"
+ relationship="stack"
+ relative="org.eclipse.ui.views.ProblemView">
+ </view>
+ </perspectiveExtension>
+ </extension>
+
+ <!--
+ <extension
+ point="org.eclipse.jdt.ui.javaEditorTextHovers">
+ <hover
+ id="org.eclipse.objectteams.otdt.ui.help.IProblemDocumentation"
+ class="org.eclipse.objectteams.otdt.ui.help.IProblemDocumentation"
+ label="ObjectTeams Language Specification Hover"/>
+ </extension>
+ -->
+
+</plugin>
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/schema.css b/plugins/org.eclipse.objectteams.otdt.ui.help/schema.css
new file mode 100644
index 000000000..10aee3133
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/schema.css
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * Copyright (c) 2003 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+H6.SchemaHeader {
+ font-size:16px;
+ display:inline
+}
+
+P.SchemaCopyright {
+ font-size: smaller;
+ font-style: normal;
+ color: #336699;
+ display:inline;
+ margin-top: 3.000000pt;
+ margin-bottom: 11.000000pt;
+ margin-right: 0.000000pt;
+ margin-left: 0.000000pt;
+}
+
+P.SchemaDtd {
+ color: #800000;
+ margin-top: 0.000000pt;
+ margin-bottom: 0.000000pt;
+ margin-right: 0.000000pt;
+ margin-left: 10.000000pt;
+}
+
+P.SchemaDtdAttlist {
+ color: #800000;
+ margin-top: 0.000000pt;
+ margin-bottom: 0.000000pt;
+ margin-right: 0.000000pt;
+ margin-left: 20.000000pt;
+}
+
+span.SchemaTag {
+ color: #000080;
+}
+
+span.SchemaCstring {
+ color: #008000;
+}
+
+pre.Example {
+ margin-top: 0.000000pt;
+}
+
+.ConfigMarkupElementDesc {
+ color: black;
+ margin-top: 0.000000pt;
+ margin-bottom: 0.000000pt;
+ margin-right: 0.000000pt;
+ margin-left: 10.000000pt;
+}
+
+.ConfigMarkupAttlistDesc {
+ color: black;
+ margin-top: 0.000000pt;
+ margin-bottom: 0.000000pt;
+ margin-right: 0.000000pt;
+ margin-left: 32.000000pt;
+}
+
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/src/org/eclipse/objectteams/otdt/ui/help/OTHelpPlugin.java b/plugins/org.eclipse.objectteams.otdt.ui.help/src/org/eclipse/objectteams/otdt/ui/help/OTHelpPlugin.java
new file mode 100644
index 000000000..a3dfda6c4
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/src/org/eclipse/objectteams/otdt/ui/help/OTHelpPlugin.java
@@ -0,0 +1,70 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2008 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: OTHelpPlugin.java 23436 2010-02-04 00:29:04Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.ui.help;
+
+import org.eclipse.objectteams.otdt.core.exceptions.ExceptionHandler;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The main plugin class to be used in the desktop.
+ */
+public class OTHelpPlugin extends AbstractUIPlugin {
+ //The shared instance.
+ private static OTHelpPlugin plugin;
+
+ public static final String PLUGIN_ID = "org.eclipse.objectteams.otdt.ui.help"; //$NON-NLS-1$
+ public static final String OTJLD_VIEW = "org.eclipse.objectteams.otdt.ui.help.views.OTJLDView"; //$NON-NLS-1$
+
+ /**
+ * The constructor.
+ */
+ public OTHelpPlugin() {
+ }
+
+ /**
+ * This method is called upon plug-in activation
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /**
+ * This method is called when the plug-in is stopped
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance.
+ */
+ public static OTHelpPlugin getDefault() {
+ return plugin;
+ }
+
+ public static ExceptionHandler getExceptionHandler()
+ {
+ return new ExceptionHandler(PLUGIN_ID);
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/src/org/eclipse/objectteams/otdt/ui/help/OTJLDError.java b/plugins/org.eclipse.objectteams.otdt.ui.help/src/org/eclipse/objectteams/otdt/ui/help/OTJLDError.java
new file mode 100644
index 000000000..69e564f94
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/src/org/eclipse/objectteams/otdt/ui/help/OTJLDError.java
@@ -0,0 +1,184 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2005, 2008 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: OTJLDError.java 23436 2010-02-04 00:29:04Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.ui.help;
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.objectteams.otdt.ui.help.views.OTJLDView;
+
+
+/**
+ * @author gis
+ */
+@SuppressWarnings("nls")
+public class OTJLDError
+{
+ private ArrayList<OTURL> m_urls;
+ private static final Pattern OTLD_MARKER_PATTERN = Pattern.compile(".*\\(OTJLD\\s*(.*)\\s*\\).*", Pattern.DOTALL);
+ private static final Pattern SUBSECTION_PATTERN = Pattern.compile("(.*)\\s*\\(\\s*(.*)\\s*\\).*");
+ public static final String URL_PATH = "guide/otjld/xdef/";
+
+ public static class OTURL
+ {
+ private URL m_url; // the plugin-relative url to the document
+ private String m_anchor;
+
+ private OTURL(URL url)
+ {
+ m_url = url;
+ m_anchor = "";
+ }
+
+ public OTURL(URL url, String anchor)
+ {
+ m_url = url;
+
+ if (anchor != null && anchor.length() > 0)
+ m_anchor = "#" + anchor;
+ else
+ m_anchor = "";
+ }
+
+ public String toString()
+ {
+ return getURL();
+ }
+
+ public String getURL()
+ {
+ if (OTJLDView.hasBrowser())
+ return getBrowserURL();
+
+ return getHelpSystemURL();
+ }
+
+ private String getBrowserURL()
+ {
+ String result = null;
+ try
+ {
+ result = FileLocator.resolve(m_url).toString();
+ result += m_anchor;
+ }
+ catch (IOException ex)
+ {
+ OTHelpPlugin.getExceptionHandler().logException("Unable to resolve url: + url", ex);
+ }
+
+ return result;
+ }
+
+ private String getHelpSystemURL()
+ {
+ return "/" + OTHelpPlugin.PLUGIN_ID + m_url.getPath() + m_anchor;
+ }
+
+ }
+
+ public OTJLDError(String message)
+ {
+ parseMarkerMessage(message);
+ }
+
+ public OTURL[] getURLs()
+ {
+ if (m_urls == null || m_urls.isEmpty())
+ return new OTURL[0];
+
+ return m_urls.toArray(new OTURL[m_urls.size()]);
+ }
+
+ private void parseMarkerMessage(String text)
+ {
+ Matcher matcher = OTLD_MARKER_PATTERN.matcher(text);
+ if (!matcher.matches())
+ return;
+
+ m_urls = new ArrayList<OTURL>();
+
+ for (int i = 0; i < matcher.groupCount(); i++)
+ {
+ String decl = matcher.group(i + 1); // 1-based!
+ parseParagraphs(decl.trim());
+ }
+ }
+
+ // expected (but not guaranteed) input: something like 'x.y.z (a)'
+ // TODO (possibly more than one reference! Maybe separated via commas?
+ private void parseParagraphs(String decl)
+ {
+ String paragraph = null;
+ String subSection = null;
+
+ Matcher matcher = SUBSECTION_PATTERN.matcher(decl);
+ if (matcher.matches())
+ {
+ assert (matcher.groupCount() == 2);
+ paragraph = matcher.group(1); // 1-based!
+ subSection = matcher.group(2);
+ }
+ else
+ paragraph = decl; // the entire message is the paragraph (i.e. '3.1.2')
+
+ OTURL url = lookupURL(paragraph, subSection);
+ if (url != null)
+ m_urls.add(url);
+ }
+
+ private OTURL lookupURL(String paragraph, String subSection)
+ {
+ String ssFileNameAddon = "";
+ if (subSection != null && subSection.length() > 0)
+ ssFileNameAddon = "." + subSection;
+ String variablePart = paragraph + ssFileNameAddon;
+ URL url = null;
+ while (url == null) {
+
+ String file = URL_PATH + "s" + variablePart + ".html";
+
+ url = OTHelpPlugin.getDefault().getBundle().getEntry(file);
+
+ // in case an exact matching file is not found, use the parent section:
+ int lastDot = variablePart.lastIndexOf('.');
+ if (lastDot > -1)
+ variablePart = variablePart.substring(0, lastDot);
+ else
+ break;
+ }
+ if (url == null)
+ return null;
+
+ return new OTURL(url); // no anchor, it's in the filename already
+ }
+
+ public static String getHome() {
+ return OTJLDError.URL_PATH+"index.html";
+ }
+
+ public static OTURL getHomepageURL() {
+ return new OTURL(OTHelpPlugin.getDefault().getBundle().getEntry(getHome()));
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/src/org/eclipse/objectteams/otdt/ui/help/actions/OTJLDViewActionDelegate.java b/plugins/org.eclipse.objectteams.otdt.ui.help/src/org/eclipse/objectteams/otdt/ui/help/actions/OTJLDViewActionDelegate.java
new file mode 100644
index 000000000..748711a08
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/src/org/eclipse/objectteams/otdt/ui/help/actions/OTJLDViewActionDelegate.java
@@ -0,0 +1,55 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2008 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: OTJLDViewActionDelegate.java 23436 2010-02-04 00:29:04Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.ui.help.actions;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.objectteams.otdt.ui.help.OTJLDError;
+import org.eclipse.objectteams.otdt.ui.help.views.OTJLDView;
+import org.eclipse.ui.IViewActionDelegate;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.internal.browser.BrowserViewer;
+
+/**
+ * @author mosconi
+ */
+@SuppressWarnings("restriction")
+public class OTJLDViewActionDelegate implements IViewActionDelegate {
+
+ private OTJLDView view = null;
+ private BrowserViewer viewer = null;
+
+ public void init(IViewPart view) {
+ if (viewer == null) {
+ this.view = (OTJLDView) view;
+ this.viewer = this.view.getViewer();
+ }
+ }
+
+ public void run(IAction action) {
+ if (action.getId().equals("org.eclipse.objectteams.otdt.ui.help.OTJLDView.next")) //$NON-NLS-1$
+ viewer.forward();
+ if (action.getId().equals("org.eclipse.objectteams.otdt.ui.help.OTJLDView.back")) //$NON-NLS-1$
+ viewer.back();
+ if (action.getId().equals("org.eclipse.objectteams.otdt.ui.help.OTJLDView.home")) //$NON-NLS-1$
+ this.view.setURL(OTJLDError.getHomepageURL().getURL());
+ }
+
+ public void selectionChanged(IAction action, ISelection selection) {
+ }
+
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/src/org/eclipse/objectteams/otdt/ui/help/actions/ShowOTJLDAction.java b/plugins/org.eclipse.objectteams.otdt.ui.help/src/org/eclipse/objectteams/otdt/ui/help/actions/ShowOTJLDAction.java
new file mode 100644
index 000000000..b65e39e9c
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/src/org/eclipse/objectteams/otdt/ui/help/actions/ShowOTJLDAction.java
@@ -0,0 +1,120 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2005, 2008 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: ShowOTJLDAction.java 23436 2010-02-04 00:29:04Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.ui.help.actions;
+
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jdt.core.IJavaModelMarker;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.objectteams.otdt.ui.help.OTHelpPlugin;
+import org.eclipse.objectteams.otdt.ui.help.OTJLDError;
+import org.eclipse.objectteams.otdt.ui.help.OTJLDError.OTURL;
+import org.eclipse.objectteams.otdt.ui.help.views.OTJLDView;
+import org.eclipse.ui.IViewActionDelegate;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.views.markers.MarkerItem;
+
+/**
+ * @author gis
+ */
+public class ShowOTJLDAction implements IViewActionDelegate
+{
+ private IViewPart m_view;
+ private OTJLDView m_otjldView;
+ private OTURL[] m_urls;
+
+ public void init(IViewPart view)
+ {
+ m_view = view;
+ }
+
+ public void run(IAction action)
+ {
+ if (m_urls == null || m_urls.length == 0) // TODO (carp): error message in statusbar
+ return;
+
+ try
+ {
+ if (OTJLDView.hasBrowser())
+ {
+ m_otjldView = (OTJLDView) m_view.getSite().getPage().showView(OTHelpPlugin.OTJLD_VIEW);
+ }
+ m_otjldView.setURL(m_urls[0].getURL());
+ }
+ catch (PartInitException ex)
+ {
+ OTHelpPlugin.getExceptionHandler().logException("Unable to initialize browser", ex); //$NON-NLS-1$
+ }
+ }
+
+ public void selectionChanged(IAction action, ISelection selection)
+ {
+ try
+ {
+ evaluateSelection(selection);
+ action.setEnabled(m_urls != null && m_urls.length > 0);
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ private void evaluateSelection(ISelection selection)
+ {
+ m_urls = null;
+
+ if (!(selection instanceof IStructuredSelection))
+ return;
+
+ IStructuredSelection sel = (IStructuredSelection) selection;
+ if (sel.size() != 1) // precondition failed, should be handled by enablesFor in plugin.xml
+ return;
+
+ Object item = sel.getFirstElement();
+ IMarker marker = null;
+ if (item instanceof MarkerItem)
+ marker = ((MarkerItem) item).getMarker();
+ else if (item instanceof IMarker)
+ marker = (IMarker) item;
+
+ if (marker == null) return; // either no type matched, or MarkerCategory.getMarker() returned null.
+
+ try
+ {
+ if (!IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER.equals(marker.getType()))
+ return;
+
+ String text = marker.getAttribute(IMarker.MESSAGE, null);
+ if (text == null)
+ return;
+ OTJLDError error = new OTJLDError(text);
+ m_urls = error.getURLs();
+ }
+ catch (CoreException ex)
+ {
+ OTHelpPlugin.getExceptionHandler().logCoreException("Cannot retrieve marker from selection", ex); //$NON-NLS-1$
+ }
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.ui.help/src/org/eclipse/objectteams/otdt/ui/help/views/OTJLDView.java b/plugins/org.eclipse.objectteams.otdt.ui.help/src/org/eclipse/objectteams/otdt/ui/help/views/OTJLDView.java
new file mode 100644
index 000000000..4d54df910
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui.help/src/org/eclipse/objectteams/otdt/ui/help/views/OTJLDView.java
@@ -0,0 +1,52 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2008 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: OTJLDView.java 23436 2010-02-04 00:29:04Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.ui.help.views;
+
+import org.eclipse.objectteams.otdt.ui.help.OTJLDError;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.browser.IWorkbenchBrowserSupport;
+import org.eclipse.ui.internal.browser.BrowserViewer;
+import org.eclipse.ui.internal.browser.WebBrowserUtil;
+import org.eclipse.ui.internal.browser.WebBrowserView;
+
+/**
+ * @author mosconi
+ */
+@SuppressWarnings("restriction")
+public class OTJLDView extends WebBrowserView {
+
+ @Override
+ public void createPartControl(Composite parent) {
+ viewer = new BrowserViewer(parent, IWorkbenchBrowserSupport.AS_VIEW);
+ viewer.setContainer(this);
+ setURL(OTJLDError.getHomepageURL().getURL());
+ }
+
+ public BrowserViewer getViewer() {
+ return viewer;
+ }
+
+ public static boolean hasBrowser() {
+ return WebBrowserUtil.canUseInternalWebBrowser();
+ }
+
+ @Override
+ public void setURL(String url) {
+ super.setURL(url);
+ }
+
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/.classpath b/plugins/org.eclipse.objectteams.otdt.ui/.classpath
new file mode 100644
index 000000000..64c5e31b7
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <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="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/.cvsignore b/plugins/org.eclipse.objectteams.otdt.ui/.cvsignore
new file mode 100644
index 000000000..f9b5b5189
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/.cvsignore
@@ -0,0 +1,3 @@
+bin
+temp.folder
+otdtui.jar
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/.project b/plugins/org.eclipse.objectteams.otdt.ui/.project
new file mode 100644
index 000000000..ba49923e0
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.objectteams.otdt.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>
+ </natures>
+</projectDescription>
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/.settings/org.eclipse.core.resources.prefs b/plugins/org.eclipse.objectteams.otdt.ui/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 000000000..613c62b80
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,3 @@
+#Fri Mar 23 07:54:22 CET 2007
+eclipse.preferences.version=1
+encoding//src/org/objectteams/otdt/internal/ui/bindingeditor/Messages.properties=8859_1
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.objectteams.otdt.ui/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..35fc435c4
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,58 @@
+#Thu May 14 15:41:11 CEST 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.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=ignore
+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=warning
+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.objectteams.otdt.ui/META-INF/MANIFEST.MF b/plugins/org.eclipse.objectteams.otdt.ui/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..22a0a2f1d
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/META-INF/MANIFEST.MF
@@ -0,0 +1,43 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: OTDTUI Plug-in
+Bundle-SymbolicName: org.eclipse.objectteams.otdt.ui;singleton:=true
+Bundle-Version: 1.4.0.qualifier
+Bundle-Activator: org.eclipse.objectteams.otdt.ui.OTDTUIPlugin
+Bundle-Vendor: Fraunhofer FIRST
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.ui.views,
+ org.eclipse.jface.text,
+ org.eclipse.ui.workbench.texteditor,
+ org.eclipse.ui.editors,
+ org.eclipse.ui,
+ org.eclipse.jdt.core,
+ org.eclipse.jdt.ui,
+ org.eclipse.debug.core,
+ org.eclipse.debug.ui,
+ org.eclipse.jdt.debug.ui,
+ org.eclipse.jdt.launching,
+ org.eclipse.core.resources,
+ org.eclipse.search,
+ org.eclipse.ui.console,
+ org.eclipse.ui.ide,
+ org.eclipse.help,
+ org.eclipse.core.filesystem,
+ org.eclipse.objectteams.otdt.debug,
+ org.eclipse.ui.forms,
+ org.eclipse.objectteams.otdt,
+ org.eclipse.compare;bundle-version="3.5.100",
+ org.eclipse.team.core;bundle-version="3.5.0",
+ org.eclipse.team.ui;bundle-version="3.5.100"
+Bundle-ActivationPolicy: lazy
+Export-Package:
+ org.eclipse.objectteams.otdt.internal.ui.callinmarkers;x-friends:="org.eclipse.objectteams.otdt.ui.tests",
+ org.eclipse.objectteams.otdt.internal.ui.javaeditor;x-friends:="org.eclipse.objectteams.otdt.debug.ui,org.eclipse.objectteams.otdt.jdt.ui",
+ org.eclipse.objectteams.otdt.internal.ui.preferences;x-friends:="org.eclipse.objectteams.otdt.ui.tests",
+ org.eclipse.objectteams.otdt.internal.ui.wizards;x-friends:="org.eclipse.objectteams.otdt.ui.tests",
+ org.eclipse.objectteams.otdt.internal.ui.wizards.listeners;x-friends:="org.eclipse.objectteams.otdt.ui.tests",
+ org.eclipse.objectteams.otdt.internal.ui.wizards.typecreation;x-friends:="org.eclipse.objectteams.otdt.ui.tests",
+ org.eclipse.objectteams.otdt.ui,
+ org.eclipse.objectteams.otdt.ui.dialogs
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/build.properties b/plugins/org.eclipse.objectteams.otdt.ui/build.properties
new file mode 100644
index 000000000..acc83bdac
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/build.properties
@@ -0,0 +1,7 @@
+bin.includes = plugin.xml,\
+ icons/,\
+ plugin.properties,\
+ .,\
+ META-INF/,\
+ templates/
+source.. = src/
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/icons/jdt/full/ctool16/opentype.gif b/plugins/org.eclipse.objectteams.otdt.ui/icons/jdt/full/ctool16/opentype.gif
new file mode 100644
index 000000000..40d2bc946
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/icons/jdt/full/ctool16/opentype.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/icons/jdt/full/obj16/over_co.gif b/plugins/org.eclipse.objectteams.otdt.ui/icons/jdt/full/obj16/over_co.gif
new file mode 100644
index 000000000..938767b20
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/icons/jdt/full/obj16/over_co.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/baseguard_obj.gif b/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/baseguard_obj.gif
new file mode 100644
index 000000000..85d8fa776
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/baseguard_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/boundrole_co.gif b/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/boundrole_co.gif
new file mode 100644
index 000000000..5ff97896e
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/boundrole_co.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/callinbinding_obj.gif b/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/callinbinding_obj.gif
new file mode 100644
index 000000000..b3b5254d7
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/callinbinding_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/callinbindingafter_obj.gif b/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/callinbindingafter_obj.gif
new file mode 100644
index 000000000..dde17c8e4
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/callinbindingafter_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/callinbindingbefore_obj.gif b/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/callinbindingbefore_obj.gif
new file mode 100644
index 000000000..c71a184db
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/callinbindingbefore_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/callinbindingreplace_obj.gif b/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/callinbindingreplace_obj.gif
new file mode 100644
index 000000000..0000be342
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/callinbindingreplace_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/callinmethod_co.gif b/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/callinmethod_co.gif
new file mode 100644
index 000000000..177407c9c
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/callinmethod_co.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/callout_marker.gif b/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/callout_marker.gif
new file mode 100644
index 000000000..afd816da6
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/callout_marker.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/calloutbinding_obj.gif b/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/calloutbinding_obj.gif
new file mode 100644
index 000000000..f96f75506
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/calloutbinding_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/default/hide_team_package.gif b/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/default/hide_team_package.gif
new file mode 100644
index 000000000..894fdcb01
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/default/hide_team_package.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/disabled/hide_team_package.gif b/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/disabled/hide_team_package.gif
new file mode 100644
index 000000000..894fdcb01
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/disabled/hide_team_package.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/guard_obj.gif b/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/guard_obj.gif
new file mode 100644
index 000000000..67c562375
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/guard_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/hover/hide_team_package.gif b/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/hover/hide_team_package.gif
new file mode 100644
index 000000000..b9a2c5643
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/hover/hide_team_package.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/jcu_obj.gif b/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/jcu_obj.gif
new file mode 100644
index 000000000..4cecec975
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/jcu_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/newrole_obj.png b/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/newrole_obj.png
new file mode 100644
index 000000000..a157171d5
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/newrole_obj.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/newteam_obj.gif b/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/newteam_obj.gif
new file mode 100644
index 000000000..29c0d9441
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/newteam_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/ot.png b/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/ot.png
new file mode 100644
index 000000000..d2ed13deb
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/ot.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/ot_bare_10.png b/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/ot_bare_10.png
new file mode 100644
index 000000000..fcbb8cc7b
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/ot_bare_10.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/playedBy_obj.gif b/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/playedBy_obj.gif
new file mode 100644
index 000000000..85202819c
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/playedBy_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/role_obj.png b/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/role_obj.png
new file mode 100644
index 000000000..f89af2d0a
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/role_obj.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/role_ovr.png b/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/role_ovr.png
new file mode 100644
index 000000000..a9d9dc39b
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/role_ovr.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/role_protected_obj.png b/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/role_protected_obj.png
new file mode 100644
index 000000000..c47d049ac
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/role_protected_obj.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif b/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif
new file mode 100644
index 000000000..cadfdc271
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/team_ovr.gif b/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/team_ovr.gif
new file mode 100644
index 000000000..595f58495
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/team_ovr.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/team_role_obj.gif b/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/team_role_obj.gif
new file mode 100644
index 000000000..bb7076e41
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/team_role_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/team_role_ovr.gif b/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/team_role_ovr.gif
new file mode 100644
index 000000000..e2899350c
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/team_role_ovr.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/team_role_protected_obj.gif b/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/team_role_protected_obj.gif
new file mode 100644
index 000000000..a41d18f26
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/team_role_protected_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/wizard/newotjprj_wiz.png b/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/wizard/newotjprj_wiz.png
new file mode 100644
index 000000000..2f04ac478
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/wizard/newotjprj_wiz.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/wizard/newprj_wiz.gif b/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/wizard/newprj_wiz.gif
new file mode 100644
index 000000000..858f4c988
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/wizard/newprj_wiz.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/wizard/newrole_wiz.png b/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/wizard/newrole_wiz.png
new file mode 100644
index 000000000..e22484d79
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/wizard/newrole_wiz.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/wizard/newteam_wiz.png b/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/wizard/newteam_wiz.png
new file mode 100644
index 000000000..567cb10d2
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/icons/ot/wizard/newteam_wiz.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/plugin.properties b/plugins/org.eclipse.objectteams.otdt.ui/plugin.properties
new file mode 100644
index 000000000..302800f93
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/plugin.properties
@@ -0,0 +1,39 @@
+pluginName= Object Teams Development Tools UI
+providerName= Fraunhofer FIRST
+
+# New OT project wizard
+ObjectTeams = Object Teams
+NewOTProject.label = Object Teams Project
+NewOTProject.description = Create an Object Teams project
+
+# NewTeamCreationWizard
+NewTeam.label = Team
+NewTeam.description = Create a team
+
+# NewRoleCreationWizard
+NewRole.label = Role
+NewRole.description = Create a role
+
+perspectiveName=Object Teams
+viewCategoryName=Object Teams
+packagesViewName=Package Explorer
+hierarchyViewName=Hierarchy
+
+##########################################################################
+# Compiler configurable options
+##########################################################################
+OTCompilerPreferencePageName=Compiler (OT/J)
+OTCompilerPropertyPageName=Java Compiler (OT/J)
+
+preferenceKeywords.compiler.options=Java errors warnings ignore compiler options decapsulation basecall lifting callin playedBy role
+
+
+############################
+
+OTGeneralPreferencePageName=Object Teams
+
+# Context menu:
+CompareWithBaseMethodAction.label=&Bound Base Method
+CompareWithBaseMethodAction.description=Compare the current method with the base method it replaces.
+# Repeated from org.eclipse.compare:
+CompareWithMenu.label= Comp&are With
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/plugin.xml b/plugins/org.eclipse.objectteams.otdt.ui/plugin.xml
new file mode 100644
index 000000000..cf050305f
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/plugin.xml
@@ -0,0 +1,472 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+<plugin>
+
+<!-- Perspectives -->
+ <extension
+ point="org.eclipse.ui.perspectives">
+ <perspective
+ name="%perspectiveName"
+ icon="icons/ot/ot.png"
+ class="org.eclipse.objectteams.otdt.internal.ui.OTJavaPerspectiveFactory"
+ id="org.eclipse.objectteams.otdt.ui.OTJavaPerspective">
+ </perspective>
+ </extension>
+
+<!-- View category -->
+ <extension
+ point="org.eclipse.ui.views">
+ <category
+ id="org.eclipse.objectteams.otdt.ui"
+ name="Object Teams">
+ </category>
+ </extension>
+
+ <extension
+ point="org.eclipse.ui.perspectiveExtensions">
+ <perspectiveExtension
+ targetID="org.eclipse.objectteams.otdt.ui.OTJavaPerspective">
+
+ <!-- "Open Perspective" shows the Debug, Resource and OT-perspective -->
+ <perspectiveShortcut
+ id="org.eclipse.debug.ui.DebugPerspective">
+ </perspectiveShortcut>
+ <perspectiveShortcut
+ id="org.eclipse.ui.resourcePerspective">
+ </perspectiveShortcut>
+ <perspectiveShortcut
+ id="org.eclipse.objectteams.otdt.ui.OTJavaPerspective">
+ </perspectiveShortcut>
+ <view
+ id="org.eclipse.pde.runtime.LogView"
+ minimized="false"
+ relationship="stack"
+ relative="org.eclipse.ui.views.ProblemView">
+ </view>
+ <newWizardShortcut
+ id="org.eclipse.objectteams.otdt.ui.wizards.NewTeamCreationWizard">
+ </newWizardShortcut>
+ <newWizardShortcut
+ id="org.eclipse.objectteams.otdt.ui.wizards.NewRoleCreationWizard">
+ </newWizardShortcut>
+ <newWizardShortcut
+ id="org.eclipse.objectteams.otdt.ui.wizards.OTNewProjectWizard">
+ </newWizardShortcut>
+ <newWizardShortcut
+ id="org.eclispe.objectteams.otdt.pde.ui.wizards.OTNewPluginProjectWizard">
+ </newWizardShortcut>
+ <actionSet
+ id="org.eclipse.jdt.ui.text.java.actionSet.presentation">
+ </actionSet>
+ </perspectiveExtension>
+
+ <!-- Add our own perspective to the Resource, Java and Debug perspectives -->
+ <perspectiveExtension
+ targetID="org.eclipse.ui.resourcePerspective">
+ <perspectiveShortcut
+ id="org.eclipse.objectteams.otdt.ui.OTJavaPerspective">
+ </perspectiveShortcut>
+ </perspectiveExtension>
+
+ <perspectiveExtension
+ targetID="org.eclipse.jdt.ui.JavaPerspective">
+ <perspectiveShortcut
+ id="org.eclipse.objectteams.otdt.ui.OTJavaPerspective">
+ </perspectiveShortcut>
+ </perspectiveExtension>
+
+ <perspectiveExtension
+ targetID="org.eclipse.debug.ui.DebugPerspective">
+ <perspectiveShortcut
+ id="org.eclipse.objectteams.otdt.ui.OTJavaPerspective">
+ </perspectiveShortcut>
+ </perspectiveExtension>
+
+ </extension>
+
+<!-- Object Teams Wizards -->
+ <extension
+ point="org.eclipse.ui.newWizards">
+ <category
+ name="%ObjectTeams"
+ id="org.eclipse.objectteams.otdt.ui.wizards">
+ </category>
+ <wizard
+ name="%NewOTProject.label"
+ icon="icons/ot/wizard/newprj_wiz.gif"
+ category="org.eclipse.objectteams.otdt.ui.wizards"
+ class="org.eclipse.objectteams.otdt.internal.ui.wizards.OTNewProjectWizard"
+ preferredPerspectives="org.eclipse.objectteams.otdt.ui.OTJavaPerspective"
+ project="true"
+ finalPerspective="org.eclipse.objectteams.otdt.ui.OTJavaPerspective"
+ id="org.eclipse.objectteams.otdt.ui.wizards.OTNewProjectWizard">
+ <description>
+ %NewOTProject.description
+ </description>
+ </wizard>
+ <wizard
+ name="%NewTeam.label"
+ icon="icons/ot/newteam_obj.gif"
+ category="org.eclipse.objectteams.otdt.ui.wizards"
+ id="org.eclipse.objectteams.otdt.ui.wizards.NewTeamCreationWizard">
+ <class
+ class="org.eclipse.objectteams.otdt.internal.ui.wizards.NewTeamCreationWizard">
+ <parameter name="javatype" value="true"/>
+ </class>
+ <description>
+ %NewTeam.description
+ </description>
+ </wizard>
+ <wizard
+ name="%NewRole.label"
+ icon="icons/ot/newrole_obj.png"
+ category="org.eclipse.objectteams.otdt.ui.wizards"
+ id="org.eclipse.objectteams.otdt.ui.wizards.NewRoleCreationWizard">
+ <class
+ class="org.eclipse.objectteams.otdt.internal.ui.wizards.NewRoleCreationWizard">
+ <parameter name="javatype" value="true"/>
+ </class>
+ <description>
+ %NewRole.description
+ </description>
+ </wizard>
+ </extension>
+
+
+<!-- Object Teams Markers/Annotation: Callin, Callout, PlayedBy, OverridingRole -->
+ <extension
+ point="org.eclipse.core.resources.markers"
+ id="callinMarker"
+ name="Callin Marker">
+ <super type="org.eclipse.core.resources.textmarker"/>
+ <persistent value="false"/>
+ <attribute name="org.eclipse.objectteams.otdt.ui.markerAttr.CallinMapping"/>
+ </extension>
+ <extension
+ point="org.eclipse.core.resources.markers"
+ id="calloutMarker"
+ name="Callout Marker">
+ <super type="org.eclipse.core.resources.textmarker"/>
+ <persistent value="false"/>
+ <attribute name="org.eclipse.objectteams.otdt.ui.markerAttr.CalloutMapping"/>
+ </extension>
+ <extension
+ point="org.eclipse.core.resources.markers"
+ id="playedByMarker"
+ name="PlayedBy Marker">
+ <super type="org.eclipse.core.resources.textmarker"/>
+ <persistent value="false"/>
+ <attribute name="org.eclipse.objectteams.otdt.ui.markerAttr.PlayedByMapping"/>
+ </extension>
+
+ <extension
+ point="org.eclipse.ui.editors.annotationTypes">
+ <type
+ name="org.eclipse.objectteams.otdt.ui.annotationtypes.CallinMarker"
+ super="org.eclipse.jdt.ui.info"
+ markerType="org.eclipse.objectteams.otdt.ui.callinMarker">
+ </type>
+ <type
+ name="org.eclipse.objectteams.otdt.ui.annotationtypes.CalloutMarker"
+ super="org.eclipse.jdt.ui.info"
+ markerType="org.eclipse.objectteams.otdt.ui.calloutMarker">
+ </type>
+ <type
+ name="org.eclipse.objectteams.otdt.ui.annotationtypes.PlayedByMarker"
+ super="org.eclipse.jdt.ui.info"
+ markerType="org.eclipse.objectteams.otdt.ui.playedByMarker">
+ </type>
+ <type
+ name="org.eclipse.objectteams.otdt.ui.roleOverrideIndicator"/>
+ </extension>
+
+ <extension
+ point="org.eclipse.ui.editors.markerAnnotationSpecification">
+ <specification
+ annotationType="org.eclipse.objectteams.otdt.ui.annotationtypes.CallinMarker"
+ colorPreferenceKey="callinmarker.color"
+ colorPreferenceValue="120,159,79"
+ contributesToHeader="true"
+ highlightPreferenceKey="callinmarker.highlight"
+ icon="icons/ot/callinbinding_obj.gif"
+ includeOnPreferencePage="true"
+ isGoToNextNavigationTarget="true"
+ isGoToNextNavigationTargetKey="callinmarker.gotonext"
+ isGoToPreviousNavigationTarget="true"
+ isGoToPreviousNavigationTargetKey="callinmarker.gotoprev"
+ label="Callin bindings"
+ overviewRulerPreferenceKey="callinmarker.overview"
+ overviewRulerPreferenceValue="true"
+ presentationLayer="9"
+ showInNextPrevDropdownToolbarAction="true"
+ showInNextPrevDropdownToolbarActionKey="callinmarker.nextprev.action"
+ symbolicIcon="info"
+ textPreferenceKey="callinmarker.text"
+ textStylePreferenceKey="callinmarker.textstyle"
+ textStylePreferenceValue="NONE"
+ verticalRulerPreferenceKey="callinmarker.vertical"
+ verticalRulerPreferenceValue="true">
+ </specification>
+
+ <specification
+ annotationType="org.eclipse.objectteams.otdt.ui.annotationtypes.CalloutMarker"
+ colorPreferenceKey="calloutmarker.color"
+ colorPreferenceValue="120,159,79"
+ contributesToHeader="true"
+ highlightPreferenceKey="calloutmarker.highlight"
+ icon="icons/ot/callout_marker.gif"
+ includeOnPreferencePage="true"
+ isGoToNextNavigationTarget="true"
+ isGoToNextNavigationTargetKey="calloutmarker.gotonext"
+ isGoToPreviousNavigationTarget="true"
+ isGoToPreviousNavigationTargetKey="calloutmarker.gotoprev"
+ label="Decapsulating callout bindings"
+ overviewRulerPreferenceKey="calloutmarker.overview"
+ overviewRulerPreferenceValue="true"
+ presentationLayer="9"
+ showInNextPrevDropdownToolbarAction="true"
+ showInNextPrevDropdownToolbarActionKey="calloutmarker.nextprev.action"
+ symbolicIcon="info"
+ textPreferenceKey="calloutmarker.text"
+ textStylePreferenceKey="calloutmarker.textstyle"
+ textStylePreferenceValue="NONE"
+ verticalRulerPreferenceKey="calloutmarker.vertical"
+ verticalRulerPreferenceValue="true">
+ </specification>
+
+ <specification
+ annotationType="org.eclipse.objectteams.otdt.ui.annotationtypes.PlayedByMarker"
+ colorPreferenceKey="playedbymarker.color"
+ colorPreferenceValue="120,159,79"
+ contributesToHeader="true"
+ highlightPreferenceKey="playedbymarker.highlight"
+ icon="icons/ot/playedBy_obj.gif"
+ includeOnPreferencePage="true"
+ isGoToNextNavigationTarget="true"
+ isGoToNextNavigationTargetKey="playedbymarker.gotonext"
+ label="Role bindings"
+ overviewRulerPreferenceKey="playedbymarker.overview"
+ overviewRulerPreferenceValue="true"
+ presentationLayer="9"
+ symbolicIcon="info"
+ textPreferenceKey="playedbymarker.text"
+ textStylePreferenceKey="playedbymarker.teststyle"
+ textStylePreferenceValue="NONE"
+ verticalRulerPreferenceKey="playedbymarker.vertical"
+ verticalRulerPreferenceValue="true">
+ </specification>
+<!-- modelled after org.eclipse.jdt.ui.overrideIndicator (with which it still shares the preferences): -->
+ <specification
+ annotationType="org.eclipse.objectteams.otdt.ui.roleOverrideIndicator"
+ label="Role class override indicator"
+ icon="icons/jdt/full/obj16/over_co.gif"
+ textPreferenceKey="overrideIndicator"
+ textPreferenceValue="false"
+ highlightPreferenceKey="overrideIndicatorHighlighting"
+ highlightPreferenceValue="false"
+ contributesToHeader="false"
+ overviewRulerPreferenceKey="overrideIndicatorInOverviewRuler"
+ overviewRulerPreferenceValue="false"
+ verticalRulerPreferenceKey="overrideIndicatorInVerticalRuler"
+ verticalRulerPreferenceValue="true"
+ colorPreferenceKey="overrideIndicatorColor"
+ colorPreferenceValue="180,207,205"
+ presentationLayer="3"
+ showInNextPrevDropdownToolbarActionKey="showoverrideIndicatorInNextPrevDropdownToolbarAction"
+ showInNextPrevDropdownToolbarAction="false"
+ isGoToNextNavigationTargetKey="isOverrideIndicatorGoToNextNavigationTarget"
+ isGoToNextNavigationTarget="false"
+ isGoToPreviousNavigationTargetKey="isOverrideIndicatorGoToPreviousNavigationTarget"
+ textStylePreferenceKey="overrideIndicatorTextStyle"
+ textStylePreferenceValue="SQUIGGLES">
+ </specification>
+ </extension>
+
+ <extension
+ point="org.eclipse.ui.editorActions">
+ <editorContribution
+ id="org.eclipse.ui.texteditor.ruler.actions"
+ targetID="org.eclipse.jdt.ui.CompilationUnitEditor">
+ <action
+ actionID="RulerClick"
+ label="openteam"
+ class="org.eclipse.objectteams.otdt.ui.UpdateRulerAction"
+ id="org.eclipse.objectteams.otdt.refactoring.ui.actions.UpdateRulerAction">
+ </action>
+ </editorContribution>
+ <editorContribution
+ id="org.eclipse.ui.texteditor.ruler.actions"
+ targetID="org.eclipse.jdt.ui.ClassFileEditor">
+ <action
+ actionID="RulerClick"
+ label="openteam"
+ class="org.eclipse.objectteams.otdt.ui.UpdateRulerAction"
+ id="org.eclipse.objectteams.otdt.refactoring.ui.actions.UpdateRulerAction">
+ </action>
+ </editorContribution>
+ </extension>
+
+<!-- Object Teams Templates-->
+ <extension
+ point="org.eclipse.ui.editors.templates">
+ <contextType
+ name="%templates.java.contextType.name"
+ class="org.eclipse.jdt.internal.corext.template.java.JavaContextType"
+ id="java">
+ </contextType>
+ <contextType
+ name="%templates.javadoc.contextType.name"
+ class="org.eclipse.jdt.internal.corext.template.java.JavaDocContextType"
+ id="javadoc">
+ </contextType>
+ <resolver
+ class="org.eclipse.objectteams.otdt.internal.ui.templates.ParameterMappingTemplateResolver"
+ contextTypeId="java"
+ description="Resolver for callin parameter mappings"
+ name="callin parameter mapping"
+ type="callin_parameter_name">
+ </resolver>
+ <resolver
+ class="org.eclipse.objectteams.otdt.internal.ui.templates.ParameterMappingTemplateResolver"
+ contextTypeId="java"
+ description="Resolver for callout parameter mappings"
+ name="callout parameter mapping"
+ type="callout_parameter_name">
+ </resolver>
+ <include
+ file="templates/OT-templates.xml"
+ translations="templates/OT-templates.properties">
+ </include>
+ </extension>
+
+
+
+<!-- Configurable options for the OT/J compiler -->
+ <extension
+ point="org.eclipse.ui.preferencePages">
+ <page
+ id="org.eclipse.objectteams.otdt.ui.preferences.CompilerPreferencePage"
+ name="%OTCompilerPreferencePageName"
+ category="org.eclipse.jdt.ui.preferences.JavaBasePreferencePage"
+ class="org.eclipse.objectteams.otdt.internal.ui.preferences.OTCompilerPreferencePage">
+ <keywordReference id="org.eclipse.objectteams.otdt.ui.compliance"/>
+ </page>
+
+ <!-- General Object Teams configuration options -->
+ <page
+ id="org.eclipse.objectteams.otdt.ui.preferences.GeneralPreferencePage"
+ name="%OTGeneralPreferencePageName"
+ class="org.eclipse.objectteams.otdt.internal.ui.preferences.OTGeneralPreferencePage">
+ </page>
+
+ </extension>
+ <extension
+ point="org.eclipse.ui.propertyPages">
+ <page
+ class="org.eclipse.objectteams.otdt.internal.ui.preferences.OTCompilerPreferencePage"
+ icon="icons/ot/ot_bare_10.png"
+ id="org.eclipse.objectteams.otdt.ui.propertyPages.CompilerPreferencePage"
+ name="%OTCompilerPropertyPageName">
+ <filter name="nature"
+ value="org.eclipse.objectteams.otdt.OTJavaNature">
+ </filter>
+ <keywordReference id="org.eclipse.objectteams.otdt.ui.compliance"/>
+ <enabledWhen>
+ <or>
+ <instanceof
+ value="org.eclipse.core.resources.IProject">
+ </instanceof>
+ <instanceof
+ value="org.eclipse.jdt.core.IJavaProject">
+ </instanceof>
+ </or>
+ </enabledWhen>
+ </page>
+ </extension>
+ <extension
+ point="org.eclipse.ui.keywords">
+ <keyword
+ id="org.eclipse.objectteams.otdt.ui.compliance"
+ label="%preferenceKeywords.compiler.options"/>
+ </extension>
+ <!-- Binding Editor -->
+ <extension
+ point="org.eclipse.ui.menus">
+ <menuContribution
+ locationURI="popup:org.eclipse.ui.popup.any?before=group.open">
+ <command
+ commandId="org.eclipse.objectteams.otdt.ui.commands.openBindingEditor"
+ icon="icons/ot/calloutbinding_obj.gif"
+ style="push">
+ <visibleWhen
+ checkEnabled="true">
+ </visibleWhen>
+ </command>
+ </menuContribution>
+ </extension>
+ <extension
+ point="org.eclipse.ui.commands">
+ <command
+ id="org.eclipse.objectteams.otdt.ui.commands.openBindingEditor"
+ name="Open Binding Editor">
+ </command>
+ </extension>
+ <extension
+ point="org.eclipse.ui.handlers">
+ <handler
+ class="org.eclipse.objectteams.otdt.ui.handlers.OpenBindingEditorHandler"
+ commandId="org.eclipse.objectteams.otdt.ui.commands.openBindingEditor">
+ </handler>
+ </extension>
+ <!-- Compare callin method with base method: -->
+ <extension
+ point="org.eclipse.ui.menus">
+ <!-- Forward declaration of a menu declared the old way: -->
+ <menuContribution
+ locationURI="popup:org.eclipse.ui.popup.any">
+ <menu
+ id="compareWithMenu"
+ label="%CompareWithMenu.label">
+ <separator
+ name="compareWithGroup">
+ </separator>
+ </menu>
+ </menuContribution>
+ <!-- Hook this contribution into the above submenu: -->
+ <menuContribution
+ locationURI="popup:compareWithMenu?after=compareWithGroup">
+ <command
+ commandId="org.eclipse.objectteams.otdt.ui.commands.compareWithBaseMethod"
+ icon="icons/ot/callinbindingreplace_obj.gif"
+ style="push">
+ <visibleWhen
+ checkEnabled="true">
+ </visibleWhen>
+ </command>
+ </menuContribution>
+ </extension>
+ <extension
+ point="org.eclipse.ui.commands">
+ <command
+ description="%CompareWithBaseMethodAction.description"
+ id="org.eclipse.objectteams.otdt.ui.commands.compareWithBaseMethod"
+ name="%CompareWithBaseMethodAction.label">
+ </command>
+ </extension>
+ <extension
+ point="org.eclipse.ui.handlers">
+ <handler
+ class="org.eclipse.objectteams.otdt.ui.handlers.CompareWithBaseMethodHandler"
+ commandId="org.eclipse.objectteams.otdt.ui.commands.compareWithBaseMethod">
+ </handler>
+ </extension>
+<!--
+ <extension
+ point="org.eclipse.jdt.ui.foldingStructureProviders">
+ <provider
+ class="org.eclipse.objectteams.otdt.internal.ui.text.folding.OTJavaFoldingStructureProvider"
+ id="org.eclipse.objectteams.otdt.ui.foldingProvider"/>
+ </extension>
+-->
+</plugin>
+ \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/OTDTUIMessages.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/OTDTUIMessages.java
new file mode 100644
index 000000000..2b40b0496
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/OTDTUIMessages.java
@@ -0,0 +1,37 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2009, Stephan Herrmann.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: OTDTUIMessages.java 23435 2010-02-04 00:14:38Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Stephan Herrmann - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui;
+
+import org.eclipse.osgi.util.NLS;
+
+public class OTDTUIMessages extends NLS {
+ private static final String BUNDLE_NAME = "org.eclipse.objectteams.otdt.internal.ui.OTDTUIMessages"; //$NON-NLS-1$
+ public static String CompareWithBaseMethodAction_errorTitle;
+ public static String CompareWithBaseMethodAction_ambiguousBindingsError;
+ public static String CompareWithBaseMethodAction_multipleBaseMethodsError;
+ public static String CompareBoundMethods_base_method_label;
+ public static String CompareBoundMethods_compare_title;
+ public static String CompareBoundMethods_compare_tooltip;
+ public static String CompareBoundMethods_role_method_label;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, OTDTUIMessages.class);
+ }
+
+ private OTDTUIMessages() {
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/OTDTUIMessages.properties b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/OTDTUIMessages.properties
new file mode 100644
index 000000000..d8bd68f6c
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/OTDTUIMessages.properties
@@ -0,0 +1,26 @@
+ #**********************************************************************
+ # This file is part of "Object Teams Development Tooling"-Software
+ #
+ # Copyright 2009, Stephan Herrmann.
+ #
+ # All rights reserved. This program and the accompanying materials
+ # are made available under the terms of the Eclipse Public License v1.0
+ # which accompanies this distribution, and is available at
+ # http://www.eclipse.org/legal/epl-v10.html
+ # $Id: OTDTUIMessages.properties 23435 2010-02-04 00:14:38Z stephan $
+ #
+ # Please visit http://www.objectteams.org for updates and contact.
+ #
+ # Contributors:
+ # Stephan Herrmann - Initial API and implementation
+ #**********************************************************************
+
+# Context menu:
+CompareWithBaseMethodAction_errorTitle=Cannot compare bound methods.
+CompareWithBaseMethodAction_ambiguousBindingsError=This callin method is bound more than once, please select the callin binding.
+CompareWithBaseMethodAction_multipleBaseMethodsError=This callin binding refers to multiple base methods.
+
+CompareBoundMethods_base_method_label=Base method {0}.{1}(..)
+CompareBoundMethods_compare_title=Compare {0}() with its base method
+CompareBoundMethods_compare_tooltip=Compare role method {0}() with its callin-bound base method {1}()
+CompareBoundMethods_role_method_label=Role method {0}.{1}(..)
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/OTElementAdapterFactory.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/OTElementAdapterFactory.java
new file mode 100644
index 000000000..8e8edaedc
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/OTElementAdapterFactory.java
@@ -0,0 +1,55 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2003, 2009 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: OTElementAdapterFactory.java 23435 2010-02-04 00:14:38Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui;
+
+import org.eclipse.core.runtime.IAdapterFactory;
+import org.eclipse.ui.model.IWorkbenchAdapter;
+
+
+/**
+ * This factory provides a WorkbenchAdapter for IAdaptable OT elements and
+ * needs to be registered by the platforms AdapterManager.
+ *
+ * @author kaiser
+ * @version $Id: OTElementAdapterFactory.java 23435 2010-02-04 00:14:38Z stephan $
+ */
+public class OTElementAdapterFactory implements IAdapterFactory
+{
+ WorkbenchAdapter _otAdapter = new WorkbenchAdapter();
+ Class[] _allAdapters = { IWorkbenchAdapter.class };
+
+ public Object getAdapter(Object adaptableObject, Class adapterType)
+ {
+ Object adapter = null;
+
+ if (IWorkbenchAdapter.class.equals(adapterType))
+ {
+ adapter = _otAdapter;
+ }
+
+ return adapter;
+ }
+
+ public Class[] getAdapterList()
+ {
+ return _allAdapters;
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/OTJavaPerspectiveFactory.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/OTJavaPerspectiveFactory.java
new file mode 100644
index 000000000..41d6b99d1
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/OTJavaPerspectiveFactory.java
@@ -0,0 +1,33 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2003, 2009 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: OTJavaPerspectiveFactory.java 23435 2010-02-04 00:14:38Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui;
+
+import org.eclipse.jdt.internal.ui.JavaPerspectiveFactory;
+
+/**
+ * The Object Teams perspective is a clone of the Java perspective.
+ * All additions are defined via extension points.
+ * @author mosconi
+ * @version $Id: OTJavaPerspectiveFactory.java 23435 2010-02-04 00:14:38Z stephan $
+ */
+public class OTJavaPerspectiveFactory extends JavaPerspectiveFactory {
+
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/WorkbenchAdapter.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/WorkbenchAdapter.java
new file mode 100644
index 000000000..d9b142073
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/WorkbenchAdapter.java
@@ -0,0 +1,170 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2003, 2009 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: WorkbenchAdapter.java 23435 2010-02-04 00:14:38Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jdt.core.Flags;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IParent;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.objectteams.otdt.core.ICallinMapping;
+import org.eclipse.objectteams.otdt.core.IMethodMapping;
+import org.eclipse.objectteams.otdt.core.IOTJavaElement;
+import org.eclipse.objectteams.otdt.core.IOTType;
+import org.eclipse.objectteams.otdt.core.OTModelManager;
+import org.eclipse.objectteams.otdt.ui.ImageConstants;
+import org.eclipse.objectteams.otdt.ui.ImageManager;
+import org.eclipse.ui.model.IWorkbenchAdapter;
+
+/**
+ * WorkbenchAdapter implementation for OTM elements.
+ *
+ * @author kaiser
+ * @version $Id: WorkbenchAdapter.java 23435 2010-02-04 00:14:38Z stephan $
+ */
+public class WorkbenchAdapter implements IWorkbenchAdapter
+{
+ public Object[] getChildren(Object parentElement)
+ {
+ try {
+ if (parentElement instanceof ICompilationUnit)
+ return getCUMembers((ICompilationUnit)parentElement);
+
+//{OTModelUpdate : children are in the java element:
+ if (parentElement instanceof IOTType)
+ parentElement = ((IOTType)parentElement).getCorrespondingJavaElement();
+// SH}
+ if (parentElement instanceof IParent)
+ return ((IParent)parentElement).getChildren();
+ }
+ catch (JavaModelException ex) { /* noop */ }
+
+ return new Object[0];
+ }
+
+ /**
+ * Returns all types, including team and "external defined" role classes, of
+ * a given ICompilationUnit.
+ */
+ private Object[] getCUMembers(ICompilationUnit unit) throws JavaModelException
+ {
+ List<IType> result = new ArrayList<IType>();
+ IType[] types = unit.getTypes();
+
+ for (int idx = 0; idx < types.length; idx++)
+ {
+ if (OTModelManager.hasOTElementFor(types[idx]))
+ result.add(OTModelManager.getOTElement(types[idx]));
+ else
+ result.add(types[idx]);
+ }
+
+ return result.toArray();
+ }
+
+ public ImageDescriptor getImageDescriptor(Object element)
+ {
+ ImageDescriptor result = ImageDescriptor.getMissingImageDescriptor();
+
+ try
+ {
+ if (element instanceof IOTType)
+ result = getTypeImageDescriptor((IOTType)element);
+ else if (element instanceof IMethodMapping)
+ result = getBindingImageDescriptor((IMethodMapping)element);
+ }
+ catch (JavaModelException ex)
+ {
+ // MissingImageDescriptor is already added to the result.
+ }
+
+ return result;
+ }
+
+ public String getLabel(Object elem)
+ {
+ if (elem instanceof IOTJavaElement)
+ return ((IOTJavaElement)elem).getElementName();
+
+ return null;
+ }
+
+ public Object getParent(Object elem)
+ {
+ if (elem instanceof IOTType)
+ {
+ IOTType otType = (IOTType)elem;
+//{OTModelUpdate
+ return ((IType) otType.getCorrespondingJavaElement()).getParent();
+//haebor}
+ }
+
+ return null;
+ }
+
+ /**
+ * Return the propriate image descriptor for an OT type.
+ */
+ private ImageDescriptor getTypeImageDescriptor(IOTType type) throws JavaModelException
+ {
+ if (type.isTeam())
+ {
+ if (type.isRole()) {
+ if ((type.getFlags() & Flags.AccProtected) != 0)
+ return ImageManager.getSharedInstance().getDescriptor(ImageConstants.TEAM_ROLE_PROTECTED_IMG);
+ return ImageManager.getSharedInstance().getDescriptor(ImageConstants.TEAM_ROLE_IMG);
+ }
+ return ImageManager.getSharedInstance().getDescriptor(ImageConstants.TEAM_IMG);
+ }
+ else
+ {
+ if ((type.getFlags() & Flags.AccProtected) != 0)
+ return ImageManager.getSharedInstance().getDescriptor(ImageConstants.ROLECLASS_PROTECTED_IMG);
+ return ImageManager.getSharedInstance().getDescriptor(ImageConstants.ROLECLASS_IMG);
+ }
+ }
+
+ private ImageDescriptor getBindingImageDescriptor(IMethodMapping binding)
+ {
+ if (binding.getMappingKind() == IMethodMapping.CALLIN_MAPPING)
+ {
+ ICallinMapping callinMapping = (ICallinMapping) binding;
+ switch(callinMapping.getCallinKind())
+ {
+ case ICallinMapping.KIND_BEFORE:
+ return ImageManager.getSharedInstance().getDescriptor(ImageConstants.CALLINBINDING_BEFORE_IMG);
+ case ICallinMapping.KIND_AFTER:
+ return ImageManager.getSharedInstance().getDescriptor(ImageConstants.CALLINBINDING_AFTER_IMG);
+ default:
+ case ICallinMapping.KIND_REPLACE:
+ return ImageManager.getSharedInstance().getDescriptor(ImageConstants.CALLINBINDING_REPLACE_IMG);
+ }
+ }
+ else
+ {
+ return ImageManager.getSharedInstance().getDescriptor(ImageConstants.CALLOUTBINDING_IMG);
+ }
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/bindingeditor/AddTypeBindingDialog.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/bindingeditor/AddTypeBindingDialog.java
new file mode 100644
index 000000000..c0fd6441c
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/bindingeditor/AddTypeBindingDialog.java
@@ -0,0 +1,523 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: AddTypeBindingDialog.java 23435 2010-02-04 00:14:38Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.bindingeditor;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.core.search.IJavaSearchConstants;
+import org.eclipse.jdt.core.search.IJavaSearchScope;
+import org.eclipse.jdt.core.search.SearchEngine;
+import org.eclipse.jdt.internal.corext.util.Messages;
+import org.eclipse.jdt.internal.ui.dialogs.FilteredTypesSelectionDialog;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.layout.PixelConverter;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.objectteams.otdt.core.IOTType;
+import org.eclipse.objectteams.otdt.core.IRoleType;
+import org.eclipse.objectteams.otdt.core.OTModelManager;
+import org.eclipse.objectteams.otdt.ui.OTDTUIPlugin;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.KeyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Image;
+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.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.Text;
+import org.eclipse.ui.dialogs.FilteredList;
+import org.eclipse.ui.model.WorkbenchLabelProvider;
+
+/**
+ * This dialog is for selection of a role class and a base class for editing.
+ *
+ * @author $ikeman$
+ * @version $Id:AddTypeBindingDialog.java 15586 2007-03-23 13:07:39Z stephan $
+ */
+public class AddTypeBindingDialog extends FilteredTypesSelectionDialog
+{
+ private boolean _baseRelativeToEnclosingBase = false;
+ private IType _baseType;
+ private IType _roleType;
+ private IType _focusTeam;
+ private String _roleTypeName;
+ private String _baseTypeName;
+
+ private IType[] _roleTypes;
+ private FilteredList _rolList;
+ private String _roleNamePattern = ""; //$NON-NLS-1$
+
+ private Button _okButton;
+ private IJavaSearchScope _currentSearchScope; // FIXME(SH) (see showOnlyBaseOfEnclosing())
+
+ public class LabelProvider extends WorkbenchLabelProvider implements ITableLabelProvider
+ {
+ protected String decorateText(String input, Object element)
+ {
+ IType role = (IType)element;
+ String name = role.getTypeQualifiedName().replace('$','.');
+ return name;
+ }
+
+ public void addListener(ILabelProviderListener listener)
+ {
+ }
+
+ public void dispose()
+ {
+ }
+
+ public boolean isLabelProperty(Object element, String property)
+ {
+ return false;
+ }
+
+ public void removeListener(ILabelProviderListener listener)
+ {
+ }
+
+ public Image getColumnImage(Object element, int columnIndex)
+ {
+ return null;
+ }
+
+ public String getColumnText(Object element, int columnIndex)
+ {
+ return null;
+ }
+ }
+
+
+ static AddTypeBindingDialog create(Shell parentshell, IType focusTeam) {
+ IJavaSearchScope scope = createSearchScope(focusTeam, true);
+ return new AddTypeBindingDialog(parentshell, focusTeam, scope);
+ }
+ private AddTypeBindingDialog(Shell parentshell, IType focusTeam, IJavaSearchScope scope)
+ {
+ super(parentshell, false, null, scope, IJavaSearchConstants.TYPE);
+ _currentSearchScope = scope;
+ _focusTeam = focusTeam;
+
+ setMessage(
+ OTDTUIPlugin.getResourceString("BindingEditor.AddconnectorDialog.BaseClassSelect.Input.title")); //$NON-NLS-1$
+ }
+
+ protected static IJavaSearchScope createSearchScope(IType type, boolean onlyEnclosingBase)
+ {
+ IJavaSearchScope scope = null;
+
+ if (onlyEnclosingBase)
+ {
+ IRoleType enclosingRole = null;
+ if (type instanceof IRoleType) // shouldn't OTModelManager.getOTElement() handle that case?
+ enclosingRole = (IRoleType) type;
+ else
+ {
+ IOTType enclosingType = (IOTType) OTModelManager.getOTElement(type);
+ if (enclosingType instanceof IRoleType)
+ enclosingRole = (IRoleType) enclosingType;
+ }
+
+ if (enclosingRole != null)
+ {
+ try {
+ IType baseType = enclosingRole.getBaseClass();
+ scope = SearchEngine.createJavaSearchScope(new IJavaElement[] {baseType}, false);
+ } catch (JavaModelException ex) {
+ OTDTUIPlugin.getExceptionHandler().logCoreException("Cannot create enclosing-base-searchscope", ex); //$NON-NLS-1$
+ }
+ }
+ // else flag an error? for now, just create the other scope
+ }
+
+ if (scope == null)
+ scope = SearchEngine.createJavaSearchScope(new IJavaElement[] {type.getJavaProject()}, true);
+
+ return scope;
+ }
+
+ protected void configureShell(Shell newShell)
+ {
+ super.configureShell(newShell);
+ newShell.setText(OTDTUIPlugin.getResourceString("BindingEditor.AddconnectorDialog.title")); //$NON-NLS-1$
+ }
+
+ public Control createDialogArea(Composite parent)
+ {
+ Group panes = new Group(parent, SWT.NONE);
+ panes.setLayout(new GridLayout(2, true));
+ panes.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+
+ Group roleTypeGrp = createRoleGroup(panes);
+ createRoleLabel(roleTypeGrp);
+ createRoleTypeText(roleTypeGrp);
+ createRoleListLabel(roleTypeGrp);
+ createRoleList(roleTypeGrp);
+
+ Group baseTypeGrp = createBaseGroup(panes);
+ super.createDialogArea(baseTypeGrp);
+ createSrchInEncBaseCheck(baseTypeGrp);
+
+ return panes;
+ }
+
+ private Group createRoleGroup(Composite container)
+ {
+ Group roleClsGrp = new Group(container, SWT.SHADOW_NONE);
+ roleClsGrp.setText(OTDTUIPlugin.getResourceString(
+ "BindingEditor.AddconnectorDialog.RoleClassSelect.title")); //$NON-NLS-1$
+ roleClsGrp.setLayout(new GridLayout());
+ roleClsGrp.setLayoutData(new GridData(GridData.FILL_BOTH));
+
+ return roleClsGrp;
+ }
+
+ private void createRoleLabel(Group roleTypeGrp)
+ {
+ Label rolPatLabel = new Label(roleTypeGrp, SWT.NONE);
+ rolPatLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ rolPatLabel.setText(
+ OTDTUIPlugin.getResourceString("BindingEditor.AddconnectorDialog.RoleClassSelect.Input.title")); //$NON-NLS-1$
+ }
+
+ private void createRoleTypeText(Group roleTypeGrp)
+ {
+ final Text result = new Text(roleTypeGrp, SWT.BORDER);
+ result.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ result.setText((_roleNamePattern == null ? "" : _roleNamePattern)); //$NON-NLS-1$
+
+ result.addListener(SWT.Modify, new Listener()
+ {
+ public void handleEvent(Event evt)
+ {
+ _rolList.setFilter(result.getText());
+ checkOkButton();
+ }
+ });
+ result.addKeyListener(new KeyListener()
+ {
+ public void keyPressed(KeyEvent evt)
+ {
+ if (evt.keyCode == SWT.ARROW_DOWN)
+ _rolList.setFocus();
+ }
+
+ public void keyReleased(KeyEvent evt)
+ {
+ checkOkButton();
+ }
+ });
+ }
+
+ private void createRoleListLabel(Group roleTypeGrp)
+ {
+ Label result = new Label(roleTypeGrp, SWT.NONE);
+ result.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ result.setText(
+ OTDTUIPlugin.getResourceString("BindingEditor.AddconnectorDialog.RoleClassSelect.List.title")); //$NON-NLS-1$
+ }
+
+ private void createRoleList(Group roleGroup)
+ {
+ FilteredList result = new FilteredList(
+ roleGroup,
+ SWT.BORDER,
+ new LabelProvider(),
+ true,
+ false,
+ true);
+ GridData gd = new GridData(GridData.FILL_BOTH);
+ PixelConverter converter= new PixelConverter(result);
+ gd.widthHint= converter.convertWidthInCharsToPixels(70);
+ gd.heightHint= convertHeightInCharsToPixels(10);
+ result.setLayoutData(gd);
+ result.setElements(_roleTypes); // computed by open()->computeRoles()
+ _rolList = result;
+ }
+
+ private Group createBaseGroup(Composite container)
+ {
+ final Group result = new Group(container, SWT.TOP);
+ result.setText(OTDTUIPlugin.getResourceString(
+ "BindingEditor.AddconnectorDialog.BaseClassSelect.title")); //$NON-NLS-1$
+ result.setLayout(new GridLayout());
+ result.setLayoutData(new GridData(GridData.FILL_BOTH));
+
+ return result;
+ }
+
+ private void createSrchInEncBaseCheck(Group baseTypeGrp) {
+ final Button srchInEncBaseCheck = new Button(baseTypeGrp, SWT.CHECK);
+ srchInEncBaseCheck.setText(OTDTUIPlugin.getResourceString("BindingEditor.AddTypeBindingDialog.use_base_as_anchor")); //$NON-NLS-1$
+ srchInEncBaseCheck.setEnabled(false);
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ srchInEncBaseCheck.setLayoutData(gd);
+ try {
+ IOTType teamType = null;
+ if (_focusTeam != null)
+ teamType = OTModelManager.getOTElement(_focusTeam);
+
+ if (teamType != null && teamType.isRole()) {
+ IType baseclass = ((IRoleType)teamType).getBaseClass();
+ if (baseclass != null) {
+ srchInEncBaseCheck.setText(Messages.format(
+ OTDTUIPlugin.getResourceString("BindingEditor.AddTypeBindingDialog.use_specified_base_as_anchor"), //$NON-NLS-1$
+ baseclass.getElementName()));
+ srchInEncBaseCheck.setEnabled(true);
+ srchInEncBaseCheck.addSelectionListener( new SelectionAdapter()
+ {
+ public void widgetSelected(SelectionEvent evt)
+ {
+ showOnlyBaseOfEnclosing(srchInEncBaseCheck.getSelection());
+ }
+ });
+ }
+ }
+ } catch (JavaModelException jme) {
+ // no change
+ }
+ }
+
+ private void showOnlyBaseOfEnclosing(boolean onlyBase)
+ {
+ // FIXME(SH): cannot affect scope of super class TypeSelectionDialog2!!
+ _currentSearchScope = createSearchScope(_focusTeam, onlyBase);
+ _baseRelativeToEnclosingBase = onlyBase;
+ }
+
+ protected void createButtonsForButtonBar(Composite parent)
+ {
+ _okButton = createButton(
+ parent,
+ IDialogConstants.OK_ID,
+ IDialogConstants.OK_LABEL,
+ true);
+ createButton(
+ parent,
+ IDialogConstants.CANCEL_ID,
+ IDialogConstants.CANCEL_LABEL,
+ false);
+
+ _okButton.setEnabled(false);
+ }
+
+ private void checkOkButton()
+ {
+ // Note(SH): seemingly called only when base selection has been made.
+ if (_rolList.isEmpty() || _rolList.getSelectionIndex()== -1)
+ _okButton.setEnabled(false);
+ else
+ _okButton.setEnabled(true);
+ }
+
+ protected void updateButtonsEnableState(IStatus status)
+ {
+ if (!_rolList.isEmpty())
+ super.updateButtonsEnableState(status);
+ }
+
+ @Override
+ protected void handleSelected(StructuredSelection selection) {
+ super.handleSelected(selection);
+ checkOkButton();
+ }
+
+ @Override
+ protected void handleDoubleClick() {
+ //overwrite inherited method, just do nothing on a doubleclick on a type
+ }
+
+ @Override
+ public int open()
+ {
+ computeRoles();
+ if (_roleTypes == null || _roleTypes.length == 0)
+ {
+ String title= org.eclipse.objectteams.otdt.internal.ui.bindingeditor.Messages.AddTypeBindingDialog_role_selection_title;
+ String message= org.eclipse.objectteams.otdt.internal.ui.bindingeditor.Messages.AddTypeBindingDialog_no_roles_available_error;
+ MessageDialog.openInformation(getShell(), title, message);
+ return CANCEL;
+ }
+ return super.open();
+ }
+
+ private void computeRoles() {
+ IOTType teamType = null;
+ if (_focusTeam != null)
+ {
+ teamType = OTModelManager.getOTElement(_focusTeam);
+//{Experimental: look for roles inherited from explicit _and_ implicit superteam
+ IType[] roles = null;
+// ArrayList roles = new ArrayList();
+ try
+ {
+ // roles = TypeHelper.getInheritedRoleTypes(team);
+ roles = teamType.getRoleTypes(IOTType.ALL);
+ // FIXME(SH): filter overridden tsupers.
+// if (team.isRole()) {
+// ITypeHierarchy tsuperHierarchy = ((IRoleType)team).newImplicitSupertypeHierarchy();
+// IType[] tsuperTeams = tsuperHierarchy.getAllClasses();
+// for (int i = 0; i < tsuperTeams.length; i++) {
+// roles.addAll(Arrays.asList(TypeHelper.getRoleTypes(tsuperTeams[i], false)));
+// }
+// } else {
+// roles.addAll(Arrays.asList(TypeHelper.getRoleTypes(team, false)));
+// }
+ IType javaTeam = (IType)teamType.getCorrespondingJavaElement();
+ IType[] relevant = new IType[roles.length];
+ int j=0;
+ for (IType role : roles) {
+ IOTType roleType = (IOTType)OTModelManager.getOTElement(role);
+ if (!roleType.isRole())
+ continue;
+ if (((IRoleType)roleType).getBaseClass() == null) {
+ IType declaringTeam = roleType.getDeclaringType();
+ if (declaringTeam == javaTeam)
+ continue;
+ }
+ relevant[j++] = role;
+ }
+ if (j == 0)
+ return;
+ if (j < roles.length)
+ System.arraycopy(relevant, 0, roles=new IType[j], 0, j);
+ }
+ catch (JavaModelException ex)
+ {
+ String title = Messages.format(
+ OTDTUIPlugin.getResourceString("BindingEditor.generic_error_in_dialog"), //$NON-NLS-1$
+ OTDTUIPlugin.getResourceString("BindingEditor.AddconnectorDialog.title")); //$NON-NLS-1$
+ String message = Messages.format(
+ OTDTUIPlugin.getResourceString("BindingEditor.AddTypeBindingDialog.error_retrieving_roles"), //$NON-NLS-1$
+ this._focusTeam.getFullyQualifiedName());
+
+ MessageDialog.openError(getShell(), title, message);
+ buttonPressed(IDialogConstants.CANCEL_ID);
+ }
+ _roleTypes = replaceITypesWithOTTypes(roles);
+// _roleTypes = roles.toArray(new IType[roles.size()]);
+// SH}
+ }
+
+ }
+
+ private static IType[] replaceITypesWithOTTypes(IType[] types)
+ {
+ for (int i = 0; i < types.length; i++)
+ {
+ IType type = types[i];
+ type.exists(); // ensure it's "open"
+ IType otType = OTModelManager.getOTElement(type);
+ if (otType != null)
+ types[i] = otType;
+ }
+
+ return types;
+ }
+
+ protected void computeResult()
+ {
+// CRIPPLE (3.5) migration
+// TypeNameMatch ref = getSelectedTypes()[0];
+//
+// IType type= ref.getType();
+// if (type == null)
+// {
+// // not a class file or compilation unit
+// String title= JavaUIMessages.TypeSelectionDialog_errorTitle;
+// String message= Messages.format(JavaUIMessages.TypeSelectionDialog_dialogMessage, type.getElementName());
+// MessageDialog.openError(getShell(), title, message);
+// setResult(null);
+// }
+// else
+// {
+// List<IType> result= new ArrayList<IType>(1);
+// result.add(type);
+// setResult(result);
+// }
+ }
+
+ protected void okPressed()
+ {
+ if (_rolList.isEmpty() || getResult()[0] == null)
+ {
+ checkOkButton();
+ String title = Messages.format(
+ OTDTUIPlugin.getResourceString("BindingEditor.generic_error_in_dialog"), //$NON-NLS-1$
+ OTDTUIPlugin.getResourceString("BindingEditor.AddconnectorDialog.title")); //$NON-NLS-1$
+ String message = OTDTUIPlugin.getResourceString("BindingEditor.AddTypeBindingDialog.missing_class"); //$NON-NLS-1$
+ MessageDialog.openError(getShell(), title, message);
+ }
+ else
+ {
+ computeResult();
+
+ _baseType = (IType) super.getFirstResult();
+ _baseTypeName = _baseType.getFullyQualifiedName();
+ _roleType = (IType)_rolList.getSelection()[0];
+ _roleTypeName = _roleType.getFullyQualifiedName();
+
+ setReturnCode(OK);
+ close();
+ }
+ }
+
+ public IType getBaseType()
+ {
+ return _baseType;
+ }
+
+ /**
+ * @return the selected BaseTypeName as FullyQualifiedName
+ */
+ public String getBaseTypeName()
+ {
+ if (_baseRelativeToEnclosingBase)
+ return "base."+_baseType.getElementName(); //$NON-NLS-1$
+ return _baseTypeName;
+ }
+
+ public IType getRoleType()
+ {
+ return _roleType;
+ }
+
+ /**
+ * @return the selected RoleTypeName as FullyQualifiedName
+ */
+ public String getRoleTypeName()
+ {
+ return _roleTypeName;
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/bindingeditor/BindingConfiguration.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/bindingeditor/BindingConfiguration.java
new file mode 100644
index 000000000..d80e54003
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/bindingeditor/BindingConfiguration.java
@@ -0,0 +1,1408 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2005, 2007 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: BindingConfiguration.java 23435 2010-02-04 00:14:38Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.bindingeditor;
+
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.jdt.core.Flags;
+import org.eclipse.jdt.core.IField;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IMember;
+import org.eclipse.jdt.core.IMethod;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.core.Signature;
+import org.eclipse.jdt.core.dom.AST;
+import org.eclipse.jdt.core.dom.ASTNode;
+import org.eclipse.jdt.core.dom.AbstractMethodMappingDeclaration;
+import org.eclipse.jdt.core.dom.ArrayType;
+import org.eclipse.jdt.core.dom.CallinMappingDeclaration;
+import org.eclipse.jdt.core.dom.CalloutMappingDeclaration;
+import org.eclipse.jdt.core.dom.ITypeBinding;
+import org.eclipse.jdt.core.dom.MethodMappingElement;
+import org.eclipse.jdt.core.dom.MethodSpec;
+import org.eclipse.jdt.core.dom.Modifier;
+import org.eclipse.jdt.core.dom.Name;
+import org.eclipse.jdt.core.dom.PrimitiveType;
+import org.eclipse.jdt.core.dom.QualifiedName;
+import org.eclipse.jdt.core.dom.RoleTypeDeclaration;
+import org.eclipse.jdt.core.dom.SimpleName;
+import org.eclipse.jdt.core.dom.SimpleType;
+import org.eclipse.jdt.core.dom.SingleVariableDeclaration;
+import org.eclipse.jdt.core.dom.Type;
+import org.eclipse.jdt.core.dom.rewrite.ASTNodeCreator;
+import org.eclipse.jdt.internal.corext.dom.ASTNodes;
+import org.eclipse.jdt.internal.ui.viewsupport.JavaUILabelProvider;
+import org.eclipse.jdt.internal.ui.viewsupport.TreeHierarchyLayoutProblemsDecorator;
+import org.eclipse.jdt.ui.JavaElementLabels;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerSorter;
+import org.eclipse.objectteams.otdt.core.IOTType;
+import org.eclipse.objectteams.otdt.core.IRoleType;
+import org.eclipse.objectteams.otdt.core.OTModelManager;
+import org.eclipse.objectteams.otdt.core.TypeHelper;
+import org.eclipse.objectteams.otdt.ui.OTDTUIPlugin;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Table;
+
+/**
+ * Select role-Method, callout or callin-kind and base-Method for creation of Callin-/CalloutMappingDeclaration.
+ *
+ * @author jwloka
+ */
+public class BindingConfiguration extends Composite
+{
+ private static final int DESELECT_DISABLE_BUTTONS = 1;
+ private static final int SELECT_BUTTONS = 0;
+ private static final String OT_GENERATED_INDICATOR = "_OT$"; //$NON-NLS-1$
+ private static final String FAKED_METHOD_NAME = '\''+Messages.BindingConfiguration_new_method_label;
+ private static final Object[] EMPTY_LIST = new Object[0];
+ private static final int OT_CALLOUT = 0x1000000;
+ private static final int OT_CALLOUT_OVERRIDE = 0x2000000;
+
+ private IMethod[] _roleMethods;
+ private IMember[] _baseMethods;
+ private IMethod _fakedMeth;
+
+ final TableViewer _roleMethListViewer;
+ final TableViewer _baseMethListViewer;
+ final RadioButtonComposite _methMapBtnComp;
+ private Button _calloutBtn;
+ private Button _calloutOverrideBtn;
+ private Button _callinBeforeBtn;
+ private Button _callinReplaceBtn;
+ private Button _callinAfterBtn;
+ private RoleTypeDeclaration _selectedRole;
+ private CalloutMappingDeclaration _selectedCalloutDecl;
+ private CalloutMappingDeclaration _calloutMapping;
+ private CallinMappingDeclaration _selectedCallinDecl;
+ private CallinMappingDeclaration _callinMapping;
+ private BindingEditor _bindingEditor;
+
+ private Button _applyBtn;
+ private boolean _newCallout;
+ private List _parameterMappings;
+ private IType _curTeam;
+
+ class BaseMethodContentProvider implements IStructuredContentProvider
+ {
+ public Object[] getElements(Object inputElement)
+ {
+ return (_baseMethods != null) ? getFilteredMethods() : EMPTY_LIST;
+ }
+
+ public void dispose() {}
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
+
+ private Object[] getFilteredMethods()
+ {
+ List<IMember> result = new ArrayList<IMember>();
+ for (int idx = 0; idx < _baseMethods.length; idx++)
+ {
+ IMember curElem = _baseMethods[idx];
+ try {
+ if ( !curElem.getElementName().startsWith(OT_GENERATED_INDICATOR)
+ && !Flags.isSynthetic(curElem.getFlags()))
+ {
+ result.add(curElem);
+ }
+ } catch (JavaModelException jme) {
+ // nop
+ }
+ }
+
+ return result.toArray();
+ }
+ }
+
+ class RoleMethodContentProvider implements IStructuredContentProvider
+ {
+ public Object[] getElements(Object inputElement)
+ {
+ return getFakedMethodList();
+ }
+
+ private Object[] getFakedMethodList()
+ {
+ if (_curTeam == null)
+ {
+ return EMPTY_LIST;
+ }
+
+ _fakedMeth = _curTeam.getMethod(FAKED_METHOD_NAME, new String[0] );
+
+ if (_roleMethods == null)
+ {
+ return new IMethod[] { _fakedMeth };
+ }
+ else
+ {
+ List<IMethod> result = new ArrayList<IMethod>();
+ for (int idx = 0; idx < _roleMethods.length; idx++)
+ {
+ IMethod curElem = _roleMethods[idx];
+ if (!curElem.getElementName().startsWith(OT_GENERATED_INDICATOR))
+ {
+ result.add(curElem);
+ }
+ }
+ result.add(_fakedMeth);
+
+ return result.toArray();
+ }
+ }
+
+ public void dispose() {}
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
+ }
+
+
+ public BindingConfiguration(Composite parent, int style)
+ {
+ super(parent, style);
+ setLayout(new FormLayout());
+
+ _bindingEditor = (BindingEditor)parent.getParent();
+
+ JavaUILabelProvider labelProvider = new JavaUILabelProvider();
+ labelProvider.addLabelDecorator(new TreeHierarchyLayoutProblemsDecorator());
+ labelProvider.setTextFlags(JavaElementLabels.M_APP_RETURNTYPE | JavaElementLabels.M_PARAMETER_TYPES | JavaElementLabels.M_PARAMETER_NAMES);
+
+ final Composite composite = new Composite(this, SWT.NONE);
+ final FormData formData_10 = new FormData();
+ formData_10.bottom = new FormAttachment(100, -5);
+ formData_10.right = new FormAttachment(100, -5);
+ formData_10.top = new FormAttachment(100, -50);
+ formData_10.left = new FormAttachment(0, 5);
+ composite.setLayoutData(formData_10);
+ composite.setLayout(new FormLayout());
+
+ _applyBtn = new Button(composite, SWT.NONE);
+ final FormData formData_11 = new FormData();
+ formData_11.bottom = new FormAttachment(100, -5);
+ formData_11.right = new FormAttachment(100, -5);
+ _applyBtn.setLayoutData(formData_11);
+ _applyBtn.setText(Messages.BindingConfiguration_apply_button);
+ _applyBtn.setEnabled(false);
+ addApplyButtonListener(_applyBtn);
+
+ // method mapping button group
+ _methMapBtnComp = new RadioButtonComposite(this, SWT.NONE);
+ final FormData formData_1 = new FormData();
+ formData_1.right = new FormAttachment(60, -5);
+ formData_1.bottom = new FormAttachment(composite, 5, SWT.TOP);
+ formData_1.top = new FormAttachment(0, 8);
+ formData_1.left = new FormAttachment(40, 5);
+ _methMapBtnComp.setLayoutData(formData_1);
+ _methMapBtnComp.setLayout(new FormLayout());
+
+ _calloutBtn = new Button(_methMapBtnComp, SWT.TOGGLE);
+ addButtonListener(_calloutBtn);
+ final FormData formData_3 = new FormData();
+ formData_3.right = new FormAttachment(100, -5);
+ formData_3.top = new FormAttachment(0, 5);
+ formData_3.left = new FormAttachment(0, 5);
+ _calloutBtn.setLayoutData(formData_3);
+ _calloutBtn.setText("->"); //$NON-NLS-1$
+
+ _calloutOverrideBtn = new Button(_methMapBtnComp, SWT.TOGGLE);
+ addButtonListener( _calloutOverrideBtn);
+ final FormData formData_4 = new FormData();
+ formData_4.right = new FormAttachment(100, -5);
+ formData_4.top = new FormAttachment(_calloutBtn, 5, SWT.BOTTOM);
+ formData_4.left = new FormAttachment(0, 5);
+ _calloutOverrideBtn.setLayoutData(formData_4);
+ _calloutOverrideBtn.setText("=>"); //$NON-NLS-1$
+
+ _callinBeforeBtn = new Button(_methMapBtnComp, SWT.TOGGLE);
+ addButtonListener(_callinBeforeBtn);
+ final FormData formData_5 = new FormData();
+ formData_5.right = new FormAttachment(100, -5);
+ formData_5.top = new FormAttachment(_calloutOverrideBtn, 5, SWT.BOTTOM);
+ formData_5.left = new FormAttachment(0, 5);
+ _callinBeforeBtn.setLayoutData(formData_5);
+ _callinBeforeBtn.setText("<- before"); //$NON-NLS-1$
+
+ _callinReplaceBtn = new Button(_methMapBtnComp, SWT.TOGGLE);
+ addButtonListener(_callinReplaceBtn);
+ final FormData formData_6 = new FormData();
+ formData_6.right = new FormAttachment(100, -5);
+ formData_6.top = new FormAttachment(_callinBeforeBtn, 5, SWT.BOTTOM);
+ formData_6.left = new FormAttachment(0, 5);
+ _callinReplaceBtn.setLayoutData(formData_6);
+ _callinReplaceBtn.setText("<- replace"); //$NON-NLS-1$
+
+ _callinAfterBtn = new Button(_methMapBtnComp, SWT.TOGGLE);
+ addButtonListener(_callinAfterBtn);
+ final FormData formData_7 = new FormData();
+ formData_7.right = new FormAttachment(100, -5);
+ formData_7.top = new FormAttachment(_callinReplaceBtn, 5, SWT.BOTTOM);
+ formData_7.left = new FormAttachment(0, 5);
+ _callinAfterBtn.setLayoutData(formData_7);
+ _callinAfterBtn.setText("<- after"); //$NON-NLS-1$
+
+ final Label roleMethLabel = new Label(this, SWT.NONE);
+ final FormData formData = new FormData();
+ formData.right = new FormAttachment(0, 210);
+ formData.top = new FormAttachment(0, 5);
+ formData.left = new FormAttachment(0, 5);
+ roleMethLabel.setLayoutData(formData);
+ roleMethLabel.setText(Messages.BindingConfiguration_role_methods_label);
+
+ _roleMethListViewer = new TableViewer(this, SWT.V_SCROLL | SWT.BORDER | SWT.H_SCROLL);
+ _roleMethListViewer.setContentProvider(new RoleMethodContentProvider());
+ _roleMethListViewer.setLabelProvider(labelProvider);
+ final Table roleMethList = _roleMethListViewer.getTable();
+ final FormData formData_8 = new FormData();
+ formData_8.bottom = new FormAttachment(composite, 5, SWT.TOP);
+ formData_8.right = new FormAttachment(40, 0);
+ formData_8.top = new FormAttachment(roleMethLabel, 5, SWT.BOTTOM);
+ formData_8.left = new FormAttachment(0, 5);
+ roleMethList.setLayoutData(formData_8);
+ _roleMethListViewer.setSorter(new ViewerSorter());
+ _roleMethListViewer.setInput(new Object());
+
+ addRoleListSelectionChangedListener(_roleMethListViewer);
+
+ final Label baseMethLabel = new Label(this, SWT.NONE);
+ final FormData formData_2 = new FormData();
+ formData_2.right = new FormAttachment(100, -5);
+ formData_2.top = new FormAttachment(0, 5);
+ formData_2.left = new FormAttachment(_methMapBtnComp, 5, SWT.RIGHT);
+ baseMethLabel.setLayoutData(formData_2);
+ baseMethLabel.setText(Messages.BindingConfiguration_base_methods_label);
+
+ _baseMethListViewer = new TableViewer(this, SWT.V_SCROLL | SWT.MULTI | SWT.BORDER | SWT.H_SCROLL);
+ _baseMethListViewer.setContentProvider(new BaseMethodContentProvider());
+ _baseMethListViewer.setLabelProvider(labelProvider);
+ final Table baseMethList = _baseMethListViewer.getTable();
+ final FormData formData_12 = new FormData();
+ formData_12.bottom = new FormAttachment(composite, 5, SWT.TOP);
+ formData_12.right = new FormAttachment(100, -5);
+ formData_12.top = new FormAttachment(baseMethLabel, 5, SWT.BOTTOM);
+ formData_12.left = new FormAttachment(60, 0);
+ baseMethList.setLayoutData(formData_12);
+ _baseMethListViewer.setSorter(new ViewerSorter());
+ _baseMethListViewer.setInput(new Object());
+
+ addBaseListSelectionChangedListener(_baseMethListViewer);
+ }
+
+ private void addRoleListSelectionChangedListener(final TableViewer tableViewer)
+ {
+ ISelectionChangedListener listener = new ISelectionChangedListener()
+ {
+ public void selectionChanged(SelectionChangedEvent event)
+ {
+ if (validateSelections())
+ {
+ _methMapBtnComp.enableAll();
+ }
+
+ toggleApplyButton();
+ }
+ };
+
+ tableViewer.addSelectionChangedListener(listener);
+ }
+
+ private void addBaseListSelectionChangedListener(final TableViewer tableViewer)
+ {
+ ISelectionChangedListener listener = new ISelectionChangedListener()
+ {
+ public void selectionChanged(SelectionChangedEvent event)
+ {
+ if (!validateSelections())
+ {
+ return;
+ }
+
+ //no abstract methods selected
+ _methMapBtnComp.enableAll();
+ if (!tableViewer.getSelection().isEmpty()
+ && tableViewer.getTable().getSelection().length > 1)
+ {
+ toggleModifierButtons(OT_CALLOUT|OT_CALLOUT_OVERRIDE, DESELECT_DISABLE_BUTTONS);
+ _methMapBtnComp.removeSelectionButton(_calloutBtn);
+ _methMapBtnComp.removeSelectionButton(_calloutOverrideBtn);
+ }
+ toggleApplyButton();
+ }
+ };
+
+ tableViewer.addSelectionChangedListener(listener);
+ }
+
+ private boolean validateSelections()
+ {
+ StructuredSelection selectedBaseIMembers = (StructuredSelection)_baseMethListViewer.getSelection();
+ for (Iterator iter = selectedBaseIMembers.iterator(); iter.hasNext();)
+ {
+ IMember baseIMember = (IMember) iter.next();
+ try
+ {
+ if (Flags.isAbstract(baseIMember.getFlags()))
+ {
+ _methMapBtnComp.deselectAll();
+ _methMapBtnComp.disableAll();
+ toggleApplyButton();
+ return false;
+ }
+ }
+ catch (JavaModelException ex)
+ {
+ return false;
+ }
+ }
+
+ StructuredSelection selectedRoleIMethod = (StructuredSelection)_roleMethListViewer.getSelection();
+
+ if (selectedRoleIMethod.isEmpty())
+ {
+ return true;
+ }
+
+ IMethod roleMethod = (IMethod)selectedRoleIMethod.getFirstElement();
+ try
+ {
+ if (roleMethod.getElementName().equals(FAKED_METHOD_NAME))
+ {
+ toggleModifierButtons(OT_CALLOUT_OVERRIDE|
+ Modifier.OT_AFTER_CALLIN|
+ Modifier.OT_BEFORE_CALLIN|
+ Modifier.OT_REPLACE_CALLIN,
+ DESELECT_DISABLE_BUTTONS);
+
+ toggleApplyButton();
+ return false;
+ }
+
+ if (!roleMethod.getElementName().equals(FAKED_METHOD_NAME)
+ && !Flags.isCallin(roleMethod.getFlags())
+ && !Flags.isAbstract(roleMethod.getFlags()))
+ {
+ toggleModifierButtons(Modifier.OT_REPLACE_CALLIN|OT_CALLOUT, DESELECT_DISABLE_BUTTONS);
+ toggleApplyButton();
+ return false;
+ }
+
+ if (!roleMethod.getElementName().equals(FAKED_METHOD_NAME)
+ && Flags.isCallin(roleMethod.getFlags())
+ && !Flags.isAbstract(roleMethod.getFlags()))
+ {
+ toggleModifierButtons(OT_CALLOUT_OVERRIDE|
+ OT_CALLOUT|
+ Modifier.OT_AFTER_CALLIN|
+ Modifier.OT_BEFORE_CALLIN,
+ DESELECT_DISABLE_BUTTONS);
+ toggleApplyButton();
+ return false;
+ }
+ }
+ catch (JavaModelException ex)
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ protected void checkSubclass() {}
+
+ public IMember[] getBaseMethods(IType baseClass) throws JavaModelException
+ {
+ List<IMember> result = new ArrayList<IMember>();
+ //FIXME: cleaner but way(!) too slow:
+ //TypeHelper.getInheritedMethods(baseClass, true, false, false, new NullProgressMonitor());//
+
+ // ---------- stolen (and adapted) from CallinMapping.findBaseMethods():
+ IType[] typeParents = TypeHelper.getSuperTypes(baseClass);
+ if (OTModelManager.hasOTElementFor(baseClass)) {
+ IOTType otType = OTModelManager.getOTElement(baseClass);
+ if (otType.isRole()) {
+ IType[] implicitSupers = TypeHelper.getImplicitSuperTypes((IRoleType)otType);
+ int len1 = implicitSupers.length;
+ int len2 = typeParents.length;
+ // shift to back:
+ System.arraycopy(
+ typeParents, 0,
+ typeParents = new IType[len1+len2-1],
+ len1-1, // let tsupers overwrite first element which repeats the original baseClass
+ len2);
+ // insert at front (implicit has higher priority)
+ System.arraycopy(
+ implicitSupers, 0,
+ typeParents, 0,
+ len1);
+ }
+ }
+ HashSet<String> signatures = new HashSet<String>(); // for filtering of duplicates.
+ for (int i = 0; i < typeParents.length; i++) {
+ if (typeParents[i].getFullyQualifiedName().equals(TypeHelper.JAVA_LANG_OBJECT))
+ continue;
+ // TODO(SH): don't include private fields from super classes
+ IField[] fields = typeParents[i].getFields();
+ for (int fieldIdx = 0; fieldIdx < fields.length; fieldIdx++)
+ {
+ IField field = fields[fieldIdx];
+ String signature = field.getElementName()+field.getTypeSignature();
+ if (!signatures.contains(signature))
+ {
+ result.add(field);
+ signatures.add(signature);
+ }
+ }
+
+ IMethod[] methods = typeParents[i].getMethods();
+ for (int methIdx = 0; methIdx < methods.length; methIdx++)
+ {
+ IMethod method = methods[methIdx];
+ String signature = method.getElementName()+method.getSignature();
+ if ( !method.isConstructor()
+ && !signatures.contains(signature))
+ {
+ result.add(method);
+ signatures.add(signature);
+ }
+ }
+ }
+ // -----------
+
+ return result.toArray(new IMember[result.size()]);
+ }
+
+ public void setFocusRole(RoleTypeDeclaration focusRole, IType teamType, boolean initial)
+ {
+ if (initial)
+ {
+ _selectedCallinDecl = null;
+ _selectedCalloutDecl = null;
+ _parameterMappings = null;
+ }
+
+ _selectedRole = focusRole;
+
+ IJavaProject project = teamType.getCompilationUnit().getJavaProject();
+ IType teamClass = null;
+ // implicit inherited role class methods
+ try
+ {
+ teamClass = project.findType(teamType.getFullyQualifiedName('.'));
+ _roleMethods = TypeHelper.getAllRoleMethods(
+ teamClass,
+ focusRole.getName().toString());
+
+ }
+ catch (JavaModelException ex)
+ {
+ openErrorDialog(Messages.BindingConfiguration_error_retrieving_role_methods);
+ }
+
+ Type baseType = focusRole.getBaseClassType();
+
+ // base class methods
+ if (baseType != null)
+ {
+ try
+ {
+ String qualifiedBaseName = null;
+ if (baseType instanceof SimpleType) {
+ // try for cached names (those roles created within the binding editor):
+ Name baseName = ((SimpleType)baseType).getName();
+ qualifiedBaseName = (baseName instanceof QualifiedName) ?
+ baseName.getFullyQualifiedName() :
+ this._bindingEditor._baseClassLookup.get(((SimpleName)baseName).getIdentifier());
+ }
+ if (qualifiedBaseName == null) // other roles should be resolvable:
+ qualifiedBaseName = focusRole.resolveBinding().getBaseClass().getQualifiedName();
+
+ if (qualifiedBaseName != null)
+ _baseMethods = getBaseMethods(project.findType(qualifiedBaseName));
+ else
+ OTDTUIPlugin.getExceptionHandler().logCoreException("Failed to resolve focus role - no methods available.", null); //$NON-NLS-1$
+ }
+ catch (JavaModelException ex)
+ {
+ OTDTUIPlugin.getExceptionHandler().logCoreException(ex.getMessage(), ex);
+ }
+ }
+
+ // clear selection
+ _roleMethListViewer.setSelection(new StructuredSelection(EMPTY_LIST));
+ _baseMethListViewer.setSelection(new StructuredSelection(EMPTY_LIST));
+ _roleMethListViewer.refresh();
+ _baseMethListViewer.refresh();
+ _methMapBtnComp.enableAll();
+ _methMapBtnComp.deselectAll();
+ toggleApplyButton();
+ }
+
+ IType findRoleType (IType teamClass, String roleName)
+ throws JavaModelException
+ {
+ IType[] roles = teamClass.getTypes();
+ for (IType roleType : roles)
+ if (roleType.getElementName().equals(roleName))
+ return roleType;
+
+ for (IType roleType : roles)
+ {
+ IType result = findRoleType(roleType, roleName);
+ if (result != null)
+ return result;
+ }
+ return null;
+ }
+
+ private void toggleApplyButton()
+ {
+ if (_baseMethListViewer.getSelection().isEmpty()
+ || _roleMethListViewer.getSelection().isEmpty()
+ || (_methMapBtnComp.getSelectedButton() == null))
+ {
+ _applyBtn.setEnabled(false);
+ }
+ else
+ {
+ _applyBtn.setEnabled(true);
+ }
+ }
+
+ public void setCalloutMapping(ASTNode selectedNode, IType teamType)
+ {
+ if ( !(selectedNode instanceof CalloutMappingDeclaration) )
+ {
+ return;
+ }
+
+ _selectedCallinDecl = null;
+ _selectedCalloutDecl = (CalloutMappingDeclaration)selectedNode;
+ RoleTypeDeclaration roleTypeDecl = (RoleTypeDeclaration)_selectedCalloutDecl.getParent();
+ setFocusRole(roleTypeDecl, teamType, false);
+
+ MethodSpec roleMethSpec = (MethodSpec)_selectedCalloutDecl.getRoleMappingElement();
+ IMember roleMeth = findCorrespondingIMember(roleMethSpec, _roleMethods, null);
+ if (roleMeth != null)
+ {
+ _roleMethListViewer.setSelection( new StructuredSelection(roleMeth) );
+ }
+ else
+ {
+ _roleMethListViewer.setSelection( new StructuredSelection(_fakedMeth) );
+ }
+
+ MethodMappingElement baseSpec = (MethodMappingElement)_selectedCalloutDecl.getBaseMappingElement();
+ List<MethodMappingElement> baseSpecs = new ArrayList<MethodMappingElement>();
+ baseSpecs.add(baseSpec);
+ List<IMember> curBaseMeths = findCorrespondingIMembers(baseSpecs, _baseMethods);
+ if (curBaseMeths != null)
+ {
+ _baseMethListViewer.setSelection( new StructuredSelection(curBaseMeths) );
+ }
+ else
+ {
+ _baseMethListViewer.setSelection( new StructuredSelection(EMPTY_LIST) );
+ }
+
+ _parameterMappings = _selectedCalloutDecl.getParameterMappings();
+
+
+ if( _selectedCalloutDecl.isCalloutOverride())
+ {
+ _methMapBtnComp.setSelectionButton(_calloutOverrideBtn);
+ }
+ else
+ {
+ _methMapBtnComp.setSelectionButton(_calloutBtn);
+ }
+
+ toggleApplyButton();
+ }
+
+ public void setCallinMapping(ASTNode selectedNode, IType teamType)
+ {
+ if ( !(selectedNode instanceof CallinMappingDeclaration))
+ {
+ return;
+ }
+
+ _selectedCalloutDecl = null;
+ _selectedCallinDecl = (CallinMappingDeclaration)selectedNode;
+
+ RoleTypeDeclaration roleTypeDecl = (RoleTypeDeclaration)_selectedCallinDecl.getParent();
+ setFocusRole(roleTypeDecl, teamType, false);
+
+ MethodSpec roleMethSpec = (MethodSpec)_selectedCallinDecl.getRoleMappingElement();
+ IMember roleMeth = findCorrespondingIMember(roleMethSpec, _roleMethods, null);
+ if (roleMeth != null)
+ {
+ _roleMethListViewer.setSelection( new StructuredSelection(roleMeth) );
+ }
+ else
+ {
+ _roleMethListViewer.setSelection( new StructuredSelection(EMPTY_LIST) );
+ }
+
+ java.util.List<MethodMappingElement> baseMapElems = _selectedCallinDecl.getBaseMappingElements();
+ if (baseMapElems.size() == 0)
+ {
+ return;
+ }
+
+ java.util.List<IMember> baseMembs = findCorrespondingIMembers(baseMapElems, _baseMethods);
+ if (baseMembs != null)
+ {
+ _baseMethListViewer.setSelection( new StructuredSelection(baseMembs) );
+ }
+ else
+ {
+ _baseMethListViewer.setSelection( new StructuredSelection(EMPTY_LIST) );
+ }
+
+ _parameterMappings = _selectedCallinDecl.getParameterMappings();
+
+ toggleModifierButtons(_selectedCallinDecl.getCallinModifier(), SELECT_BUTTONS);
+ toggleApplyButton();
+ }
+
+ private List<IMember> findCorrespondingIMembers(List<MethodMappingElement> methodSpecs, IMember[] members)
+ {
+ Hashtable<String, Integer> methodAppearances = getMethodAppearances(members);
+
+ List<IMember> baseMembers = new ArrayList<IMember>();
+ for (Iterator<MethodMappingElement> iter = methodSpecs.iterator(); iter.hasNext();)
+ {
+ MethodMappingElement methodSpec = iter.next();
+
+ IMember foundMethod = findCorrespondingIMember(methodSpec, members, methodAppearances);
+ baseMembers.add(foundMethod);
+ }
+ return baseMembers;
+ }
+
+ private IMember findCorrespondingIMember(MethodMappingElement methodSpec, IMember[] methods, Hashtable<String, Integer> methodAppearances)
+ {
+ if (methodAppearances == null)
+ methodAppearances = getMethodAppearances(methods);
+
+ String methodName = methodSpec.getName().toString();
+ for (int idx = 0; idx < methods.length; idx++)
+ {
+ if (methodName.equals(methods[idx].getElementName()))
+ {
+ Integer value = methodAppearances.get(methodName);
+ if (value.intValue() > 1)
+ {
+ // FIXME(SH): handle field cases:
+ if ( methodSpec instanceof MethodSpec
+ && methods[idx] instanceof IMethod)
+ {
+ List parameters = ((MethodSpec)methodSpec).parameters();
+ String []parameterTypes = ((IMethod)methods[idx]).getParameterTypes();
+
+ if (parameters.size() != parameterTypes.length)
+ {
+ continue;
+ }
+
+ if (validateParameterMatching(parameters, parameterTypes))
+ {
+ return methods[idx];
+ }
+ }
+ }
+ else
+ {
+ return methods[idx];
+ }
+ }
+ }
+ return null;
+ }
+
+ private boolean validateParameterMatching(List parameters, String[] parameterTypes)
+ {
+ boolean totallyMatch = true;
+ int counter = 0;
+ for (Iterator iter = parameters.iterator(); iter.hasNext();)
+ {
+ SingleVariableDeclaration variable = (SingleVariableDeclaration) iter .next();
+ String paramTypeNameFromMethodSpec = null;
+
+ if (variable.getType().isPrimitiveType())
+ {
+ paramTypeNameFromMethodSpec = ((PrimitiveType)variable.getType()).getPrimitiveTypeCode().toString();
+ }
+
+ if (variable.getType().isSimpleType())
+ {
+ ITypeBinding typeBinding =((SimpleType)variable.getType()).resolveBinding();
+ if (typeBinding == null)
+ {
+ paramTypeNameFromMethodSpec = ((SimpleType)variable.getType()).getName().getFullyQualifiedName();
+ }
+ else
+ {
+ paramTypeNameFromMethodSpec = typeBinding.getQualifiedName();
+ }
+ }
+
+ if (variable.getType().isArrayType())
+ {
+ Type arrayType = ((ArrayType)variable.getType()).getComponentType();
+ if (arrayType.isPrimitiveType())
+ {
+ paramTypeNameFromMethodSpec = ((PrimitiveType)arrayType).getPrimitiveTypeCode().toString();
+ }
+
+ if (arrayType.isSimpleType())
+ {
+ ITypeBinding typeBinding =((SimpleType)arrayType).resolveBinding();
+ if (typeBinding == null)
+ {
+ paramTypeNameFromMethodSpec = ((SimpleType)arrayType).getName().getFullyQualifiedName();
+ }
+ else
+ {
+ paramTypeNameFromMethodSpec = typeBinding.getQualifiedName();
+ }
+ }
+ paramTypeNameFromMethodSpec += "[]"; //$NON-NLS-1$
+ }
+
+ //TODO(ike): Find a way to resolved parameters of methodSpecs to get fully qualified names
+ String paramTypeNameFromIMethod = Signature.toString(parameterTypes[counter]);
+ String simpleTypeName = getSimpleParameterName(paramTypeNameFromIMethod);
+ if (!simpleTypeName.equals(paramTypeNameFromMethodSpec))
+ {
+ totallyMatch = false;
+ }
+
+ counter++;
+ }
+ return totallyMatch;
+ }
+
+
+ private String getSimpleParameterName(String parameterName)
+ {
+ String [] simpleNameArray = parameterName.split("\\."); //$NON-NLS-1$
+ if (simpleNameArray.length == 0)
+ return parameterName;
+ else
+ return simpleNameArray[simpleNameArray.length - 1];
+ }
+
+ private Hashtable<String, Integer> getMethodAppearances(IMember[] methods)
+ {
+ Hashtable<String, Integer> appearances = new Hashtable<String, Integer>();
+ for (int idx = 0; idx < methods.length; idx++)
+ {
+ String methodName = methods[idx].getElementName();
+ if (appearances.containsKey(methodName))
+ {
+ Integer value = appearances.get(methodName);
+ int app = value.intValue();
+ app++;
+ appearances.put(methodName, new Integer(app));
+ }
+ else
+ {
+ appearances.put(methodName, new Integer(1));
+ }
+ }
+ return appearances;
+ }
+
+ private void toggleModifierButtons(int modifiers, int selectionLevel)
+ {
+ List<Button> buttonList = getButtonsForModifiers(modifiers);
+
+ switch (selectionLevel)
+ {
+ case SELECT_BUTTONS:
+ for (Iterator<Button> iter = buttonList.iterator(); iter.hasNext();)
+ {
+ Button button = iter.next();
+ _methMapBtnComp.setSelectionButton(button);
+ }
+ break;
+
+ case DESELECT_DISABLE_BUTTONS:
+ if (Modifier.isReplace(modifiers))
+ {
+ _callinReplaceBtn.setEnabled(false);
+ _methMapBtnComp.removeSelectionButton(_callinReplaceBtn);
+ }
+ else
+ {
+ _callinReplaceBtn.setEnabled(true);
+ }
+
+ if (Modifier.isBefore(modifiers))
+ {
+ _callinBeforeBtn.setEnabled(false);
+ _methMapBtnComp.removeSelectionButton(_callinBeforeBtn);
+ }
+ else
+ {
+ _callinBeforeBtn.setEnabled(true);
+ }
+
+ if (Modifier.isAfter(modifiers))
+ {
+ _callinAfterBtn.setEnabled(false);
+ _methMapBtnComp.removeSelectionButton(_callinAfterBtn);
+ }
+ else
+ {
+ _callinAfterBtn.setEnabled(true);
+ }
+
+ if (isCallout(modifiers))
+ {
+ _calloutBtn.setEnabled(false);
+ _methMapBtnComp.removeSelectionButton(_calloutBtn);
+ }
+ else
+ {
+ _calloutBtn.setEnabled(true);
+ }
+
+ if (isCalloutOverride(modifiers))
+ {
+ _calloutOverrideBtn.setEnabled(false);
+ _methMapBtnComp.removeSelectionButton(_calloutOverrideBtn);
+ }
+ else
+ {
+ _calloutOverrideBtn.setEnabled(true);
+ }
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ private List<Button> getButtonsForModifiers(int modifiers)
+ {
+ List<Button> buttonList = new ArrayList<Button>();
+
+ if (Modifier.isReplace(modifiers))
+ buttonList.add(_callinReplaceBtn);
+
+ if (Modifier.isBefore(modifiers))
+ buttonList.add(_callinBeforeBtn);
+
+ if (Modifier.isAfter(modifiers))
+ buttonList.add(_callinAfterBtn);
+
+ if (isCallout(modifiers))
+ buttonList.add(_calloutBtn);
+
+ if (isCalloutOverride(modifiers))
+ buttonList.add(_calloutBtn);
+
+ return buttonList;
+ }
+
+ private boolean isCalloutOverride(int modifiers)
+ {
+ return (modifiers & OT_CALLOUT_OVERRIDE) != 0;
+ }
+
+ private boolean isCallout(int modifiers)
+ {
+ return (modifiers & OT_CALLOUT) != 0;
+ }
+
+ private void addButtonListener(Button button)
+ {
+ SelectionListener buttonListener = new SelectionListener() {
+ public void widgetSelected(SelectionEvent evt)
+ {
+ Button selectedButton = (Button)evt.getSource();
+ _methMapBtnComp.doRadioButtonBehavior(selectedButton);
+ toggleApplyButton();
+ }
+
+ public void widgetDefaultSelected(SelectionEvent evt) {}
+ };
+ button.addSelectionListener(buttonListener);
+ }
+
+ private void addApplyButtonListener(Button applyButton)
+ {
+ SelectionListener applyButtonListener = new SelectionAdapter()
+ {
+ public void widgetSelected(SelectionEvent evt)
+ {
+ applyPressed();
+ }
+ };
+ applyButton.addSelectionListener(applyButtonListener);
+ }
+
+ private boolean createMethodMapping()
+ {
+ int methMapModifier = 0;
+ boolean calloutOverride = false;
+ boolean signatureFlag = true;
+ _newCallout = true;
+ Button selectedButton = _methMapBtnComp.getSelectedButton();
+
+ if (_calloutBtn.equals(selectedButton))
+ {
+ methMapModifier = 0;
+ _newCallout = true;
+ }
+ if (_calloutOverrideBtn.equals(selectedButton))
+ {
+ calloutOverride = true;
+ methMapModifier = 0;
+ _newCallout = true;
+ }
+ if (_callinReplaceBtn.equals(selectedButton))
+ {
+ methMapModifier = Modifier.OT_REPLACE_CALLIN;
+ _newCallout = false;
+ }
+ if (_callinBeforeBtn.equals(selectedButton))
+ {
+ methMapModifier = Modifier.OT_BEFORE_CALLIN;
+ _newCallout = false;
+ }
+ if (_callinAfterBtn.equals(selectedButton))
+ {
+ methMapModifier = Modifier.OT_AFTER_CALLIN;
+ _newCallout = false;
+ }
+
+ StructuredSelection selectedRoleMethod = (StructuredSelection)_roleMethListViewer.getSelection();
+ if (selectedRoleMethod.isEmpty())
+ {
+ return false;
+ }
+
+ StructuredSelection selectedBaseMethods = (StructuredSelection)_baseMethListViewer.getSelection();
+ if (selectedBaseMethods.isEmpty())
+ {
+ return false;
+ }
+
+ IMethod roleMethod = (IMethod) selectedRoleMethod.getFirstElement();
+ IMember[] baseMethods = new IMember[selectedBaseMethods.size()];
+ int baseMethodsCount = 0;
+ for (Iterator iter = selectedBaseMethods.iterator(); iter.hasNext();)
+ {
+ IMember baseMethod = (IMember) iter.next();
+ baseMethods[baseMethodsCount++] = baseMethod;
+ }
+
+ AST ast = _selectedRole.getAST();
+
+ if (_newCallout)
+ {
+ return createCalloutMapping(ast, roleMethod, baseMethods[0], methMapModifier, calloutOverride, signatureFlag);
+ }
+ else
+ {
+ return createCallinMapping(ast, roleMethod, baseMethods, methMapModifier, signatureFlag);
+ }
+ }
+
+ private boolean createCallinMapping(AST ast, IMethod roleIMethod, IMember[] baseMethods, int modifier, boolean signatureFlag)
+ {
+ // can only bind methods in callin:
+ for (IMember member : baseMethods)
+ if (!(member instanceof IMethod))
+ return false;
+
+ MethodSpec givenRoleMSpec = null;
+ List<MethodSpec> givenBaseMSpecs = null;
+ if (_selectedCallinDecl != null)
+ {
+ givenRoleMSpec = (MethodSpec)_selectedCallinDecl.getRoleMappingElement();
+ givenBaseMSpecs = _selectedCallinDecl.getBaseMappingElements();
+ }
+
+ IMethod templateForRoleMethodSpec = roleIMethod;
+ if (templateForRoleMethodSpec.getElementName().startsWith(FAKED_METHOD_NAME))
+ templateForRoleMethodSpec = (IMethod)baseMethods[0]; // use the first base method as template for the role method spec
+ // FIXME: support automatic creation of a new role method
+
+ MethodSpec roleMethodSpec = createMethodSpec(ast, templateForRoleMethodSpec, givenRoleMSpec, signatureFlag);
+ if (roleMethodSpec == null)
+ return false;
+
+ List<MethodMappingElement> baseMethodSpecs = new ArrayList<MethodMappingElement>();
+ for (int idx = 0; idx < baseMethods.length; idx++)
+ {
+ IMethod baseIMethod = (IMethod)baseMethods[idx];
+ MethodSpec baseMSpec = null;
+
+ if ((givenBaseMSpecs != null) && baseMethods.length == 1)
+ {
+ baseMSpec = givenBaseMSpecs.get(idx);
+ }
+
+ MethodMappingElement baseMethodSpec = createMethodSpec(ast, baseIMethod, baseMSpec, signatureFlag);
+ if (baseMethodSpec!= null)
+ {
+ baseMethodSpecs.add(baseMethodSpec);
+ }
+ }
+ if (_selectedCallinDecl == null)
+ {
+ _parameterMappings = null;
+ }
+
+ _callinMapping = ASTNodeCreator.createCallinMappingDeclaration(
+ ast,
+ null,
+ modifier,
+ roleMethodSpec,
+ baseMethodSpecs,
+ _parameterMappings);
+
+ return true;
+ }
+
+ private boolean createCalloutMapping(
+ AST ast,
+ IMethod roleMethod,
+ IMember baseMethod,
+ int bindingModifier,
+ boolean calloutOverride,
+ boolean signatureFlag)
+ {
+ MethodSpec selRolMethSpec = null;
+ MethodMappingElement selBasMethSpec = null;
+
+ if (_selectedCalloutDecl != null)
+ {
+ selRolMethSpec = (MethodSpec)_selectedCalloutDecl.getRoleMappingElement();
+ selBasMethSpec = _selectedCalloutDecl.getBaseMappingElement();
+ if (baseMethod instanceof IMethod && !(selBasMethSpec instanceof MethodSpec))
+ return false; // cannot change from method to field.
+ }
+
+ MethodMappingElement baseMethodSpec = null;
+ if (baseMethod instanceof IMethod)
+ baseMethodSpec = createMethodSpec(
+ ast,
+ (IMethod)baseMethod,
+ (MethodSpec)selBasMethSpec,
+ signatureFlag);
+ /* FIXME: implement all other combinations
+ else
+ baseMethodSpec = createFieldAccessSpec(ast, (IField)baseIMember, baseMSpec, signatureFlag);
+ */
+ if (baseMethodSpec == null)
+ {
+ return false;
+ }
+
+ MethodMappingElement roleMethodSpec = null;
+ if (roleMethod.getElementName().startsWith(FAKED_METHOD_NAME))
+ {
+ if (baseMethod instanceof IMethod)
+ roleMethodSpec = createMethodSpec(
+ ast,
+ (IMethod)baseMethod,
+ (MethodSpec)selBasMethSpec,
+ signatureFlag);
+ /* FIXME: implement:
+ else
+ roleMethodSpec = createFieldAccess((IField)baseMethod...);
+ */
+ }
+ else
+ {
+ roleMethodSpec = createMethodSpec(
+ ast,
+ roleMethod,
+ selRolMethSpec,
+ signatureFlag);
+ }
+ if (roleMethodSpec == null)
+ {
+ return false;
+ }
+
+ if (_selectedCalloutDecl == null)
+ {
+ _parameterMappings = null;
+ }
+
+ _calloutMapping = ASTNodeCreator.createCalloutMappingDeclaration(
+ ast,
+ null,
+ 0, // modifiers
+ roleMethodSpec,
+ baseMethodSpec,
+ bindingModifier, // FIXME(SH): not yet provided from caller
+ _parameterMappings,
+ calloutOverride,
+ signatureFlag);
+
+ return true;
+ }
+
+ private MethodSpec createMethodSpec(AST ast, IMethod iMethod, MethodSpec givenMethodSpec, boolean signatureFlag)
+ {
+ String returnTypeString;
+ try
+ {
+ returnTypeString = Signature.toString(iMethod.getReturnType());
+ }
+ catch (JavaModelException e)
+ {
+ return null;
+ }
+
+ Type returnType = ASTNodeCreator.createType(ast, returnTypeString);
+
+ String [] parameterTypes = iMethod.getParameterTypes();
+ String [] parameterNames = null;
+
+ try
+ {
+ parameterNames = iMethod.getParameterNames();
+ }
+ catch (JavaModelException e1)
+ {
+ return null;
+ }
+
+ List mSpecParameters = null;
+ if (givenMethodSpec != null)
+ {
+ mSpecParameters = givenMethodSpec.parameters();
+ }
+
+ java.util.List<SingleVariableDeclaration> methodParameters = new ArrayList<SingleVariableDeclaration>();
+ for (int idx = 0; idx < parameterTypes.length; idx++)
+ {
+ Type parameterType = ASTNodeCreator.createType(
+ ast,
+ Signature.getSimpleName(Signature.toString(parameterTypes[idx])));
+
+ SingleVariableDeclaration roleParameter;
+ if (mSpecParameters != null && mSpecParameters.size()==parameterNames.length)
+ {
+ SingleVariableDeclaration param = (SingleVariableDeclaration)mSpecParameters.get(idx);
+ roleParameter =
+ ASTNodeCreator.createArgument(ast, 0, parameterType, param.getName().toString(), 0, null);
+ }
+ else
+ {
+ roleParameter =
+ ASTNodeCreator.createArgument(ast, 0, parameterType, parameterNames[idx], 0, null);
+ }
+
+ methodParameters.add(roleParameter);
+
+ }
+
+ MethodSpec methodSpec = ASTNodeCreator.createMethodSpec(
+ ast,
+ iMethod.getElementName(),
+ returnType,
+ methodParameters,
+ signatureFlag
+ );
+
+
+ return methodSpec;
+ }
+
+ //copied from org.soothsayer.util.ASTNodeHelper;
+ public static String getMethodSignature(IMethod meth)
+ {
+ StringBuffer result = new StringBuffer();
+
+ if (meth != null)
+ {
+ result.append(meth.getElementName());
+ result.append('(');
+
+ String[] parameterTypes = meth.getParameterTypes();
+ for (int idx = 0; idx < parameterTypes.length; idx++)
+ {
+ String curType = parameterTypes[idx];
+ result.append(curType);
+ if (idx < parameterTypes.length)
+ {
+ result.append(", "); //$NON-NLS-1$
+ }
+ }
+ result.append(')');
+ }
+
+ return result.toString();
+ }
+
+ public void resetLists()
+ {
+ _baseMethListViewer.getTable().removeAll();
+ _roleMethListViewer.getTable().removeAll();
+ _methMapBtnComp.enableAll();
+ _methMapBtnComp.deselectAll();
+ }
+
+ public void setCurrentTeamForMethodFake(IType teamType)
+ {
+ _curTeam = teamType;
+ }
+
+ private void applyPressed()
+ {
+ if (_selectedRole.isRoleFile()) {
+ openErrorDialog(MessageFormat.format(
+ Messages.BindingConfiguration_error_cant_edit_rolefile,
+ _selectedRole.getName().getIdentifier(),
+ _selectedRole.getName().getIdentifier()));
+ return;
+ }
+ RoleTypeDeclaration currentRole= _selectedRole;
+ while (true) {
+ currentRole= (RoleTypeDeclaration)ASTNodes.getParent(currentRole, ASTNode.ROLE_TYPE_DECLARATION);
+ if (currentRole == null)
+ break;
+ if (currentRole.isRoleFile()) {
+ openErrorDialog(MessageFormat.format(
+ Messages.BindingConfiguration_error_cant_edit_rolefile_nested,
+ new Object[]{_selectedRole.getName().getIdentifier(),
+ currentRole.getName().getIdentifier(),
+ currentRole.getName().getIdentifier()}));
+ return;
+ }
+ currentRole= (RoleTypeDeclaration)ASTNodes.getParent(_selectedRole, ASTNode.ROLE_TYPE_DECLARATION);
+ }
+
+ _calloutMapping = null;
+ _callinMapping = null;
+ int selectedIndex = -1;
+
+ if (createMethodMapping())
+ {
+ if (_calloutMapping != null)
+ {
+ if (_selectedCalloutDecl != null)
+ {
+ selectedIndex = _selectedRole.bodyDeclarations().indexOf(_selectedCalloutDecl);
+ _selectedRole.bodyDeclarations().remove(_selectedCalloutDecl);
+ }
+ if (_selectedCallinDecl != null)
+ {
+ selectedIndex = _selectedRole.bodyDeclarations().indexOf(_selectedCallinDecl);
+ _selectedRole.bodyDeclarations().remove(_selectedCallinDecl);
+ }
+
+ if (selectedIndex == -1){
+ _selectedRole.bodyDeclarations().add(_calloutMapping);
+ }
+ else
+ {
+ _selectedRole.bodyDeclarations().add(selectedIndex, _calloutMapping);
+ }
+ }
+
+ if (_callinMapping != null)
+ {
+ if (_selectedCallinDecl != null)
+ {
+ selectedIndex = _selectedRole.bodyDeclarations().indexOf(_selectedCallinDecl);
+ _selectedRole.bodyDeclarations().remove(_selectedCallinDecl);
+
+ }
+ if (_selectedCalloutDecl != null)
+ {
+ selectedIndex = _selectedRole.bodyDeclarations().indexOf(_selectedCalloutDecl);
+ _selectedRole.bodyDeclarations().remove(_selectedCalloutDecl);
+ }
+
+ if (selectedIndex == -1)
+ {
+ _selectedRole.bodyDeclarations().add(_callinMapping);
+ }
+ else
+ {
+ _selectedRole.bodyDeclarations().add(selectedIndex, _callinMapping);
+ }
+ }
+
+ // clear selection
+ _roleMethListViewer.setSelection(new StructuredSelection(EMPTY_LIST));
+ _baseMethListViewer.setSelection(new StructuredSelection(EMPTY_LIST));
+ _roleMethListViewer.refresh();
+ _baseMethListViewer.refresh();
+
+ _bindingEditor.refresh();
+
+ AbstractMethodMappingDeclaration mapping = _callinMapping;
+ if (mapping == null)
+ mapping = _calloutMapping;
+ _bindingEditor.methodBindingAdded(mapping);
+ }
+ else
+ {
+ openErrorDialog(Messages.BindingConfiguration_error_binding_creation_failed);
+
+ _roleMethListViewer.setSelection(new StructuredSelection(EMPTY_LIST));
+ _baseMethListViewer.setSelection(new StructuredSelection(EMPTY_LIST));
+ _roleMethListViewer.refresh();
+ _baseMethListViewer.refresh();
+ _methMapBtnComp.enableAll();
+ _methMapBtnComp.deselectAll();
+
+ _bindingEditor.refresh();
+ }
+ }
+
+ private void openErrorDialog(String message)
+ {
+ MessageDialog.openError(getShell(), Messages.BindingConfiguration_error_unspecific, message);
+ }
+
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/bindingeditor/BindingEditor.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/bindingeditor/BindingEditor.java
new file mode 100644
index 000000000..5bc696f43
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/bindingeditor/BindingEditor.java
@@ -0,0 +1,721 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2005, 2007 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: BindingEditor.java 23435 2010-02-04 00:14:38Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.bindingeditor;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.core.dom.AST;
+import org.eclipse.jdt.core.dom.ASTNode;
+import org.eclipse.jdt.core.dom.ASTVisitor;
+import org.eclipse.jdt.core.dom.AbstractMethodMappingDeclaration;
+import org.eclipse.jdt.core.dom.CallinMappingDeclaration;
+import org.eclipse.jdt.core.dom.CalloutMappingDeclaration;
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jdt.core.dom.FieldAccessSpec;
+import org.eclipse.jdt.core.dom.ITypeBinding;
+import org.eclipse.jdt.core.dom.IVariableBinding;
+import org.eclipse.jdt.core.dom.ImportDeclaration;
+import org.eclipse.jdt.core.dom.MethodMappingElement;
+import org.eclipse.jdt.core.dom.Modifier;
+import org.eclipse.jdt.core.dom.Name;
+import org.eclipse.jdt.core.dom.ParameterMapping;
+import org.eclipse.jdt.core.dom.ParameterizedType;
+import org.eclipse.jdt.core.dom.QualifiedType;
+import org.eclipse.jdt.core.dom.RoleTypeDeclaration;
+import org.eclipse.jdt.core.dom.SimpleType;
+import org.eclipse.jdt.core.dom.Type;
+import org.eclipse.jdt.core.dom.TypeDeclaration;
+import org.eclipse.jdt.ui.ISharedImages;
+import org.eclipse.jdt.ui.JavaUI;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.TabFolder;
+import org.eclipse.swt.widgets.TabItem;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeColumn;
+import org.eclipse.swt.widgets.TreeItem;
+import org.eclipse.ui.model.WorkbenchLabelProvider;
+import org.eclipse.objectteams.otdt.core.compiler.IOTConstants;
+import org.eclipse.objectteams.otdt.ui.ImageManager;
+
+/**
+ * The main UI class of the binding editor.
+ *
+ * @author jwloka
+ */
+public class BindingEditor extends Composite
+{
+ private IType _team;
+ final BindingConfiguration bindConfig;
+ private Tree _connTableTree;
+ private TabFolder _tabFolder;
+ private CallinMappingConfiguration _callinMapConfig;
+ private CalloutMappingConfiguration _calloutMapConfig;
+ private TabItem _paraMapItem;
+ private TabItem _methMapItem;
+ // for tab folder switching
+ private final TabItem[] _methMapItems;
+ private final TabItem[] _paraMapItems;
+ final TreeViewer _connTableViewer;
+ private TypeDeclaration _rootTeam;
+
+ /** Map single names to qualified names (only for bases of newly created roles. */
+ HashMap<String,String> _baseClassLookup = new HashMap<String,String>();
+
+ class TreeContentProvider implements IStructuredContentProvider, ITreeContentProvider
+ {
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
+ public void dispose() {}
+
+ public Object[] getElements(Object inputElement)
+ {
+ TypeDeclaration decl = (TypeDeclaration)inputElement;
+ return decl.getTypes();
+ }
+
+ public Object[] getChildren(Object parentElement)
+ {
+ ASTNode node = (ASTNode)parentElement;
+ if (node.getNodeType() == ASTNode.ROLE_TYPE_DECLARATION)
+ {
+ RoleTypeDeclaration roleNode = (RoleTypeDeclaration)node;
+ Object[] callouts = roleNode.getCallOuts();
+ Object[] callins = roleNode.getCallIns();
+ Object[] roles = roleNode.getRoles();
+ Object[] result = new Object[roles.length+callouts.length+callins.length];
+ System.arraycopy(roles, 0, result, 0, roles.length);
+ System.arraycopy(callouts, 0, result, roles.length, callouts.length);
+ System.arraycopy(callins, 0, result, roles.length+callouts.length, callins.length);
+ return result;
+ }
+ else if (node.getNodeType() == ASTNode.CALLIN_MAPPING_DECLARATION
+ || node.getNodeType() == ASTNode.CALLOUT_MAPPING_DECLARATION)
+ {
+ AbstractMethodMappingDeclaration mapping =
+ (AbstractMethodMappingDeclaration)node;
+ List pMappings = mapping.getParameterMappings();
+ return pMappings.toArray();
+ }
+ else
+ {
+ return new Object[]{};
+ }
+ }
+
+ public Object getParent(Object element)
+ {
+ return null;
+ }
+
+ public boolean hasChildren(Object element)
+ {
+ return getChildren(element).length > 0;
+ }
+ }
+
+ class LabelProvider extends WorkbenchLabelProvider implements ITableLabelProvider
+ {
+ private static final String INDENT = " "; //$NON-NLS-1$
+ private static final String PARAMETER_MAPPING_RIGHT = "->"; //$NON-NLS-1$
+ private static final String EMPTY_TEXT = ""; //$NON-NLS-1$
+
+ public void addListener(ILabelProviderListener listener) {}
+ public void dispose() {}
+
+ public boolean isLabelProperty(Object element, String property)
+ {
+ return false;
+ }
+
+ public void removeListener(ILabelProviderListener listener) {}
+
+ public Image getColumnImage(Object element, int columnIndex)
+ {
+ ASTNode node = (ASTNode)element;
+ switch (columnIndex) {
+ case 0: // role column
+ if (node.getNodeType() == ASTNode.ROLE_TYPE_DECLARATION) {
+ if (((RoleTypeDeclaration)node).isTeam())
+ return ImageManager.getSharedInstance().get(ImageManager.TEAM_ROLE_IMG);
+ else
+ return ImageManager.getSharedInstance().get(ImageManager.ROLECLASS_IMG);
+ }
+ break;
+ case 2: // base column
+ if (node.getNodeType() == ASTNode.ROLE_TYPE_DECLARATION) {
+ ITypeBinding binding= ((TypeDeclaration)node).resolveBinding();
+ if (binding != null)
+ binding= binding.getBaseClass();
+ if (binding != null) {
+ if (binding.isRole()) {
+ if (binding.isTeam())
+ return ImageManager.getSharedInstance().get(ImageManager.TEAM_ROLE_IMG);
+ else
+ return ImageManager.getSharedInstance().get(ImageManager.ROLECLASS_IMG);
+ } else if (binding.isTeam()) {
+ return ImageManager.getSharedInstance().get(ImageManager.TEAM_IMG);
+ }
+ }
+ return JavaUI.getSharedImages().getImage(ISharedImages.IMG_OBJS_CLASS);
+ } else if (node.getNodeType() == ASTNode.CALLOUT_MAPPING_DECLARATION) {
+ MethodMappingElement baseMappingElement = ((CalloutMappingDeclaration)node).getBaseMappingElement();
+ if (baseMappingElement.getNodeType() == ASTNode.FIELD_ACCESS_SPEC)
+ {
+ IVariableBinding field= ((FieldAccessSpec)baseMappingElement).resolveBinding();
+ if (field != null) {
+ if (Modifier.isPublic(field.getModifiers()))
+ return JavaUI.getSharedImages().getImage(ISharedImages.IMG_FIELD_PUBLIC);
+ if (Modifier.isProtected(field.getModifiers()))
+ return JavaUI.getSharedImages().getImage(ISharedImages.IMG_FIELD_PROTECTED);
+ if (Modifier.isPrivate(field.getModifiers()))
+ return JavaUI.getSharedImages().getImage(ISharedImages.IMG_FIELD_PRIVATE);
+ }
+ return JavaUI.getSharedImages().getImage(ISharedImages.IMG_FIELD_DEFAULT);
+ }
+ }
+ break;
+ case 1: // mapping kind column
+ switch (node.getNodeType()) {
+ case ASTNode.CALLIN_MAPPING_DECLARATION:
+ int callinModifier = ((CallinMappingDeclaration)element).getCallinModifier();
+ if (Modifier.isAfter(callinModifier))
+ return ImageManager.getSharedInstance().get(ImageManager.CALLINBINDING_AFTER_IMG);
+ else if(Modifier.isBefore(callinModifier))
+ return ImageManager.getSharedInstance().get(ImageManager.CALLINBINDING_BEFORE_IMG);
+ else
+ return ImageManager.getSharedInstance().get(ImageManager.CALLINBINDING_REPLACE_IMG);
+
+ case ASTNode.CALLOUT_MAPPING_DECLARATION:
+ return ImageManager.getSharedInstance().get(ImageManager.CALLOUTBINDING_IMG);
+
+ case ASTNode.PARAMETER_MAPPING:
+ ParameterMapping mapping = (ParameterMapping)element;
+ if (mapping.getDirection().equals(PARAMETER_MAPPING_RIGHT))
+ return ImageManager.getSharedInstance().get(ImageManager.CALLOUTBINDING_IMG);
+ else
+ return ImageManager.getSharedInstance().get(ImageManager.CALLINBINDING_REPLACE_IMG); // ups ;-)
+ }
+ }
+ return null;
+ }
+
+
+ public String getColumnText(Object element, int columnIndex)
+ {
+ ASTNode node = (ASTNode)element;
+ switch (node.getNodeType())
+ {
+ case ASTNode.ROLE_TYPE_DECLARATION:
+ {
+ RoleTypeDeclaration role = (RoleTypeDeclaration)element;
+ switch (columnIndex)
+ {
+ case 0:
+ return role.getName().getIdentifier();
+ case 1:
+ return EMPTY_TEXT;
+ case 2:
+ Name baseClass = getRoleBaseClass(role);
+ if (baseClass != null)
+ return baseClass.getFullyQualifiedName();
+ else
+ return EMPTY_TEXT;
+ default:
+ return EMPTY_TEXT;
+ }
+ }
+ case ASTNode.CALLIN_MAPPING_DECLARATION:
+ {
+ CallinMappingDeclaration callinDecl = (CallinMappingDeclaration)element;
+ switch (columnIndex)
+ {
+ case 0:
+ return callinDecl.getRoleMappingElement().toString();
+ case 1:
+
+ if (Modifier.isAfter(callinDecl.getCallinModifier()))
+ {
+ return new String(IOTConstants.NAME_AFTER);
+ }
+ else if(Modifier.isBefore(callinDecl.getCallinModifier()))
+ {
+ return new String(IOTConstants.NAME_BEFORE);
+ }
+ else if(Modifier.isReplace(callinDecl.getCallinModifier()))
+ {
+ return new String(IOTConstants.NAME_REPLACE);
+ }
+ else
+ {
+ return EMPTY_TEXT;
+ }
+
+ //orig:
+ //return Modifier.ModifierKeyword.fromFlagValue(callinDecl.getModifiers()).toString();
+ case 2:
+ List baseMappingElements = callinDecl.getBaseMappingElements();
+ String result = INDENT;
+ for (int idx = 0; idx < baseMappingElements.size(); idx ++)
+ {
+ if (idx > 0)
+ {
+ result = result + ", "; //$NON-NLS-1$
+ }
+ result = result + baseMappingElements.get(idx).toString();
+ }
+ return result;
+ default:
+ return EMPTY_TEXT;
+ }
+ }
+ case ASTNode.CALLOUT_MAPPING_DECLARATION:
+ {
+ CalloutMappingDeclaration callout = (CalloutMappingDeclaration)element;
+ switch (columnIndex)
+ {
+ case 0:
+ return callout.getRoleMappingElement().toString();
+ case 1:
+ return EMPTY_TEXT;
+ case 2:
+ return INDENT+callout.getBaseMappingElement().toString();
+ default:
+ return EMPTY_TEXT;
+ }
+ }
+ case ASTNode.PARAMETER_MAPPING:
+ {
+ ParameterMapping mapping = (ParameterMapping)element;
+ switch (columnIndex)
+ {
+ case 0:
+ if (mapping.getDirection().equals(PARAMETER_MAPPING_RIGHT))
+ return mapping.getExpression().toString();
+ else
+ return mapping.getIdentifier().getIdentifier();
+ case 1:
+ return EMPTY_TEXT;
+ case 2:
+ if (mapping.getDirection().equals(PARAMETER_MAPPING_RIGHT))
+ return INDENT+mapping.getIdentifier();
+ else
+ return INDENT+mapping.getExpression().toString();
+ default:
+ return EMPTY_TEXT;
+ }
+ }
+ default:
+ {
+ return EMPTY_TEXT;
+ }
+ }
+ }
+ }
+
+
+ public BindingEditor(final Composite parent, int style, final IType teamType, final CompilationUnit root)
+ {
+ super(parent, style);
+ _team = teamType;
+ calculateRootNode(root);
+
+ setLayout(new FormLayout());
+
+ final Group connDefGroup = new Group(this, SWT.NONE);
+ connDefGroup.setText(Messages.BindingEditor_connector_title);
+ final FormData formData = new FormData();
+ formData.bottom = new FormAttachment(58, 0);
+ formData.right = new FormAttachment(100, -5);
+ formData.top = new FormAttachment(0, 5);
+ formData.left = new FormAttachment(0, 5);
+ connDefGroup.setLayoutData(formData);
+ connDefGroup.setLayout(new FormLayout());
+
+ _connTableViewer = new TreeViewer(connDefGroup, SWT.BORDER);
+ _connTableViewer.setContentProvider(new TreeContentProvider());
+ _connTableViewer.setLabelProvider(new LabelProvider());
+ _connTableViewer.setAutoExpandLevel(2);
+
+ _connTableTree = _connTableViewer.getTree();
+
+ final FormData formData_2 = new FormData();
+ formData_2.bottom = new FormAttachment(84, 0);
+ formData_2.right = new FormAttachment(100, -5);
+ formData_2.top = new FormAttachment(0, 5);
+ formData_2.left = new FormAttachment(0, 5);
+ _connTableTree.setLayoutData(formData_2);
+ _connTableTree.addSelectionListener( new SelectionAdapter()
+ {
+ public void widgetSelected(SelectionEvent evt)
+ {
+ bindingTableSelectionChanged();
+ }
+ });
+
+ _connTableTree.setLinesVisible(true);
+ _connTableTree.setHeaderVisible(true);
+
+ final TreeColumn rolesCol = new TreeColumn(_connTableTree, SWT.NONE);
+ rolesCol.setWidth(300);
+ rolesCol.setText(Messages.BindingEditor_role_types_title);
+
+ final TreeColumn methMapColumn = new TreeColumn(_connTableTree, SWT.NONE);
+ methMapColumn.setWidth(80);
+
+ final TreeColumn baseCol = new TreeColumn(_connTableTree, SWT.NONE);
+ baseCol.setWidth(300);
+ baseCol.setText(Messages.BindingEditor_base_types_title);
+
+ // Note(SH): need all columns set before retrieving contents by setInput()
+ _connTableViewer.setInput(_rootTeam);
+
+ final Composite buttonComp = new Composite(connDefGroup, SWT.NONE);
+ final FormData formData_3 = new FormData();
+ formData_3.bottom = new FormAttachment(100, -5);
+ formData_3.right = new FormAttachment(100, -5);
+ formData_3.top = new FormAttachment(_connTableTree, 5, SWT.BOTTOM);
+ formData_3.left = new FormAttachment(_connTableTree, 0, SWT.LEFT);
+ buttonComp.setLayoutData(formData_3);
+ buttonComp.setLayout(new FormLayout());
+
+ final Button addConnBtn = new Button(buttonComp, SWT.NONE);
+ final FormData formData_4 = new FormData();
+ formData_4.top = new FormAttachment(0, 5);
+ formData_4.left = new FormAttachment(0, 5);
+ addConnBtn.setLayoutData(formData_4);
+ addConnBtn.setText(Messages.BindingEditor_add_type_binding_button);
+ addConnBtn.addSelectionListener( new SelectionAdapter()
+ {
+ @SuppressWarnings("unchecked")
+ public void widgetSelected(SelectionEvent evt)
+ {
+ IType roleClass = null;
+
+ AddTypeBindingDialog dlg =
+ AddTypeBindingDialog.create(parent.getShell(), teamType);
+ if (AddTypeBindingDialog.OK == dlg.open())
+ {
+ roleClass = dlg.getRoleType();
+ }
+ else
+ {
+ return;
+ }
+
+ AST ast = _rootTeam.getAST();
+
+ RoleTypeDeclaration role = ast.newRoleTypeDeclaration();
+ role.setName(ast.newSimpleName(roleClass.getElementName()));
+ role.setRole(true);
+ try {
+ int flags = roleClass.getFlags() & ~Modifier.ABSTRACT;
+ role.modifiers().addAll(ast.newModifiers(flags));
+ } catch (JavaModelException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ String qualifiedBaseTypeName = dlg.getBaseTypeName();
+ String[] identifiers = qualifiedBaseTypeName.split("\\."); //$NON-NLS-1$
+
+ // use the single name for playedBy:
+ int len = identifiers.length;
+ String singleName = identifiers[len-1];
+ role.setBaseClassType(ast.newSimpleType(ast.newName(singleName)));
+ BindingEditor.this._baseClassLookup.put(singleName, qualifiedBaseTypeName);
+
+ // add an import using the qualified name:
+ _rootTeam.bodyDeclarations().add(role);
+ ImportDeclaration baseImport = ast.newImportDeclaration();
+ baseImport.setBase(true);
+ baseImport.setName(ast.newName(identifiers));
+ root.imports().add(baseImport);
+
+ refresh();
+ _connTableViewer.setSelection(new StructuredSelection(role));
+ bindingTableSelectionChanged();
+ }
+ });
+
+ final Button remConnBtn = new Button(buttonComp, SWT.NONE);
+ final FormData formData_5 = new FormData();
+ formData_5.top = new FormAttachment(addConnBtn, 0, SWT.TOP);
+ formData_5.left = new FormAttachment(addConnBtn, 5, SWT.RIGHT);
+ remConnBtn.setLayoutData(formData_5);
+ remConnBtn.setText(Messages.BindingEditor_remove_button);
+ remConnBtn.addSelectionListener( new SelectionAdapter()
+ {
+ public void widgetSelected(SelectionEvent evt)
+ {
+ removeElementsFromAST();
+ refresh();
+ bindConfig.resetLists();
+ }
+ });
+
+ // TabFolder
+ _tabFolder = new TabFolder(this, SWT.NONE);
+ final FormData formData_1 = new FormData();
+ formData_1.bottom = new FormAttachment(100, -5);
+ formData_1.right = new FormAttachment(100, -5);
+ formData_1.top = new FormAttachment(connDefGroup, 5, SWT.BOTTOM);
+ formData_1.left = new FormAttachment(0, 5);
+ _tabFolder.setLayoutData(formData_1);
+
+ // method mapping tab item
+ bindConfig = new BindingConfiguration(_tabFolder, SWT.NONE);
+ bindConfig.setCurrentTeamForMethodFake(teamType);
+
+ _methMapItem = new TabItem(_tabFolder, SWT.NONE);
+ _methMapItem.setText(Messages.BindingEditor_method_binding_tab);
+ _methMapItem.setControl(bindConfig);
+ _methMapItems = new TabItem[] { _methMapItem };
+
+
+ // parameter mapping tab item
+ _callinMapConfig = new CallinMappingConfiguration(_tabFolder, SWT.NONE);
+ _calloutMapConfig = new CalloutMappingConfiguration(_tabFolder, SWT.NONE);
+
+ _paraMapItem = new TabItem(_tabFolder, SWT.NONE);
+ _paraMapItem.setText(Messages.BindingEditor_param_mapping_tab);
+ _paraMapItem.setControl(_callinMapConfig);
+ _paraMapItems = new TabItem[] { _paraMapItem };
+ }
+
+ private void calculateRootNode(CompilationUnit cu)
+ {
+ // Note: we compare the source-start of the IType's name with the DOM node's simpleName's
+ // source-start, instead of using the type's start-position. This is because the IType's
+ // getSourceRange() method returns a different position than dom.TypeDeclaration.getStartPosition()
+ // depending on the type of comment before the type declaration (/** */ vs. /* */), so they
+ // didn't match.
+
+ try
+ {
+ final TypeDeclaration[] teamDecl = new TypeDeclaration[1];
+ final int teamPos = _team.getNameRange().getOffset();
+
+ ASTVisitor visitor = new org.eclipse.jdt.internal.corext.dom.GenericVisitor() {
+ public boolean visit(CompilationUnit node) {
+ for (Iterator iter = node.types().iterator(); iter.hasNext();) {
+ TypeDeclaration type = (TypeDeclaration) iter.next();
+ if (!visit(type))
+ return false;
+ }
+ return false;
+ }
+
+ public boolean visit(TypeDeclaration node) {
+ int pos = node.getName().getStartPosition();
+ if (pos == teamPos) {
+ teamDecl[0] = node;
+ return false;
+ }
+
+ TypeDeclaration[] memberTypes = node.getTypes();
+ for (int i = 0; i < memberTypes.length; i++) {
+ if (!visit(memberTypes[i]))
+ return false;
+ }
+
+ return true;
+ }
+
+ public boolean visit(RoleTypeDeclaration node) {
+ return visit ((TypeDeclaration) node);
+ }
+
+ };
+
+ visitor.visit(cu);
+
+ _rootTeam = teamDecl[0];
+ }
+ catch (JavaModelException ex) {}
+ }
+
+ private void prepareParameterMappingConfiguration(
+ AbstractMethodMappingDeclaration methMap,
+ ParameterMapping paraMap)
+ {
+ if (methMap == null)
+ {
+ _paraMapItem.setControl(null);
+ }
+ else if (methMap instanceof CallinMappingDeclaration)
+ {
+ _paraMapItem.setControl(_callinMapConfig);
+ _callinMapConfig.setFocus(
+ paraMap,
+ (CallinMappingDeclaration)methMap);
+ }
+ else if (methMap instanceof CalloutMappingDeclaration)
+ {
+ _paraMapItem.setControl(_calloutMapConfig);
+ _calloutMapConfig.setFocus(
+ paraMap,
+ (CalloutMappingDeclaration)methMap);
+ }
+ }
+
+ private void removeElementsFromAST()
+ {
+ TreeItem[] selectedItems = _connTableTree.getSelection();
+ ASTNode selectedNode = null;
+
+ for (int idx = 0; idx < selectedItems.length; idx++)
+ {
+ selectedNode = (ASTNode)selectedItems[idx].getData();
+
+ if (selectedNode.getParent() instanceof TypeDeclaration)
+ {
+ removeElementFromAST(selectedNode);
+ }
+ else if(selectedNode.getParent() instanceof AbstractMethodMappingDeclaration)
+ {
+ removeElementFromAST((ParameterMapping)selectedNode);
+ }
+ }
+ }
+
+ /** Removes roles from teams and mappings from roles */
+ private void removeElementFromAST(ASTNode selectedNode)
+ {
+ TypeDeclaration parent = (TypeDeclaration)selectedNode.getParent();
+ parent.bodyDeclarations().remove(selectedNode);
+ }
+
+ /** Removes ParameterMappings from callin or callout */
+ private void removeElementFromAST(ParameterMapping selectedNode)
+ {
+ AbstractMethodMappingDeclaration abstractMethodMappingDeclaration =
+ (AbstractMethodMappingDeclaration)selectedNode.getParent();
+ abstractMethodMappingDeclaration.getParameterMappings().remove(selectedNode);
+ }
+
+ protected void checkSubclass() {}
+
+ private AbstractMethodMappingDeclaration getAbstractMethodMapping(ParameterMapping paraMap)
+ {
+ return (AbstractMethodMappingDeclaration)paraMap.getParent();
+ }
+
+ public void refresh()
+ {
+ _connTableViewer.refresh();
+ }
+
+ public void bindingTableSelectionChanged()
+ {
+ TreeItem[] selectedItems = _connTableTree.getSelection();
+ ASTNode selectedNode = null;
+
+ for (int idx = 0; idx < selectedItems.length; idx++)
+ {
+ selectedNode = (ASTNode)selectedItems[idx].getData();
+ switch (selectedNode.getNodeType())
+ {
+ case ASTNode.ROLE_TYPE_DECLARATION:
+ RoleTypeDeclaration roleTypeDecl =
+ (RoleTypeDeclaration)selectedNode;
+
+ bindConfig.setFocusRole(roleTypeDecl, _team, true);
+ prepareParameterMappingConfiguration(null, null);
+ _tabFolder.setSelection(_methMapItems);
+ break;
+ case ASTNode.CALLOUT_MAPPING_DECLARATION:
+ bindConfig.setCalloutMapping(selectedNode, _team);
+ prepareParameterMappingConfiguration(
+ (AbstractMethodMappingDeclaration)selectedNode,
+ null);
+ _tabFolder.setSelection(_methMapItems);
+ break;
+ case ASTNode.CALLIN_MAPPING_DECLARATION:
+ bindConfig.setCallinMapping(selectedNode, _team);
+ prepareParameterMappingConfiguration(
+ (AbstractMethodMappingDeclaration)selectedNode,
+ null);
+ _tabFolder.setSelection(_methMapItems);
+ break;
+ case ASTNode.PARAMETER_MAPPING:
+ ParameterMapping paraMap =
+ (ParameterMapping)selectedNode;
+
+ AbstractMethodMappingDeclaration methMap =
+ getAbstractMethodMapping(paraMap);
+ prepareParameterMappingConfiguration(methMap, paraMap);
+
+ _tabFolder.setSelection(_paraMapItems);
+ break;
+ default:
+ break;
+ }
+ }
+ }
+
+ public void methodBindingAdded(AbstractMethodMappingDeclaration mapping)
+ {
+ _connTableViewer.expandToLevel(mapping.getParent(), 1);
+ // Note(SH): do not select the new element, because this caused
+ // subsequent creation of method mappings to replace this method mapping.
+ // This problem annoyed us throughout all demos (Chicago) and tutorials (Erfurt, Bonn)!
+ //_connTableViewer.setSelection(new StructuredSelection(mapping));
+ bindingTableSelectionChanged();
+ }
+
+ private Name getRoleBaseClass(RoleTypeDeclaration element) {
+ Name result = null;
+ Type baseType = element.getBaseClassType();
+ if(baseType != null) {
+ if (baseType.isParameterizedType())
+ baseType= ((ParameterizedType)baseType).getType();
+ if(baseType.isSimpleType())
+ result = ((SimpleType)baseType).getName();
+ else
+ if(baseType.isQualifiedType())
+ result = ((QualifiedType)baseType).getName();
+ else
+ assert false; // what's that?
+ }
+ return result;
+ }
+
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/bindingeditor/BindingEditorDialog.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/bindingeditor/BindingEditorDialog.java
new file mode 100644
index 000000000..44f7dccf8
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/bindingeditor/BindingEditorDialog.java
@@ -0,0 +1,210 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2005, 2009 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: BindingEditorDialog.java 23435 2010-02-04 00:14:38Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.bindingeditor;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jdt.core.IBuffer;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.core.dom.AST;
+import org.eclipse.jdt.core.dom.ASTParser;
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jdt.ui.actions.OrganizeImportsAction;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.text.Document;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.text.edits.TextEdit;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchSite;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.ide.IDE;
+
+/**
+ * The Main UI element of the binding editor.
+ *
+ * Created on Feb 7, 2005
+ *
+ * @author jwloka
+ * @version $Id: BindingEditorDialog.java 23435 2010-02-04 00:14:38Z stephan $
+ */
+public class BindingEditorDialog extends Dialog
+{
+ private String _title;
+ protected IType _team;
+ private BindingEditor _bindingEditor;
+ private CompilationUnit _root;
+ private IDocument _originalDocument;
+
+ public BindingEditorDialog(Shell parentShell, IType teamType)
+ {
+ super(parentShell);
+ super.setShellStyle(getShellStyle() | SWT.RESIZE);
+ _title = Messages.BindingEditorDialog_dialog_title + teamType.getElementName();
+ _team = teamType;
+ }
+
+ public int open()
+ {
+ parseCurrentTeam();
+ openResource((IFile)_team.getCompilationUnit().getResource());
+
+ return super.open();
+ }
+
+ protected void configureShell(Shell shell)
+ {
+ super.configureShell(shell);
+ if (_title != null)
+ shell.setText(_title);
+ }
+
+ protected Control createDialogArea(Composite parent)
+ {
+
+ Composite container = (Composite) super.createDialogArea(parent);
+ container.setLayout(new FormLayout());
+
+ _bindingEditor = new BindingEditor(container, SWT.NONE, _team, _root);
+ final FormData formData = new FormData();
+ formData.bottom = new FormAttachment(100, -5);
+ formData.right = new FormAttachment(100, -5);
+ formData.top = new FormAttachment(0, 5);
+ formData.left = new FormAttachment(0, 5);
+ _bindingEditor.setLayoutData(formData);
+ return container;
+ }
+
+ protected void createButtonsForButtonBar(Composite parent)
+ {
+ createButton(
+ parent,
+ IDialogConstants.OK_ID,
+ IDialogConstants.OK_LABEL,
+ true);
+ createButton(
+ parent,
+ IDialogConstants.CANCEL_ID,
+ IDialogConstants.CANCEL_LABEL,
+ false);
+ }
+
+ protected Point getInitialSize()
+ {
+ Point calced = super.getInitialSize();
+ return new Point(Math.max(calced.x, 881), calced.y);
+ }
+
+ @SuppressWarnings("unchecked")
+ protected void okPressed()
+ {
+ setReturnCode(OK);
+
+ IProgressMonitor monitor = new NullProgressMonitor();
+ ICompilationUnit cu = _team.getCompilationUnit();
+ Map<String, String> options = cu.getJavaProject().getOptions(true);
+ // recognize OT/J syntax even in fragments not starting with "team":
+ options.put(org.eclipse.jdt.internal.compiler.impl.CompilerOptions.OPTION_AllowScopedKeywords,
+ org.eclipse.jdt.internal.compiler.impl.CompilerOptions.DISABLED);
+ TextEdit edits = _root.rewrite(_originalDocument, options);
+
+ try
+ {
+ edits.apply(_originalDocument);
+ String newSource = _originalDocument.get();
+ IBuffer buf = cu.getBuffer();
+ buf.setContents(newSource);
+ // TODO(jsv) use "organize imports" also for closed files, this version works only on open file
+ try
+ {
+ IWorkbenchPage activePage = org.eclipse.jdt.internal.ui.JavaPlugin.getActivePage();
+ IWorkbenchSite site = activePage.getActiveEditor().getEditorSite();
+ OrganizeImportsAction organizeImportsAction = new OrganizeImportsAction(site);
+ organizeImportsAction.run(cu);
+ }
+ catch (NullPointerException ex)
+ {
+ org.eclipse.jdt.internal.ui.JavaPlugin.log(ex);
+ }
+
+ buf.save(monitor, false);
+ }
+ catch (Exception ex)
+ {
+ org.eclipse.jdt.internal.ui.JavaPlugin.log(ex);
+ }
+ close();
+ }
+
+ private void openResource(final IFile resource)
+ {
+ try
+ {
+ IDE.openEditor(org.eclipse.jdt.internal.ui.JavaPlugin.getActivePage(), resource, true);
+ }
+ catch (PartInitException ex)
+ {
+ org.eclipse.jdt.internal.ui.JavaPlugin.log(ex);
+ }
+ }
+
+ private void parseCurrentTeam()
+ {
+ try
+ {
+ _originalDocument = new Document(_team.getCompilationUnit().getSource());
+
+ ASTParser parser = ASTParser.newParser(AST.JLS3);
+
+ parser.setSource(_team.getCompilationUnit());
+ parser.setResolveBindings(true);
+
+ // tell the ASTConverter to include contained role files.
+ // Note, that currently these role files cannot be modified by the binding editor (Trac #93).
+ HashMap<String, String> options= new HashMap<String, String>(JavaCore.getOptions());
+ options.put(JavaCore.AST_INCLUDES_ROLE_FILES, JavaCore.ENABLED);
+ parser.setCompilerOptions(options);
+
+ _root = (CompilationUnit)parser.createAST(null);
+ _root.recordModifications();
+ }
+ catch (JavaModelException ex)
+ {
+ _originalDocument = null;
+ org.eclipse.jdt.internal.ui.JavaPlugin.log(ex);
+ }
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/bindingeditor/CallinMappingConfiguration.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/bindingeditor/CallinMappingConfiguration.java
new file mode 100644
index 000000000..d78336118
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/bindingeditor/CallinMappingConfiguration.java
@@ -0,0 +1,447 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2005, 2009 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: CallinMappingConfiguration.java 23435 2010-02-04 00:14:38Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.bindingeditor;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import org.eclipse.jdt.core.dom.ASTNode;
+import org.eclipse.jdt.core.dom.CallinMappingDeclaration;
+import org.eclipse.jdt.core.dom.Expression;
+import org.eclipse.jdt.core.dom.MethodSpec;
+import org.eclipse.jdt.core.dom.Modifier;
+import org.eclipse.jdt.core.dom.ParameterMapping;
+import org.eclipse.jdt.core.dom.SingleVariableDeclaration;
+import org.eclipse.jdt.core.dom.rewrite.ASTNodeCreator;
+import org.eclipse.jface.text.Document;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.TextViewer;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ListViewer;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.objectteams.otdt.ui.OTDTUIPlugin;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.StyledText;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.List;
+
+/**
+ * This is a configuration element for the
+ * parameter mappings of a callin mapping.
+ *
+ * A parameter mapping: identifier "&lt;-" expression
+ * A result mapping: expression "-&gt;" "result"
+ *
+ * Created on Feb 7, 2005
+ *
+ * @author jwloka
+ * @version $Id: CallinMappingConfiguration.java 23435 2010-02-04 00:14:38Z stephan $
+ */
+public class CallinMappingConfiguration extends Group
+{
+
+ // Method mapping declaration context
+ private CallinMappingDeclaration _callin;
+
+ // parameter mapping
+ private ListViewer _paraListViewer;
+ private TextViewer _paraTextViewer;
+
+ // result mapping
+ private ListViewer _resListViewer;
+ private TextViewer _resTextViewer;
+
+ private BindingEditor _bindingEditor;
+ private Group _resMapGrp;
+ private Label _methBindLabel;
+
+ private final Object[] EMPTY = new Object[0];
+ private final static String EMPTY_TEXT = ""; //$NON-NLS-1$
+
+ class RoleMethodParameterContentProvider implements IStructuredContentProvider
+ {
+ public Object[] getElements(Object inputElement)
+ {
+ if (_callin == null)
+ {
+ return EMPTY;
+ }
+
+ java.util.List<String> result = new ArrayList<String>();
+ MethodSpec methSpec = (MethodSpec)_callin.getRoleMappingElement();
+ for (Iterator paramIdx = methSpec.parameters().iterator(); paramIdx.hasNext();) {
+ SingleVariableDeclaration param = (SingleVariableDeclaration) paramIdx.next();
+ result.add(param.getName().toString());
+ }
+ return result.toArray();
+ }
+
+ public void dispose() {}
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
+ }
+
+
+ class ResultContentProvider implements IStructuredContentProvider
+ {
+ public Object[] getElements(Object inputElement)
+ {
+ return new Object[] { "result" }; //$NON-NLS-1$
+ }
+
+ public void dispose() {}
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
+ }
+
+
+ public CallinMappingConfiguration(Composite parent, int style)
+ {
+ super(parent, style);
+
+ _bindingEditor = (BindingEditor)parent.getParent();
+ setText(OTDTUIPlugin.getResourceString("CallinMappingConfiguration_dialog_title")); //$NON-NLS-1$
+ setLayout(new FormLayout());
+
+ _methBindLabel = new Label(this, SWT.NONE);
+ final FormData formData = new FormData();
+ formData.right = new FormAttachment(100, -5);
+ formData.top = new FormAttachment(0, 5);
+ formData.left = new FormAttachment(0, 10);
+ _methBindLabel.setLayoutData(formData);
+ _methBindLabel.setText(OTDTUIPlugin.getResourceString("MethodMappingConfiguration_no_method_binding_selected")); //$NON-NLS-1$
+ final Group paraMapGrp = new Group(this, SWT.NONE);
+ paraMapGrp.setText(OTDTUIPlugin.getResourceString("MethodMappingConfiguration_param_mapping_group_title")); //$NON-NLS-1$
+ final FormData formData_1 = new FormData();
+ formData_1.bottom = new FormAttachment(50, 0);
+ formData_1.right = new FormAttachment(100, -5);
+ formData_1.top = new FormAttachment(0, 28);
+ formData_1.left = new FormAttachment(0, 5);
+ paraMapGrp.setLayoutData(formData_1);
+ paraMapGrp.setLayout(new FormLayout());
+
+ _paraListViewer = new ListViewer(paraMapGrp, SWT.V_SCROLL | SWT.BORDER | SWT.H_SCROLL);
+ _paraListViewer.setContentProvider(new RoleMethodParameterContentProvider());
+ final List paraList = _paraListViewer.getList();
+ final FormData formData_7 = new FormData();
+ formData_7.bottom = new FormAttachment(100, -5);
+ formData_7.right = new FormAttachment(40, 0);
+ formData_7.top = new FormAttachment(0, 5);
+ formData_7.left = new FormAttachment(0, 5);
+ paraList.setLayoutData(formData_7);
+ _paraListViewer.setInput(new Object());
+ _paraListViewer.addSelectionChangedListener(
+ new ISelectionChangedListener()
+ {
+ public void selectionChanged(SelectionChangedEvent event)
+ {
+ if ( !_paraListViewer.getSelection().isEmpty() )
+ {
+ _resListViewer.setSelection(StructuredSelection.EMPTY);
+ }
+ }
+
+ }
+ );
+
+ _paraTextViewer = new TextViewer(paraMapGrp, SWT.BORDER);
+ _paraTextViewer.setDocument(new Document(EMPTY_TEXT));
+ final StyledText paraText_1 = _paraTextViewer.getTextWidget();
+ final FormData formData_5 = new FormData();
+ formData_5.bottom = new FormAttachment(100, -5);
+ formData_5.top = new FormAttachment(0, 5);
+ formData_5.right = new FormAttachment(100, -5);
+ formData_5.left = new FormAttachment(58, 0);
+ paraText_1.setLayoutData(formData_5);
+ _paraTextViewer.setInput(new Object());
+
+ final Composite paraBtnComp = new Composite(paraMapGrp, SWT.NONE);
+ final FormData formData_6 = new FormData();
+ formData_6.left = new FormAttachment(paraList, 5, SWT.RIGHT);
+ formData_6.right = new FormAttachment(paraText_1, -5, SWT.LEFT);
+ formData_6.bottom = new FormAttachment(100, -5);
+ formData_6.top = new FormAttachment(0, 5);
+ paraBtnComp.setLayoutData(formData_6);
+ paraBtnComp.setLayout(new FormLayout());
+
+ final Button paraMapBtn = new Button(paraBtnComp, SWT.NONE);
+ final FormData formData_2 = new FormData();
+ formData_2.top = new FormAttachment(36, 0);
+ formData_2.right = new FormAttachment(100, -5);
+ formData_2.left = new FormAttachment(0, 5);
+ paraMapBtn.setLayoutData(formData_2);
+ paraMapBtn.setText("<-"); //$NON-NLS-1$
+
+
+ final Button applyBtn = new Button(this, SWT.NONE);
+ final FormData formData_11 = new FormData();
+ formData_11.bottom = new FormAttachment(100, -5);
+ formData_11.right = new FormAttachment(100, -5);
+ applyBtn.setLayoutData(formData_11);
+ applyBtn.setText(OTDTUIPlugin.getResourceString("MethodMappingConfiguration_apply_button_label")); //$NON-NLS-1$
+ applyBtn.addSelectionListener(
+ new SelectionAdapter()
+ {
+ public void widgetSelected(SelectionEvent evt)
+ {
+ applySelectedMapping();
+ }
+ }
+ );
+
+ _resMapGrp = new Group(this, SWT.NONE);
+ _resMapGrp.setText(OTDTUIPlugin.getResourceString("MethodMappingConfiguration_result_mapping_group_title")); //$NON-NLS-1$
+ final FormData formData_4 = new FormData();
+ formData_4.bottom = new FormAttachment(applyBtn, -5, SWT.TOP);
+ formData_4.right = new FormAttachment(100, -5);
+ formData_4.top = new FormAttachment(paraMapGrp, 5, SWT.BOTTOM);
+ formData_4.left = new FormAttachment(0, 5);
+ _resMapGrp.setLayoutData(formData_4);
+ _resMapGrp.setLayout(new FormLayout());
+
+
+
+ // right side "result"
+ _resListViewer = new ListViewer(_resMapGrp, SWT.V_SCROLL | SWT.BORDER | SWT.H_SCROLL);
+ _resListViewer.setContentProvider(new ResultContentProvider());
+ final List resList = _resListViewer.getList();
+ final FormData formData_8 = new FormData();
+ formData_8.bottom = new FormAttachment(100, -5);
+ formData_8.right = new FormAttachment(100, -5);
+ formData_8.top = new FormAttachment(0, 5);
+ formData_8.left = new FormAttachment(58, 0);
+ resList.setLayoutData(formData_8);
+ _resListViewer.setInput(new Object());
+ _resListViewer.addSelectionChangedListener(
+ new ISelectionChangedListener()
+ {
+ public void selectionChanged(SelectionChangedEvent event)
+ {
+ if ( !_resListViewer.getSelection().isEmpty() )
+ {
+ _paraListViewer.setSelection(StructuredSelection.EMPTY);
+ }
+ }
+
+ }
+ );
+
+ // left side
+ _resTextViewer = new TextViewer(_resMapGrp, SWT.BORDER);
+ final StyledText resText_1 = _resTextViewer.getTextWidget();
+ final FormData formData_10 = new FormData();
+ formData_10.bottom = new FormAttachment(100, -5);
+ formData_10.top = new FormAttachment(0, 5);
+ formData_10.right = new FormAttachment(40, 0);
+ formData_10.left = new FormAttachment(0, 5);
+ resText_1.setLayoutData(formData_10);
+ _resTextViewer.setInput(new Object());
+
+ final Composite resBtnComp = new Composite(_resMapGrp, SWT.NONE);
+ final FormData formData_3 = new FormData();
+ formData_3.left = new FormAttachment(resText_1, 5, SWT.RIGHT);
+ formData_3.right = new FormAttachment(resList, -5, SWT.LEFT);
+ formData_3.bottom = new FormAttachment(100, -5);
+ formData_3.top = new FormAttachment(0, 5);
+ resBtnComp.setLayoutData(formData_3);
+ resBtnComp.setLayout(new FormLayout());
+
+ final Button resMapBtn = new Button(resBtnComp, SWT.NONE);
+ final FormData formData_9 = new FormData();
+ formData_9.right = new FormAttachment(100, -5);
+ formData_9.top = new FormAttachment(0, 5);
+ formData_9.left = new FormAttachment(0, 5);
+ resMapBtn.setLayoutData(formData_9);
+ resMapBtn.setText("->"); //$NON-NLS-1$
+ //
+ }
+
+ protected void checkSubclass() {}
+
+
+ private void applySelectedMapping()
+ {
+ IStructuredSelection selection = null;
+ String identifier = null;
+ String expr = null;
+
+ selection = (IStructuredSelection)_paraListViewer.getSelection();
+ if (!selection.isEmpty())
+ {
+ identifier = (String)selection.getFirstElement();
+ IDocument doc = _paraTextViewer.getDocument();
+ if (doc != null)
+ {
+ expr = doc.get();
+ if (!expr.equals(EMPTY_TEXT))
+ {
+ updateParameterMapping(identifier, expr);
+ }
+ }
+ }
+
+ selection = (IStructuredSelection)_resListViewer.getSelection();
+ if (!selection.isEmpty())
+ {
+ identifier = (String)selection.getFirstElement();
+ IDocument doc = _resTextViewer.getDocument();
+ if (doc != null)
+ {
+ expr = doc.get();
+ if (!expr.equals(EMPTY_TEXT))
+ {
+ updateParameterMapping(identifier, expr);
+ }
+ }
+ }
+
+ _bindingEditor.refresh();
+ }
+
+
+
+
+ protected void setFocus(ParameterMapping paraMap, CallinMappingDeclaration callinDecl)
+ {
+ if (!Modifier.isReplace(callinDecl.getCallinModifier()))
+ {
+ _resMapGrp.setVisible(false);
+ }
+ else
+ {
+ _resMapGrp.setVisible(true);
+ }
+ setMethodMapping(callinDecl);
+ setParameterMapping(paraMap);
+ }
+
+ protected void setParameterMapping(ParameterMapping paraMap)
+ {
+ if (paraMap == null)
+ {
+ _resTextViewer.setDocument(new Document(EMPTY_TEXT));
+ _paraTextViewer.setDocument(new Document(EMPTY_TEXT));
+ clearSelections();
+ return;
+ }
+
+ String identifier = paraMap.getIdentifier().getIdentifier();
+ ASTNode expr = paraMap.getExpression();
+ if (paraMap.hasResultFlag())
+ {
+ _paraListViewer.setSelection(StructuredSelection.EMPTY);
+ _resListViewer.setSelection(new StructuredSelection(identifier));
+ _resTextViewer.setDocument(new Document(expr.toString()));
+ }
+ else
+ {
+ _resListViewer.setSelection(StructuredSelection.EMPTY);
+ _paraListViewer.setSelection(new StructuredSelection(identifier));
+ _paraTextViewer.setDocument(new Document(expr.toString()));
+ }
+ }
+
+ protected void setMethodMapping(CallinMappingDeclaration callinDecl)
+ {
+ _callin = callinDecl;
+ String modifier = EMPTY_TEXT;
+
+ if (Modifier.isAfter(_callin.getCallinModifier()))
+ {
+ modifier = "after"; //$NON-NLS-1$
+ }
+ else if (Modifier.isBefore(_callin.getCallinModifier()))
+ {
+ modifier = "before"; //$NON-NLS-1$
+ }
+ else if (Modifier.isReplace(_callin.getCallinModifier()))
+ {
+ modifier = "replace"; //$NON-NLS-1$
+ }
+
+ _methBindLabel.setText(
+ _callin.getRoleMappingElement().toString()
+ + " <- " + modifier + ' ' //$NON-NLS-1$
+ + _callin.getBaseMappingElements().get(0).toString()
+ );
+ _paraListViewer.refresh();
+ }
+
+ protected void updateParameterMapping(String identifier, String expr)
+ {
+ ParameterMapping paraMap = null;
+ Expression exprNode = ASTNodeCreator.createExpression(_callin.getAST(), expr);
+
+ // if parsing of expr fails, ignore this parameter mapping
+ if (exprNode == null)
+ {
+ return;
+ }
+
+ java.util.List<ParameterMapping> paraMaps = _callin.getParameterMappings();
+ for (Iterator<ParameterMapping> mapIdx = paraMaps.iterator(); mapIdx.hasNext();) {
+ ParameterMapping mapping = mapIdx.next();
+ if (identifier.equals(mapping.getIdentifier()))
+ {
+ paraMap = mapping;
+ break;
+ }
+ }
+
+ if (paraMap == null)
+ {
+ paraMap = _callin.getAST().newParameterMapping();
+ paraMaps.add(paraMap);
+ }
+
+ paraMap.setIdentifier(_callin.getAST().newSimpleName(identifier));
+ if (identifier.equals("result")) //$NON-NLS-1$
+ {
+ paraMap.setDirection("->"); //$NON-NLS-1$
+ paraMap.setResultFlag(true);
+ }
+ else
+ {
+ paraMap.setDirection("<-"); //$NON-NLS-1$
+ paraMap.setResultFlag(false);
+ }
+
+ paraMap.setExpression(exprNode);
+ }
+
+ public void clearSelections()
+ {
+ _resListViewer.setSelection(StructuredSelection.EMPTY);
+ _paraListViewer.setSelection(StructuredSelection.EMPTY);
+ _resTextViewer.setSelection(StructuredSelection.EMPTY);
+ _paraTextViewer.setSelection(StructuredSelection.EMPTY);
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/bindingeditor/CalloutMappingConfiguration.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/bindingeditor/CalloutMappingConfiguration.java
new file mode 100644
index 000000000..d88572440
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/bindingeditor/CalloutMappingConfiguration.java
@@ -0,0 +1,436 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2005, 2007 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: CalloutMappingConfiguration.java 23435 2010-02-04 00:14:38Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.bindingeditor;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import org.eclipse.jdt.core.dom.ASTNode;
+import org.eclipse.jdt.core.dom.CalloutMappingDeclaration;
+import org.eclipse.jdt.core.dom.Expression;
+import org.eclipse.jdt.core.dom.FieldAccessSpec;
+import org.eclipse.jdt.core.dom.MethodMappingElement;
+import org.eclipse.jdt.core.dom.MethodSpec;
+import org.eclipse.jdt.core.dom.ParameterMapping;
+import org.eclipse.jdt.core.dom.SingleVariableDeclaration;
+import org.eclipse.jdt.core.dom.rewrite.ASTNodeCreator;
+import org.eclipse.jface.text.Document;
+import org.eclipse.jface.text.TextViewer;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ListViewer;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.objectteams.otdt.ui.OTDTUIPlugin;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.StyledText;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.List;
+
+/**
+ * This is a configuration element for the
+ * parameter mappings of a callout mapping.
+ *
+ * A parameter mapping: expression "->" identifier
+ * A result mapping: "result" "<-" expression
+ *
+ * @author jwloka
+ */
+public class CalloutMappingConfiguration extends Group
+{
+ // Method mapping declaration context
+ private CalloutMappingDeclaration _callout;
+
+ // parameter mapping
+ private ListViewer _paraListViewer;
+ private TextViewer _paraTextViewer;
+
+ // result mapping
+ private ListViewer _resListViewer;
+ private TextViewer _resTextViewer;
+
+ private BindingEditor _bindingEditor;
+ private Label _methBindLabel;
+
+ private final Object[] EMPTY = new Object[0];
+ private static final String EMPTY_TEXT = ""; //$NON-NLS-1$
+
+
+ class BaseMethodParameterContentProvider implements IStructuredContentProvider
+ {
+ public Object[] getElements(Object inputElement)
+ {
+ if (_callout == null)
+ {
+ return EMPTY;
+ }
+
+ java.util.List<String> result = new ArrayList<String>();
+ MethodMappingElement baseElement = _callout.getBaseMappingElement();
+ if (baseElement instanceof FieldAccessSpec) {
+ result.add(baseElement.getName().toString());
+ } else if (baseElement instanceof MethodSpec) {
+ MethodSpec methSpec = (MethodSpec)baseElement;
+ for (Iterator paramIdx = methSpec.parameters().iterator(); paramIdx.hasNext();) {
+ SingleVariableDeclaration param = (SingleVariableDeclaration) paramIdx.next();
+ result.add(param.getName().toString());
+ }
+ }
+ return result.toArray();
+
+ }
+
+ public void dispose()
+ {}
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
+ {}
+ }
+
+
+ class ResultContentProvider implements IStructuredContentProvider
+ {
+ public Object[] getElements(Object inputElement)
+ {
+ return new Object[] { "result" }; //$NON-NLS-1$
+ }
+
+ public void dispose()
+ {}
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
+ {}
+ }
+
+
+ public CalloutMappingConfiguration(Composite parent, int style)
+ {
+ super(parent, style);
+ _bindingEditor = (BindingEditor)parent.getParent();
+ setText(OTDTUIPlugin.getResourceString("CalloutMappingConfiguration_dialog_title")); //$NON-NLS-1$
+ setLayout(new FormLayout());
+
+ _methBindLabel = new Label(this, SWT.NONE);
+ final FormData formData = new FormData();
+ formData.right = new FormAttachment(100, -5);
+ formData.top = new FormAttachment(0, 5);
+ formData.left = new FormAttachment(0, 10);
+ _methBindLabel.setLayoutData(formData);
+ _methBindLabel.setText(OTDTUIPlugin.getResourceString("MethodMappingConfiguration_no_method_binding_selected")); //$NON-NLS-1$
+ final Group paraMapGrp = new Group(this, SWT.NONE);
+ paraMapGrp.setText(OTDTUIPlugin.getResourceString("MethodMappingConfiguration_param_mapping_group_title")); //$NON-NLS-1$
+ final FormData formData_1 = new FormData();
+ formData_1.bottom = new FormAttachment(50, 0);
+ formData_1.right = new FormAttachment(100, -5);
+ formData_1.top = new FormAttachment(0, 28);
+ formData_1.left = new FormAttachment(0, 5);
+ paraMapGrp.setLayoutData(formData_1);
+ paraMapGrp.setLayout(new FormLayout());
+
+ // left side, expression
+ _paraTextViewer = new TextViewer(paraMapGrp, SWT.BORDER);
+ _paraTextViewer.setDocument(new Document());
+ final StyledText paraText = _paraTextViewer.getTextWidget();
+ final FormData formData_5 = new FormData();
+ formData_5.right = new FormAttachment(43, 0);
+ formData_5.bottom = new FormAttachment(100, -5);
+ formData_5.top = new FormAttachment(0, 5);
+ formData_5.left = new FormAttachment(0, 5);
+ paraText.setLayoutData(formData_5);
+ _paraTextViewer.setInput(new Object());
+
+ // right side, identiers
+ _paraListViewer = new ListViewer(paraMapGrp, SWT.BORDER);
+ _paraListViewer.setContentProvider(new BaseMethodParameterContentProvider());
+ final List paraList = _paraListViewer.getList();
+ final FormData formData_7 = new FormData();
+ formData_7.bottom = new FormAttachment(100, -5);
+ formData_7.right = new FormAttachment(100, -5);
+ formData_7.top = new FormAttachment(0, 5);
+ formData_7.left = new FormAttachment(59, 0);
+ paraList.setLayoutData(formData_7);
+ _paraListViewer.setInput(new Object());
+
+ _paraListViewer.addSelectionChangedListener(
+ new ISelectionChangedListener()
+ {
+ public void selectionChanged(SelectionChangedEvent event)
+ {
+ if ( !_paraListViewer.getSelection().isEmpty() )
+ {
+ _resListViewer.setSelection(StructuredSelection.EMPTY);
+ }
+ }
+
+ }
+ );
+
+
+
+ final Composite paraBtnComp = new Composite(paraMapGrp, SWT.NONE);
+ final FormData formData_6 = new FormData();
+ formData_6.right = new FormAttachment(paraList, -5, SWT.LEFT);
+ formData_6.bottom = new FormAttachment(100, -5);
+ formData_6.top = new FormAttachment(paraText, 0, SWT.TOP);
+ formData_6.left = new FormAttachment(paraText, 5, SWT.RIGHT);
+ paraBtnComp.setLayoutData(formData_6);
+ paraBtnComp.setLayout(new FormLayout());
+
+ final Button paraMapBtn = new Button(paraBtnComp, SWT.NONE);
+ final FormData formData_2 = new FormData();
+ formData_2.right = new FormAttachment(100, -5);
+ formData_2.top = new FormAttachment(34, 0);
+ formData_2.left = new FormAttachment(0, 5);
+ paraMapBtn.setLayoutData(formData_2);
+ paraMapBtn.setText("->"); //$NON-NLS-1$
+
+
+ final Button applyBtn = new Button(this, SWT.NONE);
+ final FormData formData_11 = new FormData();
+ formData_11.bottom = new FormAttachment(100, -5);
+ formData_11.right = new FormAttachment(100, -5);
+ applyBtn.setLayoutData(formData_11);
+ applyBtn.setText(OTDTUIPlugin.getResourceString("MethodMappingConfiguration_apply_button_label")); //$NON-NLS-1$
+
+ applyBtn.addSelectionListener(
+ new SelectionAdapter()
+ {
+ public void widgetSelected(SelectionEvent evt)
+ {
+ applySelectedMapping();
+ }
+ }
+ );
+
+ final Group resMapGrp = new Group(this, SWT.NONE);
+ resMapGrp.setText(OTDTUIPlugin.getResourceString("MethodMappingConfiguration_result_mapping_group_title")); //$NON-NLS-1$
+ final FormData formData_4 = new FormData();
+ formData_4.bottom = new FormAttachment(applyBtn, -5, SWT.TOP);
+ formData_4.right = new FormAttachment(100, -5);
+ formData_4.top = new FormAttachment(paraMapGrp, 5, SWT.BOTTOM);
+ formData_4.left = new FormAttachment(0, 5);
+ resMapGrp.setLayoutData(formData_4);
+ resMapGrp.setLayout(new FormLayout());
+
+ _resListViewer = new ListViewer(resMapGrp, SWT.BORDER);
+ _resListViewer.setContentProvider(new ResultContentProvider());
+ final List resList = _resListViewer.getList();
+ final FormData formData_8 = new FormData();
+ formData_8.bottom = new FormAttachment(100, -5);
+ formData_8.right = new FormAttachment(43, 0);
+ formData_8.top = new FormAttachment(0, 5);
+ formData_8.left = new FormAttachment(0, 5);
+ resList.setLayoutData(formData_8);
+ _resListViewer.setInput(new Object());
+
+ _resListViewer.addSelectionChangedListener(
+ new ISelectionChangedListener()
+ {
+ public void selectionChanged(SelectionChangedEvent event)
+ {
+ if ( !_resListViewer.getSelection().isEmpty() )
+ {
+ _paraListViewer.setSelection(StructuredSelection.EMPTY);
+ }
+ }
+
+ }
+ );
+
+ _resTextViewer = new TextViewer(resMapGrp, SWT.BORDER);
+ final StyledText resText = _resTextViewer.getTextWidget();
+ final FormData formData_10 = new FormData();
+ formData_10.bottom = new FormAttachment(100, -5);
+ formData_10.right = new FormAttachment(100, -5);
+ formData_10.top = new FormAttachment(0, 5);
+ formData_10.left = new FormAttachment(59, 0);
+ resText.setLayoutData(formData_10);
+ _resTextViewer.setInput(new Object());
+
+ final Composite resBtnComp = new Composite(resMapGrp, SWT.NONE);
+ final FormData formData_3 = new FormData();
+ formData_3.right = new FormAttachment(resText, -5, SWT.LEFT);
+ formData_3.bottom = new FormAttachment(100, -5);
+ formData_3.top = new FormAttachment(resText, 0, SWT.TOP);
+ formData_3.left = new FormAttachment(resList, 5, SWT.RIGHT);
+ resBtnComp.setLayoutData(formData_3);
+ resBtnComp.setLayout(new FormLayout());
+
+ final Button resMapBtn = new Button(resBtnComp, SWT.NONE);
+ final FormData formData_9 = new FormData();
+ formData_9.right = new FormAttachment(100, -5);
+ formData_9.top = new FormAttachment(0, 5);
+ formData_9.left = new FormAttachment(0, 5);
+ resMapBtn.setLayoutData(formData_9);
+ resMapBtn.setText("<-"); //$NON-NLS-1$
+ //
+ }
+
+ public void dispose()
+ {
+ super.dispose();
+ }
+
+ protected void checkSubclass()
+ {}
+
+
+
+ private void applySelectedMapping()
+ {
+ IStructuredSelection selection = null;
+ String identifier = null;
+ String expr = null;
+
+ selection = (IStructuredSelection)_paraListViewer.getSelection();
+ if (!selection.isEmpty())
+ {
+ identifier = (String)selection.getFirstElement();
+ expr = _paraTextViewer.getDocument().get();
+ if (!expr.equals(EMPTY_TEXT))
+ {
+ updateParameterMapping(identifier, expr);
+ }
+ }
+
+ selection = (IStructuredSelection)_resListViewer.getSelection();
+ if (!selection.isEmpty())
+ {
+ identifier = (String)selection.getFirstElement();
+ expr = _resTextViewer.getDocument().get();
+ if (!expr.equals(EMPTY_TEXT))
+ {
+ updateParameterMapping(identifier, expr);
+ }
+ }
+
+ _bindingEditor.refresh();
+ }
+
+
+ protected void setFocus(ParameterMapping paraMap, CalloutMappingDeclaration callout)
+ {
+ setMethodBinding(callout);
+ setParameterMapping(paraMap);
+ }
+
+ protected void setParameterMapping(ParameterMapping paraMap)
+ {
+ if (paraMap == null)
+ {
+ _resTextViewer.setDocument(new Document(EMPTY_TEXT));
+ _paraTextViewer.setDocument(new Document(EMPTY_TEXT));
+ clearSelections();
+ return;
+ }
+
+ String identifier = paraMap.getIdentifier().getIdentifier();
+ ASTNode expr = paraMap.getExpression();
+ if (paraMap.hasResultFlag())
+ {
+ _paraListViewer.setSelection(StructuredSelection.EMPTY);
+ _resListViewer.setSelection(new StructuredSelection(identifier));
+ _resTextViewer.setDocument(new Document(expr.toString()));
+ }
+ else
+ {
+ _resListViewer.setSelection(StructuredSelection.EMPTY);
+ _paraListViewer.setSelection(new StructuredSelection(identifier));
+ _paraTextViewer.setDocument(new Document(expr.toString()));
+ }
+ }
+
+ protected void setMethodBinding(CalloutMappingDeclaration callout)
+ {
+ _callout = callout;
+ _methBindLabel.setText(
+ _callout.getRoleMappingElement().toString()
+ + (_callout.isCalloutOverride() ? "=>" : "->") //$NON-NLS-1$ //$NON-NLS-2$
+ + _callout.getBaseMappingElement().toString()
+ );
+ _paraListViewer.refresh();
+ }
+
+ @SuppressWarnings("unchecked") // AST does not use generics :(
+ protected void updateParameterMapping(String identifier, String expr)
+ {
+ ParameterMapping paraMap = null;
+ Expression exprNode = ASTNodeCreator.createExpression(_callout.getAST(), expr);
+
+ // if parsing of expr fails, ignore this parameter mapping
+ if (exprNode == null)
+ {
+ return;
+ }
+
+ java.util.List<ParameterMapping> paraMaps = _callout.getParameterMappings();
+ for (Iterator<ParameterMapping> mapIdx = paraMaps.iterator(); mapIdx.hasNext();)
+ {
+ ParameterMapping mapping = mapIdx.next();
+ if (identifier.equals(mapping.getIdentifier()))
+ {
+ paraMap = mapping;
+ break;
+ }
+
+ }
+
+ if (paraMap == null)
+ {
+ paraMap = _callout.getAST().newParameterMapping();
+ paraMaps.add(paraMap);
+ }
+
+ paraMap.setIdentifier(_callout.getAST().newSimpleName(identifier));
+ if (identifier.equals("result")) //$NON-NLS-1$
+ {
+ paraMap.setDirection("<-"); //$NON-NLS-1$
+ paraMap.setResultFlag(true);
+ }
+ else
+ {
+ paraMap.setDirection("->"); //$NON-NLS-1$
+ paraMap.setResultFlag(false);
+ }
+
+ paraMap.setExpression(exprNode);
+ }
+
+
+ public void clearSelections()
+ {
+ _resListViewer.setSelection(StructuredSelection.EMPTY);
+ _paraListViewer.setSelection(StructuredSelection.EMPTY);
+ _resTextViewer.setSelection(StructuredSelection.EMPTY);
+ _paraTextViewer.setSelection(StructuredSelection.EMPTY);
+ }
+
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/bindingeditor/Messages.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/bindingeditor/Messages.java
new file mode 100644
index 000000000..d9286fced
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/bindingeditor/Messages.java
@@ -0,0 +1,68 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2005, 2009 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id$
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.bindingeditor;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.eclipse.objectteams.otdt.internal.ui.bindingeditor.Messages"; //$NON-NLS-1$
+
+ public static String AddTypeBindingDialog_no_roles_available_error;
+
+ public static String AddTypeBindingDialog_role_selection_title;
+
+ public static String BindingEditorDialog_dialog_title;
+
+ public static String BindingEditor_connector_title;
+ public static String BindingEditor_role_types_title;
+ public static String BindingEditor_base_types_title;
+ public static String BindingEditor_add_type_binding_button;
+ public static String BindingEditor_remove_button;
+
+ public static String BindingEditor_method_binding_tab;
+ public static String BindingEditor_param_mapping_tab;
+
+ public static String BindingConfiguration_new_method_label;
+ public static String BindingConfiguration_role_methods_label;
+ public static String BindingConfiguration_base_methods_label;
+ public static String BindingConfiguration_apply_button;
+
+ public static String BindingConfiguration_error_unspecific;
+ public static String BindingConfiguration_error_retrieving_role_methods;
+ public static String BindingConfiguration_error_binding_creation_failed;
+
+ public static String OpenBindingEditorAction_error_title;
+ public static String OpenBindingEditorAction_error_no_team_selected;
+
+ public static String BindingConfiguration_error_cant_edit_rolefile;
+
+ public static String BindingConfiguration_error_cant_edit_rolefile_nested;
+
+
+
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/bindingeditor/Messages.properties b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/bindingeditor/Messages.properties
new file mode 100644
index 000000000..8c6203e6b
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/bindingeditor/Messages.properties
@@ -0,0 +1,27 @@
+AddTypeBindingDialog_no_roles_available_error=No role types available.
+AddTypeBindingDialog_role_selection_title=Role type selection
+BindingEditorDialog_dialog_title=Bindings for Team:
+
+BindingEditor_connector_title=Connector Definition
+BindingEditor_role_types_title=Role Types
+BindingEditor_base_types_title=Base Types
+BindingEditor_add_type_binding_button=Add Type Binding...
+BindingEditor_remove_button=Remove
+
+BindingEditor_method_binding_tab=Method Binding Configuration
+BindingEditor_param_mapping_tab=Parameter Mapping Configuration
+
+BindingConfiguration_new_method_label=New method
+BindingConfiguration_role_methods_label=Role Methods
+BindingConfiguration_base_methods_label=Base Methods
+BindingConfiguration_apply_button=Apply
+
+BindingConfiguration_error_unspecific=Error in BindingDialog
+BindingConfiguration_error_retrieving_role_methods=Error while trying to get all role-Methods
+BindingConfiguration_error_binding_creation_failed=Creation of Callin-/Calloutbinding failed.
+
+BindingConfiguration_error_cant_edit_rolefile=Sorry, can''t edit role {0}!\nReason: {1} is a role file and the binding editor doesn''t yet support editing role files via their enclosing team.
+BindingConfiguration_error_cant_edit_rolefile_nested=Sorry, can''t edit role {0}!\nReason: Enclosing team {1} is a role file and the binding editor doesn''t yet support editing role files via their enclosing team.\nTo perform this operation please open the binding editor directly for team {2}.
+
+OpenBindingEditorAction_error_title=Binding editor
+OpenBindingEditorAction_error_no_team_selected=Please select a team
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/bindingeditor/RadioButtonComposite.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/bindingeditor/RadioButtonComposite.java
new file mode 100644
index 000000000..9c0e42e75
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/bindingeditor/RadioButtonComposite.java
@@ -0,0 +1,154 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2005, 2009 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: RadioButtonComposite.java 23435 2010-02-04 00:14:38Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.bindingeditor;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+
+/**
+ * This composite imitates the radiobutton-behavior.
+ * All children have to be buttons(toggleButtons recommended).
+ *
+ * Created on Mar 21, 2005
+ *
+ * @author ike
+ * @version $Id: RadioButtonComposite.java 23435 2010-02-04 00:14:38Z stephan $
+ */
+public class RadioButtonComposite extends Composite
+{
+
+ Button _oldSelectedButton;
+
+ public RadioButtonComposite(Composite parent, int style)
+ {
+ super(parent, style);
+ }
+
+ public void doRadioButtonBehavior(Button selectedButton)
+ {
+
+ if (_oldSelectedButton != null && _oldSelectedButton.equals(selectedButton))
+ {
+ selectedButton.setSelection(true);
+ _oldSelectedButton = selectedButton;
+ return;
+ }
+
+ Button [] radioButtons = getButtons();
+ for (int idx = 0; idx < radioButtons.length; idx++)
+ {
+ if (!radioButtons[idx].equals(selectedButton))
+ {
+ radioButtons[idx].setSelection(false);
+ }
+ }
+
+ _oldSelectedButton = selectedButton;
+ }
+
+ public Button getSelectedButton()
+ {
+ Button [] radioButtons = getButtons();
+ for (int idx = 0; idx < radioButtons.length; idx++)
+ {
+ if (radioButtons[idx].getSelection())
+ return radioButtons[idx];
+ }
+
+ return null;
+ }
+
+ public void setSelectionButton(Button button)
+ {
+ Button [] radioButtons = getButtons();
+ for (int idx = 0; idx < radioButtons.length; idx++)
+ {
+ if (radioButtons[idx].equals(button))
+ {
+ radioButtons[idx].setSelection(true);
+ _oldSelectedButton = button;
+ }
+ else
+ {
+ radioButtons[idx].setSelection(false);
+ }
+ }
+ }
+
+ public void removeSelectionButton(Button button)
+ {
+ Button [] radioButtons = getButtons();
+ for (int idx = 0; idx < radioButtons.length; idx++)
+ {
+ if (radioButtons[idx].equals(button) && radioButtons[idx].getSelection())
+ {
+ radioButtons[idx].setSelection(false);
+ _oldSelectedButton = null;
+ }
+ }
+ }
+
+ public void deselectAll()
+ {
+ Button [] radioButtons = getButtons();
+ for (int idx = 0; idx < radioButtons.length; idx++)
+ {
+ if(radioButtons[idx].getSelection())
+ radioButtons[idx].setSelection(false);
+ }
+ }
+
+ public void enableAll()
+ {
+ Button [] radioButtons = getButtons();
+ for (int idx = 0; idx < radioButtons.length; idx++)
+ {
+ if(!radioButtons[idx].isEnabled())
+ radioButtons[idx].setEnabled(true);
+ }
+ }
+
+ public void disableAll()
+ {
+ Button [] radioButtons = getButtons();
+ for (int idx = 0; idx < radioButtons.length; idx++)
+ {
+ if(radioButtons[idx].isEnabled())
+ radioButtons[idx].setEnabled(false);
+ }
+ }
+
+ private Button[] getButtons()
+ {
+ Control [] controls = this.getChildren();
+ List<Button> buttons = new ArrayList<Button>();
+ for (int idx = 0; idx < controls.length; idx++)
+ {
+ if (controls[idx] instanceof Button)
+ buttons.add((Button)controls[idx]);
+ }
+ return buttons.toArray(new Button[buttons.size()]);
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/callinmarkers/AbstractMarkable.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/callinmarkers/AbstractMarkable.java
new file mode 100644
index 000000000..64a256454
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/callinmarkers/AbstractMarkable.java
@@ -0,0 +1,238 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2008 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: AbstractMarkable.java 23435 2010-02-04 00:14:38Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.callinmarkers;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jdt.core.Flags;
+import org.eclipse.jdt.core.IJavaElement;
+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.core.search.IJavaSearchScope;
+import org.eclipse.jdt.core.search.SearchEngine;
+import org.eclipse.objectteams.otdt.core.compiler.OTNameUtils;
+import org.eclipse.jdt.internal.core.hierarchy.TypeHierarchy;
+
+
+/**
+ * Abstraction for buffers that can hold markers in the ruler:
+ * <ul>
+ * <li>resources representing source files
+ * <li>java elements representing binary class files
+ * </ul>
+ *
+ * @author stephan
+ * @since 1.2.5
+ */
+public abstract class AbstractMarkable {
+
+ final static String PDE_PLUGIN_NATURE_ID = "org.eclipse.pde.PluginNature"; //$NON-NLS-1$ // avoid importing org.eclipse.pde.core
+
+ /** Name of this markable for use in the UI. */
+ abstract String getName();
+
+ /** Remove all callin markers from this markable. */
+ abstract void removeCallinMarkers() throws CoreException;
+
+ abstract IJavaElement getJavaElement();
+
+ abstract IResource getResource();
+
+ /** Create a real marker with the given ID. */
+ abstract IMarker createMarker(String id) throws CoreException;
+
+ /**
+ * Get all types that contribute members to the current markable.
+ * Contribution happens through containment (members) and inheritance.
+ */
+ abstract Set<IType> getAllTypes(IJavaProject[] projects, IProgressMonitor monitor) throws CoreException;
+
+ /**
+ * Get all projects that could be relevant for searching.
+ */
+ abstract IJavaProject[] getProjects() throws JavaModelException;
+
+ /**
+ * Is the given element contained in this markable?
+ */
+ abstract boolean containsElement(IJavaElement element);
+
+ /**
+ * Fetch the member and super types of type and add them to the given sets.
+ * Works recursively.
+ *
+ * @param members all members, direct and indirect, including inherited members.
+ * @param supers all super types of this and its members.
+ * @param type focus type
+ * @param currentProject the project of the current Markable, use this first when searching types.
+ * @param projects where to search for super types which are given by their name
+ * @param monitor
+ * @throws JavaModelException
+ */
+ void addSuperAndMemberTypes(Set<IType> members, Set<IType> supers, IType type, IJavaProject currentProject, IJavaProject[] projects, IProgressMonitor monitor)
+ throws JavaModelException
+ {
+ if (!type.exists())
+ return; // mh?
+
+ IType superType = null;
+ String superclassName = type.getSuperclassName();
+ String packageName = null;
+ String typeName = null;
+ if (superclassName != null) {
+ superclassName = superclassName.replace('$', '.');
+ if (superclassName.indexOf('.') != -1) {
+ // qualified, find the type directly:
+ superType = currentProject.findType(superclassName);
+ } else {
+ // resolve it now:
+ String[][] resolvedSuperName = type.resolveType(superclassName);
+ if (resolvedSuperName != null && resolvedSuperName.length == 1) {
+ packageName = resolvedSuperName[0][0];
+ typeName = resolvedSuperName[0][1];
+ if (!(packageName.equals("java.lang") && typeName.equals("Object"))) //$NON-NLS-1$ //$NON-NLS-2$
+ {
+ superType = currentProject.findType(packageName, typeName, (IProgressMonitor)null);
+
+ if (superType == null)
+ for (IJavaProject prj : projects)
+ if ((superType = prj.findType(packageName, typeName, (IProgressMonitor)null)) != null)
+ break;
+ }
+ }
+ }
+ }
+
+ if (superType != null && !superType.isAnonymous()) {
+ supers.add(superType);
+ if (!members.contains(superType)) // avoid super-member-loop
+ addSuperAndMemberTypes(members, supers, superType, currentProject, projects, monitor);
+ }
+
+ for (IType member : type.getTypes()) {
+ if (member.isInterface()) continue; // not currently bindable
+ if ( Flags.isRole(member.getFlags())
+ && OTNameUtils.isTopConfined(member.getElementName())) continue; // confineds are not bound base
+ members.add(member);
+ if (!supers.contains(member)) // avoid super-member-loop
+ addSuperAndMemberTypes(members, supers, member, currentProject, projects, monitor);
+ }
+ }
+ /**
+ * Get all direct and indirect subtypes of all types in 'types'.
+ * @param types
+ * @param monitor
+ * @return
+ * @throws JavaModelException
+ */
+ Set<IType> getSubTypes(Set<IType> types, IProgressMonitor monitor) throws JavaModelException {
+ monitor.beginTask("base class hierarchy", types.size());
+
+ IJavaSearchScope workspaceScope = SearchEngine.createWorkspaceScope();
+ Set<IType> subTypes = new HashSet<IType>(13);
+ for (IType type: types) {
+ TypeHierarchy hier = new TypeHierarchy(type, null, workspaceScope, true);
+ hier.refresh(monitor);
+ for(IType subType : hier.getSubtypes(type))
+ subTypes.add(subType);
+ monitor.worked(1);
+ }
+ monitor.done();
+ return subTypes;
+ }
+
+ /** Fetch projects from a resource or all workspace projects if resource === null */
+ IJavaProject[] getProjects(IResource resource) {
+ IJavaProject[] projects = null;
+ if (resource != null) {
+ IProject project = resource.getProject();
+ projects = getProjectsToSearch(project);
+ } else {
+ IWorkspace ws = ResourcesPlugin.getWorkspace();
+ ArrayList<IJavaProject> projectList = new ArrayList<IJavaProject>();
+ for (IProject prj : ws.getRoot().getProjects())
+ if (isOTProject(prj) && prj.isOpen()) // FIXME(SH): better project filtering
+ projectList.add(JavaCore.create(prj));
+ projects = projectList.toArray(new IJavaProject[projectList.size()]);
+ }
+ return projects;
+ }
+
+ private IJavaProject[] getProjectsToSearch(IProject baseProject)
+ {
+ Set<IJavaProject> result = new HashSet<IJavaProject>();
+ calculateProjectsToSearch(baseProject, result);
+ return result.toArray(new IJavaProject[result.size()]);
+ }
+
+ private boolean isOTProject(IProject project)
+ {
+ try
+ {
+ return project.hasNature(JavaCore.OTJ_NATURE_ID);
+ }
+ catch (CoreException ex)
+ {
+ return false;
+ }
+ }
+
+ private boolean isPluginProject(IProject project)
+ {
+ try
+ {
+ return project.hasNature(PDE_PLUGIN_NATURE_ID);
+ }
+ catch (CoreException ex)
+ {
+ return false;
+ }
+ }
+
+ private void calculateProjectsToSearch(IProject currentProject, Set<IJavaProject> allProjects)
+ {
+ if (isOTProject(currentProject))
+ {
+ allProjects.add(JavaCore.create(currentProject));
+ }
+
+// if (isPluginProject(currentProject))
+// return; // don't search indirect dependencies of plug-in projects because aspectBindings must be declared directly
+
+ IProject[] referencingProjects = currentProject.getReferencingProjects();
+
+ for (int i = 0; i < referencingProjects.length; i++)
+ {
+ IProject project = referencingProjects[i];
+ calculateProjectsToSearch(project, allProjects);
+ }
+ }
+
+ /** Does this represent a real JavaElement (including existing ancestors)? */
+ public abstract boolean exists();
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/callinmarkers/AnnotationHelper.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/callinmarkers/AnnotationHelper.java
new file mode 100644
index 000000000..e545dc77b
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/callinmarkers/AnnotationHelper.java
@@ -0,0 +1,114 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2009 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: AnnotationHelper.java 23435 2010-02-04 00:14:38Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.callinmarkers;
+
+import java.util.Iterator;
+
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jdt.core.IJavaModelMarker;
+import org.eclipse.jdt.core.ISourceRange;
+import org.eclipse.jdt.core.compiler.IProblem;
+import org.eclipse.jdt.internal.ui.javaeditor.IJavaAnnotation;
+import org.eclipse.jdt.internal.ui.javaeditor.JavaAnnotationIterator;
+import org.eclipse.jface.text.source.Annotation;
+import org.eclipse.jface.text.source.AnnotationModel;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.texteditor.IDocumentProvider;
+import org.eclipse.ui.texteditor.ITextEditor;
+import org.eclipse.ui.texteditor.MarkerAnnotation;
+
+/**
+ * This class helps the callin marker creator to handle problem annotations/markers.
+ *
+ * @author stephan
+ * @since 1.2.6
+ */
+public class AnnotationHelper {
+ private AnnotationModel fAnnotationModel;
+
+ public AnnotationHelper(IEditorPart targetEditor, IEditorInput editorInput) {
+ ITextEditor textEditor = (ITextEditor) targetEditor.getAdapter(ITextEditor.class);
+ if (textEditor != null) {
+ IDocumentProvider provider= textEditor.getDocumentProvider();
+ fAnnotationModel = (AnnotationModel) provider.getAnnotationModel(editorInput);
+ }
+ }
+
+ /** If a callout binds to an unused private method/field, remove the "unused" warning. */
+ <M> void removeSomeWarnings(IResource resource, ISourceRange nameRange) throws CoreException
+ {
+ if (fAnnotationModel == null)
+ return;
+
+ Iterator annotationIterator = new JavaAnnotationIterator(
+ fAnnotationModel.getAnnotationIterator(nameRange.getOffset(), nameRange.getLength(), false, true),
+ false); // not all, only problems
+ boolean needRemoveMarker = false;
+ annotations:
+ while (annotationIterator.hasNext()) {
+ Object next = annotationIterator.next();
+ if (next instanceof IJavaAnnotation) {
+ IJavaAnnotation javaAnnot = (IJavaAnnotation) next;
+ if (javaAnnot.isProblem() || isProblemMarkerAnnotation(javaAnnot))
+ {
+ switch (javaAnnot.getId()) {
+ case IProblem.UnusedPrivateField:
+ case IProblem.UnusedPrivateMethod:
+ fAnnotationModel.removeAnnotation((Annotation)javaAnnot); // remove from the ruler
+ if (javaAnnot instanceof MarkerAnnotation) {
+ ((MarkerAnnotation) javaAnnot).getMarker().delete(); // remove from problems view
+ } else {
+ needRemoveMarker = true;
+ }
+ break annotations;
+ }
+ }
+ }
+ }
+ if (!needRemoveMarker)
+ return;
+ IMarker[] problems = resource.findMarkers(IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER, true, IResource.DEPTH_ZERO);
+ if (problems != null) {
+ markers: for (IMarker problem : problems) {
+ int problemStart = problem.getAttribute(IMarker.CHAR_START, -1);
+ if (problemStart >= nameRange.getOffset() && problemStart < (nameRange.getOffset()+nameRange.getLength()))
+ {
+ switch(problem.getAttribute(IJavaModelMarker.ID, -1)) {
+ case IProblem.UnusedPrivateField:
+ case IProblem.UnusedPrivateMethod:
+ problem.delete();
+ break markers;
+ }
+ }
+ }
+ }
+ }
+
+ private static boolean isProblemMarkerAnnotation(IJavaAnnotation annotation) {
+ if (!(annotation instanceof MarkerAnnotation))
+ return false;
+ try {
+ return(((MarkerAnnotation)annotation).getMarker().isSubtypeOf(IMarker.PROBLEM));
+ } catch (CoreException e) {
+ return false;
+ }
+ }
+
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/callinmarkers/CallinMarker.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/callinmarkers/CallinMarker.java
new file mode 100644
index 000000000..43ea88379
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/callinmarkers/CallinMarker.java
@@ -0,0 +1,119 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2008 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: CallinMarker.java 23435 2010-02-04 00:14:38Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.callinmarkers;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IMember;
+import org.eclipse.jdt.core.ISourceRange;
+import org.eclipse.objectteams.otdt.ui.OTDTUIPlugin;
+
+/**
+ * @author gis
+ */
+public class CallinMarker
+{
+ public static final String CALLIN_ID = "org.eclipse.objectteams.otdt.ui.callinMarker"; //$NON-NLS-1$
+ public static final String CALLOUT_ID = "org.eclipse.objectteams.otdt.ui.calloutMarker"; //$NON-NLS-1$
+ public static final String PLAYEDBY_ID = "org.eclipse.objectteams.otdt.ui.playedByMarker"; //$NON-NLS-1$
+ public static final String ATTR_BASE_ELEMENT = "org.eclipse.objectteams.otdt.ui.markerAttr.BaseElement"; //$NON-NLS-1$
+ public static final String ATTR_ROLE_ELEMENTS = "org.eclipse.objectteams.otdt.ui.markerAttr.RoleElements"; //$NON-NLS-1$
+
+ private Map<String, Object> _attribs = new HashMap<String, Object>(11);
+ private String id;
+
+ public CallinMarker(String markerKind)
+ {
+ super();
+ this.id = markerKind;
+ _attribs.put(IMarker.SEVERITY, new Integer(IMarker.SEVERITY_INFO));
+ _attribs.put(IMarker.PRIORITY, new Integer(IMarker.PRIORITY_HIGH));
+ }
+
+ public void setLineNumber(int line)
+ {
+ _attribs.put(IMarker.LINE_NUMBER, new Integer(line));
+ }
+
+ public void setNameRange(ISourceRange nameRange) {
+ _attribs.put(IMarker.CHAR_START, nameRange.getOffset());
+ _attribs.put(IMarker.CHAR_END, nameRange.getOffset()+nameRange.getLength());
+ }
+
+ /** define the roles or callin mappings referenced by the base element. */
+ public <M extends IMember> void setRoleElement(Set<M> roleElements)
+ {
+ StringBuffer encoded = new StringBuffer();
+ for (IMember m : roleElements) {
+ encoded.append(m.getHandleIdentifier());
+ encoded.append('\n');
+ }
+ this._attribs.put(CallinMarker.ATTR_ROLE_ELEMENTS, encoded.toString());
+ }
+
+ /** set the base element (class or method) to which this marker is attached. */
+ public void setBaseElement(IMember baseElement)
+ {
+ _attribs.put(CallinMarker.ATTR_BASE_ELEMENT, baseElement.getHandleIdentifier());
+ if (baseElement.getElementType() == IJavaElement.TYPE) {
+ _attribs.put(IMarker.MESSAGE, OTDTUIPlugin.getResourceString("CallinMarker.playedby_tooltip")+' '+baseElement.getElementName()); //$NON-NLS-1$
+ } else if (this.id == CALLIN_ID) {
+ _attribs.put(IMarker.MESSAGE, OTDTUIPlugin.getResourceString("CallinMarker.callin_tooltip")+' '+baseElement.getElementName()+"()"); //$NON-NLS-1$ //$NON-NLS-2$
+ } else if (this.id == CALLOUT_ID) {
+ String baseMemberName = baseElement.getElementName();
+ if (baseElement.getElementType() == IJavaElement.METHOD) // not for callout to field
+ baseMemberName += "()"; //$NON-NLS-1$
+ _attribs.put(IMarker.MESSAGE, OTDTUIPlugin.getResourceString("CallinMarker.callout_tooltip") + ' ' + baseMemberName); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Actually create the marker.
+ * PRE: all relevant attributes have been set before.
+ *
+ * @param target the target element where to attach the marker (based on a resource or a java element)
+ * @throws CoreException thrown when a marker operation failed.
+ */
+ @SuppressWarnings("unchecked") // IMarker.getAttributes() yields raw type
+ public void create(AbstractMarkable target) throws CoreException
+ {
+ IMarker marker = target.createMarker(this.id);
+ Map markerAttributes = marker.getAttributes();
+ if (markerAttributes != null)
+ _attribs.putAll(markerAttributes); // markers for JavaElements have already one attribute
+ marker.setAttributes(_attribs);
+ _attribs.clear(); // clear attributes for reuse of this object
+ }
+
+ public static boolean isTypeMarker(IMarker marker) {
+ try {
+ return marker.getType().equals(PLAYEDBY_ID);
+ } catch (CoreException e) {
+ return false;
+ }
+ }
+
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/callinmarkers/CallinMarkerCreator2.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/callinmarkers/CallinMarkerCreator2.java
new file mode 100644
index 000000000..5b938e708
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/callinmarkers/CallinMarkerCreator2.java
@@ -0,0 +1,785 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2003, 2008 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: CallinMarkerCreator2.java 23435 2010-02-04 00:14:38Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.callinmarkers;
+
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.IWorkspaceRunnable;
+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.core.runtime.Status;
+import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jdt.core.Flags;
+import org.eclipse.jdt.core.IClassFile;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IField;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IMember;
+import org.eclipse.jdt.core.IMethod;
+import org.eclipse.jdt.core.ISourceRange;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.core.search.IJavaSearchConstants;
+import org.eclipse.jdt.core.search.IJavaSearchScope;
+import org.eclipse.jdt.core.search.SearchMatch;
+import org.eclipse.jdt.core.search.SearchPattern;
+import org.eclipse.jdt.core.search.SearchRequestor;
+import org.eclipse.jface.action.IStatusLineManager;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.DefaultLineTracker;
+import org.eclipse.jface.text.ILineTracker;
+import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.objectteams.otdt.core.ICallinMapping;
+import org.eclipse.objectteams.otdt.core.ICalloutMapping;
+import org.eclipse.objectteams.otdt.core.ICalloutToFieldMapping;
+import org.eclipse.objectteams.otdt.core.IMethodMapping;
+import org.eclipse.objectteams.otdt.core.IOTJavaElement;
+import org.eclipse.objectteams.otdt.core.IOTType;
+import org.eclipse.objectteams.otdt.core.IRoleType;
+import org.eclipse.objectteams.otdt.core.OTModelManager;
+import org.eclipse.objectteams.otdt.core.search.OTSearchEngine;
+import org.eclipse.objectteams.otdt.internal.ui.preferences.GeneralPreferences;
+import org.eclipse.objectteams.otdt.ui.JavaEditorActivationListener;
+import org.eclipse.objectteams.otdt.ui.OTDTUIPlugin;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchPartReference;
+
+/**
+ * This class creates Object Teams binding markers of two kinds:
+ * <ul>
+ * <li>playedBy markers marking base classes bound by playedBy
+ * <li>callin markers marking base methods bound by callin.
+ * </ul>
+ * It also monitors editor and resource changes and automatically creates/removes callin
+ * markers for all methods.
+ *
+ * TODO(SH): validate updating for methods and implement something similar for types, too.
+ *
+ * @author carp
+ */
+public class CallinMarkerCreator2 extends JavaEditorActivationListener
+{
+
+ protected CallinMarkerJob _currentJob;
+ private Map<IJavaElement,IType> m_cachedBaseForRole = new HashMap<IJavaElement,IType>();
+ private Set<IResource> m_cachedMarkersForResources = new HashSet<IResource>();
+ private Set<IJavaElement> m_cachedMarkersForJavaElements = new HashSet<IJavaElement>();
+ private boolean m_enabled = false;
+ protected AnnotationHelper annotationHelper;
+
+ /**
+ * Typical usage:
+ * <code>
+ * CallinMarkerCreator creator = OTDTUIPlugin.getCallinMarkerCreator();
+ * creator.updateAllMarkers(myMethod, someProgressMonitor);
+ * </code>
+ */
+ public CallinMarkerCreator2()
+ {
+ IPreferenceStore store = OTDTUIPlugin.getDefault().getPreferenceStore();
+ store.addPropertyChangeListener(new IPropertyChangeListener() {
+ public void propertyChange(PropertyChangeEvent event)
+ {
+ if (GeneralPreferences.CALLIN_MARKER_ENABLED_BOOL.equals(event.getProperty()))
+ {
+ boolean newValue = ((Boolean) event.getNewValue()).booleanValue();
+ setEnabled(newValue);
+ // FIXME: upon enablement, run callin marker creator for current editor, if any
+ }
+ }
+ });
+
+ setEnabled(store.getBoolean(GeneralPreferences.CALLIN_MARKER_ENABLED_BOOL));
+ }
+
+ public void setEnabled(boolean enable)
+ {
+ if (m_enabled == enable)
+ return;
+
+ if (enable)
+ installListener();
+ else
+ uninstallListener();
+
+ m_enabled = enable;
+ }
+
+ public boolean isEnabled()
+ {
+ return m_enabled;
+ }
+
+ /** API for {@link RoleBindingChangedListener}. */
+ public void updateCallinMarker(final IMember member, IStatusLineManager statusLine)
+ {
+ if (!isEnabled())
+ return;
+
+ if (!isCached(member.getResource()) && !isCreatingMarkersFor(member.getResource()))
+ return;
+
+ final AbstractMarkable target = new ResourceMarkable(member.getResource());
+ CallinMarkerJob job = new CallinMarkerJob(target) {
+ protected void updateMarkers(IProgressMonitor monitor) throws Exception {
+ updateCallinMarker(target, member, monitor);
+ }
+ };
+
+ // updating just one single method will not set current _currentJob
+ schedule(job, statusLine);
+ }
+
+
+ /**
+ * API for {@link RoleBindingChangedListener}.
+ * When some role bindings have changed remove cached information regarding its base.
+ */
+ public void invalidateRole(IType roleType, IType baseClass) {
+ if (baseClass != null)
+ invalidateBase(baseClass);
+ IType cachedBaseClass = this.m_cachedBaseForRole.get(roleType);
+ if ( cachedBaseClass != null
+ && !cachedBaseClass.equals(baseClass))
+ {
+ // playedBy mapping itself has changed
+ this.m_cachedBaseForRole.remove(roleType);
+ invalidateBase(cachedBaseClass);
+ }
+ }
+ void invalidateBase(IJavaElement baseClass) {
+ this.m_cachedMarkersForJavaElements.remove(baseClass);
+ try {
+ IJavaElement cu = baseClass.getAncestor(IJavaElement.COMPILATION_UNIT);
+ if (cu != null) {
+ IResource resource = cu.getCorrespondingResource();
+ if (resource != null)
+ this.m_cachedMarkersForResources.remove(resource);
+ }
+ } catch (JavaModelException e) {
+ // cannot uncache missing resource
+ }
+ }
+
+ /**
+ * When the editor input changed find the markable target and update markers.
+ */
+ protected void activeJavaEditorChanged(IWorkbenchPart editor)
+ {
+ if (!(editor instanceof IEditorPart))
+ {
+ if (editor == null) {
+ this.annotationHelper = null;
+ this.fActiveEditor = null;
+ }
+ return;
+ }
+
+ IEditorPart targetEditor = (IEditorPart) editor;
+ final IEditorInput editorInput = targetEditor.getEditorInput();
+ final IStatusLineManager statusLine = targetEditor.getEditorSite().getActionBars().getStatusLineManager();
+
+ this.fActiveEditor = editor;
+ this.annotationHelper = new AnnotationHelper(targetEditor, editorInput);
+
+ AbstractMarkable target= null;
+ if ((editorInput instanceof IFileEditorInput)) { // source file
+ IResource resource = ((IFileEditorInput)editorInput).getFile();
+ if (resource == null || isCached(resource) || isCreatingMarkersFor(resource))
+ return; // already has markers -- skip it
+ target = new ResourceMarkable(resource);
+ } else { // binary java element
+ IJavaElement element = getInputJavaElement((IEditorPart) editor);
+ if (element == null || isCached(element) || isCreatingMarkersFor(element))
+ return; // already has markers -- skip it
+ target = new JavaElementMarkable(element);
+ }
+
+ if (target.exists())
+ updateCallinMarkers(target, statusLine);
+ }
+
+ // FIXME: listen to classpath changes as well
+ // hint from the news group:
+ // See:
+ // - org.eclipse.jdt.core.JavaCore.addElementChangedListener(IElementChangedListener, int)
+ // - org.eclipse.jdt.core.IJavaElementDelta.F_CLASSPATH_CHANGED
+
+ /**
+ * @param resource the resource in where to look for bound base methods
+ * @param statusLine a status line where errors can be displayed or null if you don't want error messages
+ */
+ public void updateCallinMarkers(final AbstractMarkable target, IStatusLineManager statusLine)
+ {
+ CallinMarkerJob job = new CallinMarkerJob(target) {
+ protected void updateMarkers(IProgressMonitor monitor) throws Exception {
+ updateCallinMarkers(target, monitor);
+ }
+ };
+
+ setCurrentJob(job);
+ schedule(job, statusLine);
+ }
+
+ /**
+ * For a given markable target remove all old markers and create new ones.
+ *
+ * @param target the markable item to create markers for
+ * @param monitor
+ * @throws CoreException thrown when one of the many searches and or lookups failed.
+ */
+ private void updateCallinMarkers(final AbstractMarkable target, IProgressMonitor monitor) throws CoreException
+ {
+ try
+ {
+ if (target == null || !target.exists())
+ return;
+
+ monitor.beginTask(
+ MessageFormat.format(
+ OTDTUIPlugin.getResourceString("CallinMarkerCreator2.updating_for_resource_message"), //$NON-NLS-1$
+ new Object[] { target.getName() }), 62);
+
+ target.removeCallinMarkers();
+ monitor.worked(2);
+
+ // ==== role bindings: ====
+ IJavaProject[] projects = target.getProjects();
+ Set<IType> allTypes = target.getAllTypes(projects, monitor); // 10 ticks
+ Map<IMember, Set<IType>> playedByMap = searchPlayedByBindings(allTypes, projects, new MySubProgressMonitor(monitor, 20));
+ if (playedByMap == null || playedByMap.size() == 0)
+ return;
+
+ createMarkersFor(target, playedByMap, CallinMarker.PLAYEDBY_ID, new MySubProgressMonitor(monitor, 5));
+
+ // collect all roles for use as search scope:
+ IMember[] allRoleTypes = collectRolesAndSubroles(playedByMap, new MySubProgressMonitor(monitor, 10));
+
+ // ==== callin/callout bindings: ====
+ Set<IMember> allMembers = getAllMethodsAndFields(target.getJavaElement());
+ monitor.worked(5);
+ updateMethodMarkers(target, allRoleTypes, allMembers, new SubProgressMonitor(monitor, 10));
+ }
+ finally {
+ monitor.done();
+ }
+ }
+
+ private IMember[] collectRolesAndSubroles(Map<IMember, Set<IType>> playedByMap, IProgressMonitor submon)
+ throws JavaModelException
+ {
+ IMember[] allRoleTypes;
+ Set<IMember> collectedRoleTypes = new HashSet<IMember>();
+ submon.beginTask("Finding sub roles", playedByMap.size()); //$NON-NLS-1$
+ for (Set<IType> value : playedByMap.values()) {
+ collectedRoleTypes.addAll(value);
+ for (IType member : value) {
+ if (member.exists()) {
+ IOTType otType = OTModelManager.getOTElement(member);
+ if (otType != null) {
+ IType[] subtypes = otType.newOTTypeHierarchy(submon).getAllSubtypes(otType);
+ for (IType subtype : subtypes)
+ collectedRoleTypes.add(subtype);
+ }
+ }
+ submon.worked(1);
+ }
+ }
+ allRoleTypes = collectedRoleTypes.toArray(new IMember[collectedRoleTypes.size()]);
+ submon.done();
+ return allRoleTypes;
+ }
+
+ private void updateCallinMarker(AbstractMarkable target, IMember member, IProgressMonitor monitor) throws CoreException
+ {
+ // TODO(SH): in this scenario a search for all callins mentioning method should be faster.
+ try
+ {
+ monitor.beginTask(
+ MessageFormat.format(
+ OTDTUIPlugin.getResourceString("CallinMarkerCreator2.updating_for_method_message"), //$NON-NLS-1$
+ new Object[] { member.getElementName() }), 45);
+
+ IResource resource = member.getResource();
+ if (resource != null) // only called when base class changed -> source only.
+ {
+ CallinMarkerRemover.removeCallinMarker( member, resource );
+ monitor.worked(5);
+
+ // find direct roles:
+ ArrayList<IType> allTypes = new ArrayList<IType>(1);
+ allTypes.add((IType)member.getAncestor(IJavaElement.TYPE)); // TODO(SH): could be IOTType?
+ Map<IMember, Set<IType>> playedByMap = searchPlayedByBindings(allTypes,
+ new IJavaProject[]{member.getJavaProject()},
+ new MySubProgressMonitor(monitor, 20));
+ if (playedByMap == null)
+ return;
+
+ // collect all roles w/ subroles for use as search scope:
+ IMember[] allRoleTypes = collectRolesAndSubroles(playedByMap, new MySubProgressMonitor(monitor, 10));
+
+ ArrayList<IMember> memberSet = new ArrayList<IMember>(1);
+ memberSet.add(member);
+ updateMethodMarkers(target, allRoleTypes, memberSet, new SubProgressMonitor(monitor, 10));
+ }
+ }
+ finally {
+ monitor.done();
+ }
+ }
+
+ private void updateMethodMarkers(AbstractMarkable target, IMember[] allRoleTypes, Collection<IMember> memberSet, IProgressMonitor monitor)
+ {
+ try {
+ monitor.beginTask(null, 40);
+ Map<IMember, Set<IMember>> callinMap = new HashMap<IMember, Set<IMember>>();
+ Map<IMember, Set<IMember>> calloutMap = new HashMap<IMember, Set<IMember>>();
+ searchMemberBindings(memberSet, allRoleTypes, callinMap, calloutMap, new MySubProgressMonitor(monitor, 20));
+ createMarkersFor(target, callinMap, CallinMarker.CALLIN_ID, new MySubProgressMonitor(monitor, 10));
+ createMarkersFor(target, calloutMap, CallinMarker.CALLOUT_ID, new MySubProgressMonitor(monitor, 10));
+ } finally {
+ monitor.done();
+ }
+ }
+
+ private void setCurrentJob(CallinMarkerJob job)
+ {
+ synchronized (this) {
+ if (_currentJob != null) {
+ _currentJob.cancel();
+ }
+
+ _currentJob = job;
+ }
+ }
+
+ // ------ Some of these methods are duplicated to account for the source/binary duality: ------
+ public boolean isCreatingMarkersFor(IResource resource)
+ {
+ synchronized(this) {
+ if (_currentJob == null) return false;
+ IResource jobResource = _currentJob.getResource();
+ return (jobResource != null) && jobResource.equals(resource);
+ }
+ }
+
+ private boolean isCreatingMarkersFor(IJavaElement element)
+ {
+ synchronized(this) {
+ if (_currentJob == null) return false;
+ IJavaElement javaElement = _currentJob.getJavaElement();
+ return (javaElement != null) && javaElement.equals(element);
+ }
+ }
+
+ private boolean isCached(IResource resource)
+ {
+ return m_cachedMarkersForResources.contains(resource);
+ }
+ private boolean isCached(IJavaElement element)
+ {
+ return m_cachedMarkersForJavaElements.contains(element);
+ }
+
+ private void setCached(final IResource resource)
+ {
+ m_cachedMarkersForResources.add(resource);
+ }
+ private void setCached(final IJavaElement element)
+ {
+ m_cachedMarkersForJavaElements.add(element);
+ }
+
+ private void removeFromCache(final IResource resource)
+ {
+ m_cachedMarkersForResources.remove(resource);
+ }
+ private void removeFromCache(final IJavaElement element)
+ {
+ m_cachedMarkersForJavaElements.remove(element);
+ }
+
+ private void removeFromCache(IWorkbenchPartReference ref)
+ {
+ IWorkbenchPart part = ref.getPart(false);
+ if (part instanceof IEditorPart)
+ {
+ IEditorInput input = ((IEditorPart) part).getEditorInput();
+ if (input instanceof IFileEditorInput)
+ removeFromCache(((IFileEditorInput) input).getFile());
+ }
+ }
+
+ public void partClosed(IWorkbenchPartReference ref)
+ {
+ removeFromCache(ref);
+ super.partClosed(ref);
+ }
+
+ /**
+ * Fetch all methods and fields contained in the input.
+ * @param javaElement the corresponding ICompilationUnit, IClassFile or IType
+ */
+ private Set<IMember> getAllMethodsAndFields(IJavaElement javaElement) {
+ if (javaElement == null)
+ return new HashSet<IMember>(0);
+
+ Set<IMember> members = new HashSet<IMember>(13);
+
+ switch (javaElement.getElementType())
+ {
+ case IJavaElement.COMPILATION_UNIT:
+ {
+ ICompilationUnit unit = (ICompilationUnit)javaElement;
+ IType[] types;
+ try {
+
+ types = unit.getTypes();
+ for (int idx = 0; idx < types.length; idx++)
+ members.addAll(getAllMethodsAndFields(types[idx]));
+
+ } catch (JavaModelException e) {
+ // ignore, without types we simply find no methods
+ }
+ break;
+ }
+ case IJavaElement.CLASS_FILE:
+ {
+ IClassFile classFile = (IClassFile)javaElement;
+ members.addAll(getAllMethodsAndFields(classFile.getType()));
+ break;
+ }
+ case IJavaElement.TYPE:
+ {
+ IType type = (IType) javaElement;
+ try {
+
+ members.addAll(Arrays.asList(type.getMethods()));
+ members.addAll(Arrays.asList(type.getFields()));
+ // handle all inner types
+ IType[] memberTypes = type.getTypes();
+ for (int idx = 0; idx < memberTypes.length; idx++)
+ members.addAll(getAllMethodsAndFields(memberTypes[idx]));
+
+ } catch (JavaModelException e) {
+ // ignore, finding methods bailed out but keep those we already found
+ }
+ break;
+ }
+ default:
+ break;
+ }
+
+ return members;
+ }
+
+ /**
+ * Find all playedBy bindings within a given set of projects refering to one of baseTypes as its baseclass.
+ *
+ * @param baseTypes
+ * @param projects
+ * @param monitor
+ * @return a map indexed by base types containing sets of role types bound to the given base type.
+ * @throws CoreException
+ */
+ private Map<IMember, Set<IType>> searchPlayedByBindings(Collection<IType> baseTypes, IJavaProject[] projects, MySubProgressMonitor monitor)
+ {
+ if (baseTypes == null || baseTypes.size() == 0) {
+ monitor.doneNothing();
+ return null;
+ }
+
+ OTSearchEngine engine = new OTSearchEngine();
+ IJavaSearchScope searchScope = OTSearchEngine.createOTSearchScope(projects, false);
+ final Map<IMember, Set<IType>> resultMap = new HashMap<IMember, Set<IType>>();
+
+ try {
+ monitor.beginTask(OTDTUIPlugin.getResourceString("searching role types"), baseTypes.size()); //$NON-NLS-1$
+
+ for (final IType baseType : baseTypes)
+ {
+ try
+ {
+ IProgressMonitor searchMonitor = new SubProgressMonitor(monitor, 1);
+ if (!baseType.exists()) // ensure it's 'open'
+ continue;
+ if (baseType.isEnum() || baseType.isAnnotation())
+ continue; // no callin-to-enum/annot
+ SearchPattern pattern = SearchPattern.createPattern(baseType, IJavaSearchConstants.PLAYEDBY_REFERENCES);
+ if (pattern == null)
+ OTDTUIPlugin.getDefault().getLog().log(new Status(Status.ERROR, OTDTUIPlugin.UIPLUGIN_ID, "Error creating pattern")); //$NON-NLS-1$
+ else
+ engine.search(
+ pattern,
+ searchScope,
+ new SearchRequestor() {
+ public void acceptSearchMatch(SearchMatch match)
+ throws CoreException
+ {
+ Object element = match.getElement();
+ if (element instanceof IType)
+ {
+ // FIXME(SH): check: if mapping is a role, baseType must be conform to its baseclass
+ IType mapping = (IType) element;
+ addToMapOfSets(resultMap, baseType, mapping);
+ }
+ }
+ },
+ searchMonitor);
+ }
+ catch (CoreException ex)
+ {
+ OTDTUIPlugin.getDefault().getLog().log(new Status(Status.ERROR, OTDTUIPlugin.UIPLUGIN_ID, "Error finding playedBy bindings", ex)); //$NON-NLS-1$
+ }
+ }
+ }
+ finally {
+ monitor.done();
+ }
+
+ return resultMap;
+ }
+
+ /**
+ * Search all callin bindings within allRoleTypes mentioning one of baseMethods as a base method.
+ *
+ * @param baseMembers base methods and fields of interest
+ * @param allRoleTypes roles where to search
+ * @param callinMap store found callin bindings here (one set per base method)
+ * @param calloutMap store found callout bindings here (one set per base method/field)
+ * @param monitor
+ */
+ private void searchMemberBindings(Collection<IMember> baseMembers,
+ IMember[] allRoleTypes,
+ Map<IMember, Set<IMember>> callinMap,
+ Map<IMember, Set<IMember>> calloutMap,
+ MySubProgressMonitor monitor)
+ {
+ if (baseMembers == null || baseMembers.size() == 0) {
+ monitor.doneNothing();
+ return;
+ }
+
+ // given all potential role types, just directly traverse to the callin bindings:
+ for (IMember roleMember : allRoleTypes)
+ {
+ IOTType otType = OTModelManager.getOTElement((IType)roleMember);
+ if (otType == null || !otType.isRole()) continue;
+ IRoleType roleType = (IRoleType)otType;
+
+ for (IMethodMapping mapping : roleType.getMethodMappings())
+ {
+ try {
+ if (mapping.getElementType() == IOTJavaElement.CALLIN_MAPPING)
+ {
+ ICallinMapping callinMapping = (ICallinMapping) mapping;
+ for (IMethod baseMethod : callinMapping.getBoundBaseMethods())
+ if (baseMembers.contains(baseMethod)) // TODO(SH): would comparison of resources suffice??
+ addToMapOfSets(callinMap, baseMethod, mapping);
+ }
+ else if (mapping.getElementType() == IOTJavaElement.CALLOUT_MAPPING) {
+ ICalloutMapping calloutMapping = (ICalloutMapping) mapping;
+ IMethod baseMethod = calloutMapping.getBoundBaseMethod();
+ if (baseMembers.contains(baseMethod) && !isVisibleFor(baseMethod, roleType))
+ addToMapOfSets(calloutMap, baseMethod, mapping);
+ }
+ else if (mapping.getElementType() == IOTJavaElement.CALLOUT_TO_FIELD_MAPPING) {
+ ICalloutToFieldMapping calloutMapping = (ICalloutToFieldMapping) mapping;
+ IField baseField = calloutMapping.getBoundBaseField();
+ if (baseMembers.contains(baseField) && !isVisibleFor(baseField, roleType))
+ addToMapOfSets(calloutMap, baseField, mapping);
+ }
+ } catch (JavaModelException ex) {
+ OTDTUIPlugin.getDefault().getLog().log(new Status(Status.ERROR, OTDTUIPlugin.UIPLUGIN_ID, "Error checking callin/callout binding", ex)); //$NON-NLS-1$
+ }
+ }
+ }
+ }
+
+ boolean isVisibleFor(IMember baseMember, IType roleType) throws JavaModelException {
+ int flags = baseMember.getFlags();
+ if (Flags.isPrivate(flags))
+ return false;
+ if (Flags.isPublic(flags))
+ return true;
+ String rolePackage = roleType.getPackageFragment().getElementName();
+ return baseMember.getDeclaringType().getPackageFragment().getElementName().equals(rolePackage);
+ }
+
+ /**
+ * add the key->value pair to the given map of sets, creating a new value set if needed.
+ * @param mapOfSets
+ * @param key
+ * @param value
+ */
+ private <M extends IMember> void addToMapOfSets(final Map<IMember, Set<M>> mapOfSets, IMember key, M value)
+ {
+ Set<M> setForType = mapOfSets.get(key);
+ if (setForType == null)
+ mapOfSets.put(key, setForType = new HashSet<M>());
+ setForType.add(value);
+ }
+
+ /**
+ * Create actual markers wrapped by CallinMarkers from the data given as bindingMap.
+ *
+ * @param target where to attach the markers
+ * @param bindingMap data for creating markers: a map from base elements (classes|methods) to role elements (roles|callins) binding to the former.
+ * @param markerKind what kind of marker should be created?
+ * @param monitor
+ */
+ private <M extends IMember> void createMarkersFor(final AbstractMarkable target, final Map<IMember, Set<M>> bindingMap, final String markerKind, MySubProgressMonitor monitor)
+ {
+ if (bindingMap == null) {
+ monitor.doneNothing();
+ return;
+ }
+
+ final Set<IMember> baseElements = bindingMap.keySet();
+ if (baseElements == null || baseElements.size() == 0) {
+ monitor.doneNothing();
+ return;
+ }
+ // freeze this value to avoid shared access to the field:
+ final AnnotationHelper myAnnotationHelper = annotationHelper;
+ if (myAnnotationHelper == null) { // has the active editor been reset to null?
+ if (monitor != null)
+ monitor.setCanceled(true);
+ return;
+ }
+ IWorkspaceRunnable runnable = new IWorkspaceRunnable() {
+ public void run(IProgressMonitor monitor) throws CoreException
+ {
+ monitor.beginTask(OTDTUIPlugin.getResourceString("CallinMarkerCreator2.creating_markers_message"), baseElements.size()); //$NON-NLS-1$
+
+ try {
+ ILineTracker lineTracker = null;
+ final ICompilationUnit compilationUnit = baseElements.iterator().next().getCompilationUnit();
+ if (compilationUnit != null) {
+ lineTracker = new DefaultLineTracker();
+ lineTracker.set(compilationUnit.getSource());
+ }
+ CallinMarker marker = new CallinMarker(markerKind);
+
+ for (IMember baseElement : baseElements)
+ {
+ // ensure type is actually contained in the target, not super/inherited
+ if (baseElement instanceof IType && !target.containsElement(baseElement))
+ continue;
+
+ Set<M> bindings = bindingMap.get(baseElement);
+
+ if (bindings != null && bindings.size() != 0)
+ {
+ if (markerKind == CallinMarker.PLAYEDBY_ID)
+ for (M binding : bindings)
+ CallinMarkerCreator2.this.m_cachedBaseForRole.put(binding, (IType)baseElement);
+
+ try {
+ ISourceRange nameRange = baseElement.getNameRange();
+ if (nameRange.getOffset() >= 0 && nameRange.getLength() >= 0) {
+ if (lineTracker != null) {
+ int line = lineTracker.getLineNumberOfOffset(nameRange.getOffset()) + 1; // one-based
+ marker.setLineNumber(line);
+ } else {
+ marker.setNameRange(nameRange);
+ }
+ if (markerKind.equals(CallinMarker.CALLOUT_ID)) {
+ myAnnotationHelper.removeSomeWarnings(target.getResource(), nameRange);
+ }
+ } else if (!baseElement.isBinary()) {
+ if (nameRange.getOffset() < 0)
+ throw new BadLocationException("Offset must be >= 0, is "+nameRange.getOffset());
+ if (nameRange.getLength() < 0)
+ throw new BadLocationException("Length must be >= 0, is "+nameRange.getLength());
+ }
+ }
+ catch (BadLocationException ex) {
+ OTDTUIPlugin.getExceptionHandler().logException(OTDTUIPlugin.getResourceString("CallinMarkerCreator2.line_number_error_message"), ex); //$NON-NLS-1$
+ }
+ marker.setBaseElement(baseElement);
+ marker.setRoleElement(bindings);
+
+ marker.create(target);
+ }
+ monitor.worked(1);
+ }
+ }
+ finally {
+ monitor.done();
+ }
+ }
+ };
+
+ try {
+ ResourcesPlugin.getWorkspace().run(runnable, null, IWorkspace.AVOID_UPDATE, monitor);
+ } catch (CoreException ex) {
+ OTDTUIPlugin.getExceptionHandler().logException("Error creating markers", ex); //$NON-NLS-1$
+ }
+ }
+
+ protected void schedule(final CallinMarkerJob job, IStatusLineManager statusLine)
+ {
+ job.addJobChangeListener(new JobListener(statusLine) {
+ protected void jobFinished(int status) {
+ synchronized(CallinMarkerCreator2.this) {
+ if (_currentJob == job)
+ _currentJob = null;
+
+ IResource resource = job.getResource();
+ if (resource != null)
+ if (status == IStatus.OK)
+ setCached(resource);
+ else
+ removeFromCache(resource);
+ else {
+ IJavaElement element = job.getJavaElement();
+ if (status == IStatus.OK)
+ setCached(element);
+ else
+ removeFromCache(element);
+ }
+ }
+ }
+ });
+
+ job.setPriority(Job.DECORATE);
+ job.schedule(100); // delay 100ms
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/callinmarkers/CallinMarkerJob.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/callinmarkers/CallinMarkerJob.java
new file mode 100644
index 000000000..7234cb801
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/callinmarkers/CallinMarkerJob.java
@@ -0,0 +1,82 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2008 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: CallinMarkerJob.java 23435 2010-02-04 00:14:38Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.callinmarkers;
+
+import org.eclipse.core.resources.IResource;
+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.jdt.core.IJavaElement;
+import org.eclipse.objectteams.otdt.ui.OTDTUIPlugin;
+
+/**
+ * @author gis
+ */
+public abstract class CallinMarkerJob extends org.eclipse.core.runtime.jobs.Job
+{
+ private final IResource _resource;
+ private final IJavaElement _javaElement;
+
+ public CallinMarkerJob(final AbstractMarkable target)
+ {
+ super(OTDTUIPlugin.getResourceString("CallinMarkerJob.job_title")); //$NON-NLS-1$
+ if (target instanceof ResourceMarkable) {
+ this._resource = ((ResourceMarkable)target).fResource;
+ this._javaElement= null;
+ } else {
+ this._resource = null;
+ this._javaElement= ((JavaElementMarkable)target).fJavaElement;
+ }
+ // markerRule is normally null, but let's play by the rules:
+ IResource resource = target.getResource();
+ if (resource != null)
+ setRule(resource.getWorkspace().getRuleFactory().markerRule(resource));
+ }
+
+ protected IStatus run(IProgressMonitor monitor)
+ {
+ try {
+ updateMarkers(monitor);
+ }
+ catch (OperationCanceledException ex) {
+ return Status.CANCEL_STATUS;
+ }
+ catch (Exception ex) {
+ return OTDTUIPlugin.createErrorStatus("Exception during marker creation.", ex); //$NON-NLS-1$
+ }
+ catch (Error error) {} // ignore other errors, like Assertions and InternalCompilerErrors
+
+ return Status.OK_STATUS;
+ }
+
+ protected abstract void updateMarkers(IProgressMonitor monitor) throws Exception;
+
+ public final IResource getResource()
+ {
+ return this._resource;
+ }
+
+ public final IJavaElement getJavaElement()
+ {
+ return this._javaElement;
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/callinmarkers/CallinMarkerRemover.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/callinmarkers/CallinMarkerRemover.java
new file mode 100644
index 000000000..70d6085a4
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/callinmarkers/CallinMarkerRemover.java
@@ -0,0 +1,106 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2008 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: CallinMarkerRemover.java 23435 2010-02-04 00:14:38Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.callinmarkers;
+
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IMember;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.objectteams.otdt.ui.OTDTUIPlugin;
+
+/**
+ * @author gis
+ */
+public class CallinMarkerRemover
+{
+ public static void removeCallinMarkers(IResource resource) throws CoreException
+ {
+ for (String id : new String[] { CallinMarker.PLAYEDBY_ID, CallinMarker.CALLIN_ID, CallinMarker.CALLOUT_ID} )
+ if (resource.exists())
+ resource.deleteMarkers(id, true, IResource.DEPTH_INFINITE);
+ }
+
+ public static synchronized void removeCallinMarker(IMember member, IResource resource)
+ {
+ // we need to pass the resource, as the method might already be removed and hence would
+ // not be able to give us a resource.
+ if (resource.exists())
+ {
+ try
+ {
+ IMarker marker;
+ if (member.getElementType() == IJavaElement.METHOD) {
+ marker = getCallinMarker(member, CallinMarker.CALLIN_ID, resource);
+ if (marker != null)
+ marker.delete();
+ }
+ // method or field:
+ marker = getCallinMarker(member, CallinMarker.CALLOUT_ID, resource);
+ if (marker != null)
+ marker.delete();
+ }
+ catch (CoreException ex)
+ {
+ OTDTUIPlugin.getExceptionHandler().
+ logException("Problems removing callin marker", ex); //$NON-NLS-1$
+ }
+ }
+ }
+
+ /**
+ * Finds the marker attached to the given method.
+ * Note: may return null if nothing found.
+ */
+ private static synchronized IMarker getCallinMarker(IMember baseElement, String markerKind, IResource resource) throws JavaModelException, CoreException
+ {
+ IMarker[] markers = resource.findMarkers(markerKind, true, IResource.DEPTH_INFINITE);
+
+ String methodId = baseElement.getHandleIdentifier();
+
+ for (int i = 0; i < markers.length; i++)
+ {
+ if (methodId.equals(markers[i].getAttribute(CallinMarker.ATTR_BASE_ELEMENT, null)))
+ return markers[i];
+ }
+ return null;
+ }
+
+
+ public static void removeCallinMarkers(IJavaElement element) throws CoreException
+ {
+ if (element.exists())
+ {
+ IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+
+ // FIXME(SH): implement!
+// resource.deleteMarkers(CallinMarker.ID,
+// true,
+// IResource.DEPTH_INFINITE);
+ }
+ }
+
+
+
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/callinmarkers/JavaElementMarkable.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/callinmarkers/JavaElementMarkable.java
new file mode 100644
index 000000000..03ea62f88
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/callinmarkers/JavaElementMarkable.java
@@ -0,0 +1,110 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2008 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: JavaElementMarkable.java 23435 2010-02-04 00:14:38Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.callinmarkers;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jdt.core.IClassFile;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
+
+/**
+ * Implement markable protocol for java elements.
+ *
+ * @author stephan
+ * @since 1.2.5
+ */
+public class JavaElementMarkable extends AbstractMarkable {
+ IJavaElement fJavaElement;
+
+ public JavaElementMarkable(IJavaElement javaElement) {
+ this.fJavaElement = javaElement;
+ }
+
+ public String getName() {
+ return this.fJavaElement.getElementName();
+ }
+
+ public Set<IType> getAllTypes(IJavaProject[] projects, IProgressMonitor monitor) throws JavaModelException {
+ Set<IType> result = new HashSet<IType>(13);
+ if (this.fJavaElement instanceof IClassFile) {
+
+ IType type = ((IClassFile)this.fJavaElement).getType();
+
+ Set<IType> members = new HashSet<IType>(5);
+ Set<IType> supers = new HashSet<IType>(5);
+ members.add(type);
+ addSuperAndMemberTypes(members, supers, type, this.fJavaElement.getJavaProject(), projects, monitor);
+ result.addAll(members);
+ result.addAll(supers);
+ monitor.worked(5);
+
+ result.addAll(getSubTypes(members, new MySubProgressMonitor(monitor, 5)));
+ }
+ monitor.done();
+ return result;
+ }
+
+ public void removeCallinMarkers() throws CoreException {
+ CallinMarkerRemover.removeCallinMarkers(this.fJavaElement);
+ }
+
+ public IJavaElement getJavaElement() {
+ return this.fJavaElement;
+ }
+
+ public IResource getResource() {
+ return this.fJavaElement.getResource();
+ }
+
+ boolean containsElement(IJavaElement element) {
+ IJavaElement current = element;
+ while (current != null) {
+ if (current == this.fJavaElement)
+ return true;
+ current = current.getParent();
+ }
+ return false;
+ }
+
+ public boolean exists() {
+ return this.fJavaElement.exists();
+ }
+
+ IJavaProject[] getProjects() throws JavaModelException {
+ // FIXME(SH): might want to lookup the project from a library??
+ return getProjects(this.fJavaElement.getCorrespondingResource());
+ }
+
+ public IMarker createMarker(String id) throws CoreException {
+ IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+ IMarker marker = root.createMarker(id);
+ ((JavaCore)JavaCore.getPlugin()).configureJavaElementMarker(marker, this.fJavaElement);
+ return marker;
+ }
+
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/callinmarkers/JobListener.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/callinmarkers/JobListener.java
new file mode 100644
index 000000000..2f147e675
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/callinmarkers/JobListener.java
@@ -0,0 +1,62 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2005, 2009 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: JobListener.java 23435 2010-02-04 00:14:38Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.callinmarkers;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.jobs.IJobChangeEvent;
+import org.eclipse.core.runtime.jobs.JobChangeAdapter;
+import org.eclipse.jface.action.IStatusLineManager;
+import org.eclipse.objectteams.otdt.ui.OTDTUIPlugin;
+
+
+abstract class JobListener extends JobChangeAdapter
+{
+ private final IStatusLineManager _statusLine;
+
+ public JobListener(IStatusLineManager statusLine)
+ {
+ _statusLine = statusLine;
+ }
+
+ public void done(IJobChangeEvent event)
+ {
+ IStatus status = event.getResult();
+ switch (status.getCode())
+ {
+ case IStatus.ERROR:
+ if (_statusLine != null)
+ _statusLine.setErrorMessage(OTDTUIPlugin.getResourceString("CallinMarkerCreator2.search_failed_message")); //$NON-NLS-1$
+ OTDTUIPlugin.getExceptionHandler().logException(status.getMessage(), status.getException());
+ break;
+ case IStatus.CANCEL:
+ if (_statusLine != null)
+ _statusLine.setMessage(OTDTUIPlugin.getResourceString("CallinMarkerCreator2.search_canceled_message")); //$NON-NLS-1$
+ break;
+ default:
+ case IStatus.OK:
+ break; // do nothing
+ }
+
+ jobFinished(status.getCode());
+ }
+
+ protected abstract void jobFinished(int status);
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/callinmarkers/MySubProgressMonitor.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/callinmarkers/MySubProgressMonitor.java
new file mode 100644
index 000000000..6909a61d3
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/callinmarkers/MySubProgressMonitor.java
@@ -0,0 +1,45 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2005, 2009 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: MySubProgressMonitor.java 23435 2010-02-04 00:14:38Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.callinmarkers;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.core.runtime.SubProgressMonitor;
+
+public class MySubProgressMonitor extends SubProgressMonitor
+{
+ public MySubProgressMonitor(IProgressMonitor monitor, int ticks)
+ {
+ super(monitor, ticks, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK);
+ }
+
+ public void doneNothing() {
+ beginTask("", 1); //$NON-NLS-1$
+ done();
+ }
+
+ @Override
+ public void worked(int work) {
+ if (isCanceled())
+ throw new OperationCanceledException();
+ super.worked(work);
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/callinmarkers/ResourceMarkable.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/callinmarkers/ResourceMarkable.java
new file mode 100644
index 000000000..81d98ab48
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/callinmarkers/ResourceMarkable.java
@@ -0,0 +1,103 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2008 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: ResourceMarkable.java 23435 2010-02-04 00:14:38Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.callinmarkers;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
+
+/**
+ * Implement the markable protocol for resources.
+ *
+ * @author stephan
+ * @since 1.2.5
+ */
+public class ResourceMarkable extends AbstractMarkable {
+ IResource fResource;
+
+ public ResourceMarkable(IResource resource) {
+ this.fResource = resource;
+ }
+
+ public String getName() {
+ return this.fResource.getName();
+ }
+
+ public Set<IType> getAllTypes(IJavaProject[] projects, IProgressMonitor monitor) throws CoreException {
+ Set<IType> result = new HashSet<IType>(13);
+ IJavaElement element = JavaCore.create(this.fResource);
+ if (element instanceof ICompilationUnit)
+ {
+ Set<IType> members = new HashSet<IType>(5);
+ Set<IType> supers = new HashSet<IType>(5);
+ for (IType type : ((ICompilationUnit) element).getTypes()) {
+ members.add(type);
+ addSuperAndMemberTypes(members, supers, type, JavaCore.create(this.fResource.getProject()), projects, monitor);
+ }
+ result.addAll(members);
+ result.addAll(supers);
+ monitor.worked(5);
+
+ result.addAll(getSubTypes(members, new MySubProgressMonitor(monitor, 5)));
+ }
+ return result;
+ }
+ IJavaProject[] getProjects() throws JavaModelException {
+ return getProjects(this.fResource);
+ }
+
+ public void removeCallinMarkers() throws CoreException {
+ CallinMarkerRemover.removeCallinMarkers(this.fResource);
+ }
+
+ public IJavaElement getJavaElement() {
+ return JavaCore.create(this.fResource);
+ }
+
+ public IResource getResource() {
+ return this.fResource;
+ }
+
+ boolean containsElement(IJavaElement element) {
+ return this.fResource.equals(element.getResource());
+ }
+
+ public boolean exists() {
+ if (!this.fResource.exists()) return false;
+ IJavaElement javaElement = getJavaElement();
+ do {
+ if (!javaElement.exists())
+ return false;
+ javaElement = javaElement.getParent();
+ } while (javaElement.getElementType() != IJavaElement.PACKAGE_FRAGMENT_ROOT);
+ return true;
+ }
+
+ public IMarker createMarker(String id) throws CoreException {
+ return this.fResource.createMarker(id);
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/callinmarkers/RoleBindingChangedListener.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/callinmarkers/RoleBindingChangedListener.java
new file mode 100644
index 000000000..016f94d48
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/callinmarkers/RoleBindingChangedListener.java
@@ -0,0 +1,153 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2005, 2009 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: RoleBindingChangedListener.java 23435 2010-02-04 00:14:38Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.callinmarkers;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.jdt.core.ElementChangedEvent;
+import org.eclipse.jdt.core.IElementChangedListener;
+import org.eclipse.jdt.core.IField;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IJavaElementDelta;
+import org.eclipse.jdt.core.IMember;
+import org.eclipse.jdt.core.IMethod;
+import org.eclipse.jdt.core.IParent;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jface.action.IStatusLineManager;
+import org.eclipse.objectteams.otdt.core.IMethodMapping;
+import org.eclipse.objectteams.otdt.core.IOTType;
+import org.eclipse.objectteams.otdt.core.IRoleType;
+import org.eclipse.objectteams.otdt.core.OTModelManager;
+import org.eclipse.objectteams.otdt.ui.OTDTUIPlugin;
+import org.eclipse.ui.IViewSite;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPartSite;
+
+/**
+ * This listener receives notification of changes to any java elements.
+ * It reacts upon:
+ * <ul>
+ * <li>changes to methods inside base classes;
+ * when a bound base method is removed or added
+ * a callin marker is removed or newly created respectively.
+ * <li>changes to a role class;
+ * these trigger that callin markers for its baseclass need to be re-computed.
+ * </ul>
+ *
+ * @author brcan
+ * @version $Id: RoleBindingChangedListener.java 23435 2010-02-04 00:14:38Z stephan $
+ */
+public class RoleBindingChangedListener implements IElementChangedListener
+{
+ public void elementChanged(ElementChangedEvent event)
+ {
+ updateCallinMarkers(new IJavaElementDelta[] { event.getDelta() });
+ }
+
+ private void updateCallinMarkers(IJavaElementDelta[] deltas)
+ {
+ if (deltas != null)
+ {
+// if (deltas.length > 0)
+// _CallinMarkerCreator2.reset();
+
+ for (int idx = 0; idx < deltas.length; idx++)
+ {
+ IJavaElementDelta curDelta = deltas[idx];
+
+ final IJavaElement curElem = curDelta.getElement();
+
+ // check for nested deltas
+ if (curElem instanceof IParent)
+ {
+ // visit child's deltas recursively
+ updateCallinMarkers(curDelta.getAffectedChildren());
+ }
+ // addition/removal of role types:
+ if ( curElem instanceof IType
+ && ( curDelta.getKind() == IJavaElementDelta.REMOVED
+ || curDelta.getKind() == IJavaElementDelta.ADDED
+ || curDelta.getFlags() == IJavaElementDelta.F_SUPER_TYPES))
+ {
+ IType roleType = (IType)curElem;
+ IOTType otType = OTModelManager.getOTElement(roleType);
+ if (otType != null && otType.isRole())
+ invalidateRole((IRoleType)otType, roleType);
+ }
+ // changes of base methods & fields:
+ if (curElem instanceof IMethod || curElem instanceof IField)
+ {
+ handleDeltaKind(curDelta, (IMember)curElem);
+ }
+ // any changes in method mappings:
+ if (curElem instanceof IMethodMapping) {
+ // changes in method mappings invalidate the current role's baseclass:
+ IJavaElement parent = curElem.getParent();
+ if (parent instanceof IRoleType) {
+ invalidateRole((IRoleType)parent, (IType) ((IRoleType)parent).getCorrespondingJavaElement());
+ }
+ }
+ }
+ }
+ }
+ private void invalidateRole(IRoleType otType, IType roleType) {
+ IType baseClass = null;
+ try {
+ baseClass = otType.getBaseClass();
+ } catch (JavaModelException e) {
+ /* ignore, proceed with null baseclass */
+ }
+ OTDTUIPlugin.getDefault().getCallinMarkerCreator().invalidateRole(roleType, baseClass);
+ }
+
+ private void handleDeltaKind(IJavaElementDelta delta, IMember baseMember)
+ {
+ if (delta.getKind() == IJavaElementDelta.ADDED)
+ {
+ baseMemberAdded(baseMember);
+ }
+ else if (delta.getKind() == IJavaElementDelta.REMOVED)
+ {
+ baseMemberRemoved(baseMember, baseMember.getResource());
+ }
+ }
+
+ // when renaming a method/field, we apparently get first an add-event, then a remove event.
+ private void baseMemberAdded(IMember baseMember)
+ {
+ IStatusLineManager statusLine = null;
+ IWorkbenchPage page = OTDTUIPlugin.getActivePage();
+ if (page != null && page.getActivePart() != null)
+ {
+ IWorkbenchPartSite site = page.getActivePart().getSite();
+ if (site instanceof IViewSite)
+ statusLine = ((IViewSite) site).getActionBars().getStatusLineManager();
+ }
+
+ OTDTUIPlugin.getDefault().getCallinMarkerCreator().updateCallinMarker(baseMember, statusLine);
+ }
+
+ private void baseMemberRemoved(IMember baseMember, IResource resource)
+ {
+ CallinMarkerRemover.removeCallinMarker(baseMember, resource);
+ }
+}
+
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/compare/BaseMethodCompareElement.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/compare/BaseMethodCompareElement.java
new file mode 100644
index 000000000..5c4e8ce65
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/compare/BaseMethodCompareElement.java
@@ -0,0 +1,133 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2009, Stephan Herrmann and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id$
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Stephan Herrmann - Initial API and implementation
+ * IBM Corporation - Individual methods and code fragments.
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.compare;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IStorage;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IMethod;
+import org.eclipse.jdt.core.ISourceRange;
+import org.eclipse.jdt.core.ISourceReference;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.team.internal.ui.StorageTypedElement;
+import org.eclipse.ui.IEditorInput;
+
+/**
+ * Represents the base method in a compare-bound-methods comparison.
+ * The base method may be binary, this part of the comparison will never be editable.
+ *
+ * @author stephan
+ * @since 1.4.0
+ */
+public class BaseMethodCompareElement extends StorageTypedElement
+{
+ IMethod method = null;
+
+ public BaseMethodCompareElement(IMethod method, String localEncoding) {
+ super(localEncoding);
+ this.method = method;
+ }
+ public Image getImage() {
+ return null; // never displayed in the UI
+ }
+ public String getName() {
+ return this.method.getElementName();
+ }
+ public Object getTypeName() {
+ return this.method.getDeclaringType().getElementName();
+ }
+ public String getType() {
+ // cf. RoleMethodNode#getType()
+ return "java2"; //$NON-NLS-1$
+ }
+ public IResource getResource() {
+ return this.method.getResource();
+ }
+
+ @Override
+ protected IStorage fetchContents(IProgressMonitor monitor) throws CoreException {
+ return new IStorage() {
+ public InputStream getContents() throws CoreException {
+ String contents = getExtendedSource(BaseMethodCompareElement.this.method);
+ byte[] bytes;
+ try {
+ bytes= contents.getBytes(getCharset());
+ } catch (UnsupportedEncodingException e) {
+ bytes= contents.getBytes();
+ }
+ return new ByteArrayInputStream(bytes);
+ }
+ public IPath getFullPath() {
+ return null;
+ }
+ public String getName() {
+ return method.getElementName();
+ }
+ public boolean isReadOnly() {
+ return true;
+ }
+ public Object getAdapter(Class adapter) {
+ return null;
+ }
+ };
+ }
+
+ private String getExtendedSource(IMethod method) throws JavaModelException
+ {
+ // get parent
+ IJavaElement parent= method.getParent();
+ if (parent instanceof ISourceReference) {
+ ISourceReference sr= (ISourceReference) parent;
+ String parentContent= sr.getSource();
+ if (parentContent != null) {
+ ISourceRange parentRange= sr.getSourceRange();
+ ISourceRange childRange= method.getSourceRange();
+
+ int start= childRange.getOffset() - parentRange.getOffset();
+ int end= start + childRange.getLength();
+
+ // search backwards for beginning of line
+ while (start > 0) {
+ char c= parentContent.charAt(start-1);
+ if (c == '\n' || c == '\r')
+ break;
+ start--;
+ }
+
+ return parentContent.substring(start, end);
+ }
+ }
+
+ return method.getSource();
+ }
+
+ @Override
+ protected IEditorInput getDocumentKey(Object element) {
+ return null; // base side is not editable, hence no need to make it sharable.
+ }
+
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/compare/CompareBoundMethodsEditorInput.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/compare/CompareBoundMethodsEditorInput.java
new file mode 100644
index 000000000..11f8cc49c
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/compare/CompareBoundMethodsEditorInput.java
@@ -0,0 +1,301 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2009, Stephan Herrmann and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id$
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Stephan Herrmann - Initial API and implementation
+ * IBM Corporation - Individual methods and code fragments.
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.compare;
+
+import java.lang.reflect.InvocationTargetException;
+
+import org.eclipse.compare.CompareConfiguration;
+import org.eclipse.compare.ISharedDocumentAdapter;
+import org.eclipse.compare.ITypedElement;
+import org.eclipse.compare.structuremergeviewer.Differencer;
+import org.eclipse.compare.structuremergeviewer.ICompareInput;
+import org.eclipse.compare.structuremergeviewer.IStructureComparator;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jdt.core.IMethod;
+import org.eclipse.jdt.core.ISourceRange;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.internal.ui.compare.JavaStructureCreator;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.objectteams.otdt.internal.ui.OTDTUIMessages;
+import org.eclipse.objectteams.otdt.ui.OTDTUIPlugin;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.team.internal.ui.mapping.AbstractCompareInput;
+import org.eclipse.team.internal.ui.mapping.CompareInputChangeNotifier;
+import org.eclipse.team.internal.ui.synchronize.EditableSharedDocumentAdapter;
+import org.eclipse.team.ui.synchronize.SaveableCompareEditorInput;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IWorkbenchPage;
+
+/**
+ * The editor input for comparing bound methods.
+ *
+ * @author stephan
+ * @since 1.4.0
+ */
+public class CompareBoundMethodsEditorInput extends SaveableCompareEditorInput {
+
+ // editable LHS:
+ private ITypedElement left;
+ private IMethod roleMethod;
+ // readonly RHS:
+ private BaseMethodCompareElement right;
+
+ CompareInputChangeNotifier notifier = new CompareInputChangeNotifier() {
+ protected IResource[] getResources(ICompareInput input) {
+ IResource resource = getResource();
+ if (resource == null)
+ return new IResource[0];
+ return new IResource[] { resource };
+ }
+ };
+
+ EditableSharedDocumentAdapter sharedDocumentAdapter;
+
+ // hold on to a control that we want to hide:
+ private Composite outline;
+
+ class MyJavaStructureCreator extends JavaStructureCreator {
+ /* (non-Javadoc)
+ * @see org.eclipse.compare.structuremergeviewer.StructureCreator#createStructureComparator(java.lang.Object, org.eclipse.jface.text.IDocument, org.eclipse.compare.ISharedDocumentAdapter, org.eclipse.core.runtime.IProgressMonitor)
+ */
+ protected IStructureComparator createStructureComparator(Object element,
+ IDocument document,
+ ISharedDocumentAdapter sharedDocumentAdapter,
+ IProgressMonitor monitor)
+ throws CoreException
+ {
+ if (document != null)
+ return new RoleMethodNode.RootJavaNode(document, element, sharedDocumentAdapter);
+ return null;
+ }
+ }
+
+ /*
+ * Returns <code>true</code> if the other object is of type
+ * <code>CompareBoundMethodsEditorInput</code> and both of their
+ * corresponding left and right objects are identical. The content is not
+ * considered.
+ */
+ public boolean equals(Object obj) {
+ if (obj == this)
+ return true;
+ if (obj instanceof CompareBoundMethodsEditorInput) {
+ CompareBoundMethodsEditorInput other = (CompareBoundMethodsEditorInput) obj;
+ return other.left.equals(this.left)
+ && other.right.equals(this.right);
+ }
+ return false;
+ }
+
+ public class MyDiffNode extends AbstractCompareInput {
+ public MyDiffNode(ITypedElement left, ITypedElement right) {
+ super(Differencer.CHANGE, null, left, right);
+ }
+ public void fireChange() {
+ super.fireChange();
+ }
+ protected CompareInputChangeNotifier getChangeNotifier() {
+ return notifier;
+ }
+ public boolean needsUpdate() {
+ // The base never changes
+ return false;
+ }
+ public void update() {
+ fireChange();
+ }
+ }
+
+ /**
+ * Creates a new CompareBoundMethodsEditorInput.
+ * @param left
+ * @param right
+ * @param page
+ * @throws JavaModelException
+ */
+ public CompareBoundMethodsEditorInput(IMethod roleMethod, IMethod baseMethod, IWorkbenchPage page) throws CoreException {
+ super(new CompareConfiguration(), page);
+ this.roleMethod = roleMethod;
+ this.left = makeJavaNode();
+ this.right = new BaseMethodCompareElement(baseMethod, getEncoding(roleMethod));
+ setTitle(left.getName());
+ }
+
+ private ITypedElement makeJavaNode() throws CoreException
+ {
+ // this structure creator is responsible for setup of a sharedDocumentAdapter while building the root node:
+ MyJavaStructureCreator creator = new MyJavaStructureCreator();
+ IStructureComparator rootNode = creator.createStructure(this, null);
+
+ // create the detail node (role method):
+ ISourceRange sourceRange = this.roleMethod.getSourceRange();
+ return new RoleMethodNode((RoleMethodNode)rootNode, RoleMethodNode.METHOD, this.roleMethod.getElementName(), sourceRange.getOffset(), sourceRange.getLength());
+ }
+
+ private String getEncoding(IMethod method) {
+ IResource resource = method.getResource();
+ if (resource instanceof IFile) {
+ IFile file = (IFile) resource;
+ try {
+ return file.getCharset();
+ } catch (CoreException e) {
+ OTDTUIPlugin.log(e);
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public Control createOutlineContents(Composite parent, int direction) {
+ // hold on to a control that we want to hide:
+ return this.outline = (Composite) super.createOutlineContents(parent, direction);
+ }
+
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.ui.synchronize.SaveableCompareEditorInput#prepareCompareInput(IProgressMonitor)
+ */
+ protected ICompareInput prepareCompareInput(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
+ ICompareInput input = createCompareInput();
+ getCompareConfiguration().setLeftEditable(true);
+ getCompareConfiguration().setRightEditable(false);
+ ensureContentsCached(this.right, monitor);
+ initLabels(input);
+ return input;
+ }
+
+ private static void ensureContentsCached(BaseMethodCompareElement right, IProgressMonitor monitor)
+ {
+ if (right != null) {
+ try {
+ right.cacheContents(monitor);
+ } catch (CoreException e) {
+ OTDTUIPlugin.log(e);
+ }
+ }
+ }
+
+ private IResource getResource() {
+ return this.roleMethod.getResource();
+ }
+
+ private ICompareInput createCompareInput() {
+ MyDiffNode input = new MyDiffNode(this.left,this.right);
+ return input;
+ }
+
+ private void initLabels(ICompareInput input) {
+ CompareConfiguration cc = getCompareConfiguration();
+ if (this.left != null) {
+ String leftLabel = NLS.bind(OTDTUIMessages.CompareBoundMethods_role_method_label,
+ new Object[]{this.roleMethod.getDeclaringType().getElementName(), this.roleMethod.getElementName()});
+ cc.setLeftLabel(leftLabel);
+ }
+ if (this.right != null) {
+ String rightLabel = NLS.bind(OTDTUIMessages.CompareBoundMethods_base_method_label,
+ new Object[]{this.right.getTypeName(), this.right.getName()});
+ cc.setRightLabel(rightLabel);
+ }
+ }
+
+
+ /* (non-Javadoc)
+ * @see org.eclipse.compare.CompareEditorInput#getToolTipText()
+ */
+ public String getToolTipText() {
+ Object[] titleObject = new Object[2];
+ titleObject[0] = this.left.getName();
+ titleObject[1] = this.right.getName();
+ return NLS.bind(OTDTUIMessages.CompareBoundMethods_compare_tooltip, titleObject);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.compare.CompareEditorInput#getTitle()
+ */
+ public String getTitle() {
+ Object[] titleObject = new Object[1];
+ titleObject[0] = this.left.getName();
+ return NLS.bind(OTDTUIMessages.CompareBoundMethods_compare_title, titleObject);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.compare.CompareEditorInput#getAdapter(java.lang.Class)
+ */
+ public Object getAdapter(Class adapter) {
+ if (adapter == IFile.class || adapter == IResource.class) {
+ return getResource();
+ }
+ if (adapter == ISharedDocumentAdapter.class) {
+ return getSharedDocumentAdapter();
+ }
+ return super.getAdapter(adapter);
+ }
+
+ private synchronized ISharedDocumentAdapter getSharedDocumentAdapter() {
+ if (this.sharedDocumentAdapter == null)
+ this.sharedDocumentAdapter = new EditableSharedDocumentAdapter(new EditableSharedDocumentAdapter.ISharedDocumentAdapterListener() {
+ public void handleDocumentConnected() { /* ignored */ }
+ public void handleDocumentFlushed() {
+ IEditorInput input = sharedDocumentAdapter.getDocumentKey(getResource());
+ try {
+ if (input != null)
+ sharedDocumentAdapter.saveDocument(input, true, new NullProgressMonitor());
+ } catch (CoreException e) {
+ OTDTUIPlugin.log(e);
+ }
+ }
+ public void handleDocumentDeleted() { /* ignored */ }
+ public void handleDocumentSaved() { /* ignored */ }
+ public void handleDocumentDisconnected() { /* ignored */ }
+ });
+ return this.sharedDocumentAdapter;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.ui.synchronize.LocalResourceCompareEditorInput#fireInputChange()
+ */
+ protected void fireInputChange() {
+ ((MyDiffNode)getCompareResult()).fireChange();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.ui.synchronize.SaveableCompareEditorInput#contentsCreated()
+ */
+ protected void contentsCreated() {
+ super.contentsCreated();
+ this.outline.setVisible(false);
+ this.notifier.initialize();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.ui.synchronize.SaveableCompareEditorInput#handleDispose()
+ */
+ protected void handleDispose() {
+ super.handleDispose();
+ this.notifier.dispose();
+ IEditorInput input = this.sharedDocumentAdapter.getDocumentKey(getResource());
+ if (input != null)
+ this.sharedDocumentAdapter.disconnect(input);
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/compare/RoleMethodNode.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/compare/RoleMethodNode.java
new file mode 100644
index 000000000..685f787ed
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/compare/RoleMethodNode.java
@@ -0,0 +1,262 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2009, Stephan Herrmann and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id$
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Stephan Herrmann - Initial API and implementation
+ * IBM Corporation - Some individual method and fragments
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.compare;
+
+import java.io.UnsupportedEncodingException;
+
+import org.eclipse.compare.IEditableContent;
+import org.eclipse.compare.IEditableContentExtension;
+import org.eclipse.compare.IEncodedStreamContentAccessor;
+import org.eclipse.compare.ISharedDocumentAdapter;
+import org.eclipse.compare.ITypedElement;
+import org.eclipse.compare.SharedDocumentAdapter;
+import org.eclipse.compare.contentmergeviewer.IDocumentRange;
+import org.eclipse.compare.structuremergeviewer.DocumentRangeNode;
+import org.eclipse.compare.structuremergeviewer.IStructureComparator;
+import org.eclipse.compare.structuremergeviewer.SharedDocumentAdapterWrapper;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.objectteams.otdt.ui.OTDTUIPlugin;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.services.IDisposable;
+import org.eclipse.ui.texteditor.IDocumentProvider;
+
+
+/**
+ * Represents the role method of a bound-methods-comparison.
+ *
+ * This class is inspired by class org.eclipse.jdt.internal.ui.compare.JavaNode.
+ *
+ * @author stephan
+ * @since 1.4.0
+ */
+class RoleMethodNode extends DocumentRangeNode implements ITypedElement {
+
+ public static final int CU= 0;
+ public static final int METHOD= 11;
+
+ private static final String COMPILATION_UNIT = "compilationUnit"; //$NON-NLS-1$
+
+ private static final char METHOD_ID= '~';
+ private static final char COMPILATIONUNIT= '{';
+
+ static String buildID(int type, String name) {
+ StringBuffer sb= new StringBuffer();
+ switch (type) {
+ case RoleMethodNode.CU:
+ sb.append(COMPILATIONUNIT);
+ break;
+ case RoleMethodNode.METHOD:
+ sb.append(METHOD_ID);
+ sb.append(name);
+ break;
+ default:
+ Assert.isTrue(false);
+ break;
+ }
+ return sb.toString();
+ }
+
+ /**
+ * The root node of the compilation/document unit containing the role method.
+ * This node is responsible for saving the comparison.
+ */
+ static class RootJavaNode extends RoleMethodNode implements IDisposable {
+
+ private final Object fInput;
+ private final ISharedDocumentAdapter fAdapter;
+
+ RootJavaNode(IDocument document, Object input, ISharedDocumentAdapter adapter) {
+ super(document);
+ fInput= input;
+ fAdapter= adapter;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.compare.structuremergeviewer.DocumentRangeNode#isEditable()
+ */
+ public boolean isEditable() {
+ return true;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.compare.structuremergeviewer.DocumentRangeNode#nodeChanged(org.eclipse.compare.structuremergeviewer.DocumentRangeNode)
+ */
+ protected void nodeChanged(DocumentRangeNode node) {
+ save(this, this.fInput);
+ }
+
+ void save(IStructureComparator node, Object input) {
+ if (node instanceof IDocumentRange && input instanceof IEditableContent) {
+ IDocument document= ((IDocumentRange)node).getDocument();
+ // First check to see if we have a shared document
+ final ISharedDocumentAdapter sda = SharedDocumentAdapterWrapper.getAdapter(input);
+ if (sda != null) {
+ IEditorInput key = sda.getDocumentKey(input);
+ if (key != null) {
+ IDocumentProvider provider = SharedDocumentAdapter.getDocumentProvider(key);
+ if (provider != null) {
+ IDocument providerDoc = provider.getDocument(key);
+ // We have to make sure that the document we are saving is the same as the shared document
+ if (providerDoc != null && providerDoc == document) {
+ if (save(provider, document, input, sda, key))
+ return;
+ }
+ }
+ }
+ }
+ IEditableContent bca= (IEditableContent) input;
+ String contents= document.get();
+ String encoding= null;
+ if (input instanceof IEncodedStreamContentAccessor) {
+ try {
+ encoding= ((IEncodedStreamContentAccessor)input).getCharset();
+ } catch (CoreException e1) {
+ // ignore
+ }
+ }
+ if (encoding == null)
+ encoding= ResourcesPlugin.getEncoding();
+ byte[] bytes;
+ try {
+ bytes= contents.getBytes(encoding);
+ } catch (UnsupportedEncodingException e) {
+ bytes= contents.getBytes();
+ }
+ bca.setContent(bytes);
+ }
+ }
+
+ boolean save(final IDocumentProvider provider, final IDocument document,
+ final Object input, final ISharedDocumentAdapter sda, final IEditorInput key) {
+ try {
+ sda.flushDocument(provider, key, document, false);
+ return true;
+ } catch (CoreException e) {
+ OTDTUIPlugin.log(e);
+ }
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.services.IDisposable#dispose()
+ */
+ public void dispose() {
+ if (fAdapter != null) {
+ fAdapter.disconnect(fInput);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.compare.structuremergeviewer.DocumentRangeNode#getAdapter(java.lang.Class)
+ */
+ public Object getAdapter(Class adapter) {
+ if (adapter == ISharedDocumentAdapter.class) {
+ return fAdapter;
+ }
+ return super.getAdapter(adapter);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.compare.structuremergeviewer.DocumentRangeNode#isReadOnly()
+ */
+ public boolean isReadOnly() {
+ if (fInput instanceof IEditableContentExtension) {
+ IEditableContentExtension ext = (IEditableContentExtension) fInput;
+ return ext.isReadOnly();
+ }
+ return super.isReadOnly();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.compare.structuremergeviewer.DocumentRangeNode#validateEdit(org.eclipse.swt.widgets.Shell)
+ */
+ public IStatus validateEdit(Shell shell) {
+ if (fInput instanceof IEditableContentExtension) {
+ IEditableContentExtension ext = (IEditableContentExtension) fInput;
+ return ext.validateEdit(shell);
+ }
+ return super.validateEdit(shell);
+ }
+ }
+
+ /**
+ * Creates a RoleMethodNode under the given parent.
+ * @param parent the parent node
+ * @param type the Java elements type. Legal values are from the range CU to METHOD of this class.
+ * @param name the name of the Java element
+ * @param start the starting position of the java element in the underlying document
+ * @param length the number of characters of the java element in the underlying document
+ */
+ public RoleMethodNode(RoleMethodNode parent, int type, String name, int start, int length) {
+ super(parent, type, buildID(type, name), parent.getDocument(), start, length);
+ parent.addChild(this);
+ }
+
+ /**
+ * Creates a RoleMethodNode for a CU. It represents the root of a
+ * RoleMethodNode tree, so its parent is null.
+ * @param document the document which contains the Java element
+ */
+ public RoleMethodNode(IDocument document) {
+ super(CU, buildID(CU, "root"), document, 0, document.getLength()); //$NON-NLS-1$
+ }
+
+ /**
+ * Returns a name which is presented in the UI.
+ * @see ITypedElement#getName()
+ */
+ public String getName() {
+
+ switch (getTypeCode()) {
+ case CU:
+ return COMPILATION_UNIT;
+ }
+ return getId().substring(1); // we strip away the type character
+ }
+
+ /*
+ * @see ITypedElement#getType()
+ */
+ public String getType() {
+ return "java2"; //$NON-NLS-1$
+ }
+
+ /**
+ * Returns a shared image for this Java element.
+ *
+ * see ITypedInput.getImage
+ */
+ public Image getImage() {
+ return null; // never displayed in the UI
+ }
+
+ /*
+ * @see java.lang.Object#toString()
+ */
+ public String toString() {
+ return getType() + ": " + getName() //$NON-NLS-1$
+ + "[" + getRange().offset + "+" + getRange().length + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ }
+}
+
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/javaeditor/OTJavaEditorMessages.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/javaeditor/OTJavaEditorMessages.java
new file mode 100644
index 000000000..9a2a0be7a
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/javaeditor/OTJavaEditorMessages.java
@@ -0,0 +1,41 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: OTJavaEditorMessages.java 23435 2010-02-04 00:14:38Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.javaeditor;
+
+import org.eclipse.osgi.util.NLS;;
+
+public class OTJavaEditorMessages extends NLS {
+
+ private static final String BUNDLE_NAME = "org.eclipse.objectteams.otdt.internal.ui.javaeditor.OTJavaEditorMessages"; //$NON-NLS-1$
+
+ public static String RoleOverrideIndicator_open_error_message;
+ public static String RoleOverrideIndicator_open_error_messageHasLogEntry;
+ public static String RoleOverrideIndicator_open_error_title;
+ public static String RoleOverrideIndicator_overrides;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, OTJavaEditorMessages.class);
+ }
+
+ private OTJavaEditorMessages() {
+ }
+
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/javaeditor/OTJavaEditorMessages.properties b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/javaeditor/OTJavaEditorMessages.properties
new file mode 100644
index 000000000..d6ba86064
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/javaeditor/OTJavaEditorMessages.properties
@@ -0,0 +1,4 @@
+RoleOverrideIndicator_open_error_message= Could not open the super implementation.
+RoleOverrideIndicator_open_error_messageHasLogEntry= Could not open the super implementation.\nSee the error log for details.
+RoleOverrideIndicator_open_error_title= Open Declaring Role Class
+RoleOverrideIndicator_overrides= overrides {0}
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/javaeditor/RoleOverrideIndicatorManager.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/javaeditor/RoleOverrideIndicatorManager.java
new file mode 100644
index 000000000..49e02146e
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/javaeditor/RoleOverrideIndicatorManager.java
@@ -0,0 +1,239 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id$
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.javaeditor;
+
+import java.text.MessageFormat;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.ITypeRoot;
+import org.eclipse.jdt.core.dom.ASTNode;
+import org.eclipse.jdt.core.dom.ASTVisitor;
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jdt.core.dom.ITypeBinding;
+import org.eclipse.jdt.core.dom.RoleTypeDeclaration;
+import org.eclipse.jdt.core.dom.SimpleName;
+import org.eclipse.jdt.core.dom.TypeDeclaration;
+
+import org.eclipse.jdt.internal.ui.JavaPlugin;
+import org.eclipse.jdt.internal.ui.javaeditor.JavaSelectAnnotationRulerAction;
+import org.eclipse.jdt.internal.ui.text.java.IJavaReconcilingListener;
+import org.eclipse.jdt.internal.ui.util.ExceptionHandler;
+import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels;
+import org.eclipse.jdt.ui.JavaUI;
+import org.eclipse.jdt.ui.SharedASTProvider;
+
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.text.ISynchronizable;
+import org.eclipse.jface.text.Position;
+import org.eclipse.jface.text.source.Annotation;
+import org.eclipse.jface.text.source.IAnnotationModel;
+import org.eclipse.jface.text.source.IAnnotationModelExtension;
+
+/**
+ * Manages the override indicators for the given Java element and annotation model.
+ *
+ * Copied from {@link org.eclipse.jdt.internal.ui.javaeditor.OverrideIndicatorManager} and slightly adjusted.
+ *
+ * Note that inaccessible features preclude that this class were directly integrated into
+ * {@link JavaSelectAnnotationRulerAction}, which is why the jdt.ui.adaptor has to
+ * help (see {@link org.eclipse.objectteams.otdt.internal.ui.javaeditor.AnnotationAdaptor}).
+ *
+ * @author stephan
+ * @since 1.2.8
+ */
+public class RoleOverrideIndicatorManager implements IJavaReconcilingListener {
+
+ /**
+ * Role class override indicator annotation.
+ */
+ public class OverrideIndicator extends Annotation {
+
+ private String fAstNodeKey;
+
+ /**
+ * Creates a new override annotation.
+ *
+ * @param text the text associated with this annotation
+ * @param key the type binding key
+ */
+ OverrideIndicator(String text, String key) {
+ super(ANNOTATION_TYPE, false, text);
+ fAstNodeKey= key;
+ }
+
+ /**
+ * Opens and reveals the defining role (closest tsuper).
+ */
+ public void open() {
+ CompilationUnit ast= SharedASTProvider.getAST(fJavaElement, SharedASTProvider.WAIT_ACTIVE_ONLY, null);
+ if (ast != null) {
+ ASTNode node= ast.findDeclaringNode(fAstNodeKey);
+//{ObjectTeams: specific search strategy for a role's tsupers:
+ if (node instanceof TypeDeclaration) {
+ try {
+ ITypeBinding typeBinding = ((TypeDeclaration)node).resolveBinding();
+ ITypeBinding[] tsuperRoles = typeBinding.getSuperRoles();
+ if (tsuperRoles != null && tsuperRoles.length > 0) {
+ IJavaElement definingRole = tsuperRoles[0].getJavaElement();
+ if (definingRole!= null) {
+// SH}
+ JavaUI.openInEditor(definingRole, true, true);
+ return;
+ }
+ }
+ } catch (CoreException e) {
+ ExceptionHandler.handle(e, OTJavaEditorMessages.RoleOverrideIndicator_open_error_title, OTJavaEditorMessages.RoleOverrideIndicator_open_error_messageHasLogEntry);
+ return;
+ }
+ }
+ }
+ String title= OTJavaEditorMessages.RoleOverrideIndicator_open_error_title;
+ String message= OTJavaEditorMessages.RoleOverrideIndicator_open_error_message;
+ MessageDialog.openError(JavaPlugin.getActiveWorkbenchShell(), title, message);
+ }
+ }
+
+ static final String ANNOTATION_TYPE= "org.eclipse.objectteams.otdt.ui.roleOverrideIndicator"; //$NON-NLS-1$
+
+ private IAnnotationModel fAnnotationModel;
+ private Object fAnnotationModelLockObject;
+ private Annotation[] fOverrideAnnotations;
+ private ITypeRoot fJavaElement;
+
+
+ public RoleOverrideIndicatorManager(IAnnotationModel annotationModel, ITypeRoot javaElement, CompilationUnit ast) {
+ Assert.isNotNull(annotationModel);
+ Assert.isNotNull(javaElement);
+
+ fJavaElement= javaElement;
+ fAnnotationModel=annotationModel;
+ fAnnotationModelLockObject= getLockObject(fAnnotationModel);
+
+ updateAnnotations(ast, new NullProgressMonitor());
+ }
+
+ /**
+ * Returns the lock object for the given annotation model.
+ *
+ * @param annotationModel the annotation model
+ * @return the annotation model's lock object
+ */
+ private Object getLockObject(IAnnotationModel annotationModel) {
+ if (annotationModel instanceof ISynchronizable) {
+ Object lock= ((ISynchronizable)annotationModel).getLockObject();
+ if (lock != null)
+ return lock;
+ }
+ return annotationModel;
+ }
+
+ /**
+ * Updates the override annotations based on the given AST.
+ *
+ * @param ast the compilation unit AST
+ * @param progressMonitor the progress monitor
+ */
+ protected void updateAnnotations(CompilationUnit ast, IProgressMonitor progressMonitor) {
+
+ if (ast == null || progressMonitor.isCanceled())
+ return;
+
+ final Map<OverrideIndicator, Position> annotationMap= new HashMap<OverrideIndicator, Position>(10);
+
+ ast.accept(new ASTVisitor(false) {
+ /*
+ * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.RoleTypeDeclaration)
+ */
+ public boolean visit(RoleTypeDeclaration node) {
+ ITypeBinding binding= node.resolveBinding();
+ if (binding != null) {
+//{ObjectTeams: different search for super implementation:
+ ITypeBinding[] definingRoles= binding.getSuperRoles();
+ if (definingRoles != null && definingRoles.length > 0) {
+ ITypeBinding definingRole = definingRoles[0];
+// SH}
+ ITypeBinding definingType= definingRole.getDeclaringClass();
+ String qualifiedRoleName= definingType.getQualifiedName() + "." + binding.getName(); //$NON-NLS-1$
+
+ String text= MessageFormat.format(OTJavaEditorMessages.RoleOverrideIndicator_overrides, new Object[] {BasicElementLabels.getJavaElementName(qualifiedRoleName)});
+
+ SimpleName name= node.getName();
+ Position position= new Position(name.getStartPosition(), name.getLength());
+
+ annotationMap.put(new OverrideIndicator(text, binding.getKey()), position);
+ }
+ }
+ return true;
+ }
+ });
+
+ if (progressMonitor.isCanceled())
+ return;
+
+ synchronized (fAnnotationModelLockObject) {
+ if (fAnnotationModel instanceof IAnnotationModelExtension) {
+ ((IAnnotationModelExtension)fAnnotationModel).replaceAnnotations(fOverrideAnnotations, annotationMap);
+ } else {
+ removeAnnotations();
+ Iterator<Map.Entry<OverrideIndicator, Position>> iter= annotationMap.entrySet().iterator();
+ while (iter.hasNext()) {
+ Map.Entry<OverrideIndicator, Position> mapEntry= iter.next();
+ fAnnotationModel.addAnnotation(mapEntry.getKey(), mapEntry.getValue());
+ }
+ }
+ fOverrideAnnotations= annotationMap.keySet().toArray(new Annotation[annotationMap.keySet().size()]);
+ }
+ }
+
+ /**
+ * Removes all override indicators from this manager's annotation model.
+ */
+ //FIXME: made public to workaround IllegalAccessError with split package access
+ // from bundle org.eclipse.objectteams.otdt.jdt.ui(x-friends not working)
+ public void removeAnnotations() {
+ if (fOverrideAnnotations == null)
+ return;
+
+ synchronized (fAnnotationModelLockObject) {
+ if (fAnnotationModel instanceof IAnnotationModelExtension) {
+ ((IAnnotationModelExtension)fAnnotationModel).replaceAnnotations(fOverrideAnnotations, null);
+ } else {
+ for (int i= 0, length= fOverrideAnnotations.length; i < length; i++)
+ fAnnotationModel.removeAnnotation(fOverrideAnnotations[i]);
+ }
+ fOverrideAnnotations= null;
+ }
+ }
+
+ /*
+ * @see org.eclipse.jdt.internal.ui.text.java.IJavaReconcilingListener#aboutToBeReconciled()
+ */
+ public void aboutToBeReconciled() {
+ }
+
+ /*
+ * @see org.eclipse.jdt.internal.ui.text.java.IJavaReconcilingListener#reconciled(CompilationUnit, boolean, IProgressMonitor)
+ */
+ public void reconciled(CompilationUnit ast, boolean forced, IProgressMonitor progressMonitor) {
+ updateAnnotations(ast, progressMonitor);
+ }
+}
+
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/preferences/CompilerConfigurationBlock.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/preferences/CompilerConfigurationBlock.java
new file mode 100644
index 000000000..f7f3c4881
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/preferences/CompilerConfigurationBlock.java
@@ -0,0 +1,382 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2005, 2009 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: CompilerConfigurationBlock.java 23435 2010-02-04 00:14:38Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.preferences;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.internal.ui.JavaPlugin;
+import org.eclipse.jdt.internal.ui.preferences.OptionsConfigurationBlock;
+import org.eclipse.jdt.internal.ui.preferences.PreferencesMessages;
+import org.eclipse.jdt.internal.ui.preferences.ScrolledPageContent;
+import org.eclipse.jdt.internal.ui.wizards.IStatusChangeListener;
+import org.eclipse.jface.dialogs.ControlEnableState;
+import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.objectteams.otdt.core.ext.OTDTPlugin;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.FontData;
+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.ui.forms.widgets.ExpandableComposite;
+import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
+
+/**
+ * Partly copied from org.eclipse.jdt.internal.ui.preferences.CompilerConfigurationBlock.
+ *
+ * This class defines all configurable options of the OT/J compiler.
+ * + private static final Key PREF_PB_
+ * also add in getKeys()
+ * + createCompilerPreferenceTabContent() -> create label
+ * -> use OTPreferencesMessages
+ *
+ * Other classes/methods involved are (Problem reporting):
+ * + CompilerOptions:
+ * - constant "String OPTION_ReportXxx"
+ * - constant "long Xxx" bit for use in mask
+ * - default "warningThreshold": include Xxx-bit if appropriate
+ * - getMap(): transfer severity (bitset) to optionsMap
+ * - set(Map): transfer from optionsMap to severity (bitset)
+ * - toString()
+ * + ProblemReporter
+ * - getIrritant: map problemId (from IProblem) to irritant (=option)
+ * - individual report-methods: don't hardcode severity!
+ * + DefaultCodeFormatter.getDefaultCompilerOptions()
+ *
+ * Integration into the plugin:
+ * + OTDTPlugin.OT_COMPILER_XXX: constants for configurable options (sync with OPTION_ReportXxx)
+ * + OTCompilerPreferencePage
+ * (basically unchanged except for reference to CompilerConfigurationBlock and one ID)
+ * + plugin.xml:
+ * define preference/property-page extensions
+ *
+ * For enable/disable options these differences apply:
+ * + CompilerOptions:
+ * - no longs/masks but a boolean field
+ *
+ * Created on Sep 11, 2005
+ *
+ * @author stephan
+ * @version $Id: CompilerConfigurationBlock.java 23435 2010-02-04 00:14:38Z stephan $
+ */
+public class CompilerConfigurationBlock extends OptionsConfigurationBlock {
+
+ // Preference store keys, see JavaCore.getOptions
+ /* Note(SH):
+ * We must use the JDTCoreKeys in order to store our preferences in the same preference store (and thus file).
+ * Only keys from this store will be passed to the compiler
+ */
+
+ // proplem severities:
+ private static final Key PREF_PB_BASECALL = getJDTCoreKey(OTDTPlugin.OT_COMPILER_BASE_CALL);
+ private static final Key PREF_PB_UNSAFE_ROLE_INSTANTIATION = getJDTCoreKey(OTDTPlugin.OT_COMPILER_UNSAFE_ROLE_INSTANTIATION);
+
+// private static final Key PREF_PB_EFFECTLESS_FIELDACCESS = getJDTCoreKey(OTDTPlugin.OT_COMPILER_EFFECTLESS_FIELDACCESS);
+ private static final Key PREF_PB_FRAGILE_CALLIN = getJDTCoreKey(OTDTPlugin.OT_COMPILER_FRAGILE_CALLIN);
+// private static final Key PREF_PB_UNUSED_PARAMMAP = getJDTCoreKey(OTDTPlugin.OT_COMPILER_UNUSED_PARAMMAP);
+
+ private static final Key PREF_PB_POTENTIAL_AMBIGUOUS_PLAYEDBY = getJDTCoreKey(OTDTPlugin.OT_COMPILER_POTENTIAL_AMBIGUOUS_PLAYEDBY);
+ private static final Key PREF_PB_ABSTRACT_POTENTIAL_RELEVANT_ROLE = getJDTCoreKey(OTDTPlugin.OT_COMPILER_ABSTRACT_POTENTIAL_RELEVANT_ROLE);
+
+ private static final Key PREF_PB_DECAPSULATION = getJDTCoreKey(OTDTPlugin.OT_COMPILER_DECAPSULATION);
+
+ private static final Key PREF_PB_DEPRECATED_PATH_SYNTAX = getJDTCoreKey(OTDTPlugin.OT_COMPILER_DEPRECATED_PATH_SYNTAX);
+
+ private static final Key PREF_PB_BINDING_CONVENTIONS = getJDTCoreKey(OTDTPlugin.OT_COMPILER_BINDING_CONVENTIONS);
+
+ private static final Key PREF_PB_INFERRED_CALLOUT = getJDTCoreKey(OTDTPlugin.OT_COMPILER_INFERRED_CALLOUT);
+
+ private static final Key PREF_PB_WEAVE_INTO_SYSTEM_CLASS = getJDTCoreKey(OTDTPlugin.OT_COMPILER_WEAVE_INTO_SYSTEM_CLASS);
+
+ private static final Key PREF_PB_OVERRIDE_FINAL_ROLE = getJDTCoreKey(OTDTPlugin.OT_COMPILER_OVERRIDE_FINAL_ROLE);
+
+ private static final Key PREF_PB_EXCEPTION_IN_GUARD = getJDTCoreKey(OTDTPlugin.OT_COMPILER_EXCEPTION_IN_GUARD);
+
+ private static final Key PREF_PB_AMBIGUOUS_LOWERING = getJDTCoreKey(OTDTPlugin.OT_COMPILER_AMBIGUOUS_LOWERING);
+
+ private static final Key PREF_PB_ADAPTING_DEPRECATED = getJDTCoreKey(OTDTPlugin.OT_COMPILER_ADAPTING_DEPRECATED);
+
+// private static final Key PREF_PB_INCOMPLETE_BUILD = getJDTCoreKey(OTDTPlugin.OT_COMPILER_INCOMPLETE_BUILD);
+
+ // feature enablement:
+ private static final Key PREF_OPT_SCOPED_KEYWORDS = getJDTCoreKey(OTDTPlugin.OT_COMPILER_SCOPED_KEYWORDS);
+
+ // values
+ private static final String ERROR= JavaCore.ERROR;
+ private static final String WARNING= JavaCore.WARNING;
+ private static final String IGNORE= JavaCore.IGNORE;
+
+ private static final String ENABLED= JavaCore.ENABLED;
+ private static final String DISABLED= JavaCore.DISABLED;
+
+ private static final String SETTINGS_SECTION_NAME = null; // ?? see ProblemSeveritiesConfigurationBlock
+
+ // would be needed if some controls are enabled/disabled programmatically:
+ // private IStatus fComplianceStatus;
+ // private ArrayList fComplianceControls;
+ private Composite fControlsComposite;
+ private ControlEnableState fBlockEnableState;
+
+ public CompilerConfigurationBlock(IStatusChangeListener context, IProject project, IWorkbenchPreferenceContainer container) {
+ super(context, project, getKeys(), container);
+
+ fBlockEnableState= null;
+ // currently unused:
+ //fComplianceControls= new ArrayList();
+ //ComplianceStatus= new StatusInfo();
+
+ }
+
+ private static Key[] getKeys() {
+ return new Key[] {
+ PREF_PB_BASECALL, PREF_PB_UNSAFE_ROLE_INSTANTIATION,
+// PREF_PB_EFFECTLESS_FIELDACCESS,
+ PREF_PB_FRAGILE_CALLIN,
+// PREF_PB_UNUSED_PARAMMAP,
+ PREF_PB_POTENTIAL_AMBIGUOUS_PLAYEDBY, PREF_PB_ABSTRACT_POTENTIAL_RELEVANT_ROLE,
+ PREF_PB_DECAPSULATION,
+ PREF_PB_BINDING_CONVENTIONS,
+ PREF_PB_DEPRECATED_PATH_SYNTAX,
+ PREF_PB_INFERRED_CALLOUT,
+ PREF_PB_ADAPTING_DEPRECATED,
+ PREF_PB_WEAVE_INTO_SYSTEM_CLASS,
+ PREF_PB_OVERRIDE_FINAL_ROLE,
+ PREF_PB_EXCEPTION_IN_GUARD,
+ PREF_PB_AMBIGUOUS_LOWERING,
+// PREF_PB_INCOMPLETE_BUILD,
+ PREF_OPT_SCOPED_KEYWORDS
+ };
+ }
+
+ /*
+ * @see org.eclipse.jface.preference.PreferencePage#createContents(Composite)
+ */
+ protected Control createContents(Composite parent) {
+ setShell(parent.getShell());
+
+ Composite complianceComposite= createCompilerPreferenceTabContent(parent);
+
+ validateSettings(null, null, null);
+
+ return complianceComposite;
+ }
+
+ public void enablePreferenceContent(boolean enable) {
+ if (fControlsComposite != null && !fControlsComposite.isDisposed()) {
+ if (enable) {
+ if (fBlockEnableState != null) {
+ fBlockEnableState.restore();
+ fBlockEnableState= null;
+ }
+ } else {
+ if (fBlockEnableState == null) {
+ fBlockEnableState= ControlEnableState.disable(fControlsComposite);
+ }
+ }
+ }
+ }
+
+
+ private Composite createCompilerPreferenceTabContent(Composite folder) {
+ String[] errorWarningIgnore= new String[] { ERROR, WARNING, IGNORE };
+
+ String[] errorWarningIgnoreLabels= new String[] {
+ PreferencesMessages.ProblemSeveritiesConfigurationBlock_error,
+ PreferencesMessages.ProblemSeveritiesConfigurationBlock_warning,
+ PreferencesMessages.ProblemSeveritiesConfigurationBlock_ignore
+ };
+
+ String[] enabledDisabled= new String[] { ENABLED, DISABLED };
+
+
+ // widget layout mainly copied from ProblemSeveritiesConfigurationBlock:
+ int nColumns= 3;
+ final ScrolledPageContent sc1 = new ScrolledPageContent(folder);
+
+ Composite composite= sc1.getBody();
+ GridLayout layout= new GridLayout(nColumns, false);
+ layout.marginHeight= 0;
+ layout.marginWidth= 0;
+ composite.setLayout(layout);
+
+ Label description= new Label(composite, SWT.LEFT | SWT.WRAP);
+ description.setFont(description.getFont());
+ description.setText(OTPreferencesMessages.OTCompilerConfiguration_common_description);
+ description.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, true, false, nColumns - 1, 1));
+
+ Composite inner;
+ String label;
+
+ // --- Problem configuration ---
+ inner = myCreateSection(nColumns, composite, OTPreferencesMessages.OTCompilerProblemConfiguration_description);
+
+ label= OTPreferencesMessages.OTCompilerProblemConfiguration_otjld_ref_description;
+ addLabel(inner, nColumns, label, SWT.ITALIC);
+
+ label= OTPreferencesMessages.OTCompilerConfigurationBlock_not_exactly_one_basecall_label;
+ addComboBox(inner, label, PREF_PB_BASECALL, errorWarningIgnore, errorWarningIgnoreLabels, 0);
+
+ label= OTPreferencesMessages.OTCompilerConfigurationBlock_unsafe_role_instantiation_label;
+ addComboBox(inner, label, PREF_PB_UNSAFE_ROLE_INSTANTIATION, errorWarningIgnore, errorWarningIgnoreLabels, 0);
+
+// label= OTPreferencesMessages.OTCompilerConfigurationBlock_effectless_fieldaccess_label;
+// addComboBox(inner, label, PREF_PB_EFFECTLESS_FIELDACCESS, errorWarningIgnore, errorWarningIgnoreLabels, 0);
+
+ label= OTPreferencesMessages.OTCompilerConfigurationBlock_fragile_callin_label;
+ addComboBox(inner, label, PREF_PB_FRAGILE_CALLIN, errorWarningIgnore, errorWarningIgnoreLabels, 0);
+
+// label= OTPreferencesMessages.OTCompilerConfigurationBlock_unused_parammap_label;
+// addComboBox(inner, label, PREF_PB_UNUSED_PARAMMAP, errorWarningIgnore, errorWarningIgnoreLabels, 0);
+
+ label= OTPreferencesMessages.OTCompilerConfigurationBlock_potential_ambiguous_playedby_label;
+ addComboBox(inner, label, PREF_PB_POTENTIAL_AMBIGUOUS_PLAYEDBY, errorWarningIgnore, errorWarningIgnoreLabels, 0);
+
+ label= OTPreferencesMessages.OTCompilerConfigurationBlock_ambiguous_lowering_label;
+ addComboBox(inner, label, PREF_PB_AMBIGUOUS_LOWERING, errorWarningIgnore, errorWarningIgnoreLabels, 0);
+
+ label= OTPreferencesMessages.OTCompilerConfigurationBlock_abstract_potential_relevant_role_label;
+ addComboBox(inner, label, PREF_PB_ABSTRACT_POTENTIAL_RELEVANT_ROLE, errorWarningIgnore, errorWarningIgnoreLabels, 0);
+
+ label= OTPreferencesMessages.OTCompilerConfigurationBlock_decapsulation_label;
+ addComboBox(inner, label, PREF_PB_DECAPSULATION, errorWarningIgnore, errorWarningIgnoreLabels, 0);
+
+ label= OTPreferencesMessages.OTCompilerConfigurationBlock_bindingconventions_label;
+ addComboBox(inner, label, PREF_PB_BINDING_CONVENTIONS, errorWarningIgnore, errorWarningIgnoreLabels, 0);
+
+ label= OTPreferencesMessages.OTCompilerConfigurationBlock_deprecated_path_syntax_label;
+ addComboBox(inner, label, PREF_PB_DEPRECATED_PATH_SYNTAX, errorWarningIgnore, errorWarningIgnoreLabels, 0);
+
+ label= OTPreferencesMessages.OTCompilerConfigurationBlock_inferred_callout_label;
+ addComboBox(inner, label, PREF_PB_INFERRED_CALLOUT, errorWarningIgnore, errorWarningIgnoreLabels, 0);
+
+ label= OTPreferencesMessages.OTCompilerConfigurationBlock_adapting_deprecated_label;
+ addComboBox(inner, label, PREF_PB_ADAPTING_DEPRECATED, errorWarningIgnore, errorWarningIgnoreLabels, 0);
+
+ label= OTPreferencesMessages.OTCompilerConfigurationBlock_binding_to_system_class;
+ addComboBox(inner, label, PREF_PB_WEAVE_INTO_SYSTEM_CLASS, errorWarningIgnore, errorWarningIgnoreLabels, 0);
+
+ label= OTPreferencesMessages.OTCompilerConfigurationBlock_override_final_role;
+ addComboBox(inner, label, PREF_PB_OVERRIDE_FINAL_ROLE, errorWarningIgnore, errorWarningIgnoreLabels, 0);
+
+ label= OTPreferencesMessages.OTCompilerConfigurationBlock_exception_in_guard;
+ addComboBox(inner, label, PREF_PB_EXCEPTION_IN_GUARD, errorWarningIgnore, errorWarningIgnoreLabels, 0);
+
+// label= OTPreferencesMessages.OTCompilerConfigurationBlock_incomplete_build_label;
+// addComboBox(inner, label, PREF_PB_INCOMPLETE_BUILD, errorWarningIgnore, errorWarningIgnoreLabels, 0);
+
+ // ---- Feature enablement ----
+ inner = myCreateSection(nColumns, composite, OTPreferencesMessages.OTCompilerFeatureEnablement_description);
+
+ label= OTPreferencesMessages.OTCompilerConfigurationBlock_opt_scoped_keywords;
+ addCheckBox(inner, label, PREF_OPT_SCOPED_KEYWORDS, enabledDisabled, 0);
+
+ // not sure whether this works
+ IDialogSettings section= JavaPlugin.getDefault().getDialogSettings().getSection(SETTINGS_SECTION_NAME);
+ restoreSectionExpansionStates(section);
+
+ // store in this field in order to support enabling/disabling via enablePreferenceContent()
+ fControlsComposite = composite;
+ return composite;
+ }
+
+ private Composite myCreateSection(int nColumns, Composite composite, String label) {
+ ExpandableComposite excomposite = createStyleSection(composite, label, nColumns);
+ Composite inner= new Composite(excomposite, SWT.NONE);
+ inner.setFont(composite.getFont());
+ inner.setLayout(new GridLayout(nColumns, false));
+ excomposite.setClient(inner);
+ return inner;
+ }
+
+ private void addLabel(Composite composite, int nColumns, String descriptionText, int fontStyle)
+ {
+ Label description= new Label(composite, SWT.WRAP);
+ description.setText(descriptionText);
+ if (fontStyle != SWT.NORMAL) {
+ Font f = composite.getFont();
+ FontData[] datas = f.getFontData();
+ datas[0].setStyle(fontStyle);
+ description.setFont(new Font(f.getDevice(), datas[0]));
+ }
+ GridData gd= new GridData();
+ gd.horizontalSpan= nColumns;
+ //gd.widthHint= fPixelConverter.convertWidthInCharsToPixels(60);
+ description.setLayoutData(gd);
+ }
+
+ /* (non-javadoc)
+ * Update fields and validate.
+ * @param changedKey Key that changed, or null, if all changed.
+ */
+ protected void validateSettings(Key changedKey, String olValue, String newValue) {
+
+ if (changedKey != null) {
+ if (PREF_PB_BASECALL.equals(changedKey) || PREF_PB_DECAPSULATION.equals(changedKey))
+ {
+ // not yet used really.
+ updateEnableStates();
+ } else {
+ return;
+ }
+ } else {
+ updateEnableStates();
+ }
+ }
+
+
+ private void updateEnableStates() {
+ // TODO(SH): enable check boxes for details:
+// boolean enableBasecall = !checkValue(PREF_PB_BASECALL, IGNORE);
+// getCheckBox(PREF_PB_DEPRECATION_IN_DEPRECATED_CODE).setEnabled(enableDeprecation);
+// getCheckBox(PREF_PB_DEPRECATION_WHEN_OVERRIDING).setEnabled(enableDeprecation);
+
+ // TODO(SH): enable check boxes for details:
+// boolean enableDecapsulation = !checkValue(PREF_PB_DECAPSULATION, IGNORE);
+// getCheckBox(PREF_PB_DEPRECATION_IN_DEPRECATED_CODE).setEnabled(enableDeprecation);
+// getCheckBox(PREF_PB_DEPRECATION_WHEN_OVERRIDING).setEnabled(enableDeprecation);
+
+ }
+
+
+ protected String[] getFullBuildDialogStrings(boolean workspaceSettings) {
+ String title= PreferencesMessages.ComplianceConfigurationBlock_needsbuild_title;
+
+ String message;
+ if (workspaceSettings) {
+ message= PreferencesMessages.ComplianceConfigurationBlock_needsfullbuild_message;
+ } else {
+ message= PreferencesMessages.ComplianceConfigurationBlock_needsprojectbuild_message;
+ }
+ return new String[] { title, message };
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jdt.internal.ui.preferences.OptionsConfigurationBlock#dispose()
+ */
+ public void dispose() {
+ IDialogSettings section= JavaPlugin.getDefault().getDialogSettings().addNewSection(SETTINGS_SECTION_NAME);
+ storeSectionExpansionStates(section);
+ super.dispose();
+ }
+
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/preferences/GeneralPreferences.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/preferences/GeneralPreferences.java
new file mode 100644
index 000000000..10fd6f96c
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/preferences/GeneralPreferences.java
@@ -0,0 +1,37 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2003, 2008 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: GeneralPreferences.java 23435 2010-02-04 00:14:38Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.preferences;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+
+/**
+ * @author gis
+ */
+public class GeneralPreferences
+{
+ public static String CALLIN_MARKER_ENABLED_BOOL = "prefs.ot.callinmarker.enabled"; //$NON-NLS-1$
+
+//TODO (haebor): use mechanisms that are defined by DefaultPreferences
+ public static void initDefaults(IPreferenceStore prefs)
+ {
+ prefs.setDefault(CALLIN_MARKER_ENABLED_BOOL, true);
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/preferences/OTCompilerPreferencePage.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/preferences/OTCompilerPreferencePage.java
new file mode 100644
index 000000000..587752338
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/preferences/OTCompilerPreferencePage.java
@@ -0,0 +1,165 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 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
+ * $Id: OTCompilerPreferencePage.java 23435 2010-02-04 00:14:38Z stephan $
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * Fraunhofer FIRST - extended API and implementation
+ * Technical University Berlin - extended API and implementation
+ *******************************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.preferences;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.IAdaptable;
+
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
+
+import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
+import org.eclipse.jdt.internal.ui.JavaPlugin;
+
+import org.eclipse.jdt.internal.ui.preferences.PropertyAndPreferencePage;
+
+/**
+ * OT_COPY_PASTE
+ * The page to configure the compiler options.
+ * Copied from org.eclipse.jdt.internal.ui.preferences.CompliancePreferencePage
+ *
+ * This page is used by "Window->Preferences->Java->Compiler (OT/J)"
+ *
+ * Created on Sep 11, 2005
+ *
+ * @author stephan
+ */
+public class OTCompilerPreferencePage extends PropertyAndPreferencePage {
+
+ // sync with ids in plugin.xml:
+ // id of the page in the org.eclipse.ui.preferencePages extension
+ public static final String PREF_ID= "org.eclipse.objectteams.otdt.ui.preferences.CompilerPreferencePage"; //$NON-NLS-1$
+ // id of the pages in the org.eclipse.ui.propertyPages extension
+ public static final String PROP_ID= "org.eclipse.objectteams.otdt.ui.propertyPages.CompilerPreferencePage"; //$NON-NLS-1$
+
+ private CompilerConfigurationBlock fConfigurationBlock;
+
+ public OTCompilerPreferencePage() {
+ setPreferenceStore(JavaPlugin.getDefault().getPreferenceStore());
+ // only shown on the preference page:
+ //setDescription(OTPreferencesMessages.CompilerConfigurationBlock_common_description);
+
+ // only used when page is shown programatically
+ setTitle(OTPreferencesMessages.OTCompilerPreferencePage_title);
+ }
+
+ /*
+ * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
+ */
+ public void createControl(Composite parent) {
+ IWorkbenchPreferenceContainer container= (IWorkbenchPreferenceContainer) getContainer();
+ fConfigurationBlock= new CompilerConfigurationBlock(getNewStatusChangedListener(), getProject(), container);
+
+ super.createControl(parent);
+
+ // TODO(SH): do we have more appropriate help?
+ if (isProjectPreferencePage()) {
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IJavaHelpContextIds.COMPILER_PROPERTY_PAGE);
+ } else {
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IJavaHelpContextIds.COMPILER_PREFERENCE_PAGE);
+ }
+ }
+
+ protected Control createPreferenceContent(Composite composite) {
+ return fConfigurationBlock.createContents(composite);
+ }
+
+ protected boolean hasProjectSpecificOptions(IProject project) {
+ return fConfigurationBlock.hasProjectSpecificOptions(project);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jdt.internal.ui.preferences.PropertyAndPreferencePage#getPreferencePageID()
+ */
+ protected String getPreferencePageID() {
+ return PREF_ID;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jdt.internal.ui.preferences.PropertyAndPreferencePage#getPropertyPageID()
+ */
+ protected String getPropertyPageID() {
+ return PROP_ID;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.DialogPage#dispose()
+ */
+ public void dispose() {
+ if (fConfigurationBlock != null) {
+ fConfigurationBlock.dispose();
+ }
+ super.dispose();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jdt.internal.ui.preferences.PropertyAndPreferencePage#enableProjectSpecificSettings(boolean)
+ */
+ protected void enableProjectSpecificSettings(boolean useProjectSpecificSettings) {
+ super.enableProjectSpecificSettings(useProjectSpecificSettings);
+ if (fConfigurationBlock != null) {
+ fConfigurationBlock.useProjectSpecificSettings(useProjectSpecificSettings);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jdt.internal.ui.preferences.PropertyAndPreferencePage#enablePreferenceContent(boolean)
+ */
+ protected void enablePreferenceContent(boolean enable) {
+ if (fConfigurationBlock != null) {
+ fConfigurationBlock.enablePreferenceContent(enable);
+ }
+ }
+
+ /*
+ * @see org.eclipse.jface.preference.IPreferencePage#performDefaults()
+ */
+ protected void performDefaults() {
+ super.performDefaults();
+ if (fConfigurationBlock != null) {
+ fConfigurationBlock.performDefaults();
+ }
+ }
+
+ /*
+ * @see org.eclipse.jface.preference.IPreferencePage#performOk()
+ */
+ public boolean performOk() {
+ if (fConfigurationBlock != null && !fConfigurationBlock.performOk()) {
+ return false;
+ }
+ return super.performOk();
+ }
+
+ /*
+ * @see org.eclipse.jface.preference.IPreferencePage#performApply()
+ */
+ public void performApply() {
+ if (fConfigurationBlock != null) {
+ fConfigurationBlock.performApply();
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jdt.internal.ui.preferences.PropertyAndPreferencePage#setElement(org.eclipse.core.runtime.IAdaptable)
+ */
+ public void setElement(IAdaptable element) {
+ super.setElement(element);
+ setDescription(null); // no description for property page
+ }
+
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/preferences/OTGeneralPreferencePage.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/preferences/OTGeneralPreferencePage.java
new file mode 100644
index 000000000..3908971dc
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/preferences/OTGeneralPreferencePage.java
@@ -0,0 +1,99 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2003, 2008 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: OTGeneralPreferencePage.java 23435 2010-02-04 00:14:38Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.preferences;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferencePage;
+import org.eclipse.objectteams.otdt.ui.OTDTUIPlugin;
+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.Control;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+
+/**
+ * @author gis
+ */
+public class OTGeneralPreferencePage extends PreferencePage implements IWorkbenchPreferencePage
+{
+ private Button _callinMarkerButton;
+
+ public OTGeneralPreferencePage()
+ {
+ super(OTPreferencesMessages.preferences_general_title);
+ }
+
+ protected IPreferenceStore doGetPreferenceStore()
+ {
+ return OTDTUIPlugin.getDefault().getPreferenceStore();
+ }
+
+ protected Control createContents(Composite parent)
+ {
+ Composite result = new Composite(parent, SWT.NULL);
+ result.setLayout(new GridLayout(2, false));
+
+ _callinMarkerButton = new Button(result, SWT.CHECK);
+ _callinMarkerButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ _callinMarkerButton.setText(OTPreferencesMessages.preferences_general_callinmarker_label);
+
+ // km: (TPX-432) read and set values before any eventhandler is registered
+ initValues();
+
+ return result;
+ }
+
+ protected void initValues()
+ {
+ IPreferenceStore prefs = getPreferenceStore();
+ _callinMarkerButton.setSelection(prefs.getBoolean(GeneralPreferences.CALLIN_MARKER_ENABLED_BOOL));
+ }
+
+ protected void initDefaults()
+ {
+ IPreferenceStore prefs = getPreferenceStore();
+ _callinMarkerButton.setSelection(prefs.getDefaultBoolean(GeneralPreferences.CALLIN_MARKER_ENABLED_BOOL));
+ }
+
+ @Override
+ public boolean performOk()
+ {
+ IPreferenceStore prefs = getPreferenceStore();
+ prefs.setValue(GeneralPreferences.CALLIN_MARKER_ENABLED_BOOL, _callinMarkerButton.getSelection());
+ return true;
+ }
+
+ protected void performDefaults()
+ {
+ IPreferenceStore prefs = getPreferenceStore();
+ GeneralPreferences.initDefaults(prefs);
+ initDefaults();
+
+ super.performDefaults();
+ }
+
+ public void init(IWorkbench workbench) {
+ // nothing to do
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/preferences/OTPreferencesMessages.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/preferences/OTPreferencesMessages.java
new file mode 100644
index 000000000..3bed61277
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/preferences/OTPreferencesMessages.java
@@ -0,0 +1,78 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2005, 2009 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: OTPreferencesMessages.java 23435 2010-02-04 00:14:38Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.preferences;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * This class integrates OT-specific messages for the property/preference pages
+ * with those provided by the JDT (OT-specific messages have precedence).
+ *
+ * Created on Sep 11, 2005
+ *
+ * @author stephan
+ * @version $Id: OTPreferencesMessages.java 23435 2010-02-04 00:14:38Z stephan $
+ */
+public class OTPreferencesMessages {
+
+ private static final String BUNDLE_NAME= "org.eclipse.objectteams.otdt.internal.ui.preferences.OTPreferencesMessages";//$NON-NLS-1$
+
+
+ private OTPreferencesMessages() {
+ }
+
+ static {
+ NLS.initializeMessages(BUNDLE_NAME, OTPreferencesMessages.class);
+ }
+
+ public static String OTCompilerPreferencePageName;
+ public static String OTCompilerPropertyPageName;
+
+ public static String OTCompilerPreferencePage_title;
+
+ public static String OTCompilerConfiguration_common_description;
+ public static String OTCompilerProblemConfiguration_description;
+ public static String OTCompilerProblemConfiguration_otjld_ref_description;
+ public static String OTCompilerFeatureEnablement_description;
+
+ public static String OTCompilerConfigurationBlock_not_exactly_one_basecall_label;
+ public static String OTCompilerConfigurationBlock_unsafe_role_instantiation_label;
+ public static String OTCompilerConfigurationBlock_effectless_fieldaccess_label;
+ public static String OTCompilerConfigurationBlock_fragile_callin_label;
+ public static String OTCompilerConfigurationBlock_unused_parammap_label;
+ public static String OTCompilerConfigurationBlock_potential_ambiguous_playedby_label;
+ public static String OTCompilerConfigurationBlock_ambiguous_lowering_label;
+ public static String OTCompilerConfigurationBlock_abstract_potential_relevant_role_label;
+ public static String OTCompilerConfigurationBlock_decapsulation_label;
+ public static String OTCompilerConfigurationBlock_bindingconventions_label;
+ public static String OTCompilerConfigurationBlock_deprecated_path_syntax_label;
+ public static String OTCompilerConfigurationBlock_inferred_callout_label;
+ public static String OTCompilerConfigurationBlock_adapting_deprecated_label;
+ public static String OTCompilerConfigurationBlock_incomplete_build_label;
+ public static String OTCompilerConfigurationBlock_binding_to_system_class;
+ public static String OTCompilerConfigurationBlock_override_final_role;
+ public static String OTCompilerConfigurationBlock_exception_in_guard;
+ public static String OTCompilerConfigurationBlock_opt_scoped_keywords;
+
+ public static String preferences_general_title;
+ public static String preferences_general_callinmarker_label;
+ public static String preferences_general_debugfilters_label;
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/preferences/OTPreferencesMessages.properties b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/preferences/OTPreferencesMessages.properties
new file mode 100644
index 000000000..fdf21d141
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/preferences/OTPreferencesMessages.properties
@@ -0,0 +1,52 @@
+##########################################################################
+# This file is part of "Obect Teams Development Tooling"-Software.
+#-------------------------------------------------------------------------
+# Messages for configurable compiler options
+#
+# Author: Stephan Herrmann
+##########################################################################
+# the following two names resemble the original JDT-names in order to list
+# them next to each other:
+OTCompilerPreferencePageName=Compiler (OT/J)
+OTCompilerPropertyPageName=Java Compiler (OT/J)
+
+OTCompilerPreferencePage_title=OT/J Compiler
+
+OTCompilerConfiguration_common_description=Configurable options of the OT/J compiler
+
+OTCompilerProblemConfiguration_description=Select the severity level for the following problems:
+OTCompilerProblemConfiguration_otjld_ref_description=(numbers refer to paragraphs in the OTJLD)
+
+OTCompilerConfigurationBlock_not_exactly_one_basecall_label=Missing or multiple basecalls in callin method (\u00a74.3(b,c))
+OTCompilerConfigurationBlock_unsafe_role_instantiation_label=Unsafe role instantiation (\u00a72.4.1(c), \u00a72.4.3)
+
+OTCompilerConfigurationBlock_effectless_fieldaccess_label=Effectless callout to field (\u00a73.5(b))
+OTCompilerConfigurationBlock_fragile_callin_label=Fragile callin binding (\u00a74.3(e))
+OTCompilerConfigurationBlock_unused_parammap_label=Unused parameter mapping (\u00a73.2)
+
+OTCompilerConfigurationBlock_potential_ambiguous_playedby_label=Potentially ambiguous role-base binding (\u00a72.3.4(a))
+OTCompilerConfigurationBlock_ambiguous_lowering_label=Ambiguity between lowering and upcast (\u00a72.2(f))
+OTCompilerConfigurationBlock_abstract_potential_relevant_role_label=Abstract role is potentially relevant (\u00a72.5(b))
+
+OTCompilerConfigurationBlock_decapsulation_label=Decapsulation (overriding access restrictions) (\u00a7 3.4)
+
+OTCompilerConfigurationBlock_bindingconventions_label=Violations of binding conventions (\u00a7 2.1.2(d) et al)
+OTCompilerConfigurationBlock_deprecated_path_syntax_label=Using deprecated path syntax for externalized roles (\u00a7 1.2.2(b))
+
+OTCompilerConfigurationBlock_inferred_callout_label=Inferring callout bindings for inherited abstract methods (\u00a7 3.1(j))
+OTCompilerConfigurationBlock_adapting_deprecated_label=Adapting a deprecated type / method
+
+OTCompilerConfigurationBlock_incomplete_build_label=Report if incremental build generates incomplete code (requiring a full build).
+OTCompilerConfigurationBlock_binding_to_system_class=Report if trying to bind a role to a system class.
+OTCompilerConfigurationBlock_override_final_role=Report if overriding a final role (experimental feature).
+OTCompilerConfigurationBlock_exception_in_guard=Report if a guard throws a checked exception (\u00a7 5.4(c)).
+
+OTCompilerFeatureEnablement_description=Select which experimental features should be enabled:
+
+OTCompilerConfigurationBlock_opt_scoped_keywords=Allow scoped keywords (\u00a7A.0.1)
+
+preferences_general_title=Object Teams
+preferences_general_callinmarker_label=Show markers for playedBy, callin and callout bindings in the editor of each bound base class.
+preferences_general_debugfilters_label=Enable filtering of generated code when debugging
+
+
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/templates/ParameterMappingTemplateResolver.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/templates/ParameterMappingTemplateResolver.java
new file mode 100644
index 000000000..31042e220
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/templates/ParameterMappingTemplateResolver.java
@@ -0,0 +1,112 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2008 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: ParameterMappingTemplateResolver.java 23435 2010-02-04 00:14:38Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.templates;
+
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IMethod;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.internal.corext.template.java.JavaContext;
+import org.eclipse.jface.text.templates.TemplateContext;
+import org.eclipse.jface.text.templates.TemplateVariable;
+import org.eclipse.jface.text.templates.TemplateVariableResolver;
+import org.eclipse.objectteams.otdt.core.ICallinMapping;
+import org.eclipse.objectteams.otdt.core.ICalloutMapping;
+import org.eclipse.objectteams.otdt.core.IMethodMapping;
+import org.eclipse.objectteams.otdt.core.IOTJavaElement;
+import org.eclipse.objectteams.otdt.core.util.MethodData;
+
+/**
+ * This resolver proposes the parameter names to be used in a callin/callout parameter mapping
+ * created from a completion template.
+ *
+ * @author stephan
+ * @since 1.2.4
+ */
+public class ParameterMappingTemplateResolver extends TemplateVariableResolver {
+
+ // types of this resolver:
+ private static final String CALLIN_PARAMETER_NAME = "callin_parameter_name"; //$NON-NLS-1$
+ private static final String CALLOUT_PARAMETER_NAME = "callout_parameter_name"; //$NON-NLS-1$
+
+ private static final String VOID = "V";//$NON-NLS-1$
+
+ // special expansions:
+ private static final String RESULT = "result"; //$NON-NLS-1$
+ private static final String NOT_APPLICABLE = "$not applicable$"; //$NON-NLS-1$
+
+ @Override
+ public void resolve(TemplateVariable variable, TemplateContext context) {
+ if (context instanceof JavaContext) {
+ IMethodMapping methodMapping = findEnclosingMethodMapping((JavaContext)context);
+ if (methodMapping != null) {
+ variable.setValue(NOT_APPLICABLE);
+ String[] argumentNames = null;
+ if (!methodMapping.hasSignature()) {
+ return;
+ } else if (this.getType().equals(CALLIN_PARAMETER_NAME) && methodMapping.getElementType() == IOTJavaElement.CALLIN_MAPPING)
+ {
+ MethodData method = methodMapping.getRoleMethodHandle();
+ argumentNames = method.getArgumentNames();
+ } else if (this.getType().equals(CALLOUT_PARAMETER_NAME) && methodMapping.getElementType() == IOTJavaElement.CALLOUT_MAPPING)
+ {
+ MethodData method = ((ICalloutMapping) methodMapping).getBaseMethodHandle();
+ argumentNames = method.getArgumentNames();
+ } else {
+ if (isResultMappingSupported(methodMapping))
+ variable.setValue(RESULT);
+ else
+ variable.setResolved(false);
+ return;
+ }
+ if (argumentNames != null && argumentNames.length > 0)
+ variable.setValues(argumentNames);
+ else
+ variable.setResolved(false);
+ }
+ }
+ }
+
+
+ private IMethodMapping findEnclosingMethodMapping(JavaContext jContext) {
+ IJavaElement callinMapping = jContext.findEnclosingElement(IOTJavaElement.CALLIN_MAPPING);
+ if (callinMapping != null)
+ return (IMethodMapping) callinMapping;
+ return (IMethodMapping) jContext.findEnclosingElement(IOTJavaElement.CALLOUT_MAPPING);
+ }
+
+ /* Only propose a result mapping if a result value is actually expected. */
+ private boolean isResultMappingSupported(IMethodMapping element)
+ {
+ if (element.getElementType() == IOTJavaElement.CALLOUT_MAPPING)
+ return !element.getRoleMethodHandle().getReturnType().equals(VOID);
+
+ if (element.getElementType() == IOTJavaElement.CALLIN_MAPPING) {
+ if (((ICallinMapping) element).getCallinKind() != ICallinMapping.KIND_REPLACE)
+ return false;
+ try {
+ for (IMethod boundBaseMethod : ((ICallinMapping) element).getBoundBaseMethods())
+ if (boundBaseMethod.getReturnType().equals(VOID))
+ return false;
+ } catch (JavaModelException e) {
+ return false;
+ }
+ return true;
+ }
+ return false;
+ }
+
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/NewRoleCreationWizard.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/NewRoleCreationWizard.java
new file mode 100644
index 000000000..84ea62908
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/NewRoleCreationWizard.java
@@ -0,0 +1,107 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2003, 2009 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: NewRoleCreationWizard.java 23435 2010-02-04 00:14:38Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.wizards;
+
+import org.eclipse.jdt.internal.ui.JavaPlugin;
+import org.eclipse.objectteams.otdt.internal.ui.wizards.typecreation.RoleCreator;
+import org.eclipse.objectteams.otdt.internal.ui.wizards.typecreation.RoleTypeInfo;
+import org.eclipse.objectteams.otdt.internal.ui.wizards.typecreation.TypeCreator;
+import org.eclipse.objectteams.otdt.internal.ui.wizards.typecreation.TypeInfo;
+import org.eclipse.objectteams.otdt.ui.ImageConstants;
+import org.eclipse.objectteams.otdt.ui.OTDTUIPlugin;
+
+/**
+ * A wizard for creating a new role.
+ *
+ * @author brcan
+ * @version $Id: NewRoleCreationWizard.java 23435 2010-02-04 00:14:38Z stephan $
+ */
+public class NewRoleCreationWizard extends NewTypeCreationWizard
+{
+
+ private NewRoleWizardPage _rolePage;
+
+
+ public NewRoleCreationWizard()
+ {
+ super();
+
+ setDefaultPageImageDescriptor(
+ OTDTUIPlugin.getDefault().getImageRegistry().getDescriptor(
+ ImageConstants.NEW_ROLE));
+ setDialogSettings(JavaPlugin.getDefault().getDialogSettings());
+ setWindowTitle(OTNewWizardMessages.NewRoleCreationWizard_title);
+ }
+
+ /*
+ * @see Wizard#createPages
+ */
+ public void addPages()
+ {
+ super.addPages();
+ _rolePage = new NewRoleWizardPage();
+ addPage(_rolePage);
+ _rolePage.init(getSelection());
+ }
+
+ /**
+ * @return The page referenced by this wizard. This is an object of type
+ * org.eclipse.objectteams.otdt.internal.ui.wizards.NewRoleWizardPage
+ */
+ public NewTypeWizardPage getPage()
+ {
+ return _rolePage;
+ }
+
+ /**
+ * @return A new object of type org.eclipse.objectteams.otdt.internal.ui.wizards.typecreation.RoleCreator
+ */
+ protected TypeCreator createTypeCreator()
+ {
+ return new RoleCreator();
+ }
+
+ protected TypeInfo setTypeData(TypeCreator creator)
+ {
+ TypeInfo typeInfo = super.setTypeData(creator);
+
+ if ( (typeInfo instanceof RoleTypeInfo) && (getPage() instanceof NewRoleWizardPage) )
+ {
+ setRoleSpecificTypeData( (RoleTypeInfo)typeInfo, (NewRoleWizardPage)getPage() );
+ }
+ return typeInfo;
+ }
+
+ private void setRoleSpecificTypeData(RoleTypeInfo roleInfo, NewRoleWizardPage rolePage)
+ {
+ roleInfo.setBaseTypeName( rolePage.getBaseClassName() );
+ }
+
+ protected TypeInfo createTypeInfo()
+ {
+ NewTypeWizardPage page = getPage();
+
+ return new RoleTypeInfo(page.getTypeName(),
+ page.getPackageFragmentRoot(),
+ page.getPackageFragment());
+ }
+}
+
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/NewRoleWizardPage.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/NewRoleWizardPage.java
new file mode 100644
index 000000000..57db644fe
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/NewRoleWizardPage.java
@@ -0,0 +1,273 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2003, 2009 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: NewRoleWizardPage.java 23435 2010-02-04 00:14:38Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.wizards;
+
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.internal.corext.refactoring.StubTypeContext;
+import org.eclipse.jdt.internal.ui.dialogs.TextFieldNavigationHandler;
+import org.eclipse.jdt.internal.ui.refactoring.contentassist.CompletionContextRequestor;
+import org.eclipse.jdt.internal.ui.refactoring.contentassist.ControlContentAssistHelper;
+import org.eclipse.jdt.internal.ui.refactoring.contentassist.JavaTypeCompletionProcessor;
+import org.eclipse.jdt.internal.ui.wizards.NewWizardMessages;
+import org.eclipse.jdt.internal.ui.wizards.dialogfields.DialogField;
+import org.eclipse.jdt.internal.ui.wizards.dialogfields.LayoutUtil;
+import org.eclipse.jdt.internal.ui.wizards.dialogfields.SelectionButtonDialogFieldGroup;
+import org.eclipse.jdt.internal.ui.wizards.dialogfields.StringButtonDialogField;
+import org.eclipse.jdt.internal.ui.wizards.dialogfields.StringButtonStatusDialogField;
+import org.eclipse.jdt.internal.ui.wizards.dialogfields.StringDialogField;
+import org.eclipse.objectteams.otdt.internal.ui.wizards.listeners.NewRoleWizardPageListener;
+import org.eclipse.objectteams.otdt.internal.ui.wizards.listeners.NewTypeWizardPageListener;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Text;
+
+/**
+ * The class <code>NewRoleWizardPage</code> contains controls
+ * for a 'New Role WizardPage'.
+ *
+ * @author brcan
+ * @version $Id: NewRoleWizardPage.java 23435 2010-02-04 00:14:38Z stephan $
+ */
+public class NewRoleWizardPage extends NewTypeWizardPage
+{
+ private static final int CREATE_INHERITED_INDEX = 0;
+
+ private StringDialogField _implicitSuperclassDialogField;
+ private StringButtonDialogField _baseClassDialogField;
+
+
+ public NewRoleWizardPage()
+ {
+ super("NewRoleWizardPage"); //$NON-NLS-1$
+
+ setTitle(OTNewWizardMessages.NewRoleWizardPage_title);
+ setDescription(OTNewWizardMessages.NewRoleWizardPage_description);
+
+ _baseClassDialogField = createBaseClassDialogField(getListener());
+ _implicitSuperclassDialogField = createImplicitSuperclassDialogField();
+ }
+
+ /**
+ * @return the baseclass name
+ */
+ public String getBaseClassName()
+ {
+ return getBaseClassDialogField().getText();
+ }
+
+ public String getImplicitSuperclassName()
+ {
+ return getImplicitSuperclassDialogField().getText();
+ }
+
+ /**
+ * @param name the new baseclass name
+ */
+ public void setBaseClassName(String name)
+ {
+ getBaseClassDialogField().setText(name);
+ }
+
+ public void setImplicitSuperclassName(String name)
+ {
+ getImplicitSuperclassDialogField().setText(name);
+ }
+
+ /**
+ * @return false
+ * a role instance always depends on a team instance
+ * thats why having a main method makes no sense
+ */
+ public boolean isCreateMainSelected()
+ {
+ return false;
+ }
+
+ public boolean isCreateInheritedSelected()
+ {
+ return getMethodStubsButtons().getSelectionButton(CREATE_INHERITED_INDEX).getSelection();
+ }
+
+ /**
+ * @return false
+ * in the majority of cases roles don't have any constructor
+ */
+ public boolean isCreateConstructorsSelected()
+ {
+ return false;
+ }
+
+ public StringButtonDialogField getBaseClassDialogField()
+ {
+ return _baseClassDialogField;
+ }
+
+ public StringDialogField getImplicitSuperclassDialogField()
+ {
+ return _implicitSuperclassDialogField;
+ }
+
+ protected NewTypeWizardPageListener createPageListener()
+ {
+ return new NewRoleWizardPageListener(this);
+ }
+
+ protected StringButtonStatusDialogField createPackageDialogField(NewTypeWizardPageListener listener)
+ {
+ return null;
+ }
+
+ protected void createPackageControls(Composite composite, int nColumns)
+ {
+ //do nothing
+ }
+
+ protected SelectionButtonDialogFieldGroup createBindingEditorButtons()
+ {
+ //do nothing
+ return null;
+ }
+
+ protected StringButtonDialogField createSuperClassDialogField(NewTypeWizardPageListener adapter)
+ {
+ StringButtonDialogField result = super.createSuperClassDialogField(adapter);
+ result.setLabelText(OTNewWizardMessages.NewRoleWizardPage_superclass_explicit_label);
+
+ return result;
+ }
+
+ protected void createInheritanceControls(Composite composite, int nColumns)
+ {
+ createImplicitSuperclassControls(composite, nColumns);
+ super.createInheritanceControls(composite, nColumns);
+ createBaseClassControls(composite, nColumns);
+ }
+
+ protected SelectionButtonDialogFieldGroup createMethodStubsButtons()
+ {
+ String[] buttonName = new String[] { NewWizardMessages.NewClassWizardPage_methods_inherited };
+ SelectionButtonDialogFieldGroup result = new SelectionButtonDialogFieldGroup(SWT.CHECK, buttonName, 1);
+ result.setLabelText(NewWizardMessages.NewClassWizardPage_methods_label);
+
+ return result;
+ }
+
+ /**
+ * Creates the controls for the baseclass name field. Expects a <code>GridLayout</code>
+ * with at least 3 columns.
+ *
+ * @param composite the parent composite
+ * @param nColumns number of columns to span
+ */
+ protected void createBaseClassControls(Composite composite, int nColumns)
+ {
+ _baseClassDialogField.doFillIntoGrid(composite, nColumns);
+
+ Text text= _baseClassDialogField.getTextControl(null);
+ LayoutUtil.setWidthHint(text, getMaxFieldWidth());
+
+ JavaTypeCompletionProcessor baseClassCompletionProcessor= new JavaTypeCompletionProcessor(false, false);
+ baseClassCompletionProcessor.setCompletionContextRequestor(new CompletionContextRequestor() {
+ public StubTypeContext getStubTypeContext() {
+ return getSuperClassStubTypeContext();
+ }
+ });
+
+ ControlContentAssistHelper.createTextContentAssistant(text, baseClassCompletionProcessor);
+ TextFieldNavigationHandler.install(text);
+ }
+
+ protected void initTypePage(IJavaElement elem)
+ {
+ super.initTypePage(elem);
+ getEnclosingTypeSelectionField().setSelection(true);
+ getEnclosingTypeSelectionField().setEnabled(false);
+ setImplicitSuperclassName(""); //$NON-NLS-1$
+ setSuperTypeName("java.lang.Object"); //$NON-NLS-1$
+ getInlineSelectionDialogField().setSelection(true); // default to inline roles
+ getInlineSelectionDialogField().setEnabled(true);
+ }
+
+ protected void initAccessModifierButtons()
+ {
+ // Note(SH): we are still creating all selection buttons to stay consistent
+ // with other type creation wizards. (As long as the strange order
+ // "public, default, private, protected" is pertained, we even MUST create
+ // all four buttons, since we need the last one..).
+ getAccessModifierButtons().setSelection(PUBLIC_INDEX, false);
+ getAccessModifierButtons().enableSelectionButton(DEFAULT_INDEX, false);
+ getAccessModifierButtons().enableSelectionButton(PRIVATE_INDEX, false);
+ getAccessModifierButtons().setSelection(PROTECTED_INDEX, true);
+ }
+
+ protected void initMethodStubButtons()
+ {
+ getMethodStubsButtons().setSelection(CREATE_INHERITED_INDEX, true);
+ getMethodStubsButtons().setEnabled(true);
+ }
+
+ private StringButtonDialogField createBaseClassDialogField(NewTypeWizardPageListener listener)
+ {
+ StringButtonDialogField result = new StringButtonDialogField(listener);
+ result.setDialogFieldListener(listener);
+ result.setLabelText(OTNewWizardMessages.NewRoleWizardPage_baseclass_label);
+ result.setButtonLabel(OTNewWizardMessages.NewRoleWizardPage_baseclass_selection_button);
+
+ return result;
+ }
+
+ private StringDialogField createImplicitSuperclassDialogField()
+ {
+ StringDialogField result = new StringDialogField();
+ result.setLabelText(OTNewWizardMessages.NewRoleWizardPage_superclass_implicit_label);
+ result.setEnabled(false);
+
+ return result;
+ }
+
+ /**
+ * Creates the controls for the type name field. Expects a <code>GridLayout</code> with at
+ * least 2 columns.
+ *
+ * @param composite the parent composite
+ * @param nColumns number of columns to span
+ */
+ private void createImplicitSuperclassControls(Composite composite, int nColumns)
+ {
+ _implicitSuperclassDialogField.doFillIntoGrid(composite, nColumns - 1);
+ DialogField.createEmptySpace(composite);
+ LayoutUtil.setWidthHint(_implicitSuperclassDialogField.getTextControl(null), getMaxFieldWidth());
+ }
+
+ protected void initBindingEditorButtons()
+ {
+ }
+
+ public boolean isOpenBindingEditorSelected()
+ {
+ return false;
+ }
+
+ @Override
+ protected String getEnclosingTypeLabel() {
+ return OTNewWizardMessages.NewRoleWizardPage_enclosingtype_label;
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/NewTeamCreationWizard.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/NewTeamCreationWizard.java
new file mode 100644
index 000000000..984438b1d
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/NewTeamCreationWizard.java
@@ -0,0 +1,110 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2003, 2009 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: NewTeamCreationWizard.java 23435 2010-02-04 00:14:38Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.wizards;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.internal.ui.JavaPlugin;
+import org.eclipse.objectteams.otdt.internal.ui.bindingeditor.BindingEditorDialog;
+import org.eclipse.objectteams.otdt.internal.ui.wizards.typecreation.TeamCreator;
+import org.eclipse.objectteams.otdt.internal.ui.wizards.typecreation.TypeCreator;
+import org.eclipse.objectteams.otdt.ui.ImageManager;
+import org.eclipse.objectteams.otdt.ui.OTDTUIPlugin;
+import org.eclipse.swt.widgets.Display;
+
+
+/**
+ * A wizard for creating a new team.
+ *
+ * @author brcan
+ * @version $Id: NewTeamCreationWizard.java 23435 2010-02-04 00:14:38Z stephan $
+ */
+public class NewTeamCreationWizard extends NewTypeCreationWizard
+{
+
+ private NewTeamWizardPage _teamPage;
+
+
+ public NewTeamCreationWizard()
+ {
+ super();
+
+ setDefaultPageImageDescriptor(
+ OTDTUIPlugin.getDefault().getImageRegistry().getDescriptor(
+ ImageManager.NEW_TEAM));
+ setDialogSettings(JavaPlugin.getDefault().getDialogSettings());
+ setWindowTitle(OTNewWizardMessages.NewTeamCreationWizard_title);
+ }
+
+ /*
+ * @see Wizard#createPages
+ */
+ public void addPages()
+ {
+ super.addPages();
+ _teamPage = new NewTeamWizardPage();
+ addPage(_teamPage);
+ _teamPage.init(getSelection());
+ }
+
+ /**
+ * @return The page referenced by this wizard. This is an object of type
+ * org.eclipse.objectteams.otdt.internal.ui.wizards.NewTeamWizardPage
+ */
+ public NewTypeWizardPage getPage()
+ {
+ return _teamPage;
+ }
+
+
+ protected void finishPage(IProgressMonitor monitor)
+ throws InterruptedException, CoreException
+ {
+ super.finishPage(monitor);
+
+ if (getPage().isOpenBindingEditorSelected())
+ {
+ final IType createdTeam = getCreatedType();
+ if (createdTeam == null)
+ {
+ // something went wrong, bail out
+ return;
+ }
+
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ BindingEditorDialog dlg = new BindingEditorDialog(getShell(), createdTeam);
+ dlg.open();
+ }
+ });
+
+ }
+ }
+
+ /**
+ * @return A new object of type org.eclipse.objectteams.otdt.internal.ui.wizards.typecreation.TeamCreator
+ */
+ protected TypeCreator createTypeCreator()
+ {
+ return new TeamCreator();
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/NewTeamWizardPage.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/NewTeamWizardPage.java
new file mode 100644
index 000000000..47c51150c
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/NewTeamWizardPage.java
@@ -0,0 +1,156 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2003, 2009 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: NewTeamWizardPage.java 23435 2010-02-04 00:14:38Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.wizards;
+
+import org.eclipse.jdt.core.Flags;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.internal.ui.wizards.NewWizardMessages;
+import org.eclipse.jdt.internal.ui.wizards.dialogfields.SelectionButtonDialogFieldGroup;
+import org.eclipse.jdt.internal.ui.wizards.dialogfields.StringButtonDialogField;
+import org.eclipse.objectteams.otdt.internal.ui.wizards.listeners.NewTeamWizardPageListener;
+import org.eclipse.objectteams.otdt.internal.ui.wizards.listeners.NewTypeWizardPageListener;
+import org.eclipse.swt.SWT;
+
+/**
+ * The class <code>NewTeamWizardPage</code> contains controls
+ * for a 'New Team WizardPage'.
+ *
+ * @author brcan
+ * @version $Id: NewTeamWizardPage.java 23435 2010-02-04 00:14:38Z stephan $
+ */
+public class NewTeamWizardPage extends NewTypeWizardPage
+{
+ private static final int CREATE_MAIN_INDEX = 0;
+ private static final int CREATE_CONSTRUCTOR_INDEX = 1;
+ private static final int CREATE_INHERITED_INDEX = 2;
+ private static final int CREATE_BINDINGEDITOR_INDEX = 0;
+
+
+ public NewTeamWizardPage()
+ {
+ super("NewTeamWizardPage"); //$NON-NLS-1$
+
+ setTitle(OTNewWizardMessages.NewTeamWizardPage_title);
+ setDescription(OTNewWizardMessages.NewTeamWizardPage_description);
+ }
+
+ protected StringButtonDialogField createSuperClassDialogField(NewTypeWizardPageListener adapter)
+ {
+ StringButtonDialogField result = super.createSuperClassDialogField(adapter);
+ result.setLabelText(OTNewWizardMessages.NewTeamWizardPage_superclass_label);
+
+ return result;
+ }
+
+ protected SelectionButtonDialogFieldGroup createMethodStubsButtons()
+ {
+ String[] buttonNames3 = new String[]
+ {
+ NewWizardMessages.NewClassWizardPage_methods_main,
+ OTNewWizardMessages.NewTeamWizardPage_methods_constructors,
+ NewWizardMessages.NewClassWizardPage_methods_inherited
+ };
+
+ SelectionButtonDialogFieldGroup result = new SelectionButtonDialogFieldGroup(SWT.CHECK, buttonNames3, 1);
+ result.setLabelText(NewWizardMessages.NewClassWizardPage_methods_label);
+
+ return result;
+ }
+
+ protected SelectionButtonDialogFieldGroup createBindingEditorButtons()
+ {
+ String[] buttonNames1 = new String[]
+ {
+ OTNewWizardMessages.NewTeamWizardPage_BindingEditor_selection
+ };
+
+ SelectionButtonDialogFieldGroup result = new SelectionButtonDialogFieldGroup(SWT.CHECK, buttonNames1, 1);
+ result.setLabelText(OTNewWizardMessages.NewTeamWizardPage_BindingEditor_description);
+
+ return result;
+ }
+
+ protected void initTypePage(IJavaElement elem)
+ {
+ super.initTypePage(elem);
+ setSuperTypeName("org.objectteams.Team"); //$NON-NLS-1$
+ }
+
+ protected void initAccessModifierButtons()
+ {
+ getAccessModifierButtons().setSelection(PUBLIC_INDEX, true);
+ getAccessModifierButtons().enableSelectionButton(DEFAULT_INDEX, true);
+
+ getAccessModifierButtons().enableSelectionButton(PRIVATE_INDEX, false);
+ getAccessModifierButtons().enableSelectionButton(PROTECTED_INDEX, true);
+ }
+
+
+ /**
+ * Sets the selection state of the method stub checkboxes.
+ */
+ protected void initMethodStubButtons()
+ {
+ getMethodStubsButtons().setSelection(CREATE_MAIN_INDEX, false);
+ getMethodStubsButtons().setSelection(CREATE_CONSTRUCTOR_INDEX, false);
+ getMethodStubsButtons().setSelection(CREATE_INHERITED_INDEX, true);
+
+ getMethodStubsButtons().setEnabled(true);
+ }
+
+ public boolean isCreateMainSelected()
+ {
+ return getMethodStubsButtons().getSelectionButton(CREATE_MAIN_INDEX).getSelection();
+ }
+
+ public boolean isCreateInheritedSelected()
+ {
+ return getMethodStubsButtons().getSelectionButton(CREATE_INHERITED_INDEX).getSelection();
+ }
+
+ public boolean isCreateConstructorsSelected()
+ {
+ return getMethodStubsButtons().getSelectionButton(CREATE_CONSTRUCTOR_INDEX).getSelection();
+ }
+
+
+ protected void initBindingEditorButtons()
+ {
+ getBindingEditorButtons().setSelection(CREATE_BINDINGEDITOR_INDEX, false);
+
+ getBindingEditorButtons().setEnabled(false);
+ }
+
+ public boolean isOpenBindingEditorSelected()
+ {
+ return getBindingEditorButtons().getSelectionButton(CREATE_BINDINGEDITOR_INDEX).getSelection();
+ }
+
+ protected NewTypeWizardPageListener createPageListener()
+ {
+ return new NewTeamWizardPageListener(this);
+ }
+
+ @Override
+ public int getModifiers() {
+ return super.getModifiers() + Flags.AccTeam;
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/NewTypeCreationWizard.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/NewTypeCreationWizard.java
new file mode 100644
index 000000000..372997746
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/NewTypeCreationWizard.java
@@ -0,0 +1,148 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2003, 2009 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: NewTypeCreationWizard.java 23435 2010-02-04 00:14:38Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.wizards;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.internal.ui.wizards.NewElementWizard;
+import org.eclipse.objectteams.otdt.core.IOTType;
+import org.eclipse.objectteams.otdt.core.OTModelManager;
+import org.eclipse.objectteams.otdt.internal.ui.wizards.typecreation.TypeCreator;
+import org.eclipse.objectteams.otdt.internal.ui.wizards.typecreation.TypeInfo;
+
+
+/**
+ * @author kaschja
+ * @version $Id: NewTypeCreationWizard.java 23435 2010-02-04 00:14:38Z stephan $
+ */
+public abstract class NewTypeCreationWizard extends NewElementWizard
+{
+ private IType _createdType;
+
+
+ public NewTypeCreationWizard()
+ {
+ }
+
+
+ public boolean performFinish()
+ {
+ warnAboutTypeCommentDeprecation();
+ return super.performFinish();
+ }
+
+ // finishPage() is run as a WorkspaceRunnable. We need access to the SWT-thread though,
+ // so we need to stay in our thread.
+ protected boolean canRunForked()
+ {
+ return false;
+ }
+
+ protected void finishPage(IProgressMonitor monitor)
+ throws InterruptedException, CoreException
+ {
+ TypeCreator creator = createTypeCreator();
+ setTypeData(creator);
+
+ IType createdType = creator.createType(monitor);
+ ICompilationUnit createdCompUnit = createdType.getCompilationUnit();
+ ICompilationUnit cu = createdCompUnit == null ? null : createdCompUnit.getPrimary();
+
+
+ if (cu != null)
+ {
+ IResource resource = cu.getResource();
+ selectAndReveal(resource);
+ openResource((IFile) resource);
+
+ _createdType = cu.getType(createdType.getElementName());
+ }
+ }
+
+ public IType getCreatedType()
+ {
+ return _createdType;
+ }
+
+ /*
+ * Hook methods.
+ */
+ protected abstract NewTypeWizardPage getPage();
+ protected abstract TypeCreator createTypeCreator();
+
+ protected TypeInfo createTypeInfo()
+ {
+ NewTypeWizardPage page = getPage();
+
+ return new TypeInfo(page.getTypeName(),
+ page.getPackageFragmentRoot(),
+ page.getPackageFragment());
+ }
+
+
+ protected TypeInfo setTypeData(TypeCreator creator)
+ {
+ NewTypeWizardPage page = getPage();
+ TypeInfo typeInfo = createTypeInfo();
+
+ typeInfo.setEnclosingTypeName(page.getEnclosingTypeName());
+ typeInfo.setSuperClassName(page.getSuperTypeName());
+ typeInfo.setSuperInterfacesNames(page.getSuperInterfaces());
+ typeInfo.setModifier(page.getModifiers());
+ typeInfo.setCurrentType(page.getCurrentType());
+
+ if (page instanceof NewTeamWizardPage)
+ {
+ IType enclosingType = page.getEnclosingType();
+ if ( (enclosingType != null) && enclosingType.exists() )
+ {
+ IOTType enclosingOTType = OTModelManager.getOTElement(enclosingType);
+ if (enclosingOTType != null)
+ {
+ typeInfo.setIsRole(true);
+ }
+ }
+ }
+ else // if (page instanceof NewRoleWizardPage)
+ {
+ typeInfo.setIsRole(true);
+ }
+
+ typeInfo.setInline(page.isInlineTypeSelected());
+
+ typeInfo.setCreateMainMethod(page.isCreateMainSelected());
+ typeInfo.setCreateConstructor(page.isCreateConstructorsSelected());
+ typeInfo.setCreateAbstractInheritedMethods(page.isCreateInheritedSelected());
+
+ creator.setTypeInfo(typeInfo);
+ return typeInfo;
+ }
+
+ public IJavaElement getCreatedElement() {
+ return _createdType;
+ }
+
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/NewTypeWizardPage.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/NewTypeWizardPage.java
new file mode 100644
index 000000000..447fb636d
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/NewTypeWizardPage.java
@@ -0,0 +1,1418 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2008 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: NewTypeWizardPage.java 23435 2010-02-04 00:14:38Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.wizards;
+
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.filesystem.EFS;
+import org.eclipse.core.filesystem.IFileStore;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jdt.core.Flags;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IPackageFragment;
+import org.eclipse.jdt.core.IPackageFragmentRoot;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaConventions;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.core.compiler.IProblem;
+import org.eclipse.jdt.core.dom.AST;
+import org.eclipse.jdt.core.dom.ASTParser;
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jdt.core.dom.ParameterizedType;
+import org.eclipse.jdt.core.dom.Type;
+import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
+import org.eclipse.jdt.internal.corext.codemanipulation.StubUtility;
+import org.eclipse.jdt.internal.corext.refactoring.StubTypeContext;
+import org.eclipse.jdt.internal.corext.refactoring.TypeContextChecker;
+import org.eclipse.jdt.internal.corext.util.JavaModelUtil;
+import org.eclipse.jdt.internal.corext.util.Messages;
+import org.eclipse.jdt.internal.corext.util.Resources;
+import org.eclipse.jdt.internal.ui.JavaPluginImages;
+import org.eclipse.jdt.internal.ui.dialogs.StatusInfo;
+import org.eclipse.jdt.internal.ui.dialogs.StatusUtil;
+import org.eclipse.jdt.internal.ui.dialogs.TableTextCellEditor;
+import org.eclipse.jdt.internal.ui.dialogs.TextFieldNavigationHandler;
+import org.eclipse.jdt.internal.ui.refactoring.contentassist.CompletionContextRequestor;
+import org.eclipse.jdt.internal.ui.refactoring.contentassist.ControlContentAssistHelper;
+import org.eclipse.jdt.internal.ui.refactoring.contentassist.JavaPackageCompletionProcessor;
+import org.eclipse.jdt.internal.ui.refactoring.contentassist.JavaTypeCompletionProcessor;
+import org.eclipse.jdt.internal.ui.util.SWTUtil;
+import org.eclipse.jdt.internal.ui.wizards.NewWizardMessages;
+import org.eclipse.jdt.internal.ui.wizards.dialogfields.DialogField;
+import org.eclipse.jdt.internal.ui.wizards.dialogfields.IDialogFieldListener;
+import org.eclipse.jdt.internal.ui.wizards.dialogfields.IListAdapter;
+import org.eclipse.jdt.internal.ui.wizards.dialogfields.LayoutUtil;
+import org.eclipse.jdt.internal.ui.wizards.dialogfields.ListDialogField;
+import org.eclipse.jdt.internal.ui.wizards.dialogfields.SelectionButtonDialogField;
+import org.eclipse.jdt.internal.ui.wizards.dialogfields.SelectionButtonDialogFieldGroup;
+import org.eclipse.jdt.internal.ui.wizards.dialogfields.StringButtonDialogField;
+import org.eclipse.jdt.internal.ui.wizards.dialogfields.StringButtonStatusDialogField;
+import org.eclipse.jdt.internal.ui.wizards.dialogfields.StringDialogField;
+import org.eclipse.jdt.ui.wizards.NewContainerWizardPage;
+import org.eclipse.jface.contentassist.SubjectControlContentAssistant;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.viewers.CellEditor;
+import org.eclipse.jface.viewers.ICellModifier;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.objectteams.otdt.core.IOTType;
+import org.eclipse.objectteams.otdt.core.OTModelManager;
+import org.eclipse.objectteams.otdt.internal.ui.wizards.listeners.NewTypeWizardPageListener;
+import org.eclipse.objectteams.otdt.ui.OTDTUIPlugin;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.accessibility.AccessibleAdapter;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.eclipse.swt.events.KeyAdapter;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.graphics.Image;
+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.Item;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.contentassist.ContentAssistHandler;
+
+/**
+ * The class <code>NewTypeWizardPage</code> contains controls for a
+ * 'New ObjectTeams-Type WizardPage'. It is intended to serve as base class of
+ * team and role creation wizards.
+ *
+ * @see org.eclipse.objectteams.otdt.internal.ui.wizards.NewTeamWizardPage
+ * @see org.eclipse.objectteams.otdt.internal.ui.wizards.NewRoleWizardPage
+ *
+ * @author kaschja
+ * @version $Id: NewTypeWizardPage.java 23435 2010-02-04 00:14:38Z stephan $
+ */
+public abstract class NewTypeWizardPage extends org.eclipse.jdt.ui.wizards.NewTypeWizardPage
+{
+ public static final int PUBLIC_INDEX = 0;
+ public static final int DEFAULT_INDEX = 1;
+ public static final int PRIVATE_INDEX = 2;
+ public static final int PROTECTED_INDEX = 3;
+
+ public static final int ABSTRACT_INDEX = 0;
+ public static final int FINAL_INDEX = 1;
+ public static final int STATIC_INDEX = 2;
+
+ private StringButtonStatusDialogField _packageDialogField;
+
+ private SelectionButtonDialogField _enclosingTypeSelection;
+ private StringButtonDialogField _enclosingTypeDialogField;
+
+ private SelectionButtonDialogFieldGroup _accessModifierButtons;
+ private SelectionButtonDialogFieldGroup _otherModifierButtons;
+ private StringButtonDialogField _superTypeDialogField;
+ private StringDialogField _typeNameDialogField;
+ private ListDialogField _superInterfacesDialogField;
+ private SelectionButtonDialogFieldGroup _methodStubsButtons;
+ private SelectionButtonDialogFieldGroup _bindingEditorButtons;
+ private SelectionButtonDialogField _inlineSelectionDialogField;
+
+ private JavaPackageCompletionProcessor _currPackageCompletionProcessor;
+ private JavaTypeCompletionProcessor _enclosingTypeCompletionProcessor;
+
+ private NewTypeWizardPageListener _listener;
+
+ private IPackageFragment _currentPackage;
+ private IType _enclosingType;
+ private IType _superType;
+ private IType _currentType;
+
+ private boolean _canModifyPackage;
+ private boolean _canModifyEnclosingType;
+
+ private StubTypeContext _superClassStubTypeContext;
+ private StubTypeContext _superInterfaceStubTypeContext;
+
+// ------------------------------------------------------------------------------
+// start of innerclass definitions
+//------------------------------------------------------------------------------
+
+ public static class InterfaceWrapper {
+ public String interfaceName;
+
+ public InterfaceWrapper(String interfaceName) {
+ this.interfaceName= interfaceName;
+ }
+
+ public int hashCode() {
+ return interfaceName.hashCode();
+ }
+
+ public boolean equals(Object obj) {
+ return obj != null && getClass().equals(obj.getClass()) && ((InterfaceWrapper) obj).interfaceName.equals(interfaceName);
+ }
+ }
+
+
+ private static class InterfacesListLabelProvider extends LabelProvider {
+ private Image fInterfaceImage;
+
+ public InterfacesListLabelProvider() {
+ fInterfaceImage= JavaPluginImages.get(JavaPluginImages.IMG_OBJS_INTERFACE);
+ }
+
+ public String getText(Object element) {
+ return ((InterfaceWrapper) element).interfaceName;
+ }
+
+ public Image getImage(Object element) {
+ return fInterfaceImage;
+ }
+ }
+
+ public NewTypeWizardPage(String pageName)
+ {
+ super(CLASS_TYPE, pageName);
+
+ _listener = createPageListener();
+
+ _packageDialogField = createPackageDialogField(_listener);
+
+ _enclosingTypeSelection= new SelectionButtonDialogField(SWT.CHECK);
+ _enclosingTypeSelection.setDialogFieldListener(_listener);
+ _enclosingTypeSelection.setLabelText(getEnclosingTypeLabel());
+
+ _enclosingTypeDialogField = createEnclosingTypeDialogField(_listener);
+
+ _typeNameDialogField = createTypeNameDialogField(_listener);
+ _superTypeDialogField = createSuperClassDialogField(_listener);
+ _superInterfacesDialogField = createSuperInterfacesDialogField(_listener,_listener);
+ _accessModifierButtons = createAccessModifierButtons(_listener);
+ _otherModifierButtons = createOtherModifierButtons(_listener);
+ _methodStubsButtons = createMethodStubsButtons();
+ _bindingEditorButtons = createBindingEditorButtons();
+ _inlineSelectionDialogField = createInlineSelectionDialogField(_listener);
+
+ _currPackageCompletionProcessor= new JavaPackageCompletionProcessor();
+ _enclosingTypeCompletionProcessor= new JavaTypeCompletionProcessor(false, false);
+
+ _canModifyPackage = true;
+ _canModifyEnclosingType = true;
+ updateEnableState();
+
+ }
+
+ protected abstract NewTypeWizardPageListener createPageListener();
+
+//------------------------------------------------------------------------------
+//creation of page elements (dialog fields, selection buttons, ...)
+//------------------------------------------------------------------------------
+
+ protected SelectionButtonDialogFieldGroup createOtherModifierButtons(NewTypeWizardPageListener listener)
+ {
+ SelectionButtonDialogFieldGroup result;
+ String[] buttonNames = new String[]
+ {
+ /* 0 == ABSTRACT_INDEX */ NewWizardMessages.NewTypeWizardPage_modifiers_abstract,
+ /* 1 == FINAL_INDEX */ NewWizardMessages.NewTypeWizardPage_modifiers_final,
+ /* 2 == STATIC_INDEX*/ NewWizardMessages.NewTypeWizardPage_modifiers_static
+ };
+
+ result = new SelectionButtonDialogFieldGroup(SWT.CHECK, buttonNames, 4);
+ result.setDialogFieldListener(listener);
+
+ return result;
+ }
+
+ protected SelectionButtonDialogFieldGroup createAccessModifierButtons(NewTypeWizardPageListener listener)
+ {
+ String[] buttonNames = new String[]
+ {
+ /* 0 == PUBLIC_INDEX */ NewWizardMessages.NewTypeWizardPage_modifiers_public,
+ /* 1 == DEFAULT_INDEX */ NewWizardMessages.NewTypeWizardPage_modifiers_default,
+ /* 2 == PRIVATE_INDEX */ NewWizardMessages.NewTypeWizardPage_modifiers_private,
+ /* 3 == PROTECTED_INDEX*/ NewWizardMessages.NewTypeWizardPage_modifiers_protected
+ };
+ SelectionButtonDialogFieldGroup result = new SelectionButtonDialogFieldGroup(SWT.RADIO, buttonNames, 4);
+ result.setDialogFieldListener(listener);
+ result.setLabelText(NewWizardMessages.NewTypeWizardPage_modifiers_acc_label);
+ result.setSelection(0, true);
+
+ return result;
+ }
+
+ protected ListDialogField createSuperInterfacesDialogField(IListAdapter listlistener,
+ IDialogFieldListener fieldlistener)
+ {
+ ListDialogField result = null;
+
+ String[] buttonNames = new String[]
+ {
+ /* 0 */ NewWizardMessages.NewTypeWizardPage_interfaces_add,
+ /* 1 */ null,
+ /* 2 */ NewWizardMessages.NewTypeWizardPage_interfaces_remove
+ };
+
+ result = new ListDialogField(listlistener, buttonNames, new InterfacesListLabelProvider());
+ result.setDialogFieldListener(fieldlistener);
+
+ String interfaceLabel = NewWizardMessages.NewTypeWizardPage_interfaces_class_label;
+
+ result.setLabelText(interfaceLabel);
+ result.setRemoveButtonIndex(2);
+
+ return result;
+ }
+
+ protected StringButtonDialogField createSuperClassDialogField(NewTypeWizardPageListener listener)
+ {
+ StringButtonDialogField result = new StringButtonDialogField(listener);
+ result.setDialogFieldListener(listener);
+ result.setLabelText(NewWizardMessages.NewTypeWizardPage_superclass_label);
+ result.setButtonLabel(NewWizardMessages.NewTypeWizardPage_superclass_button);
+
+ return result;
+ }
+
+ protected StringDialogField createTypeNameDialogField(NewTypeWizardPageListener listener)
+ {
+ StringDialogField result = new StringDialogField();
+ result.setDialogFieldListener(listener);
+ result.setLabelText(NewWizardMessages.NewTypeWizardPage_typename_label);
+
+ return result;
+ }
+
+ protected StringButtonDialogField createEnclosingTypeDialogField(NewTypeWizardPageListener listener)
+ {
+ StringButtonDialogField result = new StringButtonDialogField(listener);
+ result.setDialogFieldListener(listener);
+ result.setButtonLabel(NewWizardMessages.NewTypeWizardPage_enclosing_button);
+
+ return result;
+
+ }
+
+ protected StringButtonStatusDialogField createPackageDialogField(NewTypeWizardPageListener listener)
+ {
+ StringButtonStatusDialogField result = new StringButtonStatusDialogField(listener);
+ result.setDialogFieldListener(listener);
+ result.setLabelText(NewWizardMessages.NewTypeWizardPage_package_label);
+ result.setButtonLabel(NewWizardMessages.NewTypeWizardPage_package_button);
+ result.setStatusWidthHint(NewWizardMessages.NewTypeWizardPage_default);
+
+ return result;
+ }
+
+ protected SelectionButtonDialogField createInlineSelectionDialogField(NewTypeWizardPageListener listener)
+ {
+ SelectionButtonDialogField result = new SelectionButtonDialogField(SWT.CHECK);
+ result.setDialogFieldListener(listener);
+ result.setLabelText(OTNewWizardMessages.NewRoleWizardPage_inlined_checkbox_label);
+
+ return result;
+ }
+
+ protected abstract SelectionButtonDialogFieldGroup createMethodStubsButtons();
+
+ protected abstract SelectionButtonDialogFieldGroup createBindingEditorButtons();
+
+//------------------------------------------------------------------------------
+// creation of controls - visual arrangement of page elements
+//------------------------------------------------------------------------------
+
+ public void createControl(Composite parent)
+ {
+ initializeDialogUnits(parent);
+
+ Composite composite= new Composite(parent, SWT.NONE);
+
+ int nColumns= 4;
+
+ GridLayout layout= new GridLayout();
+ layout.numColumns= nColumns;
+ composite.setLayout(layout);
+
+ createContainerControls(composite, nColumns);
+ createPackageControls(composite, nColumns);
+ createEnclosingTypeControls(composite, nColumns);
+ createInlineSelectionControls(composite, nColumns);
+ createSeparator(composite, nColumns);
+ createTypeNameControls(composite, nColumns);
+ createModifierControls(composite, nColumns);
+ createInheritanceControls(composite,nColumns);
+ createSuperInterfacesControls(composite, nColumns);
+ createMethodStubSelectionControls(composite, nColumns);
+ createBindingEditorControls(composite, nColumns);
+ createCommentControls(composite, nColumns);
+ setAddComments(StubUtility.doAddComments(getJavaProject()), true);
+ enableCommentControl(true);
+
+ setControl(composite);
+ Dialog.applyDialogFont(composite);
+ }
+
+ protected void createInheritanceControls(Composite composite, int nColumns)
+ {
+ createSuperTypeControls(composite,nColumns);
+ }
+
+ protected void createInlineSelectionControls(Composite composite, int nColumns)
+ {
+ DialogField.createEmptySpace(composite);
+ _inlineSelectionDialogField.doFillIntoGrid(composite, nColumns-1);
+ }
+
+ /**
+ * Creates the controls for the package name field. Expects a <code>GridLayout</code> with at
+ * least 4 columns.
+ *
+ * @param composite the parent composite
+ * @param nColumns number of columns to span
+ */
+ protected void createPackageControls(Composite composite, int nColumns)
+ {
+ _packageDialogField.doFillIntoGrid(composite, nColumns);
+ Text text= _packageDialogField.getTextControl(null);
+ LayoutUtil.setWidthHint(text, getMaxFieldWidth());
+ LayoutUtil.setHorizontalGrabbing(text);
+
+ ControlContentAssistHelper.createTextContentAssistant(text, _currPackageCompletionProcessor);
+ TextFieldNavigationHandler.install(text);
+ }
+
+ /**
+ * Creates the controls for the enclosing type name field. Expects a <code>GridLayout</code> with at
+ * least 4 columns.
+ *
+ * @param composite the parent composite
+ * @param nColumns number of columns to span
+ */
+ protected void createEnclosingTypeControls(Composite composite, int nColumns)
+ {
+ // #6891
+ Composite tabGroup= new Composite(composite, SWT.NONE);
+ GridLayout layout= new GridLayout();
+ layout.marginWidth= 0;
+ layout.marginHeight= 0;
+ tabGroup.setLayout(layout);
+
+ _enclosingTypeSelection.doFillIntoGrid(tabGroup, 1);
+
+ Text text= _enclosingTypeDialogField.getTextControl(composite);
+ text.getAccessible().addAccessibleListener(new AccessibleAdapter() {
+ public void getName(AccessibleEvent e) {
+ e.result= NewWizardMessages.NewTypeWizardPage_enclosing_field_description;
+ }
+ });
+ GridData gd= new GridData(GridData.FILL_HORIZONTAL);
+ gd.widthHint= getMaxFieldWidth();
+ gd.horizontalSpan= 2;
+ text.setLayoutData(gd);
+
+ Button button= _enclosingTypeDialogField.getChangeControl(composite);
+ gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL);
+ gd.widthHint = SWTUtil.getButtonWidthHint(button);
+ button.setLayoutData(gd);
+ ControlContentAssistHelper.createTextContentAssistant(text, _enclosingTypeCompletionProcessor);
+ TextFieldNavigationHandler.install(text);
+ }
+
+ /**
+ * Creates the controls for the type name field. Expects a <code>GridLayout</code> with at
+ * least 2 columns.
+ *
+ * @param composite the parent composite
+ * @param nColumns number of columns to span
+ */
+ protected void createTypeNameControls(Composite composite, int nColumns)
+ {
+ _typeNameDialogField.doFillIntoGrid(composite, nColumns - 1);
+ DialogField.createEmptySpace(composite);
+
+ LayoutUtil.setWidthHint(_typeNameDialogField.getTextControl(null), getMaxFieldWidth());
+ }
+
+ /**
+ * Creates the controls for the modifiers radio/ceckbox buttons. Expects a
+ * <code>GridLayout</code> with at least 3 columns.
+ *
+ * @param composite the parent composite
+ * @param nColumns number of columns to span
+ */
+ protected void createModifierControls(Composite composite, int nColumns)
+ {
+ LayoutUtil.setHorizontalSpan(_accessModifierButtons.getLabelControl(composite), 1);
+
+ Control control= _accessModifierButtons.getSelectionButtonsGroup(composite);
+ GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL);
+ gd.horizontalSpan= nColumns - 2;
+ control.setLayoutData(gd);
+
+ DialogField.createEmptySpace(composite);
+
+ DialogField.createEmptySpace(composite);
+
+ control= _otherModifierButtons.getSelectionButtonsGroup(composite);
+ gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL);
+ gd.horizontalSpan= nColumns - 2;
+ control.setLayoutData(gd);
+
+ DialogField.createEmptySpace(composite);
+ }
+
+ /**
+ * Creates the controls for the superclass name field. Expects a <code>GridLayout</code>
+ * with at least 3 columns.
+ *
+ * @param composite the parent composite
+ * @param nColumns number of columns to span
+ */
+ protected void createSuperTypeControls(Composite composite, int nColumns)
+ {
+ _superTypeDialogField.doFillIntoGrid(composite, nColumns);
+ Text text= _superTypeDialogField.getTextControl(null);
+ LayoutUtil.setWidthHint(text, getMaxFieldWidth());
+
+ JavaTypeCompletionProcessor superClassCompletionProcessor= new JavaTypeCompletionProcessor(false, false);
+ superClassCompletionProcessor.setCompletionContextRequestor(new CompletionContextRequestor() {
+ public StubTypeContext getStubTypeContext() {
+ return getSuperClassStubTypeContext();
+ }
+ });
+
+ ControlContentAssistHelper.createTextContentAssistant(text, superClassCompletionProcessor);
+ TextFieldNavigationHandler.install(text);
+ }
+
+ StubTypeContext getSuperClassStubTypeContext() {
+ if (_superClassStubTypeContext == null) {
+ String typeName;
+ if (_currentType != null) {
+ typeName= getTypeName();
+ } else {
+ typeName= JavaTypeCompletionProcessor.DUMMY_CLASS_NAME;
+ }
+ _superClassStubTypeContext = TypeContextChecker.createSuperClassStubTypeContext(typeName, getEnclosingType(), getPackageFragment());
+ }
+ return _superClassStubTypeContext;
+ }
+
+ /**
+ * Hook method that gets called when the type name has changed. The method validates the
+ * type name and returns the status of the validation.
+ * <p>
+ * Subclasses may extend this method to perform their own validation.
+ * </p>
+ *
+ * @return the status of the validation
+ */
+ protected IStatus typeNameChanged() {
+ super.typeNameChanged();
+
+ StatusInfo status= new StatusInfo();
+ _currentType= null;
+ String typeNameWithParameters= getTypeName();
+ // must not be empty
+ if (typeNameWithParameters.length() == 0) {
+ status.setError(NewWizardMessages.NewTypeWizardPage_error_EnterTypeName);
+ return status;
+ }
+
+ String typeName= getTypeNameWithoutParameters();
+ if (typeName.indexOf('.') != -1) {
+ status.setError(NewWizardMessages.NewTypeWizardPage_error_QualifiedName);
+ return status;
+ }
+ IStatus val= validateJavaTypeName(typeName, getJavaProject());
+ if (val.getSeverity() == IStatus.ERROR) {
+ status.setError(Messages.format(NewWizardMessages.NewTypeWizardPage_error_InvalidTypeName, val.getMessage()));
+ return status;
+ } else if (val.getSeverity() == IStatus.WARNING) {
+ status.setWarning(Messages.format(NewWizardMessages.NewTypeWizardPage_warning_TypeNameDiscouraged, val.getMessage()));
+ // continue checking
+ }
+
+ // must not exist
+ if (!isEnclosingTypeSelected()) {
+ IPackageFragment pack= getPackageFragment();
+ if (pack != null) {
+ ICompilationUnit cu= pack.getCompilationUnit(getCompilationUnitName(typeName));
+ _currentType= cu.getType(typeName);
+ IResource resource= cu.getResource();
+
+ if (resource.exists()) {
+ status.setError(NewWizardMessages.NewTypeWizardPage_error_TypeNameExists);
+ return status;
+ }
+ URI location= resource.getLocationURI();
+ if (location != null) {
+ try {
+ IFileStore store= EFS.getStore(location);
+ if (store.fetchInfo().exists()) {
+ status.setError(NewWizardMessages.NewTypeWizardPage_error_TypeNameExistsDifferentCase);
+ return status;
+ }
+ } catch (CoreException e) {
+ status.setError(Messages.format(
+ NewWizardMessages.NewTypeWizardPage_error_uri_location_unkown,
+ Resources.getLocationString(resource)));
+ }
+ }
+ }
+ } else {
+ IType type= getEnclosingType();
+ if (type != null) {
+ _currentType= type.getType(typeName);
+ if (_currentType.exists()) {
+ status.setError(NewWizardMessages.NewTypeWizardPage_error_TypeNameExists);
+ return status;
+ }
+ }
+ }
+
+ if (typeNameWithParameters != typeName) {
+ IPackageFragmentRoot root= getPackageFragmentRoot();
+ if (root != null) {
+ if (!JavaModelUtil.is50OrHigher(root.getJavaProject())) {
+ status.setError(NewWizardMessages.NewTypeWizardPage_error_TypeParameters);
+ return status;
+ }
+ String typeDeclaration= "class " + typeNameWithParameters + " {}"; //$NON-NLS-1$//$NON-NLS-2$
+ ASTParser parser= ASTParser.newParser(AST.JLS3);
+ parser.setSource(typeDeclaration.toCharArray());
+ parser.setProject(root.getJavaProject());
+ CompilationUnit compilationUnit= (CompilationUnit) parser.createAST(null);
+ IProblem[] problems= compilationUnit.getProblems();
+ if (problems.length > 0) {
+ status.setError(Messages.format(NewWizardMessages.NewTypeWizardPage_error_InvalidTypeName, problems[0].getMessage()));
+ return status;
+ }
+ }
+ }
+ return status;
+ }
+
+ private String getTypeNameWithoutParameters() {
+ String typeNameWithParameters= getTypeName();
+ int angleBracketOffset= typeNameWithParameters.indexOf('<');
+ if (angleBracketOffset == -1) {
+ return typeNameWithParameters;
+ } else {
+ return typeNameWithParameters.substring(0, angleBracketOffset);
+ }
+ }
+
+
+ /**
+ * Creates the controls for the superclass name field. Expects a <code>GridLayout</code> with
+ * at least 3 columns.
+ *
+ * @param composite the parent composite
+ * @param nColumns number of columns to span
+ */
+// protected void createSuperInterfacesControls(Composite composite, int nColumns)
+// {
+// _superInterfacesDialogField.doFillIntoGrid(composite, nColumns);
+// GridData gd = (GridData)_superInterfacesDialogField.getListControl(null).getLayoutData();
+// gd.heightHint = convertHeightInCharsToPixels(3);
+// gd.grabExcessVerticalSpace = false;
+// gd.widthHint = getMaxFieldWidth();
+// }
+
+ /**
+ * Creates the controls for the superclass name field. Expects a <code>GridLayout</code> with
+ * at least 3 columns.
+ *
+ * @param composite the parent composite
+ * @param nColumns number of columns to span
+ */
+ protected void createSuperInterfacesControls(Composite composite, int nColumns) {
+ final String INTERFACE= "interface"; //$NON-NLS-1$
+ _superInterfacesDialogField.doFillIntoGrid(composite, nColumns);
+ final TableViewer tableViewer= _superInterfacesDialogField.getTableViewer();
+ tableViewer.setColumnProperties(new String[] {INTERFACE});
+
+ TableTextCellEditor cellEditor= new TableTextCellEditor(tableViewer, 0) {
+ protected void doSetFocus() {
+ if (text != null) {
+ text.setFocus();
+ text.setSelection(text.getText().length());
+ checkSelection();
+ checkDeleteable();
+ checkSelectable();
+ }
+ }
+ };
+ JavaTypeCompletionProcessor superInterfaceCompletionProcessor= new JavaTypeCompletionProcessor(false, false);
+ superInterfaceCompletionProcessor.setCompletionContextRequestor(new CompletionContextRequestor() {
+ public StubTypeContext getStubTypeContext() {
+ return getSuperInterfacesStubTypeContext();
+ }
+ });
+ SubjectControlContentAssistant contentAssistant= ControlContentAssistHelper.createJavaContentAssistant(superInterfaceCompletionProcessor);
+ Text cellEditorText= cellEditor.getText();
+ ContentAssistHandler.createHandlerForText(cellEditorText, contentAssistant);
+ TextFieldNavigationHandler.install(cellEditorText);
+ cellEditor.setContentAssistant(contentAssistant);
+
+ tableViewer.setCellEditors(new CellEditor[] { cellEditor });
+ tableViewer.setCellModifier(new ICellModifier() {
+ public void modify(Object element, String property, Object value) {
+ if (element instanceof Item)
+ element = ((Item) element).getData();
+
+ ((InterfaceWrapper) element).interfaceName= (String) value;
+ _superInterfacesDialogField.elementChanged(element);
+ }
+ public Object getValue(Object element, String property) {
+ return ((InterfaceWrapper) element).interfaceName;
+ }
+ public boolean canModify(Object element, String property) {
+ return true;
+ }
+ });
+ tableViewer.getTable().addKeyListener(new KeyAdapter() {
+ public void keyPressed(KeyEvent event) {
+ if (event.keyCode == SWT.F2 && event.stateMask == 0) {
+ ISelection selection= tableViewer.getSelection();
+ if (! (selection instanceof IStructuredSelection))
+ return;
+ IStructuredSelection structuredSelection= (IStructuredSelection) selection;
+ tableViewer.editElement(structuredSelection.getFirstElement(), 0);
+ }
+ }
+ });
+ GridData gd= (GridData) _superInterfacesDialogField.getListControl(null).getLayoutData();
+
+ gd.heightHint= convertHeightInCharsToPixels(3);
+
+ gd.grabExcessVerticalSpace= false;
+ gd.widthHint= getMaxFieldWidth();
+ }
+
+ private StubTypeContext getSuperInterfacesStubTypeContext() {
+ if (_superInterfaceStubTypeContext == null) {
+ String typeName;
+ if (_currentType != null) {
+ typeName= getTypeName();
+ } else {
+ typeName= JavaTypeCompletionProcessor.DUMMY_CLASS_NAME;
+ }
+ _superInterfaceStubTypeContext= TypeContextChecker.createSuperInterfaceStubTypeContext(typeName, getEnclosingType(), getPackageFragment());
+ }
+ return _superInterfaceStubTypeContext;
+ }
+
+ protected void createMethodStubSelectionControls(Composite composite, int nColumns)
+ {
+ Control labelControl = _methodStubsButtons.getLabelControl(composite);
+ LayoutUtil.setHorizontalSpan(labelControl, nColumns);
+
+ DialogField.createEmptySpace(composite);
+
+ Control buttonGroup = _methodStubsButtons.getSelectionButtonsGroup(composite);
+ LayoutUtil.setHorizontalSpan(buttonGroup, nColumns - 1);
+ }
+
+ protected void createBindingEditorControls(Composite composite, int nColumns)
+ {
+ if (_bindingEditorButtons != null)
+ {
+ DialogField.createEmptySpace(composite);
+ Control labelControl = _bindingEditorButtons.getLabelControl(composite);
+ LayoutUtil.setHorizontalSpan(labelControl, nColumns);
+
+ DialogField.createEmptySpace(composite);
+
+ Control buttonGroup = _bindingEditorButtons.getSelectionButtonsGroup(composite);
+ LayoutUtil.setHorizontalSpan(buttonGroup, nColumns - 1);
+ }
+ }
+
+ /**
+ * Creates the controls for the baseclass name field. Expects a <code>GridLayout</code>
+ * with at least 3 columns.
+ * This method gets called by createControls.
+ * It is intended to be overridden by the subclass
+ * org.eclipse.objectteams.otdt.internal.ui.wizards.NewRoleWizardPage.
+ *
+ * @param composite the parent composite
+ * @param nColumns number of columns to span
+ */
+ protected void createBaseClassControls(Composite composite, int nColumns){}
+
+//------------------------------------------------------------------------------
+// start of init and set methods
+//------------------------------------------------------------------------------
+
+ /**
+ * The wizard owning this page is responsible for calling this method with the
+ * current selection. The selection is used to initialize the fields of the wizard
+ * page.
+ *
+ * @param selection used to initialize the fields
+ */
+ public void init(IStructuredSelection selection)
+ {
+ IJavaElement jelem = getInitialJavaElement(selection);
+ initContainerPage(jelem);
+ initTypePage(jelem);
+ }
+
+ /**
+ * Initializes all fields provided by the page with a given selection.
+ *
+ * @param elem the selection used to intialize this page or <code>
+ * null</code> if no selection was available
+ */
+ protected void initTypePage(IJavaElement elem)
+ {
+ getInlineSelectionDialogField().setEnabled(false);
+
+ initAccessModifierButtons();
+ initOtherModifierButtons();
+ initMethodStubButtons();
+ initBindingEditorButtons();
+
+ IJavaProject project= null;
+ if (elem != null)
+ {
+ project= elem.getJavaProject();
+ initPackageAndEnclosingType(elem);
+ }
+ setTypeName(""); //$NON-NLS-1$
+ setSuperInterfaces(new ArrayList(5));
+ setAddComments(StubUtility.doAddComments(project), true); // from project or workspace
+ }
+
+
+ /**
+ * initializes the package and enclosing type dialog fields
+ * depending on the given initial selected IJavaElement
+ * (that is the IJavaElement which was selected in the Package Explorer,
+ * when the request to open the wizard occured)
+ */
+ protected void initPackageAndEnclosingType(IJavaElement initialSelectedElem)
+ {
+ IType potentialEnclosingType = null;
+ IType typeInCU = (IType) initialSelectedElem.getAncestor(IJavaElement.TYPE);
+
+ if (typeInCU != null)
+ {
+ if (typeInCU.getCompilationUnit() != null)
+ {
+ potentialEnclosingType = typeInCU;
+ }
+ }
+ else
+ {
+ ICompilationUnit cu = (ICompilationUnit) initialSelectedElem.getAncestor(IJavaElement.COMPILATION_UNIT);
+ if (cu != null)
+ {
+ potentialEnclosingType = cu.findPrimaryType();
+ }
+ }
+
+ //default case
+ IPackageFragment packageFragment = (IPackageFragment) initialSelectedElem.getAncestor(IJavaElement.PACKAGE_FRAGMENT);
+ String packName = (packageFragment == null)
+ ? "" //$NON-NLS-1$
+ : packageFragment.getElementName();
+ setPackageFragmentName(packName);
+ setEnclosingTypeName(""); //$NON-NLS-1$
+
+ if (potentialEnclosingType != null)
+ {
+ if (OTModelManager.hasOTElementFor(potentialEnclosingType))
+ {
+ IOTType potentialEnclosingOTType = OTModelManager.getOTElement(potentialEnclosingType);
+
+ boolean hasChanges = false;
+ if (potentialEnclosingOTType.isTeam())
+ {
+ handleTeamSelected(potentialEnclosingOTType);
+ hasChanges = true;
+ }
+ else //if potentialEnclosingOTType.isRole()
+ {
+ handleRoleSelected(potentialEnclosingOTType);
+ hasChanges = true;
+ }
+
+ if (hasChanges)
+ {
+ }
+ }
+ else try
+ {
+ if (potentialEnclosingType.isClass())
+ {
+ handleClassSelected(potentialEnclosingType);
+ }
+ }
+ catch (JavaModelException ex)
+ {
+ OTDTUIPlugin.getExceptionHandler().logCoreException(null,ex);
+ }
+ }
+ }
+
+ /**
+ * sets the enclosing type to be the given team class and
+ * the package fragment to be the package fragment of that team
+ * @param potentialEnclosingTeam - isTeam must be true
+ */
+ private void handleTeamSelected(IOTType potentialEnclosingTeam)
+ {
+ IType enclosingTeam = null;
+ IPackageFragment packageFragment = null;
+
+ if (potentialEnclosingTeam != null)
+ {
+//{OTModelUpdate
+ enclosingTeam = (IType) potentialEnclosingTeam.getCorrespondingJavaElement();
+//haebor}
+ packageFragment = enclosingTeam.getPackageFragment();
+ }
+
+ String enclosingTeamName = (enclosingTeam == null) ? "" : enclosingTeam.getFullyQualifiedName('.'); //$NON-NLS-1$
+ setEnclosingTypeName(enclosingTeamName);
+
+ String packName = (packageFragment == null) ? "" : packageFragment.getElementName(); //$NON-NLS-1$
+ setPackageFragmentName(packName);
+ }
+
+ /**
+ * sets the enclosing type to be the enclosing team of the given role class and
+ * the package fragment to be the package fragment of that team
+ * @param potentialEnclosingRole - isRole() must be true
+ */
+ private void handleRoleSelected(IOTType potentialEnclosingRole)
+ {
+ IType enclosingTeam = null;
+ IPackageFragment packageFragment = null;
+
+ if (potentialEnclosingRole != null) {
+ if (potentialEnclosingRole.isRole())
+ {
+ IJavaElement parent = potentialEnclosingRole.getParent();
+ if (parent instanceof IOTType) {
+ enclosingTeam = (IType)((IOTType)parent).getCorrespondingJavaElement();
+ packageFragment = enclosingTeam.getPackageFragment();
+ }
+ }
+ if (packageFragment == null) {
+ packageFragment = potentialEnclosingRole.getPackageFragment();
+ }
+ }
+
+ String enclosingTeamName = (enclosingTeam == null) ? "" : enclosingTeam.getFullyQualifiedName('.'); //$NON-NLS-1$
+ setEnclosingTypeName(enclosingTeamName);
+
+ String packName = (packageFragment == null) ? "" : packageFragment.getElementName(); //$NON-NLS-1$
+ setPackageFragmentName(packName);
+ }
+
+ /**
+ * sets the enclosing type to be null and
+ * the package fragment to be the package fragment of the given class
+ */
+ private void handleClassSelected(IType potentialEnclosingType)
+ {
+ setEnclosingTypeName(""); //$NON-NLS-1$
+
+ IPackageFragment pack = potentialEnclosingType.getPackageFragment();
+ String packName = (pack == null) ? "" : pack.getElementName(); //$NON-NLS-1$
+ setPackageFragmentName(packName);
+ }
+
+ protected abstract void initAccessModifierButtons();
+
+ protected void initOtherModifierButtons()
+ {
+ _otherModifierButtons.enableSelectionButton(STATIC_INDEX, false);
+ _otherModifierButtons.enableSelectionButton(FINAL_INDEX, true);
+ }
+
+ /**
+ * Sets the selection state of the method stub checkboxes.
+ */
+ protected abstract void initMethodStubButtons();
+
+ /**
+ * Sets the selection state of the bindingeditor checkbox.
+ */
+ protected abstract void initBindingEditorButtons();
+
+ /**
+ * Sets the enclosing type. The method updates the underlying model
+ * and the text of the control.
+ *
+ * @param type the enclosing type
+ * @param canBeModified if <code>true</code> the enclosing type field is
+ * editable; otherwise it is read-only.
+ */
+ public void setEnclosingType(IType type, boolean canBeModified) {
+ super.setEnclosingType(type, canBeModified);
+
+ _enclosingType= type;
+ _canModifyEnclosingType= canBeModified;
+ updateEnableState();
+ }
+
+ public void setEnclosingTypeName(String qualifiedName)
+ {
+ getEnclosingTypeDialogField().setText(qualifiedName);
+ }
+
+ /**
+ * Sets the package fragment to the given value. The method updates the model.
+ * It does NOT update the text of the control the text of the control.
+ *
+ * @param pack the package fragment to be set
+ */
+ public void setPackageFragment(IPackageFragment pack, boolean canBeModified) {
+ _currentPackage = pack;
+ _canModifyPackage= canBeModified;
+ updateEnableState();
+ }
+
+ public void setPackageFragmentName(String packageName)
+ {
+ if (getPackageDialogField() != null)
+ {
+ getPackageDialogField().setText(packageName);
+ }
+ }
+
+ /**
+ * Sets the type name input field's text to the given value. Method doesn't update
+ * the model.
+ *
+ * @param name the new type name
+ */
+ public void setTypeName(String name)
+ {
+ _typeNameDialogField.setText(name);
+ _typeNameDialogField.setEnabled(true);
+ }
+
+ /**
+ * Sets the super interfaces.
+ *
+ * @param interfacesNames a list of super interface. The method requires that
+ * the list's elements are of type <code>String</code>
+ */
+ public void setSuperInterfaces(List interfacesNames)
+ {
+ _superInterfacesDialogField.setElements(interfacesNames);
+ _superInterfacesDialogField.setEnabled(true);
+ }
+
+ public void setSuperType(IType type)
+ {
+ _superType = type;
+ }
+
+ public void setSuperTypeName(String name)
+ {
+ getSuperTypeDialogField().setText(name);
+ getSuperTypeDialogField().setEnabled(true);
+ }
+
+ public void setVisible(boolean visible) {
+ super.setVisible(visible);
+ if (visible) {
+ setFocus();
+ IStatus status = StatusUtil.getMostSevere(((NewTypeWizardPageListener)this._listener).getRelevantStates(true/*ignoreFirstField*/));
+ if (!status.isOK())
+ StatusUtil.applyToStatusLine(this, status);
+ }
+ }
+
+ /**
+ * Sets the focus on the type name input field.
+ */
+ protected void setFocus()
+ {
+ _typeNameDialogField.setFocus();
+ }
+
+
+//------------------------------------------------------------------------------
+// start of get methods
+//-----------------------------------------------------------------------------
+
+ public SelectionButtonDialogFieldGroup getAccessModifierButtons()
+ {
+ return _accessModifierButtons;
+ }
+
+ public SelectionButtonDialogFieldGroup getOtherModifierButtons()
+ {
+ return _otherModifierButtons;
+ }
+
+ public SelectionButtonDialogFieldGroup getMethodStubsButtons()
+ {
+ return _methodStubsButtons;
+ }
+
+ public abstract boolean isCreateMainSelected();
+
+ public abstract boolean isCreateInheritedSelected();
+
+ public abstract boolean isCreateConstructorsSelected();
+
+
+ public SelectionButtonDialogFieldGroup getBindingEditorButtons()
+ {
+ return _bindingEditorButtons;
+ }
+
+ public abstract boolean isOpenBindingEditorSelected();
+
+ public NewTypeWizardPageListener getListener()
+ {
+ return _listener;
+ }
+
+ public StringButtonStatusDialogField getPackageDialogField()
+ {
+ return _packageDialogField;
+ }
+
+ public StringDialogField getTypeNameDialogField()
+ {
+ return _typeNameDialogField;
+ }
+
+ public StringButtonDialogField getEnclosingTypeDialogField()
+ {
+ return _enclosingTypeDialogField;
+ }
+
+ public StringButtonDialogField getSuperTypeDialogField()
+ {
+ return _superTypeDialogField;
+ }
+
+ public SelectionButtonDialogField getInlineSelectionDialogField()
+ {
+ return _inlineSelectionDialogField;
+ }
+
+ public ListDialogField getSuperInterfacesDialogField()
+ {
+ return _superInterfacesDialogField;
+ }
+
+ public SelectionButtonDialogField getEnclosingTypeSelectionField() {
+ return _enclosingTypeSelection;
+ }
+
+ public String getTypeName()
+ {
+ return getTypeNameDialogField().getText();
+ }
+
+ public IPackageFragment getPackageFragment()
+ {
+ return _currentPackage;
+ }
+
+ public String getPackageName()
+ {
+ if (_packageDialogField != null)
+ {
+ return _packageDialogField.getText();
+ }
+ else
+ {
+ return ""; //$NON-NLS-1$
+ }
+ }
+
+ public IType getEnclosingType()
+ {
+ return _enclosingType;
+ }
+
+ public String getEnclosingTypeName()
+ {
+ return getEnclosingTypeDialogField().getText();
+ }
+
+ public boolean isInlineTypeSelected()
+ {
+ return getInlineSelectionDialogField().isSelected();
+ }
+
+ public IType getSuperType()
+ {
+ return _superType;
+ }
+
+ public String getSuperTypeName()
+ {
+ return getSuperTypeDialogField().getText();
+ }
+
+ /**
+ * Returns the chosen super interfaces.
+ *
+ * @return a list of chosen super interfaces. The list's elements
+ * are of type <code>String</code>
+ */
+ @SuppressWarnings("unchecked") // ListDialogField uses raw List
+ public List getSuperInterfaces() {
+ List interfaces= _superInterfacesDialogField.getElements();
+ ArrayList result= new ArrayList(interfaces.size());
+ for (Iterator iter= interfaces.iterator(); iter.hasNext();) {
+ InterfaceWrapper wrapper= (InterfaceWrapper) iter.next();
+ result.add(wrapper.interfaceName);
+ }
+ return result;
+ }
+ /**
+ * Hook method that gets called when the list of super interface has changed. The method
+ * validates the super interfaces and returns the status of the validation.
+ * <p>
+ * Subclasses may extend this method to perform their own validation.
+ * </p>
+ *
+ * @return the status of the validation
+ */
+ protected IStatus superInterfacesChanged() {
+ StatusInfo status= new StatusInfo();
+
+ IPackageFragmentRoot root= getPackageFragmentRoot();
+ _superInterfacesDialogField.enableButton(0, root != null);
+
+ if (root != null) {
+ List elements= _superInterfacesDialogField.getElements();
+ int nElements= elements.size();
+ for (int i= 0; i < nElements; i++) {
+ String intfname= ((InterfaceWrapper) elements.get(i)).interfaceName;
+ Type type= TypeContextChecker.parseSuperInterface(intfname);
+ if (type == null) {
+ status.setError(Messages.format(NewWizardMessages.NewTypeWizardPage_error_InvalidSuperInterfaceName, intfname));
+ return status;
+ }
+ if (type instanceof ParameterizedType && ! JavaModelUtil.is50OrHigher(root.getJavaProject())) {
+ status.setError(Messages.format(NewWizardMessages.NewTypeWizardPage_error_SuperInterfaceNotParameterized, intfname));
+ return status;
+ }
+ }
+ }
+ return status;
+ }
+
+ /**
+ * Sets the super interfaces.
+ *
+ * @param interfacesNames a list of super interface. The method requires that
+ * the list's elements are of type <code>String</code>
+ * @param canBeModified if <code>true</code> the super interface field is
+ * editable; otherwise it is read-only.
+ */
+ @SuppressWarnings("unchecked") // we are called with a raw List
+ public void setSuperInterfaces(List interfacesNames, boolean canBeModified) {
+ ArrayList interfaces= new ArrayList(interfacesNames.size());
+ for (Iterator iter= interfacesNames.iterator(); iter.hasNext();) {
+ interfaces.add(new InterfaceWrapper((String) iter.next()));
+ }
+ _superInterfacesDialogField.setElements(interfaces);
+ _superInterfacesDialogField.setEnabled(canBeModified);
+ }
+
+ /**
+ * Adds a super interface to the end of the list and selects it if it is not in the list yet.
+ *
+ * @param superInterface the fully qualified type name of the interface.
+ * @return returns <code>true</code>if the interfaces has been added, <code>false</code>
+ * if the interface already is in the list.
+ * @since 3.2
+ */
+ public boolean addSuperInterface(String superInterface) {
+ return _superInterfacesDialogField.addElement(new InterfaceWrapper(superInterface));
+ }
+
+
+ /**
+ * Returns the selected modifiers.
+ *
+ * @return the selected modifiers
+ * @see org.eclipse.jdt.core.Flags
+ */
+ public int getModifiers()
+ {
+ int mdf= 0;
+ if (getAccessModifierButtons().isSelected(PUBLIC_INDEX))
+ {
+ mdf+= Flags.AccPublic;
+ } else if (getAccessModifierButtons().isSelected(PRIVATE_INDEX))
+ {
+ mdf+= Flags.AccPrivate;
+ } else if (getAccessModifierButtons().isSelected(PROTECTED_INDEX))
+ {
+ mdf+= Flags.AccProtected;
+ }
+ if (getOtherModifierButtons().isSelected(ABSTRACT_INDEX) && (STATIC_INDEX != 0))
+ {
+ mdf+= Flags.AccAbstract;
+ }
+ if (getOtherModifierButtons().isSelected(FINAL_INDEX))
+ {
+ mdf+= Flags.AccFinal;
+ }
+ if (getOtherModifierButtons().isSelected(STATIC_INDEX))
+ {
+ mdf+= Flags.AccStatic;
+ }
+ return mdf;
+ }
+
+ public IStatus getContainerStatus()
+ {
+ //inherited from NewContainerWizardPage
+ return fContainerStatus;
+ }
+
+ /**
+ * extended visibility in order to enable calls from external listeners
+ * @see NewContainerWizardPage.updateStatus
+ */
+ public void updateStatus(IStatus[] status)
+ {
+ super.updateStatus(status);
+ }
+
+ /**
+ * workaround
+ * the containerDialogField is defined in a superclass and declared private
+ *
+ * informs the listener that the container dialogfield has changed
+ */
+ protected void handleFieldChanged(String fieldName)
+ {
+ super.handleFieldChanged(fieldName);
+ if (fieldName == CONTAINER)
+ {
+ getListener().handleContainerChanged();
+ }
+ }
+
+ /** A bridge to the protected method typeNameChanged() */
+ public IStatus publicTypeNameChanged() {
+ return typeNameChanged();
+ }
+
+ /**
+ * Returns the selection state of the enclosing type checkbox.
+ *
+ * @return the selection state of the enclosing type checkbox
+ */
+ public boolean isEnclosingTypeSelected() {
+ if(_enclosingTypeSelection == null)
+ return super.isEnclosingTypeSelected();
+ else
+ return _enclosingTypeSelection.isSelected();
+ }
+
+ /**
+ * Sets the enclosing type checkbox's selection state.
+ *
+ * @param isSelected the checkbox's selection state
+ * @param canBeModified if <code>true</code> the enclosing type checkbox is
+ * modifiable; otherwise it is read-only.
+ */
+ public void setEnclosingTypeSelection(boolean isSelected, boolean canBeModified) {
+ super.setEnclosingTypeSelection(isSelected, canBeModified);
+ _enclosingTypeSelection.setSelection(isSelected);
+ _enclosingTypeSelection.setEnabled(canBeModified);
+ updateEnableState();
+ }
+
+ /*
+ * Updates the enable state of buttons related to the enclosing type selection checkbox.
+ */
+ public void updateEnableState() {
+ boolean enclosing= isEnclosingTypeSelected();
+ if(_packageDialogField != null)
+ _packageDialogField.setEnabled(_canModifyPackage && !enclosing);
+ _enclosingTypeDialogField.setEnabled(_canModifyEnclosingType && enclosing);
+ }
+
+ /*
+ * @see org.eclipse.jdt.ui.wizards.NewContainerWizardPage#containerChanged()
+ */
+ protected IStatus containerChanged() {
+ IStatus status= super.containerChanged();
+
+ _currPackageCompletionProcessor.setPackageFragmentRoot(getPackageFragmentRoot());
+ if (getPackageFragmentRoot() != null) {
+ _enclosingTypeCompletionProcessor.setPackageFragment(getPackageFragmentRoot().getPackageFragment("")); //$NON-NLS-1$
+ }
+ return status;
+ }
+
+ /**
+ * Returns the label that is used for the enclosing type input field.
+ *
+ * @return the label that is used for the enclosing type input field.
+ * @since 3.2
+ */
+ protected String getEnclosingTypeLabel() {
+ return NewWizardMessages.NewTypeWizardPage_enclosing_selection_label;
+ }
+
+ IType getCurrentType() {
+ return _currentType;
+ }
+
+ @Override
+ public IType chooseEnclosingType() {
+ return super.chooseEnclosingType();
+ }
+
+ public static IStatus validateJavaTypeName(String typeName, IJavaProject javaProject) {
+ String sourceLevel = CompilerOptions.VERSION_1_5;
+ String complianceLevel = CompilerOptions.VERSION_1_5;
+ if (javaProject != null) {
+ sourceLevel = javaProject.getOption(CompilerOptions.OPTION_Source, true);
+ complianceLevel = javaProject.getOption(CompilerOptions.OPTION_Compliance, true);
+ }
+ return JavaConventions.validateJavaTypeName(typeName, sourceLevel, complianceLevel);
+ }
+ public static IStatus validatePackageName(String packageName, IJavaProject javaProject) {
+ String sourceLevel = CompilerOptions.VERSION_1_5;
+ String complianceLevel = CompilerOptions.VERSION_1_5;
+ if (javaProject != null) {
+ sourceLevel = javaProject.getOption(CompilerOptions.OPTION_Source, true);
+ complianceLevel = javaProject.getOption(CompilerOptions.OPTION_Compliance, true);
+ }
+ return JavaConventions.validatePackageName(packageName, sourceLevel, complianceLevel);
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/OTNewProjectWizard.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/OTNewProjectWizard.java
new file mode 100644
index 000000000..3648cc606
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/OTNewProjectWizard.java
@@ -0,0 +1,188 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2003, 2009 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: OTNewProjectWizard.java 23435 2010-02-04 00:14:38Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.wizards;
+
+import java.lang.reflect.InvocationTargetException;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExecutableExtension;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.launching.JavaRuntime;
+import org.eclipse.jdt.ui.wizards.JavaCapabilityConfigurationPage;
+import org.eclipse.jface.dialogs.ErrorDialog;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.objectteams.otdt.core.ext.OTDTPlugin;
+import org.eclipse.objectteams.otdt.core.ext.OTREContainer;
+import org.eclipse.objectteams.otdt.ui.ImageConstants;
+import org.eclipse.objectteams.otdt.ui.OTDTUIPlugin;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.actions.WorkspaceModifyOperation;
+import org.eclipse.ui.dialogs.WizardNewProjectCreationPage;
+import org.eclipse.ui.wizards.newresource.BasicNewProjectResourceWizard;
+import org.eclipse.ui.wizards.newresource.BasicNewResourceWizard;
+
+/**
+ * @author brcan
+ * @version $Id: OTNewProjectWizard.java 23435 2010-02-04 00:14:38Z stephan $
+ */
+
+public class OTNewProjectWizard
+ extends BasicNewProjectResourceWizard
+ implements IExecutableExtension
+{
+ private IConfigurationElement _configElement;
+ private JavaCapabilityConfigurationPage _javaPage;
+ private WizardNewProjectCreationPage _mainPage;
+// private IJavaProject _javaProject;
+ private IWorkbench _workbench;
+
+ public OTNewProjectWizard()
+ {
+ super();
+ setDefaultPageImageDescriptor(OTDTUIPlugin.getDefault().getImageRegistry().getDescriptor(ImageConstants.NEW_OT_PROJECT));
+ setDialogSettings(OTDTUIPlugin.getDefault().getDialogSettings());
+ setWindowTitle(OTDTUIPlugin.getResourceString("NewOTProjectCreationWizard.title")); //$NON-NLS-1$
+ }
+
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
+ _workbench= workbench;
+ }
+
+ public void addPages()
+ {
+ _mainPage = new WizardNewProjectCreationPage("NewOTProjectCreationWizard"); //$NON-NLS-1$
+ _mainPage.setTitle(OTDTUIPlugin.getResourceString("NewOTProjectCreationWizard.MainPage.title")); //$NON-NLS-1$
+ _mainPage.setDescription(OTDTUIPlugin.getResourceString("NewOTProjectCreationWizard.MainPage.description")); //$NON-NLS-1$
+ addPage(_mainPage);
+
+ _javaPage = new JavaCapabilityConfigurationPage() {
+
+ @Override
+ public void setVisible(boolean visible)
+ {
+ updateJavaPage();
+ super.setVisible(visible);
+ }
+ };
+
+ // We can't add otre.jar to the classpath here, as that would overwrite the default classpath, i.e. the source folder (carp)
+// _javaPage.setDefaultClassPath(new IClasspathEntry[] { JavaCore.newContainerEntry(OTREContainer.OTRE_CONTAINER_PATH) }, true);
+ addPage(_javaPage);
+ }
+
+ private void updateJavaPage()
+ {
+ IJavaProject jproject= JavaCore.create(_mainPage.getProjectHandle());
+ if (!jproject.equals(_javaPage.getJavaProject()))
+ {
+ IClasspathEntry[] buildPath= {
+ JavaCore.newSourceEntry(jproject.getPath().append("src")), //$NON-NLS-1$
+ JavaRuntime.getDefaultJREContainerEntry()
+ };
+ IPath outputLocation= jproject.getPath().append("bin"); //$NON-NLS-1$
+ _javaPage.init(jproject, outputLocation, buildPath, false);
+ }
+ }
+
+ private void finishPage(IProgressMonitor monitor) throws InterruptedException, CoreException {
+ if (monitor == null) {
+ monitor= new NullProgressMonitor();
+ }
+ try {
+ monitor.beginTask(OTNewWizardMessages.NewProjectWizard_task_title, 4); // 4 steps
+
+ IProject project= _mainPage.getProjectHandle();
+ IPath locationPath= _mainPage.getLocationPath();
+
+ // create the project
+ IProjectDescription desc= project.getWorkspace().newProjectDescription(project.getName());
+ if (!_mainPage.useDefaults()) {
+ desc.setLocation(locationPath);
+ }
+ desc.setNatureIds(OTDTPlugin.createProjectNatures(desc));
+ desc.setBuildSpec(OTDTPlugin.createProjectBuildCommands(desc));
+
+ project.create(desc, new SubProgressMonitor(monitor, 1));
+ project.open(new SubProgressMonitor(monitor, 1));
+
+ updateJavaPage();
+ _javaPage.configureJavaProject(new SubProgressMonitor(monitor, 1));
+
+ OTREContainer.initializeOTJProject(project);
+
+ // change to the perspective specified in the plugin.xml
+ BasicNewProjectResourceWizard.updatePerspective(_configElement);
+ BasicNewResourceWizard.selectAndReveal(project, _workbench.getActiveWorkbenchWindow());
+
+ } finally {
+ monitor.done();
+ }
+ }
+
+ public boolean performFinish() {
+ WorkspaceModifyOperation op= new WorkspaceModifyOperation() {
+ protected void execute(IProgressMonitor monitor) throws CoreException, InvocationTargetException, InterruptedException {
+ finishPage(monitor);
+ }
+ };
+ try {
+ getContainer().run(false, true, op);
+ } catch (InvocationTargetException ex) {
+ if (ex.getTargetException() instanceof CoreException)
+ {
+ CoreException core = (CoreException) ex.getTargetException();
+ ErrorDialog.openError(getShell(), OTNewWizardMessages.NewProjectWizard_error_title, core.getMessage(), core.getStatus());
+ }
+
+ String title = OTNewWizardMessages.NewProjectWizard_wizard_creation_failure_title;
+ String message = OTNewWizardMessages.NewProjectWizard_wizard_creation_failure_message;
+ OTDTUIPlugin.getExceptionHandler().logException("Wizard title" + title + ": "+ message, ex); //$NON-NLS-1$ //$NON-NLS-2$
+ return false;
+ } catch (InterruptedException e) {
+ return false; // canceled
+ }
+ return true;
+ }
+
+
+
+ /**
+ * Stores the configuration element for the wizard.
+ * The config element will be used in performFinish()
+ * to set the result perspective.
+ */
+ public void setInitializationData(
+ IConfigurationElement cfig,
+ String propertyName,
+ Object data)
+ {
+ _configElement = cfig;
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/OTNewWizardMessages.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/OTNewWizardMessages.java
new file mode 100644
index 000000000..7dd0a030a
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/OTNewWizardMessages.java
@@ -0,0 +1,102 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: OTNewWizardMessages.java 23435 2010-02-04 00:14:38Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.wizards;
+
+import org.eclipse.osgi.util.NLS;
+
+public class OTNewWizardMessages extends NLS {
+
+ private static final String BUNDLE_NAME= "org.eclipse.objectteams.otdt.internal.ui.wizards.OTNewWizardMessages";//$NON-NLS-1$
+
+
+ private OTNewWizardMessages() {
+ // Do not instantiate
+ }
+
+ public static String NewProjectWizard_task_title;
+ public static String NewProjectWizard_wizard_creation_failure_title;
+ public static String NewProjectWizard_wizard_creation_failure_message;
+ public static String NewProjectWizard_error_title;
+
+ // common errors:
+ public static String NewTypeWizardPage_same_enclosing_and_super_error;
+ public static String NewTypeWizardPage_super_of_regular_is_role_error;
+
+ // NewRole:
+ public static String NewRoleCreationWizard_title;
+
+ public static String NewRoleWizardPage_title;
+ public static String NewRoleWizardPage_description;
+
+ public static String NewRoleWizardPage_enclosingtype_label;
+ public static String NewRoleWizardPage_ChooseEnclosingTypeDialog_title;
+ public static String NewRoleWizardPage_ChooseEnclosingTypeDialog_description;
+
+ public static String NewRoleWizardPage_inlined_checkbox_label;
+
+ public static String NewRoleWizardPage_SuperclassDialog_title;
+ public static String NewRoleWizardPage_SuperclassDialog_message;
+ public static String NewRoleWizardPage_superclass_explicit_label;
+
+ public static String NewRoleWizardPage_superclass_implicit_label;
+
+ public static String NewRoleWizardPage_BaseclassDialog_title;
+ public static String NewRoleWizardPage_BaseclassDialog_message;
+ public static String NewRoleWizardPage_baseclass_label;
+ public static String NewRoleWizardPage_baseclass_selection_button;
+
+ // errors:
+ public static String NewRoleWizardPage_already_has_this_super;
+ public static String NewRoleWizardPage_explicit_and_implicit_subclassing_error;
+ public static String NewRoleWizardPage_incompatible_supers_error;
+ public static String NewRoleWizardPage_super_is_overridden_error;
+ public static String NewRoleWizardPage_super_is_role_of_different_team_error;
+
+ public static String NewRole_base_class_equals_enclosing;
+ public static String NewRole_base_class_equals_member;
+ public static String NewRole_role_hides_team;
+
+ // NewTeam:
+ public static String NewTeamCreationWizard_title;
+ public static String NewTeamWizardPage_title;
+ public static String NewTeamWizardPage_description;
+
+ public static String NewTeamWizardPage_ChooseSuperTypeDialog_title;
+ public static String NewTeamWizardPage_ChooseSuperTypeDialog_description;
+ public static String NewTeamWizardPage_superclass_label;
+
+ public static String NewTeamWizardPage_methods_constructors;
+
+ public static String NewTeamWizardPage_BindingEditor_selection;
+ public static String NewTeamWizardPage_BindingEditor_description;
+
+ public static String TeamSelectionDialog_upperLabel;
+ public static String TeamSelectionDialog_lowerLabel;
+ public static String TeamSelectionDialog_notypes_title;
+ public static String TeamSelectionDialog_notypes_message;
+
+
+
+
+ static {
+ NLS.initializeMessages(BUNDLE_NAME, OTNewWizardMessages.class);
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/OTNewWizardMessages.properties b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/OTNewWizardMessages.properties
new file mode 100644
index 000000000..c60292cba
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/OTNewWizardMessages.properties
@@ -0,0 +1,68 @@
+# new project wizard:
+NewProjectWizard_task_title=Creating Object Teams project...
+NewProjectWizard_wizard_creation_failure_title=Wizard Creation Failure
+NewProjectWizard_wizard_creation_failure_message=An error occurred while creating the wizard
+NewProjectWizard_error_title=Error creating Object Teams Java project
+
+
+# common errors:
+NewTypeWizardPage_same_enclosing_and_super_error=Enclosing and superclass must be different
+NewTypeWizardPage_super_of_regular_is_role_error=Superclass is a role class. Therefore the type to be created must be a role class too and needs an enclosing team class.
+
+#NewTeamCreationWizard
+NewTeamCreationWizard_title = New Team
+
+#NewTeamWizardPage
+NewTeamWizardPage_title = Team Class
+NewTeamWizardPage_description = Create a new team class.
+
+NewTeamWizardPage_ChooseSuperTypeDialog_title= Superteam Selection
+NewTeamWizardPage_ChooseSuperTypeDialog_description= Choose a team as superclass of the new team class:
+NewTeamWizardPage_superclass_label = Superte&am:
+
+NewTeamWizardPage_methods_constructors=&Constructors from superteam
+
+NewTeamWizardPage_BindingEditor_selection= Edit using the Binding Editor
+NewTeamWizardPage_BindingEditor_description= Should this team be used as a connector?
+
+# NewRoleCreationWizard
+NewRoleCreationWizard_title = New Role
+
+#NewRoleWizardPage
+NewRoleWizardPage_title = Role class
+NewRoleWizardPage_description = Create a new role class.
+
+NewRoleWizardPage_enclosingtype_label=Enclosing Team
+NewRoleWizardPage_ChooseEnclosingTypeDialog_description=&Choose a team to which the new class will be added as a role:
+NewRoleWizardPage_ChooseEnclosingTypeDialog_title=Enclosing Team Selection
+
+NewRoleWizardPage_inlined_checkbox_label=&inlined
+
+NewRoleWizardPage_SuperclassDialog_title= Explicit Superclass Selection
+NewRoleWizardPage_SuperclassDialog_message= Choose a type as explicit superclass of the new role class:
+NewRoleWizardPage_superclass_explicit_label = E&xplicit superclass:
+
+NewRoleWizardPage_superclass_implicit_label = Implicit superclass:
+
+NewRoleWizardPage_BaseclassDialog_title= Baseclass Selection
+NewRoleWizardPage_BaseclassDialog_message= Choose a type that plays the new role:
+NewRoleWizardPage_baseclass_label = Bound &base class:
+NewRoleWizardPage_baseclass_selection_button=&Browse...
+
+# errors:
+NewRoleWizardPage_already_has_this_super=Role to be created already inherits from {0} because an implicit superclass inherits from it.
+NewRoleWizardPage_explicit_and_implicit_subclassing_error=It is not allowed to subclass a type implicitly and explicitly at the same time.
+NewRoleWizardPage_incompatible_supers_error=Super class must be sub class of {0} because implicit super role already declares it as its super class.
+NewRoleWizardPage_super_is_overridden_error=The superclass is not visible in the scope of the role that is to be created because it has an overriding implicit subclass.
+NewRoleWizardPage_super_is_role_of_different_team_error=Superclass is a role class. Its enclosing team must be contained in the supertype hierarchy of the enclosing team of the type to be created.
+
+NewRole_base_class_equals_enclosing="Cannot use the enclosing class {0} as the base class."
+NewRole_base_class_equals_member="A member class {0} exists in scope, cannot use as base class."
+NewRole_role_hides_team = Role must not hide or shadow its enclosing team.
+
+# === DIALOGS: ===
+#TeamSelectionDialog
+TeamSelectionDialog_upperLabel= Matching teams:
+TeamSelectionDialog_lowerLabel= Qualifier:
+TeamSelectionDialog_notypes_title=Team Selection
+TeamSelectionDialog_notypes_message=No teams available.
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/OpenOTProjectWizardAction.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/OpenOTProjectWizardAction.java
new file mode 100644
index 000000000..fbfc592ed
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/OpenOTProjectWizardAction.java
@@ -0,0 +1,48 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2003, 2009 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: OpenOTProjectWizardAction.java 23435 2010-02-04 00:14:38Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.wizards;
+
+import org.eclipse.jdt.ui.actions.AbstractOpenWizardAction;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.INewWizard;
+
+/**
+ * Action for the OT new project wizard. This action is only used in cheatsheets.
+ *
+ * @author brcan
+ * @version $Id: OpenOTProjectWizardAction.java 23435 2010-02-04 00:14:38Z stephan $
+ */
+public class OpenOTProjectWizardAction extends AbstractOpenWizardAction {
+
+ public OpenOTProjectWizardAction() {
+// WorkbenchHelp.setHelp(this, IJavaHelpContextIds.OPEN_PROJECT_WIZARD_ACTION);
+ }
+
+ @Override
+ protected INewWizard createWizard() {
+ return new OTNewProjectWizard();
+ }
+
+ @Override
+ protected boolean doCreateProjectFirstOnEmptyWorkspace(Shell shell) {
+ return true; // can work on an empty workspace
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/OpenRoleWizardAction.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/OpenRoleWizardAction.java
new file mode 100644
index 000000000..4cbeb0581
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/OpenRoleWizardAction.java
@@ -0,0 +1,52 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2003, 2009 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: OpenRoleWizardAction.java 23435 2010-02-04 00:14:38Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.wizards;
+
+import org.eclipse.jdt.ui.actions.AbstractOpenWizardAction;
+import org.eclipse.ui.INewWizard;
+
+/**
+ * Action for the role wizard. This action is only used in cheatsheets.
+ *
+ * @author brcan
+ * @version $Id: OpenRoleWizardAction.java 23435 2010-02-04 00:14:38Z stephan $
+ */
+public class OpenRoleWizardAction extends AbstractOpenWizardAction
+{
+ public OpenRoleWizardAction() {
+// WorkbenchHelp.setHelp(this, IJavaHelpContextIds.OPEN_CLASS_WIZARD_ACTION);
+ }
+/* km: not needed anymore?
+ public OpenRoleWizardAction(String label, Class[] acceptedTypes) {
+ super(label, acceptedTypes, false);
+// WorkbenchHelp.setHelp(this, IJavaHelpContextIds.OPEN_CLASS_WIZARD_ACTION);
+ }
+*/
+ protected INewWizard createWizard() {
+ return new NewRoleCreationWizard();
+ }
+
+// FIXME(KM): method isnt override anymore - what to use instead? outcommented to get compiled
+/* protected boolean shouldAcceptElement(Object obj) {
+ return isOnBuildPath(obj) && !isInArchive(obj);
+ }
+*/
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/OpenTeamWizardAction.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/OpenTeamWizardAction.java
new file mode 100644
index 000000000..a8cfad140
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/OpenTeamWizardAction.java
@@ -0,0 +1,52 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2003, 2009 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: OpenTeamWizardAction.java 23435 2010-02-04 00:14:38Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.wizards;
+
+import org.eclipse.jdt.ui.actions.AbstractOpenWizardAction;
+import org.eclipse.ui.INewWizard;
+
+/**
+ * Action for the team wizard. This action is only used in cheatsheets.
+ *
+ * @author brcan
+ * @version $Id: OpenTeamWizardAction.java 23435 2010-02-04 00:14:38Z stephan $
+ */
+public class OpenTeamWizardAction extends AbstractOpenWizardAction
+{
+ public OpenTeamWizardAction() {
+// WorkbenchHelp.setHelp(this, IJavaHelpContextIds.OPEN_CLASS_WIZARD_ACTION);
+ }
+/* km: not needed anymore?
+ public OpenTeamWizardAction(String label, Class[] acceptedTypes) {
+ super(label, acceptedTypes, false);
+// WorkbenchHelp.setHelp(this, IJavaHelpContextIds.OPEN_CLASS_WIZARD_ACTION);
+ }
+*/
+ protected INewWizard createWizard() {
+ return new NewTeamCreationWizard();
+ }
+
+// FIXME(KM): method isnt override anymore - what to use instead? outcommented to get compiled
+/* protected boolean shouldAcceptElement(Object obj) {
+ return isOnBuildPath(obj) && !isInArchive(obj);
+ }
+*/
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/listeners/NewRoleWizardPageListener.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/listeners/NewRoleWizardPageListener.java
new file mode 100644
index 000000000..c62a4120e
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/listeners/NewRoleWizardPageListener.java
@@ -0,0 +1,379 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2008 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: NewRoleWizardPageListener.java 23435 2010-02-04 00:14:38Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.wizards.listeners;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IPackageFragmentRoot;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.ITypeHierarchy;
+import org.eclipse.jdt.core.JavaConventions;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.core.Signature;
+import org.eclipse.jdt.core.search.IJavaSearchConstants;
+import org.eclipse.jdt.core.search.IJavaSearchScope;
+import org.eclipse.jdt.core.search.SearchEngine;
+import org.eclipse.jdt.internal.ui.dialogs.FilteredTypesSelectionDialog;
+import org.eclipse.jdt.internal.ui.dialogs.StatusInfo;
+import org.eclipse.jdt.internal.ui.wizards.dialogfields.DialogField;
+import org.eclipse.jface.window.Window;
+import org.eclipse.jdt.internal.corext.util.Messages;
+import org.eclipse.objectteams.otdt.core.IOTType;
+import org.eclipse.objectteams.otdt.core.IRoleType;
+import org.eclipse.objectteams.otdt.core.OTModelManager;
+import org.eclipse.objectteams.otdt.internal.core.OTJavaElement;
+import org.eclipse.objectteams.otdt.internal.ui.wizards.NewRoleWizardPage;
+import org.eclipse.objectteams.otdt.internal.ui.wizards.NewTypeWizardPage;
+import org.eclipse.objectteams.otdt.internal.ui.wizards.OTNewWizardMessages;
+import org.eclipse.objectteams.otdt.ui.OTDTUIPlugin;
+import org.eclipse.ui.dialogs.ISelectionStatusValidator;
+
+/**
+ * The main listener class for org.eclipse.objectteams.otdt.internal.ui.wizards.NewRoleWizardPage.
+ * It listens to changes of the entry fields and clicks on the browse buttons
+ * of the observed NewRoleWizardPage.
+ *
+ * @author kaschja
+ * @version $Id: NewRoleWizardPageListener.java 23435 2010-02-04 00:14:38Z stephan $
+ */
+public class NewRoleWizardPageListener extends NewTypeWizardPageListener
+{
+ protected static final int BASE = 20;
+
+ private IStatus _baseStatus = new StatusInfo();
+ // cache this info (hierarchy operation is expensive)
+ private IType[] fSuperTeams = null;
+
+ public NewRoleWizardPageListener(NewTypeWizardPage observedPage)
+ {
+ super(observedPage);
+ }
+
+ protected int getChangedElement(DialogField field)
+ {
+ if (getObservedPage() instanceof NewRoleWizardPage)
+ {
+ NewRoleWizardPage page = (NewRoleWizardPage) getObservedPage();
+
+ if (field == page.getBaseClassDialogField())
+ {
+ return BASE;
+ }
+ }
+
+ return super.getChangedElement(field);
+ }
+
+ protected void performReviews(int change)
+ {
+ super.performReviews(change);
+
+ if ((change == CONTAINER)
+ || (change == PACKAGE)
+ || (change == ENCLOSINGTYPE)
+ || (change == BASE)
+ || (change == NAME) )
+ {
+ _baseStatus = validateBaseClass();
+ handleImplicitSuperclassDialogField();
+ }
+ }
+
+ protected void handleChangeControlPressed(DialogField field)
+ {
+ if (!(getObservedPage() instanceof NewRoleWizardPage) )
+ {
+ return;
+ }
+ NewRoleWizardPage page = (NewRoleWizardPage) getObservedPage();
+
+ if (field == page.getBaseClassDialogField())
+ {
+ IType type = chooseBaseType();
+ if (type != null)
+ {
+ String str = type.getFullyQualifiedName('.');
+ page.setBaseClassName(str);
+ }
+ }
+ else
+ {
+ super.handleChangeControlPressed(field);
+ }
+ }
+
+ protected IStatus validateTypeName()
+ {
+ // FIXME(SH): admit parameterized name!
+ IStatus superStatus = super.validateTypeName();
+ if (superStatus.getSeverity() == IStatus.ERROR)
+ {
+ return superStatus;
+ }
+
+ NewRoleWizardPage page = (NewRoleWizardPage) getObservedPage();
+
+ String enclosingTypeName = page.getEnclosingTypeName();
+ // strip package name off of enclosing type
+ enclosingTypeName = enclosingTypeName.substring(enclosingTypeName.lastIndexOf('.') + 1);
+
+ String simpleRoleName = page.getTypeName();
+ if (simpleRoleName.equals(enclosingTypeName))
+ {
+ StatusInfo status = new StatusInfo();
+ status.setError(OTNewWizardMessages.NewRole_role_hides_team);
+ return status;
+ }
+
+ return superStatus;
+ }
+
+ protected IType chooseEnclosingType()
+ {
+ IPackageFragmentRoot root= getObservedPage().getPackageFragmentRoot();
+ if (root == null)
+ return null;
+
+ return chooseTeam( root,
+ getObservedPage().getShell(),
+ getObservedPage().getWizard().getContainer(),
+ org.eclipse.objectteams.otdt.internal.ui.wizards.OTNewWizardMessages.NewRoleWizardPage_ChooseEnclosingTypeDialog_title,
+ org.eclipse.objectteams.otdt.internal.ui.wizards.OTNewWizardMessages.NewRoleWizardPage_ChooseEnclosingTypeDialog_description,
+ Signature.getSimpleName(getObservedPage().getEnclosingTypeName()));
+ }
+
+ protected IType chooseSuperType()
+ {
+ IPackageFragmentRoot root = getObservedPage().getPackageFragmentRoot();
+ if (root == null)
+ {
+ return null;
+ }
+
+ IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { root.getJavaProject() });
+
+ FilteredTypesSelectionDialog dialog = new FilteredTypesSelectionDialog(
+ getObservedPage().getShell(),
+ false,
+ getObservedPage().getWizard().getContainer(),
+ scope,
+ IJavaSearchConstants.CLASS);
+ dialog.setTitle(OTNewWizardMessages.NewRoleWizardPage_SuperclassDialog_title);
+ dialog.setMessage(OTNewWizardMessages.NewRoleWizardPage_SuperclassDialog_message);
+ dialog.setInitialPattern(getObservedPage().getSuperTypeName());
+
+ if (dialog.open() == Window.OK)
+ {
+ return (IType) dialog.getFirstResult();
+ }
+ return null;
+ }
+
+ private IType chooseBaseType()
+ {
+ IPackageFragmentRoot root = getObservedPage().getPackageFragmentRoot();
+ if (root == null)
+ {
+ return null;
+ }
+
+ IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { root.getJavaProject() });
+
+ FilteredTypesSelectionDialog dialog = new FilteredTypesSelectionDialog(getObservedPage().getShell(),
+ false,
+ getObservedPage().getWizard().getContainer(),
+ scope,
+ IJavaSearchConstants.TYPE);
+ dialog.setTitle(OTNewWizardMessages.NewRoleWizardPage_BaseclassDialog_title);
+ dialog.setMessage(OTNewWizardMessages.NewRoleWizardPage_BaseclassDialog_message);
+ dialog.setInitialPattern( ((NewRoleWizardPage)getObservedPage()).getBaseClassName());
+ dialog.setValidator(new ISelectionStatusValidator()
+ {
+ public IStatus validate(Object[] selection) {
+ if ( selection != null && selection.length > 0
+ && selection[0] instanceof IType)
+ return validateBaseClassName(
+ getObservedPage().getEnclosingType(),
+ ((IType)selection[0]).getElementName());
+ return StatusInfo.OK_STATUS;
+ };
+ });
+
+ if (dialog.open() == FilteredTypesSelectionDialog.OK)
+ {
+ return (IType) dialog.getFirstResult();
+ }
+ return null;
+ }
+
+ protected void handleEnclosingTypeDialogFieldIsEmpty(StatusInfo status)
+ {
+ status.setError(org.eclipse.jdt.internal.ui.wizards.NewWizardMessages.NewTypeWizardPage_error_EnclosingTypeEnterName);
+ }
+
+ @Override
+ protected IStatus validateEnclosingType() {
+ IStatus status = super.validateEnclosingType();
+ if (status.isOK())
+ cacheSuperTeams();
+ return status;
+ }
+
+ private void cacheSuperTeams() {
+ try {
+ IType enclosingType = this.getObservedPage().getEnclosingType();
+ ITypeHierarchy hierarchy = enclosingType.newSupertypeHierarchy(null);
+ fSuperTeams = hierarchy.getAllSuperclasses(enclosingType);
+ }
+ catch (JavaModelException ex) {
+ OTDTUIPlugin.getExceptionHandler().logException("Problems creating supertype hierarchy", ex); //$NON-NLS-1$
+ }
+ }
+
+ // ------ validation --------
+ public IStatus[] getRelevantStates(boolean ignoreFirstField)
+ {
+ if (ignoreFirstField)
+ return new IStatus[]
+ {
+ getObservedPage().getContainerStatus(),
+ _packageStatus,
+ _enclosingTeamStatus,
+ // not this one: _typeNameStatus,
+ _baseStatus,
+ _modifierStatus,
+ _superTypeStatus,
+ _superInterfacesStatus,
+ };
+ else
+ // status of all used components
+ return new IStatus[]
+ {
+ getObservedPage().getContainerStatus(),
+ _packageStatus,
+ _enclosingTeamStatus,
+ _typeNameStatus,
+ _baseStatus,
+ _modifierStatus,
+ _superTypeStatus,
+ _superInterfacesStatus,
+ };
+ }
+
+ private void handleImplicitSuperclassDialogField()
+ {
+ if (!(getObservedPage() instanceof NewRoleWizardPage))
+ return;
+
+ NewRoleWizardPage page = (NewRoleWizardPage) getObservedPage();
+ page.setImplicitSuperclassName(""); //$NON-NLS-1$
+
+ if (hasTypeNameError()) // don't proceed if there is an error already
+ return;
+
+ IType enclosingTeam = page.getEnclosingType();
+
+ if (enclosingTeam != null)
+ {
+ if (fSuperTeams == null)
+ cacheSuperTeams();
+
+ for (int idx = 0; idx < fSuperTeams.length; idx++)
+ {
+ IType memberType = fSuperTeams[idx].getType(page.getTypeName());
+ IOTType otType = OTModelManager.getOTElement(memberType);
+
+ if (otType != null && otType instanceof IRoleType)
+ {
+ String fullQualName = memberType.getFullyQualifiedName('.');
+ page.setImplicitSuperclassName(fullQualName);
+ return;
+ }
+ }
+ }
+ }
+
+ private boolean hasTypeNameError()
+ {
+ IStatus[] stati = new IStatus[] {
+ getObservedPage().getContainerStatus(),
+ _packageStatus,
+ _enclosingTeamStatus,
+ _typeNameStatus
+ };
+
+ return hasErrorStatus(stati);
+ }
+
+ private IStatus validateBaseClass()
+ {
+ NewRoleWizardPage page = (NewRoleWizardPage) getObservedPage();
+ String baseclassName = page.getBaseClassName();
+
+ if (baseclassName.length() == 0)
+ return StatusInfo.OK_STATUS; // a Role without a playedBy relation is just fine
+
+ // ERRORS:
+ IStatus validJava = JavaConventions.validateJavaTypeName(baseclassName);
+ if (validJava.getSeverity() == IStatus.ERROR)
+ return new StatusInfo(IStatus.ERROR,
+ Messages.format(org.eclipse.jdt.internal.ui.wizards.NewWizardMessages.NewTypeWizardPage_error_InvalidTypeName,
+ validJava.getMessage()));
+
+ // check shadowing (ERROR):
+ IType enclosingType = getObservedPage().getEnclosingType();
+ IStatus status = validateBaseClassName(enclosingType, baseclassName);
+ if (!status.isOK())
+ return status;
+
+ // WARNINGS:
+ if (validJava.getSeverity() == IStatus.WARNING)
+ return new StatusInfo(IStatus.WARNING,
+ Messages.format(org.eclipse.jdt.internal.ui.wizards.NewWizardMessages.NewTypeWizardPage_warning_TypeNameDiscouraged,
+ validJava.getMessage()));
+
+ return StatusInfo.OK_STATUS;
+ }
+
+ IStatus validateBaseClassName(IType enclosingType, String name) {
+ while (enclosingType != null) {
+ if (name.equals(enclosingType.getElementName())) {
+ return new StatusInfo(StatusInfo.ERROR,
+ Messages.format(
+ OTNewWizardMessages.NewRole_base_class_equals_enclosing,
+ name));
+ }
+ try {
+ for (IJavaElement member : enclosingType.getChildren()) {
+ if ( member.getElementType() == OTJavaElement.ROLE
+ && member.getElementName().equals(name))
+ return new StatusInfo(StatusInfo.ERROR,
+ Messages.format(
+ OTNewWizardMessages.NewRole_base_class_equals_member,
+ name));
+ }
+ } catch (JavaModelException e) { /* nop */ }
+ enclosingType = enclosingType.getDeclaringType();
+ }
+ return StatusInfo.OK_STATUS;
+ }
+
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/listeners/NewTeamWizardPageListener.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/listeners/NewTeamWizardPageListener.java
new file mode 100644
index 000000000..289203fcb
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/listeners/NewTeamWizardPageListener.java
@@ -0,0 +1,256 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2008 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: NewTeamWizardPageListener.java 23435 2010-02-04 00:14:38Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.wizards.listeners;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jdt.core.Flags;
+import org.eclipse.jdt.core.IPackageFragmentRoot;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.internal.corext.util.Messages;
+import org.eclipse.jdt.internal.ui.dialogs.StatusInfo;
+import org.eclipse.jdt.internal.ui.wizards.NewWizardMessages;
+import org.eclipse.jdt.internal.ui.wizards.dialogfields.SelectionButtonDialogFieldGroup;
+import org.eclipse.objectteams.otdt.core.IOTType;
+import org.eclipse.objectteams.otdt.core.OTModelManager;
+import org.eclipse.objectteams.otdt.core.compiler.IOTConstants;
+import org.eclipse.objectteams.otdt.internal.ui.wizards.NewTeamWizardPage;
+import org.eclipse.objectteams.otdt.internal.ui.wizards.NewTypeWizardPage;
+import org.eclipse.objectteams.otdt.internal.ui.wizards.OTNewWizardMessages;
+import org.eclipse.objectteams.otdt.ui.OTDTUIPlugin;
+
+
+/**
+ * The main listener class for org.eclipse.objectteams.otdt.internal.ui.wizards.NewTeamWizardPage.
+ * It listens to changes of the entry fields and clicks on the browse buttons
+ * of the observed NewTeamWizardPage
+ *
+ *
+ * @author kaschja
+ * @version $Id: NewTeamWizardPageListener.java 23435 2010-02-04 00:14:38Z stephan $
+ */
+public class NewTeamWizardPageListener extends NewTypeWizardPageListener
+{
+
+ public NewTeamWizardPageListener(NewTeamWizardPage observedPage)
+ {
+ super(observedPage);
+ }
+
+
+ protected IType chooseSuperType()
+ {
+ IPackageFragmentRoot root= getObservedPage().getPackageFragmentRoot();
+ if (root == null)
+ {
+ return null;
+ }
+
+ return chooseTeam(root.getJavaProject(),
+ getObservedPage().getShell(),
+ getObservedPage().getWizard().getContainer(),
+ OTNewWizardMessages.NewTeamWizardPage_ChooseSuperTypeDialog_title,
+ OTNewWizardMessages.NewTeamWizardPage_ChooseSuperTypeDialog_description,
+ getObservedPage().getSuperTypeName());
+ }
+
+ // ------ validation --------
+ public IStatus[] getRelevantStates(boolean ignoreFirstField)
+ {
+ if (ignoreFirstField)
+ return new IStatus[] {
+ getObservedPage().getContainerStatus(),
+
+ _packageStatus,
+ _enclosingTeamStatus,
+
+ // not this one: _typeNameStatus,
+ _modifierStatus,
+ _superTypeStatus,
+ _superInterfacesStatus
+
+ };
+ else
+ // status of all used components
+ return new IStatus[]
+ {
+ getObservedPage().getContainerStatus(),
+
+ _packageStatus,
+ _enclosingTeamStatus,
+
+ _typeNameStatus,
+ _modifierStatus,
+ _superTypeStatus,
+ _superInterfacesStatus
+ };
+ }
+
+
+ protected IStatus validateEnclosingType()
+ {
+ IStatus status = super.validateEnclosingType();
+ if ( status.getSeverity() == IStatus.ERROR )
+ {
+ //deselect and disable Inlined-Checkbox
+ getObservedPage().getInlineSelectionDialogField().setSelection(false);
+ getObservedPage().getInlineSelectionDialogField().setEnabled(false);
+ }
+ handleAccessModifierButtons();
+ getObservedPage().updateEnableState();
+ return status;
+ }
+
+ @Override
+ void validateSuperClass(StatusInfo status) {
+ super.validateSuperClass(status);
+
+ // deselect Bindingeditor when supertype == o.o.Team
+ IType superType = getObservedPage().getSuperType();
+ if (superType == null)
+ return;
+ IOTType superTeam = OTModelManager.getOTElement(superType);
+ if (! superType.getFullyQualifiedName().equals(String.valueOf(IOTConstants.STR_ORG_OBJECTTEAMS_TEAM)) && superTeam != null)
+ {
+ SelectionButtonDialogFieldGroup bindingEditorGroup = ((NewTeamWizardPage)getObservedPage()).getBindingEditorButtons();
+ bindingEditorGroup.setEnabled(true);
+ }
+ }
+
+ protected void handleEnclosingTypeDialogFieldIsEmpty(StatusInfo status)
+ {
+ getObservedPage().getPackageDialogField().setEnabled(true);
+
+ //disable Inlined-Checkbox
+ getObservedPage().getInlineSelectionDialogField().setSelection(false);
+ getObservedPage().getInlineSelectionDialogField().setEnabled(false);
+
+ super.handleEnclosingTypeDialogFieldIsEmpty(status);
+ }
+
+ protected void handleAccessModifierButtons()
+ {
+ SelectionButtonDialogFieldGroup modifierButtons = getObservedPage().getAccessModifierButtons();
+
+ if (getObservedPage().getEnclosingTypeName().equals("")) //$NON-NLS-1$
+ {
+ int modifiers = getObservedPage().getModifiers();
+ if (Flags.isPrivate(modifiers) || Flags.isProtected(modifiers))
+ {
+ modifierButtons.setSelection(NewTypeWizardPage.PRIVATE_INDEX, false);
+ modifierButtons.setSelection(NewTypeWizardPage.PROTECTED_INDEX, false);
+ modifierButtons.setSelection(NewTypeWizardPage.PUBLIC_INDEX, true);
+ }
+ modifierButtons.enableSelectionButton(NewTypeWizardPage.PRIVATE_INDEX, false);
+ modifierButtons.enableSelectionButton(NewTypeWizardPage.PROTECTED_INDEX, false);
+ }
+ else
+ {
+ modifierButtons.enableSelectionButton(NewTypeWizardPage.PRIVATE_INDEX, true);
+ modifierButtons.enableSelectionButton(NewTypeWizardPage.PROTECTED_INDEX, true);
+ }
+ }
+
+
+ /**
+ * Gets called when the package field has changed. The method
+ * validates the package name and returns the status of the validation.
+ * The validation also updates the package fragment model.
+ *
+ * @return the status of the validation
+ */
+ protected IStatus validatePackage() {
+ StatusInfo status = new StatusInfo();
+
+ updatePackageStatusLabel();
+ getObservedPage().getPackageDialogField().enableButton(getObservedPage().getPackageFragmentRoot() != null);
+
+ String packName = getObservedPage().getPackageName();
+ if (packName.trim().length() > 0)
+ {
+ IStatus val = NewTypeWizardPage.validatePackageName(packName, getObservedPage().getJavaProject());
+ if (val.getSeverity() == IStatus.ERROR)
+ {
+ status.setError(Messages.format(NewWizardMessages.NewTypeWizardPage_error_InvalidPackageName, val.getMessage()));
+ return status;
+ }
+ else if (val.getSeverity() == IStatus.WARNING)
+ {
+ status.setWarning(Messages.format(NewWizardMessages.NewTypeWizardPage_warning_DiscouragedPackageName, val.getMessage()));
+ // continue
+ }
+ }
+
+ IPackageFragmentRoot root = getObservedPage().getPackageFragmentRoot();
+ if (root != null)
+ {
+ if (root.getJavaProject().exists() && packName.trim().length() > 0)
+ {
+ try
+ {
+ IPath rootPath = root.getPath();
+ IPath outputPath = root.getJavaProject().getOutputLocation();
+
+ if (rootPath.isPrefixOf(outputPath)
+ && !rootPath.equals(outputPath))
+ {
+ // if the bin folder is inside of our root, dont allow to name a package
+ // like the bin folder
+ IPath packagePath = rootPath.append(packName.replace('.', '/'));
+
+ if (outputPath.isPrefixOf(packagePath))
+ {
+ status.setError(NewWizardMessages.NewTypeWizardPage_error_ClashOutputLocation);
+ return status;
+ }
+ }
+ }
+ catch (JavaModelException ex)
+ {
+ OTDTUIPlugin.getExceptionHandler().logCoreException("", ex); //$NON-NLS-1$
+ // let pass
+ }
+ }
+ getObservedPage().setPackageFragment(root.getPackageFragment(packName), true);
+ }
+ else
+ {
+ status.setError(""); //$NON-NLS-1$
+ }
+ return status;
+ }
+
+
+ protected void updatePackageStatusLabel() {
+ String packName = getObservedPage().getPackageName();
+
+ if (packName.length() == 0)
+ {
+ getObservedPage().getPackageDialogField().setStatus(NewWizardMessages.NewTypeWizardPage_default);
+ }
+ else
+ {
+ getObservedPage().getPackageDialogField().setStatus(""); //$NON-NLS-1$
+ }
+ }
+
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/listeners/NewTypeWizardPageListener.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/listeners/NewTypeWizardPageListener.java
new file mode 100644
index 000000000..059b1ece3
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/listeners/NewTypeWizardPageListener.java
@@ -0,0 +1,908 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2003, 2009 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: NewTypeWizardPageListener.java 23435 2010-02-04 00:14:38Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.wizards.listeners;
+
+import java.util.List;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IPackageFragment;
+import org.eclipse.jdt.core.IPackageFragmentRoot;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.ITypeHierarchy;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.core.dom.Type;
+import org.eclipse.jdt.core.search.IJavaSearchScope;
+import org.eclipse.jdt.internal.corext.refactoring.TypeContextChecker;
+import org.eclipse.jdt.internal.corext.util.JavaModelUtil;
+import org.eclipse.jdt.internal.corext.util.Messages;
+import org.eclipse.jdt.internal.ui.JavaPlugin;
+import org.eclipse.jdt.internal.ui.dialogs.StatusInfo;
+import org.eclipse.jdt.internal.ui.wizards.NewWizardMessages;
+import org.eclipse.jdt.internal.ui.wizards.SuperInterfaceSelectionDialog;
+import org.eclipse.jdt.internal.ui.wizards.dialogfields.DialogField;
+import org.eclipse.jdt.internal.ui.wizards.dialogfields.IDialogFieldListener;
+import org.eclipse.jdt.internal.ui.wizards.dialogfields.IListAdapter;
+import org.eclipse.jdt.internal.ui.wizards.dialogfields.IStringButtonAdapter;
+import org.eclipse.jdt.internal.ui.wizards.dialogfields.ListDialogField;
+import org.eclipse.jdt.ui.JavaElementLabelProvider;
+import org.eclipse.jface.operation.IRunnableContext;
+import org.eclipse.jface.window.Window;
+import org.eclipse.jface.wizard.IWizardContainer;
+import org.eclipse.objectteams.otdt.core.IOTType;
+import org.eclipse.objectteams.otdt.core.OTModelManager;
+import org.eclipse.objectteams.otdt.core.search.OTSearchEngine;
+import org.eclipse.objectteams.otdt.internal.ui.wizards.NewTeamWizardPage;
+import org.eclipse.objectteams.otdt.internal.ui.wizards.NewTypeWizardPage;
+import org.eclipse.objectteams.otdt.ui.OTDTUIPlugin;
+import org.eclipse.objectteams.otdt.ui.dialogs.TeamSelectionDialog;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.dialogs.ElementListSelectionDialog;
+
+
+/**
+ * The main listener class for org.eclipse.objectteams.otdt.internal.ui.wizards.NewTypeWizardPage.
+ * It listens to changes of the entry fields and clicks on the browse buttons
+ * of the observed NewTypeWizardPage.
+ *
+ * @author kaschja
+ * @version $Id: NewTypeWizardPageListener.java 23435 2010-02-04 00:14:38Z stephan $
+ */
+public abstract class NewTypeWizardPageListener implements IStringButtonAdapter,
+ IDialogFieldListener,
+ IListAdapter
+{
+ protected static final int CONTAINER = 1;
+ protected static final int PACKAGE = 2;
+ protected static final int ENCLOSINGTYPE = 3;
+ protected static final int NAME = 4;
+ protected static final int SUPERTYPE = 5;
+ protected static final int SUPERINTERFACES = 6;
+ protected static final int ENCLOSINGTYPESELECTION = 7;
+
+ protected IStatus _packageStatus = new StatusInfo();
+ protected IStatus _enclosingTeamStatus = new StatusInfo();
+ protected IStatus _typeNameStatus = new StatusInfo();
+ protected IStatus _modifierStatus = new StatusInfo();
+ protected IStatus _superTypeStatus = new StatusInfo();
+ protected IStatus _superInterfacesStatus = new StatusInfo();
+
+ private NewTypeWizardPage _observedPage;
+
+
+ public NewTypeWizardPageListener(NewTypeWizardPage observedPage)
+ {
+ _observedPage = observedPage;
+ }
+
+//------------------------------------------------------------------------------
+
+ // -------- IStringButtonAdapter
+ /**
+ * gets called when a browse button of the observed wizard page is clicked
+ */
+ public void changeControlPressed(DialogField field)
+ {
+ handleChangeControlPressed(field);
+ }
+
+ // -------- IDialogFieldListener
+ /**
+ * gets called when the content of a dialog field of the observed wizard page
+ * has changed
+ */
+ public void dialogFieldChanged(DialogField field)
+ {
+ if (field == _observedPage.getTypeNameDialogField())
+ _observedPage.publicTypeNameChanged(); // will eventually set _observedPage._currentType
+ int changedElement = getChangedElement(field);
+ performReviews(changedElement);
+ updateStatus();
+ }
+
+ public void doubleClicked(ListDialogField field)
+ {
+ }
+
+ //-------- IListAdapter
+ /**
+ * gets called when the add interface button of the observed page is clicked
+ */
+ public void customButtonPressed(ListDialogField field, int index)
+ {
+ chooseSuperInterfaces(field);
+ }
+ public void selectionChanged(ListDialogField field) {}
+
+//------------------------------------------------------------------------------
+
+ protected NewTypeWizardPage getObservedPage()
+ {
+ return _observedPage;
+ }
+
+ protected int getChangedElement(DialogField field)
+ {
+ int change = 0;
+
+ if (field == getObservedPage().getPackageDialogField())
+ {
+ change = PACKAGE;
+ }
+ else if (field == getObservedPage().getEnclosingTypeDialogField())
+ {
+ change = ENCLOSINGTYPE;
+ }
+ else if (field == getObservedPage().getInlineSelectionDialogField())
+ {
+ }
+ else if (field == getObservedPage().getTypeNameDialogField())
+ {
+ change = NAME;
+ }
+ else if (field == getObservedPage().getSuperTypeDialogField())
+ {
+ change = SUPERTYPE;
+ }
+ else if (field == getObservedPage().getSuperInterfacesDialogField())
+ {
+ change = SUPERINTERFACES;
+ }
+ else if (field == getObservedPage().getEnclosingTypeSelectionField())
+ {
+ change = ENCLOSINGTYPESELECTION;
+ }
+
+ return change;
+ }
+
+ /**
+ * After calling this method, call updateStatus() to reflect the review-status in the UI.
+ * @param change The dialog field, that was changed, one of CONTAINER, PACKAGE, ENCLOSINGTYPE...
+ */
+ protected void performReviews(int change)
+ {
+ switch (change)
+ {
+ case CONTAINER :
+ _packageStatus = validatePackage();
+ _enclosingTeamStatus = validateEnclosingType();
+ _typeNameStatus = validateTypeName();
+ _superTypeStatus = validateSuperType();
+ _superInterfacesStatus = validateSuperInterfaces();
+ break;
+
+ case PACKAGE:
+ _packageStatus = validatePackage();
+ _enclosingTeamStatus = validateEnclosingType();
+ _typeNameStatus = validateTypeName();
+ break;
+
+ case ENCLOSINGTYPE:
+ _enclosingTeamStatus = validateEnclosingType();
+ _typeNameStatus = validateTypeName();
+ break;
+ case ENCLOSINGTYPESELECTION:
+ _packageStatus = validatePackage();
+ _enclosingTeamStatus = validateEnclosingType();
+ _typeNameStatus = validateTypeName();
+ break;
+ case NAME:
+ _typeNameStatus = validateTypeName();
+ break;
+
+ case SUPERTYPE:
+ _superTypeStatus = validateSuperType();
+
+ case SUPERINTERFACES:
+ validateSuperInterfaces();
+
+ default :
+ break;
+ }
+ }
+
+ protected void handleChangeControlPressed(DialogField field)
+ {
+ if (field == getObservedPage().getPackageDialogField())
+ {
+ IPackageFragment pack= choosePackage();
+ if (pack != null)
+ {
+ getObservedPage().setPackageFragmentName(pack.getElementName());
+ }
+ }
+ else if (field == getObservedPage().getEnclosingTypeDialogField())
+ {
+ IType type= chooseEnclosingType();
+
+ if (type != null)
+ {
+ String packageName = type.getPackageFragment().getElementName();
+ getObservedPage().setPackageFragmentName(packageName);
+ String qualifiedTeam = type.getFullyQualifiedName('.');
+ getObservedPage().setEnclosingTypeName(qualifiedTeam);
+ }
+ }
+ else if (field == getObservedPage().getSuperTypeDialogField())
+ {
+ IType supertype = chooseSuperType();
+
+ if (supertype != null)
+ {
+ getObservedPage().setSuperTypeName(supertype.getFullyQualifiedName('.'));
+ }
+ }
+ }
+
+ private IPackageFragment choosePackage()
+ {
+ IPackageFragmentRoot froot = getObservedPage().getPackageFragmentRoot();
+ IJavaElement[] packages = null;
+ try
+ {
+ if (froot != null && froot.exists())
+ {
+ packages= froot.getChildren();
+ }
+ }
+ catch (JavaModelException ex)
+ {
+ OTDTUIPlugin.getExceptionHandler().logCoreException(null, ex);
+ }
+
+ if (packages == null)
+ {
+ packages= new IJavaElement[0];
+ }
+
+ ElementListSelectionDialog dialog = new ElementListSelectionDialog(getObservedPage().getShell(),
+ new JavaElementLabelProvider(JavaElementLabelProvider.SHOW_DEFAULT));
+ dialog.setIgnoreCase(false);
+ dialog.setTitle(NewWizardMessages.NewTypeWizardPage_ChoosePackageDialog_title);
+ dialog.setMessage(NewWizardMessages.NewTypeWizardPage_ChoosePackageDialog_description);
+ dialog.setEmptyListMessage(NewWizardMessages.NewTypeWizardPage_ChoosePackageDialog_empty);
+ dialog.setElements(packages);
+ IPackageFragment pack = getObservedPage().getPackageFragment();
+
+ if (pack != null)
+ {
+ dialog.setInitialSelections(new Object[] { pack });
+ }
+
+ if (dialog.open() == ElementListSelectionDialog.OK)
+ {
+ return (IPackageFragment) dialog.getFirstResult();
+ }
+ return null;
+ }
+
+ // TODO(SH): this method could easily be reused by clients, look for better location then.
+ public static IType chooseTeam(IJavaElement searchScope, Shell shell, IWizardContainer container, String dialogTitle, String dialogMessage, String filter)
+ {
+ IJavaSearchScope scope= OTSearchEngine.createOTSearchScope(new IJavaElement[] { searchScope }, true);
+ TeamSelectionDialog dialog = new TeamSelectionDialog(shell, container, scope);
+ dialog.setTitle(dialogTitle);
+ dialog.setMessage(dialogMessage);
+ dialog.setFilter(filter);
+
+
+ if (dialog.open() == Window.OK)
+ return (IType) dialog.getFirstResult();
+
+ return null;
+ }
+
+ protected abstract IType chooseSuperType();
+
+ private void chooseSuperInterfaces(ListDialogField field)
+ {
+ IPackageFragmentRoot root= getObservedPage().getPackageFragmentRoot();
+ if (root == null)
+ {
+ return;
+ }
+
+ SuperInterfaceSelectionDialog dialog;
+
+
+ Shell parent = getObservedPage().getShell();
+ IRunnableContext context = getObservedPage().getWizard().getContainer();
+ NewTypeWizardPage page = getObservedPage();
+ IJavaProject root2 = root.getJavaProject();
+
+ dialog = new SuperInterfaceSelectionDialog(parent, context, page, root2);
+/* dialog = new SuperInterfaceSelectionDialog(getObservedPage().getShell(),
+ getObservedPage().getWizard().getContainer(),
+ getObservedPage(),
+ root.getJavaProject());
+*/ dialog.setTitle( NewWizardMessages.NewTypeWizardPage_InterfacesDialog_class_title);
+ dialog.setMessage(NewWizardMessages.NewTypeWizardPage_InterfacesDialog_message);
+ dialog.open();
+ return;
+ }
+
+ protected IType chooseEnclosingType()
+ {
+ return getObservedPage().chooseEnclosingType();
+ }
+
+ protected boolean hasErrorStatus(IStatus[] stati)
+ {
+ for (int i = 0; i < stati.length; i++)
+ {
+ if (stati[i] != null && stati[i].getSeverity() == IStatus.ERROR)
+ return true;
+ }
+
+ return false;
+ }
+
+ public abstract IStatus[] getRelevantStates(boolean ignoreFirstField);
+
+ protected void updateStatus()
+ {
+ // the most severe status will be displayed and the ok button enabled/disabled.
+ getObservedPage().updateStatus(getRelevantStates(false));
+ }
+
+ /**
+ * Gets called when the type name has changed. The method validates the
+ * type name and returns the status of the validation.
+ *
+ * @return the status of the validation
+ */
+ protected IStatus validateTypeName()
+ {
+ StatusInfo status = new StatusInfo();
+ String typeName = getObservedPage().getTypeName();
+
+ // must not be empty
+ if (typeName.length() == 0)
+ {
+ status.setError(NewWizardMessages.NewTypeWizardPage_error_EnterTypeName);
+ return status;
+ }
+ if (typeName.indexOf('.') != -1)
+ {
+ status.setError(NewWizardMessages.NewTypeWizardPage_error_QualifiedName);
+ return status;
+ }
+ IStatus val = NewTypeWizardPage.validateJavaTypeName(typeName, getObservedPage().getJavaProject());
+ if (val.getSeverity() == IStatus.ERROR)
+ {
+ status.setError(Messages.format(NewWizardMessages.NewTypeWizardPage_error_InvalidTypeName, val.getMessage()));
+ return status;
+ }
+ else if (val.getSeverity() == IStatus.WARNING)
+ {
+ status.setWarning(Messages.format(NewWizardMessages.NewTypeWizardPage_warning_TypeNameDiscouraged, val.getMessage()));
+ // continue checking
+ }
+
+ // role file must not exist
+ IType enclosingTeam = getObservedPage().getEnclosingType();
+ IPackageFragment pack = getObservedPage().getPackageFragment();
+ if ((pack == null) && (enclosingTeam != null)) // manually create package via team
+ {
+ pack = getTeamPackage(enclosingTeam);
+ }
+
+ if (pack != null)
+ {
+ ICompilationUnit cu = pack.getCompilationUnit(typeName + ".java"); //$NON-NLS-1$
+ if (cu.getResource().exists())
+ {
+ status.setError(NewWizardMessages.NewTypeWizardPage_error_TypeNameExists);
+ return status;
+ }
+ }
+ // inlined role must not exist
+ if (enclosingTeam != null)
+ {
+ IType member = enclosingTeam.getType(typeName);
+ {
+ if (member.exists())
+ {
+ status.setError(NewWizardMessages.NewTypeWizardPage_error_TypeNameExists);
+ return status;
+ }
+ }
+ }
+
+ validateSuperClass(status);
+
+ return status;
+ }
+
+ /**
+ * @param teamType the team (maybe nested) to look up the team package for
+ * @return the team package, which may not physically exist or null if an exception occurred.
+ */
+ private IPackageFragment getTeamPackage(IType teamType)
+ {
+ String enclosingTeamName = teamType.getTypeQualifiedName('/'); // e.g. "Outer/Inner/MostInner"
+ try {
+ IPath teamPackagePath = teamType.getPackageFragment().getPath();
+ teamPackagePath = teamPackagePath.append(enclosingTeamName);
+ return teamType.getJavaProject().findPackageFragment(teamPackagePath);
+ }
+ catch (JavaModelException ex)
+ {
+ // package does not exist
+ }
+ return null;
+ }
+
+ /**
+ * Gets called when the enclosing type name has changed. The method
+ * validates the enclosing type and returns the status of the validation.
+ * It also updates the enclosing type model.
+ *
+ * @return the status of the validation
+ */
+ protected IStatus validateEnclosingType()
+ {
+ StatusInfo status = new StatusInfo();
+ getObservedPage().setEnclosingType(null, true);
+
+ IPackageFragmentRoot root = getObservedPage().getPackageFragmentRoot();
+ if (root == null)
+ {
+ status.setError(""); //$NON-NLS-1$
+ return status;
+ }
+
+ String enclName = getObservedPage().getEnclosingTypeName();
+ if (enclName.trim().length() == 0)
+ {
+ handleEnclosingTypeDialogFieldIsEmpty(status);
+ return status;
+ }
+ else
+ {
+ if (_observedPage instanceof NewTeamWizardPage)
+ {
+ _observedPage.getPackageDialogField().setEnabled(false);
+ }
+ }
+
+ try
+ {
+ IType type = root.getJavaProject().findType(enclName);
+
+ if (type == null)
+ {
+ status.setError(NewWizardMessages.NewTypeWizardPage_error_EnclosingTypeNotExists);
+ }
+ else if (type.getCompilationUnit() == null)
+ {
+ status.setError(NewWizardMessages.NewTypeWizardPage_error_EnclosingNotInCU);
+ }
+ else if (!JavaModelUtil.isEditable(type.getCompilationUnit()))
+ {
+ status.setError(NewWizardMessages.NewTypeWizardPage_error_EnclosingNotEditable);
+ }
+ else if (type.equals(getObservedPage().getSuperType()))
+ {
+ status.setError(org.eclipse.objectteams.otdt.internal.ui.wizards.OTNewWizardMessages.NewTypeWizardPage_same_enclosing_and_super_error);
+ }
+
+ if (status.isError())
+ {
+ return status;
+ }
+
+ getObservedPage().setEnclosingType(type, true);
+
+ IPackageFragmentRoot enclosingRoot = JavaModelUtil.getPackageFragmentRoot(type);
+ if (!enclosingRoot.equals(root))
+ {
+ status.setWarning(NewWizardMessages.NewTypeWizardPage_warning_EnclosingNotInSourceFolder);
+ }
+
+ validateSuperClass(status);
+
+ //enable Inlined-Checkbox
+ getObservedPage().getInlineSelectionDialogField().setEnabled(true);
+ return status;
+ }
+ catch (JavaModelException ex)
+ {
+ status.setError(NewWizardMessages.NewTypeWizardPage_error_EnclosingTypeNotExists);
+ OTDTUIPlugin.getExceptionHandler().logCoreException("", ex); //$NON-NLS-1$
+ return status;
+ }
+ }
+
+ protected void handleEnclosingTypeDialogFieldIsEmpty(StatusInfo status)
+ {
+ validateSuperClass(status);
+ }
+
+ /**
+ * Gets called when the package field has changed. The method
+ * validates the package name and returns the status of the validation.
+ * The validation also updates the package fragment model.
+ *
+ * @return the status of the validation
+ */
+ protected IStatus validatePackage() {
+ return new StatusInfo(); // default: nothing to check
+ }
+
+ /**
+ * Gets called when the list of super interface has changed. The method
+ * validates the superinterfaces and returns the status of the validation.
+ *
+ * @return the status of the validation
+ */
+ protected IStatus validateSuperInterfaces()
+ {
+ StatusInfo status = new StatusInfo();
+
+ IPackageFragmentRoot root = getObservedPage().getPackageFragmentRoot();
+ getObservedPage().getSuperInterfacesDialogField().enableButton(
+ 0,
+ root != null);
+
+ if (root != null)
+ {
+ List elements = getObservedPage().getSuperInterfaces();
+ int nElements = elements.size();
+ for (int i = 0; i < nElements; i++)
+ {
+ String intfname = (String) elements.get(i);
+ Type type= TypeContextChecker.parseSuperInterface(intfname);
+ if (type == null) {
+ status.setError(Messages.format(NewWizardMessages.NewTypeWizardPage_error_InvalidSuperInterfaceName, intfname));
+ return status;
+ }
+ }
+ }
+ return status;
+ }
+
+ /**
+ * Gets called when the superclass name has changed. The method
+ * validates the superclass name and returns the status of the validation.
+ *
+ * @return the status of the validation
+ */
+ protected IStatus validateSuperType()
+ {
+ StatusInfo status = new StatusInfo();
+ IPackageFragmentRoot root = getObservedPage().getPackageFragmentRoot();
+ getObservedPage().getSuperTypeDialogField().enableButton(root != null);
+
+ getObservedPage().setSuperType(null);
+
+ String superTypeName = getObservedPage().getSuperTypeName();
+ if (superTypeName.trim().length() == 0)
+ {
+ // accept the empty field (stands for java.lang.Object)
+ return status;
+ }
+ IStatus val = NewTypeWizardPage.validateJavaTypeName(superTypeName, getObservedPage().getJavaProject());
+ if (val.getSeverity() == IStatus.ERROR)
+ {
+ status.setError(NewWizardMessages.NewTypeWizardPage_error_InvalidSuperClassName);
+ return status;
+ }
+ if (root != null)
+ {
+ try
+ {
+ Type type= TypeContextChecker.parseSuperClass(superTypeName);
+ if (type == null) {
+ status.setError(NewWizardMessages.NewTypeWizardPage_error_InvalidSuperClassName);
+ return status;
+ }
+ IType iType = resolveSuperTypeName(root.getJavaProject(), superTypeName);
+ if (iType == null) {
+ status.setError(NewWizardMessages.NewTypeWizardPage_error_InvalidSuperClassName);
+ return status;
+ }
+ if (iType.equals(getObservedPage().getEnclosingType()))
+ {
+ status.setError(org.eclipse.objectteams.otdt.internal.ui.wizards.OTNewWizardMessages.NewTypeWizardPage_same_enclosing_and_super_error);
+ }
+ getObservedPage().setSuperType(iType);
+ validateSuperClass(status);
+ }
+ catch (JavaModelException e)
+ {
+ status.setError(NewWizardMessages.NewTypeWizardPage_error_InvalidSuperClassName);
+ JavaPlugin.log(e);
+ }
+ }
+ else
+ {
+ status.setError(""); //$NON-NLS-1$
+ }
+ return status;
+ }
+
+ private IType resolveSuperTypeName(IJavaProject jproject, String supertypeName)
+ throws JavaModelException
+ {
+ if (!jproject.exists())
+ {
+ return null;
+ }
+ IType supertype = null;
+
+ //TODO (kaschja): handle case of external defined role class
+ //innerclass (internal defined role class)
+ if ( (getObservedPage().getEnclosingType() != null)
+ && (getObservedPage().isInlineTypeSelected()) )
+ {
+ // search in the context of the enclosing type
+ IType enclosingType = getObservedPage().getEnclosingType();
+
+ String[][] res = enclosingType.resolveType(supertypeName);
+ if (res != null && res.length > 0)
+ {
+ supertype = jproject.findType(res[0][0], res[0][1]);
+ }
+ }
+ else
+ {
+ IPackageFragment currPack = getObservedPage().getPackageFragment();
+ if (currPack != null)
+ {
+ String packName = currPack.getElementName();
+ // search in own package
+ if (!currPack.isDefaultPackage())
+ {
+ supertype = jproject.findType(packName, supertypeName);
+ }
+ // search in java.lang
+ if (supertype == null && !"java.lang".equals(packName)) //$NON-NLS-1$
+ {
+ supertype = jproject.findType("java.lang", supertypeName); //$NON-NLS-1$
+ }
+ }
+ // search fully qualified
+ if (supertype == null)
+ {
+ supertype = jproject.findType(supertypeName);
+ }
+ }
+ return supertype;
+ }
+
+ /**
+ * workaround
+ *
+ * The containerDialogField of the observed NewTypeWizardPage
+ * is defined in a superclass and declared private. That's why this listener
+ * cannot be registered to this dialog field. So its dialogFieldChanged method
+ * does not get called when the container dialog field has changed.
+ * Fortunately the observed NewTypeWizardPage gets informed about changes of
+ * this dialog field via its superclass hook method handleFieldChanged.
+ * So it can inform its listener by calling this method.
+ *
+ * simulates call of handleDialogFieldChanged
+ */
+ public void handleContainerChanged()
+ {
+ //TODO (kaschja): check if the container is inside a or itself an OTProject
+ // getObservedPage().getPackageFragmentRoot().getJavaProject().getProject().getNature(natureId);
+
+ performReviews(CONTAINER);
+ updateStatus();
+ }
+
+
+ void validateSuperClass(StatusInfo status)
+ {
+
+ IType superType = getObservedPage().getSuperType();
+ IType enclosingType = getObservedPage().getEnclosingType();
+ String newRoleName = getObservedPage().getTypeName().trim();
+
+ IOTType superTypeOTElem = null;
+
+ if (superType == null)
+ return;
+
+ superTypeOTElem = OTModelManager.getOTElement(superType);
+
+ try {
+ if ( (superTypeOTElem != null) && superTypeOTElem.isRole() )
+ {
+ checkSuperRoleType(status, enclosingType, superType, newRoleName);
+
+ if (status.isError())
+ return;
+ }
+
+ // TODO (carp): check if this works
+// old TODO (kaschja) comment the following section in by the time IType.newSuperTypeHierarchy works properly for role classes
+// if ( isTypeToBeCreatedARole() && ! newRoleName.equals("") )
+// {
+// checkImplicitRoleHierarchyForExplicitSuperClass(status, enclosingType, superType, newRoleName);
+// }
+
+ }
+ catch (JavaModelException ex) {
+ ex.printStackTrace();
+ }
+ }
+
+
+ private void checkSuperRoleType(StatusInfo status, IType enclosingType, IType superType, String newRoleName) throws JavaModelException
+ {
+ if ( ! isTypeToBeCreatedARole() )
+ {
+ status.setError(org.eclipse.objectteams.otdt.internal.ui.wizards.OTNewWizardMessages.NewTypeWizardPage_super_of_regular_is_role_error);
+ return;
+ }
+
+ if ( ! isSuperRolesTeamContainedInEnclosingTypesHierarchy(enclosingType, superType) )
+ {
+ status.setError(org.eclipse.objectteams.otdt.internal.ui.wizards.OTNewWizardMessages.NewRoleWizardPage_super_is_role_of_different_team_error);
+ return;
+ }
+
+ if ( newRoleName.equals( superType.getElementName() ) )
+ {
+ status.setError(org.eclipse.objectteams.otdt.internal.ui.wizards.OTNewWizardMessages.NewRoleWizardPage_explicit_and_implicit_subclassing_error);
+ return;
+ }
+
+ if ( hasSuperroleOverridingImplicitSubrole(enclosingType, superType) )
+ {
+ status.setError(org.eclipse.objectteams.otdt.internal.ui.wizards.OTNewWizardMessages.NewRoleWizardPage_super_is_overridden_error);
+ return;
+ }
+ }
+
+ /**
+ * checks if the role that is to be created
+ * has already an explicit superclass
+ * (that is the role that is to be created has an implicit superrole which has an explicit superclass)
+ * and if so
+ * the class that is intended to be the explicit superclass of the role that is to be created
+ * must be a subclass of the existing explicit superclass
+ * otherwise the status is set to ERROR
+ *
+ * FIXME(SH): add a call to this method!
+ */
+ private void checkImplicitRoleHierarchyForExplicitSuperClass(StatusInfo status, IType enclosingType, IType superType, String newRoleName)
+ throws JavaModelException
+ {
+ IType explicitSuperclassOfImplicitSuperrole = getExplicitSuperclassOfImplicitSuperrole(enclosingType, newRoleName);
+
+ if (explicitSuperclassOfImplicitSuperrole != null)
+ {
+ if (explicitSuperclassOfImplicitSuperrole.getFullyQualifiedName().equals(superType.getFullyQualifiedName()))
+ {
+ status.setInfo(Messages.format(
+ org.eclipse.objectteams.otdt.internal.ui.wizards.OTNewWizardMessages.NewRoleWizardPage_already_has_this_super,
+ superType.getFullyQualifiedName()));
+ return;
+ }
+
+ ITypeHierarchy superTypeHierarchy = superType.newSupertypeHierarchy(new NullProgressMonitor());
+
+ if ( !superTypeHierarchy.contains(explicitSuperclassOfImplicitSuperrole))
+ {
+ status.setError(Messages.format(
+ org.eclipse.objectteams.otdt.internal.ui.wizards.OTNewWizardMessages.NewRoleWizardPage_incompatible_supers_error,
+ explicitSuperclassOfImplicitSuperrole.getFullyQualifiedName()));
+ return;
+ }
+ }
+ }
+
+ private IType getExplicitSuperclassOfImplicitSuperrole(IType teamType, String roleSimpleName) throws JavaModelException
+ {
+ IOTType teamOTElem = OTModelManager.getOTElement(teamType);
+
+ if ( (teamOTElem == null) || (!teamOTElem.isTeam()) )
+ {
+ return null;
+ }
+
+ ITypeHierarchy teamSuperHierarchy = teamType.newSupertypeHierarchy(null);
+ IType[] superTeams = teamSuperHierarchy.getAllSuperclasses(teamType);
+ IType curRole = null;
+ ITypeHierarchy explicitRoleSuperHierarchy = null;
+
+ for (int idx = 0; idx < superTeams.length; idx++)
+ {
+ curRole = superTeams[idx].getType(roleSimpleName);
+ if (curRole.exists())
+ {
+ explicitRoleSuperHierarchy = curRole.newSupertypeHierarchy(null);
+ if (explicitRoleSuperHierarchy.getSuperclass(curRole) != null)
+ {
+ return explicitRoleSuperHierarchy.getSuperclass(curRole);
+ }
+ }
+ }
+ return null;
+ }
+
+ private boolean isTypeToBeCreatedARole()
+ {
+ IType enclosingType = getObservedPage().getEnclosingType();
+
+ if (enclosingType == null)
+ {
+ return false;
+ }
+ IOTType enclosingTypeOTElem = OTModelManager.getOTElement(enclosingType);
+
+ if ( (enclosingTypeOTElem == null) || ( ! enclosingTypeOTElem.isTeam()) )
+ {
+ return false;
+ }
+ return true;
+ }
+
+ private boolean isSuperRolesTeamContainedInEnclosingTypesHierarchy(IType enclosingTeam, IType superRole)
+ throws JavaModelException
+ {
+ ITypeHierarchy teamHierarchy = enclosingTeam.newSupertypeHierarchy(null);
+ IType teamOfSuperType = superRole.getDeclaringType();
+
+ if ( ! teamHierarchy.contains(teamOfSuperType) )
+ {
+ return false;
+ }
+ return true;
+ }
+
+ private boolean hasSuperroleOverridingImplicitSubrole(IType enclosingTeam, IType superRole) throws JavaModelException
+ {
+ IType teamOfSuperrole = superRole.getDeclaringType();
+
+ if (enclosingTeam.getFullyQualifiedName().equals(teamOfSuperrole.getFullyQualifiedName()))
+ {
+ return false;
+ }
+
+ ITypeHierarchy enclosingTeamHierarchy = enclosingTeam.newSupertypeHierarchy(null);
+ IType[] superTeams = enclosingTeamHierarchy.getAllSuperclasses(enclosingTeam);
+ IType implicitSubrole = null;
+ int idx = 0;
+ IType curTeam = superTeams[idx];
+
+ while ( ! curTeam.getFullyQualifiedName().equals(teamOfSuperrole.getFullyQualifiedName()))
+ {
+ implicitSubrole = curTeam.getType(superRole.getElementName());
+ if (implicitSubrole.exists())
+ {
+ return true;
+ }
+ idx++;
+ curTeam = superTeams[idx];
+ }
+ return false;
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/listeners/SuperInterfacesListener.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/listeners/SuperInterfacesListener.java
new file mode 100644
index 000000000..696bec894
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/listeners/SuperInterfacesListener.java
@@ -0,0 +1,84 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2003, 2009 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: SuperInterfacesListener.java 23435 2010-02-04 00:14:38Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.wizards.listeners;
+
+import org.eclipse.jdt.core.IPackageFragmentRoot;
+import org.eclipse.jdt.internal.ui.wizards.NewWizardMessages;
+import org.eclipse.jdt.internal.ui.wizards.SuperInterfaceSelectionDialog;
+import org.eclipse.jdt.internal.ui.wizards.dialogfields.IListAdapter;
+import org.eclipse.jdt.internal.ui.wizards.dialogfields.ListDialogField;
+import org.eclipse.objectteams.otdt.internal.ui.wizards.NewTypeWizardPage;
+
+
+/**
+ * A listener for org.eclipse.objectteams.otdt.internal.ui.wizards.NewTypeWizardPage.
+ * It listens to changes of the interface list dialog field of its observed page.
+ *
+ * @author kaschja
+ * @version $Id: SuperInterfacesListener.java 23435 2010-02-04 00:14:38Z stephan $
+ */
+public class SuperInterfacesListener implements IListAdapter
+{
+
+ private NewTypeWizardPage _page;
+
+
+ public SuperInterfacesListener(NewTypeWizardPage page)
+ {
+ _page = page;
+ }
+
+ public void customButtonPressed(ListDialogField field, int index)
+ {
+ chooseSuperInterfaces(field);
+ }
+ public void selectionChanged(ListDialogField field) {}
+ public void doubleClicked(ListDialogField field){}
+
+
+ protected NewTypeWizardPage getPage()
+ {
+ return _page;
+ }
+
+
+ private void chooseSuperInterfaces(ListDialogField field)
+ {
+ IPackageFragmentRoot root= getPage().getPackageFragmentRoot();
+ if (root == null)
+ {
+ return;
+ }
+
+ SuperInterfaceSelectionDialog dialog;
+
+ // Note(km): need to change 3rd param from getPage().getSuperInterfacesDialogField()
+ // to get it compiled.
+ dialog = new SuperInterfaceSelectionDialog(getPage().getShell(),
+ getPage().getWizard().getContainer(),
+ getPage(),
+ root.getJavaProject());
+ dialog.setTitle( NewWizardMessages.NewTypeWizardPage_InterfacesDialog_class_title);
+ dialog.setMessage(NewWizardMessages.NewTypeWizardPage_InterfacesDialog_message);
+ dialog.open();
+ return;
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/typecreation/RoleCreator.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/typecreation/RoleCreator.java
new file mode 100644
index 000000000..f982fae42
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/typecreation/RoleCreator.java
@@ -0,0 +1,99 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2005, 2009 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: RoleCreator.java 23435 2010-02-04 00:14:38Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.wizards.typecreation;
+
+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.jdt.core.IType;
+import org.eclipse.jdt.core.ITypeHierarchy;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.core.dom.rewrite.ImportRewrite;
+import org.eclipse.objectteams.otdt.core.IOTType;
+import org.eclipse.objectteams.otdt.core.IRoleType;
+import org.eclipse.objectteams.otdt.core.OTModelManager;
+import org.eclipse.objectteams.otdt.ui.OTDTUIPluginConstants;
+
+
+/**
+ * A RoleCreator is responsible for creating a new role class.
+ *
+ * @author kaschja
+ * @version $Id: RoleCreator.java 23435 2010-02-04 00:14:38Z stephan $
+ */
+public class RoleCreator extends TypeCreator
+{
+
+ /**
+ * @return "java.lang.Object"
+ */
+ protected String createDefaultSupertypeName()
+ {
+ return "java.lang.Object"; //$NON-NLS-1$
+ }
+
+
+ protected void writeInheritanceRelations(ImportsManager imports, StringBuffer buf) throws CoreException
+ {
+ super.writeInheritanceRelations(imports, buf);
+ writeBaseClass(buf, imports.fImportsRewrite);
+ }
+
+ private void writeBaseClass(StringBuffer buf, ImportRewrite imports)
+ {
+ if ( !(getTypeInfo() instanceof RoleTypeInfo) )
+ return;
+
+ RoleTypeInfo typeInfo = (RoleTypeInfo) getTypeInfo();
+ String baseName = typeInfo.getBaseTypeName();
+
+ if (baseName != null && baseName.trim().length() > 0 )
+ {
+ buf.append(" playedBy "); //$NON-NLS-1$
+ buf.append(imports.addImportBase(baseName));
+ }
+ }
+
+
+ protected void validateTypeCreation()
+ throws CoreException
+ {
+ if (getTypeInfo().getEnclosingTypeName().trim().length() == 0)
+ {
+ throw new CoreException(new Status(IStatus.ERROR,
+ OTDTUIPluginConstants.UIPLUGIN_ID,
+ IStatus.OK,
+ "The role class " + getTypeInfo().getTypeName() + " must have an enclosing team.", //$NON-NLS-1$ //$NON-NLS-2$
+ null));
+ }
+ }
+
+ protected ITypeHierarchy createSuperTypeHierarchy(IType type,
+ IProgressMonitor monitor) throws JavaModelException
+ {
+ IOTType otType = OTModelManager.getOTElement(type);
+ if (otType instanceof IRoleType)
+ return otType.newSuperOTTypeHierarchy(monitor);
+
+ return super.createSuperTypeHierarchy(type, monitor);
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/typecreation/RoleTypeInfo.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/typecreation/RoleTypeInfo.java
new file mode 100644
index 000000000..838286b27
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/typecreation/RoleTypeInfo.java
@@ -0,0 +1,65 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2005, 2009 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: RoleTypeInfo.java 23435 2010-02-04 00:14:38Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.wizards.typecreation;
+
+import org.eclipse.jdt.core.IPackageFragment;
+import org.eclipse.jdt.core.IPackageFragmentRoot;
+
+/**
+ * @author kaschja
+ * @version $Id: RoleTypeInfo.java 23435 2010-02-04 00:14:38Z stephan $
+ */
+public class RoleTypeInfo extends TypeInfo
+{
+
+ private String _baseTypeName;
+
+
+ public RoleTypeInfo(String typeName, IPackageFragmentRoot pkgFragRoot, IPackageFragment pkgFrag)
+ {
+ super(typeName, pkgFragRoot, pkgFrag);
+ setIsRole(true);
+ }
+
+ public void setBaseTypeName(String baseTypeName)
+ {
+ _baseTypeName = baseTypeName;
+ }
+
+ public String getBaseTypeName()
+ {
+ return _baseTypeName;
+ }
+
+ /**
+ * specifies that the type is a role
+ * parameter will be ignored
+ */
+ public void setIsRole(boolean isRole)
+ {
+ super.setIsRole(true);
+ }
+
+ public boolean isRole()
+ {
+ return true;
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/typecreation/TeamCreator.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/typecreation/TeamCreator.java
new file mode 100644
index 000000000..c5f9d227e
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/typecreation/TeamCreator.java
@@ -0,0 +1,58 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2008 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: TeamCreator.java 23435 2010-02-04 00:14:38Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.wizards.typecreation;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.ITypeHierarchy;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.objectteams.otdt.core.IOTType;
+import org.eclipse.objectteams.otdt.core.OTModelManager;
+import org.eclipse.objectteams.otdt.core.compiler.IOTConstants;
+
+
+/**
+ * A TeamCreator is responsible for creating a new team class.
+ *
+ * @author kaschja
+ * @version $Id: TeamCreator.java 23435 2010-02-04 00:14:38Z stephan $
+ */
+public class TeamCreator extends TypeCreator
+{
+
+ /**
+ * @return "org.objectteams.Team"
+ */
+ protected String createDefaultSupertypeName()
+ {
+ return String.valueOf(IOTConstants.STR_ORG_OBJECTTEAMS_TEAM);
+ }
+
+ protected ITypeHierarchy createSuperTypeHierarchy(IType type,
+ IProgressMonitor monitor) throws JavaModelException
+ {
+ IOTType otType = OTModelManager.getOTElement(type);
+ if (otType != null)
+ return otType.newSuperOTTypeHierarchy(monitor);
+
+ return super.createSuperTypeHierarchy(type, monitor);
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/typecreation/TypeCreator.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/typecreation/TypeCreator.java
new file mode 100644
index 000000000..ecca97136
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/typecreation/TypeCreator.java
@@ -0,0 +1,992 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 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
+ * $Id: TypeCreator.java 23435 2010-02-04 00:14:38Z stephan $
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * Fraunhofer FIRST - extended API and implementation
+ * Technical University Berlin - extended API and implementation
+ *******************************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.wizards.typecreation;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.jdt.core.Flags;
+import org.eclipse.jdt.core.IBuffer;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IMethod;
+import org.eclipse.jdt.core.IPackageFragment;
+import org.eclipse.jdt.core.ISourceRange;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.ITypeHierarchy;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.core.ToolFactory;
+import org.eclipse.jdt.core.compiler.IProblem;
+import org.eclipse.jdt.core.compiler.IScanner;
+import org.eclipse.jdt.core.compiler.ITerminalSymbols;
+import org.eclipse.jdt.core.compiler.InvalidInputException;
+import org.eclipse.jdt.core.dom.AST;
+import org.eclipse.jdt.core.dom.ASTNode;
+import org.eclipse.jdt.core.dom.ASTParser;
+import org.eclipse.jdt.core.dom.AbstractTypeDeclaration;
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jdt.core.dom.ITypeBinding;
+import org.eclipse.jdt.core.dom.ImportDeclaration;
+import org.eclipse.jdt.core.dom.rewrite.ImportRewrite;
+import org.eclipse.jdt.core.formatter.CodeFormatter;
+import org.eclipse.jdt.internal.corext.codemanipulation.AddUnimplementedConstructorsOperation;
+import org.eclipse.jdt.internal.corext.codemanipulation.AddUnimplementedMethodsOperation;
+import org.eclipse.jdt.internal.corext.codemanipulation.CodeGenerationSettings;
+import org.eclipse.jdt.internal.corext.codemanipulation.StubUtility;
+import org.eclipse.jdt.internal.corext.dom.ASTNodes;
+import org.eclipse.jdt.internal.corext.dom.TokenScanner;
+import org.eclipse.jdt.internal.corext.refactoring.StubTypeContext;
+import org.eclipse.jdt.internal.corext.refactoring.TypeContextChecker;
+import org.eclipse.jdt.internal.corext.template.java.CodeTemplateContext;
+import org.eclipse.jdt.internal.corext.template.java.CodeTemplateContextType;
+import org.eclipse.jdt.internal.corext.util.CodeFormatterUtil;
+import org.eclipse.jdt.internal.corext.util.JavaModelUtil;
+import org.eclipse.jdt.internal.corext.util.Strings;
+import org.eclipse.jdt.internal.ui.JavaPlugin;
+import org.eclipse.jdt.internal.ui.preferences.JavaPreferencesSettings;
+import org.eclipse.jdt.internal.ui.refactoring.contentassist.JavaTypeCompletionProcessor;
+import org.eclipse.jdt.internal.ui.viewsupport.ProjectTemplateStore;
+import org.eclipse.jdt.internal.ui.wizards.NewWizardMessages;
+import org.eclipse.jdt.ui.CodeGeneration;
+import org.eclipse.jdt.ui.PreferenceConstants;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.Document;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.templates.Template;
+import org.eclipse.jface.text.templates.TemplateBuffer;
+import org.eclipse.jface.text.templates.TemplateException;
+import org.eclipse.jface.text.templates.TemplateVariable;
+import org.eclipse.text.edits.DeleteEdit;
+import org.eclipse.text.edits.MalformedTreeException;
+import org.eclipse.text.edits.MultiTextEdit;
+import org.eclipse.text.edits.TextEdit;
+import org.eclipse.objectteams.otdt.core.compiler.IOTConstants;
+import org.eclipse.objectteams.otdt.ui.OTDTUIPluginConstants;
+
+/**
+ * Individual method copied from {@link org.eclipse.jdt.internal.corext.codemanipulation.StubUtility#getCompilationUnitContent(ICompilationUnit, String, String, String, String)}
+ *
+ * @author kaschja
+ */
+public abstract class TypeCreator
+{
+
+ private TypeInfo _typeInfo;
+
+ private IType _createdType;
+ private String _defaultSupertypeName;
+
+ private StubTypeContext fSuperClassStubTypeContext;
+ private StubTypeContext fSuperInterfaceStubTypeContext; // FIXME(SH): use it!?! (see writeSuperClass / writeSuperInterfaces)
+
+
+ public TypeCreator()
+ {
+ _defaultSupertypeName = createDefaultSupertypeName();
+ }
+
+
+ public void setTypeInfo(TypeInfo typeInfo)
+ {
+ _typeInfo = typeInfo;
+ }
+
+ protected TypeInfo getTypeInfo()
+ {
+ return _typeInfo;
+ }
+
+
+ /**
+ * Hook method. Gets called by Constructor.
+ */
+ protected abstract String createDefaultSupertypeName();
+
+ protected String getDefaultSupertypeName()
+ {
+ return _defaultSupertypeName;
+ }
+
+ private void setCreatedType(IType createdType)
+ {
+ _createdType = createdType;
+ }
+
+ public IType createType(IProgressMonitor monitor) throws CoreException, InterruptedException
+ {
+ if (monitor == null) {
+ monitor= new NullProgressMonitor();
+ }
+
+ monitor.beginTask(NewWizardMessages.NewTypeWizardPage_operationdesc, 10);
+
+ ICompilationUnit createdWorkingCopy= null;
+
+ try
+ {
+ validateTypeCreation();
+
+ IPackageFragment pack = getPackageFragment();
+
+ monitor.worked(1);
+
+ IType createdType;
+ ImportsManager imports;
+ int indent= 0;
+
+ String lineDelimiter= null;
+ boolean needsSave = false;
+
+ Set<String> existingImports;
+
+ if (!_typeInfo.isInlineType())
+ {
+ lineDelimiter= StubUtility.getLineDelimiterUsed(pack.getJavaProject());
+
+ ICompilationUnit parentCU= pack.createCompilationUnit(_typeInfo.getTypeName() + ".java", "", false, new SubProgressMonitor(monitor, 2)); //$NON-NLS-1$ //$NON-NLS-2$
+ // create a working copy with a new owner
+ needsSave= true;
+ parentCU.becomeWorkingCopy(new SubProgressMonitor(monitor, 1)); // cu is now a (primary) working copy
+ createdWorkingCopy= parentCU;
+
+ IBuffer buffer= parentCU.getBuffer();
+
+ String cuContent= constructCUContent(parentCU, constructSimpleTypeStub(), lineDelimiter);
+ buffer.setContents(cuContent);
+
+ CompilationUnit astRoot= createASTForImports(parentCU);
+ existingImports= getExistingImports(astRoot);
+
+ imports= new ImportsManager(astRoot);
+
+ // add an import that will be removed again. Having this import solves 14661
+ imports.addImport(JavaModelUtil.concatenateName(pack.getElementName(), _typeInfo.getTypeName()));
+
+ String typeContent= constructTypeStub(parentCU, imports, lineDelimiter);
+
+ AbstractTypeDeclaration typeNode= (AbstractTypeDeclaration) astRoot.types().get(0);
+ int start= ((ASTNode) typeNode.modifiers().get(0)).getStartPosition();
+ int end= typeNode.getStartPosition() + typeNode.getLength();
+
+ buffer.replace(start, end - start, typeContent);
+
+ createdType= parentCU.getType(_typeInfo.getTypeName());
+//{OTDTUI: help the compiler by saving the unit
+// createdWorkingCopy.commitWorkingCopy(true, monitor);
+// createdWorkingCopy.save(monitor, true);
+//carp}
+ }
+ else
+ {
+ IType enclosingType = getEnclosingType();
+
+ ICompilationUnit parentCU = enclosingType.getCompilationUnit();
+
+ needsSave= !parentCU.isWorkingCopy();
+ parentCU.becomeWorkingCopy(new SubProgressMonitor(monitor, 1)); // cu is now for sure (primary) a working copy
+ createdWorkingCopy= parentCU;
+
+ CompilationUnit astRoot= createASTForImports(parentCU);
+ imports= new ImportsManager(astRoot);
+ existingImports= getExistingImports(astRoot);
+
+ // add imports that will be removed again. Having the imports solves 14661
+ IType[] topLevelTypes= parentCU.getTypes();
+ for (int i= 0; i < topLevelTypes.length; i++) {
+ imports.addImport(topLevelTypes[i].getFullyQualifiedName('.'));
+ }
+
+ lineDelimiter= StubUtility.getLineDelimiterUsed(enclosingType);
+ StringBuffer content= new StringBuffer();
+
+ if (PreferenceConstants.getPreferenceStore().getBoolean(PreferenceConstants.CODEGEN_ADD_COMMENTS))
+ {
+ String comment= getTypeComment(parentCU, lineDelimiter);
+ if (comment != null)
+ {
+ content.append(comment);
+ content.append(lineDelimiter);
+ }
+ }
+ content.append(constructTypeStub(parentCU, imports, lineDelimiter));
+ IJavaElement[] elems= enclosingType.getChildren();
+ IJavaElement sibling= elems.length > 0 ? elems[0] : null;
+
+// try
+// {
+ createdType = enclosingType.createType(
+ content.toString(),
+ sibling,
+ false,
+ new SubProgressMonitor(monitor, 2));
+// }
+// catch (Exception ex)
+// {
+// OTDTUIPlugin.getExceptionHandler().logException(ex);
+// }
+
+ indent = StubUtility.getIndentUsed(enclosingType) + 1;
+ }
+
+ if (monitor.isCanceled()) {
+ throw new InterruptedException();
+ }
+
+
+ // add imports for superclass/interfaces, so types can be resolved correctly
+
+ ICompilationUnit cu= createdType.getCompilationUnit();
+
+ imports.create(false, new SubProgressMonitor(monitor, 1));
+
+ JavaModelUtil.reconcile(cu);
+
+ if (monitor.isCanceled()) {
+ throw new InterruptedException();
+ }
+
+ // set up again
+ CompilationUnit astRoot= createASTForImports(imports.getCompilationUnit());
+ imports= new ImportsManager(astRoot);
+
+ createTypeMembers(createdType, imports, new SubProgressMonitor(monitor, 1));
+
+ // add imports
+ imports.create(false, new SubProgressMonitor(monitor, 1));
+
+ removeUnusedImports(cu, existingImports, false);
+
+ JavaModelUtil.reconcile(cu);
+
+ ISourceRange range= createdType.getSourceRange();
+
+ IBuffer buf= cu.getBuffer();
+ String originalContent= buf.getText(range.getOffset(), range.getLength());
+
+ String formattedContent= CodeFormatterUtil.format(CodeFormatter.K_CLASS_BODY_DECLARATIONS, originalContent, indent, lineDelimiter, pack.getJavaProject());
+ formattedContent= Strings.trimLeadingTabsAndSpaces(formattedContent);
+ buf.replace(range.getOffset(), range.getLength(), formattedContent);
+
+
+ if (!_typeInfo.isInlineType()) {
+ String fileComment= getFileComment(cu);
+ if (fileComment != null && fileComment.length() > 0) {
+ buf.replace(0, 0, fileComment + lineDelimiter);
+ }
+ }
+
+ if (needsSave) {
+ cu.commitWorkingCopy(true, new SubProgressMonitor(monitor, 1));
+ } else {
+ monitor.worked(1);
+ }
+
+
+ setCreatedType(createdType);
+
+// if (createdWorkingCopy != null) {
+// fCreatedType= (IType) createdType.getPrimaryElement();
+// } else {
+// fCreatedType= createdType;
+// }
+ }
+ finally
+ {
+ if (createdWorkingCopy != null)
+ {
+ createdWorkingCopy.discardWorkingCopy();
+ }
+ monitor.done();
+ }
+
+ return _createdType;
+ }
+
+ private CompilationUnit createASTForImports(ICompilationUnit cu) {
+ ASTParser parser= ASTParser.newParser(AST.JLS3);
+ parser.setSource(cu);
+ parser.setResolveBindings(false);
+ parser.setFocalPosition(0);
+ return (CompilationUnit) parser.createAST(null);
+ }
+
+
+ private Set<String> getExistingImports(CompilationUnit root) {
+ List imports= root.imports();
+ Set<String> res= new HashSet<String>(imports.size());
+ for (int i= 0; i < imports.size(); i++) {
+ res.add(ASTNodes.asString((ImportDeclaration) imports.get(i)));
+ }
+ return res;
+ }
+
+ private boolean isValidComment(String template) {
+ IScanner scanner= ToolFactory.createScanner(true, false, false, false);
+ scanner.setSource(template.toCharArray());
+ try {
+ int next= scanner.getNextToken();
+ while (TokenScanner.isComment(next)) {
+ next= scanner.getNextToken();
+ }
+ return next == ITerminalSymbols.TokenNameEOF;
+ } catch (InvalidInputException e) {
+ }
+ return false;
+ }
+
+ /**
+ * @deprecated Instead of file templates, the new type code template
+ * specifies the stub for a compilation unit.
+ */
+ protected String getFileComment(ICompilationUnit parentCU) {
+ return null;
+ }
+
+ /**
+ * Hook method that gets called from <code>createType</code> to retrieve
+ * a file comment. This default implementation returns the content of the
+ * 'file comment' template or <code>null</code> if no comment should be created.
+ *
+ * @param parentCU the parent compilation unit
+ * @param lineDelimiter the line delimiter to use
+ * @return the file comment or <code>null</code> if a file comment
+ * is not desired
+ * @throws CoreException
+ *
+ * @since 3.1
+ */
+ protected String getFileComment(ICompilationUnit parentCU, String lineDelimiter) throws CoreException {
+ if (true /*isAddComments()*/) {
+ return CodeGeneration.getFileComment(parentCU, lineDelimiter);
+ }
+ return null;
+
+ }
+
+ /**
+ * Hook method that gets called from <code>createType</code> to retrieve
+ * a type comment. This default implementation returns the content of the
+ * 'type comment' template.
+ *
+ * @param parentCU the parent compilation unit
+ * @param lineDelimiter the line delimiter to use
+ * @return the type comment or <code>null</code> if a type comment
+ * is not desired
+ *
+ * @since 3.0
+ */
+ protected String getTypeComment(ICompilationUnit parentCU, String lineDelimiter) {
+ try {
+ StringBuffer typeName= new StringBuffer();
+// if (isEnclosingTypeSelected()) {
+// typeName.append(JavaModelUtil.getTypeQualifiedName(getEnclosingType(page))).append('.');
+// }
+ typeName.append(_typeInfo.getTypeName());
+ String comment= CodeGeneration.getTypeComment(parentCU, typeName.toString(), lineDelimiter);
+ if (comment != null && isValidComment(comment)) {
+ return comment;
+ }
+ } catch (CoreException e) {
+ JavaPlugin.log(e);
+ }
+ return null;
+ }
+
+ private void removeUnusedImports(ICompilationUnit cu, Set<String> existingImports, boolean needsSave) throws CoreException {
+ ASTParser parser= ASTParser.newParser(AST.JLS3);
+ parser.setSource(cu);
+ parser.setResolveBindings(true);
+
+ CompilationUnit root= (CompilationUnit) parser.createAST(null);
+ if (root.getProblems().length == 0) {
+ return;
+ }
+
+ List importsDecls= root.imports();
+ if (importsDecls.isEmpty()) {
+ return;
+ }
+ ImportsManager imports= new ImportsManager(root);
+
+ int importsEnd= ASTNodes.getExclusiveEnd((ASTNode) importsDecls.get(importsDecls.size() - 1));
+ IProblem[] problems= root.getProblems();
+ for (int i= 0; i < problems.length; i++) {
+ IProblem curr= problems[i];
+ if (curr.getSourceEnd() < importsEnd) {
+ int id= curr.getID();
+ if (id == IProblem.UnusedImport || id == IProblem.NotVisibleType) { // not visible problems hide unused -> remove both
+ int pos= curr.getSourceStart();
+ for (int k= 0; k < importsDecls.size(); k++) {
+ ImportDeclaration decl= (ImportDeclaration) importsDecls.get(k);
+ if (decl.getStartPosition() <= pos && pos < decl.getStartPosition() + decl.getLength()) {
+ if (existingImports.isEmpty() || !existingImports.contains(ASTNodes.asString(decl))) {
+ String name= decl.getName().getFullyQualifiedName();
+ if (decl.isOnDemand()) {
+ name += ".*"; //$NON-NLS-1$
+ }
+ if (decl.isStatic()) {
+ imports.removeStaticImport(name);
+ } else {
+ imports.removeImport(name);
+ }
+ }
+ break;
+ }
+ }
+ }
+ }
+ }
+ imports.create(needsSave, null);
+ }
+
+
+ private IType getEnclosingType() throws CoreException
+ {
+ IType enclosingType = null;
+
+ if (_typeInfo.getEnclosingTypeName().trim().length() != 0)
+ {
+ try
+ {
+ enclosingType = _typeInfo.getPkgFragmentRoot().getJavaProject().findType(_typeInfo.getEnclosingTypeName());
+
+ if ((enclosingType == null)
+ || (enclosingType.getCompilationUnit() == null))
+ {
+ throw new Exception("The enclosing type " //$NON-NLS-1$
+ + _typeInfo.getEnclosingTypeName()
+ + "or its compilation unit does not exist."); //$NON-NLS-1$
+ }
+
+ if (!JavaModelUtil.isEditable(enclosingType.getCompilationUnit()))
+ {
+ throw new Exception("The compilation unit of the enclosing type " //$NON-NLS-1$
+ + _typeInfo.getEnclosingTypeName()
+ + " is not editable!"); //$NON-NLS-1$
+ }
+ }
+ catch (Exception ex)
+ {
+ throw new CoreException(new Status(IStatus.ERROR,
+ OTDTUIPluginConstants.UIPLUGIN_ID,
+ IStatus.OK,
+ ex.getMessage(),
+ null));
+ }
+ }
+ return enclosingType;
+ }
+
+ private IPackageFragment getPackageFragment()
+ throws JavaModelException, CoreException
+ {
+
+ IPackageFragment pkgFragment = null;
+ IType enclosingType = getEnclosingType();
+
+ if (enclosingType == null)
+ {
+ pkgFragment = _typeInfo.getPkgFragment();
+ if (pkgFragment == null)
+ {
+ pkgFragment = _typeInfo.getPkgFragmentRoot().getPackageFragment(""); //$NON-NLS-1$
+ }
+ }
+ else
+ {
+ if (_typeInfo.isInlineType())
+ {
+ pkgFragment = enclosingType.getPackageFragment();
+ }
+ else //external defined role class (= role class with its own file)
+ {
+ String qualifiedEnclosingTypeName = getEnclosingType().getFullyQualifiedName('.');
+
+ pkgFragment = _typeInfo.getPkgFragmentRoot().getPackageFragment(qualifiedEnclosingTypeName);
+ }
+
+ }
+
+ if (!pkgFragment.exists())
+ {
+ pkgFragment = _typeInfo.getPkgFragmentRoot().createPackageFragment(pkgFragment.getElementName(), true, null);
+ }
+
+ return pkgFragment;
+ }
+
+
+ protected void validateTypeCreation()
+ throws CoreException
+ {
+ if (_typeInfo.isInlineType() && (_typeInfo.getEnclosingTypeName().trim().length() == 0))
+ {
+ throw new CoreException(new Status(IStatus.ERROR,
+ OTDTUIPluginConstants.UIPLUGIN_ID,
+ IStatus.OK,
+ "The class " + _typeInfo.getTypeName() //$NON-NLS-1$
+ + " is declared to be an inner class" //$NON-NLS-1$
+ + " but fails to specify its enclosing type.", //$NON-NLS-1$
+ null));
+ }
+ }
+
+ private String constructSimpleTypeStub() {
+ StringBuffer buf= new StringBuffer("public class "); //$NON-NLS-1$
+ buf.append(_typeInfo.getTypeName());
+ buf.append("{ }"); //$NON-NLS-1$
+ return buf.toString();
+ }
+
+ /*
+ * Called from createType to construct the source for this type
+ */
+ private String constructTypeStub(ICompilationUnit parentCU, ImportsManager imports, String lineDelimiter) throws CoreException
+ {
+ StringBuffer buf= new StringBuffer();
+
+ buf.append(Flags.toString(_typeInfo.getModifiers()));
+
+ if (_typeInfo.getModifiers() != 0)
+ {
+ buf.append(' ');
+ }
+
+ buf.append("class "); //$NON-NLS-1$
+
+ buf.append(_typeInfo.getTypeName());
+
+ writeInheritanceRelations(imports, buf);
+
+ buf.append(" {").append(lineDelimiter); //$NON-NLS-1$
+ String typeBody= CodeGeneration.getTypeBody(CodeGeneration.CLASS_BODY_TEMPLATE_ID, parentCU, _typeInfo.getTypeName(), lineDelimiter);
+ if (typeBody != null) {
+ buf.append(typeBody);
+ } else {
+ buf.append(lineDelimiter);
+ }
+ buf.append('}').append(lineDelimiter);
+
+ return buf.toString();
+ }
+
+
+
+
+ protected void writeInheritanceRelations(ImportsManager imports, StringBuffer buf) throws CoreException
+ {
+ writeSuperClass(buf, imports);
+
+ writeSuperInterfaces(buf, imports);
+ }
+
+ private void writeSuperClass(StringBuffer buf, ImportsManager imports) throws CoreException {
+ String superclass= _typeInfo.getSuperClassName();
+ if (superclass.length() > 0 && !"java.lang.Object".equals(superclass) //$NON-NLS-1$
+//{ObjectTeams: also ignore default supertype (TPX-430)
+ && ! String.valueOf(IOTConstants.STR_ORG_OBJECTTEAMS_TEAM).equals(superclass)
+// km}
+
+ ) {
+ buf.append(" extends "); //$NON-NLS-1$
+
+ ITypeBinding binding= TypeContextChecker.resolveSuperClass(superclass, _typeInfo.getCurrentType(), getSuperClassStubTypeContext());
+ if (binding != null) {
+ buf.append(imports.addImport(binding));
+ } else {
+ buf.append(imports.addImport(superclass));
+ }
+ }
+ }
+
+ private StubTypeContext getSuperClassStubTypeContext() throws CoreException {
+ if (fSuperClassStubTypeContext == null) {
+ String typeName;
+ if (_typeInfo.getCurrentType() != null) {
+ typeName= _typeInfo.getTypeName();
+ } else {
+ typeName= JavaTypeCompletionProcessor.DUMMY_CLASS_NAME;
+ }
+ fSuperClassStubTypeContext= TypeContextChecker.createSuperClassStubTypeContext(typeName, getEnclosingType(), getPackageFragment());
+ }
+ return fSuperClassStubTypeContext;
+
+
+ }
+
+
+ private void writeSuperInterfaces(StringBuffer buf, ImportsManager imports) throws CoreException
+ {
+ List<String> interfaces= _typeInfo.getSuperInterfacesNames();
+ int last= interfaces.size() - 1;
+ if (last >= 0) {
+ buf.append(" implements "); //$NON-NLS-1$
+
+ String[] intfs= interfaces.toArray(new String[interfaces.size()]);
+ ITypeBinding[] bindings;
+ IType currentType = _typeInfo.getCurrentType();
+ if (currentType != null) {
+ bindings= TypeContextChecker.resolveSuperInterfaces(intfs, currentType, getSuperInterfacesStubTypeContext());
+ } else {
+ bindings= new ITypeBinding[intfs.length];
+ }
+ for (int i= 0; i <= last; i++) {
+ ITypeBinding binding= bindings[i];
+ if (binding != null) {
+ buf.append(imports.addImport(binding));
+ } else {
+ buf.append(imports.addImport(intfs[i]));
+ }
+ if (i < last) {
+ buf.append(',');
+ }
+ }
+ }
+ }
+
+
+ private StubTypeContext getSuperInterfacesStubTypeContext() throws CoreException {
+ if (fSuperInterfaceStubTypeContext == null) {
+ String typeName;
+ if (_typeInfo != null) {
+ typeName= _typeInfo.getTypeName();
+ } else {
+ typeName= JavaTypeCompletionProcessor.DUMMY_CLASS_NAME;
+ }
+ fSuperInterfaceStubTypeContext= TypeContextChecker.createSuperInterfaceStubTypeContext(typeName, getEnclosingType(), getPackageFragment());
+ }
+ return fSuperInterfaceStubTypeContext;
+ }
+
+//{OTDTUI
+ private String createCUHeaderFromScratch(IPackageFragment pack, String lineDelimiter)
+ {
+ StringBuffer buf= new StringBuffer();
+ // external role classes never have a normal package, they reference their enclosing team as package
+ if (_typeInfo.isRole())
+ {
+ buf.append("team "); //$NON-NLS-1$
+ buf.append("package ").append(pack.getElementName()).append(';'); //$NON-NLS-1$
+ }
+ else
+ {
+ if (!pack.isDefaultPackage())
+ {
+ buf.append("package ").append(pack.getElementName()).append(';'); //$NON-NLS-1$
+ }
+ }
+ buf.append(lineDelimiter).append(lineDelimiter);
+ return buf.toString();
+ }
+//carp}
+
+//{OTDTUI: OT_COPY_PASTE: replacement for StubUtility.getCompilationUnitContent()
+ private String getCompilationUnitContent(ICompilationUnit cu, String fileComment, String typeComment, String typeContent, String lineDelimiter) throws CoreException {
+//{OTDTUI: added team modifier
+ IPackageFragment pack= (IPackageFragment) cu.getParent();
+ String packageString = _typeInfo.isRole() ? "team package " : "package "; //$NON-NLS-1$ //$NON-NLS-2$
+ String packDecl= pack.isDefaultPackage() ? "" : packageString + pack.getElementName() + ';'; //$NON-NLS-1$
+//carp}
+
+ Template template= getCodeTemplate(CodeTemplateContextType.NEWTYPE_ID, cu.getJavaProject());
+ if (template == null) {
+ return null;
+ }
+
+ IJavaProject project= cu.getJavaProject();
+ CodeTemplateContext context= new CodeTemplateContext(template.getContextTypeId(), project, lineDelimiter);
+ context.setCompilationUnitVariables(cu);
+ context.setVariable(CodeTemplateContextType.PACKAGE_DECLARATION, packDecl);
+ context.setVariable(CodeTemplateContextType.TYPE_COMMENT, typeComment != null ? typeComment : ""); //$NON-NLS-1$
+ context.setVariable(CodeTemplateContextType.FILE_COMMENT, fileComment != null ? fileComment : ""); //$NON-NLS-1$
+ context.setVariable(CodeTemplateContextType.TYPE_DECLARATION, typeContent);
+ context.setVariable(CodeTemplateContextType.TYPENAME, JavaCore.removeJavaLikeExtension(cu.getElementName()));
+
+ String[] fullLine= { CodeTemplateContextType.PACKAGE_DECLARATION, CodeTemplateContextType.FILE_COMMENT, CodeTemplateContextType.TYPE_COMMENT };
+ return evaluateTemplate(context, template, fullLine);
+ }
+
+ private static Template getCodeTemplate(String id, IJavaProject project) {
+ if (project == null)
+ return JavaPlugin.getDefault().getCodeTemplateStore().findTemplateById(id);
+ ProjectTemplateStore projectStore= new ProjectTemplateStore(project.getProject());
+ try {
+ projectStore.load();
+ } catch (IOException e) {
+ JavaPlugin.log(e);
+ }
+ return projectStore.findTemplateById(id);
+ }
+
+
+ private static String evaluateTemplate(CodeTemplateContext context, Template template, String[] fullLineVariables) throws CoreException {
+ TemplateBuffer buffer;
+ try {
+ buffer= context.evaluate(template);
+ if (buffer == null)
+ return null;
+ String str= fixEmptyVariables(buffer, fullLineVariables);
+ if (Strings.containsOnlyWhitespaces(str)) {
+ return null;
+ }
+ return str;
+ } catch (BadLocationException e) {
+ throw new CoreException(Status.CANCEL_STATUS);
+ } catch (TemplateException e) {
+ throw new CoreException(Status.CANCEL_STATUS);
+ }
+ }
+
+ // remove lines for empty variables
+ private static String fixEmptyVariables(TemplateBuffer buffer, String[] variables) throws MalformedTreeException, BadLocationException {
+ IDocument doc= new Document(buffer.getString());
+ int nLines= doc.getNumberOfLines();
+ MultiTextEdit edit= new MultiTextEdit();
+ HashSet<Integer> removedLines= new HashSet<Integer>();
+ for (int i= 0; i < variables.length; i++) {
+ TemplateVariable position= findVariable(buffer, variables[i]); // look if Javadoc tags have to be added
+ if (position == null || position.getLength() > 0) {
+ continue;
+ }
+ int[] offsets= position.getOffsets();
+ for (int k= 0; k < offsets.length; k++) {
+ int line= doc.getLineOfOffset(offsets[k]);
+ IRegion lineInfo= doc.getLineInformation(line);
+ int offset= lineInfo.getOffset();
+ String str= doc.get(offset, lineInfo.getLength());
+ if (Strings.containsOnlyWhitespaces(str) && nLines > line + 1 && removedLines.add(new Integer(line))) {
+ int nextStart= doc.getLineOffset(line + 1);
+ edit.addChild(new DeleteEdit(offset, nextStart - offset));
+ }
+ }
+ }
+ edit.apply(doc, 0);
+ return doc.get();
+ }
+ private static TemplateVariable findVariable(TemplateBuffer buffer, String variable) {
+ TemplateVariable[] positions= buffer.getVariables();
+ for (int i= 0; i < positions.length; i++) {
+ TemplateVariable curr= positions[i];
+ if (variable.equals(curr.getType())) {
+ return curr;
+ }
+ }
+ return null;
+ }
+
+
+//end OT_COPY_PASTE
+//carp}
+
+ /**
+ * Uses the New Java file template from the code template page to generate a
+ * compilation unit with the given type content.
+ * @param cu The new created compilation unit
+ * @param typeContent The content of the type, including signature and type
+ * body.
+ * @param lineDelimiter The line delimiter to be used.
+ * @return String Returns the result of evaluating the new file template
+ * with the given type content.
+ * @throws CoreException
+ * @since 2.1
+ */
+ protected String constructCUContent(ICompilationUnit cu, String typeContent, String lineDelimiter) throws CoreException {
+ String fileComment= getFileComment(cu, lineDelimiter);
+ String typeComment= getTypeComment(cu, lineDelimiter);
+ IPackageFragment pack= (IPackageFragment) cu.getParent();
+// String content= CodeGeneration.getCompilationUnitContent(cu, fileComment, typeComment, typeContent, lineDelimiter);
+//{OTDTUI: use own own code generation (team modifier!)
+ String content= getCompilationUnitContent(cu, fileComment, typeComment, typeContent, lineDelimiter);
+//carp}
+ if (content != null) {
+ ASTParser parser= ASTParser.newParser(AST.JLS3);
+//OTDTUI: set unit name and project for role-file handling in parser -- probably obsolete!
+ parser.setUnitName(cu.getPath().toString());
+//carp}
+
+ parser.setProject(cu.getJavaProject());
+ parser.setSource(content.toCharArray());
+ CompilationUnit unit= (CompilationUnit) parser.createAST(null);
+ if ((pack.isDefaultPackage() || unit.getPackage() != null) && !unit.types().isEmpty()) {
+ return content;
+ }
+ }
+
+//{OTDTUI: adapted to add the "team" package modifier
+ System.out.println("TypeCreator: does this ever happen?");
+ StringBuffer buf= new StringBuffer();
+ buf.append (createCUHeaderFromScratch(pack, lineDelimiter));
+//carp}
+ if (typeComment != null) {
+ buf.append(typeComment).append(lineDelimiter);
+ }
+ buf.append(typeContent);
+ return buf.toString();
+ }
+
+ private void createTypeMembers(IType type, ImportsManager imports, IProgressMonitor monitor)
+ throws CoreException
+ {
+ createInheritedMethods(type, imports, new SubProgressMonitor(monitor, 1));
+
+ if(_typeInfo.isCreateMainMethod())
+ {
+ StringBuffer buf = new StringBuffer();
+ buf.append("public static void main("); //$NON-NLS-1$
+ buf.append(imports.addImport("java.lang.String")); //$NON-NLS-1$
+ buf.append("[] args) {}"); //$NON-NLS-1$
+ type.createMethod(buf.toString(), null, false, null);
+ }
+
+ if(monitor != null)
+ {
+ monitor.done();
+ }
+ }
+
+ protected ITypeHierarchy createSuperTypeHierarchy(IType type, IProgressMonitor monitor) throws JavaModelException
+ {
+ return type.newSupertypeHierarchy(monitor);
+ }
+
+/**
+ * Copied from NewTypeWizardPage.createInheritedMethods
+ * doXYZ Parameters replaced by is-Methods in _typeInfo
+ */
+ protected IMethod[] createInheritedMethods(IType type, ImportsManager imports, IProgressMonitor monitor)
+ throws CoreException
+ {
+ final ICompilationUnit cu= type.getCompilationUnit();
+ JavaModelUtil.reconcile(cu);
+ IMethod[] typeMethods= type.getMethods();
+ Set<String> handleIds= new HashSet<String>(typeMethods.length);
+ for (int index= 0; index < typeMethods.length; index++)
+ handleIds.add(typeMethods[index].getHandleIdentifier());
+ ArrayList<IMethod> newMethods= new ArrayList<IMethod>();
+ CodeGenerationSettings settings= JavaPreferencesSettings.getCodeGenerationSettings(type.getJavaProject());
+// TODO: addComments has to be set in _typeInfo
+ settings.createComments= true;
+ ASTParser parser= ASTParser.newParser(AST.JLS3);
+ parser.setResolveBindings(true);
+ parser.setSource(cu);
+ CompilationUnit unit= (CompilationUnit) parser.createAST(new SubProgressMonitor(monitor, 1));
+ final ITypeBinding binding= ASTNodes.getTypeBinding(unit, type);
+ if (binding != null) {
+ if (_typeInfo.isCreateAbstractInheritedMethods()) {
+ AddUnimplementedMethodsOperation operation= new AddUnimplementedMethodsOperation(unit, binding, null, -1, false, true, false);
+// TODO: addComments (parameter) has to be set in _typeInfo
+ operation.setCreateComments(true);
+ operation.run(monitor);
+ createImports(imports, operation.getCreatedImports());
+ }
+ if (_typeInfo.isCreateConstructor()) {
+ AddUnimplementedConstructorsOperation operation= new AddUnimplementedConstructorsOperation(unit, binding, null, -1, false, true, false);
+// TODO: addComments (parameter) has to be set in _typeInfo
+ operation.setCreateComments(true);
+ operation.run(monitor);
+ createImports(imports, operation.getCreatedImports());
+ }
+ }
+ JavaModelUtil.reconcile(cu);
+ typeMethods= type.getMethods();
+ for (int index= 0; index < typeMethods.length; index++)
+ if (!handleIds.contains(typeMethods[index].getHandleIdentifier()))
+ newMethods.add(typeMethods[index]);
+ IMethod[] methods= new IMethod[newMethods.size()];
+ newMethods.toArray(methods);
+ return methods;
+ }
+
+ private void createImports(ImportsManager imports, String[] createdImports) {
+ for (int index= 0; index < createdImports.length; index++)
+ imports.addImport(createdImports[index]);
+ }
+
+
+ /**
+ * Class used in stub creation routines to add needed imports to a
+ * compilation unit.
+ */
+ public static class ImportsManager
+ {
+ ImportRewrite fImportsRewrite;
+
+ /* package */ ImportsManager(CompilationUnit astRoot) throws CoreException {
+ fImportsRewrite= StubUtility.createImportRewrite(astRoot, true);
+ }
+
+ /* package */ ImportsManager(ICompilationUnit createdWorkingCopy) throws CoreException {
+ fImportsRewrite= StubUtility.createImportRewrite(createdWorkingCopy, true);
+ }
+
+ /* package */ ICompilationUnit getCompilationUnit() {
+ return fImportsRewrite.getCompilationUnit();
+ }
+
+ /**
+ * Adds a new import declaration that is sorted in the existing imports.
+ * If an import already exists or the import would conflict with an import
+ * of an other type with the same simple name, the import is not added.
+ *
+ * @param qualifiedTypeName The fully qualified name of the type to import
+ * (dot separated).
+ * @return Returns the simple type name that can be used in the code or the
+ * fully qualified type name if an import conflict prevented the import.
+ */
+ public String addImport(String qualifiedTypeName) {
+ return fImportsRewrite.addImport(qualifiedTypeName);
+ }
+
+ /**
+ * Adds a new import declaration that is sorted in the existing imports.
+ * If an import already exists or the import would conflict with an import
+ * of an other type with the same simple name, the import is not added.
+ *
+ * @param typeBinding the binding of the type to import
+ *
+ * @return Returns the simple type name that can be used in the code or the
+ * fully qualified type name if an import conflict prevented the import.
+ */
+ public String addImport(ITypeBinding typeBinding) {
+ return fImportsRewrite.addImport(typeBinding);
+ }
+
+ /* package */ void create(boolean needsSave, IProgressMonitor monitor) throws CoreException {
+ TextEdit edit= fImportsRewrite.rewriteImports(monitor);
+ JavaModelUtil.applyEdit(fImportsRewrite.getCompilationUnit(), edit, needsSave, null);
+ }
+
+ /* package */ void removeImport(String qualifiedName) {
+ fImportsRewrite.removeImport(qualifiedName);
+ }
+
+ /* package */ void removeStaticImport(String qualifiedName) {
+ fImportsRewrite.removeStaticImport(qualifiedName);
+ }
+
+ }
+
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/typecreation/TypeInfo.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/typecreation/TypeInfo.java
new file mode 100644
index 000000000..41b6bae95
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/wizards/typecreation/TypeInfo.java
@@ -0,0 +1,193 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2008 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: TypeInfo.java 23435 2010-02-04 00:14:38Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.internal.ui.wizards.typecreation;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.Flags;
+import org.eclipse.jdt.core.IPackageFragment;
+import org.eclipse.jdt.core.IPackageFragmentRoot;
+
+/**
+ * @author kaschja
+ * @version $Id: TypeInfo.java 23435 2010-02-04 00:14:38Z stephan $
+ */
+public class TypeInfo
+{
+ private String _typeName;
+
+ private IPackageFragmentRoot _pkgFragmentRoot;
+ private IPackageFragment _pkgFragment;
+
+ private String _enclosingTypeName = ""; //$NON-NLS-1$
+ private String _superClassName = "java.lang.Object"; //$NON-NLS-1$
+ private List<String> _superInterfacesNames = new ArrayList<String>();
+ private int _modifiers = Flags.AccPublic;
+
+ private boolean _isCreateMainMethod = false;
+ private boolean _isCreateConstructor = false;
+ private boolean _isCreateAbstractInheritedMethods = false;
+
+ private boolean _isRole = false;
+ private boolean _isInlineType = false;
+
+ private IType _currentType = null;
+
+
+ public TypeInfo(String typeName, IPackageFragmentRoot pkgFragRoot, IPackageFragment pkgFrag)
+ {
+ _typeName = typeName;
+ _pkgFragmentRoot = pkgFragRoot;
+ _pkgFragment = pkgFrag;
+ }
+
+ public void setModifier(int modifiers)
+ {
+ _modifiers = modifiers;
+ }
+
+ public void setCurrentType(IType type) {
+ _currentType = type;
+ }
+
+ public IType getCurrentType() {
+ return _currentType;
+ }
+
+ /**
+ *
+ * @param fullyQualifiedSuperClassName
+ */
+ public void setSuperClassName(String fullyQualifiedSuperClassName)
+ {
+ _superClassName = fullyQualifiedSuperClassName;
+ }
+
+ public void setSuperInterfacesNames(List<String> superInterfacesNames)
+ {
+ _superInterfacesNames = superInterfacesNames;
+ }
+
+ /**
+ * @param fullyQualifiedEnclosingTypeName
+ */
+ public void setEnclosingTypeName(String fullyQualifiedEnclosingTypeName)
+ {
+ _enclosingTypeName = fullyQualifiedEnclosingTypeName;
+ }
+
+ public void setIsRole(boolean isRole)
+ {
+ _isRole = isRole;
+ }
+
+
+ public void setInline(boolean isInline)
+ {
+ _isInlineType = isInline;
+ }
+
+ public void setCreateMainMethod(boolean isCreate)
+ {
+ _isCreateMainMethod = isCreate;
+ }
+
+ public void setCreateConstructor(boolean isCreate)
+ {
+ _isCreateConstructor = isCreate;
+ }
+
+ public void setCreateAbstractInheritedMethods(boolean isCreate)
+ {
+ _isCreateAbstractInheritedMethods = isCreate;
+ }
+
+
+ /* from here get-methods */
+
+ public boolean isCreateAbstractInheritedMethods()
+ {
+ return _isCreateAbstractInheritedMethods;
+ }
+
+ public boolean isCreateConstructor()
+ {
+ return _isCreateConstructor;
+ }
+
+ public boolean isCreateMainMethod()
+ {
+ return _isCreateMainMethod;
+ }
+
+ public boolean isInlineType()
+ {
+ return _isInlineType;
+ }
+
+ /**
+ * @return fully qualified enclosing type name
+ */
+ public String getEnclosingTypeName()
+ {
+ return _enclosingTypeName;
+ }
+
+ public boolean isRole()
+ {
+ return _isRole;
+ }
+
+ public int getModifiers()
+ {
+ return _modifiers;
+ }
+
+ public IPackageFragment getPkgFragment()
+ {
+ return _pkgFragment;
+ }
+
+ public IPackageFragmentRoot getPkgFragmentRoot()
+ {
+ return _pkgFragmentRoot;
+ }
+
+ /**
+ * @return fully qualified superclass name
+ */
+ public String getSuperClassName()
+ {
+ return _superClassName;
+ }
+
+ public List<String> getSuperInterfacesNames()
+ {
+ return _superInterfacesNames;
+ }
+
+ public String getTypeName()
+ {
+ return _typeName;
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/ui/ImageConstants.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/ui/ImageConstants.java
new file mode 100644
index 000000000..ae2b4cd17
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/ui/ImageConstants.java
@@ -0,0 +1,73 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2003, 2009 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: ImageConstants.java 23434 2010-02-03 23:52:31Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.ui;
+
+/**
+ * This interface holds plugin image keys for the OTDTUIPlugin. You need them
+ * when requesting images from the plugin ImageRegistry.
+ *
+ * @author kaiser
+ * @version $Id: ImageConstants.java 23434 2010-02-03 23:52:31Z stephan $
+ */
+@SuppressWarnings("nls")
+public interface ImageConstants
+{
+ public static final String IMG_PATH = "icons/ot/";
+
+ public static final String DEFAULT_PATH = "default/";
+ public static final String HOVER_PATH = "hover/";
+ public static final String DISABLED_PATH = "disabled/";
+
+ // Method binding icons:
+ public static final String CALLINBINDING_AFTER_IMG = "callinbindingafter_obj.gif";
+ public static final String CALLINBINDING_BEFORE_IMG = "callinbindingbefore_obj.gif";
+ public static final String CALLINBINDING_REPLACE_IMG= "callinbindingreplace_obj.gif";
+ public static final String CALLOUTBINDING_IMG = "calloutbinding_obj.gif";
+
+ public static final String CALLINMETHOD_IMG = "callinmethod_co.gif";
+ public static final String BOUNDROLE_IMG = "boundrole_co.gif";
+
+ // Guard predicates:
+ public static final String GUARD_IMG = "guard_obj.gif";
+ public static final String BASEGUARD_IMG = "baseguard_obj.gif";
+
+ // Class icons:
+ public static final String ROLECLASS_IMG = "role_obj.png";
+ public static final String ROLECLASS_PROTECTED_IMG = "role_protected_obj.png";
+
+ public static final String TEAM_IMG = "team_obj.gif";
+ public static final String TEAM_ROLE_IMG = "team_role_obj.gif";
+ public static final String TEAM_ROLE_PROTECTED_IMG = "team_role_protected_obj.gif";
+
+ // Overlay icons:
+ public static final String ROLE_OVR = "role_ovr.png";
+ public static final String TEAM_OVR = "team_ovr.gif";
+ public static final String TEAM_ROLE_OVR = "team_role_ovr.gif";
+
+ // action (default/disabled/hover):
+ public static final String HIDE_TEAMPACKAGE = "hide_team_package.gif";
+
+ // decorations on wizard pages:
+ public static final String NEW_TEAM = "wizard/newteam_wiz.png";
+ public static final String NEW_ROLE = "wizard/newrole_wiz.png";
+ public static final String NEW_OT_PROJECT = "wizard/newotjprj_wiz.png";
+
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/ui/ImageManager.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/ui/ImageManager.java
new file mode 100644
index 000000000..d811e1880
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/ui/ImageManager.java
@@ -0,0 +1,172 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2003, 2009 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: ImageManager.java 23434 2010-02-03 23:52:31Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.ui;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+
+
+/**
+ * Tool class to access plugin images
+ *
+ * @author kaiser
+ * @version $Id: ImageManager.java 23434 2010-02-03 23:52:31Z stephan $
+ */
+public class ImageManager implements ImageConstants
+{
+ private static final String[] _pluginIcons =
+ {
+ CALLOUTBINDING_IMG,
+ CALLINBINDING_REPLACE_IMG,
+ CALLINBINDING_BEFORE_IMG,
+ CALLINBINDING_AFTER_IMG,
+ CALLINMETHOD_IMG,
+ BOUNDROLE_IMG,
+ GUARD_IMG,
+ BASEGUARD_IMG,
+ ROLECLASS_IMG,
+ ROLECLASS_PROTECTED_IMG,
+ TEAM_IMG,
+ TEAM_ROLE_IMG,
+ TEAM_ROLE_PROTECTED_IMG,
+ ROLE_OVR,
+ TEAM_OVR,
+ TEAM_ROLE_OVR,
+ HIDE_TEAMPACKAGE,
+ NEW_OT_PROJECT,
+ NEW_TEAM,
+ NEW_ROLE
+ };
+
+ private static ImageManager _singleton;
+
+ /**
+ * Avoid multiple instances
+ */
+ protected ImageManager()
+ {
+ }
+
+ /**
+ * The only way to access plugin images
+ * @return PluginImages instance
+ */
+ public static ImageManager getSharedInstance()
+ {
+ if (_singleton == null)
+ {
+ _singleton = new ImageManager();
+ }
+
+ return _singleton;
+ }
+
+ /**
+ * Add all plugin specific images to given ImageRegistry
+ * @param reg - ImageRegistry to use
+ */
+ public void registerPluginImages(ImageRegistry reg)
+ {
+ ImageDescriptor descr;
+
+ try
+ {
+ String[] pluginIcons = pluginIcons();
+ URL baseURL = new URL(getInstallLocation(), IMG_PATH);
+ for (int idx = 0; idx < pluginIcons.length; idx++)
+ {
+ descr = ImageDescriptor.createFromURL(
+ new URL(baseURL, pluginIcons[idx]));
+ reg.put(pluginIcons[idx], descr);
+ }
+ }
+ catch (MalformedURLException ex)
+ {
+ OTDTUIPlugin.getExceptionHandler().logException(ex);
+ }
+ }
+
+ private URL getInstallLocation() {
+ return getPlugin().getBundle().getEntry("/"); //$NON-NLS-1$
+ }
+
+ /** Override to specify which plugin we are serving. */
+ protected AbstractUIPlugin getPlugin() {
+ return OTDTUIPlugin.getDefault();
+ }
+
+ /** Override to specify which icons should be registered. */
+ protected String[] pluginIcons() {
+ return _pluginIcons;
+ }
+
+ /**
+ * Setup images for different action states
+ * @param action - action to initialise
+ * @param imgKey - image name to use
+ */
+ public void setActionImageDescriptors(IAction action, String imgName)
+ {
+ try
+ {
+ ImageDescriptor descr;
+ URL baseURL = new URL(getInstallLocation(), IMG_PATH);
+
+ // set different types image descriptors according to action state
+ descr = ImageDescriptor.createFromURL(new URL(baseURL, DEFAULT_PATH+imgName));
+ action.setImageDescriptor( descr );
+
+ descr = ImageDescriptor.createFromURL(new URL(baseURL, HOVER_PATH+imgName));
+ action.setHoverImageDescriptor(descr);
+
+ descr = ImageDescriptor.createFromURL(new URL(baseURL, DISABLED_PATH+imgName));
+ action.setDisabledImageDescriptor(descr);
+ }
+ catch (MalformedURLException ex)
+ {
+ OTDTUIPlugin.getExceptionHandler().logException(ex);
+ }
+ }
+
+ /**
+ * Get image from this Plugin's ImageRegistry
+ * @param imageKey - image key from the set returned by pluginIcons().
+ * @return image object
+ */
+ public Image get(String imageKey)
+ {
+ // redirect to image registry
+ return getPlugin().getImageRegistry().get(imageKey);
+ }
+
+
+ public ImageDescriptor getDescriptor(String imageKey)
+ {
+ return getPlugin().getImageRegistry().getDescriptor(imageKey);
+ }
+
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/ui/JavaEditorActivationListener.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/ui/JavaEditorActivationListener.java
new file mode 100644
index 000000000..f3e01e32d
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/ui/JavaEditorActivationListener.java
@@ -0,0 +1,157 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 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
+ * $Id: JavaEditorActivationListener.java 23434 2010-02-03 23:52:31Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * IBM Corporation - Initial API and implementation
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.objectteams.otdt.ui;
+
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.internal.ui.JavaPlugin;
+import org.eclipse.jdt.internal.ui.javaeditor.IClassFileEditorInput;
+import org.eclipse.jdt.internal.ui.javaeditor.JavaEditor;
+import org.eclipse.jdt.ui.JavaUI;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IPartListener2;
+import org.eclipse.ui.IWindowListener;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchPartReference;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * @author gis
+ */
+public abstract class JavaEditorActivationListener implements IPartListener2, IWindowListener
+{
+//{OT_COPY_PASTE from CompilationUnitEditor and ClassFileEditor
+ protected abstract void activeJavaEditorChanged(IWorkbenchPart editor);
+
+ /*
+ * @see org.eclipse.jdt.internal.ui.javaeditor.JavaEditor#getInputJavaElement()
+ */
+ protected IJavaElement getInputJavaElement(IEditorPart editor) {
+ final IEditorInput editorInput = editor.getEditorInput();
+
+ if (editorInput instanceof IClassFileEditorInput)
+ return ((IClassFileEditorInput) editorInput).getClassFile();
+ else if (editor instanceof JavaEditor)
+ return JavaPlugin.getDefault().getWorkingCopyManager().getWorkingCopy(editorInput);
+
+ return null;
+ }
+//carp}
+
+
+//{OT_COPY_PASTE from org.eclipse.jdt.internal.ui.javaeditor.ASTProvider.ActivationListener
+ protected IWorkbenchPart fActiveEditor;
+ private IWorkbench fWorkbench;
+
+ public void installListener() {
+ /*
+ * XXX: Don't in-line this field unless the following bug has been fixed:
+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=55246
+ */
+ fWorkbench= PlatformUI.getWorkbench();
+
+ fWorkbench.addWindowListener(this);
+
+ // Ensure existing windows get connected
+ IWorkbenchWindow[] windows= fWorkbench.getWorkbenchWindows();
+ for (int i= 0, length= windows.length; i < length; i++)
+ windows[i].getPartService().addPartListener(this);
+ }
+
+ public void uninstallListener() {
+ if (fWorkbench == null)
+ return;
+
+ fWorkbench.removeWindowListener(this);
+
+ // Ensure existing windows get disconnected
+ IWorkbenchWindow[] windows= fWorkbench.getWorkbenchWindows();
+ for (int i= 0, length= windows.length; i < length; i++)
+ windows[i].getPartService().removePartListener(this);
+ }
+
+ public void partActivated(IWorkbenchPartReference ref) {
+ if (isJavaEditor(ref) && !isActiveEditor(ref))
+ activeJavaEditorChanged(ref.getPart(true));
+ }
+
+ public void partBroughtToTop(IWorkbenchPartReference ref) {
+ if (isJavaEditor(ref) && !isActiveEditor(ref))
+ activeJavaEditorChanged(ref.getPart(true));
+ }
+
+ public void partClosed(IWorkbenchPartReference ref) {
+ if (isActiveEditor(ref))
+ activeJavaEditorChanged(null);
+ }
+
+ public void partDeactivated(IWorkbenchPartReference ref) {
+ }
+
+ public void partOpened(IWorkbenchPartReference ref) {
+ if (isJavaEditor(ref) && !isActiveEditor(ref))
+ activeJavaEditorChanged(ref.getPart(true));
+ }
+
+ public void partHidden(IWorkbenchPartReference ref) {
+ }
+
+ public void partVisible(IWorkbenchPartReference ref) {
+ if (isJavaEditor(ref) && !isActiveEditor(ref))
+ activeJavaEditorChanged(ref.getPart(true));
+ }
+
+ public void partInputChanged(IWorkbenchPartReference ref) {
+ }
+
+ public void windowActivated(IWorkbenchWindow window) {
+ IWorkbenchPartReference ref= window.getPartService().getActivePartReference();
+ if (isJavaEditor(ref) && !isActiveEditor(ref))
+ activeJavaEditorChanged(ref.getPart(true));
+ }
+
+ public void windowDeactivated(IWorkbenchWindow window) {
+ }
+
+ public void windowClosed(IWorkbenchWindow window) {
+ if (fActiveEditor != null && fActiveEditor.getSite() != null && window == fActiveEditor.getSite().getWorkbenchWindow())
+ activeJavaEditorChanged(null);
+ window.getPartService().removePartListener(this);
+ }
+
+ public void windowOpened(IWorkbenchWindow window) {
+ window.getPartService().addPartListener(this);
+ }
+
+ protected boolean isActiveEditor(IWorkbenchPartReference ref) {
+ return ref != null && isActiveEditor(ref.getPart(false));
+ }
+
+ protected boolean isActiveEditor(IWorkbenchPart part) {
+ return part != null && (part == fActiveEditor);
+ }
+
+ protected boolean isJavaEditor(IWorkbenchPartReference ref) {
+ if (ref == null)
+ return false;
+
+ String id= ref.getId();
+ return JavaUI.ID_CF_EDITOR.equals(id) || JavaUI.ID_CU_EDITOR.equals(id);
+ }
+}
+//carp} -- end OT_COPY_PASTE
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/ui/OTDTUIPlugin.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/ui/OTDTUIPlugin.java
new file mode 100644
index 000000000..49ed24fcb
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/ui/OTDTUIPlugin.java
@@ -0,0 +1,213 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2005, 2009 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: OTDTUIPlugin.java 23435 2010-02-04 00:14:38Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.ui;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IAdapterManager;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jdt.core.ElementChangedEvent;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.objectteams.otdt.core.IOTJavaElement;
+import org.eclipse.objectteams.otdt.core.OTModelManager;
+import org.eclipse.objectteams.otdt.core.exceptions.ExceptionHandler;
+import org.eclipse.objectteams.otdt.internal.ui.OTElementAdapterFactory;
+import org.eclipse.objectteams.otdt.internal.ui.callinmarkers.CallinMarkerCreator2;
+import org.eclipse.objectteams.otdt.internal.ui.callinmarkers.RoleBindingChangedListener;
+import org.eclipse.objectteams.otdt.internal.ui.preferences.GeneralPreferences;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * ObjectTeams Development Tooling User Interface Plugin.
+ *
+ * @author kaiser
+ * @version $Id: OTDTUIPlugin.java 23435 2010-02-04 00:14:38Z stephan $
+ */
+public class OTDTUIPlugin extends AbstractUIPlugin implements OTDTUIPluginConstants
+{
+ private OTElementAdapterFactory _otElementAdapterFactory;
+
+ private static OTDTUIPlugin _singleton;
+
+ private ResourceBundle _resourceBundle;
+
+ private RoleBindingChangedListener _baseClassChangedListener;
+
+ private CallinMarkerCreator2 _callinMarkerCreator;
+
+ public OTDTUIPlugin()
+ {
+ super();
+ _singleton = this;
+
+ try
+ {
+ _resourceBundle = ResourceBundle.getBundle( RESOURCES_ID );
+ }
+ catch (MissingResourceException ex)
+ {
+ getExceptionHandler().logException(ex);
+ _resourceBundle = null;
+ }
+ }
+
+ public static OTDTUIPlugin getDefault()
+ {
+ return _singleton;
+ }
+
+ public static IWorkbenchPage getActivePage()
+ {
+ return getDefault().internalGetActivePage();
+ }
+
+ private IWorkbenchPage internalGetActivePage() {
+ IWorkbenchWindow window= getWorkbench().getActiveWorkbenchWindow();
+ if (window == null)
+ return null;
+ return getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ }
+
+ /**
+ * Returns the string from the plugin's resource bundle,
+ * or 'key' if not found.
+ */
+ public static String getResourceString(String key)
+ {
+ ResourceBundle bundle = OTDTUIPlugin.getDefault().getResourceBundle();
+ try
+ {
+ return bundle.getString(key);
+ }
+ catch (MissingResourceException ex)
+ {
+ return key;
+ }
+ }
+
+ public static IWorkspace getWorkspace()
+ {
+ return ResourcesPlugin.getWorkspace();
+ }
+
+ public ResourceBundle getResourceBundle()
+ {
+ return _resourceBundle;
+ }
+
+ /**
+ * Add Object Teams flavoured images to the image registry.
+ */
+ protected void initializeImageRegistry(ImageRegistry reg)
+ {
+ ImageManager.getSharedInstance().registerPluginImages(reg);
+ }
+
+ public void start(BundleContext context) throws Exception
+ {
+ super.start(context);
+
+ GeneralPreferences.initDefaults(getPreferenceStore());
+
+ registerAdapter();
+
+ addJavaElementChangedListeners();
+
+ getCallinMarkerCreator(); // initialize
+
+ getImageRegistry(); // initialize images to avoid https://bugs.eclipse.org/293995
+ }
+
+ public void stop(BundleContext context) throws Exception
+ {
+ unregisterAdapter();
+ removeElementChangedListeners();
+
+ if (_callinMarkerCreator != null)
+ {
+ _callinMarkerCreator.uninstallListener();
+ _callinMarkerCreator = null;
+ }
+
+ // we don't have many other places where we could clean up OTDTCore. JavaCore is not ours :-/
+ OTModelManager.dispose();
+ super.stop(context);
+ }
+
+ public static ExceptionHandler getExceptionHandler()
+ {
+ return new ExceptionHandler(UIPLUGIN_ID);
+ }
+
+ private void registerAdapter()
+ {
+ _otElementAdapterFactory = new OTElementAdapterFactory();
+ IAdapterManager manager = Platform.getAdapterManager();
+ manager.registerAdapters(_otElementAdapterFactory, IOTJavaElement.class);
+ }
+
+ private void unregisterAdapter()
+ {
+ IAdapterManager manager = Platform.getAdapterManager();
+ manager.unregisterAdapters(_otElementAdapterFactory, IOTJavaElement.class);
+ }
+
+ private void addJavaElementChangedListeners()
+ {
+ _baseClassChangedListener = new RoleBindingChangedListener();
+
+ JavaCore.addElementChangedListener(_baseClassChangedListener,
+ ElementChangedEvent.POST_RECONCILE|
+ ElementChangedEvent.POST_CHANGE);
+ }
+
+ private void removeElementChangedListeners()
+ {
+ JavaCore.removeElementChangedListener(_baseClassChangedListener);
+ _baseClassChangedListener = null;
+ }
+
+ public static Status createErrorStatus(String message, Throwable exception)
+ {
+ return new Status(IStatus.ERROR, UIPLUGIN_ID, IStatus.OK, message, exception);
+ }
+
+ public CallinMarkerCreator2 getCallinMarkerCreator()
+ {
+ if (_callinMarkerCreator == null)
+ _callinMarkerCreator = new CallinMarkerCreator2();
+
+ return _callinMarkerCreator;
+ }
+
+ public static void log(Throwable t) {
+ getDefault().getLog().log(new Status(IStatus.ERROR, UIPLUGIN_ID, t.getMessage(), t));
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/ui/OTDTUIPluginConstants.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/ui/OTDTUIPluginConstants.java
new file mode 100644
index 000000000..d58504fad
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/ui/OTDTUIPluginConstants.java
@@ -0,0 +1,45 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2005, 2009 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: OTDTUIPluginConstants.java 23434 2010-02-03 23:52:31Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.ui;
+
+import org.eclipse.objectteams.otdt.core.ext.OTDTPlugin;
+
+/**
+ * A collection of all plugin related ids
+ * NOTE: Keep them up to date with ids plugin.xml
+ *
+ * @author kaiser
+ * @version $Id: OTDTUIPluginConstants.java 23434 2010-02-03 23:52:31Z stephan $
+ */
+@SuppressWarnings("nls")
+public interface OTDTUIPluginConstants
+{
+ public static final String UIPLUGIN_ID = OTDTPlugin.PLUGIN_ID + ".ui";
+
+ public static final String RESOURCES_ID = UIPLUGIN_ID + ".OTPluginResources";
+
+ // perspectives
+ public static final String PERSPECTIVE_ID = UIPLUGIN_ID + ".OTJavaPerspective";
+
+ // wizards
+ public static final String NEW_TEAM_WIZARD_ID = UIPLUGIN_ID + ".wizards.NewTeamCreationWizard";
+ public static final String NEW_ROLE_WIZARD_ID = UIPLUGIN_ID + ".wizards.NewRoleCreationWizard";
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/ui/OTPluginResources.properties b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/ui/OTPluginResources.properties
new file mode 100644
index 000000000..7e3105da1
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/ui/OTPluginResources.properties
@@ -0,0 +1,86 @@
+###############################################################################
+# This file is part of "Object Teams Development Tooling"-Software
+#
+# Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
+# for its Fraunhofer Institute for Computer Architecture and Software
+# Technology (FIRST), Berlin, Germany and Technical University Berlin,
+# Germany.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Please visit http://www.eclipse.org/objectteams for updates and contact.
+#
+# Contributors:
+# Fraunhofer FIRST - Initial API and implementation
+# Technical University Berlin - Initial API and implementation
+###############################################################################
+
+# NewOTProjectCreationWizard
+NewOTProjectCreationWizard = OT Wizard
+NewOTProjectCreationWizard.title = New OT Project Wizard
+NewOTProjectCreationWizard.MainPage.title = Object Teams Project
+NewOTProjectCreationWizard.MainPage.description = Create a new Object Teams project
+
+
+# ------- strings for NewTypeWizardPage are now in OTNewWizardMessages -------
+
+#BindingEditor
+BindingEditor.AddconnectorDialog.title= Add Type Binding
+BindingEditor.AddconnectorDialog.RoleClassSelect.title= Choose a role type
+BindingEditor.AddconnectorDialog.RoleClassSelect.Input.title = Select a role type (? = any character, * = any String)
+BindingEditor.AddconnectorDialog.RoleClassSelect.List.title= Matching types:
+BindingEditor.AddconnectorDialog.BaseClassSelect.title= Choose a base type
+BindingEditor.AddconnectorDialog.BaseClassSelect.Input.title = Select a base type (? = any character, * = any String)
+BindingEditor.AddTypeBindingDialog.use_base_as_anchor=Use "base" as type anchor
+BindingEditor.AddTypeBindingDialog.use_specified_base_as_anchor=Use "base" ({0}) as type anchor
+BindingEditor.AddTypeBindingDialog.missing_class=No base class or no role class selected.
+BindingEditor.AddTypeBindingDialog.error_retrieving_roles=An Error occurred, while trying to get roles from team {0}.
+BindingEditor.generic_error_in_dialog=Error in {0}
+
+CallinMappingConfiguration_dialog_title=Callin Mapping Configuration
+CalloutMappingConfiguration_dialog_title=Callout Mapping Configuration
+MethodMappingConfiguration_no_method_binding_selected=<no method binding selected>
+MethodMappingConfiguration_param_mapping_group_title=Parameter Mapping
+MethodMappingConfiguration_result_mapping_group_title=Result Mapping
+MethodMappingConfiguration_apply_button_label=Apply
+
+#CallinMarkerCreator:
+CallinMarkerJob.job_title=Callin Marker Creator
+CallinMarker.menu_playedby_title=OT/J bound roles
+CallinMarker.menu_callin_title=OT/J callin bindings
+CallinMarker.menu_callout_title=OT/J callout decapsulation
+CallinMarker.playedby_tooltip=Role(s) bound to
+CallinMarker.callin_tooltip=Callin binding(s) to
+CallinMarker.callout_tooltip=Decapsulating callout binding(s) to
+CallinMarkerCreator2.creating_markers_message=Creating markers...
+CallinMarkerCreator2.updating_for_resource_message=Updating callin markers for resource {0}
+CallinMarkerCreator2.updating_for_method_message=Updating callin markers for method {0}
+CallinMarkerCreator2.searching_callin_binding_message=Searching for callin bindings...
+CallinMarkerCreator2.search_failed_message=Searching for bound base methods failed -- no markers will be shown.
+CallinMarkerCreator2.search_canceled_message=Searching for bound base methods canceled -- no markers will be shown.
+CallinMarkerCreator2.line_number_error_message=Cannot compute line number for callin marker
+
+## Launching:
+
+OTJavaMainTab.jplis_checkbox_label=Java 5 JPLIS Launching (recommended)
+
+#Team activation tab:
+TeamConfig.tab_title=Team Activation
+TeamConfig.activate_checkbox_description=Instantiate and activate the following teams at program launch
+TeamConfig.choose_team_dialog_title=Choose a Team
+TeamConfig.choose_team_dialog_description=Enter the Team's name (? = any character, * = any String)
+TeamConfig.add_team_button_label=&Add...
+TeamConfig.remove_team_button_label=Remo&ve
+TeamConfig.team_up_button_label=Up
+TeamConfig.team_down_button_label=Down
+
+TeamConfig.not_found_message=The following teams can not be found anymore and will not be statically activated.\n
+TeamConfig.error_adding_team_title=Error adding team
+TeamConfig.error_adding_team_message=Couldn't add the team {0}
+TeamConfig.cannot_instantiate_message=The teams must not be abstract and have a public default constructor or none at all.
+TeamConfig.project_not_set_title=Project not set
+TeamConfig.project_not_set_message=You need to select a project in the 'Main' tab first.
+
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/ui/UpdateRulerAction.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/ui/UpdateRulerAction.java
new file mode 100644
index 000000000..a2bc83115
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/ui/UpdateRulerAction.java
@@ -0,0 +1,301 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2008 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: UpdateRulerAction.java 23435 2010-02-04 00:14:38Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.ui;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jdt.core.IClassFile;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IMember;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.internal.ui.javaeditor.EditorUtility;
+import org.eclipse.jdt.internal.ui.javaeditor.IClassFileEditorInput;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IContributionItem;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.source.IVerticalRulerInfo;
+import org.eclipse.objectteams.otdt.core.IOTType;
+import org.eclipse.objectteams.otdt.core.IRoleType;
+import org.eclipse.objectteams.otdt.core.OTModelManager;
+import org.eclipse.objectteams.otdt.internal.ui.callinmarkers.CallinMarker;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.texteditor.AbstractRulerActionDelegate;
+import org.eclipse.ui.texteditor.ITextEditor;
+
+/**
+ * Action that is executed when the user right clicks on a binding marker at
+ * the vertical ruler and chooses a mapping (bound role class or callin mapping)
+ * from the ObjectTeams submenu.
+ *
+ * @author brcan
+ * @version $Id: UpdateRulerAction.java 23435 2010-02-04 00:14:38Z stephan $
+ */
+public class UpdateRulerAction extends AbstractRulerActionDelegate
+{
+ public final static String OT_PLAYEDBY_MENU_LABEL = OTDTUIPlugin.getResourceString("CallinMarker.menu_playedby_title"); //$NON-NLS-1$
+ public final static String OT_CALLIN_MENU_LABEL = OTDTUIPlugin.getResourceString("CallinMarker.menu_callin_title"); //$NON-NLS-1$
+ public final static String OT_CALLOUT_MENU_LABEL = OTDTUIPlugin.getResourceString("CallinMarker.menu_callout_title"); //$NON-NLS-1$
+
+ private IEditorPart _editor = null;
+ private IVerticalRulerInfo _rulerInfo = null;
+
+ public UpdateRulerAction()
+ {
+ }
+
+ public void setActiveEditor(IAction callerAction, IEditorPart targetEditor)
+ {
+ _editor = targetEditor;
+
+ super.setActiveEditor(callerAction, targetEditor);
+ }
+
+ protected IAction createAction(ITextEditor editor, IVerticalRulerInfo rulerInfo)
+ {
+ _rulerInfo = rulerInfo;
+
+ return null;
+ }
+
+ public void menuAboutToShow(IMenuManager contextMenu)
+ {
+ try
+ {
+ IMarker[] markers = findMarkers();
+
+ if (markers != null && markers.length != 0)
+ {
+ Integer clickedLine = new Integer(_rulerInfo.getLineOfLastMouseButtonActivity() + 1);
+ IDocument document = null;
+ if (this._editor instanceof ITextEditor) {
+ ITextEditor textEditor = (ITextEditor) this._editor;
+ document= textEditor.getDocumentProvider().getDocument(textEditor.getEditorInput());
+ }
+ for (int idx = 0; idx < markers.length; idx++)
+ {
+ IMarker curMarker = markers[idx];
+
+ Object lineAttribute = curMarker.getAttribute(IMarker.LINE_NUMBER);
+ if (lineAttribute != null)
+ {
+ if (lineAttribute.equals(clickedLine))
+ insertTeamMenus(contextMenu, curMarker);
+ } else if (document != null) {
+ // markers in ClassFileEditor have no line number, must go via position:
+ Integer startAttribute = (Integer) curMarker.getAttribute(IMarker.CHAR_START);
+ try {
+ if (clickedLine.equals(document.getLineOfOffset(startAttribute)+1))
+ insertTeamMenus(contextMenu, curMarker);
+ }
+ catch (BadLocationException e) { /* nop */ }
+ }
+ }
+ }
+ }
+ catch (CoreException ex)
+ {
+ OTDTUIPlugin.getExceptionHandler().logCoreException("Problems extending ruler context menu", ex); //$NON-NLS-1$
+ }
+ }
+
+ private IMarker[] findMarkers() throws CoreException
+ {
+
+ final IEditorInput editorInput = _editor.getEditorInput();
+ if (editorInput instanceof IFileEditorInput)
+ {
+ IFileEditorInput fileEditorInput = (IFileEditorInput)editorInput;
+ IFile file = fileEditorInput.getFile();
+
+ IMarker[] result = getAllBindingMarkers(file);
+ return result;
+ }
+ else if (editorInput instanceof IClassFileEditorInput)
+ {
+ IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+ IMarker[] allMarkers = getAllBindingMarkers(root);
+
+ // now we have all CallinMarkers for all class files in the workspace, need to filter now:
+ IClassFile classFile = ((IClassFileEditorInput) editorInput).getClassFile();
+ List<IMarker> filteredMarkers = new ArrayList<IMarker>(13);
+ for (IMarker marker : allMarkers)
+ if (JavaCore.isReferencedBy(classFile, marker))
+ filteredMarkers.add(marker);
+ return filteredMarkers.toArray(new IMarker[filteredMarkers.size()]);
+ }
+ return null;
+ }
+
+ /** get all playedBy and callin markers for the given resource. */
+ private IMarker[] getAllBindingMarkers(IResource resource) throws CoreException {
+ IMarker[] markers1 = resource.findMarkers(CallinMarker.PLAYEDBY_ID, true, IResource.DEPTH_INFINITE);
+ IMarker[] markers2 = resource.findMarkers(CallinMarker.CALLIN_ID, true, IResource.DEPTH_INFINITE);
+ IMarker[] markers3 = resource.findMarkers(CallinMarker.CALLOUT_ID, true, IResource.DEPTH_INFINITE);
+ int len1 = markers1.length, len2 = markers2.length, len3 = markers3.length;
+ IMarker[] result = new IMarker[len1+len2+len3];
+ System.arraycopy(markers1, 0, result, 0, len1);
+ System.arraycopy(markers2, 0, result, len1, len2);
+ System.arraycopy(markers3, 0, result, len1+len2, len3);
+ return result;
+ }
+
+ /** Get the context menu of kind 'markerKind', creating it if ondemand. */
+ private IMenuManager getObjectTeamsMenu(IMenuManager contextMenu, String markerKind)
+ {
+ String label;
+ if (CallinMarker.CALLIN_ID.equals(markerKind))
+ label = OT_CALLIN_MENU_LABEL;
+ else if (CallinMarker.CALLOUT_ID.equals(markerKind))
+ label = OT_CALLOUT_MENU_LABEL;
+ else
+ label = OT_PLAYEDBY_MENU_LABEL;
+
+ IMenuManager subMenu = getSubMenu(contextMenu, label);
+ if (subMenu != null)
+ return subMenu;
+
+ MenuManager otMenu = new MenuManager(label, markerKind); // id cannot be null, re-use the markerKind
+ if (contextMenu.isEmpty())
+ contextMenu.add(otMenu);
+ else // insert on top
+ contextMenu.insertBefore(contextMenu.getItems()[0].getId(), otMenu);
+ return otMenu;
+ }
+
+ private IAction createOpenEditorAction(String label, final IJavaElement target)
+ {
+ Action result = new Action(label)
+ {
+ public void run()
+ {
+ try
+ {
+ IEditorPart part = EditorUtility.openInEditor(target);
+ if (target.exists()) // also initializes source positions if necessary
+ EditorUtility.revealInEditor(part, target);
+ }
+ catch (PartInitException ex)
+ {
+ OTDTUIPlugin.getExceptionHandler().logException("Problems initializing editor", ex); //$NON-NLS-1$
+ }
+ }
+ };
+
+ return result;
+ }
+
+ List<IMember> getMappings (IMarker marker) throws CoreException
+ {
+ Object attr = marker.getAttribute(CallinMarker.ATTR_ROLE_ELEMENTS);
+ if (attr == null || !(attr instanceof String))
+ return null;
+ String str = (String)attr;
+ List<IMember> result = new ArrayList<IMember>();
+ int start = 0;
+ int pos;
+ while ((pos = str.indexOf('\n', start)) != -1) {
+ result.add((IMember)JavaCore.create(str.substring(start, pos)));
+ start = pos+1;
+ }
+ return result;
+ }
+
+ private void insertTeamMenus(IMenuManager contextMenu, IMarker marker) throws CoreException
+ {
+ List<IMember> mappings = getMappings(marker);
+ if (mappings == null) return;
+
+ IMenuManager otMenu = getObjectTeamsMenu(contextMenu, marker.getType());
+
+ for (IMember curMapping : mappings)
+ {
+ IType type = (IType)(curMapping.getAncestor(IJavaElement.TYPE));
+ IOTType otType = OTModelManager.getOTElement(type); // FIXME(SH): doesn't find role files??? (try StubUtility2)
+ if (otType == null || !otType.isRole())
+ continue;
+
+ IOTType teamType = ((IRoleType) otType).getTeam();
+
+ IMenuManager curTeamMenu = null;
+
+ if (!isSubMenuContained(otMenu, teamType.getElementName()))
+ {
+ curTeamMenu = new MenuManager(teamType.getElementName());
+ otMenu.add(curTeamMenu);
+ }
+ else
+ {
+ curTeamMenu = getSubMenu(otMenu, teamType.getElementName());
+ }
+ String actLabel = getMappingLabel(type, curMapping);
+ curTeamMenu.add(createOpenEditorAction(actLabel, curMapping));
+ }
+ }
+
+ private String getMappingLabel(IType type, IMember mapping)
+ {
+ if (type.equals(mapping)) return type.getElementName();
+
+ return type.getElementName() + ": " + mapping.getElementName(); //$NON-NLS-1$
+ }
+
+ private IMenuManager getSubMenu(IMenuManager otMenu, String subMenuName)
+ {
+ if (otMenu == null)
+ return null;
+
+ IContributionItem[] items = otMenu.getItems();
+
+ for (int idx = 0; idx < items.length; idx++)
+ {
+ if (items[idx] instanceof IMenuManager)
+ {
+ MenuManager cur = (MenuManager)items[idx];
+ if (cur.getMenuText().equals(subMenuName))
+ {
+ return cur;
+ }
+ }
+ }
+
+ return null;
+ }
+
+ private boolean isSubMenuContained(IMenuManager menu, String subMenuName)
+ {
+ return getSubMenu(menu, subMenuName) != null;
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/ui/Util.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/ui/Util.java
new file mode 100644
index 000000000..f28e7b5b8
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/ui/Util.java
@@ -0,0 +1,178 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2005, 2009 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id$
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.ui;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jdt.core.Flags;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IMethod;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.core.Signature;
+import org.eclipse.objectteams.otdt.core.IOTJavaElement;
+import org.eclipse.objectteams.otdt.core.IOTType;
+import org.eclipse.objectteams.otdt.core.IRoleFileType;
+import org.eclipse.objectteams.otdt.core.OTModelManager;
+
+
+/**
+ * @author kaiser
+ * @version $Id: Util.java 15419 2007-02-23 12:07:05Z stephan $
+ */
+public class Util
+{
+ private static final Object[] NO_OBJECTS = new Object[0];
+
+ /**
+ * Replaces IType inputs with IOTType if mapping exists in TypeManager
+ */
+ public static Object[] replaceOTTypes(Object[] types) {
+ return replaceOTTypes(types, false);
+ }
+ public static Object[] replaceOTTypes(Object[] types, boolean lazyCopy)
+ {
+ if (types == null)
+ return NO_OBJECTS;
+
+ boolean needCopy = lazyCopy;
+ for (int idx = 0; idx < types.length; idx++)
+ {
+ Object curChild = types[idx];
+
+ if (curChild instanceof IType)
+ {
+ IOTType otElement =
+ OTModelManager.getOTElement((IType)curChild);
+
+ if (otElement != null) {
+ try {
+ if (needCopy) {
+ int len = types.length;
+ System.arraycopy(types, 0, types=new IJavaElement[len], 0, len);
+ needCopy = false;
+ }
+ types[idx] = otElement;
+ } catch (ArrayStoreException ase) {
+ int len = types.length;
+ System.arraycopy(types, 0, types = new IJavaElement[len], 0, len);
+ types[idx] = otElement;
+ }
+ }
+ }
+ }
+ return types; // due to arraycopy this might be different from the input
+ }
+
+ public static List<Object> removeExternalDefinedRoles(Object[] types)
+ {
+ ArrayList<Object> result = new ArrayList<Object>(types.length);
+
+ for (int idx = 0; idx < types.length; idx++)
+ {
+ Object curChild = types[idx];
+
+ if (curChild != null && !(curChild instanceof IRoleFileType))
+ {
+ result.add(curChild);
+ }
+ }
+
+ return result;
+ }
+
+ public static List<Object> filterOTGenerated(List<Object> children) {
+ ArrayList<Object> result = new ArrayList<Object>(children.size());
+ for (Object elem : children) {
+ if (elem instanceof IJavaElement)
+ if (isGenerated((IJavaElement)elem))
+ continue;
+ result.add(elem);
+ }
+ return result;
+ }
+
+ /* same as above, but array instead of list */
+ public static Object[] filterOTGenerated(Object[] children) {
+ if (children == null) return children;
+ ArrayList<Object> result = new ArrayList<Object>(children.length);
+ for (Object elem : children) { // Note: same code as above, different type!
+ if (elem instanceof IJavaElement)
+ if (isGenerated((IJavaElement)elem))
+ continue;
+ result.add(elem);
+ }
+ return result.toArray();
+ }
+
+ @SuppressWarnings("nls")
+ public static boolean isGenerated(IJavaElement elem) {
+ // TODO (SH): check whether ViewerFilters can do the job better.
+
+ // all kinds of generated features determined by name:
+ String name = elem.getElementName();
+ final String[] patterns = new String[] {
+ "_OT$", "TSuper__OT__", // general OT-prefix
+ "class$", "access$", "val$", "this$" // std. java synthetics.
+ };
+ for (int i = 0; i < patterns.length; i++) {
+ if (name.indexOf(patterns[i]) >= 0)
+ return true;
+ }
+
+ switch (elem.getElementType()) {
+ case IJavaElement.TYPE:
+ case IOTJavaElement.ROLE:
+ // Predefined role types (non-overridable)?
+ final String[] fullPatterns = new String[] {
+ "IConfined", "Confined", "__OT__Confined", "ILowerable", // special OT types
+ };
+ for (int i = 0; i < fullPatterns.length; i++) {
+ if (name.equals(fullPatterns[i]))
+ return true;
+ }
+ break;
+ case IJavaElement.METHOD:
+ // tsuper-method?
+ IMethod method = (IMethod)elem;
+ String[] paramTypes = method.getParameterTypes();
+ if (paramTypes.length > 0) {
+ String lastType = Signature.getSimpleName(Signature.toString(paramTypes[paramTypes.length-1]));
+ if (lastType.startsWith("TSuper__OT__"))
+ return true;
+ }
+ break;
+ }
+
+ // Synthetic role interface?
+ if (elem.getElementType() == IOTJavaElement.ROLE) {
+ IType type = (IType)elem;
+ try {
+ if (Flags.isSynthetic(type.getFlags()))
+ return true;
+ } catch (JavaModelException ex) {
+ // nop
+ }
+ }
+ return false;
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/ui/dialogs/ISearchFilter.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/ui/dialogs/ISearchFilter.java
new file mode 100644
index 000000000..cae0c495f
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/ui/dialogs/ISearchFilter.java
@@ -0,0 +1,39 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2003, 2009 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: ISearchFilter.java 23434 2010-02-03 23:52:31Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.ui.dialogs;
+
+import org.eclipse.objectteams.otdt.core.IOTType;
+
+/**
+ * @author gis
+ */
+public interface ISearchFilter
+{
+ /**
+ * Gets an array of OT types as input and is supposed
+ * to return a new filtered array of OT Types that should
+ * be used instead of the given one.
+ *
+ * May return the (modified or not) original array.
+ */
+ public IOTType[] filterTypes(IOTType[] types);
+
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/ui/dialogs/OTTypeSelectionLabelProvider.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/ui/dialogs/OTTypeSelectionLabelProvider.java
new file mode 100644
index 000000000..28cd9cebe
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/ui/dialogs/OTTypeSelectionLabelProvider.java
@@ -0,0 +1,76 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2003, 2009 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: OTTypeSelectionLabelProvider.java 23435 2010-02-04 00:14:38Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.ui.dialogs;
+
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.internal.ui.JavaPluginImages;
+import org.eclipse.jdt.ui.JavaElementLabels;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.objectteams.otdt.core.IOTType;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.model.WorkbenchLabelProvider;
+
+
+/**
+ * A LabelProvider for the lower pane of a TeamSelectionDialog.
+ *
+ * @author kaschja
+ * @version $Id: OTTypeSelectionLabelProvider.java 23435 2010-02-04 00:14:38Z stephan $
+ */
+public class OTTypeSelectionLabelProvider extends LabelProvider
+{
+ private static final Image PKG_ICON = JavaPluginImages.get(JavaPluginImages.IMG_OBJS_PACKAGE);
+
+ private WorkbenchLabelProvider _wblp = new WorkbenchLabelProvider();
+
+
+ /**
+ * @param element may be of any type in particular of type {@link org.eclipse.objectteams.otdt.core.IOTType}
+ * @return package name and source location (source folder) of the given element.
+ */
+ public String getText(Object element)
+ {
+ String result;
+
+ if (element instanceof IOTType)
+ {
+//{OTModelUpdate
+ IType type = (IType) ((IOTType)element).getCorrespondingJavaElement();
+//haebor}
+ result = JavaElementLabels.getElementLabel(type.getPackageFragment(),
+ JavaElementLabels.P_POST_QUALIFIED);
+ }
+ else
+ {
+ result = _wblp.getText(element);
+ }
+
+ return result;
+ }
+
+ /**
+ * @return the package icon
+ */
+ public Image getImage(Object element)
+ {
+ return PKG_ICON;
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/ui/dialogs/TeamSelectionDialog.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/ui/dialogs/TeamSelectionDialog.java
new file mode 100644
index 000000000..5925fbd9f
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/ui/dialogs/TeamSelectionDialog.java
@@ -0,0 +1,339 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2003, 2009 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: TeamSelectionDialog.java 23435 2010-02-04 00:14:38Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.ui.dialogs;
+
+
+
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.search.IJavaSearchConstants;
+import org.eclipse.jdt.core.search.IJavaSearchScope;
+import org.eclipse.jdt.core.search.SearchPattern;
+import org.eclipse.jdt.internal.corext.util.Strings;
+import org.eclipse.jdt.internal.ui.util.StringMatcher;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.operation.IRunnableContext;
+import org.eclipse.objectteams.otdt.core.IOTType;
+import org.eclipse.objectteams.otdt.core.exceptions.InternalCompilerError;
+import org.eclipse.objectteams.otdt.core.search.OTSearchEngine;
+import org.eclipse.objectteams.otdt.core.search.OTSearchRequestor;
+import org.eclipse.objectteams.otdt.internal.ui.wizards.OTNewWizardMessages;
+import org.eclipse.objectteams.otdt.ui.OTDTUIPlugin;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.dialogs.FilteredList;
+import org.eclipse.ui.dialogs.TwoPaneElementSelector;
+import org.eclipse.ui.model.WorkbenchLabelProvider;
+
+
+/**
+ * A dialog to select a team type from a list of teams
+ *
+ * This class is a copy of org.eclipse.jdt.internal.ui.dialogs.TypeSelectionDialog.
+ * The constructor and methods open, computeResult and TypeFilterMatcher.match
+ * are modified. The method TypeFilterMatcher.getContainerName is new.
+ *
+ * The reason for copying TypeSelectionDialog instead of subclassing it
+ * is the following:
+ * The method TypeSelectionDialog.open which must be extended
+ * contains a super-call (= TwoPaneElementSelector.open).
+ * If one subclasses TypeSelectionDialog and overrides the method open,
+ * it is not possible to call the (super-super-)method TwoPaneElementSelector.open
+ * without calling the (super-)method TypeSelectionDialog.open.
+ *
+ * @author kaschja
+ * @version $Id: TeamSelectionDialog.java 23435 2010-02-04 00:14:38Z stephan $
+ */
+public class TeamSelectionDialog extends TwoPaneElementSelector
+{
+
+ private IJavaSearchScope fScope;
+ private List<ISearchFilter> _searchFilters = new LinkedList<ISearchFilter>();
+
+ /**
+ * Constructs a team selection dialog.
+ * @param parent the parent shell.
+ * @param context the runnable context.
+ * @param scope the java search scope.
+ */
+ public TeamSelectionDialog(Shell parent, IRunnableContext context, IJavaSearchScope scope)
+ {
+ super(parent, new WorkbenchLabelProvider(), new OTTypeSelectionLabelProvider());
+
+ assert context != null;
+ assert scope != null;
+
+ fScope= scope;
+
+ setUpperListLabel(OTNewWizardMessages.TeamSelectionDialog_upperLabel);
+ setLowerListLabel(OTNewWizardMessages.TeamSelectionDialog_lowerLabel);
+ }
+
+ /**
+ * Adds a filter that is consulted after the search engine performed its search
+ * and before the result is shown to the user.
+ * A filter may remove or change search-results as it sees fit.
+ * @param filter
+ */
+ public void addSearchFilter(ISearchFilter filter)
+ {
+ // does not check if filter is already in the list
+ _searchFilters.add(filter);
+ }
+
+ public void removeSearchFilter(ISearchFilter filter)
+ {
+ _searchFilters.remove(filter);
+ }
+
+ /*
+ * @see AbstractElementListSelectionDialog#createFilteredList(Composite)
+ */
+ protected FilteredList createFilteredList(Composite parent)
+ {
+ FilteredList list = super.createFilteredList(parent);
+
+ fFilteredList.setFilterMatcher(new TypeFilterMatcher());
+ fFilteredList.setComparator(new StringComparator());
+
+ return list;
+ }
+
+ /*
+ * @see org.eclipse.jface.window.Window#open()
+ */
+ public int open()
+ {
+ OTSearchRequestor requestor = new OTSearchRequestor();
+
+ try
+ {
+ SearchPattern teamPattern = OTSearchEngine.createTeamTypePattern(IJavaSearchConstants.CLASS, SearchPattern.R_EXACT_MATCH);
+ new OTSearchEngine().search(teamPattern, fScope, requestor, null);
+ }
+ catch (CoreException ex)
+ {
+ OTDTUIPlugin.getExceptionHandler().logCoreException("Problems searching team types", ex); //$NON-NLS-1$
+ }
+ catch (InternalCompilerError ex) // be defensive against InternalCompilerErrors :-/
+ {
+ OTDTUIPlugin.getExceptionHandler().logException("Problems searching team types", ex); //$NON-NLS-1$
+ }
+
+ IOTType[] teamsInScope = requestor.getOTTypes();
+ teamsInScope = filterTypes(teamsInScope);
+
+ if ( (teamsInScope == null) || (teamsInScope.length == 0) )
+ {
+ String title = OTNewWizardMessages.TeamSelectionDialog_notypes_title;
+ String message = OTNewWizardMessages.TeamSelectionDialog_notypes_message;
+ MessageDialog.openInformation(getShell(), title, message);
+ return CANCEL;
+ }
+ else
+ {
+ setElements(teamsInScope);
+ return super.open();
+ }
+ }
+
+ protected IOTType[] filterTypes(IOTType[] teamsInScope)
+ {
+ IOTType[] filteredTypes = teamsInScope;
+
+ for (Iterator<ISearchFilter> iter = _searchFilters.iterator(); iter.hasNext();)
+ {
+ ISearchFilter filter = iter.next();
+ filteredTypes = filter.filterTypes(filteredTypes);
+ }
+
+ return filteredTypes;
+ }
+
+ /*
+ * @see org.eclipse.ui.dialogs.SelectionStatusDialog#computeResult()
+ */
+ protected void computeResult()
+ {
+ Object tmpRef = getLowerSelectedElement();
+
+ if (tmpRef instanceof IOTType)
+ {
+ IOTType ref = (IOTType) tmpRef;
+ IType type = (IType) ref.getCorrespondingJavaElement();
+
+ List<IType> result = new ArrayList<IType>(1);
+ result.add(type);
+ setResult(result);
+ }
+ }
+
+
+//------------------------------------------------------------------------------
+
+ private static class TypeFilterMatcher
+ implements FilteredList.FilterMatcher
+ {
+
+ private static final char END_SYMBOL = '<';
+ private static final char ANY_STRING = '*';
+
+ private StringMatcher fMatcher;
+ private StringMatcher fQualifierMatcher;
+
+ /*
+ * @see FilteredList.FilterMatcher#setFilter(String, boolean)
+ */
+ public void setFilter(String pattern,
+ boolean ignoreCase,
+ boolean igoreWildCards)
+ {
+ int qualifierIndex = pattern.lastIndexOf("."); //$NON-NLS-1$
+
+ // type
+ if (qualifierIndex == -1)
+ {
+ fQualifierMatcher = null;
+ fMatcher =
+ new StringMatcher(
+ adjustPattern(pattern),
+ ignoreCase,
+ igoreWildCards);
+
+ }
+ //qualified type
+ else
+ {
+ fQualifierMatcher =
+ new StringMatcher(
+ pattern.substring(0, qualifierIndex),
+ ignoreCase,
+ igoreWildCards);
+ fMatcher =
+ new StringMatcher(
+ adjustPattern(pattern.substring(qualifierIndex + 1)),
+ ignoreCase,
+ igoreWildCards);
+ }
+ }
+
+ /*
+ * @see FilteredList.FilterMatcher#match(Object)
+ */
+ public boolean match(Object element)
+ {
+ if (!(element instanceof IOTType))
+ {
+ return false;
+ }
+
+ IOTType type = (IOTType) element;
+
+ if (!fMatcher.match(type.getElementName()))
+ {
+ return false;
+ }
+
+ if (fQualifierMatcher == null)
+ {
+ return true;
+ }
+
+ return fQualifierMatcher.match(getContainerName(type));
+ }
+
+ public String getContainerName(IOTType type)
+ {
+ String qualName = type.getFullyQualifiedName();
+ int index = qualName.lastIndexOf('.');
+ if (index == -1)
+ return ""; //$NON-NLS-1$
+
+ String containerName =
+ qualName.substring(0, index);
+
+ return containerName;
+ }
+
+
+ private String adjustPattern(String pattern)
+ {
+ int length = pattern.length();
+ if (length > 0)
+ {
+ switch (pattern.charAt(length - 1))
+ {
+ case END_SYMBOL :
+ pattern = pattern.substring(0, length - 1);
+ break;
+ case ANY_STRING :
+ break;
+ default :
+ pattern = pattern + ANY_STRING;
+ }
+ }
+ return pattern;
+ }
+ }
+
+//-----------------------------------------------------------------------------
+
+ /*
+ * A string comparator which is aware of obfuscated code
+ * (type names starting with lower case characters).
+ */
+ private static class StringComparator implements Comparator
+ {
+ public int compare(Object left, Object right)
+ {
+ String leftString = (String) left;
+ String rightString = (String) right;
+
+ if (Strings.isLowerCase(leftString.charAt(0))
+ && !Strings.isLowerCase(rightString.charAt(0)))
+ {
+ return +1;
+ }
+
+ if (Strings.isLowerCase(rightString.charAt(0))
+ && !Strings.isLowerCase(leftString.charAt(0)))
+ {
+ return -1;
+ }
+
+ int result = leftString.compareToIgnoreCase(rightString);
+
+ if (result == 0)
+ {
+ result = leftString.compareTo(rightString);
+ }
+
+ return result;
+ }
+ }
+}
+
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/ui/handlers/CompareWithBaseMethodHandler.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/ui/handlers/CompareWithBaseMethodHandler.java
new file mode 100644
index 000000000..8f4870b22
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/ui/handlers/CompareWithBaseMethodHandler.java
@@ -0,0 +1,245 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2009, Stephan Herrmann.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id$
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Stephan Herrmann - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.ui.handlers;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.compare.CompareEditorInput;
+import org.eclipse.compare.CompareUI;
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jdt.core.IMethod;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.internal.compiler.lookup.ExtraCompilerModifiers;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.util.OpenStrategy;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.objectteams.otdt.core.ICallinMapping;
+import org.eclipse.objectteams.otdt.core.IMethodMapping;
+import org.eclipse.objectteams.otdt.core.IRoleType;
+import org.eclipse.objectteams.otdt.core.OTModelManager;
+import org.eclipse.objectteams.otdt.internal.ui.OTDTUIMessages;
+import org.eclipse.objectteams.otdt.internal.ui.compare.CompareBoundMethodsEditorInput;
+import org.eclipse.objectteams.otdt.ui.OTDTUIPlugin;
+import org.eclipse.team.internal.ui.IPreferenceIds;
+import org.eclipse.team.internal.ui.TeamUIPlugin;
+import org.eclipse.team.ui.synchronize.SaveableCompareEditorInput;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IEditorReference;
+import org.eclipse.ui.IReusableEditor;
+import org.eclipse.ui.ISources;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchSite;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+/**
+ * This handler implements the "Compare with ... Bound base method" command.
+ *
+ * @author stephan
+ * @since 1.4.0
+ */
+public class CompareWithBaseMethodHandler extends AbstractHandler implements IStructuredSelection {
+
+ IMethod roleMethod;
+ IMethod baseMethod;
+ ICallinMapping callinMapping;
+ private IStructuredSelection selection;
+ private IWorkbenchPage page;
+
+ // === Implement IStructuredSelection: ===
+ public boolean isEmpty() { return false; }
+
+ public List toList() {
+ List<IMethod> result = new ArrayList<IMethod>(2);
+ result.add(roleMethod);
+ result.add(baseMethod);
+ return result;
+ }
+
+ public Object[] toArray() {
+ return new Object[]{roleMethod, baseMethod};
+ }
+
+ public int size() { return 2; }
+
+ public Iterator iterator() { return null; } // unused method
+
+ public Object getFirstElement() { return null; } // unused method
+ // === End IStructuredSelection ===
+
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.commands.AbstractHandler#setEnabled(java.lang.Object)
+ */
+ @Override
+ public void setEnabled(Object evaluationContext)
+ {
+ // fetch UI-context:
+ IWorkbenchSite site = (IWorkbenchSite) HandlerUtil.getVariable(evaluationContext, ISources.ACTIVE_SITE_NAME);
+ if (site == null)
+ return; // happens on workbench shutdown
+ this.page = site.getPage();
+
+ // initialize roleMethod and/or callinMapping from current selection:
+ this.roleMethod = null;
+ this.callinMapping = null;
+ ISelection sel = (ISelection) HandlerUtil.getVariable(evaluationContext, ISources.ACTIVE_CURRENT_SELECTION_NAME);
+ if (sel instanceof IStructuredSelection) {
+ this.selection = (IStructuredSelection) sel;
+ if (this.selection.size() == 1) {
+ Object element = this.selection.getFirstElement();
+ if (element instanceof IMethod) {
+ IMethod method = (IMethod) element;
+ try {
+ if ((method.getFlags() & ExtraCompilerModifiers.AccCallin) != 0) {
+ this.roleMethod = method;
+ setBaseEnabled(true);
+ return;
+ }
+ } catch (JavaModelException e) {
+ // nop, can't read method.getFlags();
+ }
+ } else if (element instanceof ICallinMapping) {
+ this.callinMapping = (ICallinMapping) element;
+ setBaseEnabled(true);
+ return;
+ }
+ }
+ }
+ setBaseEnabled(false);
+ }
+
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ this.baseMethod = null;
+ if (this.roleMethod != null && this.callinMapping == null) {
+ // find a callin mapping by which this role method is bound:
+ IType type = (IType) roleMethod.getParent();
+ IRoleType roleType = (IRoleType) OTModelManager.getOTElement(type);
+ for (IMethodMapping mapping : roleType.getMethodMappings(IRoleType.CALLINS)) {
+ if (mapping.getRoleMethod().equals(this.roleMethod))
+ if (this.callinMapping == null) {
+ this.callinMapping = (ICallinMapping)mapping;
+ } else {
+ MessageDialog.openError(null, // shell
+ OTDTUIMessages.CompareWithBaseMethodAction_errorTitle,
+ OTDTUIMessages.CompareWithBaseMethodAction_ambiguousBindingsError);
+ return null;
+ }
+ }
+ }
+ if (this.callinMapping != null) {
+ // find the methods bound by this callin mapping:
+ this.roleMethod = this.callinMapping.getRoleMethod();
+ IMethod[] baseMethods;
+ try {
+ baseMethods = this.callinMapping.getBoundBaseMethods();
+ } catch (JavaModelException e) {
+ throw new ExecutionException(e.getMessage());
+ }
+ if (baseMethods.length > 1) {
+ MessageDialog.openError(null, // shell
+ OTDTUIMessages.CompareWithBaseMethodAction_errorTitle,
+ OTDTUIMessages.CompareWithBaseMethodAction_multipleBaseMethodsError);
+ return null;
+ }
+ this.baseMethod = baseMethods[0];
+ }
+
+ if (this.roleMethod != null && this.baseMethod != null)
+ openCompareEditor();
+
+ return null;
+ }
+
+ void openCompareEditor() {
+ try {
+ CompareEditorInput input = new CompareBoundMethodsEditorInput(this.roleMethod, this.baseMethod, this.page);
+ IWorkbenchPage workBenchPage = this.page;
+ IEditorPart editor = findReusableCompareEditor(input, workBenchPage);
+ if (editor != null) {
+ IEditorInput otherInput = editor.getEditorInput();
+ if (otherInput.equals(input)) {
+ // simply provide focus to editor
+ if (OpenStrategy.activateOnOpen())
+ workBenchPage.activate(editor);
+ else
+ workBenchPage.bringToTop(editor);
+ } else {
+ // if editor is currently not open on that input either re-use
+ // existing
+ CompareUI.reuseCompareEditor(input, (IReusableEditor) editor);
+ if (OpenStrategy.activateOnOpen())
+ workBenchPage.activate(editor);
+ else
+ workBenchPage.bringToTop(editor);
+ }
+ } else {
+ CompareUI.openCompareEditor(input, OpenStrategy.activateOnOpen());
+ }
+ } catch (CoreException ce) {
+ OTDTUIPlugin.log(ce);
+ }
+ }
+
+ /**
+ * Returns an editor that can be re-used. An open compare editor that
+ * has un-saved changes cannot be re-used.
+ * @param input the input being opened
+ * @param page
+ * @return an EditorPart or <code>null</code> if none can be found
+ */
+ IEditorPart findReusableCompareEditor(CompareEditorInput input, IWorkbenchPage page) {
+ IEditorReference[] editorRefs = page.getEditorReferences();
+ // first loop looking for an editor with the same input
+ for (int i = 0; i < editorRefs.length; i++) {
+ IEditorPart part = editorRefs[i].getEditor(false);
+ if (part != null
+ && (part.getEditorInput() instanceof CompareBoundMethodsEditorInput)
+ && part instanceof IReusableEditor
+ && part.getEditorInput().equals(input)) {
+ return part;
+ }
+ }
+
+ // if none found and "Reuse open compare editors" preference is on use
+ // a non-dirty editor
+ if (isReuseOpenEditor()) {
+ for (int i = 0; i < editorRefs.length; i++) {
+ IEditorPart part = editorRefs[i].getEditor(false);
+ if (part != null
+ && (part.getEditorInput() instanceof SaveableCompareEditorInput)
+ && part instanceof IReusableEditor && !part.isDirty()) {
+ return part;
+ }
+ }
+ }
+
+ // no re-usable editor found
+ return null;
+ }
+
+ boolean isReuseOpenEditor() {
+ return TeamUIPlugin.getPlugin().getPreferenceStore().getBoolean(IPreferenceIds.REUSE_OPEN_COMPARE_EDITOR);
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/ui/handlers/OpenBindingEditorHandler.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/ui/handlers/OpenBindingEditorHandler.java
new file mode 100644
index 000000000..076265fa4
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/ui/handlers/OpenBindingEditorHandler.java
@@ -0,0 +1,98 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2008 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id$
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.ui.handlers;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.objectteams.otdt.core.IOTType;
+import org.eclipse.objectteams.otdt.core.IRoleFileType;
+import org.eclipse.objectteams.otdt.core.OTModelManager;
+import org.eclipse.objectteams.otdt.internal.ui.bindingeditor.BindingEditorDialog;
+import org.eclipse.ui.ISources;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+/**
+ * Handler responsible for the openBindingEditor command.
+ * @author mosconi
+ */
+public class OpenBindingEditorHandler extends AbstractHandler {
+
+ private IOTType currentTeam = null;
+
+ public OpenBindingEditorHandler() {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.commands.AbstractHandler#setEnabled(java.lang.Object)
+ */
+ @Override
+ public void setEnabled(Object evaluationContext) {
+ ISelection selection = (ISelection) HandlerUtil.getVariable(evaluationContext, ISources.ACTIVE_CURRENT_SELECTION_NAME);
+ currentTeam = getRootTeam(selection);
+ if (currentTeam != null)
+ setBaseEnabled(true);
+ else
+ setBaseEnabled(false);
+ }
+
+ /**
+ * Opens the Binding Editor Dialog.
+ */
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);
+ new BindingEditorDialog(window.getShell(), currentTeam).open();
+ return null;
+ }
+
+ /**
+ * Finds the outermost containing team for the given selection.
+ * @param selection The current selection (can be null).
+ * @return The best matching team for the selection, or null if no team found.
+ */
+ protected IOTType getRootTeam(ISelection selection) {
+ IOTType selectedTeam = null;
+ if (!(selection instanceof IStructuredSelection))
+ return null;
+ Object element = ((IStructuredSelection) selection).getFirstElement();
+ if (!(element instanceof IJavaElement))
+ return null;
+ IJavaElement jElement = (IJavaElement) element;
+ ICompilationUnit cu = (ICompilationUnit) jElement.getAncestor(IType.COMPILATION_UNIT);
+ if (cu == null)
+ return null;
+ IType type = cu.findPrimaryType();
+ IOTType otType = OTModelManager.getOTElement(type);
+ if (otType == null)
+ return null;
+ if (otType.isTeam())
+ selectedTeam = otType;
+ else if (otType instanceof IRoleFileType)
+ selectedTeam = ((IRoleFileType)otType).getTeam();
+ return selectedTeam;
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/templates/OT-templates.properties b/plugins/org.eclipse.objectteams.otdt.ui/templates/OT-templates.properties
new file mode 100644
index 000000000..0888e3f90
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/templates/OT-templates.properties
@@ -0,0 +1,3 @@
+Templates.with.callin.parametermappings = specify callin parameter mapping(s)
+Templates.with.callout.parametermappings = specify callout parameter mapping(s)
+Templates.within = within statement \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/templates/OT-templates.xml b/plugins/org.eclipse.objectteams.otdt.ui/templates/OT-templates.xml
new file mode 100644
index 000000000..54ae45708
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.ui/templates/OT-templates.xml
@@ -0,0 +1,25 @@
+<templates>
+ <template name="with"
+ id="org.eclipse.objectteams.otdt.ui.templates.callin_with"
+ description="%Templates.with.callin.parametermappings"
+ context="java"
+ enabled="true">with { ${callin_parameter_name} &lt;- ${Expression}${cursor} }
+ </template>
+
+ <template name="with"
+ id="org.eclipse.objectteams.otdt.ui.templates.callout_with"
+ description="%Templates.with.callout.parametermappings"
+ context="java"
+ enabled="true">with { ${Expression} -&gt; ${callout_parameter_name}${cursor} }
+ </template>
+
+ <template name="within"
+ id="org.eclipse.objectteams.otdt.ui.templates.within"
+ description="%Templates.within"
+ context="java"
+ enabled="true">within (${TeamExpression})
+ {
+
+ }
+ </template>
+</templates> \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt/.classpath b/plugins/org.eclipse.objectteams.otdt/.classpath
new file mode 100644
index 000000000..304e86186
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <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.objectteams.otdt/.cvsignore b/plugins/org.eclipse.objectteams.otdt/.cvsignore
new file mode 100644
index 000000000..7eeea25ff
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt/.cvsignore
@@ -0,0 +1,4 @@
+bin
+temp.folder
+build.xml
+otdt.jar
diff --git a/plugins/org.eclipse.objectteams.otdt/.project b/plugins/org.eclipse.objectteams.otdt/.project
new file mode 100644
index 000000000..a40a6545a
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.objectteams.otdt</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.objectteams.otdt/.settings/org.eclipse.core.resources.prefs b/plugins/org.eclipse.objectteams.otdt/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 000000000..10d8eb030
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,3 @@
+#Fri Mar 09 01:42:55 CET 2007
+eclipse.preferences.version=1
+encoding//src/org/objectteams/otdt/core/ext/OTCoreExtMessages.properties=8859_1
diff --git a/plugins/org.eclipse.objectteams.otdt/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.objectteams.otdt/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..5bacb6610
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+#Tue Sep 18 18:10:56 CEST 2007
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/plugins/org.eclipse.objectteams.otdt/META-INF/MANIFEST.MF b/plugins/org.eclipse.objectteams.otdt/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..ad3f620ad
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt/META-INF/MANIFEST.MF
@@ -0,0 +1,18 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Object Teams Development Tooling
+Bundle-SymbolicName: org.eclipse.objectteams.otdt;singleton:=true
+Bundle-Version: 1.4.0.qualifier
+Bundle-Activator: org.eclipse.objectteams.otdt.core.ext.OTDTPlugin
+Bundle-Vendor: The TOPPrax consortium
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
+ org.eclipse.core.resources,
+ org.eclipse.jdt.core;bundle-version="[3.5.1.v_OTDT_r140,4.0.0)",
+ org.eclipse.jdt.launching,
+ org.eclipse.debug.core,
+ org.eclipse.objectteams.otequinox.branding
+Bundle-ActivationPolicy: lazy
+Bundle-ClassPath: otdtcoreext.jar
+Export-Package: org.eclipse.objectteams.otdt.core.ext
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/plugins/org.eclipse.objectteams.otdt/META-INF/p2.inf b/plugins/org.eclipse.objectteams.otdt/META-INF/p2.inf
new file mode 100644
index 000000000..e0bbd4103
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt/META-INF/p2.inf
@@ -0,0 +1,12 @@
+instructions.install = \
+ removeProgramArg(programArg:-showsplash); \
+ removeProgramArg(programArg:org.eclipse.platform); \
+ addProgramArg(programArg:-showsplash); \
+ addProgramArg(programArg:org.eclipse.objectteams.otdt); \
+ setProgramProperty(propName:osgi.splashPath,propValue:platform\:/base/plugins/org.eclipse.objectteams.otdt);
+instructions.uninstall = \
+ removeProgramArg(programArg:-showsplash); \
+ removeProgramArg(programArg:org.eclipse.objectteams.otdt); \
+ addProgramArg(programArg:-showsplash); \
+ addProgramArg(programArg:org.eclipse.platform); \
+ setProgramProperty(propName:osgi.splashPath,propValue:platform\:/base/plugins/org.eclipse.platform);
diff --git a/plugins/org.eclipse.objectteams.otdt/OT-Icon_32x32.png b/plugins/org.eclipse.objectteams.otdt/OT-Icon_32x32.png
new file mode 100644
index 000000000..1614869aa
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt/OT-Icon_32x32.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt/OTDT_32x32.png b/plugins/org.eclipse.objectteams.otdt/OTDT_32x32.png
new file mode 100644
index 000000000..5d09b7ec9
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt/OTDT_32x32.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt/OTlogo.gif b/plugins/org.eclipse.objectteams.otdt/OTlogo.gif
new file mode 100644
index 000000000..be3bc29e9
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt/OTlogo.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt/about.html b/plugins/org.eclipse.objectteams.otdt/about.html
new file mode 100644
index 000000000..47048bd42
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>Feb 3, 2010</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.objectteams.otdt/about.ini b/plugins/org.eclipse.objectteams.otdt/about.ini
new file mode 100644
index 000000000..970677fdc
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt/about.ini
@@ -0,0 +1,12 @@
+aboutText=Object Teams Development Tooling\n\
+\n\
+OTDT Version: 1.4.0 Milestone 2\n\
+\n\
+Based on Eclipse version 3.6.0 M4\n\
+\n\
+(c) Copyright The TOPPrax consortium, 2005, 2009\n\
+Visit http://www.objectteams.org
+
+featureImage=OTDT_32x32.png
+
+# welcomePage=$nl$/welcome.xml
diff --git a/plugins/org.eclipse.objectteams.otdt/build.properties b/plugins/org.eclipse.objectteams.otdt/build.properties
new file mode 100644
index 000000000..026e501c2
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt/build.properties
@@ -0,0 +1,14 @@
+bin.includes = plugin.xml,\
+ OTDT_32x32.png,\
+ about.ini,\
+ META-INF/,\
+ lib/,\
+ otdtcoreext.jar,\
+ plugin.properties,\
+ splash.bmp
+src.includes = build.properties,\
+ .classpath,\
+ .project
+jars.compile.order = otdtcoreext.jar
+output.otdtcoreext.jar = bin/
+source.otdtcoreext.jar = src/
diff --git a/plugins/org.eclipse.objectteams.otdt/lib/otre_min.jar b/plugins/org.eclipse.objectteams.otdt/lib/otre_min.jar
new file mode 100644
index 000000000..fc4bd11ea
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt/lib/otre_min.jar
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt/plugin.properties b/plugins/org.eclipse.objectteams.otdt/plugin.properties
new file mode 100644
index 000000000..a0c9178f9
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt/plugin.properties
@@ -0,0 +1,2 @@
+otNatureName=Object Teams
+otjBuilderName=OT/J Builder \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otdt/plugin.xml b/plugins/org.eclipse.objectteams.otdt/plugin.xml
new file mode 100644
index 000000000..4c374444c
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt/plugin.xml
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+
+
+
+<plugin>
+ <!-- Note that the nature and builder definitions appear here mainly
+ because they should have an ID starting with org.eclipse.objectteams.otdt,
+ rather than org.eclipse.jdt, allthough they are defined in jdt.core -->
+
+ <!-- objectteams project nature -->
+ <extension
+ point="org.eclipse.core.resources.natures"
+ id="OTJavaNature"
+ name="%otNatureName">
+ <runtime>
+ <run class="org.eclipse.objectteams.otdt.core.ext.OTJavaNature">
+ </run>
+ </runtime>
+ <builder
+ id="org.eclipse.objectteams.otdt.builder.OTJBuilder">
+ </builder>
+ <!-- run and configure our nature AFTER the java-nature has been configured -->
+ <requires-nature
+ id="org.eclipse.jdt.core.javanature">
+ </requires-nature>
+ </extension>
+
+ <!-- OT/J Builder: -->
+ <extension
+ point="org.eclipse.core.resources.builders"
+ id="builder.OTJBuilder"
+ name="%otjBuilderName">
+ <builder hasNature="true">
+ <run class="org.eclipse.objectteams.otdt.internal.core.builder.OTJBuilder">
+ </run>
+ </builder>
+ </extension>
+
+ <extension point="org.eclipse.jdt.core.classpathVariableInitializer">
+ <classpathVariableInitializer
+ variable="OTDT_INSTALLDIR"
+ class="org.eclipse.objectteams.otdt.core.ext.OTVariableInitializer"/>
+ </extension>
+
+ <extension
+ point="org.eclipse.jdt.core.classpathContainerInitializer"
+ id="org.eclipse.objectteams.otdt.otreContainerInitializer">
+ <classpathContainerInitializer
+ id="OTRE"
+ class="org.eclipse.objectteams.otdt.core.ext.OTREContainerInitializer"/>
+ </extension>
+
+ <extension
+ point="org.eclipse.jdt.core.classpathVariableInitializer">
+ <classpathVariableInitializer
+ variable="OTRUNTIME_INSTALLDIR"
+ class="org.eclipse.objectteams.otdt.core.ext.OTRuntimeVariableInitializer">
+ </classpathVariableInitializer>
+ </extension>
+
+ <extension point="org.eclipse.jdt.launching.classpathProviders">
+ <classpathProvider
+ id="org.eclipse.objectteams.otdt.OTRuntimeClasspathProvider"
+ class="org.eclipse.objectteams.otdt.core.ext.OTRuntimeClasspathProvider">
+ </classpathProvider>
+ </extension>
+</plugin>
diff --git a/plugins/org.eclipse.objectteams.otdt/splash.bmp b/plugins/org.eclipse.objectteams.otdt/splash.bmp
new file mode 100644
index 000000000..4bbee5548
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt/splash.bmp
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otdt/src/org/eclipse/objectteams/otdt/core/ext/OTCoreExtMessages.java b/plugins/org.eclipse.objectteams.otdt/src/org/eclipse/objectteams/otdt/core/ext/OTCoreExtMessages.java
new file mode 100644
index 000000000..9e5ef1496
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt/src/org/eclipse/objectteams/otdt/core/ext/OTCoreExtMessages.java
@@ -0,0 +1,38 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2003, 2007 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: OTCoreExtMessages.java 23427 2010-02-03 22:23:59Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.core.ext;
+
+import org.eclipse.osgi.util.NLS;
+
+public class OTCoreExtMessages extends NLS {
+ private static final String BUNDLE_NAME = "org.eclipse.objectteams.otdt.core.ext.OTCoreExtMessages"; //$NON-NLS-1$
+
+ public static String OTREContainer__Description;
+
+ public static String OTREContainer_otre_not_found;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, OTCoreExtMessages.class);
+ }
+
+ private OTCoreExtMessages() {
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt/src/org/eclipse/objectteams/otdt/core/ext/OTCoreExtMessages.properties b/plugins/org.eclipse.objectteams.otdt/src/org/eclipse/objectteams/otdt/core/ext/OTCoreExtMessages.properties
new file mode 100644
index 000000000..6a81b37ca
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt/src/org/eclipse/objectteams/otdt/core/ext/OTCoreExtMessages.properties
@@ -0,0 +1,2 @@
+OTREContainer__Description=Object Teams Runtime Environment
+OTREContainer_otre_not_found=Cannot setup Object Teams ClassPath -- maybe otre.jar not found?
diff --git a/plugins/org.eclipse.objectteams.otdt/src/org/eclipse/objectteams/otdt/core/ext/OTDTPlugin.java b/plugins/org.eclipse.objectteams.otdt/src/org/eclipse/objectteams/otdt/core/ext/OTDTPlugin.java
new file mode 100644
index 000000000..36dcf9a63
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt/src/org/eclipse/objectteams/otdt/core/ext/OTDTPlugin.java
@@ -0,0 +1,155 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2003, 2007 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: OTDTPlugin.java 23427 2010-02-03 22:23:59Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.core.ext;
+
+import org.eclipse.core.resources.ICommand;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Plugin;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.objectteams.otdt.core.exceptions.ExceptionHandler;
+
+
+/**
+ * The main plugin class to be used in the desktop.
+ *
+ * @author jwloka
+ */
+public class OTDTPlugin extends Plugin
+{
+ public static final String PLUGIN_ID = JavaCore.OTDT_PLUGIN_ID;
+
+ public static final String OTDT_INSTALLDIR = "OTDT_INSTALLDIR"; //$NON-NLS-1$
+
+ // === IDs for configurable options for the compiler : ===
+ public static final String OT_COMPILER_BASE_CALL =
+ PLUGIN_ID + ".compiler.problem.basecall"; //$NON-NLS-1$
+ public static final String OT_COMPILER_UNSAFE_ROLE_INSTANTIATION =
+ PLUGIN_ID + ".compiler.problem.unsafe_role_instantiation"; //$NON-NLS-1$
+
+ public static final String OT_COMPILER_EFFECTLESS_FIELDACCESS =
+ PLUGIN_ID + ".compiler.problem.effectless_fieldaccess"; //$NON-NLS-1$
+ public static final String OT_COMPILER_FRAGILE_CALLIN =
+ PLUGIN_ID + ".compiler.problem.fragile_callin"; //$NON-NLS-1$
+ public static final String OT_COMPILER_UNUSED_PARAMMAP =
+ PLUGIN_ID + ".compiler.problem.unused_parammap"; //$NON-NLS-1$
+
+ public static final String OT_COMPILER_POTENTIAL_AMBIGUOUS_PLAYEDBY =
+ PLUGIN_ID + ".compiler.problem.potential_ambiguous_playedby"; //$NON-NLS-1$
+ public static final String OT_COMPILER_ABSTRACT_POTENTIAL_RELEVANT_ROLE =
+ PLUGIN_ID + ".compiler.problem.abstract_potential_relevant_role"; //$NON-NLS-1$
+
+ public static final String OT_COMPILER_DECAPSULATION =
+ PLUGIN_ID + ".compiler.problem.decapsulation"; //$NON-NLS-1$
+
+ public static final String OT_COMPILER_BINDING_CONVENTIONS =
+ PLUGIN_ID + ".compiler.problem.binding_conventions"; //$NON-NLS-1$
+
+ public static final String OT_COMPILER_INFERRED_CALLOUT =
+ PLUGIN_ID + ".compiler.problem.inferred_callout"; //$NON-NLS-1$
+
+ public static final String OT_COMPILER_INCOMPLETE_BUILD =
+ PLUGIN_ID + ".compiler.problem.incomplete_build"; //$NON-NLS-1$
+
+ public static final String OT_COMPILER_WEAVE_INTO_SYSTEM_CLASS =
+ PLUGIN_ID + ".compiler.problem.weave_into_system_class"; //$NON-NLS-1$
+
+ public static final String OT_COMPILER_OVERRIDE_FINAL_ROLE =
+ PLUGIN_ID + ".compiler.problem.override_final_role"; //$NON-NLS-1$
+
+ public static final String OT_COMPILER_EXCEPTION_IN_GUARD =
+ PLUGIN_ID + ".compiler.problem.exception_in_guard"; //$NON-NLS-1$
+
+ public static final String OT_COMPILER_AMBIGUOUS_LOWERING =
+ PLUGIN_ID + ".compiler.problem.ambiguous_lowering"; //$NON-NLS-1$
+
+ public static final String OT_COMPILER_ADAPTING_DEPRECATED =
+ PLUGIN_ID + ".compiler.problem.adapting_deprecated"; //$NON-NLS-1$
+
+ public static final String OT_COMPILER_SCOPED_KEYWORDS =
+ PLUGIN_ID + ".compiler.option.scoped_keywords"; //$NON-NLS-1$
+
+ public static final String OT_COMPILER_DEPRECATED_PATH_SYNTAX =
+ PLUGIN_ID + ".compiler.problem.deprecated_path_syntax"; //$NON-NLS-1$;
+
+
+ public static String OTRUNTIME_INSTALLDIR = "OTRUNTIME_INSTALLDIR"; //$NON-NLS-1$
+
+ private static OTDTPlugin _singleton = null;
+
+
+ public OTDTPlugin()
+ {
+ super();
+ _singleton = this;
+ }
+
+ public static OTDTPlugin getDefault()
+ {
+ return _singleton;
+ }
+
+ public static String[] createProjectNatures(IProjectDescription prjDesc)
+ {
+ String[] natures = prjDesc.getNatureIds();
+ String[] result = new String[natures.length + 1];
+
+ System.arraycopy(natures, 0, result, 0, natures.length);
+
+ result[natures.length] = JavaCore.OTJ_NATURE_ID;
+
+ return result;
+ }
+
+ public static ICommand[] createProjectBuildCommands(IProjectDescription project)
+ {
+ return new ICommand[] { createProjectBuildCommand(project) };
+ }
+
+ public static ICommand createProjectBuildCommand(IProjectDescription project)
+ {
+ ICommand otBuildCmd = project.newCommand();
+ otBuildCmd.setBuilderName(JavaCore.OTJ_BUILDER_ID);
+ return otBuildCmd;
+ }
+
+ public static ExceptionHandler getExceptionHandler()
+ {
+ return new ExceptionHandler(PLUGIN_ID);
+ }
+
+ public static Status createErrorStatus(String message, Throwable exception)
+ {
+ return new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, message, exception);
+ }
+
+ /**
+ * Take relativeFileName relative to OTRUNTIME_INSTALLDIR and make an absolute path from that.
+ * The returned string is enclosed in double-quotes so it is safe to have blanks within.
+ */
+ public static String calculateAbsoluteRuntimePath(String relativeFileName)
+ {
+ Path path = new Path(OTDTPlugin.OTRUNTIME_INSTALLDIR + relativeFileName);
+ return "\""+JavaCore.getResolvedVariablePath( path ).toOSString()+'"'; //$NON-NLS-1$
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt/src/org/eclipse/objectteams/otdt/core/ext/OTJavaNature.java b/plugins/org.eclipse.objectteams.otdt/src/org/eclipse/objectteams/otdt/core/ext/OTJavaNature.java
new file mode 100644
index 000000000..42d7520d2
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt/src/org/eclipse/objectteams/otdt/core/ext/OTJavaNature.java
@@ -0,0 +1,172 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2003, 2007 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: OTJavaNature.java 23427 2010-02-03 22:23:59Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.core.ext;
+
+import org.eclipse.core.resources.ICommand;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.resources.IProjectNature;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.internal.core.ExternalJavaProject;
+
+
+/**
+ * @author jwloka
+ * @version $Id: OTJavaNature.java 23427 2010-02-03 22:23:59Z stephan $
+ */
+@SuppressWarnings("restriction")
+public class OTJavaNature implements IProjectNature
+{
+ private IProject _prj;
+
+ public void configure() throws CoreException
+ {
+ IProjectDescription projectDescription = _prj.getDescription();
+ ICommand command = projectDescription.newCommand();
+ command.setBuilderName(JavaCore.OTJ_BUILDER_ID);
+
+ ICommand[] buildCommands = projectDescription.getBuildSpec();
+ ICommand[] newBuildCommands;
+
+ if (contains(buildCommands, JavaCore.OTJ_BUILDER_ID))
+ {
+ return; // safety, do nothing
+ }
+
+ if (contains(buildCommands, JavaCore.BUILDER_ID))
+ {
+ newBuildCommands =
+ replace(buildCommands, JavaCore.BUILDER_ID, command);
+ }
+ else
+ {
+ newBuildCommands = insert(buildCommands, command);
+ }
+
+ projectDescription.setBuildSpec(newBuildCommands);
+ _prj.setDescription(projectDescription, null);
+ }
+
+ public void deconfigure() throws CoreException
+ {
+ IProjectDescription description = _prj.getDescription();
+ ICommand[] buildCommands = description.getBuildSpec();
+ ICommand command = description.newCommand();
+ command.setBuilderName(JavaCore.BUILDER_ID);
+
+ ICommand[] newBuildCommands;
+
+ if (contains(buildCommands, JavaCore.OTJ_BUILDER_ID))
+ {
+ newBuildCommands =
+ replace(buildCommands, JavaCore.OTJ_BUILDER_ID, command);
+ }
+ else
+ {
+ newBuildCommands =
+ remove(buildCommands, JavaCore.OTJ_BUILDER_ID);
+ }
+
+ description.setBuildSpec(newBuildCommands);
+ _prj.setDescription(description, null);
+ }
+
+ public IProject getProject()
+ {
+ return _prj;
+ }
+
+ public void setProject(IProject value)
+ {
+ _prj = value;
+ }
+
+ public static boolean hasOTJavaNature(IProject project) {
+ try {
+ return project.hasNature(JavaCore.OTJ_NATURE_ID);
+ } catch (CoreException e) {
+ if (ExternalJavaProject.EXTERNAL_PROJECT_NAME.equals(project.getName())) // see JavaProject
+ return true;
+ }
+ return false;
+ }
+
+ private boolean contains(ICommand[] commands, String builderId)
+ {
+ for (int i = 0; i < commands.length; i++)
+ {
+ if (commands[i].getBuilderName().equals(builderId))
+ return true;
+ }
+
+ return false;
+ }
+
+ private ICommand[] replace(
+ ICommand[] sourceCommands, String oldBuilderId, ICommand newCommand)
+ {
+ ICommand[] newCommands = new ICommand[sourceCommands.length];
+
+ for (int i = 0; i < sourceCommands.length; i++)
+ {
+ if (sourceCommands[i].getBuilderName().equals(oldBuilderId))
+ {
+ newCommands[i] = newCommand;
+ }
+ else
+ {
+ newCommands[i] = sourceCommands[i];
+ }
+ }
+
+ return newCommands;
+ }
+
+ private ICommand[] insert(ICommand[] sourceCommands, ICommand command)
+ {
+ ICommand[] newCommands = new ICommand[sourceCommands.length + 1];
+ newCommands[0] = command;
+
+ for (int i = 0; i < sourceCommands.length; i++)
+ {
+ newCommands[i + 1] = sourceCommands[i];
+ }
+
+ return newCommands;
+ }
+
+ private ICommand[] remove(ICommand[] sourceCommands, String builderId)
+ {
+ ICommand[] newCommands = new ICommand[sourceCommands.length - 1];
+ int newCommandIndex = 0;
+
+ for (int i = 0; i < sourceCommands.length; i++)
+ {
+ if (!sourceCommands[i].getBuilderName().equals(builderId))
+ {
+ newCommands[newCommandIndex++] = sourceCommands[i];
+ }
+ }
+
+ return newCommands;
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt/src/org/eclipse/objectteams/otdt/core/ext/OTREContainer.java b/plugins/org.eclipse.objectteams.otdt/src/org/eclipse/objectteams/otdt/core/ext/OTREContainer.java
new file mode 100644
index 000000000..921b82b9a
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt/src/org/eclipse/objectteams/otdt/core/ext/OTREContainer.java
@@ -0,0 +1,151 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2003, 2007 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: OTREContainer.java 23427 2010-02-03 22:23:59Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.core.ext;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jdt.core.IClasspathContainer;
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
+
+/**
+ * @author gis
+ */
+public class OTREContainer implements IClasspathContainer
+{
+ public static final String OTRE_CONTAINER_NAME = "OTRE"; //$NON-NLS-1$
+ public static final String OTRE_JAR_FILENAME = "otre.jar"; //$NON-NLS-1$
+ public static final String OTRE_MIN_JAR_FILENAME = "otre_min.jar"; //$NON-NLS-1$
+
+ public static final IPath OTRE_CONTAINER_PATH = new Path(OTRE_CONTAINER_NAME);
+ public static final String OTRE_JAR_PATH = OTDTPlugin.OTDT_INSTALLDIR + "/lib/" + OTRE_JAR_FILENAME; //$NON-NLS-1$
+ public static final String OTRE_MIN_JAR_PATH = OTDTPlugin.OTDT_INSTALLDIR + "/lib/" + OTRE_MIN_JAR_FILENAME; //$NON-NLS-1$
+
+ private IClasspathEntry[] _cpEntries;
+
+ public IClasspathEntry[] getClasspathEntries()
+ {
+ if (_cpEntries == null)
+ {
+ _cpEntries = new IClasspathEntry[1];
+ IPath fullPath = new Path(OTRE_JAR_PATH);
+ IClasspathEntry varOTREEntry = JavaCore.newVariableEntry(fullPath, fullPath, fullPath, true);
+ _cpEntries[0] = JavaCore.getResolvedClasspathEntry(varOTREEntry);
+ }
+
+ return _cpEntries;
+ }
+
+ public String getDescription()
+ {
+ return OTCoreExtMessages.OTREContainer__Description;
+ }
+
+ public int getKind()
+ {
+ return IClasspathContainer.K_APPLICATION;
+ }
+
+ public IPath getPath()
+ {
+ return OTRE_CONTAINER_PATH;
+ }
+
+ /**
+ * Adds the ObjectTeams classes to the given JavaProject's classpath,
+ * and ensures the Java compliance is >= 1.5
+ */
+ public static void initializeOTJProject(IProject project) throws CoreException
+ {
+ if (project == null)
+ {
+ return;
+ }
+
+ if (project.hasNature(JavaCore.NATURE_ID))
+ {
+ IJavaProject javaPrj = (IJavaProject) project.getNature(JavaCore.NATURE_ID);
+ IClasspathEntry[] classpath = javaPrj.getRawClasspath();
+
+ if (!isOTREAlreadyInClasspath(classpath))
+ {
+ addOTREToClasspath(javaPrj, classpath);
+ }
+ String javaVersion = javaPrj.getOption(JavaCore.COMPILER_COMPLIANCE, true);
+ if (javaVersion.compareTo(JavaCore.VERSION_1_5)<0) {
+ javaPrj.setOption(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_5);
+ javaPrj.setOption(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_5);
+ javaPrj.setOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_5);
+ javaPrj.setOption(JavaCore.COMPILER_PB_ASSERT_IDENTIFIER, JavaCore.ERROR);
+ javaPrj.setOption(JavaCore.COMPILER_PB_ENUM_IDENTIFIER, JavaCore.ERROR);
+ javaPrj.setOption(JavaCore.COMPILER_CODEGEN_INLINE_JSR_BYTECODE, JavaCore.ENABLED);
+ }
+ }
+ }
+
+ private static boolean isOTREAlreadyInClasspath(IClasspathEntry[] classpath)
+ {
+ for (int idx = 0; classpath != null && idx < classpath.length; idx++)
+ {
+ IClasspathEntry entry = classpath[idx];
+ if (entry.getEntryKind() == IClasspathEntry.CPE_CONTAINER && entry.getPath().equals(OTRE_CONTAINER_PATH))
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Add the object teams foundation classes to the classpath.
+ */
+ private static void addOTREToClasspath(IJavaProject javaPrj, IClasspathEntry[] classpath)
+ throws JavaModelException, CoreException
+ {
+ IClasspathEntry[] newClasspath = new IClasspathEntry[classpath.length + 1];
+
+ System.arraycopy( classpath, 0, newClasspath, 0, classpath.length );
+
+ newClasspath[classpath.length] = JavaCore.newContainerEntry(OTRE_CONTAINER_PATH, false);
+
+ if (newClasspath[classpath.length] != null)
+ {
+ javaPrj.setRawClasspath( newClasspath, null );
+ }
+ else
+ {
+ Status reason = new Status(
+ IStatus.ERROR,
+ OTDTPlugin.PLUGIN_ID,
+ IStatus.OK,
+ OTCoreExtMessages.OTREContainer_otre_not_found, null);
+
+ throw new CoreException( reason );
+ }
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt/src/org/eclipse/objectteams/otdt/core/ext/OTREContainerInitializer.java b/plugins/org.eclipse.objectteams.otdt/src/org/eclipse/objectteams/otdt/core/ext/OTREContainerInitializer.java
new file mode 100644
index 000000000..61689ac0e
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt/src/org/eclipse/objectteams/otdt/core/ext/OTREContainerInitializer.java
@@ -0,0 +1,60 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2003, 2007 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: OTREContainerInitializer.java 23427 2010-02-03 22:23:59Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.core.ext;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jdt.core.ClasspathContainerInitializer;
+import org.eclipse.jdt.core.IClasspathContainer;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+
+/**
+ * This class creates the OTREContainer. Installed from plugin.xml as an extension.
+ *
+ * @author gis
+ */
+public class OTREContainerInitializer extends ClasspathContainerInitializer
+{
+
+ public OTREContainerInitializer()
+ {
+ super();
+ }
+
+ public void initialize(IPath containerPath, IJavaProject project)
+ throws CoreException
+ {
+ if (containerPath == null || containerPath.isEmpty() || !containerPath.segment(0).equals(OTREContainer.OTRE_CONTAINER_NAME))
+ return;
+
+ JavaCore.setClasspathContainer(
+ containerPath,
+ new IJavaProject[] { project },
+ new IClasspathContainer[] { createOTREContainer() },
+ null);
+ }
+
+ private IClasspathContainer createOTREContainer()
+ {
+ return new OTREContainer();
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt/src/org/eclipse/objectteams/otdt/core/ext/OTRuntimeClasspathProvider.java b/plugins/org.eclipse.objectteams.otdt/src/org/eclipse/objectteams/otdt/core/ext/OTRuntimeClasspathProvider.java
new file mode 100644
index 000000000..e90bfe421
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt/src/org/eclipse/objectteams/otdt/core/ext/OTRuntimeClasspathProvider.java
@@ -0,0 +1,123 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2003, 2006 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: OTRuntimeClasspathProvider.java 21932 2009-07-30 16:53:44Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.core.ext;
+
+import java.util.LinkedList;
+import java.util.List;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
+import org.eclipse.jdt.launching.JavaRuntime;
+import org.eclipse.jdt.launching.StandardClasspathProvider;
+
+
+/**
+ * @author gis
+ * @version $Id: OTRuntimeClasspathProvider.java 21932 2009-07-30 16:53:44Z stephan $
+ */
+public class OTRuntimeClasspathProvider extends StandardClasspathProvider
+{
+ public static final String PROVIDER_ID = "org.eclipse.objectteams.otdt.OTRuntimeClasspathProvider"; //$NON-NLS-1$
+
+ public static IPath BCEL_JAR = getVariablePath("/lib/BCEL.jar"); //$NON-NLS-1$
+
+ public IRuntimeClasspathEntry[] computeUnresolvedClasspath(ILaunchConfiguration configuration) throws CoreException
+ {
+ // add BCEL, JMangler-core and JMangler-start (classpath / bootclasspath)
+ IRuntimeClasspathEntry[] origEntries = super.computeUnresolvedClasspath(configuration);
+
+ int oldLength = origEntries.length;
+ IRuntimeClasspathEntry[] otRuntimeEntries = computePathsToAdd(origEntries);
+ IRuntimeClasspathEntry[] result = new IRuntimeClasspathEntry[oldLength + otRuntimeEntries.length];
+ System.arraycopy(origEntries, 0, result, 0, oldLength);
+
+ // add the missing OT runtime paths to the result
+ for (int i = 0; i < otRuntimeEntries.length; i++)
+ {
+ result[oldLength + i] = otRuntimeEntries[i];
+ }
+
+// IJavaProject project = JavaRuntime.getJavaProject(configuration);
+// if (project == null) {
+// // no project - use JRE's libraries by default
+
+ return result;
+ }
+
+ private static IRuntimeClasspathEntry[] computePathsToAdd( IRuntimeClasspathEntry[] origEntries )
+ {
+ boolean hasBCEL = false;
+ boolean hasJManglerCore = false;
+ boolean hasJManglerStart = false;
+
+ for (int i = 0; i < origEntries.length; i++)
+ {
+ IRuntimeClasspathEntry entry = origEntries[i];
+ if (BCEL_JAR.equals(entry.getPath()))
+ hasBCEL = true;
+ }
+
+ List<IRuntimeClasspathEntry> result = new LinkedList<IRuntimeClasspathEntry>();
+ IRuntimeClasspathEntry entry;
+
+//TODO (carp): make these class paths variable classpaths and compute the absolute path later
+// Also fix getVariablePath() then.
+ if (!hasBCEL)
+ {
+ entry = JavaRuntime.newArchiveRuntimeClasspathEntry(BCEL_JAR);
+ entry.setClasspathProperty(IRuntimeClasspathEntry.BOOTSTRAP_CLASSES);
+ result.add(entry);
+ }
+
+ if (!hasJManglerCore)
+ {
+ throw new RuntimeException("JMangler is no longer supported");
+ }
+
+ if (!hasJManglerStart)
+ {
+ throw new RuntimeException("JMangler is no longer supported");
+ }
+
+ return result.toArray(new IRuntimeClasspathEntry[result.size()]);
+ }
+
+ private static IPath getVariablePath(String filename)
+ {
+ Path path = new Path(OTDTPlugin.OTRUNTIME_INSTALLDIR + filename);
+ //return path;
+ return JavaCore.getResolvedVariablePath(path);
+ }
+
+ public IRuntimeClasspathEntry[] resolveClasspath(
+ IRuntimeClasspathEntry[] entries,
+ ILaunchConfiguration configuration)
+ throws CoreException
+ {
+ IRuntimeClasspathEntry[] result = super.resolveClasspath(entries, configuration);
+ return result;
+ }
+
+}
diff --git a/plugins/org.eclipse.objectteams.otdt/src/org/eclipse/objectteams/otdt/core/ext/OTRuntimeVariableInitializer.java b/plugins/org.eclipse.objectteams.otdt/src/org/eclipse/objectteams/otdt/core/ext/OTRuntimeVariableInitializer.java
new file mode 100644
index 000000000..c81ca4362
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt/src/org/eclipse/objectteams/otdt/core/ext/OTRuntimeVariableInitializer.java
@@ -0,0 +1,39 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2003, 2006 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: OTRuntimeVariableInitializer.java 23419 2010-02-03 20:43:26Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.core.ext;
+
+import org.eclipse.jdt.core.ClasspathVariableInitializer;
+
+/**
+ * FIXME(SH): try if this VARIABLE can be removed altogether.
+ * @author gis
+ * @version $Id: OTRuntimeVariableInitializer.java 23419 2010-02-03 20:43:26Z stephan $
+ */
+public class OTRuntimeVariableInitializer extends ClasspathVariableInitializer
+{
+ public void initialize(String variable)
+ {
+ if (OTDTPlugin.OTRUNTIME_INSTALLDIR.equals(variable))
+ {
+ OTVariableInitializer.setPluginInstallationPathVariable(OTDTPlugin.getDefault(), variable);
+ }
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otdt/src/org/eclipse/objectteams/otdt/core/ext/OTVariableInitializer.java b/plugins/org.eclipse.objectteams.otdt/src/org/eclipse/objectteams/otdt/core/ext/OTVariableInitializer.java
new file mode 100644
index 000000000..e7d07dab2
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt/src/org/eclipse/objectteams/otdt/core/ext/OTVariableInitializer.java
@@ -0,0 +1,74 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2003, 2007 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: OTVariableInitializer.java 23427 2010-02-03 22:23:59Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.core.ext;
+
+import java.io.File;
+import java.net.URL;
+
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Plugin;
+import org.eclipse.jdt.core.ClasspathVariableInitializer;
+import org.eclipse.jdt.core.JavaCore;
+
+
+/**
+ * ClassPathVariableInitializer to initialize the OTRE_INSTALL variable.
+ *
+ * @author gis
+ * @version $Id: OTVariableInitializer.java 23427 2010-02-03 22:23:59Z stephan $
+ */
+public class OTVariableInitializer extends ClasspathVariableInitializer
+{
+ public OTVariableInitializer()
+ {
+ super();
+ }
+
+ public void initialize(String variable)
+ {
+ if (OTDTPlugin.OTDT_INSTALLDIR.equals(variable))
+ {
+ setPluginInstallationPathVariable(OTDTPlugin.getDefault(), variable);
+ }
+ }
+
+ public static void setPluginInstallationPathVariable(Plugin relativePlugin, String variable)
+ {
+ try
+ {
+ URL installDirectory = relativePlugin.getBundle().getEntry("/"); //$NON-NLS-1$
+
+ // On Windows, the next line leads to something like "/C:/Programme/Eclipse/plugins/my.plugin
+ // If we simply make an org.eclipse.core.runtime.Path out of it, the leading '/' makes the
+ // parsing fail (device, e.g. 'C:' is not detected). We must use java.io.File to parse it
+ // properly.
+ String path = FileLocator.toFileURL(installDirectory).getPath();
+ String fixedPath = new File(path).getPath();
+ JavaCore.setClasspathVariable(variable, new Path(fixedPath), new NullProgressMonitor());
+ }
+ catch (Exception ex)
+ {
+ OTDTPlugin.getExceptionHandler().logException(ex);
+ }
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otequinox.branding/.classpath b/plugins/org.eclipse.objectteams.otequinox.branding/.classpath
new file mode 100644
index 000000000..987380a81
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox.branding/.classpath
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <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="con" path="OTRE"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/org.eclipse.objectteams.otequinox.branding/.project b/plugins/org.eclipse.objectteams.otequinox.branding/.project
new file mode 100644
index 000000000..b2b35ef78
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox.branding/.project
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.objectteams.otequinox.branding</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.objectteams.otdt.builder.OTJBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.objectteams.otdt.OTJavaNature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/org.eclipse.objectteams.otequinox.branding/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.objectteams.otequinox.branding/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..2f7f6e272
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox.branding/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,16 @@
+#Sun Aug 26 11:11:54 CEST 2007
+eclipse.preferences.version=1
+org.objectteams.otdt.compiler.option.joinpoint_queries=disabled
+org.objectteams.otdt.compiler.option.scoped_keywords=enabled
+org.objectteams.otdt.compiler.problem.abstract_potential_relevant_role=warning
+org.objectteams.otdt.compiler.problem.basecall=warning
+org.objectteams.otdt.compiler.problem.binding_conventions=error
+org.objectteams.otdt.compiler.problem.decapsulation=warning
+org.objectteams.otdt.compiler.problem.deprecated_path_syntax=warning
+org.objectteams.otdt.compiler.problem.effectless_fieldaccess=warning
+org.objectteams.otdt.compiler.problem.fragile_callin=warning
+org.objectteams.otdt.compiler.problem.incomplete_build=error
+org.objectteams.otdt.compiler.problem.inferred_callout=error
+org.objectteams.otdt.compiler.problem.potential_ambiguous_playedby=warning
+org.objectteams.otdt.compiler.problem.unsafe_liftctor=warning
+org.objectteams.otdt.compiler.problem.unused_parammap=warning
diff --git a/plugins/org.eclipse.objectteams.otequinox.branding/META-INF/MANIFEST.MF b/plugins/org.eclipse.objectteams.otequinox.branding/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..538e1eef5
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox.branding/META-INF/MANIFEST.MF
@@ -0,0 +1,14 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Example Plug-in for the Equinox-OTRE integration
+Bundle-SymbolicName: org.eclipse.objectteams.otequinox.branding;singleton:=true
+Bundle-Version: 1.4.0.qualifier
+Bundle-Vendor: objectteams.org
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.objectteams.otequinox,
+ org.eclipse.ui.workbench,
+ org.eclipse.ui
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ActivationPolicy: lazy
+Bundle-Activator: org.eclipse.objectteams.otequinox.branding.Activator
diff --git a/plugins/org.eclipse.objectteams.otequinox.branding/build.properties b/plugins/org.eclipse.objectteams.otequinox.branding/build.properties
new file mode 100644
index 000000000..5b6f9840a
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox.branding/build.properties
@@ -0,0 +1,8 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ plugin.xml,\
+ .,\
+ icons/
+src.includes = src/
+
diff --git a/plugins/org.eclipse.objectteams.otequinox.branding/icons/signed_adapted.gif b/plugins/org.eclipse.objectteams.otequinox.branding/icons/signed_adapted.gif
new file mode 100644
index 000000000..986fa4208
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox.branding/icons/signed_adapted.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otequinox.branding/icons/unsigned_adapted.gif b/plugins/org.eclipse.objectteams.otequinox.branding/icons/unsigned_adapted.gif
new file mode 100644
index 000000000..915a4e78f
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox.branding/icons/unsigned_adapted.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otequinox.branding/plugin.xml b/plugins/org.eclipse.objectteams.otequinox.branding/plugin.xml
new file mode 100644
index 000000000..a2dfe6517
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox.branding/plugin.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+<plugin>
+ <extension
+ point="org.eclipse.objectteams.otequinox.aspectBindings">
+ <aspectBinding icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/calloutbinding_obj.gif">
+ <team class="org.eclipse.objectteams.otequinox.internal.branding.BrandingAdaptor"
+ activation="ALL_THREADS"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif"/>
+ <basePlugin
+ id="org.eclipse.ui.workbench"
+ icon="platform:/plugin/org.eclipse.pde.ui/icons/obj16/plugin_obj.gif"/>
+ </aspectBinding>
+ </extension>
+
+</plugin>
diff --git a/plugins/org.eclipse.objectteams.otequinox.branding/src/org/eclipse/objectteams/otequinox/branding/Activator.java b/plugins/org.eclipse.objectteams.otequinox.branding/src/org/eclipse/objectteams/otequinox/branding/Activator.java
new file mode 100644
index 000000000..5f971e500
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox.branding/src/org/eclipse/objectteams/otequinox/branding/Activator.java
@@ -0,0 +1,98 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2009 Stephan Herrmann.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: Activator.java 23461 2010-02-04 22:10:39Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Stephan Herrmann - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otequinox.branding;
+
+import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+
+/**
+ * This bundle activator is only responsible for managing two icons,
+ * see {@link #getImage(String)}.
+ *
+ * @author stephan
+ * @since 1.4.0
+ */
+public class Activator extends AbstractUIPlugin {
+
+ /** "Signed" icon with aspect binding decoration. */
+ public static final String IMG_SIGNED_ADAPTED = "org.eclipse.objectteams.otequinox.branding.signed_adapted"; //$NON-NLS-1$
+
+ /** "Unsigned" icon with aspect binding decoration. */
+ public static final String IMG_UNSIGNED_ADAPTED = "org.eclipse.objectteams.otequinox.branding.unsigned_adapted"; //$NON-NLS-1$
+
+ /** The plug-in ID */
+ public static final String PLUGIN_ID = "org.eclipse.objectteams.otequinox.branding"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+ private ImageRegistry imageRegistry;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Get an image identified by the given key. Supported values are
+ * {@link #IMG_SIGNED_ADAPTED} and {@link #IMG_UNSIGNED_ADAPTED}.
+ * @param key
+ * @return a cached imaged, if valid key was given, otherwise null.
+ */
+ public Image getImage(String key) {
+ if (this.imageRegistry == null)
+ initializeImageRegistry();
+ return this.imageRegistry.get(key);
+ }
+
+ private void initializeImageRegistry() {
+ this.imageRegistry = new ImageRegistry();
+ this.imageRegistry.put(IMG_SIGNED_ADAPTED, imageDescriptorFromPlugin(PLUGIN_ID, "icons/signed_adapted.gif")); //$NON-NLS-1$
+ this.imageRegistry.put(IMG_UNSIGNED_ADAPTED, imageDescriptorFromPlugin(PLUGIN_ID, "icons/unsigned_adapted.gif")); //$NON-NLS-1$
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otequinox.branding/src/org/eclipse/objectteams/otequinox/internal/branding/BrandingAdaptor.java b/plugins/org.eclipse.objectteams.otequinox.branding/src/org/eclipse/objectteams/otequinox/internal/branding/BrandingAdaptor.java
new file mode 100644
index 000000000..f3be3701d
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox.branding/src/org/eclipse/objectteams/otequinox/internal/branding/BrandingAdaptor.java
@@ -0,0 +1,103 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id:AboutAdaptor.java 15202 2007-01-28 11:30:50Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otequinox.internal.branding;
+
+import java.util.HashSet;
+
+import org.eclipse.objectteams.otequinox.TransformerPlugin;
+import org.eclipse.objectteams.otequinox.branding.Activator;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.internal.WorkbenchMessages;
+
+import base org.eclipse.ui.internal.about.AboutBundleData;
+import base org.eclipse.ui.internal.about.AboutPluginsPage.BundleTableLabelProvider;
+
+/**
+ * This aspect adapts the branding of the Eclipse workbench by
+ * - adapting the about plug-ins dialog, displaying as a self-application
+ * which plug-ins have been adapted by an OT/J aspect.
+ * - changing the startup message "Loading Workbench" to a OT-specific one.
+ *
+ * @author stephan
+ * @version $Id:AboutAdaptor.java 15202 2007-01-28 11:30:50Z stephan $
+ */
+@SuppressWarnings("restriction")
+public team class BrandingAdaptor
+{
+ public BrandingAdaptor() {
+ WorkbenchMessages.Startup_Loading_Workbench = BrandingMessages.BrandingAdaptor_Loading_Workbench;
+ }
+ /** Append OT-adaptations to the version number of any adapted bundle. */
+ protected class AboutBundleAdaptor playedBy AboutBundleData
+ base when (isAdaptedBaseBundle(base))
+ {
+ callin String getVersion()
+ {
+ String adaptationString = ""; //$NON-NLS-1$
+ HashSet<String> reportedPlugins = new HashSet<String>();
+ adaptationString = BrandingMessages.BrandingAdaptor_OT_adapted_by;
+ for (String element : TransformerPlugin.getDefault().getAdaptingAspectPlugins(getID()))
+ {
+ if (!reportedPlugins.contains(element))
+ adaptationString = adaptationString+"\n* "+element; //$NON-NLS-1$
+ reportedPlugins.add(element);
+ }
+ return base.getVersion() + adaptationString;
+ }
+ getVersion <- replace getVersion;
+
+ String getID() -> String getId();
+ boolean isSigned() -> boolean isSigned();
+ boolean isSignedDetermined() -> boolean isSignedDetermined();
+ }
+
+ /**
+ * For all adapted bundles replace the singed/unsigned icons with
+ * a variant that is decorated with a aspect binding icon.
+ */
+ protected class IconAdaptor playedBy BundleTableLabelProvider {
+
+ Image getAdaptedSigningColumnImage(AboutBundleAdaptor data) <- replace Image getColumnImage(Object element, int columnIndex)
+ base when (columnIndex == 0 && isAdaptedBaseBundle(element))
+ with { data <- (AboutBundleData)element }
+
+ @SuppressWarnings("basecall")
+ callin Image getAdaptedSigningColumnImage(AboutBundleAdaptor data) {
+ if (data.isSignedDetermined()) {
+ if (data.isSigned())
+ return Activator.getDefault().getImage(Activator.IMG_SIGNED_ADAPTED);
+ else
+ return Activator.getDefault().getImage(Activator.IMG_UNSIGNED_ADAPTED);
+ }
+ return base.getAdaptedSigningColumnImage(data);
+ }
+ }
+
+ /** Is 'element' an AboutBundleData object representing a bundle that is adapted by an OT/Equinox bundle? */
+ public static boolean isAdaptedBaseBundle(Object element) {
+ // use qualified name, because AboutBundleData is a role's base class thus considered alien to this team:
+ if (element instanceof org.eclipse.ui.internal.about.AboutBundleData) {
+ String symbolicName = ((org.eclipse.ui.internal.about.AboutBundleData)element).getId();
+ return TransformerPlugin.getDefault().isAdaptedBasePlugin(symbolicName);
+ }
+ return false;
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otequinox.branding/src/org/eclipse/objectteams/otequinox/internal/branding/BrandingMessages.java b/plugins/org.eclipse.objectteams.otequinox.branding/src/org/eclipse/objectteams/otequinox/internal/branding/BrandingMessages.java
new file mode 100644
index 000000000..0898d8066
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox.branding/src/org/eclipse/objectteams/otequinox/internal/branding/BrandingMessages.java
@@ -0,0 +1,33 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2009 Stephan Herrmann.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: BrandingMessages.java 23461 2010-02-04 22:10:39Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Stephan Herrmann - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otequinox.internal.branding;
+
+import org.eclipse.osgi.util.NLS;
+
+public class BrandingMessages extends NLS {
+ private static final String BUNDLE_NAME = BrandingMessages.class.getName();
+ public static String BrandingAdaptor_Loading_Workbench;
+
+ public static String BrandingAdaptor_OT_adapted_by;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, BrandingMessages.class);
+ }
+
+ private BrandingMessages() {
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otequinox.branding/src/org/eclipse/objectteams/otequinox/internal/branding/BrandingMessages.properties b/plugins/org.eclipse.objectteams.otequinox.branding/src/org/eclipse/objectteams/otequinox/internal/branding/BrandingMessages.properties
new file mode 100644
index 000000000..2591bbd86
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox.branding/src/org/eclipse/objectteams/otequinox/internal/branding/BrandingMessages.properties
@@ -0,0 +1,2 @@
+BrandingAdaptor_Loading_Workbench=Loading Object Teams Workbench with OT/Equinox enabled
+BrandingAdaptor_OT_adapted_by=\n**** OT-adapted by:
diff --git a/plugins/org.eclipse.objectteams.otequinox.hook/.classpath b/plugins/org.eclipse.objectteams.otequinox.hook/.classpath
new file mode 100644
index 000000000..18ffe9570
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox.hook/.classpath
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <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="lib" path="/org.eclipse.objectteams.otequinox.runtime"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/org.eclipse.objectteams.otequinox.hook/.project b/plugins/org.eclipse.objectteams.otequinox.hook/.project
new file mode 100644
index 000000000..73623040a
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox.hook/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.objectteams.otequinox.hook</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.objectteams.otequinox.hook/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.objectteams.otequinox.hook/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..6629a1074
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox.hook/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,65 @@
+#Sat Oct 18 18:45:16 CEST 2008
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+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.fatalOptionalError=enabled
+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=warning
+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=warning
+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=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=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=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+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.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/plugins/org.eclipse.objectteams.otequinox.hook/META-INF/MANIFEST.MF b/plugins/org.eclipse.objectteams.otequinox.hook/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..79a0607e8
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox.hook/META-INF/MANIFEST.MF
@@ -0,0 +1,9 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Transformer Hook Fragment
+Bundle-SymbolicName: org.eclipse.objectteams.otequinox.hook
+Bundle-Version: 1.4.0.qualifier
+Bundle-Vendor: objectteams.org
+Fragment-Host: org.eclipse.osgi;bundle-version="[3.6.0.v20090928,4.0.0)"
+Export-Package: org.eclipse.objectteams.otequinox.hook
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/plugins/org.eclipse.objectteams.otequinox.hook/build.properties b/plugins/org.eclipse.objectteams.otequinox.hook/build.properties
new file mode 100644
index 000000000..61c53ff58
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox.hook/build.properties
@@ -0,0 +1,10 @@
+output.. = bin/
+bin.includes = .,\
+ META-INF/
+src.includes = .classpath,\
+ .project,\
+ build.properties,\
+ documentation/
+jars.compile.order = .
+source.. = src/
+jars.extra.classpath = lib/otre.jar
diff --git a/plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/hook/AspectPermission.java b/plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/hook/AspectPermission.java
new file mode 100644
index 000000000..b50bd8020
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/hook/AspectPermission.java
@@ -0,0 +1,33 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2009 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id$
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otequinox.hook;
+
+/**
+ * Possible values while negotiating aspect access (aspectBinding and forcedExport).
+ * Note that order is relevant in this enum: higher index means higher priority.
+ *
+ * @author stephan
+ * @since 1.2.6
+ */
+public enum AspectPermission {
+ /** Not influencing negotiation between other parties. */
+ UNDEFINED,
+ /** A permission is granted unless someone else denies it. */
+ GRANT,
+ /** A permission is explicitly denied. Cannot be overridden. */
+ DENY;
+}
diff --git a/plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/hook/ClassScanner.java b/plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/hook/ClassScanner.java
new file mode 100644
index 000000000..0627ee673
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/hook/ClassScanner.java
@@ -0,0 +1,141 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2008 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: ClassScanner.java 23461 2010-02-04 22:10:39Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otequinox.hook;
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+
+import org.eclipse.objectteams.otequinox.internal.hook.Util;
+import org.eclipse.objectteams.otre.jplis.ObjectTeamsTransformer;
+import org.eclipse.objectteams.otre.util.CallinBindingManager;
+import org.osgi.framework.Bundle;
+
+/**
+ * Bridge for the TransformerPlugin by which it can access the ObjectTeamsTransformer
+ * without accessing that OTRE class.
+ *
+ * @author stephan
+ * @since 1.2.0
+ */
+@SuppressWarnings("nls")
+public class ClassScanner
+{
+ // default is "on", leave this switch for trouble shooting and profiling:
+ public static final boolean REPOSITORY_USE_RESOURCE_LOADER = !"off".equals(System.getProperty("otequinox.repository.hook"));
+
+ ObjectTeamsTransformer transformer = new ObjectTeamsTransformer();
+
+ // collect class names recorded by readOTAttributes:
+
+ // * this version used by the MasterTeamLoader.loadTeams:
+ HashMap<String,ArrayList<String>> baseClassNamesByTeam = new HashMap<String, ArrayList<String>>();
+ // * these fields used by TransformerHook.processClass (collected over multiple readOTAttributes):
+ ArrayList<String> allBaseClassNames = new ArrayList<String>();
+ ArrayList<String> roleClassNames = new ArrayList<String>();
+
+
+ /**
+ * Read all OT byte code attributes for the specified class.
+ * While doing so the names of roles and adapted base classes are collected.
+ *
+ * @param bundle where to look
+ * @param className the class to investigate (team or role)
+ * @param loader the loader (could be null) to use for further classFile lookup
+ * @throws ClassFormatError
+ * @throws IOException
+ * @throws ClassNotFoundException the team or role class was not found
+ */
+ public void readOTAttributes(Bundle bundle, String className, ClassLoader loader)
+ throws ClassFormatError, IOException, ClassNotFoundException
+ {
+ if (!REPOSITORY_USE_RESOURCE_LOADER)
+ loader = null;
+ URL classFile = bundle.getResource(className.replace('.', '/')+".class");
+ if (classFile == null)
+ throw new ClassNotFoundException(className);
+ this.transformer.readOTAttributes(classFile.openStream(), classFile.getFile(), loader);
+ Collection<String> currentBaseNames = this.transformer.fetchAdaptedBases(); // destructive read
+ if (currentBaseNames != null) {
+ // store per team:
+ ArrayList<String> basesPerTeam = this.baseClassNamesByTeam.get(className);
+ if (basesPerTeam == null) {
+ basesPerTeam = new ArrayList<String>();
+ this.baseClassNamesByTeam.put(className, basesPerTeam);
+ }
+ basesPerTeam.addAll(currentBaseNames);
+ // accumulated store:
+ allBaseClassNames.addAll(currentBaseNames);
+ }
+ readMemberTypeAttributes(bundle, className, loader);
+ }
+
+ /**
+ * Get the names of the base classes adapted by the given team and
+ * encountered while reading the byte code attributes.
+ * (Destructive read).
+ */
+ public Collection<String> getCollectedBaseClassNames(String teamName) {
+ return this.baseClassNamesByTeam.remove(teamName);
+ }
+
+ /**
+ * Get the names of all adapted base classes encountered while reading the byte code attributes.
+ * (Destructive read).
+ */
+ public Collection<String> getCollectedBaseClassNames() {
+ try {
+ return this.allBaseClassNames;
+ } finally {
+ this.allBaseClassNames = new ArrayList<String>();
+ }
+ }
+
+ /**
+ * Get the names of all member roles encountered while reading the byte code attributes.
+ * (Destructive read).
+ */
+ public Collection<String> getCollectedRoleClassNames() {
+ return this.roleClassNames;
+ }
+
+ /*
+ * Recurse into member types scanning OT attributes.
+ */
+ private void readMemberTypeAttributes(Bundle bundle,
+ String className,
+ ClassLoader resourceLoader)
+ {
+ List<String> roles = CallinBindingManager.getRolePerTeam(className);
+ if (roles != null) {
+ ILogger logger = HookConfigurator.getLogger();
+ for (String roleName: roles) {
+ logger.log(Util.OK, "scanning role "+roleName);
+ try {
+ this.roleClassNames.add(roleName);
+ readOTAttributes(bundle, roleName, resourceLoader);
+ } catch (Throwable t) {
+ logger.log(t, "Failed to read OT-Attributes of role "+roleName);
+ }
+ readMemberTypeAttributes(bundle, roleName, resourceLoader);
+ }
+ }
+ }
+}; \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/hook/HookConfigurator.java b/plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/hook/HookConfigurator.java
new file mode 100644
index 000000000..f90e60a9a
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/hook/HookConfigurator.java
@@ -0,0 +1,127 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: HookConfigurator.java 23461 2010-02-04 22:10:39Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otequinox.hook;
+
+import java.io.File;
+import java.util.ArrayList;
+
+import org.eclipse.core.runtime.internal.adaptor.EclipseStorageHook;
+import org.eclipse.objectteams.otequinox.internal.hook.Logger;
+import org.eclipse.objectteams.otequinox.internal.hook.OTEquinoxServiceWatcher;
+import org.eclipse.objectteams.otequinox.internal.hook.OTStorageHook;
+import org.eclipse.objectteams.otequinox.internal.hook.TransformerHook;
+import org.eclipse.osgi.baseadaptor.hooks.StorageHook;
+import org.eclipse.osgi.framework.log.FrameworkLogEntry;
+
+/**
+ * This class installs the necessary hooks for using OT/J in eclipse plugins.
+ * As the first OTDT class in the load process it also updates the eclipse buildId
+ * to contain the OTDT version number, too (for logging).
+ *
+ * @author stephan
+ * @version $Id: HookConfigurator.java 23461 2010-02-04 22:10:39Z stephan $
+ */
+public class HookConfigurator implements org.eclipse.osgi.baseadaptor.HookConfigurator {
+
+
+ private static final String OTDT_BUILD_ID = "OT-1.4.0M2"; //$NON-NLS-1$
+ private static final String ECLIPSE_BUILD_ID = "eclipse.buildId"; //$NON-NLS-1$
+ /** Has OT/Equinox been enabled (using system property ot.equinox set to anything but "false")? */
+ public static final boolean OT_EQUINOX_ENABLED;
+
+ static {
+ String otequinoxProperty = System.getProperty("ot.equinox"); //$NON-NLS-1$
+ if (otequinoxProperty == null)
+ OT_EQUINOX_ENABLED = false;
+ else
+ OT_EQUINOX_ENABLED = !"false".equals(otequinoxProperty); //$NON-NLS-1$
+ }
+
+ // singleton:
+ static HookConfigurator instance;
+ // logging (console or via FrameworkLog):
+ private Logger logger;
+ public HookConfigurator() {
+ instance = this;
+ }
+ public static ILogger getLogger() {
+ if (instance == null)
+ throw new RuntimeException("TransformerHook not initialized, perhaps OT/Equinox is not enabled?"); //$NON-NLS-1$
+ return instance.logger;
+ }
+
+ private void updateBuildID() {
+ String eclipseBuild = System.getProperty(ECLIPSE_BUILD_ID);
+ if (eclipseBuild == null) {
+ eclipseBuild = OTDT_BUILD_ID;
+ } else {
+ int pos = eclipseBuild.indexOf('-', 8);
+ if (pos > 0)
+ eclipseBuild = eclipseBuild.substring(0, pos);
+ eclipseBuild = eclipseBuild+"."+OTDT_BUILD_ID; //$NON-NLS-1$
+ }
+ System.setProperty(ECLIPSE_BUILD_ID, eclipseBuild);
+ }
+
+ public void addHooks(org.eclipse.osgi.baseadaptor.HookRegistry hookRegistry) {
+ if (!OT_EQUINOX_ENABLED)
+ return;
+ this.logger = new Logger(hookRegistry.getAdaptor().getFrameworkLog());
+ updateBuildID();
+ TransformerHook transformerHook = new TransformerHook(hookRegistry.getAdaptor());
+ // this instance observes
+ hookRegistry.addClassLoadingHook(transformerHook);
+ hookRegistry.addClassLoaderDelegateHook(transformerHook);
+ hookRegistry.addWatcher(transformerHook);
+ hookRegistry.addAdaptorHook(new OTEquinoxServiceWatcher(transformerHook));
+ synchronized (hookRegistry) {
+ insertStorageHook(hookRegistry);
+ }
+ }
+ /* Insert an OTStorageHook before EclipseStorageHook as to intercept getManifest(): */
+ private void insertStorageHook(org.eclipse.osgi.baseadaptor.HookRegistry hookRegistry)
+ {
+ hookRegistry.addStorageHook(null); // grow array, fill in below:
+ StorageHook[] allStorageHooks= hookRegistry.getStorageHooks();
+
+ OTStorageHook storageHook= null;
+ for (int i=allStorageHooks.length-1; i>0; i--) {
+ allStorageHooks[i]= allStorageHooks[i-1];
+ if (allStorageHooks[i] instanceof EclipseStorageHook)
+ storageHook= new OTStorageHook(null, (EclipseStorageHook)allStorageHooks[i]);
+ }
+ if (storageHook != null) // only install if validly wired
+ allStorageHooks[0]= storageHook;
+ else
+ hookRegistry.getAdaptor().getFrameworkLog().log(new FrameworkLogEntry(
+ HookConfigurator.class.getName(),
+ "EclipseStorageHook not found", //$NON-NLS-1$
+ FrameworkLogEntry.ERROR, null, null));
+ }
+ /** Bridge to the OTStorageHook. */
+ public static void parseForcedExportsFile(File configFile, AspectPermission perm) {
+ OTStorageHook.parseForcedExportsFile(configFile, perm);
+ }
+ /** Bridge to the OTStorageHook. */
+ public static ArrayList<String[]> getForcedExportsByAspect(String aspectBundleId, AspectPermission perm) {
+ return OTStorageHook.getForcedExportsByAspect(aspectBundleId, perm);
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/hook/IAspectRegistry.java b/plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/hook/IAspectRegistry.java
new file mode 100644
index 000000000..a580f4264
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/hook/IAspectRegistry.java
@@ -0,0 +1,66 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2007, 2009 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: MasterTeamLoader.java 15426 2007-02-25 12:52:19Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otequinox.hook;
+
+import org.osgi.framework.Bundle;
+
+/**
+ * This slice of the IOTEquinoxService provides features to query the
+ * registry of aspectBindings.
+ *
+ * @author stephan
+ * @since OTDT 1.1.4
+ */
+public interface IAspectRegistry {
+
+ /** Are we running within the OTDT? */
+ public boolean isOTDT();
+
+ /** Is `symbolicName' the name of a base plugin for which an adapting team is registered? */
+ public boolean isAdaptedBasePlugin(String baseBundleName);
+
+ /**
+ * Get the names of aspect plugins adapting a given base plugin.
+ * @param basePlugin base plugin.
+ * @return non-null array of symbolic names of aspect plugins.
+ */
+ public String[] getAdaptingAspectPlugins(Bundle baseBundle);
+
+ /**
+ * Get the plugin IDs of all base plugins adapted by this aspect plugin.
+ * If this plugin is not an aspect plugin return null.
+ * @param aspectBundle potential aspect plugin
+ * @return array of base plugin IDs or null.
+ */
+ public String[] getAdaptedBasePlugins(Bundle aspectBundle);
+
+ /**
+ * Does `bundle' have internal teams, i.e., teams that adapt classes from their
+ * enclosing plug-in only?
+ * @param bundle
+ * @return
+ */
+ public boolean hasInternalTeams(Bundle bundle);
+
+ /**
+ * Does the symbolic name refer to an aspect bundle for which some permission was denied?
+ * @param symbolicName
+ * @return
+ */
+ public boolean isDeniedAspectPlugin(String symbolicName);
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/hook/IByteCodeAnalyzer.java b/plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/hook/IByteCodeAnalyzer.java
new file mode 100644
index 000000000..8aa6039e0
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/hook/IByteCodeAnalyzer.java
@@ -0,0 +1,32 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2008 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: IByteCodeAnalyzer.java 23461 2010-02-04 22:10:39Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otequinox.hook;
+
+import java.io.InputStream;
+
+/**
+ * Interface for byte code analyzers that peek specific information
+ * from a class' byte code without parsing the whole structure.
+ *
+ * @author stephan
+ * @since 1.2.3
+ */
+public interface IByteCodeAnalyzer {
+
+ String getSuperclass(InputStream is, String className);
+ String getSuperclass(byte[] bytes, String className);
+}
diff --git a/plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/hook/ILogger.java b/plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/hook/ILogger.java
new file mode 100644
index 000000000..891586a59
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/hook/ILogger.java
@@ -0,0 +1,39 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2008, 2009 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id$
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otequinox.hook;
+
+import org.eclipse.osgi.framework.log.FrameworkLogEntry;
+
+/**
+ * Our own variant of a logger interface, just slightly tailored variants of log methods.
+ * @author stephan
+ * @since 1.2.0
+ */
+public interface ILogger {
+
+ int ERROR = FrameworkLogEntry.ERROR;
+ int WARNING = FrameworkLogEntry.WARNING;
+ int INFO = FrameworkLogEntry.INFO;
+ int OK = FrameworkLogEntry.OK;
+
+ public void log(Throwable t, String msg);
+ public void log(int status, String msg);
+ /** Same as above but do not filter by warnlevel. */
+ public void doLog(int status, String msg);
+ public void log(String pluginID, Throwable ex, String msg);
+ public void log(String pluginID, int status, String msg);
+}
diff --git a/plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/hook/IOTEquinoxService.java b/plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/hook/IOTEquinoxService.java
new file mode 100644
index 000000000..ad74d62f7
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/hook/IOTEquinoxService.java
@@ -0,0 +1,29 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2007 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id$
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otequinox.hook;
+
+/**
+ * This interface unites the aspect registry and the team loading mechanism
+ * to a OT/Equinox service.
+ * This service is published by the otequinox plugin and consumed by the transformer hook.
+ *
+ * @author stephan
+ * @since OTDT 1.1.4
+ */
+public interface IOTEquinoxService extends IAspectRegistry, ITeamLoader {
+ IByteCodeAnalyzer getByteCodeAnalyzer();
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/hook/ITeamLoader.java b/plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/hook/ITeamLoader.java
new file mode 100644
index 000000000..95bd9b562
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/hook/ITeamLoader.java
@@ -0,0 +1,62 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2007 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: MasterTeamLoader.java 15426 2007-02-25 12:52:19Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otequinox.hook;
+
+
+import org.osgi.framework.Bundle;
+
+/**
+ * Interface to the team loading mechanism.
+ *
+ * @author stephan
+ * @since OTDT 1.1.4
+ */
+public interface ITeamLoader {
+
+ /**
+ * Load all teams registered as adapting `baseBundle'.
+ * Also load all adapted base classes from the base bundle.
+ *
+ * @param baseBundle the bundle to be adapted
+ * @param classScanner object to be used for scanning class attributes
+ * @return whether loading teams was successful.
+ * If so, instantiateTeams() should be invoked later.
+ */
+ public boolean loadTeams(Bundle baseBundle, ClassScanner classScanner);
+
+ /**
+ * Load all internal teams of bundle, i.e., teams that adapt classes from their
+ * enclosing plug-in only.
+ *
+ * @param bundle this bundle is aspect and base at the same time
+ * @param scanner class scanner which collects the affected base and role classes.
+ * @return
+ */
+ public boolean loadInternalTeams(Bundle bundle, ClassScanner scanner);
+
+ /**
+ * Instantiate all teams for baseBundle which have been loaded via loadTeams().
+ * @param baseBundle
+ * @param triggerClassName class who's loading triggered this instantiation request.
+ */
+ public void instantiateTeams(final Bundle baseBundle, String triggerClassName);
+
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/internal/hook/AspectBundleRole.java b/plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/internal/hook/AspectBundleRole.java
new file mode 100644
index 000000000..09edd385a
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/internal/hook/AspectBundleRole.java
@@ -0,0 +1,45 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: AspectBundleRole.java 23461 2010-02-04 22:10:39Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otequinox.internal.hook;
+
+public class AspectBundleRole {
+
+ boolean isLoading = false;
+
+ AspectBundleRole(boolean isLoading) {
+ this.isLoading = isLoading;
+ }
+
+ static boolean isLoadingTeams(BundleRegistry bundleRegistry, String bundleID)
+ {
+ AspectBundleRole aspect = bundleRegistry.aspectBundles.get(bundleID);
+ if (aspect == null)
+ return false;
+ return aspect.isLoading;
+ }
+
+ static void markLoadingTeams(BundleRegistry bundleRegistry, String bundleID, boolean flag) {
+ AspectBundleRole aspect = bundleRegistry.aspectBundles.get(bundleID);
+ if (aspect != null)
+ aspect.isLoading = flag;
+ }
+
+}
diff --git a/plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/internal/hook/BaseBundleRole.java b/plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/internal/hook/BaseBundleRole.java
new file mode 100644
index 000000000..2d02ed876
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/internal/hook/BaseBundleRole.java
@@ -0,0 +1,197 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2009 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: BaseBundleRole.java 23468 2010-02-04 22:34:27Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otequinox.internal.hook;
+
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+
+import org.eclipse.objectteams.otequinox.hook.ClassScanner;
+import org.eclipse.objectteams.otequinox.hook.HookConfigurator;
+import org.eclipse.objectteams.otequinox.hook.ILogger;
+import org.eclipse.objectteams.otequinox.hook.ITeamLoader;
+import org.osgi.framework.Bundle;
+
+/**
+ * This class decorates each base bundle for which adapting aspect bundles exist.
+ *
+ * @author stephan
+ * @version $Id: BaseBundleRole.java 23468 2010-02-04 22:34:27Z stephan $
+ */
+@SuppressWarnings("nls")
+public class BaseBundleRole {
+
+ enum State {
+ INITIAL, // nothing known yet.
+ WAIT_FOR_TEAM, // a base bundle for which an aspect was found which cannot yet be loaded.
+ ACTIVATED, // was waiting, activation has been done,
+ TEAMS_LOADED, // ready to be loaded/transformed
+ TEAMS_INSTANTIATED // in this final state the team has been instantiated
+ }
+
+ /** Pseudo ID of a basePlugin specifying that the team(s) adapt base classes from their own plugin. */
+ static final String SELF = "SELF";
+
+ /* Symbolic name of the base bundle. */
+ final String symbolicName;
+ /* The corresponding base bundle itself. */
+ Bundle bundle;
+ /* The bundles by which teams are loaded. */
+ ArrayList<Bundle> aspectBundles = new ArrayList<Bundle>();
+
+ /* State according to the above state model. */
+ State state = State.INITIAL;
+
+ // used by the ClassLoaderDelegateHook to cut recursive search:
+ HashSet<String> missingClassNames = new HashSet<String>(); // currently unused
+ HashMap<String,Class<?>> knownAlienClasses= new HashMap<String, Class<?>>();
+
+ BaseBundleRole(Bundle bundle) {
+ this.bundle = bundle;
+ this.symbolicName = bundle.getSymbolicName();
+ }
+
+ void setup(Bundle bundle, State state) {
+ this.state = state;
+ this.bundle = bundle;
+ }
+
+ /** Found an adapted base via the aspect: create a role,
+ * or retrieve and enhance an existing one (by adding the aspect bundle). */
+ static BaseBundleRole createBaseBundleRole(
+ BundleRegistry bundleRegistry,
+ Bundle baseBundle,
+ Bundle aspectBundle)
+ {
+ String symbolicName = baseBundle.getSymbolicName();
+ BaseBundleRole baseRole = bundleRegistry.adaptedBaseBundles.get(symbolicName);
+ if (baseRole == null) {
+ baseRole = new BaseBundleRole(baseBundle);
+ bundleRegistry.adaptedBaseBundles.put(symbolicName, baseRole);
+ }
+ baseRole.aspectBundles.add(aspectBundle);
+ return baseRole;
+ }
+
+ /**
+ * Perform actions due when the base plugin has finished its activation.
+ * Mainly delegate these actions to the bundle's BaseBundleRole.
+ *
+ * @param bundleRegistry
+ * @param bundle
+ * @param loader
+ * @return a Runnable encapsulating the action of instantiating teams (or null).
+ */
+ static void endActivation(
+ BundleRegistry bundleRegistry,
+ Bundle bundle,
+ SafeAspectRegistry aspectRegistry,
+ ITeamLoader loader)
+ {
+ String symbolicName = bundle.getSymbolicName();
+ BaseBundleRole baseRole = bundleRegistry.adaptedBaseBundles.get(symbolicName);
+ if (baseRole != null) {
+ String[] aspects = aspectRegistry.getAdaptingAspectPlugins(bundle);
+ if (aspects.length == 0)
+ return; // error during service access
+
+ // before retrieving aspect roles ensure base bundle has its
+ // classloader initialized (which triggers aspect role creation):
+ bundle.getResource("META-INF/MANIFEST.MF"); // ignore result //$NON-NLS-1$
+
+ try {
+ for (String aspect : aspects) {
+ AspectBundleRole aspectBundleRole = bundleRegistry.aspectBundles.get(aspect);
+ aspectBundleRole.isLoading = true;
+ }
+ baseRole.endActivation(loader);
+ } finally {
+ for (String aspect : aspects) {
+ AspectBundleRole aspectBundleRole = bundleRegistry.aspectBundles.get(aspect);
+ aspectBundleRole.isLoading = false;
+ }
+ }
+ }
+ }
+ private void endActivation(final ITeamLoader loader)
+ {
+ ILogger log = HookConfigurator.getLogger();
+
+ switch (this.state) {
+ case WAIT_FOR_TEAM:
+ // FIXME(SH): remove once we are sure it never happens
+ log.log(Util.ERROR, "Asynchronuous activation while initializing class loader: "+this);
+ this.state = State.ACTIVATED;
+ break;
+ case TEAMS_LOADED:
+ // fetch and answer this request
+ this.state = State.TEAMS_INSTANTIATED;
+
+ // Delegate to the TransformerPlugin to perform PHASE 2 of aspect activation:
+ // + loading adapted base classes
+ // + instantiating loaded teams.
+ log.log(Util.OK, "PHASE 2: Handling base plugin with aspects pending for instantiation: "
+ +this.bundle.getSymbolicName());
+ loader.instantiateTeams(this.bundle, /*triggerClassname*/null);
+ break;
+ default: // noop
+ }
+ }
+
+ /**
+ * Load all known teams adapting this base bundle.
+ * @param loader the team loader service from org.eclipse.objectteams.otequinox.
+ */
+ void loadTeams(ITeamLoader loader, ClassScanner scanner) {
+ ILogger log = HookConfigurator.getLogger();
+
+ if (this.state != State.WAIT_FOR_TEAM)
+ log.log(Util.ERROR, "Unexpected state when loading teams for "+this);
+
+ // perform PHASE 1:
+ log.log(Util.OK, "PHASE 1: Load team classes adapting plugin "+this.symbolicName);
+
+ if (loader.loadTeams(this.bundle, scanner))
+ {
+ if (this.state == State.ACTIVATED) {
+ // FIXME(SH): remove once we are sure it never happens
+
+ this.state = State.TEAMS_INSTANTIATED;
+
+ log.log(Util.ERROR, "!!!! Unexpected control flow !!!!");
+
+ log.log(Util.INFO, "PHASE 2: Handling base plugin with aspects pending for instantiation: "+this.symbolicName);
+ loader.instantiateTeams(this.bundle, /*triggerClassname*/null);
+ } else {
+ this.state = State.TEAMS_LOADED;
+ }
+ } else {
+ this.state = State.TEAMS_INSTANTIATED;
+ }
+ }
+
+ @Override
+ public String toString() {
+ String result= "Base Bundle "+this.symbolicName +"("+this.state+")";
+ for (Bundle aspect : this.aspectBundles) {
+ result += "\n\t"+aspect;
+ }
+ return result;
+ }
+
+}
diff --git a/plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/internal/hook/BundleRegistry.java b/plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/internal/hook/BundleRegistry.java
new file mode 100644
index 000000000..88d41f749
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/internal/hook/BundleRegistry.java
@@ -0,0 +1,98 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: BundleRegistry.java 23461 2010-02-04 22:10:39Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otequinox.internal.hook;
+
+import java.util.HashMap;
+
+import org.eclipse.objectteams.otequinox.hook.ClassScanner;
+import org.eclipse.objectteams.otequinox.hook.IAspectRegistry;
+import org.eclipse.objectteams.otequinox.hook.ITeamLoader;
+import org.osgi.framework.Bundle;
+
+/** Maintain mappings from plugin ids to base/aspect bundles.
+ * Please just think of this class as a team and {Base,Aspect}BundleRole
+ * as its roles ;-)
+ */
+public class BundleRegistry {
+
+ HashMap<String,BaseBundleRole> adaptedBaseBundles = new HashMap<String, BaseBundleRole>();
+
+ HashMap<String,AspectBundleRole> aspectBundles = new HashMap<String, AspectBundleRole>();
+
+ public boolean isAdaptedBaseBundle(String symbolicName) {
+ return adaptedBaseBundles.containsKey(symbolicName);
+ }
+
+ void createAspectRole (String symbolicName) {
+ aspectBundles.put(symbolicName, new AspectBundleRole(true));
+ }
+
+ void resetLoading (String[] aspects) {
+ for (String aspect : aspects)
+ aspectBundles.get(aspect).isLoading = false;
+ }
+
+ /** Found an adapted base directly.
+ * After this the bundle is waiting for transformation.
+ */
+ BaseBundleRole createWaitingBase(Bundle baseBundle)
+ {
+ String symbolicName = baseBundle.getSymbolicName();
+ BaseBundleRole baseRole = this.adaptedBaseBundles.get(symbolicName);
+ if (baseRole == null) {
+ baseRole = new BaseBundleRole(baseBundle);
+ this.adaptedBaseBundles.put(symbolicName, baseRole);
+ }
+ baseRole.setup(baseBundle, BaseBundleRole.State.WAIT_FOR_TEAM);
+ return baseRole;
+ }
+
+ /** Delegate to the TransformerPlugin to perform PHASE 1 of aspect activation:
+ * + loading of teams adapting baseBundle
+ * @param baseBundle TODO
+ * @param registry
+ * @param loader
+ * @param scanner instance to use for scanning OT byte code attributes.
+ * @return a collection of names of adapted base classes (non-null)
+ */
+ void checkLoadTeams (Bundle baseBundle, IAspectRegistry registry, ITeamLoader loader, ClassScanner scanner)
+ {
+ // DEBUG:
+ // if (isKnowID(baseBundle.getSymbolicName()))
+ // System.out.println(">>3>>"+baseBundle.getSymbolicName());
+
+ String[] aspectBundleNames = registry.getAdaptingAspectPlugins(baseBundle);
+ if (aspectBundleNames.length == 0)
+ return;
+
+ try {
+ for (String aspect : aspectBundleNames)
+ this.createAspectRole(aspect); // enable transformation for these plugins
+
+ // requesting PHASE 2 (request might be answered during loadTeams)
+ BaseBundleRole baseRole = this.createWaitingBase(baseBundle);
+
+ baseRole.loadTeams(loader, scanner);
+ } finally {
+ this.resetLoading(aspectBundleNames);
+ }
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/internal/hook/ByteCodeAnalyzer.java b/plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/internal/hook/ByteCodeAnalyzer.java
new file mode 100644
index 000000000..1db9f608d
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/internal/hook/ByteCodeAnalyzer.java
@@ -0,0 +1,85 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2007 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: TransformerPlugin.java 15357 2007-02-18 17:01:36Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otequinox.internal.hook;
+
+/**
+ * This class is used to peek the byte code before passing it to the transformers or the JVM.
+ *
+ * @author stephan
+ */
+public class ByteCodeAnalyzer {
+
+ // cannot import jdt.core, so repeat some constants here:
+ static final int AccTeam = 0x8000;
+ static final int Utf8Tag = 1;
+ static final int LongTag = 5;
+ static final int DoubleTag = 6;
+ static final int[] CPEntryLengths = new int[] {
+ 0,
+ 3, // UTF-8
+ 0,
+ 5, // integer
+ 5, // float
+ 9, // long
+ 9, // double
+ 3, // class
+ 3, // string
+ 5, // field
+ 5, // method
+ 5, // ifc method
+ 5, // name and type
+ };
+
+ /** Peek the bytecode for class flags to test if current class is a team. */
+ static boolean isTeam(byte[] classbytes)
+ {
+ int constantPoolCount = combineTwoBytes(classbytes, 8);
+ int readOffset = 10;
+
+ // skip over constant pool:
+ for (int i = 1; i < constantPoolCount; i++) {
+ int tag = classbytes[readOffset];
+ if (tag == Utf8Tag)
+ readOffset += combineTwoBytes(classbytes, readOffset + 1);
+ if (tag < CPEntryLengths.length)
+ readOffset += CPEntryLengths[tag];
+ else
+ throw new RuntimeException("bad tag?"); //$NON-NLS-1$
+ if (tag == DoubleTag || tag == LongTag)
+ i++;
+ }
+ int classFlags = combineTwoBytes(classbytes, readOffset);
+ return (classFlags & AccTeam) != 0;
+ }
+
+ /* helper for above: read an unsigned short. */
+ static int combineTwoBytes(byte [] bytes, int start) {
+ int first = bytes[start];
+ int second = bytes[start+1];
+ int twoBytes = 0;
+
+ twoBytes = twoBytes|(first&0xff);
+ twoBytes = twoBytes<<8;
+ twoBytes = twoBytes|(second&0xff);
+ return twoBytes;
+ }
+
+}
diff --git a/plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/internal/hook/Logger.java b/plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/internal/hook/Logger.java
new file mode 100644
index 000000000..42dba38b1
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/internal/hook/Logger.java
@@ -0,0 +1,81 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2007 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: MasterTeamLoader.java 15426 2007-02-25 12:52:19Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otequinox.internal.hook;
+
+import org.eclipse.objectteams.otequinox.hook.HookConfigurator;
+import org.eclipse.objectteams.otequinox.hook.ILogger;
+import org.eclipse.osgi.framework.log.FrameworkLog;
+import org.eclipse.osgi.framework.log.FrameworkLogEntry;
+
+
+/**
+ * Log either to console or - as soon as it is initialized - via the TransformerPlugin.
+ *
+ * @author stephan
+ * @since OTDT 1.1.4
+ */
+public class Logger implements ILogger
+{
+ private FrameworkLog fwLog;
+
+ public Logger(FrameworkLog fwLog) {
+ this.fwLog = fwLog;
+ }
+
+ public void log(Throwable t, String msg) {
+ log(HookConfigurator.class.getPackage().getName(), t, msg);
+ }
+ public void log(String pluginID, Throwable t, String msg) {
+ if (this.fwLog != null) {
+ this.fwLog.log(new FrameworkLogEntry(pluginID, FrameworkLogEntry.ERROR, 0, msg, 0, t, null));
+ return;
+ } else {
+ // no success logging, print to console instead:
+ System.err.println("OT/Equinox: "+msg); //$NON-NLS-1$
+ t.printStackTrace();
+ }
+ }
+
+ public void log(int status, String msg) {
+ if (status >= Util.WARN_LEVEL)
+ doLog(HookConfigurator.class.getPackage().getName(), status, msg);
+ }
+ public void log(String pluginID, int status, String msg) {
+ if (status >= Util.WARN_LEVEL)
+ doLog(pluginID, status, msg);
+ }
+
+ public void doLog(int status, String msg) {
+ doLog(HookConfigurator.class.getPackage().getName(), status, msg);
+ }
+ public void doLog(String pluginID, int status, String msg) {
+ if (this.fwLog != null) {
+ this.fwLog.log(new FrameworkLogEntry(pluginID, status, 0, msg, 0, null, null));
+ } else {
+ // no success logging, print to console instead:
+ msg = "OT/Equinox: "+msg; //$NON-NLS-1$
+ if ((status & Util.ERROR) != 0)
+ System.err.println(msg);
+ else
+ System.out.println(msg);
+ }
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/internal/hook/OTEquinoxServiceWatcher.java b/plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/internal/hook/OTEquinoxServiceWatcher.java
new file mode 100644
index 000000000..0dc137ba9
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/internal/hook/OTEquinoxServiceWatcher.java
@@ -0,0 +1,127 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2007 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: MasterTeamLoader.java 15426 2007-02-25 12:52:19Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otequinox.internal.hook;
+
+import java.io.IOException;
+import java.net.URLConnection;
+import java.util.Properties;
+
+import org.eclipse.objectteams.otequinox.hook.IOTEquinoxService;
+import org.eclipse.osgi.baseadaptor.BaseAdaptor;
+import org.eclipse.osgi.baseadaptor.hooks.AdaptorHook;
+import org.eclipse.osgi.framework.log.FrameworkLog;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.ServiceEvent;
+import org.osgi.framework.ServiceListener;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.packageadmin.PackageAdmin;
+
+/**
+ * This class waits for the IOTEquinoxService to be registered and
+ * announces it to the TransformerHook.
+ *
+ * @author stephan
+ * @since OTDT 1.1.4
+ */
+public class OTEquinoxServiceWatcher implements AdaptorHook {
+
+ // whom to inform:
+ private TransformerHook hook;
+
+ public OTEquinoxServiceWatcher(TransformerHook hook) {
+ this.hook= hook;
+ }
+
+ private void initialize (final BundleContext context)
+ {
+ String transformerFilter = "(objectclass="+IOTEquinoxService.class.getName()+")"; //$NON-NLS-1$ //$NON-NLS-2$
+ //Add listener to listen for the registration of the OT/Equinox service:
+ ServiceListener transformerListener = new ServiceListener() {
+ public void serviceChanged(ServiceEvent event) {
+ if(event.getType() == ServiceEvent.REGISTERED)
+ connectOTEquinoxService(context);
+ }
+ };
+ try {
+ context.addServiceListener(transformerListener,transformerFilter);
+ }
+ catch (Exception ex) {
+ ex.printStackTrace();
+ }
+ ServiceReference ref= context.getServiceReference(PackageAdmin.class.getName());
+ if (ref!=null)
+ this.hook.connectPackageAdmin((PackageAdmin)context.getService(ref));
+
+ }
+
+ private void connectOTEquinoxService (BundleContext context) {
+ ServiceReference ref= context.getServiceReference(IOTEquinoxService.class.getName());
+ if (ref!=null)
+ this.hook.connectOTEquinoxService((IOTEquinoxService)context.getService(ref));
+ }
+
+
+ /**
+ * Capture the system bundle at start-up:
+ * (see {@link AdaptorHook#frameworkStart(BundleContext)}
+ */
+ public void frameworkStart(BundleContext systemContext) throws BundleException {
+ initialize(systemContext);
+ }
+
+ // === other methods implementing AdaptorHook do nothing: ===
+
+ public void addProperties(Properties properties) {
+ // do nothing
+ }
+
+ public FrameworkLog createFrameworkLog() {
+ // do nothing
+ return null;
+ }
+ public void frameworkStop(BundleContext context) throws BundleException {
+ // do nothing
+ }
+
+ public void frameworkStopping(BundleContext context) {
+ // do nothing
+ }
+
+ public void handleRuntimeError(Throwable error) {
+ // do nothing
+ }
+
+ public void initialize(BaseAdaptor adaptor) {
+ // do nothing
+ }
+
+ public URLConnection mapLocationToURLConnection(String location)
+ throws IOException {
+ // do nothing
+ return null;
+ }
+
+ public boolean matchDNChain(String pattern, String[] dnChain) {
+ // do nothing
+ return false;
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/internal/hook/OTStorageHook.java b/plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/internal/hook/OTStorageHook.java
new file mode 100644
index 000000000..b0cd2ec6a
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/internal/hook/OTStorageHook.java
@@ -0,0 +1,390 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2007, 2009 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id$
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otequinox.internal.hook;
+
+import java.io.BufferedReader;
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.util.ArrayList;
+import java.util.Dictionary;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.runtime.internal.adaptor.EclipseStorageHook;
+import org.eclipse.objectteams.otequinox.hook.AspectPermission;
+import org.eclipse.osgi.baseadaptor.BaseData;
+import org.eclipse.osgi.baseadaptor.hooks.StorageHook;
+import org.eclipse.osgi.framework.log.FrameworkLog;
+import org.eclipse.osgi.framework.log.FrameworkLogEntry;
+import org.eclipse.osgi.framework.util.Headers;
+import org.eclipse.osgi.framework.util.KeyedElement;
+import org.osgi.framework.BundleException;
+
+/**
+ * This hook essentially intercepts calls to getManifest() as to insert directives
+ * from otequinox.forced.exports (as read from config.ini or other locations).
+ *
+ * @author stephan
+ * @since 1.1.4
+ */
+public class OTStorageHook implements StorageHook
+{
+ // property names:
+ private static final String FORCED_EXPORTS_DENIED = "otequinox.forced.exports.denied"; // //$NON-NLS-1$
+ private static final String FORCED_EXPORTS_GRANTED = "otequinox.forced.exports.granted"; // //$NON-NLS-1$
+ // legacy:
+ private static final String FORCED_EXPORTS = "otequinox.forced.exports"; // //$NON-NLS-1$
+
+ // terminal tokens:
+ private static final String EXPORT_PACKAGE = "Export-Package"; //$NON-NLS-1$
+ private static final String XFRIENDS = "x-friends:="; //$NON-NLS-1$
+
+ private static final String KEY = OTStorageHook.class.getName();
+ private static final int HASHCODE = KEY.hashCode();
+ private static final int STORAGE_VERSION = 1;
+
+
+ private static HashMap<String, String> grantedForcedExports = null;
+ private static HashMap<String, String> deniedForcedExports = null;
+
+ private static void readForcedExports() {
+ // read forced exports from config.ini (system properties), or file(s)
+ deniedForcedExports= new HashMap<String, String>();
+ grantedForcedExports= new HashMap<String, String>();
+ readForcedExportsFromProperty(FORCED_EXPORTS_DENIED, AspectPermission.DENY);
+ readForcedExportsFromProperty(FORCED_EXPORTS_GRANTED, AspectPermission.GRANT);
+ // legacy:
+ readForcedExportsFromProperty(FORCED_EXPORTS, AspectPermission.GRANT);
+ }
+
+ private static void readForcedExportsFromProperty(String propKey, AspectPermission perm) {
+ String value= System.getProperty(propKey);
+ if (value != null) {
+ if (value.length() > 0 && value.charAt(0) == '@') {
+ // follows: comma-separated list for filenames to read from:
+ int pos = 1;
+ while (pos < value.length()) {
+ int comma = value.indexOf(',', pos);
+ String fileName;
+ if (comma > -1) {
+ fileName = value.substring(pos, comma);
+ pos = comma+1;
+ } else {
+ fileName = value.substring(pos);
+ pos = value.length();
+ }
+ parseForcedExportsFile(new File(fileName), perm);
+ }
+ } else {
+ parseForcedExports(value, perm);
+ }
+ }
+ }
+
+ /**
+ * Adds the definitions from a given file to the set of granted forced exports.
+ * @param file file to read from
+ * @param perm either ALLOW or DENY, determines how the found forced export decls are interpreted.
+ */
+ synchronized public static void parseForcedExportsFile(File file, AspectPermission perm) {
+ StringBuffer newVal = new StringBuffer();
+ try {
+ // read content of one file:
+ FileInputStream fis = new FileInputStream(file);
+ BufferedReader br = new BufferedReader(new InputStreamReader(fis, "UTF8")); //$NON-NLS-1$
+ String line;
+ boolean afterClosingBrace = false;
+ while ((line = br.readLine()) != null) {
+ line = line.trim();
+ if (line.length() > 0) {
+ // may need to replace linebreak after ']' with ',' - to match one-line syntax in config.ini
+ char lastReadChar = line.charAt(line.length()-1);
+ if (afterClosingBrace && lastReadChar != ',')
+ newVal.append(',');
+ afterClosingBrace = lastReadChar == ']';
+
+ newVal.append(line);
+ }
+ }
+ parseForcedExports(newVal.toString(), perm);
+ } catch (IOException e) {
+ fwLog.log(new FrameworkLogEntry(OTStorageHook.class.getName(),
+ "failed to read forcedExports file "+file.getName(), //$NON-NLS-1$
+ FrameworkLogEntry.ERROR, e, null));
+ }
+ }
+ /* Adds the given definitions to the set of granted forced exports. */
+ private static void parseForcedExports(String value, AspectPermission perm) {
+ HashMap<String, String> map = getForcedExportsMap(perm);
+ if (map == null) return; // DONT_CARE
+ int pos = 0;
+ String[] values = new String[2]; // { BaseBundleID , PackageExports }
+ while (true) {
+ pos = getForcedExportForOneBase(value, pos, values);
+ String plugin= values[0];
+ String pack= values[1];
+ if (map.containsKey(plugin)) {
+ String oldPack = map.get(plugin);
+ pack = oldPack+','+pack; // append to existing definition
+ }
+ map.put(plugin, pack);
+ if (pos >= value.length())
+ break; // eot: done without errors
+ if (value.charAt(pos) != ',')
+ throwSyntaxError(value, pos, "missing ','"); //$NON-NLS-1$
+ pos++; // skip the ','
+ }
+ }
+ /**
+ * fetch one chunk of forced exports specification from `spec`:
+ * <ul>
+ * <li>my.base.plugin[<em>specification-of-force-exported-packages</em>]<em>tail</em></li>
+ * </ul>
+ * is split into:
+ * <ul>
+ * <li>my.base.plugin</li>
+ * <li><em>specification-of-force-exported-packages</em></li>
+ * </ul>
+ * and return value points to <em>tail</em>
+ * @param spec where to read from
+ * @param start where to start reading (within spec)
+ * @param value store result chunks in this array: [0] = base plugin, [1] = packages specification
+ * @return position after what has been interpreted so far
+ */
+ private static int getForcedExportForOneBase(String spec, int start, String[] values) {
+ int open = spec.indexOf('[', start);
+ if (open == -1)
+ throwSyntaxError(spec, start, "missing '['"); //$NON-NLS-1$
+ int close = spec.indexOf(']', start);
+ if (close == -1)
+ throwSyntaxError(spec, open, "missing ']'"); //$NON-NLS-1$
+ values[0] = spec.substring(start, open);
+ values[1] = spec.substring(open+1, close);
+ return close+1;
+ }
+
+ private static void throwSyntaxError(String spec, int pos, String string) {
+ throw new RuntimeException("Illegal syntax in "+FORCED_EXPORTS+" directive at position "+pos+" (not counting whitespace): "+string+"\n value is:\n"+spec); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ }
+
+ private static HashMap<String, String> getForcedExportsMap(AspectPermission perm) {
+ switch (perm) {
+ case GRANT: return grantedForcedExports;
+ case DENY: return deniedForcedExports;
+ case UNDEFINED: return null;
+// default: // not implementing a default case, want to be warned when new enum-constants are added
+ }
+ // for binary compatibility; see also https://bugs.eclipse.org/bugs/show_bug.cgi?id=265744
+ throw new IncompatibleClassChangeError("enum "+AspectPermission.class.getName()+" has changed unexpectedly."); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ static FrameworkLog fwLog;
+
+ BaseData bundleData;
+ EclipseStorageHook manifestProvider;
+
+ public OTStorageHook(BaseData bundleData, EclipseStorageHook manifestProvider) {
+ this.bundleData = bundleData;
+ this.manifestProvider = manifestProvider;
+ if (fwLog == null && bundleData != null)
+ fwLog = bundleData.getAdaptor().getFrameworkLog();
+ }
+
+ public void copy(StorageHook storageHook) {
+ OTStorageHook orig= (OTStorageHook)storageHook;
+ this.bundleData= orig.bundleData;
+ this.manifestProvider= orig.manifestProvider;
+ }
+
+ public StorageHook create(BaseData bundledata) throws BundleException {
+ return new OTStorageHook(bundledata, this.manifestProvider);
+ }
+
+ public boolean forgetStartLevelChange(int startlevel) {
+ return false;
+ }
+
+ public boolean forgetStatusChange(int status) {
+ return false;
+ }
+
+ public Dictionary<?,?> getManifest(boolean firstLoad) throws BundleException
+ {
+ final Dictionary<?,?> orig= this.manifestProvider.create(this.bundleData).getManifest(firstLoad);
+
+ // wrap the original answer:
+ return new Headers(orig.size())
+ {
+ @Override
+ public Object get(Object key) {
+ Object value = orig.get(key);
+ if (!EXPORT_PACKAGE.equals(key))
+ return value;
+ synchronized (OTStorageHook.class){
+ if (grantedForcedExports == null)
+ readForcedExports();
+ }
+ String exports= grantedForcedExports.get(OTStorageHook.this.bundleData.getSymbolicName());
+ if (exports != null) {
+ // yes, we need to add forced exports:
+ String packages= (String)orig.get(EXPORT_PACKAGE);
+ if (!exports.contains(XFRIENDS)) {
+ // invalid directive:
+ grantedForcedExports.remove(OTStorageHook.this.bundleData.getSymbolicName());
+ logError("config.ini: missing x-friends directive in forced export of "+exports); //$NON-NLS-1$
+ return packages; // don't install illegal forced exports
+ }
+ if (packages != null)
+ return packages+','+exports;
+ return exports;
+ }
+ return value;
+ }
+ // other methods simply delegate:
+ @Override public synchronized int size() { return orig.size(); }
+ @Override public synchronized Enumeration<?> keys() { return orig.keys(); }
+ };
+ }
+
+ static void logError(String message) {
+ fwLog.log(new FrameworkLogEntry(OTStorageHook.class.getName(),
+ message,
+ FrameworkLogEntry.ERROR,
+ null, null));
+ }
+
+ public int getStorageVersion() {
+ return STORAGE_VERSION;
+ }
+
+ @SuppressWarnings("unchecked")
+ public void initialize(final Dictionary manifest) throws BundleException {
+ // no-op
+ }
+
+ public StorageHook load(BaseData bundledata, DataInputStream is)
+ throws IOException
+ {
+ return new OTStorageHook(bundledata, this.manifestProvider);
+ }
+
+ public boolean matchDNChain(String pattern) {
+ return false;
+ }
+
+ public void save(DataOutputStream os) throws IOException {
+ // no-op
+ }
+
+ public void validate() throws IllegalArgumentException {
+ // no-op
+ }
+
+ public Object getKey() {
+ return KEY;
+ }
+
+ public boolean compare(KeyedElement other) {
+ return other.getKey() == KEY;
+ }
+
+ public int getKeyHashCode() {
+ return HASHCODE;
+ }
+
+ /**
+ * Query whether any forced-exports are declared in config.ini (or other location)
+ * for the given aspect bundle.
+ * @param aspectBundleId
+ * @return list of pairs (baseBundleId x packageName)
+ */
+ public static ArrayList<String[]> getForcedExportsByAspect(String aspectBundleId, AspectPermission perm)
+ {
+ // can be queried before we had a chance to initialize our data structures
+ synchronized (OTStorageHook.class) {
+ if (grantedForcedExports == null)
+ readForcedExports();
+ }
+
+ ArrayList<String[]> result= new ArrayList<String[]>(5);
+
+ HashMap<String, String> map = getForcedExportsMap(perm);
+ if (map == null)
+ return result; // DONT_CARE: useless query.
+
+ for (Map.Entry<String,String> entry: map.entrySet()) {
+ String export= entry.getValue();
+ int start = 0;
+ while (start >= 0 && start < export.length()) {
+ if (start > 0) {
+ // skip separator after previous entry
+ if (export.charAt(start) == ',')
+ start++;
+ else
+ logError("Error parsing forced exports: "+export+", comma expected at position "+start); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ int pos= export.indexOf(';'+XFRIENDS, start);
+ if (pos == -1)
+ break;
+ String packageName = export.substring(start, pos);
+ List<String> aspectBundles = new ArrayList<String>();
+ start = scanAspectBundles(export, pos+XFRIENDS.length()+1, aspectBundles);
+ for (String aspect : aspectBundles) {
+ if (aspect.equals(aspectBundleId)) {
+ result.add(new String[]{entry.getKey(), packageName});
+ }
+ }
+ }
+ }
+ return result;
+ }
+
+ private static int scanAspectBundles(String export, int pos, List<String> result) {
+ String termChars = ",]"; //$NON-NLS-1$
+ if (export.charAt(pos) == '"') {
+ pos++;
+ termChars = "\""; //$NON-NLS-1$
+ }
+ int start = pos;
+ while (pos < export.length()) {
+ char c = export.charAt(pos);
+ switch (c) {
+ case ',':
+ case ']':
+ case '"':
+ String next = export.substring(start, pos);
+ result.add(next);
+ start = pos+1;
+ if (termChars.indexOf(c) != -1)
+ return start;
+ break;
+ }
+ pos++;
+ }
+ logError("Unterminated forced exports: "+export); //$NON-NLS-1$
+ if (pos > start)
+ result.add(export.substring(start));
+ return export.length();
+ }
+
+}
diff --git a/plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/internal/hook/SafeAspectRegistry.java b/plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/internal/hook/SafeAspectRegistry.java
new file mode 100644
index 000000000..86575db8c
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/internal/hook/SafeAspectRegistry.java
@@ -0,0 +1,131 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2007 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: MasterTeamLoader.java 15426 2007-02-25 12:52:19Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otequinox.internal.hook;
+
+import java.util.HashSet;
+
+import org.eclipse.objectteams.otequinox.hook.IAspectRegistry;
+import org.eclipse.objectteams.otequinox.hook.ILogger;
+import org.eclipse.objectteams.otequinox.hook.IOTEquinoxService;
+import org.osgi.framework.Bundle;
+
+/**
+ * Implements IAspectRegistry via an indirection in order to catch
+ * query attempts before the OT/Equinox plugin is properly initialized.
+ *
+ * @author stephan
+ * @since OTDT 1.1.4
+ */
+@SuppressWarnings("nls")
+public class SafeAspectRegistry implements IAspectRegistry {
+
+ // references to other important objects:
+ private TransformerHook hook;
+ private IOTEquinoxService otEquinox;
+
+ // record bundles that were loaded before the transformer was in place:
+ private HashSet<String> nonAdaptableBundles = new HashSet<String>();
+ private enum InitState { OK, NOT_YET, TOO_LATE }
+
+ SafeAspectRegistry(TransformerHook hook) {
+ this.hook= hook;
+ }
+ void connectOTEquinoxService(IOTEquinoxService otEquinoxService, ILogger log) {
+ this.otEquinox= otEquinoxService;
+ // Check whether any of the plugins, which have been loaded before the TransformerPlugin,
+ // are declared to be adapted by an aspect => ERROR.
+ for (String bundle: nonAdaptableBundles)
+ if (otEquinoxService.isAdaptedBasePlugin(bundle))
+ log.log(Util.ERROR, "Trying to adapt non-adaptable platform bundle "+bundle);
+ }
+
+ /** see {@link org.eclipse.objectteams.otequinox.hook.IAspectRegistry#isOTDT()} */
+ public boolean isOTDT() {
+ return (this.otEquinox != null) && this.otEquinox.isOTDT();
+ }
+
+ /** see {@link org.eclipse.objectteams.otequinox.hook.IAspectRegistry#isAdaptedBasePlugin(String)} */
+ public boolean isAdaptedBasePlugin(String baseBundleName) {
+ InitState state= checkInitialization(baseBundleName);
+ if (state == InitState.NOT_YET)
+ return false;
+ boolean result= this.otEquinox.isAdaptedBasePlugin(baseBundleName);
+ if (!result) return false;
+ if (state == InitState.TOO_LATE)
+ throw new RuntimeException("Boot order problem: base bundle "+baseBundleName
+ +" was loaded before the transformer plug-in was ready!");
+ return result;
+ }
+
+ /** see {@link org.eclipse.objectteams.otequinox.hook.IAspectRegistry#getAdaptingAspectPlugins(Bundle)} */
+ public String[] getAdaptingAspectPlugins(Bundle baseBundle) {
+ InitState state= checkInitialization(baseBundle.getSymbolicName());
+ if (state == InitState.NOT_YET)
+ return new String[0];
+ String[] result= this.otEquinox.getAdaptingAspectPlugins(baseBundle);
+ if (result.length > 0) {
+ if (state == InitState.TOO_LATE)
+ throw new RuntimeException( "Boot order problem: base bundle "+baseBundle.getSymbolicName()
+ +" was loaded before the transformer plug-in was ready!");
+ }
+ return result;
+ }
+
+ /** see {@link org.eclipse.objectteams.otequinox.hook.IAspectRegistry#getAdaptedBasePlugins(Bundle)} */
+ public String[] getAdaptedBasePlugins(Bundle aspectBundle) {
+ if (aspectBundle == this.hook.otEquinoxBundle)
+ return null; // don't adapt the adaptor
+ if (this.otEquinox == null)
+ return null;
+ return this.otEquinox.getAdaptedBasePlugins(aspectBundle);
+ }
+
+ /** see {@link org.eclipse.objectteams.otequinox.hook.IAspectRegistry#hasInternalTeams(Bundle)} */
+ public boolean hasInternalTeams(Bundle baseBundle) {
+ if (this.otEquinox == null)
+ return false;
+ return this.otEquinox.hasInternalTeams(baseBundle);
+ }
+
+ private InitState checkInitialization(String baseBundle) {
+ if (nonAdaptableBundles.contains(baseBundle)) {
+ if (this.otEquinox == null)
+ return InitState.NOT_YET;
+ return InitState.TOO_LATE;
+ }
+ if (this.otEquinox == null) {
+ // can't ask the registry before this field is initialized.
+ if (!Util.isPlatformBundle(baseBundle))
+ // no transformer, no log!
+ // But note, that the same problem should also be detected by sanityCheck!
+ System.err.println("Accessing non-adaptable element "+baseBundle);
+ nonAdaptableBundles.add(baseBundle);
+ return InitState.NOT_YET;
+ }
+ return InitState.OK;
+ }
+ /** see {@link org.eclipse.objectteams.otequinox.hook.IAspectRegistry#isDeniedAspectPlugin(String)} */
+ public boolean isDeniedAspectPlugin(String symbolicName) {
+ if (this.otEquinox != null)
+ return this.otEquinox.isDeniedAspectPlugin(symbolicName);
+ return false;
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/internal/hook/TransformerHook.java b/plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/internal/hook/TransformerHook.java
new file mode 100644
index 000000000..87e86e95e
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/internal/hook/TransformerHook.java
@@ -0,0 +1,654 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2009 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: TransformerHook.java 23468 2010-02-04 22:34:27Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otequinox.internal.hook;
+
+import java.io.InputStream;
+import java.lang.instrument.IllegalClassFormatException;
+import java.net.URL;
+import java.security.ProtectionDomain;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.StringTokenizer;
+
+import org.eclipse.osgi.baseadaptor.BaseAdaptor;
+import org.eclipse.osgi.baseadaptor.BaseData;
+import org.eclipse.osgi.baseadaptor.bundlefile.BundleEntry;
+import org.eclipse.osgi.baseadaptor.hooks.ClassLoadingHook;
+import org.eclipse.osgi.baseadaptor.loader.BaseClassLoader;
+import org.eclipse.osgi.baseadaptor.loader.ClasspathEntry;
+import org.eclipse.osgi.baseadaptor.loader.ClasspathManager;
+import org.eclipse.osgi.framework.adaptor.BundleClassLoader;
+import org.eclipse.osgi.framework.adaptor.BundleData;
+import org.eclipse.osgi.framework.adaptor.BundleProtectionDomain;
+import org.eclipse.osgi.framework.adaptor.BundleWatcher;
+import org.eclipse.osgi.framework.adaptor.ClassLoaderDelegate;
+import org.eclipse.osgi.framework.adaptor.ClassLoaderDelegateHook;
+import org.eclipse.osgi.framework.internal.core.BundleHost;
+import org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader;
+import org.eclipse.objectteams.otequinox.hook.ClassScanner;
+import org.eclipse.objectteams.otequinox.hook.HookConfigurator;
+import org.eclipse.objectteams.otequinox.hook.IByteCodeAnalyzer;
+import org.eclipse.objectteams.otequinox.hook.ILogger;
+import org.eclipse.objectteams.otequinox.hook.IOTEquinoxService;
+import org.eclipse.objectteams.otequinox.hook.ITeamLoader;
+import org.eclipse.objectteams.otequinox.internal.hook.Util.ProfileKind;
+import org.eclipse.objectteams.otre.jplis.ObjectTeamsTransformer;
+import org.osgi.framework.Bundle;
+import org.osgi.service.packageadmin.PackageAdmin;
+
+/**
+ * This class intercepts class loading in order to perform load time weaving for OT/J.
+ *
+ * Install using these properties (either from commandline or config.ini):
+ * <pre>
+ * osgi.framework.extensions=org.eclipse.objectteams.eclipse.transformer.hook
+ * osgi.hook.configurators.include=org.eclipse.objectteams.eclipse.transformer.hook.HookConfigurator
+ * </pre>
+ *
+ * The principal method is processClass() which delegates to an ObjectTeamsTransformer (OTRE).
+ * The plugin life-cycle is controlled by methods initializedClassLoader() and watchBundle().
+ *
+ * @author stephan
+ * @version $Id: TransformerHook.java 23468 2010-02-04 22:34:27Z stephan $
+ */
+@SuppressWarnings("nls")
+public class TransformerHook implements ClassLoadingHook, BundleWatcher, ClassLoaderDelegateHook
+{
+ // As an OSGI extension bundle, we can't depend on the transformer plugin, so we have to hardcode this
+ public static final String TRANSFORMER_PLUGIN_ID = "org.eclipse.objectteams.otequinox" ; //$NON-NLS-1$
+
+ private static final String WORKSPACE_INITIALIZER_PLUGIN_ID = "org.eclipse.objectteams.otdt.earlyui";
+ private static final String OTDT_QUALIFIER = "OTDT";
+
+ // another non-transformable bundle:
+ private static final String ASM_PLUGIN_ID = "org.objectweb.asm"; //$NON-NLS-1$
+
+ private static final HashSet<String> WEAVE_BUNDLES = new HashSet<String>();
+ static {
+ String value = System.getProperty("otequinox.weave");
+ if (value != null && value.length() > 0) {
+ StringTokenizer st = new StringTokenizer(value, ",");
+ while (st.hasMoreTokens())
+ WEAVE_BUNDLES.add(st.nextToken());
+ }
+ }
+
+ /** kinds of classes needing transformation. */
+ enum ClassKind { BASE, ROLE, TEAM; }
+
+
+ /** A class loader which knows about OTRE but cannot transform byte code. *
+ * All plugins may require class org.objectteams.ITeam and related. */
+ private ClassLoader parentClassLoader;
+
+
+ // ==== STATE ====
+
+ /* storage for additional information regarding base and aspect bundles. */
+ final private BundleRegistry bundleRegistry = new BundleRegistry();
+
+ /* Local registry of all classes needing adaptation.
+ * Note that the ClassKind is recorded only for logging/profiling,
+ * so it doesn't hurt that we can't assign several kinds to the same class.
+ */
+ final HashMap<String,ClassKind> transformableClasses= new HashMap<String, ClassKind>();
+ private void addTransformableClass(String className, ClassKind kind) {
+ this.transformableClasses.put(className, kind);
+ String ifcName= className.replace("__OT__", ""); //$NON-NLS-1$ //$NON-NLS-2$
+ if (ifcName != className)
+ this.transformableClasses.put(ifcName, kind); // for role classes also enter the ifc-part
+ }
+
+ /**
+ * @param classBytes array containing the class' byte code
+ * @param className '.'-separated fully qualified class name
+ * @param resourceLoader class loader that should be used to find further .class files.
+ * @param bundleName name of the bundle from which the class is loaded.
+ */
+ private ClassKind fetchTransformationKind(byte[] classBytes, final String className, ClassLoader resourceLoader, final Bundle bundle) {
+ ClassKind kind = this.transformableClasses.get(className);
+ if (kind == ClassKind.BASE && !this.bundleRegistry.isAdaptedBaseBundle(bundle.getSymbolicName()))
+ kind = null; // don't use false info
+ if ( kind != null // found
+ || this.byteCodeAnalyzer == null ) // can't do better
+ {
+ return kind;
+ }
+ String superName = this.byteCodeAnalyzer.getSuperclass(classBytes, className);
+ if (superName != null)
+ return fetchInheritedTransformationKind(superName, resourceLoader, bundle.getSymbolicName());
+ return kind;
+ }
+ private ClassKind fetchInheritedTransformationKind(String className, ClassLoader resourceLoader, String bundleName) {
+ //TODO(SH): change to use bundle here, too (rather than bundleName)?
+ ClassKind kind = this.transformableClasses.get(className);
+ if (kind == ClassKind.BASE && !this.bundleRegistry.isAdaptedBaseBundle(bundleName))
+ kind = null; // don't use false info
+ if (kind != null) {
+ return kind;
+ }
+ String superName = null;
+ InputStream is = resourceLoader.getResourceAsStream(className.replace('.', '/')+".class");
+ if (is != null)
+ superName = this.byteCodeAnalyzer.getSuperclass(is, className);
+ if (superName != null)
+ return fetchInheritedTransformationKind(superName, resourceLoader, bundleName);
+ return kind;
+ }
+
+ /** stored between method calls, indexed by plugin ID (unspecific, base or aspect): */
+ final protected HashMap<BundleData,ProtectionDomain> domains= new HashMap<BundleData,ProtectionDomain>();
+
+ // ==== access to the PackageAdmin service (for resolving bundles etc.) ====
+ private PackageAdmin packageAdmin;
+
+ // ==== A Bridge to the TransformerPlugin ====
+
+ /** The bundle org.eclipse.objectteams.otequinox. */
+ Bundle otEquinoxBundle;
+
+ /** Gateway to the class org.eclipse.objectteams.otequinox.TransformerPlugin. */
+ // loading and instantiating teams:
+ private ITeamLoader teamLoadingService;
+ // asking about aspectBindings:
+ final private SafeAspectRegistry aspectRegistry= new SafeAspectRegistry(this);
+
+ private IByteCodeAnalyzer byteCodeAnalyzer;
+
+ // logging (console or via FrameworkLog):
+ final private ILogger logger;
+
+ final private HashSet<Bundle> uninstalling = new HashSet<Bundle>();
+
+ // Class loaders for which initializedClassLoader is currently executing (usable, but not yet registered):
+ private HashMap<Bundle,BaseClassLoader> pendingClassLoaders = new HashMap<Bundle, BaseClassLoader>();
+
+ /** Constructor invoked by the framework (via {@link HookConfigurator#addHooks(org.eclipse.osgi.baseadaptor.HookRegistry)}). */
+ public TransformerHook(BaseAdaptor adaptor) {
+ this.logger = HookConfigurator.getLogger();
+
+ // make OTRE available to all bundles via framework classpath
+ // which contains the fragment org.eclipse.objectteams.otequinox.runtime:
+ this.parentClassLoader= getClass().getClassLoader();
+
+ this.logger.log(Util.INFO, "Created equinox adaptor hook: "+getClass().getName()+
+ ".\n \t(To disable this and subsequent INFO messages from OT/Equinox set otequinox.debug to WARN or ERROR).");
+ }
+
+
+ /** Invoked when the TransformerPlugin has registered itself as a service. */
+ void connectOTEquinoxService(IOTEquinoxService otEquinoxService) {
+ this.teamLoadingService= otEquinoxService;
+ this.aspectRegistry.connectOTEquinoxService(otEquinoxService, this.logger);
+ this.byteCodeAnalyzer= otEquinoxService.getByteCodeAnalyzer();
+ this.logger.log(Util.INFO, "OT/Equinox: connected the transformer service");
+ }
+
+ void connectPackageAdmin(PackageAdmin packageAdmin) {
+ this.packageAdmin = packageAdmin;
+ }
+
+// SH: extra safety against recursion (see Trac #173)
+ ThreadLocal<String> currentlyProcessedClassName = new ThreadLocal<String>();
+// :HS
+ /**
+ * Delegate some classes to the ObjectTeamsTransformer for byte code weaving.
+ */
+ public byte[] processClass(String name, byte[] classbytes,
+ ClasspathEntry classpathEntry, BundleEntry entry,
+ ClasspathManager manager)
+ {
+ String previousClassName = currentlyProcessedClassName.get();
+ this.currentlyProcessedClassName.set(name);
+ try {
+
+ Bundle bundle = manager.getBaseData().getBundle();
+ ProtectionDomain domain = domains.get(manager.getBaseData());
+ if (bundle == this.otEquinoxBundle)
+ return classbytes; // don't transform the adaptor ;-)
+ if (ASM_PLUGIN_ID.equals(bundle.getSymbolicName())) // name comparison since multiple instances of this bundle could exist
+ return classbytes; // don't transform ASM
+
+// SH: extra safety against recursion (see Trac #173)
+ if (name.equals(previousClassName)) {
+ logger.log(new Exception("unexpected loading situation"), "Recursion occurred loading class "+name+" from bundle "+bundle.getSymbolicName());
+ return null;
+ }
+// :HS
+
+ // NB: we must use a fresh instance of ObjectTeamsTransformer
+ // on each invocation because the OTRE is _not_ thread safe,
+ // specifically the field ObjectTeamsTransformation.factory
+ // MUST NOT be accessed or even assigned concurrently.
+ ObjectTeamsTransformer objectTeamsTransformer= null;
+
+ ClassLoader resourceLoader = null;
+ if (ClassScanner.REPOSITORY_USE_RESOURCE_LOADER)
+ resourceLoader = (ClassLoader) manager.getBaseClassLoader();
+
+ // ==== loading an adapted base class?
+ long time = 0;
+ if (Util.PROFILE) time= System.nanoTime();
+ ClassKind classKind= fetchTransformationKind(classbytes, name, resourceLoader, bundle);
+ if (Util.PROFILE) Util.profile(time, ProfileKind.SuperClassFetching, "", this.logger);
+ if (classKind == ClassKind.BASE) {
+ objectTeamsTransformer= new ObjectTeamsTransformer();
+ classbytes= transformClass(objectTeamsTransformer, resourceLoader,
+ name, classbytes, domain,
+ "potential base", ProfileKind.BaseTransformation);
+ // ==== loading a role class?
+ } else if (classKind == ClassKind.ROLE) {
+ objectTeamsTransformer= new ObjectTeamsTransformer();
+ classbytes= transformClass(objectTeamsTransformer, resourceLoader,
+ name, classbytes, domain,
+ "role", ProfileKind.AspectTransformation); //$NON-NLS-1$
+ } else {
+ // ==== loading a team class?
+ boolean isLoading = AspectBundleRole.isLoadingTeams(bundleRegistry, bundle.getSymbolicName());
+ if (isLoading || ByteCodeAnalyzer.isTeam(classbytes)) {
+ try {
+ if (bundle.getState() < Bundle.STARTING && this.aspectRegistry.hasInternalTeams(bundle)) {
+ this.logger.doLog(Util.ERROR, "Illegal state: loading team class "+name+" from bundle "+bundle.getSymbolicName()+" \n"+
+ "while this bundle has not been activated yet (state="+bundle.getState()+").\n"+
+ "Aspect bindings will not be woven.\n"+
+ "Note: Perhaps the bundle lacks an activation policy (lazy)?");
+ return null;
+ }
+ AspectBundleRole.markLoadingTeams(bundleRegistry, bundle.getSymbolicName(), true);
+ // transform the aspect:
+ objectTeamsTransformer= new ObjectTeamsTransformer();
+ classbytes= transformClass(objectTeamsTransformer, resourceLoader,
+ name, classbytes, domain,
+ "team", ProfileKind.AspectTransformation); //$NON-NLS-1$
+ } finally {
+ if (!isLoading)
+ AspectBundleRole.markLoadingTeams(bundleRegistry, bundle.getSymbolicName(), false);
+ }
+ } else if ( this.otEquinoxBundle != null
+ && WEAVE_BUNDLES.contains(bundle.getSymbolicName())
+ && this.aspectRegistry.isAdaptedBasePlugin(bundle.getSymbolicName()))
+ {
+ objectTeamsTransformer= new ObjectTeamsTransformer();
+ classbytes= transformClass(objectTeamsTransformer, resourceLoader,
+ name, classbytes, domain,
+ "ordinary class (could be sub base class)", ProfileKind.BaseTransformation);
+ }
+ }
+ }
+ catch (IllegalClassFormatException icfe) {
+ icfe.printStackTrace();
+ }
+ finally {
+ this.currentlyProcessedClassName.set(previousClassName);
+ }
+ return classbytes;
+ }
+
+ // transform, log and profile:
+ private byte[] transformClass(ObjectTeamsTransformer objectTeamsTransformer, ClassLoader resourceLoader,
+ String name, byte[] classbytes, ProtectionDomain domain,
+ String kind, ProfileKind profileKind)
+ throws IllegalClassFormatException
+ {
+ this.logger.log(Util.OK, "about to transform "+kind+" class "+name);
+ long time= 0;
+ if (Util.PROFILE) time= System.nanoTime();
+ classbytes = objectTeamsTransformer.transform(resourceLoader, name, null, domain, classbytes);
+ if (Util.PROFILE) Util.profile(time, profileKind, name, this.logger);
+ return classbytes;
+ }
+
+ // hook method, no specific action
+ @SuppressWarnings("unchecked")
+ public boolean addClassPathEntry(
+ ArrayList cpEntries,
+ String cp,
+ ClasspathManager hostmanager,
+ BaseData sourcedata,
+ ProtectionDomain sourcedomain)
+ {
+ return false;
+ }
+
+ // hook method, no specific action
+ public String findLibrary(BaseData data, String libName) {
+ return null;
+ }
+
+ /** Make all bundles share the system classloader as their parent,
+ * in order to expose the OTRE to all.
+ */
+ public ClassLoader getBundleClassLoaderParent() {
+ return parentClassLoader;
+ }
+
+ public BaseClassLoader createClassLoader(
+ final ClassLoader parent,
+ ClassLoaderDelegate delegate,
+ BundleProtectionDomain domain,
+ BaseData data,
+ String[] bundleclasspath)
+ {
+ Bundle bundle = data.getBundle();
+
+ if (this.pendingClassLoaders.containsKey(bundle))
+ // a class loader is being announced via initializedClassloader,
+ // yet, before that method returns, the Bundle isn't yet wired to the class loader,
+ // so grab it from our intermediate storage:
+ return this.pendingClassLoaders.get(bundle);
+
+ // some paranoid sanity checks (shouldn't trigger any more)
+ if ( bundle != this.otEquinoxBundle
+ && !uninstalling.contains(bundle) // perhaps can't query transformer yet (uninstalling unused during launch)
+ && this.aspectRegistry.isAdaptedBasePlugin(bundle.getSymbolicName()))
+ {
+ BaseBundleRole baseBundle= this.bundleRegistry.adaptedBaseBundles.get(bundle.getSymbolicName());
+ if (baseBundle != null && baseBundle.state != BaseBundleRole.State.INITIAL) {
+
+ // defensive:
+ this.logger.log(Util.ERROR, "Circular class path for "+bundle.getSymbolicName());
+ // return a dummy class loader that rather fails than dead-locking.
+ return new DefaultClassLoader(parent, delegate, domain, data, bundleclasspath)
+ {
+ @Override
+ public Class<?> findLocalClass(String classname) throws ClassNotFoundException {
+ throw new ClassNotFoundException("Has already reported class path circularity");
+ }
+ @Override public URL findLocalResource(String resource) { return null; }
+
+ @Override public void initialize() { /* nop to avoid infinite recursion */ }
+
+ @Override
+ public Class<?> loadClass(String name) throws ClassNotFoundException {
+ throw new ClassNotFoundException("Has already reported class path circularity");
+ }
+ };
+ }
+ }
+
+ // normally we let the Framework create classloaders:
+ return null;
+ }
+
+ public void initializedClassLoader(final BaseClassLoader bundleClassLoader, BaseData data)
+ {
+// DEBUG:
+// if (isKnowID(data.getSymbolicName()))
+// System.out.println(">>1>>"+data.getSymbolicName());
+
+
+ ProtectionDomain domain = bundleClassLoader.getDomain();
+ if (domain != null)
+ domains.put(data, domain);
+
+ Bundle bundle = data.getBundle();
+ if (bundle == otEquinoxBundle) // don't adapt the transformer.
+ return;
+
+ if (this.uninstalling.contains(bundle)) // don't adapt bundle that is being uninstalled
+ return;
+
+ if (this.pendingClassLoaders.containsKey(bundle))
+ return; // already initialized (in this very call-stack?)
+
+ // ==== perhaps it's an aspect adapting some base bundle(s):
+
+ // register class loaders for teams per plugin ID of adapted base
+ String[] adaptedBaseBundles = this.aspectRegistry.getAdaptedBasePlugins(bundle);
+ if (adaptedBaseBundles != null)
+ for (String baseID : adaptedBaseBundles) {
+ Bundle baseBundle = null;
+ if (baseID.toUpperCase().equals(BaseBundleRole.SELF)) {
+ baseBundle = bundle;
+ } else {
+ Bundle[] baseBundles = packageAdmin.getBundles(baseID, null);
+ if (baseBundles == null) {
+ this.logger.log(Util.ERROR, "Adapted base bundle "+baseID+" not found.");
+ } else if (baseBundles.length > 1) {
+ baseBundle = baseBundles[0];
+ for (int i=1; i<baseBundles.length; i++)
+ if (baseBundle.getVersion().compareTo(baseBundles[i].getVersion()) < 0) // smaller version than next
+ baseBundle = baseBundles[i];
+ this.logger.log(Util.WARNING, "Found more than one version of adapted base bundle "+baseID+", picked version "+baseBundle.getVersion()+".");
+ } else {
+ baseBundle = baseBundles[0];
+ }
+ }
+ if (baseBundle != null)
+ BaseBundleRole.createBaseBundleRole(this.bundleRegistry, baseBundle, bundle);
+ }
+
+ // ==== perhaps it's a base bundle:
+
+ // Trigger PHASE 1 of aspect activation:
+ if (this.teamLoadingService != null)
+ checkLoadTeams(bundleClassLoader, bundle);
+ else if (!Util.isPlatformBundle(bundle.getSymbolicName()))
+ this.logger.log(Util.WARNING, "Not loading teams for bundle "+bundle.getSymbolicName()+
+ " (transformerPlugin not yet initialized)");
+ }
+
+ private void checkLoadTeams(BaseClassLoader bundleClassLoader, Bundle bundle)
+ {
+ this.pendingClassLoaders.put(bundle,bundleClassLoader);
+ ClassScanner scanner = new ClassScanner();
+ this.bundleRegistry.checkLoadTeams(bundle, this.aspectRegistry, this.teamLoadingService, scanner);
+ recordRolesAndBases(scanner);
+ this.pendingClassLoaders.remove(bundle);
+ }
+
+ private void recordRolesAndBases(ClassScanner scanner) {
+ Collection<String> baseClassNames = scanner.getCollectedBaseClassNames();
+ if (baseClassNames != null)
+ for (String baseClassName : baseClassNames)
+ addTransformableClass(baseClassName, ClassKind.BASE);
+ Collection<String> roleClassNames = scanner.getCollectedRoleClassNames();
+ if (roleClassNames != null)
+ for (String roleClassName : roleClassNames)
+ addTransformableClass(roleClassName, ClassKind.ROLE);
+ }
+
+ /**
+ * This method watches the life-cycle of plugins, and implements 2-phase loading for the
+ * transformer bundle org.eclipse.objectteams.otequinox:
+ * <pre>
+ * STEP 1. as soon as possible (may need to try more than once):
+ * -> retrieve and store bundle org.eclipse.objectteams.otequinox in "transformerBundle"
+ * -> activate org.eclipse.objectteams.otequinox
+ * STEP 2. after activating org.eclipse.objectteams.otequinox
+ * -> load class TransformerPlugin and store in "transformerPluginClass"
+ * </pre>
+ *
+ * For all other plugins check whether PHASE-2 of loading has to be performed when
+ * the plugin's activation finishes.
+ */
+ public void watchBundle(final Bundle bundle, int type) {
+// DEBUG:
+// if (isKnownID(bundle.getSymbolicName()))
+// System.out.println(">>2>>"+bundle.getSymbolicName());
+
+ if (type == BundleWatcher.START_ACTIVATION) {
+ if (TRANSFORMER_PLUGIN_ID.equals(bundle.getSymbolicName()))
+ otEquinoxBundle = bundle;
+ checkJdtCoreOrig(bundle);
+ checkInternalTeams(bundle);
+ }
+
+ if (type == BundleWatcher.END_ACTIVATION) {
+ Util.reportBundleStateChange(bundle, type, this.logger);
+
+ // start the transformerBundle as early as possible:
+ // (runtime must be activated for initialization of locations).
+ if ("org.eclipse.core.runtime".equals(bundle.getSymbolicName()))
+ startTransformerBundle();
+
+ if (bundle != otEquinoxBundle) {
+ // ==== trigger remaining actions now that the plugin is activated:
+ BaseBundleRole.endActivation(bundleRegistry, bundle, this.aspectRegistry, this.teamLoadingService);
+ }
+ } else if (type == BundleWatcher.START_UNINSTALLING) {
+ this.uninstalling.add(bundle);
+ } else if (type == BundleWatcher.END_UNINSTALLING) {
+ this.uninstalling.remove(bundle);
+ }
+ }
+
+ /** Load all internal teams of bundle, if any. */
+ private void checkInternalTeams(Bundle bundle) {
+ if (this.aspectRegistry.hasInternalTeams(bundle)) {
+ // aspectRole needed to record 'aspectRole.isLoading' from processClass().
+ this.bundleRegistry.createAspectRole(bundle.getSymbolicName());
+ this.logger.log(Util.OK, "Will load internal teams of "+bundle.getSymbolicName());
+ ClassScanner scanner = new ClassScanner();
+ if (this.teamLoadingService.loadInternalTeams(bundle, scanner)) {
+ recordRolesAndBases(scanner);
+ BaseBundleRole baseRole= BaseBundleRole.createBaseBundleRole(bundleRegistry, bundle, bundle); // self-adapting
+ baseRole.state= BaseBundleRole.State.TEAMS_LOADED;
+ this.logger.log(Util.INFO, "Loaded internal teams of "+bundle.getSymbolicName());
+ } else {
+ this.logger.log(Util.ERROR, "Failed to load internal teams of "+bundle.getSymbolicName());
+ }
+ }
+ }
+
+ /** Loading an original jdt.core is fatal for us: */
+ private void checkJdtCoreOrig(Bundle bundle) {
+ if (!this.aspectRegistry.isOTDT()) return; // nothing to check
+ if ("org.eclipse.jdt.core".equals(bundle.getSymbolicName())) {
+ if (bundle instanceof BundleHost) {
+ BundleHost host = (BundleHost)bundle;
+ if (!host.getVersion().getQualifier().contains(OTDT_QUALIFIER))
+ throw new Error("Fatal dependency problem: loading wrong version '"+host.getVersion()+"' of plug-in "+bundle.getSymbolicName());
+ }
+ }
+ }
+
+ private void startTransformerBundle() {
+ if (this.otEquinoxBundle != null)
+ return;
+ this.otEquinoxBundle = startBundle(TRANSFORMER_PLUGIN_ID, true);
+ // check if we want to set a workspace location (earliest opportunity):
+ startBundle(WORKSPACE_INITIALIZER_PLUGIN_ID, false); // ignore if not present
+ }
+
+ private Bundle startBundle(String bundleID, boolean logError) {
+ Bundle[] candidates = packageAdmin.getBundles(bundleID, null);
+ if (candidates == null) {
+ if (logError)
+ this.logger.log(ILogger.ERROR, "Bundle "+bundleID+" not found");
+ return null;
+ }
+ Bundle bundle = candidates[0]; // [0] corresponds to the highest version
+ try {
+ bundle.start();
+ } catch (Exception e) {
+ if (logError)
+ this.logger.log(e, "Error starting the OT/Equinox transformer plug-in");
+ }
+ return bundle;
+ }
+
+ public Class<?> preFindClass(String name, BundleClassLoader classLoader, BundleData data)
+ throws ClassNotFoundException
+ {
+ if (aspectRegistry.isDeniedAspectPlugin(data.getSymbolicName()))
+ throw new ClassNotFoundException(name+" from denied aspect bundle "+data.getSymbolicName());
+
+ BaseBundleRole baseBundle= this.bundleRegistry.adaptedBaseBundles.get(data.getSymbolicName());
+ if (baseBundle == null)
+ return null; // nothing to contribute
+
+ synchronized (baseBundle) {
+ if (baseBundle.missingClassNames.contains(name))
+ throw new ClassNotFoundException(name); // already failed before
+ }
+ return baseBundle.knownAlienClasses.get(name); // check for previous success
+ }
+
+ ThreadLocal<String> currentlySearchedClassName = new ThreadLocal<String>();
+
+ public Class<?> postFindClass(String name, BundleClassLoader classLoader, BundleData data) {
+ if (name.equals(currentlySearchedClassName.get()))
+ return null;
+ String bundleSymbolicName = data.getSymbolicName();
+ BaseBundleRole baseBundle= this.bundleRegistry.adaptedBaseBundles.get(bundleSymbolicName);
+ if (baseBundle == null)
+ return null; // not a registered base plugin, nothing to contribute
+ if (baseBundle.state == BaseBundleRole.State.WAIT_FOR_TEAM) {
+ logger.log(Util.WARNING, "Base plugin "+bundleSymbolicName+" is not yet ready for delegated classloading");
+ } else if (baseBundle.aspectBundles.isEmpty()) {
+ logger.log(Util.WARNING, ">>> adapting aspect bundles not yet wired when loading: "+name);
+ } else {
+ // a team class may be alien to the current plugin, yet the woven plugin
+ // may depend on the team. That's why we need this ClassLoaderDelegateHook.
+
+ // avoid infinite recursion:
+ currentlySearchedClassName.set(name);
+ try {
+ for (Bundle aspectBundle: baseBundle.aspectBundles) {
+ if (aspectBundle.getBundleId() == data.getBundleID())
+ continue; // self adaptation, nothing to contribute
+ try {
+ Class<?> result= aspectBundle.loadClass(name);
+ if (result != null) {
+ baseBundle.knownAlienClasses.put(name, result);
+ logger.log(Util.OK, "loaded alien class from aspect plugin: "+name);
+ return result;
+ }
+ } catch (ClassNotFoundException e) {
+ // noop, keep traversing aspect bundles
+ }
+ }
+ } finally {
+ currentlySearchedClassName.set(null);
+ }
+ synchronized(baseBundle) {
+ // remember this class so we never again need to search
+ baseBundle.missingClassNames.add(name);
+ }
+ }
+ return null;
+ }
+ public String postFindLibrary(String name, BundleClassLoader classLoader, BundleData data) {
+ return null;
+ }
+ public URL postFindResource(String name, BundleClassLoader classLoader, BundleData data) {
+ return null;
+ }
+ @SuppressWarnings("unchecked")
+ public Enumeration postFindResources(String name, BundleClassLoader classLoader, BundleData data) {
+ return null;
+ }
+ public String preFindLibrary(String name, BundleClassLoader classLoader, BundleData data) {
+ return null;
+ }
+ public URL preFindResource(String name, BundleClassLoader classLoader, BundleData data) {
+ return null;
+ }
+ @SuppressWarnings("unchecked")
+ public Enumeration preFindResources(String name, BundleClassLoader classLoader, BundleData data) {
+ return null;
+ }
+
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/internal/hook/Util.java b/plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/internal/hook/Util.java
new file mode 100644
index 000000000..eca9938e7
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/internal/hook/Util.java
@@ -0,0 +1,138 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: Util.java 23461 2010-02-04 22:10:39Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otequinox.internal.hook;
+
+import java.util.HashSet;
+
+import org.eclipse.objectteams.otequinox.hook.ILogger;
+import org.eclipse.osgi.framework.adaptor.BundleWatcher;
+import org.osgi.framework.Bundle;
+
+public class Util
+{
+ // from org.eclipse.core.runtime.IStatus:
+ public static final int OK = 0;
+ public static final int INFO = 0x01;
+ public static final int WARNING = 0x02;
+ public static final int ERROR = 0x04;
+
+ // configure OT/Equinox debugging:
+ public static int WARN_LEVEL = INFO;
+ public static boolean PROFILE= false;
+ static {
+ String level = System.getProperty("otequinox.debug"); //$NON-NLS-1$
+ if (level != null) {
+ level = level.toUpperCase();
+ if (level.equals("OK")) //$NON-NLS-1$
+ WARN_LEVEL = OK;
+ else if (level.equals("INFO")) //$NON-NLS-1$
+ WARN_LEVEL = INFO;
+ else if (level.startsWith("WARN")) //$NON-NLS-1$
+ WARN_LEVEL = WARNING;
+ else if (level.startsWith("ERR")) //$NON-NLS-1$
+ WARN_LEVEL = ERROR;
+ else
+ WARN_LEVEL = OK;
+ }
+ PROFILE= (System.getProperty("otequinox.profile") != null); //$NON-NLS-1$
+ }
+
+ /** Profiling data: */
+ enum ProfileKind { BaseTransformation, AspectTransformation, SuperClassFetching }
+ private static long[] profileTimes= new long[ProfileKind.values().length];
+ private static long systemStartTime= System.nanoTime();
+
+ static HashSet<String> PLATFORM_BUNDLES = null;
+
+ @SuppressWarnings("nls")
+ private static void checkInit() {
+ if (PLATFORM_BUNDLES == null) {
+ PLATFORM_BUNDLES = new HashSet<String>();
+ for (String bundle : new String[] { "org.eclipse.equinox.common",
+ "org.eclipse.update.configurator",
+ "org.eclipse.core.runtime",
+ "org.eclipse.equinox.registry",
+ "org.eclipse.equinox.app",
+ "org.eclipse.equinox.ds",
+ "org.eclipse.equinox.event",
+ "org.eclipse.equinox.util",
+ "org.eclipse.osgi.services",
+ "org.eclipse.core.runtime.compatibility.auth",
+ "org.eclipse.equinox.preferences",
+ "org.eclipse.equinox.simpleconfigurator",
+ "org.eclipse.core.jobs",
+ "org.eclipse.core.runtime.compatibility",
+ "org.eclipse.equinox.p2.core",
+ "org.eclipse.equinox.p2.reconciler.dropins",
+ "org.eclipse.equinox.p2.directorywatcher",
+ "org.eclipse.ecf",
+ "org.eclipse.ecf.identity",
+ "org.eclipse.ecf.filetransfer",
+ "org.eclipse.ecf.provider.filetransfer",
+ "org.eclipse.ecf.provider.filetransfer.httpclient",
+ "org.apache.commons.httpclient"
+ })
+ PLATFORM_BUNDLES.add(bundle);
+ }
+ }
+
+ static boolean isPlatformBundle(String bundleName) {
+ checkInit();
+ return PLATFORM_BUNDLES.contains(bundleName);
+ }
+
+ static void reportBundleStateChange(Bundle bundle, int type, ILogger logger) {
+ if (Util.WARN_LEVEL == Util.OK) {
+ String msg = ""; //$NON-NLS-1$
+ switch (type) {
+ case BundleWatcher.START_INSTALLING: msg += "Installing "; break; //$NON-NLS-1$
+ case BundleWatcher.END_INSTALLING: msg += "Installed "; break; //$NON-NLS-1$
+ case BundleWatcher.START_ACTIVATION: msg += "Activating "; break; //$NON-NLS-1$
+ case BundleWatcher.END_ACTIVATION: msg += "Activated "; break; //$NON-NLS-1$
+ }
+ logger.log(OK, msg+bundle.toString());
+ }
+ }
+
+ @SuppressWarnings("nls")
+ public static void profile(long startTime, ProfileKind kind, String msg, ILogger logger)
+ {
+ long now= System.nanoTime();
+ long delta= (now-startTime) / getActiveCount();
+ long total= (profileTimes[kind.ordinal()]+= delta);
+ msg = msg.substring(msg.lastIndexOf('.')+1);
+ logger.doLog(INFO, "Profile "+kind.name()+": "+m(delta)+"("+m(total)+"/"+m(now-systemStartTime)+") ["+msg+"]");
+ }
+ // nano-to milli conversion
+ private static double m(long l) {
+ return (l/1000000.0);
+ }
+
+ private static int getActiveCount() {
+ ThreadGroup group= Thread.currentThread().getThreadGroup();
+ ThreadGroup parent= group.getParent();
+ while (parent != null) {
+ group= parent;
+ parent= group.getParent();
+ }
+ return group.activeCount();
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otequinox.runtime/.classpath b/plugins/org.eclipse.objectteams.otequinox.runtime/.classpath
new file mode 100644
index 000000000..7cec603db
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox.runtime/.classpath
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/org.eclipse.objectteams.otequinox.runtime/.project b/plugins/org.eclipse.objectteams.otequinox.runtime/.project
new file mode 100644
index 000000000..e016377de
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox.runtime/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.objectteams.otequinox.runtime</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.objectteams.otequinox.runtime/META-INF/MANIFEST.MF b/plugins/org.eclipse.objectteams.otequinox.runtime/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..7ed71413a
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox.runtime/META-INF/MANIFEST.MF
@@ -0,0 +1,10 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: OTRE OSGI Extension Bundle
+Bundle-SymbolicName: org.eclipse.objectteams.otequinox.runtime
+Bundle-Version: 1.4.0.qualifier
+Bundle-Vendor: objectteams.org
+Fragment-Host: org.eclipse.osgi;bundle-version="[3.6.0.v20090928,4.0.0)"
+Export-Package: org.objectteams,
+ org.eclipse.objectteams.otre
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/plugins/org.eclipse.objectteams.otequinox.runtime/README.txt b/plugins/org.eclipse.objectteams.otequinox.runtime/README.txt
new file mode 100644
index 000000000..1ce681d48
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox.runtime/README.txt
@@ -0,0 +1,5 @@
+Libraries used in this transformer.hook OSGI extension bundle can not be
+packaged as inner jar files (e.g. otre.jar and BCEL.jar), as OSGI does not
+know how to deal with those.
+
+See https://bugs.eclipse.org/bugs/show_bug.cgi?id=143283 \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otequinox.runtime/build.properties b/plugins/org.eclipse.objectteams.otequinox.runtime/build.properties
new file mode 100644
index 000000000..a647fe085
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox.runtime/build.properties
@@ -0,0 +1,8 @@
+bin.includes = META-INF/,\
+ de/,\
+ gnu/,\
+ org/
+src.includes = build.properties,\
+ README.txt,\
+ .project,\
+ .classpath
diff --git a/plugins/org.eclipse.objectteams.otequinox.sunjvm/.project b/plugins/org.eclipse.objectteams.otequinox.sunjvm/.project
new file mode 100644
index 000000000..18cc906de
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox.sunjvm/.project
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.objectteams.otequinox.sunjvm</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <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>
+ </natures>
+</projectDescription>
diff --git a/plugins/org.eclipse.objectteams.otequinox.sunjvm/META-INF/MANIFEST.MF b/plugins/org.eclipse.objectteams.otequinox.sunjvm/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..c793ab4ff
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox.sunjvm/META-INF/MANIFEST.MF
@@ -0,0 +1,9 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: OT/Equinox SunJVM Fragment
+Bundle-SymbolicName: org.eclipse.objectteams.otequinox.sunjvm
+Bundle-Version: 1.3.0.qualifier
+Bundle-Vendor: objectteams.org
+Fragment-Host: org.eclipse.objectteams.otequinox;bundle-version="[1.3.0,2.0.0)"
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Eclipse-PlatformFilter: (|(osgi.os=linux) (osgi.os=win32) (ogsi.os=solaris))
diff --git a/plugins/org.eclipse.objectteams.otequinox.sunjvm/META-INF/p2.inf b/plugins/org.eclipse.objectteams.otequinox.sunjvm/META-INF/p2.inf
new file mode 100644
index 000000000..856393a83
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox.sunjvm/META-INF/p2.inf
@@ -0,0 +1,6 @@
+instructions.install = \
+ addJvmArg(jvmArg:-XX:+UnlockDiagnosticVMOptions); \
+ addJvmArg(jvmArg:-XX:+UnsyncloadClass);
+instructions.uninstall = \
+ removeJvmArg(jvmArg:-XX:+UnlockDiagnosticVMOptions); \
+ removeJvmArg(jvmArg:-XX:+UnsyncloadClass);
diff --git a/plugins/org.eclipse.objectteams.otequinox.sunjvm/build.properties b/plugins/org.eclipse.objectteams.otequinox.sunjvm/build.properties
new file mode 100644
index 000000000..5f22cdd44
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox.sunjvm/build.properties
@@ -0,0 +1 @@
+bin.includes = META-INF/
diff --git a/plugins/org.eclipse.objectteams.otequinox/.classpath b/plugins/org.eclipse.objectteams.otequinox/.classpath
new file mode 100644
index 000000000..304e86186
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <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.objectteams.otequinox/.project b/plugins/org.eclipse.objectteams.otequinox/.project
new file mode 100644
index 000000000..7cbf18fa2
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.objectteams.otequinox</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.objectteams.otequinox/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.objectteams.otequinox/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..64ec58623
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,70 @@
+#Thu Mar 12 15:19:36 CET 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.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.fatalOptionalError=enabled
+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=warning
+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=ignore
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=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=warning
+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=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+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.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/plugins/org.eclipse.objectteams.otequinox/META-INF/MANIFEST.MF b/plugins/org.eclipse.objectteams.otequinox/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..38e210eab
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox/META-INF/MANIFEST.MF
@@ -0,0 +1,18 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: ObjectTeams/Equinox Integration
+Bundle-SymbolicName: org.eclipse.objectteams.otequinox;singleton:=true
+Bundle-Version: 1.4.0.qualifier
+Bundle-Vendor: objectteams.org
+Require-Bundle: org.eclipse.equinox.common,
+ org.eclipse.equinox.registry,
+ org.eclipse.osgi;bundle-version="[3.6.0.v20090928,4.0.0)",
+ org.objectweb.asm;bundle-version="[3.1.0,4.0.0)"
+Import-Package: org.eclipse.core.internal.runtime;resolution:=optional,
+ org.eclipse.objectteams.otequinox.hook,
+ org.eclipse.objectteams.otre
+Bundle-Activator: org.eclipse.objectteams.otequinox.TransformerPlugin
+Export-Package: org.eclipse.objectteams.otequinox
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ActivationPolicy: lazy
+
diff --git a/plugins/org.eclipse.objectteams.otequinox/META-INF/p2.inf b/plugins/org.eclipse.objectteams.otequinox/META-INF/p2.inf
new file mode 100644
index 000000000..e2b8d9ea1
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox/META-INF/p2.inf
@@ -0,0 +1,10 @@
+instructions.install = \
+ setProgramProperty(propName:osgi.hook.configurators.include,propValue:org.eclipse.objectteams.otequinox.hook.HookConfigurator); \
+ setProgramProperty(propName:osgi.classloader.singleThreadLoads,propValue:false); \
+ setProgramProperty(propName:osgi.classloader.lock,propValue:classname); \
+ setProgramProperty(propName:ot.equinox,propValue:1);
+instructions.uninstall = \
+ setProgramProperty(propName:osgi.hook.configurators.include,propValue:); \
+ setProgramProperty(propName:osgi.classloader.singleThreadLoads,propValue:); \
+ setProgramProperty(propName:osgi.classloader.lock,propValue:); \
+ setProgramProperty(propName:ot.equinox,propValue:);
diff --git a/plugins/org.eclipse.objectteams.otequinox/about.ini b/plugins/org.eclipse.objectteams.otequinox/about.ini
new file mode 100644
index 000000000..8b89ca6ba
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox/about.ini
@@ -0,0 +1,14 @@
+aboutText=Object Teams -- Equinox integration (OT/Equinox)\n\
+\n\
+OTDT Version: 1.4.0M2 - developed for Eclipse version 3.6.0M4\n\
+\n\
+(c) Copyright Technical University Berlin and others, 2005, 2010\n\
+Visit http://www.eclipse.org/objectteams\n\
+\n\
+Upon installation, OT/Equinox is enabled in your configuration/config.ini file.\n\
+For instructions on how to temporarily disable OT/Equinox see the instructions at:\n\
+ http://www.objectteams.org/distrib/features.html#otequinox
+
+
+featureImage=ote_32n.png
+
diff --git a/plugins/org.eclipse.objectteams.otequinox/build.properties b/plugins/org.eclipse.objectteams.otequinox/build.properties
new file mode 100644
index 000000000..8e8d1f776
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox/build.properties
@@ -0,0 +1,13 @@
+bin.includes = META-INF/,\
+ plugin.xml,\
+ .,\
+ schema/,\
+ about.ini,\
+ ote_32n.png
+jars.compile.order = .
+src.includes = build.properties,\
+ META-INF/,\
+ .classpath,\
+ .project,\
+ schema/
+source.. = src/
diff --git a/plugins/org.eclipse.objectteams.otequinox/ote_32n.png b/plugins/org.eclipse.objectteams.otequinox/ote_32n.png
new file mode 100644
index 000000000..490ac03a3
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox/ote_32n.png
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otequinox/plugin.xml b/plugins/org.eclipse.objectteams.otequinox/plugin.xml
new file mode 100644
index 000000000..5c9aff330
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox/plugin.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+<plugin>
+ <extension-point id="aspectBindings" name="OT/J Aspect Bindings" schema="schema/aspectBindings.exsd"/>
+ <extension-point id="aspectBindingNegotiators" name="OT/Equinox negotiators for aspect binding requests" schema="schema/aspectBindingNegotiators.exsd"/>
+</plugin>
diff --git a/plugins/org.eclipse.objectteams.otequinox/schema/aspectBindingNegotiators.exsd b/plugins/org.eclipse.objectteams.otequinox/schema/aspectBindingNegotiators.exsd
new file mode 100644
index 000000000..9d5418813
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox/schema/aspectBindingNegotiators.exsd
@@ -0,0 +1,145 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.objectteams.otequinox" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="org.eclipse.objectteams.otequinox" id="aspectBindingNegotiators" name="OT/Equinox negotiators for aspect binding requests"/>
+ </appInfo>
+ <documentation>
+ Allow client plugins to participate in negotiation whether aspect binding requests
+(incl. forced exports) should be denied or granted.
+&lt;p&gt;
+All extensions will be asked whenever an aspect plugin requests an aspect binding
+or a forced export for which no permission could be found in persistent storage
+of neither the eclipse installation nor the workspace.
+&lt;ul&gt;
+&lt;li&gt;As soon as any extension DENYs a given request this aspect plugin is blocked.&lt;/li&gt;
+&lt;li&gt;If no extension GRANTs the request the aspect plugin is blocked, too.&lt;/li&gt;
+&lt;li&gt;Only if at least one extension GRANTs the request and no extension DENYs
+the aspect may proceed and will be woven into its base entities.&lt;/li&gt;
+&lt;/ul&gt;
+&lt;/p&gt;
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appInfo>
+ <meta.element />
+ </appInfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="negotiator" minOccurs="1" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute translatable="true"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="negotiator">
+ <annotation>
+ <documentation>
+ A participant in the protocol for aspect binding negotiation,
+which is able to grant or deny a request by an aspect bundle.
+ </documentation>
+ </annotation>
+ <complexType>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+ Fully qualified name of the class that shall participate in the negotiation protocol.
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java" basedOn=":org.eclipse.objectteams.otequinox.IAspectRequestNegotiator"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ OTDT 1.2.6
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="examples"/>
+ </appInfo>
+ <documentation>
+ Example of a declaration of a &lt;code&gt;negotiator&lt;/code&gt;:&lt;pre&gt;
+&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
+&lt;?eclipse version=&quot;3.2&quot;?&gt;
+&lt;plugin&gt;
+ &lt;extension
+ point=&quot;org.eclipse.objectteams.otequinox.aspectBindingNegotiators&quot;&gt;
+ &lt;negotiator
+ class=&quot;yesser.AspectRequestGranter&quot;&gt;
+ &lt;/negotiator&gt;
+ &lt;/extension&gt;
+&lt;/plugin&gt;
+&lt;/pre&gt;
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="apiInfo"/>
+ </appInfo>
+ <documentation>
+ The class named in the &lt;code&gt;class&lt;/code&gt; property must implement the &lt;code&gt;org.eclipse.objectteams.otequinox.IAspectRequestNegotiator&lt;/code&gt; interface.
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="copyright"/>
+ </appInfo>
+ <documentation>
+ &lt;em&gt;
+&lt;p&gt;
+This file is part of &quot;Object Teams Development Tooling&quot;-Software
+&lt;/p&gt;&lt;p&gt;
+Copyright 2009 Technical University Berlin, Germany.
+All rights reserved. This program and 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;
+&lt;/p&gt;&lt;p&gt;
+Please visit &lt;a href=&quot;http://www.objectteams.org&quot;&gt;www.objectteams.org&lt;/a&gt; for updates and contact.
+&lt;/p&gt;&lt;p&gt;
+Contributors:&lt;br&gt;
+Technical University Berlin - Initial API and implementation
+&lt;/p&gt;
+&lt;/em&gt;
+ </documentation>
+ </annotation>
+
+</schema>
diff --git a/plugins/org.eclipse.objectteams.otequinox/schema/aspectBindings.exsd b/plugins/org.eclipse.objectteams.otequinox/schema/aspectBindings.exsd
new file mode 100644
index 000000000..e2d90ede9
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox/schema/aspectBindings.exsd
@@ -0,0 +1,278 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.objectteams.otequinox" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="org.eclipse.objectteams.otequinox" id="aspectBindings" name="OT/J Aspect Bindings"/>
+ </appInfo>
+ <documentation>
+ This extension point allows to define a new &lt;strong&gt;relationship&lt;/strong&gt; between plug-ins
+called &lt;strong&gt;&quot;aspectBinding&quot;&lt;/strong&gt;.
+By an aspectBinding an aspect plug-in declares which &lt;strong&gt;base plug-ins&lt;/strong&gt; it wishes to adapt
+and which &lt;strong&gt;team classes&lt;/strong&gt; are used for that purpose.
+Only teams in this list are allowed to adapt classes from another plug-in, and such
+adaptation is restricted to classes residing in the specified base plug-in.
+
+Each team class mentioned in an aspectBinding is automatically &lt;strong&gt;instantiated&lt;/strong&gt;
+before the corresponding base plug-in is fully activated.
+In addition extensions may specify that a given team is also &lt;strong&gt;activated&lt;/strong&gt;
+after instantiation.
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appInfo>
+ <meta.element />
+ </appInfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="aspectBinding" minOccurs="1" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute translatable="true"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="aspectBinding">
+ <annotation>
+ <appInfo>
+ <meta.element icon="icon"/>
+ </appInfo>
+ <documentation>
+ Specifies an individual aspect binding by which a given team class adapts classes from a given base plugin.
+ </documentation>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="basePlugin"/>
+ <element ref="team" minOccurs="1" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="icon" type="string" use="default" value="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/calloutbinding_obj.gif">
+ <annotation>
+ <documentation>
+ &lt;i&gt;Default value to provide an icon for this element kind. No need to edit&lt;/i&gt;
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="resource"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="basePlugin">
+ <annotation>
+ <appInfo>
+ <meta.element icon="icon"/>
+ </appInfo>
+ <documentation>
+ &lt;p&gt;
+The base plug-in whose classes may be adapted by the given team(s).
+The base bundle must be a regular bundle, not a fragment.
+If a bundle &lt;b&gt;fragment&lt;/b&gt; should be adapted the aspect binding must refer to the fragment&apos;s host bundle
+and additionally a &lt;code&gt;requiredFragment&lt;/code&gt; should be added.
+&lt;/p&gt;
+&lt;p&gt;
+By specifying &lt;code&gt;SELF&lt;/code&gt; as the basePlugin, a team may adapt classes from its own bundle.
+&lt;/p&gt;
+ </documentation>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="forcedExports" minOccurs="0" maxOccurs="1"/>
+ <element ref="requiredFragment" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+ Qualified identifier of the base plug-in.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="icon" type="string" use="default" value="platform:/plugin/org.eclipse.pde.ui/icons/obj16/plugin_obj.gif">
+ <annotation>
+ <documentation>
+ &lt;i&gt;Default value to provide an icon for this element kind. No need to edit&lt;/i&gt;
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="resource"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="team">
+ <annotation>
+ <appInfo>
+ <meta.element labelAttribute="class" icon="icon"/>
+ </appInfo>
+ <documentation>
+ The team class of this plug-in which is allowed to adapt classes of the given base plug-in.
+ </documentation>
+ </annotation>
+ <complexType>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+ Fully qualified name of a team class.
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java" basedOn=":org.objectteams.ITeam"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ <attribute name="superclass" type="string">
+ <annotation>
+ <documentation>
+ Fully qualified name of the team&apos;s super-class if that is not org.objectteams.Team but another team of the same plugin.
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java" basedOn=":org.objectteams.ITeam"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ <attribute name="activation">
+ <annotation>
+ <documentation>
+ Request activation of this team class:
+NONE: don&apos;t automatically activate (default)
+THREAD: activate for one thread (discouraged)
+ALL_THREADS: activate for all threads
+ </documentation>
+ </annotation>
+ <simpleType>
+ <restriction base="string">
+ <enumeration value="NONE">
+ </enumeration>
+ <enumeration value="THREAD">
+ </enumeration>
+ <enumeration value="ALL_THREADS">
+ </enumeration>
+ </restriction>
+ </simpleType>
+ </attribute>
+ <attribute name="icon" type="string" use="default" value="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif">
+ <annotation>
+ <documentation>
+ &lt;i&gt;Default value to provide an icon for this element kind. No need to edit&lt;/i&gt;
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="resource"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="forcedExports" type="string">
+ <annotation>
+ <documentation>
+ Declare any requests to access packages from the base plugin which are not exported.
+Provide comma separated list of package names (as in the OSGi Export-Package: header).
+ </documentation>
+ </annotation>
+ </element>
+
+ <element name="requiredFragment">
+ <annotation>
+ <documentation>
+ Name of a fragment of the base bundle that is required by the aspect.
+ </documentation>
+ </annotation>
+ <complexType>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+ Symbolic name of the fragment.
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ OTDT 0.9.1 based on Eclipse 3.2.
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="examples"/>
+ </appInfo>
+ <documentation>
+ See example plugin org.eclipse.objectteams.otequinox.branding.
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="apiInfo"/>
+ </appInfo>
+ <documentation>
+ The &lt;code&gt;class&lt;/code&gt; named in the class property must be a team class thus implementing the &lt;code&gt;org.objectteams.ITeam&lt;/code&gt; interface.
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="implementation"/>
+ </appInfo>
+ <documentation>
+ None.
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="copyright"/>
+ </appInfo>
+ <documentation>
+ &lt;em&gt;
+&lt;p&gt;
+This file is part of &quot;Object Teams Development Tooling&quot;-Software
+&lt;/p&gt;&lt;p&gt;
+Copyright 2006, 2010 Technical University Berlin, Germany.
+All rights reserved. This program and 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;
+&lt;/p&gt;&lt;p&gt;
+Please visit &lt;a href=&quot;http://www.objectteams.org&quot;&gt;www.objectteams.org&lt;/a&gt; for updates and contact.
+&lt;/p&gt;&lt;p&gt;
+Contributors:&lt;br&gt;
+Technical University Berlin - Initial API and implementation
+&lt;/p&gt;
+&lt;/em&gt;
+ </documentation>
+ </annotation>
+
+</schema>
diff --git a/plugins/org.eclipse.objectteams.otequinox/src/org/eclipse/objectteams/otequinox/ActivationKind.java b/plugins/org.eclipse.objectteams.otequinox/src/org/eclipse/objectteams/otequinox/ActivationKind.java
new file mode 100644
index 000000000..2beae774f
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox/src/org/eclipse/objectteams/otequinox/ActivationKind.java
@@ -0,0 +1,32 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2009 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: ActivationKind.java 23461 2010-02-04 22:10:39Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otequinox;
+
+/**
+ * Possible values for the "activation" attribute of a "team" element within an "aspectBinding" extension.
+ *
+ * @author stephan
+ * @since 1.2.7 (was inline previously)
+ */
+public enum ActivationKind {
+ /** Don't activate team by default. */
+ NONE,
+ /** Activate team for current thread. */
+ THREAD,
+ /** Globally activate team. */
+ ALL_THREADS;
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otequinox/src/org/eclipse/objectteams/otequinox/AspectBindingRequestAnswer.java b/plugins/org.eclipse.objectteams.otequinox/src/org/eclipse/objectteams/otequinox/AspectBindingRequestAnswer.java
new file mode 100644
index 000000000..98d769e5f
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox/src/org/eclipse/objectteams/otequinox/AspectBindingRequestAnswer.java
@@ -0,0 +1,47 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2009 Germany and Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: AspectBindingRequestAnswer.java 23468 2010-02-04 22:34:27Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otequinox;
+
+import org.eclipse.objectteams.otequinox.hook.AspectPermission;
+
+/**
+ * Answer for an aspect binding request. See extension point org.eclipse.objectteams.otequinox.aspectBindingNegotiators.
+ *
+ * @author stephan
+ * @see 1.2.6
+ */
+public class AspectBindingRequestAnswer
+{
+ /** Should this answer be remembered persistently? */
+ public boolean persistent;
+ /** Should this answer be applied to all subsequent requests? */
+ public boolean allRequests;
+ /** The actual answer. */
+ public AspectPermission permission;
+
+ /**
+ * @param persistent Should this answer be remembered persistently?
+ * @param allRequests Should this answer be applied to all subsequent requests?
+ * @param permission One of DENY, GRANT, UNDEFINED (let others decide).
+ */
+ public AspectBindingRequestAnswer(boolean persistent, boolean allRequests, AspectPermission permission) {
+ this.persistent = persistent;
+ this.allRequests = allRequests;
+ this.permission = permission;
+ }
+
+}
diff --git a/plugins/org.eclipse.objectteams.otequinox/src/org/eclipse/objectteams/otequinox/Constants.java b/plugins/org.eclipse.objectteams.otequinox/src/org/eclipse/objectteams/otequinox/Constants.java
new file mode 100644
index 000000000..c4a7f3b8f
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox/src/org/eclipse/objectteams/otequinox/Constants.java
@@ -0,0 +1,61 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2009 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: Constants.java 23461 2010-02-04 22:10:39Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otequinox;
+
+/**
+ * Constants used for OT/Equinox.
+ *
+ * @author stephan
+ * @since 1.2.7
+ */
+public interface Constants {
+
+ /** ID of this plugin. */
+ public static final String TRANSFORMER_PLUGIN_ID = "org.eclipse.objectteams.otequinox" ; //$NON-NLS-1$
+
+ // === Extension point elements: ===
+
+ /** Simple name of the extension point org.eclipse.objectteams.otequinox.aspectBindings. */
+ static final String ASPECT_BINDING_EXTPOINT_ID = "aspectBindings";
+ static final String ASPECT_BINDING_FQEXTPOINT_ID = TRANSFORMER_PLUGIN_ID+'.'+ASPECT_BINDING_EXTPOINT_ID;
+
+ /** Attribute of "team" and "basePlugin" elements. */
+ static final String ID = "id";
+
+ /** Element of EP aspectBindings denoting a team class. */
+ static final String TEAM = "team";
+ /** Attribute of a "team" element denoting the fully qualified class name. */
+ static final String CLASS = "class";
+ /** Attribute of a "team" element denoting the team's superclass. */
+ static final String SUPERCLASS = "superclass";
+ /** Attribute of a "team" element denoting the requested activation: one of "NONE", "THREAD", "ALL_THREADS". */
+ static final String ACTIVATION = "activation";
+
+ /** Element of EP aspectBindings denoting an adapted base plugin. */
+ static final String BASE_PLUGIN = "basePlugin";
+ /** Subelement of a "basePlugin" denoting a framgment of the base plugin that is required by the aspect. */
+ static final String REQUIRED_FRAGMENT = "requiredFragment";
+ /** Pseudo ID of a basePlugin specifying that the team(s) adapt base classes from their own plugin. */
+ static final String SELF = "SELF";
+
+ /** Element of EP aspectBinding - child of basePlugin node - requesting exports forced on the given base plug-in. */
+ public static final String FORCED_EXPORTS_ELEMENT = "forcedExports";
+
+ /** Simple name of the extension point org.eclipse.objectteams.otequinox.aspectBindingNegotiators. */
+ public static final String ASPECT_NEGOTIATOR_EXTPOINT_ID = "aspectBindingNegotiators";
+
+}
diff --git a/plugins/org.eclipse.objectteams.otequinox/src/org/eclipse/objectteams/otequinox/IAspectRequestNegotiator.java b/plugins/org.eclipse.objectteams.otequinox/src/org/eclipse/objectteams/otequinox/IAspectRequestNegotiator.java
new file mode 100644
index 000000000..353370e9e
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox/src/org/eclipse/objectteams/otequinox/IAspectRequestNegotiator.java
@@ -0,0 +1,49 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2009 Germany and Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: IAspectRequestNegotiator.java 23468 2010-02-04 22:34:27Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otequinox;
+
+import org.eclipse.objectteams.otequinox.hook.AspectPermission;
+
+/**
+ * Interface for extenders wishing to participate in negotiation about aspect binding requests
+ * including forced exports.
+ *
+ * @author stephan
+ * @since 1.2.6
+ */
+public interface IAspectRequestNegotiator {
+
+ /**
+ * Check whether a request for forced exports should be granted.
+ * @param aspectBundleSymbolicName the aspect issuing the request
+ * @param baseBundleSymbolicName the affected base bundle
+ * @param basePackage the affected base package
+ * @param previousNegotiation the result of negotations up-to this point
+ * @return a structure holding the answer, must not be null.
+ */
+ AspectBindingRequestAnswer checkForcedExport(String aspectBundleSymbolicName, String baseBundleSymbolicName, String basePackage, AspectPermission previousNegotiation);
+
+ /**
+ * Check whether a request for an aspect binding should be granted.
+ * @param aspectBundleSymbolicName the aspect issuing the request
+ * @param baseBundleSymbolicName the affected base bundle
+ * @param teamClass an affecting team class involved in this aspect binding
+ * @param previousNegotiation the result of negotations up-to this point
+ * @return a structure holding the answer, must not be null.
+ */
+ AspectBindingRequestAnswer checkAspectBinding(String aspectBundleSymbolicName, String baseBundleSymbolicName, String teamClass, AspectPermission previousNegotiation);
+}
diff --git a/plugins/org.eclipse.objectteams.otequinox/src/org/eclipse/objectteams/otequinox/TransformerPlugin.java b/plugins/org.eclipse.objectteams.otequinox/src/org/eclipse/objectteams/otequinox/TransformerPlugin.java
new file mode 100644
index 000000000..a6f819365
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox/src/org/eclipse/objectteams/otequinox/TransformerPlugin.java
@@ -0,0 +1,565 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: TransformerPlugin.java 23468 2010-02-04 22:34:27Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otequinox;
+
+import static org.eclipse.objectteams.otequinox.Constants.*;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Properties;
+import java.util.Set;
+
+import org.eclipse.core.internal.runtime.InternalPlatform;
+import org.eclipse.core.runtime.IConfigurationElement; //from: org.eclipse.equinox.registry
+import org.eclipse.core.runtime.RegistryFactory;
+import org.eclipse.objectteams.otequinox.internal.ASMByteCodeAnalyzer;
+import org.eclipse.objectteams.otequinox.internal.AspectBinding;
+import org.eclipse.objectteams.otequinox.internal.AspectPermissionManager;
+import org.eclipse.objectteams.otequinox.internal.MasterTeamLoader;
+import org.eclipse.objectteams.otequinox.hook.ClassScanner;
+import org.eclipse.objectteams.otequinox.hook.HookConfigurator;
+import org.eclipse.objectteams.otequinox.hook.IAspectRegistry;
+import org.eclipse.objectteams.otequinox.hook.IByteCodeAnalyzer;
+import org.eclipse.objectteams.otequinox.hook.ILogger;
+import org.eclipse.objectteams.otequinox.hook.IOTEquinoxService;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.ServiceReference;
+import org.osgi.framework.ServiceRegistration;
+import org.osgi.service.packageadmin.PackageAdmin;
+
+/**
+ * The main class (activator) of the transformer plugin.
+ * It maintains the aspect registry of this plugin.
+ * This class optionally uses {@link InternalPlatform} for the purpose of accessing the workspace location,
+ * i.e., if this class is not found, no workspace location will be used.
+ *
+ * @author stephan
+ * @version $Id: TransformerPlugin.java 23468 2010-02-04 22:34:27Z stephan $
+ */
+@SuppressWarnings("restriction") // accessing InternalPlatform
+public class TransformerPlugin implements BundleActivator, IOTEquinoxService
+{
+ private static List<String> KNOWN_OTDT_ASPECTS = new ArrayList<String>();
+ static {
+ KNOWN_OTDT_ASPECTS.add("org.eclipse.objectteams.otdt.jdt.ui");
+ KNOWN_OTDT_ASPECTS.add("org.eclipse.objectteams.otdt.compiler.adaptor");
+ KNOWN_OTDT_ASPECTS.add("org.eclipse.objectteams.otdt.refactoring.adaptor");
+ KNOWN_OTDT_ASPECTS.add("org.eclipse.objectteams.otdt.pde.ui");
+ KNOWN_OTDT_ASPECTS.add("org.eclipse.objectteams.otdt.samples");
+ }
+ /** main internal registry of aspect bindings. */
+ private static HashMap<String, ArrayList<AspectBinding>> aspectBindingsByBasePlugin =
+ new HashMap<String, ArrayList<AspectBinding>>();
+ private static HashMap<String, ArrayList<AspectBinding>> aspectBindingsByAspectPlugin =
+ new HashMap<String, ArrayList<AspectBinding>>();
+ // map base bundle name to list of adapted base class names
+ private static HashMap<String, ArrayList<String>> adaptedBaseClassNames =
+ new HashMap<String, ArrayList<String>>();
+ // set of aspect plug-ins which have internal teams:
+ private Set<String> selfAdaptingAspects= new HashSet<String>();
+
+ /** Aspect Permissions and Negotiation (delegate to dedicated manager). */
+ private AspectPermissionManager permissionManager;
+
+ /** The instance that is created by the framework. */
+ private static TransformerPlugin instance;
+ private ServiceRegistration serviceRegistration;
+ private ILogger log;
+
+ /** instances which may have pending team classes waiting for instantiation. */
+ private HashMap<Bundle,List<MasterTeamLoader>> masterTeamLoaders = new HashMap<Bundle, List<MasterTeamLoader>>();
+
+ /** Service needed for handling fragments */
+ private PackageAdmin packageAdmin;
+
+ // note: actually List<Team> but Team cannot be mentioned in this plugin.
+ private List<Object> teamInstances = new ArrayList<Object>();
+
+ public static boolean IS_OTDT = false;
+
+ public boolean isOTDT() {
+ return IS_OTDT;
+ }
+
+ public TransformerPlugin() {
+ instance = this;
+ }
+ public void start(BundleContext context) throws Exception {
+ if (!HookConfigurator.OT_EQUINOX_ENABLED)
+ throw new BundleException("Not starting the transformer plugin because OT/Equinox has not been enabled (set system property \"ot.equinox\").");
+
+ this.log = HookConfigurator.getLogger();
+ log(ILogger.INFO, "activating org.eclipse.objectteams.otequinox");
+
+ ServiceReference ref= context.getServiceReference(PackageAdmin.class.getName());
+ if (ref!=null)
+ this.packageAdmin = (PackageAdmin)context.getService(ref);
+ else
+ this.log(ILogger.ERROR, "Failed to load PackageAdmin service. Will not be able to handle fragments.");
+
+ this.permissionManager = new AspectPermissionManager(this.log, context.getBundle(), this.packageAdmin);
+ this.permissionManager.loadAspectBindingNegotiators(context);
+ loadAspectBindings();
+ this.serviceRegistration = context.registerService(IOTEquinoxService.class.getName(), this, new Properties());
+ }
+
+ /* be a good citizen: clean up. */
+ public void stop(BundleContext context) throws Exception {
+ serviceRegistration.unregister();
+ }
+
+ public static TransformerPlugin getDefault() {
+ return instance;
+ }
+
+ /** public API: Do we know about any team that has not yet been initiaized as requested? */
+ public static boolean isWaitingForTeams() {
+ synchronized (instance.masterTeamLoaders) {
+ if (!instance.masterTeamLoaders.isEmpty())
+ return true;
+ }
+ synchronized (aspectBindingsByBasePlugin) {
+ for (ArrayList<AspectBinding> aspects : aspectBindingsByBasePlugin.values())
+ for (AspectBinding aspectBinding : aspects)
+ if (!aspectBinding.activated)
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Internal API for TransformerHook:
+ * see {@link IAspectRegistry#isDeniedAspectPlugin(String)}
+ */
+ public boolean isDeniedAspectPlugin(String symbolicName) {
+ return this.permissionManager.isDeniedAspectPlugin(symbolicName);
+ }
+
+ /* Load extensions for org.eclipse.objectteams.otequinox.aspectBindings and check aspect permissions. */
+ private void loadAspectBindings() {
+ IConfigurationElement[] aspectBindingConfigs = RegistryFactory.getRegistry().getConfigurationElementsFor(
+ TRANSFORMER_PLUGIN_ID, ASPECT_BINDING_EXTPOINT_ID);
+
+ for (int i = 0; i < aspectBindingConfigs.length; i++) {
+ IConfigurationElement currentBindingConfig = aspectBindingConfigs[i];
+
+ //aspect:
+ String aspectBundleId= currentBindingConfig.getContributor().getName();
+ IS_OTDT |= KNOWN_OTDT_ASPECTS.contains(aspectBundleId);
+
+ //base:
+ IConfigurationElement[] basePlugins = currentBindingConfig.getChildren(BASE_PLUGIN);
+ if (basePlugins.length != 1) {
+ log(ILogger.ERROR, "aspectBinding of "+aspectBundleId+" must declare exactly one basePlugin");
+ continue;
+ }
+ String baseBundleId = basePlugins[0].getAttribute(ID);
+
+ //base fragments?
+ IConfigurationElement[] fragments = basePlugins[0].getChildren(REQUIRED_FRAGMENT);
+ if (fragments != null && !checkRequiredFragments(aspectBundleId, baseBundleId, fragments)) // reported inside
+ continue;
+
+ AspectBinding binding = new AspectBinding(aspectBundleId, baseBundleId, basePlugins[0].getChildren(Constants.FORCED_EXPORTS_ELEMENT));
+ // TODO(SH): maybe enforce that every bundle id is given only once?
+
+ //teams:
+ IConfigurationElement[] teams = currentBindingConfig.getChildren(TEAM);
+ binding.initTeams(teams.length);
+ try {
+ for (int j = 0; j < teams.length; j++) {
+ String teamClass = teams[j].getAttribute(CLASS);
+ binding.teamClasses[j] = teamClass;
+ String activation = teams[j].getAttribute(ACTIVATION);
+ binding.setActivation(j, activation);
+ }
+
+ String realBaseBundleId = baseBundleId.toUpperCase().equals(SELF) ? aspectBundleId : baseBundleId;
+ addBindingForBaseBundle(realBaseBundleId, binding);
+ addBindingForAspectBundle(aspectBundleId, binding);
+
+ // now that binding.teamClasses is filled connect to super team, if requested:
+ for (int j = 0; j < teams.length; j++) {
+ String superTeamName = teams[j].getAttribute(SUPERCLASS);
+ if (superTeamName != null)
+ addSubTeam(aspectBundleId, binding.teamClasses[j], superTeamName);
+ }
+ log(ILogger.INFO, "registered:\n"+binding);
+ } catch (Throwable t) {
+ log(t, "Invalid aspectBinding extension");
+ }
+ }
+ }
+
+ private boolean checkRequiredFragments(String aspectBundleId, String baseBundleId, IConfigurationElement[] fragments)
+ {
+ // checking only, no real action needed.
+ boolean hasError = false;
+ for (IConfigurationElement fragment : fragments) {
+ String fragId = fragment.getAttribute(ID);
+ if (fragId == null) {
+ log(ILogger.ERROR, "Mandatory attribute \"id\" missing from element \"requiredFragment\" of aspect binding in "+aspectBundleId);
+ return false;
+ }
+ if (packageAdmin == null) {
+ log(ILogger.ERROR, "Not checking required fragment "+fragId+" in aspect binding of "+aspectBundleId+", package admin service not present");
+ return false; // report only once.
+ }
+
+ Bundle[] fragmentBundles = packageAdmin.getBundles(fragId, null);
+ if (fragmentBundles == null || fragmentBundles.length == 0) {
+ log(ILogger.ERROR, "Required fragment "+fragId+" not found in aspect binding of "+aspectBundleId);
+ hasError = true;
+ continue;
+ }
+ Bundle fragmentBundle = fragmentBundles[0];
+ String aspectBindingHint = " (aspect binding of "+aspectBundleId+")";
+ if (packageAdmin.getBundleType(fragmentBundle) != PackageAdmin.BUNDLE_TYPE_FRAGMENT) {
+ log(ILogger.ERROR, "Required fragment " + fragId + " is not a fragment" + aspectBindingHint);
+ hasError = true;
+ continue;
+ }
+ Bundle[] hosts = packageAdmin.getHosts(fragmentBundle);
+ if (hosts == null || hosts.length == 0) {
+ if (fragmentBundle.getState() < Bundle.RESOLVED) {
+ log(ILogger.ERROR, "Required fragment " + fragId + " is not resolved" + aspectBindingHint);
+ hasError = true;
+ continue;
+ }
+ log(ILogger.ERROR, "Required fragment "+fragId+" has no host bundle"+aspectBindingHint);
+ hasError = true;
+ continue;
+ }
+ Bundle host = hosts[0];
+ if (!host.getSymbolicName().equals(baseBundleId)) {
+ log(ILogger.ERROR, "Required fragment "+fragId+" has wrong host "+host.getSymbolicName()+aspectBindingHint);
+ hasError = true;
+ }
+ }
+ return !hasError;
+ }
+
+
+ private static void addBindingForBaseBundle(String baseBundleId, AspectBinding binding) {
+ ArrayList<AspectBinding> bindingList = aspectBindingsByBasePlugin.get(baseBundleId);
+ if (bindingList == null) {
+ bindingList = new ArrayList<AspectBinding>();
+ aspectBindingsByBasePlugin.put(baseBundleId, bindingList);
+ }
+ bindingList.add(binding);
+ }
+
+ private void addBindingForAspectBundle(String aspectBundleId, AspectBinding binding) {
+ ArrayList<AspectBinding> bindingList = aspectBindingsByAspectPlugin.get(aspectBundleId);
+ if (bindingList == null) {
+ bindingList = new ArrayList<AspectBinding>();
+ aspectBindingsByAspectPlugin.put(aspectBundleId, bindingList);
+ }
+ bindingList.add(binding);
+ if (binding.basePlugin.toUpperCase().equals(SELF))
+ selfAdaptingAspects.add(aspectBundleId);
+ }
+
+ /**
+ * Record a sub-class relationship of two teams within the same aspect bundle.
+ *
+ * @param aspectBundleId
+ * @param subTeamName
+ * @param teamName
+ */
+ private void addSubTeam(String aspectBundleId, String subTeamName, String teamName) {
+ ArrayList<AspectBinding> bindingList = aspectBindingsByAspectPlugin.get(aspectBundleId);
+ if (bindingList == null) {
+ Exception e = new Exception("No such aspect binding");
+ log(e, "Class "+teamName+" not registered (declared to be superclass of team "+subTeamName);
+ } else {
+ for (AspectBinding binding : bindingList)
+ if (binding.teamClasses != null)
+ for (int i=0; i < binding.teamClasses.length; i++)
+ if (binding.teamClasses[i].equals(teamName)) {
+ if (binding.subTeamClasses[i] == null)
+ binding.subTeamClasses[i] = new ArrayList<String>();
+ binding.subTeamClasses[i].add(subTeamName);
+ return;
+ }
+ Exception e = new Exception("No such aspect binding");
+ log(e, "Class "+teamName+" not registered(2) (declared to be superclass of team "+subTeamName);
+ }
+ }
+
+ /**
+ * Internal API for TransformerHook:
+ * see {@link IAspectRegistry#getAdaptedBasePlugins(Bundle)}
+ */
+ public String[] getAdaptedBasePlugins(Bundle aspectBundle) {
+ ArrayList<AspectBinding> bindings = aspectBindingsByAspectPlugin.get(aspectBundle.getSymbolicName());
+ if (bindings == null) return null;
+ String[] basePlugins = new String[bindings.size()];
+ for (int i=0; i<basePlugins.length; i++) {
+ basePlugins[i] = bindings.get(i).basePlugin;
+ }
+ return basePlugins;
+ }
+
+ /** Is `symbolicName' the name of a base plugin for which an adapting team is registered? */
+ public boolean isAdaptedBasePlugin(String symbolicName) {
+ ArrayList<AspectBinding> list = aspectBindingsByBasePlugin.get(symbolicName);
+ return list != null && !list.isEmpty();
+ }
+
+ /**
+ * public API:
+ * {@link IAspectRegistry#getAdaptingAspectPlugins(Bundle)}
+ */
+ public String[] getAdaptingAspectPlugins(Bundle basePlugin) {
+ return getAdaptingAspectPlugins(basePlugin.getSymbolicName());
+ }
+ /**
+ * public API:
+ * Get the names of aspect plugins adapting a given base plugin.
+ * @param basePluginName symbolic name of a base plugin.
+ * @return non-null array of symbolic names of aspect plugins.
+ */
+ public String[] getAdaptingAspectPlugins(String basePluginName) {
+ ArrayList<AspectBinding> list = aspectBindingsByBasePlugin.get(basePluginName);
+
+ if (list == null)
+ return new String[0];
+
+ String[] aspects = new String[list.size()];
+ for (int i=0; i< list.size(); i++)
+ aspects[i] = list.get(i).aspectPlugin;
+
+ return aspects;
+ }
+
+ /**
+ * Recored the names of base classes adapted by a given team from a given aspect bundle.
+ */
+ public void storeAdaptedBaseClassNames(String aspectBundleName, String teamName, Collection<String> baseClassNames)
+ {
+ // search the base plugin being adapted by the given team:
+ String basePlugin = null;
+ bindings:
+ for (AspectBinding aspectBinding : aspectBindingsByAspectPlugin.get(aspectBundleName)) {
+ for (String aspectTeamClass : aspectBinding.teamClasses)
+ if (aspectTeamClass.equals(teamName)) {
+ basePlugin = aspectBinding.basePlugin;
+ break bindings;
+ }
+ }
+ if (basePlugin == null && selfAdaptingAspects.contains(aspectBundleName))
+ basePlugin = aspectBundleName;
+ if (basePlugin == null) {
+ log(ILogger.ERROR, "Base plugin for team "+teamName+" from "+aspectBundleName+" not found!");
+ return;
+ }
+ // merge base class names into existing:
+ synchronized (adaptedBaseClassNames) {
+ ArrayList<String> baseBundleClassNames = adaptedBaseClassNames.get(basePlugin);
+ if (baseBundleClassNames == null) {
+ baseBundleClassNames = new ArrayList<String>();
+ adaptedBaseClassNames.put(basePlugin, baseBundleClassNames);
+ }
+ baseBundleClassNames.addAll(baseClassNames);
+ }
+ }
+
+ /**
+ * Internal API for TransformerHook:
+ * see {@link org.eclipse.objectteams.otequinox.hook.ITeamLoader#loadTeams(Bundle, IClassScanner)}
+ */
+ public boolean loadTeams(Bundle baseBundle, ClassScanner classScanner) {
+ ArrayList<AspectBinding> bindings = aspectBindingsByBasePlugin.get(baseBundle.getSymbolicName());
+ return delegateToMasterTeamLoader(baseBundle, classScanner, bindings);
+ }
+
+ /**
+ * Internal API for TransformerHook:
+ * see {@link org.eclipse.objectteams.otequinox.hook.IAspectRegistry#hasInternalTeams(Bundle)}
+ */
+ public boolean hasInternalTeams(Bundle bundle) {
+ return selfAdaptingAspects.contains(bundle.getSymbolicName());
+ }
+
+ /**
+ * Internal API for TransformerHook:
+ * see {@link org.eclipse.objectteams.otequinox.hook.ITeamLoader#loadInternalTeams(Bundle,ClassScanner)}
+ */
+ public boolean loadInternalTeams(Bundle bundle, ClassScanner scanner) {
+ ArrayList<AspectBinding> selfBindings = new ArrayList<AspectBinding>();
+ synchronized (aspectBindingsByAspectPlugin) {
+ ArrayList<AspectBinding> bindings = aspectBindingsByAspectPlugin.get(bundle.getSymbolicName());
+ if (bindings == null)
+ return false;
+ for (int i = 0; i < bindings.size(); )
+ if (bindings.get(i).basePlugin.toUpperCase().equals(SELF))
+ selfBindings.add(bindings.remove(i));
+ else
+ i++;
+ }
+ return delegateToMasterTeamLoader(bundle, scanner, selfBindings);
+ }
+
+ // this performs some work for load[Internal]Teams:
+ // create&register a MasterTeamLoader and use it for loading the teams.
+ private boolean delegateToMasterTeamLoader(Bundle baseBundle,
+ ClassScanner scanner,
+ ArrayList<AspectBinding> bindings)
+ {
+ if (bindings == null || bindings.isEmpty())
+ return false;
+ MasterTeamLoader masterTeamLoader = new MasterTeamLoader(baseBundle);
+ boolean success = masterTeamLoader.loadTeams(baseBundle, scanner, bindings);
+ if (success)
+ addMasterTeamLoader(baseBundle, masterTeamLoader);
+ return success;
+ }
+
+ /**
+ * Internal API for TransformerHook:
+ * see {@link org.eclipse.objectteams.otequinox.hook.ITeamLoader#instantiateTeams(Bundle)}
+ */
+ public void instantiateTeams(Bundle baseBundle, String triggerClassname) {
+ instance.internalInstantiateTeams(baseBundle, triggerClassname);
+ }
+
+ /** Add a master team loader which may hold a list of teams waiting for instantiation.
+ */
+ private void addMasterTeamLoader(Bundle baseBundle, MasterTeamLoader masterTeamLoader) {
+ synchronized (this.masterTeamLoaders) {
+ List<MasterTeamLoader> loaders = this.masterTeamLoaders.get(baseBundle);
+ if (loaders == null) {
+ loaders = new ArrayList<MasterTeamLoader>();
+ this.masterTeamLoaders.put(baseBundle, loaders);
+ }
+ loaders.add(masterTeamLoader);
+ }
+ }
+
+
+ /**
+ * Instantiate all teams affecting the given base bundle. Don't, however, load the class who's loading
+ * triggered this call.
+ *
+ * This method checks whether the AspectPermissionManager.isReady(). If not, defer instantiation and
+ * return the set of all affected base classes for use as a trigger for deferred instantiation.
+ *
+ * @param baseBundle
+ * @param triggerClassname if non-null: the name of a base class who's loading triggered this instantiation.
+ */
+ private void internalInstantiateTeams(Bundle baseBundle, String triggerClassname)
+ {
+ List<MasterTeamLoader> loaders = null;
+ synchronized (this.masterTeamLoaders) {
+ loaders= this.masterTeamLoaders.get(baseBundle);
+ if (this.masterTeamLoaders.isEmpty() || loaders == null)
+ return;
+
+ // check permission for forcedExports of all adapting aspect bundles
+ // (do this only if team loaders are found, but before any side effects occur)
+ synchronized (aspectBindingsByBasePlugin) {
+ List<AspectBinding> aspects= aspectBindingsByBasePlugin.get(baseBundle.getSymbolicName());
+ if (aspects != null) {
+ if (this.permissionManager.isReady()) {
+ for (AspectBinding aspectBinding : aspects)
+ if (!this.permissionManager.checkForcedExports(aspectBinding.aspectPlugin, baseBundle.getSymbolicName(), aspectBinding.forcedExports))
+ return; // don't activate teams of rejected aspect bundle
+ } else {
+ this.permissionManager.addForcedExportsObligations(aspects, baseBundle);
+ }
+ }
+ }
+
+ loaders = new ArrayList<MasterTeamLoader>(loaders);
+ this.masterTeamLoaders.remove(baseBundle);
+ }
+ while (!loaders.isEmpty()) {
+ // be sure not to hold any lock during this statement:
+ List<Object> newInstances = loaders.remove(0).instantiateLoadedTeams(baseBundle, triggerClassname, this.permissionManager);
+ synchronized (this.teamInstances) {
+ this.teamInstances.addAll(newInstances);
+ }
+ }
+ // mark the fact that all teams adapting this base bundle have now been activated:
+ synchronized (aspectBindingsByBasePlugin) {
+ List<AspectBinding> aspects= aspectBindingsByBasePlugin.get(baseBundle.getSymbolicName());
+ if (aspects != null)
+ for (AspectBinding aspectBinding : aspects)
+ aspectBinding.activated= true;
+ }
+ }
+
+ /** Copy all registered team instances into the given list,
+ * which must by of type List<Team>; (can't mention Team in this plugin).
+ */
+ @SuppressWarnings("unchecked")
+ public static synchronized void getTeamInstances(List list) {
+ list.addAll(instance.teamInstances);
+ }
+
+ // configure OT/Equinox debugging:
+ public static int WARN_LEVEL = ILogger.ERROR;
+ static {
+ String level = System.getProperty("otequinox.debug");
+ if (level != null) {
+ level = level.toUpperCase();
+ if (level.equals("OK"))
+ WARN_LEVEL = ILogger.OK;
+ else if (level.equals("INFO"))
+ WARN_LEVEL = ILogger.INFO;
+ else if (level.startsWith("WARN"))
+ WARN_LEVEL = ILogger.WARNING;
+ else if (level.startsWith("ERR"))
+ WARN_LEVEL = ILogger.ERROR;
+ else
+ WARN_LEVEL = ILogger.OK;
+ }
+ }
+
+ public void log (Throwable ex, String msg) {
+ msg = "OT/Equinox: "+msg;
+ System.err.println(msg);
+ ex.printStackTrace();
+ this.log.log(TRANSFORMER_PLUGIN_ID, ex, msg);
+ }
+
+ public void log(int status, String msg) {
+ if (status >= WARN_LEVEL)
+ doLog(status, msg);
+ }
+
+ public void doLog(int status, String msg) {
+ msg = "OT/Equinox: "+msg;
+ this.log.log(TRANSFORMER_PLUGIN_ID, status, msg);
+ }
+
+ public IByteCodeAnalyzer getByteCodeAnalyzer() {
+ return new ASMByteCodeAnalyzer();
+ }
+}
+
diff --git a/plugins/org.eclipse.objectteams.otequinox/src/org/eclipse/objectteams/otequinox/internal/ASMByteCodeAnalyzer.java b/plugins/org.eclipse.objectteams.otequinox/src/org/eclipse/objectteams/otequinox/internal/ASMByteCodeAnalyzer.java
new file mode 100644
index 000000000..cf8cbede2
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox/src/org/eclipse/objectteams/otequinox/internal/ASMByteCodeAnalyzer.java
@@ -0,0 +1,152 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2008 Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: ASMByteCodeAnalyzer.java 23468 2010-02-04 22:34:27Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otequinox.internal;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.objectteams.otequinox.hook.IByteCodeAnalyzer;
+import org.objectweb.asm.ClassReader;
+import org.objectweb.asm.commons.EmptyVisitor;
+
+/**
+ * This class performs some fast readClass analyses
+ * to determine further processing.
+ *
+ * @author Oliver Frank
+ * @since 1.2.3
+ */
+public class ASMByteCodeAnalyzer implements IByteCodeAnalyzer {
+ private static final int ACC_TEAM = 0x8000;
+
+ private static class ClassInformation {
+ private boolean isTeam;
+ private String superClassName;
+
+ public ClassInformation(boolean isTeam, String superClassName) {
+ super();
+ this.isTeam = isTeam;
+ this.superClassName = superClassName;
+ }
+
+ public boolean isTeam() {
+ return isTeam;
+ }
+
+ public String getSuperClassName() {
+ if (superClassName != null)
+ return superClassName.replace('/', '.');
+ return null;
+ }
+ }
+
+ private static class MyVisitor extends EmptyVisitor {
+ MyVisitor() { super();}
+ private boolean isTeam;
+ private String superClassName;
+
+ public boolean isTeam() {
+ return isTeam;
+ }
+
+ public String getSuperClassName() {
+ return superClassName;
+ }
+
+ @Override
+ public void visit(int version, int access, String name,
+ String signature, String superName, String[] interfaces) {
+ superClassName = superName;
+ isTeam = (access & ACC_TEAM) != 0;
+ }
+ }
+
+ private Map<String, ClassInformation> classInformationMap = new HashMap<String, ClassInformation>();
+
+ /**
+ * Fetch the superclass name of a given class.
+ * @param classStream stream providing the class bytes
+ * @param className fully qualified name of the class
+ * @return fully qualified ('.'-separated) name of the class' superclass or null if an exception occurred.
+ */
+ public String getSuperclass(InputStream classStream, String className) {
+ try {
+ return getClassInformation(null, classStream, className)
+ .getSuperClassName();
+ } catch (IOException e) {
+ return null;
+ }
+ }
+
+ /**
+ * Fetch the superclass name of a given class.
+ * @param classStream stream providing the class bytes
+ * @param className fully qualified name of the class
+ * @return fully qualified ('.'-separated) name of the class' superclass or null if an exception occurred.
+ */
+ public String getSuperclass(byte[] classBytes, String className) {
+ try {
+ return getClassInformation(classBytes, null, className)
+ .getSuperClassName();
+ } catch (IOException e) {
+ return null;
+ }
+ }
+
+ public boolean isTeam(byte[] classBytes, String className)
+ throws IOException {
+ return getClassInformation(classBytes, null, className).isTeam();
+ }
+
+ private ClassInformation getClassInformation(byte[] classBytes,
+ InputStream classStream, String className) throws IOException
+ {
+ synchronized (this.classInformationMap) {
+ ClassInformation classInformation = classInformationMap.get(className);
+ if (classInformation != null) {
+ return classInformation;
+ }
+ if (classBytes != null) {
+ classInformation = this.getClassInformationPrivate(classBytes);
+ } else {
+ classInformation = this.getClassInformationPrivate(classStream);
+ }
+ classInformationMap.put(className, classInformation);
+ return classInformation;
+ }
+ }
+
+
+ private ClassInformation getClassInformationPrivate(InputStream classStream)
+ throws IOException {
+ return getClassInformationPrivate(new ClassReader(classStream));
+ }
+
+ private ClassInformation getClassInformationPrivate(byte[] classBytes) {
+ return getClassInformationPrivate(new ClassReader(classBytes));
+ }
+
+ private ClassInformation getClassInformationPrivate(ClassReader reader) {
+ MyVisitor visitor = new MyVisitor();
+
+ reader.accept(visitor, 0);
+ return new ClassInformation(visitor.isTeam(), visitor
+ .getSuperClassName());
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otequinox/src/org/eclipse/objectteams/otequinox/internal/AspectBinding.java b/plugins/org.eclipse.objectteams.otequinox/src/org/eclipse/objectteams/otequinox/internal/AspectBinding.java
new file mode 100644
index 000000000..7b1547a5f
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox/src/org/eclipse/objectteams/otequinox/internal/AspectBinding.java
@@ -0,0 +1,64 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2009 Germany and Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id$
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otequinox.internal;
+
+import java.util.List;
+
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.objectteams.otequinox.ActivationKind;
+
+/**
+ * A simple record representing the information read from an extension to org.eclipse.objectteams.otequinox.aspectBindings.
+ * @author stephan
+ * @since 1.3.0 (was a nested class before that)
+ */
+public class AspectBinding {
+ public String aspectPlugin;
+ public String basePlugin;
+ public IConfigurationElement[] forcedExports;
+ public ActivationKind[] activations = null;
+ public String[] teamClasses;
+ public List<String>[] subTeamClasses;
+ public boolean activated= false;
+
+ public AspectBinding(String aspectId, String baseId, IConfigurationElement[] forcedExportsConfs) {
+ this.aspectPlugin= aspectId;
+ this.basePlugin= baseId;
+ this.forcedExports= forcedExportsConfs;
+ }
+
+ @SuppressWarnings("unchecked")
+ public void initTeams(int count) {
+ this.teamClasses = new String[count];
+ this.subTeamClasses = new List[count]; // new List<String>[count] is illegal!
+ this.activations = new ActivationKind[count];
+ }
+
+ public void setActivation(int i, String specifier) {
+ if (specifier == null)
+ this.activations[i] = ActivationKind.NONE;
+ else
+ this.activations[i] = ActivationKind.valueOf(specifier);
+ }
+ public String toString() {
+ String result = "\tbase plugin "+basePlugin+"\n\tadapted by aspect pluging "+aspectPlugin;
+ for (String teamClass : teamClasses) {
+ result += "\n\t\t + team "+teamClass;
+ }
+ return result;
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otequinox/src/org/eclipse/objectteams/otequinox/internal/AspectPermissionManager.java b/plugins/org.eclipse.objectteams.otequinox/src/org/eclipse/objectteams/otequinox/internal/AspectPermissionManager.java
new file mode 100644
index 000000000..38e425b08
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox/src/org/eclipse/objectteams/otequinox/internal/AspectPermissionManager.java
@@ -0,0 +1,616 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2009 Germany and Technical University Berlin, Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: AspectPermissionManager.java 23468 2010-02-04 22:34:27Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otequinox.internal;
+
+import static org.eclipse.objectteams.otequinox.hook.AspectPermission.*;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Properties;
+import java.util.Set;
+
+import org.eclipse.core.internal.runtime.InternalPlatform;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.RegistryFactory;
+import org.eclipse.objectteams.otequinox.ActivationKind;
+import org.eclipse.objectteams.otequinox.AspectBindingRequestAnswer;
+import org.eclipse.objectteams.otequinox.Constants;
+import org.eclipse.objectteams.otequinox.IAspectRequestNegotiator;
+import org.eclipse.objectteams.otequinox.TransformerPlugin;
+import org.eclipse.objectteams.otequinox.internal.MasterTeamLoader.TeamClassRecord;
+import org.eclipse.osgi.service.datalocation.Location;
+import org.eclipse.objectteams.otequinox.hook.AspectPermission;
+import org.eclipse.objectteams.otequinox.hook.HookConfigurator;
+import org.eclipse.objectteams.otequinox.hook.ILogger;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+import org.osgi.service.packageadmin.PackageAdmin;
+
+/**
+ * Manage permissions of aspect bundles requesting to apply aspectBindings and forcedExports.
+ * The following pieces of information are checked:
+ * <ul>
+ * <li>properties set in installation-wide config.ini or as command line args (handled by {@link HookConfigurator} (plus internal class OTStorageHook))</li>
+ * <li>defaults set per workspace (file negotiationDefaults.txt)</li>
+ * <li>individual GRANT/DENY per workspace (files grantedForcedExports.txt, deniedForcedExports.txt)</li>
+ * <li>answers from registered negotiators (extension point org.eclipse.objectteams.otequinox.aspectBindingNegotiators, see {@link IAspectRequestNegotiator})</li>
+ * </ul>
+ *
+ * <p>
+ * The final answer for a given request is combined from all sources where the priority of any {@link #DENY} answer is highest,
+ * of {@link #UNDEFINED} is lowest.
+ * </p>
+ * <p>
+ * If a negotiator has determined a decision and its answer has the <code>persistent</code> flag set,
+ * this particular aspect permission is stored as per-workspace configuration.
+ * </p>
+ * @author stephan
+ * @since 1.2.6
+ */
+@SuppressWarnings("restriction")
+public class AspectPermissionManager {
+
+ // property names for default configuration:
+ private static final String FORCED_EXPORT_DEFAULT = "forced.export.default";
+ private static final String ASPECT_BINDING_DEFAULT = "aspect.binding.default";
+
+ // workspace files where negotiation configuration is stored:
+ private static final String NEGOTIATION_DEFAULTS_FILE = "negotiationDefaults.txt";
+ private static final String GRANTED_FORCED_EXPORTS_FILE = "grantedForcedExports.txt";
+ private static final String DENIED_FORCED_EXPORTS_FILE = "deniedForcedExports.txt";
+
+
+ // set of aspect plug-ins for which some permission has been denied:
+ private Set<String> deniedAspects = new HashSet<String>();
+ // default permission for aspect bindings:
+ private AspectPermission defaultAspectBindingPermission = GRANT;
+ // default permission for forced exports:
+ private AspectPermission defaultForcedExportPermission = UNDEFINED; // not yet granted, but open for receiving a GRANT
+ // for negotiation of aspect binding requests (incl. forced export):
+ private List<IAspectRequestNegotiator> negotiators = new ArrayList<IAspectRequestNegotiator>();
+
+
+ // collect all forced exports (denied/granted), granted should balance to an empty structure.
+ // structure is: aspect-id -> (base bundle x base package)*
+ private HashMap<String, ArrayList<String[]>> deniedForcedExportsByAspect= new HashMap<String, ArrayList<String[]>>();
+ private HashMap<String, ArrayList<String[]>> grantedForcedExportsByAspect= new HashMap<String, ArrayList<String[]>>();
+
+ // key is aspectId+"->"+baseId, value is array of team names
+ private HashMap<String, Set<String>> deniedTeamsByAspectBinding = new HashMap<String, Set<String>>();
+ private HashMap<String, Set<String>> grantedTeamsByAspectBinding = new HashMap<String, Set<String>>();
+
+ // the workspace directory for storing the state of this plugin
+ private IPath otequinoxState;
+ // back link needed for accessing the state location:
+ private Bundle transformerBundle;
+ // helper instance needed to stop bundles by name
+ private PackageAdmin packageAdmin;
+ // shared logger:
+ private ILogger log;
+
+ public AspectPermissionManager(ILogger log, Bundle bundle, PackageAdmin packageAdmin) {
+ this.log = log;
+ this.transformerBundle = bundle;
+ this.packageAdmin = packageAdmin;
+ }
+
+ /* local cache for isReady(): */
+ private boolean isWaitingForLocation = true;
+
+ /** Before using this permission manager a client must check whether we're ready (instance location set). */
+ public boolean isReady() {
+ if (!isWaitingForLocation)
+ return true;
+ try {
+ InternalPlatform platform = InternalPlatform.getDefault();
+ Location instanceLocation = platform.getInstanceLocation();
+ if (!instanceLocation.isSet())
+ return false; // not yet capable
+ this.isWaitingForLocation = false;
+ fetchAspectBindingPermssionsFromWorkspace();
+ } catch (NoClassDefFoundError ncdfe) {
+ this.log.log(ILogger.WARNING, "Optional class InternalPlatform not found, cannot access workspace location");
+ this.isWaitingForLocation = false;
+ return true;
+ }
+ if (!this.obligations.isEmpty())
+ for (Runnable job : this.obligations)
+ job.run();
+ return true;
+ }
+
+ /**
+ * Fetch stored permissions from this plugin's workspace state.
+ *
+ * @pre instance location should be set (see {@link #isReady()}),
+ * otherwise will silently return without accessing workspace settings.
+ */
+ private void fetchAspectBindingPermssionsFromWorkspace()
+ {
+ try {
+ this.otequinoxState = InternalPlatform.getDefault().getStateLocation(this.transformerBundle, true);
+ } catch (NoClassDefFoundError ncdfe) {
+ this.log.log(ILogger.WARNING, "Optional class InternalPlatform not found, cannot access workspace location");
+ return;
+ }
+
+ // defaults:
+ IPath configFilePath = this.otequinoxState.append(NEGOTIATION_DEFAULTS_FILE);
+ File configFile = new File(configFilePath.toOSString());
+ if (configFile.exists()) {
+ Properties props = new Properties();
+ try {
+ boolean migrated = false; // TODO(SH): remove this migration support in 1.3.0
+ props.load(new FileInputStream(configFile));
+ String value = (String) props.get(ASPECT_BINDING_DEFAULT);
+ if (value != null)
+ try {
+ defaultAspectBindingPermission = AspectPermission.valueOf(value);
+ } catch (IllegalArgumentException iae) {
+ if ("DONT_CARE".equals(value)) {
+ defaultAspectBindingPermission = AspectPermission.UNDEFINED;
+ migrated = true;
+ } else {
+ // this code should remain even after 1.3.0:
+ defaultAspectBindingPermission = AspectPermission.DENY;
+ log(iae, "Cannot set default aspect permission from file "+NEGOTIATION_DEFAULTS_FILE+", assuming DENY.");
+ }
+ }
+ value = (String) props.get(FORCED_EXPORT_DEFAULT);
+ if (value != null)
+ try {
+ defaultForcedExportPermission = AspectPermission.valueOf(value);
+ } catch (IllegalArgumentException iae) {
+ if ("DONT_CARE".equals(value)) {
+ defaultForcedExportPermission = AspectPermission.UNDEFINED;
+ migrated = true;
+ } else {
+ // this code should remain even after 1.3.0:
+ defaultForcedExportPermission = AspectPermission.DENY;
+ log(iae, "Cannot set default forced exports permission from file "+NEGOTIATION_DEFAULTS_FILE+", assuming DENY.");
+ }
+ }
+ if (migrated)
+ writeNegotiationDefaults(configFile);
+ } catch (IOException ioex) {
+ log(ioex, "Failed to read configuration file "+configFilePath.toOSString());
+ }
+ } else {
+ try {
+ File stateDir = new File(this.otequinoxState.toOSString());
+ if (!stateDir.exists())
+ stateDir.mkdirs();
+ configFile.createNewFile();
+ writeNegotiationDefaults(configFile);
+ } catch (IOException ioex) {
+ log(ioex, "Failed to create configuration file "+configFilePath.toOSString());
+ }
+ }
+
+ // explicitly denied:
+ configFilePath = this.otequinoxState.append(DENIED_FORCED_EXPORTS_FILE);
+ configFile = new File(configFilePath.toOSString());
+ if (configFile.exists())
+ HookConfigurator.parseForcedExportsFile(configFile, DENY);
+
+ // explicitly granted:
+ configFilePath = this.otequinoxState.append(GRANTED_FORCED_EXPORTS_FILE);
+ configFile = new File(configFilePath.toOSString());
+ if (configFile.exists())
+ HookConfigurator.parseForcedExportsFile(configFile, GRANT);
+ }
+
+ private void writeNegotiationDefaults(File configFile)
+ throws IOException
+ {
+ FileWriter writer = new FileWriter(configFile);
+ writer.append(ASPECT_BINDING_DEFAULT+'='+defaultAspectBindingPermission.toString()+'\n');
+ writer.append(FORCED_EXPORT_DEFAULT+'='+defaultForcedExportPermission.toString()+'\n');
+ writer.flush();
+ writer.close();
+ log(ILogger.INFO, "Created aspect binding defaults file "+configFile.getCanonicalPath());
+ }
+
+
+ /** Load extensions for EP org.eclipse.objectteams.otequinox.aspectBindingNegotiators. */
+ public void loadAspectBindingNegotiators(BundleContext context) {
+ IConfigurationElement[] aspectBindingNegotiatorsConfigs = RegistryFactory.getRegistry().getConfigurationElementsFor(
+ Constants.TRANSFORMER_PLUGIN_ID, Constants.ASPECT_NEGOTIATOR_EXTPOINT_ID);
+ for (int i = 0; i < aspectBindingNegotiatorsConfigs.length; i++) {
+ IConfigurationElement currentNegotiatorConfig = aspectBindingNegotiatorsConfigs[i];
+ try {
+ Object negotiator = currentNegotiatorConfig.createExecutableExtension("class");
+ if (negotiator != null)
+ this.negotiators.add(((IAspectRequestNegotiator)negotiator));
+ } catch (CoreException e) {
+ log(e, "Failed to instantiate extension "+currentNegotiatorConfig);
+ }
+ }
+ }
+
+ /** Delegatee of internal API {@link TransformerPlugin#isDeniedAspectPlugin(String)}. */
+ public boolean isDeniedAspectPlugin(String symbolicName) {
+ return this.deniedAspects.contains(symbolicName);
+ }
+
+
+ /**
+ * Check whether a given aspect requests forced exports from base,
+ * and whether these requests are granted/denied by checking all available sources.
+ *
+ * Clients should ask {@link #isReady()} (ie., instance location is set) before calling this method,
+ * otherwise workspace settings have to be silently ignored (any error should be signaled by client).
+ *
+ * @param aspectId symbolic name of the aspect bundle
+ * @param baseBundleId symbolic name of the bound base bundle
+ * @param forcedExports any forced exports requested in this aspect binding.
+ * @return whether all requests (if any) have been granted
+ */
+ public boolean checkForcedExports(String aspectId, String baseBundleId, IConfigurationElement[] forcedExports)
+ {
+ if (forcedExports == null || forcedExports.length == 0)
+ return true;
+
+ ArrayList<String[]> deniedForcedExports = getConfiguredForcedExports(aspectId, DENY, deniedForcedExportsByAspect);
+ ArrayList<String[]> grantedForcedExports= getConfiguredForcedExports(aspectId, GRANT, grantedForcedExportsByAspect);
+
+ // iterate all requested forcedExports to search for a matching permission:
+ for (IConfigurationElement forcedExport : forcedExports) { // [0..1] (as defined in the schema)
+ String forcedExportsRequest = forcedExport.getValue();
+ if (forcedExportsRequest == null)
+ continue;
+ for (String singleForcedExportRequest : forcedExportsRequest.split(","))
+ {
+ singleForcedExportRequest = singleForcedExportRequest.trim();
+
+ String[] listEntry;
+ boolean grantReported = false;
+ AspectPermission negotiatedPermission = this.defaultForcedExportPermission;
+
+ // DENY by default?
+ if (negotiatedPermission == DENY) {
+ log(ILogger.ERROR, "Default denial of forced export regarding package "+singleForcedExportRequest+
+ " from bundle "+baseBundleId+" as requested by bundle "+aspectId+"; bundle not activated");
+ this.deniedAspects.add(aspectId); // keep for answering the TransformerHook.
+ return false; // NOPE!
+ }
+
+ // DENY from configuration?
+ listEntry = findRequestInList(baseBundleId, singleForcedExportRequest, deniedForcedExports);
+ if (listEntry != null) {
+ log(ILogger.ERROR, "Explicit denial of forced export regarding package "+singleForcedExportRequest+
+ " from bundle "+baseBundleId+" as requested by bundle "+aspectId+"; bundle not activated");
+ this.deniedAspects.add(aspectId); // keep for answering the TransformerHook.
+ return false; // NOPE!
+ }
+
+ // GRANT from configuration?
+ listEntry = findRequestInList(baseBundleId, singleForcedExportRequest, grantedForcedExports);
+ if (listEntry != null) {
+ log(ILogger.INFO, "Forced export granted for "+aspectId+": "+singleForcedExportRequest+" (from bundle "+baseBundleId+")");
+ grantReported = true;
+ grantedForcedExports.remove(listEntry);
+ negotiatedPermission = GRANT;
+ }
+
+ // default and persistent configuration did not DENY, proceed to the negotiators:
+ boolean shouldPersist = false;
+ for (IAspectRequestNegotiator negotiator : this.negotiators) {
+ AspectBindingRequestAnswer answer = negotiator.checkForcedExport(aspectId, baseBundleId, singleForcedExportRequest, negotiatedPermission);
+ if (answer != null) {
+ if (answer.permission.compareTo(negotiatedPermission) > 0) // increasing priority of answer?
+ {
+ shouldPersist = answer.persistent;
+ negotiatedPermission = answer.permission;
+ // locally store as default for subsequent requests (not persistent, see below):
+ if (answer.allRequests)
+ this.defaultForcedExportPermission = negotiatedPermission;
+ if (negotiatedPermission == DENY)
+ break; // end of discussion.
+ }
+ }
+ }
+
+ // make decision persistent?
+ if (shouldPersist && negotiatedPermission != UNDEFINED)
+ // FIXME(SH): handle "allRequests":
+ persistForcedExportsAnswer(aspectId, baseBundleId, singleForcedExportRequest, negotiatedPermission);
+
+ // report:
+ if (negotiatedPermission == GRANT) {
+ if (!grantReported)
+ log(ILogger.INFO, "Negotiation granted forced export for "+aspectId+
+ ": "+singleForcedExportRequest+" (from bundle "+baseBundleId+')');
+ } else {
+ String verb = "did not grant";
+ if (negotiatedPermission == DENY)
+ verb = "denied";
+ log(ILogger.ERROR, "Negotiation "+verb+" forced export for "+aspectId+
+ ": "+singleForcedExportRequest+" (from bundle "+baseBundleId+")"+
+ ". Aspect is not activated.");
+ this.deniedAspects.add(aspectId); // keep for answering the TransformerHook.
+ return false; // don't install illegal aspect
+ }
+ }
+ }
+ if (!grantedForcedExports.isEmpty())
+ reportUnmatchForcedExports(aspectId, grantedForcedExports);
+ return true;
+ }
+
+ /**
+ * Get the forced exports configured for a given aspect bundle with permission <code>perm</code>.
+ * Consult {@link HookConfigurator} and store the result in <code>map</code>.
+ *
+ * @param aspectId symbolic name of the aspect in focus
+ * @param perm are we asking about DENY or GRANT?
+ * @param map in/out param for storing results from OTStorageHook
+ * @return list of pairs (base bundle x base package)
+ */
+ private ArrayList<String[]> getConfiguredForcedExports(String aspectId,
+ AspectPermission perm,
+ HashMap<String, ArrayList<String[]>> map)
+ {
+ ArrayList<String[]> forcedExports= map.get(aspectId);
+ if (forcedExports == null) {
+ // fetch declarations from config.ini or other locations.
+ forcedExports= HookConfigurator.getForcedExportsByAspect(aspectId, perm);
+ map.put(aspectId, forcedExports);
+ }
+ return forcedExports;
+ }
+
+ private String[] findRequestInList(String baseBundleId, String basePackage, ArrayList<String[]> list) {
+ if (list != null)
+ for (String[] singleExport : list)
+ if ( singleExport[0].equals(baseBundleId)
+ && singleExport[1].equals(basePackage))
+ {
+ return singleExport;
+ }
+ return null;
+ }
+
+ /**
+ * If the structure of grantedForcedExports is not empty we have mismatches between forced-export declarations.
+ * Report these mismatches as warnings.
+ */
+ void reportUnmatchForcedExports(String aspectId, ArrayList<String[]> unmatchedForcedExports)
+ {
+ for (String[] export: unmatchedForcedExports) {
+ String baseId = export[0];
+ String pack = export[1];
+ log(ILogger.WARNING, "Aspect "+aspectId+
+ " does not declare forced export of package "+
+ pack+" from bundle "+baseId+
+ " as declared in config.ini (or system property)");
+ }
+ }
+
+ /* Simple strategy to append a forced export to a file (existing or to be created). */
+ private void persistForcedExportsAnswer(String aspectId, String baseBundleId, String basePackage, AspectPermission negotiatedPermission)
+ {
+ if (this.otequinoxState == null) {
+ log(ILogger.ERROR, "Can't persist forcedExports permission, no workspace location accessable.");
+ return;
+ }
+ try {
+ String fileName = (negotiatedPermission == DENY) ? DENIED_FORCED_EXPORTS_FILE : GRANTED_FORCED_EXPORTS_FILE;
+ IPath forcedExportsPath = this.otequinoxState.append(fileName);
+ File forcedExportsFile = new File(forcedExportsPath.toOSString());
+ if (!forcedExportsFile.exists())
+ forcedExportsFile.createNewFile();
+ FileWriter writer = new FileWriter(forcedExportsFile, true); // FIXME(SH): consider merge (after decision about file format)
+ writer.append('\n');
+ writer.append(baseBundleId);
+ writer.append("\n[\n\t");
+ writer.append(basePackage);
+ writer.append(";x-friends:=\"");
+ writer.append(aspectId);
+ writer.append("\"\n]\n");
+ writer.flush();
+ writer.close();
+ } catch (IOException ioe) {
+ log(ioe, "Failed to persist negotiation result");
+ }
+ }
+
+ /**
+ * Check permission for the aspect binding of one specific team.
+ *
+ * Clients should ask {@link #isReady()} (ie., instance location is set) before calling this method,
+ * otherwise workspace settings have to be silently ignored (any error should be signaled by client).
+ *
+ * @param aspectBundleId
+ * @param baseBundleId
+ * @param teamClass
+ * @return whether this team is permitted to adapt classes from the given base bundle.
+ */
+ boolean checkTeamBinding(String aspectBundleId, String baseBundleId, String teamClass)
+ {
+ boolean shouldReportGrant = false; // grant by default should not be reported
+ AspectPermission negotiatedPermission = this.defaultAspectBindingPermission;
+
+ // DENY by default?
+ if (negotiatedPermission == DENY) {
+ log(ILogger.ERROR, "Default denial of aspect binding regarding base bundle "+baseBundleId+
+ " as requested by bundle "+aspectBundleId+"; bundle not activated");
+ this.deniedAspects.add(aspectBundleId); // keep for answering the TransformerHook.
+ return false; // NOPE!
+ }
+
+
+ String key = aspectBundleId+"->"+baseBundleId;
+
+ // denied from configuration?
+ Set<String> deniedTeams = deniedTeamsByAspectBinding.get(key);
+ if (deniedTeams != null && !deniedTeams.isEmpty()) {
+ if (deniedTeams.contains(teamClass)) {
+ deniedAspects.add(aspectBundleId);
+ return false;
+ }
+ }
+
+ // granted from configuration?
+ Set<String> grantedTeams = grantedTeamsByAspectBinding.get(key);
+ if (grantedTeams != null && grantedTeams.contains(teamClass)) {
+ negotiatedPermission = GRANT;
+ shouldReportGrant = true;
+ }
+
+ // default and persistent configuration did not DENY, proceed to the negotiators:
+ boolean shouldPersist = false;
+ for (IAspectRequestNegotiator negotiator : this.negotiators) {
+ AspectBindingRequestAnswer answer = negotiator.checkAspectBinding(aspectBundleId, baseBundleId, teamClass, negotiatedPermission);
+ if (answer != null) {
+ if (answer.permission.compareTo(negotiatedPermission) > 0) // increasing priority of answer?
+ {
+ shouldPersist = answer.persistent;
+ negotiatedPermission = answer.permission;
+ shouldReportGrant = negotiatedPermission == GRANT;
+ // locally store as default for subsequent requests:
+ if (answer.allRequests)
+ this.defaultAspectBindingPermission = negotiatedPermission;
+
+ if (negotiatedPermission == DENY)
+ break; // end of discussion.
+ }
+ }
+ }
+
+ // make decision persistent?
+ if (shouldPersist && negotiatedPermission != UNDEFINED)
+ persistTeamBindingAnswer(aspectBundleId, baseBundleId, teamClass, negotiatedPermission);
+
+ // report:
+ if (negotiatedPermission == GRANT) {
+ if (shouldReportGrant)
+ log(ILogger.INFO, "Negotiation granted aspect binding for "+aspectBundleId+
+ " to base bundle "+baseBundleId+" by means of team "+teamClass+'.');
+ } else {
+ String verb = "did not grant";
+ if (negotiatedPermission == DENY)
+ verb = "denied";
+ log(ILogger.ERROR, "Negotiation "+verb+" aspect binding for "+aspectBundleId+
+ " to base bundle "+baseBundleId+" by means of team "+teamClass+
+ ". Aspect is not activated.");
+ this.deniedAspects.add(aspectBundleId); // keep for answering the TransformerHook.
+ return false; // don't install illegal aspect
+ }
+ return true;
+ }
+
+ private void persistTeamBindingAnswer(String aspectBundleId, String baseBundleId, String teamClass, AspectPermission negotiatedPermission)
+ {
+ // FIXME(SH): implement persisting these!
+ }
+
+ void log (Throwable ex, String msg) {
+ msg = "OT/Equinox: "+msg;
+ this.log.log(Constants.TRANSFORMER_PLUGIN_ID, ex, msg);
+ }
+
+ void log(int status, String msg) {
+ if (status >= TransformerPlugin.WARN_LEVEL)
+ this.log.log(Constants.TRANSFORMER_PLUGIN_ID, status, "OT/Equinox: "+msg);
+ }
+
+ List<Runnable> obligations = new ArrayList<Runnable>();
+ public void addBaseBundleObligations(final List<Object> teamInstances, final ArrayList<TeamClassRecord> teamClasses, final Bundle baseBundle) {
+ schedule(new Runnable() {
+ public void run() {
+ List<TeamClassRecord> teamsToRevert = new ArrayList<TeamClassRecord>();
+ // aspect bindings:
+ for (TeamClassRecord teamClass : teamClasses)
+ if (!checkTeamBinding(teamClass.aspectBundle.getSymbolicName(), baseBundle.getSymbolicName(), teamClass.teamName))
+ teamsToRevert.add(teamClass);
+ if (!teamsToRevert.isEmpty())
+ revert(teamsToRevert);
+ }
+ void revert(List<TeamClassRecord> teamsToRevert) {
+ try {
+ Set<Bundle> bundlesToStop = new HashSet<Bundle>();
+ Class<?>[] deactivationArgumentTypes = new Class[]{Thread.class};
+ Object[] deactivationArguments = new Object[] {TeamClassRecord.get_ALL_THREADS()};
+ for (int i=0, c=0; c< teamsToRevert.size(); c++) {
+ TeamClassRecord teamClass = teamClasses.get(c);
+ if (teamClass.activation != ActivationKind.NONE) {
+ Object teamInstance = teamInstances.get(i++);
+ Method deactivationMethod = teamClass.clazz.getMethod("deactivate", deactivationArgumentTypes);
+ deactivationMethod.invoke(teamInstance, deactivationArguments);
+ // could also check if roles are present already ...
+ }
+ bundlesToStop.add(teamClass.aspectBundle);
+ }
+ for (Bundle bundle : bundlesToStop) {
+ log(ILogger.ERROR, "Stopping aspect bundle "+bundle.getSymbolicName()+" with denied aspect binding(s)");
+ bundle.stop();
+ }
+ } catch (Exception e) {
+ log(e, "Failed to revert aspect bundle with denied aspect bindings.");
+ }
+ }
+ });
+ }
+
+ public void addForcedExportsObligations(final List<AspectBinding> aspects, final Bundle baseBundle) {
+ schedule(new Runnable () {
+ public void run() {
+ for (AspectBinding aspectBinding : aspects)
+ if (!checkForcedExports(aspectBinding.aspectPlugin, baseBundle.getSymbolicName(), aspectBinding.forcedExports))
+ stopIllegalBundle(aspectBinding.aspectPlugin);
+ }
+ });
+ }
+
+ void schedule(Runnable job) {
+ if (isReady()) // became ready since last query?
+ job.run();
+ else
+ synchronized(obligations) {
+ obligations.add(job);
+ }
+ }
+
+ void stopIllegalBundle(String symbolicName) {
+ String msgCore = "stop bundle "+symbolicName+" whose requests for forced exports have been denied";
+ if (this.packageAdmin == null) {
+ log(ILogger.ERROR, "Needing to "+msgCore+" but package admin is not available");
+ } else {
+ Bundle[] bundles = this.packageAdmin.getBundles(symbolicName, null);
+ if (bundles == null)
+ log(ILogger.ERROR, "Needing to "+msgCore+" but bundle cannot be retrieved");
+ else
+ try {
+ bundles[0].stop();
+ } catch (BundleException e) {
+ log(e, "Failed to " + msgCore);
+ }
+ }
+ }
+
+}
diff --git a/plugins/org.eclipse.objectteams.otequinox/src/org/eclipse/objectteams/otequinox/internal/MasterTeamLoader.java b/plugins/org.eclipse.objectteams.otequinox/src/org/eclipse/objectteams/otequinox/internal/MasterTeamLoader.java
new file mode 100644
index 000000000..989a83bb0
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox/src/org/eclipse/objectteams/otequinox/internal/MasterTeamLoader.java
@@ -0,0 +1,292 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: MasterTeamLoader.java 23468 2010-02-04 22:34:27Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otequinox.internal;
+
+import java.io.IOException;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.internal.registry.osgi.OSGIUtils;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.objectteams.otequinox.ActivationKind;
+import org.eclipse.objectteams.otequinox.TransformerPlugin;
+import org.eclipse.osgi.framework.internal.core.BundleHost;
+import org.eclipse.objectteams.otequinox.hook.ClassScanner;
+import org.eclipse.objectteams.otequinox.hook.ILogger;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleException;
+
+/**
+ * Each instance of this class is responsible for loading all teams adapting a specific base plugin.
+ * It stores the team classes loaded successfully.
+ * After team loading a call to instantiateLoadedTeams() shall be issued to instantiate
+ * those teams, but that call pre-assumes that adapted base classes have already been loaded.
+ *
+ * @author stephan
+ * @version $Id: MasterTeamLoader.java 23468 2010-02-04 22:34:27Z stephan $
+ */
+@SuppressWarnings("restriction")
+public class MasterTeamLoader {
+
+ /** A simple record describing a configured and loaded team class: */
+ static class TeamClassRecord {
+ // store these info to check consistency among different aspectBindings mentioning the same team class:
+ static Set<Class<?>> allInstantiatedTeams = new HashSet<Class<?>>();
+ static Map<Class<?>, ActivationKind> allActivations = new HashMap<Class<?>, ActivationKind>();
+
+ /** The bundle providing this team classs. */
+ Bundle aspectBundle;
+ /** The qualified team name. */
+ String teamName;
+ /** The loaded team class. */
+ Class<?> clazz;
+ /** The activation kind which was requested from the extension. */
+ ActivationKind activation;
+ /**
+ * @param clazz the loaded team class
+ * @param activation the activation kind which was requested from the extension
+ */
+ TeamClassRecord(Class<?> clazz, ActivationKind activation) {
+ this.clazz = clazz;
+ this.activation = activation;
+ }
+
+ public TeamClassRecord(Bundle aspectBundle, String teamName, ActivationKind activation) throws Exception {
+ this.activation = activation;
+ this.aspectBundle = aspectBundle;
+ this.teamName = teamName;
+ // enable to revert to early loading:
+ //this.clazz = this.aspectBundle.loadClass(this.teamName);
+ }
+
+ /** Constant from org.objectteams.Team acquired via reflection. */
+ static Thread ALL_THREADS = null;
+
+ /** Retrieve org.objectteams.Team.ALL_THREADS. */
+ static synchronized Thread get_ALL_THREADS()
+ throws Exception
+ {
+ if (ALL_THREADS == null) {
+ Class<?> ooTeam = Class.forName("org.objectteams.Team");
+ Field constantField = ooTeam.getDeclaredField("ALL_THREADS");
+ ALL_THREADS = (Thread)constantField.get(null);
+ }
+ return ALL_THREADS;
+ }
+ void readOTAttributes(ClassScanner scanner)
+ throws Exception, IOException
+ {
+ readOTAttributes(scanner, this.teamName);
+ }
+
+ void readOTAttributes(ClassScanner scanner, String teamName)
+ throws Exception, IOException
+ {
+ TransformerPlugin.getDefault().log(IStatus.OK, "reading attributes of team "+teamName);
+ ClassLoader loader = (ClassLoader) ((BundleHost)aspectBundle).getLoaderProxy().getBundleLoader().createClassLoader();
+ scanner.readOTAttributes(aspectBundle, teamName, loader);
+ Collection<String> baseClassNames = scanner.getCollectedBaseClassNames(teamName);
+ if (baseClassNames != null && !baseClassNames.isEmpty())
+ TransformerPlugin.getDefault().storeAdaptedBaseClassNames(this.aspectBundle.getSymbolicName(), teamName, baseClassNames);
+ }
+
+ public boolean isAlreadyHandled() throws ClassNotFoundException {
+ if (this.clazz == null)
+ this.clazz = this.aspectBundle.loadClass(this.teamName);
+ return allInstantiatedTeams.contains(this.clazz);
+ }
+
+ public Object newInstance() throws Exception {
+ if (this.clazz == null)
+ this.clazz = this.aspectBundle.loadClass(this.teamName);
+ allInstantiatedTeams.add(this.clazz); // do this before accessing the constructor to avoid circularity (see Trac #257).
+ Object newInstance = this.clazz.newInstance();
+ return newInstance;
+ }
+
+ public void markAsActivated() {
+ allActivations.put(this.clazz, this.activation);
+ }
+
+ public ActivationKind getActualActivation() {
+ ActivationKind kind = allActivations.get(this.clazz);
+ if (kind == null)
+ return ActivationKind.NONE;
+ return kind;
+ }
+ }
+
+ Bundle baseBundle;
+
+ /** Team classes waiting for activation. */
+ private List<TeamClassRecord> teamClasses = new ArrayList<TeamClassRecord>();
+
+ private HashMap<Bundle,List<String>> baseBundleToAspectName = new HashMap<Bundle, List<String>>();
+
+ public MasterTeamLoader(Bundle baseBundle) {
+ this.baseBundle = baseBundle;
+ }
+
+ /**
+ * Load all teams adapting baseBundle and the adapted base classes.
+ * TODO(SH): No checks are yet performed, whether the teams found in extensions actually
+ * match the given baseBundle.
+ *
+ * @param baseBundle an adaptable base bundle which was just activated.
+ * @param classScanner helper for reading OT bytecode attributes.
+ * @param bindings declared aspect bindings for this bundle
+ * @return whether or not teams have been loaded successfully
+ */
+ public boolean loadTeams(Bundle baseBundle, ClassScanner classScanner, ArrayList<AspectBinding> bindings)
+ {
+ for (final AspectBinding binding : bindings) {
+ String aspectBundleName = binding.aspectPlugin;
+
+ log(IStatus.OK, ">>> TransformerPlugin loading aspect plugin "+aspectBundleName+" <<<");
+
+ final Bundle aspectBundle = OSGIUtils.getDefault().getBundle(aspectBundleName);
+ if (aspectBundle == null) {
+ Throwable t = new Exception("Aspect bundle "+aspectBundleName+" does not exist.");
+ t.fillInStackTrace();
+ log(t, "Failed to load teams for an aspect plugin.");
+ }
+
+ // load and store the team classes:
+ for (int i = 0; i < binding.teamClasses.length; i++) {
+ try {
+ TeamClassRecord teamClassRecord = new TeamClassRecord(
+ aspectBundle, binding.teamClasses[i],
+ binding.activations[i]
+ );
+ this.teamClasses.add(teamClassRecord);
+ teamClassRecord.readOTAttributes(classScanner); // disable to revert to early loading
+ if (binding.subTeamClasses[i] != null)
+ for (String subTeamName : binding.subTeamClasses[i])
+ teamClassRecord.readOTAttributes(classScanner, subTeamName); // FIXME(SH): really use the same TeamClassRecord??
+
+ } catch (Throwable t) {
+ log(t, "Exception occurred while loading team class"); //$NON-NLS-1$
+ }
+ }
+
+ // store aspectBundleName for PHASE 2:
+ List<String> aspectNames = baseBundleToAspectName.get(baseBundle);
+ if (aspectNames == null)
+ baseBundleToAspectName.put(baseBundle, aspectNames = new ArrayList<String>());
+ aspectNames.add(aspectBundleName);
+ }
+ return !this.teamClasses.isEmpty();
+ }
+
+ /**
+ * Instantiate all team classes loaded before.
+ * Before doing so all adapted base classes have to be loaded, too.
+ *
+ * @pre the AspectPermissionManager should be ready (ie., instance location is set), otherwise
+ * workspace settings have to be ignored (error should be signaled by client).
+ *
+ * @param baseBundle only teams adapting this base bundle should be instantiated
+ * @param triggerClassname loading of this class triggered this instantiation (may be null)
+ * @param permissionManager helper for checking permissions of aspectBinding / forcedExport
+ * @return list of team instances (maybe empty). Null signal that instantiation had to be deferred.
+ */
+ public List<Object> instantiateLoadedTeams(Bundle baseBundle, String triggerClassname, AspectPermissionManager permissionManager)
+ {
+ List<Object> teamInstances = new ArrayList<Object>(this.teamClasses.size());
+
+ // permission checking can be performed now or later, depending on readiness:
+ boolean permissionManagerReady = permissionManager.isReady();
+
+ // ==== check permissions before we start activating:
+ if (permissionManagerReady) { // otherwise we will register pending obligations below.
+ boolean hasDenial = false;
+ for (TeamClassRecord teamClass : this.teamClasses)
+ if (!permissionManager.checkTeamBinding(teamClass.aspectBundle.getSymbolicName(), baseBundle.getSymbolicName(), teamClass.teamName))
+ {
+ hasDenial = true;
+ try {
+ teamClass.aspectBundle.stop();
+ log(ILogger.ERROR, "Stopped bundle "+teamClass.aspectBundle.getSymbolicName()+" which requests unconfirmed aspect binding(s).");
+ } catch (BundleException e) {
+ log(e, "Failed to stop bundle "+teamClass.aspectBundle.getSymbolicName()+" which requests unconfirmed aspect binding(s).");
+ }
+ }
+ if (hasDenial)
+ return teamInstances; // still empty list
+ }
+
+ // ==== instantiate the teams:
+ for (TeamClassRecord teamClass : this.teamClasses) {
+ if (teamClass.activation == ActivationKind.NONE)
+ continue;
+ try {
+ if (teamClass.isAlreadyHandled()) { // previously instantiated due to a different aspectBinding/basePlugin?
+ ActivationKind actualActivation = teamClass.getActualActivation();
+ if ( actualActivation != teamClass.activation
+ && actualActivation != ActivationKind.NONE
+ && teamClass.activation != ActivationKind.NONE)
+ {
+ log(IStatus.WARNING, "Conflicting activation requests in aspect bindings for team class "+teamClass.teamName);
+ }
+ } else {
+ Object newTeam = teamClass.newInstance();
+ teamInstances.add(newTeam);
+
+ Class<?>[] activationArgumentTypes = new Class[0];
+ Object[] activationArguments = null;
+ switch(teamClass.activation) {
+ case ALL_THREADS:
+ activationArgumentTypes = new Class[]{Thread.class};
+ activationArguments = new Object[] {TeamClassRecord.get_ALL_THREADS()};
+ // fall through
+ case THREAD:
+ Method activationMethod = teamClass.clazz.getMethod("activate", activationArgumentTypes);
+ activationMethod.invoke(newTeam, activationArguments);
+ log(IStatus.OK, ">>> instantiated team: "+teamClass.clazz+", activation: "+teamClass.activation+" <<<");
+ teamClass.markAsActivated();
+ break;
+ case NONE:
+ // nothing ;-)
+ }
+ }
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+ }
+ if (!permissionManagerReady)
+ permissionManager.addBaseBundleObligations(teamInstances, new ArrayList<TeamClassRecord>(this.teamClasses), baseBundle);
+ return teamInstances;
+ }
+
+ void log(int status, String msg) {
+ TransformerPlugin.getDefault().log(status, msg);
+ }
+ void log(Throwable t, String msg) {
+ TransformerPlugin.getDefault().log(t, msg);
+ }
+}

Back to the top