Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'target_explorer/plugins')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.core.cdt/src/org/eclipse/tcf/te/core/cdt/CdtUtils.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.core/src/org/eclipse/tcf/te/core/nodes/interfaces/wire/IWireTypeNetwork.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.core/src/org/eclipse/tcf/te/core/properties/PropertyTester.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/delegates/LaunchConfigurationDelegate.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/lm/interfaces/ICommonLaunchAttributes.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/lm/interfaces/IFileTransferLaunchAttributes.java46
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/lm/interfaces/ILaunchContextLaunchAttributes.java48
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/steps/AbstractLaunchStep.java216
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/steps/RemoveLaunchStep.java78
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/steps/iterators/AbstractLaunchStepGroupIterator.java188
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/steps/iterators/LaunchContextIterator.java90
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/editor/AbstractLaunchTabContainerEditorPage.java400
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/handler/EditorHandlerDelegate.java142
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/services/UIService.java76
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/launchcontext/AbstractContextSelectorControl.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/src/org/eclipse/tcf/te/runtime/concurrent/executors/AbstractDelegatingExecutorService.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.persistence/src/org/eclipse/tcf/te/runtime/persistence/delegates/GsonMapPersistenceDelegate.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.persistence/src/org/eclipse/tcf/te/runtime/persistence/interfaces/IPersistenceDelegate.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src/org/eclipse/tcf/te/runtime/services/AbstractServiceManager.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src/org/eclipse/tcf/te/runtime/services/interfaces/IDebugService.java104
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src/org/eclipse/tcf/te/runtime/services/internal/MenuServicePropertyTester.java82
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src/org/eclipse/tcf/te/runtime/services/internal/PropertiesContainerPropertyTester.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.statushandler/src/org/eclipse/tcf/te/runtime/statushandler/StatusHandlerUtil.java236
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/plugin.properties34
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/FullQualifiedId.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/extensions/StepExecutor.java506
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/extensions/StepGroup.java1744
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/interfaces/IStep.java322
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/interfaces/IStepGroupIterator.java106
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/internal/PropertyTester.java128
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/nls/Messages.java138
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/nls/Messages.properties104
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/stepper/Stepper.java1476
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/steps/AbstractStep.java378
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime/src/org/eclipse/tcf/te/runtime/callback/Callback.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime/src/org/eclipse/tcf/te/runtime/nls/Messages.java74
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime/src/org/eclipse/tcf/te/runtime/nls/Messages.properties30
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime/src/org/eclipse/tcf/te/runtime/processes/ProcessOutputReaderThread.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime/src/org/eclipse/tcf/te/runtime/tracing/TraceHandler.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.core/plugin.properties48
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/activator/CoreBundleActivator.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/internal/ChannelManager.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/internal/Startup.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/nls/Messages.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/nls/Messages.properties2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/steps/CloseChannelStep.java106
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/steps/OpenChannelStep.java142
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/streams/StreamsDataReceiver.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/va/AbstractExternalValueAdd.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/va/ValueAddLauncher.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/plugin.properties28
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/interfaces/steps/IFileSystemStepAttributes.java52
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/steps/FileTransferStep.java158
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/controls/FSTreeViewerSorter.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/controls/TreeContentProvider.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/handlers/EditorHandlerDelegate.java110
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/wizards/TargetPatternFilter.java114
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/services/UIService.java76
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/OSGI-INF/l10n/bundle.properties11
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/about.properties3
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/build.properties9
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/activator/Activator.java9
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/launching/TERunLaunchDelegate.java9
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/plugin.properties58
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/interfaces/steps/ITcfLaunchStepAttributes.java52
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/internal/adapters/AdapterFactory.java242
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/internal/adapters/LaunchStepContext.java202
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/lm/delegates/AttachLaunchManagerDelegate.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/lm/delegates/RemoteAppLaunchManagerDelegate.java662
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/nls/Messages.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/steps/AbstractTcfLaunchStep.java90
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/steps/AttachDebuggerStep.java130
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/steps/iterators/AbstractTcfLaunchStepGroupIterator.java92
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/steps/iterators/FileTransferIterator.java108
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/steps/iterators/LaunchProcessIterator.java140
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/plugin.properties2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/activator/UIPlugin.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/AbstractTcfLaunchTabContainerEditorPage.java568
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/tabs/MemoryMapTab.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/tabs/PathMapTab.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/tabs/TableUtils.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/filetransfer/AddEditFileTransferDialog.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/internal/services/DebugService.java382
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/nls/Messages.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/nls/Messages.properties2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/LaunchConfigurationMainTabSection.java574
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/RemoteAppPropertiesSection.java164
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/plugin.properties42
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/Scanner.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/IModelListener.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/IScanner.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/ITracing.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/nodes/ILocatorModel.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/nodes/IPeerModelProperties.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/services/ILocatorModelLookupService.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/LocatorModelPropertyTester.java474
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/adapters/AdapterFactory.java240
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/listener/LocatorListener.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/listener/ModelAdapter.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/nls/Messages.java144
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/nls/Messages.properties22
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/nodes/LocatorModel.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/nodes/PeerModel.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/LocatorModelLookupService.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/LocatorModelPeerNodeQueryService.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/CheckServiceStep.java212
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.log.core/src/org/eclipse/tcf/te/tcf/log/core/internal/nls/Messages.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/plugin.properties30
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/interfaces/launcher/IProcessLauncher.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/interfaces/steps/IProcessesStepAttributes.java134
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/interfaces/tracing/ITraceIds.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/interfaces/IProcessContextNodeProperties.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/RuntimeModel.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/services/RuntimeModelChannelService.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/services/RuntimeModelLookupService.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/services/RuntimeModelRefreshService.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/services/RuntimeModelUpdateService.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/steps/AttachStep.java414
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/steps/LaunchProcessStep.java354
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/steps/ResumeProcessStep.java234
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/plugin.properties2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/handler/AttachHandler.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/handler/ConfigIntervalDynamicContribution.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/handler/EditorHandlerDelegate.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/services/UIService.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.terminals.ui/src/org/eclipse/tcf/te/tcf/terminals/ui/launcher/TerminalsLauncherDelegate.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/help/IContextHelpIds.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/nls/Messages.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/scriptpad/actions/PeerAction.java128
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/scriptpad/actions/PlayAction.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/plugin.properties150
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/activator/UIPlugin.java560
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/controls/CustomTransportPanel.java540
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/controls/PeerNameControl.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/controls/PipeTransportPanel.java540
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/controls/TcpTransportPanel.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/controls/TransportTypeControl.java288
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/OverviewEditorPage.java474
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/controls/InfoSectionPeerNameControl.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/controls/TransportSectionTypeControl.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/sections/GeneralInformationSection.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/sections/TransportSection.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/AbstractPeerModelEditorHandlerDelegate.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/RefreshHandler.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/StartDebugCommandHandler.java212
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/PropertyTester.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/adapters/PeerModelFactory.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/preferences/IPreferenceKeys.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/preferences/PreferencesInitializer.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/tabbed/PeerGeneralSectionContentProvider.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/DelegatingLabelProvider.java576
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/ModelListener.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/nls/Messages.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/NewTargetWizard.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/NewTargetWizardPage.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/concurrent/ConcurrentTestCase.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/stepper/StepperTests.java592
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/stepper/steps/ParameterizedTestStep.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/stepper/steps/TestStep.java82
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/suites/AllTests.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/tcf/TcfTestCase.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/tcf/launch/TcfLaunchTests.java286
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/BaseControl.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/BaseEditBrowseTextControl.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/BaseWizardConfigurationPanelControl.java506
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/file/FileSelectionControl.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/net/RemoteHostPortControl.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/nls/Messages.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/nls/Messages.properties2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/validator/HexValidator.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/validator/NameOrIPValidator.java292
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/validator/NameOrIPVerifyListener.java146
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/validator/NumberValidator.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/validator/PortNumberValidator.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/validator/RegexValidator.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/wire/network/NetworkAddressControl.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/wire/network/NetworkCablePanel.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/wire/serial/SerialPortAddressDialog.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.forms/src/org/eclipse/tcf/te/ui/forms/CustomFormToolkit.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.forms/src/org/eclipse/tcf/te/ui/forms/interfaces/tracing/ITraceIds.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.forms/src/org/eclipse/tcf/te/ui/forms/parts/AbstractSection.java858
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.forms/src/org/eclipse/tcf/te/ui/forms/parts/AbstractTableSection.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.forms/src/org/eclipse/tcf/te/ui/forms/parts/AbstractTreeSection.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.forms/src/org/eclipse/tcf/te/ui/forms/parts/TablePart.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.swt/src/org/eclipse/tcf/te/ui/jface/dialogs/CustomTrayDialog.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.swt/src/org/eclipse/tcf/te/ui/jface/images/AbstractImageDescriptor.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.swt/src/org/eclipse/tcf/te/ui/jface/interfaces/IValidatingContainer.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.swt/src/org/eclipse/tcf/te/ui/swt/SWTControlUtil.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.terminals.process/src/org/eclipse/tcf/te/ui/terminals/process/ProcessConnectorType.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.terminals.process/src/org/eclipse/tcf/te/ui/terminals/process/ProcessSettings.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/actions/AbstractAction.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/activator/UIPlugin.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/help/IContextHelpIds.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/interfaces/ILauncherDelegate.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/interfaces/ImageConsts.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/interfaces/tracing/ITraceIds.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/internal/dialogs/EncodingSelectionDialog.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/internal/handler/LaunchTerminalCommandHandler.java316
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/launcher/LauncherDelegateManager.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/streams/AbstractStreamsConnector.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/streams/OutputStreamMonitor.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/streams/StreamsConnector.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/tabs/TabFolderMenuHandler.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views/plugin.properties178
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/actions/NewActionProvider.java318
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/activator/UIPlugin.java352
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/categories/Category.java418
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/editor/Editor.java1060
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/editor/EditorEventListener.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/editor/EditorInput.java388
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/editor/controls/ButtonPanelControl.java398
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/editor/pages/AbstractCustomFormToolkitEditorPage.java682
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/editor/pages/AbstractEditorPage.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/editor/pages/TreeViewerExplorerEditorPage.java1014
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/events/AbstractEventListener.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/events/ViewerContentChangeEvent.java168
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/expressions/PropertyTester.java96
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/expressions/SelectionSourceProvider.java414
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/extensions/EditorPageBindingExtensionPointManager.java388
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/extensions/EditorPageExtensionPointManager.java204
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/extensions/LabelProviderDelegateExtensionPointManager.java262
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/handler/FilterMRUContribution.java216
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/handler/NewWizardHandler.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/handler/OpenEditorHandler.java226
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/handler/ShowInSystemManagementHandler.java230
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/interfaces/ICategory.java112
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/interfaces/IEditorPage.java40
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/interfaces/IEditorSaveAsAdapter.java68
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/interfaces/IRoot.java38
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/interfaces/IUIConstants.java120
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/interfaces/ImageConsts.java140
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/interfaces/categories/ICategoryManager.java180
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/internal/View.java510
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/internal/ViewViewer.java306
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/internal/adapters/EditorAdapterFactory.java114
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/internal/categories/AbstractCategoryContributionItem.java610
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/internal/categories/CategoryFactory.java98
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/internal/categories/CategoryManager.java728
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/internal/categories/CategoryPropertyTester.java352
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/internal/preferences/IPreferenceKeys.java100
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/internal/preferences/PreferencesInitializer.java92
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/internal/quickfilter/EditorQuickFilterTester.java128
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/internal/services/MenuService.java78
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/listeners/WorkbenchWindowListener.java72
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/navigator/LabelProviderDelegate.java100
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/navigator/ViewerContentProvider.java252
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/navigator/nodes/NewWizardNode.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/nls/Messages.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/nls/Messages.properties2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/perspective/PerspectiveFactory.java154
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui/plugin.properties130
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/activator/UIPlugin.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/dialogs/NameValuePairDialog.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/dialogs/RenameDialog.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/events/AbstractEventListener.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/help/IContextHelpIds.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/interfaces/ImageConsts.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/interfaces/handler/IDeleteHandlerDelegate.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/interfaces/handler/IEditorHandlerDelegate.java66
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/internal/utils/TablePatternFilter.java248
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/internal/utils/TreeViewerSearchDialog.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/nls/Messages.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/nls/Messages.properties2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/tables/properties/NodePropertiesTableControl.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/trees/ColumnDescriptor.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/trees/Pending.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/trees/TreeViewerEditorActivationStrategy.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/trees/TreeViewerExtension.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/trees/TreeViewerHeaderMenu.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/trees/TreeViewerSorter.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/utils/StringMatcher.java986
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/wizards/AbstractWizard.java240
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/wizards/newWizard/NewWizardCommandHandler.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/wizards/newWizard/NewWizardSelectionPage.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/wizards/pages/AbstractFormsWizardPage.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te/build.properties9
276 files changed, 16680 insertions, 16634 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.core.cdt/src/org/eclipse/tcf/te/core/cdt/CdtUtils.java b/target_explorer/plugins/org.eclipse.tcf.te.core.cdt/src/org/eclipse/tcf/te/core/cdt/CdtUtils.java
index 2eaf96d58..9b312ff9d 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.core.cdt/src/org/eclipse/tcf/te/core/cdt/CdtUtils.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.core.cdt/src/org/eclipse/tcf/te/core/cdt/CdtUtils.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Wind River Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2012, 2013 Wind River Systems, Inc. and others. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.core/src/org/eclipse/tcf/te/core/nodes/interfaces/wire/IWireTypeNetwork.java b/target_explorer/plugins/org.eclipse.tcf.te.core/src/org/eclipse/tcf/te/core/nodes/interfaces/wire/IWireTypeNetwork.java
index 49e1ec9c5..2d47313c9 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.core/src/org/eclipse/tcf/te/core/nodes/interfaces/wire/IWireTypeNetwork.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.core/src/org/eclipse/tcf/te/core/nodes/interfaces/wire/IWireTypeNetwork.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Wind River Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2012, 2013 Wind River Systems, Inc. and others. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.core/src/org/eclipse/tcf/te/core/properties/PropertyTester.java b/target_explorer/plugins/org.eclipse.tcf.te.core/src/org/eclipse/tcf/te/core/properties/PropertyTester.java
index 2deda64ef..42c4e97db 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.core/src/org/eclipse/tcf/te/core/properties/PropertyTester.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.core/src/org/eclipse/tcf/te/core/properties/PropertyTester.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011 Wind River Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2011, 2013 Wind River Systems, Inc. and others. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/delegates/LaunchConfigurationDelegate.java b/target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/delegates/LaunchConfigurationDelegate.java
index 7eab7db2f..2f42f7603 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/delegates/LaunchConfigurationDelegate.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/delegates/LaunchConfigurationDelegate.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Wind River Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2012, 2013 Wind River Systems, Inc. and others. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/lm/interfaces/ICommonLaunchAttributes.java b/target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/lm/interfaces/ICommonLaunchAttributes.java
index 3ae25a61f..ca67f2af2 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/lm/interfaces/ICommonLaunchAttributes.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/lm/interfaces/ICommonLaunchAttributes.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Wind River Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2012, 2013 Wind River Systems, Inc. and others. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/lm/interfaces/IFileTransferLaunchAttributes.java b/target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/lm/interfaces/IFileTransferLaunchAttributes.java
index 163fb8f76..f7e027152 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/lm/interfaces/IFileTransferLaunchAttributes.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/lm/interfaces/IFileTransferLaunchAttributes.java
@@ -1,23 +1,23 @@
-/*******************************************************************************
- * Copyright (c) 2012 Wind River Systems, Inc. and others. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.tcf.te.launch.core.lm.interfaces;
-
-/**
- * Defines the launch configuration attribute id's to access the launch step contexts.
- */
-public interface IFileTransferLaunchAttributes {
-
- /**
- * Launch configuration attribute: The file transfer items the launch is operating with. Use
- * {@link FileTransferPersistanceDelegate} to access
- * this attribute within a launch configuration.
- */
- public static final String ATTR_FILE_TRANSFERS = ICommonLaunchAttributes.ATTR_PREFIX + ".file_transfers"; //$NON-NLS-1$
-}
+/*******************************************************************************
+ * Copyright (c) 2012, 2013 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.launch.core.lm.interfaces;
+
+/**
+ * Defines the launch configuration attribute id's to access the launch step contexts.
+ */
+public interface IFileTransferLaunchAttributes {
+
+ /**
+ * Launch configuration attribute: The file transfer items the launch is operating with. Use
+ * {@link FileTransferPersistanceDelegate} to access
+ * this attribute within a launch configuration.
+ */
+ public static final String ATTR_FILE_TRANSFERS = ICommonLaunchAttributes.ATTR_PREFIX + ".file_transfers"; //$NON-NLS-1$
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/lm/interfaces/ILaunchContextLaunchAttributes.java b/target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/lm/interfaces/ILaunchContextLaunchAttributes.java
index ef5fba737..8eddee6ec 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/lm/interfaces/ILaunchContextLaunchAttributes.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/lm/interfaces/ILaunchContextLaunchAttributes.java
@@ -1,24 +1,24 @@
-/*******************************************************************************
- * Copyright (c) 2012 Wind River Systems, Inc. and others. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.tcf.te.launch.core.lm.interfaces;
-
-/**
- * Defines the launch configuration attribute id's to access the launch step contexts.
- */
-public interface ILaunchContextLaunchAttributes {
-
- /**
- * Launch configuration attribute: The launch contexts the launch is operating with. Use
- * {@link ContextSelectorPersistanceDelegate} to access
- * this attribute within a launch configuration.
- */
- public static final String ATTR_LAUNCH_CONTEXTS = ICommonLaunchAttributes.ATTR_PREFIX + ".launch_contexts"; //$NON-NLS-1$
-
-}
+/*******************************************************************************
+ * Copyright (c) 2012, 2013 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.launch.core.lm.interfaces;
+
+/**
+ * Defines the launch configuration attribute id's to access the launch step contexts.
+ */
+public interface ILaunchContextLaunchAttributes {
+
+ /**
+ * Launch configuration attribute: The launch contexts the launch is operating with. Use
+ * {@link ContextSelectorPersistanceDelegate} to access
+ * this attribute within a launch configuration.
+ */
+ public static final String ATTR_LAUNCH_CONTEXTS = ICommonLaunchAttributes.ATTR_PREFIX + ".launch_contexts"; //$NON-NLS-1$
+
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/steps/AbstractLaunchStep.java b/target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/steps/AbstractLaunchStep.java
index 2ba6e64a6..97cf1dfe0 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/steps/AbstractLaunchStep.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/steps/AbstractLaunchStep.java
@@ -1,108 +1,108 @@
-/*******************************************************************************
- * Copyright (c) 2012 Wind River Systems, Inc. and others. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.tcf.te.launch.core.steps;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-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.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationType;
-import org.eclipse.tcf.te.launch.core.activator.CoreBundleActivator;
-import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
-import org.eclipse.tcf.te.runtime.model.interfaces.IModelNode;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
-import org.eclipse.tcf.te.runtime.stepper.steps.AbstractStep;
-
-/**
- * Abstract launch step implementation.
- */
-public abstract class AbstractLaunchStep extends AbstractStep {
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IExtendedStep#validateExecute(org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor)
- */
- @Override
- public void validateExecute(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor) throws CoreException {
- if (getLaunch(context) == null) {
- throw new CoreException(new Status(IStatus.ERROR, CoreBundleActivator.getUniqueIdentifier(), "missing launch context")); //$NON-NLS-1$
- }
- }
-
- /**
- * Returns the launch object for the given step context.
- *
- * @param context The step context.
- * @return The launch or <code>null</code>.
- */
- protected ILaunch getLaunch(IStepContext context) {
- Assert.isNotNull(context);
- return (ILaunch)context.getAdapter(ILaunch.class);
- }
-
- /**
- * Returns the launch configuration for the given step context.
- *
- * @param context The step context.
- * @return The launch configuration or <code>null</code>.
- */
- protected ILaunchConfiguration getLaunchConfiguration(IStepContext context) {
- Assert.isNotNull(context);
- return (ILaunchConfiguration)context.getAdapter(ILaunchConfiguration.class);
- }
-
- /**
- * Returns the launch configuration type for the given step context.
- *
- * @param context The step context.
- * @return The launch configuration type or <code>null</code>.
- */
- protected ILaunchConfigurationType getLaunchConfigurationType(IStepContext context) {
- Assert.isNotNull(context);
- return (ILaunchConfigurationType)context.getAdapter(ILaunchConfigurationType.class);
- }
-
- /**
- * Returns the current launch mode.
- *
- * @param context The step context.
- * @return The launch mode or <code>null</code>.
- */
- protected String getLaunchMode(IStepContext context) {
- ILaunch launch = getLaunch(context);
- return launch != null ? launch.getLaunchMode() : null;
- }
-
- /**
- * Returns the active model node context that is currently used.
- *
- * @param context The step context. Must not be <code>null</code>.
- * @param data The data giving object. Must not be <code>null</code>.
- * @param fullQualifiedId The full qualfied id for this step. Must not be <code>null</code>.
- * @return The active model node context.
- */
- protected IModelNode getActiveModelNodeContext(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId) {
- Object activeContext = getActiveContext(context, data, fullQualifiedId);
- IModelNode modelNode = null;
- if (activeContext instanceof IModelNode)
- return (IModelNode)activeContext;
- if (activeContext instanceof IAdaptable)
- modelNode = (IModelNode)((IAdaptable)activeContext).getAdapter(IModelNode.class);
- if (modelNode == null)
- modelNode = (IModelNode)Platform.getAdapterManager().getAdapter(activeContext, IModelNode.class);
-
- return modelNode;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2012, 2013 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.launch.core.steps;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+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.debug.core.ILaunch;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationType;
+import org.eclipse.tcf.te.launch.core.activator.CoreBundleActivator;
+import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
+import org.eclipse.tcf.te.runtime.model.interfaces.IModelNode;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
+import org.eclipse.tcf.te.runtime.stepper.steps.AbstractStep;
+
+/**
+ * Abstract launch step implementation.
+ */
+public abstract class AbstractLaunchStep extends AbstractStep {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IExtendedStep#validateExecute(org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ public void validateExecute(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor) throws CoreException {
+ if (getLaunch(context) == null) {
+ throw new CoreException(new Status(IStatus.ERROR, CoreBundleActivator.getUniqueIdentifier(), "missing launch context")); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Returns the launch object for the given step context.
+ *
+ * @param context The step context.
+ * @return The launch or <code>null</code>.
+ */
+ protected ILaunch getLaunch(IStepContext context) {
+ Assert.isNotNull(context);
+ return (ILaunch)context.getAdapter(ILaunch.class);
+ }
+
+ /**
+ * Returns the launch configuration for the given step context.
+ *
+ * @param context The step context.
+ * @return The launch configuration or <code>null</code>.
+ */
+ protected ILaunchConfiguration getLaunchConfiguration(IStepContext context) {
+ Assert.isNotNull(context);
+ return (ILaunchConfiguration)context.getAdapter(ILaunchConfiguration.class);
+ }
+
+ /**
+ * Returns the launch configuration type for the given step context.
+ *
+ * @param context The step context.
+ * @return The launch configuration type or <code>null</code>.
+ */
+ protected ILaunchConfigurationType getLaunchConfigurationType(IStepContext context) {
+ Assert.isNotNull(context);
+ return (ILaunchConfigurationType)context.getAdapter(ILaunchConfigurationType.class);
+ }
+
+ /**
+ * Returns the current launch mode.
+ *
+ * @param context The step context.
+ * @return The launch mode or <code>null</code>.
+ */
+ protected String getLaunchMode(IStepContext context) {
+ ILaunch launch = getLaunch(context);
+ return launch != null ? launch.getLaunchMode() : null;
+ }
+
+ /**
+ * Returns the active model node context that is currently used.
+ *
+ * @param context The step context. Must not be <code>null</code>.
+ * @param data The data giving object. Must not be <code>null</code>.
+ * @param fullQualifiedId The full qualfied id for this step. Must not be <code>null</code>.
+ * @return The active model node context.
+ */
+ protected IModelNode getActiveModelNodeContext(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId) {
+ Object activeContext = getActiveContext(context, data, fullQualifiedId);
+ IModelNode modelNode = null;
+ if (activeContext instanceof IModelNode)
+ return (IModelNode)activeContext;
+ if (activeContext instanceof IAdaptable)
+ modelNode = (IModelNode)((IAdaptable)activeContext).getAdapter(IModelNode.class);
+ if (modelNode == null)
+ modelNode = (IModelNode)Platform.getAdapterManager().getAdapter(activeContext, IModelNode.class);
+
+ return modelNode;
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/steps/RemoveLaunchStep.java b/target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/steps/RemoveLaunchStep.java
index 3f5d7ffa2..54564cb67 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/steps/RemoveLaunchStep.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/steps/RemoveLaunchStep.java
@@ -1,39 +1,39 @@
-/*******************************************************************************
- * Copyright (c) 2012 Wind River Systems, Inc. and others. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.tcf.te.launch.core.steps;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
-import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
-
-/**
- * Remove launch step implementation.
- */
-public class RemoveLaunchStep extends AbstractLaunchStep {
-
- /**
- * Constructor.
- */
- public RemoveLaunchStep() {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStep#execute(org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor, org.eclipse.tcf.te.runtime.interfaces.callback.ICallback)
- */
- @Override
- public void execute(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor, ICallback callback) {
- DebugPlugin.getDefault().getLaunchManager().removeLaunch(getLaunch(context));
- callback.done(this, Status.OK_STATUS);
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2012, 2013 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.launch.core.steps;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
+import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
+
+/**
+ * Remove launch step implementation.
+ */
+public class RemoveLaunchStep extends AbstractLaunchStep {
+
+ /**
+ * Constructor.
+ */
+ public RemoveLaunchStep() {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStep#execute(org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor, org.eclipse.tcf.te.runtime.interfaces.callback.ICallback)
+ */
+ @Override
+ public void execute(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor, ICallback callback) {
+ DebugPlugin.getDefault().getLaunchManager().removeLaunch(getLaunch(context));
+ callback.done(this, Status.OK_STATUS);
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/steps/iterators/AbstractLaunchStepGroupIterator.java b/target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/steps/iterators/AbstractLaunchStepGroupIterator.java
index 8f574e1f6..4ca43c070 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/steps/iterators/AbstractLaunchStepGroupIterator.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/steps/iterators/AbstractLaunchStepGroupIterator.java
@@ -1,94 +1,94 @@
-/*******************************************************************************
- * Copyright (c) 2012 Wind River Systems, Inc. and others. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tcf.te.launch.core.steps.iterators;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationType;
-import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
-import org.eclipse.tcf.te.runtime.model.interfaces.IModelNode;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
-import org.eclipse.tcf.te.runtime.stepper.iterators.AbstractStepGroupIterator;
-
-/**
- * Abstract launch stepgroup iterator.
- */
-public abstract class AbstractLaunchStepGroupIterator extends AbstractStepGroupIterator {
-
- /**
- * Returns the launch object for the given step context.
- *
- * @param context The step context.
- * @return The launch or <code>null</code>.
- */
- protected ILaunch getLaunch(IStepContext context) {
- Assert.isNotNull(context);
- return (ILaunch)context.getAdapter(ILaunch.class);
- }
-
- /**
- * Returns the launch configuration for the given step context.
- *
- * @param context The step context.
- * @return The launch configuration or <code>null</code>.
- */
- protected ILaunchConfiguration getLaunchConfiguration(IStepContext context) {
- Assert.isNotNull(context);
- return (ILaunchConfiguration)context.getAdapter(ILaunchConfiguration.class);
- }
-
- /**
- * Returns the launch configuration type for the given step context.
- *
- * @param context The step context.
- * @return The launch configuration type or <code>null</code>.
- */
- protected ILaunchConfigurationType getLaunchConfigurationType(IStepContext context) {
- Assert.isNotNull(context);
- return (ILaunchConfigurationType)context.getAdapter(ILaunchConfigurationType.class);
- }
-
- /**
- * Returns the current launch mode.
- *
- * @param context The step context.
- * @return The launch mode or <code>null</code>.
- */
- protected String getLaunchMode(IStepContext context) {
- ILaunch launch = getLaunch(context);
- return launch != null ? launch.getLaunchMode() : null;
- }
-
- /**
- * Returns the active model node context that is currently used.
- *
- * @param context The step context. Must not be <code>null</code>.
- * @param data The data giving object. Must not be <code>null</code>.
- * @param fullQualifiedId The full qualfied id for this step. Must not be <code>null</code>.
- * @return The active model node context.
- */
- protected IModelNode getActiveModelNodeContext(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId) {
- Object activeContext = getActiveContext(context, data, fullQualifiedId);
- IModelNode modelNode = null;
- if (activeContext instanceof IModelNode)
- return (IModelNode)activeContext;
- if (activeContext instanceof IAdaptable)
- modelNode = (IModelNode)((IAdaptable)activeContext).getAdapter(IModelNode.class);
- if (modelNode == null)
- modelNode = (IModelNode)Platform.getAdapterManager().getAdapter(activeContext, IModelNode.class);
-
- return modelNode;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2012, 2013 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.tcf.te.launch.core.steps.iterators;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationType;
+import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
+import org.eclipse.tcf.te.runtime.model.interfaces.IModelNode;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
+import org.eclipse.tcf.te.runtime.stepper.iterators.AbstractStepGroupIterator;
+
+/**
+ * Abstract launch stepgroup iterator.
+ */
+public abstract class AbstractLaunchStepGroupIterator extends AbstractStepGroupIterator {
+
+ /**
+ * Returns the launch object for the given step context.
+ *
+ * @param context The step context.
+ * @return The launch or <code>null</code>.
+ */
+ protected ILaunch getLaunch(IStepContext context) {
+ Assert.isNotNull(context);
+ return (ILaunch)context.getAdapter(ILaunch.class);
+ }
+
+ /**
+ * Returns the launch configuration for the given step context.
+ *
+ * @param context The step context.
+ * @return The launch configuration or <code>null</code>.
+ */
+ protected ILaunchConfiguration getLaunchConfiguration(IStepContext context) {
+ Assert.isNotNull(context);
+ return (ILaunchConfiguration)context.getAdapter(ILaunchConfiguration.class);
+ }
+
+ /**
+ * Returns the launch configuration type for the given step context.
+ *
+ * @param context The step context.
+ * @return The launch configuration type or <code>null</code>.
+ */
+ protected ILaunchConfigurationType getLaunchConfigurationType(IStepContext context) {
+ Assert.isNotNull(context);
+ return (ILaunchConfigurationType)context.getAdapter(ILaunchConfigurationType.class);
+ }
+
+ /**
+ * Returns the current launch mode.
+ *
+ * @param context The step context.
+ * @return The launch mode or <code>null</code>.
+ */
+ protected String getLaunchMode(IStepContext context) {
+ ILaunch launch = getLaunch(context);
+ return launch != null ? launch.getLaunchMode() : null;
+ }
+
+ /**
+ * Returns the active model node context that is currently used.
+ *
+ * @param context The step context. Must not be <code>null</code>.
+ * @param data The data giving object. Must not be <code>null</code>.
+ * @param fullQualifiedId The full qualfied id for this step. Must not be <code>null</code>.
+ * @return The active model node context.
+ */
+ protected IModelNode getActiveModelNodeContext(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId) {
+ Object activeContext = getActiveContext(context, data, fullQualifiedId);
+ IModelNode modelNode = null;
+ if (activeContext instanceof IModelNode)
+ return (IModelNode)activeContext;
+ if (activeContext instanceof IAdaptable)
+ modelNode = (IModelNode)((IAdaptable)activeContext).getAdapter(IModelNode.class);
+ if (modelNode == null)
+ modelNode = (IModelNode)Platform.getAdapterManager().getAdapter(activeContext, IModelNode.class);
+
+ return modelNode;
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/steps/iterators/LaunchContextIterator.java b/target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/steps/iterators/LaunchContextIterator.java
index 060b01053..aca87d22f 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/steps/iterators/LaunchContextIterator.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/steps/iterators/LaunchContextIterator.java
@@ -1,45 +1,45 @@
-/*******************************************************************************
- * Copyright (c) 2012 Wind River Systems, Inc. and others. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tcf.te.launch.core.steps.iterators;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.tcf.te.launch.core.persistence.launchcontext.LaunchContextsPersistenceDelegate;
-import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
-import org.eclipse.tcf.te.runtime.model.interfaces.IModelNode;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
-
-/**
- * LaunchContextIterator
- */
-public class LaunchContextIterator extends AbstractLaunchStepGroupIterator {
-
- private IModelNode[] contexts = null;
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStepGroupIterator#initialize(org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor)
- */
- @Override
- public void initialize(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor) throws CoreException {
- super.initialize(context, data, fullQualifiedId, monitor);
- contexts = LaunchContextsPersistenceDelegate.getLaunchContexts(getLaunchConfiguration(context));
- setIterations(contexts != null ? contexts.length : 0);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.stepper.iterators.AbstractStepGroupIterator#internalNext(org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor)
- */
- @Override
- public void internalNext(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor) throws CoreException {
- setActiveContext(contexts[getIteration()], data, fullQualifiedId);
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2012, 2013 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.tcf.te.launch.core.steps.iterators;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.tcf.te.launch.core.persistence.launchcontext.LaunchContextsPersistenceDelegate;
+import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
+import org.eclipse.tcf.te.runtime.model.interfaces.IModelNode;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
+
+/**
+ * LaunchContextIterator
+ */
+public class LaunchContextIterator extends AbstractLaunchStepGroupIterator {
+
+ private IModelNode[] contexts = null;
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStepGroupIterator#initialize(org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ public void initialize(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor) throws CoreException {
+ super.initialize(context, data, fullQualifiedId, monitor);
+ contexts = LaunchContextsPersistenceDelegate.getLaunchContexts(getLaunchConfiguration(context));
+ setIterations(contexts != null ? contexts.length : 0);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.stepper.iterators.AbstractStepGroupIterator#internalNext(org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ public void internalNext(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor) throws CoreException {
+ setActiveContext(contexts[getIteration()], data, fullQualifiedId);
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/editor/AbstractLaunchTabContainerEditorPage.java b/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/editor/AbstractLaunchTabContainerEditorPage.java
index e8a6af559..af1f3c0bd 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/editor/AbstractLaunchTabContainerEditorPage.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/editor/AbstractLaunchTabContainerEditorPage.java
@@ -1,200 +1,200 @@
-/*******************************************************************************
- * Copyright (c) 2012 Wind River Systems, Inc. and others. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.tcf.te.launch.ui.editor;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.tcf.te.launch.ui.tabs.AbstractFormsLaunchConfigurationTab;
-import org.eclipse.tcf.te.ui.forms.CustomFormToolkit;
-import org.eclipse.tcf.te.ui.views.editor.pages.AbstractCustomFormToolkitEditorPage;
-import org.eclipse.ui.forms.AbstractFormPart;
-
-/**
- * Abstract editor page implementation serving as container for a launch tab.
- */
-public abstract class AbstractLaunchTabContainerEditorPage extends AbstractCustomFormToolkitEditorPage {
- // Reference to the launch configuration tab
- private final AbstractLaunchConfigurationTab launchTab;
-
- boolean isDirty = false;
-
- /**
- * Constructor.
- */
- public AbstractLaunchTabContainerEditorPage() {
- super();
-
- // Create the launch configuration tab instance
- launchTab = createLaunchConfigurationTab();
- Assert.isNotNull(launchTab);
- }
-
- /**
- * Creates a new instance of the launch configuration tab to associate.
- *
- * @return The new launch configuration tab instance.
- */
- protected abstract AbstractLaunchConfigurationTab createLaunchConfigurationTab();
-
- /**
- * Returns the associated launch configuration tab.
- *
- * @return The launch configuration tab or <code>null</code>.
- */
- protected final AbstractLaunchConfigurationTab getLaunchConfigurationTab() {
- return launchTab;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.views.editor.pages.AbstractCustomFormToolkitEditorPage#dispose()
- */
- @Override
- public void dispose() {
- launchTab.dispose();
- super.dispose();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.views.editor.pages.AbstractCustomFormToolkitEditorPage#hasApplyAction()
- */
- @Override
- protected boolean hasApplyAction() {
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.views.editor.pages.AbstractCustomFormToolkitEditorPage#getContextHelpId()
- */
- @Override
- protected String getContextHelpId() {
- return launchTab.getHelpContextId();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.views.editor.pages.AbstractCustomFormToolkitEditorPage#getFormTitle()
- */
- @Override
- protected String getFormTitle() {
- return launchTab.getName();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.views.editor.pages.AbstractCustomFormToolkitEditorPage#getFormImage()
- */
- @Override
- protected Image getFormImage() {
- return launchTab.getImage();
- }
-
- /**
- * Set the dirty state for this editor page.
- * @param dirty The dirty state.
- */
- public void setDirty(boolean dirty) {
- isDirty = dirty;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.views.editor.pages.AbstractCustomFormToolkitEditorPage#doCreateFormContent(org.eclipse.swt.widgets.Composite, org.eclipse.tcf.te.ui.forms.CustomFormToolkit)
- */
- @Override
- protected void doCreateFormContent(Composite parent, CustomFormToolkit toolkit) {
- Assert.isNotNull(parent);
- Assert.isNotNull(toolkit);
-
- // Create the launch tab content
- if (launchTab instanceof AbstractFormsLaunchConfigurationTab) {
- ((AbstractFormsLaunchConfigurationTab)launchTab).createFormContent(getManagedForm());
- } else {
- launchTab.createControl(parent);
- }
-
- getManagedForm().addPart(new AbstractFormPart() {
- @Override
- public boolean isDirty() {
- return isDirty;
- }
-
- @Override
- public void commit(boolean onSave) {
- super.commit(onSave);
-
- if (onSave) {
- extractData();
- }
- }
- });
-
- // Fix the background color of the launch tab controls
- Color bg = parent.getBackground();
- Control[] children = parent.getChildren();
- if (bg != null && children != null && children.length > 0) {
- fixBackgrounds(children, bg);
- }
- }
-
- /**
- * Set the data to the page.
- * @param input The editor input.
- * @return <code>true</code> if data was set.
- */
- public abstract boolean setupData(Object input);
-
- /**
- * Extract the data from the page.
- * @return <code>true</code> if data was set.
- */
- public abstract boolean extractData();
-
- @Override
- public void setActive(boolean active) {
- super.setActive(active);
- if (active) setupData(getEditorInput());
- }
-
- /**
- * Set the background color of the given controls and their children
- * to the given color.
- *
- * @param controls The list of controls. Must not be <code>null</code>.
- * @param bg The background color. Must not be <code>null</code>.
- */
- protected final void fixBackgrounds(Control[] controls, Color bg) {
- Assert.isNotNull(controls);
- Assert.isNotNull(bg);
- for (Control c : controls) {
- if (!(c instanceof Composite) && !(c instanceof Label) && !(c instanceof Button)) {
- continue;
- }
- if (c instanceof Button) {
- int style = ((Button)c).getStyle();
- if ((style & SWT.RADIO) == 0 && (style & SWT.CHECK) == 0) {
- continue;
- }
- }
- if (!bg.equals(c.getBackground())) {
- c.setBackground(bg);
- }
- if (c instanceof Composite) {
- Control[] children = ((Composite)c).getChildren();
- if (children != null && children.length > 0) {
- fixBackgrounds(children, bg);
- }
- }
- }
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2012, 2013 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.launch.ui.editor;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.tcf.te.launch.ui.tabs.AbstractFormsLaunchConfigurationTab;
+import org.eclipse.tcf.te.ui.forms.CustomFormToolkit;
+import org.eclipse.tcf.te.ui.views.editor.pages.AbstractCustomFormToolkitEditorPage;
+import org.eclipse.ui.forms.AbstractFormPart;
+
+/**
+ * Abstract editor page implementation serving as container for a launch tab.
+ */
+public abstract class AbstractLaunchTabContainerEditorPage extends AbstractCustomFormToolkitEditorPage {
+ // Reference to the launch configuration tab
+ private final AbstractLaunchConfigurationTab launchTab;
+
+ boolean isDirty = false;
+
+ /**
+ * Constructor.
+ */
+ public AbstractLaunchTabContainerEditorPage() {
+ super();
+
+ // Create the launch configuration tab instance
+ launchTab = createLaunchConfigurationTab();
+ Assert.isNotNull(launchTab);
+ }
+
+ /**
+ * Creates a new instance of the launch configuration tab to associate.
+ *
+ * @return The new launch configuration tab instance.
+ */
+ protected abstract AbstractLaunchConfigurationTab createLaunchConfigurationTab();
+
+ /**
+ * Returns the associated launch configuration tab.
+ *
+ * @return The launch configuration tab or <code>null</code>.
+ */
+ protected final AbstractLaunchConfigurationTab getLaunchConfigurationTab() {
+ return launchTab;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.views.editor.pages.AbstractCustomFormToolkitEditorPage#dispose()
+ */
+ @Override
+ public void dispose() {
+ launchTab.dispose();
+ super.dispose();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.views.editor.pages.AbstractCustomFormToolkitEditorPage#hasApplyAction()
+ */
+ @Override
+ protected boolean hasApplyAction() {
+ return true;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.views.editor.pages.AbstractCustomFormToolkitEditorPage#getContextHelpId()
+ */
+ @Override
+ protected String getContextHelpId() {
+ return launchTab.getHelpContextId();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.views.editor.pages.AbstractCustomFormToolkitEditorPage#getFormTitle()
+ */
+ @Override
+ protected String getFormTitle() {
+ return launchTab.getName();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.views.editor.pages.AbstractCustomFormToolkitEditorPage#getFormImage()
+ */
+ @Override
+ protected Image getFormImage() {
+ return launchTab.getImage();
+ }
+
+ /**
+ * Set the dirty state for this editor page.
+ * @param dirty The dirty state.
+ */
+ public void setDirty(boolean dirty) {
+ isDirty = dirty;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.views.editor.pages.AbstractCustomFormToolkitEditorPage#doCreateFormContent(org.eclipse.swt.widgets.Composite, org.eclipse.tcf.te.ui.forms.CustomFormToolkit)
+ */
+ @Override
+ protected void doCreateFormContent(Composite parent, CustomFormToolkit toolkit) {
+ Assert.isNotNull(parent);
+ Assert.isNotNull(toolkit);
+
+ // Create the launch tab content
+ if (launchTab instanceof AbstractFormsLaunchConfigurationTab) {
+ ((AbstractFormsLaunchConfigurationTab)launchTab).createFormContent(getManagedForm());
+ } else {
+ launchTab.createControl(parent);
+ }
+
+ getManagedForm().addPart(new AbstractFormPart() {
+ @Override
+ public boolean isDirty() {
+ return isDirty;
+ }
+
+ @Override
+ public void commit(boolean onSave) {
+ super.commit(onSave);
+
+ if (onSave) {
+ extractData();
+ }
+ }
+ });
+
+ // Fix the background color of the launch tab controls
+ Color bg = parent.getBackground();
+ Control[] children = parent.getChildren();
+ if (bg != null && children != null && children.length > 0) {
+ fixBackgrounds(children, bg);
+ }
+ }
+
+ /**
+ * Set the data to the page.
+ * @param input The editor input.
+ * @return <code>true</code> if data was set.
+ */
+ public abstract boolean setupData(Object input);
+
+ /**
+ * Extract the data from the page.
+ * @return <code>true</code> if data was set.
+ */
+ public abstract boolean extractData();
+
+ @Override
+ public void setActive(boolean active) {
+ super.setActive(active);
+ if (active) setupData(getEditorInput());
+ }
+
+ /**
+ * Set the background color of the given controls and their children
+ * to the given color.
+ *
+ * @param controls The list of controls. Must not be <code>null</code>.
+ * @param bg The background color. Must not be <code>null</code>.
+ */
+ protected final void fixBackgrounds(Control[] controls, Color bg) {
+ Assert.isNotNull(controls);
+ Assert.isNotNull(bg);
+ for (Control c : controls) {
+ if (!(c instanceof Composite) && !(c instanceof Label) && !(c instanceof Button)) {
+ continue;
+ }
+ if (c instanceof Button) {
+ int style = ((Button)c).getStyle();
+ if ((style & SWT.RADIO) == 0 && (style & SWT.CHECK) == 0) {
+ continue;
+ }
+ }
+ if (!bg.equals(c.getBackground())) {
+ c.setBackground(bg);
+ }
+ if (c instanceof Composite) {
+ Control[] children = ((Composite)c).getChildren();
+ if (children != null && children.length > 0) {
+ fixBackgrounds(children, bg);
+ }
+ }
+ }
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/handler/EditorHandlerDelegate.java b/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/handler/EditorHandlerDelegate.java
index 9ad0fe007..41e8953d3 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/handler/EditorHandlerDelegate.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/handler/EditorHandlerDelegate.java
@@ -1,71 +1,71 @@
-/**
- * EditorHandlerDelegate.java
- * Created on Jan 25, 2012
- *
- * Copyright (c) 2012 Wind River Systems, Inc.
- *
- * The right to copy, distribute, modify, or otherwise make use
- * of this software may be licensed only pursuant to the terms
- * of an applicable Wind River license agreement.
- */
-package org.eclipse.tcf.te.launch.ui.handler;
-
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.tcf.te.launch.ui.internal.pages.LaunchExplorerEditorPage;
-import org.eclipse.tcf.te.launch.ui.model.LaunchModel;
-import org.eclipse.tcf.te.launch.ui.model.LaunchNode;
-import org.eclipse.tcf.te.ui.interfaces.handler.IEditorHandlerDelegate;
-import org.eclipse.tcf.te.ui.swt.DisplayUtil;
-import org.eclipse.tcf.te.ui.views.editor.Editor;
-import org.eclipse.tcf.te.ui.views.editor.EditorInput;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.forms.editor.FormEditor;
-import org.eclipse.ui.forms.editor.IFormPage;
-
-/**
- * Launch properties command handler implementation.
- */
-public class EditorHandlerDelegate implements IEditorHandlerDelegate {
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.interfaces.handler.IEditorHandlerDelegate#getEditorInput(java.lang.Object)
- */
- @Override
- public IEditorInput getEditorInput(Object element) {
- if (element instanceof LaunchModel) {
- return new EditorInput(((LaunchModel)element).getModelRoot());
- }
- if (element instanceof LaunchNode) {
- return new EditorInput(((LaunchNode)element).getModel().getModelRoot());
- }
- return new EditorInput(element);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.interfaces.handler.IEditorHandlerDelegate#postOpenProperties(org.eclipse.ui.IEditorPart, java.lang.Object)
- */
- @Override
- public void postOpenEditor(IEditorPart editor, final Object element) {
- if (editor instanceof FormEditor) {
- final FormEditor formEditor = (FormEditor)editor;
- DisplayUtil.safeAsyncExec(new Runnable() {
- @Override
- public void run() {
- IFormPage page = formEditor.setActivePage("org.eclipse.tcf.te.launch.ui.LaunchEditorPage"); //$NON-NLS-1$
- // If the element is a context node, select the node
- if (page != null && element instanceof LaunchModel || element instanceof LaunchNode) {
- Viewer viewer = ((LaunchExplorerEditorPage)page).getTreeControl().getViewer();
- if (viewer != null) {
- viewer.setSelection(new StructuredSelection(element), true);
- }
- }
- else if (formEditor instanceof Editor) {
- ((Editor)formEditor).setActivePage(0);
- }
- }
- });
- }
- }
-}
+/**
+ * EditorHandlerDelegate.java
+ * Created on Jan 25, 2012
+ *
+ * Copyright (c) 2012, 2013 Wind River Systems, Inc.
+ *
+ * The right to copy, distribute, modify, or otherwise make use
+ * of this software may be licensed only pursuant to the terms
+ * of an applicable Wind River license agreement.
+ */
+package org.eclipse.tcf.te.launch.ui.handler;
+
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.tcf.te.launch.ui.internal.pages.LaunchExplorerEditorPage;
+import org.eclipse.tcf.te.launch.ui.model.LaunchModel;
+import org.eclipse.tcf.te.launch.ui.model.LaunchNode;
+import org.eclipse.tcf.te.ui.interfaces.handler.IEditorHandlerDelegate;
+import org.eclipse.tcf.te.ui.swt.DisplayUtil;
+import org.eclipse.tcf.te.ui.views.editor.Editor;
+import org.eclipse.tcf.te.ui.views.editor.EditorInput;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.forms.editor.FormEditor;
+import org.eclipse.ui.forms.editor.IFormPage;
+
+/**
+ * Launch properties command handler implementation.
+ */
+public class EditorHandlerDelegate implements IEditorHandlerDelegate {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.interfaces.handler.IEditorHandlerDelegate#getEditorInput(java.lang.Object)
+ */
+ @Override
+ public IEditorInput getEditorInput(Object element) {
+ if (element instanceof LaunchModel) {
+ return new EditorInput(((LaunchModel)element).getModelRoot());
+ }
+ if (element instanceof LaunchNode) {
+ return new EditorInput(((LaunchNode)element).getModel().getModelRoot());
+ }
+ return new EditorInput(element);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.interfaces.handler.IEditorHandlerDelegate#postOpenProperties(org.eclipse.ui.IEditorPart, java.lang.Object)
+ */
+ @Override
+ public void postOpenEditor(IEditorPart editor, final Object element) {
+ if (editor instanceof FormEditor) {
+ final FormEditor formEditor = (FormEditor)editor;
+ DisplayUtil.safeAsyncExec(new Runnable() {
+ @Override
+ public void run() {
+ IFormPage page = formEditor.setActivePage("org.eclipse.tcf.te.launch.ui.LaunchEditorPage"); //$NON-NLS-1$
+ // If the element is a context node, select the node
+ if (page != null && element instanceof LaunchModel || element instanceof LaunchNode) {
+ Viewer viewer = ((LaunchExplorerEditorPage)page).getTreeControl().getViewer();
+ if (viewer != null) {
+ viewer.setSelection(new StructuredSelection(element), true);
+ }
+ }
+ else if (formEditor instanceof Editor) {
+ ((Editor)formEditor).setActivePage(0);
+ }
+ }
+ });
+ }
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/services/UIService.java b/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/services/UIService.java
index b34e33deb..e5a529d3f 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/services/UIService.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/services/UIService.java
@@ -1,38 +1,38 @@
-/**
- * UIService.java
- * Created on Nov 15, 2012
- *
- * Copyright (c) 2012 Wind River Systems, Inc.
- *
- * The right to copy, distribute, modify, or otherwise make use
- * of this software may be licensed only pursuant to the terms
- * of an applicable Wind River license agreement.
- */
-package org.eclipse.tcf.te.launch.ui.services;
-
-import org.eclipse.tcf.te.launch.ui.handler.EditorHandlerDelegate;
-import org.eclipse.tcf.te.runtime.services.AbstractService;
-import org.eclipse.tcf.te.runtime.services.interfaces.IUIService;
-import org.eclipse.tcf.te.ui.interfaces.handler.IEditorHandlerDelegate;
-
-/**
- * UI service implementation.
- */
-public class UIService extends AbstractService implements IUIService {
- private final IEditorHandlerDelegate editorHandlerDelegate = new EditorHandlerDelegate();
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.services.interfaces.IUIService#getDelegate(java.lang.Object, java.lang.Class)
- */
- @SuppressWarnings("unchecked")
- @Override
- public <V> V getDelegate(Object context, Class<? extends V> clazz) {
-
- if (IEditorHandlerDelegate.class.isAssignableFrom(clazz)) {
- return (V) editorHandlerDelegate;
- }
-
- return null;
- }
-
-}
+/**
+ * UIService.java
+ * Created on Nov 15, 2012
+ *
+ * Copyright (c) 2012, 2013 Wind River Systems, Inc.
+ *
+ * The right to copy, distribute, modify, or otherwise make use
+ * of this software may be licensed only pursuant to the terms
+ * of an applicable Wind River license agreement.
+ */
+package org.eclipse.tcf.te.launch.ui.services;
+
+import org.eclipse.tcf.te.launch.ui.handler.EditorHandlerDelegate;
+import org.eclipse.tcf.te.runtime.services.AbstractService;
+import org.eclipse.tcf.te.runtime.services.interfaces.IUIService;
+import org.eclipse.tcf.te.ui.interfaces.handler.IEditorHandlerDelegate;
+
+/**
+ * UI service implementation.
+ */
+public class UIService extends AbstractService implements IUIService {
+ private final IEditorHandlerDelegate editorHandlerDelegate = new EditorHandlerDelegate();
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.services.interfaces.IUIService#getDelegate(java.lang.Object, java.lang.Class)
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public <V> V getDelegate(Object context, Class<? extends V> clazz) {
+
+ if (IEditorHandlerDelegate.class.isAssignableFrom(clazz)) {
+ return (V) editorHandlerDelegate;
+ }
+
+ return null;
+ }
+
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/launchcontext/AbstractContextSelectorControl.java b/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/launchcontext/AbstractContextSelectorControl.java
index 2dbedaef7..5ab4b01ab 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/launchcontext/AbstractContextSelectorControl.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.launch.ui/src/org/eclipse/tcf/te/launch/ui/tabs/launchcontext/AbstractContextSelectorControl.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Wind River Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2012, 2013 Wind River Systems, Inc. and others. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/src/org/eclipse/tcf/te/runtime/concurrent/executors/AbstractDelegatingExecutorService.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/src/org/eclipse/tcf/te/runtime/concurrent/executors/AbstractDelegatingExecutorService.java
index d73f5f063..334751e2b 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/src/org/eclipse/tcf/te/runtime/concurrent/executors/AbstractDelegatingExecutorService.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.concurrent/src/org/eclipse/tcf/te/runtime/concurrent/executors/AbstractDelegatingExecutorService.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011 Wind River Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2011, 2012 Wind River Systems, Inc. and others. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.persistence/src/org/eclipse/tcf/te/runtime/persistence/delegates/GsonMapPersistenceDelegate.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.persistence/src/org/eclipse/tcf/te/runtime/persistence/delegates/GsonMapPersistenceDelegate.java
index ea5fb6b30..62720121b 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.runtime.persistence/src/org/eclipse/tcf/te/runtime/persistence/delegates/GsonMapPersistenceDelegate.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.persistence/src/org/eclipse/tcf/te/runtime/persistence/delegates/GsonMapPersistenceDelegate.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Wind River Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2012, 2013 Wind River Systems, Inc. and others. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.persistence/src/org/eclipse/tcf/te/runtime/persistence/interfaces/IPersistenceDelegate.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.persistence/src/org/eclipse/tcf/te/runtime/persistence/interfaces/IPersistenceDelegate.java
index 5476d3112..b17d44114 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.runtime.persistence/src/org/eclipse/tcf/te/runtime/persistence/interfaces/IPersistenceDelegate.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.persistence/src/org/eclipse/tcf/te/runtime/persistence/interfaces/IPersistenceDelegate.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Wind River Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2011, 2013 Wind River Systems, Inc. and others. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src/org/eclipse/tcf/te/runtime/services/AbstractServiceManager.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src/org/eclipse/tcf/te/runtime/services/AbstractServiceManager.java
index 221c0f246..84366fd40 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src/org/eclipse/tcf/te/runtime/services/AbstractServiceManager.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src/org/eclipse/tcf/te/runtime/services/AbstractServiceManager.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Wind River Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2011, 2013 Wind River Systems, Inc. and others. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src/org/eclipse/tcf/te/runtime/services/interfaces/IDebugService.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src/org/eclipse/tcf/te/runtime/services/interfaces/IDebugService.java
index 444b30513..c11e2b942 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src/org/eclipse/tcf/te/runtime/services/interfaces/IDebugService.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src/org/eclipse/tcf/te/runtime/services/interfaces/IDebugService.java
@@ -1,52 +1,52 @@
-/*******************************************************************************
- * Copyright (c) 2011 Wind River Systems, Inc. and others. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.tcf.te.runtime.services.interfaces;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
-import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
-
-/**
- * Debug service.
- * <p>
- * Allow to start and control the debugger for a set of given debug contexts.
- */
-public interface IDebugService extends IService {
-
- /**
- * Launches a debug session for the given context and attaches to it. The attach
- * can be parameterized via the data properties.
- *
- * @param context The debug context. Must not be <code>null</code>.
- * @param data The data properties to parameterize the attach. Must not be <code>null</code>.
- * @param monitor The progress monitor.
- * @param callback The callback to invoke once the operation completed. Must not be <code>null</code>.
- */
- public void attach(Object context, IPropertiesContainer data, IProgressMonitor monitor, ICallback callback);
-
- /**
- * Terminates a debug session for the given context and detaches it. The detach
- * can be parameterized via the data properties.
- *
- * @param context The debug context. Must not be <code>null</code>.
- * @param data The data properties to parameterize the detach. Must not be <code>null</code>.
- * @param monitor The progress monitor.
- * @param callback The callback to invoke once the operation completed. Must not be <code>null</code>.
- */
- public void detach(Object context, IPropertiesContainer data, IProgressMonitor monitor, ICallback callback);
-
- /**
- * Returns if or if not the debugger has been launched for the given context.
- *
- * @param context The debug context. Must not be <code>null</code>.
- * @return <code>True</code> if the debugger has been launched for the context, <code>false</code> otherwise.
- */
- public boolean isLaunched(Object context);
-}
+/*******************************************************************************
+ * Copyright (c) 2011, 2013 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.runtime.services.interfaces;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
+import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
+
+/**
+ * Debug service.
+ * <p>
+ * Allow to start and control the debugger for a set of given debug contexts.
+ */
+public interface IDebugService extends IService {
+
+ /**
+ * Launches a debug session for the given context and attaches to it. The attach
+ * can be parameterized via the data properties.
+ *
+ * @param context The debug context. Must not be <code>null</code>.
+ * @param data The data properties to parameterize the attach. Must not be <code>null</code>.
+ * @param monitor The progress monitor.
+ * @param callback The callback to invoke once the operation completed. Must not be <code>null</code>.
+ */
+ public void attach(Object context, IPropertiesContainer data, IProgressMonitor monitor, ICallback callback);
+
+ /**
+ * Terminates a debug session for the given context and detaches it. The detach
+ * can be parameterized via the data properties.
+ *
+ * @param context The debug context. Must not be <code>null</code>.
+ * @param data The data properties to parameterize the detach. Must not be <code>null</code>.
+ * @param monitor The progress monitor.
+ * @param callback The callback to invoke once the operation completed. Must not be <code>null</code>.
+ */
+ public void detach(Object context, IPropertiesContainer data, IProgressMonitor monitor, ICallback callback);
+
+ /**
+ * Returns if or if not the debugger has been launched for the given context.
+ *
+ * @param context The debug context. Must not be <code>null</code>.
+ * @return <code>True</code> if the debugger has been launched for the context, <code>false</code> otherwise.
+ */
+ public boolean isLaunched(Object context);
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src/org/eclipse/tcf/te/runtime/services/internal/MenuServicePropertyTester.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src/org/eclipse/tcf/te/runtime/services/internal/MenuServicePropertyTester.java
index 7bae967ae..67d412f03 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src/org/eclipse/tcf/te/runtime/services/internal/MenuServicePropertyTester.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src/org/eclipse/tcf/te/runtime/services/internal/MenuServicePropertyTester.java
@@ -1,41 +1,41 @@
-/*******************************************************************************
- * Copyright (c) 2011 Wind River Systems, Inc. and others. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.tcf.te.runtime.services.internal;
-
-import org.eclipse.tcf.te.runtime.services.ServiceManager;
-import org.eclipse.tcf.te.runtime.services.interfaces.IMenuService;
-
-/**
- * Services plug-in property tester implementation.
- */
-public class MenuServicePropertyTester extends org.eclipse.core.expressions.PropertyTester {
-
- /* (non-Javadoc)
- * @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object)
- */
- @Override
- public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
- // Get the menu service instance for the given receiver
- IMenuService service = ServiceManager.getInstance().getService(receiver, IMenuService.class);
- if (service != null) {
-
- // "isVisible": Checks if a given menu contribution shall be visible for the given receiver.
- if ("isVisible".equals(property)) { //$NON-NLS-1$
- // The menu contribution ID is the first argument
- String contributionID = args.length > 0 && args[0] instanceof String ? (String)args[0] : null;
- boolean isVisible = service.isVisible(receiver, contributionID);
- return expectedValue instanceof Boolean ? ((Boolean)expectedValue).booleanValue() == isVisible : false;
- }
- }
-
- return false;
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011, 2013 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.runtime.services.internal;
+
+import org.eclipse.tcf.te.runtime.services.ServiceManager;
+import org.eclipse.tcf.te.runtime.services.interfaces.IMenuService;
+
+/**
+ * Services plug-in property tester implementation.
+ */
+public class MenuServicePropertyTester extends org.eclipse.core.expressions.PropertyTester {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object)
+ */
+ @Override
+ public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
+ // Get the menu service instance for the given receiver
+ IMenuService service = ServiceManager.getInstance().getService(receiver, IMenuService.class);
+ if (service != null) {
+
+ // "isVisible": Checks if a given menu contribution shall be visible for the given receiver.
+ if ("isVisible".equals(property)) { //$NON-NLS-1$
+ // The menu contribution ID is the first argument
+ String contributionID = args.length > 0 && args[0] instanceof String ? (String)args[0] : null;
+ boolean isVisible = service.isVisible(receiver, contributionID);
+ return expectedValue instanceof Boolean ? ((Boolean)expectedValue).booleanValue() == isVisible : false;
+ }
+ }
+
+ return false;
+ }
+
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src/org/eclipse/tcf/te/runtime/services/internal/PropertiesContainerPropertyTester.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src/org/eclipse/tcf/te/runtime/services/internal/PropertiesContainerPropertyTester.java
index 85194fcba..955d6e1de 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src/org/eclipse/tcf/te/runtime/services/internal/PropertiesContainerPropertyTester.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src/org/eclipse/tcf/te/runtime/services/internal/PropertiesContainerPropertyTester.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011 Wind River Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2011, 2012 Wind River Systems, Inc. and others. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.statushandler/src/org/eclipse/tcf/te/runtime/statushandler/StatusHandlerUtil.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.statushandler/src/org/eclipse/tcf/te/runtime/statushandler/StatusHandlerUtil.java
index 508ab53ec..80af56237 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.runtime.statushandler/src/org/eclipse/tcf/te/runtime/statushandler/StatusHandlerUtil.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.statushandler/src/org/eclipse/tcf/te/runtime/statushandler/StatusHandlerUtil.java
@@ -1,118 +1,118 @@
-/**
- * StatusHandlerUtil.java
- * Created on May 21, 2012
- *
- * Copyright (c) 2012 Wind River Systems, Inc.
- *
- * The right to copy, distribute, modify, or otherwise make use
- * of this software may be licensed only pursuant to the terms
- * of an applicable Wind River license agreement.
- */
-package org.eclipse.tcf.te.runtime.statushandler;
-
-import java.lang.reflect.Field;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.StringTokenizer;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
-import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
-import org.eclipse.tcf.te.runtime.properties.PropertiesContainer;
-import org.eclipse.tcf.te.runtime.statushandler.activator.CoreBundleActivator;
-import org.eclipse.tcf.te.runtime.statushandler.interfaces.IStatusHandler;
-import org.eclipse.tcf.te.runtime.statushandler.interfaces.IStatusHandlerConstants;
-
-/**
- * Status handler utility implementations.
- */
-public final class StatusHandlerUtil {
-
- /**
- * Handle the given status for the given context.
- *
- * @param status The status. Must not be <code>null</code>.
- * @param context The context. Must not be <code>null</code>.
- * @param template The message template or <code>null</code>.
- * @param title The dialog title or <code>null</code>.
- * @param contextHelpId The context help id or <code>null</code>.
- * @param caller The caller or <code>null</code>.
- * @param callback The callback or <code>null</code>.
- */
- public static void handleStatus(IStatus status, Object context, String template, String title, String contextHelpId, Object caller, ICallback callback) {
- Assert.isNotNull(status);
- Assert.isNotNull(context);
-
- IStatusHandler[] handlers = StatusHandlerManager.getInstance().getHandler(context);
- if (handlers.length > 0) {
- IPropertiesContainer data = new PropertiesContainer();
-
- if (title != null) data.setProperty(IStatusHandlerConstants.PROPERTY_TITLE, title);
- if (contextHelpId != null) data.setProperty(IStatusHandlerConstants.PROPERTY_CONTEXT_HELP_ID, contextHelpId);
- if (caller != null) data.setProperty(IStatusHandlerConstants.PROPERTY_CALLER, caller);
-
- updateMessage(status, template);
-
- handlers[0].handleStatus(status, data, callback);
- } else {
- Platform.getLog(CoreBundleActivator.getContext().getBundle()).log(status);
- callback.done(caller, status);
- }
- }
-
- private static void updateMessage(IStatus status, String template) {
- Assert.isNotNull(status);
-
- StringBuilder message = new StringBuilder();
- String msg = status.getMessage();
-
- if (msg != null && msg.contains("Error text:")) { //$NON-NLS-1$
- StringTokenizer tokenizer = new StringTokenizer(msg, ","); //$NON-NLS-1$
- while (tokenizer.hasMoreElements()) {
- String token = tokenizer.nextToken();
- if (token.trim().startsWith("Error text:")) { //$NON-NLS-1$
- token = token.replaceAll("Error text:", " "); //$NON-NLS-1$ //$NON-NLS-2$
- message.append(token.trim());
- break;
- }
- }
- } else if (msg != null) {
- message.append(msg.trim());
- }
-
- // If the status is associated with an exception, the exception message may contain additional
- // detailed information. Append it to the message
- if (status.getException() != null && status.getException().getLocalizedMessage() != null
- && !status.getException().getLocalizedMessage().contains(message.toString())) {
- message.append("\n\n"); //$NON-NLS-1$
- message.append(status.getException().getLocalizedMessage());
- }
-
- // Construct the final message string
- String fullMsg = null;
- if (message.length() > 0) fullMsg = message.toString().trim();
-
- // Apply the template if any
- if (template != null) fullMsg = NLS.bind(template, fullMsg != null ? fullMsg : ""); //$NON-NLS-1$
-
- if (fullMsg != null) {
- // Normalize any possible "\r\n"
- fullMsg = fullMsg.replaceAll("\r\n", "\n"); //$NON-NLS-1$ //$NON-NLS-2$
- try {
- final Field f = status.getClass().getDeclaredField("message"); //$NON-NLS-1$
- AccessController.doPrivileged(new PrivilegedAction<Object>() {
- @Override
- public Object run() {
- f.setAccessible(true);
- return null;
- }
- });
- f.set(status, fullMsg);
- }
- catch (Exception e) {}
- }
- }
-}
+/**
+ * StatusHandlerUtil.java
+ * Created on May 21, 2012
+ *
+ * Copyright (c) 2012, 2013 Wind River Systems, Inc.
+ *
+ * The right to copy, distribute, modify, or otherwise make use
+ * of this software may be licensed only pursuant to the terms
+ * of an applicable Wind River license agreement.
+ */
+package org.eclipse.tcf.te.runtime.statushandler;
+
+import java.lang.reflect.Field;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.util.StringTokenizer;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
+import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
+import org.eclipse.tcf.te.runtime.properties.PropertiesContainer;
+import org.eclipse.tcf.te.runtime.statushandler.activator.CoreBundleActivator;
+import org.eclipse.tcf.te.runtime.statushandler.interfaces.IStatusHandler;
+import org.eclipse.tcf.te.runtime.statushandler.interfaces.IStatusHandlerConstants;
+
+/**
+ * Status handler utility implementations.
+ */
+public final class StatusHandlerUtil {
+
+ /**
+ * Handle the given status for the given context.
+ *
+ * @param status The status. Must not be <code>null</code>.
+ * @param context The context. Must not be <code>null</code>.
+ * @param template The message template or <code>null</code>.
+ * @param title The dialog title or <code>null</code>.
+ * @param contextHelpId The context help id or <code>null</code>.
+ * @param caller The caller or <code>null</code>.
+ * @param callback The callback or <code>null</code>.
+ */
+ public static void handleStatus(IStatus status, Object context, String template, String title, String contextHelpId, Object caller, ICallback callback) {
+ Assert.isNotNull(status);
+ Assert.isNotNull(context);
+
+ IStatusHandler[] handlers = StatusHandlerManager.getInstance().getHandler(context);
+ if (handlers.length > 0) {
+ IPropertiesContainer data = new PropertiesContainer();
+
+ if (title != null) data.setProperty(IStatusHandlerConstants.PROPERTY_TITLE, title);
+ if (contextHelpId != null) data.setProperty(IStatusHandlerConstants.PROPERTY_CONTEXT_HELP_ID, contextHelpId);
+ if (caller != null) data.setProperty(IStatusHandlerConstants.PROPERTY_CALLER, caller);
+
+ updateMessage(status, template);
+
+ handlers[0].handleStatus(status, data, callback);
+ } else {
+ Platform.getLog(CoreBundleActivator.getContext().getBundle()).log(status);
+ callback.done(caller, status);
+ }
+ }
+
+ private static void updateMessage(IStatus status, String template) {
+ Assert.isNotNull(status);
+
+ StringBuilder message = new StringBuilder();
+ String msg = status.getMessage();
+
+ if (msg != null && msg.contains("Error text:")) { //$NON-NLS-1$
+ StringTokenizer tokenizer = new StringTokenizer(msg, ","); //$NON-NLS-1$
+ while (tokenizer.hasMoreElements()) {
+ String token = tokenizer.nextToken();
+ if (token.trim().startsWith("Error text:")) { //$NON-NLS-1$
+ token = token.replaceAll("Error text:", " "); //$NON-NLS-1$ //$NON-NLS-2$
+ message.append(token.trim());
+ break;
+ }
+ }
+ } else if (msg != null) {
+ message.append(msg.trim());
+ }
+
+ // If the status is associated with an exception, the exception message may contain additional
+ // detailed information. Append it to the message
+ if (status.getException() != null && status.getException().getLocalizedMessage() != null
+ && !status.getException().getLocalizedMessage().contains(message.toString())) {
+ message.append("\n\n"); //$NON-NLS-1$
+ message.append(status.getException().getLocalizedMessage());
+ }
+
+ // Construct the final message string
+ String fullMsg = null;
+ if (message.length() > 0) fullMsg = message.toString().trim();
+
+ // Apply the template if any
+ if (template != null) fullMsg = NLS.bind(template, fullMsg != null ? fullMsg : ""); //$NON-NLS-1$
+
+ if (fullMsg != null) {
+ // Normalize any possible "\r\n"
+ fullMsg = fullMsg.replaceAll("\r\n", "\n"); //$NON-NLS-1$ //$NON-NLS-2$
+ try {
+ final Field f = status.getClass().getDeclaredField("message"); //$NON-NLS-1$
+ AccessController.doPrivileged(new PrivilegedAction<Object>() {
+ @Override
+ public Object run() {
+ f.setAccessible(true);
+ return null;
+ }
+ });
+ f.set(status, fullMsg);
+ }
+ catch (Exception e) {}
+ }
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/plugin.properties b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/plugin.properties
index 6408b6f8b..0807577fe 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/plugin.properties
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/plugin.properties
@@ -1,18 +1,18 @@
-##################################################################################
-# Copyright (c) 2011, 2012 Wind River Systems, Inc. and others. All rights reserved.
-# This program and the accompanying materials are made available under the terms
-# of the Eclipse Public License v1.0 which accompanies this distribution, and is
-# available at http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Wind River Systems - initial API and implementation
-##################################################################################
-
-pluginName = Target Explorer, Stepper plug-in
-providerName = Eclipse.org - Target Explorer
-
-Extension.Steppers.name=Steppers
-Extension.Steps.name=Steps
-Extension.StepGroups.name=Step Groups
-
+##################################################################################
+# Copyright (c) 2011, 2013 Wind River Systems, Inc. and others. All rights reserved.
+# This program and the accompanying materials are made available under the terms
+# of the Eclipse Public License v1.0 which accompanies this distribution, and is
+# available at http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Wind River Systems - initial API and implementation
+##################################################################################
+
+pluginName = Target Explorer, Stepper plug-in
+providerName = Eclipse.org - Target Explorer
+
+Extension.Steppers.name=Steppers
+Extension.Steps.name=Steps
+Extension.StepGroups.name=Step Groups
+
WaitStep.name=Waiting... \ No newline at end of file
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/FullQualifiedId.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/FullQualifiedId.java
index c176ad28a..7d660823d 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/FullQualifiedId.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/FullQualifiedId.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011 Wind River Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2011, 2012 Wind River Systems, Inc. and others. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/extensions/StepExecutor.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/extensions/StepExecutor.java
index f9cfb6d4d..f91289475 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/extensions/StepExecutor.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/extensions/StepExecutor.java
@@ -1,253 +1,253 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Wind River Systems, Inc. and others. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.tcf.te.runtime.stepper.extensions;
-
-import java.util.Date;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.tcf.te.runtime.callback.Callback;
-import org.eclipse.tcf.te.runtime.concurrent.util.ExecutorsUtil;
-import org.eclipse.tcf.te.runtime.interfaces.ISharedConstants;
-import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
-import org.eclipse.tcf.te.runtime.stepper.activator.CoreBundleActivator;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IStep;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepExecutor;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.tracing.ITraceIds;
-import org.eclipse.tcf.te.runtime.stepper.nls.Messages;
-import org.eclipse.tcf.te.runtime.utils.ProgressHelper;
-import org.eclipse.tcf.te.runtime.utils.StatusHelper;
-
-/**
- * Step executor implementation.
- * <p>
- * The step executor is responsible for initiating the execution of a single step. The executor
- * creates and associated the step callback and blocks the execution till the executed step invoked
- * the callback.
- * <p>
- * The step executor is passing any status thrown by the executed step to the parent stepper
- * instance for handling.
- * <p>
- * If the step to execute is of type {@link IExtendedStep}, the step executor is calling
- * {@link IExtendedStep#initializeFrom(IAdaptable, IPropertiesContainer, IFullQualifiedId, IProgressMonitor)} and
- * {@link IExtendedStep#validateExecute(IAdaptable, IPropertiesContainer, IFullQualifiedId, IProgressMonitor)} before calling
- * {@link IStep#execute(IAdaptable, IPropertiesContainer, IFullQualifiedId, IProgressMonitor, org.eclipse.tcf.te.runtime.interfaces.callback.ICallback)}.
- * <p>
- * The methods will be called within the current step executor thread.
- * <p>
- * The stepper implementation can be traced and profiled by setting the debug options:
- * <ul>
- * <li><i>org.eclipse.tcf.te.runtime.stepper/trace/stepping</i></li>
- * <li><i>org.eclipse.tcf.te.runtime.stepper/profile/stepping</i></li>
- * </ul>
- */
-public class StepExecutor implements IStepExecutor {
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStepExecutor#execute(org.eclipse.tcf.te.runtime.stepper.interfaces.IStep, org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.core.runtime.IProgressMonitor)
- */
- @Override
- public final void execute(final IStep step, IFullQualifiedId id, final IStepContext context, final IPropertiesContainer data, IProgressMonitor progress) throws CoreException {
- Assert.isNotNull(step);
- Assert.isNotNull(id);
- Assert.isNotNull(context);
- Assert.isNotNull(data);
- Assert.isNotNull(progress);
-
- long startTime = System.currentTimeMillis();
-
- CoreBundleActivator.getTraceHandler().trace("StepExecutor#execute: *** START (" + step.getLabel() + ")", //$NON-NLS-1$ //$NON-NLS-2$
- 0, ITraceIds.TRACE_STEPPING, IStatus.WARNING, this);
- CoreBundleActivator.getTraceHandler().trace(" [" + ISharedConstants.TIME_FORMAT.format(new Date(startTime)) + "]" //$NON-NLS-1$ //$NON-NLS-2$
- + " ***", //$NON-NLS-1$
- 0, ITraceIds.PROFILE_STEPPING, IStatus.WARNING, this);
-
- int ticksToUse = step.getTotalWork(context, data);
- progress = ProgressHelper.getProgressMonitor(progress, ticksToUse);
- ProgressHelper.beginTask(progress, step.getLabel(), ticksToUse);
-
- // Create the handler (and the callback) for the current step
- final Callback callback = new Callback();
-
- // Catch any exception that might occur during execution.
- // Errors are passed through by definition.
- try {
- step.initializeFrom(context, data, id, progress);
- step.validateExecute(context, data, id, progress);
- step.execute(context, data, id, progress, callback);
-
- // Wait till the step finished, an execution occurred or the
- // user hit cancel on the progress monitor.
- ExecutorsUtil.waitAndExecute(0, callback.getDoneConditionTester(progress, step.getCancelTimeout()));
-
- // Check the status of the step
- normalizeStatus(step, id, context, data, callback.getStatus());
- }
- catch (Exception e) {
- CoreBundleActivator.getTraceHandler().trace("StepExecutor#execute: Exception catched: class ='" + e.getClass().getName() + "'" //$NON-NLS-1$ //$NON-NLS-2$
- + ", message = '" + e.getLocalizedMessage() + "'" //$NON-NLS-1$ //$NON-NLS-2$
- + ", cause = " //$NON-NLS-1$
- + (e instanceof CoreException ? ((CoreException)e).getStatus().getException() : e.getCause()),
- 0, ITraceIds.TRACE_STEPPING, IStatus.WARNING, this);
-
- // If the exception is a CoreException by itself, just re-throw
- if (e instanceof CoreException) {
- // Check if the message does need normalization
- if (isExceptionMessageFormatted(e.getLocalizedMessage())) {
- throw (CoreException)e;
- }
- // We have to normalize the status message first
- normalizeStatus(step, id, context, data, ((CoreException)e).getStatus());
- } else {
- // all other exceptions are repackaged within a CoreException
- normalizeStatus(step, id, context, data, StatusHelper.getStatus(e));
- }
- }
- finally {
- if (!progress.isCanceled()) {
- progress.done();
- }
-
- // Give the step a chance for cleanup
- step.cleanup(context, data, id, progress);
-
- long endTime = System.currentTimeMillis();
- CoreBundleActivator.getTraceHandler().trace("StepExecutor#execute: *** DONE (" + step.getLabel() + ")", //$NON-NLS-1$ //$NON-NLS-2$
- 0, ITraceIds.TRACE_STEPPING, IStatus.WARNING, this);
- CoreBundleActivator.getTraceHandler().trace(" [" + ISharedConstants.TIME_FORMAT.format(new Date(endTime)) //$NON-NLS-1$
- + " , delay = " + (endTime - startTime) + " ms]" //$NON-NLS-1$ //$NON-NLS-2$
- + " ***", //$NON-NLS-1$
- 0, ITraceIds.PROFILE_STEPPING, IStatus.WARNING, this);
- }
- }
-
- /**
- * Normalize the given status.
- *
- * @param step The step.
- * @param id The fully qualified id.
- * @param context The context.
- * @param data The step data.
- * @param status The status.
- *
- * @throws CoreException - if the operation fails
- */
- private void normalizeStatus(IStep step, IFullQualifiedId id, IStepContext context , IPropertiesContainer data, IStatus status) throws CoreException {
- Assert.isNotNull(context);
- Assert.isNotNull(data);
- Assert.isNotNull(id);
- Assert.isNotNull(step);
-
- if (status == null || status.isOK()) {
- return;
- }
-
- switch (status.getSeverity()) {
- case IStatus.CANCEL:
- throw new OperationCanceledException(status.getMessage());
- default:
- String message = formatMessage(status.getMessage(), status.getSeverity(), step, id, context, data);
- status = new Status(status.getSeverity(), status.getPlugin(), status.getCode(), message != null ? message : status.getMessage(), status.getException());
- throw new CoreException(status);
- }
- }
-
- /**
- * Checks if the given message is already formatted to get displayed to the user.
- *
- * @param message The message. Must not be <code>null</code>.
- * @return <code>True</code> if the message is already formatted to get displayed to the user, <code>false</code> otherwise.
- */
- protected boolean isExceptionMessageFormatted(String message) {
- Assert.isNotNull(message);
- return message.startsWith(Messages.StepExecutor_checkPoint_normalizationNeeded);
- }
-
- /**
- * Format the message depending on the severity.
- *
- * @param message The message to format.
- * @param severity The message severity.
- * @param step The step.
- * @param id The full qualified step id.
- * @param context The target context.
- * @param data The step data.
- *
- * @return Formatted message.
- */
- protected String formatMessage(String message, int severity, IStep step, IFullQualifiedId id, IStepContext context, IPropertiesContainer data) {
- String template = null;
-
- switch (severity) {
- case IStatus.INFO:
- template = Messages.StepExecutor_info_stepFailed;
- break;
- case IStatus.WARNING:
- template = Messages.StepExecutor_warning_stepFailed;
- break;
- case IStatus.ERROR:
- template = Messages.StepExecutor_error_stepFailed;
- break;
- }
-
- // If we cannot determine the formatted message template, just return the message as is
- if (template == null) {
- return message;
- }
-
- // Check the message for additions
- message = checkMessage(message);
-
- // Split the message. The first sentence is shown more prominent on the top,
- // the rest as additional information below the step information.
- String[] splittedMsg = message != null ? message.split("[\t\n\r\f]+", 2) : new String[] { null, null }; //$NON-NLS-1$
-
- // Format the core message
- String formattedMessage = NLS.bind(template,
- new String[] { splittedMsg[0],
- context.getName(),
- context.getInfo(data),
- (step.getLabel() != null && step.getLabel().trim().length() > 0 ? step.getLabel() : step.getId())
- });
-
- // If we have more information available, append them
- if (splittedMsg.length > 1 && splittedMsg[1] != null && !"".equals(splittedMsg[1])) { //$NON-NLS-1$
- formattedMessage += "\n\n" + splittedMsg[1]; //$NON-NLS-1$
- }
-
- // In debug mode, there is even more information to add
- if (Platform.inDebugMode()) {
- formattedMessage += "\n\n" + NLS.bind(Messages.StepExecutor_stepFailed_debugInfo, id.toString()); //$NON-NLS-1$
- }
-
- return formattedMessage;
- }
-
- /**
- * Check for additions to add to the message.
- * <p>
- * <i>Reserved for future use. Currently returns the message unmodified.</i>
- *
- * @param message The message or <code>null</code>.
- * @return The checked message.
- */
- protected String checkMessage(String message) {
- return message;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011, 2013 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.runtime.stepper.extensions;
+
+import java.util.Date;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.tcf.te.runtime.callback.Callback;
+import org.eclipse.tcf.te.runtime.concurrent.util.ExecutorsUtil;
+import org.eclipse.tcf.te.runtime.interfaces.ISharedConstants;
+import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
+import org.eclipse.tcf.te.runtime.stepper.activator.CoreBundleActivator;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IStep;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepExecutor;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.tracing.ITraceIds;
+import org.eclipse.tcf.te.runtime.stepper.nls.Messages;
+import org.eclipse.tcf.te.runtime.utils.ProgressHelper;
+import org.eclipse.tcf.te.runtime.utils.StatusHelper;
+
+/**
+ * Step executor implementation.
+ * <p>
+ * The step executor is responsible for initiating the execution of a single step. The executor
+ * creates and associated the step callback and blocks the execution till the executed step invoked
+ * the callback.
+ * <p>
+ * The step executor is passing any status thrown by the executed step to the parent stepper
+ * instance for handling.
+ * <p>
+ * If the step to execute is of type {@link IExtendedStep}, the step executor is calling
+ * {@link IExtendedStep#initializeFrom(IAdaptable, IPropertiesContainer, IFullQualifiedId, IProgressMonitor)} and
+ * {@link IExtendedStep#validateExecute(IAdaptable, IPropertiesContainer, IFullQualifiedId, IProgressMonitor)} before calling
+ * {@link IStep#execute(IAdaptable, IPropertiesContainer, IFullQualifiedId, IProgressMonitor, org.eclipse.tcf.te.runtime.interfaces.callback.ICallback)}.
+ * <p>
+ * The methods will be called within the current step executor thread.
+ * <p>
+ * The stepper implementation can be traced and profiled by setting the debug options:
+ * <ul>
+ * <li><i>org.eclipse.tcf.te.runtime.stepper/trace/stepping</i></li>
+ * <li><i>org.eclipse.tcf.te.runtime.stepper/profile/stepping</i></li>
+ * </ul>
+ */
+public class StepExecutor implements IStepExecutor {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStepExecutor#execute(org.eclipse.tcf.te.runtime.stepper.interfaces.IStep, org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ public final void execute(final IStep step, IFullQualifiedId id, final IStepContext context, final IPropertiesContainer data, IProgressMonitor progress) throws CoreException {
+ Assert.isNotNull(step);
+ Assert.isNotNull(id);
+ Assert.isNotNull(context);
+ Assert.isNotNull(data);
+ Assert.isNotNull(progress);
+
+ long startTime = System.currentTimeMillis();
+
+ CoreBundleActivator.getTraceHandler().trace("StepExecutor#execute: *** START (" + step.getLabel() + ")", //$NON-NLS-1$ //$NON-NLS-2$
+ 0, ITraceIds.TRACE_STEPPING, IStatus.WARNING, this);
+ CoreBundleActivator.getTraceHandler().trace(" [" + ISharedConstants.TIME_FORMAT.format(new Date(startTime)) + "]" //$NON-NLS-1$ //$NON-NLS-2$
+ + " ***", //$NON-NLS-1$
+ 0, ITraceIds.PROFILE_STEPPING, IStatus.WARNING, this);
+
+ int ticksToUse = step.getTotalWork(context, data);
+ progress = ProgressHelper.getProgressMonitor(progress, ticksToUse);
+ ProgressHelper.beginTask(progress, step.getLabel(), ticksToUse);
+
+ // Create the handler (and the callback) for the current step
+ final Callback callback = new Callback();
+
+ // Catch any exception that might occur during execution.
+ // Errors are passed through by definition.
+ try {
+ step.initializeFrom(context, data, id, progress);
+ step.validateExecute(context, data, id, progress);
+ step.execute(context, data, id, progress, callback);
+
+ // Wait till the step finished, an execution occurred or the
+ // user hit cancel on the progress monitor.
+ ExecutorsUtil.waitAndExecute(0, callback.getDoneConditionTester(progress, step.getCancelTimeout()));
+
+ // Check the status of the step
+ normalizeStatus(step, id, context, data, callback.getStatus());
+ }
+ catch (Exception e) {
+ CoreBundleActivator.getTraceHandler().trace("StepExecutor#execute: Exception catched: class ='" + e.getClass().getName() + "'" //$NON-NLS-1$ //$NON-NLS-2$
+ + ", message = '" + e.getLocalizedMessage() + "'" //$NON-NLS-1$ //$NON-NLS-2$
+ + ", cause = " //$NON-NLS-1$
+ + (e instanceof CoreException ? ((CoreException)e).getStatus().getException() : e.getCause()),
+ 0, ITraceIds.TRACE_STEPPING, IStatus.WARNING, this);
+
+ // If the exception is a CoreException by itself, just re-throw
+ if (e instanceof CoreException) {
+ // Check if the message does need normalization
+ if (isExceptionMessageFormatted(e.getLocalizedMessage())) {
+ throw (CoreException)e;
+ }
+ // We have to normalize the status message first
+ normalizeStatus(step, id, context, data, ((CoreException)e).getStatus());
+ } else {
+ // all other exceptions are repackaged within a CoreException
+ normalizeStatus(step, id, context, data, StatusHelper.getStatus(e));
+ }
+ }
+ finally {
+ if (!progress.isCanceled()) {
+ progress.done();
+ }
+
+ // Give the step a chance for cleanup
+ step.cleanup(context, data, id, progress);
+
+ long endTime = System.currentTimeMillis();
+ CoreBundleActivator.getTraceHandler().trace("StepExecutor#execute: *** DONE (" + step.getLabel() + ")", //$NON-NLS-1$ //$NON-NLS-2$
+ 0, ITraceIds.TRACE_STEPPING, IStatus.WARNING, this);
+ CoreBundleActivator.getTraceHandler().trace(" [" + ISharedConstants.TIME_FORMAT.format(new Date(endTime)) //$NON-NLS-1$
+ + " , delay = " + (endTime - startTime) + " ms]" //$NON-NLS-1$ //$NON-NLS-2$
+ + " ***", //$NON-NLS-1$
+ 0, ITraceIds.PROFILE_STEPPING, IStatus.WARNING, this);
+ }
+ }
+
+ /**
+ * Normalize the given status.
+ *
+ * @param step The step.
+ * @param id The fully qualified id.
+ * @param context The context.
+ * @param data The step data.
+ * @param status The status.
+ *
+ * @throws CoreException - if the operation fails
+ */
+ private void normalizeStatus(IStep step, IFullQualifiedId id, IStepContext context , IPropertiesContainer data, IStatus status) throws CoreException {
+ Assert.isNotNull(context);
+ Assert.isNotNull(data);
+ Assert.isNotNull(id);
+ Assert.isNotNull(step);
+
+ if (status == null || status.isOK()) {
+ return;
+ }
+
+ switch (status.getSeverity()) {
+ case IStatus.CANCEL:
+ throw new OperationCanceledException(status.getMessage());
+ default:
+ String message = formatMessage(status.getMessage(), status.getSeverity(), step, id, context, data);
+ status = new Status(status.getSeverity(), status.getPlugin(), status.getCode(), message != null ? message : status.getMessage(), status.getException());
+ throw new CoreException(status);
+ }
+ }
+
+ /**
+ * Checks if the given message is already formatted to get displayed to the user.
+ *
+ * @param message The message. Must not be <code>null</code>.
+ * @return <code>True</code> if the message is already formatted to get displayed to the user, <code>false</code> otherwise.
+ */
+ protected boolean isExceptionMessageFormatted(String message) {
+ Assert.isNotNull(message);
+ return message.startsWith(Messages.StepExecutor_checkPoint_normalizationNeeded);
+ }
+
+ /**
+ * Format the message depending on the severity.
+ *
+ * @param message The message to format.
+ * @param severity The message severity.
+ * @param step The step.
+ * @param id The full qualified step id.
+ * @param context The target context.
+ * @param data The step data.
+ *
+ * @return Formatted message.
+ */
+ protected String formatMessage(String message, int severity, IStep step, IFullQualifiedId id, IStepContext context, IPropertiesContainer data) {
+ String template = null;
+
+ switch (severity) {
+ case IStatus.INFO:
+ template = Messages.StepExecutor_info_stepFailed;
+ break;
+ case IStatus.WARNING:
+ template = Messages.StepExecutor_warning_stepFailed;
+ break;
+ case IStatus.ERROR:
+ template = Messages.StepExecutor_error_stepFailed;
+ break;
+ }
+
+ // If we cannot determine the formatted message template, just return the message as is
+ if (template == null) {
+ return message;
+ }
+
+ // Check the message for additions
+ message = checkMessage(message);
+
+ // Split the message. The first sentence is shown more prominent on the top,
+ // the rest as additional information below the step information.
+ String[] splittedMsg = message != null ? message.split("[\t\n\r\f]+", 2) : new String[] { null, null }; //$NON-NLS-1$
+
+ // Format the core message
+ String formattedMessage = NLS.bind(template,
+ new String[] { splittedMsg[0],
+ context.getName(),
+ context.getInfo(data),
+ (step.getLabel() != null && step.getLabel().trim().length() > 0 ? step.getLabel() : step.getId())
+ });
+
+ // If we have more information available, append them
+ if (splittedMsg.length > 1 && splittedMsg[1] != null && !"".equals(splittedMsg[1])) { //$NON-NLS-1$
+ formattedMessage += "\n\n" + splittedMsg[1]; //$NON-NLS-1$
+ }
+
+ // In debug mode, there is even more information to add
+ if (Platform.inDebugMode()) {
+ formattedMessage += "\n\n" + NLS.bind(Messages.StepExecutor_stepFailed_debugInfo, id.toString()); //$NON-NLS-1$
+ }
+
+ return formattedMessage;
+ }
+
+ /**
+ * Check for additions to add to the message.
+ * <p>
+ * <i>Reserved for future use. Currently returns the message unmodified.</i>
+ *
+ * @param message The message or <code>null</code>.
+ * @return The checked message.
+ */
+ protected String checkMessage(String message) {
+ return message;
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/extensions/StepGroup.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/extensions/StepGroup.java
index 68799fe3c..d488a31da 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/extensions/StepGroup.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/extensions/StepGroup.java
@@ -1,872 +1,872 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Wind River Systems, Inc. and others. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.tcf.te.runtime.stepper.extensions;
-
-import java.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.expressions.EvaluationContext;
-import org.eclipse.core.expressions.EvaluationResult;
-import org.eclipse.core.expressions.Expression;
-import org.eclipse.core.expressions.ExpressionConverter;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.tcf.te.runtime.extensions.ExecutableExtension;
-import org.eclipse.tcf.te.runtime.extensions.ExecutableExtensionProxy;
-import org.eclipse.tcf.te.runtime.interfaces.extensions.IExecutableExtension;
-import org.eclipse.tcf.te.runtime.stepper.StepperManager;
-import org.eclipse.tcf.te.runtime.stepper.activator.CoreBundleActivator;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IStep;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepGroup;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepGroupIterator;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepGroupable;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.tracing.ITraceIds;
-import org.eclipse.tcf.te.runtime.stepper.nls.Messages;
-
-/**
- * A default step group implementation.
- */
-public class StepGroup extends ExecutableExtension implements IStepGroup {
-
- private boolean locked;
- private String baseOn;
-
- private final List<ReferenceSubElement> references = new ArrayList<ReferenceSubElement>();
-
- private ExecutableExtensionProxy<IStepGroupIterator> iteratorProxy = null;
-
- /**
- * Constant to be returned in case the step group contains no steps.
- */
- protected final static IStepGroupable[] NO_STEPS = new IStepGroupable[0];
-
- /**
- * Step group reference sub element.
- */
- protected final static class ReferenceSubElement implements org.eclipse.core.runtime.IExecutableExtension {
- private String id;
- private String secondaryId;
- private String insertBefore;
- private String insertAfter;
- private String overwrite;
- private boolean removable;
- private boolean hidden;
- private boolean disable;
- private boolean singleton;
- private final List<String> dependencies = new ArrayList<String>();
- private Expression expression;
- private Map<String,String> parameters = new HashMap<String, String>();
-
- /**
- * Returns the id of the referenced step or step group.
- *
- * @return The id of the referenced step or step group.
- */
- public String getId() {
- return id;
- }
-
- /**
- * Returns the secondary id of the referenced step or step group.
- *
- * @return The secondary id or <code>null</code>.
- */
- public String getSecondaryId() {
- return secondaryId;
- }
-
- /**
- * Sets the secondary id of the referenced step or step group.
- *
- * @return The secondary id or <code>null</code>.
- */
- public void setSecondardId(String secondaryId) {
- this.secondaryId = secondaryId;
- }
-
- /**
- * Returns the id of the step or step group the referenced
- * step or group shall be inserted before.
- *
- * @return The id or <code>null</code>.
- */
- public String getInsertBefore() {
- return insertBefore;
- }
-
- /**
- * Returns the id of the step or step group the referenced
- * step or group shall be inserted after.
- *
- * @return The id or <code>null</code>.
- */
- public String getInsertAfter() {
- return insertAfter;
- }
-
- /**
- * Returns the id of the step or step group the referenced
- * step or group do overwrite.
- *
- * @return The id or <code>null</code>.
- */
- public String getOverwrite() {
- return overwrite;
- }
-
- /**
- * Returns if or if not the referenced step or step group
- * can be removed by the user from the group.
- *
- * @return <code>True</code> if removable, <code>false</code> otherwise.
- */
- public boolean isRemovable() {
- return removable;
- }
-
- /**
- * Returns if or if not the referenced step or step group
- * is hidden.
- *
- * @return <code>True</code> if hidden, <code>false</code> otherwise.
- */
- public boolean isHidden() {
- return hidden;
- }
-
- /**
- * Returns if or if not to disable the referenced step or step group.
- *
- * @return <code>True</code> if to disable, <code>false</code> otherwise.
- */
- public boolean isDisable() {
- return disable;
- }
-
- /**
- * Returns if or if not the referenced step or step group is a singleton.
- *
- * @return <code>True</code> if singleton, <code>false</code> otherwise.
- */
- public boolean isSingleton() {
- return singleton;
- }
-
- /**
- * Returns the list of dependencies.
- * <p>
- * The step or step group id might be fully qualified using the form
- * <code>&quot;primaryId##secondaryId</code>. The <code>secondaryId</code> is optional.
- *
- * @return The list of dependencies or an empty list.
- */
- public String[] getDependencies() {
- return dependencies.toArray(new String[dependencies.size()]);
- }
-
- /**
- * Returns the enablement expression which is associated with this reference.
- *
- * @return The enablement expression or <code>null</code>.
- */
- public Expression getEnablement() {
- return expression;
- }
-
- /**
- * Returns the parameters for the step.
- *
- * @return The parameters or an empty Map.
- */
- public Map<String,String> getParameters() {
- return parameters;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IExecutableExtension#setInitializationData(org.eclipse.core.runtime.IConfigurationElement, java.lang.String, java.lang.Object)
- */
- @Override
- public void setInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException {
- if (config == null) {
- return;
- }
-
- String value = config.getAttribute("id"); //$NON-NLS-1$
- if (value != null && value.trim().length() > 0) {
- this.id = value.trim();
- }
-
- value = config.getAttribute("secondaryId"); //$NON-NLS-1$
- setSecondardId(value != null && value.trim().length() > 0 ? value.trim() : null);
-
- value = config.getAttribute("insertBefore"); //$NON-NLS-1$
- if (value != null && value.trim().length() > 0) {
- this.insertBefore = value.trim();
- }
-
- value = config.getAttribute("insertAfter"); //$NON-NLS-1$
- if (value != null && value.trim().length() > 0) {
- this.insertAfter = value.trim();
- }
-
- value = config.getAttribute("overwrite"); //$NON-NLS-1$
- if (value != null && value.trim().length() > 0) {
- this.overwrite = value.trim();
- }
-
- value = config.getAttribute("removable"); //$NON-NLS-1$
- if (value != null && value.trim().length() > 0) {
- this.removable = Boolean.parseBoolean(value.trim());
- }
-
- value = config.getAttribute("hidden"); //$NON-NLS-1$
- if (value != null && value.trim().length() > 0) {
- this.hidden = Boolean.parseBoolean(value.trim());
- }
-
- value = config.getAttribute("disable"); //$NON-NLS-1$
- if (value != null && value.trim().length() > 0) {
- this.disable = Boolean.parseBoolean(value.trim());
- }
-
- value = config.getAttribute("singleton"); //$NON-NLS-1$
- if (value != null && value.trim().length() > 0) {
- this.singleton = Boolean.parseBoolean(value.trim());
- }
-
- // Read in the list of dependencies if specified.
- dependencies.clear();
- IConfigurationElement[] requires = config.getChildren("requires"); //$NON-NLS-1$
- for (IConfigurationElement require : requires) {
- value = require.getAttribute("id"); //$NON-NLS-1$
- if (value == null || value.trim().length() == 0) {
- throw new CoreException(new Status(IStatus.ERROR,
- CoreBundleActivator.getUniqueIdentifier(),
- 0,
- NLS.bind(Messages.AbstractStep_error_missingRequiredAttribute,
- "dependency id (requires)", //$NON-NLS-1$
- config.getName()),
- null));
- }
- if (!dependencies.contains(value.trim())) {
- dependencies.add(value.trim());
- }
- }
-
- // Read the sub elements of the extension
- IConfigurationElement[] enablements = config.getChildren("enablement"); //$NON-NLS-1$
- // The "enablement" element is the only expected one
- if (enablements != null && enablements.length > 0) {
- expression = ExpressionConverter.getDefault().perform(enablements[0]);
- }
-
- // Read the sub elements of the extension
- IConfigurationElement[] params = config.getChildren("parameter"); //$NON-NLS-1$
- // The "paramter" element is the only expected one
- if (params != null && params.length > 0) {
- for (IConfigurationElement parameter : params) {
- parameters.put(parameter.getAttribute("name"), parameter.getAttribute("value")); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals(Object obj) {
- if (getId() != null && obj instanceof ReferenceSubElement) {
- boolean secondaryIdEquals = false;
- if (getSecondaryId() == null) {
- secondaryIdEquals = ((ReferenceSubElement)obj).getSecondaryId() == null;
- }
- else {
- secondaryIdEquals = getSecondaryId().equals(((ReferenceSubElement)obj).getSecondaryId());
- }
-
- return getId().equals(((ReferenceSubElement)obj).getId()) && secondaryIdEquals;
- }
- return super.equals(obj);
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#hashCode()
- */
- @Override
- public int hashCode() {
- return getId() != null ? getId().hashCode() + (getSecondaryId() != null ? getSecondaryId().hashCode() : 0) : super.hashCode();
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- @Override
- public String toString() {
- StringBuffer buffer = new StringBuffer(getClass().getSimpleName());
- buffer.append(": "); //$NON-NLS-1$
- buffer.append("id = " + getId()); //$NON-NLS-1$
- buffer.append(", secondaryId = " + getSecondaryId()); //$NON-NLS-1$
- buffer.append(", insertBefore = " + getInsertBefore()); //$NON-NLS-1$
- buffer.append(", insertAfter = " + getInsertAfter()); //$NON-NLS-1$
- buffer.append(", overwrite = " + getOverwrite()); //$NON-NLS-1$
- buffer.append(", removable = " + isRemovable()); //$NON-NLS-1$
- buffer.append(", hidden = " + isHidden()); //$NON-NLS-1$
- buffer.append(", disable = " + isDisable()); //$NON-NLS-1$
- buffer.append(", singleton = " + isSingleton()); //$NON-NLS-1$
- buffer.append(", parameters = " + getParameters()); //$NON-NLS-1$
- return buffer.toString();
- }
- }
-
- /**
- * Constructor.
- */
- public StepGroup() {
- super();
- locked = false;
- baseOn = null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.stepper.AbstractContextStepGroup#isLocked()
- */
- @Override
- public boolean isLocked() {
- return locked;
- }
-
- /**
- * Returns the id of the step group this step group is
- * initially based on.
- *
- * @return The id or <code>null</code>.
- */
- protected String getBaseOn() {
- return baseOn;
- }
-
- /**
- * Returns the references.
- */
- protected List<ReferenceSubElement> getReferences() {
- return references;
- }
-
- /**
- * Check for duplicates of the referenced step or step group. The check will fail if multiple
- * occurrence of a step or step group are found and the step or step group is supposed to be a
- * singleton.
- *
- * @param steps The list of steps. Must not be <code>null</code>.
- * @param reference The reference. Must not be <code>null</code>.
- *
- * @throws CoreException If multiple occurrences of singleton references are found.
- */
- protected void checkForDuplicates(List<IStepGroupable> steps, ReferenceSubElement reference) throws CoreException {
- Assert.isNotNull(steps);
- Assert.isNotNull(reference);
-
- // If the reference overwrites another reference, it is not a duplicate
- String overwrite = reference.getOverwrite();
- if (overwrite != null && overwrite.length() > 0) {
- return;
- }
-
- boolean checkFailed = false;
-
- for (IStepGroupable step : steps) {
- if (step.getExtension().getId().equals(reference.getId())) {
- // We've found an existing groupable with the reference id.
- // If either the groupable, the reference or the extension is
- // marked singleton, than this is an failure.
- checkFailed = step.isSingleton() || reference.isSingleton()
- || (step.getExtension() instanceof IStep && ((IStep)step.getExtension()).isSingleton());
- if (checkFailed) {
- break;
- }
- }
- }
-
- if (checkFailed) {
- throw new CoreException(new Status(IStatus.ERROR,
- CoreBundleActivator.getUniqueIdentifier(),
- MessageFormat.format(Messages.StepGroup_error_multipleSingletonOccurrences,
- NLS.bind(Messages.StepGroup_error_stepGroup, getLabel()),
- NLS.bind(Messages.StepGroup_error_referencedStepOrGroup, reference.getId()))
- ));
- }
- }
-
- /**
- * Replace all references to a given step or step group with another one.
- *
- * @param steps The list of steps. Must not be <code>null</code>.
- * @param oldId The id of the step or step group to replace. Must not be <code>null</code>.
- * @param replacement The replacement. Must not be <code>null</code>.
- * @param reference The reference sub element. Must not be <code>null</code>.
- *
- * @return The list of affected groupable's or an empty list.
- */
- protected List<IStepGroupable> onOverwrite(List<IStepGroupable> steps, String oldId, IExecutableExtension replacement, ReferenceSubElement reference) {
- Assert.isNotNull(steps);
- Assert.isNotNull(oldId);
- Assert.isNotNull(replacement);
- Assert.isNotNull(reference);
-
- List<IStepGroupable> affected = new ArrayList<IStepGroupable>();
-
- // Isolate primary and secondary id
- String primaryId = oldId;
- String secondaryId = null;
-
- String[] splitted = oldId.split("##", 2); //$NON-NLS-1$
- if (splitted.length == 2) {
- primaryId = splitted[0];
- secondaryId = splitted[1];
- }
-
- for (IStepGroupable step : steps) {
- // A step is clearly affected if the primary id and the secondary
- // id (if any) matches the overwritten id
- if (step.getExtension().getId().equals(primaryId)
- && (secondaryId == null || secondaryId.equals(step.getSecondaryId()))) {
- if (step instanceof StepGroupable) {
- StepGroupable groupable = ((StepGroupable)step);
- // Update the grouped extension
- groupable.setExtension(replacement);
- // Update the groupable secondary id
- groupable.setSecondaryId(reference.getSecondaryId());
- // Add the groupable to the list of affected steps
- affected.add(step);
- }
- }
-
- // A step is affected as well if the step depends on the overwritten step
- // In this case we have to update the dependencies.
- List<String> dependencies = new ArrayList<String>(Arrays.asList(step.getDependencies()));
- if (dependencies.contains(oldId)) {
- String fullId = replacement.getId() + (reference.getSecondaryId() != null ? "##" + reference.getSecondaryId() : ""); //$NON-NLS-1$ //$NON-NLS-2$
- // We have to replace the dependency at the exact position within the list
- dependencies.set(dependencies.indexOf(oldId), fullId);
- if (step instanceof StepGroupable) {
- ((StepGroupable)step).setDependencies(dependencies.toArray(new String[dependencies.size()]));
- }
- }
- }
-
- return affected;
- }
-
- /**
- * Insert the step before the specified step or step group. If no step or
- * step group with the given id exist, the step is added to the end.
- *
- * @param steps The list of steps. Must not be <code>null</code>.
- * @param id The id of the step or step group where to insert the new step before. Must not be <code>null</code>.
- * @param newStep The step to add. Must not be <code>null</code>.
- * @param reference The reference sub element. Must not be <code>null</code>.
- *
- * @return The list of affected groupable's or an empty list.
- */
- protected List<IStepGroupable> onInsertBefore(List<IStepGroupable> steps, String id, IExecutableExtension newStep, ReferenceSubElement reference) {
- Assert.isNotNull(steps);
- Assert.isNotNull(id);
- Assert.isNotNull(newStep);
- Assert.isNotNull(reference);
-
- List<IStepGroupable> affected = new ArrayList<IStepGroupable>();
-
- // Isolate primary and secondary id
- String primaryId = id;
- String secondaryId = null;
-
- String[] splitted = id.split("##", 2); //$NON-NLS-1$
- if (splitted.length == 2) {
- primaryId = splitted[0];
- secondaryId = splitted[1];
- }
-
- // Always loop over all steps in case the anchor step is available
- // multiple times. In such case, the new step is inserted at all
- // occurrences.
- for (int i = 0; i < steps.size(); i++) {
- IStepGroupable step = steps.get(i);
- if (!step.getExtension().getId().equals(primaryId)) {
- continue;
- }
- if (secondaryId != null && !secondaryId.equals(step.getSecondaryId())) {
- continue;
- }
-
- // Create a new groupable object for inserting
- IStepGroupable groupable = new StepGroupable(newStep, reference.getSecondaryId());
- // Insert the new step at the current position
- steps.add(i, groupable);
- // And increase the counter --> Otherwise we would see the
- // same step we want to insert before again!
- i++;
- // Add the new groupable to the list of affected steps
- affected.add(groupable);
- }
-
- // If the step could not be added, add to the end of the list
- if (affected.isEmpty()) {
- IStepGroupable groupable = new StepGroupable(newStep, reference.getSecondaryId());
- steps.add(groupable);
- }
-
- return affected;
- }
-
- /**
- * Insert the step after the specified step or step group. If no step or
- * step group with the given id exist, the step is added to the end.
- *
- * @param steps The list of steps. Must not be <code>null</code>.
- * @param id The id of the step or step group where to insert the new step after. Must not be <code>null</code>.
- * @param newStep The step to add. Must not be <code>null</code>.
- * @param reference The reference sub element. Must not be <code>null</code>.
- *
- * @return The list of affected groupable's or an empty list.
- */
- protected List<IStepGroupable> onInsertAfter(List<IStepGroupable> steps, String id, IExecutableExtension newStep, ReferenceSubElement reference) {
- Assert.isNotNull(steps);
- Assert.isNotNull(id);
- Assert.isNotNull(newStep);
- Assert.isNotNull(reference);
-
- List<IStepGroupable> affected = new ArrayList<IStepGroupable>();
-
- // Isolate primary and secondary id
- String primaryId = id;
- String secondaryId = null;
-
- String[] splitted = id.split("##", 2); //$NON-NLS-1$
- if (splitted.length == 2) {
- primaryId = splitted[0];
- secondaryId = splitted[1];
- }
-
- // Always loop over all steps in case the anchor step is available
- // multiple times. In such case, the new step is inserted at all
- // occurrences.
- for (int i = 0; i < steps.size(); i++) {
- IStepGroupable step = steps.get(i);
- if (!step.getExtension().getId().equals(primaryId)) {
- continue;
- }
- if (secondaryId != null && !secondaryId.equals(step.getSecondaryId())) {
- continue;
- }
-
- // Create a new groupable object for inserting
- IStepGroupable groupable = new StepGroupable(newStep, reference.getSecondaryId());
- // Insert the new groupable after the current step or at the end (if i + 1 == steps.size())
- steps.add(i + 1, groupable);
- // Add the new groupable to the list of affected steps
- affected.add(groupable);
- }
-
- // If the step could not be added, add to the end of the list
- if (affected.isEmpty()) {
- IStepGroupable groupable = new StepGroupable(newStep, reference.getSecondaryId());
- steps.add(groupable);
- }
-
- return affected;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStepGroup#getSteps(org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext)
- */
- @Override
- public IStepGroupable[] getSteps(IStepContext context) throws CoreException {
- Assert.isNotNull(context);
-
- // The list of resolved steps for the specified type and mode
- List<IStepGroupable> steps = new ArrayList<IStepGroupable>();
-
- // If this step group is based on another step group, we have to get the resolved
- // steps from there first.
- if (getBaseOn() != null) {
- IStepGroup baseStepGroup = StepperManager.getInstance().getStepGroupExtManager().getStepGroup(getBaseOn(), true);
- // If the base step group cannot be found, that's an error. We cannot continue
- // without the base group.
- if (baseStepGroup == null) {
- throw new CoreException(new Status(IStatus.ERROR,
- CoreBundleActivator.getUniqueIdentifier(),
- MessageFormat.format(Messages.StepGroup_error_missingBaseStepGroup,
- NLS.bind(Messages.StepGroup_error_stepGroup, getLabel()),
- NLS.bind(Messages.StepGroup_error_referencedBaseGroup, getBaseOn()))
- ));
- }
-
- // Add all the steps from the base step group now to the list
- steps.addAll(Arrays.asList(baseStepGroup.getSteps(context)));
- }
-
- // Now process the references and modify the steps list accordingly
- for (ReferenceSubElement reference : getReferences()) {
- // Get the step or step group for the referenced id. Try the steps first.
- IExecutableExtension candidate = getCandidate(reference.getId(), reference);
-
- // If the candidate is null here, that's an error as a referenced step is missing.
- if (candidate == null) {
- throw new CoreException(new Status(IStatus.ERROR,
- CoreBundleActivator.getUniqueIdentifier(),
- MessageFormat.format(Messages.StepGroup_error_missingReferencedStep,
- NLS.bind(Messages.StepGroup_error_stepGroup, getLabel()),
- NLS.bind(Messages.StepGroup_error_referencedStepOrGroup, reference.getId()))
- ));
- }
-
- // Check if the step is valid for the current contexts.
- boolean valid = isValidReference(reference, context);
-
- if (!valid) {
- CoreBundleActivator.getTraceHandler().trace(
- "StepGroup#getSteps: SKIPPED reference = '" + candidate.getLabel() + "'." //$NON-NLS-1$ //$NON-NLS-2$
- + " Not valid for contexts '" + context, //$NON-NLS-1$
- 0, ITraceIds.TRACE_STEPPING, IStatus.WARNING, this);
- continue;
- }
-
- // Check for duplicates of singleton references.
- checkForDuplicates(steps, reference);
-
- // Check for the steps own dependencies to be valid for the current type id and mode
- if (candidate instanceof IStep) {
- checkForDependenciesValid((IStep)candidate, context);
- }
-
- // Will contain the list of affected groupables from the whole list
- List<IStepGroupable> affectedGroupables = new ArrayList<IStepGroupable>();
-
- // Check first for overwriting groupables
- String overwrite = reference.getOverwrite();
- if (overwrite != null && overwrite.length() > 0) {
- affectedGroupables.addAll(onOverwrite(steps, overwrite, candidate, reference));
- } else {
- // overwrite is not set -> process insertBefore or insertAfter
- String insertBefore = reference.getInsertBefore();
- String insertAfter = reference.getInsertAfter();
-
- // If neither one is specified, the step or step group will be to the end of the list
- if ((insertBefore == null || insertBefore.length() == 0)
- && (insertAfter == null || insertAfter.length() == 0)) {
- IStepGroupable groupable = new StepGroupable(candidate, reference.getSecondaryId());
- steps.add(groupable);
- affectedGroupables.add(groupable);
- } else {
- // insertBefore comes first
- if (insertBefore != null && insertBefore.length() > 0) {
- affectedGroupables.addAll(onInsertBefore(steps, insertBefore, candidate, reference));
- } else {
- affectedGroupables.addAll(onInsertAfter(steps, insertAfter, candidate, reference));
- }
- }
- }
-
- // Process the groupable attributes on all affected groupables
- for (IStepGroupable step : affectedGroupables) {
- if (!(step instanceof StepGroupable)) {
- continue;
- }
-
- StepGroupable groupable = (StepGroupable)step;
- groupable.setDependencies(reference.getDependencies());
-
- if (!reference.isRemovable() && groupable.isRemovable()) {
- groupable.setRemovable(reference.isRemovable());
- }
- if (reference.isHidden() && !groupable.isHidden()) {
- groupable.setHidden(reference.isHidden());
- }
- if (reference.isDisable() && !groupable.isDisabled()) {
- groupable.setDisabled(reference.isDisable());
- }
- if (reference.isSingleton() && !groupable.isSingleton()) {
- groupable.setSingleton(reference.isSingleton());
- }
- }
- }
-
- return !steps.isEmpty() ? steps.toArray(new IStepGroupable[steps.size()]) : NO_STEPS;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.extensions.ExecutableExtension#setInitializationData(org.eclipse.core.runtime.IConfigurationElement, java.lang.String, java.lang.Object)
- */
- @Override
- public void setInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException {
- references.clear();
- super.setInitializationData(config, propertyName, data);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.stepper.extensions.AbstractStepGroup#doSetInitializationData(org.eclipse.core.runtime.IConfigurationElement, java.lang.String, java.lang.Object)
- */
- @Override
- public void doSetInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException {
- super.doSetInitializationData(config, propertyName, data);
-
- if (iteratorProxy == null) {
- iteratorProxy = new ExecutableExtensionProxy<IStepGroupIterator>(config) {
- @Override
- protected String getExecutableExtensionAttributeName() {
- return "iterator"; //$NON-NLS-1$
- }
- };
- }
-
- if (!locked) {
- String lockedAttribute = config.getAttribute("locked"); //$NON-NLS-1$
- if (lockedAttribute != null) {
- this.locked = Boolean.parseBoolean(lockedAttribute);
- }
- }
-
- if (baseOn == null || baseOn.trim().length() == 0) {
- String baseOnAttribute = config.getAttribute("baseOn"); //$NON-NLS-1$
- if (baseOnAttribute != null && baseOnAttribute.trim().length() > 0) {
- this.baseOn = baseOnAttribute.trim();
- }
- }
-
- Map<String, Integer> occurrences = new HashMap<String, Integer>();
- IConfigurationElement[] childElements = config.getChildren("references"); //$NON-NLS-1$
- for (IConfigurationElement childElement : childElements) {
- IConfigurationElement[] references = childElement.getChildren("reference"); //$NON-NLS-1$
- for (IConfigurationElement reference : references) {
- ReferenceSubElement candidate = new ReferenceSubElement();
- candidate.setInitializationData(reference, reference.getName(), null);
- // If multiple references to the same step or step group exist, check
- // for the secondaryId
- if (occurrences.containsKey(candidate.getId())) {
- // Occurrences are counted up always
- int number = occurrences.get(candidate.getId()).intValue() + 1;
- occurrences.put(candidate.getId(), Integer.valueOf(number));
-
- if (candidate.getSecondaryId() == null) {
- // secondaryId not explicitly set -> auto set
- candidate.setSecondardId(Integer.toString(number));
- }
- } else {
- // remember the occurrence of the reference
- occurrences.put(candidate.getId(), Integer.valueOf(1));
- }
-
- // References are not sorted out here. That's the task of the resolver.
- this.references.add(candidate);
- }
- }
- }
-
-
- /**
- * Checks if all dependencies of the given step are available
- * and valid for the given type id and mode.
- *
- * @param step The step. Must not be <code>null</code>.
- * @param context The context. Must not be <code>null</code>.
- *
- * @throws CoreException If a required step or step group is not available or not valid.
- */
- protected void checkForDependenciesValid(IStep step, IStepContext context) throws CoreException {
- Assert.isNotNull(step);
- Assert.isNotNull(context);
-
- String[] dependencies = step.getDependencies();
- for (String dependency : dependencies) {
- IExecutableExtension candidate = getCandidate(dependency, null);
-
- // If the candidate is null here, that's an error as a required step or step group is missing.
- if (candidate == null) {
- throw new CoreException(new Status(IStatus.ERROR,
- CoreBundleActivator.getUniqueIdentifier(),
- MessageFormat.format(Messages.StepGroup_error_missingRequiredStep,
- NLS.bind(Messages.StepGroup_error_step, step.getLabel()),
- NLS.bind(Messages.StepGroup_error_requiredStepOrGroup, dependency))
- ));
- }
- }
- }
-
- /**
- * Returns a candidate for the given reference.
- * @param reference The reference.
- * @return The candidate. Can be either an IStep or IStepGroup.
- */
- protected IExecutableExtension getCandidate(String id, ReferenceSubElement reference) {
- Assert.isNotNull(id);
- IExecutableExtension candidate = StepperManager.getInstance().getStepExtManager().getStep(id, true);
- if (candidate == null) {
- candidate = StepperManager.getInstance().getStepGroupExtManager().getStepGroup(id, true);
- }
- else if (reference != null && candidate instanceof IStep) {
- ((IStep)candidate).setParameters(reference.getParameters());
- }
- return candidate;
- }
-
- /**
- * Returns if or if not the reference is valid for the given contexts.
- *
- * @param reference The reference. Must not be <code>null</code>.
- * @param context The context or <code>null</code>.
- *
- * @return <code>True</code> if the step is valid, <code>false</code> otherwise.
- */
- protected boolean isValidReference(ReferenceSubElement reference, IStepContext context) {
- Assert.isNotNull(reference);
- // Get the enablement.
- Expression enablement = reference.getEnablement();
-
- if (enablement != null) {
- if (context != null) {
- // Set the default variable to the context.
- EvaluationContext evalContext = new EvaluationContext(null, context.getContextObject());
- // Initialize the evaluation context named variables
- evalContext.addVariable("context", context); //$NON-NLS-1$
- evalContext.addVariable("id", context.getId()); //$NON-NLS-1$
- // Allow plugin activation
- evalContext.setAllowPluginActivation(true);
- // Evaluate the expression
- try {
- return enablement.evaluate(evalContext).equals(EvaluationResult.TRUE);
- } catch (CoreException e) {
- IStatus status = new Status(IStatus.ERROR, CoreBundleActivator.getUniqueIdentifier(),
- e.getLocalizedMessage(), e);
- Platform.getLog(CoreBundleActivator.getContext().getBundle()).log(status);
- }
- }
- return false;
- }
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStepGroup#getStepGroupIterator()
- */
- @Override
- public IStepGroupIterator getStepGroupIterator() {
- return iteratorProxy != null ? iteratorProxy.newInstance() : null;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011, 2013 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.runtime.stepper.extensions;
+
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.expressions.EvaluationContext;
+import org.eclipse.core.expressions.EvaluationResult;
+import org.eclipse.core.expressions.Expression;
+import org.eclipse.core.expressions.ExpressionConverter;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.tcf.te.runtime.extensions.ExecutableExtension;
+import org.eclipse.tcf.te.runtime.extensions.ExecutableExtensionProxy;
+import org.eclipse.tcf.te.runtime.interfaces.extensions.IExecutableExtension;
+import org.eclipse.tcf.te.runtime.stepper.StepperManager;
+import org.eclipse.tcf.te.runtime.stepper.activator.CoreBundleActivator;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IStep;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepGroup;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepGroupIterator;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepGroupable;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.tracing.ITraceIds;
+import org.eclipse.tcf.te.runtime.stepper.nls.Messages;
+
+/**
+ * A default step group implementation.
+ */
+public class StepGroup extends ExecutableExtension implements IStepGroup {
+
+ private boolean locked;
+ private String baseOn;
+
+ private final List<ReferenceSubElement> references = new ArrayList<ReferenceSubElement>();
+
+ private ExecutableExtensionProxy<IStepGroupIterator> iteratorProxy = null;
+
+ /**
+ * Constant to be returned in case the step group contains no steps.
+ */
+ protected final static IStepGroupable[] NO_STEPS = new IStepGroupable[0];
+
+ /**
+ * Step group reference sub element.
+ */
+ protected final static class ReferenceSubElement implements org.eclipse.core.runtime.IExecutableExtension {
+ private String id;
+ private String secondaryId;
+ private String insertBefore;
+ private String insertAfter;
+ private String overwrite;
+ private boolean removable;
+ private boolean hidden;
+ private boolean disable;
+ private boolean singleton;
+ private final List<String> dependencies = new ArrayList<String>();
+ private Expression expression;
+ private Map<String,String> parameters = new HashMap<String, String>();
+
+ /**
+ * Returns the id of the referenced step or step group.
+ *
+ * @return The id of the referenced step or step group.
+ */
+ public String getId() {
+ return id;
+ }
+
+ /**
+ * Returns the secondary id of the referenced step or step group.
+ *
+ * @return The secondary id or <code>null</code>.
+ */
+ public String getSecondaryId() {
+ return secondaryId;
+ }
+
+ /**
+ * Sets the secondary id of the referenced step or step group.
+ *
+ * @return The secondary id or <code>null</code>.
+ */
+ public void setSecondardId(String secondaryId) {
+ this.secondaryId = secondaryId;
+ }
+
+ /**
+ * Returns the id of the step or step group the referenced
+ * step or group shall be inserted before.
+ *
+ * @return The id or <code>null</code>.
+ */
+ public String getInsertBefore() {
+ return insertBefore;
+ }
+
+ /**
+ * Returns the id of the step or step group the referenced
+ * step or group shall be inserted after.
+ *
+ * @return The id or <code>null</code>.
+ */
+ public String getInsertAfter() {
+ return insertAfter;
+ }
+
+ /**
+ * Returns the id of the step or step group the referenced
+ * step or group do overwrite.
+ *
+ * @return The id or <code>null</code>.
+ */
+ public String getOverwrite() {
+ return overwrite;
+ }
+
+ /**
+ * Returns if or if not the referenced step or step group
+ * can be removed by the user from the group.
+ *
+ * @return <code>True</code> if removable, <code>false</code> otherwise.
+ */
+ public boolean isRemovable() {
+ return removable;
+ }
+
+ /**
+ * Returns if or if not the referenced step or step group
+ * is hidden.
+ *
+ * @return <code>True</code> if hidden, <code>false</code> otherwise.
+ */
+ public boolean isHidden() {
+ return hidden;
+ }
+
+ /**
+ * Returns if or if not to disable the referenced step or step group.
+ *
+ * @return <code>True</code> if to disable, <code>false</code> otherwise.
+ */
+ public boolean isDisable() {
+ return disable;
+ }
+
+ /**
+ * Returns if or if not the referenced step or step group is a singleton.
+ *
+ * @return <code>True</code> if singleton, <code>false</code> otherwise.
+ */
+ public boolean isSingleton() {
+ return singleton;
+ }
+
+ /**
+ * Returns the list of dependencies.
+ * <p>
+ * The step or step group id might be fully qualified using the form
+ * <code>&quot;primaryId##secondaryId</code>. The <code>secondaryId</code> is optional.
+ *
+ * @return The list of dependencies or an empty list.
+ */
+ public String[] getDependencies() {
+ return dependencies.toArray(new String[dependencies.size()]);
+ }
+
+ /**
+ * Returns the enablement expression which is associated with this reference.
+ *
+ * @return The enablement expression or <code>null</code>.
+ */
+ public Expression getEnablement() {
+ return expression;
+ }
+
+ /**
+ * Returns the parameters for the step.
+ *
+ * @return The parameters or an empty Map.
+ */
+ public Map<String,String> getParameters() {
+ return parameters;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.IExecutableExtension#setInitializationData(org.eclipse.core.runtime.IConfigurationElement, java.lang.String, java.lang.Object)
+ */
+ @Override
+ public void setInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException {
+ if (config == null) {
+ return;
+ }
+
+ String value = config.getAttribute("id"); //$NON-NLS-1$
+ if (value != null && value.trim().length() > 0) {
+ this.id = value.trim();
+ }
+
+ value = config.getAttribute("secondaryId"); //$NON-NLS-1$
+ setSecondardId(value != null && value.trim().length() > 0 ? value.trim() : null);
+
+ value = config.getAttribute("insertBefore"); //$NON-NLS-1$
+ if (value != null && value.trim().length() > 0) {
+ this.insertBefore = value.trim();
+ }
+
+ value = config.getAttribute("insertAfter"); //$NON-NLS-1$
+ if (value != null && value.trim().length() > 0) {
+ this.insertAfter = value.trim();
+ }
+
+ value = config.getAttribute("overwrite"); //$NON-NLS-1$
+ if (value != null && value.trim().length() > 0) {
+ this.overwrite = value.trim();
+ }
+
+ value = config.getAttribute("removable"); //$NON-NLS-1$
+ if (value != null && value.trim().length() > 0) {
+ this.removable = Boolean.parseBoolean(value.trim());
+ }
+
+ value = config.getAttribute("hidden"); //$NON-NLS-1$
+ if (value != null && value.trim().length() > 0) {
+ this.hidden = Boolean.parseBoolean(value.trim());
+ }
+
+ value = config.getAttribute("disable"); //$NON-NLS-1$
+ if (value != null && value.trim().length() > 0) {
+ this.disable = Boolean.parseBoolean(value.trim());
+ }
+
+ value = config.getAttribute("singleton"); //$NON-NLS-1$
+ if (value != null && value.trim().length() > 0) {
+ this.singleton = Boolean.parseBoolean(value.trim());
+ }
+
+ // Read in the list of dependencies if specified.
+ dependencies.clear();
+ IConfigurationElement[] requires = config.getChildren("requires"); //$NON-NLS-1$
+ for (IConfigurationElement require : requires) {
+ value = require.getAttribute("id"); //$NON-NLS-1$
+ if (value == null || value.trim().length() == 0) {
+ throw new CoreException(new Status(IStatus.ERROR,
+ CoreBundleActivator.getUniqueIdentifier(),
+ 0,
+ NLS.bind(Messages.AbstractStep_error_missingRequiredAttribute,
+ "dependency id (requires)", //$NON-NLS-1$
+ config.getName()),
+ null));
+ }
+ if (!dependencies.contains(value.trim())) {
+ dependencies.add(value.trim());
+ }
+ }
+
+ // Read the sub elements of the extension
+ IConfigurationElement[] enablements = config.getChildren("enablement"); //$NON-NLS-1$
+ // The "enablement" element is the only expected one
+ if (enablements != null && enablements.length > 0) {
+ expression = ExpressionConverter.getDefault().perform(enablements[0]);
+ }
+
+ // Read the sub elements of the extension
+ IConfigurationElement[] params = config.getChildren("parameter"); //$NON-NLS-1$
+ // The "paramter" element is the only expected one
+ if (params != null && params.length > 0) {
+ for (IConfigurationElement parameter : params) {
+ parameters.put(parameter.getAttribute("name"), parameter.getAttribute("value")); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj) {
+ if (getId() != null && obj instanceof ReferenceSubElement) {
+ boolean secondaryIdEquals = false;
+ if (getSecondaryId() == null) {
+ secondaryIdEquals = ((ReferenceSubElement)obj).getSecondaryId() == null;
+ }
+ else {
+ secondaryIdEquals = getSecondaryId().equals(((ReferenceSubElement)obj).getSecondaryId());
+ }
+
+ return getId().equals(((ReferenceSubElement)obj).getId()) && secondaryIdEquals;
+ }
+ return super.equals(obj);
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode() {
+ return getId() != null ? getId().hashCode() + (getSecondaryId() != null ? getSecondaryId().hashCode() : 0) : super.hashCode();
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+ StringBuffer buffer = new StringBuffer(getClass().getSimpleName());
+ buffer.append(": "); //$NON-NLS-1$
+ buffer.append("id = " + getId()); //$NON-NLS-1$
+ buffer.append(", secondaryId = " + getSecondaryId()); //$NON-NLS-1$
+ buffer.append(", insertBefore = " + getInsertBefore()); //$NON-NLS-1$
+ buffer.append(", insertAfter = " + getInsertAfter()); //$NON-NLS-1$
+ buffer.append(", overwrite = " + getOverwrite()); //$NON-NLS-1$
+ buffer.append(", removable = " + isRemovable()); //$NON-NLS-1$
+ buffer.append(", hidden = " + isHidden()); //$NON-NLS-1$
+ buffer.append(", disable = " + isDisable()); //$NON-NLS-1$
+ buffer.append(", singleton = " + isSingleton()); //$NON-NLS-1$
+ buffer.append(", parameters = " + getParameters()); //$NON-NLS-1$
+ return buffer.toString();
+ }
+ }
+
+ /**
+ * Constructor.
+ */
+ public StepGroup() {
+ super();
+ locked = false;
+ baseOn = null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.stepper.AbstractContextStepGroup#isLocked()
+ */
+ @Override
+ public boolean isLocked() {
+ return locked;
+ }
+
+ /**
+ * Returns the id of the step group this step group is
+ * initially based on.
+ *
+ * @return The id or <code>null</code>.
+ */
+ protected String getBaseOn() {
+ return baseOn;
+ }
+
+ /**
+ * Returns the references.
+ */
+ protected List<ReferenceSubElement> getReferences() {
+ return references;
+ }
+
+ /**
+ * Check for duplicates of the referenced step or step group. The check will fail if multiple
+ * occurrence of a step or step group are found and the step or step group is supposed to be a
+ * singleton.
+ *
+ * @param steps The list of steps. Must not be <code>null</code>.
+ * @param reference The reference. Must not be <code>null</code>.
+ *
+ * @throws CoreException If multiple occurrences of singleton references are found.
+ */
+ protected void checkForDuplicates(List<IStepGroupable> steps, ReferenceSubElement reference) throws CoreException {
+ Assert.isNotNull(steps);
+ Assert.isNotNull(reference);
+
+ // If the reference overwrites another reference, it is not a duplicate
+ String overwrite = reference.getOverwrite();
+ if (overwrite != null && overwrite.length() > 0) {
+ return;
+ }
+
+ boolean checkFailed = false;
+
+ for (IStepGroupable step : steps) {
+ if (step.getExtension().getId().equals(reference.getId())) {
+ // We've found an existing groupable with the reference id.
+ // If either the groupable, the reference or the extension is
+ // marked singleton, than this is an failure.
+ checkFailed = step.isSingleton() || reference.isSingleton()
+ || (step.getExtension() instanceof IStep && ((IStep)step.getExtension()).isSingleton());
+ if (checkFailed) {
+ break;
+ }
+ }
+ }
+
+ if (checkFailed) {
+ throw new CoreException(new Status(IStatus.ERROR,
+ CoreBundleActivator.getUniqueIdentifier(),
+ MessageFormat.format(Messages.StepGroup_error_multipleSingletonOccurrences,
+ NLS.bind(Messages.StepGroup_error_stepGroup, getLabel()),
+ NLS.bind(Messages.StepGroup_error_referencedStepOrGroup, reference.getId()))
+ ));
+ }
+ }
+
+ /**
+ * Replace all references to a given step or step group with another one.
+ *
+ * @param steps The list of steps. Must not be <code>null</code>.
+ * @param oldId The id of the step or step group to replace. Must not be <code>null</code>.
+ * @param replacement The replacement. Must not be <code>null</code>.
+ * @param reference The reference sub element. Must not be <code>null</code>.
+ *
+ * @return The list of affected groupable's or an empty list.
+ */
+ protected List<IStepGroupable> onOverwrite(List<IStepGroupable> steps, String oldId, IExecutableExtension replacement, ReferenceSubElement reference) {
+ Assert.isNotNull(steps);
+ Assert.isNotNull(oldId);
+ Assert.isNotNull(replacement);
+ Assert.isNotNull(reference);
+
+ List<IStepGroupable> affected = new ArrayList<IStepGroupable>();
+
+ // Isolate primary and secondary id
+ String primaryId = oldId;
+ String secondaryId = null;
+
+ String[] splitted = oldId.split("##", 2); //$NON-NLS-1$
+ if (splitted.length == 2) {
+ primaryId = splitted[0];
+ secondaryId = splitted[1];
+ }
+
+ for (IStepGroupable step : steps) {
+ // A step is clearly affected if the primary id and the secondary
+ // id (if any) matches the overwritten id
+ if (step.getExtension().getId().equals(primaryId)
+ && (secondaryId == null || secondaryId.equals(step.getSecondaryId()))) {
+ if (step instanceof StepGroupable) {
+ StepGroupable groupable = ((StepGroupable)step);
+ // Update the grouped extension
+ groupable.setExtension(replacement);
+ // Update the groupable secondary id
+ groupable.setSecondaryId(reference.getSecondaryId());
+ // Add the groupable to the list of affected steps
+ affected.add(step);
+ }
+ }
+
+ // A step is affected as well if the step depends on the overwritten step
+ // In this case we have to update the dependencies.
+ List<String> dependencies = new ArrayList<String>(Arrays.asList(step.getDependencies()));
+ if (dependencies.contains(oldId)) {
+ String fullId = replacement.getId() + (reference.getSecondaryId() != null ? "##" + reference.getSecondaryId() : ""); //$NON-NLS-1$ //$NON-NLS-2$
+ // We have to replace the dependency at the exact position within the list
+ dependencies.set(dependencies.indexOf(oldId), fullId);
+ if (step instanceof StepGroupable) {
+ ((StepGroupable)step).setDependencies(dependencies.toArray(new String[dependencies.size()]));
+ }
+ }
+ }
+
+ return affected;
+ }
+
+ /**
+ * Insert the step before the specified step or step group. If no step or
+ * step group with the given id exist, the step is added to the end.
+ *
+ * @param steps The list of steps. Must not be <code>null</code>.
+ * @param id The id of the step or step group where to insert the new step before. Must not be <code>null</code>.
+ * @param newStep The step to add. Must not be <code>null</code>.
+ * @param reference The reference sub element. Must not be <code>null</code>.
+ *
+ * @return The list of affected groupable's or an empty list.
+ */
+ protected List<IStepGroupable> onInsertBefore(List<IStepGroupable> steps, String id, IExecutableExtension newStep, ReferenceSubElement reference) {
+ Assert.isNotNull(steps);
+ Assert.isNotNull(id);
+ Assert.isNotNull(newStep);
+ Assert.isNotNull(reference);
+
+ List<IStepGroupable> affected = new ArrayList<IStepGroupable>();
+
+ // Isolate primary and secondary id
+ String primaryId = id;
+ String secondaryId = null;
+
+ String[] splitted = id.split("##", 2); //$NON-NLS-1$
+ if (splitted.length == 2) {
+ primaryId = splitted[0];
+ secondaryId = splitted[1];
+ }
+
+ // Always loop over all steps in case the anchor step is available
+ // multiple times. In such case, the new step is inserted at all
+ // occurrences.
+ for (int i = 0; i < steps.size(); i++) {
+ IStepGroupable step = steps.get(i);
+ if (!step.getExtension().getId().equals(primaryId)) {
+ continue;
+ }
+ if (secondaryId != null && !secondaryId.equals(step.getSecondaryId())) {
+ continue;
+ }
+
+ // Create a new groupable object for inserting
+ IStepGroupable groupable = new StepGroupable(newStep, reference.getSecondaryId());
+ // Insert the new step at the current position
+ steps.add(i, groupable);
+ // And increase the counter --> Otherwise we would see the
+ // same step we want to insert before again!
+ i++;
+ // Add the new groupable to the list of affected steps
+ affected.add(groupable);
+ }
+
+ // If the step could not be added, add to the end of the list
+ if (affected.isEmpty()) {
+ IStepGroupable groupable = new StepGroupable(newStep, reference.getSecondaryId());
+ steps.add(groupable);
+ }
+
+ return affected;
+ }
+
+ /**
+ * Insert the step after the specified step or step group. If no step or
+ * step group with the given id exist, the step is added to the end.
+ *
+ * @param steps The list of steps. Must not be <code>null</code>.
+ * @param id The id of the step or step group where to insert the new step after. Must not be <code>null</code>.
+ * @param newStep The step to add. Must not be <code>null</code>.
+ * @param reference The reference sub element. Must not be <code>null</code>.
+ *
+ * @return The list of affected groupable's or an empty list.
+ */
+ protected List<IStepGroupable> onInsertAfter(List<IStepGroupable> steps, String id, IExecutableExtension newStep, ReferenceSubElement reference) {
+ Assert.isNotNull(steps);
+ Assert.isNotNull(id);
+ Assert.isNotNull(newStep);
+ Assert.isNotNull(reference);
+
+ List<IStepGroupable> affected = new ArrayList<IStepGroupable>();
+
+ // Isolate primary and secondary id
+ String primaryId = id;
+ String secondaryId = null;
+
+ String[] splitted = id.split("##", 2); //$NON-NLS-1$
+ if (splitted.length == 2) {
+ primaryId = splitted[0];
+ secondaryId = splitted[1];
+ }
+
+ // Always loop over all steps in case the anchor step is available
+ // multiple times. In such case, the new step is inserted at all
+ // occurrences.
+ for (int i = 0; i < steps.size(); i++) {
+ IStepGroupable step = steps.get(i);
+ if (!step.getExtension().getId().equals(primaryId)) {
+ continue;
+ }
+ if (secondaryId != null && !secondaryId.equals(step.getSecondaryId())) {
+ continue;
+ }
+
+ // Create a new groupable object for inserting
+ IStepGroupable groupable = new StepGroupable(newStep, reference.getSecondaryId());
+ // Insert the new groupable after the current step or at the end (if i + 1 == steps.size())
+ steps.add(i + 1, groupable);
+ // Add the new groupable to the list of affected steps
+ affected.add(groupable);
+ }
+
+ // If the step could not be added, add to the end of the list
+ if (affected.isEmpty()) {
+ IStepGroupable groupable = new StepGroupable(newStep, reference.getSecondaryId());
+ steps.add(groupable);
+ }
+
+ return affected;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStepGroup#getSteps(org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext)
+ */
+ @Override
+ public IStepGroupable[] getSteps(IStepContext context) throws CoreException {
+ Assert.isNotNull(context);
+
+ // The list of resolved steps for the specified type and mode
+ List<IStepGroupable> steps = new ArrayList<IStepGroupable>();
+
+ // If this step group is based on another step group, we have to get the resolved
+ // steps from there first.
+ if (getBaseOn() != null) {
+ IStepGroup baseStepGroup = StepperManager.getInstance().getStepGroupExtManager().getStepGroup(getBaseOn(), true);
+ // If the base step group cannot be found, that's an error. We cannot continue
+ // without the base group.
+ if (baseStepGroup == null) {
+ throw new CoreException(new Status(IStatus.ERROR,
+ CoreBundleActivator.getUniqueIdentifier(),
+ MessageFormat.format(Messages.StepGroup_error_missingBaseStepGroup,
+ NLS.bind(Messages.StepGroup_error_stepGroup, getLabel()),
+ NLS.bind(Messages.StepGroup_error_referencedBaseGroup, getBaseOn()))
+ ));
+ }
+
+ // Add all the steps from the base step group now to the list
+ steps.addAll(Arrays.asList(baseStepGroup.getSteps(context)));
+ }
+
+ // Now process the references and modify the steps list accordingly
+ for (ReferenceSubElement reference : getReferences()) {
+ // Get the step or step group for the referenced id. Try the steps first.
+ IExecutableExtension candidate = getCandidate(reference.getId(), reference);
+
+ // If the candidate is null here, that's an error as a referenced step is missing.
+ if (candidate == null) {
+ throw new CoreException(new Status(IStatus.ERROR,
+ CoreBundleActivator.getUniqueIdentifier(),
+ MessageFormat.format(Messages.StepGroup_error_missingReferencedStep,
+ NLS.bind(Messages.StepGroup_error_stepGroup, getLabel()),
+ NLS.bind(Messages.StepGroup_error_referencedStepOrGroup, reference.getId()))
+ ));
+ }
+
+ // Check if the step is valid for the current contexts.
+ boolean valid = isValidReference(reference, context);
+
+ if (!valid) {
+ CoreBundleActivator.getTraceHandler().trace(
+ "StepGroup#getSteps: SKIPPED reference = '" + candidate.getLabel() + "'." //$NON-NLS-1$ //$NON-NLS-2$
+ + " Not valid for contexts '" + context, //$NON-NLS-1$
+ 0, ITraceIds.TRACE_STEPPING, IStatus.WARNING, this);
+ continue;
+ }
+
+ // Check for duplicates of singleton references.
+ checkForDuplicates(steps, reference);
+
+ // Check for the steps own dependencies to be valid for the current type id and mode
+ if (candidate instanceof IStep) {
+ checkForDependenciesValid((IStep)candidate, context);
+ }
+
+ // Will contain the list of affected groupables from the whole list
+ List<IStepGroupable> affectedGroupables = new ArrayList<IStepGroupable>();
+
+ // Check first for overwriting groupables
+ String overwrite = reference.getOverwrite();
+ if (overwrite != null && overwrite.length() > 0) {
+ affectedGroupables.addAll(onOverwrite(steps, overwrite, candidate, reference));
+ } else {
+ // overwrite is not set -> process insertBefore or insertAfter
+ String insertBefore = reference.getInsertBefore();
+ String insertAfter = reference.getInsertAfter();
+
+ // If neither one is specified, the step or step group will be to the end of the list
+ if ((insertBefore == null || insertBefore.length() == 0)
+ && (insertAfter == null || insertAfter.length() == 0)) {
+ IStepGroupable groupable = new StepGroupable(candidate, reference.getSecondaryId());
+ steps.add(groupable);
+ affectedGroupables.add(groupable);
+ } else {
+ // insertBefore comes first
+ if (insertBefore != null && insertBefore.length() > 0) {
+ affectedGroupables.addAll(onInsertBefore(steps, insertBefore, candidate, reference));
+ } else {
+ affectedGroupables.addAll(onInsertAfter(steps, insertAfter, candidate, reference));
+ }
+ }
+ }
+
+ // Process the groupable attributes on all affected groupables
+ for (IStepGroupable step : affectedGroupables) {
+ if (!(step instanceof StepGroupable)) {
+ continue;
+ }
+
+ StepGroupable groupable = (StepGroupable)step;
+ groupable.setDependencies(reference.getDependencies());
+
+ if (!reference.isRemovable() && groupable.isRemovable()) {
+ groupable.setRemovable(reference.isRemovable());
+ }
+ if (reference.isHidden() && !groupable.isHidden()) {
+ groupable.setHidden(reference.isHidden());
+ }
+ if (reference.isDisable() && !groupable.isDisabled()) {
+ groupable.setDisabled(reference.isDisable());
+ }
+ if (reference.isSingleton() && !groupable.isSingleton()) {
+ groupable.setSingleton(reference.isSingleton());
+ }
+ }
+ }
+
+ return !steps.isEmpty() ? steps.toArray(new IStepGroupable[steps.size()]) : NO_STEPS;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.extensions.ExecutableExtension#setInitializationData(org.eclipse.core.runtime.IConfigurationElement, java.lang.String, java.lang.Object)
+ */
+ @Override
+ public void setInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException {
+ references.clear();
+ super.setInitializationData(config, propertyName, data);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.stepper.extensions.AbstractStepGroup#doSetInitializationData(org.eclipse.core.runtime.IConfigurationElement, java.lang.String, java.lang.Object)
+ */
+ @Override
+ public void doSetInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException {
+ super.doSetInitializationData(config, propertyName, data);
+
+ if (iteratorProxy == null) {
+ iteratorProxy = new ExecutableExtensionProxy<IStepGroupIterator>(config) {
+ @Override
+ protected String getExecutableExtensionAttributeName() {
+ return "iterator"; //$NON-NLS-1$
+ }
+ };
+ }
+
+ if (!locked) {
+ String lockedAttribute = config.getAttribute("locked"); //$NON-NLS-1$
+ if (lockedAttribute != null) {
+ this.locked = Boolean.parseBoolean(lockedAttribute);
+ }
+ }
+
+ if (baseOn == null || baseOn.trim().length() == 0) {
+ String baseOnAttribute = config.getAttribute("baseOn"); //$NON-NLS-1$
+ if (baseOnAttribute != null && baseOnAttribute.trim().length() > 0) {
+ this.baseOn = baseOnAttribute.trim();
+ }
+ }
+
+ Map<String, Integer> occurrences = new HashMap<String, Integer>();
+ IConfigurationElement[] childElements = config.getChildren("references"); //$NON-NLS-1$
+ for (IConfigurationElement childElement : childElements) {
+ IConfigurationElement[] references = childElement.getChildren("reference"); //$NON-NLS-1$
+ for (IConfigurationElement reference : references) {
+ ReferenceSubElement candidate = new ReferenceSubElement();
+ candidate.setInitializationData(reference, reference.getName(), null);
+ // If multiple references to the same step or step group exist, check
+ // for the secondaryId
+ if (occurrences.containsKey(candidate.getId())) {
+ // Occurrences are counted up always
+ int number = occurrences.get(candidate.getId()).intValue() + 1;
+ occurrences.put(candidate.getId(), Integer.valueOf(number));
+
+ if (candidate.getSecondaryId() == null) {
+ // secondaryId not explicitly set -> auto set
+ candidate.setSecondardId(Integer.toString(number));
+ }
+ } else {
+ // remember the occurrence of the reference
+ occurrences.put(candidate.getId(), Integer.valueOf(1));
+ }
+
+ // References are not sorted out here. That's the task of the resolver.
+ this.references.add(candidate);
+ }
+ }
+ }
+
+
+ /**
+ * Checks if all dependencies of the given step are available
+ * and valid for the given type id and mode.
+ *
+ * @param step The step. Must not be <code>null</code>.
+ * @param context The context. Must not be <code>null</code>.
+ *
+ * @throws CoreException If a required step or step group is not available or not valid.
+ */
+ protected void checkForDependenciesValid(IStep step, IStepContext context) throws CoreException {
+ Assert.isNotNull(step);
+ Assert.isNotNull(context);
+
+ String[] dependencies = step.getDependencies();
+ for (String dependency : dependencies) {
+ IExecutableExtension candidate = getCandidate(dependency, null);
+
+ // If the candidate is null here, that's an error as a required step or step group is missing.
+ if (candidate == null) {
+ throw new CoreException(new Status(IStatus.ERROR,
+ CoreBundleActivator.getUniqueIdentifier(),
+ MessageFormat.format(Messages.StepGroup_error_missingRequiredStep,
+ NLS.bind(Messages.StepGroup_error_step, step.getLabel()),
+ NLS.bind(Messages.StepGroup_error_requiredStepOrGroup, dependency))
+ ));
+ }
+ }
+ }
+
+ /**
+ * Returns a candidate for the given reference.
+ * @param reference The reference.
+ * @return The candidate. Can be either an IStep or IStepGroup.
+ */
+ protected IExecutableExtension getCandidate(String id, ReferenceSubElement reference) {
+ Assert.isNotNull(id);
+ IExecutableExtension candidate = StepperManager.getInstance().getStepExtManager().getStep(id, true);
+ if (candidate == null) {
+ candidate = StepperManager.getInstance().getStepGroupExtManager().getStepGroup(id, true);
+ }
+ else if (reference != null && candidate instanceof IStep) {
+ ((IStep)candidate).setParameters(reference.getParameters());
+ }
+ return candidate;
+ }
+
+ /**
+ * Returns if or if not the reference is valid for the given contexts.
+ *
+ * @param reference The reference. Must not be <code>null</code>.
+ * @param context The context or <code>null</code>.
+ *
+ * @return <code>True</code> if the step is valid, <code>false</code> otherwise.
+ */
+ protected boolean isValidReference(ReferenceSubElement reference, IStepContext context) {
+ Assert.isNotNull(reference);
+ // Get the enablement.
+ Expression enablement = reference.getEnablement();
+
+ if (enablement != null) {
+ if (context != null) {
+ // Set the default variable to the context.
+ EvaluationContext evalContext = new EvaluationContext(null, context.getContextObject());
+ // Initialize the evaluation context named variables
+ evalContext.addVariable("context", context); //$NON-NLS-1$
+ evalContext.addVariable("id", context.getId()); //$NON-NLS-1$
+ // Allow plugin activation
+ evalContext.setAllowPluginActivation(true);
+ // Evaluate the expression
+ try {
+ return enablement.evaluate(evalContext).equals(EvaluationResult.TRUE);
+ } catch (CoreException e) {
+ IStatus status = new Status(IStatus.ERROR, CoreBundleActivator.getUniqueIdentifier(),
+ e.getLocalizedMessage(), e);
+ Platform.getLog(CoreBundleActivator.getContext().getBundle()).log(status);
+ }
+ }
+ return false;
+ }
+ return true;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStepGroup#getStepGroupIterator()
+ */
+ @Override
+ public IStepGroupIterator getStepGroupIterator() {
+ return iteratorProxy != null ? iteratorProxy.newInstance() : null;
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/interfaces/IStep.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/interfaces/IStep.java
index 872268c2d..1d7f7abc8 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/interfaces/IStep.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/interfaces/IStep.java
@@ -1,161 +1,161 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Wind River Systems, Inc. and others. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.tcf.te.runtime.stepper.interfaces;
-
-import java.util.Map;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
-import org.eclipse.tcf.te.runtime.interfaces.extensions.IExecutableExtension;
-import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
-
-/**
- * A single step.
- * <p>
- * Steps are assumed to be asynchronous. If the step execution finished, the passed in <b>callback
- * must be invoked</b>. The parent stepper suspend the step sequence execution till the callback is
- * invoked.
- * <p>
- * Steps signals the execution state to the parent stepper via the <code>IStatus</code> object
- * passed to the callback as first argument. The status object is mandatory and cannot be
- * <code>null</code>. If the step execution succeeds, an status with severity {@link IStatus#OK} is
- * expected.
- */
-public interface IStep extends IExecutableExtension {
-
- /**
- * Additional data property for ICallback.
- */
- public static final String CALLBACK_PROPERTY_DATA = "data"; //$NON-NLS-1$
-
- /**
- * Executes the context step logic.
- *
- * @param context The context. Must not be <code>null</code>.
- * @param data The data giving object. Must not be <code>null</code>.
- * @param fullQualifiedId The full qualified id for this step. Must not be <code>null</code>.
- * @param monitor The progress monitor. Must not be <code>null</code>.
- * @param callback The callback to invoke if finished. Must not be <code>null</code>.
- */
- public void execute(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor, ICallback callback);
-
- /**
- * Returns if or if not this step can have multiple references within step groups. If
- * <code>true</code> is returned, the step can occur exactly once per step group. This method
- * effects all defined step groups and overwrite individual step settings.
- * <p>
- * The default implementation returns <code>false</code>.
- *
- * @return <code>True</code> if the step can be referenced only ones per step group,
- * <code>false</code> otherwise.
- */
- public boolean isSingleton();
-
- /**
- * Initialize the step from the given data.
- *
- * @param context The context. Must not be <code>null</code>.
- * @param data The data. Must not be <code>null</code>.
- * @param fullQualifiedId The full qualified id for this step. Must not be <code>null</code>.
- * @param monitor The progress monitor. Must not be <code>null</code>.
- */
- public void initializeFrom(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor);
-
- /**
- * Validate execution conditions.
- * <p>
- * This method is called from
- * {@link #execute(IAdaptable, IPropertiesContainer, IFullQualifiedId, IProgressMonitor, ICallback)}
- * after the step initialization. If any execution condition is not fulfilled, the method should
- * throw an {@link CoreException} to signal the failure.
- *
- * @param context The context. Must not be <code>null</code>.
- * @param data The data. Must not be <code>null</code>.
- * @param fullQualifiedId The full qualified id for this step. Must not be <code>null</code>.
- * @param monitor The progress monitor. Must not be <code>null</code>.
- *
- * @throws CoreException if the execution cannot be continue. The associated status should
- * describe the failure cause.
- */
- public void validateExecute(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor) throws CoreException;
-
- /**
- * Cleanup intermediate data of the step.
- * <p>
- * This method will be called at the end of each step execution.
- *
- * @param context The context. Must not be <code>null</code>.
- * @param data The data. Must not be <code>null</code>.
- * @param fullQualifiedId The full qualified id for this step. Must not be <code>null</code>.
- * @param monitor The progress monitor. Must not be <code>null</code>.
- */
- public void cleanup(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor);
-
- /**
- * Called from the stepper engine once an error occurred during the stepping. Gives each step,
- * completed previously to the error, the possibility to rollback whatever the step did.
- * <p>
- * <b>Note:</b> It is not guaranteed that the shared step data hasn't been overwritten in the
- * meanwhile by multiple invocation of the same step. If a step supports multiple invocations,
- * the implementer of the step is required to identify all the step data to rollback by himself.
- * <p>
- * IProgressMonitor.worked(int) should not be used for the given progress monitor. Setting sub task labels is ok.
- *
- * @param context The context. Must not be <code>null</code>.
- * @param data The data. Must not be <code>null</code>.
- * @param status The status of the last step executed and that caused the rollback.
- * @param fullQualifiedId The full qualified id for this step. Must not be <code>null</code>.
- * @param monitor The progress monitor. Must not be <code>null</code>.
- * @param callback The callback to invoke if finished. Must not be <code>null</code>.
- */
- public void rollback(IStepContext context, IPropertiesContainer data, IStatus status, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor, ICallback callback);
-
- /**
- * Get the timeout in milliseconds to wait for finish
- * when the progress monitor was canceled.
- * If a step should not have a timeout and handles the cancel itself return -1.
- * @return Timeout in milliseconds.
- */
- public int getCancelTimeout();
-
- /**
- * Returns the number of total work the step is consuming.
- *
- * @return The number of total work or {@link IProgressMonitor#UNKNOWN}.
- */
- public int getTotalWork(IStepContext context, IPropertiesContainer data);
-
- /**
- * Returns the list of required context step or context step group id's. The execution of a
- * context step fails if not all of the required steps are available or have not been executed
- * before.
- * <p>
- * If the listed required steps have dependencies on their own, these dependencies are
- * implicitly inherited.
- *
- * @return The list of required context step or context step group id's or an empty list.
- */
- public String[] getDependencies();
-
- /**
- * Set additional parameters for this step
- * @param parameters
- */
- public void setParameters(Map<String,String> parameters);
-
- /**
- * Returns a map of additional parameters given through the parameters section in the Reference section of a StepGroups.
- * @return The parameters of an empty Map.
- */
- public Map<String,String> getParameters();
-}
+/*******************************************************************************
+ * Copyright (c) 2011, 2013 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.runtime.stepper.interfaces;
+
+import java.util.Map;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
+import org.eclipse.tcf.te.runtime.interfaces.extensions.IExecutableExtension;
+import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
+
+/**
+ * A single step.
+ * <p>
+ * Steps are assumed to be asynchronous. If the step execution finished, the passed in <b>callback
+ * must be invoked</b>. The parent stepper suspend the step sequence execution till the callback is
+ * invoked.
+ * <p>
+ * Steps signals the execution state to the parent stepper via the <code>IStatus</code> object
+ * passed to the callback as first argument. The status object is mandatory and cannot be
+ * <code>null</code>. If the step execution succeeds, an status with severity {@link IStatus#OK} is
+ * expected.
+ */
+public interface IStep extends IExecutableExtension {
+
+ /**
+ * Additional data property for ICallback.
+ */
+ public static final String CALLBACK_PROPERTY_DATA = "data"; //$NON-NLS-1$
+
+ /**
+ * Executes the context step logic.
+ *
+ * @param context The context. Must not be <code>null</code>.
+ * @param data The data giving object. Must not be <code>null</code>.
+ * @param fullQualifiedId The full qualified id for this step. Must not be <code>null</code>.
+ * @param monitor The progress monitor. Must not be <code>null</code>.
+ * @param callback The callback to invoke if finished. Must not be <code>null</code>.
+ */
+ public void execute(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor, ICallback callback);
+
+ /**
+ * Returns if or if not this step can have multiple references within step groups. If
+ * <code>true</code> is returned, the step can occur exactly once per step group. This method
+ * effects all defined step groups and overwrite individual step settings.
+ * <p>
+ * The default implementation returns <code>false</code>.
+ *
+ * @return <code>True</code> if the step can be referenced only ones per step group,
+ * <code>false</code> otherwise.
+ */
+ public boolean isSingleton();
+
+ /**
+ * Initialize the step from the given data.
+ *
+ * @param context The context. Must not be <code>null</code>.
+ * @param data The data. Must not be <code>null</code>.
+ * @param fullQualifiedId The full qualified id for this step. Must not be <code>null</code>.
+ * @param monitor The progress monitor. Must not be <code>null</code>.
+ */
+ public void initializeFrom(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor);
+
+ /**
+ * Validate execution conditions.
+ * <p>
+ * This method is called from
+ * {@link #execute(IAdaptable, IPropertiesContainer, IFullQualifiedId, IProgressMonitor, ICallback)}
+ * after the step initialization. If any execution condition is not fulfilled, the method should
+ * throw an {@link CoreException} to signal the failure.
+ *
+ * @param context The context. Must not be <code>null</code>.
+ * @param data The data. Must not be <code>null</code>.
+ * @param fullQualifiedId The full qualified id for this step. Must not be <code>null</code>.
+ * @param monitor The progress monitor. Must not be <code>null</code>.
+ *
+ * @throws CoreException if the execution cannot be continue. The associated status should
+ * describe the failure cause.
+ */
+ public void validateExecute(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor) throws CoreException;
+
+ /**
+ * Cleanup intermediate data of the step.
+ * <p>
+ * This method will be called at the end of each step execution.
+ *
+ * @param context The context. Must not be <code>null</code>.
+ * @param data The data. Must not be <code>null</code>.
+ * @param fullQualifiedId The full qualified id for this step. Must not be <code>null</code>.
+ * @param monitor The progress monitor. Must not be <code>null</code>.
+ */
+ public void cleanup(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor);
+
+ /**
+ * Called from the stepper engine once an error occurred during the stepping. Gives each step,
+ * completed previously to the error, the possibility to rollback whatever the step did.
+ * <p>
+ * <b>Note:</b> It is not guaranteed that the shared step data hasn't been overwritten in the
+ * meanwhile by multiple invocation of the same step. If a step supports multiple invocations,
+ * the implementer of the step is required to identify all the step data to rollback by himself.
+ * <p>
+ * IProgressMonitor.worked(int) should not be used for the given progress monitor. Setting sub task labels is ok.
+ *
+ * @param context The context. Must not be <code>null</code>.
+ * @param data The data. Must not be <code>null</code>.
+ * @param status The status of the last step executed and that caused the rollback.
+ * @param fullQualifiedId The full qualified id for this step. Must not be <code>null</code>.
+ * @param monitor The progress monitor. Must not be <code>null</code>.
+ * @param callback The callback to invoke if finished. Must not be <code>null</code>.
+ */
+ public void rollback(IStepContext context, IPropertiesContainer data, IStatus status, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor, ICallback callback);
+
+ /**
+ * Get the timeout in milliseconds to wait for finish
+ * when the progress monitor was canceled.
+ * If a step should not have a timeout and handles the cancel itself return -1.
+ * @return Timeout in milliseconds.
+ */
+ public int getCancelTimeout();
+
+ /**
+ * Returns the number of total work the step is consuming.
+ *
+ * @return The number of total work or {@link IProgressMonitor#UNKNOWN}.
+ */
+ public int getTotalWork(IStepContext context, IPropertiesContainer data);
+
+ /**
+ * Returns the list of required context step or context step group id's. The execution of a
+ * context step fails if not all of the required steps are available or have not been executed
+ * before.
+ * <p>
+ * If the listed required steps have dependencies on their own, these dependencies are
+ * implicitly inherited.
+ *
+ * @return The list of required context step or context step group id's or an empty list.
+ */
+ public String[] getDependencies();
+
+ /**
+ * Set additional parameters for this step
+ * @param parameters
+ */
+ public void setParameters(Map<String,String> parameters);
+
+ /**
+ * Returns a map of additional parameters given through the parameters section in the Reference section of a StepGroups.
+ * @return The parameters of an empty Map.
+ */
+ public Map<String,String> getParameters();
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/interfaces/IStepGroupIterator.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/interfaces/IStepGroupIterator.java
index 0c5ce6f4c..9200f5d46 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/interfaces/IStepGroupIterator.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/interfaces/IStepGroupIterator.java
@@ -1,53 +1,53 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Wind River Systems, Inc. and others. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.tcf.te.runtime.stepper.interfaces;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.tcf.te.runtime.interfaces.extensions.IExecutableExtension;
-import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
-
-/**
- * A step group iterator.
- */
-public interface IStepGroupIterator extends IExecutableExtension {
-
- /**
- * Initialize the iterator.
- *
- * @param context The context. Must not be <code>null</code>.
- * @param data The data. Must not be <code>null</code>.
- * @param fullQualifiedId The full qualified id for this step. Must not be <code>null</code>.
- * @param monitor The progress monitor. Must not be <code>null</code>.
- */
- public void initialize(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor) throws CoreException;
-
- /**
- * Check if there is a next iteration possible.
- *
- * @param context The context. Must not be <code>null</code>.
- * @param data The data. Must not be <code>null</code>.
- * @param fullQualifiedId The full qualified id for this step. Must not be <code>null</code>.
- * @param monitor The progress monitor. Must not be <code>null</code>.
- * @return <code>true</code> if another iteration is possible.
- */
- public boolean hasNext(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor) throws CoreException;
-
- /**
- * Set the next iteration to the data using the full qualified id.
- *
- * @param context The context. Must not be <code>null</code>.
- * @param data The data. Must not be <code>null</code>.
- * @param fullQualifiedId The full qualified id for this step. Must not be <code>null</code>.
- * @param monitor The progress monitor. Must not be <code>null</code>.
- * @throws CoreException
- */
- public void next(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor) throws CoreException;
-}
+/*******************************************************************************
+ * Copyright (c) 2011, 2013 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.runtime.stepper.interfaces;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.tcf.te.runtime.interfaces.extensions.IExecutableExtension;
+import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
+
+/**
+ * A step group iterator.
+ */
+public interface IStepGroupIterator extends IExecutableExtension {
+
+ /**
+ * Initialize the iterator.
+ *
+ * @param context The context. Must not be <code>null</code>.
+ * @param data The data. Must not be <code>null</code>.
+ * @param fullQualifiedId The full qualified id for this step. Must not be <code>null</code>.
+ * @param monitor The progress monitor. Must not be <code>null</code>.
+ */
+ public void initialize(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor) throws CoreException;
+
+ /**
+ * Check if there is a next iteration possible.
+ *
+ * @param context The context. Must not be <code>null</code>.
+ * @param data The data. Must not be <code>null</code>.
+ * @param fullQualifiedId The full qualified id for this step. Must not be <code>null</code>.
+ * @param monitor The progress monitor. Must not be <code>null</code>.
+ * @return <code>true</code> if another iteration is possible.
+ */
+ public boolean hasNext(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor) throws CoreException;
+
+ /**
+ * Set the next iteration to the data using the full qualified id.
+ *
+ * @param context The context. Must not be <code>null</code>.
+ * @param data The data. Must not be <code>null</code>.
+ * @param fullQualifiedId The full qualified id for this step. Must not be <code>null</code>.
+ * @param monitor The progress monitor. Must not be <code>null</code>.
+ * @throws CoreException
+ */
+ public void next(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor) throws CoreException;
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/internal/PropertyTester.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/internal/PropertyTester.java
index 7fc2e8132..642911a56 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/internal/PropertyTester.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/internal/PropertyTester.java
@@ -1,64 +1,64 @@
-/*******************************************************************************
- * Copyright (c) 2011 Wind River Systems, Inc. and others. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.tcf.te.runtime.stepper.internal;
-
-import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
-import org.eclipse.tcf.te.runtime.services.ServiceManager;
-import org.eclipse.tcf.te.runtime.services.interfaces.IPropertiesAccessService;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepperService;
-import org.eclipse.tcf.te.runtime.stepper.job.StepperJob;
-
-
-
-/**
- * Services plug-in property tester implementation.
- */
-public class PropertyTester extends org.eclipse.core.expressions.PropertyTester {
-
- /* (non-Javadoc)
- * @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object)
- */
- @Override
- public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
-
- String operation = expectedValue instanceof String ? (String)expectedValue : null;
-
- if ("isRunning".equals(property)) { //$NON-NLS-1$
- if (operation != null && receiver instanceof IPropertiesContainer) {
- IPropertiesAccessService service = ServiceManager.getInstance().getService(receiver, IPropertiesAccessService.class);
- StepperJob job = service != null ? (StepperJob)service.getProperty(receiver, StepperJob.class.getName() + "." + operation) : null; //$NON-NLS-1$
- if (service == null && receiver instanceof IPropertiesContainer)
- job = (StepperJob)((IPropertiesContainer)receiver).getProperty(StepperJob.class.getName() + "." + operation); //$NON-NLS-1$
- return job != null && !job.isCanceled() && !job.isFinished();
- }
- }
-
- if ("isRunningOrCanceled".equals(property)) { //$NON-NLS-1$
- if (operation != null && receiver instanceof IPropertiesContainer) {
- IPropertiesAccessService service = ServiceManager.getInstance().getService(receiver, IPropertiesAccessService.class);
- StepperJob job = service != null ? (StepperJob)service.getProperty(receiver, StepperJob.class.getName() + "." + operation) : null; //$NON-NLS-1$
- if (service == null && receiver instanceof IPropertiesContainer)
- job = (StepperJob)((IPropertiesContainer)receiver).getProperty(StepperJob.class.getName() + "." + operation); //$NON-NLS-1$
- return job != null && !job.isFinished();
- }
- }
-
- if ("isEnabled".equals(property)) { //$NON-NLS-1$
- if (operation != null) {
- IStepperService service = ServiceManager.getInstance().getService(receiver, IStepperService.class);
- if (service != null) {
- return service.isEnabled(receiver, operation);
- }
- }
- }
-
- return false;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011, 2013 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.runtime.stepper.internal;
+
+import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
+import org.eclipse.tcf.te.runtime.services.ServiceManager;
+import org.eclipse.tcf.te.runtime.services.interfaces.IPropertiesAccessService;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepperService;
+import org.eclipse.tcf.te.runtime.stepper.job.StepperJob;
+
+
+
+/**
+ * Services plug-in property tester implementation.
+ */
+public class PropertyTester extends org.eclipse.core.expressions.PropertyTester {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object)
+ */
+ @Override
+ public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
+
+ String operation = expectedValue instanceof String ? (String)expectedValue : null;
+
+ if ("isRunning".equals(property)) { //$NON-NLS-1$
+ if (operation != null && receiver instanceof IPropertiesContainer) {
+ IPropertiesAccessService service = ServiceManager.getInstance().getService(receiver, IPropertiesAccessService.class);
+ StepperJob job = service != null ? (StepperJob)service.getProperty(receiver, StepperJob.class.getName() + "." + operation) : null; //$NON-NLS-1$
+ if (service == null && receiver instanceof IPropertiesContainer)
+ job = (StepperJob)((IPropertiesContainer)receiver).getProperty(StepperJob.class.getName() + "." + operation); //$NON-NLS-1$
+ return job != null && !job.isCanceled() && !job.isFinished();
+ }
+ }
+
+ if ("isRunningOrCanceled".equals(property)) { //$NON-NLS-1$
+ if (operation != null && receiver instanceof IPropertiesContainer) {
+ IPropertiesAccessService service = ServiceManager.getInstance().getService(receiver, IPropertiesAccessService.class);
+ StepperJob job = service != null ? (StepperJob)service.getProperty(receiver, StepperJob.class.getName() + "." + operation) : null; //$NON-NLS-1$
+ if (service == null && receiver instanceof IPropertiesContainer)
+ job = (StepperJob)((IPropertiesContainer)receiver).getProperty(StepperJob.class.getName() + "." + operation); //$NON-NLS-1$
+ return job != null && !job.isFinished();
+ }
+ }
+
+ if ("isEnabled".equals(property)) { //$NON-NLS-1$
+ if (operation != null) {
+ IStepperService service = ServiceManager.getInstance().getService(receiver, IStepperService.class);
+ if (service != null) {
+ return service.isEnabled(receiver, operation);
+ }
+ }
+ }
+
+ return false;
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/nls/Messages.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/nls/Messages.java
index 3a78f8ae7..00d20e149 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/nls/Messages.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/nls/Messages.java
@@ -1,69 +1,69 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Wind River Systems, Inc. and others. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.tcf.te.runtime.stepper.nls;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Stepper Runtime plugin externalized strings management.
- */
-public class Messages extends NLS {
-
- // The plug-in resource bundle name
- private static final String BUNDLE_NAME = "org.eclipse.tcf.te.runtime.stepper.nls.Messages"; //$NON-NLS-1$
-
- /**
- * Static constructor.
- */
- static {
- // Load message values from bundle file
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- // **** Declare externalized string id's down here *****
-
- public static String AbstractStep_error_missingRequiredAttribute;
- public static String AbstractStep_warning_stepFinishedWithWarnings;
-
- public static String Stepper_error_stepGroup;
- public static String Stepper_error_step;
- public static String Stepper_error_referencedBaseGroup;
- public static String Stepper_error_referencedStepOrGroup;
- public static String Stepper_error_requiredStepOrGroup;
- public static String Stepper_error_requiredStep;
- public static String Stepper_error_initializeNotCalled;
- public static String Stepper_error_missingStepGroupId;
- public static String Stepper_error_missingStepGroup;
- public static String Stepper_error_missingSteps;
- public static String Stepper_multiStatus_finishedWithWarnings;
- public static String Stepper_multiStatus_finishedWithErrors;
- public static String Stepper_error_missingRequiredStep;
- public static String Stepper_error_requiredStepNotExecuted;
-
- public static String StepGroup_error_missingBaseStepGroup;
- public static String StepGroup_error_missingReferencedStep;
- public static String StepGroup_error_missingRequiredStep;
- public static String StepGroup_error_invalidRequiredStep;
- public static String StepGroup_error_multipleSingletonOccurrences;
- public static String StepGroup_error_step;
- public static String StepGroup_error_stepGroup;
- public static String StepGroup_error_requiredStep;
- public static String StepGroup_error_referencedBaseGroup;
- public static String StepGroup_error_referencedStepOrGroup;
- public static String StepGroup_error_requiredStepOrGroup;
-
- public static String StepExecutor_checkPoint_normalizationNeeded;
- public static String StepExecutor_info_stepFailed;
- public static String StepExecutor_warning_stepFailed;
- public static String StepExecutor_error_stepFailed;
- public static String StepExecutor_stepFailed_debugInfo;
- public static String StepExecutor_warning_rollbackTimeout;
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011, 2013 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.runtime.stepper.nls;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * Stepper Runtime plugin externalized strings management.
+ */
+public class Messages extends NLS {
+
+ // The plug-in resource bundle name
+ private static final String BUNDLE_NAME = "org.eclipse.tcf.te.runtime.stepper.nls.Messages"; //$NON-NLS-1$
+
+ /**
+ * Static constructor.
+ */
+ static {
+ // Load message values from bundle file
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ // **** Declare externalized string id's down here *****
+
+ public static String AbstractStep_error_missingRequiredAttribute;
+ public static String AbstractStep_warning_stepFinishedWithWarnings;
+
+ public static String Stepper_error_stepGroup;
+ public static String Stepper_error_step;
+ public static String Stepper_error_referencedBaseGroup;
+ public static String Stepper_error_referencedStepOrGroup;
+ public static String Stepper_error_requiredStepOrGroup;
+ public static String Stepper_error_requiredStep;
+ public static String Stepper_error_initializeNotCalled;
+ public static String Stepper_error_missingStepGroupId;
+ public static String Stepper_error_missingStepGroup;
+ public static String Stepper_error_missingSteps;
+ public static String Stepper_multiStatus_finishedWithWarnings;
+ public static String Stepper_multiStatus_finishedWithErrors;
+ public static String Stepper_error_missingRequiredStep;
+ public static String Stepper_error_requiredStepNotExecuted;
+
+ public static String StepGroup_error_missingBaseStepGroup;
+ public static String StepGroup_error_missingReferencedStep;
+ public static String StepGroup_error_missingRequiredStep;
+ public static String StepGroup_error_invalidRequiredStep;
+ public static String StepGroup_error_multipleSingletonOccurrences;
+ public static String StepGroup_error_step;
+ public static String StepGroup_error_stepGroup;
+ public static String StepGroup_error_requiredStep;
+ public static String StepGroup_error_referencedBaseGroup;
+ public static String StepGroup_error_referencedStepOrGroup;
+ public static String StepGroup_error_requiredStepOrGroup;
+
+ public static String StepExecutor_checkPoint_normalizationNeeded;
+ public static String StepExecutor_info_stepFailed;
+ public static String StepExecutor_warning_stepFailed;
+ public static String StepExecutor_error_stepFailed;
+ public static String StepExecutor_stepFailed_debugInfo;
+ public static String StepExecutor_warning_rollbackTimeout;
+
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/nls/Messages.properties b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/nls/Messages.properties
index 3c4f7ff66..c9e9d9891 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/nls/Messages.properties
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/nls/Messages.properties
@@ -1,52 +1,52 @@
-###############################################################################
-# Copyright (c) 2012 Wind River Systems, Inc. and others. All rights reserved.
-# This program and the accompanying materials are made available under the terms
-# of the Eclipse Public License v1.0 which accompanies this distribution, and is
-# available at http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Wind River Systems - initial API and implementation
-###############################################################################
-
-AbstractStep_error_missingRequiredAttribute=Required attribute "{0}" missing for extension "{1}"!
-AbstractStep_warning_stepFinishedWithWarnings=Step ''{0}'' finished with warnings.
-
-Stepper_error_stepGroup=Step group:\n\t{0}
-Stepper_error_step=Step:\n\t{0}
-Stepper_error_referencedBaseGroup=Referenced Base Step Group:\n\t{0}
-Stepper_error_referencedStepOrGroup=Referenced Step or Step Group:\n\t{0}
-Stepper_error_requiredStepOrGroup=Required Step or Step Group:\n\t{0}
-Stepper_error_requiredStep=Required Step:\n\t{0}
-Stepper_error_initializeNotCalled=initialize(...) must be called before execute()!
-Stepper_error_missingStepGroupId=Execution failed. Missing step group id for ''{0}''.
-Stepper_error_missingStepGroup=Execution failed. Missing step group for id ''{0}''.
-Stepper_error_missingSteps=Execution failed. No steps enabled for ''{0}''.
-Stepper_multiStatus_finishedWithWarnings=''{0}'' completed with warnings or information.
-Stepper_multiStatus_finishedWithErrors=''{0}'' failed.
-Stepper_error_missingRequiredStep=Step execution failed. Required step or step group does not exist.\n\n{0}\n{1}\n\n{2}
-Stepper_error_requiredStepNotExecuted=Step execution failed. Required step or step group not executed before.\n\n{0}\n{1}\n\n{2}
-
-StepGroup_error_missingBaseStepGroup=Cannot determine steps for execution. Referenced base step group does not exist.\n\n{0}\n{1}\n\n{2}
-StepGroup_error_missingReferencedStep=Cannot determine steps for execution. Referenced step or step group does not exist.\n\n{0}\n{1}\n\n{2}
-StepGroup_error_missingRequiredStep=Invalid step. Required step or step group does not exist.\n\n{0}\n{1}\n\n{2}
-StepGroup_error_invalidRequiredStep=Invalid step. Required step is invalid.\n\n{0}\n{1}\n\n{2}
-StepGroup_error_multipleSingletonOccurrences=Cannot determine steps for execution. Only one reference allowed.\n\n{0}\n{1}\n\n{2}
-StepGroup_error_step=Step:\n\t{0}
-StepGroup_error_stepGroup=Step group:\n\t{0}
-StepGroup_error_requiredStep=Required Step:\n\t{0}
-StepGroup_error_referencedBaseGroup=Referenced Base Step Group:\n\t{0}
-StepGroup_error_referencedStepOrGroup=Referenced Step or Step Group:\n\t{0}
-StepGroup_error_requiredStepOrGroup=Required Step or Step Group:\n\t{0}
-
-StepExecutor_checkPoint_normalizationNeeded=Step finished with this
-StepExecutor_info_stepFailed=Step finished with this information: {0}\n\n\
-Context: {1}\n\{2}\n\
-Step: {3}
-StepExecutor_warning_stepFailed=Step finished with this warning: {0}\n\n\
-Context: {1}\n\{2}\n\
-Step: {3}
-StepExecutor_error_stepFailed=Step finished with this error: {0}\n\n\
-Context: {1}\n\{2}\n\
-Step: {3}
-StepExecutor_stepFailed_debugInfo=Debug info:\n{0}
-StepExecutor_warning_rollbackTimeout=Step rollback was aborted due to timeout.
+###############################################################################
+# Copyright (c) 2012, 2013 Wind River Systems, Inc. and others. All rights reserved.
+# This program and the accompanying materials are made available under the terms
+# of the Eclipse Public License v1.0 which accompanies this distribution, and is
+# available at http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Wind River Systems - initial API and implementation
+###############################################################################
+
+AbstractStep_error_missingRequiredAttribute=Required attribute "{0}" missing for extension "{1}"!
+AbstractStep_warning_stepFinishedWithWarnings=Step ''{0}'' finished with warnings.
+
+Stepper_error_stepGroup=Step group:\n\t{0}
+Stepper_error_step=Step:\n\t{0}
+Stepper_error_referencedBaseGroup=Referenced Base Step Group:\n\t{0}
+Stepper_error_referencedStepOrGroup=Referenced Step or Step Group:\n\t{0}
+Stepper_error_requiredStepOrGroup=Required Step or Step Group:\n\t{0}
+Stepper_error_requiredStep=Required Step:\n\t{0}
+Stepper_error_initializeNotCalled=initialize(...) must be called before execute()!
+Stepper_error_missingStepGroupId=Execution failed. Missing step group id for ''{0}''.
+Stepper_error_missingStepGroup=Execution failed. Missing step group for id ''{0}''.
+Stepper_error_missingSteps=Execution failed. No steps enabled for ''{0}''.
+Stepper_multiStatus_finishedWithWarnings=''{0}'' completed with warnings or information.
+Stepper_multiStatus_finishedWithErrors=''{0}'' failed.
+Stepper_error_missingRequiredStep=Step execution failed. Required step or step group does not exist.\n\n{0}\n{1}\n\n{2}
+Stepper_error_requiredStepNotExecuted=Step execution failed. Required step or step group not executed before.\n\n{0}\n{1}\n\n{2}
+
+StepGroup_error_missingBaseStepGroup=Cannot determine steps for execution. Referenced base step group does not exist.\n\n{0}\n{1}\n\n{2}
+StepGroup_error_missingReferencedStep=Cannot determine steps for execution. Referenced step or step group does not exist.\n\n{0}\n{1}\n\n{2}
+StepGroup_error_missingRequiredStep=Invalid step. Required step or step group does not exist.\n\n{0}\n{1}\n\n{2}
+StepGroup_error_invalidRequiredStep=Invalid step. Required step is invalid.\n\n{0}\n{1}\n\n{2}
+StepGroup_error_multipleSingletonOccurrences=Cannot determine steps for execution. Only one reference allowed.\n\n{0}\n{1}\n\n{2}
+StepGroup_error_step=Step:\n\t{0}
+StepGroup_error_stepGroup=Step group:\n\t{0}
+StepGroup_error_requiredStep=Required Step:\n\t{0}
+StepGroup_error_referencedBaseGroup=Referenced Base Step Group:\n\t{0}
+StepGroup_error_referencedStepOrGroup=Referenced Step or Step Group:\n\t{0}
+StepGroup_error_requiredStepOrGroup=Required Step or Step Group:\n\t{0}
+
+StepExecutor_checkPoint_normalizationNeeded=Step finished with this
+StepExecutor_info_stepFailed=Step finished with this information: {0}\n\n\
+Context: {1}\n\{2}\n\
+Step: {3}
+StepExecutor_warning_stepFailed=Step finished with this warning: {0}\n\n\
+Context: {1}\n\{2}\n\
+Step: {3}
+StepExecutor_error_stepFailed=Step finished with this error: {0}\n\n\
+Context: {1}\n\{2}\n\
+Step: {3}
+StepExecutor_stepFailed_debugInfo=Debug info:\n{0}
+StepExecutor_warning_rollbackTimeout=Step rollback was aborted due to timeout.
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/stepper/Stepper.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/stepper/Stepper.java
index 57d307918..ab58e687b 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/stepper/Stepper.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/stepper/Stepper.java
@@ -1,738 +1,738 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Wind River Systems, Inc. and others. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.tcf.te.runtime.stepper.stepper;
-
-import java.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.List;
-
-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.MultiStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.tcf.te.runtime.callback.Callback;
-import org.eclipse.tcf.te.runtime.concurrent.util.ExecutorsUtil;
-import org.eclipse.tcf.te.runtime.interfaces.ISharedConstants;
-import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
-import org.eclipse.tcf.te.runtime.stepper.FullQualifiedId;
-import org.eclipse.tcf.te.runtime.stepper.StepperManager;
-import org.eclipse.tcf.te.runtime.stepper.activator.CoreBundleActivator;
-import org.eclipse.tcf.te.runtime.stepper.extensions.StepExecutor;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IStep;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepExecutor;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepGroup;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepGroupIterator;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepGroupable;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepper;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.tracing.ITraceIds;
-import org.eclipse.tcf.te.runtime.stepper.nls.Messages;
-import org.eclipse.tcf.te.runtime.utils.StatusHelper;
-
-/**
- * An abstract stepper implementation.
- */
-public class Stepper implements IStepper {
-
- private boolean initialized = false;
- private boolean finished = false;
- private IPropertiesContainer data = null;
- private IFullQualifiedId fullQualifiedId = null;
- private IProgressMonitor monitor = null;
- private IStepContext context = null;
- private boolean cancelable = true;
- private String stepGroupId = null;
- private String name = null;
-
- /**
- * Internal helper describing a fully executed step.
- */
- protected final class ExecutedContextStep {
- final IFullQualifiedId id;
- final IStep step;
-
- public ExecutedContextStep(IFullQualifiedId id, IStep step) {
- this.id = id;
- this.step = step;
- }
- }
-
- /**
- * Constructor.
- */
- public Stepper() {
- super();
- }
-
- /**
- * Constructor.
- *
- * @param name The name of this stepper.
- */
- public Stepper(String name) {
- super();
- this.name = name;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStepper#getId()
- */
- @Override
- public String getId() {
- return getClass().getName();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStepper#getLabel()
- */
- @Override
- public String getLabel() {
- return name != null && name.trim().length() > 0 ? name.trim() : getId();
- }
-
- /**
- * Returns the id of the step group to execute by the stepper.
- *
- * @return The step group id.
- */
- protected String getStepGroupId() {
- return stepGroupId;
- }
-
- /**
- * Returns the step group for the given step group id.
- *
- * @param The step group id. Must not be <code>null</code>:
- * @return The step group or <code>null</code>.
- */
- protected IStepGroup getStepGroup(String id) {
- Assert.isNotNull(id);
-
- CoreBundleActivator.getTraceHandler().trace("SingleContextStepper#getStepGroup:" //$NON-NLS-1$
- + " id = '" + id + "'", //$NON-NLS-1$ //$NON-NLS-2$
- 0, ITraceIds.TRACE_STEPPING, IStatus.WARNING, this);
-
- return StepperManager.getInstance().getStepGroupExtManager().getStepGroup(id, false);
- }
-
- /**
- * Creates a new instance of the step executor to use for executing a step.
- *
- * @param step The step. Must not be <code>null</code>.
- * @param secondaryId The secondary id or <code>null</code>.
- * @param fullQualifiedStepId The fully qualified step id. Must not be <code>null</code>.
- *
- * @return The step executor instance.
- */
- protected IStepExecutor doCreateStepExecutor(IStep step, String secondaryId, IFullQualifiedId fullQualifiedStepId) {
- Assert.isNotNull(step);
- Assert.isNotNull(fullQualifiedStepId);
- return new StepExecutor();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStepper#initialize(org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext, java.lang.String, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor)
- */
- @Override
- public final void initialize(IStepContext context, String stepGroupId, IPropertiesContainer data, IProgressMonitor monitor) throws IllegalStateException {
- Assert.isNotNull(context);
- Assert.isNotNull(stepGroupId);
- Assert.isNotNull(data);
-
- // Assert stepper is not in use
- if (isInitialized()) {
- throw new IllegalStateException("Stepper instance already initialized!"); //$NON-NLS-1$
- }
-
- // set the initial stepper attributes
- this.context = context;
- this.stepGroupId = stepGroupId;
- this.data = data;
- this.monitor = monitor != null ? monitor : new NullProgressMonitor();
- this.fullQualifiedId = new FullQualifiedId(IStepper.ID_TYPE_STEP_CONTEXT_ID, context.getId(), context.getSecondaryId());
-
- // but not finished yet
- this.finished = false;
-
- // call the hook for the subclasses to initialize themselves
- onInitialize(this.data, fullQualifiedId, this.monitor);
-
- setInitialized();
-
- CoreBundleActivator.getTraceHandler().trace("Stepper#initialize:" //$NON-NLS-1$
- + " data = " + data, //$NON-NLS-1$
- 0, ITraceIds.TRACE_STEPPING, IStatus.WARNING, this);
- }
-
- /**
- * Hook for subclasses to overwrite if subclasses wants to initialize their own state.
- *
- * @param data The data. Must not be <code>null</code>.
- * @param fullQualifiedId The full qualified id of this stepper.
- * @param monitor The progress monitor. Must not be <code>null</code>.
- */
- protected void onInitialize(IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor) {
- Assert.isNotNull(data);
- Assert.isNotNull(monitor);
- }
-
- /**
- * Marks the stepper to be fully initialized.
- */
- protected final void setInitialized() {
- initialized = true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStepper#isInitialized()
- */
- @Override
- public final boolean isInitialized() {
- return initialized;
- }
-
- /**
- * Sets the cancelable state of the stepper.
- *
- * @param cancelable <code>True</code> if the stepper shall be cancelable, <code>false</code> if
- * not.
- */
- protected final void setCancelable(boolean cancelable) {
- this.cancelable = cancelable;
- }
-
- /**
- * Returns the cancelable state of the stepper.
- *
- * @return <code>True</code> if the stepper is cancelable, <code>false</code> if not.
- */
- protected final boolean isCancelable() {
- return cancelable;
- }
-
- /**
- * Get the active context.
- *
- * @return The active context or <code>null</code>.
- */
- protected IStepContext getContext() {
- return context;
- }
-
- /**
- * Get the context id.
- *
- * @return The context id or <code>null</code>.
- */
- protected String getContextId() {
- return context != null ? context.getId() : null;
- }
-
- /**
- * Returns the currently associated data. The method returns <code>null</code> if the stepper is
- * not in initialized state.
- *
- * @return The data or <code>null</code>
- */
- protected final IPropertiesContainer getData() {
- return isInitialized() ? data : null;
- }
-
- /**
- * Returns the full qualified id for this stepper.
- *
- * @return The full qualified stepper id.
- */
- protected final IFullQualifiedId getFullQualifiedId() {
- return fullQualifiedId;
- }
-
- /**
- * Returns the currently associated progress monitor. The method returns <code>null</code> if
- * the stepper is not in initialized state.
- *
- * @return The progress monitor or <code>null</code>
- */
- protected final IProgressMonitor getMonitor() {
- return isInitialized() ? monitor : null;
- }
-
- /**
- * Marks the stepper to be finished.
- */
- protected final void setFinished() {
- finished = true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStepper#isFinished()
- */
- @Override
- public final boolean isFinished() {
- return finished;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStepper#cleanup()
- */
- @Override
- public void cleanup() {
- // Set the progress monitor done here in any case
- if (getMonitor() != null) {
- getMonitor().done();
- }
-
- // Reset the initial stepper attributes
- context = null;
- data = null;
- monitor = null;
- fullQualifiedId = null;
- finished = false;
- initialized = false;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- @Override
- public String toString() {
- StringBuilder buffer = new StringBuilder(getClass().getSimpleName());
- buffer.append(" (" + getLabel() + ")"); //$NON-NLS-1$ //$NON-NLS-2$
- buffer.append(": "); //$NON-NLS-1$
- buffer.append("id = " + getId()); //$NON-NLS-1$
- return buffer.toString();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStepper#execute()
- */
- @Override
- public final void execute() throws CoreException {
- long startTime = System.currentTimeMillis();
-
- CoreBundleActivator.getTraceHandler().trace("Stepper#execute: *** ENTERED", //$NON-NLS-1$
- 0, ITraceIds.TRACE_STEPPING, IStatus.WARNING, this);
- CoreBundleActivator.getTraceHandler().trace(" [" + ISharedConstants.TIME_FORMAT.format(new Date(startTime)) + "]" //$NON-NLS-1$ //$NON-NLS-2$
- + " ***", //$NON-NLS-1$
- 0, ITraceIds.PROFILE_STEPPING, IStatus.WARNING, this);
-
- try {
- // stepper must be initialized before executing
- if (!isInitialized()) {
- throw new CoreException(new Status(IStatus.ERROR, CoreBundleActivator.getUniqueIdentifier(), Messages.Stepper_error_initializeNotCalled));
- }
-
- // Create a container for collecting the non-severe status objects
- // during the step execution. Non-severe status objects will
- // be hold back till the execution completed or stopped with an error.
- // Severe status objects are errors or cancellation.
- List<IStatus> statusContainer = new ArrayList<IStatus>();
-
- // start execution
- internalExecute(statusContainer);
-
- // If the warnings container is not empty, create a new status and
- // throw a core exception
- if (!statusContainer.isEmpty()) {
- IStatus status = null;
-
- // Check if we need a multi status
- if (statusContainer.size() > 1) {
- MultiStatus multiStatus = new MultiStatus(CoreBundleActivator.getUniqueIdentifier(), 0,
- NLS.bind(Messages.Stepper_multiStatus_finishedWithWarnings, getLabel()), null);
- for (IStatus subStatus : statusContainer) {
- multiStatus.merge(subStatus);
- }
- status = multiStatus;
- }
- else {
- status = statusContainer.get(0);
- }
-
- throw new CoreException(status);
- }
- }
- finally {
- // Mark the stepper finished
- setFinished();
-
- long endTime = System.currentTimeMillis();
- CoreBundleActivator.getTraceHandler().trace("Stepper#execute: *** DONE", //$NON-NLS-1$
- 0, ITraceIds.TRACE_STEPPING, IStatus.WARNING, this);
- CoreBundleActivator.getTraceHandler().trace(" [" + ISharedConstants.TIME_FORMAT.format(new Date(endTime)) //$NON-NLS-1$
- + " , delay = " + (endTime - startTime) + " ms]" //$NON-NLS-1$ //$NON-NLS-2$
- + " ***", //$NON-NLS-1$
- 0, ITraceIds.PROFILE_STEPPING, IStatus.WARNING, this);
- }
- }
-
- /**
- * Executes a step or step group.
- *
- * @param statusContainer The status container. Must not be <code>null</code>.
- * @throws CoreException If the execution fails.
- */
- protected void internalExecute(List<IStatus> statusContainer) throws CoreException {
- Assert.isNotNull(statusContainer);
-
- // Get the step group id
- String stepGroupId = getStepGroupId();
-
- // If no step group id is available, throw an exception
- if (stepGroupId == null) {
- throw new CoreException(new Status(IStatus.ERROR, CoreBundleActivator.getUniqueIdentifier(),
- NLS.bind(Messages.Stepper_error_missingStepGroupId, getLabel())));
- }
-
- // Get the step group
- IStepGroup stepGroup = getStepGroup(stepGroupId);
-
- // If no step group could be found, throw an exception
- if (stepGroup == null) {
- throw new CoreException(new Status(IStatus.ERROR, CoreBundleActivator.getUniqueIdentifier(),
- NLS.bind(Messages.Stepper_error_missingStepGroup, stepGroupId)));
- }
-
- // Initialize the progress monitor
- getMonitor().beginTask(stepGroup.getLabel(), calculateTotalWork(stepGroup));
-
- IFullQualifiedId fullQualifiedId = getFullQualifiedId().createChildId(ID_TYPE_STEPPER_ID, getId(), null);
- fullQualifiedId = fullQualifiedId.createChildId(ID_TYPE_STEP_GROUP_ID, stepGroup.getId(), null);
- // Execute the step group
- executeStepGroup(stepGroup, statusContainer, new ArrayList<ExecutedContextStep>(), fullQualifiedId);
- }
-
- /**
- * Executes a step group.
- *
- * @param stepGroupId The step group. Must not be <code>null</code>.
- * @param statusContainer A list holding the warnings occurred during the execution. Must not be
- * <code>null</code>.
- * @param executedSteps A list holding the id's of the steps executed before. Must not be
- * <code>null</code>.
- * @param fullQualifiedGroupId The hierarchy of all parent step group id's separated by "::".
- * Must not be <code>null</code>.
- *
- * @throws CoreException If the execution fails.
- */
- private void executeStepGroup(IStepGroup stepGroup, List<IStatus> statusContainer, List<ExecutedContextStep> executedSteps, IFullQualifiedId fullQualifiedGroupId) throws CoreException {
- Assert.isNotNull(stepGroup);
- Assert.isNotNull(statusContainer);
- Assert.isNotNull(executedSteps);
- Assert.isNotNull(fullQualifiedGroupId);
-
- // Return immediately if the user canceled the monitor in the meanwhile
- if (isCancelable() && getMonitor().isCanceled()) {
- rollback(executedSteps, Status.CANCEL_STATUS, getMonitor());
- throw new CoreException(StatusHelper.getStatus(new OperationCanceledException()));
- }
-
- CoreBundleActivator
- .getTraceHandler()
- .trace("Stepper#executeStepGroup: step group: '" + stepGroup.getLabel() + "'", //$NON-NLS-1$ //$NON-NLS-2$
- 0, ITraceIds.TRACE_STEPPING, IStatus.WARNING, this);
-
- // Resolve the steps to execute
- IStepGroupable[] groupables = stepGroup.getSteps(getContext());
-
- IStepGroupIterator iterator = stepGroup.getStepGroupIterator();
- IFullQualifiedId fullQualifiedIterationId = fullQualifiedGroupId;
- int iteration = 0;
-
- if (iterator != null) {
- iterator.initialize(getContext(), getData(), fullQualifiedGroupId, getMonitor());
- }
- boolean next = iterator == null || iterator.hasNext(getContext(), getData(), fullQualifiedGroupId, getMonitor());
-
- while (next) {
- if (iterator != null) {
- fullQualifiedIterationId = fullQualifiedGroupId.getParentId().createChildId(ID_TYPE_STEP_GROUP_ID, stepGroup.getId(), "" + iteration); //$NON-NLS-1$
- iterator.next(getContext(), getData(), fullQualifiedIterationId, getMonitor());
- }
- // Execute the steps or step groups.
- for (IStepGroupable groupable : groupables) {
- executeGroupable(groupable, statusContainer, executedSteps, fullQualifiedIterationId);
- }
- iteration++;
- next = iterator != null && iterator.hasNext(getContext(), getData(), fullQualifiedGroupId, getMonitor());
- }
- }
-
- /**
- * Executes a step groupable. The groupable might encapsulate a step or a step group.
- *
- * @param step The step groupable. Must not be <code>null</code>.
- * @param statusContainer A list holding the warnings occurred during the execution. Must not be
- * <code>null</code>.
- * @param executedSteps A list holding the id's of the steps executed before. Must not be
- * <code>null</code>.
- * @param fullQualifiedParentId The hierarchy of all parent step group id's separated by "::".
- * Must not be <code>null</code>.
- *
- * @throws CoreException If the execution failed.
- */
- private void executeGroupable(IStepGroupable groupable, List<IStatus> statusContainer, List<ExecutedContextStep> executedSteps, IFullQualifiedId fullQualifiedParentId) throws CoreException {
- Assert.isNotNull(groupable);
- Assert.isNotNull(statusContainer);
- Assert.isNotNull(executedSteps);
- Assert.isNotNull(fullQualifiedParentId);
-
- // Return immediately if the user canceled the monitor in the meanwhile
- if (isCancelable() && getMonitor() != null && getMonitor().isCanceled()) {
- rollback(executedSteps, Status.CANCEL_STATUS, getMonitor());
- throw new CoreException(StatusHelper.getStatus(new OperationCanceledException()));
- }
-
- // If the passed in groupable is disabled -> we are done immediately
- if (groupable.isDisabled()) {
- CoreBundleActivator.getTraceHandler().trace("Stepper#executeGroupable: DROPPED DISABLED groupable: id = '" + groupable.getExtension().getId() + "'" //$NON-NLS-1$ //$NON-NLS-2$
- + ", secondaryId = '" + groupable.getSecondaryId() + "'", //$NON-NLS-1$ //$NON-NLS-2$
- 0, ITraceIds.TRACE_STEPPING, IStatus.WARNING, this);
- return;
- }
-
- // Check if all dependencies of the groupable have been executed before
- checkForDependenciesExecuted(groupable, executedSteps);
-
- if (groupable.getExtension() instanceof IStepGroup) {
- IFullQualifiedId id = fullQualifiedParentId.createChildId(ID_TYPE_STEP_GROUP_ID, groupable.getExtension().getId(), groupable.getSecondaryId());
- // If the passed in groupable is associated with a step group
- // -> get the groupable from that group and execute them
- executeStepGroup((IStepGroup) groupable.getExtension(), statusContainer, executedSteps, id);
- }
- else if (groupable.getExtension() instanceof IStep) {
- // If the passed in groupable is associated with a step
- // -> check if the required steps have been executed before,
- // create a step executor and invoke the executor.
- IStep step = (IStep) groupable.getExtension();
-
- IFullQualifiedId id = fullQualifiedParentId.createChildId(ID_TYPE_STEP_ID, step.getId(), groupable.getSecondaryId());
-
- // Create the step executor now
- IStepExecutor executor = doCreateStepExecutor(step, groupable.getSecondaryId(), id);
- Assert.isNotNull(executor);
-
- try {
- executedSteps.add(new ExecutedContextStep(id, step));
- // Invoke the executor now
- executor.execute(step, id, getContext(), getData(), getMonitor());
- }
- catch (Exception e) {
- // Catch the CoreException first hand as we need to continue the
- // stepping if the step returned with warnings or information only.
- CoreException coreException = normalizeStatus(e, statusContainer);
- // If the exception has been not eaten, rollback previously executed
- // steps and re-throw the exception.
- if (coreException != null) {
- // Rollback everything, if the step(s) are supporting this and
- // the cleanup hasn't been done already.
- if (isInitialized()) {
- rollback(executedSteps, coreException.getStatus(), getMonitor());
- }
-
- // Re-throw the exception
- throw coreException;
- }
- }
- }
- }
-
- /**
- * Checks if all required dependencies have been executed before. If not, the method will throw
- * an error status.
- *
- * @param groupable The groupable. Must not be <code>null</code>.
- * @param executedSteps A list holding the id's of the steps executed before. Must not be
- * <code>null</code>.
- *
- * @throws CoreException If a dependency has not been executed before.
- */
- protected void checkForDependenciesExecuted(IStepGroupable groupable, List<ExecutedContextStep> executedSteps) throws CoreException {
- Assert.isNotNull(groupable);
- Assert.isNotNull(executedSteps);
-
- // Build up the complete list of dependencies.
- List<String> dependencies = new ArrayList<String>(Arrays.asList(groupable.getDependencies()));
- // If the groupable wraps a step, the step can have additional dependencies to check
- if (groupable.getExtension() instanceof IStep) {
- dependencies.addAll(Arrays.asList(((IStep) groupable.getExtension()).getDependencies()));
- }
-
- // Check each dependency now.
- for (String dependency : dependencies) {
- // The dependencies might be fully qualified. Split out the primary id.
- String[] splitted = dependency.split("##", 2); //$NON-NLS-1$
- String primaryId = splitted.length == 2 ? splitted[0] : dependency;
-
- // Check if the id is in the list of executed steps. As the list contains
- // the fully qualified id's, we cannot just check for contained
- boolean requiredStepExecuted = false;
- for (ExecutedContextStep step : executedSteps) {
- if (step.step.getId().equals(primaryId)) {
- requiredStepExecuted = true;
- break;
- }
- }
-
- if (!requiredStepExecuted) {
- throw new CoreException(new Status(IStatus.ERROR, CoreBundleActivator.getUniqueIdentifier(),
- MessageFormat.format(Messages.Stepper_error_requiredStepNotExecuted,
- NLS.bind(groupable.getExtension() instanceof IStep ? Messages.Stepper_error_step : Messages.Stepper_error_stepGroup,
- groupable.getExtension().getId()),
- NLS.bind(Messages.Stepper_error_requiredStepOrGroup, dependency), ""))); //$NON-NLS-1$
- }
-
- // Recursive checking is not necessary here as the step or step group
- // id's would have made it the executed steps list of they missed required
- // steps or step groups.
- }
-
- }
-
- /**
- * Rollback the steps previously executed to the failed step.
- * The rollback is executed in reverse order.
- *
- * @param executedSteps The list of executed steps.
- * @param progress The progress monitor.
- */
- protected final void rollback(final List<ExecutedContextStep> executedSteps, final IStatus rollBackStatus, IProgressMonitor progress) {
- Assert.isNotNull(executedSteps);
-
-
- while (!executedSteps.isEmpty()) {
- ExecutedContextStep executedStep = executedSteps.remove(executedSteps.size() - 1);
- Callback callback = new Callback();
- progress.setTaskName("Rollback " + executedStep.step.getLabel()); //$NON-NLS-1$
- executedStep.step.rollback(getContext(), getData(), rollBackStatus, executedStep.id, progress, callback);
- ExecutorsUtil.waitAndExecute(60000, callback.getDoneConditionTester(null));
- }
- }
-
- /**
- * Calculates the total work required for the step group. The total work is the sum of the total
- * work of each sub step. If one of the steps returns {@link IProgressMonitor#UNKNOWN}, the
- * total work will be unknown for the whole step group.
- *
- * @param stepGroupId The step group. Must not be <code>null</code>.
- * @return The total work required or {@link IProgressMonitor#UNKNOWN}.
- *
- * @throws CoreException If the total work of the step group cannot be determined.
- */
- protected int calculateTotalWork(IStepGroup stepGroup) throws CoreException {
- Assert.isNotNull(stepGroup);
-
- int totalWork = 0;
-
- // Loop the group steps and summarize the returned total work
- IStepGroupable[] groupables = stepGroup.getSteps(getContext());
- for (IStepGroupable groupable : groupables) {
- int work = groupable.getExtension() instanceof IStep ? ((IStep) groupable
- .getExtension()).getTotalWork(getContext(), getData()) : groupable
- .getExtension() instanceof IStepGroup ? calculateTotalWork((IStepGroup) groupable
- .getExtension()) : IProgressMonitor.UNKNOWN;
-
- if (work == IProgressMonitor.UNKNOWN) {
- totalWork = IProgressMonitor.UNKNOWN;
- break;
- }
-
- totalWork += work;
- }
-
- return totalWork;
- }
-
- /**
- * Normalize the associated status object of the given {@link CoreException}.
- * <p>
- * If the associated status contains only WARNING or INFORMATION status objects, the objects are
- * added to the passed in status container. The passed in exception is dropped and the method
- * will return <code>null</code>.
- * <p>
- * If the associated status contains only OK status objects, the passed in exception and the
- * associated status are dropped and the method will return <code>null</code>.
- * <p>
- * If the associated status contain ERROR status objects, the passed in exception and the
- * associated status objects are returned if the passed in status container is empty. If the
- * status container is not empty, a new exception and multi status object is created and
- * returned. The multi status object will contain all status objects from the status container
- * and all objects of the originally associated status.
- * <p>
- * If the associated status contains a CANCEL status object, the passed in exception and the
- * associated status objects are returned unmodified.
- *
- * @param e The core exception. Must not be <code>null</code>.
- * @param statusContainer The list of non-severe status objects. Must not be <code>null</code>.
- * @return The exception to re-throw or <code>null</code>.
- */
- private CoreException normalizeStatus(Exception e, List<IStatus> statusContainer) {
- Assert.isNotNull(statusContainer);
-
- CoreException coreException = null;
-
- IStatus status = Status.OK_STATUS;
- // Get the associated status from the exception
- if (e instanceof CoreException) {
- status = ((CoreException) e).getStatus();
- coreException = (CoreException) e;
- }
- else if (e instanceof OperationCanceledException) {
- status = new Status(IStatus.CANCEL, CoreBundleActivator.getUniqueIdentifier(), e.getLocalizedMessage(), e);
- coreException = new CoreException(status);
- }
- else if (e != null) {
- status = new Status(IStatus.ERROR, CoreBundleActivator.getUniqueIdentifier(), e.getLocalizedMessage(), e);
- coreException = new CoreException(status);
- }
-
- // Check the severity
- // PS: MultiStatus.getSeverity() returns always the highest severity.
- if (status.getSeverity() == IStatus.OK) {
- // OK -> drop completely and return null
- coreException = null;
- }
- else if (status.getSeverity() == IStatus.CANCEL) {
- // CANCEL -> Check monitor to be canceled.
- if (isCancelable()) {
- if (getMonitor() != null && !getMonitor().isCanceled()) {
- getMonitor().setCanceled(true);
- }
- }
- }
- else if (status.getSeverity() == IStatus.WARNING || status.getSeverity() == IStatus.INFO) {
- // WARNING or INFORMATION -> add to the list and return null
- statusContainer.add(status);
- coreException = null;
- }
- else if (status.getSeverity() == IStatus.ERROR) {
- // Error -> If the warnings container not empty, create
- // a new MultiStatus.
- if (!statusContainer.isEmpty()) {
- MultiStatus multiStatus = new MultiStatus(status.getPlugin(), status.getCode(), NLS.bind(Messages.Stepper_multiStatus_finishedWithErrors, getLabel()), null);
- for (IStatus stat : statusContainer) {
- multiStatus.merge(stat);
- }
- // Re-throw via a new CoreException
- coreException = new CoreException(multiStatus);
- }
- }
-
- return coreException;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011, 2013 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.runtime.stepper.stepper;
+
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
+
+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.MultiStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.tcf.te.runtime.callback.Callback;
+import org.eclipse.tcf.te.runtime.concurrent.util.ExecutorsUtil;
+import org.eclipse.tcf.te.runtime.interfaces.ISharedConstants;
+import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
+import org.eclipse.tcf.te.runtime.stepper.FullQualifiedId;
+import org.eclipse.tcf.te.runtime.stepper.StepperManager;
+import org.eclipse.tcf.te.runtime.stepper.activator.CoreBundleActivator;
+import org.eclipse.tcf.te.runtime.stepper.extensions.StepExecutor;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IStep;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepExecutor;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepGroup;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepGroupIterator;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepGroupable;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepper;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.tracing.ITraceIds;
+import org.eclipse.tcf.te.runtime.stepper.nls.Messages;
+import org.eclipse.tcf.te.runtime.utils.StatusHelper;
+
+/**
+ * An abstract stepper implementation.
+ */
+public class Stepper implements IStepper {
+
+ private boolean initialized = false;
+ private boolean finished = false;
+ private IPropertiesContainer data = null;
+ private IFullQualifiedId fullQualifiedId = null;
+ private IProgressMonitor monitor = null;
+ private IStepContext context = null;
+ private boolean cancelable = true;
+ private String stepGroupId = null;
+ private String name = null;
+
+ /**
+ * Internal helper describing a fully executed step.
+ */
+ protected final class ExecutedContextStep {
+ final IFullQualifiedId id;
+ final IStep step;
+
+ public ExecutedContextStep(IFullQualifiedId id, IStep step) {
+ this.id = id;
+ this.step = step;
+ }
+ }
+
+ /**
+ * Constructor.
+ */
+ public Stepper() {
+ super();
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param name The name of this stepper.
+ */
+ public Stepper(String name) {
+ super();
+ this.name = name;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStepper#getId()
+ */
+ @Override
+ public String getId() {
+ return getClass().getName();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStepper#getLabel()
+ */
+ @Override
+ public String getLabel() {
+ return name != null && name.trim().length() > 0 ? name.trim() : getId();
+ }
+
+ /**
+ * Returns the id of the step group to execute by the stepper.
+ *
+ * @return The step group id.
+ */
+ protected String getStepGroupId() {
+ return stepGroupId;
+ }
+
+ /**
+ * Returns the step group for the given step group id.
+ *
+ * @param The step group id. Must not be <code>null</code>:
+ * @return The step group or <code>null</code>.
+ */
+ protected IStepGroup getStepGroup(String id) {
+ Assert.isNotNull(id);
+
+ CoreBundleActivator.getTraceHandler().trace("SingleContextStepper#getStepGroup:" //$NON-NLS-1$
+ + " id = '" + id + "'", //$NON-NLS-1$ //$NON-NLS-2$
+ 0, ITraceIds.TRACE_STEPPING, IStatus.WARNING, this);
+
+ return StepperManager.getInstance().getStepGroupExtManager().getStepGroup(id, false);
+ }
+
+ /**
+ * Creates a new instance of the step executor to use for executing a step.
+ *
+ * @param step The step. Must not be <code>null</code>.
+ * @param secondaryId The secondary id or <code>null</code>.
+ * @param fullQualifiedStepId The fully qualified step id. Must not be <code>null</code>.
+ *
+ * @return The step executor instance.
+ */
+ protected IStepExecutor doCreateStepExecutor(IStep step, String secondaryId, IFullQualifiedId fullQualifiedStepId) {
+ Assert.isNotNull(step);
+ Assert.isNotNull(fullQualifiedStepId);
+ return new StepExecutor();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStepper#initialize(org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext, java.lang.String, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ public final void initialize(IStepContext context, String stepGroupId, IPropertiesContainer data, IProgressMonitor monitor) throws IllegalStateException {
+ Assert.isNotNull(context);
+ Assert.isNotNull(stepGroupId);
+ Assert.isNotNull(data);
+
+ // Assert stepper is not in use
+ if (isInitialized()) {
+ throw new IllegalStateException("Stepper instance already initialized!"); //$NON-NLS-1$
+ }
+
+ // set the initial stepper attributes
+ this.context = context;
+ this.stepGroupId = stepGroupId;
+ this.data = data;
+ this.monitor = monitor != null ? monitor : new NullProgressMonitor();
+ this.fullQualifiedId = new FullQualifiedId(IStepper.ID_TYPE_STEP_CONTEXT_ID, context.getId(), context.getSecondaryId());
+
+ // but not finished yet
+ this.finished = false;
+
+ // call the hook for the subclasses to initialize themselves
+ onInitialize(this.data, fullQualifiedId, this.monitor);
+
+ setInitialized();
+
+ CoreBundleActivator.getTraceHandler().trace("Stepper#initialize:" //$NON-NLS-1$
+ + " data = " + data, //$NON-NLS-1$
+ 0, ITraceIds.TRACE_STEPPING, IStatus.WARNING, this);
+ }
+
+ /**
+ * Hook for subclasses to overwrite if subclasses wants to initialize their own state.
+ *
+ * @param data The data. Must not be <code>null</code>.
+ * @param fullQualifiedId The full qualified id of this stepper.
+ * @param monitor The progress monitor. Must not be <code>null</code>.
+ */
+ protected void onInitialize(IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor) {
+ Assert.isNotNull(data);
+ Assert.isNotNull(monitor);
+ }
+
+ /**
+ * Marks the stepper to be fully initialized.
+ */
+ protected final void setInitialized() {
+ initialized = true;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStepper#isInitialized()
+ */
+ @Override
+ public final boolean isInitialized() {
+ return initialized;
+ }
+
+ /**
+ * Sets the cancelable state of the stepper.
+ *
+ * @param cancelable <code>True</code> if the stepper shall be cancelable, <code>false</code> if
+ * not.
+ */
+ protected final void setCancelable(boolean cancelable) {
+ this.cancelable = cancelable;
+ }
+
+ /**
+ * Returns the cancelable state of the stepper.
+ *
+ * @return <code>True</code> if the stepper is cancelable, <code>false</code> if not.
+ */
+ protected final boolean isCancelable() {
+ return cancelable;
+ }
+
+ /**
+ * Get the active context.
+ *
+ * @return The active context or <code>null</code>.
+ */
+ protected IStepContext getContext() {
+ return context;
+ }
+
+ /**
+ * Get the context id.
+ *
+ * @return The context id or <code>null</code>.
+ */
+ protected String getContextId() {
+ return context != null ? context.getId() : null;
+ }
+
+ /**
+ * Returns the currently associated data. The method returns <code>null</code> if the stepper is
+ * not in initialized state.
+ *
+ * @return The data or <code>null</code>
+ */
+ protected final IPropertiesContainer getData() {
+ return isInitialized() ? data : null;
+ }
+
+ /**
+ * Returns the full qualified id for this stepper.
+ *
+ * @return The full qualified stepper id.
+ */
+ protected final IFullQualifiedId getFullQualifiedId() {
+ return fullQualifiedId;
+ }
+
+ /**
+ * Returns the currently associated progress monitor. The method returns <code>null</code> if
+ * the stepper is not in initialized state.
+ *
+ * @return The progress monitor or <code>null</code>
+ */
+ protected final IProgressMonitor getMonitor() {
+ return isInitialized() ? monitor : null;
+ }
+
+ /**
+ * Marks the stepper to be finished.
+ */
+ protected final void setFinished() {
+ finished = true;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStepper#isFinished()
+ */
+ @Override
+ public final boolean isFinished() {
+ return finished;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStepper#cleanup()
+ */
+ @Override
+ public void cleanup() {
+ // Set the progress monitor done here in any case
+ if (getMonitor() != null) {
+ getMonitor().done();
+ }
+
+ // Reset the initial stepper attributes
+ context = null;
+ data = null;
+ monitor = null;
+ fullQualifiedId = null;
+ finished = false;
+ initialized = false;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+ StringBuilder buffer = new StringBuilder(getClass().getSimpleName());
+ buffer.append(" (" + getLabel() + ")"); //$NON-NLS-1$ //$NON-NLS-2$
+ buffer.append(": "); //$NON-NLS-1$
+ buffer.append("id = " + getId()); //$NON-NLS-1$
+ return buffer.toString();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStepper#execute()
+ */
+ @Override
+ public final void execute() throws CoreException {
+ long startTime = System.currentTimeMillis();
+
+ CoreBundleActivator.getTraceHandler().trace("Stepper#execute: *** ENTERED", //$NON-NLS-1$
+ 0, ITraceIds.TRACE_STEPPING, IStatus.WARNING, this);
+ CoreBundleActivator.getTraceHandler().trace(" [" + ISharedConstants.TIME_FORMAT.format(new Date(startTime)) + "]" //$NON-NLS-1$ //$NON-NLS-2$
+ + " ***", //$NON-NLS-1$
+ 0, ITraceIds.PROFILE_STEPPING, IStatus.WARNING, this);
+
+ try {
+ // stepper must be initialized before executing
+ if (!isInitialized()) {
+ throw new CoreException(new Status(IStatus.ERROR, CoreBundleActivator.getUniqueIdentifier(), Messages.Stepper_error_initializeNotCalled));
+ }
+
+ // Create a container for collecting the non-severe status objects
+ // during the step execution. Non-severe status objects will
+ // be hold back till the execution completed or stopped with an error.
+ // Severe status objects are errors or cancellation.
+ List<IStatus> statusContainer = new ArrayList<IStatus>();
+
+ // start execution
+ internalExecute(statusContainer);
+
+ // If the warnings container is not empty, create a new status and
+ // throw a core exception
+ if (!statusContainer.isEmpty()) {
+ IStatus status = null;
+
+ // Check if we need a multi status
+ if (statusContainer.size() > 1) {
+ MultiStatus multiStatus = new MultiStatus(CoreBundleActivator.getUniqueIdentifier(), 0,
+ NLS.bind(Messages.Stepper_multiStatus_finishedWithWarnings, getLabel()), null);
+ for (IStatus subStatus : statusContainer) {
+ multiStatus.merge(subStatus);
+ }
+ status = multiStatus;
+ }
+ else {
+ status = statusContainer.get(0);
+ }
+
+ throw new CoreException(status);
+ }
+ }
+ finally {
+ // Mark the stepper finished
+ setFinished();
+
+ long endTime = System.currentTimeMillis();
+ CoreBundleActivator.getTraceHandler().trace("Stepper#execute: *** DONE", //$NON-NLS-1$
+ 0, ITraceIds.TRACE_STEPPING, IStatus.WARNING, this);
+ CoreBundleActivator.getTraceHandler().trace(" [" + ISharedConstants.TIME_FORMAT.format(new Date(endTime)) //$NON-NLS-1$
+ + " , delay = " + (endTime - startTime) + " ms]" //$NON-NLS-1$ //$NON-NLS-2$
+ + " ***", //$NON-NLS-1$
+ 0, ITraceIds.PROFILE_STEPPING, IStatus.WARNING, this);
+ }
+ }
+
+ /**
+ * Executes a step or step group.
+ *
+ * @param statusContainer The status container. Must not be <code>null</code>.
+ * @throws CoreException If the execution fails.
+ */
+ protected void internalExecute(List<IStatus> statusContainer) throws CoreException {
+ Assert.isNotNull(statusContainer);
+
+ // Get the step group id
+ String stepGroupId = getStepGroupId();
+
+ // If no step group id is available, throw an exception
+ if (stepGroupId == null) {
+ throw new CoreException(new Status(IStatus.ERROR, CoreBundleActivator.getUniqueIdentifier(),
+ NLS.bind(Messages.Stepper_error_missingStepGroupId, getLabel())));
+ }
+
+ // Get the step group
+ IStepGroup stepGroup = getStepGroup(stepGroupId);
+
+ // If no step group could be found, throw an exception
+ if (stepGroup == null) {
+ throw new CoreException(new Status(IStatus.ERROR, CoreBundleActivator.getUniqueIdentifier(),
+ NLS.bind(Messages.Stepper_error_missingStepGroup, stepGroupId)));
+ }
+
+ // Initialize the progress monitor
+ getMonitor().beginTask(stepGroup.getLabel(), calculateTotalWork(stepGroup));
+
+ IFullQualifiedId fullQualifiedId = getFullQualifiedId().createChildId(ID_TYPE_STEPPER_ID, getId(), null);
+ fullQualifiedId = fullQualifiedId.createChildId(ID_TYPE_STEP_GROUP_ID, stepGroup.getId(), null);
+ // Execute the step group
+ executeStepGroup(stepGroup, statusContainer, new ArrayList<ExecutedContextStep>(), fullQualifiedId);
+ }
+
+ /**
+ * Executes a step group.
+ *
+ * @param stepGroupId The step group. Must not be <code>null</code>.
+ * @param statusContainer A list holding the warnings occurred during the execution. Must not be
+ * <code>null</code>.
+ * @param executedSteps A list holding the id's of the steps executed before. Must not be
+ * <code>null</code>.
+ * @param fullQualifiedGroupId The hierarchy of all parent step group id's separated by "::".
+ * Must not be <code>null</code>.
+ *
+ * @throws CoreException If the execution fails.
+ */
+ private void executeStepGroup(IStepGroup stepGroup, List<IStatus> statusContainer, List<ExecutedContextStep> executedSteps, IFullQualifiedId fullQualifiedGroupId) throws CoreException {
+ Assert.isNotNull(stepGroup);
+ Assert.isNotNull(statusContainer);
+ Assert.isNotNull(executedSteps);
+ Assert.isNotNull(fullQualifiedGroupId);
+
+ // Return immediately if the user canceled the monitor in the meanwhile
+ if (isCancelable() && getMonitor().isCanceled()) {
+ rollback(executedSteps, Status.CANCEL_STATUS, getMonitor());
+ throw new CoreException(StatusHelper.getStatus(new OperationCanceledException()));
+ }
+
+ CoreBundleActivator
+ .getTraceHandler()
+ .trace("Stepper#executeStepGroup: step group: '" + stepGroup.getLabel() + "'", //$NON-NLS-1$ //$NON-NLS-2$
+ 0, ITraceIds.TRACE_STEPPING, IStatus.WARNING, this);
+
+ // Resolve the steps to execute
+ IStepGroupable[] groupables = stepGroup.getSteps(getContext());
+
+ IStepGroupIterator iterator = stepGroup.getStepGroupIterator();
+ IFullQualifiedId fullQualifiedIterationId = fullQualifiedGroupId;
+ int iteration = 0;
+
+ if (iterator != null) {
+ iterator.initialize(getContext(), getData(), fullQualifiedGroupId, getMonitor());
+ }
+ boolean next = iterator == null || iterator.hasNext(getContext(), getData(), fullQualifiedGroupId, getMonitor());
+
+ while (next) {
+ if (iterator != null) {
+ fullQualifiedIterationId = fullQualifiedGroupId.getParentId().createChildId(ID_TYPE_STEP_GROUP_ID, stepGroup.getId(), "" + iteration); //$NON-NLS-1$
+ iterator.next(getContext(), getData(), fullQualifiedIterationId, getMonitor());
+ }
+ // Execute the steps or step groups.
+ for (IStepGroupable groupable : groupables) {
+ executeGroupable(groupable, statusContainer, executedSteps, fullQualifiedIterationId);
+ }
+ iteration++;
+ next = iterator != null && iterator.hasNext(getContext(), getData(), fullQualifiedGroupId, getMonitor());
+ }
+ }
+
+ /**
+ * Executes a step groupable. The groupable might encapsulate a step or a step group.
+ *
+ * @param step The step groupable. Must not be <code>null</code>.
+ * @param statusContainer A list holding the warnings occurred during the execution. Must not be
+ * <code>null</code>.
+ * @param executedSteps A list holding the id's of the steps executed before. Must not be
+ * <code>null</code>.
+ * @param fullQualifiedParentId The hierarchy of all parent step group id's separated by "::".
+ * Must not be <code>null</code>.
+ *
+ * @throws CoreException If the execution failed.
+ */
+ private void executeGroupable(IStepGroupable groupable, List<IStatus> statusContainer, List<ExecutedContextStep> executedSteps, IFullQualifiedId fullQualifiedParentId) throws CoreException {
+ Assert.isNotNull(groupable);
+ Assert.isNotNull(statusContainer);
+ Assert.isNotNull(executedSteps);
+ Assert.isNotNull(fullQualifiedParentId);
+
+ // Return immediately if the user canceled the monitor in the meanwhile
+ if (isCancelable() && getMonitor() != null && getMonitor().isCanceled()) {
+ rollback(executedSteps, Status.CANCEL_STATUS, getMonitor());
+ throw new CoreException(StatusHelper.getStatus(new OperationCanceledException()));
+ }
+
+ // If the passed in groupable is disabled -> we are done immediately
+ if (groupable.isDisabled()) {
+ CoreBundleActivator.getTraceHandler().trace("Stepper#executeGroupable: DROPPED DISABLED groupable: id = '" + groupable.getExtension().getId() + "'" //$NON-NLS-1$ //$NON-NLS-2$
+ + ", secondaryId = '" + groupable.getSecondaryId() + "'", //$NON-NLS-1$ //$NON-NLS-2$
+ 0, ITraceIds.TRACE_STEPPING, IStatus.WARNING, this);
+ return;
+ }
+
+ // Check if all dependencies of the groupable have been executed before
+ checkForDependenciesExecuted(groupable, executedSteps);
+
+ if (groupable.getExtension() instanceof IStepGroup) {
+ IFullQualifiedId id = fullQualifiedParentId.createChildId(ID_TYPE_STEP_GROUP_ID, groupable.getExtension().getId(), groupable.getSecondaryId());
+ // If the passed in groupable is associated with a step group
+ // -> get the groupable from that group and execute them
+ executeStepGroup((IStepGroup) groupable.getExtension(), statusContainer, executedSteps, id);
+ }
+ else if (groupable.getExtension() instanceof IStep) {
+ // If the passed in groupable is associated with a step
+ // -> check if the required steps have been executed before,
+ // create a step executor and invoke the executor.
+ IStep step = (IStep) groupable.getExtension();
+
+ IFullQualifiedId id = fullQualifiedParentId.createChildId(ID_TYPE_STEP_ID, step.getId(), groupable.getSecondaryId());
+
+ // Create the step executor now
+ IStepExecutor executor = doCreateStepExecutor(step, groupable.getSecondaryId(), id);
+ Assert.isNotNull(executor);
+
+ try {
+ executedSteps.add(new ExecutedContextStep(id, step));
+ // Invoke the executor now
+ executor.execute(step, id, getContext(), getData(), getMonitor());
+ }
+ catch (Exception e) {
+ // Catch the CoreException first hand as we need to continue the
+ // stepping if the step returned with warnings or information only.
+ CoreException coreException = normalizeStatus(e, statusContainer);
+ // If the exception has been not eaten, rollback previously executed
+ // steps and re-throw the exception.
+ if (coreException != null) {
+ // Rollback everything, if the step(s) are supporting this and
+ // the cleanup hasn't been done already.
+ if (isInitialized()) {
+ rollback(executedSteps, coreException.getStatus(), getMonitor());
+ }
+
+ // Re-throw the exception
+ throw coreException;
+ }
+ }
+ }
+ }
+
+ /**
+ * Checks if all required dependencies have been executed before. If not, the method will throw
+ * an error status.
+ *
+ * @param groupable The groupable. Must not be <code>null</code>.
+ * @param executedSteps A list holding the id's of the steps executed before. Must not be
+ * <code>null</code>.
+ *
+ * @throws CoreException If a dependency has not been executed before.
+ */
+ protected void checkForDependenciesExecuted(IStepGroupable groupable, List<ExecutedContextStep> executedSteps) throws CoreException {
+ Assert.isNotNull(groupable);
+ Assert.isNotNull(executedSteps);
+
+ // Build up the complete list of dependencies.
+ List<String> dependencies = new ArrayList<String>(Arrays.asList(groupable.getDependencies()));
+ // If the groupable wraps a step, the step can have additional dependencies to check
+ if (groupable.getExtension() instanceof IStep) {
+ dependencies.addAll(Arrays.asList(((IStep) groupable.getExtension()).getDependencies()));
+ }
+
+ // Check each dependency now.
+ for (String dependency : dependencies) {
+ // The dependencies might be fully qualified. Split out the primary id.
+ String[] splitted = dependency.split("##", 2); //$NON-NLS-1$
+ String primaryId = splitted.length == 2 ? splitted[0] : dependency;
+
+ // Check if the id is in the list of executed steps. As the list contains
+ // the fully qualified id's, we cannot just check for contained
+ boolean requiredStepExecuted = false;
+ for (ExecutedContextStep step : executedSteps) {
+ if (step.step.getId().equals(primaryId)) {
+ requiredStepExecuted = true;
+ break;
+ }
+ }
+
+ if (!requiredStepExecuted) {
+ throw new CoreException(new Status(IStatus.ERROR, CoreBundleActivator.getUniqueIdentifier(),
+ MessageFormat.format(Messages.Stepper_error_requiredStepNotExecuted,
+ NLS.bind(groupable.getExtension() instanceof IStep ? Messages.Stepper_error_step : Messages.Stepper_error_stepGroup,
+ groupable.getExtension().getId()),
+ NLS.bind(Messages.Stepper_error_requiredStepOrGroup, dependency), ""))); //$NON-NLS-1$
+ }
+
+ // Recursive checking is not necessary here as the step or step group
+ // id's would have made it the executed steps list of they missed required
+ // steps or step groups.
+ }
+
+ }
+
+ /**
+ * Rollback the steps previously executed to the failed step.
+ * The rollback is executed in reverse order.
+ *
+ * @param executedSteps The list of executed steps.
+ * @param progress The progress monitor.
+ */
+ protected final void rollback(final List<ExecutedContextStep> executedSteps, final IStatus rollBackStatus, IProgressMonitor progress) {
+ Assert.isNotNull(executedSteps);
+
+
+ while (!executedSteps.isEmpty()) {
+ ExecutedContextStep executedStep = executedSteps.remove(executedSteps.size() - 1);
+ Callback callback = new Callback();
+ progress.setTaskName("Rollback " + executedStep.step.getLabel()); //$NON-NLS-1$
+ executedStep.step.rollback(getContext(), getData(), rollBackStatus, executedStep.id, progress, callback);
+ ExecutorsUtil.waitAndExecute(60000, callback.getDoneConditionTester(null));
+ }
+ }
+
+ /**
+ * Calculates the total work required for the step group. The total work is the sum of the total
+ * work of each sub step. If one of the steps returns {@link IProgressMonitor#UNKNOWN}, the
+ * total work will be unknown for the whole step group.
+ *
+ * @param stepGroupId The step group. Must not be <code>null</code>.
+ * @return The total work required or {@link IProgressMonitor#UNKNOWN}.
+ *
+ * @throws CoreException If the total work of the step group cannot be determined.
+ */
+ protected int calculateTotalWork(IStepGroup stepGroup) throws CoreException {
+ Assert.isNotNull(stepGroup);
+
+ int totalWork = 0;
+
+ // Loop the group steps and summarize the returned total work
+ IStepGroupable[] groupables = stepGroup.getSteps(getContext());
+ for (IStepGroupable groupable : groupables) {
+ int work = groupable.getExtension() instanceof IStep ? ((IStep) groupable
+ .getExtension()).getTotalWork(getContext(), getData()) : groupable
+ .getExtension() instanceof IStepGroup ? calculateTotalWork((IStepGroup) groupable
+ .getExtension()) : IProgressMonitor.UNKNOWN;
+
+ if (work == IProgressMonitor.UNKNOWN) {
+ totalWork = IProgressMonitor.UNKNOWN;
+ break;
+ }
+
+ totalWork += work;
+ }
+
+ return totalWork;
+ }
+
+ /**
+ * Normalize the associated status object of the given {@link CoreException}.
+ * <p>
+ * If the associated status contains only WARNING or INFORMATION status objects, the objects are
+ * added to the passed in status container. The passed in exception is dropped and the method
+ * will return <code>null</code>.
+ * <p>
+ * If the associated status contains only OK status objects, the passed in exception and the
+ * associated status are dropped and the method will return <code>null</code>.
+ * <p>
+ * If the associated status contain ERROR status objects, the passed in exception and the
+ * associated status objects are returned if the passed in status container is empty. If the
+ * status container is not empty, a new exception and multi status object is created and
+ * returned. The multi status object will contain all status objects from the status container
+ * and all objects of the originally associated status.
+ * <p>
+ * If the associated status contains a CANCEL status object, the passed in exception and the
+ * associated status objects are returned unmodified.
+ *
+ * @param e The core exception. Must not be <code>null</code>.
+ * @param statusContainer The list of non-severe status objects. Must not be <code>null</code>.
+ * @return The exception to re-throw or <code>null</code>.
+ */
+ private CoreException normalizeStatus(Exception e, List<IStatus> statusContainer) {
+ Assert.isNotNull(statusContainer);
+
+ CoreException coreException = null;
+
+ IStatus status = Status.OK_STATUS;
+ // Get the associated status from the exception
+ if (e instanceof CoreException) {
+ status = ((CoreException) e).getStatus();
+ coreException = (CoreException) e;
+ }
+ else if (e instanceof OperationCanceledException) {
+ status = new Status(IStatus.CANCEL, CoreBundleActivator.getUniqueIdentifier(), e.getLocalizedMessage(), e);
+ coreException = new CoreException(status);
+ }
+ else if (e != null) {
+ status = new Status(IStatus.ERROR, CoreBundleActivator.getUniqueIdentifier(), e.getLocalizedMessage(), e);
+ coreException = new CoreException(status);
+ }
+
+ // Check the severity
+ // PS: MultiStatus.getSeverity() returns always the highest severity.
+ if (status.getSeverity() == IStatus.OK) {
+ // OK -> drop completely and return null
+ coreException = null;
+ }
+ else if (status.getSeverity() == IStatus.CANCEL) {
+ // CANCEL -> Check monitor to be canceled.
+ if (isCancelable()) {
+ if (getMonitor() != null && !getMonitor().isCanceled()) {
+ getMonitor().setCanceled(true);
+ }
+ }
+ }
+ else if (status.getSeverity() == IStatus.WARNING || status.getSeverity() == IStatus.INFO) {
+ // WARNING or INFORMATION -> add to the list and return null
+ statusContainer.add(status);
+ coreException = null;
+ }
+ else if (status.getSeverity() == IStatus.ERROR) {
+ // Error -> If the warnings container not empty, create
+ // a new MultiStatus.
+ if (!statusContainer.isEmpty()) {
+ MultiStatus multiStatus = new MultiStatus(status.getPlugin(), status.getCode(), NLS.bind(Messages.Stepper_multiStatus_finishedWithErrors, getLabel()), null);
+ for (IStatus stat : statusContainer) {
+ multiStatus.merge(stat);
+ }
+ // Re-throw via a new CoreException
+ coreException = new CoreException(multiStatus);
+ }
+ }
+
+ return coreException;
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/steps/AbstractStep.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/steps/AbstractStep.java
index e9991e5b1..a828d05df 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/steps/AbstractStep.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/steps/AbstractStep.java
@@ -1,189 +1,189 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Wind River Systems, Inc. and others. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.tcf.te.runtime.stepper.steps;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.tcf.te.runtime.extensions.ExecutableExtension;
-import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
-import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
-import org.eclipse.tcf.te.runtime.stepper.StepperAttributeUtil;
-import org.eclipse.tcf.te.runtime.stepper.activator.CoreBundleActivator;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IStep;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepAttributes;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
-import org.eclipse.tcf.te.runtime.stepper.nls.Messages;
-
-/**
- * An abstract step implementation.
- */
-public abstract class AbstractStep extends ExecutableExtension implements IStep {
- // List of string id's of the step dependencies.
- private final List<String> dependencies = new ArrayList<String>();
-
- // Map of parameters of the step reference
- private Map<String,String> parameters = new HashMap<String,String>();
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IExtendedStep#isSingleton()
- */
- @Override
- public boolean isSingleton() {
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.extensions.ExecutableExtension#doSetInitializationData(org.eclipse.core.runtime.IConfigurationElement, java.lang.String, java.lang.Object)
- */
- @Override
- public void doSetInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException {
- super.doSetInitializationData(config, propertyName, data);
-
- // Read in the list of required step or step id's if specified.
- dependencies.clear();
- IConfigurationElement[] requires = config.getChildren("requires"); //$NON-NLS-1$
- for (IConfigurationElement require : requires) {
- String value = require.getAttribute("id"); //$NON-NLS-1$
- if (value == null || value.trim().length() == 0) {
- throw new CoreException(new Status(IStatus.ERROR,
- CoreBundleActivator.getUniqueIdentifier(),
- 0,
- NLS.bind(Messages.AbstractStep_error_missingRequiredAttribute, "dependency id (requires)", getLabel()), //$NON-NLS-1$
- null));
- }
- if (!dependencies.contains(value.trim())) {
- dependencies.add(value.trim());
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IExtendedStep#initializeFrom(org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor)
- */
- @Override
- public void initializeFrom(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor) {
- Assert.isNotNull(context);
- Assert.isNotNull(data);
- Assert.isNotNull(fullQualifiedId);
- Assert.isNotNull(monitor);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IExtendedStep#cleanup(org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor)
- */
- @Override
- public void cleanup(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IExtendedStep#rollback(org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.core.runtime.IStatus, org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor, org.eclipse.tcf.te.runtime.interfaces.callback.ICallback)
- */
- @Override
- public void rollback(IStepContext context, IPropertiesContainer data, IStatus status, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor, ICallback callback) {
- if (callback != null) {
- callback.done(this, Status.OK_STATUS);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStep#getTotalWork(org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer)
- */
- @Override
- public int getTotalWork(IStepContext context, IPropertiesContainer data) {
- return 100;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStep#getDependencies()
- */
- @Override
- public String[] getDependencies() {
- return dependencies.toArray(new String[dependencies.size()]);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStep#setParameters(java.util.Map)
- */
- @Override
- public void setParameters(Map<String,String> parameters) {
- if (parameters != null) {
- this.parameters = parameters;
- }
- else {
- this.parameters = Collections.EMPTY_MAP;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStep#getParameters()
- */
- @Override
- public Map<String, String> getParameters() {
- return parameters;
- }
-
- /**
- * Invoke the specified callback and pass on the status and user defined data object.
- *
- * @param data The data giving object. Must not be <code>null</code>.
- * @param fullQualifiedId The full qualfied id for this step. Must not be <code>null</code>.
- * @param callback The callback.
- * @param status The status.
- * @param data The callback data.
- */
- public final void callback(IPropertiesContainer data, IFullQualifiedId fullQualifiedId, ICallback callback, IStatus status, Object callbackData) {
- Assert.isNotNull(data);
- Assert.isNotNull(fullQualifiedId);
- Assert.isNotNull(callback);
- Assert.isNotNull(status);
-
- callback.setProperty(IStep.CALLBACK_PROPERTY_DATA, callbackData);
- callback.done(this, status);
- }
-
- /**
- * Returns the active context that is currently used.
- *
- * @param context The step context. Must not be <code>null</code>.
- * @param data The data giving object. Must not be <code>null</code>.
- * @param fullQualifiedId The full qualfied id for this step. Must not be <code>null</code>.
- * @return The active context or <code>null</code>.
- */
- protected Object getActiveContext(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId) {
- Assert.isNotNull(data);
- Assert.isNotNull(fullQualifiedId);
- Object activeContext = StepperAttributeUtil.getProperty(IStepAttributes.ATTR_ACTIVE_CONTEXT, fullQualifiedId, data);
- if (activeContext == null)
- activeContext = context.getContextObject();
-
- return activeContext;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IExtendedStep#getCancelTimeout()
- */
- @Override
- public int getCancelTimeout() {
- // default timeout is 1 minute
- return 60000;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011, 2013 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.runtime.stepper.steps;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.tcf.te.runtime.extensions.ExecutableExtension;
+import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
+import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
+import org.eclipse.tcf.te.runtime.stepper.StepperAttributeUtil;
+import org.eclipse.tcf.te.runtime.stepper.activator.CoreBundleActivator;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IStep;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepAttributes;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
+import org.eclipse.tcf.te.runtime.stepper.nls.Messages;
+
+/**
+ * An abstract step implementation.
+ */
+public abstract class AbstractStep extends ExecutableExtension implements IStep {
+ // List of string id's of the step dependencies.
+ private final List<String> dependencies = new ArrayList<String>();
+
+ // Map of parameters of the step reference
+ private Map<String,String> parameters = new HashMap<String,String>();
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IExtendedStep#isSingleton()
+ */
+ @Override
+ public boolean isSingleton() {
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.extensions.ExecutableExtension#doSetInitializationData(org.eclipse.core.runtime.IConfigurationElement, java.lang.String, java.lang.Object)
+ */
+ @Override
+ public void doSetInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException {
+ super.doSetInitializationData(config, propertyName, data);
+
+ // Read in the list of required step or step id's if specified.
+ dependencies.clear();
+ IConfigurationElement[] requires = config.getChildren("requires"); //$NON-NLS-1$
+ for (IConfigurationElement require : requires) {
+ String value = require.getAttribute("id"); //$NON-NLS-1$
+ if (value == null || value.trim().length() == 0) {
+ throw new CoreException(new Status(IStatus.ERROR,
+ CoreBundleActivator.getUniqueIdentifier(),
+ 0,
+ NLS.bind(Messages.AbstractStep_error_missingRequiredAttribute, "dependency id (requires)", getLabel()), //$NON-NLS-1$
+ null));
+ }
+ if (!dependencies.contains(value.trim())) {
+ dependencies.add(value.trim());
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IExtendedStep#initializeFrom(org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ public void initializeFrom(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor) {
+ Assert.isNotNull(context);
+ Assert.isNotNull(data);
+ Assert.isNotNull(fullQualifiedId);
+ Assert.isNotNull(monitor);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IExtendedStep#cleanup(org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ public void cleanup(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor) {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IExtendedStep#rollback(org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.core.runtime.IStatus, org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor, org.eclipse.tcf.te.runtime.interfaces.callback.ICallback)
+ */
+ @Override
+ public void rollback(IStepContext context, IPropertiesContainer data, IStatus status, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor, ICallback callback) {
+ if (callback != null) {
+ callback.done(this, Status.OK_STATUS);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStep#getTotalWork(org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer)
+ */
+ @Override
+ public int getTotalWork(IStepContext context, IPropertiesContainer data) {
+ return 100;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStep#getDependencies()
+ */
+ @Override
+ public String[] getDependencies() {
+ return dependencies.toArray(new String[dependencies.size()]);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStep#setParameters(java.util.Map)
+ */
+ @Override
+ public void setParameters(Map<String,String> parameters) {
+ if (parameters != null) {
+ this.parameters = parameters;
+ }
+ else {
+ this.parameters = Collections.EMPTY_MAP;
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStep#getParameters()
+ */
+ @Override
+ public Map<String, String> getParameters() {
+ return parameters;
+ }
+
+ /**
+ * Invoke the specified callback and pass on the status and user defined data object.
+ *
+ * @param data The data giving object. Must not be <code>null</code>.
+ * @param fullQualifiedId The full qualfied id for this step. Must not be <code>null</code>.
+ * @param callback The callback.
+ * @param status The status.
+ * @param data The callback data.
+ */
+ public final void callback(IPropertiesContainer data, IFullQualifiedId fullQualifiedId, ICallback callback, IStatus status, Object callbackData) {
+ Assert.isNotNull(data);
+ Assert.isNotNull(fullQualifiedId);
+ Assert.isNotNull(callback);
+ Assert.isNotNull(status);
+
+ callback.setProperty(IStep.CALLBACK_PROPERTY_DATA, callbackData);
+ callback.done(this, status);
+ }
+
+ /**
+ * Returns the active context that is currently used.
+ *
+ * @param context The step context. Must not be <code>null</code>.
+ * @param data The data giving object. Must not be <code>null</code>.
+ * @param fullQualifiedId The full qualfied id for this step. Must not be <code>null</code>.
+ * @return The active context or <code>null</code>.
+ */
+ protected Object getActiveContext(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId) {
+ Assert.isNotNull(data);
+ Assert.isNotNull(fullQualifiedId);
+ Object activeContext = StepperAttributeUtil.getProperty(IStepAttributes.ATTR_ACTIVE_CONTEXT, fullQualifiedId, data);
+ if (activeContext == null)
+ activeContext = context.getContextObject();
+
+ return activeContext;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IExtendedStep#getCancelTimeout()
+ */
+ @Override
+ public int getCancelTimeout() {
+ // default timeout is 1 minute
+ return 60000;
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime/src/org/eclipse/tcf/te/runtime/callback/Callback.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime/src/org/eclipse/tcf/te/runtime/callback/Callback.java
index e98642a64..747ccfa0b 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.runtime/src/org/eclipse/tcf/te/runtime/callback/Callback.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime/src/org/eclipse/tcf/te/runtime/callback/Callback.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Wind River Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2011, 2013 Wind River Systems, Inc. and others. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime/src/org/eclipse/tcf/te/runtime/nls/Messages.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime/src/org/eclipse/tcf/te/runtime/nls/Messages.java
index 92e82cfd7..d4c94977d 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.runtime/src/org/eclipse/tcf/te/runtime/nls/Messages.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime/src/org/eclipse/tcf/te/runtime/nls/Messages.java
@@ -1,37 +1,37 @@
-/*******************************************************************************
- * Copyright (c) 2011 Wind River Systems, Inc. and others. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.tcf.te.runtime.nls;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Target Explorer Runtime plugin externalized strings management.
- */
-public class Messages extends NLS {
-
- // The plug-in resource bundle name
- private static final String BUNDLE_NAME = "org.eclipse.tcf.te.runtime.nls.Messages"; //$NON-NLS-1$
-
- /**
- * Static constructor.
- */
- static {
- // Load message values from bundle file
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- // **** Declare externalized string id's down here *****
-
- public static String Extension_error_missingRequiredAttribute;
- public static String Extension_error_duplicateExtension;
- public static String Extension_error_invalidExtensionPoint;
-
- public static String Callback_warning_cancelTimeout;
-}
+/*******************************************************************************
+ * Copyright (c) 2011, 2013 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.runtime.nls;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * Target Explorer Runtime plugin externalized strings management.
+ */
+public class Messages extends NLS {
+
+ // The plug-in resource bundle name
+ private static final String BUNDLE_NAME = "org.eclipse.tcf.te.runtime.nls.Messages"; //$NON-NLS-1$
+
+ /**
+ * Static constructor.
+ */
+ static {
+ // Load message values from bundle file
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ // **** Declare externalized string id's down here *****
+
+ public static String Extension_error_missingRequiredAttribute;
+ public static String Extension_error_duplicateExtension;
+ public static String Extension_error_invalidExtensionPoint;
+
+ public static String Callback_warning_cancelTimeout;
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime/src/org/eclipse/tcf/te/runtime/nls/Messages.properties b/target_explorer/plugins/org.eclipse.tcf.te.runtime/src/org/eclipse/tcf/te/runtime/nls/Messages.properties
index 30dd6118f..159f30372 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.runtime/src/org/eclipse/tcf/te/runtime/nls/Messages.properties
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime/src/org/eclipse/tcf/te/runtime/nls/Messages.properties
@@ -1,15 +1,15 @@
-###############################################################################
-# Copyright (c) 2012 Wind River Systems, Inc. and others. All rights reserved.
-# This program and the accompanying materials are made available under the terms
-# of the Eclipse Public License v1.0 which accompanies this distribution, and is
-# available at http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Wind River Systems - initial API and implementation
-###############################################################################
-
-Extension_error_missingRequiredAttribute=Required attribute "{0}" missing for extension "{1}"!
-Extension_error_duplicateExtension=Duplicate extension with id ''{0}''. Ignoring duplicated contribution from contributor ''{1}''!
-Extension_error_invalidExtensionPoint=Failed to instantiate the executable extension from extension point ''{0}''.
-
-Callback_warning_cancelTimeout=Step cancellation was aborted due to timeout.
+###############################################################################
+# Copyright (c) 2012, 2013 Wind River Systems, Inc. and others. All rights reserved.
+# This program and the accompanying materials are made available under the terms
+# of the Eclipse Public License v1.0 which accompanies this distribution, and is
+# available at http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Wind River Systems - initial API and implementation
+###############################################################################
+
+Extension_error_missingRequiredAttribute=Required attribute "{0}" missing for extension "{1}"!
+Extension_error_duplicateExtension=Duplicate extension with id ''{0}''. Ignoring duplicated contribution from contributor ''{1}''!
+Extension_error_invalidExtensionPoint=Failed to instantiate the executable extension from extension point ''{0}''.
+
+Callback_warning_cancelTimeout=Step cancellation was aborted due to timeout.
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime/src/org/eclipse/tcf/te/runtime/processes/ProcessOutputReaderThread.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime/src/org/eclipse/tcf/te/runtime/processes/ProcessOutputReaderThread.java
index 1d71afd1d..21d3767d4 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.runtime/src/org/eclipse/tcf/te/runtime/processes/ProcessOutputReaderThread.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime/src/org/eclipse/tcf/te/runtime/processes/ProcessOutputReaderThread.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Wind River Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2012, 2013 Wind River Systems, Inc. and others. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime/src/org/eclipse/tcf/te/runtime/tracing/TraceHandler.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime/src/org/eclipse/tcf/te/runtime/tracing/TraceHandler.java
index 94b0c110f..b84ecc073 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.runtime/src/org/eclipse/tcf/te/runtime/tracing/TraceHandler.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime/src/org/eclipse/tcf/te/runtime/tracing/TraceHandler.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Wind River Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2011, 2013 Wind River Systems, Inc. and others. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/plugin.properties b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/plugin.properties
index efb4816a3..4699fbc5f 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/plugin.properties
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/plugin.properties
@@ -1,24 +1,24 @@
-##################################################################################
-# Copyright (c) 2011, 2012 Wind River Systems, Inc. and others. All rights reserved.
-# This program and the accompanying materials are made available under the terms
-# of the Eclipse Public License v1.0 which accompanies this distribution, and is
-# available at http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Wind River Systems - initial API and implementation
-##################################################################################
-
-pluginName = Target Explorer, TCF Extensions, Core plug-in
-providerName = Eclipse.org - Target Explorer
-
-# ***** Extension Points *****
-
-ExtensionPoint.listeners.name=Listeners
-ExtensionPoint.valueadds.name=Value Add's
-ExtensionPoint.valueaddBindings.name=Value Add Bindings
-
-# ***** Steps *****
-
-OpenChannelStep.name=Open TCF channel
-CloseChannelStep.name=Close TCF channel
-ShutDownStep.name=Close all TCF channels
+##################################################################################
+# Copyright (c) 2011, 2013 Wind River Systems, Inc. and others. All rights reserved.
+# This program and the accompanying materials are made available under the terms
+# of the Eclipse Public License v1.0 which accompanies this distribution, and is
+# available at http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Wind River Systems - initial API and implementation
+##################################################################################
+
+pluginName = Target Explorer, TCF Extensions, Core plug-in
+providerName = Eclipse.org - Target Explorer
+
+# ***** Extension Points *****
+
+ExtensionPoint.listeners.name=Listeners
+ExtensionPoint.valueadds.name=Value Add's
+ExtensionPoint.valueaddBindings.name=Value Add Bindings
+
+# ***** Steps *****
+
+OpenChannelStep.name=Open TCF channel
+CloseChannelStep.name=Close TCF channel
+ShutDownStep.name=Close all TCF channels
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/activator/CoreBundleActivator.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/activator/CoreBundleActivator.java
index 4c9fe8d89..06c1ea5ac 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/activator/CoreBundleActivator.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/activator/CoreBundleActivator.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Wind River Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2011, 2013 Wind River Systems, Inc. and others. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/internal/ChannelManager.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/internal/ChannelManager.java
index be0e83d97..7b7496f49 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/internal/ChannelManager.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/internal/ChannelManager.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Wind River Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2011, 2013 Wind River Systems, Inc. and others. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/internal/Startup.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/internal/Startup.java
index 4160f069b..bffa18dcb 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/internal/Startup.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/internal/Startup.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011 Wind River Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2011, 2012 Wind River Systems, Inc. and others. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/nls/Messages.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/nls/Messages.java
index 44b336951..ae4c1da91 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/nls/Messages.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/nls/Messages.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Wind River Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2011, 2013 Wind River Systems, Inc. and others. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/nls/Messages.properties b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/nls/Messages.properties
index 9d864b5da..7fe81fab3 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/nls/Messages.properties
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/nls/Messages.properties
@@ -1,5 +1,5 @@
###############################################################################
-# Copyright (c) 2012 Wind River Systems, Inc. and others. All rights reserved.
+# Copyright (c) 2012, 2013 Wind River Systems, Inc. and others. All rights reserved.
# This program and the accompanying materials are made available under the terms
# of the Eclipse Public License v1.0 which accompanies this distribution, and is
# available at http://www.eclipse.org/legal/epl-v10.html
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/steps/CloseChannelStep.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/steps/CloseChannelStep.java
index 616e01482..c6944b3db 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/steps/CloseChannelStep.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/steps/CloseChannelStep.java
@@ -1,53 +1,53 @@
-/*******************************************************************************
- * Copyright (c) 2012 Wind River Systems, Inc. and others. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.tcf.te.tcf.core.steps;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.tcf.protocol.IChannel;
-import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
-import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
-import org.eclipse.tcf.te.runtime.stepper.StepperAttributeUtil;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
-import org.eclipse.tcf.te.tcf.core.Tcf;
-import org.eclipse.tcf.te.tcf.core.interfaces.steps.ITcfStepAttributes;
-
-/**
- * Close channel step implementation.
- */
-public class CloseChannelStep extends AbstractPeerStep {
-
- /**
- * Constructor.
- */
- public CloseChannelStep() {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IExtendedStep#validateExecute(org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor)
- */
- @Override
- public void validateExecute(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor) throws CoreException {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStep#execute(org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor, org.eclipse.tcf.te.runtime.interfaces.callback.ICallback)
- */
- @Override
- public void execute(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor, ICallback callback) {
- IChannel channel = (IChannel)StepperAttributeUtil.getProperty(ITcfStepAttributes.ATTR_CHANNEL, fullQualifiedId, data);
- if (channel != null && channel.getState() != IChannel.STATE_CLOSED) {
- Tcf.getChannelManager().closeChannel(channel);
- }
- callback.done(this, Status.OK_STATUS);
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2012, 2013 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.tcf.core.steps;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.tcf.protocol.IChannel;
+import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
+import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
+import org.eclipse.tcf.te.runtime.stepper.StepperAttributeUtil;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
+import org.eclipse.tcf.te.tcf.core.Tcf;
+import org.eclipse.tcf.te.tcf.core.interfaces.steps.ITcfStepAttributes;
+
+/**
+ * Close channel step implementation.
+ */
+public class CloseChannelStep extends AbstractPeerStep {
+
+ /**
+ * Constructor.
+ */
+ public CloseChannelStep() {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IExtendedStep#validateExecute(org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ public void validateExecute(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor) throws CoreException {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStep#execute(org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor, org.eclipse.tcf.te.runtime.interfaces.callback.ICallback)
+ */
+ @Override
+ public void execute(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor, ICallback callback) {
+ IChannel channel = (IChannel)StepperAttributeUtil.getProperty(ITcfStepAttributes.ATTR_CHANNEL, fullQualifiedId, data);
+ if (channel != null && channel.getState() != IChannel.STATE_CLOSED) {
+ Tcf.getChannelManager().closeChannel(channel);
+ }
+ callback.done(this, Status.OK_STATUS);
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/steps/OpenChannelStep.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/steps/OpenChannelStep.java
index bfa638548..8bd71fe39 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/steps/OpenChannelStep.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/steps/OpenChannelStep.java
@@ -1,71 +1,71 @@
-/*******************************************************************************
- * Copyright (c) 2012 Wind River Systems, Inc. and others. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.tcf.te.tcf.core.steps;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.tcf.protocol.IChannel;
-import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
-import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
-import org.eclipse.tcf.te.runtime.stepper.StepperAttributeUtil;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
-import org.eclipse.tcf.te.runtime.utils.ProgressHelper;
-import org.eclipse.tcf.te.runtime.utils.StatusHelper;
-import org.eclipse.tcf.te.tcf.core.Tcf;
-import org.eclipse.tcf.te.tcf.core.interfaces.IChannelManager;
-import org.eclipse.tcf.te.tcf.core.interfaces.steps.ITcfStepAttributes;
-
-/**
- * Open channel step implementation.
- */
-public class OpenChannelStep extends AbstractPeerStep {
-
- /**
- * Constructor.
- */
- public OpenChannelStep() {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IExtendedStep#validateExecute(org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor)
- */
- @Override
- public void validateExecute(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor) throws CoreException {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStep#execute(org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor, org.eclipse.tcf.te.runtime.interfaces.callback.ICallback)
- */
- @Override
- public void execute(IStepContext context, final IPropertiesContainer data, final IFullQualifiedId fullQualifiedId, IProgressMonitor monitor, final ICallback callback) {
- Tcf.getChannelManager().openChannel(getActivePeerContext(context, data, fullQualifiedId), null, new IChannelManager.DoneOpenChannel() {
- @Override
- public void doneOpenChannel(final Throwable error, final IChannel channel) {
- StepperAttributeUtil.setProperty(ITcfStepAttributes.ATTR_CHANNEL, fullQualifiedId.getParentId(), data, channel);
- callback.done(OpenChannelStep.this, StatusHelper.getStatus(error));
- }
- });
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.stepper.steps.AbstractStep#rollback(org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.core.runtime.IStatus, org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor, org.eclipse.tcf.te.runtime.interfaces.callback.ICallback)
- */
- @Override
- public void rollback(IStepContext context, IPropertiesContainer data, IStatus status, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor, ICallback callback) {
- IChannel channel = (IChannel)StepperAttributeUtil.getProperty(ITcfStepAttributes.ATTR_CHANNEL, fullQualifiedId, data);
- if (channel != null && channel.getState() != IChannel.STATE_CLOSED) {
- ProgressHelper.setSubTaskName(monitor, "Closing TCF channel"); //$NON-NLS-1$
- Tcf.getChannelManager().closeChannel(channel);
- }
- super.rollback(context, data, status, fullQualifiedId, monitor, callback);
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2012, 2013 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.tcf.core.steps;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.tcf.protocol.IChannel;
+import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
+import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
+import org.eclipse.tcf.te.runtime.stepper.StepperAttributeUtil;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
+import org.eclipse.tcf.te.runtime.utils.ProgressHelper;
+import org.eclipse.tcf.te.runtime.utils.StatusHelper;
+import org.eclipse.tcf.te.tcf.core.Tcf;
+import org.eclipse.tcf.te.tcf.core.interfaces.IChannelManager;
+import org.eclipse.tcf.te.tcf.core.interfaces.steps.ITcfStepAttributes;
+
+/**
+ * Open channel step implementation.
+ */
+public class OpenChannelStep extends AbstractPeerStep {
+
+ /**
+ * Constructor.
+ */
+ public OpenChannelStep() {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IExtendedStep#validateExecute(org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ public void validateExecute(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor) throws CoreException {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStep#execute(org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor, org.eclipse.tcf.te.runtime.interfaces.callback.ICallback)
+ */
+ @Override
+ public void execute(IStepContext context, final IPropertiesContainer data, final IFullQualifiedId fullQualifiedId, IProgressMonitor monitor, final ICallback callback) {
+ Tcf.getChannelManager().openChannel(getActivePeerContext(context, data, fullQualifiedId), null, new IChannelManager.DoneOpenChannel() {
+ @Override
+ public void doneOpenChannel(final Throwable error, final IChannel channel) {
+ StepperAttributeUtil.setProperty(ITcfStepAttributes.ATTR_CHANNEL, fullQualifiedId.getParentId(), data, channel);
+ callback.done(OpenChannelStep.this, StatusHelper.getStatus(error));
+ }
+ });
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.stepper.steps.AbstractStep#rollback(org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.core.runtime.IStatus, org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor, org.eclipse.tcf.te.runtime.interfaces.callback.ICallback)
+ */
+ @Override
+ public void rollback(IStepContext context, IPropertiesContainer data, IStatus status, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor, ICallback callback) {
+ IChannel channel = (IChannel)StepperAttributeUtil.getProperty(ITcfStepAttributes.ATTR_CHANNEL, fullQualifiedId, data);
+ if (channel != null && channel.getState() != IChannel.STATE_CLOSED) {
+ ProgressHelper.setSubTaskName(monitor, "Closing TCF channel"); //$NON-NLS-1$
+ Tcf.getChannelManager().closeChannel(channel);
+ }
+ super.rollback(context, data, status, fullQualifiedId, monitor, callback);
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/streams/StreamsDataReceiver.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/streams/StreamsDataReceiver.java
index 7ffb5dafe..c9e1ff0eb 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/streams/StreamsDataReceiver.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/streams/StreamsDataReceiver.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011 Wind River Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2011, 2012 Wind River Systems, Inc. and others. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/va/AbstractExternalValueAdd.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/va/AbstractExternalValueAdd.java
index a25594d9e..0924d9f86 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/va/AbstractExternalValueAdd.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/va/AbstractExternalValueAdd.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Wind River Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2012, 2013 Wind River Systems, Inc. and others. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/va/ValueAddLauncher.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/va/ValueAddLauncher.java
index 140ccdc18..e986fc212 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/va/ValueAddLauncher.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/va/ValueAddLauncher.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Wind River Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2012, 2013 Wind River Systems, Inc. and others. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/plugin.properties b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/plugin.properties
index 7e5ddaff1..2807b0345 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/plugin.properties
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/plugin.properties
@@ -1,14 +1,14 @@
-##################################################################################
-# Copyright (c) 2012 Wind River Systems, Inc. and others. All rights reserved.
-# This program and the accompanying materials are made available under the terms
-# of the Eclipse Public License v1.0 which accompanies this distribution, and is
-# available at http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Wind River Systems - initial API and implementation
-##################################################################################
-
-providerName = Eclipse.org - Target Explorer
-pluginName = Target Explorer, TCF File System Extensions Core
-
-FileTransferStep.name=Transfer File
+##################################################################################
+# Copyright (c) 2012, 2013 Wind River Systems, Inc. and others. All rights reserved.
+# This program and the accompanying materials are made available under the terms
+# of the Eclipse Public License v1.0 which accompanies this distribution, and is
+# available at http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Wind River Systems - initial API and implementation
+##################################################################################
+
+providerName = Eclipse.org - Target Explorer
+pluginName = Target Explorer, TCF File System Extensions Core
+
+FileTransferStep.name=Transfer File
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/interfaces/steps/IFileSystemStepAttributes.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/interfaces/steps/IFileSystemStepAttributes.java
index 11721a4d8..8801a4c7e 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/interfaces/steps/IFileSystemStepAttributes.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/interfaces/steps/IFileSystemStepAttributes.java
@@ -1,26 +1,26 @@
-/*******************************************************************************
- * Copyright (c) 2012 Wind River Systems, Inc. and others. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.tcf.te.tcf.filesystem.core.interfaces.steps;
-
-/**
- * Defines filesystem related step data attribute id's.
- */
-public interface IFileSystemStepAttributes {
-
- /**
- * Define the prefix used by all other attribute id's as prefix.
- */
- public static final String ATTR_PREFIX = "org.eclipse.tcf.te.tcf.filesystem.core"; //$NON-NLS-1$
-
- /**
- * The file transfer item the stepper is currently operating with.
- */
- public static final String ATTR_FILE_TRANSFER_ITEM = ATTR_PREFIX + ".file_transfer_item"; //$NON-NLS-1$
-}
+/*******************************************************************************
+ * Copyright (c) 2012, 2013 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.tcf.filesystem.core.interfaces.steps;
+
+/**
+ * Defines filesystem related step data attribute id's.
+ */
+public interface IFileSystemStepAttributes {
+
+ /**
+ * Define the prefix used by all other attribute id's as prefix.
+ */
+ public static final String ATTR_PREFIX = "org.eclipse.tcf.te.tcf.filesystem.core"; //$NON-NLS-1$
+
+ /**
+ * The file transfer item the stepper is currently operating with.
+ */
+ public static final String ATTR_FILE_TRANSFER_ITEM = ATTR_PREFIX + ".file_transfer_item"; //$NON-NLS-1$
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/steps/FileTransferStep.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/steps/FileTransferStep.java
index 8918a512a..f38b862d6 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/steps/FileTransferStep.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/steps/FileTransferStep.java
@@ -1,79 +1,79 @@
-/*******************************************************************************
- * Copyright (c) 2012 Wind River Systems, Inc. and others. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.tcf.te.tcf.filesystem.core.steps;
-
-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.tcf.protocol.IChannel;
-import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
-import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
-import org.eclipse.tcf.te.runtime.services.interfaces.filetransfer.IFileTransferItem;
-import org.eclipse.tcf.te.runtime.stepper.StepperAttributeUtil;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
-import org.eclipse.tcf.te.tcf.core.interfaces.steps.ITcfStepAttributes;
-import org.eclipse.tcf.te.tcf.core.steps.AbstractPeerStep;
-import org.eclipse.tcf.te.tcf.filesystem.core.activator.CorePlugin;
-import org.eclipse.tcf.te.tcf.filesystem.core.interfaces.steps.IFileSystemStepAttributes;
-import org.eclipse.tcf.te.tcf.filesystem.core.services.FileTransferService;
-
-/**
- * Launch process step implementation.
- */
-public class FileTransferStep extends AbstractPeerStep {
-
- /**
- * Constructor.
- */
- public FileTransferStep() {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IExtendedStep#validateExecute(org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor)
- */
- @Override
- public void validateExecute(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor) throws CoreException {
- IChannel channel = (IChannel)StepperAttributeUtil.getProperty(ITcfStepAttributes.ATTR_CHANNEL, fullQualifiedId, data);
- if (channel == null || channel.getState() != IChannel.STATE_OPEN) {
- throw new CoreException(new Status(IStatus.ERROR, CorePlugin.getUniqueIdentifier(), "missing or closed channel")); //$NON-NLS-1$
- }
-
- Object item = StepperAttributeUtil.getProperty(IFileSystemStepAttributes.ATTR_FILE_TRANSFER_ITEM, fullQualifiedId, data);
- if (!(item instanceof IFileTransferItem)) {
- throw new CoreException(new Status(IStatus.ERROR, CorePlugin.getUniqueIdentifier(), "missing file transfer item")); //$NON-NLS-1$
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStep#execute(org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor, org.eclipse.tcf.te.runtime.interfaces.callback.ICallback)
- */
- @Override
- public void execute(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor, final ICallback callback) {
- final IChannel channel = (IChannel)StepperAttributeUtil.getProperty(ITcfStepAttributes.ATTR_CHANNEL, fullQualifiedId, data);
- final IFileTransferItem item = (IFileTransferItem)StepperAttributeUtil.getProperty(IFileSystemStepAttributes.ATTR_FILE_TRANSFER_ITEM, fullQualifiedId, data);
-
- if (item.isEnabled()) {
- FileTransferService.transfer(getActivePeerContext(context, data, fullQualifiedId), channel, item, monitor, callback);
- }
- else {
- callback.done(this, Status.OK_STATUS);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.stepper.extensions.AbstractStep#getTotalWork(org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer)
- */
- @Override
- public int getTotalWork(IStepContext context, IPropertiesContainer data) {
- return 1000;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2012, 2013 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.tcf.filesystem.core.steps;
+
+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.tcf.protocol.IChannel;
+import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
+import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
+import org.eclipse.tcf.te.runtime.services.interfaces.filetransfer.IFileTransferItem;
+import org.eclipse.tcf.te.runtime.stepper.StepperAttributeUtil;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
+import org.eclipse.tcf.te.tcf.core.interfaces.steps.ITcfStepAttributes;
+import org.eclipse.tcf.te.tcf.core.steps.AbstractPeerStep;
+import org.eclipse.tcf.te.tcf.filesystem.core.activator.CorePlugin;
+import org.eclipse.tcf.te.tcf.filesystem.core.interfaces.steps.IFileSystemStepAttributes;
+import org.eclipse.tcf.te.tcf.filesystem.core.services.FileTransferService;
+
+/**
+ * Launch process step implementation.
+ */
+public class FileTransferStep extends AbstractPeerStep {
+
+ /**
+ * Constructor.
+ */
+ public FileTransferStep() {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IExtendedStep#validateExecute(org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ public void validateExecute(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor) throws CoreException {
+ IChannel channel = (IChannel)StepperAttributeUtil.getProperty(ITcfStepAttributes.ATTR_CHANNEL, fullQualifiedId, data);
+ if (channel == null || channel.getState() != IChannel.STATE_OPEN) {
+ throw new CoreException(new Status(IStatus.ERROR, CorePlugin.getUniqueIdentifier(), "missing or closed channel")); //$NON-NLS-1$
+ }
+
+ Object item = StepperAttributeUtil.getProperty(IFileSystemStepAttributes.ATTR_FILE_TRANSFER_ITEM, fullQualifiedId, data);
+ if (!(item instanceof IFileTransferItem)) {
+ throw new CoreException(new Status(IStatus.ERROR, CorePlugin.getUniqueIdentifier(), "missing file transfer item")); //$NON-NLS-1$
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStep#execute(org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor, org.eclipse.tcf.te.runtime.interfaces.callback.ICallback)
+ */
+ @Override
+ public void execute(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor, final ICallback callback) {
+ final IChannel channel = (IChannel)StepperAttributeUtil.getProperty(ITcfStepAttributes.ATTR_CHANNEL, fullQualifiedId, data);
+ final IFileTransferItem item = (IFileTransferItem)StepperAttributeUtil.getProperty(IFileSystemStepAttributes.ATTR_FILE_TRANSFER_ITEM, fullQualifiedId, data);
+
+ if (item.isEnabled()) {
+ FileTransferService.transfer(getActivePeerContext(context, data, fullQualifiedId), channel, item, monitor, callback);
+ }
+ else {
+ callback.done(this, Status.OK_STATUS);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.stepper.extensions.AbstractStep#getTotalWork(org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer)
+ */
+ @Override
+ public int getTotalWork(IStepContext context, IPropertiesContainer data) {
+ return 1000;
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/controls/FSTreeViewerSorter.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/controls/FSTreeViewerSorter.java
index 1f548ab3a..9faea0f74 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/controls/FSTreeViewerSorter.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/controls/FSTreeViewerSorter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Wind River Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2011, 2013 Wind River Systems, Inc. and others. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/controls/TreeContentProvider.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/controls/TreeContentProvider.java
index 3cbb1032c..583432a41 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/controls/TreeContentProvider.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/controls/TreeContentProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Wind River Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2011, 2013 Wind River Systems, Inc. and others. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/handlers/EditorHandlerDelegate.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/handlers/EditorHandlerDelegate.java
index fdc43a7c9..fb64aac8b 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/handlers/EditorHandlerDelegate.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/handlers/EditorHandlerDelegate.java
@@ -1,55 +1,55 @@
-/**
- * EditorHandlerDelegate.java
- * Created on Jan 25, 2012
- *
- * Copyright (c) 2012 Wind River Systems, Inc.
- *
- * The right to copy, distribute, modify, or otherwise make use
- * of this software may be licensed only pursuant to the terms
- * of an applicable Wind River license agreement.
- */
-package org.eclipse.tcf.te.tcf.filesystem.ui.internal.handlers;
-
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.tcf.te.tcf.filesystem.core.model.FSModel;
-import org.eclipse.tcf.te.tcf.filesystem.core.model.FSTreeNode;
-import org.eclipse.tcf.te.tcf.filesystem.ui.internal.pages.FSExplorerEditorPage;
-import org.eclipse.tcf.te.tcf.ui.handler.AbstractPeerModelEditorHandlerDelegate;
-import org.eclipse.tcf.te.ui.swt.DisplayUtil;
-import org.eclipse.tcf.te.ui.views.editor.Editor;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.forms.editor.FormEditor;
-import org.eclipse.ui.forms.editor.IFormPage;
-
-/**
- * Systems context node properties command handler implementation.
- */
-public class EditorHandlerDelegate extends AbstractPeerModelEditorHandlerDelegate {
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.interfaces.handler.IEditorHandlerDelegate#postOpenProperties(org.eclipse.ui.IEditorPart, java.lang.Object)
- */
- @Override
- public void postOpenEditor(IEditorPart editor, final Object element) {
- if (editor instanceof FormEditor) {
- final FormEditor formEditor = (FormEditor)editor;
- DisplayUtil.safeAsyncExec(new Runnable() {
- @Override
- public void run() {
- IFormPage page = formEditor.setActivePage("org.eclipse.tcf.te.tcf.filesystem.FSExplorerEditorPage"); //$NON-NLS-1$
- // If the element is a context node, select the node
- if (page != null && element instanceof FSTreeNode || element instanceof FSModel) {
- Viewer viewer = ((FSExplorerEditorPage)page).getTreeControl().getViewer();
- if (viewer != null) {
- viewer.setSelection(new StructuredSelection(element), true);
- }
- }
- else if (formEditor instanceof Editor) {
- ((Editor)formEditor).setActivePage(0);
- }
- }
- });
- }
- }
-}
+/**
+ * EditorHandlerDelegate.java
+ * Created on Jan 25, 2012
+ *
+ * Copyright (c) 2012, 2013 Wind River Systems, Inc.
+ *
+ * The right to copy, distribute, modify, or otherwise make use
+ * of this software may be licensed only pursuant to the terms
+ * of an applicable Wind River license agreement.
+ */
+package org.eclipse.tcf.te.tcf.filesystem.ui.internal.handlers;
+
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.tcf.te.tcf.filesystem.core.model.FSModel;
+import org.eclipse.tcf.te.tcf.filesystem.core.model.FSTreeNode;
+import org.eclipse.tcf.te.tcf.filesystem.ui.internal.pages.FSExplorerEditorPage;
+import org.eclipse.tcf.te.tcf.ui.handler.AbstractPeerModelEditorHandlerDelegate;
+import org.eclipse.tcf.te.ui.swt.DisplayUtil;
+import org.eclipse.tcf.te.ui.views.editor.Editor;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.forms.editor.FormEditor;
+import org.eclipse.ui.forms.editor.IFormPage;
+
+/**
+ * Systems context node properties command handler implementation.
+ */
+public class EditorHandlerDelegate extends AbstractPeerModelEditorHandlerDelegate {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.interfaces.handler.IEditorHandlerDelegate#postOpenProperties(org.eclipse.ui.IEditorPart, java.lang.Object)
+ */
+ @Override
+ public void postOpenEditor(IEditorPart editor, final Object element) {
+ if (editor instanceof FormEditor) {
+ final FormEditor formEditor = (FormEditor)editor;
+ DisplayUtil.safeAsyncExec(new Runnable() {
+ @Override
+ public void run() {
+ IFormPage page = formEditor.setActivePage("org.eclipse.tcf.te.tcf.filesystem.FSExplorerEditorPage"); //$NON-NLS-1$
+ // If the element is a context node, select the node
+ if (page != null && element instanceof FSTreeNode || element instanceof FSModel) {
+ Viewer viewer = ((FSExplorerEditorPage)page).getTreeControl().getViewer();
+ if (viewer != null) {
+ viewer.setSelection(new StructuredSelection(element), true);
+ }
+ }
+ else if (formEditor instanceof Editor) {
+ ((Editor)formEditor).setActivePage(0);
+ }
+ }
+ });
+ }
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/wizards/TargetPatternFilter.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/wizards/TargetPatternFilter.java
index fbd82c68f..32d7a10b7 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/wizards/TargetPatternFilter.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/wizards/TargetPatternFilter.java
@@ -1,57 +1,57 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009, 2012 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.tcf.te.tcf.filesystem.ui.internal.wizards;
-
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
-import org.eclipse.tcf.te.tcf.ui.navigator.DelegatingLabelProvider;
-import org.eclipse.ui.dialogs.PatternFilter;
-
-/**
- * A class that handles filtering wizard node items based on a supplied matching
- * string and keywords
- * <p>
- * This class is copied and adapted from <code>org.eclipse.ui.internal.dialogs.WizardPatternFilter</code>.
- */
-public class TargetPatternFilter extends PatternFilter {
- private DelegatingLabelProvider targetLabelProvider = new DelegatingLabelProvider();
- /**
- * Create a new instance of a WizardPatternFilter
- * @param isMatchItem
- */
- public TargetPatternFilter() {
- super();
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.internal.dialogs.PatternFilter#isElementSelectable(java.lang.Object)
- */
- @Override
- public boolean isElementSelectable(Object element) {
- return element instanceof IPeerModel;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.internal.dialogs.PatternFilter#isElementMatch(org.eclipse.jface.viewers.Viewer, java.lang.Object)
- */
- @Override
- protected boolean isLeafMatch(Viewer viewer, Object element) {
- if ( element instanceof IPeerModel) {
- String text = targetLabelProvider.getText(element);
- if (wordMatches(text)) {
- return true;
- }
- }
- return false;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2005, 2012 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.tcf.filesystem.ui.internal.wizards;
+
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
+import org.eclipse.tcf.te.tcf.ui.navigator.DelegatingLabelProvider;
+import org.eclipse.ui.dialogs.PatternFilter;
+
+/**
+ * A class that handles filtering wizard node items based on a supplied matching
+ * string and keywords
+ * <p>
+ * This class is copied and adapted from <code>org.eclipse.ui.internal.dialogs.WizardPatternFilter</code>.
+ */
+public class TargetPatternFilter extends PatternFilter {
+ private DelegatingLabelProvider targetLabelProvider = new DelegatingLabelProvider();
+ /**
+ * Create a new instance of a WizardPatternFilter
+ * @param isMatchItem
+ */
+ public TargetPatternFilter() {
+ super();
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.internal.dialogs.PatternFilter#isElementSelectable(java.lang.Object)
+ */
+ @Override
+ public boolean isElementSelectable(Object element) {
+ return element instanceof IPeerModel;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.internal.dialogs.PatternFilter#isElementMatch(org.eclipse.jface.viewers.Viewer, java.lang.Object)
+ */
+ @Override
+ protected boolean isLeafMatch(Viewer viewer, Object element) {
+ if ( element instanceof IPeerModel) {
+ String text = targetLabelProvider.getText(element);
+ if (wordMatches(text)) {
+ return true;
+ }
+ }
+ return false;
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/services/UIService.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/services/UIService.java
index ab00b8a92..807e594e7 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/services/UIService.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/services/UIService.java
@@ -1,38 +1,38 @@
-/**
- * UIService.java
- * Created on Nov 15, 2012
- *
- * Copyright (c) 2012 Wind River Systems, Inc.
- *
- * The right to copy, distribute, modify, or otherwise make use
- * of this software may be licensed only pursuant to the terms
- * of an applicable Wind River license agreement.
- */
-package org.eclipse.tcf.te.tcf.filesystem.ui.services;
-
-import org.eclipse.tcf.te.runtime.services.AbstractService;
-import org.eclipse.tcf.te.runtime.services.interfaces.IUIService;
-import org.eclipse.tcf.te.tcf.filesystem.ui.internal.handlers.EditorHandlerDelegate;
-import org.eclipse.tcf.te.ui.interfaces.handler.IEditorHandlerDelegate;
-
-/**
- * UI service implementation.
- */
-public class UIService extends AbstractService implements IUIService {
- private final IEditorHandlerDelegate editorHandlerDelegate = new EditorHandlerDelegate();
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.services.interfaces.IUIService#getDelegate(java.lang.Object, java.lang.Class)
- */
- @SuppressWarnings("unchecked")
- @Override
- public <V> V getDelegate(Object context, Class<? extends V> clazz) {
-
- if (IEditorHandlerDelegate.class.isAssignableFrom(clazz)) {
- return (V) editorHandlerDelegate;
- }
-
- return null;
- }
-
-}
+/**
+ * UIService.java
+ * Created on Nov 15, 2012
+ *
+ * Copyright (c) 2012, 2013 Wind River Systems, Inc.
+ *
+ * The right to copy, distribute, modify, or otherwise make use
+ * of this software may be licensed only pursuant to the terms
+ * of an applicable Wind River license agreement.
+ */
+package org.eclipse.tcf.te.tcf.filesystem.ui.services;
+
+import org.eclipse.tcf.te.runtime.services.AbstractService;
+import org.eclipse.tcf.te.runtime.services.interfaces.IUIService;
+import org.eclipse.tcf.te.tcf.filesystem.ui.internal.handlers.EditorHandlerDelegate;
+import org.eclipse.tcf.te.ui.interfaces.handler.IEditorHandlerDelegate;
+
+/**
+ * UI service implementation.
+ */
+public class UIService extends AbstractService implements IUIService {
+ private final IEditorHandlerDelegate editorHandlerDelegate = new EditorHandlerDelegate();
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.services.interfaces.IUIService#getDelegate(java.lang.Object, java.lang.Class)
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public <V> V getDelegate(Object context, Class<? extends V> clazz) {
+
+ if (IEditorHandlerDelegate.class.isAssignableFrom(clazz)) {
+ return (V) editorHandlerDelegate;
+ }
+
+ return null;
+ }
+
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/OSGI-INF/l10n/bundle.properties b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/OSGI-INF/l10n/bundle.properties
index 381c21348..2516a71b0 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/OSGI-INF/l10n/bundle.properties
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/OSGI-INF/l10n/bundle.properties
@@ -1,4 +1,13 @@
-#Properties file for org.eclipse.tcf.te.tcf.launch.cdt
+###############################################################################
+# Copyright (c) 2013 MontaVista Software, LLC. and others. All rights reserved.
+# This program and the accompanying materials are made available under the terms
+# of the Eclipse Public License v1.0 which accompanies this distribution, and is
+# available at http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Anna Dushistova (MontaVista) - initial API and implementation
+###############################################################################
+
Bundle-Name = Remote debug and launch over TE/TCF
Vendor-Name = Eclipse.org - Target Explorer
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/about.properties b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/about.properties
index 633488a6f..2b039fcda 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/about.properties
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/about.properties
@@ -1,5 +1,5 @@
###############################################################################
-# Copyright (c) 2006, 2009 PalmSource, Inc. and others.
+# Copyright (c) 2006, 2012 PalmSource, Inc. and others.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
@@ -8,6 +8,7 @@
# Contributors:
# PalmSource - initial API and implementation
###############################################################################
+
# about.properties
# contains externalized strings for about.ini
# java.io.Properties file (ISO 8859-1 with "\" escapes)
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/build.properties b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/build.properties
index 948f0bdf0..62bfe5f8a 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/build.properties
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/build.properties
@@ -1,3 +1,12 @@
+###############################################################################
+# Copyright (c) 2013 MontaVista Software, LLC. and others. All rights reserved.
+# This program and the accompanying materials are made available under the terms
+# of the Eclipse Public License v1.0 which accompanies this distribution, and is
+# available at http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Anna Dushistova (MontaVista) - initial API and implementation
+###############################################################################
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/activator/Activator.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/activator/Activator.java
index 3c7eedf45..73d490ca5 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/activator/Activator.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/activator/Activator.java
@@ -1,3 +1,12 @@
+/*******************************************************************************
+ * Copyright (c) 2013 MontaVista Software, LLC. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Anna Dushistova (MontaVista) - initial API and implementation
+ *******************************************************************************/
package org.eclipse.tcf.te.tcf.launch.cdt.activator;
import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/launching/TERunLaunchDelegate.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/launching/TERunLaunchDelegate.java
index 44b4e0c36..25b7e6cbb 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/launching/TERunLaunchDelegate.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/launching/TERunLaunchDelegate.java
@@ -1,3 +1,12 @@
+/*******************************************************************************
+ * Copyright (c) 2013 MontaVista Software, LLC. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Anna Dushistova (MontaVista) - initial API and implementation
+ *******************************************************************************/
package org.eclipse.tcf.te.tcf.launch.cdt.launching;
import org.eclipse.cdt.core.model.ICProject;
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/plugin.properties b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/plugin.properties
index 7c86354ea..fc5d05a89 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/plugin.properties
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/plugin.properties
@@ -1,29 +1,29 @@
-##################################################################################
-# Copyright (c) 2011, 2012 Wind River Systems, Inc. and others. All rights reserved.
-# This program and the accompanying materials are made available under the terms
-# of the Eclipse Public License v1.0 which accompanies this distribution, and is
-# available at http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Wind River Systems - initial API and implementation
-##################################################################################
-
-pluginName = Target Explorer, TCF Launching, Core
-providerName = Eclipse.org - Target Explorer
-
-# ***** Launch Configuration Types *****
-
-LaunchType.Remote.App.name=Remote Application
-LaunchType.Attach.name=Remote Debugger
-
-# ***** Launch Step Groups *****
-
-LaunchStepGroup.Remote.App.name=Remote Application
-LaunchStepGroup.FileTransfer.name=File Transfer
-LaunchStepGroup.LaunchProcess.name=Launch Process
-
-LaunchStepGroup.Attach.name=Attach
-
-# ***** Launch Steps *****
-
-LaunchStep.AttachDebugger.name=Attach Debugger
+##################################################################################
+# Copyright (c) 2011, 2013 Wind River Systems, Inc. and others. All rights reserved.
+# This program and the accompanying materials are made available under the terms
+# of the Eclipse Public License v1.0 which accompanies this distribution, and is
+# available at http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Wind River Systems - initial API and implementation
+##################################################################################
+
+pluginName = Target Explorer, TCF Launching, Core
+providerName = Eclipse.org - Target Explorer
+
+# ***** Launch Configuration Types *****
+
+LaunchType.Remote.App.name=Remote Application
+LaunchType.Attach.name=Remote Debugger
+
+# ***** Launch Step Groups *****
+
+LaunchStepGroup.Remote.App.name=Remote Application
+LaunchStepGroup.FileTransfer.name=File Transfer
+LaunchStepGroup.LaunchProcess.name=Launch Process
+
+LaunchStepGroup.Attach.name=Attach
+
+# ***** Launch Steps *****
+
+LaunchStep.AttachDebugger.name=Attach Debugger
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/interfaces/steps/ITcfLaunchStepAttributes.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/interfaces/steps/ITcfLaunchStepAttributes.java
index a8d28eab1..ab45156a4 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/interfaces/steps/ITcfLaunchStepAttributes.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/interfaces/steps/ITcfLaunchStepAttributes.java
@@ -1,26 +1,26 @@
-/*******************************************************************************
- * Copyright (c) 2012 Wind River Systems, Inc. and others. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.tcf.te.tcf.launch.core.interfaces.steps;
-
-/**
- * Defines the launch configuration attribute id's for attach launches.
- */
-public interface ITcfLaunchStepAttributes {
-
- /**
- * Define the prefix used by all other attribute id's as prefix.
- */
- public static final String ATTR_PREFIX = "org.eclipse.tcf.te.tcf.launch"; //$NON-NLS-1$
-
- /**
- * Launch configuration attribute: List of TCF services to use to attach all their children (i.e. {IProcesses})
- */
- public static final String ATTR_ATTACH_SERVICES = ATTR_PREFIX + ".attach_services"; //$NON-NLS-1$
-}
+/*******************************************************************************
+ * Copyright (c) 2012, 2013 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.tcf.launch.core.interfaces.steps;
+
+/**
+ * Defines the launch configuration attribute id's for attach launches.
+ */
+public interface ITcfLaunchStepAttributes {
+
+ /**
+ * Define the prefix used by all other attribute id's as prefix.
+ */
+ public static final String ATTR_PREFIX = "org.eclipse.tcf.te.tcf.launch"; //$NON-NLS-1$
+
+ /**
+ * Launch configuration attribute: List of TCF services to use to attach all their children (i.e. {IProcesses})
+ */
+ public static final String ATTR_ATTACH_SERVICES = ATTR_PREFIX + ".attach_services"; //$NON-NLS-1$
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/internal/adapters/AdapterFactory.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/internal/adapters/AdapterFactory.java
index 6ae2a7c9a..4460b12e1 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/internal/adapters/AdapterFactory.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/internal/adapters/AdapterFactory.java
@@ -1,121 +1,121 @@
-/*******************************************************************************
- * Copyright (c) 2012 Wind River Systems, Inc. and others. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.tcf.te.tcf.launch.core.internal.adapters;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.debug.core.ILaunchListener;
-import org.eclipse.tcf.protocol.Protocol;
-import org.eclipse.tcf.te.runtime.interfaces.IDisposable;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
-
-/**
- * Adapter factory implementation.
- */
-public class AdapterFactory implements IAdapterFactory {
- // Maintain a map of step context adapters per peer model
- /* default */ Map<ILaunch, IStepContext> adapters = new HashMap<ILaunch, IStepContext>();
- AttachLaunchConfigAdapter attachLaunchConfigAdapter = new AttachLaunchConfigAdapter();
-
- private static final Class<?>[] CLASSES = new Class[] {
- IStepContext.class,
- ILaunchConfiguration.class,
- ILaunchConfigurationWorkingCopy.class,
- };
-
- /**
- * Constructor.
- */
- public AdapterFactory() {
- final ILaunchListener listener = new ILaunchListener() {
- @Override
- public void launchRemoved(ILaunch launch) {
- IStepContext adapter = adapters.remove(launch);
- if (adapter instanceof IDisposable) {
- ((IDisposable)adapter).dispose();
- }
- }
- @Override
- public void launchChanged(ILaunch launch) {
- IStepContext adapter = adapters.remove(launch);
- if (adapter instanceof IDisposable) {
- ((IDisposable)adapter).dispose();
- }
- }
- @Override
- public void launchAdded(ILaunch launch) {
- }
- };
-
- Runnable runnable = new Runnable() {
- @Override
- public void run() {
- DebugPlugin.getDefault().getLaunchManager().addLaunchListener(listener);
- }
- };
-
- if (Protocol.isDispatchThread()) {
- runnable.run();
- }
- else {
- Protocol.invokeAndWait(runnable);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
- */
- @Override
- public Object getAdapter(Object adaptableObject, Class adapterType) {
- if (adaptableObject instanceof ILaunch) {
- if (IStepContext.class.equals(adapterType)) {
- // Lookup the adapter
- IStepContext adapter = adapters.get(adaptableObject);
- // No adapter yet -> create a new one for this peer
- if (adapter == null) {
- adapter = new LaunchStepContext((ILaunch)adaptableObject);
- adapters.put((ILaunch)adaptableObject, adapter);
- }
- return adapter;
- }
- }
- else if (adaptableObject instanceof IPeerModel) {
- if (ILaunchConfiguration.class.equals(adapterType)) {
- return attachLaunchConfigAdapter.getAttachLaunchConfig((IPeerModel)adaptableObject);
- }
- if (ILaunchConfigurationWorkingCopy.class.equals(adapterType)) {
- ILaunchConfiguration launchConfig = attachLaunchConfigAdapter.getAttachLaunchConfig((IPeerModel)adaptableObject);
- try {
- return launchConfig.getWorkingCopy();
- }
- catch (Exception e) {
- return launchConfig;
- }
- }
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
- */
- @Override
- public Class[] getAdapterList() {
- return CLASSES;
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2012, 2013 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.tcf.launch.core.internal.adapters;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.core.runtime.IAdapterFactory;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.debug.core.ILaunchListener;
+import org.eclipse.tcf.protocol.Protocol;
+import org.eclipse.tcf.te.runtime.interfaces.IDisposable;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
+
+/**
+ * Adapter factory implementation.
+ */
+public class AdapterFactory implements IAdapterFactory {
+ // Maintain a map of step context adapters per peer model
+ /* default */ Map<ILaunch, IStepContext> adapters = new HashMap<ILaunch, IStepContext>();
+ AttachLaunchConfigAdapter attachLaunchConfigAdapter = new AttachLaunchConfigAdapter();
+
+ private static final Class<?>[] CLASSES = new Class[] {
+ IStepContext.class,
+ ILaunchConfiguration.class,
+ ILaunchConfigurationWorkingCopy.class,
+ };
+
+ /**
+ * Constructor.
+ */
+ public AdapterFactory() {
+ final ILaunchListener listener = new ILaunchListener() {
+ @Override
+ public void launchRemoved(ILaunch launch) {
+ IStepContext adapter = adapters.remove(launch);
+ if (adapter instanceof IDisposable) {
+ ((IDisposable)adapter).dispose();
+ }
+ }
+ @Override
+ public void launchChanged(ILaunch launch) {
+ IStepContext adapter = adapters.remove(launch);
+ if (adapter instanceof IDisposable) {
+ ((IDisposable)adapter).dispose();
+ }
+ }
+ @Override
+ public void launchAdded(ILaunch launch) {
+ }
+ };
+
+ Runnable runnable = new Runnable() {
+ @Override
+ public void run() {
+ DebugPlugin.getDefault().getLaunchManager().addLaunchListener(listener);
+ }
+ };
+
+ if (Protocol.isDispatchThread()) {
+ runnable.run();
+ }
+ else {
+ Protocol.invokeAndWait(runnable);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
+ */
+ @Override
+ public Object getAdapter(Object adaptableObject, Class adapterType) {
+ if (adaptableObject instanceof ILaunch) {
+ if (IStepContext.class.equals(adapterType)) {
+ // Lookup the adapter
+ IStepContext adapter = adapters.get(adaptableObject);
+ // No adapter yet -> create a new one for this peer
+ if (adapter == null) {
+ adapter = new LaunchStepContext((ILaunch)adaptableObject);
+ adapters.put((ILaunch)adaptableObject, adapter);
+ }
+ return adapter;
+ }
+ }
+ else if (adaptableObject instanceof IPeerModel) {
+ if (ILaunchConfiguration.class.equals(adapterType)) {
+ return attachLaunchConfigAdapter.getAttachLaunchConfig((IPeerModel)adaptableObject);
+ }
+ if (ILaunchConfigurationWorkingCopy.class.equals(adapterType)) {
+ ILaunchConfiguration launchConfig = attachLaunchConfigAdapter.getAttachLaunchConfig((IPeerModel)adaptableObject);
+ try {
+ return launchConfig.getWorkingCopy();
+ }
+ catch (Exception e) {
+ return launchConfig;
+ }
+ }
+ }
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
+ */
+ @Override
+ public Class[] getAdapterList() {
+ return CLASSES;
+ }
+
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/internal/adapters/LaunchStepContext.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/internal/adapters/LaunchStepContext.java
index cd30c2a1d..419d5b8fc 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/internal/adapters/LaunchStepContext.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/internal/adapters/LaunchStepContext.java
@@ -1,101 +1,101 @@
-/*******************************************************************************
- * Copyright (c) 2012 Wind River Systems, Inc. and others. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.tcf.te.tcf.launch.core.internal.adapters;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationType;
-import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
-import org.eclipse.tcf.te.runtime.stepper.context.AbstractStepContext;
-
-/**
- * Launch step context adapter implementation.
- */
-public class LaunchStepContext extends AbstractStepContext {
-
- /**
- * Constructor.
- *
- * @param launch The launch. Must not be <code>null</code>.
- */
- public LaunchStepContext(ILaunch launch) {
- super(launch);
- }
-
- /**
- * Returns the launch.
- * @return The launch.
- */
- public ILaunch getLaunch() {
- return (ILaunch)getContextObject();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext#getId()
- */
- @Override
- public String getId() {
- return getLaunch().getLaunchConfiguration() != null ? getLaunch().getLaunchConfiguration().getName() : null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext#getSecondaryId()
- */
- @Override
- public String getSecondaryId() {
- return getLaunch().getLaunchMode();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext#getName()
- */
- @Override
- public String getName() {
- return getId();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext#getInfo(org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer)
- */
- @Override
- public String getInfo(IPropertiesContainer data) {
- try {
- return getName() + "(" + getLaunch().getLaunchMode() + ") - " + getLaunch().getLaunchConfiguration().getType().getName(); //$NON-NLS-1$ //$NON-NLS-2$
- }
- catch (CoreException e) {
- }
- return getName() + "(" + getLaunch().getLaunchMode() + ")"; //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.PlatformObject#getAdapter(java.lang.Class)
- */
- @Override
- public Object getAdapter(final Class adapter) {
- if (ILaunch.class.equals(adapter)) {
- return getLaunch();
- }
-
- if (ILaunchConfiguration.class.isAssignableFrom(adapter)) {
- return getLaunch().getLaunchConfiguration();
- }
-
- if (ILaunchConfigurationType.class.isAssignableFrom(adapter)) {
- try {
- return getLaunch().getLaunchConfiguration().getType();
- }
- catch (CoreException e) {
- }
- }
-
- return super.getAdapter(adapter);
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2012, 2013 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.tcf.launch.core.internal.adapters;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationType;
+import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
+import org.eclipse.tcf.te.runtime.stepper.context.AbstractStepContext;
+
+/**
+ * Launch step context adapter implementation.
+ */
+public class LaunchStepContext extends AbstractStepContext {
+
+ /**
+ * Constructor.
+ *
+ * @param launch The launch. Must not be <code>null</code>.
+ */
+ public LaunchStepContext(ILaunch launch) {
+ super(launch);
+ }
+
+ /**
+ * Returns the launch.
+ * @return The launch.
+ */
+ public ILaunch getLaunch() {
+ return (ILaunch)getContextObject();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext#getId()
+ */
+ @Override
+ public String getId() {
+ return getLaunch().getLaunchConfiguration() != null ? getLaunch().getLaunchConfiguration().getName() : null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext#getSecondaryId()
+ */
+ @Override
+ public String getSecondaryId() {
+ return getLaunch().getLaunchMode();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext#getName()
+ */
+ @Override
+ public String getName() {
+ return getId();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext#getInfo(org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer)
+ */
+ @Override
+ public String getInfo(IPropertiesContainer data) {
+ try {
+ return getName() + "(" + getLaunch().getLaunchMode() + ") - " + getLaunch().getLaunchConfiguration().getType().getName(); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ catch (CoreException e) {
+ }
+ return getName() + "(" + getLaunch().getLaunchMode() + ")"; //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.PlatformObject#getAdapter(java.lang.Class)
+ */
+ @Override
+ public Object getAdapter(final Class adapter) {
+ if (ILaunch.class.equals(adapter)) {
+ return getLaunch();
+ }
+
+ if (ILaunchConfiguration.class.isAssignableFrom(adapter)) {
+ return getLaunch().getLaunchConfiguration();
+ }
+
+ if (ILaunchConfigurationType.class.isAssignableFrom(adapter)) {
+ try {
+ return getLaunch().getLaunchConfiguration().getType();
+ }
+ catch (CoreException e) {
+ }
+ }
+
+ return super.getAdapter(adapter);
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/lm/delegates/AttachLaunchManagerDelegate.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/lm/delegates/AttachLaunchManagerDelegate.java
index 577ec6cdf..6c7fee00b 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/lm/delegates/AttachLaunchManagerDelegate.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/lm/delegates/AttachLaunchManagerDelegate.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Wind River Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2012, 2013 Wind River Systems, Inc. and others. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/lm/delegates/RemoteAppLaunchManagerDelegate.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/lm/delegates/RemoteAppLaunchManagerDelegate.java
index 3a7aa926e..9620acc70 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/lm/delegates/RemoteAppLaunchManagerDelegate.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/lm/delegates/RemoteAppLaunchManagerDelegate.java
@@ -1,331 +1,331 @@
-/*******************************************************************************
- * Copyright (c) 2012 Wind River Systems, Inc. and others. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tcf.te.tcf.launch.core.lm.delegates;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.tcf.te.core.cdt.CdtUtils;
-import org.eclipse.tcf.te.launch.core.exceptions.LaunchServiceException;
-import org.eclipse.tcf.te.launch.core.interfaces.IReferencedProjectItem;
-import org.eclipse.tcf.te.launch.core.lm.delegates.DefaultLaunchManagerDelegate;
-import org.eclipse.tcf.te.launch.core.lm.interfaces.IFileTransferLaunchAttributes;
-import org.eclipse.tcf.te.launch.core.lm.interfaces.ILaunchContextLaunchAttributes;
-import org.eclipse.tcf.te.launch.core.lm.interfaces.ILaunchSpecification;
-import org.eclipse.tcf.te.launch.core.lm.interfaces.IReferencedProjectLaunchAttributes;
-import org.eclipse.tcf.te.launch.core.persistence.DefaultPersistenceDelegate;
-import org.eclipse.tcf.te.launch.core.persistence.filetransfer.FileTransfersPersistenceDelegate;
-import org.eclipse.tcf.te.launch.core.persistence.launchcontext.LaunchContextsPersistenceDelegate;
-import org.eclipse.tcf.te.launch.core.persistence.projects.ReferencedProjectItem;
-import org.eclipse.tcf.te.launch.core.persistence.projects.ReferencedProjectsPersistenceDelegate;
-import org.eclipse.tcf.te.launch.core.selection.interfaces.IProjectSelectionContext;
-import org.eclipse.tcf.te.launch.core.selection.interfaces.IRemoteSelectionContext;
-import org.eclipse.tcf.te.launch.core.selection.interfaces.ISelectionContext;
-import org.eclipse.tcf.te.runtime.model.interfaces.IModelNode;
-import org.eclipse.tcf.te.runtime.services.ServiceManager;
-import org.eclipse.tcf.te.runtime.services.filetransfer.FileTransferItem;
-import org.eclipse.tcf.te.runtime.services.interfaces.IPropertiesAccessService;
-import org.eclipse.tcf.te.runtime.services.interfaces.constants.IPropertiesAccessServiceConstants;
-import org.eclipse.tcf.te.runtime.services.interfaces.filetransfer.IFileTransferItem;
-import org.eclipse.tcf.te.tcf.processes.core.interfaces.steps.IProcessesStepAttributes;
-
-/**
- * RemoteAppLaunchManagerDelegate
- */
-public class RemoteAppLaunchManagerDelegate extends DefaultLaunchManagerDelegate {
-
- private static final String[] MANDATORY_CONFIG_ATTRIBUTES = new String[] {
- ILaunchContextLaunchAttributes.ATTR_LAUNCH_CONTEXTS,
- IProcessesStepAttributes.ATTR_PROCESS_IMAGE
- };
-
- /**
- * Constructor.
- */
- public RemoteAppLaunchManagerDelegate() {
- super();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.launch.core.lm.delegates.DefaultLaunchManagerDelegate#initLaunchConfigAttributes(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy, org.eclipse.tcf.te.launch.core.lm.interfaces.ILaunchSpecification)
- */
- @Override
- public void initLaunchConfigAttributes(ILaunchConfigurationWorkingCopy wc, ILaunchSpecification launchSpec) {
- super.initLaunchConfigAttributes(wc, launchSpec);
-
- wc.setAttribute(IProcessesStepAttributes.ATTR_STOP_AT_MAIN, true);
- wc.setAttribute(IProcessesStepAttributes.ATTR_ATTACH_CHILDREN, true);
- try {
- wc.setAttribute(ILaunchConfiguration.ATTR_SOURCE_LOCATOR_MEMENTO, CdtUtils.getDefaultSourceLookupDirector().getMemento());
- IModelNode[] contexts = LaunchContextsPersistenceDelegate.getLaunchContexts(launchSpec);
- if (contexts != null && contexts.length == 1) {
- ILaunchConfiguration attachLaunch = (ILaunchConfiguration)Platform.getAdapterManager().getAdapter(contexts[0], ILaunchConfiguration.class);
- wc.setAttribute("org.eclipse.tcf.debug.PathMap", attachLaunch.getAttribute("org.eclipse.tcf.debug.PathMap", (String)null)); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- catch (Exception e) {
- }
- copySpecToConfig(launchSpec, wc);
-
- wc.rename(getDefaultLaunchName(wc));
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.launch.core.lm.delegates.DefaultLaunchManagerDelegate#updateLaunchConfig(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy, org.eclipse.tcf.te.launch.core.selection.interfaces.ISelectionContext, boolean)
- */
- @Override
- public void updateLaunchConfig(ILaunchConfigurationWorkingCopy wc, ISelectionContext selContext, boolean replace) {
- super.updateLaunchConfig(wc, selContext, replace);
-
- if (selContext instanceof IProjectSelectionContext) {
- List<IFileTransferItem> transfers;
- List<IReferencedProjectItem> projects;
- String processPath;
- if (replace) {
- transfers = new ArrayList<IFileTransferItem>();
- projects = new ArrayList<IReferencedProjectItem>();
- processPath = getProcessImageAndSetProjectAndTransfer((IProjectSelectionContext)selContext, transfers, projects);
-
- FileTransfersPersistenceDelegate.setFileTransfers(wc, transfers.toArray(new IFileTransferItem[transfers.size()]));
- ReferencedProjectsPersistenceDelegate.setReferencedProjects(wc, projects.toArray(new IReferencedProjectItem[projects.size()]));
- if (processPath != null && processPath.trim().length() > 0) {
- DefaultPersistenceDelegate.setAttribute(wc, IProcessesStepAttributes.ATTR_PROCESS_IMAGE, processPath);
- }
- }
- else {
- transfers = new ArrayList<IFileTransferItem>(Arrays.asList(FileTransfersPersistenceDelegate.getFileTransfers(wc)));
- projects = new ArrayList<IReferencedProjectItem>(Arrays.asList(ReferencedProjectsPersistenceDelegate.getReferencedProjects(wc)));
- processPath = getProcessImageAndSetProjectAndTransfer((IProjectSelectionContext)selContext, transfers, projects);
-
- FileTransfersPersistenceDelegate.setFileTransfers(wc, transfers.toArray(new IFileTransferItem[transfers.size()]));
- ReferencedProjectsPersistenceDelegate.setReferencedProjects(wc, projects.toArray(new IReferencedProjectItem[projects.size()]));
- if (processPath != null && processPath.trim().length() > 0 && !DefaultPersistenceDelegate.hasAttribute(wc, IProcessesStepAttributes.ATTR_PROCESS_IMAGE)) {
- DefaultPersistenceDelegate.setAttribute(wc, IProcessesStepAttributes.ATTR_PROCESS_IMAGE, processPath);
- }
- }
- }
- else if (selContext instanceof IRemoteSelectionContext) {
- IRemoteSelectionContext remoteCtx = (IRemoteSelectionContext)selContext;
- LaunchContextsPersistenceDelegate.setLaunchContexts(wc, new IModelNode[]{remoteCtx.getRemoteCtx()});
- }
-
- wc.rename(getDefaultLaunchName(wc));
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.launch.core.lm.delegates.DefaultLaunchManagerDelegate#addLaunchSpecAttributes(org.eclipse.tcf.te.launch.core.lm.interfaces.ILaunchSpecification, java.lang.String, org.eclipse.tcf.te.launch.core.selection.interfaces.ISelectionContext)
- */
- @Override
- protected ILaunchSpecification addLaunchSpecAttributes(ILaunchSpecification launchSpec, String launchConfigTypeId, ISelectionContext selectionContext) {
- launchSpec = super.addLaunchSpecAttributes(launchSpec, launchConfigTypeId, selectionContext);
-
- if (selectionContext instanceof IRemoteSelectionContext) {
- List<IModelNode> launchContexts = new ArrayList<IModelNode>(Arrays.asList(LaunchContextsPersistenceDelegate.getLaunchContexts(launchSpec)));
- IModelNode remoteCtx = ((IRemoteSelectionContext)selectionContext).getRemoteCtx();
- if (!launchContexts.contains(remoteCtx)) {
- launchContexts.add(remoteCtx);
- LaunchContextsPersistenceDelegate.setLaunchContexts(launchSpec, launchContexts.toArray(new IModelNode[launchContexts.size()]));
- }
-
- launchSpec.setLaunchConfigName(getDefaultLaunchName(launchSpec));
- }
- else if (selectionContext instanceof IProjectSelectionContext) {
- List<IFileTransferItem> transfers = new ArrayList<IFileTransferItem>(Arrays.asList(FileTransfersPersistenceDelegate.getFileTransfers(launchSpec)));
- List<IReferencedProjectItem> projects = new ArrayList<IReferencedProjectItem>(Arrays.asList(ReferencedProjectsPersistenceDelegate.getReferencedProjects(launchSpec)));
- String processPath = getProcessImageAndSetProjectAndTransfer((IProjectSelectionContext)selectionContext, transfers, projects);
-
- FileTransfersPersistenceDelegate.setFileTransfers(launchSpec, transfers.toArray(new IFileTransferItem[transfers.size()]));
- ReferencedProjectsPersistenceDelegate.setReferencedProjects(launchSpec, projects.toArray(new IReferencedProjectItem[projects.size()]));
- launchSpec.addAttribute(IProcessesStepAttributes.ATTR_PROCESS_IMAGE, processPath);
-
- launchSpec.setLaunchConfigName(getDefaultLaunchName(launchSpec));
- }
-
- return launchSpec;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.launch.core.lm.delegates.DefaultLaunchManagerDelegate#getDefaultLaunchName(org.eclipse.tcf.te.launch.core.lm.interfaces.ILaunchSpecification)
- */
- @Override
- public String getDefaultLaunchName(ILaunchSpecification launchSpec) {
- IModelNode[] contexts = LaunchContextsPersistenceDelegate.getLaunchContexts(launchSpec);
- String processPath = (String)launchSpec.getAttribute(IProcessesStepAttributes.ATTR_PROCESS_IMAGE, null);
- String name = getDefaultLaunchName((contexts != null && contexts.length > 0 ? contexts[0] : null), processPath);
- return name.trim().length() > 0 ? name.trim() : super.getDefaultLaunchName(launchSpec);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.launch.core.lm.delegates.DefaultLaunchManagerDelegate#getDefaultLaunchName(org.eclipse.debug.core.ILaunchConfiguration)
- */
- @Override
- public String getDefaultLaunchName(ILaunchConfiguration launchConfig) {
- IModelNode[] contexts = LaunchContextsPersistenceDelegate.getLaunchContexts(launchConfig);
- String processPath = DefaultPersistenceDelegate.getAttribute(launchConfig, IProcessesStepAttributes.ATTR_PROCESS_IMAGE, (String)null);
- String name = getDefaultLaunchName((contexts != null && contexts.length > 0 ? contexts[0] : null), processPath);
- return name.trim().length() > 0 ? name.trim() : super.getDefaultLaunchName(launchConfig);
- }
-
- private String getDefaultLaunchName(IModelNode context, String processPath) {
- String name = ""; //$NON-NLS-1$
- if (processPath != null) {
- name += new Path(processPath).lastSegment();
- }
- if (context != null) {
- IPropertiesAccessService service = ServiceManager.getInstance().getService(context, IPropertiesAccessService.class);
- Object dnsName = service != null ? service.getProperty(context, "dns.name.transient") : null; //$NON-NLS-1$
- String ctxName = service != null ? (String)service.getTargetAddress(context).get(IPropertiesAccessServiceConstants.PROP_ADDRESS) : null;
- ctxName = dnsName != null && dnsName.toString().trim().length() > 0 ? dnsName.toString().trim() : ctxName;
-
- name += " (" + ctxName + ")"; //$NON-NLS-1$ //$NON-NLS-2$
- }
- return name.trim();
- }
-
- private String getProcessImageAndSetProjectAndTransfer(IProjectSelectionContext prjContext, List<IFileTransferItem> transfers, List<IReferencedProjectItem> projects) {
- String processName = null;
- String processPath = null;
-
- boolean added = false;
- for (Object selection : prjContext.getSelections()) {
- if (selection instanceof IPath) {
- IPath path = (IPath)selection;
- IFileTransferItem transfer = new FileTransferItem(path, new Path("/tmp/")); //$NON-NLS-1$
- if (!transfers.contains(transfer)) {
- transfers.add(transfer);
- }
- if (!added) {
- processName = path.lastSegment();
- processPath = "/tmp/" + processName; //$NON-NLS-1$
- }
- added = true;
- }
- }
-
- IReferencedProjectItem project = new ReferencedProjectItem(prjContext.getProjectCtx().getName());
- if (!projects.contains(project)) {
- projects.add(project);
- }
-
- return processPath;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.launch.core.lm.delegates.DefaultLaunchManagerDelegate#validate(java.lang.String, org.eclipse.debug.core.ILaunchConfiguration)
- */
- @Override
- public void validate(String launchMode, ILaunchConfiguration launchConfig) throws LaunchServiceException {
- super.validate(launchMode, launchConfig);
-
- StringBuilder missingAttributes = new StringBuilder();
- for (String attribute : MANDATORY_CONFIG_ATTRIBUTES) {
- if (!isValidAttribute(attribute, launchConfig, launchMode)) {
- if (missingAttributes.length() == 0) {
- missingAttributes.append(attribute);
- } else {
- missingAttributes.append(", "); //$NON-NLS-1$
- missingAttributes.append(attribute);
- }
- }
- }
- if (missingAttributes.length() > 0) {
- throw new LaunchServiceException("Missing launch configuration attributes: " + '\n' + missingAttributes.toString(), LaunchServiceException.TYPE_MISSING_LAUNCH_CONFIG_ATTR); //$NON-NLS-1$
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.launch.core.lm.delegates.DefaultLaunchManagerDelegate#equals(java.lang.String, java.lang.Object, java.lang.Object, org.eclipse.tcf.te.launch.core.lm.interfaces.ILaunchSpecification, org.eclipse.debug.core.ILaunchConfiguration, java.lang.String)
- */
- @Override
- protected int equals(String attributeKey, Object specValue, Object confValue, ILaunchSpecification launchSpec, ILaunchConfiguration launchConfig, String launchMode) {
-
- if (IProcessesStepAttributes.ATTR_PROCESS_IMAGE.equals(attributeKey)) {
- // get match of object
- int match = specValue.equals(confValue) ? FULL_MATCH : NO_MATCH;
- // compare objects in the list when they are not already equal
- if (match != FULL_MATCH) {
- IPath confPath = new Path(confValue.toString());
- IPath specPath = new Path(specValue.toString());
-
- if (confPath.lastSegment().equals(specPath.lastSegment())) {
- match = PARTIAL_MATCH;
- }
- else {
- match = NO_MATCH;
- }
- }
- return match;
- }
-
- return super.equals(attributeKey, specValue, confValue, launchSpec, launchConfig, launchMode);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.launch.core.lm.delegates.DefaultLaunchManagerDelegate#getNumAttributes()
- */
- @Override
- protected int getNumAttributes() {
- return 8;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.launch.core.lm.delegates.DefaultLaunchManagerDelegate#getAttributeRanking(java.lang.String)
- */
- @Override
- protected int getAttributeRanking(String attributeKey) {
- if (ILaunchContextLaunchAttributes.ATTR_LAUNCH_CONTEXTS.equals(attributeKey)) {
- return getNumAttributes() * 256;
- }
- else if (IProcessesStepAttributes.ATTR_PROCESS_IMAGE.equals(attributeKey)) {
- return getNumAttributes() * 128;
- }
- else if (IProcessesStepAttributes.ATTR_PROCESS_ARGUMENTS.equals(attributeKey)) {
- return getNumAttributes() * 64;
- }
- else if (IFileTransferLaunchAttributes.ATTR_FILE_TRANSFERS.equals(attributeKey)) {
- return getNumAttributes() * 32;
- }
- else if (IReferencedProjectLaunchAttributes.ATTR_REFERENCED_PROJECTS.equals(attributeKey)) {
- return getNumAttributes() * 16;
- }
- else if (IProcessesStepAttributes.ATTR_STOP_AT_ENTRY.equals(attributeKey)) {
- return getNumAttributes() * 8;
- }
- else if (IProcessesStepAttributes.ATTR_STOP_AT_MAIN.equals(attributeKey)) {
- return getNumAttributes() * 4;
- }
- else if (IProcessesStepAttributes.ATTR_ATTACH_CHILDREN.equals(attributeKey)) {
- return getNumAttributes() * 2;
- }
- else {
- return 1;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.launch.core.lm.delegates.DefaultLaunchManagerDelegate#getDescription(org.eclipse.debug.core.ILaunchConfiguration)
- */
- @Override
- public String getDescription(ILaunchConfiguration config) {
- String image = DefaultPersistenceDelegate.getAttribute(config, IProcessesStepAttributes.ATTR_PROCESS_IMAGE, (String)null);
- String args = DefaultPersistenceDelegate.getAttribute(config, IProcessesStepAttributes.ATTR_PROCESS_ARGUMENTS, ""); //$NON-NLS-1$
- if (image != null) {
- return new Path(image).toPortableString() + " " + args; //$NON-NLS-1$
- }
- return ""; //$NON-NLS-1$
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2012, 2013 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.tcf.te.tcf.launch.core.lm.delegates;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.tcf.te.core.cdt.CdtUtils;
+import org.eclipse.tcf.te.launch.core.exceptions.LaunchServiceException;
+import org.eclipse.tcf.te.launch.core.interfaces.IReferencedProjectItem;
+import org.eclipse.tcf.te.launch.core.lm.delegates.DefaultLaunchManagerDelegate;
+import org.eclipse.tcf.te.launch.core.lm.interfaces.IFileTransferLaunchAttributes;
+import org.eclipse.tcf.te.launch.core.lm.interfaces.ILaunchContextLaunchAttributes;
+import org.eclipse.tcf.te.launch.core.lm.interfaces.ILaunchSpecification;
+import org.eclipse.tcf.te.launch.core.lm.interfaces.IReferencedProjectLaunchAttributes;
+import org.eclipse.tcf.te.launch.core.persistence.DefaultPersistenceDelegate;
+import org.eclipse.tcf.te.launch.core.persistence.filetransfer.FileTransfersPersistenceDelegate;
+import org.eclipse.tcf.te.launch.core.persistence.launchcontext.LaunchContextsPersistenceDelegate;
+import org.eclipse.tcf.te.launch.core.persistence.projects.ReferencedProjectItem;
+import org.eclipse.tcf.te.launch.core.persistence.projects.ReferencedProjectsPersistenceDelegate;
+import org.eclipse.tcf.te.launch.core.selection.interfaces.IProjectSelectionContext;
+import org.eclipse.tcf.te.launch.core.selection.interfaces.IRemoteSelectionContext;
+import org.eclipse.tcf.te.launch.core.selection.interfaces.ISelectionContext;
+import org.eclipse.tcf.te.runtime.model.interfaces.IModelNode;
+import org.eclipse.tcf.te.runtime.services.ServiceManager;
+import org.eclipse.tcf.te.runtime.services.filetransfer.FileTransferItem;
+import org.eclipse.tcf.te.runtime.services.interfaces.IPropertiesAccessService;
+import org.eclipse.tcf.te.runtime.services.interfaces.constants.IPropertiesAccessServiceConstants;
+import org.eclipse.tcf.te.runtime.services.interfaces.filetransfer.IFileTransferItem;
+import org.eclipse.tcf.te.tcf.processes.core.interfaces.steps.IProcessesStepAttributes;
+
+/**
+ * RemoteAppLaunchManagerDelegate
+ */
+public class RemoteAppLaunchManagerDelegate extends DefaultLaunchManagerDelegate {
+
+ private static final String[] MANDATORY_CONFIG_ATTRIBUTES = new String[] {
+ ILaunchContextLaunchAttributes.ATTR_LAUNCH_CONTEXTS,
+ IProcessesStepAttributes.ATTR_PROCESS_IMAGE
+ };
+
+ /**
+ * Constructor.
+ */
+ public RemoteAppLaunchManagerDelegate() {
+ super();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.launch.core.lm.delegates.DefaultLaunchManagerDelegate#initLaunchConfigAttributes(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy, org.eclipse.tcf.te.launch.core.lm.interfaces.ILaunchSpecification)
+ */
+ @Override
+ public void initLaunchConfigAttributes(ILaunchConfigurationWorkingCopy wc, ILaunchSpecification launchSpec) {
+ super.initLaunchConfigAttributes(wc, launchSpec);
+
+ wc.setAttribute(IProcessesStepAttributes.ATTR_STOP_AT_MAIN, true);
+ wc.setAttribute(IProcessesStepAttributes.ATTR_ATTACH_CHILDREN, true);
+ try {
+ wc.setAttribute(ILaunchConfiguration.ATTR_SOURCE_LOCATOR_MEMENTO, CdtUtils.getDefaultSourceLookupDirector().getMemento());
+ IModelNode[] contexts = LaunchContextsPersistenceDelegate.getLaunchContexts(launchSpec);
+ if (contexts != null && contexts.length == 1) {
+ ILaunchConfiguration attachLaunch = (ILaunchConfiguration)Platform.getAdapterManager().getAdapter(contexts[0], ILaunchConfiguration.class);
+ wc.setAttribute("org.eclipse.tcf.debug.PathMap", attachLaunch.getAttribute("org.eclipse.tcf.debug.PathMap", (String)null)); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+ catch (Exception e) {
+ }
+ copySpecToConfig(launchSpec, wc);
+
+ wc.rename(getDefaultLaunchName(wc));
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.launch.core.lm.delegates.DefaultLaunchManagerDelegate#updateLaunchConfig(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy, org.eclipse.tcf.te.launch.core.selection.interfaces.ISelectionContext, boolean)
+ */
+ @Override
+ public void updateLaunchConfig(ILaunchConfigurationWorkingCopy wc, ISelectionContext selContext, boolean replace) {
+ super.updateLaunchConfig(wc, selContext, replace);
+
+ if (selContext instanceof IProjectSelectionContext) {
+ List<IFileTransferItem> transfers;
+ List<IReferencedProjectItem> projects;
+ String processPath;
+ if (replace) {
+ transfers = new ArrayList<IFileTransferItem>();
+ projects = new ArrayList<IReferencedProjectItem>();
+ processPath = getProcessImageAndSetProjectAndTransfer((IProjectSelectionContext)selContext, transfers, projects);
+
+ FileTransfersPersistenceDelegate.setFileTransfers(wc, transfers.toArray(new IFileTransferItem[transfers.size()]));
+ ReferencedProjectsPersistenceDelegate.setReferencedProjects(wc, projects.toArray(new IReferencedProjectItem[projects.size()]));
+ if (processPath != null && processPath.trim().length() > 0) {
+ DefaultPersistenceDelegate.setAttribute(wc, IProcessesStepAttributes.ATTR_PROCESS_IMAGE, processPath);
+ }
+ }
+ else {
+ transfers = new ArrayList<IFileTransferItem>(Arrays.asList(FileTransfersPersistenceDelegate.getFileTransfers(wc)));
+ projects = new ArrayList<IReferencedProjectItem>(Arrays.asList(ReferencedProjectsPersistenceDelegate.getReferencedProjects(wc)));
+ processPath = getProcessImageAndSetProjectAndTransfer((IProjectSelectionContext)selContext, transfers, projects);
+
+ FileTransfersPersistenceDelegate.setFileTransfers(wc, transfers.toArray(new IFileTransferItem[transfers.size()]));
+ ReferencedProjectsPersistenceDelegate.setReferencedProjects(wc, projects.toArray(new IReferencedProjectItem[projects.size()]));
+ if (processPath != null && processPath.trim().length() > 0 && !DefaultPersistenceDelegate.hasAttribute(wc, IProcessesStepAttributes.ATTR_PROCESS_IMAGE)) {
+ DefaultPersistenceDelegate.setAttribute(wc, IProcessesStepAttributes.ATTR_PROCESS_IMAGE, processPath);
+ }
+ }
+ }
+ else if (selContext instanceof IRemoteSelectionContext) {
+ IRemoteSelectionContext remoteCtx = (IRemoteSelectionContext)selContext;
+ LaunchContextsPersistenceDelegate.setLaunchContexts(wc, new IModelNode[]{remoteCtx.getRemoteCtx()});
+ }
+
+ wc.rename(getDefaultLaunchName(wc));
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.launch.core.lm.delegates.DefaultLaunchManagerDelegate#addLaunchSpecAttributes(org.eclipse.tcf.te.launch.core.lm.interfaces.ILaunchSpecification, java.lang.String, org.eclipse.tcf.te.launch.core.selection.interfaces.ISelectionContext)
+ */
+ @Override
+ protected ILaunchSpecification addLaunchSpecAttributes(ILaunchSpecification launchSpec, String launchConfigTypeId, ISelectionContext selectionContext) {
+ launchSpec = super.addLaunchSpecAttributes(launchSpec, launchConfigTypeId, selectionContext);
+
+ if (selectionContext instanceof IRemoteSelectionContext) {
+ List<IModelNode> launchContexts = new ArrayList<IModelNode>(Arrays.asList(LaunchContextsPersistenceDelegate.getLaunchContexts(launchSpec)));
+ IModelNode remoteCtx = ((IRemoteSelectionContext)selectionContext).getRemoteCtx();
+ if (!launchContexts.contains(remoteCtx)) {
+ launchContexts.add(remoteCtx);
+ LaunchContextsPersistenceDelegate.setLaunchContexts(launchSpec, launchContexts.toArray(new IModelNode[launchContexts.size()]));
+ }
+
+ launchSpec.setLaunchConfigName(getDefaultLaunchName(launchSpec));
+ }
+ else if (selectionContext instanceof IProjectSelectionContext) {
+ List<IFileTransferItem> transfers = new ArrayList<IFileTransferItem>(Arrays.asList(FileTransfersPersistenceDelegate.getFileTransfers(launchSpec)));
+ List<IReferencedProjectItem> projects = new ArrayList<IReferencedProjectItem>(Arrays.asList(ReferencedProjectsPersistenceDelegate.getReferencedProjects(launchSpec)));
+ String processPath = getProcessImageAndSetProjectAndTransfer((IProjectSelectionContext)selectionContext, transfers, projects);
+
+ FileTransfersPersistenceDelegate.setFileTransfers(launchSpec, transfers.toArray(new IFileTransferItem[transfers.size()]));
+ ReferencedProjectsPersistenceDelegate.setReferencedProjects(launchSpec, projects.toArray(new IReferencedProjectItem[projects.size()]));
+ launchSpec.addAttribute(IProcessesStepAttributes.ATTR_PROCESS_IMAGE, processPath);
+
+ launchSpec.setLaunchConfigName(getDefaultLaunchName(launchSpec));
+ }
+
+ return launchSpec;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.launch.core.lm.delegates.DefaultLaunchManagerDelegate#getDefaultLaunchName(org.eclipse.tcf.te.launch.core.lm.interfaces.ILaunchSpecification)
+ */
+ @Override
+ public String getDefaultLaunchName(ILaunchSpecification launchSpec) {
+ IModelNode[] contexts = LaunchContextsPersistenceDelegate.getLaunchContexts(launchSpec);
+ String processPath = (String)launchSpec.getAttribute(IProcessesStepAttributes.ATTR_PROCESS_IMAGE, null);
+ String name = getDefaultLaunchName((contexts != null && contexts.length > 0 ? contexts[0] : null), processPath);
+ return name.trim().length() > 0 ? name.trim() : super.getDefaultLaunchName(launchSpec);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.launch.core.lm.delegates.DefaultLaunchManagerDelegate#getDefaultLaunchName(org.eclipse.debug.core.ILaunchConfiguration)
+ */
+ @Override
+ public String getDefaultLaunchName(ILaunchConfiguration launchConfig) {
+ IModelNode[] contexts = LaunchContextsPersistenceDelegate.getLaunchContexts(launchConfig);
+ String processPath = DefaultPersistenceDelegate.getAttribute(launchConfig, IProcessesStepAttributes.ATTR_PROCESS_IMAGE, (String)null);
+ String name = getDefaultLaunchName((contexts != null && contexts.length > 0 ? contexts[0] : null), processPath);
+ return name.trim().length() > 0 ? name.trim() : super.getDefaultLaunchName(launchConfig);
+ }
+
+ private String getDefaultLaunchName(IModelNode context, String processPath) {
+ String name = ""; //$NON-NLS-1$
+ if (processPath != null) {
+ name += new Path(processPath).lastSegment();
+ }
+ if (context != null) {
+ IPropertiesAccessService service = ServiceManager.getInstance().getService(context, IPropertiesAccessService.class);
+ Object dnsName = service != null ? service.getProperty(context, "dns.name.transient") : null; //$NON-NLS-1$
+ String ctxName = service != null ? (String)service.getTargetAddress(context).get(IPropertiesAccessServiceConstants.PROP_ADDRESS) : null;
+ ctxName = dnsName != null && dnsName.toString().trim().length() > 0 ? dnsName.toString().trim() : ctxName;
+
+ name += " (" + ctxName + ")"; //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ return name.trim();
+ }
+
+ private String getProcessImageAndSetProjectAndTransfer(IProjectSelectionContext prjContext, List<IFileTransferItem> transfers, List<IReferencedProjectItem> projects) {
+ String processName = null;
+ String processPath = null;
+
+ boolean added = false;
+ for (Object selection : prjContext.getSelections()) {
+ if (selection instanceof IPath) {
+ IPath path = (IPath)selection;
+ IFileTransferItem transfer = new FileTransferItem(path, new Path("/tmp/")); //$NON-NLS-1$
+ if (!transfers.contains(transfer)) {
+ transfers.add(transfer);
+ }
+ if (!added) {
+ processName = path.lastSegment();
+ processPath = "/tmp/" + processName; //$NON-NLS-1$
+ }
+ added = true;
+ }
+ }
+
+ IReferencedProjectItem project = new ReferencedProjectItem(prjContext.getProjectCtx().getName());
+ if (!projects.contains(project)) {
+ projects.add(project);
+ }
+
+ return processPath;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.launch.core.lm.delegates.DefaultLaunchManagerDelegate#validate(java.lang.String, org.eclipse.debug.core.ILaunchConfiguration)
+ */
+ @Override
+ public void validate(String launchMode, ILaunchConfiguration launchConfig) throws LaunchServiceException {
+ super.validate(launchMode, launchConfig);
+
+ StringBuilder missingAttributes = new StringBuilder();
+ for (String attribute : MANDATORY_CONFIG_ATTRIBUTES) {
+ if (!isValidAttribute(attribute, launchConfig, launchMode)) {
+ if (missingAttributes.length() == 0) {
+ missingAttributes.append(attribute);
+ } else {
+ missingAttributes.append(", "); //$NON-NLS-1$
+ missingAttributes.append(attribute);
+ }
+ }
+ }
+ if (missingAttributes.length() > 0) {
+ throw new LaunchServiceException("Missing launch configuration attributes: " + '\n' + missingAttributes.toString(), LaunchServiceException.TYPE_MISSING_LAUNCH_CONFIG_ATTR); //$NON-NLS-1$
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.launch.core.lm.delegates.DefaultLaunchManagerDelegate#equals(java.lang.String, java.lang.Object, java.lang.Object, org.eclipse.tcf.te.launch.core.lm.interfaces.ILaunchSpecification, org.eclipse.debug.core.ILaunchConfiguration, java.lang.String)
+ */
+ @Override
+ protected int equals(String attributeKey, Object specValue, Object confValue, ILaunchSpecification launchSpec, ILaunchConfiguration launchConfig, String launchMode) {
+
+ if (IProcessesStepAttributes.ATTR_PROCESS_IMAGE.equals(attributeKey)) {
+ // get match of object
+ int match = specValue.equals(confValue) ? FULL_MATCH : NO_MATCH;
+ // compare objects in the list when they are not already equal
+ if (match != FULL_MATCH) {
+ IPath confPath = new Path(confValue.toString());
+ IPath specPath = new Path(specValue.toString());
+
+ if (confPath.lastSegment().equals(specPath.lastSegment())) {
+ match = PARTIAL_MATCH;
+ }
+ else {
+ match = NO_MATCH;
+ }
+ }
+ return match;
+ }
+
+ return super.equals(attributeKey, specValue, confValue, launchSpec, launchConfig, launchMode);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.launch.core.lm.delegates.DefaultLaunchManagerDelegate#getNumAttributes()
+ */
+ @Override
+ protected int getNumAttributes() {
+ return 8;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.launch.core.lm.delegates.DefaultLaunchManagerDelegate#getAttributeRanking(java.lang.String)
+ */
+ @Override
+ protected int getAttributeRanking(String attributeKey) {
+ if (ILaunchContextLaunchAttributes.ATTR_LAUNCH_CONTEXTS.equals(attributeKey)) {
+ return getNumAttributes() * 256;
+ }
+ else if (IProcessesStepAttributes.ATTR_PROCESS_IMAGE.equals(attributeKey)) {
+ return getNumAttributes() * 128;
+ }
+ else if (IProcessesStepAttributes.ATTR_PROCESS_ARGUMENTS.equals(attributeKey)) {
+ return getNumAttributes() * 64;
+ }
+ else if (IFileTransferLaunchAttributes.ATTR_FILE_TRANSFERS.equals(attributeKey)) {
+ return getNumAttributes() * 32;
+ }
+ else if (IReferencedProjectLaunchAttributes.ATTR_REFERENCED_PROJECTS.equals(attributeKey)) {
+ return getNumAttributes() * 16;
+ }
+ else if (IProcessesStepAttributes.ATTR_STOP_AT_ENTRY.equals(attributeKey)) {
+ return getNumAttributes() * 8;
+ }
+ else if (IProcessesStepAttributes.ATTR_STOP_AT_MAIN.equals(attributeKey)) {
+ return getNumAttributes() * 4;
+ }
+ else if (IProcessesStepAttributes.ATTR_ATTACH_CHILDREN.equals(attributeKey)) {
+ return getNumAttributes() * 2;
+ }
+ else {
+ return 1;
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.launch.core.lm.delegates.DefaultLaunchManagerDelegate#getDescription(org.eclipse.debug.core.ILaunchConfiguration)
+ */
+ @Override
+ public String getDescription(ILaunchConfiguration config) {
+ String image = DefaultPersistenceDelegate.getAttribute(config, IProcessesStepAttributes.ATTR_PROCESS_IMAGE, (String)null);
+ String args = DefaultPersistenceDelegate.getAttribute(config, IProcessesStepAttributes.ATTR_PROCESS_ARGUMENTS, ""); //$NON-NLS-1$
+ if (image != null) {
+ return new Path(image).toPortableString() + " " + args; //$NON-NLS-1$
+ }
+ return ""; //$NON-NLS-1$
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/nls/Messages.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/nls/Messages.java
index b69b7bb1e..513446a6f 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/nls/Messages.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/nls/Messages.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Wind River Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2011, 2013 Wind River Systems, Inc. and others. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/steps/AbstractTcfLaunchStep.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/steps/AbstractTcfLaunchStep.java
index 2f19954b6..9b5b73147 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/steps/AbstractTcfLaunchStep.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/steps/AbstractTcfLaunchStep.java
@@ -1,45 +1,45 @@
-/*******************************************************************************
- * Copyright (c) 2012 Wind River Systems, Inc. and others. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.tcf.te.tcf.launch.core.steps;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.tcf.te.launch.core.steps.AbstractLaunchStep;
-import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
-
-/**
- * Abstract TCF launch step implementation.
- */
-public abstract class AbstractTcfLaunchStep extends AbstractLaunchStep {
-
- /**
- * Returns the active peer model context that is currently used.
- *
- * @param context The step context. Must not be <code>null</code>.
- * @param data The data giving object. Must not be <code>null</code>.
- * @param fullQualifiedId The full qualfied id for this step. Must not be <code>null</code>.
- * @return The active peer model context.
- */
- protected IPeerModel getActivePeerModelContext(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId) {
- Object activeContext = getActiveContext(context, data, fullQualifiedId);
- IPeerModel peerModel = null;
- if (activeContext instanceof IPeerModel)
- return (IPeerModel)activeContext;
- if (activeContext instanceof IAdaptable)
- peerModel = (IPeerModel)((IAdaptable)activeContext).getAdapter(IPeerModel.class);
- if (peerModel == null)
- peerModel = (IPeerModel)Platform.getAdapterManager().getAdapter(activeContext, IPeerModel.class);
-
- return peerModel;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2012, 2013 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.tcf.launch.core.steps;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.tcf.te.launch.core.steps.AbstractLaunchStep;
+import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
+
+/**
+ * Abstract TCF launch step implementation.
+ */
+public abstract class AbstractTcfLaunchStep extends AbstractLaunchStep {
+
+ /**
+ * Returns the active peer model context that is currently used.
+ *
+ * @param context The step context. Must not be <code>null</code>.
+ * @param data The data giving object. Must not be <code>null</code>.
+ * @param fullQualifiedId The full qualfied id for this step. Must not be <code>null</code>.
+ * @return The active peer model context.
+ */
+ protected IPeerModel getActivePeerModelContext(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId) {
+ Object activeContext = getActiveContext(context, data, fullQualifiedId);
+ IPeerModel peerModel = null;
+ if (activeContext instanceof IPeerModel)
+ return (IPeerModel)activeContext;
+ if (activeContext instanceof IAdaptable)
+ peerModel = (IPeerModel)((IAdaptable)activeContext).getAdapter(IPeerModel.class);
+ if (peerModel == null)
+ peerModel = (IPeerModel)Platform.getAdapterManager().getAdapter(activeContext, IPeerModel.class);
+
+ return peerModel;
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/steps/AttachDebuggerStep.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/steps/AttachDebuggerStep.java
index afb5c2a32..425c76b69 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/steps/AttachDebuggerStep.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/steps/AttachDebuggerStep.java
@@ -1,65 +1,65 @@
-/*******************************************************************************
- * Copyright (c) 2012 Wind River Systems, Inc. and others. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.tcf.te.tcf.launch.core.steps;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.tcf.protocol.Protocol;
-import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
-import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
-import org.eclipse.tcf.te.runtime.utils.StatusHelper;
-import org.eclipse.tcf.te.tcf.launch.core.delegates.Launch;
-
-/**
- * Attach debugger step implementation.
- */
-public class AttachDebuggerStep extends AbstractTcfLaunchStep {
-
- /**
- * Constructor.
- */
- public AttachDebuggerStep() {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStep#execute(org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor, org.eclipse.tcf.te.runtime.interfaces.callback.ICallback)
- */
- @Override
- public void execute(final IStepContext context, final IPropertiesContainer data, final IFullQualifiedId fullQualifiedId, final IProgressMonitor monitor, final ICallback callback) {
- if (Protocol.isDispatchThread()) {
- internalExecute(context, data, fullQualifiedId, monitor, callback);
- }
- else {
- Protocol.invokeLater(new Runnable() {
- @Override
- public void run() {
- internalExecute(context, data, fullQualifiedId, monitor, callback);
- }
- });
- }
- }
-
- protected void internalExecute(IStepContext context, final IPropertiesContainer data, final IFullQualifiedId fullQualifiedId, final IProgressMonitor monitor, final ICallback callback) {
- ILaunch launch = getLaunch(context);
- if (launch instanceof Launch) {
- Launch tcfLaunch = (Launch)launch;
- try {
- tcfLaunch.attachDebugger(getActivePeerModelContext(context, data, fullQualifiedId));
- callback.done(this, Status.OK_STATUS);
- }
- catch (Exception e) {
- callback.done(this, StatusHelper.getStatus(e));
- }
- }
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2012, 2013 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.tcf.launch.core.steps;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.tcf.protocol.Protocol;
+import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
+import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
+import org.eclipse.tcf.te.runtime.utils.StatusHelper;
+import org.eclipse.tcf.te.tcf.launch.core.delegates.Launch;
+
+/**
+ * Attach debugger step implementation.
+ */
+public class AttachDebuggerStep extends AbstractTcfLaunchStep {
+
+ /**
+ * Constructor.
+ */
+ public AttachDebuggerStep() {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStep#execute(org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor, org.eclipse.tcf.te.runtime.interfaces.callback.ICallback)
+ */
+ @Override
+ public void execute(final IStepContext context, final IPropertiesContainer data, final IFullQualifiedId fullQualifiedId, final IProgressMonitor monitor, final ICallback callback) {
+ if (Protocol.isDispatchThread()) {
+ internalExecute(context, data, fullQualifiedId, monitor, callback);
+ }
+ else {
+ Protocol.invokeLater(new Runnable() {
+ @Override
+ public void run() {
+ internalExecute(context, data, fullQualifiedId, monitor, callback);
+ }
+ });
+ }
+ }
+
+ protected void internalExecute(IStepContext context, final IPropertiesContainer data, final IFullQualifiedId fullQualifiedId, final IProgressMonitor monitor, final ICallback callback) {
+ ILaunch launch = getLaunch(context);
+ if (launch instanceof Launch) {
+ Launch tcfLaunch = (Launch)launch;
+ try {
+ tcfLaunch.attachDebugger(getActivePeerModelContext(context, data, fullQualifiedId));
+ callback.done(this, Status.OK_STATUS);
+ }
+ catch (Exception e) {
+ callback.done(this, StatusHelper.getStatus(e));
+ }
+ }
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/steps/iterators/AbstractTcfLaunchStepGroupIterator.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/steps/iterators/AbstractTcfLaunchStepGroupIterator.java
index 856a33016..6f0a8b272 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/steps/iterators/AbstractTcfLaunchStepGroupIterator.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/steps/iterators/AbstractTcfLaunchStepGroupIterator.java
@@ -1,46 +1,46 @@
-/*******************************************************************************
- * Copyright (c) 2012 Wind River Systems, Inc. and others. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tcf.te.tcf.launch.core.steps.iterators;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.tcf.te.launch.core.steps.iterators.AbstractLaunchStepGroupIterator;
-import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
-
-/**
- * Abstract TCF launch step group iterator.
- */
-public abstract class AbstractTcfLaunchStepGroupIterator extends AbstractLaunchStepGroupIterator {
-
- /**
- * Returns the active peer model context that is currently used.
- *
- * @param context The step context. Must not be <code>null</code>.
- * @param data The data giving object. Must not be <code>null</code>.
- * @param fullQualifiedId The full qualfied id for this step. Must not be <code>null</code>.
- * @return The active peer model context.
- */
- protected IPeerModel getActivePeerModelContext(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId) {
- Object activeContext = getActiveContext(context, data, fullQualifiedId);
- IPeerModel peerModel = null;
- if (activeContext instanceof IPeerModel)
- return (IPeerModel)activeContext;
- if (activeContext instanceof IAdaptable)
- peerModel = (IPeerModel)((IAdaptable)activeContext).getAdapter(IPeerModel.class);
- if (peerModel == null)
- peerModel = (IPeerModel)Platform.getAdapterManager().getAdapter(activeContext, IPeerModel.class);
-
- return peerModel;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2012, 2013 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.tcf.te.tcf.launch.core.steps.iterators;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.tcf.te.launch.core.steps.iterators.AbstractLaunchStepGroupIterator;
+import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
+
+/**
+ * Abstract TCF launch step group iterator.
+ */
+public abstract class AbstractTcfLaunchStepGroupIterator extends AbstractLaunchStepGroupIterator {
+
+ /**
+ * Returns the active peer model context that is currently used.
+ *
+ * @param context The step context. Must not be <code>null</code>.
+ * @param data The data giving object. Must not be <code>null</code>.
+ * @param fullQualifiedId The full qualfied id for this step. Must not be <code>null</code>.
+ * @return The active peer model context.
+ */
+ protected IPeerModel getActivePeerModelContext(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId) {
+ Object activeContext = getActiveContext(context, data, fullQualifiedId);
+ IPeerModel peerModel = null;
+ if (activeContext instanceof IPeerModel)
+ return (IPeerModel)activeContext;
+ if (activeContext instanceof IAdaptable)
+ peerModel = (IPeerModel)((IAdaptable)activeContext).getAdapter(IPeerModel.class);
+ if (peerModel == null)
+ peerModel = (IPeerModel)Platform.getAdapterManager().getAdapter(activeContext, IPeerModel.class);
+
+ return peerModel;
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/steps/iterators/FileTransferIterator.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/steps/iterators/FileTransferIterator.java
index 39facd55c..a31f8642a 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/steps/iterators/FileTransferIterator.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/steps/iterators/FileTransferIterator.java
@@ -1,54 +1,54 @@
-/*******************************************************************************
- * Copyright (c) 2012 Wind River Systems, Inc. and others. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tcf.te.tcf.launch.core.steps.iterators;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.tcf.te.launch.core.persistence.filetransfer.FileTransfersPersistenceDelegate;
-import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
-import org.eclipse.tcf.te.runtime.services.interfaces.filetransfer.IFileTransferItem;
-import org.eclipse.tcf.te.runtime.stepper.StepperAttributeUtil;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
-import org.eclipse.tcf.te.tcf.filesystem.core.interfaces.steps.IFileSystemStepAttributes;
-
-/**
- * Step group iterator for file transfer.
- */
-public class FileTransferIterator extends AbstractTcfLaunchStepGroupIterator {
-
- private IFileTransferItem[] items = null;
-
- /**
- * Constructor.
- */
- public FileTransferIterator() {
- super();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStepGroupIterator#initialize(org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor)
- */
- @Override
- public void initialize(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor) throws CoreException {
- super.initialize(context, data, fullQualifiedId, monitor);
- items = FileTransfersPersistenceDelegate.getFileTransfers(getLaunchConfiguration(context));
- setIterations(items != null ? items.length : 0);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.stepper.iterators.AbstractStepGroupIterator#internalNext(org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor)
- */
- @Override
- public void internalNext(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor) throws CoreException {
- StepperAttributeUtil.setProperty(IFileSystemStepAttributes.ATTR_FILE_TRANSFER_ITEM, fullQualifiedId, data, items[getIteration()]);
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2012, 2013 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.tcf.te.tcf.launch.core.steps.iterators;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.tcf.te.launch.core.persistence.filetransfer.FileTransfersPersistenceDelegate;
+import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
+import org.eclipse.tcf.te.runtime.services.interfaces.filetransfer.IFileTransferItem;
+import org.eclipse.tcf.te.runtime.stepper.StepperAttributeUtil;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
+import org.eclipse.tcf.te.tcf.filesystem.core.interfaces.steps.IFileSystemStepAttributes;
+
+/**
+ * Step group iterator for file transfer.
+ */
+public class FileTransferIterator extends AbstractTcfLaunchStepGroupIterator {
+
+ private IFileTransferItem[] items = null;
+
+ /**
+ * Constructor.
+ */
+ public FileTransferIterator() {
+ super();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStepGroupIterator#initialize(org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ public void initialize(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor) throws CoreException {
+ super.initialize(context, data, fullQualifiedId, monitor);
+ items = FileTransfersPersistenceDelegate.getFileTransfers(getLaunchConfiguration(context));
+ setIterations(items != null ? items.length : 0);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.stepper.iterators.AbstractStepGroupIterator#internalNext(org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ public void internalNext(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor) throws CoreException {
+ StepperAttributeUtil.setProperty(IFileSystemStepAttributes.ATTR_FILE_TRANSFER_ITEM, fullQualifiedId, data, items[getIteration()]);
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/steps/iterators/LaunchProcessIterator.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/steps/iterators/LaunchProcessIterator.java
index 8ffad1081..7c1e0a8f2 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/steps/iterators/LaunchProcessIterator.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/steps/iterators/LaunchProcessIterator.java
@@ -1,70 +1,70 @@
-/*******************************************************************************
- * Copyright (c) 2012 Wind River Systems, Inc. and others. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tcf.te.tcf.launch.core.steps.iterators;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.tcf.te.launch.core.persistence.DefaultPersistenceDelegate;
-import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
-import org.eclipse.tcf.te.runtime.stepper.StepperAttributeUtil;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
-import org.eclipse.tcf.te.tcf.processes.core.interfaces.steps.IProcessesStepAttributes;
-
-/**
- * Step group iterator for file transfer.
- */
-public class LaunchProcessIterator extends AbstractTcfLaunchStepGroupIterator {
-
- /**
- * Constructor.
- */
- public LaunchProcessIterator() {
- super();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.stepper.iterators.AbstractStepGroupIterator#initialize(org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor)
- */
- @Override
- public void initialize(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor) throws CoreException {
- super.initialize(context, data, fullQualifiedId, monitor);
- setIterations(1);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.stepper.iterators.AbstractStepGroupIterator#internalNext(org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor)
- */
- @Override
- public void internalNext(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor) throws CoreException {
- String processImage = DefaultPersistenceDelegate.getAttribute(getLaunchConfiguration(context), IProcessesStepAttributes.ATTR_PROCESS_IMAGE, (String)null);
- String processArguments = DefaultPersistenceDelegate.getAttribute(getLaunchConfiguration(context), IProcessesStepAttributes.ATTR_PROCESS_ARGUMENTS, (String)null);
-
- boolean isDebug = ILaunchManager.DEBUG_MODE.equals(getLaunchMode(context));
- boolean attachProcess = isDebug;
- boolean stopAtEntry = isDebug && DefaultPersistenceDelegate.getAttribute(getLaunchConfiguration(context), IProcessesStepAttributes.ATTR_STOP_AT_ENTRY, false);
- boolean stopAtMain = isDebug && DefaultPersistenceDelegate.getAttribute(getLaunchConfiguration(context), IProcessesStepAttributes.ATTR_STOP_AT_MAIN, false);
- boolean attachChildren = isDebug && DefaultPersistenceDelegate.getAttribute(getLaunchConfiguration(context), IProcessesStepAttributes.ATTR_ATTACH_CHILDREN, false);
-
- boolean outputConsole = DefaultPersistenceDelegate.getAttribute(getLaunchConfiguration(context), "org.eclipse.debug.ui.ATTR_CONSOLE_OUTPUT_ON", true); //$NON-NLS-1$
- String outputFile = DefaultPersistenceDelegate.getAttribute(getLaunchConfiguration(context), "org.eclipse.debug.ui.ATTR_CAPTURE_IN_FILE", (String)null); //$NON-NLS-1$
-
- StepperAttributeUtil.setProperty(IProcessesStepAttributes.ATTR_PROCESS_IMAGE, fullQualifiedId, data, processImage);
- StepperAttributeUtil.setProperty(IProcessesStepAttributes.ATTR_PROCESS_ARGUMENTS, fullQualifiedId, data, processArguments);
- StepperAttributeUtil.setProperty(IProcessesStepAttributes.ATTR_ATTACH, fullQualifiedId, data, attachProcess);
- StepperAttributeUtil.setProperty(IProcessesStepAttributes.ATTR_ATTACH_CHILDREN, fullQualifiedId, data, attachChildren);
- StepperAttributeUtil.setProperty(IProcessesStepAttributes.ATTR_STOP_AT_ENTRY, fullQualifiedId, data, stopAtEntry);
- StepperAttributeUtil.setProperty(IProcessesStepAttributes.ATTR_STOP_AT_MAIN, fullQualifiedId, data, stopAtMain);
- StepperAttributeUtil.setProperty(IProcessesStepAttributes.ATTR_OUTPUT_CONSOLE, fullQualifiedId, data, outputConsole);
- StepperAttributeUtil.setProperty(IProcessesStepAttributes.ATTR_OUTPUT_FILE, fullQualifiedId, data, outputFile);
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2012, 2013 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.tcf.te.tcf.launch.core.steps.iterators;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.tcf.te.launch.core.persistence.DefaultPersistenceDelegate;
+import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
+import org.eclipse.tcf.te.runtime.stepper.StepperAttributeUtil;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
+import org.eclipse.tcf.te.tcf.processes.core.interfaces.steps.IProcessesStepAttributes;
+
+/**
+ * Step group iterator for file transfer.
+ */
+public class LaunchProcessIterator extends AbstractTcfLaunchStepGroupIterator {
+
+ /**
+ * Constructor.
+ */
+ public LaunchProcessIterator() {
+ super();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.stepper.iterators.AbstractStepGroupIterator#initialize(org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ public void initialize(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor) throws CoreException {
+ super.initialize(context, data, fullQualifiedId, monitor);
+ setIterations(1);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.stepper.iterators.AbstractStepGroupIterator#internalNext(org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ public void internalNext(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor) throws CoreException {
+ String processImage = DefaultPersistenceDelegate.getAttribute(getLaunchConfiguration(context), IProcessesStepAttributes.ATTR_PROCESS_IMAGE, (String)null);
+ String processArguments = DefaultPersistenceDelegate.getAttribute(getLaunchConfiguration(context), IProcessesStepAttributes.ATTR_PROCESS_ARGUMENTS, (String)null);
+
+ boolean isDebug = ILaunchManager.DEBUG_MODE.equals(getLaunchMode(context));
+ boolean attachProcess = isDebug;
+ boolean stopAtEntry = isDebug && DefaultPersistenceDelegate.getAttribute(getLaunchConfiguration(context), IProcessesStepAttributes.ATTR_STOP_AT_ENTRY, false);
+ boolean stopAtMain = isDebug && DefaultPersistenceDelegate.getAttribute(getLaunchConfiguration(context), IProcessesStepAttributes.ATTR_STOP_AT_MAIN, false);
+ boolean attachChildren = isDebug && DefaultPersistenceDelegate.getAttribute(getLaunchConfiguration(context), IProcessesStepAttributes.ATTR_ATTACH_CHILDREN, false);
+
+ boolean outputConsole = DefaultPersistenceDelegate.getAttribute(getLaunchConfiguration(context), "org.eclipse.debug.ui.ATTR_CONSOLE_OUTPUT_ON", true); //$NON-NLS-1$
+ String outputFile = DefaultPersistenceDelegate.getAttribute(getLaunchConfiguration(context), "org.eclipse.debug.ui.ATTR_CAPTURE_IN_FILE", (String)null); //$NON-NLS-1$
+
+ StepperAttributeUtil.setProperty(IProcessesStepAttributes.ATTR_PROCESS_IMAGE, fullQualifiedId, data, processImage);
+ StepperAttributeUtil.setProperty(IProcessesStepAttributes.ATTR_PROCESS_ARGUMENTS, fullQualifiedId, data, processArguments);
+ StepperAttributeUtil.setProperty(IProcessesStepAttributes.ATTR_ATTACH, fullQualifiedId, data, attachProcess);
+ StepperAttributeUtil.setProperty(IProcessesStepAttributes.ATTR_ATTACH_CHILDREN, fullQualifiedId, data, attachChildren);
+ StepperAttributeUtil.setProperty(IProcessesStepAttributes.ATTR_STOP_AT_ENTRY, fullQualifiedId, data, stopAtEntry);
+ StepperAttributeUtil.setProperty(IProcessesStepAttributes.ATTR_STOP_AT_MAIN, fullQualifiedId, data, stopAtMain);
+ StepperAttributeUtil.setProperty(IProcessesStepAttributes.ATTR_OUTPUT_CONSOLE, fullQualifiedId, data, outputConsole);
+ StepperAttributeUtil.setProperty(IProcessesStepAttributes.ATTR_OUTPUT_FILE, fullQualifiedId, data, outputFile);
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/plugin.properties b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/plugin.properties
index 3d563eb11..0e01c655b 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/plugin.properties
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/plugin.properties
@@ -1,5 +1,5 @@
##################################################################################
-# Copyright (c) 2011, 2012 Wind River Systems, Inc. and others. All rights reserved.
+# Copyright (c) 2011, 2013 Wind River Systems, Inc. and others. All rights reserved.
# This program and the accompanying materials are made available under the terms
# of the Eclipse Public License v1.0 which accompanies this distribution, and is
# available at http://www.eclipse.org/legal/epl-v10.html
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/activator/UIPlugin.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/activator/UIPlugin.java
index 62bc02758..fc78f3040 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/activator/UIPlugin.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/activator/UIPlugin.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Wind River Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2011, 2013 Wind River Systems, Inc. and others. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/AbstractTcfLaunchTabContainerEditorPage.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/AbstractTcfLaunchTabContainerEditorPage.java
index c0a9310ea..d86f6d796 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/AbstractTcfLaunchTabContainerEditorPage.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/AbstractTcfLaunchTabContainerEditorPage.java
@@ -1,284 +1,284 @@
-/*******************************************************************************
- * Copyright (c) 2012 Wind River Systems, Inc. and others. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.tcf.te.tcf.launch.ui.editor;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationListener;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.tcf.te.launch.ui.editor.AbstractLaunchTabContainerEditorPage;
-import org.eclipse.tcf.te.runtime.concurrent.util.ExecutorsUtil;
-import org.eclipse.tcf.te.runtime.persistence.PersistenceManager;
-import org.eclipse.tcf.te.runtime.persistence.interfaces.IPersistenceDelegate;
-import org.eclipse.tcf.te.runtime.services.ServiceManager;
-import org.eclipse.tcf.te.runtime.services.interfaces.IPropertiesAccessService;
-import org.eclipse.tcf.te.tcf.launch.ui.activator.UIPlugin;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
-
-/**
- * TCF launch configuration tab container page implementation.
- */
-public abstract class AbstractTcfLaunchTabContainerEditorPage extends AbstractLaunchTabContainerEditorPage implements ILaunchConfigurationListener {
-
- protected ILaunchConfigurationListener launchConfigListener = null;
-
- protected static final String PROP_LAUNCH_CONFIG_WC = "launchConfigWorkingCopy.transient.silent"; //$NON-NLS-1$
- protected static final String PROP_ORIGINAL_LAUNCH_CONFIG_ATTRIBUTES = "launchConfigAttributes.transient.silent"; //$NON-NLS-1$
-
- /**
- * Get the peer model from the editor input.
- *
- * @param input The editor input.
- * @return The peer model.
- */
- public IPeerModel getPeerModel(Object input) {
- return (IPeerModel) ((IAdaptable) input).getAdapter(IPeerModel.class);
- }
-
- /*
- * (non-Javadoc)
- * @see
- * org.eclipse.tcf.te.launch.ui.editor.AbstractLaunchTabContainerEditorPage#hasApplyAction()
- */
- @Override
- protected boolean hasApplyAction() {
- return !isAutoSave();
- }
-
- private boolean isAutoSave() {
- boolean autoSave = !UIPlugin.getDefault().getPreferenceStore().getBoolean("NoLaunchEditorTabAutoSave"); //$NON-NLS-1$
- return autoSave;
- }
-
- /**
- * Get the launch configuration from the peer model.
- *
- * @param peerModel The peer model.
- * @return The launch configuration.
- */
- public static ILaunchConfigurationWorkingCopy getLaunchConfig(final IPeerModel peerModel) {
- ILaunchConfigurationWorkingCopy wc = null;
- if (peerModel != null) {
- IPropertiesAccessService service = ServiceManager.getInstance()
- .getService(peerModel, IPropertiesAccessService.class);
- Assert.isNotNull(service);
- if (service.getProperty(peerModel, PROP_LAUNCH_CONFIG_WC) instanceof ILaunchConfigurationWorkingCopy) {
- wc = (ILaunchConfigurationWorkingCopy) service
- .getProperty(peerModel, PROP_LAUNCH_CONFIG_WC);
- }
- else {
- wc = (ILaunchConfigurationWorkingCopy) Platform.getAdapterManager()
- .getAdapter(peerModel, ILaunchConfigurationWorkingCopy.class);
- if (wc == null) {
- wc = (ILaunchConfigurationWorkingCopy) Platform
- .getAdapterManager()
- .loadAdapter(peerModel, "org.eclipse.debug.core.ILaunchConfigurationWorkingCopy"); //$NON-NLS-1$
- }
- Assert.isNotNull(wc);
- service.setProperty(peerModel, PROP_LAUNCH_CONFIG_WC, wc);
- IPersistenceDelegate delegate = PersistenceManager.getInstance()
- .getDelegate(wc, String.class);
- String launchConfigAttributes = null;
- try {
- launchConfigAttributes = delegate != null ? (String) delegate
- .write(wc, String.class) : null;
- }
- catch (Exception e) {
- /* ignored on purpose */
- }
- service.setProperty(peerModel, PROP_ORIGINAL_LAUNCH_CONFIG_ATTRIBUTES, launchConfigAttributes);
- }
- }
- return wc;
- }
-
- /*
- * (non-Javadoc)
- * @see
- * org.eclipse.tcf.te.launch.ui.editor.AbstractLaunchTabContainerEditorPage#setupData(java.lang
- * .Object)
- */
- @Override
- public boolean setupData(Object input) {
- ILaunchConfigurationWorkingCopy wc = getLaunchConfig(getPeerModel(input));
- if (wc != null) {
- getLaunchConfigurationTab().initializeFrom(wc);
- checkLaunchConfigDirty();
- return true;
- }
- return false;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.tcf.te.launch.ui.editor.AbstractLaunchTabContainerEditorPage#extractData()
- */
- @Override
- public boolean extractData() {
- if (isAutoSave()) {
- return false;
- }
- ILaunchConfigurationWorkingCopy wc = getLaunchConfig(getPeerModel(getEditorInput()));
- if (wc != null && checkLaunchConfigDirty()) {
- getLaunchConfigurationTab().performApply(wc);
- try {
- wc.doSave();
- IPeerModel peerModel = getPeerModel(getEditorInput());
- IPropertiesAccessService service = ServiceManager.getInstance()
- .getService(peerModel, IPropertiesAccessService.class);
- Assert.isNotNull(service);
- service.setProperty(peerModel, PROP_LAUNCH_CONFIG_WC, null);
- checkLaunchConfigDirty();
- return true;
- }
- catch (Exception e) {
- }
- }
- return false;
- }
-
- /**
- * Check if the launch configuration has changed. If it has changed, the page is set dirty.
- *
- * @return <code>true</code> if the launch configuration has changed since last save.
- */
- public boolean checkLaunchConfigDirty() {
- boolean dirty = false;
- IPeerModel peerModel = getPeerModel(getEditorInput());
- IPropertiesAccessService service = ServiceManager.getInstance()
- .getService(peerModel, IPropertiesAccessService.class);
- String oldLaunchConfigAttributes = (String) service
- .getProperty(peerModel, PROP_ORIGINAL_LAUNCH_CONFIG_ATTRIBUTES);
- IPersistenceDelegate delegate = PersistenceManager.getInstance()
- .getDelegate(getLaunchConfig(peerModel), String.class);
- String launchConfigAttributes = null;
- try {
- launchConfigAttributes = (String) delegate
- .write(getLaunchConfig(peerModel), String.class);
- dirty = !launchConfigAttributes.equals(oldLaunchConfigAttributes);
- }
- catch (Exception e) {
- }
- setDirty(dirty);
- return dirty;
- }
-
- /*
- * (non-Javadoc)
- * @see
- * org.eclipse.tcf.te.launch.ui.editor.AbstractLaunchTabContainerEditorPage#setDirty(boolean)
- */
- @Override
- public void setDirty(boolean dirty) {
- if (isAutoSave()) {
- ILaunchConfigurationWorkingCopy wc = getLaunchConfig(getPeerModel(getEditorInput()));
- if (wc != null && dirty) {
- try {
- wc.doSave();
- IPeerModel peerModel = getPeerModel(getEditorInput());
- IPropertiesAccessService service = ServiceManager.getInstance()
- .getService(peerModel, IPropertiesAccessService.class);
- service.setProperty(peerModel, PROP_LAUNCH_CONFIG_WC, null);
- }
- catch (Exception e) {
- }
- }
- }
- else {
- super.setDirty(dirty);
- ExecutorsUtil.executeInUI(new Runnable() {
- @Override
- public void run() {
- getManagedForm().dirtyStateChanged();
- }
- });
- }
- }
-
- /*
- * (non-Javadoc)
- * @see
- * org.eclipse.tcf.te.launch.ui.editor.AbstractLaunchTabContainerEditorPage#setActive(boolean)
- */
- @Override
- public void setActive(boolean active) {
- super.setActive(active);
- if (active && launchConfigListener == null) {
- launchConfigListener = this;
- DebugPlugin.getDefault().getLaunchManager().addLaunchConfigurationListener(this);
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.tcf.te.launch.ui.editor.AbstractLaunchTabContainerEditorPage#dispose()
- */
- @Override
- public void dispose() {
- super.dispose();
- IPeerModel peerModel = getPeerModel(getEditorInput());
- IPropertiesAccessService service = ServiceManager.getInstance()
- .getService(peerModel, IPropertiesAccessService.class);
- service.setProperty(peerModel, PROP_ORIGINAL_LAUNCH_CONFIG_ATTRIBUTES, null);
- service.setProperty(peerModel, PROP_LAUNCH_CONFIG_WC, null);
- DebugPlugin.getDefault().getLaunchManager().removeLaunchConfigurationListener(this);
- launchConfigListener = null;
- }
-
- /*
- * (non-Javadoc)
- * @see
- * org.eclipse.debug.core.ILaunchConfigurationListener#launchConfigurationAdded(org.eclipse.
- * debug.core.ILaunchConfiguration)
- */
- @Override
- public void launchConfigurationAdded(ILaunchConfiguration configuration) {
- }
-
- /*
- * (non-Javadoc)
- * @see
- * org.eclipse.debug.core.ILaunchConfigurationListener#launchConfigurationRemoved(org.eclipse
- * .debug.core.ILaunchConfiguration)
- */
- @Override
- public void launchConfigurationRemoved(ILaunchConfiguration configuration) {
- }
-
- /*
- * (non-Javadoc)
- * @see
- * org.eclipse.debug.core.ILaunchConfigurationListener#launchConfigurationChanged(org.eclipse
- * .debug.core.ILaunchConfiguration)
- */
- @Override
- public void launchConfigurationChanged(ILaunchConfiguration configuration) {
- if (!(configuration instanceof ILaunchConfigurationWorkingCopy)) {
- IPeerModel peerModel = getPeerModel(getEditorInput());
- IPropertiesAccessService service = ServiceManager.getInstance()
- .getService(peerModel, IPropertiesAccessService.class);
- ILaunchConfigurationWorkingCopy wc = (ILaunchConfigurationWorkingCopy) service
- .getProperty(peerModel, PROP_LAUNCH_CONFIG_WC);
- if (wc != null && configuration.getName().equals(wc.getName())) {
- service.setProperty(peerModel, PROP_ORIGINAL_LAUNCH_CONFIG_ATTRIBUTES, null);
- service.setProperty(peerModel, PROP_LAUNCH_CONFIG_WC, null);
- ExecutorsUtil.executeInUI(new Runnable() {
- @Override
- public void run() {
- setActive(isActive());
- }
- });
- }
- }
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2012, 2013 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.tcf.launch.ui.editor;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationListener;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.tcf.te.launch.ui.editor.AbstractLaunchTabContainerEditorPage;
+import org.eclipse.tcf.te.runtime.concurrent.util.ExecutorsUtil;
+import org.eclipse.tcf.te.runtime.persistence.PersistenceManager;
+import org.eclipse.tcf.te.runtime.persistence.interfaces.IPersistenceDelegate;
+import org.eclipse.tcf.te.runtime.services.ServiceManager;
+import org.eclipse.tcf.te.runtime.services.interfaces.IPropertiesAccessService;
+import org.eclipse.tcf.te.tcf.launch.ui.activator.UIPlugin;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
+
+/**
+ * TCF launch configuration tab container page implementation.
+ */
+public abstract class AbstractTcfLaunchTabContainerEditorPage extends AbstractLaunchTabContainerEditorPage implements ILaunchConfigurationListener {
+
+ protected ILaunchConfigurationListener launchConfigListener = null;
+
+ protected static final String PROP_LAUNCH_CONFIG_WC = "launchConfigWorkingCopy.transient.silent"; //$NON-NLS-1$
+ protected static final String PROP_ORIGINAL_LAUNCH_CONFIG_ATTRIBUTES = "launchConfigAttributes.transient.silent"; //$NON-NLS-1$
+
+ /**
+ * Get the peer model from the editor input.
+ *
+ * @param input The editor input.
+ * @return The peer model.
+ */
+ public IPeerModel getPeerModel(Object input) {
+ return (IPeerModel) ((IAdaptable) input).getAdapter(IPeerModel.class);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.tcf.te.launch.ui.editor.AbstractLaunchTabContainerEditorPage#hasApplyAction()
+ */
+ @Override
+ protected boolean hasApplyAction() {
+ return !isAutoSave();
+ }
+
+ private boolean isAutoSave() {
+ boolean autoSave = !UIPlugin.getDefault().getPreferenceStore().getBoolean("NoLaunchEditorTabAutoSave"); //$NON-NLS-1$
+ return autoSave;
+ }
+
+ /**
+ * Get the launch configuration from the peer model.
+ *
+ * @param peerModel The peer model.
+ * @return The launch configuration.
+ */
+ public static ILaunchConfigurationWorkingCopy getLaunchConfig(final IPeerModel peerModel) {
+ ILaunchConfigurationWorkingCopy wc = null;
+ if (peerModel != null) {
+ IPropertiesAccessService service = ServiceManager.getInstance()
+ .getService(peerModel, IPropertiesAccessService.class);
+ Assert.isNotNull(service);
+ if (service.getProperty(peerModel, PROP_LAUNCH_CONFIG_WC) instanceof ILaunchConfigurationWorkingCopy) {
+ wc = (ILaunchConfigurationWorkingCopy) service
+ .getProperty(peerModel, PROP_LAUNCH_CONFIG_WC);
+ }
+ else {
+ wc = (ILaunchConfigurationWorkingCopy) Platform.getAdapterManager()
+ .getAdapter(peerModel, ILaunchConfigurationWorkingCopy.class);
+ if (wc == null) {
+ wc = (ILaunchConfigurationWorkingCopy) Platform
+ .getAdapterManager()
+ .loadAdapter(peerModel, "org.eclipse.debug.core.ILaunchConfigurationWorkingCopy"); //$NON-NLS-1$
+ }
+ Assert.isNotNull(wc);
+ service.setProperty(peerModel, PROP_LAUNCH_CONFIG_WC, wc);
+ IPersistenceDelegate delegate = PersistenceManager.getInstance()
+ .getDelegate(wc, String.class);
+ String launchConfigAttributes = null;
+ try {
+ launchConfigAttributes = delegate != null ? (String) delegate
+ .write(wc, String.class) : null;
+ }
+ catch (Exception e) {
+ /* ignored on purpose */
+ }
+ service.setProperty(peerModel, PROP_ORIGINAL_LAUNCH_CONFIG_ATTRIBUTES, launchConfigAttributes);
+ }
+ }
+ return wc;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.tcf.te.launch.ui.editor.AbstractLaunchTabContainerEditorPage#setupData(java.lang
+ * .Object)
+ */
+ @Override
+ public boolean setupData(Object input) {
+ ILaunchConfigurationWorkingCopy wc = getLaunchConfig(getPeerModel(input));
+ if (wc != null) {
+ getLaunchConfigurationTab().initializeFrom(wc);
+ checkLaunchConfigDirty();
+ return true;
+ }
+ return false;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.tcf.te.launch.ui.editor.AbstractLaunchTabContainerEditorPage#extractData()
+ */
+ @Override
+ public boolean extractData() {
+ if (isAutoSave()) {
+ return false;
+ }
+ ILaunchConfigurationWorkingCopy wc = getLaunchConfig(getPeerModel(getEditorInput()));
+ if (wc != null && checkLaunchConfigDirty()) {
+ getLaunchConfigurationTab().performApply(wc);
+ try {
+ wc.doSave();
+ IPeerModel peerModel = getPeerModel(getEditorInput());
+ IPropertiesAccessService service = ServiceManager.getInstance()
+ .getService(peerModel, IPropertiesAccessService.class);
+ Assert.isNotNull(service);
+ service.setProperty(peerModel, PROP_LAUNCH_CONFIG_WC, null);
+ checkLaunchConfigDirty();
+ return true;
+ }
+ catch (Exception e) {
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Check if the launch configuration has changed. If it has changed, the page is set dirty.
+ *
+ * @return <code>true</code> if the launch configuration has changed since last save.
+ */
+ public boolean checkLaunchConfigDirty() {
+ boolean dirty = false;
+ IPeerModel peerModel = getPeerModel(getEditorInput());
+ IPropertiesAccessService service = ServiceManager.getInstance()
+ .getService(peerModel, IPropertiesAccessService.class);
+ String oldLaunchConfigAttributes = (String) service
+ .getProperty(peerModel, PROP_ORIGINAL_LAUNCH_CONFIG_ATTRIBUTES);
+ IPersistenceDelegate delegate = PersistenceManager.getInstance()
+ .getDelegate(getLaunchConfig(peerModel), String.class);
+ String launchConfigAttributes = null;
+ try {
+ launchConfigAttributes = (String) delegate
+ .write(getLaunchConfig(peerModel), String.class);
+ dirty = !launchConfigAttributes.equals(oldLaunchConfigAttributes);
+ }
+ catch (Exception e) {
+ }
+ setDirty(dirty);
+ return dirty;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.tcf.te.launch.ui.editor.AbstractLaunchTabContainerEditorPage#setDirty(boolean)
+ */
+ @Override
+ public void setDirty(boolean dirty) {
+ if (isAutoSave()) {
+ ILaunchConfigurationWorkingCopy wc = getLaunchConfig(getPeerModel(getEditorInput()));
+ if (wc != null && dirty) {
+ try {
+ wc.doSave();
+ IPeerModel peerModel = getPeerModel(getEditorInput());
+ IPropertiesAccessService service = ServiceManager.getInstance()
+ .getService(peerModel, IPropertiesAccessService.class);
+ service.setProperty(peerModel, PROP_LAUNCH_CONFIG_WC, null);
+ }
+ catch (Exception e) {
+ }
+ }
+ }
+ else {
+ super.setDirty(dirty);
+ ExecutorsUtil.executeInUI(new Runnable() {
+ @Override
+ public void run() {
+ getManagedForm().dirtyStateChanged();
+ }
+ });
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.tcf.te.launch.ui.editor.AbstractLaunchTabContainerEditorPage#setActive(boolean)
+ */
+ @Override
+ public void setActive(boolean active) {
+ super.setActive(active);
+ if (active && launchConfigListener == null) {
+ launchConfigListener = this;
+ DebugPlugin.getDefault().getLaunchManager().addLaunchConfigurationListener(this);
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.tcf.te.launch.ui.editor.AbstractLaunchTabContainerEditorPage#dispose()
+ */
+ @Override
+ public void dispose() {
+ super.dispose();
+ IPeerModel peerModel = getPeerModel(getEditorInput());
+ IPropertiesAccessService service = ServiceManager.getInstance()
+ .getService(peerModel, IPropertiesAccessService.class);
+ service.setProperty(peerModel, PROP_ORIGINAL_LAUNCH_CONFIG_ATTRIBUTES, null);
+ service.setProperty(peerModel, PROP_LAUNCH_CONFIG_WC, null);
+ DebugPlugin.getDefault().getLaunchManager().removeLaunchConfigurationListener(this);
+ launchConfigListener = null;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.debug.core.ILaunchConfigurationListener#launchConfigurationAdded(org.eclipse.
+ * debug.core.ILaunchConfiguration)
+ */
+ @Override
+ public void launchConfigurationAdded(ILaunchConfiguration configuration) {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.debug.core.ILaunchConfigurationListener#launchConfigurationRemoved(org.eclipse
+ * .debug.core.ILaunchConfiguration)
+ */
+ @Override
+ public void launchConfigurationRemoved(ILaunchConfiguration configuration) {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.debug.core.ILaunchConfigurationListener#launchConfigurationChanged(org.eclipse
+ * .debug.core.ILaunchConfiguration)
+ */
+ @Override
+ public void launchConfigurationChanged(ILaunchConfiguration configuration) {
+ if (!(configuration instanceof ILaunchConfigurationWorkingCopy)) {
+ IPeerModel peerModel = getPeerModel(getEditorInput());
+ IPropertiesAccessService service = ServiceManager.getInstance()
+ .getService(peerModel, IPropertiesAccessService.class);
+ ILaunchConfigurationWorkingCopy wc = (ILaunchConfigurationWorkingCopy) service
+ .getProperty(peerModel, PROP_LAUNCH_CONFIG_WC);
+ if (wc != null && configuration.getName().equals(wc.getName())) {
+ service.setProperty(peerModel, PROP_ORIGINAL_LAUNCH_CONFIG_ATTRIBUTES, null);
+ service.setProperty(peerModel, PROP_LAUNCH_CONFIG_WC, null);
+ ExecutorsUtil.executeInUI(new Runnable() {
+ @Override
+ public void run() {
+ setActive(isActive());
+ }
+ });
+ }
+ }
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/tabs/MemoryMapTab.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/tabs/MemoryMapTab.java
index 82c0a0833..ac04d4f50 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/tabs/MemoryMapTab.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/tabs/MemoryMapTab.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Wind River Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2012, 2013 Wind River Systems, Inc. and others. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/tabs/PathMapTab.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/tabs/PathMapTab.java
index 3565e154d..3ec23500b 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/tabs/PathMapTab.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/tabs/PathMapTab.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Wind River Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2012, 2013 Wind River Systems, Inc. and others. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/tabs/TableUtils.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/tabs/TableUtils.java
index a4a67a7c2..932834cb7 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/tabs/TableUtils.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/tabs/TableUtils.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Wind River Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2012, 2013 Wind River Systems, Inc. and others. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/filetransfer/AddEditFileTransferDialog.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/filetransfer/AddEditFileTransferDialog.java
index e307eac4e..3326315a4 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/filetransfer/AddEditFileTransferDialog.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/filetransfer/AddEditFileTransferDialog.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Wind River Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2012, 2013 Wind River Systems, Inc. and others. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/internal/services/DebugService.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/internal/services/DebugService.java
index e6ac0f6e0..c461a4b5b 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/internal/services/DebugService.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/internal/services/DebugService.java
@@ -1,191 +1,191 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Wind River Systems, Inc. and others. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.tcf.te.tcf.launch.ui.internal.services;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationType;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.core.ILaunchesListener;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.tcf.protocol.Protocol;
-import org.eclipse.tcf.te.launch.core.lm.LaunchManager;
-import org.eclipse.tcf.te.launch.core.lm.interfaces.ILaunchManagerDelegate;
-import org.eclipse.tcf.te.launch.core.lm.interfaces.ILaunchSpecification;
-import org.eclipse.tcf.te.launch.core.persistence.launchcontext.LaunchContextsPersistenceDelegate;
-import org.eclipse.tcf.te.launch.core.selection.LaunchSelection;
-import org.eclipse.tcf.te.launch.core.selection.RemoteSelectionContext;
-import org.eclipse.tcf.te.launch.core.selection.interfaces.ILaunchSelection;
-import org.eclipse.tcf.te.runtime.concurrent.util.ExecutorsUtil;
-import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
-import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
-import org.eclipse.tcf.te.runtime.model.interfaces.IModelNode;
-import org.eclipse.tcf.te.runtime.services.AbstractService;
-import org.eclipse.tcf.te.runtime.services.interfaces.IDebugService;
-import org.eclipse.tcf.te.runtime.utils.StatusHelper;
-import org.eclipse.tcf.te.tcf.launch.core.interfaces.ILaunchTypes;
-
-/**
- * Debug service implementations for TCF contexts.
- */
-public class DebugService extends AbstractService implements IDebugService {
- // Reference to the launches listener
- private final ILaunchesListener listener;
-
- /**
- * Constructor
- */
- public DebugService() {
- super();
-
- // Create and register the launches listener instance
- listener = new DebugServicesLaunchesListener();
- DebugPlugin.getDefault().getLaunchManager().addLaunchListener(listener);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.services.interfaces.IDebugService#attach(java.lang.Object, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.core.runtime.IProgressMonitor, org.eclipse.tcf.te.runtime.interfaces.callback.ICallback)
- */
- @Override
- public void attach(final Object context, final IPropertiesContainer data, final IProgressMonitor monitor, final ICallback callback) {
- if (!Protocol.isDispatchThread()) {
- internalAttach(context, data, monitor, callback);
- }
- else {
- ExecutorsUtil.execute(new Runnable() {
- @Override
- public void run() {
- internalAttach(context, data, monitor, callback);
- }
- });
- }
- }
-
- protected void internalAttach(final Object context, final IPropertiesContainer data, final IProgressMonitor monitor, final ICallback callback) {
- Assert.isTrue(!Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
-
- Assert.isNotNull(context);
- Assert.isNotNull(data);
- Assert.isNotNull(callback);
-
- if (context instanceof IModelNode) {
- ILaunchConfigurationType launchConfigType = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationType(ILaunchTypes.ATTACH);
- try {
- ILaunchSelection launchSelection = new LaunchSelection(ILaunchManager.DEBUG_MODE, new RemoteSelectionContext((IModelNode)context, true));
- ILaunchManagerDelegate delegate = LaunchManager.getInstance().getLaunchManagerDelegate(launchConfigType, ILaunchManager.DEBUG_MODE);
- if (delegate != null) {
- // create an empty launch configuration specification to initialize all attributes with their default defaults.
- ILaunchSpecification launchSpec = delegate.getLaunchSpecification(launchConfigType.getIdentifier(), launchSelection);
- for (String key : data.getProperties().keySet()) {
- launchSpec.addAttribute(key, data.getProperty(key));
- }
- delegate.validate(launchSpec);
- if (launchSpec != null && launchSpec.isValid()) {
- ILaunchConfiguration[] launchConfigs = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurations(launchConfigType);
- launchConfigs = delegate.getMatchingLaunchConfigurations(launchSpec, launchConfigs);
-
- ILaunchConfiguration config = launchConfigs != null && launchConfigs.length > 0 ? launchConfigs[0] : null;
-
- boolean skip = false;
- if (config != null) {
-
- ILaunch[] launches = DebugPlugin.getDefault().getLaunchManager().getLaunches();
- for (ILaunch launch : launches) {
- if (launch.getLaunchConfiguration().getType().getIdentifier().equals(ILaunchTypes.ATTACH) && !launch.isTerminated()) {
- IModelNode[] contexts = LaunchContextsPersistenceDelegate.getLaunchContexts(launch.getLaunchConfiguration());
- if (contexts != null && contexts.length == 1 && contexts[0].equals(context)) {
- skip = true;
- }
- }
- }
- }
-
- if (!skip) {
- config = LaunchManager.getInstance().createOrUpdateLaunchConfiguration(config, launchSpec);
-
- delegate.validate(ILaunchManager.DEBUG_MODE, config);
- DebugUITools.launch(config, ILaunchManager.DEBUG_MODE);
- }
- }
- }
- callback.done(this, Status.OK_STATUS);
- }
- catch (Exception e) {
- callback.done(this, StatusHelper.getStatus(e));
- }
- }
- else {
- callback.done(this, Status.OK_STATUS);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.services.interfaces.IDebugService#detach(java.lang.Object, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.core.runtime.IProgressMonitor, org.eclipse.tcf.te.runtime.interfaces.callback.ICallback)
- */
- @Override
- public void detach(Object context, IPropertiesContainer data, final IProgressMonitor monitor, ICallback callback) {
- Assert.isNotNull(context);
- Assert.isNotNull(data);
- Assert.isNotNull(callback);
-
- if (context instanceof IModelNode) {
- ILaunch[] launches = DebugPlugin.getDefault().getLaunchManager().getLaunches();
- for (ILaunch launch : launches) {
- try {
- if (launch.getLaunchConfiguration().getType().getIdentifier().equals(ILaunchTypes.ATTACH) && !launch.isTerminated()) {
- IModelNode[] contexts = LaunchContextsPersistenceDelegate.getLaunchContexts(launch.getLaunchConfiguration());
- if (contexts != null && contexts.length == 1 && contexts[0].equals(context)) {
- launch.terminate();
- }
- }
- } catch (Exception e) {
- callback.done(this, StatusHelper.getStatus(e));
- return;
- }
- }
- }
- callback.done(this, Status.OK_STATUS);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.services.interfaces.IDebugService#isLaunched(java.lang.Object)
- */
- @Override
- public boolean isLaunched(Object context) {
- Assert.isNotNull(context);
-
- boolean isLaunched = false;
-
- if (context instanceof IModelNode) {
- ILaunch[] launches = DebugPlugin.getDefault().getLaunchManager().getLaunches();
- for (ILaunch launch : launches) {
- try {
- if (launch.getLaunchConfiguration().getType().getIdentifier().equals(ILaunchTypes.ATTACH) && !launch.isTerminated()) {
- IModelNode[] contexts = LaunchContextsPersistenceDelegate.getLaunchContexts(launch.getLaunchConfiguration());
- if (contexts != null && contexts.length == 1 && contexts[0].equals(context)) {
- isLaunched = true;
- break;
- }
- }
- } catch (CoreException e) {
- if (Platform.inDebugMode()) e.printStackTrace();
- }
- }
- }
-
- return isLaunched;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011, 2013 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.tcf.launch.ui.internal.services;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationType;
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.debug.core.ILaunchesListener;
+import org.eclipse.debug.ui.DebugUITools;
+import org.eclipse.tcf.protocol.Protocol;
+import org.eclipse.tcf.te.launch.core.lm.LaunchManager;
+import org.eclipse.tcf.te.launch.core.lm.interfaces.ILaunchManagerDelegate;
+import org.eclipse.tcf.te.launch.core.lm.interfaces.ILaunchSpecification;
+import org.eclipse.tcf.te.launch.core.persistence.launchcontext.LaunchContextsPersistenceDelegate;
+import org.eclipse.tcf.te.launch.core.selection.LaunchSelection;
+import org.eclipse.tcf.te.launch.core.selection.RemoteSelectionContext;
+import org.eclipse.tcf.te.launch.core.selection.interfaces.ILaunchSelection;
+import org.eclipse.tcf.te.runtime.concurrent.util.ExecutorsUtil;
+import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
+import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
+import org.eclipse.tcf.te.runtime.model.interfaces.IModelNode;
+import org.eclipse.tcf.te.runtime.services.AbstractService;
+import org.eclipse.tcf.te.runtime.services.interfaces.IDebugService;
+import org.eclipse.tcf.te.runtime.utils.StatusHelper;
+import org.eclipse.tcf.te.tcf.launch.core.interfaces.ILaunchTypes;
+
+/**
+ * Debug service implementations for TCF contexts.
+ */
+public class DebugService extends AbstractService implements IDebugService {
+ // Reference to the launches listener
+ private final ILaunchesListener listener;
+
+ /**
+ * Constructor
+ */
+ public DebugService() {
+ super();
+
+ // Create and register the launches listener instance
+ listener = new DebugServicesLaunchesListener();
+ DebugPlugin.getDefault().getLaunchManager().addLaunchListener(listener);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.services.interfaces.IDebugService#attach(java.lang.Object, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.core.runtime.IProgressMonitor, org.eclipse.tcf.te.runtime.interfaces.callback.ICallback)
+ */
+ @Override
+ public void attach(final Object context, final IPropertiesContainer data, final IProgressMonitor monitor, final ICallback callback) {
+ if (!Protocol.isDispatchThread()) {
+ internalAttach(context, data, monitor, callback);
+ }
+ else {
+ ExecutorsUtil.execute(new Runnable() {
+ @Override
+ public void run() {
+ internalAttach(context, data, monitor, callback);
+ }
+ });
+ }
+ }
+
+ protected void internalAttach(final Object context, final IPropertiesContainer data, final IProgressMonitor monitor, final ICallback callback) {
+ Assert.isTrue(!Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
+
+ Assert.isNotNull(context);
+ Assert.isNotNull(data);
+ Assert.isNotNull(callback);
+
+ if (context instanceof IModelNode) {
+ ILaunchConfigurationType launchConfigType = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationType(ILaunchTypes.ATTACH);
+ try {
+ ILaunchSelection launchSelection = new LaunchSelection(ILaunchManager.DEBUG_MODE, new RemoteSelectionContext((IModelNode)context, true));
+ ILaunchManagerDelegate delegate = LaunchManager.getInstance().getLaunchManagerDelegate(launchConfigType, ILaunchManager.DEBUG_MODE);
+ if (delegate != null) {
+ // create an empty launch configuration specification to initialize all attributes with their default defaults.
+ ILaunchSpecification launchSpec = delegate.getLaunchSpecification(launchConfigType.getIdentifier(), launchSelection);
+ for (String key : data.getProperties().keySet()) {
+ launchSpec.addAttribute(key, data.getProperty(key));
+ }
+ delegate.validate(launchSpec);
+ if (launchSpec != null && launchSpec.isValid()) {
+ ILaunchConfiguration[] launchConfigs = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurations(launchConfigType);
+ launchConfigs = delegate.getMatchingLaunchConfigurations(launchSpec, launchConfigs);
+
+ ILaunchConfiguration config = launchConfigs != null && launchConfigs.length > 0 ? launchConfigs[0] : null;
+
+ boolean skip = false;
+ if (config != null) {
+
+ ILaunch[] launches = DebugPlugin.getDefault().getLaunchManager().getLaunches();
+ for (ILaunch launch : launches) {
+ if (launch.getLaunchConfiguration().getType().getIdentifier().equals(ILaunchTypes.ATTACH) && !launch.isTerminated()) {
+ IModelNode[] contexts = LaunchContextsPersistenceDelegate.getLaunchContexts(launch.getLaunchConfiguration());
+ if (contexts != null && contexts.length == 1 && contexts[0].equals(context)) {
+ skip = true;
+ }
+ }
+ }
+ }
+
+ if (!skip) {
+ config = LaunchManager.getInstance().createOrUpdateLaunchConfiguration(config, launchSpec);
+
+ delegate.validate(ILaunchManager.DEBUG_MODE, config);
+ DebugUITools.launch(config, ILaunchManager.DEBUG_MODE);
+ }
+ }
+ }
+ callback.done(this, Status.OK_STATUS);
+ }
+ catch (Exception e) {
+ callback.done(this, StatusHelper.getStatus(e));
+ }
+ }
+ else {
+ callback.done(this, Status.OK_STATUS);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.services.interfaces.IDebugService#detach(java.lang.Object, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.core.runtime.IProgressMonitor, org.eclipse.tcf.te.runtime.interfaces.callback.ICallback)
+ */
+ @Override
+ public void detach(Object context, IPropertiesContainer data, final IProgressMonitor monitor, ICallback callback) {
+ Assert.isNotNull(context);
+ Assert.isNotNull(data);
+ Assert.isNotNull(callback);
+
+ if (context instanceof IModelNode) {
+ ILaunch[] launches = DebugPlugin.getDefault().getLaunchManager().getLaunches();
+ for (ILaunch launch : launches) {
+ try {
+ if (launch.getLaunchConfiguration().getType().getIdentifier().equals(ILaunchTypes.ATTACH) && !launch.isTerminated()) {
+ IModelNode[] contexts = LaunchContextsPersistenceDelegate.getLaunchContexts(launch.getLaunchConfiguration());
+ if (contexts != null && contexts.length == 1 && contexts[0].equals(context)) {
+ launch.terminate();
+ }
+ }
+ } catch (Exception e) {
+ callback.done(this, StatusHelper.getStatus(e));
+ return;
+ }
+ }
+ }
+ callback.done(this, Status.OK_STATUS);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.services.interfaces.IDebugService#isLaunched(java.lang.Object)
+ */
+ @Override
+ public boolean isLaunched(Object context) {
+ Assert.isNotNull(context);
+
+ boolean isLaunched = false;
+
+ if (context instanceof IModelNode) {
+ ILaunch[] launches = DebugPlugin.getDefault().getLaunchManager().getLaunches();
+ for (ILaunch launch : launches) {
+ try {
+ if (launch.getLaunchConfiguration().getType().getIdentifier().equals(ILaunchTypes.ATTACH) && !launch.isTerminated()) {
+ IModelNode[] contexts = LaunchContextsPersistenceDelegate.getLaunchContexts(launch.getLaunchConfiguration());
+ if (contexts != null && contexts.length == 1 && contexts[0].equals(context)) {
+ isLaunched = true;
+ break;
+ }
+ }
+ } catch (CoreException e) {
+ if (Platform.inDebugMode()) e.printStackTrace();
+ }
+ }
+ }
+
+ return isLaunched;
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/nls/Messages.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/nls/Messages.java
index cbc3136b0..d3876d80e 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/nls/Messages.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/nls/Messages.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Wind River Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2011, 2013 Wind River Systems, Inc. and others. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/nls/Messages.properties b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/nls/Messages.properties
index 3e9abe0b1..247c2ccfc 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/nls/Messages.properties
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/nls/Messages.properties
@@ -1,5 +1,5 @@
###############################################################################
-# Copyright (c) 2012 Wind River Systems, Inc. and others. All rights reserved.
+# Copyright (c) 2012, 2013 Wind River Systems, Inc. and others. All rights reserved.
# This program and the accompanying materials are made available under the terms
# of the Eclipse Public License v1.0 which accompanies this distribution, and is
# available at http://www.eclipse.org/legal/epl-v10.html
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/LaunchConfigurationMainTabSection.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/LaunchConfigurationMainTabSection.java
index c18e12861..6211968da 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/LaunchConfigurationMainTabSection.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/LaunchConfigurationMainTabSection.java
@@ -1,287 +1,287 @@
-/*******************************************************************************
- * Copyright (c) 2012 Wind River Systems, Inc. and others. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.tcf.te.tcf.launch.ui.remote.app;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.ui.ILaunchConfigurationDialog;
-import org.eclipse.jface.dialogs.IMessageProvider;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-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.Label;
-import org.eclipse.tcf.te.launch.core.persistence.DefaultPersistenceDelegate;
-import org.eclipse.tcf.te.launch.core.persistence.launchcontext.LaunchContextsPersistenceDelegate;
-import org.eclipse.tcf.te.launch.ui.interfaces.ILaunchConfigurationTabFormPart;
-import org.eclipse.tcf.te.launch.ui.tabs.AbstractLaunchConfigurationTab;
-import org.eclipse.tcf.te.runtime.model.interfaces.IModelNode;
-import org.eclipse.tcf.te.tcf.filesystem.core.model.FSTreeNode;
-import org.eclipse.tcf.te.tcf.filesystem.ui.dialogs.FSOpenFileDialog;
-import org.eclipse.tcf.te.tcf.launch.ui.nls.Messages;
-import org.eclipse.tcf.te.tcf.processes.core.interfaces.steps.IProcessesStepAttributes;
-import org.eclipse.tcf.te.ui.controls.BaseEditBrowseTextControl;
-import org.eclipse.tcf.te.ui.forms.parts.AbstractSection;
-import org.eclipse.ui.forms.IManagedForm;
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-import org.eclipse.ui.forms.widgets.Section;
-
-/**
- * Remote application launch configuration main tab section implementation.
- */
-public class LaunchConfigurationMainTabSection extends AbstractSection implements ILaunchConfigurationTabFormPart {
-
- /* default */ BaseEditBrowseTextControl processImage;
- /* default */ BaseEditBrowseTextControl processArguments;
- private Button stopAtEntry;
- private Button stopAtMain;
- private Button attachChildren;
-
- /* default */ IModelNode firstSelection = null;
-
- /**
- * Constructor.
- *
- * @param form The parent managed form. Must not be <code>null</code>.
- * @param parent The parent composite. Must not be <code>null</code>.
- */
- public LaunchConfigurationMainTabSection(IManagedForm form, Composite parent) {
- super(form, parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
- getSection().setBackground(parent.getBackground());
- createClient(getSection(), form.getToolkit());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.forms.parts.AbstractSection#createClient(org.eclipse.ui.forms.widgets.Section, org.eclipse.ui.forms.widgets.FormToolkit)
- */
- @Override
- protected void createClient(final Section section, FormToolkit toolkit) {
- Assert.isNotNull(section);
- Assert.isNotNull(toolkit);
-
- // Configure the section
- section.setText(Messages.LaunchConfigurationMainTabSection_title);
- if (section.getParent().getLayout() instanceof GridLayout) {
- section.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL, SWT.CENTER, true, false));
- }
-
- // Create the section client
- Composite client = createClientContainer(section, 3, toolkit);
- Assert.isNotNull(client);
- section.setClient(client);
- client.setBackground(section.getBackground());
-
- // Create a toolbar for the section
- createSectionToolbar(section, toolkit);
-
- // Create the section sub controls
- processImage = new BaseEditBrowseTextControl(null) {
- @Override
- protected void onButtonControlSelected() {
- if (firstSelection != null) {
- FSOpenFileDialog dialog = new FSOpenFileDialog(section.getShell());
- dialog.setFilterPath(getEditFieldControlText());
- dialog.setInput(firstSelection);
- if (dialog.open() == Window.OK) {
- Object candidate = dialog.getFirstResult();
- if (candidate instanceof FSTreeNode) {
- String absPath = ((FSTreeNode) candidate).getLocation();
- if (absPath != null) {
- processImage.setEditFieldControlText(absPath);
- }
- }
- }
- }
- }
- @Override
- public void modifyText(ModifyEvent e) {
- super.modifyText(e);
- getManagedForm().dirtyStateChanged();
- }
- };
- processImage.setEditFieldLabel(Messages.LaunchConfigurationMainTabSection_processImage_label);
- processImage.setIsGroup(false);
- processImage.setHideBrowseButton(false);
- processImage.setAdjustBackgroundColor(true);
- processImage.setParentControlIsInnerPanel(true);
- processImage.setFormToolkit(toolkit);
- processImage.setupPanel(client);
- processImage.doCreateControlDecoration(processImage.getEditFieldControl());
-
- processArguments = new BaseEditBrowseTextControl(null) {
- @Override
- public void modifyText(ModifyEvent e) {
- super.modifyText(e);
- getManagedForm().dirtyStateChanged();
- }
- };
- processArguments.setEditFieldLabel(Messages.LaunchConfigurationMainTabSection_processArguments_label);
- processArguments.setIsGroup(false);
- processArguments.setHideBrowseButton(true);
- processArguments.setAdjustBackgroundColor(true);
- processArguments.setParentControlIsInnerPanel(true);
- processArguments.setFormToolkit(toolkit);
- processArguments.setupPanel(client);
-
- Object container = getManagedForm().getContainer();
- if (container instanceof AbstractLaunchConfigurationTab) {
- ILaunchConfigurationDialog dialog = ((AbstractLaunchConfigurationTab)container).getLaunchConfigurationDialog();
- String mode = dialog != null ? dialog.getMode() : null;
- if (ILaunchManager.DEBUG_MODE.equals(mode)) {
- // Add the debug options to the launch tab
- Label label = new Label(client, SWT.HORIZONTAL);
- GridData layoutData = new GridData(SWT.FILL, SWT.CENTER, true, false);
- layoutData.horizontalSpan = 3;
- label.setLayoutData(layoutData);
-
- stopAtEntry = new Button(client, SWT.CHECK);
- stopAtEntry.setText(Messages.LaunchConfigurationMainTabSection_stopAtEntry_label);
- layoutData = new GridData(SWT.FILL, SWT.CENTER, true, false);
- layoutData.horizontalSpan = 3;
- stopAtEntry.setLayoutData(layoutData);
- stopAtEntry.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- getManagedForm().dirtyStateChanged();
- }
- });
-
- stopAtMain = new Button(client, SWT.CHECK);
- stopAtMain.setText(Messages.LaunchConfigurationMainTabSection_stopAtMain_label);
- layoutData = new GridData(SWT.FILL, SWT.CENTER, true, false);
- layoutData.horizontalSpan = 3;
- stopAtMain.setLayoutData(layoutData);
- stopAtMain.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- getManagedForm().dirtyStateChanged();
- }
- });
-
- attachChildren = new Button(client, SWT.CHECK);
- attachChildren.setText(Messages.LaunchConfigurationMainTabSection_attachChildren_label);
- layoutData = new GridData(SWT.FILL, SWT.CENTER, true, false);
- layoutData.horizontalSpan = 3;
- attachChildren.setLayoutData(layoutData);
- attachChildren.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- getManagedForm().dirtyStateChanged();
- }
- });
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.launch.ui.interfaces.ILaunchConfigurationTabFormPart#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration)
- */
- @Override
- public void initializeFrom(ILaunchConfiguration configuration) {
- Assert.isNotNull(configuration);
-
- if (processImage != null) {
- String image = DefaultPersistenceDelegate.getAttribute(configuration, IProcessesStepAttributes.ATTR_PROCESS_IMAGE, ""); //$NON-NLS-1$
- processImage.setEditFieldControlText(image);
- }
-
- if (processArguments != null) {
- String arguments = DefaultPersistenceDelegate.getAttribute(configuration, IProcessesStepAttributes.ATTR_PROCESS_ARGUMENTS, ""); //$NON-NLS-1$
- processArguments.setEditFieldControlText(arguments);
- }
-
- if (stopAtEntry != null) {
- boolean selected = DefaultPersistenceDelegate.getAttribute(configuration, IProcessesStepAttributes.ATTR_STOP_AT_ENTRY, false);
- stopAtEntry.setSelection(selected);
- }
-
- if (stopAtMain != null) {
- boolean selected = DefaultPersistenceDelegate.getAttribute(configuration, IProcessesStepAttributes.ATTR_STOP_AT_MAIN, false);
- stopAtMain.setSelection(selected);
- }
-
- if (attachChildren != null) {
- boolean selected = DefaultPersistenceDelegate.getAttribute(configuration, IProcessesStepAttributes.ATTR_ATTACH_CHILDREN, false);
- attachChildren.setSelection(selected);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.launch.ui.interfaces.ILaunchConfigurationTabFormPart#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- */
- @Override
- public void performApply(ILaunchConfigurationWorkingCopy configuration) {
- Assert.isNotNull(configuration);
-
- if (processImage != null) {
- String image = processImage.getEditFieldControlText();
-
- if (image != null && image.trim().length() > 0) {
- DefaultPersistenceDelegate.setAttribute(configuration, IProcessesStepAttributes.ATTR_PROCESS_IMAGE, image);
- } else {
- DefaultPersistenceDelegate.setAttribute(configuration, IProcessesStepAttributes.ATTR_PROCESS_IMAGE, (String)null);
- }
- } else {
- DefaultPersistenceDelegate.setAttribute(configuration, IProcessesStepAttributes.ATTR_PROCESS_IMAGE, (String)null);
- }
-
- if (processArguments != null) {
- String arguments = processArguments.getEditFieldControlText();
-
- if (arguments != null && arguments.trim().length() > 0) {
- DefaultPersistenceDelegate.setAttribute(configuration, IProcessesStepAttributes.ATTR_PROCESS_ARGUMENTS, arguments);
- } else {
- DefaultPersistenceDelegate.setAttribute(configuration, IProcessesStepAttributes.ATTR_PROCESS_ARGUMENTS, (String)null);
- }
- } else {
- DefaultPersistenceDelegate.setAttribute(configuration, IProcessesStepAttributes.ATTR_PROCESS_ARGUMENTS, (String)null);
- }
-
- if (stopAtEntry != null) {
- DefaultPersistenceDelegate.setAttribute(configuration, IProcessesStepAttributes.ATTR_STOP_AT_ENTRY, stopAtEntry.getSelection());
- }
-
- if (stopAtMain != null) {
- DefaultPersistenceDelegate.setAttribute(configuration, IProcessesStepAttributes.ATTR_STOP_AT_MAIN, stopAtMain.getSelection());
- }
-
- if (attachChildren != null) {
- DefaultPersistenceDelegate.setAttribute(configuration, IProcessesStepAttributes.ATTR_ATTACH_CHILDREN, attachChildren.getSelection());
- }
- }
-
- @Override
- public boolean isValid(ILaunchConfiguration configuration) {
- firstSelection = null;
- IModelNode[] contexts = LaunchContextsPersistenceDelegate.getLaunchContexts(configuration);
- if (contexts != null && contexts.length > 0) {
- firstSelection = contexts[0];
- }
- processImage.getButtonControl().setEnabled(firstSelection != null);
-
- if (processImage.getEditFieldControlText().trim().length() > 0) {
- setMessage(null, IMessageProvider.NONE);
- }
- else {
- setMessage(Messages.LaunchConfigurationMainTabSection_error_missingProcessImage, IMessageProvider.ERROR);
- }
- processImage.updateControlDecoration(getMessage(), getMessageType());
-
- return processImage.getEditFieldControlText().trim().length() > 0;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2012, 2013 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.tcf.launch.ui.remote.app;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.debug.ui.ILaunchConfigurationDialog;
+import org.eclipse.jface.dialogs.IMessageProvider;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+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.Label;
+import org.eclipse.tcf.te.launch.core.persistence.DefaultPersistenceDelegate;
+import org.eclipse.tcf.te.launch.core.persistence.launchcontext.LaunchContextsPersistenceDelegate;
+import org.eclipse.tcf.te.launch.ui.interfaces.ILaunchConfigurationTabFormPart;
+import org.eclipse.tcf.te.launch.ui.tabs.AbstractLaunchConfigurationTab;
+import org.eclipse.tcf.te.runtime.model.interfaces.IModelNode;
+import org.eclipse.tcf.te.tcf.filesystem.core.model.FSTreeNode;
+import org.eclipse.tcf.te.tcf.filesystem.ui.dialogs.FSOpenFileDialog;
+import org.eclipse.tcf.te.tcf.launch.ui.nls.Messages;
+import org.eclipse.tcf.te.tcf.processes.core.interfaces.steps.IProcessesStepAttributes;
+import org.eclipse.tcf.te.ui.controls.BaseEditBrowseTextControl;
+import org.eclipse.tcf.te.ui.forms.parts.AbstractSection;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.Section;
+
+/**
+ * Remote application launch configuration main tab section implementation.
+ */
+public class LaunchConfigurationMainTabSection extends AbstractSection implements ILaunchConfigurationTabFormPart {
+
+ /* default */ BaseEditBrowseTextControl processImage;
+ /* default */ BaseEditBrowseTextControl processArguments;
+ private Button stopAtEntry;
+ private Button stopAtMain;
+ private Button attachChildren;
+
+ /* default */ IModelNode firstSelection = null;
+
+ /**
+ * Constructor.
+ *
+ * @param form The parent managed form. Must not be <code>null</code>.
+ * @param parent The parent composite. Must not be <code>null</code>.
+ */
+ public LaunchConfigurationMainTabSection(IManagedForm form, Composite parent) {
+ super(form, parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+ getSection().setBackground(parent.getBackground());
+ createClient(getSection(), form.getToolkit());
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.forms.parts.AbstractSection#createClient(org.eclipse.ui.forms.widgets.Section, org.eclipse.ui.forms.widgets.FormToolkit)
+ */
+ @Override
+ protected void createClient(final Section section, FormToolkit toolkit) {
+ Assert.isNotNull(section);
+ Assert.isNotNull(toolkit);
+
+ // Configure the section
+ section.setText(Messages.LaunchConfigurationMainTabSection_title);
+ if (section.getParent().getLayout() instanceof GridLayout) {
+ section.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL, SWT.CENTER, true, false));
+ }
+
+ // Create the section client
+ Composite client = createClientContainer(section, 3, toolkit);
+ Assert.isNotNull(client);
+ section.setClient(client);
+ client.setBackground(section.getBackground());
+
+ // Create a toolbar for the section
+ createSectionToolbar(section, toolkit);
+
+ // Create the section sub controls
+ processImage = new BaseEditBrowseTextControl(null) {
+ @Override
+ protected void onButtonControlSelected() {
+ if (firstSelection != null) {
+ FSOpenFileDialog dialog = new FSOpenFileDialog(section.getShell());
+ dialog.setFilterPath(getEditFieldControlText());
+ dialog.setInput(firstSelection);
+ if (dialog.open() == Window.OK) {
+ Object candidate = dialog.getFirstResult();
+ if (candidate instanceof FSTreeNode) {
+ String absPath = ((FSTreeNode) candidate).getLocation();
+ if (absPath != null) {
+ processImage.setEditFieldControlText(absPath);
+ }
+ }
+ }
+ }
+ }
+ @Override
+ public void modifyText(ModifyEvent e) {
+ super.modifyText(e);
+ getManagedForm().dirtyStateChanged();
+ }
+ };
+ processImage.setEditFieldLabel(Messages.LaunchConfigurationMainTabSection_processImage_label);
+ processImage.setIsGroup(false);
+ processImage.setHideBrowseButton(false);
+ processImage.setAdjustBackgroundColor(true);
+ processImage.setParentControlIsInnerPanel(true);
+ processImage.setFormToolkit(toolkit);
+ processImage.setupPanel(client);
+ processImage.doCreateControlDecoration(processImage.getEditFieldControl());
+
+ processArguments = new BaseEditBrowseTextControl(null) {
+ @Override
+ public void modifyText(ModifyEvent e) {
+ super.modifyText(e);
+ getManagedForm().dirtyStateChanged();
+ }
+ };
+ processArguments.setEditFieldLabel(Messages.LaunchConfigurationMainTabSection_processArguments_label);
+ processArguments.setIsGroup(false);
+ processArguments.setHideBrowseButton(true);
+ processArguments.setAdjustBackgroundColor(true);
+ processArguments.setParentControlIsInnerPanel(true);
+ processArguments.setFormToolkit(toolkit);
+ processArguments.setupPanel(client);
+
+ Object container = getManagedForm().getContainer();
+ if (container instanceof AbstractLaunchConfigurationTab) {
+ ILaunchConfigurationDialog dialog = ((AbstractLaunchConfigurationTab)container).getLaunchConfigurationDialog();
+ String mode = dialog != null ? dialog.getMode() : null;
+ if (ILaunchManager.DEBUG_MODE.equals(mode)) {
+ // Add the debug options to the launch tab
+ Label label = new Label(client, SWT.HORIZONTAL);
+ GridData layoutData = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ layoutData.horizontalSpan = 3;
+ label.setLayoutData(layoutData);
+
+ stopAtEntry = new Button(client, SWT.CHECK);
+ stopAtEntry.setText(Messages.LaunchConfigurationMainTabSection_stopAtEntry_label);
+ layoutData = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ layoutData.horizontalSpan = 3;
+ stopAtEntry.setLayoutData(layoutData);
+ stopAtEntry.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ getManagedForm().dirtyStateChanged();
+ }
+ });
+
+ stopAtMain = new Button(client, SWT.CHECK);
+ stopAtMain.setText(Messages.LaunchConfigurationMainTabSection_stopAtMain_label);
+ layoutData = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ layoutData.horizontalSpan = 3;
+ stopAtMain.setLayoutData(layoutData);
+ stopAtMain.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ getManagedForm().dirtyStateChanged();
+ }
+ });
+
+ attachChildren = new Button(client, SWT.CHECK);
+ attachChildren.setText(Messages.LaunchConfigurationMainTabSection_attachChildren_label);
+ layoutData = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ layoutData.horizontalSpan = 3;
+ attachChildren.setLayoutData(layoutData);
+ attachChildren.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ getManagedForm().dirtyStateChanged();
+ }
+ });
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.launch.ui.interfaces.ILaunchConfigurationTabFormPart#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration)
+ */
+ @Override
+ public void initializeFrom(ILaunchConfiguration configuration) {
+ Assert.isNotNull(configuration);
+
+ if (processImage != null) {
+ String image = DefaultPersistenceDelegate.getAttribute(configuration, IProcessesStepAttributes.ATTR_PROCESS_IMAGE, ""); //$NON-NLS-1$
+ processImage.setEditFieldControlText(image);
+ }
+
+ if (processArguments != null) {
+ String arguments = DefaultPersistenceDelegate.getAttribute(configuration, IProcessesStepAttributes.ATTR_PROCESS_ARGUMENTS, ""); //$NON-NLS-1$
+ processArguments.setEditFieldControlText(arguments);
+ }
+
+ if (stopAtEntry != null) {
+ boolean selected = DefaultPersistenceDelegate.getAttribute(configuration, IProcessesStepAttributes.ATTR_STOP_AT_ENTRY, false);
+ stopAtEntry.setSelection(selected);
+ }
+
+ if (stopAtMain != null) {
+ boolean selected = DefaultPersistenceDelegate.getAttribute(configuration, IProcessesStepAttributes.ATTR_STOP_AT_MAIN, false);
+ stopAtMain.setSelection(selected);
+ }
+
+ if (attachChildren != null) {
+ boolean selected = DefaultPersistenceDelegate.getAttribute(configuration, IProcessesStepAttributes.ATTR_ATTACH_CHILDREN, false);
+ attachChildren.setSelection(selected);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.launch.ui.interfaces.ILaunchConfigurationTabFormPart#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
+ */
+ @Override
+ public void performApply(ILaunchConfigurationWorkingCopy configuration) {
+ Assert.isNotNull(configuration);
+
+ if (processImage != null) {
+ String image = processImage.getEditFieldControlText();
+
+ if (image != null && image.trim().length() > 0) {
+ DefaultPersistenceDelegate.setAttribute(configuration, IProcessesStepAttributes.ATTR_PROCESS_IMAGE, image);
+ } else {
+ DefaultPersistenceDelegate.setAttribute(configuration, IProcessesStepAttributes.ATTR_PROCESS_IMAGE, (String)null);
+ }
+ } else {
+ DefaultPersistenceDelegate.setAttribute(configuration, IProcessesStepAttributes.ATTR_PROCESS_IMAGE, (String)null);
+ }
+
+ if (processArguments != null) {
+ String arguments = processArguments.getEditFieldControlText();
+
+ if (arguments != null && arguments.trim().length() > 0) {
+ DefaultPersistenceDelegate.setAttribute(configuration, IProcessesStepAttributes.ATTR_PROCESS_ARGUMENTS, arguments);
+ } else {
+ DefaultPersistenceDelegate.setAttribute(configuration, IProcessesStepAttributes.ATTR_PROCESS_ARGUMENTS, (String)null);
+ }
+ } else {
+ DefaultPersistenceDelegate.setAttribute(configuration, IProcessesStepAttributes.ATTR_PROCESS_ARGUMENTS, (String)null);
+ }
+
+ if (stopAtEntry != null) {
+ DefaultPersistenceDelegate.setAttribute(configuration, IProcessesStepAttributes.ATTR_STOP_AT_ENTRY, stopAtEntry.getSelection());
+ }
+
+ if (stopAtMain != null) {
+ DefaultPersistenceDelegate.setAttribute(configuration, IProcessesStepAttributes.ATTR_STOP_AT_MAIN, stopAtMain.getSelection());
+ }
+
+ if (attachChildren != null) {
+ DefaultPersistenceDelegate.setAttribute(configuration, IProcessesStepAttributes.ATTR_ATTACH_CHILDREN, attachChildren.getSelection());
+ }
+ }
+
+ @Override
+ public boolean isValid(ILaunchConfiguration configuration) {
+ firstSelection = null;
+ IModelNode[] contexts = LaunchContextsPersistenceDelegate.getLaunchContexts(configuration);
+ if (contexts != null && contexts.length > 0) {
+ firstSelection = contexts[0];
+ }
+ processImage.getButtonControl().setEnabled(firstSelection != null);
+
+ if (processImage.getEditFieldControlText().trim().length() > 0) {
+ setMessage(null, IMessageProvider.NONE);
+ }
+ else {
+ setMessage(Messages.LaunchConfigurationMainTabSection_error_missingProcessImage, IMessageProvider.ERROR);
+ }
+ processImage.updateControlDecoration(getMessage(), getMessageType());
+
+ return processImage.getEditFieldControlText().trim().length() > 0;
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/RemoteAppPropertiesSection.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/RemoteAppPropertiesSection.java
index 324faca53..64d464580 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/RemoteAppPropertiesSection.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/remote/app/RemoteAppPropertiesSection.java
@@ -1,82 +1,82 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Wind River Systems, Inc. and others. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.tcf.te.tcf.launch.ui.remote.app;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.tcf.te.launch.core.persistence.DefaultPersistenceDelegate;
-import org.eclipse.tcf.te.launch.ui.model.LaunchNode;
-import org.eclipse.tcf.te.launch.ui.properties.BaseTitledSection;
-import org.eclipse.tcf.te.tcf.launch.ui.nls.Messages;
-import org.eclipse.tcf.te.tcf.processes.core.interfaces.steps.IProcessesStepAttributes;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
-
-/**
- * The property section to display the properties of a launch configuration.
- */
-public class RemoteAppPropertiesSection extends BaseTitledSection {
- private String processImageValue = ""; //$NON-NLS-1$
- private String processArgsValue = ""; //$NON-NLS-1$
-
-
- private Text processImage;
- private Text processArgs;
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.views.properties.tabbed.AbstractPropertySection#createControls(org.eclipse.swt.widgets.Composite, org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage)
- */
- @Override
- public void createControls(Composite parent, TabbedPropertySheetPage aTabbedPropertySheetPage) {
- super.createControls(parent, aTabbedPropertySheetPage);
-
- processImage = createTextField(null, Messages.LaunchConfigurationMainTabSection_processImage_label);
- processArgs = createTextField(processImage, Messages.LaunchConfigurationMainTabSection_processArguments_label);
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.views.properties.tabbed.AbstractPropertySection#setInput(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
- */
- @Override
- public void setInput(IWorkbenchPart part, ISelection selection) {
- super.setInput(part, selection);
- Assert.isTrue(selection instanceof IStructuredSelection);
- Object input = ((IStructuredSelection) selection).getFirstElement();
- Assert.isTrue(input instanceof LaunchNode);
- ILaunchConfiguration node = ((LaunchNode)input).getLaunchConfiguration();
- processImageValue = DefaultPersistenceDelegate.getAttribute(node, IProcessesStepAttributes.ATTR_PROCESS_IMAGE, ""); //$NON-NLS-1$
- processArgsValue = DefaultPersistenceDelegate.getAttribute(node, IProcessesStepAttributes.ATTR_PROCESS_ARGUMENTS, ""); //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.views.properties.tabbed.AbstractPropertySection#refresh()
- */
- @Override
- public void refresh() {
- if (processImage != null) processImage.setText(new Path(processImageValue).toPortableString());
- if (processArgs != null) processArgs.setText(processArgsValue);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.views.tabbed.BaseTitledSection#getText()
- */
- @Override
- protected String getText() {
- return Messages.LaunchConfigurationMainTabSection_title;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011, 2013 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.tcf.launch.ui.remote.app;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.tcf.te.launch.core.persistence.DefaultPersistenceDelegate;
+import org.eclipse.tcf.te.launch.ui.model.LaunchNode;
+import org.eclipse.tcf.te.launch.ui.properties.BaseTitledSection;
+import org.eclipse.tcf.te.tcf.launch.ui.nls.Messages;
+import org.eclipse.tcf.te.tcf.processes.core.interfaces.steps.IProcessesStepAttributes;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
+
+/**
+ * The property section to display the properties of a launch configuration.
+ */
+public class RemoteAppPropertiesSection extends BaseTitledSection {
+ private String processImageValue = ""; //$NON-NLS-1$
+ private String processArgsValue = ""; //$NON-NLS-1$
+
+
+ private Text processImage;
+ private Text processArgs;
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.views.properties.tabbed.AbstractPropertySection#createControls(org.eclipse.swt.widgets.Composite, org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage)
+ */
+ @Override
+ public void createControls(Composite parent, TabbedPropertySheetPage aTabbedPropertySheetPage) {
+ super.createControls(parent, aTabbedPropertySheetPage);
+
+ processImage = createTextField(null, Messages.LaunchConfigurationMainTabSection_processImage_label);
+ processArgs = createTextField(processImage, Messages.LaunchConfigurationMainTabSection_processArguments_label);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.views.properties.tabbed.AbstractPropertySection#setInput(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
+ */
+ @Override
+ public void setInput(IWorkbenchPart part, ISelection selection) {
+ super.setInput(part, selection);
+ Assert.isTrue(selection instanceof IStructuredSelection);
+ Object input = ((IStructuredSelection) selection).getFirstElement();
+ Assert.isTrue(input instanceof LaunchNode);
+ ILaunchConfiguration node = ((LaunchNode)input).getLaunchConfiguration();
+ processImageValue = DefaultPersistenceDelegate.getAttribute(node, IProcessesStepAttributes.ATTR_PROCESS_IMAGE, ""); //$NON-NLS-1$
+ processArgsValue = DefaultPersistenceDelegate.getAttribute(node, IProcessesStepAttributes.ATTR_PROCESS_ARGUMENTS, ""); //$NON-NLS-1$
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.views.properties.tabbed.AbstractPropertySection#refresh()
+ */
+ @Override
+ public void refresh() {
+ if (processImage != null) processImage.setText(new Path(processImageValue).toPortableString());
+ if (processArgs != null) processArgs.setText(processArgsValue);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.views.tabbed.BaseTitledSection#getText()
+ */
+ @Override
+ protected String getText() {
+ return Messages.LaunchConfigurationMainTabSection_title;
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/plugin.properties b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/plugin.properties
index 9c02dfa24..6d883ec0a 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/plugin.properties
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/plugin.properties
@@ -1,22 +1,22 @@
-##################################################################################
-# Copyright (c) 2011, 2012 Wind River Systems, Inc. and others. All rights reserved.
-# This program and the accompanying materials are made available under the terms
-# of the Eclipse Public License v1.0 which accompanies this distribution, and is
-# available at http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Wind River Systems - initial API and implementation
-##################################################################################
-
-pluginName = Target Explorer, TCF Locator Extensions
-providerName = Eclipse.org - Target Explorer
-
-# ***** Steps *****
-
-CheckServiceStep.name=Check TCF Service
-StartSimulatorStep.name=Start Simulator
-StopSimulatorStep.name=Stop Simulator
-StartDebuggerStep.name=Start Debugger
-StopDebuggerStep.name=Stop Debugger
-SetWaitForReadyStep.name=Set peer waiting state
+##################################################################################
+# Copyright (c) 2011, 2013 Wind River Systems, Inc. and others. All rights reserved.
+# This program and the accompanying materials are made available under the terms
+# of the Eclipse Public License v1.0 which accompanies this distribution, and is
+# available at http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Wind River Systems - initial API and implementation
+##################################################################################
+
+pluginName = Target Explorer, TCF Locator Extensions
+providerName = Eclipse.org - Target Explorer
+
+# ***** Steps *****
+
+CheckServiceStep.name=Check TCF Service
+StartSimulatorStep.name=Start Simulator
+StopSimulatorStep.name=Stop Simulator
+StartDebuggerStep.name=Start Debugger
+StopDebuggerStep.name=Stop Debugger
+SetWaitForReadyStep.name=Set peer waiting state
WaitForReadyStep.name=Wait until peer becomes ready \ No newline at end of file
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/Scanner.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/Scanner.java
index dca88b108..e56e05a01 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/Scanner.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/Scanner.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Wind River Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2011, 2013 Wind River Systems, Inc. and others. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/IModelListener.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/IModelListener.java
index 086f1fb87..c592f5362 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/IModelListener.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/IModelListener.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011 Wind River Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2011, 2012 Wind River Systems, Inc. and others. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/IScanner.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/IScanner.java
index 726f6eb09..ef9e79012 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/IScanner.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/IScanner.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011 Wind River Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2011, 2013 Wind River Systems, Inc. and others. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/ITracing.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/ITracing.java
index dc91db0e0..b131fbb3b 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/ITracing.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/ITracing.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011 Wind River Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2011, 2013 Wind River Systems, Inc. and others. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/nodes/ILocatorModel.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/nodes/ILocatorModel.java
index cf5933e27..7c89b9d54 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/nodes/ILocatorModel.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/nodes/ILocatorModel.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011 Wind River Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2011, 2012 Wind River Systems, Inc. and others. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/nodes/IPeerModelProperties.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/nodes/IPeerModelProperties.java
index 47553b679..0a811c602 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/nodes/IPeerModelProperties.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/nodes/IPeerModelProperties.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Wind River Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2011, 2013 Wind River Systems, Inc. and others. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/services/ILocatorModelLookupService.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/services/ILocatorModelLookupService.java
index e03e04fa2..5331a97c7 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/services/ILocatorModelLookupService.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/services/ILocatorModelLookupService.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Wind River Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2011, 2013 Wind River Systems, Inc. and others. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/LocatorModelPropertyTester.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/LocatorModelPropertyTester.java
index 5382e0248..23ce5394f 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/LocatorModelPropertyTester.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/LocatorModelPropertyTester.java
@@ -1,237 +1,237 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Wind River Systems, Inc. and others. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.tcf.te.tcf.locator.internal;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import org.eclipse.core.expressions.PropertyTester;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.tcf.protocol.IPeer;
-import org.eclipse.tcf.protocol.Protocol;
-import org.eclipse.tcf.te.tcf.locator.activator.CoreBundleActivator;
-import org.eclipse.tcf.te.tcf.locator.interfaces.ITracing;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.ILocatorModel;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModelProperties;
-import org.ecl